science-ation/admin/schedule_edit_dialog.php

183 lines
4.5 KiB
PHP
Raw Normal View History

<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(":");
//ea[1] is the type
switch(ea[1]) {
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;
}
if($("#edit_title").val().length) {
//umm if it already exists, dont change it
if($("#edit_title").val=="Choose") {
$("#edit_title").val($("#edit_event option:selected").text());
}
}
else
{
if($("#edit_event").val())
$("#edit_title").val($("#edit_event option:selected").text());
}
}
</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">
2010-06-11 20:20:46 +00:00
<?
2010-06-11 20:20:46 +00:00
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()\">";
2010-06-11 20:20:46 +00:00
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";
2010-06-11 20:20:46 +00:00
}
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").": ";
2010-06-11 20:20:46 +00:00
echo "</td><td>";
echo "<input id=\"edit_title\" type=\"text\" name=\"title\" size=\"20\">";
2010-06-11 20:20:46 +00:00
echo "</td><td>";
2010-06-11 20:20:46 +00:00
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>";
2010-06-11 20:20:46 +00:00
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>";
2010-06-11 20:20:46 +00:00
?>
</div>
<div id="schedule_tab_scienceolympics">
<?
echo "<table>";
echo "<tr><td>";
echo i18n("Maximum Number of Teams").": ";
echo "</td><td>";
echo "<input type=\"text\" name=\"somaxteams\" id=\"edit_somaxteams\" size=\"4\">";
echo "</td></tr>";
echo "</table>";
echo "FIXME: the fields below this line are not functional yet";
echo "<hr />";
echo "<table style=\"width: 95%;\">";
echo "<tr>";
echo "<td>";
echo i18n("Grades Recommended").": ";
echo "</td><td>";
echo i18n("Grades Required").": ";
echo "</td></tr>";
echo "<tr><td>";
//FIXME fix grades from config
for($x=7;$x<=12;$x++) {
echo "<input type=\"checkbox\" name=\"recommendedgrades[]\"> Grade $x <br />\n";
}
echo "</td><td>";
//FIXME fix grades from config
for($x=7;$x<=12;$x++) {
echo "<input type=\"checkbox\" name=\"recommendedgrades[]\"> Grade $x <br />\n";
}
echo "</td></tr>\n";
echo "<tr>";
echo "<td>";
echo i18n("Judges").": ";
echo "</td><td>";
echo "show list of registered judges to choose from";
echo "</td></tr>";
echo "</table>";
?>
</div>
<div id="schedule_tab_sciencefairjudging">
</div>
<div id="schedule_tab_tour">
</div>
</form>
</div>