• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP fromDBDate函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中fromDBDate函数的典型用法代码示例。如果您正苦于以下问题:PHP fromDBDate函数的具体用法?PHP fromDBDate怎么用?PHP fromDBDate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了fromDBDate函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: SQLInsert

        } else {
            $new_rec = 1;
            $rec['ID'] = SQLInsert($table_name, $rec);
            // adding new record
        }
        $out['OK'] = 1;
    } else {
        $out['ERR'] = 1;
    }
}
if ($rec['DUE'] != '') {
    $rec['DUE'] = fromDBDate($rec['DUE']);
}
if ($rec['ADDED'] != '') {
    $tmp = explode(' ', $rec['ADDED']);
    $out['ADDED_DATE'] = fromDBDate($tmp[0]);
    $tmp2 = explode(':', $tmp[1]);
    $added_hours = $tmp2[0];
    $added_minutes = $tmp2[1];
}
for ($i = 0; $i < 60; $i++) {
    $title = $i;
    if ($i < 10) {
        $title = "0{$i}";
    }
    if ($title == $added_minutes) {
        $out['ADDED_MINUTES'][] = array('TITLE' => $title, 'SELECTED' => 1);
    } else {
        $out['ADDED_MINUTES'][] = array('TITLE' => $title);
    }
}
开发者ID:vasvlad,项目名称:majordomo,代码行数:31,代码来源:calendar_events_edit.inc.php


示例2: Scan

    $session->data['ssdp_devices_qry'] = $qry;
}
if (!$qry) {
    $qry = "1";
}
//="ID DESC";
//$out['SORTBY']=$sortby_ssdp_devices;
// SEARCH RESULTS
$res = Scan();
if ($res[0]['ID']) {
    //paging($res, 100, $out); // search result paging
    $total = count($res);
    for ($i = 0; $i < $total; $i++) {
        // some action for every record if required
        $tmp = explode(' ', $res[$i]['UPDATED']);
        $res[$i]['UPDATED'] = fromDBDate($tmp[0]) . " " . $tmp[1];
    }
    $out['RESULT'] = $res;
}
function Scan()
{
    $upnp = new Upnp();
    print 'searching...' . PHP_EOL;
    $everything = $upnp->discover();
    $result = [];
    foreach ($everything as $device) {
        //print_r($device);  //uncomment to see all available array elements for a device.
        $info = $device['description']['device'];
        // print array_search(, array_column( $result, 'ADDRESS'));
        if (!array_search_result($result, 'UUID', $info["UDN"])) {
            $result[] = ["ID" => $info["UDN"], "TITLE" => $info["friendlyName"], "ADDRESS" => $info["presentationURL"], "UUID" => $info["UDN"], "DESCRIPTION" => is_array($info["modelDescription"]) ? implode(',', $info["modelDescription"]) : $info["modelDescription"], "TYPE" => explode(":", $info["deviceType"])[3], "LOGO" => getDefImg($info), "SERIAL" => $info["serialNumber"], "MANUFACTURERURL" => $info["manufacturerURL"], "UPDATED" => '', "MODEL" => $info["modelName"], "MANUFACTURER" => $info["manufacturer"], "IP" => getIp($info)];
开发者ID:T-REX-XP,项目名称:SSDPFinder,代码行数:31,代码来源:ssdp_devices_scan.inc.php


示例3: str_replace

if (!$qry) {
    $qry = "1";
}
// FIELDS ORDER
global $sortby_system_errors;
if (!$sortby_system_errors) {
    $sortby_system_errors = $session->data['system_errors_sort'];
} else {
    if ($session->data['system_errors_sort'] == $sortby_system_errors) {
        if (Is_Integer(strpos($sortby_system_errors, ' DESC'))) {
            $sortby_system_errors = str_replace(' DESC', '', $sortby_system_errors);
        } else {
            $sortby_system_errors = $sortby_system_errors . " DESC";
        }
    }
    $session->data['system_errors_sort'] = $sortby_system_errors;
}
$sortby_system_errors = "ACTIVE DESC, LATEST_UPDATE DESC, CODE";
$out['SORTBY'] = $sortby_system_errors;
// SEARCH RESULTS
$res = SQLSelect("SELECT * FROM system_errors WHERE {$qry} ORDER BY " . $sortby_system_errors);
if ($res[0]['ID']) {
    colorizeArray($res);
    $total = count($res);
    for ($i = 0; $i < $total; $i++) {
        // some action for every record if required
        $tmp = explode(' ', $res[$i]['LATEST_UPDATE']);
        $res[$i]['LATEST_UPDATE'] = fromDBDate($tmp[0]) . " " . $tmp[1];
    }
    $out['RESULT'] = $res;
}
开发者ID:cdkisa,项目名称:majordomo,代码行数:31,代码来源:system_errors_search.inc.php


示例4: SQLSelect

}
//options for 'USER_ID' (select)
$tmp = SQLSelect("SELECT ID, NAME FROM users ORDER BY NAME");
$users_total = count($tmp);
for ($users_i = 0; $users_i < $users_total; $users_i++) {
    $user_id_opt[$tmp[$users_i]['ID']] = $tmp[$users_i]['NAME'];
}
for ($i = 0; $i < $users_total; $i++) {
    if ($rec['USER_ID'] == $tmp[$i]['ID']) {
        $tmp[$i]['SELECTED'] = 1;
    }
}
$out['USER_ID_OPTIONS'] = $tmp;
if ($rec['UPDATED'] != '') {
    $tmp = explode(' ', $rec['UPDATED']);
    $out['UPDATED_DATE'] = fromDBDate($tmp[0]);
    $tmp2 = explode(':', $tmp[1]);
    $updated_hours = $tmp2[0];
    $updated_minutes = $tmp2[1];
}
for ($i = 0; $i < 60; $i++) {
    $title = $i;
    if ($i < 10) {
        $title = "0{$i}";
    }
    if ($title == $updated_minutes) {
        $out['UPDATED_MINUTES'][] = array('TITLE' => $title, 'SELECTED' => 1);
    } else {
        $out['UPDATED_MINUTES'][] = array('TITLE' => $title);
    }
}
开发者ID:cdkisa,项目名称:majordomo,代码行数:31,代码来源:gpsdevices_edit.inc.php


示例5: array

    }
}
for ($i = 0; $i < 24; $i++) {
    $title = $i;
    if ($i < 10) {
        $title = "0{$i}";
    }
    if ($title == $check_latest_hours) {
        $out['CHECK_LATEST_HOURS'][] = array('TITLE' => $title, 'SELECTED' => 1);
    } else {
        $out['CHECK_LATEST_HOURS'][] = array('TITLE' => $title);
    }
}
if ($rec['CHECK_NEXT'] != '') {
    $tmp = explode(' ', $rec['CHECK_NEXT']);
    $out['CHECK_NEXT_DATE'] = fromDBDate($tmp[0]);
    $tmp2 = explode(':', $tmp[1]);
    $check_next_hours = $tmp2[0];
    $check_next_minutes = $tmp2[1];
}
for ($i = 0; $i < 60; $i++) {
    $title = $i;
    if ($i < 10) {
        $title = "0{$i}";
    }
    if ($title == $check_next_minutes) {
        $out['CHECK_NEXT_MINUTES'][] = array('TITLE' => $title, 'SELECTED' => 1);
    } else {
        $out['CHECK_NEXT_MINUTES'][] = array('TITLE' => $title);
    }
}
开发者ID:sergejey,项目名称:majordomo-modbus,代码行数:31,代码来源:modbusdevices_edit.inc.php


