Esempio n. 1
9
function goEnrolments()
{
    $progroup = db::runQuery("select * from process_group where process_status = '2'", 0, 1);
    if ($progroup) {
        foreach ($progroup as $pgr) {
            $supressInvoiceEmail = "0";
            $generateInvoice = "true";
            $archiveINvoice = "true";
            $Continue = true;
            //Check if we already have an invoice (Usually due to a failed payment needing to be come back through).
            $enrCheck = db::runQuery("select * from |process_group| where processgroupID = '{$processgroup}'");
            if ($enrCheck) {
                $enrCheckcur = $enrCheck[0];
                if (!$enrCheckcur['GroupInvoiceID'] == "") {
                    db::insertQuery("update |process_group| set process_status = '4' where processgroupID = '{$processgroup}'");
                    continue;
                }
            }
            if ($pgr['campaign_code'] == "") {
                $campaignCode = false;
                $campaignDetails = false;
                $campaignID = 0;
                $campaignName = false;
                $allowOfflinePayments = false;
                $forceOfflinePayments = false;
                $dontInvoiceUser = false;
                $addressToInvoice = false;
                $contactIDtoInvoice = false;
                $sendAWFANotice = false;
                $autoLockandCloseInvoice = true;
            } else {
                $campaignCode = $pgr['campaign_code'];
                $campaignDetails = getCampaignDetails($campaignCode);
                $campaignID = $campaignDetails['ID'];
                $campaignName = $campaignDetails['campaignName'];
                $allowOfflinePayments = $campaignDetails['allowOfflinePayments'];
                $forceOfflinePayments = $campaignDetails['forceOfflinePayments'];
                $dontInvoiceUser = $campaignDetails['dontInvoiceUser'];
                $addressToInvoice = $campaignDetails['addressToInvoice'];
                $contactIDtoInvoice = $campaignDetails['contactIDtoInvoice'];
                $sendAWFANotice = $campaignDetails['awfaSendInvoiceNotification'];
                $autoLockandCloseInvoice = $campaignDetails['awfaAutoLockandCloseInvoice'];
                if ($autoLockandCloseInvoice == 0) {
                    $autoLockandCloseInvoice = false;
                }
                if ($autoLockandCloseInvoice == 1) {
                    $autoLockandCloseInvoice = true;
                }
                if ($forceOfflinePayments) {
                    $forceOfflinePayments = true;
                } else {
                    $forceOfflinePayments = false;
                }
                if ($contactIDtoInvoice == "") {
                    $contactIDtoInvoice = false;
                }
            }
            $courseID = $pgr['eventID'];
            $courseDetails = getEventDetails($courseID);
            $processgroup = db::esc($pgr['processgroupID']);
            $contactIDtoInvoice = db::esc($contactIDtoInvoice);
            $allowOfflinePayments = db::esc($allowOfflinePayments);
            $forceOfflinePayments = db::esc($forceOfflinePayments);
            $dontInvoiceUser = db::esc($dontInvoiceUser);
            $addressToInvoice = db::esc($addressToInvoice);
            //Create Multi Enrolment
            $trainees = db::runQuery("select * from process_trainee where processgroupID = '{$processgroup}'");
            $primaryContact = "";
            $courseInstanceID = "";
            $processgroup = "";
            $costperperson = $courseDetails['cost'];
            $subt = getDiscountPrice($campaignCode, $costperperson);
            $costperperson = $subt;
            if (!$costperperson == $subt) {
                $hasdiscount = true;
            } else {
                $hasdiscount = false;
            }
            echo $costperperson . " ---<br>";
            $totalCostCal = 0;
            if ($trainees) {
                $contactList = "";
                foreach ($trainees as $trn) {
                    if ($contactList == "") {
                        $contactList = $contactList . $trn['contactID'];
                        $primaryContact = $trn['contactID'];
                        $courseInstanceID = $trn['eventID'];
                        $processgroup = $trn['processgroupID'];
                        $processgroup = $trn['processgroupID'];
                        $costperperson = $costperperson;
                    } else {
                        $contactList = $contactList . "," . $trn['contactID'];
                    }
                    $totalCostCal = $totalCostCal + $costperperson;
                }
                if ($contactIDtoInvoice != false) {
                    $primaryContact = $contactIDtoInvoice;
                }
                $totalCostCal = db::esc($totalCostCal);
                $primaryContact = db::esc($primaryContact);
                db::insertQuery("update process_group set totalcost = '{$totalCostCal}', process_status = '3', primaryContactID = '{$primaryContact}', allowOfflinePayments = '{$allowOfflinePayments}', forceOfflinePayments = '{$forceOfflinePayments}', dontInvoiceUser = '******', addressToInvoice = '{$addressToInvoice}', contactIDtoInvoice = '{$contactIDtoInvoice}' where processgroupID = '{$processgroup}'");
                //$supressInvoiceEmail = "false";
                if ($autoLockandCloseInvoice) {
                    $lockInvoiceItems = "false";
                    $supressInvoiceEmail = "true";
                    $generateInvoice = "true";
                    $archiveINvoice = "false";
                } else {
                    $lockInvoiceItems = "true";
                    $supressInvoiceEmail = "false";
                    $generateInvoice = "true";
                    $archiveINvoice = "true";
                }
                if ($hasdiscount) {
                    $supressInvoiceEmail = "true";
                    //20151211 - AJ - Fix for invoices not auto archiving when they should
                    $lockInvoiceItems = "false";
                    $supressInvoiceEmail = "true";
                    $generateInvoice = "true";
                    $archiveINvoice = "false";
                } else {
                    $supressInvoiceEmail = "false";
                    //20151211 - AJ _ Fix for invoices not auto archiving when the should
                    $lockInvoiceItems = "true";
                    $supressInvoiceEmail = "false";
                    $generateInvoice = "true";
                    $archiveINvoice = "true";
                }
                $enrollVars = array('contactID' => $contactList, 'instanceID' => $courseInstanceID, 'payerID' => $primaryContact, 'type' => 'w', 'generateInvoice' => $generateInvoice, 'suppressEmail' => $supressInvoiceEmail, 'archiveInvoice' => $archiveINvoice, 'lockInvoiceItems' => $lockInvoiceItems);
                $enrollNow = axcelerate_multienroll($enrollVars, $processgroup);
                ob_start();
                echo "Axcelerate Multi Enrol\n";
                var_dump($enrollNow);
                echo "\n\nvars:\n\n";
                var_dump($enrollVars);
                $extrans_dump = ob_get_clean();
                dlog($extrans_dump, false, $processgroup);
                if (isset($enrollNow->error)) {
                    $enrollIsError = true;
                    $trans['message'] = $enrollNow->MESSAGES;
                    dlog("Enrol-Enrolment: Axcelerate returned error: {$processgroup} - " . $trans['message'], false, $processgroup);
                    markGroupError($processgroup, $trans['message']);
                    die;
                }
                $groupInvoiceID = "";
                $totalCost = 0;
                foreach ($enrollNow as $student) {
                    $InvoiceID = db::esc($student->INVOICEID);
                    $ContactID = db::esc($student->CONTACTID);
                    $LearnerID = db::esc($student->LEARNERID);
                    $Amount = db::esc($student->AMOUNT);
                    $totalCost = $totalCost + $student->AMOUNT;
                    if ($ContactID == "") {
                        markGroupError($processgroup, "");
                    }
                    $groupInvoiceID = $InvoiceID;
                    if (!$sendAWFANotice == "") {
                        //Send a manual invoice flag
                        $sendManualInvoice = "1";
                        $sendAWFANotice = db::esc($sendAWFANotice);
                    } else {
                        $sendManualInvoice = "0";
                    }
                    db::insertQuery("update process_trainee set learnerID = '{$LearnerID}', invoiceID = '{$InvoiceID}', sendManualInvoice = '{$sendManualInvoice}', manualInvoiceTo = '{$sendAWFANotice}' where contactID = '{$ContactID}' and processgroupID = '{$processgroup}'");
                }
                if ($forceOfflinePayments == true) {
                    db::insertQuery("update process_group set GroupInvoiceID = '{$groupInvoiceID}', process_status = '4', payment_type = 'offline', primaryContactID = '{$primaryContact}' where processgroupID = '{$processgroup}'");
                } else {
                    db::insertQuery("update process_group set GroupInvoiceID = '{$groupInvoiceID}', process_status = '4', primaryContactID = '{$primaryContact}' where processgroupID = '{$processgroup}'");
                }
                if ($sendManualInvoice == "1") {
                    sendManualInvoice($processgroup);
                }
            }
        }
    }
}
/**
 * Translates the four parameters into a event ID url
 *
 * @param project_name  : string corresponding to `redcap_projects.app_title` column
 * @param study_id      : string corresponding to `redcap_data.record` column
 * @param event_name    : string corresponding to `redcap_events_metadata.descrip` column
 * @param page_name     : string representing the form name `redcap_events_forms.form_name`
 *
 * @return string
 */
