</a>
                    <ul class="dropdown-menu dropdown-tasks">;';
                    
						$cnt1 = 0;
						foreach($inst_id as $schoolID) {
							$getSQLdata =  mysql_query("SELECT * FROM `log_battery` where INST_ID = '$schoolID' and REC_DATE = (Select MAX(REC_DATE) FROM log_battery where INST_ID = '$schoolID')") or die(mysql_error());
							while($rowData = mysql_fetch_array($getSQLdata)){
								echo '<li>
                            <a href="#INST_ID='.$schoolID.'">
                                <div>
                                    <p>
                                        <strong>'.$inst_name[$cnt1].'</strong>
                                        <span class="pull-right text-muted">'.$rowData["STATUS"].'% Full</span>
                                    </p>
                                    <div class="progress progress-striped active">
                                        <div class="progress-bar '.battery_Bar(intval($rowData["STATUS"])).'" role="progressbar" aria-valuenow="'.$rowData["STATUS"].'" aria-valuemin="0" aria-valuemax="100" style="width:'.$rowData["STATUS"].'%">
                                            <span class="sr-only">Battery Life '.$rowData["STATUS"].'%</span>
                                        </div>
                                    </div>
                                </div>
                            </a>
                        </li> <li class="divider"></li>';
							}
						}
                   echo' <li>
                            <a class="text-center" href="#">
                                <strong>See All Battery Levels</strong>
                                <i class="fa fa-angle-right"></i>
                            </a>
                        </li>
                    </ul>
예제 #2
0
파일: functions.php 프로젝트: T-TEL/TelBel
function getBatteryLevels($inst_id)
{
    $cnt1 = 0;
    foreach ($inst_id as $schoolID) {
        $getSQLdata = mysql_query("SELECT CAST(STATUS AS UNSIGNED) as STATUS FROM `log_battery` where INST_ID = '{$schoolID}' and REC_DATE = (Select MAX(REC_DATE) FROM log_battery where INST_ID = '{$schoolID}')") or die(mysql_error());
        while ($rowData = mysql_fetch_array($getSQLdata)) {
            echo '<li>
		<a href="#INST_ID=' . $schoolID . '">
			<div>
				<p>
					<strong>' . $inst_name[$cnt1] . '</strong>
					<span class="pull-right text-muted">' . $rowData["STATUS"] . ' % Full</span>
				</p>
				<div class="progress progress-striped active">
					<div class="progress-bar ' . battery_Bar(intval($rowData["STATUS"])) . '" role="progressbar" aria-valuenow="' . $rowData["STATUS"] . '" aria-valuemin="0" aria-valuemax="100" style="width:' . $rowData["STATUS"] . '%">
						<span class="sr-only">Battery Life ' . $rowData["STATUS"] . '%</span>
					</div>
				</div>
			</div>
		</a>
	</li> <li class="divider"></li>';
        }
    }
}