示例6: paging

  }
  if (!$qry) $qry="1";
  // FIELDS ORDER
  global $sortby_calendar_events;
  if (!$sortby_calendar_events) {
   $sortby_calendar_events=$session->data['calendar_events_sort'];
  } else {
   if ($session->data['calendar_events_sort']==$sortby_calendar_events) {
    if (Is_Integer(strpos($sortby_calendar_events, ' DESC'))) {
     $sortby_calendar_events=str_replace(' DESC', '', $sortby_calendar_events);
    } else {
     $sortby_calendar_events=$sortby_calendar_events." DESC";
    }
   }
   $session->data['calendar_events_sort']=$sortby_calendar_events;
  }
  if (!$sortby_calendar_events) $sortby_calendar_events="ID DESC";
  $out['SORTBY']=$sortby_calendar_events;
  // SEARCH RESULTS
  $res=SQLSelect("SELECT * FROM calendar_events WHERE $qry ORDER BY ".$sortby_calendar_events);
  if ($res[0]['ID']) {
   paging($res, 50, $out); // search result paging
   colorizeArray($res);
   $total=count($res);
   for($i=0;$i<$total;$i++) {
    // some action for every record if required
    $res[$i]['DUE']=fromDBDate($res[$i]['DUE']);
   }
   $out['RESULT']=$res;
  }
?>
开发者ID:novozhenets,项目名称:majordomo,代码行数:31,代码来源:calendar_events_search.inc.php


示例7: str_replace

