コード例 #1
0
if (isset($_POST['search'])) {
    $stardate = $_POST['startdate'];
    $enddate = $_POST['enddate'];
    $received_name = $_POST['received_name'];
    $received_facts = $_POST['facts'];
    $received_no = $_POST['received_no'];
    $selStatus = $_POST['selStatus'];
    // ............put into array
    $array['stardate'] = $stardate;
    $array['enddate'] = $enddate;
    $array['received_no'] = $received_no;
    $array['received_name'] = $received_name;
    $array['received_facts'] = $received_facts;
    $array['selStatus'] = $selStatus;
    $array['order_type'] = $_SESSION['sess_order_type'];
    $search_result = searchOrder($array, $db);
    if (!empty($search_result)) {
        for ($i = 0; $i < count($search_result); $i++) {
            echo "<tr>";
            echo "<td><a href='" . ROOT . "order_detail.php?ordid=" . $search_result[$i]['order_id'] . "'>" . $search_result[$i]['order_uid'] . "</a></td>";
            echo "<td>" . $search_result[$i]['order_date'] . "</td>";
            echo "<td>" . $search_result[$i]['order_dept'] . "</td>";
            echo "<td>" . $search_result[$i]['responsible_person'] . "</td>";
            echo "<td>" . $search_result[$i]['company_name'] . "</td>";
            echo "<td>" . $search_result[$i]['client_user_name'] . "</td>";
            $rflist = getRfById($search_result[$i]['order_id'], $db);
            echo "<td>";
            if (empty($rflist)) {
                echo "-";
            } else {
                for ($a = 0; $a < count($rflist); $a++) {
コード例 #2
0
ファイル: index.php プロジェクト: mayliupeng/weixin
    //echo "当前目录中,文件".$cacheFile.".json存在";
    $modifyFile = filemtime($nowCacheJsonFile);
    $createFile = filectime($nowCacheJsonFile);
    $nowtime = time();
    //echo (date("Y-m-d H:i:s",$changFile));
    //echo $nowtime-$modifyFile;
    //if (($nowtime-$modifyFile)/3600 < 1) {//缓存时间为1小时
    if (($nowtime - $modifyFile) / 86400 < 3) {
        //缓存时间为3天
        $cacheDataJson = json_decode(file_get_contents($cacheDir . $cacheFile . ".json"));
        customJsonRes('304', 'cache', $cacheDataJson, date("Y-m-d H:i:s", $modifyFile));
    } else {
        searchOrder($sId, $sqlsAll, $sqlsId, $tablePubinfo, $tableId);
    }
} else {
    searchOrder($sId, $sqlsAll, $sqlsId, $tablePubinfo, $tableId);
}
//执行查询操作
function searchOrder($sId, $sqlsAll, $sqlsId, $tablePubinfo, $tableId)
{
    switch ($sId) {
        case '0':
            con_mysql_get($sqlsAll, $tablePubinfo, $tableId, $sId);
            break;
        default:
            con_mysql_get($sqlsId, $tablePubinfo, $tableId, $sId);
            break;
    }
}
//定时缓存
function apiCache($tablePubinfo, $tableId, $urlGet, $names)