forked from science-ation/science-ation
e55a6f901a
Add min/max judges/volunteers/teams Add defaults Update science olympic tab display Add Teams/Volunteers/Judges status to admin schedule view
210 lines
5.5 KiB
PHP
210 lines
5.5 KiB
PHP
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
$("#schedule_tabs").tabs({
|
|
show: function(event, ui) {
|
|
switch(ui.panel.id) {
|
|
case 'schedule_tab_general':
|
|
update_tab_general();
|
|
break;
|
|
case 'schedule_tab_scienceolympics':
|
|
update_tab_scienceolympics();
|
|
break;
|
|
}
|
|
},
|
|
selected: 0
|
|
});
|
|
event_change();
|
|
});
|
|
|
|
function update_tab_general() {
|
|
}
|
|
|
|
function update_tab_scienceolympics() {
|
|
}
|
|
|
|
function event_change() {
|
|
var ea=$("#edit_event").val().split(":");
|
|
//if its not set, we must be on "choose" still, so disable the other tabs until they choose something
|
|
//then get the heck out of here
|
|
if(!ea[1]) {
|
|
$("#schedule_tabs").tabs("option","disabled",[1,2,3]);
|
|
return;
|
|
}
|
|
//ea[1] is the type
|
|
switch(ea[1]) {
|
|
case "":
|
|
case "general":
|
|
$("#schedule_tabs").tabs("option","disabled",[1,2,3]);
|
|
break;
|
|
case "scienceolympic":
|
|
$("#schedule_tabs").tabs("option","disabled",[2,3]);
|
|
break;
|
|
case "sciencefairjudging":
|
|
$("#schedule_tabs").tabs("option","disabled",[1,3]);
|
|
break;
|
|
case "tour":
|
|
$("#schedule_tabs").tabs("option","disabled",[1,2]);
|
|
break;
|
|
default:
|
|
return;
|
|
}
|
|
|
|
/*
|
|
if($("#edit_title").val().length) {
|
|
//umm if it already exists, dont change it
|
|
//no, screw it, change it anyways
|
|
}
|
|
else
|
|
{
|
|
*/
|
|
if($("#edit_event").val())
|
|
$("#edit_title").val($("#edit_event option:selected").text());
|
|
//}
|
|
var ed=eventdefaults[ea[0]];
|
|
$("#edit_sominteams").val(ed.default_min_teams);
|
|
$("#edit_somaxteams").val(ed.default_max_teams);
|
|
|
|
$("#edit_sominjudges").val(ed.default_min_judges);
|
|
$("#edit_somaxjudges").val(ed.default_max_judges);
|
|
|
|
$("#edit_sominvolunteers").val(ed.default_min_volunteers);
|
|
$("#edit_somaxvolunteers").val(ed.default_max_volunteers);
|
|
|
|
$("#edit_somaxteamsize").val(ed.default_max_team_size);
|
|
$("#edit_sominteamsize").val(ed.default_min_team_size);
|
|
}
|
|
|
|
</script>
|
|
<div id="schedule_tabs">
|
|
<ul>
|
|
<li><a href="#schedule_tab_general"><span><?=i18n('General')?></span></a></li>
|
|
<li><a href="#schedule_tab_scienceolympics"><span><?=i18n('Science Olympics')?></span></a></li>
|
|
<li><a href="#schedule_tab_sciencefairjudging"><span><?=i18n('Science Fair Judging')?></span></a></li>
|
|
<li><a href="#schedule_tab_tour"><span><?=i18n('Tour')?></span></a></li>
|
|
</ul>
|
|
<form method="post" id="edit_event_form">
|
|
<div id="schedule_tab_general">
|
|
|
|
<?
|
|
|
|
|
|
|
|
echo "<input type=\"hidden\" name=\"id\" id=\"edit_schedule_id\">";
|
|
echo "<table style=\"width: 95%;\">";
|
|
echo "<tr><td>";
|
|
echo i18n("Event").": ";
|
|
echo "</td><td>";
|
|
echo "<select name=\"event_id\" id=\"edit_event\" onchange=\"event_change()\">";
|
|
echo "<option value=\"\">".i18n("Choose")."</option>\n";
|
|
$q=mysql_query("SELECT * FROM events WHERE conferences_id='{$conference['id']}' ORDER BY name");
|
|
while($r=mysql_fetch_object($q)) {
|
|
echo "<option value=\"$r->id:$r->eventtype\">$r->name</option>\n";
|
|
}
|
|
echo "</select>\n";
|
|
echo "</td><td>";
|
|
echo i18n("Location").": ";
|
|
echo "</td><td>";
|
|
echo "<select name=\"location_id\" id=\"edit_location\">";
|
|
echo "<option value=\"\">".i18n("Choose")."</option>\n";
|
|
$q=mysql_query("SELECT * FROM locations WHERE conferences_id='{$conference['id']}' ORDER BY name");
|
|
while($r=mysql_fetch_object($q)) {
|
|
echo "<option value=\"$r->id\">$r->name</option>\n";
|
|
}
|
|
echo "</select>\n";
|
|
echo "</td></tr>\n";
|
|
|
|
|
|
echo "<tr><td>";
|
|
echo i18n("Title").": ";
|
|
echo "</td><td>";
|
|
echo "<input id=\"edit_title\" type=\"text\" name=\"title\" size=\"20\">";
|
|
|
|
echo "</td><td>";
|
|
|
|
echo i18n("Date").": ";
|
|
echo "</td><td>";
|
|
echo "<input id=\"edit_date\" type=\"text\" name=\"date\" class=\"date\" size=\"12\">";
|
|
echo "</td><td>";
|
|
echo "</td><td>";
|
|
echo "</td></tr>\n";
|
|
|
|
echo "<tr><td>";
|
|
|
|
echo i18n("Start at").": ";
|
|
echo "</td><td>";
|
|
emit_hour_selector('hour',"","id=\"edit_hour\"");
|
|
echo ":";
|
|
emit_minute_selector('minute',"","id=\"edit_minute\"",15);
|
|
|
|
|
|
echo "</td><td>";
|
|
|
|
echo i18n("Duration").": ";
|
|
echo "</td><td>";
|
|
echo "<input id=\"edit_duration\" type=\"text\" name=\"duration\" size=\"4\">";
|
|
echo "minutes";
|
|
echo "</td></tr>\n";
|
|
echo "</table>";
|
|
|
|
?>
|
|
|
|
</div>
|
|
<div id="schedule_tab_scienceolympics">
|
|
<table>
|
|
<tr>
|
|
<th></th>
|
|
<th><?=i18n("Minimum")?></th>
|
|
<th><?=i18n("Maximum")?></th>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><?=i18n("Number of Teams")?></td>
|
|
<td><input type="text" name="sominteams" id="edit_sominteams" size="4"></td>
|
|
<td><input type="text" name="somaxteams" id="edit_somaxteams" size="4"></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><?=i18n("Team Member Size")?></td>
|
|
<td><input type="text" name="sominteamsize" id="edit_sominteamsize" size="4"></td>
|
|
<td><input type="text" name="somaxteamsize" id="edit_somaxteamsize" size="4"></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><?=i18n("Number of Judges")?></td>
|
|
<td><input type="text" name="sominjudges" id="edit_sominjudges" size="4"></td>
|
|
<td><input type="text" name="somaxjudges" id="edit_somaxjudges" size="4"></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><?=i18n("Number of Volunteers")?></td>
|
|
<td><input type="text" name="sominvolunteers" id="edit_sominvolunteers" size="4"></td>
|
|
<td><input type="text" name="somaxvolunteers" id="edit_somaxvolunteers" size="4"></td>
|
|
</tr>
|
|
|
|
</table>
|
|
<?
|
|
|
|
echo "<h4>".i18n("Judges")."</h4>";
|
|
echo "<table style=\"width: 95%;\">";
|
|
echo "<tr>";
|
|
echo "<td>";
|
|
echo "</td><td>";
|
|
echo "FIXME: show list of registered judges to choose from";
|
|
echo "</td></tr>";
|
|
echo "</table>";
|
|
|
|
echo "<h4>".i18n("Registered Teams")."</h4>";
|
|
echo "<div id=\"event_editor_tab_scienceolympics_registeredteams\"></div>";
|
|
echo "</div>\n";
|
|
|
|
|
|
?>
|
|
</div>
|
|
<div id="schedule_tab_sciencefairjudging">
|
|
</div>
|
|
<div id="schedule_tab_tour">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|