function getUrlForEvent($project_name, $study_id, $event_name, $page_name)
{
    $event_details = getEventDetails($project_name, $study_id, $event_name);
    $url_data = array('pid' => $event_details['project_id'], 'id' => $study_id, 'page' => $page_name, 'event_id' => $event_details['event_id']);
    $url = "http://" . $_SERVER['HTTP_HOST'] . "/redcap/redcap_v6.0.5/DataEntry/index.php?" . http_build_query($url_data);
    return $url;
}
Esempio n. 3
0
 function sendBookingConfirmation($bookingID, $instanceID, $enrolVar, $ccEmail = false)
 {
     $enrolVar['state'] = getStateFromPostcode($enrolVar['postcode']);
     //$instanceID = "161835";
     $courseDetailObj = getEventDetails($instanceID);
     $courseDetails['name'] = $courseDetailObj['websiteName'];
     $courseDetails['date'] = date("l", strtotime($courseDetailObj['courseDate'])) . "<br>" . date("j", strtotime($courseDetailObj['courseDate'])) . "<sup>" . date("S", strtotime($courseDetailObj['courseDate'])) . "</sup> " . date("F Y", strtotime($courseDetailObj['courseDate']));
     $courseDetails['date_nb'] = date("l", strtotime($courseDetailObj['courseDate'])) . " " . date("j", strtotime($courseDetailObj['courseDate'])) . "<sup>" . date("S", strtotime($courseDetailObj['courseDate'])) . "</sup> " . date("F Y", strtotime($courseDetailObj['courseDate']));
     $courseDetails['time'] = date("g:i a", strtotime($courseDetailObj['startDateTime'])) . " to " . date("g:i a", strtotime($courseDetailObj['endDateTime']));
     $courseDetails['location'] = str_replace(", ", "<br>", str_replace("\n", "<br>", $courseDetailObj['StreetAddress']));
     $courseDetails['maplink'] = "https://www.google.com.au/maps?q=" . str_replace(" ", "+", str_replace("\n", " ", $courseDetailObj['StreetAddress']));
     //var_dump($courseDetails);
     //die();
     $emailKey = sha1(date("r", strtotime("now")) . generateRandomString(5) . $bookingID . $instanceID);
     //$bookingID = "123456789-123456789";
     $viewonlinelink = "https://www.australiawidefirstaid.com.au/email/?k=" . $emailKey;
     $livedata = $enrolVar['fname'] . " " . $enrolVar['lname'] . "|" . $enrolVar['email'] . "|" . $bookingID;
     $livechatURL = "https://www.australiawidefirstaid.com.au/?livechat=true&data=" . base64_encode($livedata);
     $html = getEmailTemplate("template_CouponEmailConfirmation_generic.htm");
     $html = varReplace("bookingID", $bookingID, $html);
     $html = varReplace("emailviewlink", $viewonlinelink, $html);
     $html = varReplace("livechatURL", $livechatURL, $html);
     $html = varReplace("user.firstname", $enrolVar['fname'], $html);
     $html = varReplace("user.lastname", $enrolVar['lname'], $html);
     $html = varReplace("user.address", $enrolVar['address'], $html);
     $html = varReplace("user.suburb", $enrolVar['suburb'], $html);
     $html = varReplace("user.state", $enrolVar['state'], $html);
     $html = varReplace("user.postcode", $enrolVar['postcode'], $html);
     $html = varReplace("user.phone", $enrolVar['mobile'], $html);
     $html = varReplace("user.email", $enrolVar['email'], $html);
     $html = varReplace("user.orginisation", $enrolVar['workplace'], $html);
     $html = varReplace("course.name", $courseDetails['name'], $html);
     $html = varReplace("course.date", $courseDetails['date'], $html);
     $html = varReplace("course.date_nb", $courseDetails['date_nb'], $html);
     $html = varReplace("course.time", $courseDetails['time'], $html);
     $html = varReplace("course.location", $courseDetails['location'], $html);
     $html = varReplace("course.maplink", $courseDetails['maplink'], $html);
     $message = $html;
     $semail = "*****@*****.**";
     $sname = "Australia Wide First Aid";
     $rname = "";
     $priority = "high";
     $type = "text/html";
     $replysemail = $semail;
     $fullmessage = "";
     //$remail = "*****@*****.**";
     $remail = $enrolVar['email'];
     $subject = "First Aid Course Booking Confirmation - " . $enrolVar['fname'] . " " . $enrolVar['lname'] . " - " . $enrolVar['workplace'];
     email::logEmail($remail, "", $ccEmail, $subjet, $message, $bookingID, $instanceID, $emailKey);
     esmtp::sendemail_smtp($remail, $subject, $message, $ccEmail);
 }
