function __construct($orientation, $metric, $size, $year, $month) { $dynamicY = 0; parent::__construct($orientation, $metric, $size); $this->SetAutoPageBreak(true, 30); $this->AddPage(); try { $sql = "SELECT SUM(TIMESTAMPDIFF(MINUTE, starttime, endtime)) AS hours, B.name AS customername\n\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}diary A \n\t\t\t\t\t\tINNER JOIN {$_SESSION['DB_PREFIX']}client B \n\t\t\t\t\t\tON B.id = A.clientid \n\t\t\t\t\t\tWHERE A.status IN ('I', 'C')\n\t\t\t\t\t\tAND YEAR(A.starttime) = {$year}\n\t\t\t\t\t\tAND MONTH(A.starttime) = {$month}\n\t\t\t\t\t\tAND A.deleted != 'Y'\n\t\t\t\t\t\tGROUP BY B.name\n\t\t\t\t\t\tORDER BY B.name"; $result = mysql_query($sql); if ($result) { while ($member = mysql_fetch_assoc($result)) { $line = array("Customer" => $member['customername'], "Hours Worked" => number_format($member['hours'] / 60, 2)); if ($this->GetY() > 260) { $this->AddPage(); } $this->addLine($this->GetY(), $line, 5.5); $this->Line(10, $this->GetY() - 0.5, 200, $this->GetY() - 0.5); } } else { logError($sql . " - " . mysql_error()); } } catch (Exception $e) { logError($e->getMessage()); } }
function __construct($orientation, $metric, $size, $startdate, $enddate, $userid) { $dynamicY = 0; parent::__construct($orientation, $metric, $size); $this->SetAutoPageBreak(true, 30); $this->AddPage(); try { $sql = "SELECT A.*, \n\t\t\t\t\t B.name AS customername, B.accountnumber, \n\t\t\t\t\t\tDATE_FORMAT(A.metacreateddate, '%d/%m/%Y %H:%I') AS metacreateddate, \n\t\t\t\t\t\tDATE_FORMAT(A.converteddatetime, '%d/%m/%Y %H:%I') AS converteddatetime,\n\t\t\t\t\t\tTIMEDIFF(A.converteddatetime, A.metacreateddate) as diff\n\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}quotation A \n\t\t\t\t\t\tLEFT OUTER JOIN {$_SESSION['DB_PREFIX']}customer B \n\t\t\t\t\t\tON B.id = A.customerid \n\t\t\t\t\t\tLEFT OUTER JOIN {$_SESSION['DB_PREFIX']}members C \n\t\t\t\t\t\tON C.member_id = A.takenbyid \n\t\t\t\t\t\tWHERE A.takenbyid = {$userid} \n\t\t\t\t\t\tAND A.metacreateddate >= '{$startdate}' \n\t\t\t\t\t\tAND A.metacreateddate <= '{$enddate}' \n\t\t\t\t\t\tORDER BY A.metacreateddate DESC"; $result = mysql_query($sql); if ($result) { while ($member = mysql_fetch_assoc($result)) { $diff = $member['diff']; $conversiondate = $member['converteddatetime']; if (substr($diff, 0, 1) == "-") { $diff = " "; } if (substr($conversiondate, 0, 2) == "00") { $conversiondate = " "; } $line = array("Customer" => $member['customername'], "Customer Code" => $member['accountnumber'], "Quotation Number" => getSiteConfigData()->bookingprefix . "-" . sprintf("%06d", $member['id']), "Quotation Date" => $member['metacreateddate'], "Conversion Date" => $conversiondate, "Time Taken" => $diff, "Total" => number_format($member['total'], 2)); $this->addLine($this->GetY(), $line); } } else { logError($sql . " - " . mysql_error()); } } catch (Exception $e) { logError($e->getMessage()); } }
function __construct($orientation, $metric, $size, $startdate, $enddate, $userid) { $dynamicY = 0; parent::__construct($orientation, $metric, $size); $this->SetAutoPageBreak(true, 30); $this->AddPage(); try { $and = ""; if ($startdate != "") { $and .= " AND A.matchdate >= '{$startdate}' "; } if ($enddate != "") { $and .= " AND A.matchdate <= '{$enddate}' "; } if ($userid != "0") { $and .= " AND A.refereeid = {$userid} "; } $sql = "SELECT COUNT(*) AS matches, SUM(refereescore) AS score, \n\t\t\t\t\t B.name AS refereeename\n\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}matchdetails A \n\t\t\t\t\t\tLEFT OUTER JOIN {$_SESSION['DB_PREFIX']}referee B \n\t\t\t\t\t\tON B.id = A.refereeid \n\t\t\t\t\t\tWHERE refereescore >= 0 {$and}\n\t\t\t\t\t\tGROUP BY B.name \n\t\t\t\t\t\tORDER BY B.name"; $result = mysql_query($sql); if ($result) { while ($member = mysql_fetch_assoc($result)) { $line = array("Referee" => $member['refereeename'], "Games" => $member['matches'], "Average Score" => number_format($member['score'] / $member['matches'], 1)); if ($this->GetY() > 265) { $this->AddPage(); } $this->addLine($this->GetY(), $line); } } else { logError($sql . " - " . mysql_error()); } } catch (Exception $e) { logError($e->getMessage()); } }
function __construct($orientation, $metric, $size, $startdate, $enddate) { $dynamicY = 0; parent::__construct($orientation, $metric, $size); $this->SetAutoPageBreak(true, 30); $this->AddPage(); try { $and = ""; if ($startdate != "") { $and .= " AND A.matchdate >= '{$startdate}' "; } if ($enddate != "") { $and .= " AND A.matchdate <= '{$enddate}' "; } $sql = "SELECT A.*, DATE_FORMAT(A.matchdate, '%d/%m/%Y') AS matchdate,\n\t\t\t\t\t B.name AS refereeename,\n\t\t\t\t\t C.age, C.name AS teamname\n\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}matchdetails A \n\t\t\t\t\t\tLEFT OUTER JOIN {$_SESSION['DB_PREFIX']}referee B \n\t\t\t\t\t\tON B.id = A.refereeid \n\t\t\t\t\t\tLEFT OUTER JOIN {$_SESSION['DB_PREFIX']}teamagegroup C \n\t\t\t\t\t\tON C.id = A.teamid \n\t\t\t\t\t\tWHERE (A.ratereferee = 'P' OR A.rateplayers = 'P' OR A.ratemanagement = 'P' OR A.ratespectators = 'P' OR A.ratepitchsize = 'P' OR A.ratepitchcondition = 'P' OR A.rategoalsize = 'P' OR A.ratechangingrooms = 'P') {$and}\n\t\t\t\t\t\tORDER BY A.matchdate"; $result = mysql_query($sql); if ($result) { while ($member = mysql_fetch_assoc($result)) { $line = array("Date of Match" => $member['matchdate'], "Age Group" => "Under " . $member['age'], "Division" => $member['division'], "Reported By" => $member['teamname'], "Match ID" => $member['id'], "Comments" => $member['remarks']); if ($this->GetY() > 175) { $this->AddPage(); } $this->addLine($this->GetY(), $line); } } else { logError($sql . " - " . mysql_error()); } } catch (Exception $e) { logError($e->getMessage()); } }
function __construct($orientation, $metric, $size, $datefrom) { $dynamicY = 0; $this->dateFrom = $datefrom; start_db(); parent::__construct($orientation, $metric, $size); $this->SetAutoPageBreak(true, 30); $this->AddPage(); try { $startdate = convertStringToDate($this->dateFrom); $sql = "SELECT A.name, C.amount,\n\t\t\t\t\t (\n\t\t\t\t\t \t\tSELECT SUM(B.amount) * D.retailprice\n\t\t\t\t\t \t\tFROM {$_SESSION['DB_PREFIX']}eventtransaction B \n\t\t\t\t\t \t\tINNER JOIN {$_SESSION['DB_PREFIX']}product D\n\t\t\t\t\t \t\tON D.id = B.productid \n\t\t\t\t\t \t\tWHERE B.eventid = A.id \n\t\t\t\t\t \t\tAND B.eventdate = '{$startdate}' \n\t\t\t\t\t \t\tAND B.type = 'S'\n\t\t\t\t\t ) AS sold\n\t\t\t\t\t FROM {$_SESSION['DB_PREFIX']}event A \n\t\t\t\t\t LEFT OUTER JOIN {$_SESSION['DB_PREFIX']}eventforecast C\n\t\t\t\t\t ON C.eventid = A.id\n\t\t\t\t\t AND C.forecastdate = '{$startdate}' \n\t\t\t\t\t\tORDER BY A.name"; $result = mysql_query($sql); if ($result) { while ($member = mysql_fetch_assoc($result)) { $sold = $member['sold'] != "" ? $member['sold'] : 0; $line = array("Event" => $member['name'], "Takings" => "£ " . number_format($sold, 2), "Expected" => "£ " . number_format($member['amount'], 2)); $this->addLine($this->GetY(), $line, 6.2); } } else { logError($sql . " - " . mysql_error()); } } catch (Exception $e) { logError($e->getMessage()); } }
function __construct($orientation, $metric, $size, $startdate, $enddate, $userid) { $dynamicY = 0; parent::__construct($orientation, $metric, $size); $this->SetAutoPageBreak(true, 30); $this->AddPage(); try { $and = ""; if ($startdate != "") { $and .= " AND A.metacreateddate >= '{$startdate}' "; } if ($enddate != "") { $and .= " AND A.metacreateddate <= '{$enddate}' "; } if ($userid != "0") { $and .= " AND A.takenbyid = {$userid} "; } $sql = "SELECT A.*, \n\t\t\t\t\t B.name AS customername, B.accountnumber, \n\t\t\t\t\t C.fullname,\n\t\t\t\t\t\tDATE_FORMAT(A.metacreateddate, '%d/%m/%Y %H:%I') AS metacreateddate\n\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}quotation A \n\t\t\t\t\t\tLEFT OUTER JOIN {$_SESSION['DB_PREFIX']}customer B \n\t\t\t\t\t\tON B.id = A.customerid \n\t\t\t\t\t\tLEFT OUTER JOIN {$_SESSION['DB_PREFIX']}members C \n\t\t\t\t\t\tON C.member_id = A.takenbyid \n\t\t\t\t\t\tWHERE 1 = 1 {$and} \n\t\t\t\t\t\tORDER BY B.name, A.metacreateddate"; $result = mysql_query($sql); if ($result) { while ($member = mysql_fetch_assoc($result)) { $line = array("Customer" => $member['customername'], "Customer Code" => $member['accountnumber'], "Quotation Number" => getSiteConfigData()->bookingprefix . "-" . sprintf("%06d", $member['id']), "User" => $member['fullname'], "Quotation Date" => $member['metacreateddate'], "Value" => number_format($member['total'], 2)); $this->addLine($this->GetY(), $line); } } else { logError($sql . " - " . mysql_error()); } } catch (Exception $e) { logError($e->getMessage()); } }
function __construct($orientation, $metric, $size) { $dynamicY = 0; parent::__construct($orientation, $metric, $size); $this->SetAutoPageBreak(true, 30); $this->AddPage(); try { $startdate = convertStringToDate($_POST['datefrom']); $enddate = convertStringToDate($_POST['dateto']); if ($_POST['eventid'] != "0") { $eventid = $_POST['eventid']; $sql = "SELECT A.name, A.retailprice,\n\t\t\t\t\t\t (SELECT SUM(B.amount) FROM {$_SESSION['DB_PREFIX']}eventtransaction B WHERE B.productid = A.id AND B.eventid = {$eventid} AND B.eventdate BETWEEN '{$startdate}' AND '{$enddate}') AS sold,\n\t\t\t\t\t\t (SELECT SUM(C.amount) FROM {$_SESSION['DB_PREFIX']}eventtransaction C WHERE C.productid = A.id AND C.eventid = {$eventid} AND C.eventdate BETWEEN '{$startdate}' AND '{$enddate}') AS broken,\n\t\t\t\t\t\t (SELECT SUM(D.amount) FROM {$_SESSION['DB_PREFIX']}eventtransaction D WHERE D.productid = A.id AND D.eventid = {$eventid} AND D.eventdate BETWEEN '{$startdate}' AND '{$enddate}') AS demo\n\t\t\t\t\t\t FROM {$_SESSION['DB_PREFIX']}product A \n\t\t\t\t\t\t\tGROUP BY A.name\n\t\t\t\t\t\t\tORDER BY A.name"; } else { $sql = "SELECT A.name, A.retailprice,\n\t\t\t\t\t\t (SELECT SUM(B.amount) FROM {$_SESSION['DB_PREFIX']}eventtransaction B WHERE B.productid = A.id AND B.eventdate BETWEEN '{$startdate}' AND '{$enddate}' and B.type = 'S') AS sold,\n\t\t\t\t\t\t (SELECT SUM(C.amount) FROM {$_SESSION['DB_PREFIX']}eventtransaction C WHERE C.productid = A.id AND C.eventdate BETWEEN '{$startdate}' AND '{$enddate}' and C.type = 'B') AS broken,\n\t\t\t\t\t\t (SELECT SUM(D.amount) FROM {$_SESSION['DB_PREFIX']}eventtransaction D WHERE D.productid = A.id AND D.eventdate BETWEEN '{$startdate}' AND '{$enddate}' and D.type = 'G') AS demo\n\t\t\t\t\t\t FROM {$_SESSION['DB_PREFIX']}product A \n\t\t\t\t\t\t\tGROUP BY A.name\n\t\t\t\t\t\t\tORDER BY A.name"; } $result = mysql_query($sql); if ($result) { $total = 0; $totalsold = 0; $totalbroken = 0; $totaldemo = 0; while ($member = mysql_fetch_assoc($result)) { $sold = $member['sold'] != "" ? $member['sold'] : 0; $broken = $member['broken'] != "" ? $member['broken'] : 0; $demo = $member['demo'] != "" ? $member['demo'] : 0; $line = array("Product" => $member['name'], "Sold" => " " . $sold, "Broken" => " " . $broken, "Demo" => " " . $demo, "Cost" => "£ " . number_format($member['retailprice'] * ($broken + $sold + $demo), 2)); $this->addLine($this->GetY(), $line); $total += $member['retailprice'] * ($broken + $sold + $demo); $totalsold += $sold; $totalbroken += $broken; $totaldemo += $demo; } $line = array("Product" => "Total : ", "Sold" => " " . $totalsold, "Broken" => " " . $totalbroken, "Demo" => " " . $totaldemo, "Cost" => "£ " . number_format($total, 2)); $this->addLine($this->GetY() + 4, $line); } else { logError($sql . " - " . mysql_error()); } } catch (Exception $e) { logError($e->getMessage()); } }
function __construct($orientation, $metric, $size, $startdate, $enddate) { $dynamicY = 0; parent::__construct($orientation, $metric, $size); $this->SetAutoPageBreak(true, 30); $this->AddPage(); try { $sql = "SELECT A.name, B.name AS clubname\n\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}teamagegroup A \n\t\t\t\t\t\tINNER JOIN {$_SESSION['DB_PREFIX']}team B \n\t\t\t\t\t\tON B.id = A.teamid \n\t\t\t\t\t\tWHERE A.id NOT IN (SELECT C.agegroupid FROM {$_SESSION['DB_PREFIX']}player C)\n\t\t\t\t\t\tORDER BY A.name, B.name"; $result = mysql_query($sql); if ($result) { while ($member = mysql_fetch_assoc($result)) { $line = array("Club" => $member['clubname'], "Team" => $member['name']); if ($this->GetY() > 265) { $this->AddPage(); } $this->addLine($this->GetY(), $line); } } else { logError($sql . " - " . mysql_error()); } } catch (Exception $e) { logError($e->getMessage()); } }
function __construct($orientation, $metric, $size, $startdate, $enddate) { $this->fromdate = convertStringToDate($startdate); $this->todate = convertStringToDate($enddate); $eventid = $_POST['eventid']; $dynamicY = 0; parent::__construct($orientation, $metric, $size); $this->SetAutoPageBreak(true, 30); $this->AddPage(); try { $total = array(); $total[0] = 0; $total[1] = 0; $total[2] = 0; $total[3] = 0; $total[4] = 0; if ($eventid == 0) { $sql = "SELECT A.id, A.name, A.retailprice, B.stock \n\t\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}product A \n\t\t\t\t\t\t\tLEFT OUTER JOIN {$_SESSION['DB_PREFIX']}eventproductmatrix B\n\t\t\t\t\t\t\tON B.productid = A.id\n\t\t\t\t\t\t\tORDER BY A.name"; } else { $sql = "SELECT A.id, A.name, A.retailprice, B.stock \n\t\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}product A \n\t\t\t\t\t\t\tLEFT OUTER JOIN {$_SESSION['DB_PREFIX']}eventproductmatrix B\n\t\t\t\t\t\t\tON B.productid = A.id\n\t\t\t\t\t\t\tAND B.eventid = {$eventid}\n\t\t\t\t\t\t\tORDER BY A.name"; } $result = mysql_query($sql); if ($result) { while ($member = mysql_fetch_assoc($result)) { $productid = $member['id']; $productname = $member['name']; $stock = $member['stock']; $retailprice = $member['retailprice']; $sold = 0; $broken = 0; $demo = 0; if ($eventid == 0) { $sql = "SELECT \n\t\t\t\t\t\t\t\t\tIFNULL(SUM(B.amount), 0) AS amount \n\t\t\t\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}eventtransaction B \n\t\t\t\t\t\t\t\t\tWHERE B.productid = {$productid} \n\t\t\t\t\t\t\t\t\tAND B.type = 'S'\n\t\t\t\t\t\t\t\t\tAND B.eventdate BETWEEN '{$this->fromdate}' AND '{$this->todate}'"; } else { $sql = "SELECT \n\t\t\t\t\t\t\t\t\tIFNULL(SUM(B.amount), 0) AS amount \n\t\t\t\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}eventtransaction B \n\t\t\t\t\t\t\t\t\tWHERE B.productid = {$productid} \n\t\t\t\t\t\t\t\t\tAND B.eventid = {$eventid}\n\t\t\t\t\t\t\t\t\tAND B.type = 'S'\n\t\t\t\t\t\t\t\t\tAND B.eventdate BETWEEN '{$this->fromdate}' AND '{$this->todate}'"; } $itemresult = mysql_query($sql); if ($itemresult) { while ($itemmember = mysql_fetch_assoc($itemresult)) { $sold = $itemmember['amount']; } } else { logError($sql . " - " . mysql_error()); } if ($eventid == 0) { $sql = "SELECT \n\t\t\t\t\t\t\t\t\tIFNULL(SUM(B.amount), 0) AS amount \n\t\t\t\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}eventtransaction B \n\t\t\t\t\t\t\t\t\tWHERE B.productid = {$productid} \n\t\t\t\t\t\t\t\t\tAND B.type = 'B'\n\t\t\t\t\t\t\t\t\tAND B.eventdate BETWEEN '{$this->fromdate}' AND '{$this->todate}'"; } else { $sql = "SELECT \n\t\t\t\t\t\t\t\t\tIFNULL(SUM(B.amount), 0) AS amount \n\t\t\t\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}eventtransaction B \n\t\t\t\t\t\t\t\t\tWHERE B.productid = {$productid} \n\t\t\t\t\t\t\t\t\tAND B.eventid = {$eventid}\n\t\t\t\t\t\t\t\t\tAND B.type = 'B'\n\t\t\t\t\t\t\t\t\tAND B.eventdate BETWEEN '{$this->fromdate}' AND '{$this->todate}'"; } $itemresult = mysql_query($sql); if ($itemresult) { while ($itemmember = mysql_fetch_assoc($itemresult)) { $broken = $itemmember['amount']; } } else { logError($sql . " - " . mysql_error()); } if ($eventid == 0) { $sql = "SELECT \n\t\t\t\t\t\t\t\t\tIFNULL(SUM(B.amount), 0) AS amount \n\t\t\t\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}eventtransaction B \n\t\t\t\t\t\t\t\t\tWHERE B.productid = {$productid} \n\t\t\t\t\t\t\t\t\tAND B.type = 'G'\n\t\t\t\t\t\t\t\t\tAND B.eventdate BETWEEN '{$this->fromdate}' AND '{$this->todate}'"; } else { $sql = "SELECT \n\t\t\t\t\t\t\t\t\tIFNULL(SUM(B.amount), 0) AS amount \n\t\t\t\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}eventtransaction B \n\t\t\t\t\t\t\t\t\tWHERE B.productid = {$productid} \n\t\t\t\t\t\t\t\t\tAND B.eventid = {$eventid}\n\t\t\t\t\t\t\t\t\tAND B.type = 'G'\n\t\t\t\t\t\t\t\t\tAND B.eventdate BETWEEN '{$this->fromdate}' AND '{$this->todate}'"; } $itemresult = mysql_query($sql); if ($itemresult) { while ($itemmember = mysql_fetch_assoc($itemresult)) { $demo = $itemmember['amount']; } } else { logError($sql . " - " . mysql_error()); } $total[0] += $sold; $total[1] += $broken; $total[2] += $demo; $total[3] += $stock; $total[4] += $sold * $retailprice; $line = array(GetEventName($_POST['eventid']) => $productname, "SOLD" => $sold, "BROKEN" => $broken, "DEMO" => $demo, "BALANCE" => number_format($stock, 0), "SALES" => number_format($sold * $retailprice, 2)); $this->addLine($this->GetY(), $line, 5); } } else { logError($sql . " - " . mysql_error()); } $line = array(GetEventName($_POST['eventid']) => "Total", "SOLD" => " " . $total[0], "BROKEN" => " " . $total[1], "DEMO" => " " . $total[2], "BALANCE" => " " . $total[3], "SALES" => " " . number_format($total[4], 2)); $this->addLine($this->GetY() + 2, $line, 5); } catch (Exception $e) { logError($e->getMessage()); } }
function __construct($orientation, $metric, $size, $id) { $dynamicY = 0; start_db(); parent::__construct($orientation, $metric, $size); try { $sql = "SELECT \n\t\t\t\t\t\t A.*, \n\t\t\t\t\t\t DATE_FORMAT(A.matchdate, '%d/%m/%Y') AS matchdate,\n\t\t\t\t\t\t B.name AS refereename, C.name AS submittedteamname, D.name AS oppositionname, \n\t\t\t\t\t\t E.name AS agegroupname, E.age\n\t\t\t\t\t\t FROM {$_SESSION['DB_PREFIX']}matchdetails A\n\t\t\t\t\t\t LEFT OUTER JOIN {$_SESSION['DB_PREFIX']}referee B\n\t\t\t\t\t\t ON B.id = A.refereeid\n\t\t\t\t\t\t LEFT OUTER JOIN {$_SESSION['DB_PREFIX']}team C\n\t\t\t\t\t\t ON C.id = A.teamid\n\t\t\t\t\t\t LEFT OUTER JOIN {$_SESSION['DB_PREFIX']}team D\n\t\t\t\t\t\t ON D.id = A.oppositionid\n\t\t\t\t\t\t LEFT OUTER JOIN {$_SESSION['DB_PREFIX']}teamagegroup E\n\t\t\t\t\t\t ON E.id = A.agegroupid\n\t\t\t\t\t\t WHERE A.id = {$id}"; $result = mysql_query($sql); if ($result) { while ($this->headermember = mysql_fetch_assoc($result)) { $dynamicY = $this->newPage() + 2; $sql = "SELECT A.*, B.firstname, B.lastname, B.registrationnumber\n\t\t\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}matchplayerdetails A \n\t\t\t\t\t\t\t\tINNER JOIN {$_SESSION['DB_PREFIX']}player B \n\t\t\t\t\t\t\t\tON B.id = A.playerid\n\t\t\t\t\t\t\t\tWHERE A.matchid = {$id} \n\t\t\t\t\t\t\t\tORDER BY B.firstname, B.lastname"; $itemresult = mysql_query($sql); $index = 1; if ($itemresult) { while ($itemmember = mysql_fetch_assoc($itemresult)) { $this->addText(15, $dynamicY, $index++, 10, 4, ''); $this->addText(25, $dynamicY, $itemmember['firstname'] . " " . $itemmember['lastname'], 10, 4, ''); $dynamicY = $this->addText(110, $dynamicY, $itemmember['registrationnumber'], 10, 4, ''); } } else { logError($qry . " - " . mysql_error()); } $dynamicY = 153 + $this->margin; $dynamicY = $this->addText(15, $dynamicY, "CLUB / MANAGERS REPORT (Including the FA Respect Codes of Conduct)", 10, 4, 'B') + 2; if ($this->headermember['age'] < 12) { $this->addText(15, $dynamicY, "Referee", 10, 4, ''); $dynamicY = $this->addText(150, $dynamicY, $this->getRateDescription($this->headermember['ratereferee']), 10, 4, '') + 1; $this->addText(15, $dynamicY, "Opponent players", 10, 4, ''); $dynamicY = $this->addText(150, $dynamicY, $this->getRateDescription($this->headermember['rateplayers']), 10, 4, '') + 1; $this->addText(15, $dynamicY, "Opponent Management", 10, 4, ''); $dynamicY = $this->addText(150, $dynamicY, $this->getRateDescription($this->headermember['ratemanagement']), 10, 4, '') + 1; $this->addText(15, $dynamicY, "Opponent Spectators", 10, 4, ''); $dynamicY = $this->addText(150, $dynamicY, $this->getRateDescription($this->headermember['ratespectators']), 10, 4, '') + 1; $this->addText(15, $dynamicY, "Pitch Size", 10, 4, ''); $dynamicY = $this->addText(150, $dynamicY, $this->getRateDescription($this->headermember['ratepitchsize']), 10, 4, '') + 1; $this->addText(15, $dynamicY, "Pitch Condition", 10, 4, ''); $dynamicY = $this->addText(150, $dynamicY, $this->getRateDescription($this->headermember['ratepitchcondition']), 10, 4, '') + 1; $this->addText(15, $dynamicY, "Goal Size", 10, 4, ''); $dynamicY = $this->addText(150, $dynamicY, $this->getRateDescription($this->headermember['rategoalsize']), 10, 4, '') + 1; $this->addText(15, $dynamicY, "Changing Rooms", 10, 4, ''); $dynamicY = $this->addText(150, $dynamicY, $this->getRateDescription($this->headermember['ratechangingrooms']), 10, 4, '') + 1; } else { $this->addText(15, $dynamicY, "Did the pitch have the required barriers, cones and markings", 10, 4, ''); $dynamicY = $this->addText(150, $dynamicY, $this->headermember['requiredbarriers'] == 1 ? "Yes" : "No", 10, 4, '') + 1; $this->addText(15, $dynamicY, "Was the pitch size/condition, goals and changing rooms adequate", 10, 4, ''); $dynamicY = $this->addText(150, $dynamicY, $this->headermember['pitchsize'] == 1 ? "Yes" : "No", 10, 4, '') + 1; } $this->addText(15, $dynamicY, "Did your opponent players, management and spectators comply with the Codes", 10, 4, ''); $dynamicY = $this->addText(150, $dynamicY, $this->headermember['complycodes'] == 1 ? "Yes" : "No", 10, 4, '') + 1; $this->addText(15, $dynamicY, "Did you check your opponent players ID cards", 10, 4, ''); $dynamicY = $this->addText(150, $dynamicY, $this->headermember['opponentids'] == 1 ? "Yes" : "No", 10, 4, '') + 1; $this->Line(15, $dynamicY, 195, $dynamicY); $dynamicY = $this->addText(15, $dynamicY + 2, "REFEREE SECTION", 10, 4, 'B') + 3; $this->addText(15, $dynamicY, "Referee", 10, 4, 'B'); $this->addText(45, $dynamicY, $this->headermember['referee'], 10, 4, ''); if ($this->headermember['refereescore'] > 0) { $this->addText(105, $dynamicY, "Appointed by League", 10, 4, 'B'); $dynamicY = $this->addText(145, $dynamicY, $this->headermember['refappointedbyleague'] == "Y" ? "Yes" : "No", 10, 4, '') + 3; $this->addText(15, $dynamicY, "Marks out of 100", 10, 4, 'B'); $dynamicY = $this->addText(45, $dynamicY, $this->headermember['refereescore'], 10, 4, '') + 3; $this->addText(15, $dynamicY, "Remarks", 10, 4, 'B'); $dynamicY = $this->addText(45, $dynamicY, $this->headermember['refereeremarks'], 10, 4, '', 150) + 2; } else { $dynamicY = $this->addText(145, $dynamicY, " ", 10, 4, ''); } $this->Line(15, $dynamicY, 195, $dynamicY); $dynamicY = $this->addText(15, $dynamicY + 3, "SIGNED", 10, 4, 'B') + 2; $this->DynamicImage($this->headermember['imageid'], 15, $dynamicY); } } else { logError($sql . " - " . mysql_error()); } } catch (Exception $e) { logError($e->getMessage()); } $this->AliasNbPages(); }
function __construct($orientation, $metric, $size, $id) { $dynamicY = 0; start_db(); parent::__construct($orientation, $metric, $size); try { $sql = "SELECT A.*, DATE_FORMAT(A.invoicedate, '%d/%m/%Y') AS invoicedate,\n\t\t\t\t\t\tD.name AS customername, D.accountnumber, D.invoiceaddress1, D.invoiceaddress2, D.invoiceaddress3, \n\t\t\t\t\t\tD.invoicecity, D.invoicepostcode, B.deliveryaddress1, B.deliveryaddress2, \n\t\t\t\t\t\tB.deliveryaddress3, B.deliverycity, B.deliverypostcode, D.firstname, B.lastname,\n\t\t\t\t\t\tE.fullname AS takenbyname\n\t\t\t\t\t FROM {$_SESSION['DB_PREFIX']}invoice A\n\t\t\t\t\t INNER JOIN {$_SESSION['DB_PREFIX']}customerclientsite B\n\t\t\t\t\t ON B.id = A.siteid\n\t\t\t\t\t INNER JOIN {$_SESSION['DB_PREFIX']}customerclient C\n\t\t\t\t\t ON C.id = B.clientid\n\t\t\t\t\t INNER JOIN {$_SESSION['DB_PREFIX']}customer D\n\t\t\t\t\t ON D.id = C.customerid\n\t\t\t\t\t LEFT OUTER JOIN {$_SESSION['DB_PREFIX']}members E\n\t\t\t\t\t ON E.member_id = A.takenbyid\n\t\t\t\t\t WHERE A.id = {$id}\n\t\t\t\t\t ORDER BY A.id DESC"; $result = mysql_query($sql); if ($result) { while ($this->headermember = mysql_fetch_assoc($result)) { $shipping = $this->headermember['deliverycharge']; $discount = $this->headermember['discount']; $total = 0; $dynamicY = $this->newPage() + 7; $sql = "SELECT A.*, B.productcode, B.description\n\t\t\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}invoiceitem A \n\t\t\t\t\t\t\t\tINNER JOIN {$_SESSION['DB_PREFIX']}product B \n\t\t\t\t\t\t\t\tON B.id = A.productid \n\t\t\t\t\t\t\t\tWHERE A.invoiceid = {$id} \n\t\t\t\t\t\t\t\tORDER BY A.sequence"; $itemresult = mysql_query($sql); if ($itemresult) { while ($itemmember = mysql_fetch_assoc($itemresult)) { $line = array("Quantity" => $itemmember['quantity'], "Code" => $itemmember['productcode'], "Description" => $itemmember['description'], "Price Each" => number_format($itemmember['priceeach'], 2), "Line Total" => number_format($itemmember['priceeach'] * $itemmember['quantity'], 2)); $size = $this->addLine($dynamicY, $line); $dynamicY += $size + 1; if ($dynamicY > 225) { $dynamicY = $this->newPage(); $dynamicY = 102; } $total = $total + $itemmember['priceeach'] * $itemmember['quantity']; $totalvat += $itemmember['vat']; } } else { logError($qry . " - " . mysql_error()); } $line = array("Quantity" => " ", "Code" => " ", "Description" => " ", "Price Each" => "Goods Net:", "Line Total" => number_format($total, 2)); $size = $this->addLine(236, $line); $line = array("Quantity" => " ", "Code" => " ", "Description" => " ", "Price Each" => "Delivery:", "Line Total" => number_format($shipping, 2)); $size = $this->addLine(242, $line); $line = array("Quantity" => " ", "Code" => " ", "Description" => " ", "Price Each" => "Invoice Net:", "Line Total" => number_format($shipping + $total, 2)); $size = $this->addLine(248, $line); $totalvat += $shipping * (getSiteConfigData()->vatrate / 100); $line = array("Quantity" => " ", "Code" => " ", "Description" => " ", "Price Each" => "VAT:", "Line Total" => number_format($totalvat, 2)); $size = $this->addLine(254, $line); $line = array("Quantity" => " ", "Code" => " ", "Description" => " ", "Price Each" => "Total:", "Line Total" => number_format($totalvat + $shipping + $total - $discount, 2)); $size = $this->addLine(260, $line); $this->addText(162, 265, "Pounds Sterling", 6, 3); } } else { logError($sql . " - " . mysql_error()); } } catch (Exception $e) { logError($e->getMessage()); } $this->AliasNbPages(); }
function __construct($orientation, $metric, $size, $startdate, $enddate) { $dynamicY = 0; parent::__construct($orientation, $metric, $size); $this->SetAutoPageBreak(true, 30); $this->AddPage(); try { $and = ""; if ($startdate != "") { $and .= " AND A.matchdate >= '{$startdate}' "; } if ($enddate != "") { $and .= " AND A.matchdate <= '{$enddate}' "; } $sql = "SELECT A.*, DATE_FORMAT(A.matchdate, '%d/%m/%Y') AS matchdate,\n\t\t\t\t\t B.name AS refereeename,\n\t\t\t\t\t C.age, C.name AS teamname\n\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}matchdetails A \n\t\t\t\t\t\tLEFT OUTER JOIN {$_SESSION['DB_PREFIX']}referee B \n\t\t\t\t\t\tON B.id = A.refereeid \n\t\t\t\t\t\tLEFT OUTER JOIN {$_SESSION['DB_PREFIX']}teamagegroup C \n\t\t\t\t\t\tON C.id = A.teamid \n\t\t\t\t\t\tWHERE (A.remarks IS NOT NULL AND A.remarks != '') {$and}\n\t\t\t\t\t\tORDER BY A.matchdate"; $result = mysql_query($sql); if ($result) { while ($member = mysql_fetch_assoc($result)) { if ($member['division'] == "X") { if ($member['leaguecup'] == "L") { $pdivision = "League"; } else { if ($member['leaguecup'] == "C") { $pdivision = "Challenge Cup"; } else { if ($member['leaguecup'] == "N") { $pdivision = "Combination"; } else { if ($member['leaguecup'] == "X") { $pdivision = "Cup"; } else { if ($member['leaguecup'] == "T") { $pdivision = "Challenge Trophy"; } } } } } } else { if ($member['division'] == "P") { $pdivision = "Premier"; } else { if ($member['division'] == "1") { $pdivision = "1"; } else { if ($member['division'] == "2") { $pdivision = "2"; } else { if ($member['division'] == "3") { $pdivision = "3"; } else { if ($member['division'] == "4") { $pdivision = "4"; } else { if ($member['division'] == "5") { $pdivision = "5"; } else { if ($member['division'] == "6") { $pdivision = "6"; } else { if ($member['division'] == "A") { $pdivision = "A"; } else { if ($member['division'] == "B") { $pdivision = "B"; } else { if ($member['division'] == "C") { $pdivision = "C"; } else { if ($member['division'] == "D") { $pdivision = "D"; } else { if ($member['division'] == "E") { $pdivision = "E"; } else { if ($member['division'] == "F") { $pdivision = "F"; } else { if ($member['division'] == "G") { $pdivision = "G"; } else { if ($member['division'] == "H") { $pdivision = "H"; } } } } } } } } } } } } } } } } $line = array("Date of Match" => $member['matchdate'], "Age Group" => "Under " . $member['age'], "Division" => $pdivision, "Reported By" => $member['teamname'], "Match ID" => $member['id'], "Comments" => $member['remarks']); if ($this->GetY() > 175) { $this->AddPage(); } $this->addLine($this->GetY(), $line); } } else { logError($sql . " - " . mysql_error()); } } catch (Exception $e) { logError($e->getMessage()); } }
function __construct($orientation, $metric, $size, $year, $month) { $dynamicY = 0; parent::__construct($orientation, $metric, $size); $this->SetAutoPageBreak(true, 30); $this->AddPage(); try { $startdate = "{$year}-{$month}-01"; $enddate = "{$year}-{$month}-" . cal_days_in_month(CAL_GREGORIAN, $month, $year); $sql = "SELECT SUM(TIMESTAMPDIFF(MINUTE, starttime, endtime)) AS hours, B.fullname AS customername, B.member_id\n\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}diary A \n\t\t\t\t\t\tINNER JOIN {$_SESSION['DB_PREFIX']}members B \n\t\t\t\t\t\tON B.member_id = A.memberid \n\t\t\t\t\t\tWHERE A.status IN ('I', 'C')\n\t\t\t\t\t\tAND YEAR(A.starttime) = {$year}\n\t\t\t\t\t\tAND MONTH(A.starttime) = {$month}\n\t\t\t\t\t\tGROUP BY B.fullname\n\t\t\t\t\t\tORDER BY B.fullname"; $result = mysql_query($sql); if ($result) { while ($member = mysql_fetch_assoc($result)) { $holidays = 0; $absences = 0; $memberid = $member['member_id']; $sql = "SELECT A.startdate, A.enddate, A.enddate_half, A.startdate_half\n \t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}holiday A \n WHERE A.memberid = {$memberid} \n AND A.startdate <= '{$enddate}' \n AND A.enddate >= '{$startdate}'\n \t\t\t\t\t\tUNION ALL\n \t\t\t\t\t\tSELECT B.startdate, B.enddate, B.enddate_half, B.startdate_half\n \t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}bankholiday B\n WHERE B.startdate <= '{$enddate}' \n AND B.enddate >= '{$startdate}'"; $itemresult = mysql_query($sql); if ($itemresult) { while ($itemmember = mysql_fetch_assoc($itemresult)) { $date1 = new DateTime($startdate); $date2 = new DateTime($itemmember['startdate']); $diff = $date2->diff($date1)->format("%a"); if ($diff > 0) { $realstartdate = $date2; } else { $realstartdate = $date1; } $date1 = new DateTime($enddate); $date2 = new DateTime($itemmember['enddate']); $diff = $date1->diff($date2)->format("%a"); if ($diff > 0) { $realenddate = $date2; } else { $realenddate = $date1; } $holidays += $realenddate->diff($realstartdate)->format("%a"); $date = $realstartdate->format("Y-m-d"); while (strtotime($date) <= strtotime($realenddate->format("Y-m-d"))) { if (date("w", strtotime($date)) == 0 || date("w", strtotime($date)) == 6) { $holidays--; } $date = date("Y-m-d", strtotime("+1 day", strtotime($date))); } if ($itemmember['enddate_half'] == 1) { $holidays += 0.5; } if ($itemmember['startdate_half'] == 1) { $holidays += 0.5; } } } else { logError($sql . " - " . mysql_error()); } $sql = "SELECT *\n \t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}absence A \n WHERE memberid = {$memberid} \n AND startdate <= '{$enddate}' \n AND enddate >= '{$startdate}'"; $itemresult = mysql_query($sql); if ($itemresult) { while ($itemmember = mysql_fetch_assoc($itemresult)) { $date1 = new DateTime($startdate); $date2 = new DateTime($itemmember['startdate']); $diff = $date2->diff($date1)->format("%a"); if ($diff > 0) { $realstartdate = $date2; } else { $realstartdate = $date1; } $date1 = new DateTime($enddate); $date2 = new DateTime($itemmember['enddate']); $diff = $date1->diff($date2)->format("%a"); if ($diff > 0) { $realenddate = $date2; } else { $realenddate = $date1; } $absences += $realenddate->diff($realstartdate)->format("%a"); $date = $realstartdate->format("Y-m-d"); while (strtotime($date) <= strtotime($realenddate->format("Y-m-d"))) { if (date("w", strtotime($date)) == 0 || date("w", strtotime($date)) == 6) { $absences--; } $date = date("Y-m-d", strtotime("+1 day", strtotime($date))); } if ($itemmember['enddate_half'] == 1) { $absences += 0.5; } if ($itemmember['startdate_half'] == 1) { $absences += 0.5; } } } else { logError($sql . " - " . mysql_error()); } $line = array("Staff Member" => $member['customername'], "Holidays" => " " . number_format($holidays, 1), "Absences" => " " . number_format($absences, 1), "Hours Worked" => number_format($member['hours'] / 60, 2)); if ($this->GetY() > 260) { $this->AddPage(); } $this->addLine($this->GetY(), $line, 5.5); $this->Line(10, $this->GetY() - 0.5, 200, $this->GetY() - 0.5); } } else { logError($sql . " - " . mysql_error()); } } catch (Exception $e) { logError($e->getMessage()); } }
function __construct($orientation, $metric, $size, $id) { $dynamicY = 0; parent::__construct($orientation, $metric, $size); $this->SetAutoPageBreak(true, 5); $this->AddPage(); try { $sql = "SELECT *, DATE_FORMAT(A.startdate, '%d/%m/%Y') AS startdate\n\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}client A \n\t\t\t\t\t\tWHERE id = {$id}"; $result = mysql_query($sql); if ($result) { while ($member = mysql_fetch_assoc($result)) { $this->SetFillColor(100, 255, 100); $this->Rect(5.3, 21.3, 42.6, 7, "F"); $this->Rect(106.3, 21.3, 31.6, 6.5, "F"); $this->Rect(5.3, 55.3, 42.6, 25.4, "F"); $this->Rect(5.3, 88.3, 42.6, 7, "F"); $this->Rect(5.3, 105.3, 42.6, 10.6, "F"); $this->Rect(5.3, 123.5, 42.6, 60.6, "F"); $this->Rect(5.3, 206.5, 42.6, 51.6, "F"); $this->SetFillColor(150, 150, 255); $this->Rect(5.3, 28.3, 42.6, 26.5, "F"); $this->Rect(5.3, 81.40000000000001, 42.6, 7, "F"); $this->Rect(5.3, 95.40000000000001, 42.6, 10, "F"); $this->Rect(106.3, 81.40000000000001, 31.6, 6.5, "F"); $this->Rect(5.3, 116.4, 42.6, 7, "F"); $this->Rect(5.3, 184.4, 42.6, 22, "F"); $this->Rect(5.3, 258.4, 42.6, 21.2, "F"); $this->Line(106, 21, 106, 28); $this->Line(138, 21, 138, 28); $this->Line(106, 81, 106, 88); $this->Line(138, 81, 138, 88); $this->SetFillColor(0, 0, 0); $this->Rect(50, 128.4, 82.59999999999999, 7); $this->Rect(50, 140.4, 144, 7); $this->Rect(50, 152.6, 144, 7); $this->Line(59, 152.6, 59, 159.6); $this->Line(68, 152.6, 68, 159.6); $this->Line(77, 152.6, 77, 159.6); $this->Line(86, 152.6, 86, 159.6); $this->Line(95, 152.6, 95, 159.6); $this->Line(104, 152.6, 104, 159.6); $this->Line(113, 152.6, 113, 159.6); $this->Line(122, 152.6, 122, 159.6); $this->Line(131, 152.6, 131, 159.6); $this->Line(140, 152.6, 140, 159.6); $this->Line(149, 152.6, 149, 159.6); $this->Line(158, 152.6, 158, 159.6); $this->Line(167, 152.6, 167, 159.6); $this->Line(176, 152.6, 176, 159.6); $this->Line(185, 152.6, 185, 159.6); $this->Rect(50, 164.6, 18, 7); $this->Line(59, 164.6, 59, 171.6); $this->Rect(80, 164.6, 18, 7); $this->Line(89, 164.6, 89, 171.6); $this->Rect(110, 164.6, 27, 7); $this->Line(119, 164.6, 119, 171.6); $this->Line(128, 164.6, 128, 171.6); $this->Rect(150, 164.6, 21, 7); $this->Rect(50, 191.6, 136.5, 9); $this->Line(117.5, 200.6, 117.5, 206); $this->Line(126.5, 200.6, 126.5, 206); $this->Line(136.5, 200.6, 136.5, 206); $this->Line(146.5, 200.6, 146.5, 206); $this->Line(156.5, 200.6, 156.5, 206); $this->Line(166.5, 200.6, 166.5, 206); $this->Line(176.5, 200.6, 176.5, 206); $this->Line(186.5, 200.6, 186.5, 206); $this->Rect(92.5, 216, 10, 6); $this->Rect(92.5, 224, 10, 6); $this->Rect(92.5, 232, 50, 6); $this->Rect(92.5, 240, 100, 6); $this->Line(102.5, 232, 102.5, 238); $this->Line(112.5, 232, 112.5, 238); $this->Line(122.5, 232, 122.5, 238); $this->Line(132.5, 232, 132.5, 238); $margin = 74; $this->Rect(50, 191.6 + $margin, 136.5, 9); $this->Line(117.5, 200.6 + $margin, 117.5, 206 + $margin); $this->Line(126.5, 200.6 + $margin, 126.5, 206 + $margin); $this->Line(136.5, 200.6 + $margin, 136.5, 206 + $margin); $this->Line(146.5, 200.6 + $margin, 146.5, 206 + $margin); $this->Line(156.5, 200.6 + $margin, 156.5, 206 + $margin); $this->Line(166.5, 200.6 + $margin, 166.5, 206 + $margin); $this->Line(176.5, 200.6 + $margin, 176.5, 206 + $margin); $this->Line(186.5, 200.6 + $margin, 186.5, 206 + $margin); $this->Line(5, 28, 205, 28); $this->Line(5, 55, 205, 55); $this->Line(5, 81, 205, 81); $this->Line(5, 88, 205, 88); $this->Line(5, 95.5, 205, 95.5); $this->Line(5, 105, 205, 105); $this->Line(5, 116, 205, 116); $this->Line(5, 123.5, 205, 123.5); $this->Line(5, 184.5, 205, 184.5); $this->Line(5, 206.2, 205, 206.2); $this->Line(5, 258.2, 205, 258.2); // if ($member['paymentmethod'] == "Q") { // $paymentmethod = "Cheque"; // // } else if ($member['paymentmethod'] == "C") { // $paymentmethod = "Credit Card"; // // } else if ($member['paymentmethod'] == "D") { // $paymentmethod = "Debit Card"; // // } else if ($member['paymentmethod'] == "B") { // $paymentmethod = "Bank Transfer"; // } $paymentmethod = "Cheque / Credit Card / Debit Card / Bank Transfer"; $this->addText(10, 23, "Name of Organisation", 10, 4, ''); $this->addText(50, 23, $member['name'], 10, 4, ''); $this->addText(110, 23, "Contact Name", 10, 4, ''); $this->addText(140, 23, $member['firstname'] . " " . $member['lastname'], 10, 4, ''); $this->addText(10, 38, "Address", 10, 4, ''); $this->addText(50, 30, $member['address'], 10, 4, ''); $this->addText(10, 63, "Billing Address If Different", 10, 4, '', 29); $this->addText(50, 57, $member['billingaddress'], 10, 4, ''); $this->addText(10, 83, "Home Phone", 10, 4, '', 30); $this->addText(50, 83, $member['telephone'], 10, 4, '', 30); $this->addText(110, 83, "Mobile number", 10, 4, ''); $this->addText(140, 83, $member['mobile'], 10, 4, '', 30); $this->addText(10, 90, "Work Phone", 10, 4, '', 30); $this->addText(50, 90, $member['workphone'], 10, 4, '', 30); $this->addText(10, 98, "Email Address", 10, 4, '', 30); $this->addText(50, 98, $member['email'], 10, 4, ''); $this->addText(10, 107, "Paper Free Biling Address", 10, 4, '', 30); $this->addText(50, 108.5, $member['paperfreebillingaddress'], 10, 4, ''); $this->addText(10, 118, "Payment Method", 10, 4, '', 30); $this->addText(50, 118, $paymentmethod, 10, 4, ''); $this->addText(10, 152, "Credit/Debit Card Details", 10, 4, '', 30); $this->addText(50, 125, "Name as it appears on Card", 8, 3, 'B'); $this->addText(50, 137, "Address of cardholder", 8, 3, 'B'); $this->addText(50, 149, "16 Digits on the front of the card", 8, 3, 'B'); $this->addText(50, 161, "Valid from", 8, 3, 'B'); $this->addText(80, 161, "Expiry Date", 8, 3, 'B'); $this->addText(110, 161, "Card security code", 8, 3, 'B'); $this->addText(150, 161, "Issue Number", 8, 3, 'B'); $this->SetTextColor(180, 180, 180); $this->addText(51, 167, "MM", 8, 3, ''); $this->addText(60.4, 167, "YY", 8, 3, ''); $this->addText(81, 167, "MM", 8, 3, ''); $this->addText(90, 167, "YY", 8, 3, ''); $this->SetTextColor(0, 0, 0); $this->Image("images/newstarterform.png", 50, 173); $this->addText(10, 192, "Payment Authorisation", 10, 4, '', 30); $this->addText(50, 186, "I authorise Trianik Cleaners Ltd to debit my account monthly on or around the _________ of the Month", 8, 3, ''); $this->addText(50, 196, "Signature", 8, 3, 'B'); $this->SetTextColor(255, 0, 0); $this->addText(66, 194, "X", 16, 5, 'B'); $this->SetTextColor(0, 0, 0); $this->addText(118, 196, "Print Name", 8, 3, 'B'); $this->addText(118, 202, "Date", 8, 3, 'B'); $this->SetTextColor(180, 180, 180); $this->addText(130, 202, "D", 8, 3, ''); $this->addText(140, 202, "D", 8, 3, ''); $this->addText(150, 202, "M", 8, 3, ''); $this->addText(160, 202, "M", 8, 3, ''); $this->addText(170, 202, "Y", 8, 3, ''); $this->addText(180, 202, "Y", 8, 3, ''); $this->SetTextColor(0, 0, 0); $this->addText(50, 208, "TCL will debit your card for payment on or after the date shown above. Please make sure you have enough money in your account to meet the payment in full", 8, 3, 'B', 146); $this->addText(10, 232, "Keyholding", 10, 4, '', 30); $this->addText(50, 218, "Number of keys given ?", 8, 3, 'B'); $this->addText(93, 218, $member['numberofkeysgiven'], 8, 3, 'B'); $this->addText(50, 226, "Alarm Fob been given ?", 8, 3, 'B'); $this->addText(93, 226, $member['alarmfobgiven'] == "Y" ? "Yes" : "No", 8, 3, 'B'); $this->addText(50, 234, "Alarm Codes", 8, 3, 'B'); if (strlen($member['alarmcodes']) >= 1) { $this->addText(95, 234, substr($member['alarmcodes'], 0, 1), 8, 3, 'B'); } if (strlen($member['alarmcodes']) >= 2) { $this->addText(105, 234, substr($member['alarmcodes'], 1, 1), 8, 3, 'B'); } if (strlen($member['alarmcodes']) >= 3) { $this->addText(115, 234, substr($member['alarmcodes'], 2, 1), 8, 3, 'B'); } if (strlen($member['alarmcodes']) >= 4) { $this->addText(125, 234, substr($member['alarmcodes'], 3, 1), 8, 3, 'B'); } if (strlen($member['alarmcodes']) >= 5) { $this->addText(135, 234, substr($member['alarmcodes'], 4, 1), 8, 3, 'B'); } $this->addText(50, 242, "Access Instructions", 8, 3, 'B'); $this->addText(93, 242, $member['accessinstructions'], 8, 3, 'B'); $this->addText(50, 250, "Trianik take responsibility of your keys, they will be given a keyring with its own unique code, never displaying names or address, we will only gain access to your property at mutually agreed times.", 8, 3, 'B', 146); $this->addText(10, 270, "Access Authorisation", 10, 4, '', 30); $this->addText(50, 260, "I authorise Trianik Cleaners Ltd to act as resposible key holders to my property.", 8, 3, 'B', 146); $this->addText(50, 270, "Signature", 8, 3, 'B'); $this->SetTextColor(255, 0, 0); $this->addText(66, 268, "X", 16, 5, 'B'); $this->SetTextColor(0, 0, 0); $this->addText(118, 270, "Print Name", 8, 3, 'B'); $this->addText(118, 276, "Date", 8, 3, 'B'); $this->SetTextColor(180, 180, 180); $this->addText(130, 276, "D", 8, 3, ''); $this->addText(140, 276, "D", 8, 3, ''); $this->addText(150, 276, "M", 8, 3, ''); $this->addText(160, 276, "M", 8, 3, ''); $this->addText(170, 276, "Y", 8, 3, ''); $this->addText(180, 276, "Y", 8, 3, ''); $this->SetTextColor(0, 0, 0); /************************ Page 2 *********************/ $this->AddPage(); $this->SetFillColor(100, 255, 100); $this->Rect(5.3, 21.3, 42.6, 6.5, "F"); $this->Rect(106.3, 21.3, 41.6, 6.5, "F"); $this->Rect(5.3, 36.2, 42.6, 7.5, "F"); $this->Rect(106.3, 36.2, 41.6, 7.5, "F"); $this->Rect(5.3, 58.2, 42.6, 7.5, "F"); $this->Rect(5.3, 73.3, 42.6, 206.4, "F"); $this->SetFillColor(150, 150, 255); $this->Rect(5.3, 28.3, 42.6, 7.2, "F"); $this->Rect(106.3, 28.4, 41.6, 7.2, "F"); $this->Rect(5.3, 44.3, 42.6, 13.7, "F"); $this->Rect(5.3, 65.8, 42.6, 7.2, "F"); $this->Line(5, 28, 205, 28); $this->Line(5, 36, 205, 36); $this->Line(5, 44, 205, 44); $this->Line(5, 58, 205, 58); $this->Line(5, 66, 205, 66); $this->Line(5, 73, 205, 73); $this->Line(106.3, 20.9, 106.3, 44); $this->Line(147.9, 20.9, 147.9, 44); if ($member['frequency'] == "O") { $frequency = "One Off"; } else { if ($member['frequency'] == "W") { $frequency = "Weekly"; } else { if ($member['frequency'] == "T") { $frequency = "Two Weekly"; } else { if ($member['frequency'] == "F") { $frequency = "Four Weekly"; } else { $frequency = ""; } } } } $this->addText(10, 23, "Frequency of cleaning", 10, 4, ''); $this->addText(50, 23, $frequency, 8, 3, ''); $this->addText(110, 23, "Start Date", 10, 4, ''); $this->addText(150, 23, $member['startdate'] == "00/00/0000" ? "N/A" : $member['startdate'], 8, 3, ''); $this->addText(10, 31, "Hours Required", 10, 4, ''); $this->addText(50, 31, $member['hoursrequired'], 8, 3, ''); $this->addText(110, 31, "Preferred day/time", 10, 4, ''); $this->addText(150, 31, $member['preferreddaytime'], 8, 3, ''); $this->addText(10, 38, "Number of Bedrooms", 10, 4, ''); $this->addText(50, 38, $member['numberofbedrooms'], 8, 3, ''); $this->addText(110, 38, "Number of Bathrooms", 10, 4, ''); $this->addText(150, 38, $member['numberofbathrooms'], 8, 3, ''); $this->addText(10, 45, "Valuable items to be removed or not cleaned", 10, 4, '', 34); $this->addText(50, 45, $member['valuablestoberemoved'], 8, 3, ''); $this->addText(10, 60, "Vacuum", 10, 4, '', 30); $this->addText(50, 60, $member['vacuum'] == "Y" ? "Yes" : "No", 8, 3, ''); $this->addText(10, 67, "Ironing required", 10, 4, '', 30); $this->addText(50, 67, $member['ironingrequired'] == "Y" ? "Yes" : "No", 8, 3, ''); $this->addText(10, 74, "Specific Cleaning Requirements", 10, 4, '', 32); $this->addText(50, 74, $member['specificrequirements'], 8, 3, '', 153); } } else { logError($sql . " - " . mysql_error()); } } catch (Exception $e) { logError($e->getMessage()); } }
function __construct($orientation, $metric, $size, $startdate) { $this->fromdate = convertStringToDate($startdate); $this->todate = date("Y-m-d", strtotime("+1 week", strtotime($this->fromdate))); $eventid = $_POST['eventid']; $dynamicY = 0; parent::__construct($orientation, $metric, $size); $this->SetAutoPageBreak(true, 30); $this->AddPage(); try { $total = array(); $total[0] = 0; $total[1] = 0; $total[2] = 0; $total[3] = 0; $total[4] = 0; $total[5] = 0; $total[6] = 0; $sql = "SELECT A.id, A.name \n\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}product A \n\t\t\t\t\t\tORDER BY A.name"; $result = mysql_query($sql); if ($result) { while ($member = mysql_fetch_assoc($result)) { $productid = $member['id']; $productname = $member['name']; $date = $this->fromdate; $amounts = array(); while (strtotime($date) <= strtotime($this->todate)) { if ($eventid == 0) { $sql = "SELECT IFNULL(SUM(B.amount), 0) AS amount\n\t\t\t\t\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}eventtransaction B \n\t\t\t\t\t\t\t\t\t\tWHERE B.productid = {$productid} \n\t\t\t\t\t\t\t\t\t\tAND B.eventdate = '{$date}'"; } else { $sql = "SELECT IFNULL(SUM(B.amount), 0) AS amount\n\t\t\t\t\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}eventtransaction B \n\t\t\t\t\t\t\t\t\t\tWHERE B.productid = {$productid} \n\t\t\t\t\t\t\t\t\t\tAND B.eventid = {$eventid}\n\t\t\t\t\t\t\t\t\t\tAND B.eventdate = '{$date}'"; } $itemresult = mysql_query($sql); if ($itemresult) { while ($itemmember = mysql_fetch_assoc($itemresult)) { array_push($amounts, $itemmember['amount']); } } else { logError($sql . " - " . mysql_error()); } $date = date("Y-m-d", strtotime("+1 day", strtotime($date))); } $total[0] += $amounts[0]; $total[1] += $amounts[1]; $total[2] += $amounts[2]; $total[3] += $amounts[3]; $total[4] += $amounts[4]; $total[5] += $amounts[5]; $total[6] += $amounts[6]; $line = array(GetEventName($_POST['eventid']) => $productname, $this->dates[0] => $amounts[0], $this->dates[1] => $amounts[1], $this->dates[2] => $amounts[2], $this->dates[3] => $amounts[3], $this->dates[4] => $amounts[4], $this->dates[5] => $amounts[5], $this->dates[6] => $amounts[6]); $this->addLine($this->GetY(), $line, 5); } } else { logError($sql . " - " . mysql_error()); } $line = array(GetEventName($_POST['eventid']) => "Total", $this->dates[0] => " " . $total[0], $this->dates[1] => " " . $total[1], $this->dates[2] => " " . $total[2], $this->dates[3] => " " . $total[3], $this->dates[4] => " " . $total[4], $this->dates[5] => " " . $total[5], $this->dates[6] => " " . $total[6]); $this->addLine($this->GetY() + 2, $line, 5); } catch (Exception $e) { logError($e->getMessage()); } }
function __construct($orientation, $metric, $size, $startdate, $enddate) { $dynamicY = 0; parent::__construct($orientation, $metric, $size); $this->SetAutoPageBreak(true, 30); $this->AddPage(); try { $and = ""; if ($startdate != "") { $and .= "AND A.matchdate >= '{$startdate}' "; } if ($enddate != "") { $and .= "AND A.matchdate <= '{$enddate}' "; } $sql = "SELECT A.*, B.age,\n\t\t\t\t\t\tDATE_FORMAT(A.matchdate, '%d/%m/%Y') AS matchdate\n\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}matchdetails A \n\t\t\t\t\t\tINNER JOIN {$_SESSION['DB_PREFIX']}teamagegroup B\n\t\t\t\t\t\tON B.id = A.teamid \n\t\t\t\t\t\tWHERE B.age >= 12 {$and} \n\t\t\t\t\t\tORDER BY A.matchdate, B.age, A.division, A.hometeam"; $result = mysql_query($sql); $division = ""; $agegroup = ""; $matchdate = ""; if ($result) { while ($member = mysql_fetch_assoc($result)) { if ($matchdate != $member['matchdate']) { $line = array("Age Group" => "Match Date : " . $member['matchdate'], "Division" => " ", "Home Team" => " ", "Score" => " ", "Away Team" => " ", " Score " => " "); $this->addLine($this->GetY() + 5, $line); $line = array("Age Group" => " ", "Division" => " ", "Home Team" => " ", "Score" => " ", "Away Team" => " ", " Score " => " "); $this->addLine($this->GetY(), $line); $matchdate = $member['matchdate']; $agegroup = ""; } $division = $member['division']; $pdivision = " "; if ($member['division'] == "X") { if ($member['leaguecup'] == "L") { $pdivision = "League"; } else { if ($member['leaguecup'] == "C") { $pdivision = "Challenge Cup"; } else { if ($member['leaguecup'] == "N") { $pdivision = "Combination"; } else { if ($member['leaguecup'] == "X") { $pdivision = "Cup"; } else { if ($member['leaguecup'] == "T") { $pdivision = "Challenge Trophy"; } } } } } } else { if ($member['division'] == "P") { $pdivision = "Premier"; } else { if ($member['division'] == "1") { $pdivision = "1"; } else { if ($member['division'] == "2") { $pdivision = "2"; } else { if ($member['division'] == "3") { $pdivision = "3"; } else { if ($member['division'] == "4") { $pdivision = "4"; } else { if ($member['division'] == "5") { $pdivision = "5"; } else { if ($member['division'] == "6") { $pdivision = "6"; } else { if ($member['division'] == "A") { $pdivision = "A"; } else { if ($member['division'] == "B") { $pdivision = "B"; } else { if ($member['division'] == "C") { $pdivision = "C"; } else { if ($member['division'] == "D") { $pdivision = "D"; } else { if ($member['division'] == "E") { $pdivision = "E"; } else { if ($member['division'] == "F") { $pdivision = "F"; } else { if ($member['division'] == "G") { $pdivision = "G"; } else { if ($member['division'] == "H") { $pdivision = "H"; } } } } } } } } } } } } } } } } $line = array("Age Group" => "Under " . $member['age'], "Division" => $pdivision, "Home Team" => $member['hometeam'], "Score" => $member['hometeamscore'], "Away Team" => $member['opposition'], " Score " => $member['awayteamscore']); if ($this->GetY() > 265) { $this->AddPage(); } $this->addLine($this->GetY(), $line); } } else { logError($sql . " - " . mysql_error()); } } catch (Exception $e) { logError($e->getMessage()); } }