function Header()
 {
     global $cityName;
     $this->SetFont('Arial', '', 12);
     $this->SetX(-35);
     $this->Cell(0, 6, date("M d, Y"), 0, 0, 'R');
     $this->Ln(0);
     $this->printTitle();
     $this->SetFont('Arial', '', 12);
     $t = "";
     $v = "";
     if (isset($_GET['region']) && strlen($_GET['region']) > 0) {
         $t = "Region";
         $v = $_GET['region'];
     } else {
         if (isset($_GET['city']) && strlen($_GET['city']) > 0) {
             $t = "City";
             $v = $_GET['city'];
         }
     }
     if (strlen($t) > 0) {
         $this->Cell(30, 6, $t, 0, 0, 'L');
         $this->Cell(63, 6, $v, 'B', 0, 'L');
         if (strlen($cityName) > 0) {
             $this->Cell(30, 6, "City", 0, 0, 'L');
             $this->Cell(63, 6, $cityName, 'B', 0, 'L');
         }
         $this->Ln(10);
     }
     //Ensure table header is output
     parent::Header();
 }
 function Header()
 {
     global $title, $partyName;
     $this->SetFont('Arial', 'B', 18);
     // $this->Cell(0, 6, $_SESSION['companyname'], 0, 0, 'C');
     $this->SetFont('Arial', '', 12);
     $this->SetX(-35);
     $this->Cell(0, 6, date("M d, Y"), 0, 0, 'R');
     $this->Ln(0);
     $this->SetFont('Arial', 'B', 14);
     $this->Cell(0, 6, $title, 0, 1, 'C');
     $this->Ln(2);
     if (strlen($_GET['date_start']) > 0) {
         $this->SetFont('Arial', 'B', 12);
         $this->Cell(30, 6, "Start Date:", 0, 0, 'L');
         $this->SetFont('Arial', '', 12);
         $this->Cell(30, 6, $_GET['date_start'], 'B', 0, 'L');
         $this->SetX(-70);
     }
     if (strlen($_GET['date_end']) > 0) {
         $this->SetFont('Arial', 'B', 12);
         $this->Cell(30, 6, "End Date:", 0, 0, 'L');
         $this->SetFont('Arial', '', 12);
         $this->Cell(30, 6, $_GET['date_end'], 'B', 0, 'R');
     }
     $this->Ln();
     $this->SetFont('Arial', 'B', 12);
     $this->Cell(30, 6, "Party:", 0, 0, 'L');
     $this->SetFont('Arial', '', 12);
     $this->Cell(150, 6, $partyName, 'B', 1, 'L');
     $this->Ln(2);
     //Ensure table header is output
     parent::Header();
 }
Exemple #3
0
 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 Header()
 {
     global $title;
     $this->SetFont('Arial', '', 12);
     $this->SetX(-35);
     $this->Cell(0, 6, date("M d, Y"), 0, 0, 'R');
     $this->Ln(0);
     $this->SetFont('Arial', 'B', 14);
     $this->Cell(0, 6, $title, 0, 1, 'C');
     $this->Ln(2);
     $this->SetFont('Arial', 'B', 10);
     //$this->Cell(50, 6, $vendor, 'B', 0, 'L');
     $this->SetX($this->GetX() + 90);
     //$this->Cell(50, 6, $vehicle, 'B', 1, 'L');
     $this->Ln(2);
     $w = $this->w - $this->lMargin - $this->rMargin;
     $this->SetFont('Arial', 'B', 10);
     $this->Cell(20 / 100 * $w, 6, "Name", 1, 0, 'C');
     $this->Cell(25 / 100 * $w, 6, "Address", 1, 0, 'C');
     $this->Cell(10 / 100 * $w, 6, "Phone1", 1, 0, 'C');
     $this->Cell(10 / 100 * $w, 6, "Phone2", 1, 0, 'C');
     $this->Cell(10 / 100 * $w, 6, "Phone3", 1, 0, 'C');
     $this->Cell(12 / 100 * $w, 6, "Person", 1, 0, 'C');
     $this->Cell(13 / 100 * $w, 6, "Vehicle", 1, 0, 'C');
     $this->Ln();
     //Ensure table header is output
     parent::Header();
 }
 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());
     }
 }