Esempio n. 4
0
function deleteConfirm($iArea, $iEvent)
{
    $aEventDetails = getEventDetails($iEvent);
    ?>
	<form id="frmDelete" name="frmDelete" method="post" action="<?php 
    echo $_SERVER['PHP_SELF'];
    ?>
">
		<input type="hidden" name="area" value="<?php 
    echo $iArea;
    ?>
">
		<input type="hidden" name="event" value="<?php 
    echo $iEvent;
    ?>
">
		<input type="hidden" name="confirmDelete" value="1">
		<input type="submit" name="delete" value="Click here to delete <?php 
    echo $aEventDetails->event_name;
    ?>
" >
	</form>
<?php 
}
Esempio n. 5
0
function requestAbsenceButton($eventNo)
{
    $absenceRequest = getAbsenceRequest($eventNo, $_COOKIE['email']);
    if ($absenceRequest['state'] == 'pending') {
        return '<td><span class="label label-warning">absence request ' . $absenceRequest['state'] . '</span></td><td><div class="btn">edit request</div></td>';
    }
    if ($absenceRequest['state'] == 'confirmed') {
        return '<td><span class="label label-success">absence request ' . $absenceRequest['state'] . '</span></td><td></td>';
    }
    if ($absenceRequest['state'] == 'denied') {
        return '<td><span class="label label-important">absence request ' . $absenceRequest['state'] . '</span></td><td><div class="btn">edit request</div></td>';
    } else {
        $eventDetails = getEventDetails($_SESSION['eventNo']);
        $callTime = strtotime($eventDetails['callTime']);
        if ($callTime > time()) {
            return '<div class="btn">request absence</div>';
        }
    }
    //print_r($absenceRequest);
}
Esempio n. 6
0
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/
// $Id: editEvent.php,v 1.4 2005/10/30 22:37:19 atrommer Exp $
checkUser($_SESSION['USERTYPE'], 2);
if (!$_REQUEST['event']) {
    // throw an error, we need an event to edit
    accessDenied("Please select an event to edit first!");
}
$oEvent = getEventDetails($_REQUEST['event']);
doHeader("Editing Event");
?>
<form name="frmAddEvent" action="editSchedDetails.php" method="post">
	<input type="hidden" name="isSubmit">
	<input type="hidden" name="area" value="<?php 
