Exemplo n.º 1
0
 public static function TemplateView($template, $ext = '.php')
 {
     parse_str(parse_url(Url::curRequestURL(), PHP_URL_QUERY), $get);
     if ($get['ver'] == 'mobile') {
         $_SESSION['mobile'] = true;
         header('Location: /');
     } else {
         if ($get['ver'] == 'desk') {
             $_SESSION['mobile'] = false;
             header('Location: /');
         }
     }
     if (CheckMobile() || $_SESSION['mobile'] == true) {
         if (!is_dir(TEMPLATE_M_PATH)) {
             die('Không tồn tại thư mục template');
         }
         $rs = TEMPLATE_M_PATH . $template . $ext;
     } else {
         if (!is_dir(TEMPLATE_PATH)) {
             die('Không tồn tại thư mục template');
         }
         $rs = TEMPLATE_PATH . $template . $ext;
     }
     return $rs;
 }
Exemplo n.º 2
0
function getTemplateContent($templateFileName)
{
    loadWebConfig();
    //读模板
    $templateFile = '';
    $customTemplateFile = '';
    $c = '';
    $customTemplateFile = ROOT_PATH . 'template/' . $GLOBALS['db_PREFIX'] . '/' . $templateFileName;
    //为手机端
    if (CheckMobile() == true || @$_REQUEST['m'] == 'mobile') {
        $templateFile = ROOT_PATH . '/Template/mobile/' . $templateFileName;
    }
    //判断手机端文件是否存在20160330
    if (CheckFile($templateFile) == false) {
        if (CheckFile($customTemplateFile) == true) {
            $templateFile = $customTemplateFile;
        } else {
            $templateFile = ROOT_PATH . $templateFileName;
        }
    }
    $c = getFText($templateFile);
    $c = replaceLableContent($c);
    $getTemplateContent = $c;
    return @$getTemplateContent;
}
Exemplo n.º 3
0
if (isset($_GET['Step'])) {
    if ($_GET['Step'] == 1) {
        $Test = 1;
        $Step = 1;
    } else {
        $Test = 0;
        $Step = $_GET['Step'];
    }
}
$stmt_SysDB->bindParam(':Test', $Test, PDO::PARAM_INT, 6);
$stmt_SysDB->bindParam(':Step', $Step, PDO::PARAM_INT, 6);
$chWidth = 1920;
$chHeight = 1080;
$chFont = 16;
$chWeight = 3;
if (CheckMobile()) {
    $chHeight = $chHeight / 2;
    $chWidth = $chWidth / 2;
    $chFont = $chFont / 2;
    $chWeight = $chWeight / 2;
}
$serieSettingsD = array("R" => 16, "G" => 16, "B" => 16);
$serieSettingsS = array("R" => 49, "G" => 79, "B" => 79);
$ChartTitle = $_GET['DynVar'] . " Dynamic Graph";
switch ($_GET['DynVar']) {
    case "CPU":
        $stmt_SysDB->execute();
        while ($row_SysDB = $stmt_SysDB->fetch(PDO::FETCH_ASSOC)) {
            ksort($row_SysDB);
            $OTime[] = $row_SysDB['WalkTime'];
            $thisCPUAverage = ($row_SysDB['CPULoad1'] + $row_SysDB['CPULoad2'] + $row_SysDB['CPULoad3'] + $row_SysDB['CPULoad4'] + $row_SysDB['CPULoad5'] + $row_SysDB['CPULoad6'] + $row_SysDB['CPULoad7'] + $row_SysDB['CPULoad8']) / 8;