<?php
	session_start();
	include("../../asset/theme/css/myfunc.php");
	include("../../php_crud/my_class.php");
	$obj = new my_class();
	
	$device_tbl = "AQUATIC.TBLGWH_BASICINFOMST@AQUATIC227 BASIC_INFO LEFT JOIN AQUATIC.TBLGWH_DIVISIONINFO@AQUATIC227 DIV_INFO ON BASIC_INFO.DIVISIONCODE=DIV_INFO.ID
LEFT JOIN AQUATIC.TBLGWH_SUBDIVISIONINFO@AQUATIC227 SUB_DIV_INFO ON BASIC_INFO.SUBDIVISIONCODE=SUB_DIV_INFO.ID LEFT JOIN AQUATIC.TBLGWH_DISTRICTINFO@AQUATIC227 DIST_INFO ON BASIC_INFO.DISTRICTCODE = DIST_INFO.ID LEFT JOIN AQUATIC.TBLGWH_UPAZILA@AQUATIC227 UPAZILA_INFO ON BASIC_INFO.UPAZILACODE=UPAZILA_INFO.ID";
	$device_cols = "BASIC_INFO.ID,BASIC_INFO.DEVICESLNO,BASIC_INFO.NEW_ID,BASIC_INFO.OLD_ID,BASIC_INFO.ZONE,DIV_INFO.DIVISIONNAME,SUB_DIV_INFO.SUBDIVISIONNAME,
DIST_INFO.DISTRICTNAME,UPAZILA_INFO.UPAZILANAME,BASIC_INFO.CREATEBY,BASIC_INFO.CREATEDATE,BASIC_INFO.UPDATEBY,BASIC_INFO.UPDATEDATE";
	
?>

<table border="1" class="table table-boredered table-striped">
	<thead>
		<th></th>
		<th>AutInc</th>
		<th>Device Sl No</th>
		<th>New ID</th>
		<th>Old ID</th>
		<th>Zone Name</th>
		<th>Division Name</th>
		<th>Sub-Division Name</th>
		<th>Device Name</th>
		<th>Upazila Name</th>
		<th></th>
		<!--<th>Create by</th>
		<th>Create Date</th>
		<th>Update By</th>
		<th>Update Date</th>-->
	</thead>
	<tbody>
		<?php foreach($obj->View_all_data_row_column_By_Cond($device_tbl,$device_cols,"1=1") as $device_info_list){
			
		?>
			<tr>
				<td>
					<button class="btn btn-minier btn-success" type="button" id="btn_save_<?php echo $device_info_list['ID']; ?>" onclick="set_device_info('<?php echo $device_info_list['ID']; ?>')">
						<i class="icon-check"></i> Pick
					</button>
				</td>
				<td><?php echo $device_info_list['ID']; ?></td>
				<td><?php echo $device_info_list['DEVICESLNO']; ?>
					<input type="hidden" name="p_dev_sl_no_<?php echo $device_info_list['ID']; ?>" id="p_dev_sl_no_<?php echo $device_info_list['ID']; ?>" value="<?php echo $device_info_list['DEVICESLNO']; ?>" />
				</td>
				<td><?php echo $device_info_list['NEW_ID']; ?>
					<input type="hidden" name="p_new_id_<?php echo $device_info_list['ID']; ?>" id="p_new_id_<?php echo $device_info_list['ID']; ?>" value="<?php echo $device_info_list['NEW_ID']; ?>" />
				</td>
				<td><?php echo $device_info_list['OLD_ID']; ?>
					<input type="hidden" name="p_old_id_<?php echo $device_info_list['ID']; ?>" id="p_old_id_<?php echo $device_info_list['ID']; ?>" value="<?php echo $device_info_list['OLD_ID']; ?>" />
				</td>
				<td><?php echo $device_info_list['ZONE']; ?></td>
				<td><?php echo $device_info_list['DIVISIONNAME']; ?></td>
				<td><?php echo $device_info_list['SUBDIVISIONNAME']; ?></td>
				<td><?php echo $device_info_list['DISTRICTNAME']; ?>
					<input type="hidden" name="p_dist_name_<?php echo $device_info_list['ID']; ?>" id="p_dist_name_<?php echo $device_info_list['ID']; ?>" value="<?php echo $device_info_list['DISTRICTNAME']; ?>" />
				</td>
				<td><?php echo $device_info_list['UPAZILANAME']; ?>
					<input type="hidden" name="p_upa_name_<?php echo $device_info_list['ID']; ?>" id="p_upa_name_<?php echo $device_info_list['ID']; ?>" value="<?php echo $device_info_list['UPAZILANAME']; ?>" />	
				</td>
				<td> 
					<button class="btn btn-minier btn-success" type="button" id="btn_save_<?php echo $device_info_list['ID']; ?>" onclick="set_device_info('<?php echo $device_info_list['ID']; ?>')">
						<i class="icon-check"></i> Pick
					</button>
				</td>
			</tr>
	<?php } ?>
	</tbody>
</table>