order meeting room - 离散度30min

w

<meta charset="UTF-8">
<?php
include(‘conn.php‘);
include(‘w_fun.php‘);
include(‘config_lang.php‘);
include(‘w_fun_this_project.php‘);
$sql = ‘SET GLOBAL  connect_timeout=31536000‘;
mysqli_query($link, $sql);
$wclock0 = 8;
$wclock1 = 21;

$wtoday = date(‘Y-m-d‘);
$wts = strtotime($wtoday);
$wts += $wclock0 * 3600;
echo $wts . ‘<br>‘;

$sql = ‘SELECT * FROM room_order WHERE wstart>‘ . $wts . ‘  ORDER  BY wstart  ASC‘;
var_dump($sql);

$wts = strtotime($wtoday);
$wts += $wclock1 * 3600;
echo $wts . ‘<br>‘;

$wrows = db_multiple_rows_link($link, $sql);

echo ‘<br>-------------------------------db<br>‘;
foreach ($wrows AS $one) {
    //var_dump($one);
    echo ‘<br>‘;
    $date = date(‘Y_m_d‘, $one[‘wstart‘]);
    $dateb = date(‘H:i‘, $one[‘wstart‘]);
    $ws = intval(date(‘Hi‘, $one[‘wstart‘]));
    echo ‘<br>‘ . $date;
    echo ‘<br>‘ . $dateb;
    echo ‘<br>‘ . $ws;

    $date = date(‘Y_m_d‘, $one[‘wend‘]);
    $dateb = date(‘H:i‘, $one[‘wend‘]);
    $we = intval(date(‘Hi‘, $one[‘wend‘]));
    echo ‘<br>‘ . $date;
    echo ‘<br>‘ . $dateb;
    echo ‘<br>‘ . $we;
    $wcount = floor(($we - $ws) / 30);
    echo ‘<br>‘ . $wcount;
    for ($w = $wclock0; $w < $wclock1; $w++) {

        $wn = ‘w‘ . $date . ‘ws‘ . ($w * 100);
        $wv = ‘w‘;
        if ($ws >= ($w - 1) * 100 && $ws < ($w * 100 + 30)) {
            $wv = $one[‘id‘] . ‘@[email protected]‘ . $one[‘sysuser‘];
        }
        wjs_cookie($wn, $wv);
        $wn = ‘w‘ . $date . ‘we‘ . ($w * 100);
        $wv = ‘w‘;
        if ($we >= ($w - 1) * 100 && $we < ($w * 100 + 30)) {
            $wv = $one[‘id‘] . ‘@[email protected]‘ . $one[‘sysuser‘];
        }
        wjs_cookie($wn, $wv);

        $wn = ‘w‘ . $date . ‘ws‘ . ($w * 100 + 30);
        $wv = ‘w‘;
        if ($ws >= ($w * 100 + 30) && $ws < ($w + 1) * 100) {
            $wv = $one[‘id‘] . ‘@[email protected]‘ . $one[‘sysuser‘];
        }
        wjs_cookie($wn, $wv);
        $wn = ‘w‘ . $date . ‘we‘ . ($w * 100 + 30);
        $wv = ‘w‘;
        if ($we >= ($w * 100 + 30) && $we < ($w + 1) * 100) {
            $wv = $one[‘id‘] . ‘@[email protected]‘ . $one[‘sysuser‘];
        }
        wjs_cookie($wn, $wv);

    }
}

function wjs_cookie($wn, $wv)
{

    echo ‘<script>document.cookie="‘ . $wn . ‘=‘ . $wv . ‘";</script>‘;
}

echo ‘<br>-------------------------------wcookie<br>‘;
//var_dump($_COOKIE);

$sql = ‘SELECT MAX(wstart) AS wmaxdate FROM room_order ‘;
var_dump($sql);
$wmaxdate = db_single_row_single_field_link($link, $sql, ‘wmaxdate‘);
$wts = strtotime($wtoday);
//$wmaxdate  = date(‘Y_m_d‘, $wmaxdate );
echo ‘<br>‘ . $wmaxdate . ‘<br>‘;

