Fixes to maek signature page work

This commit is contained in:
james 2011-03-02 16:50:28 +00:00
parent e7fac7406f
commit 86ab58acac
3 changed files with 35 additions and 13 deletions

10
api.php
View File

@ -1194,6 +1194,16 @@ switch($request[0]) {
$c=ob_get_contents();
ob_end_clean();
$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['pdf']=$b64;
break;

View File

@ -38,8 +38,7 @@
);
$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) {
mysql_query("INSERT INTO pagetext (textname,textdescription,text,conferences_id,lang) VALUES (
'".mysql_escape_string($r->textname)."',
@ -47,6 +46,7 @@
'".mysql_escape_string($r->text)."',
'".$conference['id']."',
'".mysql_escape_string($lang)."')");
echo mysql_error();
}
}

View File

@ -34,21 +34,29 @@
//they must be a participant
user_auth_required('participant');
$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
FROM registrations
WHERE
registrations.id='{$u['registration_id']}'
AND registrations.conferences_id={$conference['id']}");
registrations.id='{$u['registrations_id']}'
AND registrations.conferences_id={$conference['id']}";
// echo "query=[$qstr]";
$q=mysql_query($qstr);
/*
echo mysql_error();
echo "Checkign Auth\n";
*/
if(mysql_num_rows($q)==0) {
header("Location: register_participants.php");
echo "Authentication Failed!";
exit;
}
// echo "Auth OK\n";
$authinfo=mysql_fetch_object($q);
$registration_number=$authinfo->regnum;
$registration_id=$authinfo->regid;
@ -89,16 +97,21 @@ $pdf->AddPage();
");
$projectinfo=mysql_fetch_object($q);
$q=mysql_query("SELECT firstname, lastname, grade, schools_id
$qstr="SELECT firstname, lastname, grade, schools_id
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
WHERE registrations_id='".$registration_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;
}
}
$plural = (count($studentinfoarray)>1) ? 's' : '';
@ -211,7 +224,6 @@ function sig($pdf, $text)
$pdf->WriteHTML("<h3>".i18n('Additional Information')."</h3>$t");
$pdf->WriteHTML("<br><hr>");
}
if(isset($PDFDEST))
echo $pdf->output('',$PDFDEST);
else