Exemple #8
0
 function Header()
 {
     global $title, $vendor;
     $this->SetFont('Arial', '', 12);
     $this->SetX(-35);
     $this->Cell(0, 6, date("M d, Y"), 0, 0, 'R');
     $this->Ln(0);
     $this->SetFont('Arial', 'B', 14);
     $this->Cell(0, 6, $title, 0, 1, 'C');
     $this->Ln(1);
     $this->SetFont('Arial', 'B', 10);
     $this->Cell(50, 6, $vendor, 'B', 0, 'L');
     $this->SetX($this->GetX() + 90);
     $this->Cell(50, 6, "", 'B', 1, 'L');
     $this->Ln(1);
     $w = $this->w - $this->lMargin - $this->rMargin;
     $this->SetFont('Arial', 'B', 10);
     $this->Cell(5 / 100 * $w, 6, "C-No", 1, 0, 'C');
     $this->Cell(40 / 100 * $w, 6, "Description", 1, 0, 'C');
     $this->Cell(25 / 100 * $w, 6, "Manufacturer No", 1, 0, 'C');
     $this->Cell(5 / 100 * $w, 6, "Cost", 1, 0, 'C');
     $this->Cell(5 / 100 * $w, 6, "Sale", 1, 0, 'C');
     $this->Cell(5 / 100 * $w, 6, "Diff", 1, 0, 'C');
     $this->Cell(5 / 100 * $w, 6, "Qty", 1, 0, 'C');
     $this->Cell(10 / 100 * $w, 6, "Amount", 1, 0, 'C');
     $this->Ln();
     //Ensure table header is output
     parent::Header();
 }
Exemple #9
0
 function Header()
 {
     global $title, $vehicle, $vendor;
     $this->SetFont('Arial', '', 12);
     $this->SetX(-35);
     $this->Cell(0, 6, date("M d, Y"), 0, 0, 'R');
     $this->Ln(0);
     $this->SetFont('Arial', 'B', 14);
     $this->Cell(0, 6, $title, 0, 1, 'C');
     $this->Ln(2);
     $this->SetFont('Arial', 'B', 10);
     $this->Cell(50, 6, $vendor, 'B', 0, 'L');
     $this->SetX($this->GetX() + 90);
     $this->Cell(50, 6, $vehicle, 'B', 1, 'L');
     $this->Ln(2);
     $w = $this->w - $this->lMargin - $this->rMargin;
     $this->SetFont('Arial', 'B', 10);
     $this->Cell(5 / 100 * $w, 6, "C-No", 1, 0, 'C');
     if ($vendor == 'TIK') {
         $this->Cell(25 / 100 * $w, 6, "Description", 1, 0, 'C');
         $this->Cell(15 / 100 * $w, 6, "Fix Rate", 1, 0, 'C');
     } else {
         $this->Cell(40 / 100 * $w, 6, "Description", 1, 0, 'C');
     }
     $this->Cell(15 / 100 * $w, 6, "Model", 1, 0, 'C');
     $this->Cell(15 / 100 * $w, 6, "OEM Num", 1, 0, 'C');
     $this->Cell(25 / 100 * $w, 6, "Circular Rate", 1, 0, 'C');
     $this->Ln();
     //Ensure table header is output
     parent::Header();
 }
 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());
     }
 }
