<?php

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