From: jsvoyager <jsv...@us...> - 2004-12-23 02:35:58
|
Update of /cvsroot/webschool/webschool/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22228/admin Modified Files: sports.php Log Message: Some more sports... Index: sports.php =================================================================== RCS file: /cvsroot/webschool/webschool/admin/sports.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sports.php 28 Nov 2004 22:47:53 -0000 1.4 --- sports.php 23 Dec 2004 02:35:17 -0000 1.5 *************** *** 63,77 **** $j = 0; while ($schedule = dbr4()){ $sports[$i]['schedule'][$j]['versus'] = $schedule['versus']; ! $sports[$i]['schedule'][$j]['date'] = "Uh....wait a bit"; //Still thinking of a creative way to do this ! $sports[$i]['schedule'][$j]['score'] = $schedule['score']; $sports[$i]['schedule'][$j]['id'] = $schedule['id']; $sports[$i]['schedule'][$j]['cid'] = $schedule['cid']; } $i++; } $smarty->assign("sports", $sports); } --- 63,114 ---- $j = 0; while ($schedule = dbr4()){ + $query = "SELECT * FROM "._CALENDER_." WHERE id='{$schedule['cid']}' LIMIT 0,1"; + db(__FILE__,__LINE__, $query); + $calresult = dbr(); + $date = date("m/d/Y", strtotime($calresult['date'])); + $sports[$i]['schedule'][$j]['versus'] = $schedule['versus']; ! $sports[$i]['schedule'][$j]['date'] = $date; ! $sports[$i]['schedule'][$j]['score'] = ($schedule['score'] == -1) ? ("TBA") : ($schedule['score']); ! $sports[$i]['schedule'][$j]['location'] = $schedule['location']; $sports[$i]['schedule'][$j]['id'] = $schedule['id']; $sports[$i]['schedule'][$j]['cid'] = $schedule['cid']; + + $j++; } + //Get pictures + + //TBD + $i++; } $smarty->assign("sports", $sports); + + ///////////////////////////// + // That famous giant if + // statement to see what + // to do + //////////////////////////// + + if ($_GET['op'] == "addplayer"){ + if (isset($_POST['name'])){ + //Add to db + $query = "INSERT INTO "._SPORTS_ROSTER_." (sid, name, position) VALUES ('{$_POST['sid']}', " . + "'{$_POST['name']}', '{$_POST['position']}')"; + dbn(__FILE__,__LINE__,$query); + header("Location: "._AMOD_); + die(); + }else{ + //Show form + $smarty->assign("sid", $_GET['id']); + $smarty->display("admin/sports.addplayer.tpl"); + } + }elseif ($_GET['op'] == "addsched"){ + //this feature has been delayed until the calendar AMOD is finished + }elseif ($_GET['op'] == "addpic"){ + //this feature is delayed until post 1.0.0 + } } |