Exemple #12
0
 function Header()
 {
     global $ret, $_title;
     $this->SetFont('Arial', '', 6);
     $this->SetX(-35);
     $this->Cell(0, 6, date("M d, Y"), 0, 0, 'R');
     $this->Ln(0);
     $this->SetFont('Arial', 'I', 6);
     $this->SetX($this->lMargin);
     $this->Cell(0, 6, 'Report generated by nexexcel.com', 0, 0, 'L');
     $this->Ln(0);
     $t = $_title;
     if (isset($_GET['account_class']) && strlen($_GET['account_class']) > 0) {
         $t .= " - " . $_GET['account_class'];
     }
     $this->SetFont('Arial', 'B', 8);
     $this->Cell(0, 6, $t, 0, 1, 'C');
     $this->Ln(2);
     $this->SetFont('Arial', '', 8);
     $this->Cell(30, 6, "Account Name", 0, 0, 'L');
     $this->Cell(63, 6, $ret['account_name'], 'B', 0, 'L');
     $this->SetX($this->GetX() + 25);
     $this->Cell(35, 6, "Opening Balance", 0, 0, 'L');
     $this->Cell(37, 6, number_format($ret['aob']), 1, 1, 'R');
     if (strlen($ret['party_address']) > 0) {
         $this->Cell(30, 6, "Party Address", 0, 0, 'L');
         $this->Cell(63, 6, $ret['party_address'], 'B', 1, 'L');
     }
     $this->Ln(5);
     //Ensure table header is output
     parent::Header();
 }
 function Header()
 {
     $this->SetFont('Arial', '', 8);
     $this->SetX(-35);
     $this->Cell(0, 6, date("M d, Y"), 0, 0, 'R');
     $this->Ln(0);
     $this->printTitle();
     //Ensure table header is output
     parent::Header();
 }
 function Header()
 {
     $this->SetFont('Arial', 'B', 18);
     // $this->Cell(0, 6, $_SESSION['companyname'], 0, 0, 'C');
     $this->SetFont('Arial', '', 12);
     $this->SetX(-35);
     $this->Cell(0, 6, date("M d, Y"), 0, 0, 'R');
     $this->Ln(0);
     $this->printTitle();
     //Ensure table header is output
     parent::Header();
 }
 function Header()
 {
     $this->SetFont('Arial', '', 12);
     $this->SetX(-35);
     $this->Cell(0, 6, date("M d, Y"), 0, 0, 'R');
     $this->Ln(0);
     $this->printTitle();
     $this->Cell(94.999527777778, 6, 'Karachi', 1, 0, 'C', false);
     $this->Cell(94.999527777778, 6, 'Lahore', 1, 0, 'C', false);
     $this->Ln();
     //Ensure table header is output
     parent::Header();
 }
 function Header()
 {
     global $title, $city;
     $this->SetFont('Arial', '', 12);
     $this->SetX(-35);
     $this->Cell(0, 6, date("M d, Y"), 0, 0, 'R');
     $this->Ln(0);
     $this->SetFont('Arial', 'B', 14);
     $this->Cell(0, 6, $title, 0, 1, 'C');
     $this->SetFont('Arial', 'B', 12);
     $this->Cell(0, 6, $city, 1, 1, 'C');
     //Ensure table header is output
     parent::Header();
 }
Exemple #17
0
 function Header()
 {
     global $title;
     $strDate = $_GET['date_start'];
     if (strlen($_GET['date_end']) > 0) {
         $strDate .= " ~ " . $_GET['date_end'];
     }
     $this->SetFont('Arial', 'B', 18);
     $this->Cell(0, 6, $title . " - " . $strDate, 0, 0, 'C');
     $this->SetFont('Arial', '', 12);
     $this->SetX(-35);
     $this->Cell(0, 6, date("M d, Y"), 0, 1, 'R');
     $this->Ln();
     //Ensure table header is output
     parent::Header();
 }
 function Header()
 {
     global $title;
     $this->SetFont('Arial', '', 6);
     $this->SetX(-35);
     $this->Cell(0, 6, date("M d, Y"), 0, 0, 'R');
     $this->Ln(0);
     $this->SetFont('Arial', 'I', 6);
     $this->SetX($this->lMargin);
     $this->Cell(0, 6, 'Report generated by nexexcel.com', 0, 0, 'L');
     $this->Ln(0);
     $this->SetFont('Arial', 'B', 8);
     $this->Cell(0, 6, $title, 0, 1, 'C');
     $this->Ln(0);
     //Ensure table header is output
     parent::Header();
 }
