<?php include_once "../class/CheckAsset.php"; $updateChk = new CheckAsset(); $id = $_GET["id"]; $status = $_GET["status"]; if ($status == "ใช้งานได้") { $stat = "Y"; } else { if ($status == "ชำรุด") { $stat = "N"; } else { if ($status == "เสื่อมสภาพ") { $stat = "D"; } else { $stat = null; } } } $updateChk->setId($id); $updateChk->setStatus($stat); $updateChk->checkAssetStatus();
<?php include_once "../class/Config.php"; include_once "../class/CheckAsset.php"; $checkAsset = new CheckAsset(); $dbAsset = new config(); $checkId = $_GET["id"]; //$checkId = "5"; $checkAsset->setId($checkId); $arr = $checkAsset->getCheckAssetById(); $data_array = array(); $no = 1; while ($res = $dbAsset->fetch_object($arr)) { if ($res->status == "Y") { $stat = "ใช้งานได้"; } else { if ($res->status == "N") { $stat = "ชำรุด"; } else { if ($res->status == "D") { $stat = "เสื่อมสภาพ"; } else { if ($res->status == null) { $stat = "-"; } } } } $selDate = $res->assetAddDate; $newYear = $res->assetYear; $dateM = substr($selDate, 4, 6);