当前位置: 首页>>代码示例>>PHP>>正文


PHP db::runQuery方法代码示例

本文整理汇总了PHP中db::runQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP db::runQuery方法的具体用法?PHP db::runQuery怎么用?PHP db::runQuery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在db的用法示例。


在下文中一共展示了db::runQuery方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getNABMessageID

function getNABMessageID()
{
    $messageID = db::runQuery("select * from NAB_messageID");
    return $messageID[0];
}
开发者ID:verbazend,项目名称:AWFA,代码行数:5,代码来源:functions.php

示例2: log

                    db::insertQuery("insert into log (type,message,instanceID) values('sync','Istance Enrolment Closed','{$instanceID}')");
                    $closedTotal++;
                }
            }
        } else {
            if ($enrolmentOpen) {
                db::insertQuery("insert into events (instanceID, courseID, locationID, startDateTime, endDateTime, courseDate, cost, maxparticipants, totalParticipants, totalParticipantsVacancy, enrolmentOpen, updated, processed, active) values('{$instanceID}','{$courseID}','{$locationID}','{$startDateTime}','{$endDateTime}','{$courseData}','{$cost}','{$maxparticipants}','{$totalParticipants}','{$totalParticipantsVacancy}','{$enrolmentOpen}',now(),'1','1')");
                db::insertQuery("insert into log (type,message,instanceID) values('sync','Istance Created','{$instanceID}')");
            }
        }
        $eventTotal++;
    }
    //var_dump($courses);
    //die();
}
$mergedata = db::runQuery("select * from locations where mergeWithID != '0'");
if ($mergedata) {
    foreach ($mergedata as $merge) {
        $oldLocationID = db::esc($merge['ID']);
        $newLocationID = db::esc($merge['mergeWithID']);
        db::insertQuery("update events set locationID = '{$newLocationID}' where locationID = '{$oldLocationID}'");
        $locationMerge++;
    }
}
dlog("Finalising", "sync");
echo "Total Locations Processed: " . $locationTotal . "<br>\n";
echo "Total Locations Merged: " . $locationMerge . "<br>\n";
echo "Total Events Processed: " . $eventTotal . "<br>\n";
echo "Total Events Closed: " . $closedTotal . "<br>\n";
echo "Completed at: " . date("Y-m-d g:i:s A", strtotime("now"));
dlog("############################################", "sync");
开发者ID:verbazend,项目名称:AWFA,代码行数:31,代码来源:sync.php

示例3: substr

        $currentuser++;
    }
    $enrolVar['source'] = $postVar['source'];
    //Payment Method
    $enrolVar['payment'] = $postVar['payment'];
    $enrolVarp['otherPtype'] = $postVar['otherpaymentselection'];
    //Fields for Credit Card
    $enrolVar['cc'] = $postVar['cc'];
    $enrolVar['expiryM'] = $postVar['expiryM'];
    $enrolVar['expiryY'] = substr($postVar['expiryY'], -2, 2);
    $enrolVar['cvv'] = $postVar['cvv'];
    //Terms & Conditions / mailing opt in
    $enrolVar['opt_in'] = $postVar['opt_in'];
    $enrolVar['terms'] = $postVar['terms'];
    $enrolVar['campaign'] = $postVar['campaign'];
    //$enrolVar['singleinvoice'] = $postVar['singleinvoice'];
    $groupdata = array('processgroupID' => $groupID, 'eventID' => $eventID, 'total_trainee' => $totalUsers, 'single_invoice' => 0, 'campaign_code' => $enrolVar['campaign'], 'cc_num' => $enrolVar['cc'], 'cc_ccv' => $enrolVar['cvv'], 'cc_month' => $enrolVar['expiryM'], 'cc_year' => $enrolVar['expiryY'], 'payment_type' => $enrolVar['payment'], 'userSource' => $enrolVar['source'], 'optinRebook' => $enrolVar['opt_in'], 'terms_agree' => $enrolVar['terms'], 'process_status' => 0);
    $hasGroup = db::runQuery("select count(*) as total from process_group where processgroupID = '{$groupID}'");
    if ($hasGroup[0]['total'] == 0) {
        $insertData = arrtosqltable($groupdata);
        db::insertQuery("insert into |process_group| {$insertData}");
    } else {
        $insertData = arrtosqltable_update($groupdata);
        db::insertQuery("update |process_group| " . $insertData . " where processgroupID = '" . $groupID . "'");
    }
    $result = array('result' => true, 'sessionKey' => $groupID);
    echo json_encode($result);
    //Create contacts for each user
    //Submit to /course/enrolMultiple
    //with contact ID's in array
}
开发者ID:verbazend,项目名称:AWFA,代码行数:31,代码来源:index.php

