本文整理匯總了PHP中DB::f方法的典型用法代碼示例。如果您正苦於以下問題:PHP DB::f方法的具體用法?PHP DB::f怎麽用?PHP DB::f使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DB
的用法示例。
在下文中一共展示了DB::f方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: run_my_messages
public function run_my_messages()
{
if ($rws = DB::f("select * from messages where `to`=:id or `from`=:id order by dt desc", array("id" => $this->app->getUser("id")))) {
$rws = $this->load_messages_users($rws);
return $this->display_my_messages($rws);
}
$this->app->setSuccess("<!--[You_have_not_any_messages_yet]-->", 5);
}
示例2: run
public function run()
{
global $geo_cities, $geo_countries;
$geo_cities = set_by_id(DB::f("select * from geo_cities"));
$geo_countries = set_by_id(DB::f("select * from geo_countries"));
Auth::run();
if ($user = Auth::getUser()) {
$this->user = $user;
}
$this->parseRequest();
$old_CID = null;
$is_called_common = 0;
while ($this->CID != $old_CID) {
$old_CID = $this->CID;
try {
$channel = ChannelFactory::create($this);
$channel->run();
$this->storeData($channel->getData());
if ($this->CID == $old_CID && !$is_called_common && !$this->is_ajax) {
$is_called_common = 1;
$this->CID = "common";
}
} catch (CHException $e) {
if ($this->is_ajax) {
$this->data["error"] = "[" . $e->getType() . "] " . $e->getMessage();
} else {
$this->setError($e->getMessage(), $e->getType());
}
}
}
if ($this->is_ajax) {
$this->buildAjaxOut();
} else {
$this->buildOut();
}
}
示例3: DB
$db = new DB();
$flag = 0;
/*
* checks all active subscriptions in the database
* to see if they need to be billed again
*/
require_once 'anet_php_sdk/AuthorizeNet.php';
require_once 'AuthorizeNetMerchantAccount.php';
// gets today's date
$today = date('Y-m-d');
// gets all active records with a next bill date equal to today
$query = "SELECT * FROM " . TBL_COLLEGE_SUBSCRIPTION . " WHERE fldActive=1 AND fldNextBillDate='{$today}'";
$db->query($query);
// loops through all matching records, gets the customer's customer profile ID, the payment profile ID, and bills them for the subscription renewal. If the transaction faisl, the subscription is canceled
while ($db->next_record()) {
$fldId = $db->f('fldId');
$fldType = $db->f('fldType');
$fldCoach = $db->f('fldCoach');
$fldAmount = $db->f('fldAmount');
$fldPaymentProfileId = $db->f('fldPaymentProfileId');
// gets the customer profile Id
$query = "SELECT fldFirstName,fldLastName," . "fldANetCustomerProfileId,fldEmail FROM " . TBL_COLLEGE_COACH_REGISTER . " WHERE fldId={$fldCoach}";
$db1->query($query);
$db1->next_record();
$fldFirstName = $db1->f('fldFirstName');
$fldLastName = $db1->f('fldLastName');
$fldCustomerProfileId = $db1->f('fldANetCustomerProfileId');
$fldEmail = $db1->f('fldEmail');
// attempts to charge the user for the subscription
$transaction = new AuthorizeNetTransaction();
$transaction->amount = $fldAmount;
示例4: while
$fldTransportation = $_REQUEST['tp_id'];
$tbl_transportation_discount = 'tbl_transportation_discount';
$q = $_REQUEST["q"];
$que = "select * from " . $tbl_transportation_discount . " where Event_id='" . $q . "'";
$db->query($que);
if ($db->num_rows() > 0) {
?>
<p>
<label>Select Transportation:</label>
<span>
<select name="fldTransportation" id="fldTransportation" onchange="transport_charge(this.value)">
<option value="0">I have my own transportation</option>
<?php
while ($db->next_record()) {
$id = $func->output_fun($db->f('id'));
$Event_id = $func->output_fun($db->f('Event_id'));
$Diparture_City = $func->output_fun($db->f('Diparture_City'));
$Departure_Time = $func->output_fun($db->f('Departure_Time'));
$Transportation_charge = $func->output_fun($db->f('Transportation_charge'));
$Diparture_City . " departing at " . $Departure_Time;
?>
<option value="<?php
echo $id;
?>
"<?php
if ($id == $fldTransportation) {
?>
selected="selected" <?php
}
示例5: array
if ($_POST['isSubmit'] == 'save') {
if ($func->input_fun($_POST['fldOppComments']) == '') {
$error_msg[] = "Please Fill the Comment Box.";
} else {
$fldId = $_REQUEST['athid'];
$strDataArr = array('fldathleteid' => $fldId, 'fldcoachid' => $_SESSION['Coach_id'], 'fldOppComments' => $func->input_fun($_POST['fldOppComments']));
$db->insertRec('tbl_Opp_Comments', $strDataArr);
if (count($error_msg) == 0) {
?>
<div class="thankyoumessage">
<?php
echo "Your comment has been successfully posted.";
?>
</div>
<?php
}
}
}
?>
<?php
if (count($error_msg) > 0) {
foreach ($error_msg as $key => $value) {
?>
<div class="thankyoumessage">
<?php
echo $value;
?>
</div>
<?php
}
}
示例6: COMMONFUNC
include_once "inc/page.inc.php";
include_once "inc/config.inc.php";
//for paging
$func = new COMMONFUNC();
$db = new DB();
$coachflag = 0;
$Athleteflag = 0;
$collegeflag = 0;
if ($_SESSION['mode'] == '') {
header("Location:index.php");
}
$fldEventId = $_REQUEST['fldEventId'];
$query = "Select * from " . TBL_EVENT . " where fldEventId = '{$fldEventId}' ";
$db->query($query);
$db->next_record();
$fldfldEventId = $db->f('fldEventId');
$fldEventName = $db->f('fldEventName');
$fldSport = $db->f('fldSport');
$fldEventDescription = $func->output_fun($db->f('fldEventDescription'));
$fldEventDescription = str_replace("\n", "<br>", $fldEventDescription);
$fldEventLocation = $db->f('fldEventLocation');
$fldEventStartDate = $db->f('fldEventStartDate');
$fldEventEndDate = $db->f('fldEventEndDate');
$fldHomeTeam = $db->f('fldHomeTeam');
$fldAwayTeam = $db->f('fldAwayTeam');
$fldEventStatus = $db->f('fldEventStatus');
$query_sport = "Select * from " . TBL_SPORTS . " where fldId = '{$fldSport}' ";
$db1->query($query_sport);
$db1->next_record();
$sport_nmae = $db1->f('fldSportsname');
$query_School = "Select * from " . TBL_HS_AAU_TEAM . " where fldId = '{$fldHomeTeam}' ";
示例7: array
$fldShuttleRun = $rating_func->output_fun($profile_db->f('fldShuttleRun'));
$fldBenchPressMax = $rating_func->output_fun($profile_db->f('fldBenchPressMax'));
$fldSquatMax = $rating_func->output_fun($profile_db->f('fldSquatMax'));
####### APPROVED_BY_COACH ################
if ($coachApprove == 0 || $coachApprove == "") {
// mail to Coach for pending approval request
//User Selected School
$schoolid = $fldSchool;
$sportid = $fldSport;
$emailarr = array();
$selquery = 'select first.fldId,first.fldEmail as fldEmail,first.fldName as name,first.fldLastName as lname,first.fldUsername as HSCoachUsername,first.fldPassword as HSCoachPassword from ' . TBL_HS_AAU_COACH . ' first,' . TBL_HS_AAU_COACH_SPORT_POSITION . ' second where second.fldCoachNameId = first.fldId and second.fldSportId =' . $sportid . ' and first.fldSchool =' . $schoolid;
$coach_db->query($selquery);
$coach_db->next_record();
if ($coach_db->num_rows() > 0) {
for ($i = 0; $i < $coach_db->num_rows(); $i++) {
$emailarr[] = $rating_func->output_fun($coach_db->f('fldEmail'));
$name = $rating_func->output_fun($coach_db->f('name'));
$lname = $rating_func->output_fun($coach_db->f('lname'));
#Login Info
$HSCoachUsername = $rating_func->output_fun($coach_db->f('HSCoachUsername'));
$HSCoachPassword = $rating_func->output_fun($coach_db->f('HSCoachPassword'));
$db->next_record();
}
foreach ($emailarr as $key => $emailvalue) {
######################## EMAIL to HS COACH - Athlete Approval Notification ########################
#Subject
$subjectStre = "College Prospect Network - Athlete Pending Approval";
#Intro
$bodyStre = "Hi Coach " . ucfirst($name) . ' ' . ucfirst($lname) . ",<br /><br />";
#Main Body
$bodyStre .= "You are receiving this email because " . ucfirst($aname) . " " . ucfirst($anamel) . " has applied to join <a href=http://www.CollegeProspectNetwork.com>www.CollegeProspectNetwork.com.</a> <br />";
示例8:
<div class="container">
<div class="innerWraper">
<div class="middle-bg">
<div class="cantener">
<div class="register-main">
<?php
$query = " Select * from " . TBL_SPORTCALENDER . " where fldID ='" . $_REQUEST['fldId'] . "'";
$db->query($query);
$db->next_record();
?>
<p><h1>Sports Calendar</h1></p>
<div class="registerPage">
<p>
<!-- <span><img src="<?php
//echo SITE_URL;
?>
/logo/<?php
//echo $fldSchoolLogo;
示例9: header
//for common function
include_once "inc/page.inc.php";
session_start();
if ($_SESSION['mode'] == "" or $_SESSION['FRONTEND_USER'] == "") {
header("Location:index.php");
}
//for paging
$func = new COMMONFUNC();
$db = new DB();
$flag = 0;
$error_msg = '';
$fldUsername = $_SESSION['FRONTEND_USER'];
$query = " Select * from " . TBL_ATHELETE_REGISTER . " where fldUsername = '{$fldUsername}' ";
$db->query($query);
$db->next_record();
$Status = $db->f('fldStatus');
$image_name = $db->f('fldImage');
$fldAthleteid = $db->f('fldId');
$fldFirstname = $func->output_fun($db->f('fldFirstname'));
$fldLastname = $func->output_fun($db->f('fldLastname'));
$fldClass = $func->output_fun($db->f('fldClass'));
$fldHeight = $func->output_fun($db->f('fldHeight'));
$fldWeight = $func->output_fun($db->f('fldWeight'));
$fldDescription = $func->output_fun($db->f('fldDescription'));
$fldDescription = str_replace("<br>", "\n", $fldDescription);
$fldEmail = $func->output_fun($db->f('fldEmail'));
$fldUsername = $func->output_fun($db->f('fldUsername'));
$fldSchool = $func->output_fun($db->f('fldSchool'));
$fldSport = $func->output_fun($db->f('fldSport'));
$fldJerseyNumber = $func->output_fun($db->f('fldJerseyNumber'));
$fldPrimaryPosition = $func->output_fun($db->f('fldPrimaryPosition'));
示例10: strrpos
$i = strrpos($str, ".");
if (!$i) {
return "";
}
$l = strlen($str) - $i;
$ext = substr($str, $i + 1, $l);
return $ext;
}
//Edit Mode
$fldId = $_REQUEST['fldId'];
if ($_GET['mode'] == 'edit' and $fldId != "") {
$query = " Select * from " . TBL_ATHLETE_VIDEO . " where fldId =" . $fldId;
$db->query($query);
$db->next_record();
if ($db->num_rows() > 0) {
$fldTitle = $db->f('fldTitle');
$fldVideo = $db->f('fldVideo');
$fldStatus = $db->f('fldStatus');
}
} else {
$fldTitle = " ";
$fldVideo = " ";
$fldStatus = " ";
}
//Submit Form
if ($_POST['isSubmit'] == 'save') {
//Edit the user info
$fldTitle = $func->input_fun($_POST['fldTitle']);
$fldStatus = $func->input_fun($_POST['fldStatus']);
$video_upload = $_FILES['fldVideo']['name'];
if ($video_upload) {
示例11:
<META NAME="Description" CONTENT="My Account">
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script language="Javascript" src="javascript/functions.js"></script>
</head>
<body>
<?php
include 'header.php';
?>
<!--middle panel starts from here -->
<!--content panel starts from here -->
<div class="container">
<div class="innerWraper">
<div class="middle-bg">
<div class="cantener">
<div class="register-main">
<?php
示例12: where
}
########################################################
########### FEEDBAK_FROM_OPPOSING_COACH #############
$query_6 = "select * from tbl_opp_comments where (date(fldaddedDate) >= (DATE_SUB(now(), INTERVAL 8 day)) AND date(fldaddedDate)< (now())) GROUP BY fldathleteid,fldcoachid";
$rating_db_6->query($query_6);
$arr_info = array();
$totalPages = $rating_db_6->num_rows();
if ($totalPages > 0) {
$rating_db_6->next_record();
for ($k = 0; $k < $totalPages; $k++) {
$UserID = $rating_db_6->f('fldId');
$rating_func->setAtheleteRating("WEEKLY", $UserID, "FEEDBAK_FROM_OPPOSING_COACH", true);
$rating_db_6->next_record();
}
}
########################################################
########### MOST_PROFILE_VIEW #############
$query_7 = "select * from tbl_athelete_register where fldStatus='Active' ORDER BY fldWeeklycounter DESC";
$rating_db_7->query($query_7);
$arr_info = array();
$totalPages = $rating_db_7->num_rows();
$rating_func->reset_weekly_counter();
if ($totalPages > 0) {
$rating_db_7->next_record();
$UserID = $rating_db_7->f('fldId');
$rating_func->setAtheleteRating("WEEKLY", $UserID, "MOST_PROFILE_VIEW", true);
}
##############################################
######### WEEKLY RATING END ##################
##############################################
die;
示例13: activeRequest
$Id = $_REQUEST['Id'];
$active_query_details = "update " . TBL_ADDTONETWORK_REQUEST . " set status = 'DEACTIVE' where Id='" . $Id . "'";
$activemsg = $db->query($active_query_details);
if (isset($activemsg)) {
$_REQUEST['msg'] = "Request successfully updated.";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CPN - College Network Request</title>
<META NAME="Keywords" CONTENT="My Account">
<META NAME="Description" CONTENT="My Account">
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script language="Javascript" src="javascript/functions.js"></script>
<script language="JavaScript" type="text/JavaScript">
function activeRequest(Id) {
if(confirm("Sure you want to approve this request?")) {
document.frmUsers.action = "?mode=active&Id=" + Id;
document.frmUsers.submit();
}
}
function dectiveRequest(Id) {
if(confirm("Sure you want to deny this request? You can approve still approve it later.")) {
document.frmUsers.action = "?mode=deactive&Id=" + Id;
document.frmUsers.submit();
}
}
</script>
示例14: COMMONFUNC
include_once "inc/common_functions.php";
//for common function
include_once "inc/page.inc.php";
include_once "inc/config.inc.php";
$func = new COMMONFUNC();
$db = new DB();
$tbl_transportation_discount = 'tbl_transportation_discount';
$c = $_REQUEST["c"];
$que = "select * from " . $tbl_transportation_discount . " where id='" . $c . "'";
$db->query($que);
if ($db->num_rows() > 0) {
?>
<?php
while ($db->next_record()) {
$Transportation_charge = $func->output_fun($db->f('Transportation_charge'));
}
?>
<p>
<label>Transportation Charge:</label>
<span>
<input type="text" name="Transportation_charge" id="Transportation_charge" value="<?php
echo $Transportation_charge;
?>
" readonly />
<!-- <span style="color:#444;line-height:18px;margin-left:230px;">
<font style="color:#777;">* We provide Transportation for Event and our charge is $20 <br />from sterling high school.<br></font>
<font style="color:#777;">* Bus leave at 6:15am & back at 8:00 pm<br />* If you want to interesting so selecting above Select Transportation</font>-->
</span>
</p>
示例15: header
$admin_mail = "admin@collegeprospectnetwork.com";
SendHTMLMail1($admin_mail, $subjectStre, $bodyStre, $_POST['fldEmail']);
//if (isset($t)) {
//Thanks for sending mail
header("location:page.php?page_name=contactus&msg=Your email has been sent to the appropriate team to best address your needs, and you should receive a response shortly.");
//}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php
if ($flag == 1) {
echo $db->f('fldPageMetaTitle');
}
?>
</title>
<META NAME="Keywords" CONTENT="<?php
if ($flag == 1) {
echo $db->f('fldPageMetaKeyword');
}
?>
">
<META NAME="Description" CONTENT="<?php
if ($flag == 1) {
echo $db->f('fldPageMetaDescraption');
}
?>
">