[Openfirst-cvscommit] awards/admin index.php,1.22,1.23
Brought to you by:
xtimg
From: Astronouth7303 <ast...@us...> - 2005-05-26 23:27:14
|
Update of /cvsroot/openfirst/awards/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25446/awards/admin Modified Files: index.php Log Message: updates Index: index.php =================================================================== RCS file: /cvsroot/openfirst/awards/admin/index.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** index.php 26 May 2005 21:00:31 -0000 1.22 --- index.php 26 May 2005 23:27:05 -0000 1.23 *************** *** 56,72 **** $DisplayForm = false; } // If user has posted create then insert new award record if ($CreateNew && !$DisplayForm){ ! if($_POST['award']!="" || (isset($_POST['firstaward']) && $_POST['firstaward'] == '1')){ ! if($_POST['firstaward'] == "1") { $faq = ofirst_dbquery('SELECT * FROM '. ofirst_dbquote_table('firstawards'). ! ' WHERE ' ofirst_dbquote_name('AwardName'). '='. ! ofirst_dbquote_data($_POST['firstawardname'])); $fa = ofirst_dbfetch_object($faq); ! $_POST['award'] = $fa->AwardName; ! $_POST['description'] = $fa->Description; } --- 56,88 ---- $DisplayForm = false; } + + $firstaward = false; + if (isset($_POST['firstaward'])) $firstaward = $_POST['firstaward'] == '1' ? true : false; + $award = ''; + if (isset($_POST['award'])) $award = $_POST['award']; + $event = ''; + if (isset($_POST['event'])) $event = $_POST['event']; + $date = date('Y-n-j'); + if (isset($_POST['date'])) $date = $_POST['date']; + $recipient = ''; + if (isset($_POST['recipient'])) $recipient = $_POST['recipient']; + $description = ''; + if (isset($_POST['description'])) $description = $_POST['description']; + $type = 'gold'; + if (isset($_POST['type'])) $type = $_POST['type']; + // If user has posted create then insert new award record if ($CreateNew && !$DisplayForm){ ! if ($award != "" || $firstaward){ ! if($firstaward) { $faq = ofirst_dbquery('SELECT * FROM '. ofirst_dbquote_table('firstawards'). ! ' WHERE '. ofirst_dbquote_name('AwardName'). '='. ! ofirst_dbquote_data($firstaward)); $fa = ofirst_dbfetch_object($faq); ! $award = $fa->AwardName; ! $description = $fa->Description; } *************** *** 74,80 **** ofirst_dbquote_table('awards').' ('. ofirst_dbquote_name(array('AwardName', 'FIRSTAward', 'Event', 'Date', 'Image', 'Description', 'Recipient')). ! ') values(' ! ofirst_dbquote_data(array($_POST['award'],$_POST['firstaward'],$_POST['event'],$_POST['date'],$_POST['type'],$_POST['description'],$_POST['recipient'])). ! ')'; #or die("INSERT: ".ofirst_dberror()) or die(trigger_error('an openFIRST DB error')) --- 90,96 ---- ofirst_dbquote_table('awards').' ('. ofirst_dbquote_name(array('AwardName', 'FIRSTAward', 'Event', 'Date', 'Image', 'Description', 'Recipient')). ! ') values('. ! ofirst_dbquote_data(array($award, $firstaward, $event, $date, $type, $description, $recipient)). ! ')') #or die("INSERT: ".ofirst_dberror()) or die(trigger_error('an openFIRST DB error')) *************** *** 91,114 **** if (!$CreateNew && !$DisplayForm){ ! if($_POST['award']!="" || (isset($_POST['firstaward']) && $_POST['firstaward'] == '1')){ ! if($_POST['firstaward'] == "1") { $faq = ofirst_dbquery('SELECT * FROM '.ofirst_dbquote_table('awards').' WHERE '. ofirst_dbquote_name('AwardName').'='. ! ofirst_dbquote_data($_POST['firstawardname'])); $fa = ofirst_dbfetch_object($faq); ! $_POST['award'] = $fa->AwardName; ! $_POST['description'] = $fa->Description; } ofirst_dbquery('UPDATE '.ofirst_dbquote_table('awards').' SET '. ofirst_dbquote_fd_pairs(array( ! 'AwardName' => $_POST['award'], ! 'FIRSTAward' => $_POST['firstaward'], ! 'Event' => $_POST['event'], ! 'Date' => $_POST['date'], ! 'Image' => $_POST['type'], ! 'Description' => $_POST['description'], ! 'Recipient' => $_POST['recipient'])). ! ' WHERE '.ofirst_dbquote_name('ID').'='.ofirst_dbquote_data($_POST['AwardID'])) or die("UPDATE: ".ofirst_dberror()); --- 107,130 ---- if (!$CreateNew && !$DisplayForm){ ! if ($award != "" || $firstaward){ ! if ($firstaward) { $faq = ofirst_dbquery('SELECT * FROM '.ofirst_dbquote_table('awards').' WHERE '. ofirst_dbquote_name('AwardName').'='. ! ofirst_dbquote_data($firstawardname)); $fa = ofirst_dbfetch_object($faq); ! $award = $fa->AwardName; ! $description = $fa->Description; } ofirst_dbquery('UPDATE '.ofirst_dbquote_table('awards').' SET '. ofirst_dbquote_fd_pairs(array( ! 'AwardName' => $award, ! 'FIRSTAward' => $firstaward, ! 'Event' => $event, ! 'Date' => $date, ! 'Image' => $type, ! 'Description' => $description, ! 'Recipient' => $recipient)). ! ' WHERE '.ofirst_dbquote_name('ID').'='.ofirst_dbquote_data(AwardID)) or die("UPDATE: ".ofirst_dberror()); *************** *** 123,127 **** // If the user has elected to modify an award, fill the form with those details. if(!$CreateNew) { ! $award = ofirst_dbfetch_object(ofirst_dbquery('SELECT * FROM '.ofirst_dbquote_table('awards').' WHERE '.ofirst_dbquote_name('ID').'='.ofirst_dbquote_data($_POST['AwardID']))); $award->template = false; --- 139,143 ---- // If the user has elected to modify an award, fill the form with those details. if(!$CreateNew) { ! $award = ofirst_dbfetch_object(ofirst_dbquery('SELECT * FROM '.ofirst_dbquote_table('awards').' WHERE '.ofirst_dbquote_name('ID').'='.ofirst_dbquote_data('AwardID'))); $award->template = false; *************** *** 142,148 **** <form method="post" action="index.php"> <table> <tr> ! <th> </th> ! <th><?php if (!$award->template) { echo("Modify an Existing Award --- 158,169 ---- <form method="post" action="index.php"> <table> + <colgroup> + <col /> + </colgroup> + <colgroup> + <col /> + </colgroup> <tr> ! <th colspan="2"><?php if (!$award->template) { echo("Modify an Existing Award *************** *** 155,181 **** <tr> <th>Award Name</th> ! <td> ! <input type='radio' name='firstaward' value='1' <?php if ($award->FIRSTAward) echo 'checked="checked"'; ?>> FIRST Award ! <select name='firstawardname'> ! <?php ! $faq = ofirst_dbquery('SELECT * FROM '.ofirst_dbquote_table('awards').' ORDER BY '.ofirst_dbquote_name('AwardName')); ! while($fa = ofirst_dbfetch_object($faq)) { ! echo "<option value='$fa->AwardName'"; ! if ($award->AwardName == $fa->AwardName) echo 'selected'; ! echo ">$fa->AwardName</option>"; ! } ! ?> ! </select> ! <br /><input type='radio' name='firstaward' value='1' <?php if (!$award->FIRSTAward) echo 'checked="checked"'; ?>> Custom Award ! <input name="award" type="text" id="award" value="<?php if (!$award->FIRSTAward) echo $award->AwardName; ?>"> </td> </tr> <tr> <th>Regional/Event</th> ! <td><input name="event" type="text" id="event" value="<?php echo $award->Event; ?>"></td> </tr> <tr> <th>Date</th> ! <td><input name="date" type="text" id="date" value="<?php echo $award->Date; ?>" size="10"> --- 176,220 ---- <tr> <th>Award Name</th> ! <td class="left"> ! <table class="no-space left"> ! <tr> ! <td> ! <input type='radio' name='firstaward' value='1' <?php if ($award->FIRSTAward) echo 'checked="checked"'; ?>> ! </td> ! <td> FIRST Award</td> ! </td> ! <td> ! <select name='firstawardname'> ! <?php ! $faq = ofirst_dbquery('SELECT * FROM '.ofirst_dbquote_table('awards').' ORDER BY '.ofirst_dbquote_name('AwardName')); ! while($fa = ofirst_dbfetch_object($faq)) { ! echo "<option value='$fa->AwardName'"; ! if ($award->AwardName == $fa->AwardName) echo 'selected'; ! echo ">$fa->AwardName</option>"; ! } ! ?> ! </select> ! </td> ! </tr> ! <tr> ! <td> ! <input type='radio' name='firstaward' value='0' <?php if (!$award->FIRSTAward) echo 'checked="checked"'; ?>> ! </td> ! <td> Custom Award</td> ! </td> ! <td> ! <input name="award" type="text" id="award" value="<?php if (!$award->FIRSTAward) echo $award->AwardName; ?>"> ! </td> ! </tr> ! </table> </td> </tr> <tr> <th>Regional/Event</th> ! <td class="left"><input name="event" type="text" id="event" value="<?php echo $award->Event; ?>"></td> </tr> <tr> <th>Date</th> ! <td class="left"><input name="date" type="text" id="date" value="<?php echo $award->Date; ?>" size="10"> *************** *** 184,188 **** <tr> <th>Recipient</th> ! <td><input name="recipient" type="text" id="recipient" value="<?php echo $award->Recipient; ?>"></td> --- 223,227 ---- <tr> <th>Recipient</th> ! <td class="left"><input name="recipient" type="text" id="recipient" value="<?php echo $award->Recipient; ?>"></td> *************** *** 194,202 **** <tr> <th>Award Type</th> ! <td><table> <tr> ! <td><img src="<?php echo($basepath); ?>/awards/awardsgold.png" alt="Gold"></td> ! <td><img src="<?php echo($basepath); ?>/awards/awardssilver.png" alt="Silver"></td> ! <td><img src="<?php echo($basepath); ?>/awards/awardsbronze.png" alt="Bronze"></td> </tr> <tr> --- 233,241 ---- <tr> <th>Award Type</th> ! <td class="left"><table> <tr> ! <td><img src="<?php echo($BasePath); ?>/awards/awardsgold.png" alt="Gold"></td> ! <td><img src="<?php echo($BasePath); ?>/awards/awardssilver.png" alt="Silver"></td> ! <td><img src="<?php echo($BasePath); ?>/awards/awardsbronze.png" alt="Bronze"></td> </tr> <tr> *************** *** 220,229 **** </tr> <tr> ! <th> </th> <?php if($award->template) { ?> ! <td><input name="create" type="submit" id="create" value="Create Award"></td> <?php } else { ?> ! <td><input name="modify" type="submit" id="modify" value="Modify Award"></td> <?php } ?> </tr> </table> --- 259,269 ---- </tr> <tr> ! <td colspan="2" class="center"> <?php if($award->template) { ?> ! <input name="create" type="submit" id="create" value="Create Award"> <?php } else { ?> ! <input name="modify" type="submit" id="modify" value="Modify Award"></td> <?php } ?> + </td> </tr> </table> *************** *** 231,236 **** <table> <tr> ! <th> </th> ! <th>Award Name</th> <th>Event</th> <th>Date</th> --- 271,275 ---- <table> <tr> ! <th colspan="2">Award Name</th> <th>Event</th> <th>Date</th> *************** *** 244,248 **** ?> <tr> ! <td><img src="<?php echo($basepath); ?>/awards/awards<?php echo $awards->Image; ?>.png" alt="<?php echo $awards->Image; ?>"></td> <td><?php echo $awards->AwardName; ?></td> <td><?php echo $awards->Event; ?></td> --- 283,287 ---- ?> <tr> ! <td><img src="<?php echo($BasePath); ?>/awards/awards<?php echo $awards->Image; ?>.png" alt="<?php echo $awards->Image; ?>"></td> <td><?php echo $awards->AwardName; ?></td> <td><?php echo $awards->Event; ?></td> *************** *** 266,269 **** showlogin(); } ! include_once($footer); ?> --- 305,308 ---- showlogin(); } ! include_once($Footer); ?> |