示例4: getEmailByHashID

 function getEmailByHashID($hashid, $emailConfirmation)
 {
     $hashid = db::esc($hashid);
     $emailConfirmation = db::esc($emailConfirmation);
     $email = db::runQuery("select * from emails where toAddress = '{$emailConfirmation}' and emailKey = '{$hashid}'");
     if ($email) {
         $email = $email[0];
         return $email;
     } else {
         return false;
     }
 }
开发者ID:verbazend,项目名称:AWFA,代码行数:12,代码来源:email.class.php

示例5: getresponsereferaltemplateforemail

 public function getresponsereferaltemplateforemail($listingID)
 {
     $patientdata = patient::getpatientbyID($listingID);
     $patientdata = $patientdata[0];
     $practdata = Login::gettheuser();
     $username = $practdata['email'];
     $userdata = Login::getuser($patientdata['userID']);
     if ($userdata['practtype'] == 1) {
         $practtype = "Doctor";
     } else {
         $practtype = "Nurse";
     }
     /*
                 $emailtemplate = $emailtemplate.'<h1>Practitioners Details</h1>';
                 $emailtemplate = $emailtemplate.'<p><b>Details about the practitioner who submitted the referral.<br>If serious or life threatening please contact them directly as well.</b></p>';
                 $emailtemplate = $emailtemplate.'<div><label class="label"><span class="bold">Practitioner:</span> <span>'.$userdata['fullname'].'</span></label></div>';
                 $emailtemplate = $emailtemplate.'<div><label class="label"><span class="bold">Institution:</span> <span>'.$userdata['institution'].'</span></label></div>';
                 $emailtemplate = $emailtemplate.'<br>';
                 $emailtemplate = $emailtemplate.'<div><label class="label"><span class="bold">Practitioner Type:</span> <span>'.$practtype.'</span></label></div>';
                 $emailtemplate = $emailtemplate.'<div><label class="label"><span class="bold">AHPRA Registration No.:</span> <span>'.$userdata['ahpraregnumber'].'</span></label></div>';
                 $emailtemplate = $emailtemplate.'<br>';
                 $emailtemplate = $emailtemplate.'<div><label class="label"><span class="bold">State:</span> <span>'.$userdata['state'].'</span></label></div>';
                 $emailtemplate = $emailtemplate.'<div><label class="label"><span class="bold">Direct Phone:</span> <span>'.$userdata['directphone'].'</span></label></div>';
                 $emailtemplate = $emailtemplate.'<div><label class="label"><span class="bold">Mobile (Emergency Only):</span> <span>'.$userdata['mobile'].'</span></label></div>';
                 $emailtemplate = $emailtemplate.'<div><label class="label"><span class="bold">After Hours Phone:</span> <span>'.$userdata['afterhoursph'].'</span></label></div>';
                 $emailtemplate = $emailtemplate.'';
                 $emailtemplate = $emailtemplate.'<br>';
                 $emailtemplate = $emailtemplate.' ';
     * 
     */
     $refresponse = db::runQuery('select * from |patient_responses| where PatientID = ' . db::esc($patientdata['ID']) . ' and active = 1', 0, 99);
     if ($refresponse) {
         $refresponse = $refresponse[0];
         $response = db::esc($refresponse['Response']);
         $diagnosisID = db::esc($refresponse['diagnosis_grade']);
         $diagnosisOther = db::esc($refresponse['Diagnosis']);
         $telarelated = db::esc($refresponse['telaprevir_related']);
         $followuprecommendation = db::esc($refresponse['followup_recommendation']);
         $consultcomplete = db::esc($refresponse['completed']);
         $additionalresponse = db::esc($refresponse['additional_response']);
     }
     $emailtemplate = $emailtemplate . '<div class="referralwrapper">';
     $emailtemplate = $emailtemplate . '<h1 class="formheader">Referral Response</h1>';
     $emailtemplate = $emailtemplate . '    ';
     $emailtemplate = $emailtemplate . '<div><label class="label"><span class="bold"><strong>Response:</strong></span> <spane>' . $response . '</spane></label></div>';
     $emailtemplate = $emailtemplate . '<div><div class="label"><span class="bold"><strong>Diagnosis:</strong></span> ';
     $emailtemplate = $emailtemplate . '<span>';
     $grade = db::runQuery('select * from |diagnosis_grades| order by ID asc', 0, 99);
     foreach ($grade as $item) {
         if ($diagnosisID == $item['ID']) {
             $checkedoutput = " checked";
             $emailtemplate = $emailtemplate . '<div class="formitem radiobutton "><label>' . $item['grade'] . '</label>';
             $emailtemplate = $emailtemplate . '    <span class="moreinfo">' . functions::replaceouttemplatetext($item['grade_intro']) . '<br><br>' . functions::replaceouttemplatetext($item['description']) . '</span>';
             $emailtemplate = $emailtemplate . '</div>';
         }
     }
     if ($diagnosisID == "5") {
         $emailtemplate = $emailtemplate . '<div class="formitem radiobutton "><label>Other</label>';
         $emailtemplate = $emailtemplate . '    <span class="moreinfo"><spane>' . $diagnosisOther . '</spane></span>';
         $emailtemplate = $emailtemplate . '</div>';
     }
     $emailtemplate = $emailtemplate . '</span>';
     $emailtemplate = $emailtemplate . '</div></div>';
     $emailtemplate = $emailtemplate . '<div><div class="label"><span class="bold"><strong>Telaprevir Related:</strong></span>';
     $emailtemplate = $emailtemplate . '<span>';
     $reldetails = functions::gettelaprevirrelatedoptions($telarelated);
     $emailtemplate = $emailtemplate . '<div class="formitem radiobutton "><label>' . $reldetails['name'] . '</label>';
     $emailtemplate = $emailtemplate . '    <span class="moreinfo">' . $reldetails['text'] . '</span>';
     $emailtemplate = $emailtemplate . '</div>';
     $emailtemplate = $emailtemplate . '</span>';
     $emailtemplate = $emailtemplate . '</div></div>';
     $emailtemplate = $emailtemplate . '<div><div class="label"><span class="bold"><strong>Management:</strong> <span style="font-weight:normal;"><i>Please read the following attachments</i></span></span> ';
     $emailtemplate = $emailtemplate . '<span>';
     $toattach = db::runQuery('select * from |referral_attachments| order by ID asc', 0, 99);
     foreach ($toattach as $item) {
         if (functions::patienthasreferalattachementbyid($patientdata['ID'], $item['ID'])) {
             $emailtemplate = $emailtemplate . '<div class="formitem checkbox"><label><a href="' . BASEDOMAIN . $item['filelocation'] . $item['filename'] . '" target="_blank">' . $item['fileDescription'] . '</a></label></div>';
         }
     }
     $emailtemplate = $emailtemplate . '</span>';
     $emailtemplate = $emailtemplate . '</div>';
     $emailtemplate = $emailtemplate . '<div><label class="label"><span class="bold"><strong>Follow up recommendation: </strong><span style="font-weight:normal;"><i>(blank if not required)</i></span></span> <span>' . $followuprecommendation . '</span></label></div>';
     $emailtemplate = $emailtemplate . '<input type="hidden" name="saveonly" id="saveonly" value="false">';
     $responsehistory = db::runQuery('select * from |patient_history| where history_type = 5 and patientID = ' . $listingID . ' order by historyID desc');
     if ($responsehistory) {
         $emailtemplate = $emailtemplate . '<h1 class="formheader">Additional Referral Response</h1>';
     }
     if ($responsehistory) {
         foreach ($responsehistory as $response) {
             $emailtemplate = $emailtemplate . '<div><b>From ' . functions::replaceouttemplatetext_doctor('Dr Gregory Siller', $response['doctorID']) . ' on ' . $response['history_created'] . '</b>,<br>' . $response['addresponse'] . '</div><br><br>';
         }
     }
     return $emailtemplate;
 }
