本文整理匯總了PHP中JSON_ENCODE函數的典型用法代碼示例。如果您正苦於以下問題:PHP JSON_ENCODE函數的具體用法?PHP JSON_ENCODE怎麽用?PHP JSON_ENCODE使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了JSON_ENCODE函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: FORMAT
public static function FORMAT($S, $R, $P)
{
$I = array();
if ($P === false) {
$I[] = STR_REPLACE("/", "-", $R) . " 00:00:00";
$I[] = STR_REPLACE("/", "-", $R) . " 24:59:59";
$SET = 'HOUR';
} else {
$R = explode(" - ", $R);
$I[] = STR_REPLACE("/", "-", $R[0]);
$I[] = STR_REPLACE("/", "-", $R[1]);
$SET = 'DAY';
}
$I[] = $S['s_id'];
$Q = "SELECT MIN(t_checkout_created) AS `time`, AVG(t_checkout_price) AS `cost` FROM core_tickets_processed WHERE t_checkout_created >= ? AND t_checkout_created <= ? AND t_store = ? GROUP BY";
$CA = MYSQL::QUERY($Q . " {$SET}(t_checkout_created) ORDER BY t_checkout_created ASC", $I);
$CO = MYSQL::QUERY($Q . " t_checkout_created ORDER BY t_checkout_created ASC", $I);
$STRING = array();
$STRING[] = array('name' => 'Average Charge', 'data' => '');
$STRING[] = array('name' => 'Checkout Charges', 'data' => '');
foreach ($CA as $C) {
$T = Date_UTC($C['time']);
$STRING[0]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $T[3] . "," . $C['cost'];
}
foreach ($CO as $C) {
$T = Date_UTC($C['time']);
$STRING[1]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $T[3] . "," . $T[4] . "," . $C['cost'];
}
echo JSON_ENCODE($STRING);
}
示例2: showData
function showData($data, $con)
{
$date = $con->real_escape_string($data['startdate']);
$startdate = $_REQUEST['startdate'];
$startdate = date("Y-m-d", strtotime($startdate));
$enddate = $_REQUEST['enddate'];
// $date = $con->real_escape_string($data['enddate']);
$enddate = date("Y-m-d", strtotime($enddate));
$AWSU_values = array();
$sql = "SELECT AW.AWRD_ID,AW.AWRD_REPORT,AW.AWRD_DATE,DATE_FORMAT(CONVERT_TZ(AW.AWRD_TIMESTAMP,'+00:00','+05:30'), '%d-%m-%Y %T') AS AWRD_TIMESTAMP,ULD.ULD_LOGINID as ULD_USERSTAMP FROM ADMIN_WEEKLY_REPORT_DETAILS AW JOIN USER_LOGIN_DETAILS ULD on AW.ULD_ID=ULD.ULD_ID where AW.AWRD_DATE BETWEEN '{$startdate}' AND '{$enddate}' ORDER BY AWRD_DATE DESC";
$projectfetch = mysqli_query($con, $sql);
$AWSU_values = false;
while ($row = mysqli_fetch_array($projectfetch)) {
$awsu_report = $row['AWRD_REPORT'];
if ($awsu_report != null) {
$awsu_rprt = '';
$body_msg = explode("\n", $awsu_report);
$length = count($body_msg);
for ($i = 0; $i < $length; $i++) {
$awsu_rprt .= $body_msg[$i] . '<br>';
}
} else {
$awsu_rprt = null;
}
$awsu_id = $row['AWRD_ID'];
$awsu_date = $row['AWRD_DATE'];
$awsu_userstamp = $row["ULD_USERSTAMP"];
$awsu_timestamp = $row["AWRD_TIMESTAMP"];
$AWSU_report_values = array('report' => $awsu_rprt, 'report1' => $awsu_report, 'id' => $awsu_id, 'date' => $awsu_date, 'userstamp' => $awsu_userstamp, 'timestamp' => $awsu_timestamp);
$AWSU_values[] = $AWSU_report_values;
}
echo JSON_ENCODE($AWSU_values);
}
示例3: FORMAT
public static function FORMAT($S, $R, $P)
{
$I = array($S['s_id']);
if ($P === false) {
$TI = "AND d_date = ? LIMIT 1";
$I[] = str_replace("/", "-", $R);
} else {
$R = explode(" - ", $R);
$TI = "AND d_date >= ? AND d_date <= ? ORDER BY d_date ASC";
$I[] = str_replace("/", "-", $R[0]);
$I[] = str_replace("/", "-", $R[1]);
}
$CT = MYSQL::QUERY("SELECT * FROM core_stores_daily_checkouts WHERE s_id = ? {$TI}", $I);
$STRING = array(array('name' => 'Sales', 'data' => ''));
if (!$P === false) {
foreach ($CT as $CL) {
$T = Date_UTC($CL['d_date']);
$Total = $CL['d_gross_nontaxable'] + $CL['d_gross_taxable'];
$STRING[0]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $Total;
}
} else {
$T = Date_UTC($CT['d_date']);
$Total = $CT['d_gross_nontaxable'] + $CT['d_gross_taxable'];
$STRING[0]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $Total;
}
if ($P === false) {
$STRING[0]['type'] = 'column';
}
echo JSON_ENCODE($STRING);
}
示例4: productsUpdateAction
function productsUpdateAction(Request $request, Application $app)
{
$em = $app['orm.em'];
$categoryRepository = $em->getRepository('Category');
$categories = $categoryRepository->findAll();
$categoriesPresentation = array();
foreach ($categories as $category) {
$keys = $category->getItems()->getKeys();
array_push($categoriesPresentation, array('id' => $category->getId(), 'title' => $category->getTitle(), 'summary' => $category->getSummary(), 'photo' => $category->getItems()->get(array_rand($keys))->getPhoto()));
}
return JSON_ENCODE($categoriesPresentation);
}
示例5: FORMAT
public static function FORMAT($S, $R, $P)
{
$I = array($S['s_id']);
if ($P === false) {
$TI = "AND d_date = ? LIMIT 1";
$I[] = str_replace("/", "-", $R);
} else {
$R = explode(" - ", $R);
$TI = "AND d_date >= ? AND d_date <= ? ORDER BY d_date ASC";
$I[] = str_replace("/", "-", $R[0]);
$I[] = str_replace("/", "-", $R[1]);
}
$CT = MYSQL::QUERY("SELECT * FROM core_stores_daily_checkouts WHERE s_id = ? {$TI}", $I);
$STRING = array(array('name' => 'Cash', 'data' => ''), array('name' => 'Check', 'data' => ''), array('name' => 'American Express', 'data' => ''), array('name' => 'Discover', 'data' => ''), array('name' => 'Master Card', 'data' => ''), array('name' => 'Visa', 'data' => ''), array('name' => 'Debit', 'data' => ''));
if (!$P === false) {
foreach ($CT as $CL) {
$T = Date_UTC($CL['d_date']);
$STRING[0]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CL['d_cash'];
$STRING[1]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CL['d_check'];
$STRING[2]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CL['d_amex'];
$STRING[3]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CL['d_discover'];
$STRING[4]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CL['d_master'];
$STRING[5]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CL['d_visa'];
$STRING[6]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CL['d_debit'];
}
} else {
$T = Date_UTC($CT['d_date']);
$STRING[0]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CT['d_cash'];
$STRING[1]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CT['d_check'];
$STRING[2]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CT['d_amex'];
$STRING[3]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CT['d_discover'];
$STRING[4]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CT['d_master'];
$STRING[5]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CT['d_visa'];
$STRING[6]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CT['d_debit'];
}
if ($P === false) {
$STRING[0]['type'] = 'column';
$STRING[1]['type'] = 'column';
$STRING[2]['type'] = 'column';
$STRING[3]['type'] = 'column';
$STRING[4]['type'] = 'column';
$STRING[5]['type'] = 'column';
$STRING[6]['type'] = 'column';
}
echo JSON_ENCODE($STRING);
}
示例6: JSON_ENCODE
$menunameradiovalues = $_GET['radio_value'];
$URSRC_basic_roleval=str_replace("_"," ",$menunameradiovalues);
$URSRC_getmenu_folder_values=URSRC_getmenu_folder($URSRC_basic_roleval);
echo JSON_ENCODE($URSRC_getmenu_folder_values);
}
//FUNCTION to get basic menus
if($_REQUEST['option']=="URSRC_tree_view_basic"){
$menunameradiovalues = $_GET['radio_value'];
$URSRC_basic_roleval=str_replace("_"," ",$menunameradiovalues);
$URSRC_getmenu_folder_values=URSRC_getmenubasic_folder1();
echo JSON_ENCODE($URSRC_getmenu_folder_values);
}
//FUNCTION TO LOAD INITIAL VALUES ROLE LST bX
if($_REQUEST['option']=="ACCESS_RIGHTS_SEARCH_UPDATE_BASICROLE"){
$URSRC_role_array=get_roles();
echo JSON_ENCODE($URSRC_role_array);
}
}
//
////function URSRC_unshare_document($loggin,$fileId){
////
//// global $con,$ClientId,$ClientSecret,$RedirectUri,$DriveScopes,$CalenderScopes,$Refresh_Token;
//// $drive = new Google_Client();
//// $drive->setClientId($ClientId);
//// $drive->setClientSecret($ClientSecret);
//// $drive->setRedirectUri($RedirectUri);
//// $drive->setScopes(array($DriveScopes,$CalenderScopes));
//// $drive->setAccessType('online');
//// $authUrl = $drive->createAuthUrl();
//// $refresh_token= $Refresh_Token;
//// $drive->refreshToken($refresh_token);
示例7: date
$admin_searchmin_date_value = $row["AWRD_DATE"];
// $min_date = date('d-m-Y',strtotime($admin_searchmin_date_value));
$min_date = date('Y-m-d', strtotime($admin_searchmin_date_value));
}
$admin_weekly_maxdate = mysqli_query($con, "SELECT MAX(AWRD_DATE) as AWRD_DATE FROM ADMIN_WEEKLY_REPORT_DETAILS");
while ($row = mysqli_fetch_array($admin_weekly_maxdate)) {
$admin_searchmin_date_value = $row["AWRD_DATE"];
// $max_date = date('d-m-Y',strtotime($admin_searchmin_date_value));
$max_date = date('Y-m-d', strtotime($admin_searchmin_date_value));
date_default_timezone_set('Asia/Kolkata');
$a_date = $admin_searchmin_date_value;
$date = new DateTime($a_date);
$date->modify('last day of this month');
$date = $date->format('d');
}
$value_array = array($errormsg_array, $min_date, $max_date, $date);
echo JSON_ENCODE($value_array);
}
if ($_REQUEST['option'] == "ADMIN WEEKLY REPORT ENTRY") {
$str = '3,7,84';
$errormsg_array = get_error_msg($str);
$comp_startdate = get_company_start_date();
$value_array = array($errormsg_array, $comp_startdate);
echo JSON_ENCODE($value_array);
}
if ($_REQUEST["option"] == "PUBLIC_HOLIDAY") {
$error = '71,93,94,96';
$error_array = get_error_msg($error);
$values_array = array($error_array);
echo JSON_ENCODE($values_array);
}
示例8: FORMAT
public static function FORMAT($S, $R, $P)
{
$I = array($S['s_id']);
if ($P === false) {
$TI = "AND d_date = ? LIMIT 1";
$I[] = str_replace("/", "-", $R);
} else {
$R = explode(" - ", $R);
$TI = "AND d_date >= ? AND d_date <= ? ORDER BY d_date ASC";
$I[] = str_replace("/", "-", $R[0]);
$I[] = str_replace("/", "-", $R[1]);
}
$CT = MYSQL::QUERY("SELECT * FROM core_stores_daily_tickets WHERE s_id = ? {$TI}", $I);
$AE = MYSQL::QUERY("SELECT * FROM core_stores_daily_accepts WHERE s_id = ? {$TI}", $I);
$WT = MYSQL::QUERY("SELECT * FROM core_stores_daily_walkouts WHERE s_id = ? {$TI}", $I);
$CD = MYSQL::QUERY("SELECT * FROM core_stores_daily_checkouts WHERE s_id = ? {$TI}", $I);
$RD = MYSQL::QUERY("SELECT * FROM core_stores_daily_repairs WHERE s_id = ? {$TI}", $I);
$CC = MYSQL::QUERY("SELECT * FROM core_stores_daily_customers WHERE s_id = ? {$TI}", $I);
$STRING = array(array('name' => 'Created Tickets', 'data' => ''), array('name' => 'Accepted Estimates', 'data' => ''), array('name' => 'Walked Out Tickets', 'data' => ''), array('name' => 'Checked Out Tickets', 'data' => ''), array('name' => 'Repaired Devices', 'data' => ''), array('name' => 'Customer Accounts Created', 'data' => ''));
if (!$P === false) {
foreach ($CT as $CL) {
$T = Date_UTC($CL['d_date']);
$STRING[0]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CL['d_key'];
}
foreach ($AE as $A) {
$T = Date_UTC($A['d_date']);
$STRING[1]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $A['d_key'];
}
foreach ($WT as $W) {
$T = Date_UTC($W['d_date']);
$STRING[2]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $W['d_key'];
}
foreach ($CD as $C) {
$T = Date_UTC($C['d_date']);
$STRING[3]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $C['d_key'];
}
foreach ($RD as $R) {
$T = Date_UTC($R['d_date']);
$STRING[4]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $R['d_key'];
}
foreach ($CC as $C) {
$T = Date_UTC($C['d_date']);
$STRING[5]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $C['d_key'];
}
} else {
$T = Date_UTC($CT['d_date']);
$STRING[0]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CT['d_key'];
$STRING[1]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $AE['d_key'];
$STRING[2]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $WT['d_key'];
$STRING[3]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CD['d_key'];
$STRING[4]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $RD['d_key'];
$STRING[5]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CC['d_key'];
}
if ($P === false) {
$STRING[0]['type'] = 'column';
$STRING[1]['type'] = 'column';
$STRING[2]['type'] = 'column';
$STRING[3]['type'] = 'column';
$STRING[4]['type'] = 'column';
$STRING[5]['type'] = 'column';
}
echo JSON_ENCODE($STRING);
}
示例9: getImages
function getImages()
{
if (isset($_POST["ObjectId"])) {
$images = Resources::getImage($_POST["ObjectId"]);
for ($i = 0; $i < count($images); $i++) {
$images[$i]["ImageBlob"] = base64_encode($images[$i]["ImageBlob"]);
}
$object = new stdClass();
$object->Images = $images;
echo JSON_ENCODE($this->utf8ize($object));
}
}
示例10: actionList
protected function actionList()
{
if (count($this->routes) > 0) {
$id = array_shift($this->routes);
$file = $this->dir . $id . self::jsonExtension;
if (is_file($file)) {
return file_get_contents($file);
}
return notFound();
}
$page = (int) $this->get(self::getPage, 1);
if ($page == 0) {
$page = 1;
}
$start = ($page - 1) * self::pageSize;
$end = $start + self::pageSize;
$items = [];
$c = 0;
$this->readDirectory(function ($file) use(&$c, &$items, $start, $end) {
if ($c >= $start && $c < $end) {
$items[] = json_decode(file_get_contents($this->dir . $file), true);
}
$c++;
});
header('Content-type: text/json');
return JSON_ENCODE(['items' => $items, '_meta' => ['page' => $page, 'total' => $c, 'pages' => ceil($c / self::pageSize)]]);
}
示例11: mysqli_query
}
} else {
$checkintime = null;
}
$checkouttime = mysqli_query($con, "select ECIOD_CHECK_OUT_TIME from EMPLOYEE_CHECK_IN_OUT_DETAILS where ECIOD_DATE='{$date}' and ULD_ID='{$ADM_userstamp_id}'");
$checkoutrow = mysqli_num_rows($checkouttime);
if ($checkoutrow > 0) {
if ($checkoutrow = mysqli_fetch_array($checkouttime)) {
$check_out_time = $checkoutrow["ECIOD_CHECK_OUT_TIME"];
}
} else {
$check_out_time = null;
}
$allvalues = array($final_values, $checkintime, $err_msg, $date, $check_out_time, $login_id_role, $ip_check_flag);
// mysqli_close($con);
echo JSON_ENCODE($allvalues);
} catch (mysqli_sql_exception $e) {
echo $e->getMessage();
}
} else {
if ($_REQUEST['option'] == 'CLOCK') {
global $con;
$check_in_out_location = $_REQUEST['location'];
$btn_value = $_REQUEST['btn_value'];
$date = date('Y-m-d');
$checkintime = date("G:i:s", time());
$checkouttime = date("G:i:s", time());
$uld_id = mysqli_query($con, "select ULD_ID from USER_LOGIN_DETAILS where ULD_LOGINID='{$USERSTAMP}'");
while ($row = mysqli_fetch_array($uld_id)) {
$ure_uld_id = $row["ULD_ID"];
}
示例12: while
}
if($_REQUEST['option']=="search")
{
$loginid=$_REQUEST['empid'];
$uld_id=mysqli_query($con,"select ULD_ID from VW_TS_ALL_EMPLOYEE_DETAILS where EMPLOYEE_NAME='$loginid'");
while($row=mysqli_fetch_array($uld_id)){
$TH_uld_id=$row["ULD_ID"];
}
$result = $con->query("CALL SP_TS_USER_ADMIN_REPORT_DETAILS_TICKLER_DATA('$TH_uld_id','$USERSTAMP',@TEMP_UARD_TICKLER_HISTORY)");
if(!$result) die("CALL failed: (" . $con->errno . ") " . $con->error);
$select = $con->query('SELECT @TEMP_UARD_TICKLER_HISTORY');
$result = $select->fetch_assoc();
$temp_tickler_history= $result['@TEMP_UARD_TICKLER_HISTORY'];
$TH_values=array();
$sqlquery=mysqli_query($con,"SELECT EVENT_TYPE,TABLE_NAME,TH_OLD_VALUE,TH_NEW_VALUE,TH_USERSTAMP,DATE_FORMAT(CONVERT_TZ(TH_TIMESTAMP,'+00:00','+08:00'),'%d-%m-%Y %T') AS T_TIMESTAMP FROM $temp_tickler_history ORDER BY TH_TIMESTAMP DESC ");
while($row=mysqli_fetch_array($sqlquery)){
$TH_eventtype=$row["EVENT_TYPE"];
$TH_tblename=$row["TABLE_NAME"];
$TH_oldvalue=$row['TH_OLD_VALUE'];
$TH_oldvalue=htmlspecialchars($TH_oldvalue);
$TH_newvalue=$row['TH_NEW_VALUE'];
$TH_newvalue=htmlspecialchars($TH_newvalue);
$TH_userstamp=$row['TH_USERSTAMP'];
$TH_timestamp=$row['T_TIMESTAMP'];
$TH_values[]=(object)['tptype'=>$TH_eventtype,'ttipdata'=>$TH_tblename,'oldvalue'=>$TH_oldvalue,'newvalue'=>$TH_newvalue,'userstamp'=>$TH_userstamp,'timestamp'=>$TH_timestamp];
}
$drop_query="DROP TABLE $temp_tickler_history ";
mysqli_query($con,$drop_query);
echo JSON_ENCODE($TH_values);
}
?>
示例13: while
while ($row = mysqli_fetch_array($URSRC_select_basicrole_result)) {
$URSRC_basicrole = $row["URC_DATA"];
}
$URSRC_basicroleid_array_result = mysqli_query($con, "select * from LMC_USER_RIGHTS_CONFIGURATION URC,LMC_BASIC_ROLE_PROFILE BRP where URC.URC_DATA='" . $URSRC_basicrole . "' and URC.URC_ID=BRP.URC_ID");
$URSRC_basicroleid_array = array();
while ($row = mysqli_fetch_array($URSRC_basicroleid_array_result)) {
$URSRC_basicroleid_array[] = $row["BRP_BR_ID"];
}
$get_URSRC_basicrole_profile_array = array();
for ($i = 0; $i < count($URSRC_basicroleid_array); $i++) {
$URSRC_basicrole_profile_array_result = mysqli_query($con, "select * from LMC_USER_RIGHTS_CONFIGURATION URC,LMC_BASIC_ROLE_PROFILE BRP where BRP.BRP_BR_ID=URC.URC_ID and BRP.BRP_BR_ID='" . $URSRC_basicroleid_array[$i] . "' order by URC_DATA asc ");
while ($row = mysqli_fetch_array($URSRC_basicrole_profile_array_result)) {
$get_URSRC_basicrole_profile_array[] = $row["URC_DATA"];
}
}
$get_URSRC_basicrole_profile_array = array_values(array_unique($get_URSRC_basicrole_profile_array));
$comp_startdate = get_company_start_date();
$value_array = array($get_rolecreation_array, $get_project_array, $get_menuname_array, $get_URSRC_basicrole_profile_array, $URSRC_errmsg, $get_emptype_array, $comp_startdate, $get_team_array);
echo JSON_ENCODE($value_array);
}
if ($_REQUEST["option"] == "EMAIL_TEMPLATE_ENTRY") {
$error = '71,85,86';
$error_array = get_error_msg($error);
$values_array = array($error_array);
echo JSON_ENCODE($values_array);
}
if ($_REQUEST["option"] == "RESET_FORM") {
$str = '20,138,139';
$URSRC_errmsg = get_error_msg($str);
echo JSON_ENCODE($URSRC_errmsg);
}
示例14: strtotime
if($_REQUEST['option']=="CLK_loginid_searchoption")
{
// $CLK_loginid=$_REQUEST['CLK_loginid'];
$CLK_mnthyrval=$_REQUEST['CLK_monthyear'];
// echo $CLK_mnthyrval;
// $CLK_start_value = date('Y-m-d',strtotime($CLK_mnthyrval));
$final_start=date('Y-m-01', strtotime($CLK_mnthyrval));
// echo $final_start;
$final_end=date('Y-m-t', strtotime($CLK_mnthyrval));
// echo $final_end;
// echo "SELECT COUNT(*) AS CLOCK_OUTMISSED FROM EMPLOYEE_CHECK_IN_OUT_DETAILS WHERE ECIOD_DATE BETWEEN '$final_start' AND '$final_end' AND ECIOD_CHECK_OUT_LOCATION IS NULL AND ULD_ID='$CLK_loginid'";
$CLK_flextbl= mysqli_query($con,"SELECT DATE_FORMAT(ECIOD_DATE,'%d-%m-%Y') AS ECIOD_DATE FROM EMPLOYEE_CHECK_IN_OUT_DETAILS WHERE ECIOD_DATE BETWEEN '$final_start' AND '$final_end' AND ECIOD_FLAG='X' AND ULD_ID='$uld_id'");
$CLK_COUNT= mysqli_query($con,"SELECT COUNT(*) AS CLOCK_OUTMISSED FROM EMPLOYEE_CHECK_IN_OUT_DETAILS WHERE ECIOD_DATE BETWEEN '$final_start' AND '$final_end' AND ECIOD_FLAG='X' AND ULD_ID='$uld_id'");
$CLK_values=array();
$ET_count_values=array();
while($row=mysqli_fetch_array($CLK_flextbl)){
$CLK_count=$row["ECIOD_DATE"];
$final_values=(object) ['date'=>$CLK_count];
$CLK_values[]=$final_values;
}
while($row=mysqli_fetch_array($CLK_COUNT)){
$CLK_missedcount=$row["CLOCK_OUTMISSED"];
$final_values_count=(object) ['count'=>$CLK_missedcount];
$ET_count_values[]=$final_values_count;
}
$variable=array($CLK_values,$ET_count_values);
echo JSON_ENCODE($variable);
}
}
示例15: date
// }
$fromdate = date('Y-m-d', strtotime($fdate));
$todate = date('Y-m-d', strtotime($tdate));
$ure_date_array = array();
if ($ADM_uld_id != 'SELECT') {
$sql = mysqli_query($con, "SELECT DISTINCT DATE_FORMAT(UARD_DATE,'%d-%m-%Y') AS UARD_DATE FROM USER_ADMIN_REPORT_DETAILS WHERE UARD_DATE BETWEEN '{$fromdate}' AND '{$todate}' AND ULD_ID={$ADM_uld_id} ORDER BY UARD_DATE");
while ($row = mysqli_fetch_array($sql)) {
$ure_date_array[] = $row["UARD_DATE"];
}
} else {
$sql = mysqli_query($con, "SELECT DISTINCT DATE_FORMAT(UARD_DATE,'%d-%m-%Y') AS UARD_DATE FROM USER_ADMIN_REPORT_DETAILS WHERE UARD_DATE BETWEEN '{$fromdate}' AND '{$todate}' ORDER BY UARD_DATE");
while ($row = mysqli_fetch_array($sql)) {
$ure_date_array[] = $row["UARD_DATE"];
}
}
echo JSON_ENCODE($ure_date_array);
}
if ($_REQUEST['option'] == 'ALLEMPDATE') {
$mindate = mysqli_query($con, "SELECT MIN(UARD_DATE) as UARD_DATE FROM USER_ADMIN_REPORT_DETAILS ORDER BY UARD_DATE");
while ($row = mysqli_fetch_array($mindate)) {
$allmindate = $row["UARD_DATE"];
}
$allmindate = date('d-m-Y', strtotime($allmindate));
echo $allmindate;
}
if ($_REQUEST['option'] == 'PRESENT') {
$emptyflag = 0;
$rprtdate = $_REQUEST['reportdate'];
$ure_uld_id = $_REQUEST['loginid'];
$rprtdate = date('Y-m-d', strtotime($rprtdate));
$uld_id = mysqli_query($con, "select ULD_LOGINID from USER_LOGIN_DETAILS where ULD_ID='{$ure_uld_id}'");