<?php require_once 'includes/globals.inc'; emitTop('Peanut Butter -> Latest Posts', $_SERVER['PHP_SELF']); if (isset($_GET['start'])) { escapes('start', $_GET['start']); } else { escapes('start', 0); } $where = ''; $matchColl = new MatchCollection("AND"); $owner = '+ALL'; $project = '+ALL'; if (isset($_GET['owner']) && $_GET['owner'] != '+ALL') { escapes('owner', $_GET['owner']); $matchColl->addMatch(new Match('user', $mowner)); } if (isset($_GET['project']) && $_GET['project'] != '+ALL') { escapes('project', $_GET['project']); $matchColl->addMatch(new Match('name', $mproject)); } $whereSQL = $matchColl->toSQL(); mysqlSetup(); $sqlquery = "SELECT DISTINCT `user` " . "FROM `pb_blog` ORDER BY `user` ASC"; $result = mysql_query($sqlquery) or die('Invalid query: ' . mysql_error()); ?> <table> <tr> <td> <form name="selectOwner" method="get" action="<?php
<th>Project Name</th> <th>Owner</th> <th>Status</th> <th>Progress</th> <th>Priority</th> <th>Description</th> </tr> <?php $where = ''; $matchColl = new MatchCollection("AND"); $statiMC = new MatchCollection("OR"); foreach ($statusSelected as $status) { $statiMC->addMatch(new Match('Status', $status)); } $matchColl->addMatch($statiMC); if (isset($_GET['owner']) && $_GET['owner'] != '+ALL') { $mOwner = mysql_escape_string($_GET['owner']); $matchColl->addMatch(new Match('owner', $mOwner)); } if ($keyname != '') { $words = explode(',', $keywords); foreach ($words as $word) { $matchColl->addMatch(new Match('Keywords', '%' . mysql_escape_string($word) . '%', 'LIKE')); } } $whereSQL = $matchColl->toSQL(); $sqlquery = "SELECT `name`, LEFT(`description`,80),`status`,`progress`,`priority`,`owner`,`id` FROM " . "`pb_projects` WHERE {$whereSQL} ORDER BY `priority` DESC"; $result = mysql_query($sqlquery) or die('Invalid query: ' . mysql_error()); $rownum = 0; while ($row = mysql_fetch_row($result)) {
print "\t<th>Name:</th>\n"; print "\t<td><input type=\"text\" name=\"keyname\" size=\"80\" /></td>\n"; print "</tr><tr>\n"; print "\t<th>Keywords:</th>\n"; print "\t<td><input type=\"text\" name=\"keywords\" value=\"{$keywords}\" size=\"100\"/></td>\n"; print "</tr>\n</table>\n"; print "<input type=\"submit\" name=\"newsearch\" value=\"Try Search\" />"; print "<input type=\"submit\" name=\"savesearch\" value=\"Save Search\" />"; print "</form>\n"; if ($keywords != '') { $mKeywords = mysql_escape_string($keywords); mysqlSetup(); $matchColl = new MatchCollection("AND"); $words = explode(',', $keywords); foreach ($words as $word) { $matchColl->addMatch(new Match('Keywords', '%' . mysql_escape_string($word) . '%', 'LIKE')); } $whereSQL = $matchColl->toSQL(); $sqlquery = "SELECT `name`, LEFT(`description`,100),`status`,`progress`,`priority`,`owner`,`id` FROM " . "`pb_projects` WHERE {$whereSQL} ORDER BY `priority` DESC"; $result = mysql_query($sqlquery) or die('Invalid query: ' . mysql_error()); ?> <table id="projectlist" class="list"> <tr> <th>Project Name</th> <th>Owner</th> <th>Status</th> <th>Progress</th> <th>Priority</th> <th>Description</th> </tr>
} print "\t<th>Name:</th>\n"; print "\t<td><input type=\"text\" name=\"keyname\" size=\"80\" value=\"{$name}\" /></td>\n"; print "</tr><tr>\n"; print "\t<th>Keywords:</th>\n"; print "\t<td><input type=\"text\" name=\"keywords\" value=\"{$keywords}\" size=\"100\"/></td>\n"; print "</tr>\n</table>\n"; print "<input type=\"submit\" name=\"newsearch\" value=\"Try Search\" />"; print "<input type=\"submit\" name=\"savesearch\" value=\"Save Search\" />"; print "</form>\n"; if ($keywords != '') { mysqlSetup(); $matchColl = new MatchCollection("AND"); $words = explode(',', $mkeywords); foreach ($words as $word) { $matchColl->addMatch(new Match('Keywords', '%' . $word . '%', 'LIKE')); } $whereSQL = $matchColl->toSQL(); $sqlquery = "SELECT `name`, LEFT(`description`,100),`status`,`progress`,`priority`,`owner`,`id` FROM " . "`pb_projects` WHERE {$whereSQL} ORDER BY `priority` DESC"; $result = mysql_query($sqlquery) or die('Invalid query: ' . mysql_error()); ?> <table id="projectlist" class="list"> <tr> <th>Project Name</th> <th>Owner</th> <th>Status</th> <th>Progress</th> <th>Priority</th> <th>Description</th> </tr>