Exemple #19
0
 function Header()
 {
     global $ret;
     $this->SetFont('Arial', '', 12);
     $this->SetX(-35);
     $this->Cell(0, 6, date("M d, Y"), 0, 0, 'R');
     $this->Ln(0);
     $this->printTitle();
     $this->SetFont('Arial', '', 12);
     $this->Cell(30, 6, "Account Name", 0, 0, 'L');
     $this->Cell(63, 6, $ret['account_name'], 'B', 0, 'L');
     $this->SetX($this->GetX() + 25);
     $this->Cell(35, 6, "Opening Balance", 0, 0, 'L');
     $this->Cell(37, 6, number_format($ret['aob']), 1, 1, 'R');
     $this->Ln(5);
     //Ensure table header is output
     parent::Header();
 }
 function Header()
 {
     $this->SetFont('Arial', 'B', 18);
     // $this->Cell(0, 6, $_SESSION['companyname'], 0, 0, 'C');
     $this->SetFont('Arial', '', 12);
     $this->SetX(-35);
     $this->Cell(0, 6, date("M d, Y"), 0, 1, 'R');
     $this->Ln(10);
     $this->printTitle();
     $this->SetFont('Arial', 'B', 8);
     $this->SetX(10);
     $this->Cell(55.5, 6, "Customer", 1, 0, 'C', false);
     $this->Cell(55.25, 6, "1st Visit", 1, 0, 'C', false);
     $this->Cell(55.5, 6, "2nd Visit", 1, 0, 'C', false);
     $this->Cell(55.25, 6, "3rd Visit", 1, 0, 'C', false);
     $this->Cell(55.5, 6, "4th Visit", 1, 0, 'C', false);
     $this->Ln(6);
     //Ensure table header is output
     parent::Header();
 }
 function Header()
 {
     global $aob, $account, $account_hidden;
     $this->SetFont('Arial', 'B', 18);
     // $this->Cell(0, 6, $_SESSION['companyname'], 0, 0, 'C');
     $this->SetFont('Arial', '', 12);
     $this->SetX(-35);
     $this->Cell(0, 6, "Print Date: " . date("M d, Y"), 0, 0, 'R');
     $this->Ln(0);
     $this->printTitle();
     $this->SetFont('Arial', '', 12);
     $this->Cell(42, 6, "Account Title", 0, 0, 'L');
     $this->Cell(40, 6, $account, 'B', 0, 'L');
     $this->SetX($this->GetX() + 43);
     $this->Cell(35, 6, "Opening Balance", 0, 0, 'L');
     $this->SetX($this->GetX() + 1);
     $this->Cell(30, 6, number_format($aob), 1, 1, 'R');
     $this->Cell(42, 6, "Account Code", 0, 0, 'L');
     $this->Cell(40, 6, $account_hidden, 'B', 1, 'L');
     if (strlen($_GET['date_start']) > 0 && strlen($_GET['date_end']) > 0) {
         $this->Cell(42, 6, "Date From", 0, 0, 'L');
         $this->Cell(40, 6, $_GET['date_start'], 'B', 0, 'L');
         $this->SetX($this->GetX() + 43);
         $this->Cell(35, 6, "Date To", 0, 0, 'L');
         $this->SetX($this->GetX() + 1);
         $this->Cell(30, 6, $_GET['date_end'], 'B', 1, 'R');
     } else {
         if (strlen($_GET['date_start']) > 0) {
             $this->Cell(42, 6, "Date From", 0, 0, 'L');
             $this->Cell(40, 6, $_GET['date_start'], 'B', 1, 'L');
         } else {
             if (strlen($_GET['date_end']) > 0) {
                 $this->Cell(42, 6, "Date To", 0, 0, 'L');
                 $this->Cell(40, 6, $_GET['date_end'], 'B', 1, 'L');
             }
         }
     }
     $this->Ln(5);
     //Ensure table header is output
     parent::Header();
 }
 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 Header()
 {
     global $city;
     $this->SetFont('Arial', 'B', 18);
     // $this->Cell(0, 6, $_SESSION['companyname'], 0, 0, 'C');
     $this->SetFont('Arial', '', 12);
     $this->SetX(-35);
     $this->Cell(0, 6, date("M d, Y"), 0, 0, 'R');
     $this->Ln(0);
     $this->printTitle();
     $this->SetFont('Arial', '', 12);
     $_city = $city;
     if ($_city == '#ALL#') {
         $_city = "All Pakistan";
     }
     $this->Cell(42, 6, "City", 0, 0, 'L');
     $this->Cell(40, 6, $_city, 'B', 1, 'L');
     $this->Ln(5);
     //Ensure table header is output
     parent::Header();
 }
 function Header()
 {
     global $aob, $account, $account_hidden;
     $this->SetFont('Arial', 'B', 18);
     // $this->Cell(0, 6, $_SESSION['companyname'], 0, 0, 'C');
     $this->SetFont('Arial', '', 12);
     $this->SetX(-35);
     $this->Cell(0, 6, date("M d, Y"), 0, 1, 'R');
     $this->Ln(10);
     $this->Cell(42, 6, "Customer/Distributor", 0, 0, 'L');
     $this->Cell(40, 6, $account, 'B', 0, 'L');
     $this->SetX($this->GetX() + 43);
     $this->Cell(35, 6, "Opening Balance", 0, 0, 'L');
     $this->SetX($this->GetX() + 1);
     $this->Cell(30, 6, number_format($aob), 1, 1, 'R');
     $this->Cell(42, 6, "Code", 0, 0, 'L');
     $this->Cell(40, 6, $account_hidden, 'B', 1, 'L');
     $this->Ln(5);
     $this->printTitle();
     //Ensure table header is output
     parent::Header();
 }
 function Header()
 {
     global $distributor, $d_net;
     $this->SetFont('Arial', 'B', 18);
     // $this->Cell(0, 6, $_SESSION['companyname'], 0, 0, 'C');
     $this->SetFont('Arial', '', 12);
     $this->SetX(-35);
     $this->Cell(0, 6, date("M d, Y"), 0, 1, 'R');
     $this->Ln(10);
     $this->SetFont('Arial', 'B', 14);
     $this->Cell(0, 6, 'Distributor Party Outstanding', 0, 1, 'C');
     $this->Ln(2);
     $this->SetFont('Arial', 'B', 12);
     $this->Cell(30, 6, 'Distributor', 0, 0, 'L');
     $this->Cell(50, 6, $distributor, 'B', 0, 'L');
     $this->SetX($this->GetX() + 29);
     $this->Cell(30, 6, 'Outstanding', 0, 0, 'L');
     $this->Cell(50, 6, $d_net, 'B', 0, 'L');
     $this->Ln();
     $this->Ln(5);
     //Ensure table header is output
     parent::Header();
 }
Exemple #26
0
 function Header()
 {
     global $invoice, $partyName, $partyCode, $partyCity, $date, $billteNo1, $transporter1, $billteNo2, $transporter2, $billteNo3, $transporter3, $dueDate;
     $this->SetFont('Arial', '', 8);
     $this->SetX(-35);
     $this->Cell(0, 6, date("M d, Y"), 0, 0, 'R');
     $this->Ln(0);
     $this->SetFont('Arial', 'B', 8);
     $this->Cell(0, 6, 'Estimates', 0, 1, 'C');
     $this->Ln(2);
     $this->SetFont('Arial', 'B', 8);
     $col1 = 30;
     $col2 = 50;
     $col3 = 30;
     $col4 = 50;
     $xspace = 80 - $col2;
     $pdata = array("Date", $date, "Inv#", $invoice, "Customer", $partyName, "Code", $partyCode, "Payment Due", $dueDate, "City", $partyCity, "Bilty #", $billteNo1, "Transport", $transporter1, "Bilty #", $billteNo2, "Transport", $transporter2, "Bilty #", $billteNo3, "Transport", $transporter3);
     for ($i = 0; $i < count($pdata); $i += 4) {
         $border = "0";
         if (strlen($pdata[$i + 0]) > 0) {
             $border = 'B';
         }
         $this->Cell($col1, 6, $pdata[$i + 0], 0, 0, 'L');
         $this->Cell($col2, 6, $pdata[$i + 1], $border, 0, 'L');
         $this->SetX($this->GetX() + $xspace);
         $border = "0";
         if (strlen($pdata[$i + 2]) > 0) {
             $border = 'B';
         }
         $this->Cell($col3, 6, $pdata[$i + 2], 0, 0, 'L');
         $this->Cell($col4, 6, $pdata[$i + 3], $border, 0, 'L');
         $this->Ln();
     }
     $this->Ln(5);
     //Ensure table header is output
     parent::Header();
 }
 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());
     }
 }
