} else { $arrA = $asset->getAsset(); $cmdA = $arrA; } $num = $db->num_rows($cmdA); $numPage = round($num / 20); $i = 0; $j = 1; while ($i < $numPage) { echo "<input type='button' value='" . $j . "' class='button' onclick='changePageAsset(" . $i . ");'>"; $i++; $j++; } $no1 = $startPage; $no = $no1 + 1; while ($res = $db->fetch_array($cmd)) { $selDate = $res['assetAddDate']; $numberAsString = number_format($res['assetPrice'], 2); $dateM = substr($selDate, 4, 6); $text = substr($selDate, 0, 4); $sYear = substr($res['assetYear'], 2, 4); $year = $text + 543; $dateType = $year . "" . $dateM; $datetime = DateTime::createFromFormat('Y-m-d', $dateType); $dateT = $datetime->format('d/m/Y'); echo "<tr>"; echo "<td style='text-align:center'>" . $no . "</td>"; echo "<td style='text-align:center'>" . $res['assetYear'] . "</td>"; echo "<td style='text-align:center'>" . $sYear . "/" . $res['assetTypeCode'] . "-" . $res['assetTypeCode'] . "" . $res['assetGroupCode'] . "-" . $res['assetCode'] . "</td>"; echo "<td style='text-align:left'>" . $res['assetName'] . "</td>"; echo "<td style='text-align:right'>" . $numberAsString . "</td>";
if ($assStat == "1") { $stat = "Y"; } else { if ($assStat == "2") { $stat = "N"; } else { if ($assStat == "3") { $stat = "D"; } else { $stat = ""; } } } } $arrStat = $checkAsset->getCheckAssetByStatus($stat); while ($res = $db->fetch_array($arrStat)) { $selDate = $res['assetAddDate']; $assYear = $res['assetYear']; $numberAsString = number_format($res['assetPrice'], 2); if ($res['checkStatus'] == "Y") { $stat = "ใช้งานได้"; } else { if ($res['checkStatus'] == "N") { $stat = "ชำรุด"; } else { if ($res['checkStatus'] == "D") { $stat = "เสื่อมสภาพ"; } else { $stat = "-"; } }
<div id="dialog2"></div> <div class="container"> <div class="menu"> <h1>เมนู</h1> <center><font>ยินดีต้อนร้บ</font></br></br> <?php echo "คุณ"; echo $fname; echo " "; echo $lname; echo " </br> "; echo " ตำแหน่ง : "; echo $position; $arr = $user->getUId($usr); $row = $dbU->fetch_array($arr); $uId = $row['userId']; if ($status == "Administrator") { ?> </br></br> </center> <div class="button-groups"> <a class="button big icon home" style="width:145px;" onClick="showMainPage();">หน้าหลัก</a></br> <a class="button big icon user" style="width:145px;" onClick="showManageUser();">จัดการผู้ใช้</a></br> <a class="button big icon add" style="width:145px;" onClick="showManageType();">จัดการประเภทครุภัณฑ์</a></br> <a class="button big icon add" style="width:145px;" onClick="showManageGroup();">จัดการหมวดครุภัณฑ์</a></br> <a class="button big icon add" style="width:145px;" onClick="showManageAsset();">จัดการครุภัณฑ์</a></br> <a class="button big icon approve" style="width:145px;" onClick="showCheckAsset();">ตรวจเช็คครุภัณฑ์</a></br> <a class="button big icon log" style="width:145px;" onClick="showPrintReport();">พิมพ์รายงาน</a></br> <a class="button big icon key" style="width:145px;" onClick="getEditPass(<?php echo $uId;
</head> <body > <style> @import “css/ReportStyle.css”; </style> <div id="Asset_Excel" class ="test" align=center x:publishsource="Excel" > <table x:str border=0 cellpadding=0 cellspacing=0 width=100%> <tr> <th colspan=6 height=42 class="xl201">ทะเบียนครุภัณฑ์ต่ำกว่าเกณฑ์ ณ วันที่ 30 <span> </span>กันยายน <span> </span> <?php $ress = $db->fetch_array($arrYear); echo $ress['assetYear']; ?> </th> </tr> <tr> <th width="90" class="xl202">วัน/เดือน/ปี <br>ที่ได้มา</th> <th width="100" class="xl202">รหัสครุภัณฑ์</th> <th width="300" class="xl202">รายการ</th> <th width="100" class="xl202">ราคา / หน่วย</th> <th width="170" class="xl202">ใช้ประจำหน่วยงาน</th> <th width="213" class="xl202">สถานะการตรวจสอบ</th> </tr> <?php while ($res = $db->fetch_array($arrCheck)) { $code = $res['assetTypeCode'] . "-" . $res['assetGroupCode'] . "-" . $res['assetCode'];
<?php include_once "../class/Config.php"; include_once "../class/Asset.php"; include_once "../class/CheckAsset.php"; $delAsset = new Asset(); $delChkAsset = new CheckAsset(); $db = new Config(); $delId = $_GET["id"]; //$delId = "12"; $delAsset->setId($delId); $arr = $delAsset->getAssetById(); $res = $db->fetch_array($arr); $DelChkType = $res['assetTypeCode']; $DelChkGroup = $res['assetGroupCode']; $DelChkAsset = $res['assetCode']; $delChkAsset->setAssetTypeCode($DelChkType); $delChkAsset->setAssetGroupCode($DelChkGroup); $delChkAsset->setAssetCode($DelChkAsset); $delChkAsset->delCheckAsset(); $delAsset->delAsset();
$month = substr($assetAddDate, 3, 2); $text = substr($assetAddDate, 6, 4); $yearD = substr($assetAddDate, 6, 4); if ($month >= 10 && $month <= 12) { $yearD++; } $assYear = $yearD + 543; $year = $text - 543; $dateType = $dateM . "" . $year; $datetime = DateTime::createFromFormat('d/m/yy', $dateType); $dateT = $datetime->format('Y-m-d'); if ($assetNum == "") { $addAsset->setValues($assetCode, $assetName, $assetPrice, $assetTypeId, $assetGroupId, $yearD, $assetLocation, $dateT, $remark, $userId); $addAsset->addAsset(); $arr = $addAsset->getAssetIdToCheck($assetTypeId, $assetGroupId, $assetCode); $result = $db->fetch_array($arr); $addCheck->setAssetTypeId($assetTypeId); $addCheck->setAssetGroupId($assetGroupId); $addCheck->setAssetId($result['assetId']); $addCheck->setAssetYear($yearD); $addCheck->setAssetAddDate($dateT); $addCheck->setUserId($userId); $addCheck->addCheckAsset(); } else { if ($assetNum > 1) { $i = 1; $gens = $assetCode; $gen = $gens - 1; while ($i <= $assetNum) { $genCode = str_pad($gen + 1, 3, "0", STR_PAD_LEFT); $addAsset->setValues($genCode, $assetName, $assetPrice, $assetTypeId, $assetGroupId, $yearD, $assetLocation, $dateT, $remark, $userId);