本文整理汇总了PHP中Template::header方法的典型用法代码示例。如果您正苦于以下问题:PHP Template::header方法的具体用法?PHP Template::header怎么用?PHP Template::header使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Template
的用法示例。
在下文中一共展示了Template::header方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lang
<?php
include 'core/init.php';
$template = new Template();
$logs = new Logs();
if (Input::get("action", "GET") == "clear") {
try {
Logs::Clear();
Session::Flash("logs", "success", lang('LOGS_CLEARED'), true);
} catch (Exception $ex) {
Session::Flash("logs", "danger", $ex->GetMessage(), true);
}
Redirect::To("logs.php");
}
$template->header("Logs");
if (Session::exists('logs')) {
foreach (Session::Flash('logs') as $error) {
echo "<div class='alert alert-" . $error['type'] . "' role='alert'>";
echo "<a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a>";
echo "<span class='glyphicon glyphicon-exclamation-sign' aria-hidden='true'></span>";
echo " " . $error['message'];
echo "</div>";
}
}
?>
<div class="messageBox"></div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><span class="glyphicon glyphicon-alert"></span> <?php
echo lang("logs");
示例2: date
$cache = 'cache/stats.html';
if (file_exists($cache)) {
$fromcreation = date('U') - date('U', filemtime($cache));
// hours min sec
$time = 1 * 30 * 60;
//15min
if ($fromcreation < $time) {
echo file_get_contents($cache);
exit;
}
}
require 'statsModel.php';
require 'templates/template.php';
require 'vendors.php';
$script = '<script type="text/javascript" src="js/awesomechart.js"></script>';
$out = Template::header("Statistics", $script);
$out .= Template::contentStart();
$results = new statsModel();
$stats = $results->getStats();
$out .= "<h1>General Info</h1><br/>";
$out .= "<strong>Total scans: </strong>" . $stats['total'];
$out .= "<strong> Distinct wifis: </strong>" . $stats['totalwifi'] . "<hr/>";
$out .= '<h1>Frequency Statistics</h1><br/>
<div class="charts_container">
<canvas id="frequencyCanvas" width="600" height="400">
Your web-browser does not support the HTML 5 canvas element.
</canvas>
</div>';
$datas = "";
$labels = "";
$i = 0;
示例3:
<?php
Template::header();
?>
<!-- Add your site or application content here -->
<p>Hello world! This is HTML5 Boilerplate.</p>
<?php
Template::footer();
示例4:
<?php
require_once 'templates/template.php';
echo Template::header("Index");
echo Template::contentStart();
?>
<h1>Open Wifi Statistics</h1>
<p>This is Open Wifi Statistics project Web Interface.</p>
<h2>Interesting Links</h2>
<p>
<a href="https://github.com/uberspot/OpenWifiStatistics-web">Web Interface @ Github</a><br/>
<a href="https://github.com/uberspot/OpenWifiStatistics">Android Client @ Github</a><br/>
<a href="https://play.google.com/store/apps/details?id=com.ows.OpenWifiStatistics#?t=W251bGwsMSwxLDUwMSwiY29tLm93cy5PcGVuV2lmaVN0YXRpc3RpY3MiXQ..">Android Client @ Google Play</a><br/>
</p>
<?php
echo Template::contentEnd();
echo Template::footer();
示例5: contact
public function contact()
{
$l_oTemplate = new Template();
$l_oTemplate->header($this->m_sSubject);
$l_oTemplate->info(['Name' => $this->m_sName, 'Email' => $this->m_sEmail]);
$l_oTemplate->message('Enquiry', $this->m_sMessage);
$l_oTemplate->footer();
$this->m_sMailBody = $l_oTemplate->emailTemplate();
return $this->submit();
}
示例6: Template
<?php
/**
* Author: Rene Kremer
* Date: 20.08.15
* Time: 13:27
* Version 1.0
*
* Description: Main App to roll the dices
*/
include 'templates/template.class.php';
include "dice.class.php";
$template = new Template("templates", "img");
$template->header();
$template->head();
// check if first time or reroll
if (isset($_GET["dice"]) || isset($_GET["numberOfDices"])) {
$dice = new Dice($_GET["dice"], $_GET["numberOfDices"]);
$value = $_GET["dice"];
} else {
if (isset($_POST["dice"]) && isset($_POST["dice"])) {
$dice = new Dice($_POST["dice"], $_POST["numberOfDices"]);
$value = $_POST["dice"];
} else {
//echo file_get_contents("templates/errorWrongDice.tpl");
return false;
}
}
if (!$dice->wrongDice && $template->showDice($value)) {
$dice->roll();
}
示例7: lang
Session::Flash("usersPage", "success", lang('USERS_ACCOUNT_ACTIVE_SUCCESS'), true);
} catch (Exception $ex) {
Session::Flash("usersPage", "danger", $ex->GetMessage(), true);
}
}
if (Input::get("deactivate") && $user->hasPermission("admin") && Input::get("checkbox")) {
try {
foreach (Input::get("checkbox") as $checkbox) {
$user->deactivate($checkbox);
}
Session::Flash("usersPage", "success", lang('USERS_ACCOUNT_DEACTIVE_SUCCESS'), true);
} catch (Exception $ex) {
Session::Flash("usersPage", "danger", $ex->GetMessage(), true);
}
}
$template->header("Users");
if (Session::exists('usersPage')) {
foreach (Session::Flash('usersPage') as $error) {
echo "<div class='alert alert-" . $error['type'] . "' role='alert'>";
echo "<a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a>";
echo "<span class='glyphicon glyphicon-exclamation-sign' aria-hidden='true'></span>";
echo " " . $error['message'];
echo "</div>";
}
}
?>
<div class="messageBox"></div>
<script>
$(document).ready(function(){
var editUserModel = $('#editUser');
var userId;
示例8: Posts
<?php
include 'core/init.php';
$posts = new Posts();
$template = new Template();
if (Input::get("action", "GET") == "delete" && Input::Get("id", "GET")) {
try {
$posts->delete(Input::Get("id", "GET"));
Session::Flash("posts", "success", lang('POST_DELETED_SUCCESS'), true);
} catch (Exception $ex) {
Session::Flash("posts", "danger", $ex->GetMessage(), true);
}
Redirect::To("posts.php");
}
$template->header("Posts");
if (Session::exists('posts')) {
foreach (Session::Flash('posts') as $error) {
echo "<div class='alert alert-" . $error['type'] . "' role='alert'>";
echo "<a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a>";
echo "<span class='glyphicon glyphicon-exclamation-sign' aria-hidden='true'></span>";
echo " " . $error['message'];
echo "</div>";
}
}
?>
<div class="messageBox"></div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><span class="glyphicon glyphicon-duplicate"></span> <?php
示例9: lang
$user->update(array('fbuserid' => Input::get('fbuserid')), $user->data()->id);
}
// Update password
if (Input::Get("password")) {
$salt = Hash::salt(32);
$user->update(array('password' => Hash::make(Input::get('password'), $salt), "salt" => $salt), $user->data()->id);
}
Session::Flash("settings", "success", lang('SETTINGS_UPDATED_SUCCESS'), true);
} catch (Exception $e) {
echo $e->getMessage();
}
} else {
Session::Flash("settings", "danger", "<ul><li>" . implode("</li><li>", $validation->errors()) . "</li></ul>", false);
}
}
$template->header("Settings");
if (Session::exists('settings')) {
foreach (Session::Flash('settings') as $error) {
echo "<div class='alert alert-" . $error['type'] . "' role='alert'>";
echo "<a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a>";
echo $error['message'];
echo "</div>";
}
}
?>
<div class="messageBox"></div>
<form method='POST' action='' class="settings">
<div class="row">
<div class="tabbable tabs-left">
<div class="col-xs-3">
<ul class="nav nav-tabs">
示例10: statsModel
<?php
require_once 'statsModel.php';
require_once 'statModel.php';
require_once 'templates/template.php';
$results = new statsModel();
$order = 0;
if (isset($_GET['order'])) {
$order = $_GET['order'];
}
/* Presentation */
$script = '<script type="text/javascript" src="js/morebutton.js"></script>';
echo Template::header("Results");
echo Template::contentStart();
echo "\n\t<table id='resulttable'>";
switch ($order) {
case 0:
echo "<tr><th><a href='?order=2'>Date ↺</a></th>\n\t\t<th>BSSID</th><th>SSID</th>\n\t\t<th><a href='?order=4'>Capabilities ↺</a></th><th>Frequency</th>\n\t\t<th><a href='?order=6'>Power ↺</a></th><th>Provider</th></tr>";
break;
case 2:
echo "<tr><th><a href='?order=3'>Date ↓</a></th>\n\t\t<th>BSSID</th><th>SSID</th>\n\t\t<th><a href='?order=4'>Capabilities ↺</a></th><th>Frequency</th>\n\t\t<th><a href='?order=6'>Power ↺</a></th><th>Provider</th></tr>";
break;
case 3:
echo "<tr><th><a href='?order=2'>Date ↑</a></th>\n\t\t<th>BSSID</th><th>SSID</th>\n\t\t<th><a href='?order=4'>Capabilities ↺</a></th><th>Frequency</th>\n\t\t<th><a href='?order=6'>Power ↺</a></th><th>Provider</th></tr>";
break;
case 4:
echo "<tr><th><a href='?order=2'>Date ↺</a></th>\n\t\t<th>BSSID</th><th>SSID</th>\n\t\t<th><a href='?order=5'>Capabilities ↓</a></th><th>Frequency</th>\n\t\t<th><a href='?order=6'>Power ↺</a></th><th>Provider</th></tr>";
break;
case 5:
echo "<tr><th><a href='?order=2'>Date ↺</a></th>\n\t\t<th>BSSID</th><th>SSID</th>\n\t\t<th><a href='?order=4'>Capabilities ↑</a></th><th>Frequency</th>\n\t\t<th><a href='?order=6'>Power ↺</a></th><th>Provider</th></tr>";
break;
示例11: Template
<?php
/**
* Author: Rene Kremer
* Date: 20.08.15
* Time: 13:27
* Version: 1.0
*/
include 'templates/template.class.php';
$template = new Template("templates", "img");
$template->header("header.tpl");
$template->head("head.tpl");
$template->openContent();
$template->setContent('<p>This app rolls a given number of dices</p>
<form action="rollDice.php" method="post">
<table>
<tr>
<td>Number of Dices:</td>
<td><input name="numberOfDices" placeholder="Default is 1"/></td>
</tr>
</table>
<table>
<tr>
<td><label><input type="radio" name="dice" value="d4"/><img src="img/d4.png" alt="d4"/></label></td>
<td><label><input type="radio" name="dice" value="d6"/><img src="img/d6.png" alt="d6"/></label></td>
<td><label><input type="radio" name="dice" value="d8"/><img src="img/d8.png" alt="d8"/></label></td>
</tr>
<tr>
<td/>
<td><label><input type="radio" name="dice" value="d10"/><img src="img/d10.png" alt="d10"/></label></td>
示例12: Template
<?php
include 'core/init.php';
$template = new Template();
$template->header("Upgrade");
echo "<div class='alert alert-danger'>Note: This upgrade is for version >= 1.5.2 ONLY, if you have old version (<1.5.2) you need to re-install the script.</div>";
try {
DB::GetInstance()->Query("ALTER TABLE `user_options` ADD COLUMN uniqueLink text");
} catch (Exception $e) {
}
try {
DB::GetInstance()->Query("ALTER TABLE `fbapps` ADD COLUMN app_auth_link text");
} catch (Exception $e) {
}
try {
DB::GetInstance()->Query("CREATE TABLE groups_category (\r\n\t\tid integer PRIMARY KEY AUTOINCREMENT,\r\n\t\tuser_id INTEGER,\r\n\t\tfb_id varchar(32),\r\n\t\tgroups text,\r\n\t\tcategory_name varchar(64),\r\n\t\tcreated_at datetime,\r\n\t\tupdated_at datetime\r\n\t)");
} catch (Exception $e) {
}
echo "<div class='alert alert-success'>Your script has been updated to the version 1.6.3</div>";
$template->footer();
示例13: MarkerClusterer
for (var i in $.goMap.markers) {
var temp = $($.goMap.mapId).data($.goMap.markers[i]);
if(temp.group == group || group == \'all\') {
markers.push(temp);
}
}
markerclusterer.clearMarkers();
markerclusterer = new MarkerClusterer($.goMap.map, markers);
addClusterListeners();
});
});
</script>';
$out = Template::header("Map", $script);
$out .= '<div id="map-box"><div id="map"></div></div>';
$out .= '<select id="group">
<option value="all">Show all wifi spots</option>
<option value="g1">Show only open</option>
<option value="g2">Show only wep</option>
<option value="g3">Show only the rest</option>
</select>';
$out .= '<img class="img" src="img/1.png" alt="open marker" /> O (OPEN) •
<img class="img" src="img/2.png" alt="wep marker" /> W (WEP) •
<img class="img" src="img/3.png" alt="other marker" /> S (OTHER SECURE)';
$out .= Template::footer();
$file = fopen($cache, 'w');
fwrite($file, $out);
fclose($file);
echo file_get_contents($cache);