コード例 #1
0
ファイル: index.php プロジェクト: rogerapras/lottomax
                <li>Date input box set to false </li>
                <li>Set alignment left and bottom</li>
                <li>Disable  specific date 1, 4 April, and 25 December of every years</li>
                <li>Disable  specific date 10, 14   of every months</li>
                <li>Disable 1 June 2011</li>
              </ul>
              <p><b>Code:</b></p>
              <pre>&lt;?php<br>	  $myCalendar = new tc_calendar(&quot;date5&quot;, true, false);<br>	  $myCalendar-&gt;setIcon(&quot;calendar/images/iconCalendar.gif&quot;);<br>	  $myCalendar-&gt;setDate(date('d'), date('m'), date('Y'));<br>	  $myCalendar-&gt;setPath(&quot;calendar/&quot;);<br>	  $myCalendar-&gt;setYearInterval(2000, 2015);<br>	  $myCalendar-&gt;dateAllow('2008-05-13', '2015-03-01');<br>	  $myCalendar-&gt;setDateFormat('j F Y');<br>	  $myCalendar-&gt;setAlignment('left', 'bottom');<br>	  $myCalendar-&gt;setSpecificDate(array(&quot;2011-04-01&quot;, &quot;2011-04-04&quot;, &quot;2011-12-25&quot;), 0, 'year');<br>	  $myCalendar-&gt;setSpecificDate(array(&quot;2011-04-10&quot;, &quot;2011-04-14&quot;), 0, 'month');<br>	  $myCalendar-&gt;setSpecificDate(array(&quot;2011-06-01&quot;), 0, '');<br>	  $myCalendar-&gt;writeScript();<br>	  ?&gt;</pre>
              <p class="largetxt"><b>Date Pair Example</b></p>
              <div style="float: left;">
                <div style="float: left; padding-right: 3px; line-height: 18px;">from:</div>
                <div style="float: left;">
                  <?php 
