<?php include_once "../class/Config.php"; include_once "../class/AssetGroup.php"; $showGroup = new AssetGroup(); $dbGroup = new config(); $searchType = $_GET["assetTypeCode"]; //$searchType = "01"; $arr = $showGroup->getAssetGroupByType($searchType); ?> * <select id="addAssetGroup"> <option value="00">หมวดครุภัณฑ์</option> <?php while ($rowG = $dbGroup->fetch_array($arr)) { ?> <?php echo "<option value='" . $rowG['assetGroupId'] . "'>"; echo $rowG['assetTypeCode'] . "" . $rowG['assetGroupCode'] . " " . $rowG['assetGroupName'] . "</option>"; ?> <?php } ?> </select>
<th style="width: 5%; text-align:center">ลำดับ</th> <th style="width: 28%; text-align:center">รหัสประเภทครุภัณฑ์</th> <th style="width: 28%; text-align:center">รหัสหมวดครุภัณฑ์</th> <th style="width: 28%; text-align:center">ชื่อหมวดครุภัณฑ์</th> <th style="width: 10%; text-align:center">แก้ไข</th> <th style="width: 10%; text-align:center">ลบ</th> </tr> </thead> <tbody> <?php $no = 1; $typeCode = $_GET["id"]; //$typeCode = $_GET["id"]; $arr = $assGroup->getAssetGroup(); $arr2 = $assGroup->getAssetGroupByType($typeCode); if ($typeCode == "00") { $cmd = $arr; } else { $cmd = $arr2; } while ($res = $db->fetch_array($cmd)) { echo "<tr>"; echo "<td id='Uid" . $no . "' style='text-align:center'>" . $no . "</td>"; echo "<td id='Ulname" . $no . "' style='text-align:center'>" . $res['assetTypeCode'] . "</td>"; echo "<td id='Uuname" . $no . "' style='text-align:center'>" . $res['assetTypeCode'] . "" . $res['assetGroupCode'] . "</td>"; echo "<td id='Ufname" . $no . "'>" . $res['assetGroupName'] . "</td>"; echo "<td id='Uedit" . $no . "' style='text-align:center'><a class='button icon edit' onClick='getEditGroup(" . $res['id'] . ");'></a></td>"; echo "<td id='Udel" . $no . "' style='text-align:center'><a class='button icon remove danger' onClick='delGroup(" . $res['id'] . ");'></a></td>"; echo "</tr>"; $no++;
$year = "2556"; $Type = "01"; $Group = "01"; $asset = "001"; /* $year = $_GET['assetYear']; $Type = $_GET['assetType']; $Group = $_GET['assetGroup']; $asset = $_GET['assetCode']; */ $yearS = $year - 543; $command = "WHERE assetAddDate LIKE '%" . $year . "%' AND assetTypeCode = '" . $type . "' AND assetGroupCode = '" . $group . "'"; $arrYear = $showAsset->getShowAssetYear(); $arrType = $showType->getAssetType(); //$showGroup->setAssetTypeCode($arrType); $arrGroup = $showGroup->getAssetGroupByType("01"); $arrAsset = $showAsset->getAssetBy($command); ?> <select id="assetYearQR" onchange="changePrintQR();"> <option value="0000">ประจำปี</option> <?php while ($row = $dbAsset->fetch_array($arrYear)) { $selDate = $row['years']; $year = $selDate + 543; echo "<option value='" . $year . "'>"; echo $year . "</option>"; } ?> </select>
<tr> <th style="width: 5%; text-align:center">ลำดับ</th> <th style="width: 17%; text-align:center">รหัสประเภทครุภัณฑ์</th> <th style="width: 17%; text-align:center">รหัสหมวดครุภัณฑ์</th> <th style="width: 40%; text-align:center">ชื่อหมวดครุภัณฑ์</th> <th style="width: 10%; text-align:center">แก้ไข</th> <th style="width: 10%; text-align:center">ลบ</th> </tr> </thead> <tbody> <?php $no = 1; $typeId = $_GET["assetTypeId"]; $arr = $assGroup->getAssetGroup(); $arr2 = $assGroup->getAssetGroupByType($typeId); if ($typeId == 0) { $cmd = $arr; } else { $cmd = $arr2; } while ($res = $db->fetch_array($cmd)) { echo "<tr>"; echo "<td style='text-align:center'>" . $no . "</td>"; echo "<td style='text-align:center'>" . $res['assetTypeCode'] . "</td>"; echo "<td style='text-align:center'>" . $res['assetTypeCode'] . "" . $res['assetGroupCode'] . "</td>"; echo "<td>" . $res['assetGroupName'] . "</td>"; echo "<td style='text-align:center'>\r\n\t<a class='button icon edit' onClick='getEditGroup(" . $res['assetGroupId'] . ");'></a></td>"; echo "<td style='text-align:center'>\r\n\t<a class='button icon remove danger' onClick='delGroup(" . $res['assetGroupId'] . ");'></a></td>"; echo "</tr>"; $no++;