本文整理汇总了PHP中config::fetch_object方法的典型用法代码示例。如果您正苦于以下问题:PHP config::fetch_object方法的具体用法?PHP config::fetch_object怎么用?PHP config::fetch_object使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类config
的用法示例。
在下文中一共展示了config::fetch_object方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: json_encode
<?php
include_once "../class/Config.php";
include_once "../class/AssetType.php";
$editType = new AssetType();
$dbType = new config();
$editId = $_GET["id"];
//$editId = "14";
$editType->setId($editId);
$arr = $editType->getEditAssetType();
$data_array = array();
$no = 1;
$stat = 0;
while ($res = $dbType->fetch_object($arr)) {
/*
$selDate = $res->assetTypeAddDate;
$dateM = substr($selDate,4,6);
$text = substr($selDate,0,4);
$year = $text+543;
$dateType = $year."".$dateM;
$datetime = DateTime::createFromFormat('Y-m-d',$dateType);
$dateT = $datetime->format('d/m/Y');
*/
$data_array[$res->id]['id'] = $res->id;
$data_array[$res->id]['assetTypeCode'] = $res->assetTypeCode;
$data_array[$res->id]['assetTypeName'] = $res->assetTypeName;
}
echo json_encode($data_array);
示例2: CheckAsset
<?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);
示例3: json_encode
<?php
include_once "../class/Config.php";
include_once "../class/AssetGroup.php";
$editGroup = new AssetGroup();
$dbGroup = new config();
$editId = $_GET["id"];
//$editId = "01";
$editGroup->setId($editId);
$arr = $editGroup->getEditAssetGroup();
$data_array = array();
$no = 1;
$stat = 0;
while ($res = $dbGroup->fetch_object($arr)) {
$data_array[$res->id]['id'] = $res->id;
$data_array[$res->id]['assetGroupCode'] = $res->assetGroupCode;
$data_array[$res->id]['assetGroupName'] = $res->assetGroupName;
$data_array[$res->id]['assetTypeCode'] = $res->assetTypeCode;
}
echo json_encode($data_array);
示例4: User
<?php
include_once "../class/Config.php";
include_once "../class/User.php";
$editUser = new User();
$dbss = new config();
$editId = $_GET["id"];
$arr = $editUser->getEditUser($editId);
$data_array = array();
$no = 1;
$stat = 0;
while ($res = $dbss->fetch_object($arr)) {
$data_array[$res->id]['id'] = $res->id;
$data_array[$res->id]['username'] = $res->username;
$data_array[$res->id]['firstName'] = $res->firstName;
$data_array[$res->id]['lastName'] = $res->lastName;
$data_array[$res->id]['position'] = $res->position;
if ($res->status == "Administrator") {
$stat = 1;
$data_array[$res->id]['status'] = $stat;
} else {
if ($res->status == "Officer") {
$stat = 2;
$data_array[$res->id]['status'] = $stat;
} else {
$stat = 0;
$data_array[$res->id]['status'] = $stat;
}
}
//$data_array[$res->id]['status'] = $res->status;
}