当前位置: 首页>>代码示例>>PHP>>正文


PHP config::fetch_object方法代码示例

本文整理汇总了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);
开发者ID:JhunCabas,项目名称:asset-project-system,代码行数:30,代码来源:reqSelType.php

示例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);
开发者ID:JhunCabas,项目名称:asset-project-system,代码行数:31,代码来源:reqSelCheck.php

示例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);
开发者ID:JhunCabas,项目名称:asset-project-system,代码行数:20,代码来源:reqSelGroup.php

示例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;
}
开发者ID:JhunCabas,项目名称:asset-project-system,代码行数:31,代码来源:reqSelUser.php


注:本文中的config::fetch_object方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。