$LeftOvers = $pdf->addTextWrap(650, $YPos,85,$FontSize,$stup,'right');$LeftOvers = $pdf->addTextWrap(650, $YPos,85,$FontSize,$stup,'right');$LeftOvers = $pdf->addTextWrap(650, $YPos,85,$FontSize,$stup,'right');$LeftOvers = $pdf->addTextWrap(650, $YPos,85,$FontSize,$stup,'right');<?php
/*	$Id: PDFQuotationPageHeader.inc 7551 2016-06-06 15:28:31Z rchacon $*/
/* pdf-php by R&OS code to set up a new sales order page */

/*	Please note that addTextWrap prints a font-size-height further down than
	addText and other functions.*/

// $PageNumber is initialised in 0 by includes/PDFStarter.php.
$PageNumber ++;// Increments $PageNumber before printing.
if($PageNumber>1) {// Inserts a page break if it is not the first page.
	$pdf->newPage();
}

// Prints company logo:
/*$pdf->addJpegFromFile($_SESSION['LogoFile'], 301, 520, 0, 60);// Old function. See ~/includes/class.pdf.php.*/
$pdf->Image(
	$_SESSION['LogoFile'],// Name of the file containing the image.
	20,// Abscissa from left border to the upper-left corner (LTR).
	$Page_Height -(520) -(80),// Ordinate from top border to the upper-left corner (LTR).
	0,// Width of the image in the page. If not specified or equal to zero, it is automatically calculated.
	60,// Height of the image in the page. If not specified or equal to zero, it is automatically calculated.
	''// Image format. If not specified, the type is inferred from the file extension.
);// Public function Image() in ~/includes/tcpdf/tcpdf.php.

// Prints 'Quotation' title:
$pdf->SetFont('Helvetica', 'B', 20,' ' , 'false');
$pdf->addTextWrap(0, $Page_Height-$Top_Margin-18, $Page_Width+50, 20, _('Rostering Timesheet by Locations/Posts'), 'center');

// Prints quotation info:
$pdf->SetFont('Helvetica', 'B', 14,' ' , 'false');
$pdf->addTextWrap($Page_Width-$Right_Margin-200, $Page_Height-$Top_Margin-$FontSize*1, 200, 14, _('Roster No'). ': '.$rosterid, 'right');
$pdf->SetFont('Helvetica', '', 14,' ' , 'false');

$pdf->addTextWrap($Page_Width-$Right_Margin-200, $Page_Height-$Top_Margin-$FontSize*3, 200, 12, _('Printed Date'). ': '.$date, 'right');
$pdf->addTextWrap($Page_Width-$Right_Margin-200, $Page_Height-$Top_Margin-$FontSize*4, 200, 12, _('Page').': '.$PageNumber, 'right');


		$userid = $_SESSION['UserID'];
		
$SQLuser = "SELECT email,realname
	               
			FROM www_users
			WHERE userid='" . $userid. "'
			";
	
			$resultuser = DB_query($SQLuser);
	
			$myrowuser = DB_fetch_array($resultuser) ;
		$emailm= $myrowuser['email'];
$realname= $myrowuser['realname'];

$pdf->SetFont('Helvetica', '', 12,' ' , 'false');
$pdf->addTextwrap($Page_Width-$Right_Margin-500+100, $Page_Height-$Top_Margin-$FontSize*5, 500, 12,  _('Prepared by') . ': ' . $realname.' '._('Email:'). $emailm);

$pdf->addTextwrap($Page_Width-$Right_Margin-500+100, $Page_Height-$Top_Margin-$FontSize*6, 500, 12,  _('Start Date') . ': ' . $startdate.' '._('End Date:'). $enddate);
$pdf->SetFont('Helvetica', ' ', 12,' ' , 'false');
$pdf->addTextwrap($Page_Width-$Right_Margin-500+100, $Page_Height-$Top_Margin-$FontSize*7, 500, 12,  _('Department') . ': ' . $myrowdepart['departmentname']);


