コード例 #1
0
function date_build_calendar()
{
    $t = $_GET["t"];
    $page = CurrentPageName();
    $obj_cal = new classe_calendrier("calendar-{$t}");
    //$obj_cal->activeAjax($_GET["t"],"LoadCalendar");
    if (!isset($_GET["month"])) {
        if (isset($_COOKIE["android-NavCalendar-month"])) {
            $_GET["month"] = $_COOKIE["android-NavCalendar-month"];
        }
    }
    if (!isset($_GET["year"])) {
        if (isset($_COOKIE["android-NavCalendar-year"])) {
            $_GET["year"] = $_COOKIE["android-NavCalendar-year"];
        }
    }
    if (!isset($_GET["month"])) {
        $_GET["month"] = date("m");
    }
    if (!isset($_GET["year"])) {
        $_GET["year"] = date("Y");
    }
    $obj_cal->afficheMois();
    $obj_cal->afficheSemaines(true);
    $obj_cal->afficheJours(true);
    $obj_cal->afficheNavigMois(true);
    $obj_cal->activeLienMois();
    $obj_cal->activeLiensSemaines();
    $obj_cal->activeJoursPasses();
    $obj_cal->activeJourPresent();
    $obj_cal->activeJoursFuturs();
    $obj_cal->activeJoursEvenements();
    $sql = "SELECT DAY(zDate) as tday,MONTH(zDate) as tmonth,YEAR(zDate) as tyear,SUM(QuerySize) as size,SUM(hits) as hits,{$_GET["field"]} \n\tFROM UserAuthDays GROUP BY \n\ttday,tmonth,tyear,{$_GET["field"]}\n\tHAVING {$_GET["field"]}='{$_GET["value"]}' \n\tAND tmonth={$_GET["month"]} AND tyear={$_GET["year"]} ORDER BY tday";
    $q = new mysql_squid_builder();
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        echo "{$q->mysql_error}.<hr>{$sql}</hr>";
    }
    $month = $_GET["month"];
    if (strlen($month) == 1) {
        $month = "0{$month}";
    }
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $ligne["size"] = $ligne["size"] / 1024;
        $ligne["size"] = round($ligne["size"] / 1024);
        if (strlen($ligne["tday"]) == 1) {
            $ligne["tday"] = "0" . $ligne["tday"];
        }
        $tr[] = "{$_GET["year"]}-{$month}-{$ligne["tday"]} - size:{$ligne["size"]}";
        $obj_cal->ajouteEvenement("{$_GET["year"]}-{$month}-{$ligne["tday"]}", "Downloaded size:{$ligne["size"]}M&nbsp;|&nbsp;Hits Number: {$ligne["hits"]}");
    }
    //$obj_cal->activeAjax("ajax_calendrier","calendrier.php");
    //makeCalendrier($a_annee,$a_mois)
    $obj_cal->setFormatLienMois("javascript:Blurz();\" OnClick=\"javascript:NavCalendar{$t}('%s','%s');");
    $calendar = $obj_cal->makeCalendrier($_GET["year"], $_GET["month"]);
    $html = "{$calendar}\n\t<script>\n\t\tfunction NavCalendar{$t}(year,month){\n\t\t\tSet_Cookie('android-NavCalendar-month', month, '3600', '/', '', '');\n\t\t\tSet_Cookie('android-NavCalendar-year', year, '3600', '/', '', '');\n\t\t\tLoadAjax('{$t}','{$page}?build-calendar=yes&t={$t}&field={$_GET["field"]}&value={$_GET["value"]}&year='+year+'&month='+month);\n\t\t}\n\t\t\n\t\tfunction ChangeLabelsText(){\n\t\t\tLoadjs('{$page}?ChangeLabelsText=yes&month={$month}&year={$_GET["year"]}');\n\t\t\n\t\t}\n\t\tChangeLabelsText();\n\t</script>\n\t";
    echo $html;
}
コード例 #2
0
ファイル: calendrier.php プロジェクト: JigSawFr/iftheme
            break;
    }
}
$obj_cal->setLangue(strtoupper($lang));
$lang_exist = $obj_cal->getLangue();
$obj_cal->setLangue($lang_exist);
$obj_cal->setJourCourt();
$obj_cal->afficheMois();
$obj_cal->afficheSemaines(false);
$obj_cal->afficheJours(true);
$obj_cal->afficheNavigMois(true);
$obj_cal->activeLienMois();
//$obj_cal->activeLiensSemaines();
$obj_cal->activeJoursPasses();
$obj_cal->activeJourPresent();
$obj_cal->activeJoursFuturs();
$obj_cal->activeJoursEvenements();
$obj_cal->setFormatLienJours($pathJ);
$obj_cal->setFormatLienMois($pathM);
$obj_cal->activeAjax("ajax_calendrier", get_bloginfo('wpurl') . "/wp-content/themes/iftheme/inc/calendar/calendrier.php");
global $wpdb;
$curLang = isset($_POST['lang']) ? $_POST['lang'] : str_ireplace('-', '_', get_bloginfo('language'));
//get language code if multilang
$tablemap = $wpdb->prefix . 'icl_locale_map';
$query_lang = "SELECT code FROM {$tablemap} WHERE locale = '{$curLang}'";
$code_lang = $wpdb->get_var("SHOW TABLES LIKE '{$tablemap}'") != $tablemap ? NULL : $wpdb->get_row($query_lang);
if ($code_lang) {
    $tabletrans = $wpdb->prefix . 'icl_translations';
    $query_trans = "SELECT * FROM {$tabletrans} WHERE language_code = '{$code_lang->code}' AND element_type = 'post_post'";
    $results_trans = $wpdb->get_results($query_trans);
}
コード例 #3
0
function build_calendar()
{
    $t = $_GET["t"];
    if (!is_numeric($t)) {
        $t = time();
    }
    $page = CurrentPageName();
    $obj_cal = new classe_calendrier("calendar-{$t}");
    $obj_cal->USLink = true;
    if (!isset($_GET["month"])) {
        if (isset($_COOKIE["NavCalendar-month"])) {
            $_GET["month"] = $_COOKIE["NavCalendar-month"];
        }
    }
    if (!isset($_GET["year"])) {
        if (isset($_COOKIE["NavCalendar-year"])) {
            $_GET["year"] = $_COOKIE["NavCalendar-year"];
        }
    }
    if (!isset($_GET["month"])) {
        $_GET["month"] = date("m");
    }
    if (!isset($_GET["year"])) {
        $_GET["year"] = date("Y");
    }
    if (!isset($_GET["day"])) {
        $_GET["day"] = date("d");
    }
    $obj_cal->afficheMois();
    $obj_cal->afficheSemaines(true);
    $obj_cal->afficheJours(true);
    $obj_cal->afficheNavigMois(true);
    $obj_cal->activeLienMois();
    $obj_cal->activeLiensSemaines();
    $obj_cal->activeJoursPasses();
    $obj_cal->activeJourPresent();
    $obj_cal->activeJoursFuturs();
    $obj_cal->activeJoursEvenements();
    $obj_cal->SetLienJoursJS("FormatQuery{$t}");
    $sql = "SELECT DAY(zDate) as tday,\n\tDATE_FORMAT(zDate,'%Y%m%d') as tprefix,\n\tMONTH(zDate) as tmonth,YEAR(zDate) as tyear,totalsize as size,requests as hits\n\tFROM tables_day WHERE MONTH(zDate)={$_GET["month"]} AND YEAR(zDate)={$_GET["year"]} ORDER BY DAY(zDate)";
    $q = new mysql_squid_builder();
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        echo "{$q->mysql_error}.<hr>{$sql}</hr>";
    }
    $month = $_GET["month"];
    if (strlen($month) == 1) {
        $month = "0{$month}";
    }
    $tpl = new templates();
    $ERR = array();
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $table_work = "{$ligne["tprefix"]}_hour";
        $ligne["size"] = $ligne["size"] / 1024;
        $ligne["size"] = round($ligne["size"] / 1024);
        if (strlen($ligne["tday"]) == 1) {
            $ligne["tday"] = "0" . $ligne["tday"];
        }
        $tr[] = "{$_GET["year"]}-{$month}-{$ligne["tday"]} - size:{$ligne["size"]}";
        $TableTime = strtotime("{$_GET["year"]}-{$month}-{$ligne["tday"]} 00:00:00");
        if (!$q->TABLE_EXISTS($table_work)) {
            $REPAIR[] = $tpl->_ENGINE_parse_body("\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td width=1%><img src='img/arrow-right-16.png'></td>\n\t\t\t\t\t<td><a href=\"javascript:blur();\"\n\t\t\t\t\tOnClick=\"javascript:Loadjs('squid.stats.repair.day.php?time={$TableTime}');\">{repair}: {$_GET["year"]}-{$month}-{$ligne["tday"]}</td>\n\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t");
            continue;
        }
        $obj_cal->ajouteEvenement("{$_GET["year"]}-{$month}-{$ligne["tday"]}", "Downloaded size:{$ligne["size"]}M&nbsp;|&nbsp;Hits Number: {$ligne["hits"]}");
    }
    $obj_cal->setFormatLienMois("javascript:Blurz();\" OnClick=\"javascript:NavCalendar{$t}('%s','%s');");
    $calendar = $obj_cal->makeCalendrier($_GET["year"], $_GET["month"]);
    if (isset($_GET["build-calendar"])) {
        echo $calendar;
        return;
    }
    $REPAIRTR = @implode("", $REPAIR);
    $html = "\n<div id='calendar-{$t}' class=form style='width:95%'>\n{$calendar}{$REPAIRTR}\n</div>\n\n<script>\n\nfunction FormatQuery{$t}(value){\n\tLoadjs('{$page}?FormatQuery=yes&'+value);\n}\n\nfunction NavCalendar{$t}(year,month){\n\tSet_Cookie('NavCalendar-month', month, '3600', '/', '', '');\n\tSet_Cookie('NavCalendar-year', year, '3600', '/', '', '');\n\tLoadAjax('calendar-{$t}','{$page}?build-calendar=yes&t={$t}&year='+year+'&month='+month);\n}\n</script>\n";
    echo $html;
}
コード例 #4
0
function build_calendar()
{
    $t = $_GET["t"];
    if (!is_numeric($t)) {
        $t = time();
    }
    $page = CurrentPageName();
    $obj_cal = new classe_calendrier("calendar-{$t}");
    $tpl = new templates();
    $obj_cal->USLink = true;
    $size_text = $tpl->_ENGINE_parse_body("{size}");
    $hits_text = $tpl->_ENGINE_parse_body("{hits}");
    //$obj_cal->activeAjax($_GET["t"],"LoadCalendar");
    if (!isset($_GET["month"])) {
        if (isset($_COOKIE["NavCalendar-month"])) {
            $_GET["month"] = $_COOKIE["NavCalendar-month"];
        }
    }
    if (!isset($_GET["year"])) {
        if (isset($_COOKIE["NavCalendar-year"])) {
            $_GET["year"] = $_COOKIE["NavCalendar-year"];
        }
    }
    if (!isset($_GET["month"])) {
        $_GET["month"] = date("m");
    }
    if (!isset($_GET["year"])) {
        $_GET["year"] = date("Y");
    }
    if (!isset($_GET["day"])) {
        $_GET["day"] = date("d");
    }
    $obj_cal->afficheMois();
    $obj_cal->afficheSemaines(true);
    $obj_cal->afficheJours(true);
    $obj_cal->afficheNavigMois(true);
    $obj_cal->activeLienMois();
    $obj_cal->activeLiensSemaines();
    $obj_cal->SetLienJoursJS("ChangeDay{$t}");
    $obj_cal->activeJoursPasses();
    $obj_cal->activeJourPresent();
    $obj_cal->activeJoursFuturs();
    $obj_cal->activeJoursEvenements();
    $obj_cal->StyleMoisSize = 18;
    $obj_cal->StyleJoursSize = 18;
    $obj_cal->StyleHeight = 50;
    $obj_cal->InsideEvents = true;
    $sql = "SELECT DAY(zDate) as tday,\n\tDATE_FORMAT(zDate,'%Y%m%d') as tprefix,\n\tMONTH(zDate) as tmonth,YEAR(zDate) as tyear,totalsize as size,requests as hits\n\tFROM tables_day WHERE MONTH(zDate)={$_GET["month"]} AND YEAR(zDate)={$_GET["year"]} ORDER BY DAY(zDate)";
    $q = new mysql_squid_builder();
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        echo "{$q->mysql_error}.<hr>{$sql}</hr>";
    }
    $month = $_GET["month"];
    if (strlen($month) == 1) {
        $month = "0{$month}";
    }
    $tpl = new templates();
    $ERR = array();
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $table_work = "{$ligne["tprefix"]}_hour";
        if ($ligne["tprefix"] == date('Ymd')) {
            continue;
        }
        $ligne["size"] = $ligne["size"] / 1024;
        $ligne["size"] = FormatBytes($ligne["size"]);
        if (strlen($ligne["tday"]) == 1) {
            $ligne["tday"] = "0" . $ligne["tday"];
        }
        $tr[] = "{$_GET["year"]}-{$month}-{$ligne["tday"]} - size:{$ligne["size"]}";
        $TableTime = strtotime("{$_GET["year"]}-{$month}-{$ligne["tday"]} 00:00:00");
        $ligne["hits"] = FormatNumber($ligne["hits"]);
        if (!$q->TABLE_EXISTS($table_work)) {
            $obj_cal->ajouteEvenement("{$_GET["year"]}-{$month}-{$ligne["tday"]}", $tpl->_ENGINE_parse_body("<center><table style='width:5%;border:0px'><tr><td width=1% style='border:0px'><img src='img/status_warning.png'></td><td nowrap width=99% style='border:0px'><a href=\"javascript:blur();\"  OnClick=\"javascript:Loadjs('squid.stats.repair.day.php?time={$TableTime}');\">{repair}</td></td></tr></table></center>"));
            continue;
        }
        $obj_cal->ajouteEvenement("{$_GET["year"]}-{$month}-{$ligne["tday"]}", "<li>{$size_text}:{$ligne["size"]}</li>");
        $obj_cal->ajouteEvenement("{$_GET["year"]}-{$month}-{$ligne["tday"]}", "<li>{$hits_text}:{$ligne["hits"]}</li>");
    }
    $obj_cal->setFormatLienMois("javascript:Blurz();\" OnClick=\"javascript:NavCalendar{$t}('%s','%s');");
    $calendar = $obj_cal->makeCalendrier($_GET["year"], $_GET["month"]);
    if (isset($_GET["build-calendar"])) {
        echo $calendar;
        return;
    }
    $html = "\n\t<div id='calendar-{$t}' style='width:95%;margin-top:35px' class=form>\n\t{$calendar}\n\t</div>\n\t<script>\n\t\tfunction NavCalendar{$t}(year,month){\n\t\t\tSet_Cookie('NavCalendar-month', month, '3600', '/', '', '');\n\t\t\tSet_Cookie('NavCalendar-year', year, '3600', '/', '', '');\n\t\t\tLoadAjax('calendar-{$t}','{$page}?build-calendar=yes&t={$t}&year='+year+'&month='+month);\n\t\t}\n\t\t\n\t\tfunction ChangeDay{$t}(url){\n\t\t\tdocument.location.href='miniadm.webstats.php?t={$t}&'+url;\n\t\t}\n\t\t\n\t</script>\n\t";
    echo $html;
}