本文整理汇总了PHP中json::sendJsonObj方法的典型用法代码示例。如果您正苦于以下问题:PHP json::sendJsonObj方法的具体用法?PHP json::sendJsonObj怎么用?PHP json::sendJsonObj使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类json
的用法示例。
在下文中一共展示了json::sendJsonObj方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: session_start
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this templates file, choose Tools | Templates
* and open the templates in the editor.
*/
//this file will handle profile requests
include_once '../classes/viewDAO.php';
include_once '../classes/json.php';
session_start();
//get action
$action = $_REQUEST["action"];
$dao = new viewDAO();
if ($action == "approve") {
$message = $dao->approve();
json::sendJsonObj($message);
}
示例2: pdoDAO
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this templates file, choose Tools | Templates
* and open the templates in the editor.
*/
include_once '../dataAccess/pdoDAO.php';
include_once '../../classes/json.php';
$dao = new pdoDAO();
$action = $_REQUEST['action'];
switch ($action) {
case "initReports":
\ZP\ZP::log('Opened Reports', 'Opened Reports', $_SESSION['user']->getID(), $_SESSION['module_number']);
$obj = $dao->initReports();
json::sendJsonObj($obj);
break;
case "getReport":
$mineID = trim($_POST['mineID']);
$from = trim($_POST['from']);
$to = trim($_POST['to']);
$indicatorID = trim($_POST['indicatorID']);
$report = $dao->getReport($mineID, $from, $to, $indicatorID);
json::sendJsonObj($report);
break;
default:
break;
}
示例3: array
case "initProfile":
$obj = $dao->initProfile();
json::sendJsonObj($obj);
break;
case "init-empstats":
$list = $dao->initEmpstats();
json::sendJsonObj($list);
break;
case "init_plicences":
$list = $dao->init_plicences();
json::sendJsonObj($list);
break;
case "saveLicences":
//create objects arr
$arr = array();
for ($i = 1; $i <= $_POST['rowCount']; $i++) {
$obj = (object) ["licenceID" => $_POST["licenceID" . $i], "code" => $_POST["code" . $i], "type" => $_POST["type" . $i], "resources" => $_POST["resources" . $i], "area" => $_POST["area" . $i], "location" => $_POST["location" . $i], "status" => $_POST["status" . $i]];
array_push($arr, $obj);
}
$dao->saveLicences($arr);
break;
case "addLicence":
$licence = (object) ["licence" => $_POST["licence"], "resources" => $_POST["resources"], "area" => $_POST["area"], "location" => $_POST["location"], "type" => $_POST["type"], "status" => $_POST["status"], "code" => $_POST["code"]];
$dao->addLicence($licence);
break;
case "init_boinfo":
$list = $dao->init_boinfo();
json::sendJsonObj($list);
default:
break;
}