<div id="payoff" class="callout panel"> <span class="helper"></span> <img src="<?php echo HTTP_PATH; ?> images/our-heroes.svg" alt="Cancer Research UK" /> </div> <div id="awards" class="callout panel"> <div class="title"> <!-- <i class="icon-icons_trophy"></i> --> Available to spend </div> <div class="price-panel"> <!-- <i class="icon-icons_trophy"></i> --> <?php $sum_all = getAvailable($_SESSION['user']->EmpNum); $sum_credit_card = getCreditCard($_SESSION['user']->EmpNum); $sum_orders = getEmpBasketOrdersSum($_SESSION['user']->EmpNum); $remaining_amount = $sum_all + $sum_credit_card - $sum_orders; echo '£' . ' ' . $remaining_amount; ?> </div> <div class="unlaimed-panel"> <!-- <i class="icon-icons_trophy"></i> --> +2 Unclaimed </div> </div> <div class="callout panel" id="menu_container"> <?php $menu->db = $db; echo $menu->Menu();
function createXexecRedemptionExport($post) { global $db; setMyCookie($post, 'crukRed'); $CSVMaster = "<table>"; $sqlWhere = getRedeemSQL($post["EmpNum"]); $dateSQL = getRedeemDates($post, "bo."); $sql = "SELECT *\n \t\t\tFROM tblbasket b, tblbasketorders bo, tblempall a\n \t\t\tWHERE b.orderID IS NOT NULL \n\t\t\tAND b.orderID = bo.id \n\t\t\tAND b.EmpNum = a.EmpNum \n\t\t\t" . $sqlWhere . $dateSQL . " ORDER BY bo.id DESC"; $stmt = $db->prepare($sql); $stmt->execute(); $CSVLine .= "<tr>"; if ($post["NomineeID"] == "yes") { $CSVLine .= "<td>Nominee ID</td>"; } if ($post["Nominee"] == "yes") { $CSVLine .= "<td>Nominee</td>"; } if ($post["Department"] == "yes") { $CSVLine .= "<td>Department</td>"; } if ($post["NomGrade"] == "yes") { $CSVLine .= "<td>Grade</td>"; } if ($post["RedeemDate"] == "yes") { $CSVLine .= "<td>Redeem Date</td>"; } if ($post["TransCode"] == "yes") { $CSVLine .= "<td>Order Ref</td>"; } if ($post["ProdCat"] == "yes") { $CSVLine .= "<td>Product Category</td>"; } if ($post["Product"] == "yes") { $CSVLine .= "<td>Product</td>"; } if ($post["AmountSpent"] == "yes") { $CSVLine .= "<td>Amount Spent</td>"; } if ($post["CurrentBalance"] == "yes") { $CSVLine .= "<td>Current Balance</td>"; } $CSVLine .= "<td>Address 1</td>"; $CSVLine .= "<td>Address 2</td>"; $CSVLine .= "<td>Town</td>"; $CSVLine .= "<td>Postcode</td>"; $CSVLine .= "</tr>"; $CSVMaster .= $CSVLine; while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $CSVLine = "<tr>"; $dbline = $row; $Nominee = getUser($dbline["EmpNum"]); $EmpAwards = getAvailable($dbline["EmpNum"]); $ProdData = getProductByID($dbline["prID"]); $CCTrans = getCCTransaction($dbline["orderID"]); $prodCat = getProductCategory($ProdData["subID"]); // We check each field and then add it to the CSV if ($post["NomineeID"] == "yes") { $CSVLine .= "<td>" . $dbline["EmpNum"] . "</td>"; } if ($post["Nominee"] == "yes") { $CSVLine .= "<td>" . Trim($Nominee->Fname) . " " . Trim($Nominee->Sname) . "</td>"; } if ($post["Department"] == "yes") { $CSVLine .= "<td>" . Trim($Nominee->Department) . "</td>"; } if ($post["NomGrade"] == "yes") { $CSVLine .= "<td>" . Trim($Nominee->Grade) . "</td>"; } if ($post["RedeemDate"] == "yes") { $CSVLine .= "<td>" . $dbline["date"] . "</td>"; } if ($post["TransCode"] == "yes") { $CSVLine .= "<td>CR" . $dbline["orderID"] . "</td>"; } if ($post["ProdCat"] == "yes") { $CSVLine .= "<td>" . Trim($prodCat["label"]) . "</td>"; } if ($post["Product"] == "yes") { $CSVLine .= "<td>" . Trim($ProdData["aTitle"]) . "</td>"; } $totalprice = floatval($dbline["totalPrice"]) + floatval($CCTrans->Amount); if ($post["AmountSpent"] == "yes") { $CSVLine .= "<td>" . Trim($totalprice) . "</td>"; } if ($post["CurrentBalance"] == "yes") { $CSVLine .= "<td>" . $EmpAwards . "</td>"; } $CSVLine .= "<td>" . Trim($dbline["address1"]) . "</td>"; $CSVLine .= "<td>" . Trim($dbline["address2"]) . "</td>"; $CSVLine .= "<td>" . Trim($dbline["town"]) . "</td>"; $CSVLine .= "<td>" . Trim($dbline["postcode"]) . "</td>"; $CSVLine .= "</tr>"; $CSVMaster .= $CSVLine; } $CSVMaster .= $CSVLine . "</table>"; return $CSVMaster; }
</div> <div class="col-sm-8"> <p>SKILLS</p> </div> </div><!-- End of Resourses header --> <<<<<<< HEAD <?php getAvailable($connection, $today, 1); ?> </div> </div><!-- End of Available Resourses --> ======= <?php getAvailable($connection, $today, 1); ?> </div> </div><!-- End of Available Resourses --> >>>>>>> FETCH_HEAD <div class="col-sm-12 designResoursesBlock"><!-- BOOKED resourses BOX --> <div class="col-sm-4" style="width: auto; padding-right: 10px;" id="sectionHeader"> <h4>BOOKED</h4> </div> <div class="row hrContainer"> <hr class="primaryHr"/> </div> <!-- Resourses Block --> <div class="col-sm-12"> <!-- Resourses header -->
shoot them an email */ if (isset($_POST['unspent_award'])) { if (quarterCheck()) { //For each employee check if he has an approved award //received more then 3 months ago $employees = $db->prepare("SELECT * FROM tblempall"); $employees->execute(); while ($employee = $employees->fetch(PDO::FETCH_OBJ)) { //get his approved awards that are older then 3 months $awards = $db->prepare("SELECT COUNT(*) as Count FROM tblnominations WHERE NominatedEmpNum LIKE :EmpNum AND AprStatus LIKE '1' AND AprDate < NOW() - INTERVAL 3 MONTH"); $awards->execute(array(':EmpNum' => $employee->EmpNum)); $awards = $awards->fetch(PDO::FETCH_OBJ); if ($awards->Count > 0) { //calculate the user's remaining amount $sum_all = getAvailable($employee->EmpNum); $sum_credit_card = getCreditCard($employee->EmpNum); $sum_orders = getEmpBasketOrdersSum($employee->EmpNum); $remaining_amount = $sum_all + $sum_credit_card - $sum_orders; if ($remaining_amount > 0) { //shoot him an email $email = new StdClass(); $email->emailTo = $employee->Eaddress; $email->subject = "CRUK Website Unspent Amount Reminder"; $email->Content = '<p>Hi ' . $employee->Fname . '<p> <pYou have money in your account to spend!</p>'; sendEmail($email); } } } }