forked from science-ation/science-ation
Undo the last patch
This commit is contained in:
parent
ebb323dcb9
commit
bd8ce272b1
@ -51,12 +51,5 @@
|
||||
"SELECT DISTINCT(teacheremail) AS email, teachername AS firstname FROM students WHERE year='".($config['FAIRYEAR']-1)."' AND teacheremail!=''"),
|
||||
"school_teachers_allyears"=>array("name"=>"Teachers (as entered by students) all years","query"=>
|
||||
"SELECT DISTINCT(teacheremail) AS email, teachername AS firstname FROM students WHERE teacheremail!=''"),
|
||||
/* Volunteers */
|
||||
"volunteers_active_complete_thisyear"=>array("name"=>"Volunteers active for this year and complete", "query"=>
|
||||
"SELECT id, firstname, lastname, email FROM users WHERE users.year='{$config['FAIRYEAR']}' AND users.complete='yes' AND users.types LIKE '%volunteer%' ORDER BY email"),
|
||||
|
||||
"volunteers_active_incomplete_thisyear"=>array("name"=>"Volunteers active for this year but not complete", "query"=>
|
||||
"SELECT id, firstname, lastname, email FROM users WHERE users.year='{$config['FAIRYEAR']}' AND users.complete='yes' AND users.types LIKE '%volunteer%' ORDER BY email"),
|
||||
|
||||
);
|
||||
?>
|
||||
|
@ -162,12 +162,12 @@ function judges_cost_function($annealer, $bucket_id, $ids)
|
||||
if($j['available_for_divisional2'] == true) $have_div2 = true;
|
||||
}
|
||||
/* Huge penalty for a team without a willing chair, but only if the min judges per team >1 */
|
||||
// if(!$have_chair && $config['min_judges_per_team']>1)
|
||||
// $cost += 40;
|
||||
if(!$have_chair && $config['min_judges_per_team']>1)
|
||||
$cost += 40;
|
||||
|
||||
/* Huge penalty for not having a round2 person on the team */
|
||||
if($have_div2 == false)
|
||||
$cost += 100;
|
||||
$cost += 40;
|
||||
|
||||
// TRACE("Team $bucket_id, cost is $cost\n");
|
||||
|
||||
|
@ -62,15 +62,14 @@ if($config['judge_scheduler_percent']=="-1")
|
||||
echo "<td> - <a href=\"judges_timeslots.php\">".i18n("Timeslot Manager")."</a>";
|
||||
echo "</td></tr></table>";
|
||||
|
||||
echo happy(i18n("Timeslots are OK, I configured them ---DG."));
|
||||
/* $timeslots = judges_scheduler_check_timeslots();
|
||||
$timeslots = judges_scheduler_check_timeslots();
|
||||
if($timeslots > 0) {
|
||||
echo happy(i18n("There are %1 timeslot(s) defined for divisional judging, good", array($timeslots)));
|
||||
} else {
|
||||
echo error(i18n("There are no timeslots defined for divisional judging"));
|
||||
$ok = 0;
|
||||
}
|
||||
*/
|
||||
|
||||
echo "<table class='headertable'><tr><td><h3>Awards</h3></td>";
|
||||
echo "<td> - <a href=\"awards.php\">".i18n("Awards Manager")."</a>";
|
||||
echo "</td></tr></table>";
|
||||
|
@ -220,10 +220,8 @@ echo mysql_Error();
|
||||
WHERE registrations_id='$reg_id' AND year='{$config['FAIRYEAR']}'");
|
||||
echo happy(i18n("Assigned Project Number: %1",array($projectnumber)));
|
||||
}
|
||||
else{
|
||||
else
|
||||
$projectnumber=$projectnum;
|
||||
echo happy(i18n("Using Existing Project Number: %1",array($projectnumber)));
|
||||
}
|
||||
|
||||
//get all students with this registration number
|
||||
$recipients=getEmailRecipientsForRegistration($reg_id);
|
||||
@ -248,7 +246,7 @@ echo mysql_Error();
|
||||
"PROJECTNUMBER"=>$projectnumber,
|
||||
"FAIRNAME"=>$config['fairname']
|
||||
);
|
||||
// email_send("register_participants_received",$to,$subsub,$subbod);
|
||||
email_send("register_participants_received",$to,$subsub,$subbod);
|
||||
}
|
||||
|
||||
echo happy(i18n("Registration of form %1 successfully completed",array($regnum)));
|
||||
@ -274,7 +272,7 @@ echo mysql_Error();
|
||||
"FAIRNAME"=>$config['fairname']
|
||||
);
|
||||
|
||||
// email_send("register_participants_paymentpending",$to,$subsub,$subbod);
|
||||
email_send("register_participants_paymentpending",$to,$subsub,$subbod);
|
||||
}
|
||||
echo happy(i18n("Registration of form %1 marked as payment pending",array($regnum)));
|
||||
}
|
||||
|
@ -665,10 +665,6 @@ foreach($report_stock as $n=>$v) {
|
||||
}
|
||||
$t = $filter_ops[$d['x']];
|
||||
$filter[] = "{$fields[$f]['table']} $t '{$d['value']}'";
|
||||
if(is_array($fields[$f]['components'])) {
|
||||
$components = array_merge($components,
|
||||
$fields[$f]['components']);
|
||||
}
|
||||
}
|
||||
$sel = implode(",", $sel);
|
||||
$order = implode(",", $order);
|
||||
|
@ -19,7 +19,6 @@
|
||||
else $show_unawarded_prizes="no";
|
||||
|
||||
$show_pronunciation= ($_GET['show_pronunciation'] == 'on') ? TRUE : FALSE;
|
||||
$use_total_order = ($_GET['use_total_order'] == 'on') ? TRUE : FALSE;
|
||||
|
||||
if(is_array($_GET['show_category'])) {
|
||||
$show_category = array();
|
||||
@ -49,13 +48,6 @@
|
||||
{
|
||||
$rep=new lcsv(i18n("Awards Ceremony Script"));
|
||||
}
|
||||
|
||||
if($show_unawarded_awards!="no") {
|
||||
$and_categories .= " OR projects.projectcategories_id IS NULL";
|
||||
}
|
||||
|
||||
$order = ($use_total_order == TRUE) ? 'GLOBAL_ORDER' : ' awards_order,award_prizes.order';
|
||||
|
||||
$q=mysql_query("SELECT
|
||||
award_awards.id,
|
||||
award_awards.name,
|
||||
@ -63,48 +55,67 @@
|
||||
award_awards.description,
|
||||
award_awards.order AS awards_order,
|
||||
award_types.type,
|
||||
sponsors.organization,
|
||||
award_prizes.prize,
|
||||
award_prizes.number,
|
||||
award_prizes.id AS PRIZE_ID,
|
||||
award_prizes.cash,
|
||||
award_prizes.scholarship,
|
||||
winners.projects_id,
|
||||
projects.projectnumber,
|
||||
projects.title,
|
||||
projects.projectcategories_id,
|
||||
projects.registrations_id AS reg_id,
|
||||
award_awards.order + award_prizes.order AS GLOBAL_ORDER
|
||||
sponsors.organization
|
||||
FROM
|
||||
award_awards
|
||||
LEFT JOIN award_types ON award_awards.award_types_id=award_types.id
|
||||
LEFT JOIN sponsors ON award_awards.sponsors_id=sponsors.id
|
||||
LEFT JOIN award_prizes ON award_prizes.award_awards_id=award_awards.id
|
||||
LEFT JOIN winners ON winners.awards_prizes_id=award_prizes.id
|
||||
LEFT JOIN projects ON projects.id=winners.projects_id
|
||||
award_awards,
|
||||
award_types,
|
||||
sponsors
|
||||
WHERE
|
||||
award_awards.year='$foryear'
|
||||
AND award_types.year='$foryear'
|
||||
AND award_awards.award_types_id=award_types.id
|
||||
AND award_awards.sponsors_id=sponsors.id
|
||||
AND award_awards.excludefromac='0'
|
||||
$awardtype
|
||||
AND award_prizes.year='$foryear'
|
||||
AND award_prizes.excludefromac='0'
|
||||
AND ($and_categories)
|
||||
ORDER BY $order");
|
||||
ORDER BY awards_order");
|
||||
|
||||
echo mysql_error();
|
||||
|
||||
if(!mysql_num_rows($q)) {
|
||||
$rep->output();
|
||||
exit;
|
||||
}
|
||||
|
||||
$last_award_id = -1;
|
||||
$prevprizeid=-1;
|
||||
while($r=mysql_fetch_object($q))
|
||||
if(mysql_num_rows($q))
|
||||
{
|
||||
while($r=mysql_fetch_object($q))
|
||||
{
|
||||
$pq=mysql_query("SELECT
|
||||
award_prizes.prize,
|
||||
award_prizes.number,
|
||||
award_prizes.id,
|
||||
award_prizes.cash,
|
||||
award_prizes.scholarship,
|
||||
winners.projects_id,
|
||||
projects.projectnumber,
|
||||
projects.title,
|
||||
projects.projectcategories_id,
|
||||
projects.registrations_id AS reg_id
|
||||
FROM
|
||||
award_prizes
|
||||
LEFT JOIN winners ON winners.awards_prizes_id=award_prizes.id
|
||||
LEFT JOIN projects ON projects.id=winners.projects_id
|
||||
WHERE
|
||||
award_awards_id='$r->id'
|
||||
AND award_prizes.year='$foryear'
|
||||
AND award_prizes.excludefromac='0'
|
||||
AND ($and_categories)
|
||||
ORDER BY
|
||||
`order`");
|
||||
echo mysql_error();
|
||||
|
||||
if($last_award_id != $r->id) {
|
||||
if($show_unawarded_awards=="no")
|
||||
{
|
||||
$skipAward=true;
|
||||
while($pr=mysql_fetch_object($pq))
|
||||
{
|
||||
if($pr->projectnumber)
|
||||
{
|
||||
$skipAward=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if($skipAward)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
mysql_data_seek($pq, 0);
|
||||
}
|
||||
$rep->heading("$r->name ($r->type)");
|
||||
if($r->type!="Divisional")
|
||||
$rep->addText(i18n("Sponsored by: %1",array($r->organization)));
|
||||
@ -112,107 +123,82 @@
|
||||
$rep->addText(i18n("Presented by: %1",array($r->presenter)));
|
||||
if($r->description)
|
||||
$rep->addText(i18n("Description: %1",array($r->description)));
|
||||
$last_award_id = $r->id;
|
||||
|
||||
$prevprizeid=-1;
|
||||
}
|
||||
|
||||
if($r->projectnumber || $show_unawarded_prizes=="yes")
|
||||
{
|
||||
if($prevprizeid!=$r->PRIZE_ID)
|
||||
while($pr=mysql_fetch_object($pq))
|
||||
{
|
||||
$prizetext=$r->prize;
|
||||
|
||||
if($r->cash || $r->scholarship)
|
||||
if($pr->projectnumber || $show_unawarded_prizes=="yes")
|
||||
{
|
||||
$prizetext.=" (";
|
||||
if($r->cash && $r->scholarship)
|
||||
$prizetext.="\$$r->cash cash / \$$r->scholarship scholarship";
|
||||
else if($r->cash)
|
||||
$prizetext.= "\$$r->cash cash";
|
||||
else if($r->scholarship)
|
||||
$prizetext.= "\$$r->scholarship scholarship";
|
||||
$prizetext.= ")";
|
||||
|
||||
}
|
||||
$rep->addText($prizetext);
|
||||
$prevprizeid=$r->PRIZE_ID;
|
||||
}
|
||||
|
||||
if($r->projectnumber)
|
||||
{
|
||||
$rep->addText( " ($r->projectnumber) $r->title\n");
|
||||
|
||||
$sq=mysql_query("SELECT students.firstname,
|
||||
students.lastname,
|
||||
students.pronunciation,
|
||||
students.schools_id,
|
||||
schools.school
|
||||
FROM
|
||||
students,
|
||||
schools
|
||||
WHERE
|
||||
students.registrations_id='$r->reg_id'
|
||||
AND students.schools_id=schools.id
|
||||
");
|
||||
|
||||
// $students=" Students: ";
|
||||
$studnum=0;
|
||||
$pronounce = false;
|
||||
|
||||
$sdata = array();
|
||||
|
||||
while($studentinfo=mysql_fetch_object($sq))
|
||||
{
|
||||
$sdata[$studnum]['student'] = "$studentinfo->firstname $studentinfo->lastname";
|
||||
$sdata[$studnum]['pronounce'] = "{$studentinfo->pronunciation}";
|
||||
if(trim($studentinfo->pronunciation) != '') $pronounce = TRUE;
|
||||
|
||||
|
||||
if($studnum != 0) {
|
||||
$sdata[$studnum]['student'] = ' , '.$sdata[$studnum]['student'];
|
||||
$sdata[$studnum]['pronounce'] = ' , '.$sdata[$studnum]['pronounce'];
|
||||
}
|
||||
|
||||
$sdata[$studnum]['width'] = $rep->stringWidth($sdata[$studnum]['student'])/72;
|
||||
$w = $rep->stringWidth($sdata[$studnum]['pronounce'])/72;
|
||||
if($w > $sdata[$studnum]['width']) $sdata[$studnum]['width'] = $w;
|
||||
|
||||
$studnum++;
|
||||
if($prevprizeid!=$pr->id)
|
||||
{
|
||||
$prizetext=$pr->prize;
|
||||
|
||||
if($pr->cash || $pr->scholarship)
|
||||
{
|
||||
$prizetext.=" (";
|
||||
if($pr->cash && $pr->scholarship)
|
||||
$prizetext.="\$$pr->cash cash / \$$pr->scholarship scholarship";
|
||||
else if($pr->cash)
|
||||
$prizetext.= "\$$pr->cash cash";
|
||||
else if($pr->scholarship)
|
||||
$prizetext.= "\$$pr->scholarship scholarship";
|
||||
$prizetext.= ")";
|
||||
|
||||
//we will assume that they are coming from the same school, so lets just grab the last students school
|
||||
//and use it.
|
||||
$school=$studentinfo->school;
|
||||
}
|
||||
$nextx = 1.5;
|
||||
$rep->addText("School: $school", 'left', $nextx);
|
||||
$rep->yloc -= 10/72;
|
||||
|
||||
foreach($sdata as $x=>$s) {
|
||||
$rep->addTextX($s['student'], $nextx);
|
||||
$nextx += $s['width'];
|
||||
}
|
||||
$rep->nextLine();
|
||||
|
||||
if($show_pronunciation == TRUE && $pronounce == TRUE) {
|
||||
$nextx = 1.45;
|
||||
$rep->addTextX('(', $nextx);
|
||||
$nextx = 1.5;
|
||||
foreach($sdata as $x=>$s) {
|
||||
$rep->addTextX($s['pronounce'], $nextx);
|
||||
$nextx += $s['width'];
|
||||
}
|
||||
$rep->addText($prizetext);
|
||||
|
||||
$prevprizeid=$pr->id;
|
||||
}
|
||||
$rep->addTextX(')', $nextx);
|
||||
$rep->nextLine();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$rep->addText(" Prize not awarded");
|
||||
}
|
||||
}
|
||||
$rep->nextLine();
|
||||
}
|
||||
|
||||
if($pr->projectnumber)
|
||||
{
|
||||
$rep->addText( " ($pr->projectnumber) $pr->title");
|
||||
|
||||
$sq=mysql_query("SELECT students.firstname,
|
||||
students.lastname,
|
||||
students.pronunciation,
|
||||
students.schools_id,
|
||||
schools.school
|
||||
FROM
|
||||
students,
|
||||
schools
|
||||
WHERE
|
||||
students.registrations_id='$pr->reg_id'
|
||||
AND students.schools_id=schools.id
|
||||
");
|
||||
|
||||
$students=" Students: ";
|
||||
$studnum=0;
|
||||
$pronounce = "";
|
||||
while($studentinfo=mysql_fetch_object($sq))
|
||||
{
|
||||
if($studnum>0) $students.=", ";
|
||||
$students.="$studentinfo->firstname $studentinfo->lastname";
|
||||
|
||||
if($studnum>0) $pronounce .= ", ";
|
||||
$pronounce .= "\"{$studentinfo->pronunciation}\"";
|
||||
|
||||
$studnum++;
|
||||
|
||||
//we will assume that they are coming from the same school, so lets just grab the last students school
|
||||
//and use it.
|
||||
$school=$studentinfo->school;
|
||||
}
|
||||
|
||||
$rep->addText($students);
|
||||
if(trim($pronounce) != '' && $show_pronunciation == TRUE)
|
||||
$rep->addText("Pronunciation: $pronounce");
|
||||
$rep->addText(" School: $school");
|
||||
}
|
||||
else
|
||||
{
|
||||
$rep->addText(" Prize not awarded");
|
||||
}
|
||||
}
|
||||
}
|
||||
$rep->nextLine();
|
||||
}
|
||||
|
||||
}
|
||||
$rep->output();
|
||||
?>
|
||||
|
@ -217,12 +217,7 @@ $report_awards_fields = array(
|
||||
'table' => "GROUP_CONCAT(judges.firstname, ' ', judges.lastname ORDER BY judges.lastname SEPARATOR ', ')",
|
||||
'group_by' => array('award_awards.id', 'judges_teams.num') ),
|
||||
|
||||
'static_text' => array (
|
||||
'name' => 'Label -- Static Text',
|
||||
'header' => '',
|
||||
'width' => 0.1,
|
||||
'table' => "CONCAT(' ')"),
|
||||
|
||||
|
||||
|
||||
);
|
||||
|
||||
|
@ -71,8 +71,6 @@
|
||||
echo "<td><input name=\"show_unawarded_prizes\" type=\"checkbox\" ".($config['reports_show_unawarded_prizes'] == 'yes' ? "checked" : "")."/></td></tr>";
|
||||
echo "<tr><td colspan=3><b>".i18n("Show student name pronunciation").":</b></td>";
|
||||
echo "<td><input name=\"show_pronunciation\" type=\"checkbox\" /></td></tr>";
|
||||
echo "<tr><td colspan=3><b>".i18n("Add Award+Prize order to make a total ordering").":</b></td>";
|
||||
echo "<td><input name=\"use_total_order\" type=\"checkbox\" /></td></tr>";
|
||||
|
||||
echo "<tr><td colspan=\"3\"><b>".i18n("Include the following age categories").":</b></td>";
|
||||
echo "<td>";
|
||||
|
@ -111,7 +111,7 @@ function tour_cost_function($annealer, $bucket_id, $ids)
|
||||
$c = count($ids);
|
||||
$over = ($c > $t['capacity']) ? $c - $t['capacity'] : 0;
|
||||
if($c > 0)
|
||||
$under = ($c < ($t['capacity']/2)) ? ($t['capacity']/2) - $c : 0;
|
||||
$under = ($c < ($t['capacity']/4)) ? ($t['capacity']/4) - $c : 0;
|
||||
else
|
||||
$under = 0;
|
||||
|
||||
|
@ -361,7 +361,7 @@ else
|
||||
echo " ";
|
||||
echo " ";
|
||||
echo " ";
|
||||
echo "(<a href=\"export.php?id={$pr->projects_id}\">{$pr->projectnumber}</a>) $pr->title";
|
||||
echo "($pr->projectnumber) $pr->title";
|
||||
echo "<br />";
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user