From: Anders R. <ma...@us...> - 2006-10-15 20:02:32
|
Update of /cvsroot/planeshift/planeshift/www/serverconsole/waypoints In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25331/www/serverconsole/waypoints Modified Files: waypoints_map.php Added Files: waypoints_actions.php Log Message: - Added support for editing of waypoint to serverconsole. - Changed draw of natural resources to include display of the radius. - Added support for "Go back to <Category>" to each edit page. --- NEW FILE: waypoints_actions.php --- <? function waypoints_actions(){ ?> <HTML> <BODY> <?PHP // gets operation to perform $operation = $_GET['operation']; /** * update script */ if ($operation == 'update'){ $id = $_POST['id']; $sector = $_POST['sector']; $loc_x = $_POST['x']; $loc_y = $_POST['y']; $loc_z = $_POST['z']; $radius = $_POST['radius']; // insert script $query = "update sc_waypoints set loc_sector_id=$sector, x='$loc_x',y='$loc_y',z='$loc_z',radius='$radius' where id='$id'"; $result = mysql_query2($query); // redirect ?><SCRIPT language="javascript"> document.location = "index.php?page=listwaypoints"; </script> <?PHP } elseif ($operation == 'create'){ $id = $_POST['id']; $sector = $_POST['sector']; $loc_x = $_POST['x']; $loc_y = $_POST['y']; $loc_z = $_POST['z']; $radius = $_POST['radius']; // insert script $query = "insert into waypoints set loc_sector_id=$sector, x='$loc_x',y='$loc_y',z='$loc_z',radius='$radius'"; $result = mysql_query2($query); // redirect ?><SCRIPT language="javascript"> document.location = "index.php?page=listwaypointss"; </script> <?PHP } elseif ($operation == 'delete'){ $id = $_POST['id']; // insert script $query = "delete from waypoints where id='$id'"; $result = mysql_query2($query); // redirect ?><SCRIPT language="javascript"> document.location = "index.php?page=listwaypoints"; </script> <?PHP }else{ // manage another operation here echo "Operation $operation not supported."; } ?> </body> </html> <? } ?> Index: waypoints_map.php =================================================================== RCS file: /cvsroot/planeshift/planeshift/www/serverconsole/waypoints/waypoints_map.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** waypoints_map.php 15 Aug 2006 23:11:38 -0000 1.3 --- waypoints_map.php 15 Oct 2006 20:02:26 -0000 1.4 *************** *** 122,127 **** echo "<h1>Waypoint Map View $sector</h1>"; ! echo "<div id=Layer2 style=\"position:absolute; width:1968px; height:954px; z-index:1; left:0px; top:90px\"><img src=\"index.php?page=waypoints_draw§or=".$sector."\" >"; ! //echo "<layer name=Layer2 left=10 top=87px><img src=psworld.jpg width=500 height=500></layer>"; $data = getDataFromArea($sector); --- 122,126 ---- echo "<h1>Waypoint Map View $sector</h1>"; ! echo "<div id=Layer2 style=\"position:absolute; width:1968px; height:954px; z-index:1; left:0px; top:150px\"><img src=\"index.php?page=waypoints_draw§or=".$sector."\" >"; $data = getDataFromArea($sector); *************** *** 186,190 **** ! echo " <FORM action=\"index.php?page=waypoints_map\" METHOD=POST>"; echo " <b>Select one area:</b> <br><br> Area: "; SelectAreas("","sector"); --- 185,189 ---- ! echo " <FORM action=\"index.php?page=waypoints_map&category={$_GET['category']}\" METHOD=POST>"; echo " <b>Select one area:</b> <br><br> Area: "; SelectAreas("","sector"); |