forked from science-ation/science-ation
New ajax reg list, prevents reloading the list on edit. Move all the stats stuff out.
This commit is contained in:
parent
bc9bfde34f
commit
997b54e854
@ -22,33 +22,35 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require("../common.inc.php");
|
||||
require_once("../user.inc.php");
|
||||
require_once('../common.inc.php');
|
||||
require_once('../user.inc.php');
|
||||
user_auth_required('committee', 'admin');
|
||||
require("../register_participants.inc.php");
|
||||
require_once('../register_participants.inc.php');
|
||||
|
||||
if($_GET['year']) $year=$_GET['year'];
|
||||
else $year=$config['FAIRYEAR'];
|
||||
|
||||
send_header("Registration List and Statistics",
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'Administration' => 'admin/index.php',
|
||||
'Participant Registration' => 'admin/registration.php')
|
||||
);
|
||||
?>
|
||||
<script language="javascript" type="text/javascript">
|
||||
$q=mysql_query("SELECT * FROM projectcategories WHERE year='$year' ORDER BY id");
|
||||
while($r=mysql_fetch_object($q))
|
||||
$cats[$r->id]=$r->category;
|
||||
|
||||
$q=mysql_query("SELECT * FROM projectdivisions WHERE year='$year' ORDER BY id");
|
||||
while($r=mysql_fetch_object($q))
|
||||
$divs[$r->id]=$r->division;
|
||||
|
||||
function openstudentinfo(id)
|
||||
{
|
||||
window.open("students_info.php?id="+id,"StudentInfo","location=no,menubar=no,directories=no,toolbar=no,width=770,height=500,scrollbars=yes");
|
||||
return false;
|
||||
$action=$_GET['action'];
|
||||
switch($action) {
|
||||
case 'load_row':
|
||||
$id = intval($_GET['id']);
|
||||
$q = list_query($year, '', '', $id);
|
||||
$r = mysql_fetch_object($q);
|
||||
print_row($r);
|
||||
exit;
|
||||
|
||||
}
|
||||
</script>
|
||||
<?
|
||||
if($_GET['action']=="delete" && $_GET['delete'])
|
||||
{
|
||||
case 'delete':
|
||||
$id = intval($_GET['id']);
|
||||
error_("FIXME!");
|
||||
exit;
|
||||
$regid=$_GET['delete'];
|
||||
mysql_query("DELETE FROM registrations WHERE id='$regid' AND year='".$config['FAIRYEAR']."'");
|
||||
mysql_query("DELETE FROM students WHERE registrations_id='$regid' AND year='".$config['FAIRYEAR']."'");
|
||||
@ -57,9 +59,202 @@ function openstudentinfo(id)
|
||||
mysql_query("DELETE FROM questions_answers WHERE registrations_id='$regid' AND year='".$config['FAIRYEAR']."'");
|
||||
mysql_query("DELETE FROM mentors WHERE registrations_id='$regid' AND year='".$config['FAIRYEAR']."'");
|
||||
mysql_query("DELETE FROM emergencycontact WHERE registrations_id='$regid' AND year='".$config['FAIRYEAR']."'");
|
||||
echo happy(i18n("Registration and all related data successfully deleted"));
|
||||
happy_("Registration and all related data successfully deleted");
|
||||
exit;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
send_header("Registration List and Statistics",
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'Administration' => 'admin/index.php',
|
||||
'Participant Registration' => 'admin/registration.php')
|
||||
);
|
||||
?>
|
||||
|
||||
<div id="student_editor" title="Student/Project Editor" style="display: none">
|
||||
<div id="editor_tabs">
|
||||
<ul>
|
||||
<li><a href="#editor_tab_students"><span><?=i18n('Students')?></span></a></li>
|
||||
<li><a href="#editor_tab_project"><span><?=i18n('Project')?></span></a></li>
|
||||
</ul>
|
||||
<div id="editor_tab_students">Loading...</div>
|
||||
<div id="editor_tab_project">Loading...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
var registrations_id = 0;
|
||||
function popup_editor(id, open_tab)
|
||||
{
|
||||
var w = (document.documentElement.clientWidth * 0.8);
|
||||
var h = (document.documentElement.clientHeight * 0.8);
|
||||
|
||||
registrations_id = id;
|
||||
|
||||
/* Force no tabs to be selected, need to set collapsible
|
||||
* to true first */
|
||||
$('#editor_tabs').tabs('option', 'collapsible', true);
|
||||
$('#editor_tabs').tabs('option', 'selected', -1);
|
||||
|
||||
/* Then we'll select a tab to force a reload */
|
||||
switch(open_tab) {
|
||||
case 'projects':
|
||||
$('#editor_tabs').tabs('option', 'disabled', []);
|
||||
$('#editor_tabs').tabs('select', 1);
|
||||
break;
|
||||
default:
|
||||
$('#editor_tabs').tabs('option', 'disabled', []);
|
||||
$('#editor_tabs').tabs('select', 0);
|
||||
break;
|
||||
}
|
||||
/* Don't let anything collapse */
|
||||
$('#editor_tabs').tabs('option', 'collapsible', false);
|
||||
|
||||
/* Show the dialog */
|
||||
$('#student_editor').dialog('option', 'width', w);
|
||||
$('#student_editor').dialog('option', 'height', h);
|
||||
$("#student_editor").dialog('open');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function update_students(numstudents)
|
||||
{
|
||||
var id = registrations_id;
|
||||
|
||||
var req = "action=students_load&id="+id;
|
||||
if(numstudents != 0 && numstudents != undefined) req = req+"&numstudents="+numstudents;
|
||||
|
||||
$("#editor_tab_students").load("student_editor.php?"+req, '',
|
||||
function(responseText, textStatus, XMLHttpRequest) {
|
||||
/* Attach to events we care about */
|
||||
$("#students_num").change(function() {
|
||||
var num = $("#students_num").val();
|
||||
update_students(num);
|
||||
});
|
||||
|
||||
$("#students_save").click(function() {
|
||||
var id = registrations_id;
|
||||
$("#debug").load("student_editor.php?action=students_save&id="+id, $("#students_form").serializeArray());
|
||||
});
|
||||
|
||||
$(".students_remove_button").click(function() {
|
||||
var id = registrations_id;
|
||||
var sid = $("#"+this.id +"_students_id").val();
|
||||
var conf = confirmClick('<?=i18n("Are you sure you want to remove this student from the project?")?>');
|
||||
|
||||
if(conf == false) return false;
|
||||
|
||||
$("#debug").load("student_editor.php?action=student_remove&id="+id+"&students_id="+sid, '',
|
||||
function(responseText, textStatus, XMLHttpRequest) {
|
||||
update_students();
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
function update_project()
|
||||
{
|
||||
var id = registrations_id;
|
||||
$("#editor_tab_project").load("project_editor.php?action=project_load&id="+id, '',
|
||||
function(responseText, textStatus, XMLHttpRequest) {
|
||||
/* Attach to regenerate button */
|
||||
$("#project_regenerate_number").click(function() {
|
||||
var id = registrations_id;
|
||||
/* Call for regen, and when that's done reload the project screen (and rebind everything),
|
||||
* pass all the form data in, because regen does a save first */
|
||||
$("#debug").load("project_editor.php?action=project_regenerate_number&id="+id,$("#project_form").serializeArray(),
|
||||
function(responseText, textStatus, XMLHttpRequest) {
|
||||
update_project();
|
||||
});
|
||||
});
|
||||
|
||||
/* Attach to save button */
|
||||
$("#project_save").click(function() {
|
||||
var id = registrations_id;
|
||||
$("#debug").load("project_editor.php?action=project_save&id="+id, $("#project_form").serializeArray());
|
||||
});
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
/*
|
||||
var id=sponsor_id;
|
||||
$.getJSON("<?=$_SERVER['PHP_SELF']?>?action=activityinfo_load&id="+id,
|
||||
function(json){
|
||||
$("#sponsor_id").val(json.id);
|
||||
});
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
function delete_registration(id)
|
||||
{
|
||||
registrations_id=id;
|
||||
var conf = confirmClick('<?=i18n("Are you sure you want to completely delete this registration?")?>');
|
||||
if(conf == false) return false;
|
||||
|
||||
$("#debug").load("<?=$_SERVER['PHP_SELF']?>?action=delete&id="+id,{},
|
||||
function(responseText, textStatus, XMLHttpRequest) {
|
||||
var id = registrations_id;
|
||||
$("#row_"+id).remove();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#student_editor").dialog({
|
||||
bgiframe: true, autoOpen: false,
|
||||
modal: true, resizable: false,
|
||||
draggable: false,
|
||||
buttons: {
|
||||
/* "<?=i18n('Cancel')?>": function() {
|
||||
$(this).dialog("close");
|
||||
},
|
||||
"<?=i18n('Save')?>": function() {
|
||||
save_report();
|
||||
$(this).dialog("close"); */
|
||||
"<?=i18n('Close')?>": function() {
|
||||
// save_report();
|
||||
$(this).dialog("close");
|
||||
}
|
||||
},
|
||||
close: function() {
|
||||
/* Reload the row after the dialog close in case the info has changed */
|
||||
var id = registrations_id;
|
||||
$("#row_"+id).load("<?$_SERVER['PHP_SELF']?>?action=load_row&id="+id);
|
||||
$("#row_"+id).effect('highlight',{},500);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$("#editor_tabs").tabs({
|
||||
show: function(event, ui) {
|
||||
switch(ui.panel.id) {
|
||||
case 'editor_tab_students':
|
||||
update_students();
|
||||
break;
|
||||
case 'editor_tab_project':
|
||||
update_project();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
selected: 0,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?
|
||||
echo "<br />";
|
||||
echo i18n("Choose Status").":";
|
||||
echo "<form name=\"statuschangerform\" method=\"get\" action=\"registration_list.php\">";
|
||||
@ -82,26 +277,53 @@ function openstudentinfo(id)
|
||||
echo "</select>";
|
||||
echo "</form>";
|
||||
|
||||
$q=mysql_query("SELECT * FROM projectcategories WHERE year='$year' ORDER BY id");
|
||||
while($r=mysql_fetch_object($q))
|
||||
$cats[$r->id]=$r->category;
|
||||
|
||||
$q=mysql_query("SELECT * FROM projectdivisions WHERE year='$year' ORDER BY id");
|
||||
while($r=mysql_fetch_object($q))
|
||||
$divs[$r->id]=$r->division;
|
||||
|
||||
if($showstatus) $wherestatus="AND status='$showstatus' ";
|
||||
else $wherestatus="";
|
||||
switch($_GET['sort'])
|
||||
{
|
||||
case 'status': $ORDERBY="registrations.status DESC, projects.title"; break;
|
||||
case 'num': $ORDERBY="registrations.num"; break;
|
||||
case 'projnum': $ORDERBY="projects.projectsort, projects.projectnumber"; break;
|
||||
case 'title': $ORDERBY="projects.title, registrations.status DESC"; break;
|
||||
case 'cat': $ORDERBY="projects.projectcategories_id, projects.title"; break;
|
||||
case 'div': $ORDERBY="projects.projectdivisions_id, projects.title"; break;
|
||||
default: $ORDERBY="registrations.status DESC, projects.title"; break;
|
||||
|
||||
$q = list_query($year, $wherestatus, $_GET['sort'], false);
|
||||
|
||||
echo "<table class=\"tableview\">";
|
||||
echo "<tr>";
|
||||
if($showstatus) $stat="&showstatus=".$showstatus;
|
||||
echo "<th><a href=\"registration_list.php?sort=status$stat\">".i18n("Status")."</a></th>";
|
||||
echo "<th><a href=\"registration_list.php?sort=email\">".i18n("Email Address")."</a></th>";
|
||||
echo "<th><a href=\"registration_list.php?sort=num$stat\">".i18n("Reg Num")."</a></th>";
|
||||
echo "<th><a href=\"registration_list.php?sort=projnum$stat\">".i18n("Proj Num")."</a></th>";
|
||||
echo "<th><a href=\"registration_list.php?sort=title$stat\">".i18n("Project Title")."</a></th>";
|
||||
echo "<th><a href=\"registration_list.php?sort=cat$stat\">".i18n("Age Category")."</a></th>";
|
||||
echo "<th><a href=\"registration_list.php?sort=div$stat\">".i18n("Division")."</a></th>";
|
||||
echo "<th>".i18n("School(s)")."</th>";
|
||||
echo "<th>".i18n("Student(s)")."</th>";
|
||||
echo "<th>".i18n("Action")."</th>";
|
||||
echo "</tr>";
|
||||
|
||||
while($r=mysql_fetch_object($q)) {
|
||||
echo "<tr id=\"row_{$r->reg_id}\">";
|
||||
print_row($r);
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
|
||||
echo "The statistics have move here: <a href=\"registrations_stats.php\">Registration Statistics</a>";
|
||||
|
||||
send_footer();
|
||||
|
||||
/* Now some helper fucntions we call more than once */
|
||||
function list_query($year, $wherestatus, $sort, $reg_id)
|
||||
{
|
||||
if($reg_id != false)
|
||||
$reg = "AND registrations.id='$reg_id'";
|
||||
else
|
||||
$reg = '';
|
||||
|
||||
switch($sort) {
|
||||
case 'status': $ORDERBY="registrations.status DESC, projects.title"; break;
|
||||
case 'num': $ORDERBY="registrations.num"; break;
|
||||
case 'projnum': $ORDERBY="projects.projectsort, projects.projectnumber"; break;
|
||||
case 'title': $ORDERBY="projects.title, registrations.status DESC"; break;
|
||||
case 'cat': $ORDERBY="projects.projectcategories_id, projects.title"; break;
|
||||
case 'div': $ORDERBY="projects.projectdivisions_id, projects.title"; break;
|
||||
default: $ORDERBY="registrations.status DESC, projects.title"; break;
|
||||
}
|
||||
|
||||
$q=mysql_query("SELECT registrations.id AS reg_id,
|
||||
@ -119,210 +341,84 @@ else $wherestatus="";
|
||||
1
|
||||
AND registrations.year='$year'
|
||||
$wherestatus
|
||||
$reg
|
||||
ORDER BY
|
||||
$ORDERBY
|
||||
");
|
||||
echo mysql_error();
|
||||
|
||||
echo "<table class=\"tableview\">";
|
||||
echo "<tr>";
|
||||
if($showstatus) $stat="&showstatus=".$showstatus;
|
||||
echo "<th><a href=\"registration_list.php?sort=status$stat\">".i18n("Status")."</a></th>";
|
||||
echo "<th><a href=\"registration_list.php?sort=email\">".i18n("Email Address")."</a></th>";
|
||||
echo "<th><a href=\"registration_list.php?sort=num$stat\">".i18n("Reg Num")."</a></th>";
|
||||
echo "<th><a href=\"registration_list.php?sort=projnum$stat\">".i18n("Proj Num")."</a></th>";
|
||||
echo "<th><a href=\"registration_list.php?sort=title$stat\">".i18n("Project Title")."</a></th>";
|
||||
echo "<th><a href=\"registration_list.php?sort=cat$stat\">".i18n("Age Category")."</a></th>";
|
||||
echo "<th><a href=\"registration_list.php?sort=div$stat\">".i18n("Division")."</a></th>";
|
||||
echo "<th>".i18n("School(s)")."</th>";
|
||||
echo "<th>".i18n("Student(s)")."</th>";
|
||||
echo "<th>".i18n("Action")."</th>";
|
||||
echo "</tr>";
|
||||
$stats_totalprojects=0;
|
||||
$stats_totalstudents=0;
|
||||
$stats_divisions=array();
|
||||
$stats_categories=array();
|
||||
$stats_students_catdiv=array();
|
||||
$stats_projects_catdiv=array();
|
||||
$stats_students_schools=array();
|
||||
$stats_projects_schools=array();
|
||||
$schools_names=array();
|
||||
echo mysql_error();
|
||||
return $q;
|
||||
}
|
||||
|
||||
while($r=mysql_fetch_object($q))
|
||||
|
||||
|
||||
function print_row($r)
|
||||
{
|
||||
global $cats, $divs, $config, $year;
|
||||
switch($r->status) {
|
||||
case "new": $status_text="New"; break;
|
||||
case "open": $status_text="Open"; break;
|
||||
case "paymentpending": $status_text="Payment Pending"; break;
|
||||
case "complete": $status_text="Complete"; break;
|
||||
}
|
||||
|
||||
$status_text=i18n($status_text);
|
||||
|
||||
// $cl = ($r->award_source_fairs_id) ? externalaward : '';
|
||||
$scl = "style=\"cursor:pointer;\" onclick=\"popup_editor('{$r->reg_id}','');\"";
|
||||
$pcl = "style=\"cursor:pointer;\" onclick=\"popup_editor('{$r->reg_id}','projects');\"";
|
||||
|
||||
echo "<td $scl>{$status_text}</td>";
|
||||
echo "<td $scl>{$r->email}</td>";
|
||||
echo "<td $scl>{$r->reg_num}</td>";
|
||||
$pn = str_replace(' ', ' ', $r->projectnumber);
|
||||
echo "<td $scl>$pn</td>";
|
||||
echo "<td $scl>{$r->title}</td>";
|
||||
|
||||
echo "<td $scl>".i18n($cats[$r->projectcategories_id])."</td>";
|
||||
echo "<td $scl>".i18n($divs[$r->projectdivisions_id])."</td>";
|
||||
|
||||
$sq=mysql_query("SELECT students.firstname,
|
||||
students.lastname,
|
||||
students.id,
|
||||
schools.school,
|
||||
schools.board,
|
||||
schools.id AS schools_id
|
||||
FROM
|
||||
students,schools
|
||||
WHERE
|
||||
students.registrations_id='$r->reg_id'
|
||||
AND
|
||||
students.schools_id=schools.id
|
||||
");
|
||||
echo mysql_error();
|
||||
|
||||
$studnum=1;
|
||||
$schools="";
|
||||
$students="";
|
||||
while($studentinfo=mysql_fetch_object($sq))
|
||||
{
|
||||
$stats_totalprojects++;
|
||||
$stats_divisions[$r->projectdivisions_id]++;
|
||||
$stats_categories[$r->projectcategories_id]++;
|
||||
$stats_projects_catdiv[$r->projectcategories_id][$r->projectdivisions_id]++;
|
||||
|
||||
switch($r->status)
|
||||
{
|
||||
case "new": $status_text="New"; break;
|
||||
case "open": $status_text="Open"; break;
|
||||
case "paymentpending": $status_text="Payment Pending"; break;
|
||||
case "complete": $status_text="Complete"; break;
|
||||
}
|
||||
$status_text=i18n($status_text);
|
||||
|
||||
echo "<tr>";
|
||||
echo "<td>$status_text</td>";
|
||||
echo "<td>$r->email</td>";
|
||||
echo "<td>$r->reg_num</td>";
|
||||
echo "<td>$r->projectnumber</td>";
|
||||
echo "<td><a title=\"".i18n("Click to edit")."\" href=\"project_editor.php?registration_id=$r->reg_id\">$r->title</a></td>";
|
||||
|
||||
echo "<td>".i18n($cats[$r->projectcategories_id])."</td>";
|
||||
echo "<td>".i18n($divs[$r->projectdivisions_id])."</td>";
|
||||
|
||||
$sq=mysql_query("SELECT students.firstname,
|
||||
students.lastname,
|
||||
students.id,
|
||||
schools.school,
|
||||
schools.board,
|
||||
schools.id AS schools_id
|
||||
FROM
|
||||
students,schools
|
||||
WHERE
|
||||
students.registrations_id='$r->reg_id'
|
||||
AND
|
||||
students.schools_id=schools.id
|
||||
");
|
||||
echo mysql_error();
|
||||
|
||||
$studnum=1;
|
||||
$schools="";
|
||||
$students="";
|
||||
while($studentinfo=mysql_fetch_object($sq))
|
||||
{
|
||||
$students.="<a href=\"student_editor.php?registration_id=$r->reg_id\">$studentinfo->firstname $studentinfo->lastname </a><br />";
|
||||
$schools.="$studentinfo->school <br />";
|
||||
$stats_totalstudents++;
|
||||
$stats_students_catdiv[$r->projectcategories_id][$r->projectdivisions_id]++;
|
||||
$stats_students_schools[$r->projectcategories_id][$studentinfo->schools_id]++;
|
||||
$schools_names[$studentinfo->schools_id]=$studentinfo->school." ($studentinfo->board)";
|
||||
$lastschoolid=$studentinfo->schools_id;
|
||||
}
|
||||
//this really isnt right, its only taking the school from the last student in the project to count towards the school's project totals
|
||||
//but there's really no other way
|
||||
$stats_projects_schools[$r->projectcategories_id][$lastschoolid]++;
|
||||
echo "<td>$schools</td>";
|
||||
echo "<td>$students</td>";
|
||||
echo "<td align=\"center\">";
|
||||
if($year==$config['FAIRYEAR']) {
|
||||
echo "<a title=\"".i18n("Delete this registration")."\" href=\"registration_list.php?action=delete&delete=$r->reg_id\" onclick=\"return confirmClick('".i18n("Are you sure you want to completely delete this registration?")."');\">";
|
||||
echo "<img src=\"".$config['SFIABDIRECTORY']."/images/16/button_cancel.".$config['icon_extension']."\" border=0>";
|
||||
echo "</a>";
|
||||
|
||||
echo "<form target=\"_blank\" method=\"post\" action=\"../register_participants.php\">";
|
||||
echo "<input type=\"hidden\" name=\"action\" value=\"continue\">";
|
||||
echo "<input type=\"hidden\" name=\"email\" value=\"$r->email\">";
|
||||
echo "<input type=\"hidden\" name=\"regnum\" value=\"$r->reg_num\">";
|
||||
echo "<input type=\"submit\" value=\"".i18n("Login")."\">";
|
||||
echo "</form>";
|
||||
|
||||
|
||||
}
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
$students.="$studentinfo->firstname $studentinfo->lastname<br />";
|
||||
$schools.="$studentinfo->school <br />";
|
||||
}
|
||||
echo "</table>\n";
|
||||
echo "<br />";
|
||||
|
||||
echo "<table style=\"margin-left: 50px;\">";
|
||||
echo "<tr><td colspan=\"2\"><h3>{$status_str[$showstatus]} - ".i18n("Students / projects per age category / division")."</h3></td></tr>";
|
||||
echo "<tr><td colspan=\"2\">";
|
||||
echo "<table class=\"tableview\" width=\"100%\">";
|
||||
echo "<tr><td width=\"50%\"></td>";
|
||||
foreach($cats AS $c=>$cn) {
|
||||
echo "<th>$cn<br /><nobr>".i18n("Stud | Proj")."</nobr></th>";
|
||||
echo "<td $scl>$schools</td>";
|
||||
echo "<td $scl>$students</td>";
|
||||
echo "<td align=\"center\" >";
|
||||
if($year==$config['FAIRYEAR']) {
|
||||
echo "<a title=\"".i18n("Delete this registration")."\" href=\"#\" onClick=\"delete_registration({$r->reg_id});return false\" >";
|
||||
echo "<img src=\"".$config['SFIABDIRECTORY']."/images/16/button_cancel.".$config['icon_extension']."\" border=0>";
|
||||
echo "</a>";
|
||||
|
||||
echo "<form target=\"_blank\" method=\"post\" action=\"../register_participants.php\">";
|
||||
echo "<input type=\"hidden\" name=\"action\" value=\"continue\">";
|
||||
echo "<input type=\"hidden\" name=\"email\" value=\"$r->email\">";
|
||||
echo "<input type=\"hidden\" name=\"regnum\" value=\"$r->reg_num\">";
|
||||
echo "<input type=\"submit\" value=\"".i18n("Login")."\">";
|
||||
echo "</form>";
|
||||
|
||||
|
||||
}
|
||||
echo "<th>".i18n("Total")."<br /><nobr>".i18n("Stud | Proj")."</th>";
|
||||
echo "</tr>";
|
||||
foreach($divs AS $d=>$dn) {
|
||||
echo "<tr><td>$dn</td>";
|
||||
$tstud=0;
|
||||
$tproj=0;
|
||||
foreach($cats AS $c=>$cn)
|
||||
{
|
||||
echo "<td align=\"center\">";
|
||||
echo ($stats_students_catdiv[$c][$d]?$stats_students_catdiv[$c][$d]:0);
|
||||
echo " ";
|
||||
echo ($stats_projects_catdiv[$c][$d]?$stats_projects_catdiv[$c][$d]:0);
|
||||
echo "</td>";
|
||||
$tstud+=$stats_students_catdiv[$c][$d];
|
||||
$tproj+=$stats_projects_catdiv[$c][$d];
|
||||
echo "</td>";
|
||||
|
||||
$tstudcat[$c]+=$stats_students_catdiv[$c][$d];
|
||||
$tprojcat[$c]+=$stats_projects_catdiv[$c][$d];
|
||||
}
|
||||
echo "<td align=\"center\"><b>";
|
||||
echo ($tstud?$tstud:0);
|
||||
echo " ";
|
||||
echo ($tproj?$tproj:0);
|
||||
echo "</b></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "<tr><td><b>".i18n("Total")."</b></td>";
|
||||
$tstud=0;
|
||||
$tproj=0;
|
||||
foreach($cats AS $c=>$cn) {
|
||||
echo "<td align=\"center\"><b>";
|
||||
echo ($tstudcat[$c]?$tstudcat[$c]:0);
|
||||
echo " ";
|
||||
echo ($tprojcat[$c]?$tprojcat[$c]:0);
|
||||
echo "</b></td>";
|
||||
$tstud+=$tstudcat[$c];
|
||||
$tproj+=$tprojcat[$c];
|
||||
}
|
||||
echo "<td align=\"center\"><b>";
|
||||
echo ($tstud);
|
||||
echo " ";
|
||||
echo ($tproj);
|
||||
echo "</b></td>";
|
||||
echo "</tr>";
|
||||
|
||||
echo "</table>";
|
||||
echo "</td></tr>";
|
||||
|
||||
echo "<tr><td colspan=\"2\"><br /></td></tr>";
|
||||
echo "<tr><td colspan=\"2\"><h3>{$status_str[$showstatus]} - ".i18n("Students / projects per age category / school")."</h3></td></tr>";
|
||||
echo "<tr><td colspan=\"2\">";
|
||||
echo "<table class=\"tableview\" width=\"100%\">";
|
||||
echo "<tr><td width=\"50%\"></td>";
|
||||
foreach($cats AS $c=>$cn) {
|
||||
echo "<th>$cn<br /><nobr>".i18n("Stud | Proj")."</nobr></th>";
|
||||
}
|
||||
echo "<th>".i18n("Total")."<br /><nobr>".i18n("Stud | Proj")."</nobr></th>";
|
||||
echo "</tr>";
|
||||
|
||||
asort($schools_names);
|
||||
foreach($schools_names AS $id=>$sn)
|
||||
{
|
||||
echo "<tr><td>$sn</td>";
|
||||
$tstud=0;
|
||||
$tproj=0;
|
||||
foreach($cats AS $c=>$cn) {
|
||||
echo "<td align=\"center\">".($stats_students_schools[$c][$id]?$stats_students_schools[$c][$id]:0);
|
||||
echo " ";
|
||||
echo ($stats_projects_schools[$c][$id]?$stats_projects_schools[$c][$id]:0)."</td>";
|
||||
$tstud+=$stats_students_schools[$c][$id];
|
||||
$tproj+=$stats_projects_schools[$c][$id];
|
||||
}
|
||||
echo "<td align=\"center\"><b>".($tstud?$tstud:0);
|
||||
echo " ";
|
||||
echo ($tproj?$tproj:0)."</b></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
echo i18n("%1 schools total",array(count($schools_names)));
|
||||
|
||||
echo "</td></tr>";
|
||||
echo "</table>";
|
||||
|
||||
echo "<br />";
|
||||
echo i18n("Note: statistics reflect the numbers of the current 'Status' selected at the top of the page");
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
|
||||
send_footer();
|
||||
}
|
||||
?>
|
||||
|
@ -70,7 +70,6 @@ function students_save()
|
||||
{
|
||||
global $registrations_id, $config;
|
||||
$x=1;
|
||||
happy_("here!");
|
||||
while($_POST["num"][$x]) {
|
||||
if($_POST['id'][$x]==0) {
|
||||
//if they use schoolpassword or singlepassword, then we need to set the school based on the school stored in the registration record. for anything else they can school the school on their own.
|
||||
|
Loading…
Reference in New Issue
Block a user