global $sortby_gpslog;
if (!$sortby_gpslog) {
    $sortby_gpslog = $session->data['gpslog_sort'];
} else {
    if ($session->data['gpslog_sort'] == $sortby_gpslog) {
        if (Is_Integer(strpos($sortby_gpslog, ' DESC'))) {
            $sortby_gpslog = str_replace(' DESC', '', $sortby_gpslog);
        } else {
            $sortby_gpslog = $sortby_gpslog . " DESC";
        }
    }
    $session->data['gpslog_sort'] = $sortby_gpslog;
}
if (!$sortby_gpslog) {
    $sortby_gpslog = "gpslog.ID DESC";
}
$out['SORTBY'] = $sortby_gpslog;
// SEARCH RESULTS
$res = SQLSelect("SELECT gpslog.*, gpsdevices.TITLE as DEVICE_TITLE, gpslocations.TITLE as LOCATION_TITLE FROM gpslog LEFT JOIN gpsdevices ON gpsdevices.ID=gpslog.DEVICE_ID LEFT JOIN gpslocations ON gpslocations.ID=gpslog.LOCATION_ID WHERE {$qry} ORDER BY " . $sortby_gpslog);
if ($res[0]['ID']) {
    paging($res, 50, $out);
    // search result paging
    colorizeArray($res);
    $total = count($res);
    for ($i = 0; $i < $total; $i++) {
        // some action for every record if required
        $tmp = explode(' ', $res[$i]['ADDED']);
        $res[$i]['ADDED'] = fromDBDate($tmp[0]) . " " . $tmp[1];
    }
    $out['RESULT'] = $res;
}
开发者ID:vasvlad,项目名称:majordomo,代码行数:31,代码来源:gpslog_search.inc.php


示例8: SQLSelect

}
//options for 'SCRIPT_ID' (select)
$tmp = SQLSelect("SELECT ID, TITLE FROM scripts ORDER BY TITLE");
$scripts_total = count($tmp);
for ($scripts_i = 0; $scripts_i < $scripts_total; $scripts_i++) {
    $script_id_opt[$tmp[$scripts_i]['ID']] = $tmp[$scripts_i]['TITLE'];
}
for ($i = 0; $i < $scripts_total; $i++) {
    if ($rec['SCRIPT_ID'] == $tmp[$i]['ID']) {
        $tmp[$i]['SELECTED'] = 1;
    }
}
$out['SCRIPT_ID_OPTIONS'] = $tmp;
if ($rec['EXECUTED'] != '') {
    $tmp = explode(' ', $rec['EXECUTED']);
    $out['EXECUTED_DATE'] = fromDBDate($tmp[0]);
    $tmp2 = explode(':', $tmp[1]);
    $executed_hours = $tmp2[0];
    $executed_minutes = $tmp2[1];
}
for ($i = 0; $i < 60; $i++) {
    $title = $i;
    if ($i < 10) {
        $title = "0{$i}";
    }
    if ($title == $executed_minutes) {
        $out['EXECUTED_MINUTES'][] = array('TITLE' => $title, 'SELECTED' => 1);
    } else {
        $out['EXECUTED_MINUTES'][] = array('TITLE' => $title);
    }
}
开发者ID:cdkisa,项目名称:majordomo,代码行数:31,代码来源:gpsactions_edit.inc.php


示例9: str_replace

    $sortby = $session->data['events_sort'];
} else {
    if ($session->data['events_sort'] == $sortby) {
        if (Is_Integer(strpos($sortby, ' DESC'))) {
            $sortby = str_replace(' DESC', '', $sortby);
        } else {
            $sortby = $sortby . " DESC";
        }
    }
    $session->data['events_sort'] = $sortby;
}
if (!$sortby) {
    $sortby = "ID DESC";
}
$out['SORTBY'] = $sortby;
// SEARCH RESULTS
$res = SQLSelect("SELECT * FROM events WHERE {$qry} ORDER BY {$sortby}");
if ($res[0]['ID']) {
    paging($res, 50, $out);
    // search result paging
    colorizeArray($res);
    $total = count($res);
    for ($i = 0; $i < $total; $i++) {
        // some action for every record if required
        $tmp = explode(' ', $res[$i]['ADDED']);
        $res[$i]['ADDED'] = fromDBDate($tmp[0]) . " " . $tmp[1];
        $tmp = explode(' ', $res[$i]['EXPIRE']);
        $res[$i]['EXPIRE'] = fromDBDate($tmp[0]) . " " . $tmp[1];
    }
    $out['RESULT'] = $res;
}
开发者ID:cdkisa,项目名称:majordomo,代码行数:31,代码来源:events_search.inc.php


