Advertisement
Guest User

Untitled

a guest
Oct 10th, 2017
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 50.15 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Customer Service Request Class
  4.  *
  5.  * This file is for customer service request module
  6.  * in-code documentation through DocBlocks and tags.
  7.  *
  8.  * @author John Paul Oduca Caagusan <jpcaagusan.itso@tip.edu.ph>
  9.  * @version v1.000.09052017
  10.  * @package TPM
  11.  * @since 09/05/2017
  12.  *
  13.  * @todos
  14.  *  + Add prooflist
  15.  *  + Add "Add New" link
  16.  *  + Add "Edit" link
  17.  *  + Add comprehensive reports
  18.  *
  19.  * @internal revision(s):
  20.  *  + 09222017 - lean - code review  
  21.  */
  22. class JobOrder extends MyDatabase {
  23.  
  24.     /**
  25.      * Application self version
  26.      *
  27.      * @access private
  28.      * @var string $self_version
  29.      */
  30.     private $self_version = "v1.000.07102017x";
  31.  
  32.     /**
  33.      * HTML Decoy
  34.      *
  35.      * @access public
  36.      * @var string
  37.      */
  38.     public $cfg_decoy;
  39.  
  40.     /**
  41.      * Form file name
  42.      *
  43.      * @access public
  44.      * @var string
  45.      */
  46.     public $frm;
  47.  
  48.     /**
  49.      * Crud file name
  50.      *
  51.      * @access public
  52.      * @var string
  53.      */
  54.     public $crud;
  55.  
  56.     /**
  57.      * Parameter resource
  58.      *
  59.      * @access public
  60.      * @var resource
  61.      */
  62.     public $CfgParam;
  63.  
  64.     /**
  65.      * Password resource
  66.      *
  67.      * @access public
  68.      * @var resource
  69.      */
  70.     public $CfgPassword;
  71.  
  72.     /**
  73.      * User login
  74.      *
  75.      * @access public
  76.      * @var string
  77.      */
  78.     public $logged_user;
  79.  
  80.     /**
  81.      * Schema
  82.      *
  83.      * @access public
  84.      * @var string
  85.      */
  86.     public $schema;
  87.     /**
  88.      * Access Level
  89.      *
  90.      * @access public
  91.      * @var char
  92.      */
  93.     public $access_level;
  94.  
  95.      /**
  96.      * Constructor sets up
  97.      *
  98.      * Calls parent DB Type, Link, Selects Database and sets schema
  99.      *
  100.      * @author John Paul Oduca Caagusan <jpcaagusan.itso@tip.edu.ph>
  101.      * @since 04/24/2017
  102.      *
  103.      * @internal used-by:
  104.      * + job_order_frm.php
  105.      * + job_order_crud.php
  106.      *
  107.      * @param type $db_type
  108.      * @param type $db_link
  109.      * @param type $db_name
  110.      * @param type $db_schema
  111.      *
  112.      */
  113.     function __construct($db_type, $db_link, $db_name, $db_schema) {
  114.         parent::SetDbType($db_type);
  115.         parent::SetDbLink($db_link);
  116.         parent::SelectDb($db_name);
  117.         parent::SetSchema($db_schema);
  118.     }
  119.  /**
  120.      * Display Customer Service Request
  121.      *
  122.      * This function display the list of customer service request list
  123.      *
  124.      * @author John Paul Oduca Caagusan <jpcaagusan.itso@tip.edu.ph>
  125.      * @since 04/24/2017
  126.      *
  127.      * @used-by job_order_list.php
  128.      *
  129.      * @global resource $CfgParam
  130.      * @param stirng $performed_by
  131.      * @param datetime $resolution_datetime
  132.      * @param char $incident_type
  133.      * @param char $fix_type
  134.      * @param int $satisfaction_rating
  135.      * @param char $status
  136.      * @return HTML
  137.      */
  138.     function Display_JobOrder($performed_by,  $incident_type, $fix_type, $satisfaction_rating, $status) {
  139.         global $CfgParam;
  140.         $ctr = 0;
  141.         $retval = "";
  142.         $oTable = new Table;
  143.         $retval .= $oTable->NewTable("100%", "financial", true, true);
  144.         $retval .= $oTable->UnsetValue();
  145.         $oTable->coltextArray[] = "Customer Information";
  146.         $oTable->colwidthArray[] = "30%";
  147.         $oTable->coltextArray[] = "Service Request Info";
  148.         $oTable->colwidthArray[] = "20%";
  149.         $oTable->coltextArray[] = "Action/s taken Info";
  150.         $oTable->colwidthArray[] = "30%";
  151.         $oTable->coltextArray[] = "Status";
  152.         $oTable->colwidthArray[] = "30%";
  153.         $oTable->coltextArray[] = "Action/s";
  154.         $oTable->colwidthArray[] = "10%";
  155.         $oTable->SetTableHeaderWithTrClass();
  156.         $retval .= $oTable->TableHeader();
  157.  
  158.         // List of department schedule
  159.         $jo_arr_ = $this->Get_ServiceRequest($performed_by,  $incident_type, $fix_type, $satisfaction_rating, $status);
  160.         $incident_prio_details = $this->incident_prioritization();
  161.  
  162.         // Loop through the departmental schedule list
  163.         foreach ($jo_arr_ as $jo_details_arr_) {
  164.             // extract the array  $jo_details_arr_
  165.             extract($jo_details_arr_);
  166.             // Loop through the fields and variable for preparation for pass parameters
  167.             $link_code = "";
  168.             foreach ($jo_details_arr_ as $key => $value) {
  169.                 $link_code .= "&$key=$value";
  170.             }
  171.  
  172.             $customer_info = "";
  173.             //$customer_info .= "ID: <b>" . $id  . "</b><br/>";
  174.             $customer_info .= "CSR#: <b>" . $csr_no . "</b><br/>";
  175.             if (trim($customer_position_code) == 'STUDENT') {
  176.                 $student_info = $this->Get_StudentName($customer);
  177.                 foreach ($student_info as $key => $value) {
  178.                     $link_code .= "&$key=$value";
  179.                 }
  180.                 $customer_info .= "Student Number: <b>" . $customer . "</b><br/>";
  181.                 if (strlen(trim($student_info['fullname'])) > 0) {
  182.                     $customer_info .= "Name: <b>" . $student_info['fullname'] . "</b><br/>";
  183.                     $customer_info .= "Program: <b>" . $student_info['program_id'] . "</b><br/>";
  184.                     $customer_info .= "Year Level: <b>" . $student_info['year_level'] . "</b><br/>";
  185.                 } else {
  186.                     $customer_info .=" -<i>Student Information not Found  </i>-<br/>";
  187.                 }
  188.             } else {
  189.                 $link_code .= "&fullname=" . $this->Get_EmployeeName($customer);
  190.                 $link_code .= "&customer_dept_name=" . $this->Get_DepartmentName($customer_dept_code);
  191.                 $customer_info .= "Name: <b>" . $this->Get_EmployeeName($customer) . "</b><br/>";
  192.                 $customer_info .= "Department: <b>" . $this->Get_DepartmentName($customer_dept_code) . "</b><br/>";
  193.                 $customer_info .= "Position: <b>" . $customer_position_code . "</b><br/>";
  194.             }
  195.             $customer_info .= "Date/Time Requested : <b>" . date('F d, Y  h:i A', strtotime($datetime)) . "</b><br/>";
  196.  
  197.               // Service request information
  198.             $service_request_info = "";
  199.             $service_request_info .= "Incident Type: <b>" . $incident_type_desc . "</b><br/>";
  200.             $service_request_info .= $incident_type == 'O' ? "<b>" . $incident_type_desc . "</b><br/>" : '';
  201.             $service_request_info .= "Problem :<b> " . $this->detectEncodingUTF8($problem_description) . "</b><br/>";
  202.             $service_request_info .= "Impact :<b> " . $incident_prio_details[$incident_prioritization]['impact'] . "</b><br/>";
  203.             $service_request_info .= "Urgency :<b> " . $incident_prio_details[$incident_prioritization]['urgency'] . "</b><br/>";
  204.            
  205.             //star generate
  206.             $star_f = str_repeat("<i class='star yellow icon'></i>", $satisfaction_rating);
  207.             $star_e = (5 - $satisfaction_rating) > 0 ? str_repeat("<i class='empty star icon'></i>", (5 - $satisfaction_rating)) : '';
  208.             $star = $star_f . $star_e;
  209.             $service_request_info .= "<br/>Satisfaction Rating:<br/> $star <br/>";
  210.  
  211.             // Action taken information
  212.             $action_taken_info = "";
  213.             $action_taken_info .= "Fix Type: <b>" . $fix_type_desc . "</b><br/>";
  214.             $action_taken_info .= "Action Taken: <b>" . $action_taken . "</b><br/>";
  215.             $action_taken_info .= "Recommendation: <b>" . $recommendation . "</b><br/>";
  216.             $action_taken_info .= "Response Time: <b>" . date('F d, Y  h:i A', strtotime($response_datetime)) . "</b><br/>";
  217.             $action_taken_info .= "Resolution Time: <b>" . date('F d, Y  h:i A', strtotime($resolution_datetime)) . "</b><br/>";
  218.             $turn_around_time = strtotime($resolution_datetime) - strtotime($response_datetime);
  219.             $action_taken_info .= "Turn Around Time:";
  220.            
  221.          
  222.              if(gmdate("H",  $turn_around_time ) == 1 ){
  223.                 $action_taken_info .=  " <b>" . gmdate("H",  $turn_around_time ) * 1 . "</b> Hour";
  224.             }else if(gmdate("H",  $turn_around_time ) > 1 ){
  225.                 $action_taken_info .=  " <b>" . gmdate("H",  $turn_around_time ) * 1 . "</b> Hours";
  226.                
  227.             }else {
  228.                
  229.             }
  230.            
  231.             if(gmdate("i",  $turn_around_time ) == 1 ){
  232.                 $action_taken_info .=  " <b>" . gmdate("i",  $turn_around_time ) * 1 . "</b> Minute";
  233.             }else if(gmdate("i",  $turn_around_time ) > 1 ){
  234.                 $action_taken_info .=  " <b>" . gmdate("i",  $turn_around_time ) * 1 . "</b> Minutes";
  235.                
  236.             }else{
  237.                
  238.             }      
  239.            
  240.  
  241.              // Status information
  242.  
  243.             $status_info = "";
  244.             if ($status == "O") {
  245.                 $status_info .= "<br/><a class='ui red label'>" . $status_desc . "</a><br/><br/>";
  246.                 $status_info .= "Performed  by: <b>" . $this->Get_EmployeeName($performed_by) . "</b><br/>";
  247.             } else {
  248.                 $status_info .= "<br/><a class='ui blue label'>" . $status_desc . "</a><br/><br/>";
  249.                 $status_info .= "Performed  by: <b>" . $this->Get_EmployeeName($performed_by) . "</b><br/>";
  250.                 $status_info .= "Validated  by: <b>" . $this->Get_EmployeeName($validated_by) . "</b><br/>";
  251.                 $status_info .= "<b>" . date('F d, Y  h:i A', strtotime($validated_datetime)) . "</b><br/>";
  252.             }
  253.  
  254.  
  255.             // Post
  256.             $validate_status_param_protected = "p=" . $this->CfgPassword->StringProtect("do=validate&$link_code");
  257.             $validate_status = "<li class='link_validate'><a style='cursor: pointer'  title='Validate' id='Validate'  onClick='validate_status(\"$validate_status_param_protected\",\"" . $status . "\");'   > Validate </a></li>";
  258.  
  259.  
  260.  
  261.             // Unset arrays
  262.             $oTable->UnsetTextArrayValue();
  263.             $oTable->coltextArray[] = $this->detectEncodingUTF8($customer_info . '<br/>' . $CfgParam->Ago($logs));
  264.             $oTable->coltextArray[] = $this->detectEncodingUTF8($service_request_info);
  265.             $oTable->coltextArray[] = $this->detectEncodingUTF8($action_taken_info);
  266.             $oTable->coltextArray[] = $this->detectEncodingUTF8($status_info);
  267.  
  268.             // Edit
  269.             $edit_link = "$this->frm?p=" . $this->CfgPassword->StringProtect("do=edit$link_code");
  270.             // $edit = "<li class='link2'><a href='$this->cfg_decoy' style='cursor: pointer' id='open_edit_frm_$ctr' title='Edit this Information'>Edit</a></li>";
  271.             $my_script .= openFormUrl("open_edit_frm_$ctr", $edit_link);
  272.  
  273.             // Delete
  274.             $delete_param_protected = "p=" . $this->CfgPassword->StringProtect("do=delete&$link_code");
  275.             $delete_link = "$this->crud?$delete_param_protected";
  276.             $delete = "<li class='link2'><a href='$this->cfg_decoy' title='delete' onClick='return DeleteRecord(\"$delete_link\")'>Delete</a></li>";
  277.  
  278.  
  279.            // Generate PDF CSR
  280.             $generate_csr_param_protected = $this->crud . "?p=" . $this->CfgPassword->StringProtect("do=generate_csr&$link_code");
  281.             $generate_csr = "<li class='link_post_status'><a href='$generate_csr_param_protected'" . ' target="_blank" ' . " style='cursor: pointer'  title='generate_csr' id='generate_csr'   > Generate CSR </a></li>";
  282.  
  283.             if ($this->access_level == 'A' && $status == 'O') {
  284.                 $oTable->SetActionLink($edit . $delete . '<hr>______<br/><br/>' . $generate_csr . '<hr>______<br/><br/>' . $validate_status);
  285.             } else if ($this->access_level == 'S' && $status == 'O') {
  286.                 $oTable->SetActionLink($edit . $delete . '<hr>______<br/><br/>' . $generate_csr);
  287.             } else {
  288.                 $oTable->SetActionLink($generate_csr);
  289.             }
  290.             $retval .= $oTable->TableBody();
  291.             $ctr++;
  292.         }
  293.  
  294.         $retval .= $oTable->EndTable();
  295.         $retval .= $my_script;
  296.         $retval .= "<br><center><font size='1'>" . $this->self_version . "</font></center>";
  297.         return $retval;
  298.     }
  299.    
  300.     /**
  301.      * convert number  of incident prioritization  to string information
  302.      *
  303.      * This function gets the list of incident prioritization
  304.      *
  305.      * @author John Paul Oduca Caagusan <jpcaagusan.itso@tip.edu.ph>
  306.      * @since 04/24/2017
  307.      *
  308.      * @used-by this
  309.      * @param type $number
  310.      * @return array
  311.      */
  312.     function incident_prioritization($number = null) {
  313.         $level = array('Low', 'Medium', 'High');
  314.         $data = array();
  315.         $count = 1;
  316.         foreach ($level as $impact) {
  317.             foreach ($level as $urgency) {
  318.                 $data[$count++] = array('impact' => $impact, 'urgency' => $urgency);
  319.             }
  320.         }
  321.  
  322.         return $number ? $data[$number] : $data;
  323.     }
  324.  
  325.     /**
  326.      * Get Service Requests
  327.      *
  328.      * This function gets the list of service requests
  329.      *
  330.      * @author John Paul Oduca Caagusan <jpcaagusan.itso@tip.edu.ph>
  331.      * @since 04/24/2017
  332.      *
  333.      * @used-by this
  334.      *
  335.      * @param string $performed_by
  336.      * @param char $incident_type
  337.      * @param char $fix_type
  338.      * @param int $satisfaction_rating
  339.      * @param char $status
  340.      * @return array
  341.      */
  342.     function Get_ServiceRequest($performed_by,  $incident_type, $fix_type, $satisfaction_rating, $status) {
  343.         global $cfg_enroll_db_schema;
  344.         $filter_status = $status ? " AND jo.status = '$status' " : '';
  345.         $filter_satisfaction_rating = $satisfaction_rating ? " AND jo.satisfaction_rating = '$satisfaction_rating' " : '';
  346.         $filter_fix_type = $fix_type ? " AND jo.fix_type = '$fix_type' " : '';
  347.         $filter_incident_type = $incident_type ? " AND jo.incident_type = '$incident_type' " : '';
  348.         $filter_performed_by = $performed_by ? " AND jo.performed_by = '$performed_by' " : '';
  349.  
  350.         //R - Request, I - Inquiry, S - Software, H - Hardware, N - Network, D - Database, O - Others ( Specify other incident)
  351.         ///P - Permanent Fix, W - Workaround, F - For Disposal/Retire, D - DFA/Outside Repair
  352.         $query = "SELECT
  353.            
  354.             jo.[id] + '' as id,
  355.             jo.[csr_no] + '' as csr_no,
  356.             jo.[customer] + '' as customer,
  357.             jo.[customer_dept_code] + '' as customer_dept_code,
  358.             jo.[customer_position_code] + '' as customer_position_code,
  359.             jo.[datetime] + '' as datetime,
  360.             jo.[incident_type] + '' as incident_type,
  361.             CASE incident_type
  362.                            WHEN 'R'  THEN 'Request'
  363.                            WHEN 'I'  THEN 'Inquiry'
  364.                            WHEN 'S'  THEN 'Software'
  365.                            WHEN 'H'  THEN 'Hardware'
  366.                            WHEN 'N'  THEN 'Network'
  367.                            WHEN 'D'  THEN 'Database'
  368.                            WHEN 'O'  THEN 'Others'
  369.                            ELSE 'Error incedent type - ' + incident_type
  370.                        End as incident_type_desc,
  371.                        jo.[problem_description] + '' as problem_description,
  372.                        jo.[action_taken] + '' as action_taken,
  373.                        jo.[recommendation] + '' as recommendation,
  374.                        jo.[fix_type] + '' as fix_type,
  375.                        jo.[response_datetime]  as response_datetime,
  376.                        jo.[resolution_datetime]  as resolution_datetime,
  377.                        jo.[performed_by] + '' as performed_by,
  378.                        jo.[validated_by] + '' as validated_by,
  379.                        jo.[incident_prioritization] + '' as incident_prioritization,
  380.                        jo.[satisfaction_rating] + '' as satisfaction_rating,
  381.                        jo.[status] + '' as status,
  382.                        jo.[validated_datetime] + '' as validated_datetime,
  383.                        CASE  jo.[status]
  384.                            WHEN 'O' then 'Open'  
  385.                            WHEN 'C' then 'Closed-out'  
  386.                            ELSE 'error status'+  jo.[status]  
  387.                        END as status_desc,
  388.                        CASE fix_type
  389.                            WHEN 'P'  THEN 'Permanent Fix'
  390.                            WHEN 'W'  THEN 'Workaround'
  391.                            WHEN 'F'  THEN 'For Disposal/Retire'
  392.                            WHEN 'D'  THEN 'DFA/Outside Repair'
  393.                            ELSE 'Error fix type - ' + fix_type
  394.                        End as fix_type_desc,
  395.                        jo.[logs] + '' as logs
  396.                  FROM " . parent::GetSchema() . "job_order AS jo
  397.                  WHERE 1=1
  398.                    $filter_status
  399.                    $filter_satisfaction_rating
  400.                    $filter_fix_type
  401.                    $filter_incident_type
  402.                    $filter_performed_by
  403.         ORDER BY id DESC";
  404.         $data = array();
  405.         $result = parent::Query($query);
  406.         while ($row = parent::FetchArray($result)) {
  407.             $data[] = $row;
  408.         }
  409.         return $data;
  410.     }
  411.  
  412.   /**
  413.      * Get Employee Name
  414.      *
  415.      * This function extracts the fullname of the employee by their employee id
  416.      *
  417.      * @author John Paul Oduca Caagusan <jpcaagusan.itso@tip.edu.ph>
  418.      * @since 04/24/2017
  419.      *
  420.      * @used-by this
  421.      *  
  422.      * @param string $emp_id
  423.      * @return string
  424.      */
  425.     function Get_EmployeeName($emp_id) {
  426.         $query = "SELECT FirstName + ' ' + MidName + ' ' + LastName as [fullname] FROM vHR_Employee WHERE emp_id = '$emp_id' ";
  427.         $result = parent::Query($query);
  428.         $row = parent::FetchArray($result);
  429.         return $row['fullname'];
  430.     }
  431.        /**
  432.      * Get Student Name
  433.      *
  434.      * This function gets the student name based on the student number
  435.      *
  436.      * @author John Paul Oduca Caagusan <jpcaagusan.itso@tip.edu.ph>
  437.      * @since 04/24/2017
  438.      *
  439.      * @used-by this
  440.      *
  441.      * @global int $cfg_db_type
  442.      * @global int $cfg_db_link
  443.      * @global string $cfg_db_name
  444.      * @global string $cfg_reg_db_schema
  445.      * @global int $cfg_shs_db_type
  446.      * @global int $cfg_shs_db_link
  447.      * @global string $cfg_shs_db_name
  448.      * @global string $cfg_shs_reg_db_schema
  449.      * @param string $student_number
  450.      * @return array
  451.      */
  452.     function Get_StudentName($student_number) {
  453.         global $cfg_db_type;
  454.         global $cfg_db_link;
  455.         global $cfg_db_name;
  456.         global $cfg_reg_db_schema;
  457.  
  458.         global $cfg_shs_db_type;
  459.         global $cfg_shs_db_link;
  460.         global $cfg_shs_db_name;
  461.         global $cfg_shs_reg_db_schema;
  462.  
  463.  
  464.         if (strtoupper($student_number[0]) == 'S') {
  465.             include_once "../classes/reg-shs/student_shs.class.php";
  466.             $oStudentShs = new StudentShs($cfg_shs_db_type, $cfg_shs_db_link, $cfg_shs_db_name, $cfg_shs_reg_db_schema);
  467.             $query = "SELECT first_name + ' ' + middle_name + ' ' + last_name as [fullname] , program_id, grade_level + '' as year_level FROM " . $cfg_shs_reg_db_schema . "student_masterfile WHERE student_number = '" . trim($student_number) . "' ";
  468.             $oStudentShs_result = $oStudentShs->Query($query);
  469.             $rows = array();
  470.             while ($row = $oStudentShs->FetchArray($oStudentShs_result)) {
  471.                 $rows = $row;
  472.             }
  473.         } else {
  474.             include_once "../classes/reg/student.class.php";
  475.             $oStudent = new Student($cfg_db_type, $cfg_db_link, $cfg_db_name, $cfg_reg_db_schema);
  476.             $query = "SELECT first_name + ' ' + middle_name + ' ' + last_name as [fullname] , program_id, year_level FROM " . $cfg_reg_db_schema . "student_masterfile WHERE student_number = '" . trim($student_number) . "' ";
  477.             $result = $oStudent->Query($query);
  478.             $rows = array();
  479.             while ($row = $oStudent->FetchArray($result)) {
  480.                 $rows = $row;
  481.             }
  482.         }
  483.  
  484.         return $rows;
  485.     }
  486.    
  487.     /**
  488.      * Get Department Name
  489.      *
  490.      * This function gets the department name based on department code
  491.      *
  492.      * @author John Paul Oduca Caagusan <jpcaagusan.itso@tip.edu.ph>
  493.      * @since 04/24/2017
  494.      *
  495.      * @used-by this
  496.      *
  497.      * @param string $dept_code
  498.      * @return string
  499.      */
  500.     function Get_DepartmentName($dept_code) {
  501.         $query = "SELECT DEPT_NAME + '' as department_name  FROM vdepartment WHERE DEPT_id = '$dept_code' ";
  502.         $result = parent::Query($query);
  503.         $row = parent::FetchArray($result);
  504.         return $row['department_name'];
  505.     }
  506.  
  507.    
  508.        /**
  509.      * Convert for special char
  510.      *
  511.      * This function detects for latin chars and convert it
  512.      *
  513.      * @author John Paul Oduca Caagusan <jpcaagusan.itso@tip.edu.ph>
  514.      * @since 04/24/2017
  515.      *
  516.      * @used-by this
  517.      *
  518.      * @param type $value
  519.      * @return type
  520.      */
  521.     function detectEncodingUTF8($value) {
  522.         if (!mb_detect_encoding($value, 'utf-8', true)) {
  523.             $value = utf8_encode($value);
  524.         }
  525.         return $value;
  526.     }
  527.     /**
  528.      *  this function will generate cs no
  529.      *
  530.      * @global type $cfg_report_branch
  531.      * @global type $cfg_tpm_db_schema
  532.      * @return type
  533.      */
  534.     function generate_csr_no(){
  535.         global $cfg_report_branch,$cfg_tpm_db_schema;
  536.         $report_code = $cfg_report_branch[0];
  537.         $csr_year = date('Y');
  538.         $csr_yeardate = date('Ymd');
  539.         $csr_head = $report_code . $csr_year ;
  540.          $query = "SELECT MAX(csr_no) as  max_csr_no FROM ".$cfg_tpm_db_schema."job_order
  541.                    WHERE csr_no like '$csr_head%'
  542.                ";
  543.          $result = parent::Query($query);
  544.          $row = parent::FetchArray($result);
  545.         $csr_no = $row['max_csr_no'] ?  ltrim($row['max_csr_no'],$csr_head) :  '00000' ;
  546.         $next_csr_no = $csr_no + 1 ;
  547.         $new_csr_no =$row['max_csr_no'] ? $csr_head.str_pad($next_csr_no, 8, "0", STR_PAD_LEFT) : $report_code. $csr_yeardate. str_pad($next_csr_no, 4, "0", STR_PAD_LEFT) ;
  548.         return $new_csr_no;
  549.     }
  550.    
  551.    
  552.  
  553. }
  554.  
  555. class RepCustomerServiceRequest extends Pdf {
  556.  
  557.     public $branch;
  558.     public $printed_by;
  559.     public $title = "Customer Service Report";
  560.     public $sy;
  561.     public $period_from;
  562.     public $department_type;
  563.     public $customer_dept_name;
  564.     public $customer_id;
  565.     public $customer_dept_code;
  566.     public $csr_no;
  567.     public $fullname;
  568.     public $request_date_time;
  569.     public $incident_type;
  570.     public $problem_description;
  571.     public $recommendation;
  572.     public $fix_type;
  573.     public $response_datetime;
  574.     public $resolution_datetime;
  575.     public $action_taken;
  576.     public $signiture;
  577.     public $satisfaction_rating;
  578.     public $preformed_by;
  579.     public $preformed_by_id;
  580.     public $validated_by;
  581.     public $validated_by_id;
  582.     public $incident_prioritization;
  583.  
  584.     public function PageHeader() {
  585.         $this->SetMargins(13, 6, 5, true);
  586.         $this->SetAuthor($this->preformed_by);
  587.         $this->SetTitle($this->title);
  588.         $this->SetSubject($this->csr_no);
  589.     }
  590.  
  591.     public function PageFooter() {
  592.        
  593.     }
  594.  
  595.     /**
  596.      * printing of body
  597.      *
  598.      * This function generate the body of csr
  599.      *
  600.      * @author John Paul Oduca Caagusan <jpcaagusan.itso@tip.edu.ph>
  601.      * @since 04/24/2017
  602.      *
  603.      * @used-by job_order_crud.php
  604.      *
  605.      * @param type $value
  606.      * @return type
  607.      */
  608.     public function PrintHtmlJo() {
  609.      
  610.         $image_location = '../upload/jo_signature_pic/' . trim($this->csr_no) . '_' . trim($this->customer_id) . '_' . trim($this->customer_dept_code) . '.jpg';
  611.         $bg = '#C0C0C0';
  612.         $this->AddPage();
  613.         $checkbox[0] = '<img src="../components/images/checkbox.jpg" width="7" height="7"/>';
  614.         $checkbox[1] = '<img src="../components/images/checked_checkbox.jpg" width="7" height="7"/>';
  615.        
  616.         $this->Ln();
  617.         $this->SetFillColorArray(array(192, 192, 192));
  618.         $this->SetFont('arial', '', 9);
  619.         $this->MultiCell($w = 192, $h = 3, $txt = 'TIP-ITS-007', $border =0, $align = 'R', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'M', $fitcell = true);
  620.         $this->SetFont('arial', '', 9);
  621.         $this->Ln();
  622.         $this->MultiCell($w = 192, $h = 3, $txt = 'REVISION STATUS/DATE:0/2017 JUL 7', $border=0, $align = 'R', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'M', $fitcell = true);
  623.         $this->Ln();
  624.         $this->SetFont('arial', 'B', 9);
  625.         //$this->MultiCell(190, 0, 'CUSTOMER SERVICE REPORT', 0, 'L', false, 0);
  626.         $this->MultiCell($w = 192, $h = 6, $txt = 'CUSTOMER SERVICE REPORT', $border=0, $align = 'L', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'M', $fitcell = true);
  627.         $this->Ln();
  628.         $this->SetFont('arial', 'B', 9);
  629.         $this->MultiCell($w = 35, $h = 4, $txt = 'Department:', $border = array('LTRB' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'R', $fill = true, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 8, $valign = 'M', $fitcell = true);
  630.         $this->SetFont('arial', '', 9);
  631.         $this->MultiCell($w = 60, $h = 4, $txt = $this->customer_dept_name, $border = array('LTRB' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'C', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 8, $valign = 'M', $fitcell = true);
  632.  
  633.         $this->SetFont('arial', 'B', 9);
  634.         $this->SetFillColorArray(array(192, 192, 192));
  635.         $this->MultiCell($w = 35, $h = 4, $txt = 'CSR #:', $border = array('LTRB' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'R', $fill = true, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 8, $valign = 'M', $fitcell = true);
  636.         $this->SetFont('arial', '', 9);
  637.         $this->MultiCell($w = 60, $h = 4, $txt = ($this->csr_no), $border = array('LTRB' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'C', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 8, $valign = 'M', $fitcell = true);
  638.         // 2nd row  
  639.  
  640.         $this->ln();
  641.         $this->SetFont('arial', 'B', 9);
  642.         $this->MultiCell($w = 35, $h = 6, $txt = 'Name of Customer:', $border = array('LRT' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'R', $fill = true, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'B', $fitcell = true);
  643.         $this->SetFont('arial', '', 9);
  644.         //$this->MultiCell($w=60,$h=20, $signiture , $border=array('LRT' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align='C', $fill=false, $ln=0, $x='', $y='',  $reseth=true, $stretch=0, $ishtml=false,  $autopadding=false,  $maxh=0, $valign='M', $fitcell=true);
  645.         //$this->MultiCell($w=60,$h=6, '<img src="../upload/jo_signature_pic/Q201709110053_S1234567_.jpg" style="width: 100px; height: 29px; border-top:0.4px solid #021a40;" />' , $border=array('LRT' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align='C', $fill=false, $ln=0, $x='', $y='',  $reseth=true, $stretch=0, $ishtml=true,  $autopadding=false,  $maxh=0, $valign='M', $fitcell=true);
  646.         // Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false, $fitonpage=false)
  647.        /**** *****/
  648.         if (file_exists($image_location)) {
  649.        
  650.             $image = base64_encode(file_get_contents($image_location));
  651.            
  652.            $this->MultiCell($w = 60, $h = 6, '<img src="' . $image_location . '" style="width: 100px; height: 29px; border-top:0.4px solid #021a40;" >', $border = array('' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'C', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = true, $autopadding = false, $maxh = 0, $valign = 'M', $fitcell = true);
  653.         } else {
  654.             $this->MultiCell($w = 60, $h = 6, '', $border = array('LRT' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'C', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = false, $maxh = 0, $valign = 'M', $fitcell = true);
  655.         }
  656.        
  657.         $this->MultiCell($w = 35, $h = 6, '', $border = array('LRT' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'C', $fill = true, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'B', $fitcell = true);
  658.         $this->MultiCell($w = 60, $h = 6, '', $border = array('LRT' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'C', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = false, $maxh = 0, $valign = 'M', $fitcell = true);
  659.  
  660.  
  661.         $this->ln();
  662.         $this->SetFont('arial', '', 6.5);
  663.         $this->MultiCell($w = 35, $h = 8, $txt = '(Signature Over Printed Name)', $border = array('LRB' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'R', $fill = true, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'T', $fitcell = true);
  664.         $this->SetFont('arial', '', 8);
  665.         $this->MultiCell($w = 60, $h = 8, $txt = $this->fullname, $border = array('LR' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'C', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'M', $fitcell = true);
  666.  
  667.  
  668.         $this->SetFont('arial', 'B', 9);
  669.         $this->SetFillColorArray(array(192, 192, 192));
  670.         $this->MultiCell($w = 35, $h = 8, $txt = 'Request Date/Time:', $border = array('LR' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'R', $fill = true, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'T', $fitcell = true);
  671.         $this->SetFont('arial', '', 9);
  672.         $this->MultiCell($w = 60, $h = 8, $txt = ($this->request_date_time), $border = array('LRB' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'C', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'T', $fitcell = true);
  673.  
  674.         //type of incident a
  675.  
  676.         $this->ln();
  677.         $this->SetFont('arial', 'B', 8);
  678.         $this->MultiCell($w = 95, $h = 2, $txt = 'Type of Incident:', $border = array('LRT' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'L', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = True, $autopadding = true, $maxh = 8, $valign = 'M', $fitcell = true);
  679.         $this->MultiCell($w = 95, $h = 2, $txt = 'Action Taken:', $border = array('LRT' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'L', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = True, $autopadding = true, $maxh = 8, $valign = 'M', $fitcell = true);
  680.  
  681.         $this->ln();
  682.         $html .='<table>';
  683.  
  684.         $html .= '<tr>';
  685.         $html .= '<td rowspan="4" width="10%">';
  686.         $html .= '</td>';
  687.         $html .= '<td  width="22.5%" >';
  688.         $html .= ($this->incident_type == 'R' ? $checkbox[1] : $checkbox[0] ) . ' Request ';
  689.         $html .= '</td>';
  690.         $html .= '<td width="22.5%" >';
  691.         $html .= ($this->incident_type == 'I' ? $checkbox[1] : $checkbox[0] ) . ' Inquiry ';
  692.         $html .= '</td >';
  693.         $html .= '<td width="22.5%" >';
  694.         $html .= ($this->incident_type == 'S' ? $checkbox[1] : $checkbox[0] ) . ' Software ';
  695.         $html .= '</td>';
  696.         $html .= '<td width="22.5%" >';
  697.         $html .= ($this->incident_type == 'H' ? $checkbox[1] : $checkbox[0] ) . ' Hardware  ';
  698.         $html .= '</td>';
  699.         $html .= '</tr>';
  700.         $html .= '<tr>';
  701.         $html .= '<td  width="22.5%" >';
  702.         $html .= '<br/>';
  703.         $html .= '</td>';
  704.         $html .= '<td width="22.5%" >';
  705.         $html .= '<br/>';
  706.         $html .= '</td >';
  707.         $html .= '<td width="22.5%" >';
  708.         $html .= '<br/>';
  709.         $html .= '</td>';
  710.         $html .= '<td width="22.5%" >';
  711.         $html .= '<br/>';
  712.         $html .= '</td>';
  713.         $html .= '</tr>';
  714.         $html .= '<tr>';
  715.         $html .= '<td width="22.5%">';
  716.         $html .= ($this->incident_type == 'N' ? $checkbox[1] : $checkbox[0] ) . ' Network ';
  717.         $html .= '</td>';
  718.         $html .= '<td width="22.5%" >';
  719.         $html .= ($this->incident_type == 'D' ? $checkbox[1] : $checkbox[0] ) . ' Database ';
  720.         $html .= '</td>';
  721.         $html .= '<td colspan="2">';
  722.         $html .= ($this->incident_type == 'O' ? $checkbox[1] : $checkbox[0] ) . ' Other ';
  723.         $html .= '_________________';
  724.         $html .= '</td>';
  725.         $html .= '</tr>';
  726.         $html .='</table>';
  727.         $this->SetFont('arial', '', 8);
  728.         $this->MultiCell($w = 95, $h = 40, $html, $border = array('LR' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'L', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = True, $autopadding = true, $maxh = 8, $valign = 'M', $fitcell = true);
  729.         $this->SetFont('arial', '', 8);
  730.         $this->MultiCell($w = 95, $h = 9, $this->action_taken, $border = array('LR' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'L', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'M', $fitcell = true);
  731.  
  732.         $this->ln();
  733.         $this->MultiCell($w = 95, $h = 1, '', $border = array('LR' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'L', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = False, $autopadding = true, $maxh = 0, $valign = 'M', $fitcell = true);
  734.         $this->MultiCell($w = 95, $h = 1, '', $border = array('LR' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'L', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = False, $autopadding = true, $maxh = 0, $valign = 'M', $fitcell = true);
  735.         $this->ln();
  736.         $this->SetFont('arial', 'B', 8);
  737.         $this->MultiCell($w = 95, $h = 3, 'Nature of the Problem:', $border = array('LR' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'L', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 8, $valign = 'B', $fitcell = true);
  738.  
  739.         $this->SetFont('arial', 'B', 8);
  740.         $this->MultiCell($w = 95, $h = 3, 'Recommendation:', $border = array('LR' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'L', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 8, $valign = 'B', $fitcell = true);
  741.  
  742.         $this->ln();
  743.         $this->SetFont('arial', '', 6);
  744.         $this->MultiCell($w = 95, $h = 3, '(Attach file if necessary)', $border = array('LR' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'L', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = False, $autopadding = true, $maxh = 0, $valign = 'T', $fitcell = true);
  745.         $this->MultiCell($w = 95, $h = 3, '', $border = array('LR' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'L', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = False, $autopadding = true, $maxh = 0, $valign = 'M', $fitcell = true);
  746.  
  747.  
  748.  
  749.         $this->ln();
  750.         $this->SetFont('arial', '', 9);
  751.         $this->MultiCell($w = 95, $h = 10, $this->problem_description, $border = array('LBR' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'L', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 8, $valign = 'T', $fitcell = True);
  752.  
  753.         $this->SetFont('arial', '', 9);
  754.         $this->MultiCell($w = 95, $h = 10, $this->recommendation, $border = array('LBR' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'L', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 8, $valign = 'T', $fitcell = true);
  755.  
  756.  
  757.         $html = '<b>Incident Prioritization:</b><br/><br/>';
  758.  
  759.         $html .='<table align="center"> ';
  760.         $html .='<tr>';
  761.         $html .='<td width="7%">';
  762.         $html .='<br/>';
  763.         $html .='</td>';
  764.         $html .='<td width="93%">';
  765.  
  766.         $html .='<table border="1" width="100%"   align="center"> ';
  767.         $html .='<tr  align="center" >';
  768.  
  769.         $html .='<td rowspan="4" width="9%" align="center" bgcolor="#C0C0C0" style="' . $bg . '" >';
  770.         $html .='<br/><font size= "8" ><br /><br /><br />I     <br /> M <br /> P <br /> A <br /> C <br /> T</font>';
  771.         $html .='</td>';
  772.  
  773.         $html .='<td align="center">';
  774.         $html .='&nbsp;<br />HIGH<br />';
  775.         $html .='</td>';
  776.  
  777.         $html .='<td  >';
  778.         $html .='<center>&nbsp;<br />' . ($this->incident_prioritization == '7' ? $checkbox[1] : $checkbox[0] ) . '<br /></center>';
  779.         $html .='</td>';
  780.  
  781.         $html .='<td  >';
  782.         $html .='<center>&nbsp;<br />' . ($this->incident_prioritization == '8' ? $checkbox[1] : $checkbox[0] ) . '<br /></center>';
  783.         $html .='</td>';
  784.  
  785.         $html .='<td  >';
  786.         $html .='<center>&nbsp;<br />' . ($this->incident_prioritization == '9' ? $checkbox[1] : $checkbox[0] ) . '<br /></center>';
  787.         $html .='</td>';
  788.  
  789.         $html .='</tr>';
  790.         $html .='<tr align="center" >';
  791.         $html .='<td align="center" >';
  792.         $html .='&nbsp;<br />MEDIUM<br />';
  793.         $html .='</td>';
  794.  
  795.         $html .='<td>';
  796.         $html .='<center>&nbsp;<br />' . ($this->incident_prioritization == '4' ? $checkbox[1] : $checkbox[0] ) . '<br /></center>';
  797.         $html .='</td>';
  798.  
  799.         $html .='<td>';
  800.         $html .='<center>&nbsp;<br />' . ($this->incident_prioritization == '5' ? $checkbox[1] : $checkbox[0] ) . '<br /></center>';
  801.         $html .='</td>';
  802.  
  803.         $html .='<td>';
  804.         $html .='<center>&nbsp;<br />' . ($this->incident_prioritization == '6' ? $checkbox[1] : $checkbox[0] ) . '<br /></center>';
  805.         $html .='</td>';
  806.  
  807.         $html .='</tr>';
  808.         $html .='<tr align="center" >';
  809.         $html .='<td align="center" >';
  810.         $html .='&nbsp;<br />LOW<br />';
  811.         $html .='</td>';
  812.         $html .='<td>';
  813.         $html .='<center>&nbsp;<br />' . ($this->incident_prioritization == '1' ? $checkbox[1] : $checkbox[0] ) . '<br /></center>';
  814.         $html .='</td>';
  815.         $html .='<td>';
  816.         $html .='<center>&nbsp;<br />' . ($this->incident_prioritization == '2' ? $checkbox[1] : $checkbox[0] ) . '<br /></center>';
  817.         $html .='</td>';
  818.         $html .='<td>';
  819.         $html .='<center>&nbsp;<br />' . ($this->incident_prioritization == '3' ? $checkbox[1] : $checkbox[0] ) . '<br /></center>';
  820.         $html .='</td>';
  821.         $html .='</tr>';
  822.         $html .='<tr align="center"  >';
  823.         $html .='<td align="center"  >';
  824.         $html .='<br/>';
  825.         $html .='</td>';
  826.         $html .='<td align="center"  >';
  827.         $html .='LOW';
  828.         $html .='</td>';
  829.         $html .='<td align="center"  >';
  830.         $html .='MEDIUM ';
  831.         $html .='</td>';
  832.         $html .='<td align="center"  >';
  833.         $html .='HIGH';
  834.         $html .='</td>';
  835.         $html .='</tr>';
  836.         $html .='<tr  align="center">';
  837.         $html .='<td >';
  838.         $html .='<br />';
  839.         $html .='</td >';
  840.         $html .='<td colspan ="4" style="padding-bottom:10px;"  bgcolor="#C0C0C0" >';
  841.         $html .='<br/><font size= "8" >U R G E N C Y</font>';
  842.         $html .='</td>';
  843.         $html .='</tr>';
  844.  
  845.         $html .='</table>';
  846.         $html .='</td   >';
  847.         $html .='</tr   >';
  848.         $html .='</table>';
  849.  
  850.         $this->ln();
  851.         $this->SetFont('arial', '', 7.5);
  852.         $this->MultiCell($w = 95, $h = 50, $html, $border = array('LRTB' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'L', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = true, $autopadding = true, $maxh = 8, $valign = 'M', $fitcell = true);
  853.  
  854.         // Left pane, type fix
  855.         $this->SetFont('arial', 'B', 9);
  856.         $this->MultiCell($w = 47.5, $h = 25, 'Type of Fix:', $border = array('LRTB' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'R', $fill = true, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = true, $autopadding = true, $maxh = 0, $valign = 'T', $fitcell = true);
  857.  
  858.         $html =  ($this->fix_type == 'P' ? $checkbox[1] : $checkbox[0] ) . ' Permanent Fix <br/>';
  859.         $html .= ($this->fix_type == 'W' ? $checkbox[1] : $checkbox[0] ) . ' Workaround  <br/>';
  860.         $html .= ($this->fix_type == 'F' ? $checkbox[1] : $checkbox[0] ) . ' For Disposal/Retire  <br/>';
  861.         $html .= ($this->fix_type == 'O' ? $checkbox[1] : $checkbox[0] ) . '  DFA/Outside Repair ';
  862.  
  863.         $this->SetFont('arial', '', 9);
  864.         $this->MultiCell($w = 47.5, $h = 20, $txt = $html, $border = array('LRTB' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'L', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = true, $autopadding = true, $maxh = 0, $valign = 'M', $fitcell = true);
  865.         // response date time
  866.         $this->Ln();
  867.         $this->SetFont('arial', 'B', 9);
  868.         $this->MultiCell($w = 95, $h = 7, '', $border = 0, $align = 'R', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'M', $fitcell = true);
  869.         $this->SetFont('arial', 'B', 9);
  870.         $this->MultiCell($w = 47.5, $h = 7, 'Response Date/Time:', $border = array('LRTB' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'R', $fill = true, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'M', $fitcell = true);
  871.         $this->SetFont('arial', '', 9);
  872.         $this->MultiCell($w = 47.5, $h = 7, $this->response_datetime, $border = array('LRTB' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'C', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'M', $fitcell = true);
  873.  
  874.         // resolution date time
  875.         $this->Ln();
  876.         $this->MultiCell($w = 95, $h = 7, '', $border = 0, $align = 'R', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = true, $autopadding = true, $maxh = 8, $valign = 'M', $fitcell = true);
  877.         $this->SetFont('arial', 'B', 9);
  878.         $this->MultiCell($w = 47.5, $h = 7, 'Resolution Date/Time:', $border = array('LRTB' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'R', $fill = true, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'M', $fitcell = true);
  879.         $this->SetFont('arial', '', 9);
  880.         $this->MultiCell($w = 47.5, $h = 7, $this->resolution_datetime, $border = array('LRTB' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'C', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'M', $fitcell = true);
  881.  
  882.         // performed by 1
  883.         $this->Ln();
  884.         $this->SetFont('arial', 'B', 9);
  885.         $this->MultiCell($w = 95, $h = 4, '', $border = 0, $align = 'R', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 8, $valign = 'M', $fitcell = true);
  886.         $this->SetFont('arial', 'B', 9);
  887.         $this->MultiCell($w = 47.5, $h = 4, 'Performed by:', $border = array('LRT' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'R', $fill = true, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 8, $valign = 'B', $fitcell = true);
  888.         $this->SetFont('arial', '', 9);
  889.         $this->MultiCell($w = 47.5, $h = 4, '', $border = array('LRT' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'C', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 8, $valign = 'C', $fitcell = true);
  890.  
  891.         // performed by 2
  892.         $this->Ln();
  893.         $this->MultiCell($w = 95, $h = 4, '', $border = 0, $align = 'R', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = true, $autopadding = true, $maxh = 8, $valign = 'M', $fitcell = true);
  894.         $this->SetFont('arial', '', 6.5);
  895.         $this->MultiCell($w = 47.5, $h = 4, '(Signature Over Printed Name)', $border = array('LRB' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'R', $fill = true, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 8, $valign = 'T', $fitcell = true);
  896.         $this->SetFont('arial', '', 9);
  897.         $this->MultiCell($w = 47.5, $h = 4, $this->preformed_by, $border = array('LRB' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'C', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 8, $valign = 'C', $fitcell = true);
  898.  
  899.         $full_star = $empty_star = '';
  900.         for ($i = 1; $i <= $this->satisfaction_rating; $i++) {
  901.             $full_star .= TCPDF_FONTS::unichr(72) . " ";
  902.         }
  903.         for ($i = 1; $i <= (5 - $this->satisfaction_rating); $i++) {
  904.             $empty_star .= TCPDF_FONTS::unichr(73) . " ";
  905.         }
  906.  
  907.         //service rating  
  908.         $this->Ln();
  909.         $this->SetFont('arial', 'B', 10);
  910.         $this->MultiCell($w = 63, $h = 10, ' Are you satisfied with our service? ', $border = array('LTB' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'C', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'M', $fitcell = true);
  911.         $this->SetFont('zapfdingbats', '', 11);
  912.         $this->MultiCell($w = 32, $h = 10, $full_star . $empty_star, $border = array('RTB' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'L', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'M', $fitcell = true);
  913.  
  914.         $this->SetFont('arial', 'B', 9);
  915.         $this->MultiCell($w = 47.5, $h = 5, 'Validated By:', $border = array('LRT' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'R', $fill = true, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'B', $fitcell = true);
  916.         $this->SetFont('arial', '', 9);
  917.  
  918.         $this->MultiCell($w = 47.5, $h = 5, '', $border = array('RT' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'C', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'C', $fitcell = true);
  919.  
  920.         $this->Ln();
  921.         $this->SetFont('arial', '', 7);
  922.         $this->MultiCell($w = 95, $h = 2, '', $border = 0, $align = 'R', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = true, $autopadding = true, $maxh = 0, $valign = 'C', $fitcell = true);
  923.         $this->SetFont('arial', '', 6.5);
  924.         $this->MultiCell($w = 47.5, $h = 5, '(Signature Over Printed Name)', $border = array('LRB' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'R', $fill = true, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = true, $autopadding = true, $maxh = 0, $valign = 'C', $fitcell = true);
  925.         $this->SetFont('arial', '', 9);
  926.         $this->MultiCell($w = 47.5, $h = 5, $this->validated_by, $border = array('LRB' => array('width' => 0.10, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))), $align = 'C', $fill = false, $ln = 0, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'C', $fitcell = true);
  927.  
  928.     }
  929.  
  930. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement