function printbody($forecast)
{
    function printdate($datetime)
    {
        return date('n月j日', $datetime) . ' ' . getday($datetime);
    }
    $date = getdatetime($forecast['date_y'], $forecast['fchh']);
    $images = getimageurl($forecast);
    $length = 7;
    $body = "<ul>\n<li>" . date('Y-m-d H时', $date) . "发布</li><br />\n";
    if ($forecast['fchh'] == '18') {
        $date += 86400;
        $forecast = fixforecast($forecast);
        $length = 6;
    }
    for ($i = 1; $i < $length; $i++) {
        $body .= '<li>' . printdate($date) . "<br />";
        $body .= '<img src="' . $images[$i * 2 - 1] . '" /><img src="' . $images[$i * 2] . "\" /><br />";
        $body .= "{$forecast["weather{$i}"]} {$forecast["temp{$i}"]}<br />{$forecast["wind{$i}"]}</li><br />\n";
        $date += 86400;
    }
    return $body;
}
示例#2
0
文件: users.php 项目: grimelinse/cmum
}
while ($res = $sql->fetch_array()) {
    $usrexp = checkstartexpire($res["startdate"], $res["expiredate"], $res["enabled"]);
    print "<tr>";
    if ($res["admin"] == "1") {
        print "<td>" . $res["user"] . " <span class=\"label label-warning\">A</span></td>";
    } else {
        print "<td>" . $res["user"] . "</td>";
    }
    print "<td>" . $res["displayname"] . "</td>";
    if ($setres["extrausrtbl"] == "1") {
        print "<td>" . $res["password"] . "</td>";
    } elseif ($setres["extrausrtbl"] == "2") {
        print "<td>" . printdate($res["startdate"]) . "</td>";
    } elseif ($setres["extrausrtbl"] == "3") {
        print "<td>" . printdate($res["expiredate"]) . "</td>";
    } elseif ($setres["extrausrtbl"] == "4") {
        print "<td>" . idtoadmin($res["addedby"]) . "</td>";
    }
    print "<td>" . idtogrp($res["usrgroup"]) . "</td>";
    if ($usrexp == "0") {
        print "<td><a id=\"usrlnkenabled-" . $res["id"] . "\" href=\"javascript:void(0);\" onclick=\"enableuser('" . $res["id"] . "','" . $_SESSION[$secretkey . "userlvl"] . "','" . $_SESSION[$secretkey . "usergrp"] . "','" . $_SESSION[$secretkey . "userid"] . "');\"><div id=\"usrenabled-" . $res["id"] . "\"><span class=\"label label-important\">Disabled</span></div></a></td>";
    } elseif ($usrexp == "1") {
        print "<td><a id=\"usrlnkenabled-" . $res["id"] . "\" href=\"javascript:void(0);\" onclick=\"disableuser('" . $res["id"] . "','" . $_SESSION[$secretkey . "userlvl"] . "','" . $_SESSION[$secretkey . "usergrp"] . "','" . $_SESSION[$secretkey . "userid"] . "');\"><div id=\"usrenabled-" . $res["id"] . "\"><span class=\"label label-success\">Enabled</span></div></a></td>";
    } elseif ($usrexp == "2") {
        print "<td><a id=\"usrlnkenabled-" . $res["id"] . "\" href=\"javascript:void(0);\" onclick=\"enableuser('" . $res["id"] . "','" . $_SESSION[$secretkey . "userlvl"] . "','" . $_SESSION[$secretkey . "usergrp"] . "','" . $_SESSION[$secretkey . "userid"] . "');\"><div id=\"usrenabled-" . $res["id"] . "\"><span class=\"label label-warning\">Not Started</span></div></a></td>";
    } elseif ($usrexp == "3") {
        print "<td><a id=\"usrlnkenabled-" . $res["id"] . "\" href=\"javascript:void(0);\" onclick=\"enableuser('" . $res["id"] . "','" . $_SESSION[$secretkey . "userlvl"] . "','" . $_SESSION[$secretkey . "usergrp"] . "','" . $_SESSION[$secretkey . "userid"] . "');\"><div id=\"usrenabled-" . $res["id"] . "\"><span class=\"label label-warning\">Expired</span></div></a></td>";
    } else {
        print "<td></td>";
    }