示例10: SQLInsert

            // update
        } else {
            $new_rec = 1;
            $rec['ID'] = SQLInsert($table_name, $rec);
            // adding new record
        }
        $out['OK'] = 1;
    } else {
        $out['ERR'] = 1;
    }
}
// step: default
if ($this->tab == '') {
    if ($rec['LATEST_UPDATE'] != '') {
        $tmp = explode(' ', $rec['LATEST_UPDATE']);
        $out['LATEST_UPDATE_DATE'] = fromDBDate($tmp[0]);
        $tmp2 = explode(':', $tmp[1]);
        $latest_update_hours = $tmp2[0];
        $latest_update_minutes = $tmp2[1];
    }
    for ($i = 0; $i < 60; $i++) {
        $title = $i;
        if ($i < 10) {
            $title = "0{$i}";
        }
        if ($title == $latest_update_minutes) {
            $out['LATEST_UPDATE_MINUTES'][] = array('TITLE' => $title, 'SELECTED' => 1);
        } else {
            $out['LATEST_UPDATE_MINUTES'][] = array('TITLE' => $title);
        }
    }
开发者ID:cdkisa,项目名称:majordomo,代码行数:31,代码来源:system_errors_edit.inc.php


示例11: str_replace

if (!$qry) {
    $qry = "1";
}
// FIELDS ORDER
global $sortby_gpsactions;
if (!$sortby_gpsactions) {
    $sortby_gpsactions = $session->data['gpsactions_sort'];
} else {
    if ($session->data['gpsactions_sort'] == $sortby_gpsactions) {
        if (Is_Integer(strpos($sortby_gpsactions, ' DESC'))) {
            $sortby_gpsactions = str_replace(' DESC', '', $sortby_gpsactions);
        } else {
            $sortby_gpsactions = $sortby_gpsactions . " DESC";
        }
    }
    $session->data['gpsactions_sort'] = $sortby_gpsactions;
}
$sortby_gpsactions = "gpsactions.LOCATION_ID, gpsactions.USER_ID, ACTION_TYPE";
$out['SORTBY'] = $sortby_gpsactions;
// SEARCH RESULTS
$res = SQLSelect("SELECT gpsactions.*, gpslocations.TITLE as LOCATION_TITLE, users.NAME as USER_NAME, scripts.TITLE as SCRIPT_TITLE FROM gpsactions LEFT JOIN gpslocations ON gpslocations.ID=gpsactions.LOCATION_ID LEFT JOIN users ON gpsactions.USER_ID=users.ID LEFT JOIN scripts ON scripts.ID=gpsactions.SCRIPT_ID WHERE {$qry} ORDER BY " . $sortby_gpsactions);
if ($res[0]['ID']) {
    colorizeArray($res);
    $total = count($res);
    for ($i = 0; $i < $total; $i++) {
        // some action for every record if required
        $tmp = explode(' ', $res[$i]['EXECUTED']);
        $res[$i]['EXECUTED'] = fromDBDate($tmp[0]) . " " . $tmp[1];
    }
    $out['RESULT'] = $res;
}
开发者ID:cdkisa,项目名称:majordomo,代码行数:31,代码来源:gpsactions_search.inc.php


示例12:

  } else {
   $out['ADDED_MINUTES'][]=array('TITLE'=>$title);
  }
 }
 for($i=0;$i<24;$i++) {
  $title=$i;
  if ($i<10) $title="0$i";
  if ($title==$added_hours) {
   $out['ADDED_HOURS'][]=array('TITLE'=>$title, 'SELECTED'=>1);
  } else {
   $out['ADDED_HOURS'][]=array('TITLE'=>$title);
  }
 }
 if ($rec['EXPIRE']!='') {
  $tmp=explode(' ', $rec['EXPIRE']);
  $out['EXPIRE_DATE']=fromDBDate($tmp[0]);
  $tmp2=explode(':', $tmp[1]);
  $expire_hours=$tmp2[0];
  $expire_minutes=$tmp2[1];
 }
 for($i=0;$i<60;$i++) {
  $title=$i;
  if ($i<10) $title="0$i";
  if ($title==$expire_minutes) {
   $out['EXPIRE_MINUTES'][]=array('TITLE'=>$title, 'SELECTED'=>1);
  } else {
   $out['EXPIRE_MINUTES'][]=array('TITLE'=>$title);
  }
 }
 for($i=0;$i<24;$i++) {
  $title=$i;
开发者ID:novozhenets,项目名称:majordomo,代码行数:31,代码来源:events_edit.inc.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP fromMySQLDate函数代码示例发布时间:2022-05-15
下一篇:
PHP from函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap