forked from science-ation/science-ation
Fixes to maek signature page work
This commit is contained in:
parent
e7fac7406f
commit
86ab58acac
10
api.php
10
api.php
@ -1194,6 +1194,16 @@ switch($request[0]) {
|
|||||||
$c=ob_get_contents();
|
$c=ob_get_contents();
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
$b64=base64_encode($c);
|
$b64=base64_encode($c);
|
||||||
|
|
||||||
|
$fptmp=fopen("tmp.pdf","w");
|
||||||
|
fwrite($fptmp,$c);
|
||||||
|
fclose($fptmp);
|
||||||
|
/*
|
||||||
|
$fptmp=fopen("tmp.b64","w");
|
||||||
|
fwrite($fptmp,$b64);
|
||||||
|
fclose($fptmp);
|
||||||
|
*/
|
||||||
|
|
||||||
$ret['status']="ok";
|
$ret['status']="ok";
|
||||||
$ret['pdf']=$b64;
|
$ret['pdf']=$b64;
|
||||||
break;
|
break;
|
||||||
|
@ -38,8 +38,7 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
$q=mysql_query("SELECT * FROM pagetext WHERE conferences_id='-1' ORDER BY textname");
|
$q=mysql_query("SELECT * FROM pagetext WHERE conferences_id='-1' ORDER BY textname");
|
||||||
while($r=mysql_fetch_object($q))
|
while($r=mysql_fetch_object($q)) {
|
||||||
{
|
|
||||||
foreach($config['languages'] AS $lang=>$langname) {
|
foreach($config['languages'] AS $lang=>$langname) {
|
||||||
mysql_query("INSERT INTO pagetext (textname,textdescription,text,conferences_id,lang) VALUES (
|
mysql_query("INSERT INTO pagetext (textname,textdescription,text,conferences_id,lang) VALUES (
|
||||||
'".mysql_escape_string($r->textname)."',
|
'".mysql_escape_string($r->textname)."',
|
||||||
@ -47,6 +46,7 @@
|
|||||||
'".mysql_escape_string($r->text)."',
|
'".mysql_escape_string($r->text)."',
|
||||||
'".$conference['id']."',
|
'".$conference['id']."',
|
||||||
'".mysql_escape_string($lang)."')");
|
'".mysql_escape_string($lang)."')");
|
||||||
|
echo mysql_error();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,21 +34,29 @@
|
|||||||
//they must be a participant
|
//they must be a participant
|
||||||
user_auth_required('participant');
|
user_auth_required('participant');
|
||||||
$u=user_load($_SESSION['users_id']);
|
$u=user_load($_SESSION['users_id']);
|
||||||
|
/*
|
||||||
|
echo "User: ";
|
||||||
|
print_r($u);
|
||||||
|
*/
|
||||||
|
|
||||||
$q=mysql_query("SELECT registrations.id AS regid,
|
$qstr="SELECT registrations.id AS regid,
|
||||||
registrations.num AS regnum
|
registrations.num AS regnum
|
||||||
FROM registrations
|
FROM registrations
|
||||||
WHERE
|
WHERE
|
||||||
registrations.id='{$u['registration_id']}'
|
registrations.id='{$u['registrations_id']}'
|
||||||
AND registrations.conferences_id={$conference['id']}");
|
AND registrations.conferences_id={$conference['id']}";
|
||||||
|
// echo "query=[$qstr]";
|
||||||
|
$q=mysql_query($qstr);
|
||||||
|
/*
|
||||||
echo mysql_error();
|
echo mysql_error();
|
||||||
|
echo "Checkign Auth\n";
|
||||||
|
*/
|
||||||
if(mysql_num_rows($q)==0) {
|
if(mysql_num_rows($q)==0) {
|
||||||
header("Location: register_participants.php");
|
header("Location: register_participants.php");
|
||||||
|
echo "Authentication Failed!";
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// echo "Auth OK\n";
|
||||||
$authinfo=mysql_fetch_object($q);
|
$authinfo=mysql_fetch_object($q);
|
||||||
$registration_number=$authinfo->regnum;
|
$registration_number=$authinfo->regnum;
|
||||||
$registration_id=$authinfo->regid;
|
$registration_id=$authinfo->regid;
|
||||||
@ -89,16 +97,21 @@ $pdf->AddPage();
|
|||||||
");
|
");
|
||||||
$projectinfo=mysql_fetch_object($q);
|
$projectinfo=mysql_fetch_object($q);
|
||||||
|
|
||||||
$q=mysql_query("SELECT firstname, lastname, grade, schools_id
|
$qstr="SELECT firstname, lastname, grade, schools_id
|
||||||
FROM users
|
FROM users
|
||||||
JOIN user_roles ON users.id=user_roles.id
|
JOIN user_roles ON users.id=user_roles.users_id
|
||||||
JOIN roles ON user_roles.roles_id=roles.id
|
JOIN roles ON user_roles.roles_id=roles.id
|
||||||
WHERE registrations_id='".$registration_id."'
|
WHERE registrations_id='".$registration_id."'
|
||||||
AND conferences_id='".$conference['id']."'
|
AND conferences_id='".$conference['id']."'
|
||||||
AND roles.type='participant'");
|
AND roles.type='participant'";
|
||||||
|
// echo "qstr=[$qstr]";
|
||||||
|
$q=mysql_query($qstr);
|
||||||
|
echo mysql_error();
|
||||||
|
|
||||||
while($si=mysql_fetch_object($q))
|
$studentinfoarray=array();
|
||||||
|
while($si=mysql_fetch_object($q)) {
|
||||||
$studentinfoarray[]=$si;
|
$studentinfoarray[]=$si;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$plural = (count($studentinfoarray)>1) ? 's' : '';
|
$plural = (count($studentinfoarray)>1) ? 's' : '';
|
||||||
@ -211,7 +224,6 @@ function sig($pdf, $text)
|
|||||||
$pdf->WriteHTML("<h3>".i18n('Additional Information')."</h3>$t");
|
$pdf->WriteHTML("<h3>".i18n('Additional Information')."</h3>$t");
|
||||||
$pdf->WriteHTML("<br><hr>");
|
$pdf->WriteHTML("<br><hr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($PDFDEST))
|
if(isset($PDFDEST))
|
||||||
echo $pdf->output('',$PDFDEST);
|
echo $pdf->output('',$PDFDEST);
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user