echo $oEvent->event_area_id;
?>
">
	<input type="hidden" name="event_id" value="<?php 
echo $oEvent->event_id;
?>
">
	<strong>Edit a new event:</strong>
	<table cellpadding="0" cellspacing="0" border="0">
	<tr>
                $updatequery .= "itItemCost = {$itemcost} ";
                $updatequery .= "WHERE itItemID = {$iItemID}";
                ba_db_query($link, $updatequery);
                $itemidlist .= "," . $iItemID;
            } else {
                $insertquery = "insert into {$db_prefix}items ";
                $insertquery .= "(itTicket, itMeal, itBunk, itMandatory, itAllowMultiple, itDescription, itAvailability, itAvailableFrom, itAvailableTo, itItemCost, itEventID)";
                $insertquery .= " VALUES ";
                $insertquery .= "({$ticket}, {$meal}, {$bunk}, {$mandatory}, {$allowmultiple}, '{$itemdescription}', '{$availability}', '{$availablefrom}', '{$availableto}',{$itemcost}, {$eventid}) ";
                ba_db_query($link, $insertquery);
            }
        }
    }
}
if ($eventid > 0) {
    $eventinfo = getEventDetails($eventid, 0, 'admin.php');
}
?>

<script type="text/javascript" src="../inc/wysiwyg/jquery.wysiwyg.js"></script>
<script type="text/javascript" src="../inc/wysiwyg/wysiwyg.image.js"></script>
<script type="text/javascript" src="../inc/wysiwyg/wysiwyg.link.js"></script>
<script type="text/javascript" src="../inc/wysiwyg/wysiwyg.table.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	$('#txtEventDetails').wysiwyg({
	initialContent: "Event Details",
	controls: {
		html: { visible : true }
	}
	});
