本文整理汇总了PHP中displayResults函数的典型用法代码示例。如果您正苦于以下问题:PHP displayResults函数的具体用法?PHP displayResults怎么用?PHP displayResults使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了displayResults函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
function main()
{
global $numEpochs;
global $numPatterns;
global $patNum;
global $RMSerror;
// initiate the weights
initWeights();
// load in the data
initData();
// train the network
for ($j = 0; $j <= $numEpochs; $j++) {
for ($i = 0; $i < $numPatterns; $i++) {
//select a pattern at random
//srand();
$patNum = rand(0, $numPatterns - 1);
//calculate the current network output
//and error for this pattern
calcNet();
//change network weights
WeightChangesHO();
WeightChangesIH();
}
//display the overall network error
//after each epoch
calcOverallError();
if (gmp_mod($j, 50) == 0) {
print "epoch = " . $j . " RMS Error = " . $RMSerror . "</br>";
}
}
//training has finished
//display the results
displayResults();
}
示例2: showResults
function showResults($array, $teamFor, $teamAgainst)
{
$complete = FALSE;
foreach ($array as $value) {
if ($value['Team One'] == $teamFor) {
if ($value['Team Two'] == $teamAgainst) {
displayResults($value);
$complete = TRUE;
}
}
}
if ($complete == FALSE) {
echo "Bad Selection";
}
}
示例3: findSavings
function findSavings()
{
$row = $_POST['row'];
$implode = implode(',', $row);
$explode = explode(',', $implode);
$itemNumber = $explode[0];
$retail = $explode[5];
$selectPromotionsForItemStatement = "Select * From PromotionItem WHERE ItemNumber = '" . $itemNumber . "'";
$promotionItemResult = mysql_query($selectPromotionsForItemStatement);
//Test whether the queries were successful
if (!$promotionItemResult) {
$promotionItemMessage = "The retrieval of promotion items was unsuccessful: ";
}
$numberPromotionItemRows = mysql_num_rows($promotionItemResult);
// Check if results turned out empty
$promotionItemMessage = "";
if ($numberPromotionItemRows == 0) {
$promotionItemMessage = "No items found in database";
}
$bestPromo = $retail;
$bestPrice = "none";
$adEvent = "none";
while ($row = mysql_fetch_assoc($promotionItemResult)) {
$promoCode = $row['PromoCode'];
$salePrice = $row['SalePrice'];
if ($salePrice < $bestPrice) {
$selectAdEventsForPromotionStatement = "Select * From AdEventPromotion WHERE PromoCode = '" . $promoCode . "'";
$adEventPromotionResult = mysql_query($selectAdEventsForPromotionStatement);
//Test whether the queries were successful
if (!$adEventPromotionResult) {
$adEventPromotionMessage = "The retrieval of promotion items was unsuccessful: ";
}
$numberAdEventPromotionRows = mysql_num_rows($adEventPromotionResult);
// Check if results turned out empty
$adEventPromotionMessage = "";
if ($numberAdEventPromotionRows == 0) {
$adEventPromotionMessage = "No items found in database";
} else {
$result = mysql_fetch_assoc($adEventPromotionResult);
$eventCode = $result['EventCode'];
$bestPrice = $salePrice;
$bestPromo = $promoCode;
$adEvent = $eventCode;
}
}
}
displayResults($itemNumber, $retail, $bestPrice, $bestPromo, $adEvent);
}
示例4: leagueHandler
$leagueID = leagueHandler($_POST, $userID);
debug("League is {$leagueID}");
$season = getSeason();
?>
To join a league, choose the league you're looking to join, the password provided by its administrator, and the name of your team. You can only join a league once. If a league's registration deadline has passed, it does not appear on the list.<p/>
<?php
debug($_POST["action"]);
if ($_POST["action"] == "leagueEnroll") {
$pass = getSingleton("fch_leagues", "pw", " where id = " . $_POST['leagueID'] . " and season = \"" . getSeason() . "\"");
debug("Criteria -- displName=" . $_POST["teamDisplayName"] . " pw=" . $_POST['password'] . " pass=" . $pass);
if ($_POST['password'] == $pass && strlen($_POST["teamDisplayName"]) > 0) {
echo displayResults(addGMToLeague($_POST["leagueID"], $userID, $_POST["teamDisplayName"]));
} else {
echo displayResults(getReturnCode(0, "Sorry, your password was incorrect or you didn't enter a team name."));
}
}
?>
<div class="contact-form">
<form name="leagueEnroll" method="post" class="form-validate form-horizontal" >
<input name = "action" value = "leagueEnroll" type = "hidden">
<fieldset>
<legend>What League Would You Like to Join?</legend>
<div class="control-group">
<div class="control-label">
<label id="jform_contact_name-lbl" for="jform_contact_name" class="hasTooltip required" title="<strong>Name</strong><br />Your name.">
League</label>
</div>
示例5: displayResults
}
}
if ($_POST["action"] == "removeGM") {
if (!okToTransact($_POST["transactionID"])) {
echo displayResults(getReturnCode(0, "This transaction has already been completed. Please do not use the refresh button."));
} else {
$gmToDelete = intval($_POST["gmToDelete"]);
debug("Removing {$gmToDelete} from league {$leagueID}");
$r = executeGenericSQL("UPDATE fch_league_membership SET status = \"removed\" WHERE userID = {$gmToDelete} and {$leagueID} = leagueID and season = \"{$season}\"");
if ($r != -1) {
$r = executeGenericSQL("UPDATE fch_rosters SET releaseDate = DATE_ADD(CURRENT_TIMESTAMP, INTERVAL +3 HOUR) where userID = {$gmToDelete} and leagueID = {$leagueID} and releaseDate is NULL and season = \"{$season}\" ");
if ($r != -1) {
echo displayResults(getReturnCode(1, "Successfully removed this GM."));
}
} else {
echo displayResults(getReturnCode(0, "There has been an error releasing this GM's players."));
}
}
setTransactionComplete($_POST["transactionID"]);
}
?>
<h3>More Admin Tools Coming Soon.</h3>
<h4>Registration Deadline</h4>
<?php
echo getSingleton("fch_leagues", "registrationDeadline", " WHERE id = {$leagueID} and season = \"{$season}\"");
?>
示例6: displayResults
echo "<div class=\"row-fluid\">";
echo "<div class=\"span3\">";
//echo "<h2 class=\"text-center\">Cluster 1<br /></h2>";
echo "<p class=\"text-center\"><b>Keywords:" . "</b><br />{$titlesCluster1}<br />";
displayResults($cluster1);
echo "</div>";
echo "<div class=\"span3\">";
//echo "<h2 class=\"text-center\">Cluster 2<br /></h2>";
echo "<p class=\"text-center\"><b>Keywords: " . "</b><br />{$titlesCluster2}<br />";
displayResults($cluster2);
echo "</div>";
echo "<div class=\"span3\">";
//echo "<h2 class=\"text-center\">Cluster 3<br /></h2>";
echo "<p class=\"text-center\"><b>Keywords: " . "</b><br />{$titlesCluster3}<br />";
displayResults($cluster3);
echo "</div>";
echo "<div class=\"span3\">";
//echo "<h2 class=\"text-center\">Cluster 4<br /></h2>";
echo "<p class=\"text-center\"><b>Keywords: " . "</b><br />{$titlesCluster4}<br />";
displayResults($cluster4);
echo "</div>";
echo "</div>";
}
//**************************************************************************
}
//check memory usage
//(not available on csserver)
//echo "<br /> " . memory_get_peak_usage() . "<br /> ";
}
//Include footer file
require 'includes/searchFooter.php';
示例7: displayResults
case "date":
$date = "'" . $_POST['sCriteria'] . "'";
$db->runQuery("select CL.lead_id , CL.customer_id ,\n first_name, last_name ,email, CL.employee_id , date, L.type\n from customer_leads CL, customers C, Leads L where\n CL.date={$date} and C.id = CL.customer_id and L.id = CL.lead_id;");
if ($db->result->num_rows > 0) {
displayResults($db);
$customerFound = 1;
} else {
echo "<script>location.href='viewEditLead.php?error=1'</script>";
}
break;
}
echo "</table></form></body></html>";
get_footer();
}
if (isset($_GET['status']) && !isset($_GET['error'])) {
$status = $_GET['status'];
echo "<html>\n <head>\n <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />\n <script type='text/javascript'>\n function changeRowColor (Row,State)\n {\n if(State)\n {\n Row.style.backgroundColor = '#E0E0E0';\n Row.style.color = 'Black';\n }\n else\n {\n Row.style.backgroundColor = '#f6f6f6';\n Row.style.color = 'Black';\n }\n }\n\n function pageRedirect(indexOfRow)\n {\n var lead = document.getElementById('leadsTable').rows[indexOfRow].cells[0].innerHTML;\n document.location.href = 'leadUpdate.php?leadID='+lead;\n\n }\n </script>\n </head>\n <body>\n <h3>Click to View / Update Lead</h3>\n <div id='profileBox'></div>\n <form action='{$PHP_SELF}' method='POST'>\n <table align='center' id='leadsTable' class='profile_sect'>\n <tr align = 'center'>\n <th>     Lead ID     </th>\n <th>     Customer ID     </th>\n <th>     First Name     </th>\n <th>     Last Name     </th>\n <th>     e-Mail ID     </th>\n <th>     Sales Person's ID     </th>\n <th>     Date     </th>\n <th>     Lead Type     </th>\n </tr>\n ";
switch ($status) {
case 'Open':
$db->runQuery("select CL.lead_id , CL.customer_id ,\n C.first_name, C.last_name ,C.email, CL.employee_id , date, L.type\n from customer_leads CL, customers C, Leads L where\n L.status = 'open' and L.id = CL.lead_id and C.id = CL.customer_id;");
break;
case 'Closed':
$db->runQuery("select CL.lead_id , CL.customer_id ,\n C.first_name, C.last_name ,C.email, CL.employee_id , date, L.type\n from customer_leads CL, customers C, Leads L where\n L.status = 'closed' and L.id = CL.lead_id and C.id = CL.customer_id;");
break;
}
displayResults($db);
}
if (isset($_GET['error'])) {
echo "<h3>ERROR: Not found!</h3>";
echo '<br/><br/><form><input type="submit" value="Try Again" onClick="history.go(-1);return true;"> </form>';
}
示例8: displayScore
$output .= displayScore($phpscore, $this->sl_get_path(), "php");
$output .= " </div>";
$output .= " <div style=\"width: 24%; float: left;\">";
$output .= displayScore($slscore, $this->sl_get_path(), "sl");
$output .= " </div>";
$output .= " <div style=\"width: 24%; float: left;\">";
$output .= displayScore($cmsscore, $this->sl_get_path(), "cms");
$output .= " </div>";
$output .= " <div style=\"width: 24%; float: left;\">";
$output .= displayScore($overallscore, $this->sl_get_path(), "overall");
$output .= " </div>";
$output .= " </div>";
$output .= "</div>";
$output .= "<div style=\"clear: both;\"></div>";
$output .= "<div style=\"width: 918px;\">";
$output .= displayResults($warnings, $pass);
$output .= "</div>";
}
/**
* Display the results in a nice looking form
*
* @param mixed $bad
* @param mixed $good
*/
function displayResults($bad, $good){
$n = "\n";
$message = "";
//$message .= "<script type=\"text/javascript\" charset=\"utf-8\">var myTabs = new mootabs('myTabs', {height: 440, width:895});</script>".$n;
$message .= "<div id=\"myTabs\">".$n;
$message .= " <ul class=\"mootabs_title\" style=\"background: url('../images/alert-icon.png');\">".$n;
示例9: getUserID
Due to the 12-hour rule, players are not available to manage here for the 12 hours immediately following the start time of a game in which their school is participating. For more information see <a href="./index.php/about/game-rules">Game Rules</a> under "Roster Moves."
<?php
$document = JFactory::getDocument();
#$document->addScript('fch-lib.js');
require_once "fch-lib.js";
require_once "fch-lib.php";
$userID = getUserID();
$leagueID = leagueHandler($_POST, $userID);
debug("League is {$leagueID}");
$season = getSeason();
if ($_POST['action'] == "doAcquire") {
echo displayResults(acquirePlayer($userID, $leagueID, $_POST['playerID'], $_POST['destination'], $_POST['position'], $_POST["transactionID"]));
}
$limit_f_a = getPositionLimit("F", "a", $leagueID);
$limit_f_b = getPositionLimit("F", "b", $leagueID);
$limit_d_a = getPositionLimit("D", "a", $leagueID);
$limit_d_b = getPositionLimit("D", "b", $leagueID);
$limit_g_a = getPositionLimit("G", "a", $leagueID);
$limit_g_b = getPositionLimit("G", "b", $leagueID);
$roster_f_a = selectCount("fch_rosters", " Where season = \"{$season}\" and leagueID = {$leagueID} and userID = {$userID} and releaseDate is null and position = \"F\" and statusCode = \"act\"");
$roster_f_b = selectCount("fch_rosters", " Where season = \"{$season}\" and leagueID = {$leagueID} and userID = {$userID} and releaseDate is null and position = \"F\" and statusCode = \"ben\"");
$roster_d_a = selectCount("fch_rosters", " Where season = \"{$season}\" and leagueID = {$leagueID} and userID = {$userID} and releaseDate is null and position = \"D\" and statusCode = \"act\"");
$roster_d_b = selectCount("fch_rosters", " Where season = \"{$season}\" and leagueID = {$leagueID} and userID = {$userID} and releaseDate is null and position = \"D\" and statusCode = \"ben\"");
$roster_g_a = selectCount("fch_rosters", " Where season = \"{$season}\" and leagueID = {$leagueID} and userID = {$userID} and releaseDate is null and position = \"G\" and statusCode = \"act\"");
$roster_g_b = selectCount("fch_rosters", " Where season = \"{$season}\" and leagueID = {$leagueID} and userID = {$userID} and releaseDate is null and position = \"G\" and statusCode = \"ben\"");
?>
<p/>
<h3>Your Roster Slots (used/allowed)</h3>
<style>
示例10: session_start
<?php
session_start();
?>
<?php
if (isset($_GET['lat']) && isset($_GET['long']) && isset($_GET['radius'])) {
displayResults($_GET['lat'], $_GET['long'], $_GET['radius']);
}
function displayResults($lat, $long, $radius)
{
$_SESSION["myLat"] = $lat;
$_SESSION["myLong"] = $long;
}
header('refresh: 0; url=main.php');
示例11: debug
<?php
require_once "fch-lib.js";
require_once "fch-lib.php";
if ($_POST['action'] == "doCreateLeague") {
debug("creating league");
echo displayResults(createLeague($_POST['leagueDisplayName'], $_POST['password'], $_POST['teamDisplayName'], $_POST["limit_f_a"], $_POST["limit_f_b"], $_POST["limit_d_a"], $_POST["limit_d_b"], $_POST["limit_g_a"], $_POST["limit_g_b"], $_POST["registrationDate"] . " " . $_POST["registrationTime"], $_POST["draftDate"] . " " . $_POST["draftTime"], $_POST["invitees"]));
}
?>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script>
/*
function validateDates()
{
var regDate = new Date(document.forms["createLeague"].elements["registrationDate"].value + " " + document.forms["createLeague"].elements["registrationTime"].value);
var draftDate = new Date(document.forms["createLeague"].elements["draftDate"].value + " " + document.forms["createLeague"].elements["draftTime"].value);
if ((draftDate - regDate) < 86400000)
{
alert("Your draft must be 24 hours or more after your registration date.");
return false;
}
return true;
}
*/
function intValue(field)
{
return parseInt(document.forms["createLeague"].elements[field].value);
示例12: while
while ($row = mysql_fetch_assoc($restults_academic_calendar)) {
$upcomingArray[$upcomingCount]['date_from'] = $row['date_from'];
$upcomingArray[$upcomingCount]['time_from'] = NULL;
$upcomingArray[$upcomingCount]['location'] = NULL;
$upcomingArray[$upcomingCount]['date_to'] = $row['date_to'];
$upcomingArray[$upcomingCount]['title'] = $row['description'];
$upcomingArray[$upcomingCount]['url'] = NULL;
$upcomingArray[$upcomingCount]['semester'] = $row['semester'];
$upcomingArray[$upcomingCount]['type'] = NULL;
$upcomingArray[$upcomingCount]['ts_speaker'] = NULL;
$upcomingArray[$upcomingCount]['ts_affiliation'] = NULL;
$upcomingCount++;
}
rsort($upcomingArray);
// display results
displayResults($upcomingArray);
}
}
if (isset($_POST['freq']) && $_POST['freq'] == 'tech') {
$currentDate = currentDate();
$sql = "SELECT * FROM events WHERE (type='tech session' && status='approved' AND date_from > '2014-01-01') ORDER BY date_from ASC";
$results = mysql_query($sql) or die("Unable to execute:" . mysql_error());
?>
<style>
#tech td {
padding:8px;
}
</style><br />
<p>
<strong>All the sessions will be held in GS 100 at 4:00 PM</strong>
示例13: displayError
displayError("Could not update IP tracking.");
exit;
}
setcookie("voted", "255", strtotime($config["expiration"]));
} else {
if (!mysql_query("INSERT INTO `{$dbTblT}` VALUES('{$userIP}','" . $_POST["voteFor"] . "','1',NOW());")) {
displayError("Could not update IP tracking.");
exit;
}
setcookie("voted", $_POST["voteFor"], strtotime($config["expiration"]));
}
if (!mysql_query("UPDATE `{$dbTblR}` SET `votes` = votes + 1 WHERE `id` = '" . $_POST["voteFor"] . "' LIMIT 1;")) {
displayError("Could not update vote result.");
exit;
}
displayResults(0);
exit;
}
///////////////////
function getIP($ip)
{
return long2ip($ip);
}
function putIP($ip)
{
return ip2long(gethostbyname($ip));
}
function openProxy()
{
// conceptualized by frostjedi.com; heavily modified
global $_GET, $_SERVER, $PHP_SELF;
示例14: nextDraftOrder
function nextDraftOrder($leagueID)
{
$picksSoFar = intval(selectCount("fch_draft", " WHERE leagueID = {$leagueID}"));
$totalPlayers = intval(selectCount("fch_league_membership", " WHERE leagueID = {$leagueID} and status = \"active\""));
$max = getLastPickNumber($leagueID) + 1;
// because we want the NEXT player
$season = getSeason();
debug($picksSoFar . " " . $totalPlayers . " " . $max);
if (!($totalPlayers > 0)) {
displayResults(getReturnCode(0, "Error: No players in this league."));
}
$quotient = intval(($max - 1) / $totalPlayers);
debug("quotient {$quotient}");
$mod = ($max - 1) % $totalPlayers + 1;
debug("mod {$mod}");
if ($quotient % 2 == 0) {
$r = intval($mod);
debug("{$r} = r");
} else {
$r = intval($totalPlayers - $mod + 1);
debug("{$r} = r");
}
return $r;
}
示例15: substr
// Expect b_ to be baseline, s_ to be status as updated by user
if (substr($key, 0, 2) == "s_") {
$playerID = substr($key, 2);
debug("Player is " . $playerID . " trigger is " . $_POST["s_" . $playerID]);
if ($_POST["s_" . $playerID] == "dirty") {
debug("RELEASING " . $playerID);
$r = releasePlayer($userID, $leagueID, $playerID, $_POST["transactionID"]);
$x++;
}
}
}
if ($x == 0) {
$r["status"] = 0;
$r["msg"] = "You did not select any players to drop.";
}
echo displayResults($r);
}
?>
<script>
jQuery(function($) {
jQuery(document).ready(function (){
jQuery('#l2').on('click','li',function(){
var t=jQuery(this);
jQuery('#l1').append(t);
//alert(jQuery("#s_" + this.id).val());
jQuery("#s_" + this.id).val("ok");