$sql = ‘SELECT MIN(wstart) AS wmindate FROM room_order ‘;
var_dump($sql);
$wmindate = db_single_row_single_field_link($link, $sql, ‘wmindate‘);
$wts = strtotime($wtoday);
//$wmindate  = date(‘Y_m_d‘, $wmindate);
//echo   ‘<br>‘.$wmindate .‘<br>‘;
$wdays = ceil(($wmaxdate - $wmindate) / (24 * 3600));
var_dump($wdays);

?>
<script>
    console.log(document.cookie);
</script>
<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>order room - 离散度30min </title>
    <link rel="stylesheet" href="static/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="static/bootstrap/css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="static/base.css">
    <script src="static/jquery-3.1.0.min.js"></script>
</head>
<body>
<?php
$wtr = ‘<table class="table table-striped">
<tr><td>日期</td><td>会议室编号</td><td>会议室名称</td>‘;
for ($w = $wclock0; $w < $wclock1; $w++) {

    $wtr .= ‘<td>‘ . $w . ‘:00</td>‘;
    $wtr .= ‘<td>‘ . $w . ‘:30</td>‘;
}

$wtr .= ‘<td>‘ . $wclock1 . ‘:00</td></tr>‘;

for ($wtab = 0; $wtab < $wdays; $wtab++) {
    $wtr .= ‘<tr><td>‘ . date(‘Y-m-d‘, $wrows[$wtab][‘wstart‘]) . ‘</td><td>会议室编号12</td><td>会议室名称124</td>‘;
    for ($w = $wclock0; $w < $wclock1; $w++) {
        $wtr .= ‘<td>‘ . ‘wwr‘ . ‘:00</td>‘;
    }
    $wtr .= ‘</tr>‘;
}

$wtr .= ‘</table>‘;
echo $wtr;
?>

</body>
</html>
时间: 2024-10-25 16:38:11

order meeting room - 离散度30min的相关文章

HDU 5521.Meeting 最短路模板题

Meeting Time Limit: 12000/6000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 3361    Accepted Submission(s): 1073 Problem Description Bessie and her friend Elsie decide to have a meeting. However, after Farmer Jo

luogu P3116 [USACO15JAN]会议时间Meeting Time

题目描述 Bessie and her sister Elsie want to travel from the barn to their favorite field, such that they leave at exactly the same time from the barn, and also arrive at exactly the same time at their favorite field. The farm is a collection of N fields

hdu-5521 Meeting(最短路)

题目链接: Meeting Time Limit: 12000/6000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 2024    Accepted Submission(s): 628 Problem Description Bessie and her friend Elsie decide to have a meeting. However, after Farm

Meeting 加虚拟边

Bessie and her friend Elsie decide to have a meeting. However, after Farmer John decorated his fences they were separated into different blocks. John's farm are divided into nn blocks labelled from 11 to nn. Bessie lives in the first block while Elsi

codeforces 782B The Meeting Place Cannot Be Changed+hdu 4355+hdu 2438 (三分)

B. The Meeting Place Cannot Be Changed The main road in Bytecity is a straight line from south to north. Conveniently, there are coordinates measured in meters from the southernmost building in north direction. At some points on the road there are n

3890: [Usaco2015 Jan]Meeting Time( dp )

简单的拓扑图dp.. A(i, j), B(i, j) 表示从点 i 长度为 j 的两种路径是否存在. 用bitset就行了 时间复杂度O(m) ---------------------------------------------------------------- #include<bits/stdc++.h> #define clr(x, c) memset(x, c, sizeof(x)) #define rep(i, n) for(int i = 0; i < n; ++

P3116 [USACO15JAN]会议时间Meeting Time

P3116 [USACO15JAN]会议时间Meeting Time 题目描述 Bessie and her sister Elsie want to travel from the barn to their favorite field, such that they leave at exactly the same time from the barn, and also arrive at exactly the same time at their favorite field. T

HDU 5521 Meeting(虚拟节点+最短路)

Meeting Time Limit: 12000/6000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 1358    Accepted Submission(s): 435 Problem Description Bessie and her friend Elsie decide to have a meeting. However, after Farmer Jo

Technical Committee Weekly Meeting 2016.06.21

Meeting time: 2016.June.21 1:00~2:00 Chairperson:  Thierry Carrez Meeting summary: 1.Add current house rules for reference This lists exceptions to the formal votes for various changes in the openstack/governance repository. It corresponds to house r