$pdf->addTextwrap($Page_Width-$Right_Margin-500+100, $Page_Height-$Top_Margin-$FontSize*11, 500, 12,  _('Supervisor') . ': ' . $myrow200['supervisor_details_for_rosterprintheaders']);
//$pdf->addTextwrap($Page_Width-$Right_Margin-500+100, $Page_Height-$Top_Margin-$FontSize*12, 500, 12, $super1);
$pdf->addTextwrap($Page_Width-$Right_Margin-500+100, $Page_Height-$Top_Margin-$FontSize*12, 500, 12,   _('Control Room: ') .$myrowcom['controlroom_ph']) ;
// Prints company info:
$XPos = $Page_Width/2+$Left_Margin;
$YPos = 512;
$FontSize = 12;
//$pdf->addText($XPos, $YPos-$FontSize*6, $FontSize,  _('Prepared by') . ': ' . $realname.' '._('Email:'). $emailm);



// Prints 'Quotation For' info:
$YPos -= 80;
$line_height = 15;



//$pdf->addText($XPos, $YPos-$line_height*4, $FontSize, $address3 . ' ' . $address4 . ' ' . $address5);

// Draws a box with round corners around 'Delivery To' info:
$XPos= 30;
$YPos += 12;
$pdf->RoundRectangle(
	$XPos-10,// RoundRectangle $XPos.
	$YPos+70,// RoundRectangle $YPos.
	345,// RoundRectangle $Width.
	80,// RoundRectangle $Height.
	10,// RoundRectangle $RadiusX.
	10);// RoundRectangle $RadiusY.

$pdf->SetFont('Helvetica', 'B', 12,' ' , 'false');
$pdf->addText($XPos, $YPos+60, $FontSize, _('Client').':'. $myrow300['name']);
$pdf->addText($XPos, $YPos+60-$line_height*1,$FontSize,_('Patrol Location').':'. $myrow50['patrollocation']);
$pdf->addText($XPos, $YPos+60-$line_height*2, $FontSize,_('Account No').':'. $myrow50['account_number']);
$pdf->addText($XPos, $YPos+60-$line_height*3, $FontSize,_('Sector:').$myrow200['name']);
$pdf->SetFont('Helvetica', '', 10,' ' , 'false');
$FontSize=10;

// Prints the currency name:
require_once('includes/CurrenciesArray.php');// To get the currency name from the currency code.
//$pdf->addText($Page_Width/2+$Left_Margin, $YPos-5, $FontSize,	_('All amounts stated in: FJD') );

// Prints table header:
$XPos = 40;
$YPos -= 37;
$LeftOvers = $pdf->addTextWrap($Left_Margin+30, $YPos,103, $FontSize, _('Employee'));
	if(strlen($LeftOvers) > 0) { // If translated text is greater than 103, prints remainder
		$LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos-$FontSize, 65, $FontSize, $LeftOvers);
	}
$LeftOvers = $pdf->addTextWrap(150, $YPos,505, $FontSize, _('Mon'));
$FontSize = 10;
$LeftOvers = $pdf->addTextWrap(130, $YPos-10,505, $FontSize, $startdate.' Hrs');

$mondate = $startdate;
		$tuesdate = date('d-m-Y', strtotime($mondate . ' +1 day'));
		$weddate = date('d-m-Y', strtotime($tuesdate . ' +1 day'));
		$thursdate = date('d-m-Y', strtotime($weddate . ' +1 day'));
		$fridate = date('d-m-Y', strtotime($thursdate . ' +1 day'));
		$satdate = date('d-m-Y', strtotime($fridate . ' +1 day'));
		$sundate = date('d-m-Y', strtotime($satdate . ' +1 day'));
        $mon2date = date('d-m-Y', strtotime($sundate . ' +1 day'));

