<?php
session_start();

$pasali=(($_SESSION["pasali"])-591);

      include "../include/mysql.php";

        include "../include/common.php";

		 extract($_REQUEST);

       

        $cbid=$val;

		$icondn=" where cbid='$cbid'";


            $getticketinfo=$db->select(CB,"*",$icondn);

			$getticketinfo_fetch=$db->fetch($getticketinfo);

			$rate=$getticketinfo_fetch["rate"];

		$qty=$getticketinfo_fetch["qty"];

		$amount=$getticketinfo_fetch["amount"];

		$start_no=$getticketinfo_fetch["start_no"];

		$end_no=$getticketinfo_fetch["end_no"];

		$ticket_no=$getticketinfo_fetch["ticket_no"];

		$tid=$getticketinfo_fetch["tid"];

		$tid_condn=" where tid='$tid'";

		$ticketname_select=$db->select(TM,"*",$tid_condn);

		$ticketname_select_fetch=$db->fetch($ticketname_select);

		$tname_eng=$ticketname_select_fetch["tname_eng"];

		$tname_tam=$ticketname_select_fetch["tname_tam"];


		$booking_date=date("d/m/Y",strtotime($getticketinfo_fetch["booking_date"]));

		$booking_time=$getticketinfo_fetch["booking_time"];

		if($qty==1)
		{
           
		   $sno_display=$start_no;

		}
		else
		{

            $sno_display=$start_no ."-" .$end_no;

		}


			$table="<table style='width:100%;font-size:13px;font-weight:bold;'><tr><td align='center'>அருள்மிகு மீனாக்ஷி சுந்தரேஸ்வரர் திருக்கோவில்<br>மதுரை</td></tr></table><table  style='width:100%;'><tr><td align='left' width='30%'>$booking_date</td><td width='40%'></td><td align='right' width='30%'><b>$sno_display</b></td></tr><tr><td align='left'>$booking_time</td><td align='center'><b>$pasali / $ticket_no</b></td><td align='right'></td></tr></table><table cellpadding='4' style='width:100%;background-color:black;color:white;height:40px;'><tr><td align='center'><b>$tname_eng</b></td></tr><tr><td align='center'><b>$tname_tam</b></td></tr></table><table  style='width:100%;'><tr><td align='center' style='font-weight:bold;'>விலை $rate/-</td></tr></table><table  style='width:100%;'><tr><td align='left' width='20%'></td><td width='20%'></td><td align='right' width='60%'>Amount</td></tr><tr><td align='left'><b>$qty</b> Nos.</td><td align='center'></td><td align='right'><b><img src='indian-rupee-symbol.gif' width='12px' height='12px'> $amount/-</b></td></tr></table><table  style='width:100%;font-size:12px;font-weight:bold;'><tr><td colspan='3' height='20px;'></td></tr><tr><td align='right' width='100%'><img src='jc.jpg' height='20px;'></td></tr><tr><td align='right' width='100%' align='right'>இணை ஆணையர் / நிர்வாக அதிகாரி</td></tr></table>";

			

include("mpdf_ticket.php");


//$mpdf=new mPDF(); 

$mpdf=new mPDF(' ', array(78,96));



//$mpdf=new mPDF('','', 0, '', 15, 15, 16, 16, 9, 9, 'L');

$mpdf->useAdobeCJK = true;		// Default setting in config.php
						// You can set this to false if you have defined other CJK fonts

					//	$mpdf->SetAutoFont();

$mpdf->SetAutoFont(AUTOFONT_ALL);	//	AUTOFONT_CJK | AUTOFONT_THAIVIET | AUTOFONT_RTL | AUTOFONT_INDIC	// AUTOFONT_ALL
						// () = default ALL, 0 turns OFF (default initially)

//$mpdf->mirrorMargins = 1;


/*$mpdf->pagenumPrefix = 'Page number ';
$mpdf->pagenumSuffix = ' - ';
$mpdf->nbpgPrefix = ' out of ';
$mpdf->nbpgSuffix = ' pages';

$mpdf->SetFooter('{PAGENO}{nbpg}');*/

$mpdf->SetJS('this.print();');

//$script="this.print(true);";

//$mpdf->SetJS($script); 

$mpdf->WriteHTML($table);






$mpdf->Output(); 


//exit;
//==============================================================
//==============================================================
//==============================================================


?>

<script type="text/javascript">
window.onload=function(){window.print()};
</script>