forked from science-ation/science-ation
Add an option to DELETE a registration, removes everything to do with it from the database
This commit is contained in:
parent
c72193e671
commit
b2c2fdb38b
@ -41,6 +41,19 @@ function openstudentinfo(id)
|
|||||||
echo "<a href=\"index.php\"><< ".i18n("Back to Administration")."</a>";
|
echo "<a href=\"index.php\"><< ".i18n("Back to Administration")."</a>";
|
||||||
echo " ";
|
echo " ";
|
||||||
echo "<a href=\"registration.php\"><< ".i18n("Back to Registration")."</a>";
|
echo "<a href=\"registration.php\"><< ".i18n("Back to Registration")."</a>";
|
||||||
|
if($_GET['action']=="delete" && $_GET['delete'])
|
||||||
|
{
|
||||||
|
$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']."'");
|
||||||
|
mysql_query("DELETE FROM projects WHERE registrations_id='$regid' AND year='".$config['FAIRYEAR']."'");
|
||||||
|
mysql_query("DELETE FROM safety WHERE registrations_id='$regid' AND year='".$config['FAIRYEAR']."'");
|
||||||
|
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"));
|
||||||
|
|
||||||
|
}
|
||||||
echo "<br />";
|
echo "<br />";
|
||||||
echo "<br />";
|
echo "<br />";
|
||||||
echo i18n("Choose Status").":";
|
echo i18n("Choose Status").":";
|
||||||
@ -107,6 +120,7 @@ else $wherestatus="";
|
|||||||
echo "<th><a href=\"registration_list.php?sort=div$stat\">".i18n("Division")."</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("School(s)")."</th>";
|
||||||
echo "<th>".i18n("Student(s)")."</th>";
|
echo "<th>".i18n("Student(s)")."</th>";
|
||||||
|
echo "<th>".i18n("Action")."</th>";
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
$stats_totalprojects=0;
|
$stats_totalprojects=0;
|
||||||
$stats_totalstudents=0;
|
$stats_totalstudents=0;
|
||||||
@ -169,7 +183,11 @@ else $wherestatus="";
|
|||||||
}
|
}
|
||||||
echo "<td>$schools</td>";
|
echo "<td>$schools</td>";
|
||||||
echo "<td>$students</td>";
|
echo "<td>$students</td>";
|
||||||
|
echo "<td align=\"center\">";
|
||||||
|
echo "<a 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 "</td>";
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
}
|
}
|
||||||
echo "</table>\n";
|
echo "</table>\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user