$thisweek = date('W');
$thisyear = date('Y');
$dayTimes = getDaysInWeek($thisweek, $thisyear);
//----------------------------------------
$date1 = date('Y-m-d', $dayTimes[0]);
$date2 = date('Y-m-d', $dayTimes[sizeof($dayTimes) - 1]);
function getDaysInWeek($weekNumber, $year, $dayStart = 1)
{
    // Count from '0104' because January 4th is always in week 1
    // (according to ISO 8601).
    $time = strtotime($year . '0104 +' . ($weekNumber - 1) . ' weeks');
    // Get the time of the first day of the week
    $dayTime = strtotime('-' . (date('w', $time) - $dayStart) . ' days', $time);
    // Get the times of days 0 -> 6
    $dayTimes = array();
    for ($i = 0; $i < 7; ++$i) {
        $dayTimes[] = strtotime('+' . $i . ' days', $dayTime);
    }
コード例 #2
0
function right()
{
    $q = new mysql_squid_builder();
    $page = CurrentPageName();
    $tpl = new templates();
    if (!isset($_GET["day"])) {
        $_GET["day"] = date('Y-m-d');
    }
    $title_style = "font-size:16px;width:100%;font-weight:bold;text-decoration:underline";
    $day = $_GET["day"];
    $time = strtotime("{$day} 00:00:00");
    $table = date("YW", $time) . "_week";
    echo "<!-- LINE:" . __LINE__ . ">\n";
    $_GET["week"] = date("W", $time);
    $_GET["year"] = date("Y", $time);
    $tt = getDaysInWeek($_GET["week"], $_GET["year"]);
    foreach ($tt as $dayTime) {
        $f[] = date('{l} d {F}', $dayTime);
    }
    if ($_GET["field-user"] != null) {
        $title_add = "<br>{{$_GET["field-user"]}}:{$_GET["field-user-value"]}";
        $fieldadd = "{$_GET["field-user"]},";
        $GROUP_SELECT = " HAVING `{$_GET["field-user"]}`='{$_GET["field-user-value"]}'";
    }
    echo "<script>\n\t\tLoadAjax('statistics-week-left-status','{$page}?left-status=yes&day={$_GET["day"]}');\n\t</script>\n\t";
    echo "<!-- LINE:" . __LINE__ . ">\n";
    $sourcetable = "{$_GET["year"]}{$_GET["week"]}_week";
    $title00 = $tpl->_ENGINE_parse_body("\n\t<center style='font-size:16px;width:100%;font-weight:bold;margin:10px'>\n\t\t\t{week}:&nbsp;{from}&nbsp;{$f[0]}&nbsp;{to}&nbsp;{$f[6]}{$title_add}\n\t</center>");
    if (!$q->TABLE_EXISTS($sourcetable)) {
        echo $tpl->_ENGINE_parse_body("{$title}<center style='margin:50px'>\n\t\t<H2>{$sourcetable}:{error_no_datas} ({$sourcetable} no such table)</H2></center>");
    }
    echo "<!-- LINE:" . __LINE__ . ">\n";
    $sql = "SELECT {$fieldadd}category,SUM(hits) as totalsize FROM {$sourcetable} GROUP BY {$fieldadd}category {$GROUP_SELECT} ORDER BY totalsize DESC LIMIT 0,10";
    $title0 = TITLE_SQUID_STATSTABLE($sql, "{statistics}:&nbsp;{week}:{$_GET["week"]} ({categories} TOP 10){$title_add}");
    $results = $q->QUERY_SQL($sql);
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $xdata[] = $ligne["totalsize"];
        $ydata[] = $ligne["category"];
    }
    echo "<!-- LINE:" . __LINE__ . ">\n";
    $targetedfilePie = "ressources/logs/" . basename(__FILE__) . "." . __FUNCTION__ . "." . md5($sql) . ".pie.png";
    $gp = new artica_graphs($targetedfilePie);
    $gp->xdata = $xdata;
    $gp->ydata = $ydata;
    $gp->width = 550;
    $gp->height = 550;
    $gp->ViewValues = true;
    $gp->x_title = $tpl->_ENGINE_parse_body("{top_websites}");
    $gp->pie();
    echo "<!-- LINE:" . __LINE__ . ">\n";
    $sql = "SELECT {$fieldadd}SUM(hits) as totalsize,`day` FROM {$sourcetable} GROUP BY {$fieldadd}`day` {$GROUP_SELECT} ORDER BY `day`";
    $title1 = TITLE_SQUID_STATSTABLE($sql, "{statistics}:&nbsp;{week}:{$_GET["week"]} ({requests}){$title_add}");
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        echo "<H2>{$q->mysql_error}</H2><center style='font-size:11px'><code>{$sql}</code></center>";
    }
    if (mysql_num_rows($results) == 0) {
        echo $tpl->_ENGINE_parse_body("{$title00}\n\t<center style='margin:50px'>\n\t\t<H2>{error_no_datas}</H2>\n\t\t<i>{$sourcetable} (no such data in line " . __LINE__ . ")</i>\n\t</center>");
        return;
    }
    $weeksd = array(1 => "Sunday", 2 => "Monday", 3 => "Tuesday", 4 => "Wednesday", 5 => "Thursday", 6 => "Friday", 7 => "Saturday");
    $xdata = array();
    $ydata = array();
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $xdata[] = $tpl->_ENGINE_parse_body("{{$weeksd[$ligne["day"]]}}");
        $ydata[] = $ligne["totalsize"];
    }
    $targetedfile = "ressources/logs/" . basename(__FILE__) . "." . __FUNCTION__ . "." . md5($sql) . ".png";
    $gp = new artica_graphs();
    $gp->width = 550;
    $gp->height = 350;
    $gp->filename = "{$targetedfile}";
    $gp->xdata = $xdata;
    $gp->ydata = $ydata;
    $gp->y_title = null;
    $gp->x_title = $tpl->_ENGINE_parse_body("{days}");
    $gp->title = null;
    $gp->margin0 = true;
    $gp->Fillcolor = "blue@0.9";
    $gp->color = "146497";
    $gp->line_green();
    if (!is_file($targetedfile)) {
        writelogs("Fatal \"{$targetedfile}\" no such file!", __FUNCTION__, __FILE__, __LINE__);
    }
    $sql = "SELECT {$fieldadd}SUM(size) as totalsize,`day` FROM {$sourcetable} GROUP BY {$fieldadd}`day` {$GROUP_SELECT} ORDER BY `day`";
    $title2 = TITLE_SQUID_STATSTABLE($sql, "{statistics}:&nbsp;{week}:{$_GET["week"]} ({downloaded_flow} MB){$title_add}");
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        echo "<H2>{$q->mysql_error}</H2><center style='font-size:11px'><code>{$sql}</code></center>";
    }
    if (mysql_num_rows($results) == 0) {
        echo $tpl->_ENGINE_parse_body("\n\t\t{$title00}\n\t\t<center style='margin:50px'>\n\t\t\t<H2>{error_no_datas}</H2><i>{$sourcetable} no such data (no such data in line " . __LINE__ . ")</i>\n\t\t</center>");
    }
    $weeksd = array(1 => "Sunday", 2 => "Monday", 3 => "Tuesday", 4 => "Wednesday", 5 => "Thursday", 6 => "Friday", 7 => "Saturday");
    $xdata = array();
    $ydata = array();
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $xdata[] = $tpl->_ENGINE_parse_body("{{$weeksd[$ligne["day"]]}}");
        $ydata[] = round($ligne["totalsize"] / 1024 / 1000);
    }
    $targetedfile2 = "ressources/logs/" . basename(__FILE__) . "." . __FUNCTION__ . "." . md5($sql) . ".png";
    $gp = new artica_graphs();
    $gp->width = 550;
    $gp->height = 350;
    $gp->filename = "{$targetedfile2}";
    $gp->xdata = $xdata;
    $gp->ydata = $ydata;
    $gp->y_title = null;
    $gp->x_title = $tpl->_ENGINE_parse_body("{days}");
    $gp->title = null;
    $gp->margin0 = true;
    $gp->Fillcolor = "blue@0.9";
    $gp->color = "146497";
    $gp->line_green();
    if (!is_file($targetedfile2)) {
        writelogs("Fatal \"{$targetedfile2}\" no such file!", __FUNCTION__, __FILE__, __LINE__);
    }
    $html = "\n\t{$title00}\n\t<div class=RoundedGrey>\n\t\t{$title0}\n\t\t<img src='{$targetedfilePie}' style='margin:10px'>\n\t</div>\n\t<div class=RoundedGrey>\n\t{$title1}<img src='{$targetedfile}' style='margin:10px'>\n\t</div>\n\t<div class=RoundedGrey>\n\t{$title2}\n\t<img src='{$targetedfile2}' style='margin:10px'>\n\t</div>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
