[Openfirst-cvscommit] awards index.php,1.20,1.21
Brought to you by:
xtimg
From: Jamie <ast...@us...> - 2006-02-23 16:55:16
|
Update of /cvsroot/openfirst/awards In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3955/awards Modified Files: index.php Log Message: Fixes in variable names Index: index.php =================================================================== RCS file: /cvsroot/openfirst/awards/index.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** index.php 30 Jun 2005 03:28:30 -0000 1.20 --- index.php 23 Feb 2006 16:55:01 -0000 1.21 *************** *** 1,103 **** ! <?php ! /* ! * openFIRST.awards - index.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. ! * ! * 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_once("../includes/globals.php"); ! include_once($Header); ! ! $where = array(); ! if (isset($_REQUEST['id'])) { ! $where[] = $ogDB->quoteField('ID').'='.$ogDB->quoteData($_REQUEST['id']); ! } ! if (isset($_REQUEST['name'])) { ! $where[] = $ogDB->quoteField('AwardName').'='.$ogDB->quoteData($_REQUEST['name']); ! } ! if (isset($_REQUEST['event'])) { ! $where[] = $ogDB->quoteField('Event').'='.$ogDB->quoteData($_REQUEST['event']); ! } ! if (isset($_REQUEST['date'])) { ! $where[] = $ogDB->quoteField('Date').'='.$ogDB->quoteData($_REQUEST['date']); ! } ! if (isset($_REQUEST['recipient'])) { ! $where[] = $ogDB->quoteField('Recipient').'='.$ogDB->quoteData($_REQUEST['recipient']); ! } ! if (isset($_REQUEST['image'])) { ! $where[] = $ogDB->quoteField('Image').'='.$ogDB->quoteData($_REQUEST['image']); ! } ! if (isset($_REQUEST['first'])) { ! $firstarg = trim($_REQUEST['first']); ! if (strcasecmp($firstarg, 'yes') == 0 || strcasecmp($firstarg, 'y') == 0 || strcasecmp($firstarg, 1) == 0 || strcasecmp($firstarg, 'true' ) == 0) $first = true; ! if (strcasecmp($firstarg, 'no' ) == 0 || strcasecmp($firstarg, 'n') == 0 || strcasecmp($firstarg, 0) == 0 || strcasecmp($firstarg, 'false') == 0) $first = false; ! $where[] = $ogDB->quoteField('FIRSTAward').'='.$ogDB->quoteData($first); ! } ! ! ! // Query database for award information ! $sql = 'SELECT * FROM '.$ogDB->quoteTable('awards'). ! ((count($where) > 0) ? ' WHERE '.implode(' OR ', $where) : ''). ! ' ORDER BY '.$ogDB->quoteField('Date').' DESC'; ! $query = $ogDB->query($sql); ! if ($query === false) { ! echo $ogDB->errorNumber().': '.$ogDB->errorString().'<br />'; ! var_dump($sql); ! } ! $amount = $ogDB->numberOfRows($query); ! ?> ! <h1>Team Awards</h1> ! <p>This team has won <b><?php echo $amount; ?></b> award(s)<?php if (count($where) > 0) echo ' that fit the criteria'; ?>.</p> ! <?php ! // If more then one award is present then show the values ! if($amount > 0) { ! ?> ! <table> ! <tr> ! <th colspan="2">Award Name</th> ! <th>Event</th> ! <th>Date</th> ! <th>Recipient</th> ! </tr> ! <?php ! // Loop through awards ordered by date ! while($awards = $ogDB->fetchObject($query)){ ! ?> ! <tr valign="top"> ! <td> ! <img src="awards<?php echo $awards->Image; ?>.png" alt="<?php echo $awards->Image; ?>" /> ! <?php if ($awards->FIRSTAward) { ?><img src="awardsfirst.gif" /><?php } ?> ! </td> ! <td> ! <h3><?php echo $awards->AwardName; ?></h3> ! <p><?php echo $awards->Description; ?></p> ! </td> ! <td><?php echo $awards->Event; ?></td> ! <td><?php echo $awards->Date; ?></td> ! <td><?php echo $awards->Recipient; ?></td> ! </tr> ! <?php } ?> ! </table> ! ! <?php ! } ! $ogDB->freeResult($query); ! ! include_once($Footer); ! ?> --- 1,103 ---- ! <?php ! /* ! * openFIRST.awards - index.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. ! * ! * 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_once("../includes/globals.php"); ! include_once($ogHeader); ! ! $where = array(); ! if (isset($_REQUEST['id'])) { ! $where[] = $ogDB->quoteField('ID').'='.$ogDB->quoteData($_REQUEST['id']); ! } ! if (isset($_REQUEST['name'])) { ! $where[] = $ogDB->quoteField('AwardName').'='.$ogDB->quoteData($_REQUEST['name']); ! } ! if (isset($_REQUEST['event'])) { ! $where[] = $ogDB->quoteField('Event').'='.$ogDB->quoteData($_REQUEST['event']); ! } ! if (isset($_REQUEST['date'])) { ! $where[] = $ogDB->quoteField('Date').'='.$ogDB->quoteData($_REQUEST['date']); ! } ! if (isset($_REQUEST['recipient'])) { ! $where[] = $ogDB->quoteField('Recipient').'='.$ogDB->quoteData($_REQUEST['recipient']); ! } ! if (isset($_REQUEST['image'])) { ! $where[] = $ogDB->quoteField('Image').'='.$ogDB->quoteData($_REQUEST['image']); ! } ! if (isset($_REQUEST['first'])) { ! $firstarg = trim($_REQUEST['first']); ! if (strcasecmp($firstarg, 'yes') == 0 || strcasecmp($firstarg, 'y') == 0 || strcasecmp($firstarg, 1) == 0 || strcasecmp($firstarg, 'true' ) == 0) $first = true; ! if (strcasecmp($firstarg, 'no' ) == 0 || strcasecmp($firstarg, 'n') == 0 || strcasecmp($firstarg, 0) == 0 || strcasecmp($firstarg, 'false') == 0) $first = false; ! $where[] = $ogDB->quoteField('FIRSTAward').'='.$ogDB->quoteData($first); ! } ! ! ! // Query database for award information ! $sql = 'SELECT * FROM '.$ogDB->quoteTable('awards'). ! ((count($where) > 0) ? ' WHERE '.implode(' OR ', $where) : ''). ! ' ORDER BY '.$ogDB->quoteField('Date').' DESC'; ! $query = $ogDB->query($sql); ! if ($query === false) { ! echo $ogDB->errorNumber().': '.$ogDB->errorString().'<br />'; ! var_dump($sql); ! } ! $amount = $ogDB->numberOfRows($query); ! ?> ! <h1>Team Awards</h1> ! <p>This team has won <b><?php echo $amount; ?></b> award(s)<?php if (count($where) > 0) echo ' that fit the criteria'; ?>.</p> ! <?php ! // If more then one award is present then show the values ! if($amount > 0) { ! ?> ! <table> ! <tr> ! <th colspan="2">Award Name</th> ! <th>Event</th> ! <th>Date</th> ! <th>Recipient</th> ! </tr> ! <?php ! // Loop through awards ordered by date ! while($awards = $ogDB->fetchObject($query)){ ! ?> ! <tr valign="top"> ! <td> ! <img src="awards<?php echo $awards->Image; ?>.png" alt="<?php echo $awards->Image; ?>" /> ! <?php if ($awards->FIRSTAward) { ?><img src="awardsfirst.gif" /><?php } ?> ! </td> ! <td> ! <h3><?php echo $awards->AwardName; ?></h3> ! <p><?php echo $awards->Description; ?></p> ! </td> ! <td><?php echo $awards->Event; ?></td> ! <td><?php echo $awards->Date; ?></td> ! <td><?php echo $awards->Recipient; ?></td> ! </tr> ! <?php } ?> ! </table> ! ! <?php ! } ! $ogDB->freeResult($query); ! ! include_once($ogFooter); ! ?> |