<style>
	th {
		border-bottom: 1px solid #EAEAEA !important;
	}
	
</style>
<?php
	
	include("../../php_crud/my_class.php");
	$obj = new my_class();
	
	$html .= '<table style="width: 1000px" border="0" cellpadding="0" cellspacing="0" id="station_tbl" class="table table-bordered table-striped table-bordered table-hover" style="font-size: 11px !important;">
    <thead>
        <tr style="">
            <th style="padding: 5px;border-top: 1px solid #CCC;border-left: 1px solid #CCC;border-right: 1px solid #CCC;border-bottom: 1px solid #CCC;">SL.</th>
			<th style="padding: 5px;border-top: 1px solid #CCC;border-right: 1px solid #CCC;border-bottom: 1px solid #CCC;">Device SL No.</th>
			<th style="padding: 5px;border-top: 1px solid #CCC;border-right: 1px solid #CCC;border-bottom: 1px solid #CCC;">New Id</th>
			<th style="padding: 5px;border-top: 1px solid #CCC;border-right: 1px solid #CCC;border-bottom: 1px solid #CCC;">Old Id</th>
			<th style="padding: 5px;border-top: 1px solid #CCC;border-right: 1px solid #CCC;border-bottom: 1px solid #CCC;">Zone</th>
			<th style="padding: 5px;border-top: 1px solid #CCC;border-right: 1px solid #CCC;border-bottom: 1px solid #CCC;">Division</th>
			<th style="padding: 5px;border-top: 1px solid #CCC;border-right: 1px solid #CCC;border-bottom: 1px solid #CCC;">Sub Division</th>
			<th style="padding: 5px;border-top: 1px solid #CCC;border-right: 1px solid #CCC;border-bottom: 1px solid #CCC;">District</th>
			<th style="padding: 5px;border-top: 1px solid #CCC;border-right: 1px solid #CCC;border-bottom: 1px solid #CCC;">Upazila</th>
        </tr>
    </thead><tbody>';
	$table_name =  "TBLGWH_BASICINFOMST";
	$where_cond = "FLAG='A' ORDER BY ID ASC";
	
	$row=$obj->View_all_data_row_column_By_Cond_aquatic($table_name,' * ',$where_cond);
	$i = 1;
	foreach($row AS $index=>$val){
		$division_id = $val['DIVISIONCODE'];
		$subdivision_id = $val['SUBDIVISIONCODE'];
		$district_id = $val['DISTRICTCODE'];
		$upazila_id = $val['UPAZILACODE'];
		$division_info = $obj->Details_By_Cond_aquatic("TBLGWH_DIVISIONINFO","ID='$division_id'");
		$subdivision_info = $obj->Details_By_Cond_aquatic("TBLGWH_SUBDIVISIONINFO","ID='$subdivision_id'");
		$district_info = $obj->Details_By_Cond_aquatic("TBLGWH_DISTRICTINFO","ID='$district_id'");
		$upazila_info = $obj->Details_By_Cond_aquatic("TBLGWH_UPAZILA","ID='$upazila_id'");
		$id=$val['ID'];  
		$html .="<tr>  
					<td style='padding: 5px;border-left: 1px solid #CCC;border-right: 1px solid #CCC;border-bottom: 1px solid #CCC;'>".$i."</td>
					<td style='padding: 5px;border-right: 1px solid #CCC;border-bottom: 1px solid #CCC;'>". $val['DEVICESLNO']."</td>
					<td style='padding: 5px;border-right: 1px solid #CCC;border-bottom: 1px solid #CCC;'>". $val['NEW_ID']."</td>
					<td style='padding: 5px;border-right: 1px solid #CCC;border-bottom: 1px solid #CCC;'>". $val['OLD_ID']."</td>
					<td style='padding: 5px;border-right: 1px solid #CCC;border-bottom: 1px solid #CCC;'>". $val['ZONECODE']."</td>
					<td style='padding: 5px;border-right: 1px solid #CCC;border-bottom: 1px solid #CCC;'>". $division_info['DIVISIONNAME']."</td>
					<td style='padding: 5px;border-right: 1px solid #CCC;border-bottom: 1px solid #CCC;'>". $subdivision_info['SUBDIVISIONNAME']."</td>
					<td style='padding: 5px;border-right: 1px solid #CCC;border-bottom: 1px solid #CCC;'>". $district_info['DISTRICTNAME']."</td>
					<td style='padding: 5px;border-right: 1px solid #CCC;border-bottom: 1px solid #CCC;'>". $upazila_info['UPAZILANAME']."</td>
				</tr>";
			$i++;
	}
	$html .= '</tbody></table>';




//==============================================================
//==============================================================
//==============================================================

include("../../asset/mpdf/mpdf.php");
$mpdf=new mPDF('c','A4','','',10,10,10,25,16,13); 
$mpdf->simpleTables = true;
$mpdf->packTableData = true;
$mpdf->keep_table_proportions = TRUE;
$mpdf->shrink_tables_to_fit=1;
$mpdf->SetDisplayMode('fullpage');

$mpdf->list_indent_first_level = 0;	// 1 or 0 - whether to indent the first level of a list

// LOAD a stylesheet
$stylesheet = file_get_contents('mpdfstyletables.css');
$mpdf->WriteHTML($stylesheet,1);	// The parameter 1 tells that this is css/style only and no body/html/text

$mpdf->WriteHTML($html,2);

$mpdf->Output('mpdf.pdf','I');

//==============================================================
//==============================================================
//==============================================================


?>