Esempio n. 8
0
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/
// $Id: mySchedule.php,v 1.14 2006/02/03 20:24:34 atrommer Exp $
checkUser($_SESSION['USERTYPE'], 1);
doHeader("My Schedule");
// get the user's schedule
if (isset($_REQUEST['getDesc'])) {
    // display event description
    $oEvent = getEventDetails($_REQUEST['getDesc']);
    ?>
		<b><?php 
    echo $oEvent->event_name;
    ?>
</b>
		<br>
		  <span class="contactInfo"><?php 
    echo date("l, F jS, Y", strtotime($oEvent->event_date));
    ?>
 
		  (<?php 
    echo date("g:i a", strtotime($oEvent->event_start));
    ?>
 
		  - 
Esempio n. 9
0
    if ($tCount > 0) {
        $t .= " or ";
    }
    $t .= "type='{$type}'";
    $tCount++;
}
$sCount = 0;
$s = "";
foreach ($semesters as $semester) {
    if ($sCount > 0) {
        $s .= " or ";
    }
    $s .= "semester='{$semester}'";
    $sCount++;
}
$sql = "select * from event where ({$t}) AND ({$s}) order by callTime desc";
$events = mysql_query($sql);
$html = '<div class="block span5" id="events"><table class="table" id="eventsTable">';
while ($row = mysql_fetch_array($events, MYSQL_ASSOC)) {
    $eventDetails = getEventDetails($row['eventNo']);
    $html = $html . '
	<tr class="event" id="' . $eventDetails['eventNo'] . '">
		<td>' . labelArea($eventDetails['type']) . '</td>
		<td>' . $eventDetails['name'] . '</td>
		<td>' . date("l, F d, Y", strtotime($eventDetails["callTime"])) . '</td>
		<td>' . (strtotime($eventDetails['callTime']) > time() ? buttonArea($row['eventNo'], $eventDetails['type']) : '<span class="label label-inverse">This event is over</span>') . '</td>
	</tr>
	';
}
echo $html . '</table></div>';
eventExtras();
Esempio n. 10
0
 |
 | Bitsand is distributed in the hope that it will be useful, but WITHOUT ANY
 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 | FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 | details.
 |
 | You should have received a copy of the GNU General Public License along with
 | Bitsand.  If not, see <http://www.gnu.org/licenses/>.
 +---------------------------------------------------------------------------*/
//Do not need login check for this page
$bLoginCheck = False;
include 'inc/inc_head_db.php';
include 'inc/inc_head_html.php';
include 'inc/inc_commonqueries.php';
$db_prefix = DB_PREFIX;
$eventinfo = getEventDetails($_GET['EventID'], 0, 'bookinglist.php');
$eventid = $eventinfo['evEventID'];
//Get list of players that have paid
$sql = "SELECT plFirstName, " . "plSurname, " . "bkBookAs, " . "chName, chPreferredName, chGroupSel, chGroupText, chFaction, chMonsterOnly, " . "bkDatePaymentConfirmed " . "FROM {$db_prefix}players, {$db_prefix}characters, {$db_prefix}bookings " . "WHERE plPlayerID = chPlayerID " . "AND chPlayerID = bkPlayerID " . "AND bkDatePaymentConfirmed <> '' " . "AND bkDatePaymentConfirmed <> '0000-00-00' " . "AND bkEventID = {$eventid}";
$result = ba_db_query($link, $sql);
?>
<script src="inc/sorttable.js" type="text/javascript"></script>

<?php 
echo "<h1>" . TITLE . " - Bookings</h1>\n";
echo "<h2>" . htmlentities($eventinfo['evEventName']) . "</h2>\n";
?>

<form action = 'bookinglist.php' method = 'get'>
Select event:
<select name = 'EventID'>
Esempio n. 11
0
 | Foundation, either version 3 of the License, or (at your option) any later
 | version.
 |
 | Bitsand is distributed in the hope that it will be useful, but WITHOUT ANY
 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 | FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 | details.
 |
 | You should have received a copy of the GNU General Public License along with
 | Bitsand.  If not, see <http://www.gnu.org/licenses/>.
 +---------------------------------------------------------------------------*/
include '../inc/inc_head_db.php';
include '../inc/inc_admin.php';
include '../inc/inc_head_html.php';
include '../inc/inc_commonqueries.php';
$eventinfo = getEventDetails($_GET["EventID"], 0, 'admin.php');
?>

<h1><?php 
echo TITLE;
?>
 - Manage Event</h1>
<p>
<a href = 'admin.php'>Admin</a>
</p>
<h2><?php 
echo htmlentities(stripslashes($eventinfo['evEventName']));
?>
</h2>

<p>
Esempio n. 12
0
function schedEvent($postData, $iEventID = '')
{
    global $mail;
    global $host;
    global $docroot;
    // take the input vals, call addEvent, and call addAssign
    // if we have an event_id, we do an update, else, we just add
    if ($iEventID) {
        $iEID = $iEventID;
        // we update the event, delete the currently assigned emps, and re-add the sub'd ones
        updateEvent($iEventID, sanitizeInput($postData['dDate']), sanitizeInput($postData['dStartTime']), sanitizeInput($postData['dEndTime']), sanitizeInput($postData['area']), sanitizeInput($postData['tbName']));
        // now do the delete
        delAssign($iEventID);
    } else {
        // first add the event and get back the eventID
        $iEID = addEvent(sanitizeInput($postData['dDate']), sanitizeInput($postData['dStartTime']), sanitizeInput($postData['dEndTime']), sanitizeInput($postData['area']), sanitizeInput($postData['tbName']));
    }
    // now we grab the positions for the area
    // and iterate through the emp lists, adding the assignments
    $oPositions = getAreaPos($postData['area']);
    $oEmps = getMyEmployees($_SESSION['USERID']);
    // grab data for email
    // get sender details
    $oSender = getUserVals($_SESSION['USERID']);
    // get event details
    $oEventDetails = getEventDetails($iEID);
    // set up email basics
    $mail->From = $oSender->user_email;
    $mail->FromName = $oSender->user_first . ' ' . $oSender->user_last;
    // if updated event, change subj line
    if ($iEventID) {
        $sSubj = "UPDATED: ";
    } else {
        $sSubj = "";
    }
    $sSubj .= 'You have been scheduled for ' . $oEventDetails->event_name;
    $mail->Subject = $sSubj;
    // the message
    // handle updated event
    if ($iEventID) {
        $sBody = "The following event has been UPDATED!\n";
    } else {
        $sBody = "";
    }
    $sBody .= "You have been scheduled for the following:\n";
    $sBody .= "Event Name: " . $oEventDetails->event_name . "\n";
    $sBody .= "Event Date: " . date("l, F jS, Y", strtotime($oEventDetails->event_date)) . "\n";
    $sBody .= "From: " . date("g:i a", strtotime($oEventDetails->event_start)) . " To: " . date("g:i a", strtotime($oEventDetails->event_end)) . "\n";
    $sBody .= "\nPlease see http://" . $host . $docroot . " for more details.\n";
    $sBody .= "Thanks, \n" . $oSender->user_first . " " . $oSender->user_last;
    // append to mail
    $mail->Body = $sBody;
    // iterate list
    $bAssigned = false;
    // this flag flips once an assignment is made
    foreach ($oEmps as $Emp) {
        if ($_POST['rad' . $Emp->user_id]) {
            $bAssigned = true;
            // flip the flag
            addAssign($Emp->user_id, $_POST['rad' . $Emp->user_id], $iEID);
            $mail->AddAddress($Emp->user_email, $Emp->user_first . " " . $Emp->user_last);
        }
    }
    // now check for curUser assign
    if ($_POST['rad' . $_SESSION['USERID']]) {
        addAssign($_SESSION['USERID'], $_POST['rad' . $_SESSION['USERID']], $iEID);
    }
    // send mail if checkbox checked and if >= 1 emp assigned
    if ($postData['chkMail'] && $bAssigned) {
        // send the mail
        if (!$mail->Send()) {
            accessDenied("There has been an error sending mail!");
        }
        $mail->ClearAddresses();
        $mail->ClearAttachments();
    }
    return $iEID;
}
Esempio n. 13
0
    $newbooking = 1;
}
//Get event and booking details
if ($bookingid > 0) {
    $bookingsql = "Select * FROM {$db_prefix}bookings inner join {$db_prefix}events on evEventID = bkEventID inner join {$db_prefix}players on plPlayerID = bkPlayerID where bkID = " . $bookingid;
} else {
    $bookingsql = "Select * FROM {$db_prefix}events cross join {$db_prefix}players where evEventID = " . $eventid . " and plPlayerID = " . $playerid;
}
$result = ba_db_query($link, $bookingsql);
$bookinginfo = ba_db_fetch_assoc($result);
if ($playerid == 0 && ba_db_num_rows($result) == 0) {
    $sMsg = "You cannot view this booking";
    $sURL = fnSystemURL() . 'admin.php?warn=' . urlencode($sMsg);
    header("Location: {$sURL}");
}
$eventinfo = getEventDetails($bookinginfo['evEventID'], 0);
//Delete
if (($_POST['btnDelete'] != '' || $_POST['btnDeleteAndRebook'] != '') && CheckReferrer('admin_booking.php')) {
    if ($_POST['txtConfirm'] == 'CONFIRM') {
        deleteBooking($bookinginfo['bkID']);
        if ($_POST['btnDelete'] != '') {
            $sURL = fnSystemURL() . 'admin_manageevent.php?EventID=' . $bookinginfo['bkEventID'];
        } else {
            $sURL = fnSystemURL() . 'admin_booking.php?PlayerID=' . $bookinginfo['bkPlayerID'] . "&EventID=" . $bookinginfo['bkEventID'];
        }
        header("Location: {$sURL}");
    }
}
//Update
if ($_POST['btnSave'] != '' && CheckReferrer('admin_booking.php')) {
    $bookas = htmlentities(stripslashes($_POST['cboBookAs']));
Esempio n. 14
0
<?php

require_once 'functions.php';
$userEmail = $_COOKIE['email'];
//echo 'post: '.$_POST['id'];
if ($_POST['id'] == 'current') {
    $eventNo = $_SESSION['eventNo'];
} else {
    $eventNo = $_POST['id'];
    $_SESSION['eventNo'] = $eventNo;
}
$eventDetails = getEventDetails($eventNo);
$html = '
	<table class="table no-highlight no-border">
		<tr>
			<td class="eventDetialsKey" style="display:none;">Name:</td>
			<td style="text-align:right;"><h3 class="eventDetailsValue">' . $eventDetails['name'] . '</h3></td>
			<td class="eventDetialsKey" style="display:none;">Date:</td>
			<td><h3><span class="eventDetailsValue">' . date('l F d, Y', strtotime($eventDetails['callTime'])) . '</span></h3></td>
		</tr>
		<tr>
			<td class="eventDetialsKey">Call Time:</td>
			<td><span class="eventDetailsValue">' . date('g:ia', strtotime($eventDetails['callTime'])) . '</span></td>
		</tr>
		<tr>
			<td class="eventDetialsKey">Release Time:</td>
			<td><span class="eventDetailsValue">' . date('g:ia', strtotime($eventDetails['releaseTime'])) . '</span></td>
		</tr>
		<tr>
			<td class="eventDetialsKey">Uniform:</td>
			<td><span class="eventDetailsValue">' . $eventDetails['uniform'] . '</span></td>
function goEnrolments()
{
    $progroup = db::runQuery("select * from process_group where process_status = '2'");
    if ($progroup) {
        foreach ($progroup as $pgr) {
            $supressInvoiceEmail = "0";
            $generateInvoice = "true";
            $archiveINvoice = "true";
            if ($pgr['campaign_code'] == "") {
                $campaignCode = false;
                $campaignDetails = false;
                $campaignID = 0;
                $campaignName = false;
                $allowOfflinePayments = false;
                $forceOfflinePayments = false;
                $dontInvoiceUser = false;
                $addressToInvoice = false;
                $contactIDtoInvoice = false;
            } else {
                $campaignCode = $pgr['campaign_code'];
                $campaignDetails = getCampaignDetails($campaignCode);
                $campaignID = $campaignDetails['ID'];
                $campaignName = $campaignDetails['campaignName'];
                $allowOfflinePayments = $campaignDetails['allowOfflinePayments'];
                $forceOfflinePayments = $campaignDetails['forceOfflinePayments'];
                $dontInvoiceUser = $campaignDetails['dontInvoiceUser'];
                $addressToInvoice = $campaignDetails['addressToInvoice'];
                $contactIDtoInvoice = $campaignDetails['contactIDtoInvoice'];
                if ($forceOfflinePayments) {
                    $forceOfflinePayments = true;
                } else {
                    $forceOfflinePayments = false;
                }
                if ($contactIDtoInvoice == "") {
                    $contactIDtoInvoice = false;
                }
            }
            $courseID = $pgr['eventID'];
            $courseDetails = getEventDetails($courseID);
            //var_dump($courseDetails);
            if ($campaignDetails) {
                //Course Details
                $courseCostTotal = intval($courseDetails['cost']);
                $totalAttend = $pgr['total_trainee'];
                $courseCostTotal = $courseCostTotal * $totalAttend;
                if ($campaignDetails['discountType'] == 1) {
                    //Percent Discount
                    $courseCostTotal = $courseCostTotal - $courseCostTotal * ("0." . $campaignDetails['discountAmount']);
                    $manualInvoiceEmailPrice = $courseCostTotal;
                    $customPriceOption = false;
                    $sendManualInvoice = false;
                } else {
                    if ($campaignDetails['discountType'] == 2) {
                        //Custom Price Override - Location
                        $customPriceOption = 2;
                        $courseCostTotal = courseCustomPriceLookup($customPriceOption, $courseID, $courseCostTotal, $campaignCode);
                        $manualInvoiceEmailPrice = $courseCostTotal;
                        $dontInvoiceUser = true;
                        $sendManualInvoice = true;
                    } else {
                        if ($campaignDetails['discountType'] == 3) {
                            //Custom Price Override - Course
                            $customPriceOption = 3;
                            $courseCostTotal = courseCustomPriceLookup($customPriceOption, $courseID, $courseCostTotal, $campaignCode);
                            //return errorBackResponse($courseCostTotal." - ".$courseID);
                            $manualInvoiceEmailPrice = $courseCostTotal;
                            $dontInvoiceUser = true;
                            $sendManualInvoice = true;
                        } else {
                            //Dollor Amount Discount
                            $courseCostTotal = $courseCostTotal - $campaignDetails['discountAmount'];
                            $manualInvoiceEmailPrice = $courseCostTotal;
                            $customPriceOption = false;
                            $sendManualInvoice = false;
                        }
                    }
                }
                //return errorBackResponse("Disc Type: ".$campaignDetails['discountType']);
            } else {
                //Course Details
                $courseCostTotal = intval($courseDetails['cost']);
                $totalAttend = $pgr['total_trainee'];
                $courseCostTotal = $courseCostTotal * $totalAttend;
                $manualInvoiceEmailPrice = $courseCostTotal;
            }
            $processgroup = db::esc($pgr['processgroupID']);
            $contactIDtoInvoice = db::esc($contactIDtoInvoice);
            $allowOfflinePayments = db::esc($allowOfflinePayments);
            $forceOfflinePayments = db::esc($forceOfflinePayments);
            $dontInvoiceUser = db::esc($dontInvoiceUser);
            $addressToInvoice = db::esc($addressToInvoice);
            db::insertQuery("update process_group set process_status = '3', primaryContactID = '{$contactIDtoInvoice}', allowOfflinePayments = '{$allowOfflinePayments}', forceOfflinePayments = '{$forceOfflinePayments}', dontInvoiceUser = '******', addressToInvoice = '{$addressToInvoice}', contactIDtoInvoice = '{$contactIDtoInvoice}' where processgroupID = '{$processgroup}'");
            //Create Multi Enrolment
            $trainees = db::runQuery("select * from process_trainee where processgroupID = '{$processgroup}'");
            $primaryContact = "";
            $courseInstanceID = "";
            $processgroup = "";
            $costperperson = $courseDetails['cost'];
            if ($trainees) {
                $contactList = "";
                foreach ($trainees as $trn) {
                    if ($contactList == "") {
                        $contactList = $contactList . $trn['contactID'];
                        $primaryContact = $trn['contactID'];
                        $courseInstanceID = $trn['eventID'];
                        $processgroup = $trn['processgroupID'];
                        $processgroup = $trn['processgroupID'];
                        $costperperson = $trn['cost'];
                    } else {
                        $contactList = $contactList . "," . $trn['contactID'];
                    }
                }
                if ($contactIDtoInvoice != false) {
                    $primaryContact = $contactIDtoInvoice;
                }
                //contact IDS in list   55555,111211,515456
                $supressInvoiceEmail = true;
                //$generateInvoice = true;
                $archiveINvoice = false;
                //$contactInvoiceID = '236951';
                $enrollVars = array('contactID' => $contactList, 'instanceID' => $courseInstanceID, 'invoiceID' => $contactInvoiceID, 'payerID' => $primaryContact, 'type' => 'w');
                $enrollNow = axcelerate_multienroll($enrollVars, $processgroup);
                $contactListarr = explode(",", $contactList);
                $totalCost = 0;
                foreach ($contactListarr as $contact) {
                    $enrollVarsupdate = array('contactID' => $contact, 'instanceID' => $courseInstanceID, 'payerID' => $primaryContact, 'type' => 'w', 'cost' => $costperperson);
                    $enrollNowupdate = axcelerate_multienrollupdate($enrollVarsupdate, $processgroup);
                    var_dump($enrollNowupdate);
                    $totalCost = $totalCost + $costperperson;
                }
                if (isset($enrollNow->error)) {
                    $enrollIsError = true;
                    $trans['message'] = $enrollNow->MESSAGES;
                    dlog("Enrol-Enrolment: Axcelerate returned error: {$processgroup} - " . $trans['message']);
                    markGroupError($processgroup, "");
                    die;
                }
                $groupInvoiceID = "";
                $totalCost = 0;
                foreach ($enrollNow as $student) {
                    $InvoiceID = db::esc($student->INVOICEID);
                    $ContactID = db::esc($student->CONTACTID);
                    $LearnerID = db::esc($student->LEARNERID);
                    $Amount = db::esc($student->AMOUNT);
                    $totalCost = $totalCost + $student->AMOUNT;
                    $groupInvoiceID = $InvoiceID;
                    db::insertQuery("update process_trainee set learnerID = '{$LearnerID}', invoiceID = '{$InvoiceID}' where contactID = '{$ContactID}' and processgroupID = '{$processgroup}'");
                }
                if ($forceOfflinePayments == true) {
                    db::insertQuery("update process_group set GroupInvoiceID = '{$groupInvoiceID}', process_status = '4', totalcost = '{$courseCostTotal}', payment_type = 'offline', primaryContactID = '{$primaryContact}' where processgroupID = '{$processgroup}'");
                } else {
                    db::insertQuery("update process_group set GroupInvoiceID = '{$groupInvoiceID}', process_status = '4', totalcost = '{$courseCostTotal}', primaryContactID = '{$primaryContact}' where processgroupID = '{$processgroup}'");
                }
            }
        }
    }
}
Esempio n. 16
0
 |
 | Bitsand is distributed in the hope that it will be useful, but WITHOUT ANY
 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 | FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 | details.
 |
 | You should have received a copy of the GNU General Public License along with
 | Bitsand.  If not, see <http://www.gnu.org/licenses/>.
 +---------------------------------------------------------------------------*/
include '../inc/inc_head_db.php';
include '../inc/inc_admin.php';
include '../inc/inc_head_html.php';
include '../inc/inc_commonqueries.php';
$db_prefix = DB_PREFIX;
$key = CRYPT_KEY;
$eventinfo = getEventDetails($_GET['EventID'], 0, 'admin.php');
$eventid = $eventinfo['evEventID'];
if ($_POST['btnSubmit'] != '' && CheckReferrer('admin_marshal.php')) {
    foreach ($_POST as $key => $value) {
        if (substr($key, 0, 7) == "hPlayer") {
            $iPlayerID = (int) $value;
            $refnumber = (int) $_POST["txtRefNumber{$value}"];
            $marshal = stripslashes($_POST["cboMarshal{$value}"]);
            $sql_update = "UPDATE {$db_prefix}players SET plRefNumber = {$refnumber}, plMarshal = '{$marshal}' WHERE plPlayerID = " . $iPlayerID;
            ba_db_query($link, $sql_update);
        }
    }
}
//Get list of players that have confirmed their booking
$sql = "SELECT bkPlayerID, " . "plFirstName, " . "plSurname, " . "bkBookAs, " . "plMarshal, " . "plRefNumber " . "FROM {$db_prefix}players, {$db_prefix}bookings " . "WHERE plPlayerID = bkPlayerID and bkEventID = {$eventid}";
$result = ba_db_query($link, $sql);
Esempio n. 17
0
function GetBunkAvailability($eventid, $bookingtype, $bunks)
{
    global $link, $today, $db_prefix;
    $sql = "select ifnull(sum(bkBunkAllocated), 0) as BunksAllocated from {$db_prefix}bookings where bkEventID = {$eventid} ";
    if ($bookingtype != "All") {
        $sql .= " and bkBookAs = '{$bookingtype}' ";
    }
    $result = ba_db_query($link, $sql);
    $BookingTypeAvailable = ba_db_fetch_row($result);
    $BookingTypeCount = $BookingTypeAvailable[0];
    if ($BookingTypeCount >= $bunks) {
        return false;
    }
    return true;
}
$eventinfo = getEventDetails($_GET['EventID'], 1);
?>

<script type = 'text/javascript'>

<?php 
if (GetBunkAvailability($eventinfo['evEventID'], "All", $eventinfo['evTotalBunks'])) {
    if (GetBunkAvailability($eventinfo['evEventID'], "Player", $eventinfo['evPlayerBunks'])) {
        $playerbunks = 1;
    } else {
        $playerbunks = 0;
    }
    if (GetBunkAvailability($eventinfo['evEventID'], "Monster", $eventinfo['evMonsterBunks'])) {
        $monsterbunks = 1;
    } else {
        $monsterbunks = 0;
Esempio n. 18
0
 //if(isset($_SESSION['EnrolLocked'])){
 if ($_SESSION['EnrolLocked'] == true) {
     //echo "false";
     //die();
 } else {
     $_SESSION['EnrolLocked'] = true;
 }
 //} else {
 $_SESSION['EnrolLocked'] = true;
 //}
 //
 $postVar = $_POST;
 //var_dump($postVar);
 //Course ID from the form
 $courseID = $postVar['courseid'];
 $courseDetails = getEventDetails($courseID);
 //var_dump($courseDetails);
 if ($campaignDetails) {
     //Course Details
     $courseCostTotal = intval($courseDetails['cost']);
     if ($campaignDetails['discountType'] == 1) {
         //Percent Discount
         $courseCostTotal = $courseCostTotal - $courseCostTotal * ("0." . $campaignDetails['discountAmount']);
         $manualInvoiceEmailPrice = $courseCostTotal;
         $customPriceOption = false;
         $sendManualInvoice = false;
     } else {
         if ($campaignDetails['discountType'] == 2) {
             //Custom Price Override - Location
             $customPriceOption = 2;
             $courseCostTotal = courseCustomPriceLookup($customPriceOption, $courseID, $courseCostTotal, $campaignCode);