开发者ID:verbazend,项目名称:AWFA,代码行数:94,代码来源:email.class.php

示例6: CONCAT

<?php

include "application.php";
include "db.class.php";
include "functions.php";
include "esmtp.class.php";
//var_dump($_GET);
$suburbName = db::esc($_GET['term']);
//$ret = db::runQuery("select suburbName, postcode_db.* from |startrack_suburbs| left join postcode_db on postcode_db.postcode = startrack_suburbs.postcode and postcode_db.suburb = startrack_suburbs.suburbName where countryCode = 'AU' and suburbName like '$suburbName%'");
$ret = db::runQuery("select suburbName, startrack_suburbs.postcode, postcode_db.state from |startrack_suburbs| left join postcode_db on startrack_suburbs.postcode like CONCAT('%', postcode_db.postcode ,'%') where countryCode = 'AU' and suburbName like '{$suburbName}%' group by suburbName");
$suburbArr = array();
if ($ret) {
    foreach ($ret as $retsb => $retsbv) {
        if ($retsbv['postcode'] == "") {
            $suburbArr = array_merge($suburbArr, array(array('value' => $retsbv['suburbName'], 'label' => $retsbv['suburbName'] . " " . $retsbv['state'] . " " . $retsbv['postcode'])));
        } else {
            $pcode = $retsbv['postcode'];
            if ($pcode == "4000") {
                $pcode = "4001";
            }
            $suburbname = $retsbv['suburbName'];
            $suburbArr = array_merge($suburbArr, array(array('value' => $suburbname . "|" . $retsbv['state'] . "|" . $pcode, 'label' => $retsbv['suburbName'] . " " . $retsbv['state'] . " " . $retsbv['postcode'])));
        }
    }
    $retv = $suburbArr;
} else {
    $retv = false;
}
echo json_encode($retv);
开发者ID:verbazend,项目名称:AWFA,代码行数:29,代码来源:suburb.php

