<?php
/**********************************************************************
***********************************************************************/

/**
	Document blueprint use following parameters set in doctext.inc:
***/

		$this->row = $this->pageHeight - $this->topMargin;

		$upper = $this->row - 2 * $this->lineHeight;
		$lower = $this->bottomMargin + 10 * $this->lineHeight;
		$iline1 = $upper - 5.0 * $this->lineHeight;
		$iline2 = $iline1 - 4 * $this->lineHeight;
		$iline3 = $iline2 ;//- 1.5 * $this->lineHeight;
		$iline4 = $iline3 ;//- 1.5 * $this->lineHeight;
		$iline5 = $iline4 ;//- 3 * $this->lineHeight;
		$iline6 = $iline5 - 1.5 * $this->lineHeight;
		$iline7 = $lower;
		$right = $this->pageWidth - $this->rightMargin;
		$width = ($right - $this->leftMargin) / 5;
		$icol = $this->pageWidth / 2;
		$ccol = $this->cols[0] + 4;
		$c2col = $ccol + 60;
		$ccol2 = $icol / 2;
		$mcol = $icol + 8;
		$mcol2 = $this->pageWidth - $ccol2;
                
        $header_col1 = 45;
//        $header_col2 = 380;
                
		$cols = count($this->cols);

		$col = $this->leftMargin;


//                $this->row = 386;
                $this->row = 360;
                
		// Company Logo
		//$this->NewLine();
		$logo = company_path() . "/images/" . $this->company['coy_logo'];
		if ($this->company['coy_logo'] != '' && file_exists($logo))
		{
			$this->AddImage($logo, 20, $this->row - 25, 0, 40);
		}
		else
		{
//			$this->fontSize += 4;
//			$this->Font('bold');
//			$this->Text($ccol, $this->company['coy_name'], $icol);
//			$this->Font();
//			$this->fontSize -= 4;
		}
                
		// Document title
		$this->SetTextColor(0, 0, 0);
		$this->fontSize += 4;
		$this->Font('bold');
                $this->TextWrap($header_col1, $this->row, $this->pageWidth - $this->rightMargin - $mcol - 20, $this->company['coy_name']);
		$this->fontSize += 3;
                $this->SetTextColor(0, 0, 0);
                $previous_row = $this->row;
                $this->NewLine();
//                $this->TextWrap($header_col1, $this->row - 4, $this->pageWidth - $this->rightMargin - $mcol - 10, $this->title);
                
                $this->Text(300, $this->title." #".$this->params['gate_pass_no']);
                
                $this->row = $previous_row;
		$this->Font();
		$this->fontSize -= 7;
		$this->NewLine();
		$this->SetTextColor(0, 0, 0);
		$adrline = $this->row;

		// Company data
		//$this->TextWrapLines(170, 100, $this->company['postal_address']);
                $this->Text($header_col1, $this->company['postal_address'], $header_col1 + 250);
                $this->NewLine();
                //$this->NewLine();
                
		$this->Font('italic');
		if (@$this->company['phone'])
		{
			$this->Text($header_col1, _("Phone:"), $header_col1 + 50);
			$this->Text($header_col1 + 40, $this->company['phone'], $mcol);
			$this->NewLine();
		}
                                
//		if (@$this->company['fax'])
//		{
//			$this->Text($header_col1 + 140, _("Fax:"), $header_col1 + 50);
//			$this->Text($header_col1 + 160, $this->company['fax'], $header_col1 + 250);
//			$this->NewLine();
//		}
//		if (@$this->company['email'])
//		{
//			$this->Text($header_col1, _("Email:"), $header_col1 + 50);
//
//			$url = "mailto:" . $this->company['email'];
//			$this->SetTextColor(0, 0, 255);
//			$this->Text($header_col1 + 40, $this->company['email'], $mcol);
//			$this->SetTextColor(0, 0, 0);
//			$this->addLink($url, $c2col, $this->row, $mcol, $this->row + $this->lineHeight);
//
//			$this->NewLine();
//		}
//                
//                $this->Text($header_col1, _("Website:"), $header_col1 + 50);

//                $url = get_sys_prefs_parameter_value("website");
//                
//                $this->SetTextColor(0, 0, 255);
//                $this->Text($header_col1 + 40, $url, $header_col1 + 220);
////                $this->NewLine();
//                $this->SetTextColor(0, 0, 0);
//                $this->addLink($url, $c2col, $this->row, $mcol, $this->row + $this->lineHeight);

//                $this->NewLine();  
                        
//		if (@$this->company['gst_no'])
//		{
//			$this->Text($header_col1, _("VAT No.:"), $header_col1 + 50);
//			$this->Text($header_col1 + 40, $this->company['gst_no'], $mcol);
//			$this->NewLine();
//		}
//		if (@$this->formData['domicile'])
//		{
//			$this->Text($ccol, _("Domicile"), $c2col);
//			$this->Text($c2col, $this->company['domicile'], $mcol);
//			$this->NewLine();
//		}
		$this->Font();
		$this->row = $adrline;
                
                
//return;
		if ($this->pageNumber > 1){
                    $this->row -= 15;
                    $this->Text($this->endLine - 35, _("Page") . ' ' . $this->pageNumber);
                    $this->row += 15;
                }
		
/*=========================End of header============================*/
        
        
                $iline_x = $upper - (4 * $this->lineHeight);
		$this->Line($iline_x);
                
                
//                $params['jo_id'] = $jo_id;
//                $params['job_gate_pass_no'] = $gp_row['id'];
//                $params['driver_name'] = $gp_row['driver_name'];
//                $params['comment'] = $gp_row['comment'];
//                $sys_user = get_user($gp_row['printed_by']);
//                $params['printed_by'] = $sys_user['real_name'];
//                $params['printed_on'] = sql2date($gp_row['printed_on']);
                
                
//                $this->row -= 40;
//                        
//                $row_line = $this->row;
//
//                $this->row = $row_line;
//                $this->Text(25, "Job Card :");
//                $this->Font('bold');
//                $this->Text(120, $this->params['jo_id']);
//                $this->Font();
//                $this->row -= 16; 
//
//                $this->Text(25, "Comment :");
//                $this->Font('bold');
//                $this->Text(120, $this->params['comment']);
//                $this->Font();
//                $this->row -= 16; 
//                
//                $this->row = $row_line; 
//
//                $this->Text(340, _("Date Time :"));
//                $this->Font('bold');
//                $this->Text(420, date("Y/m/d h:i:s a"));
//                $this->Font();
//                $this->row -= 16; 
//
//                $this->Text(340, _("Vehicle :"));
//                $this->Font('bold');
//                $this->Text(420, $this->params['vehicle']);
//                $this->Font();
//                $this->row -= 16; 
//
//                global $systypes_array;
//                $this->Text(340, _("Driver :"));
//                $this->Font('bold');
//                $this->Text(420, $this->params['driver_name']);
//                $this->Font();
//                $this->row -= 20;
//        
////                $this->row = $row_line; 
//                $this->row -= 10;

                

                

                

                
        
//                draw_payment_items_table($this->row -= 10, $this);
//                
//                $this->Font('bold');
//                $this->Text(33, 'No');
//                $this->Text(200, 'Item');
//                $this->Text(412, 'Unit');
//                $this->Text(467, 'Qty');
//                $this->Text(512, 'Returnable');
//                $this->Font();
                
                $current_row = $this->row;
?>
