[Openfirst-cvscommit] awards/admin index.php,NONE,1.1
Brought to you by:
xtimg
From: <dav...@us...> - 2003-06-08 01:49:41
|
Update of /cvsroot/openfirst/awards/admin In directory sc8-pr-cvs1:/tmp/cvs-serv7573/admin Added Files: index.php Log Message: initial upload --- NEW FILE: index.php --- <?php /* * openFIRST.awards - manage.php * * Copyright (C) 2003, * openFIRST Project * Original Author: David Di Biase <dav...@ea...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ include("../config/globals.php"); include($header); mysql_select_db("openFIRST",$sqlconnection); // Check if user is an admin then allow processes if (isset($user->user)){ // If user has posted delete then delete specified record in querystring DELETE if (ISSET($_GET['DELETE'])){ mysql_query("DELETE FROM ofirst_awards WHERE ID = '".$_GET['DELETE']."'") or die("DELETE: ".mysql_error()); die("<br><br><center>Award information has been deleted. [ <a href='manage.php'>Manage Award</a> ]"); } // If user has posted create then insert new award record if (ISSET($_POST['create'])){ mysql_query("INSERT INTO ofirst_awards (AwardName,Event,Date,Image,Recipient) values( '".$_POST['award']."' ,'".$_POST['event']."' ,'".$_POST['date']."' ,'".$_POST['type']."' ,'".$_POST['recipient']."')") or die("INSERT: ".mysql_error()); die("<br><br><center>Congratulations on your new award. Award submitted! [ <a href='manage.php'>Manage Award</a> ]"); } ?> <h1>Manage Award Information</h1> <p><a href="manage.php">Manage Awards </a> <a href="awards.php">View Awards</a> <?php membersmenu($user->membertype); ?></p> <form name="form1" method="post" action="manage.php"> <table width="500" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#999999"> <tr bgcolor="#999999"> <td width="142"> </td> <td width="248"><font color="#FFFFFF">Add A New Award</font></td> </tr> <tr> <td><div align="right">Award Name:</div></td> <td><input name="award" type="text" id="award"></td> </tr> <tr> <td><div align="right">Regional/Event:</div></td> <td><input name="event" type="text" id="event"></td> </tr> <tr> <td><div align="right">Date:</div></td> <td><input name="date" type="text" id="date" value="<?php echo date("Y-n-j"); ?>" size="10"> <font size="2">(Use this syntax: Year-Month-Day)</font></td> </tr> <tr> <td><div align="right">Recipient:</div></td> <td><input name="recipient" type="text" id="recipient" value="Team Award"></td> </tr> <tr> <td><div align="right">Award Type:</div></td> <td><table width="75%" border="0" cellspacing="0" cellpadding="4"> <tr> <td><div align="center"><img src="awardsgold.png" alt="Gold" width="25" height="30"></div></td> <td><div align="center"><img src="awardssilver.png" alt="Silver" width="25" height="30"></div></td> <td><div align="center"><img src="awardsbronze.png" alt="Bronze" width="25" height="30"></div></td> </tr> <tr> <td><div align="center"> <input name="type" type="radio" value="gold" checked> </div></td> <td><div align="center"> <input type="radio" name="type" value="silver"> </div></td> <td><div align="center"> <input type="radio" name="type" value="bronze"> </div></td> </tr> </table></td> </tr> <tr> <td> </td> <td><input name="create" type="submit" id="create" value="Create Listing"></td> </tr> </table> </form> <table width="600" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#999999"> <tr bgcolor="#999999"> <td> </td> <td width="152"><center><font color="#FFFFFF">Award Name</font><center></td> <td width="95"><center><font color="#FFFFFF">Event</font><center></td> <td width="84"><center><font color="#FFFFFF">Date</font><center></td> <td width="118"><center><font color="#FFFFFF">Recipient</font><center></td> <td width="89"><center><font color="#FFFFFF">Option</font><center></td> </tr> <?php // Loop through awards ordered by date $query = mysql_query("SELECT * FROM ofirst_awards ORDER BY Date"); while($awards = mysql_fetch_object($query)){ ?> <tr> <td><img src="awards<?php echo $awards->Image; ?>.png" alt="<?php echo $awards->Image; ?>"></td> <td><?php echo $awards->AwardName; ?></td> <td><?php echo $awards->Event; ?></td> <td><?php echo $awards->Date; ?></td> <td><?php echo $awards->Recipient; ?></td> <td><div align="center">[ <a href='manage.php?DELETE=<?php echo $awards->ID; ?>'>Delete</a> ]</div></td> </tr> <? } ?> </table> <?php }else{ showlogin(); } include($footer); ?> |