<!--form class="quick_search">
	<input type="text" value="Quick Search" onFocus="if(!this._haschanged){this.value=''};this._haschanged=true;">
</form-->
		<!--h3>Data Lokasi (<?php echo $jml;?> Pos)</h3-->
              <table border="0" cellpadding="2" cellspacing="1" width="100%">
<tbody>
<?php
/*$sql="SELECT * FROM m_lokasi WHERE 1=1 AND id_tipe='PDA' AND id_bbws=".$_SESSION['id_bbws']." AND status_lokasi=1
		UNION
		SELECT * FROM m_lokasi WHERE 1=1 AND nama_lokasi IN ('Sawangan','PasarBaru','Manggarai') AND id_bbws=".$_SESSION['id_bbws']." AND status_lokasi=1 ORDER BY ReceivedDate Desc, ReceivedTime Desc ";
*/

//PERBALAI $sql="SELECT nama_lokasi,nama_alat,id_merk,id_tipe,CURDATE(),ReceivedDate,DATEDIFF(current_date(),ReceivedDate) AS icon FROM m_lokasi WHERE 1=1 AND id_bbws=".$_SESSION['id_bbws']." AND status_lokasi=1 ORDER BY ReceivedDate Desc, ReceivedTime Desc ";

$sql="SELECT nama_lokasi,nama_alat,id_merk,id_tipe,CURDATE(),ReceivedDate,DATEDIFF(current_date(),ReceivedDate) AS hr,icon FROM m_lokasi WHERE 1=1 AND  status_lokasi=1 AND id_bbws=".$_SESSION['id_bbws']." ORDER BY id_tipe DESC, ReceivedDate Desc, ReceivedTime Desc ";
		      $query = mysql_query($sql);
			  $i=0;
   			  date_default_timezone_set('Asia/Jakarta');
			  $tanggal= mktime(0,0,0,date('m'),date('d'),date('Y'));
			  $hariini = date("Y-m-d", $tanggal);

              while ($row_detdata=mysql_fetch_array($query)){
              $i++;
if($row_detdata['icon']=="normal" || $row_detdata['icon']=="siaga4"){ 
							$sts="style='background-image:url(images/icons/PDAOnlineS3.png); background-repeat:no-repeat; padding-left:18px;'";
				} else if($row_detdata['icon']=="siaga3"){ 
							$sts="style='background-image:url(images/icons/PDAOnlineS4.png); background-repeat:no-repeat; padding-left:18px;'";
				} else if($row_detdata['icon']=="siaga2"){ 
							$sts="style='background-image:url(images/icons/PDAOnlineS2.png); background-repeat:no-repeat; padding-left:18px;'";
				} else if($row_detdata['icon']=="siaga1"){ 
							$sts="style='background-image:url(images/icons/PDAOnlineS1.png); background-repeat:no-repeat; padding-left:18px;'";
				} else {
					$sts="style='background-image:url(images/icon_online.png); background-repeat:no-repeat; padding-left:18px;'";				
				} 
			  ?>
              <tr>
              	<td <?php echo $sts;?>>
                <a href="home.php?page=dataposmks&pos=<?php echo $row_detdata['nama_lokasi']; ?>&tpos=<?php echo $row_detdata['id_tipe']; ?>">
			<strong>[<?php echo $row_detdata['id_tipe'];?>]-<?php echo $row_detdata['nama_alat'];?></strong></a></td>
            	<td align="left"><?php if($row_detdata['hr']>0 || $row_detdata['hr']=="") { /*echo "<em><font color='red' style='text-decoration:line-thdrough;'>".$row_detdata['hr'].".hari</font></em>";*/ } ?></td>
              </tr>
			<?php } ?>		
</tbody>
              </table>
		<!--h3>Admin</h3>
		<ul class="toggle">
			<li class="icn_settings"><a href="#">Options</a></li>
			<li class="icn_security"><a href="#">Security</a></li>
			<li class="icn_jump_back"><a href="#">Logout</a></li>
		</ul-->
		
		<!--footer>
			<hr />
			<p><strong>Copyright &copy; 2016 Bws Kaltim III</strong></p>
			<p>Theme by <a href="http://www.sdatelemetry.com">Konsultan</a></p>
		</footer-->
