コード例 #1
0
ファイル: latestPosts.php プロジェクト: noahrichards/pb
<?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 
コード例 #2
0
ファイル: projectNewSearch.php プロジェクト: noahrichards/pb
<?php 
if (isset($_POST['keywords'])) {
    $keywords = $_POST['keywords'];
    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>
コード例 #3
0
ファイル: projectEditSearch.php プロジェクト: noahrichards/pb
} else {
    escapes('keywords', $_POST['keywords']);
    escapes('name', $_POST['name']);
}
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>
コード例 #4
0
ファイル: projectOverview.php プロジェクト: noahrichards/pb
</form>
</td></tr></table>

<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>

<?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'));
    }
}
コード例 #5
0
ファイル: Glicko2.php プロジェクト: zelenin/glicko2
 /**
  * @param MatchCollection $matchCollection
  */
 public function calculateMatches(MatchCollection $matchCollection)
 {
     foreach ($matchCollection->getMatches() as $match) {
         $this->calculateMatch($match);
     }
 }