Example #1
0
function getNABMessageID()
{
    $messageID = db::runQuery("select * from NAB_messageID");
    return $messageID[0];
}
Example #2
0
                    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");
Example #3
0
        $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
}
Example #4
0
 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;
     }
 }
Example #5
0
 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;
 }
Example #6
0
<?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);
Example #7
0
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;">';
                $trhtml = $trhtml . '			<th width="30%" style="text-align:left;">Email Address</th>';
                $trhtml = $trhtml . '			<td style="text-align:left;">' . $trainee['email'] . '</td>';
                $trhtml = $trhtml . '		</tr>';
                $trhtml = $trhtml . '		<tr style="font-size:13px;">';
                $trhtml = $trhtml . '			<th width="30%" style="text-align:left;">Mobile/Phone</th>';
                $trhtml = $trhtml . '			<td style="text-align:left;">' . $trainee['mobile'] . '</td>';
                $trhtml = $trhtml . '		</tr>';
                $trhtml = $trhtml . '		<tr style="font-size:13px;">';
                $trhtml = $trhtml . '			<th width="30%" style="text-align:left;">Workplace</th>';
                $trhtml = $trhtml . '			<td style="text-align:left;">' . $trainee['workplace'] . '</td>';
                $trhtml = $trhtml . '		</tr>';
                $trhtml = $trhtml . '		<tr style="font-size:13px;">';
                $trhtml = $trhtml . '			<th width="30%" style="text-align:left;">Address</th>';
                $trhtml = $trhtml . '			<td style="text-align:left;">' . $trainee['address'] . '<br>' . $trainee['suburb'] . ' ' . $trainee['postcode'] . '</td>';
                $trhtml = $trhtml . '		</tr>';
                $trhtml = $trhtml . '	</table><br><br>';
                $traineehtml = $traineehtml . $trhtml;
                $currentTrainee++;
            }
            $html = varReplace("traineeDetails", $traineehtml, $html);
            $remail = $mData['awfaSendInvoiceNotification'];
            //$remail = "*****@*****.**";
            $subject = "MANUAL INVOICE: Please generate a manual invoice for this Discounted Enrolment";
            $message = $html;
            $bookingID = "";
            $instanceID = "";
            $ccEmail = "";
            //$ccEmail = "*****@*****.**";
            email::logEmail($remail, $ccEmail, "", $subject, $message, $bookingID, $instanceID, $emailKey);
            esmtp::sendemail_smtp($remail, $subject, $message, $ccEmail);
            echo $html;
        }
    }
}
Example #8
0
						$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'];
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;
    }
}
Example #10
0
        } 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;
Example #11
0
             $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!");
 }
Example #12
0
<?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>
Example #13
0
<?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