示例7: sendManualInvoice

function sendManualInvoice($processgroupID)
{
    $emailKey = $processgroupID;
    $html = getEmailTemplate("template_invoicenotification.htm");
    $processgroupID = db::esc($processgroupID);
    $mainData = db::runQuery("select * from process_group left join events on events.instanceID = process_group.eventID left join courses on courses.courseID = events.courseID left join locations on locations.ID = events.locationID left join coupons on coupons.couponCode = process_group.campaign_code where processgroupID = '{$processgroupID}'");
    if (!$mainData) {
        return false;
    } else {
        $mData = $mainData[0];
        $courseName = $mData['CourseName'];
        $couponName = $mData['campaignName'];
        $normalCost = $mData['cost'];
        $totalTrainees = $mData['total_trainee'];
        $discountcost = $mData['totalcost'];
        $costNormalTotal = $normalCost * $totalTrainees;
        $discountcostPerperson = $discountcost / $totalTrainees;
        $amountDiscountedTot = $costNormalTotal - $discountcost;
        $invoiceItems = "";
        for ($tr = 0; $tr < $totalTrainees; $tr++) {
            $subHTML = "";
            $subHTML = $subHTML . "\t\t<tr style='font-size:13px;'>";
            $subHTML = $subHTML . "\t\t\t<td>" . $courseName . " - " . $couponName . "</td>";
            $subHTML = $subHTML . "\t\t\t<td>\$" . number_format($normalCost, 2) . "</td>";
            $subHTML = $subHTML . "\t\t\t<td>\$" . number_format($discountcostPerperson, 2) . "</td>";
            $subHTML = $subHTML . "\t\t</tr>";
            $invoiceItems = $invoiceItems . $subHTML;
        }
        $html = varReplace("invoiceItemsRow", $invoiceItems, $html);
        $html = varReplace("order.totalNormal", number_format($costNormalTotal, 2), $html);
        $html = varReplace("order.Total", number_format($discountcost, 2), $html);
        $html = varReplace("order.amountDiscounted", number_format($amountDiscountedTot, 2), $html);
        $html = varReplace("order.subTotal", number_format($discountcost, 2), $html);
        if ($mData['payment_status'] == "completed") {
            $html = varReplace("order.amountPaid", number_format($discountcost, 2), $html);
            $html = varReplace("order.balanceDue", "0.00", $html);
        } else {
            $html = varReplace("order.amountPaid", "0.00", $html);
            $html = varReplace("order.balanceDue", number_format($discountcost, 2), $html);
        }
        $html = varReplace("amountToInvoice", number_format($discountcost, 2), $html);
        $html = varReplace("eventID", $mData['eventID'], $html);
        $html = varReplace("courseName", $mData['CourseName'], $html);
        $html = varReplace("courseDateTime", $mData['startDateTime'], $html);
        $html = varReplace("courseLocation", $mData['LocationState'] . " " . $mData['LocationName'] . " - " . $mData['StreetAddress'], $html);
        $html = varReplace("totalTrainees", $mData['total_trainee'], $html);
        $html = varReplace("courseNormalCost", "\$" . number_format($costNormalTotal, 2), $html);
        $html = varReplace("couponCode", $mData['campaign_code'], $html);
        $html = varReplace("couponName", $couponName, $html);
        if ($mData['discountType'] == "0") {
            $html = varReplace("couponDiscount", "\$" . $mData['discountAmount'] . " off total", $html);
        }
        if ($mData['discountType'] == "1") {
            $html = varReplace("couponDiscount", $mData['discountAmount'] . "% off total", $html);
        }
        if ($mData['discountType'] == "2") {
            $html = varReplace("couponDiscount", "Custom price for Location", $html);
        }
        if ($mData['discountType'] == "3") {
            $html = varReplace("couponDiscount", "Custom price for Course", $html);
        }
        $trainees = db::runQuery("select * from process_trainee where processgroupID = '{$processgroupID}'");
        if (!$trainees) {
            return false;
        } else {
            $currentTrainee = 1;
            $traineehtml = "";
            foreach ($trainees as $trainee) {
                $trhtml = "";
                $trhtml = $trhtml . '<b>Trainee ' . $currentTrainee . '</b>';
                $trhtml = $trhtml . '	<table style="width:100%; margin-left:70px;">';
                $trhtml = $trhtml . '		<tr style="font-size:13px;">';
                $trhtml = $trhtml . '			<th width="30%" style="text-align:left;">Contact ID</th>';
                $trhtml = $trhtml . '			<td style="text-align:left;"><a href="https://admin.axcelerate.com.au/management/management2/Contact_View.cfm?ContactID=' . $trainee['contactID'] . '">' . $trainee['contactID'] . '</a></th>';
                $trhtml = $trhtml . '		</tr>';
                $trhtml = $trhtml . '		<tr style="font-size:13px;">';
                $trhtml = $trhtml . '			<th width="30%" style="text-align:left;">Learner ID</th>';
                $trhtml = $trhtml . '			<td style="text-align:left;">' . $trainee['leanerID'] . '</td>';
                $trhtml = $trhtml . '		</tr>';
                $trhtml = $trhtml . '		<tr style="font-size:13px;">';
                $trhtml = $trhtml . '			<th width="30%" style="text-align:left;">Invoice ID</th>';
                $trhtml = $trhtml . '			<td style="text-align:left;">' . $trainee['invoiceID'] . '</td>';
                $trhtml = $trhtml . '		</tr>';
                $trhtml = $trhtml . '		<tr style="font-size:13px;">';
                $trhtml = $trhtml . '			<th width="30%" style="text-align:left;">Amount to Invoice</th>';
                $trhtml = $trhtml . '			<td style="text-align:left;">$' . number_format($trainee['cost'], 2) . '</td>';
                $trhtml = $trhtml . '		</tr>';
                $trhtml = $trhtml . '		<tr style="font-size:13px;">';
                $trhtml = $trhtml . '			<th width="30%" style="text-align:left;">&nbsp</th>';
                $trhtml = $trhtml . '			<td style="text-align:left;"></td>';
                $trhtml = $trhtml . '		</tr>';
                $trhtml = $trhtml . '		<tr style="font-size:13px;">';
                $trhtml = $trhtml . '			<th width="30%" style="text-align:left;">Name</th>';
                $trhtml = $trhtml . '			<td style="text-align:left;">' . $trainee['firstname'] . ' ' . $trainee['lastname'] . '</td>';
                $trhtml = $trhtml . '		</tr>';
                $trhtml = $trhtml . '		<tr style="font-size:13px;">';
                $trhtml = $trhtml . '			<th width="30%" style="text-align:left;">USI</th>';
                $trhtml = $trhtml . '			<td style="text-align:left;">' . $trainee['usi'] . '</td>';
                $trhtml = $trhtml . '		</tr>';
                $trhtml = $trhtml . '		<tr style="font-size:13px;">';
//.........这里部分代码省略.........
开发者ID:verbazend,项目名称:AWFA,代码行数:101,代码来源:functions.php

示例8: sum

						$yearName 	  = $bookingYear['vyear'];
						
						$m1  = 0;
						$m2  = 0;
						$m3  = 0;
						$m4  = 0;
						$m5  = 0;
						$m6  = 0;
						$m7  = 0;
						$m8  = 0;
						$m9  = 0;
						$m10 = 0;
						$m11 = 0;
						$m12 = 0;
							
						$BookingOverviewMonth = db::runQuery("select sum(dollorAmount) as total, DATE_FORMAT(created, '%Y/%m') as yearmonth, DATE_FORMAT(created, '%Y') as vyear, DATE_FORMAT(created, '%m') as vmonth from bookingDetails where failed = '0' and dollorAmount <> '1' and dollorAmount <> '' and YEAR(created) = '$yearName' and paymentMethod = 'payment-card' group by YEAR(created), MONTH(created) order by yearmonth");
						
						foreach($BookingOverviewMonth as $bookingMonth){
							//var_dump($bookingMonth);
							$monthNumber = $bookingMonth['vmonth'];
							if($monthNumber=="1"){
								$m1  = $bookingMonth['total'];
							}
							if($monthNumber=="2"){
								$m2  = $bookingMonth['total'];
							}
							if($monthNumber=="3"){
								$m3  = $bookingMonth['total'];
							}
							if($monthNumber=="4"){
								$m4  = $bookingMonth['total'];
开发者ID:verbazend,项目名称:AWFA,代码行数:31,代码来源:manager_home.php

示例9: getBookingDetailsFromInvoiceID

function getBookingDetailsFromInvoiceID($invoiceID)
{
    $invoiceID = db::esc($invoiceID);
    $data = db::runQuery("SELECT * FROM bookingDetails left join events on bookingDetails.instanceID = events.instanceID left join courses on courses.CourseID = events.courseID left join locations on events.locationID = locations.ID where bookingDetails.invoiceID = '{$invoiceID}'");
    if ($data) {
        return $data[0];
    } else {
        return false;
    }
}
开发者ID:verbazend,项目名称:AWFA,代码行数:10,代码来源:functions_withpaymentdiscounts_notused.php

示例10: array

        } else {
            $data = array("dates" => false);
        }
        echo json_encode($data);
        die;
    } else {
    }
}
if ($app == "checkInstance") {
    $instanceID = db::esc($_GET['instanceID']);
    $couponCode = db::esc($_GET['campaign']);
    $promoname = "";
    $instances = db::runQuery("select * from events left join courses on courses.courseID = events.courseID left join locations on locations.ID = events.locationID where instanceID = '{$instanceID}' and enrolmentOpen = '1' and active = '1'");
    if ($instances) {
        $courseCost = $instances[0]['cost'];
        $promocodes = db::runQuery("select * from coupons where couponCode = '{$couponCode}'");
        if ($promocodes) {
            $promocodes = $promocodes[0];
            $promoname = $promocodes['campaignName'];
            if ($promocodes['discountType'] == 1) {
                //Percent Discount
                //Currently Not an Option
            } else {
                //Dollor Amount Discount
                $courseCost = $courseCost - $promocodes['discountAmount'];
            }
        }
        $data = array('courseName' => $instances[0]['CourseName'], 'courseDate' => date('d M Y', strtotime($instances[0]['courseDate'])), 'courseTimings' => '' . date('h:i a', strtotime($instances[0]['startDateTime'])) . ' - ' . date('h:i a', strtotime($instances[0]['endDateTime'])), 'courseLocation' => $instances[0]['StreetAddress'], 'courseTotalCost' => $courseCost, 'promotion' => $promoname);
        echo json_encode($data);
    } else {
        echo false;
开发者ID:verbazend,项目名称:AWFA,代码行数:31,代码来源:index_141106.php

示例11: count

             $promocodes = db::runQuery("select * from coupons where couponCode = '{$couponCode}'");
             if ($promocodes) {
                 $promocodes = $promocodes[0];
                 $promoname = $promocodes['campaignName'];
                 if ($promocodes['discountType'] == 1) {
                     //Percent Discount
                     //Currently Not an Option
                 } else {
                     //Dollor Amount Discount
                     $courseCost = $courseCost - $promocodes['discountAmount'];
                 }
             }
             $coursePermClosed = db::runQuery("select count(*) as total from eventsClosed where instanceID = '{$instanceID}'");
             $coursePermClosedCount = $coursePermClosed[0]['total'];
             if ($coursePermClosedCount) {
                 $coursePermClosedDetails = db::runQuery("select * from eventsClosed where instanceID = '{$instanceID}'");
                 $courseClosedOn = $coursePermClosedDetails[0]['created'];
                 $courseClosedBy = $coursePermClosedDetails[0]['user'];
             } else {
                 $courseClosedOn = false;
                 $courseClosedBy = false;
             }
             $data = array('courseName' => $instances[0]['CourseName'], 'courseDate' => date('d M Y', strtotime($instances[0]['courseDate'])), 'courseTimings' => '' . date('h:i a', strtotime($instances[0]['startDateTime'])) . ' - ' . date('h:i a', strtotime($instances[0]['endDateTime'])), 'courseLocation' => $instances[0]['StreetAddress'], 'courseTotalCost' => $courseCost, 'promotion' => $promoname, 'enrolmentOpen' => $instances[0]['enrolmentOpen'], 'manualClose' => $coursePermClosedCount, 'courseClosedOn' => $courseClosedOn, 'courseClosedBy' => $courseClosedBy);
             echo json_encode($data);
         } else {
             echo json_encode(false);
         }
     }
 } else {
     die("Access Denied!");
 }
开发者ID:verbazend,项目名称:AWFA,代码行数:31,代码来源:index.php

示例12:

<?php
if(isset($_GET['cid'])){
	$couponID = $_GET['cid'];
} else {
	die("No ID Found");
}

$couponID = db::esc($couponID);
$couponData = db::runQuery("select * from coupons where ID = '$couponID'");

if(!$couponData){
	die("ID not Found");
}
$couponData = $couponData[0];
?>
<div style="min-height:800px;">
	<div class="row">
        <div class="col-xs-12">
          <h2 class="h2small">Edit Coupon/Campaign: <?php echo $couponData['campaignName']; ?></h2>      
          
        </div>
        
     </div>
     <div class="row">
     	<div class="col-xs-12">
     	<br>
          <div id="couponDetails">
          		<table width="100%">
          			<tr height="40">
          				<th width="200">Campaign Name</th>
          				<td><input id="campaignName" type="text" value="<?php echo $couponData['campaignName']; ?>"></td>
开发者ID:verbazend,项目名称:AWFA,代码行数:31,代码来源:manager_editcoupon.php

示例13: UNIX_TIMESTAMP

<?php

include "application.php";
include "db.class.php";
include "functions.php";
include "esmtp.class.php";
$vrt = db::runQuery("select (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(created)) as created from |log| where message = 'Finished.' and type = 'sync' order by ID desc", 0, 1);
//$vrtest = db::runQuery("select ID, type, message, created from |log| where message = 'Finished.' and type = 'sync' order by created desc",0,100);
//var_dump($vrt);
//var_dump($vrtest);
if ($vrt[0]['created'] >= 3630) {
    die($vrt[0]['created'] . " Seconds");
} else {
    die("OK");
}
?>
A
开发者ID:verbazend,项目名称:AWFA,代码行数:17,代码来源:synccheck.php


注:本文中的db::runQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。