コード例 #1
0
//**********************************************
include_once "../class/Asset.php";
include_once "../class/CheckAsset.php";
$updateAsset = new Asset();
$updateChk = new CheckAsset();
$assetId = $_GET["assetId"];
$upAssName = $_GET["upAssName"];
$upAssPrice = $_GET["upAssPrice"];
$upRemark = $_GET["upRemark"];
$upAssAddDate = $_GET["upAddDate"];
$dateM = substr($upAssAddDate, 0, 6);
$month = substr($upAssAddDate, 3, 2);
$text = substr($upAssAddDate, 6, 4);
$YearD = substr($upAssAddDate, 6, 4);
if ($month >= 10 && $month <= 12) {
    $YearD++;
}
$year = $text - 543;
$dateType = $dateM . "" . $year;
$datetime = DateTime::createFromFormat('d/m/yy', $dateType);
$dateT = $datetime->format('Y-m-d');
$updateAsset->setAssetId($assetId);
$updateAsset->setAssetName($upAssName);
$updateAsset->setAssetPrice($upAssPrice);
$updateAsset->setRemark($upRemark);
$updateAsset->setAssetAddDate($dateT);
$updateAsset->setAssetYear($YearD);
$updateAsset->editAsset();
$updateChk->setAssetId($assetId);
$updateChk->setAssetAddDate($dateT);
$updateChk->editCheckAsset();
コード例 #2
0
$addAsset = $_GET["addAsset"];
$addAssName = $_GET["addAssName"];
$addPrice = $_GET["addPrice"];
$addAddDate = $_GET["addAddDate"];
$addRemark = $_GET["addRemark"];
*/
//$assetYear = $_GET["addYear"];
$assetTypeCode = $_GET["addType"];
$assetGroupCode = $_GET["addGroup"];
$assetCode = $_GET["addAsset"];
$assetName = $_GET["addAssName"];
$assetPrice = $_GET["addPrice"];
$assetAddDate = $_GET["addAddDate"];
$remark = $_GET["addRemark"];
$assetLocation = "วิทยาลัยแม่ฮ่องสอน";
//$numberAsString = number_format($assetPrice, 2);
$dateM = substr($assetAddDate, 0, 6);
$text = substr($assetAddDate, 6, 4);
$year = $text - 543;
$dateType = $dateM . "" . $year;
$datetime = DateTime::createFromFormat('d/m/yy', $dateType);
$dateT = $datetime->format('Y-m-d');
//echo $dateT."---".$text.":".$assetPrice;
$addAsset->setValues($assetCode, $assetName, $assetPrice, $assetTypeCode, $assetGroupCode, $assetLocation, $dateT, $remark);
$addAsset->addAsset();
$addCheck->setAssetTypeCode($assetTypeCode);
$addCheck->setAssetGroupCode($assetGroupCode);
$addCheck->setAssetCode($assetCode);
$addCheck->setAssetAddDate($dateT);
//$addCheck->setAssetId();
$addCheck->addCheckAsset();