$LeftOvers = $pdf->addTextWrap(220, $YPos, 55, $FontSize, _('Tues'),'right');
$LeftOvers = $pdf->addTextWrap(220, $YPos-10, 55, $FontSize, $tuesdate,'right');
$pdf->addTextWrap(240, $YPos-10, 55, $FontSize,_(' Hrs'),'right');
	if(strlen($LeftOvers) > 0) { // If translated text is greater than 55, prints remainder
		$LeftOvers = $pdf->addTextWrap(615,$YPos-$FontSize,55, $FontSize, $LeftOvers,'right');
	}
	$LeftOvers = $pdf->addTextWrap(290, $YPos, 55, $FontSize, _('Wed'),'right');
$LeftOvers = $pdf->addTextWrap(310, $YPos-10, 55, $FontSize, $weddate,'right');
$pdf->addTextWrap(330, $YPos-10, 55, $FontSize,_(' Hrs'),'right');
	if(strlen($LeftOvers) > 0) { // If translated text is greater than 55, prints remainder
		$LeftOvers = $pdf->addTextWrap(615,$YPos-$FontSize,55, $FontSize, $LeftOvers,'right');
	}
$LeftOvers = $pdf->addTextWrap(360, $YPos, 70, $FontSize, _('Thurs'),'right');
$LeftOvers = $pdf->addTextWrap(390, $YPos-10, 55, $FontSize, $thursdate,'right');

$pdf->addTextWrap(405, $YPos-10, 55, $FontSize,_(' Hrs'),'right');
	if(strlen($LeftOvers) > 0) { // If translated text is greater than 70, prints remainder
		$LeftOvers = $pdf->addTextWrap(665, $YPos-$FontSize, 70, $FontSize, $LeftOvers,'right');
	}
$LeftOvers = $pdf->addTextWrap(420, $YPos, 90, $FontSize, _('Fri'),'right');
$LeftOvers = $pdf->addTextWrap(462, $YPos-10, 55, $FontSize, $fridate,'right');
$pdf->addTextWrap(480, $YPos-10, 55, $FontSize,_(' Hrs'),'right');
$LeftOvers = $pdf->addTextWrap(495, $YPos, 90, $FontSize, _('Sat'),'right');
$LeftOvers = $pdf->addTextWrap(545, $YPos-10, 55, $FontSize, $satdate,'right');
$pdf->addTextWrap(565, $YPos-10, 55, $FontSize,_(' Hrs'),'right');
$LeftOvers = $pdf->addTextWrap(567, $YPos, 90, $FontSize, _('Sun'),'right');
$LeftOvers = $pdf->addTextWrap(630, $YPos-10, 55, $FontSize, $sundate,'right');
$pdf->addTextWrap(650, $YPos-10, 55, $FontSize,_(' Hrs'),'right');
$LeftOvers = $pdf->addTextWrap(657, $YPos, 90, $FontSize, _('Mon2'),'right');
$LeftOvers = $pdf->addTextWrap(710, $YPos-10, 55, $FontSize, $mon2date,'right');
$pdf->addTextWrap(730, $YPos-10, 55, $FontSize,_(' Hrs'),'right');
$LeftOvers = $pdf->addTextWrap(730, $YPos, 90, $FontSize, _('Total'),'right');
;

// Draws a box with round corners around line items:
$pdf->RoundRectangle(
	$Left_Margin,// RoundRectangle $XPos.
	$YPos+$FontSize+5,// RoundRectangle $YPos.
	$Page_Width-$Left_Margin-$Right_Margin,// RoundRectangle $Width.
	$YPos+$FontSize-$Bottom_Margin+5,// RoundRectangle $Height.
	10,// RoundRectangle $RadiusX.
	10);// RoundRectangle $RadiusY.

// Line under table headings:
$LineYPos = $YPos - $FontSize -1;
$pdf->line($Page_Width-$Right_Margin, $LineYPos, $Left_Margin, $LineYPos);

$YPos -= $FontSize + 10 ;// This is to use addTextWrap's $YPos instead of normal $YPos.

?>