try {
    if (!isset($_SESSION["usuario"])) {
        validarSesion(false);
        exit;
    }
    $UsuarioNombre = $_SESSION["usuario"];
    if (!isset($_SESSION['ReportesSiniestros']["ReporteDatosdelaEmpresa"])) {
        header("Location: /JuiciosParteDemandada");
        // CIERRA LA PAGINA
        // echo "<script languaje='javascript' type='text/javascript'>window.close();</script>";
        exit;
    }
    global $conn;
    SetDateFormatOracle("DD/MM/YYYY");
    $params = array();
    $pdf = new PDFReport();
    $pdf->SetTitle("ReporteDatosdelaEmpresa");
    $pdf->SetAuthor("JLovatto");
    $pdf->SetCreator("ReporteDatosdelaEmpresa");
    $pdf->SetSubject("REPORTE WEB LEGALES");
    $sql = ObtenerSQL_DatosdelaEmpresa();
    $params[":siniestro"] = $_SESSION["ReportesSiniestros"]["ID"];
    $params[":orden"] = $_SESSION["ReportesSiniestros"]["ORDEN"];
    $stmt = DBExecSql($conn, $sql, $params);
    //-----------------------------------------------------------------------
    if (DBGetRecordCount($stmt) == 0) {
        echo "La consulta no devolviò datos.";
        exit;
    }
    $rowCabecera = DBGetQuery($stmt, 1, false);
    //-----------------------------------------------------------------------
 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 Header()
 {
     global $title, $months, $accounts_classes, $prop;
     $this->SetFont('Arial', 'B', 18);
     // $this->Cell(0, 6, $_SESSION['companyname'], 0, 0, 'C');
     $this->SetFont('Arial', '', 12);
     $this->SetX(-35);
     $this->Cell(0, 6, date("M d, Y"), 0, 0, 'R');
     $this->Ln(0);
     $this->SetFont('Arial', 'B', 14);
     $m = '(' . $_GET['date_start'] . " - " . $_GET['date_end'] . ')';
     $this->Cell(0, 6, $title . " " . $m, 0, 1, 'C');
     $this->Ln(2);
     $w = $this->w - $this->lMargin - $this->rMargin;
     $p = count($accounts_classes);
     $this->SetFillColor($prop['HeaderColor'][0], $prop['HeaderColor'][1], $prop['HeaderColor'][2]);
     $this->SetTextColor($prop['HeaderTextColor'][0], $prop['HeaderTextColor'][1], $prop['HeaderTextColor'][2]);
     foreach ($accounts_classes as $accounts_class => $accounts_class_name) {
         $this->Cell(1 / $p * $w, 6, $accounts_class_name, 1, 0, 'C', true);
     }
     $this->Ln();
     //Ensure table header is output
     parent::Header();
 }