[Openfirst-cvscommit] awards awards.php,1.7,1.8 index.php,1.18,1.19
Brought to you by:
xtimg
From: Astronouth7303 <ast...@us...> - 2005-06-30 02:28:28
|
Update of /cvsroot/openfirst/awards In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11607/awards Modified Files: awards.php index.php Log Message: Primitive searching. Slugs still need to be implemented. awards.php now fixes ModuleManager. Index: awards.php =================================================================== RCS file: /cvsroot/openfirst/awards/awards.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** awards.php 30 Jun 2005 02:00:50 -0000 1.7 --- awards.php 30 Jun 2005 02:28:19 -0000 1.8 *************** *** 34,36 **** --- 34,39 ---- } } + + $awardmod =& new AwardModule(basename(dirname(__FILE__))); + $ogModuleManager->addModuleFromObject($awardmod); ?> Index: index.php =================================================================== RCS file: /cvsroot/openfirst/awards/index.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** index.php 30 Jun 2005 01:58:53 -0000 1.18 --- index.php 30 Jun 2005 02:28:19 -0000 1.19 *************** *** 25,36 **** include_once($Header); // Query database for award information ! $query = $ofDB->query('SELECT * FROM '.$ofDB->quoteTable('awards'). ! ' ORDER BY '.$ofDB->quoteField('Date').' DESC' ! ); $amount = $ofDB->numberOfRows($query); ?> <h1>Team Awards</h1> ! <p>This team has won <b><?php echo $amount; ?></b> award(s).</p> <?php // If more then one award is present then show the values --- 25,68 ---- include_once($Header); + $where = array(); + if (isset($_REQUEST['id'])) { + $where[] = $ofDB->quoteField('ID').'='.$ofDB->quoteData($_REQUEST['id']); + } + if (isset($_REQUEST['name'])) { + $where[] = $ofDB->quoteField('AwardName').'='.$ofDB->quoteData($_REQUEST['name']); + } + if (isset($_REQUEST['event'])) { + $where[] = $ofDB->quoteField('Event').'='.$ofDB->quoteData($_REQUEST['event']); + } + if (isset($_REQUEST['date'])) { + $where[] = $ofDB->quoteField('Date').'='.$ofDB->quoteData($_REQUEST['date']); + } + if (isset($_REQUEST['recipient'])) { + $where[] = $ofDB->quoteField('Recipient').'='.$ofDB->quoteData($_REQUEST['recipient']); + } + if (isset($_REQUEST['image'])) { + $where[] = $ofDB->quoteField('Image').'='.$ofDB->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[] = $ofDB->quoteField('FIRSTAward').'='.$ofDB->quoteData($first); + } + + // Query database for award information ! $sql = 'SELECT * FROM '.$ofDB->quoteTable('awards'). ! ((count($where) > 0) ? ' WHERE '.implode(' OR ', $where) : ''). ! ' ORDER BY '.$ofDB->quoteField('Date').' DESC'; ! $query = $ofDB->query($sql); ! if ($query === false) { ! echo $ofDB->errorNumber().': '.$ofDB->errorString().'<br />'; ! var_dump($sql); ! } $amount = $ofDB->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 |