コード例 #3
0
function right(){
	if($_GET["ShowTable"]==1){right_showtable();exit;}
	$q=new mysql_squid_builder();
	$page=CurrentPageName();
	$tpl=new templates();	
	if(!isset($_GET["day"])){$_GET["day"]=$q->HIER();}
	if(!isset($_GET["type"])){$_GET["type"]="size";}
	if($_GET["type"]==null){$_GET["type"]="size";}
	$type=$_GET["type"];
	$field_query="size";
	
	$time=strtotime("{$_GET["day"]} 00:00:00");
	$SourceTable=date("YW",$time)."_blocked_week";	
	
	$_GET["week"]=date("W",$time);
	$_GET["year"]=date("Y",$time);
	$tt=getDaysInWeek($_GET["week"],$_GET["year"]);
	foreach ($tt as $dayTime) {$f[]=date('{l} d {F}', $dayTime);}	
	$subtitle="{week}:&nbsp;{from}&nbsp;{$f[0]}&nbsp;{to}&nbsp;{$f[6]}";	
	$title="<div style='font-size:16px;width:100%;font-weight:bold'>{statistics}:&nbsp;$subtitle ({hits})</div>";
	if(!$q->TABLE_EXISTS($SourceTable)){
		echo $tpl->_ENGINE_parse_body("
		<input type='hidden' id='squid-stats-week-hide-type' value='{$_GET["type"]}'>
		$title
		<center style='margin:50px'><H2>{error_no_datas}</H2><i>$SourceTable no such table</center>");
		return;
	}
	
	
	if($type=="req"){$field_query="hits";}
	
	$sql="SELECT SUM(hits) as tcount,`day` as tdate FROM $SourceTable GROUP BY `day`  ORDER BY `day` ";
	$results=$q->QUERY_SQL($sql);
	if(!$q->ok){echo "<H2>$q->mysql_error</H2><center style='font-size:11px'><code>$sql</code></center>";}	
	if(mysql_num_rows($results)==0){
		echo $tpl->_ENGINE_parse_body("$title<center style='margin:50px'>
			<H2>{error_no_datas}</H2>
		<i>&laquo;$SourceTable&raquo; (no datas)</i>
		</center>");
	}
	
	
	while($ligne=@mysql_fetch_array($results,MYSQL_ASSOC)){
		$xdata[]=$ligne["tdate"];
		$ydata[]=$ligne["tcount"];
	}	
	
	$targetedfile="ressources/logs/".basename(__FILE__).".".__FUNCTION__.".day.$SourceTable.$type.png";
	$gp=new artica_graphs();
	$gp->width=550;
	$gp->height=350;
	$gp->filename="$targetedfile";
	$gp->xdata=$xdata;
	$gp->ydata=$ydata;
	$gp->y_title=null;
	$gp->x_title=$tpl->_ENGINE_parse_body("{days}");
	$gp->title=null;
	$gp->margin0=true;
	$gp->Fillcolor="blue@0.9";
	$gp->color="146497";

	$gp->line_green();
	if(!is_file($targetedfile)){
		writelogs("Fatal \"$targetedfile\" no such file!",__FUNCTION__,__FILE__,__LINE__);
		$targetedfile="/img/kas-graph-no-datas.png";
	}	
	
	
	$sql="SELECT SUM(hits) as tcount,category FROM $SourceTable GROUP BY category ORDER BY tcount DESC LIMIT 0,10";
	$results=$q->QUERY_SQL($sql);
	if(!$q->ok){echo "<H2>$q->mysql_error</H2><center style='font-size:11px'><code>$sql</code></center>";}	
	if(mysql_num_rows($results)==0){
		echo $tpl->_ENGINE_parse_body("$title<center style='margin:50px'><H2>{error_no_datas}</H2>
		<i>$SourceTable (no datas)</i>
		<br><code>sql:$sql</code>
		</center>");
	}	
	
	$table="
	<input type='hidden' id='squid-stats-week-hide-type' value='{$_GET["type"]}'>
	<center>
<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:350px'>
<thead class='thead'>
	<tr>
	<th width=1%>{hits}</th>
	<th>{category}</th>
	</tr>
</thead>
<tbody>";
	$xdata=array();
	$ydata=array();
	
	while($ligne=@mysql_fetch_array($results,MYSQL_ASSOC)){
		if(trim($ligne["category"])==null){continue;}
		$ydata[]=$ligne["category"];
		$xdata[]=$ligne["tcount"];
		
	if($classtr=="oddRow"){$classtr=null;}else{$classtr="oddRow";}
$table=$table.
		"
		<tr class=$classtr>
			
			<td width=1%  style='font-size:14px' nowrap><strong>{$ligne["tcount"]}</strong></td>
			<td  style='font-size:14px' nowrap width=99%>
				<strong><a href=\"javascript:blur();\" 
				OnClick=\"javascript:Loadjs('$page?today-zoom=yes&category={$ligne["category"]}&day={$_GET["day"]}')\" 
				style='font-size:14px;font-weight:bold;text-decoration:underline'>{$ligne["category"]}</a></strong></td>
		</tr>
		";		
		
	}	
$table=$table."</tbody></table>";
	$targetedfile2="ressources/logs/".basename(__FILE__).".".__FUNCTION__.".day.top.10.websites.$SourceTable.$type.png";
	$gp=new artica_graphs($targetedfile2);	
	$gp->xdata=$xdata;
	$gp->ydata=$ydata;	
	$gp->width=550;
	$gp->height=550;
	$gp->ViewValues=true;
	$gp->x_title=$tpl->_ENGINE_parse_body("{top_categories}");
	$gp->pie();		
	
	$html="
	<input type='hidden' id='squid-stats-week-hide-type' value='$type'>
	$title
	<center style='margin:10px'><img src='$targetedfile'></center>
	<center style='margin:10px'><img src='$targetedfile2'></center>
	$table
	<script>
		LoadAjax('statistics-week-left-status','squid.traffic.statistics.week.php?left-status=yes&day={$_GET["day"]}');
	</script>
	
";
	echo $tpl->_ENGINE_parse_body($html);
	
	
	
	
}
コード例 #4
0
function week_categories()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $year = date("Y");
    $week = intval(date('W'));
    if ($_GET["table"] == null) {
        $table = "{$year}{$week}_week";
    } else {
        $table = $_GET["table"];
    }
    $q = new mysql_squid_builder();
    if ($q->COUNT_ROWS($table) == 0) {
        echo $tpl->_ENGINE_parse_body("{$title}<center style='margin:50px'><H2>{error_no_datas}</H2>{$sql} ({$table} {empty})</center>");
        return;
    }
    $separator = "<center><hr style='border:1px dotted #CCCCCC;width:80%'></center>";
    if (!$q->TABLE_EXISTS($table)) {
        echo "<H3>" . $tpl->_ENGINE_parse_body("{week_table_was_not_builded}{$field}") . "</h3>";
    }
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT SUM(size) as tsize FROM {$table}"));
    $downloadedINT = $ligne["tsize"];
    $downloaded = FormatBytes($downloadedINT / 1024);
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT SUM(size) as tsize FROM {$table} WHERE cached=1"));
    $cachedINT = $ligne["tsize"];
    $cached = FormatBytes($cachedINT / 1024);
    $pourc = $cachedINT / $downloadedINT;
    $pourc = $pourc * 100;
    $pourc = round($pourc, 2);
    $line = $tpl->_ENGINE_parse_body("{$field}{this_week_your_users_has_downloadedXD-XS-XP}{$separator}");
    $line = str_replace("XD", "<strong>{$downloaded}</strong>", $line);
    $line = str_replace("XS", "<strong>{$cached}</strong>", $line);
    $line = str_replace("XP", "<strong style='color:#CF1717'>{$pourc}%</strong>", $line);
    $html[] = "<div style='font-size:12px;text-align:justify;margin-bottom:5px'>{$line}</div>";
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT SUM(size) as tsize,familysite FROM {$table} GROUP BY familysite ORDER BY tsize DESC LIMIT 0,1"));
    $XXWWWS = $ligne["familysite"];
    $XWSZE = FormatBytes($ligne["tsize"] / 1024);
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT SUM(hits) as tsize,familysite FROM {$table} GROUP BY familysite ORDER BY tsize DESC LIMIT 0,1"));
    $XXWWWR = $ligne["familysite"];
    $XWSZR = $ligne["tsize"];
    $XWSCAT = familysite_MergeCategories(array($XXWWWS, $XXWWWR));
    $linkWebsite1 = "<a href=\"javascript:blur();\" \n\tOnClick=\"javascript:Loadjs('squid.traffic.statistics.week.website.php?table={$table}&field=familysite&www={$XXWWWS}');\"\n\tstyle='font-weight:bold;text-decoration:underline'\n\t>";
    $linkWebsite2 = "<a href=\"javascript:blur();\" \n\tOnClick=\"javascript:Loadjs('squid.traffic.statistics.week.website.php?table={$table}&field=familysite&www={$XXWWWR}');\"\n\tstyle='font-weight:bold;text-decoration:underline'\n\t>";
    $line = $tpl->_ENGINE_parse_body("{phrase_the_most_websites}");
    $line = str_replace("XXWWWS", "{$linkWebsite1}{$XXWWWS}</a>", $line);
    $line = str_replace("XWSZE", "<strong>{$XWSZE}</strong>", $line);
    $line = str_replace("XXWWWR", "{$linkWebsite2}{$XXWWWR}</a>", $line);
    $line = str_replace("XWSZR", "<strong>{$XWSZR}</strong>", $line);
    $line = str_replace("XWSCAT", "<strong>{$XWSCAT}</strong>", $line);
    $html[] = "<div style='font-size:12px;text-align:justify'>{$line}</div>";
    $line = $tpl->_ENGINE_parse_body("{phrase_the_most_website_represent}");
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT SUM(size) as tsize FROM {$table} WHERE familysite='{$XXWWWS}'"));
    $XXWWWSPRC_bin = $ligne["tsize"];
    $XXWWWSPRC_size = FormatBytes($XXWWWSPRC_bin / 1024);
    $XXWWWSPRC = $XXWWWSPRC_bin / $downloadedINT;
    $XXWWWSPRC = $XXWWWSPRC * 100;
    $XXWWWSPRC = round($XXWWWSPRC, 2);
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT SUM(size) as tsize FROM {$table} WHERE familysite='{$XXWWWS}' AND cached=1"));
    $XXWWWSCHE_bin = $ligne["tsize"];
    $XXWWWSCHE_size = FormatBytes($XXWWWSCHE_bin / 1024);
    $line = str_replace("XXWWWSPRC", "<strong>{$XXWWWSPRC}% ({$XXWWWSPRC_size})</strong>", $line);
    $line = str_replace("XXWWWSCHE", "<strong>{$XXWWWSCHE_size}</strong>", $line);
    $line = str_replace("XXWWWS", "{$linkWebsite1}{$XXWWWS}</a>", $line);
    $html[] = "<div style='font-size:12px;text-align:justify;margin-top:10px'>\n\t<div style='color:#CF1717;font-weight:bold;margin-top:5px;font-size:13.5px'>{$XXWWWS}:</div>\n\t{$line}</div>";
    // ******************************************************************************************************
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT `day`,SUM(hits) as thits,SUM(size) as tsize  FROM {$table} GROUP BY `day` ORDER BY thits DESC LIMIT 0,1"));
    if (!$q->ok) {
        echo $q->mysql_error;
    }
    $MostActiveDayNum = $ligne["day"] - 1;
    $MostActiveDaySize = FormatBytes($ligne["tsize"] / 1024);
    $Cyear = substr($table, 0, 4);
    $Cweek = substr($table, 4, 2);
    $Cweek = str_replace("_", "", $Cweek);
    $days = getDaysInWeek($Cweek, $Cyear);
    $dayText = date('{l}', $days[$MostActiveDayNum]);
    $TimeWeek = strtotime($Cyear . '0104 +' . ($Cweek - 1) . ' weeks');
    $DayTime = date('Y-m', $TimeWeek) . "-" . date('d', $days[$MostActiveDayNum]);
    $DayTable = date('Ymd', strtotime($DayTime)) . "_hour";
    $dayText = "<a href=\"javascript:blur();\" \n\tOnClick=\"javascript:Loadjs('squid.traffic.panel.day.php?js=yes&table={$DayTable}');\"\n\tstyle='color:#CF1717;font-weight:bold;text-decoration:underline'>{$dayText}</a>";
    $title = "{$dayText} {phrase_most_day_activeday}";
    $prc = round($ligne["tsize"] / $downloadedINT, 2) * 100;
    $html[] = "<div style='color:#CF1717;font-weight:bold;margin-top:5px;font-size:13.5px'>{$title}</div>\n\t<div style='font-size:12px;text-align:justify;'>\n\t{with} <strong>{$ligne["thits"]} {hits}</strong> {or} <strong>{$MostActiveDaySize}</strong> {it_represents} <strong>{$prc}%</strong> {of_bandwith}</div>\n\t\n\t<div style='font-size:12px;text-align:justify;margin-top:10px;margin-bottom:15px'>{phrase_thisisthegraph1}:</div>";
    $sql = "SELECT `day`,SUM(hits) as thits FROM {$table} GROUP BY `day` ORDER BY `day`";
    $results = $q->QUERY_SQL($sql);
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $day = $ligne["day"] - 1;
        $dayText = date('{l} d', $days[$day]);
        $DayTable = date('Ymd', $days[$day]) . "_hour";
        $TimeWeek = strtotime($Cyear . '0104 +' . ($Cweek - 1) . ' weeks');
        $DayTime = date('Y-m', $TimeWeek) . "-" . date('d', $days[$day]);
        $dayText = "<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('squid.traffic.panel.day.php?js=yes&table={$DayTable}');\" style='font-weight:bold;text-decoration:underline'>{$dayText}</a>";
        $tr[] = "\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{$dayText}:</td>\n\t\t\t<td nowrap><strong style='font-size:13px'>" . numberFormat($ligne["thits"], 0, "", " ") . " {hits}</td>\n\t\t</tr>\n\t\t";
        $xdata[] = $ligne["day"];
        $ydata[] = $ligne["thits"];
    }
    $time = time();
    $targetedfile = "ressources/logs/" . basename(__FILE__) . "." . __FUNCTION__ . ".{$table}.{$time}.png";
    $gp = new artica_graphs();
    $gp->width = 270;
    $gp->height = 150;
    $gp->filename = "{$targetedfile}";
    $gp->xdata = $xdata;
    $gp->ydata = $ydata;
    $gp->y_title = null;
    $gp->x_title = $tpl->_ENGINE_parse_body("{days}");
    $gp->title = null;
    $gp->margin0 = true;
    $gp->Fillcolor = "blue@0.9";
    $gp->color = "146497";
    $gp->line_green();
    if (!is_file($targetedfile)) {
        $targetedfile = "img/nograph-000.png";
    }
    $html[] = "<center style='margin-top:5px'><img src='{$targetedfile}'></center>\n\t<table style='width:50%'><tbody>" . @implode("\n", $tr) . "</tbody></table>\n\t";
    $html[] = "\n\t<script>\n\t\tLoadAjax('panel-middle-top','{$page}?panel-topwebistes-week=yes&table={$table}');\n\t</script>";
    echo $tpl->_ENGINE_parse_body(@implode("\n", $html));
}
コード例 #5
0
</th>
			<th style="width: 14.28%;"><?php 
echo @text('Sat');
?>
</th>
			<th style="width: 14.28%;"><?php 
echo @text('Sun');
?>
</th>
		</tr>
		</thead>
	</table>
	 
	<? $week_count = $firstweek ?>
	<? while($week_count <= $lastweek) : ?>
	<? $dayTimes = getDaysInWeek($week_count, 2012); ?>
	<? $lastDayOfWeek = strftime('%d', end($dayTimes)); ?>
	<? $firstDayOfWeek = strftime('%d', $dayTimes[0]); ?>
	<div class="row-fluid">
		<table class="table">
			<tr class="days">
				<td class="weeknumber" style="width: 20px;"><span class="label"><?php 
echo $week_count;
?>
</label></td>
				<? foreach ($dayTimes as $dayTime) : ?>
				<td style="width: 14.28%;" <?php 
echo strftime('%Y%m%d', $dayTime) == $today ? 'class="today"' : '';
?>
>
					<div class="calendar-day"><?php