本文整理汇总了PHP中include_template函数的典型用法代码示例。如果您正苦于以下问题:PHP include_template函数的具体用法?PHP include_template怎么用?PHP include_template使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了include_template函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_time_sheets_list_for_classes
function show_time_sheets_list_for_classes($template_name, $doAdmin = false)
{
$current_user =& singleton("current_user");
global $TPL;
if ($doAdmin) {
$db = get_pending_admin_timesheet_db();
} else {
$db = get_pending_timesheet_db();
}
$people =& get_cached_table("person");
while ($db->next_record()) {
$timeSheet = new timeSheet();
$timeSheet->read_db_record($db);
$timeSheet->set_values();
unset($date);
if ($timeSheet->get_value("status") == "manager") {
$date = $timeSheet->get_value("dateSubmittedToManager");
} else {
if ($timeSheet->get_value("status") == "admin") {
$date = $timeSheet->get_value("dateSubmittedToAdmin");
}
}
unset($TPL["warning"]);
// older than $current_user->prefs["timeSheetDaysWarn"] days
if ($date && imp($current_user->prefs["timeSheetDaysWarn"]) && (mktime() - format_date("U", $date)) / 60 / 60 / 24 > $current_user->prefs["timeSheetDaysWarn"]) {
$TPL["warning"] = page::help("This time sheet was submitted to you over " . $current_user->prefs["timeSheetDaysWarn"] . " days ago.", page::warn());
}
$TPL["date"] = "<a href=\"" . $TPL["url_alloc_timeSheet"] . "timeSheetID=" . $timeSheet->get_id() . "\">" . $date . "</a>";
$TPL["user"] = $people[$timeSheet->get_value("personID")]["name"];
$TPL["projectName"] = $db->f("projectName");
include_template("../time/templates/" . $template_name);
}
}
示例2: show_filter
function show_filter($template)
{
global $TPL;
show_skill_classes();
show_skills();
include_template($template);
}
示例3: show_overdue
function show_overdue($template_name)
{
global $db;
global $TPL;
$current_user =& singleton("current_user");
$db = new db_alloc();
$temp = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
$today = date("Y", $temp) . "-" . date("m", $temp) . "-" . date("d", $temp);
$q = prepare("SELECT itemName,itemType,item.itemID,dateBorrowed,dateToBeReturned,loan.personID \n FROM loan,item \n WHERE dateToBeReturned < '%s' \n\t\t\t\t\t AND dateReturned = '0000-00-00' \n\t\t\t\t\t AND item.itemID = loan.itemID\n ", $today);
if (!have_entity_perm("loan", PERM_READ, $current_user, false)) {
$q .= prepare("AND loan.personID = %d", $current_user->get_id());
}
$db->query($q);
while ($db->next_record()) {
$i++;
$item = new item();
$loan = new loan();
$item->read_db_record($db);
$loan->read_db_record($db);
$item->set_values();
$loan->set_values();
$person = new person();
$person->set_id($loan->get_value("personID"));
$person->select();
$TPL["person"] = $person->get_name();
$TPL["overdue"] = "<a href=\"" . $TPL["url_alloc_item"] . "itemID=" . $item->get_id() . "&return=true\">Overdue!</a>";
include_template($template_name);
}
}
示例4: get_list_html
function get_list_html($rows = array(), $ops = array())
{
global $TPL;
$TPL["wikiListRows"] = $rows;
$TPL["_FORM"] = $ops;
include_template(dirname(__FILE__) . "/../templates/wikiListS.tpl");
}
示例5: show_expenseFormList
function show_expenseFormList($template_name)
{
global $db;
global $TPL;
global $transactionRepeat;
$current_user =& singleton("current_user");
$db = new db_alloc();
$transactionRepeat = new transactionRepeat();
if (!$_GET["tfID"] && !$current_user->have_role("admin")) {
$tfIDs = $current_user->get_tfIDs();
$tfIDs and $sql = prepare("WHERE tfID in (%s)", $tfIDs);
} else {
if ($_GET["tfID"]) {
$sql = prepare("WHERE tfID = %d", $_GET["tfID"]);
}
}
$db->query("select * FROM transactionRepeat " . $sql);
while ($db->next_record()) {
$i++;
$transactionRepeat->read_db_record($db);
$transactionRepeat->set_values();
$TPL["tfName"] = tf::get_name($transactionRepeat->get_value("tfID"));
$TPL["fromTfName"] = tf::get_name($transactionRepeat->get_value("fromTfID"));
include_template($template_name);
}
$TPL["tfID"] = $tfID;
}
示例6: show_timeSheetItems
function show_timeSheetItems($template_name)
{
global $date_to_view;
$current_user =& singleton("current_user");
global $TPL;
$query = prepare("SELECT * \n FROM timeSheetItem \n LEFT JOIN timeSheet ON timeSheetItem.timeSheetID = timeSheet.timeSheetID\n LEFT JOIN project ON timeSheet.projectID = project.projectID\n WHERE dateTimeSheetItem='%s'\n AND timeSheet.personID=%d", date("Y-m-d", $date_to_view), $current_user->get_id());
$db = new db_alloc();
$db->query($query);
while ($db->next_record()) {
$timeSheetItem = new timeSheetItem();
$timeSheetItem->read_db_record($db);
$timeSheetItem->set_values();
if ($timeSheetItem->get_value("unit") == "Hour") {
$TPL["daily_hours_total"] += $timeSheetItem->get_value("timeSheetItemDuration");
}
$project = new project();
$project->read_db_record($db);
$project->set_values();
if ($project->get_value("projectShortName")) {
$TPL["item_description"] = $project->get_value("projectShortName");
} else {
$TPL["item_description"] = $project->get_value("projectName");
}
include_template($template_name);
}
}
示例7: show_users_stats
function show_users_stats($template)
{
global $TPL;
global $db;
$stats = new stats();
$projects = $stats->project_stats();
$tasks = $stats->task_stats();
$comments = $stats->comment_stats();
$persons = array();
$query = "SELECT * FROM person ORDER BY username";
$db->query($query);
while ($db->next_record()) {
$person = new person();
$person->read_db_record($db);
array_push($persons, $person->get_id());
}
usort($persons, "compare");
for ($i = 0; $i < count($persons); $i++) {
$person = new person();
$person->set_id($persons[$i]);
$person->select();
$TPL["user_username"] = $person->get_value("username");
$TPL["user_projects_current"] = $projects["current"][$person->get_id()] + 0;
$TPL["user_projects_total"] = $projects["current"][$person->get_id()] + $projects["archived"][$person->get_id()];
$TPL["user_tasks_current"] = $tasks["current"][$person->get_id()] + 0;
$TPL["user_tasks_total"] = $tasks["current"][$person->get_id()] + $tasks["completed"][$person->get_id()];
$TPL["user_comments_total"] = $comments["total"][$person->get_id()] + 0;
$TPL["user_graph"] = "<a href=\"" . $TPL["url_alloc_statsImage"] . "id=" . $person->get_id() . "&width=640&multiplier=8&labels=true\">";
$TPL["user_graph"] .= "<img alt=\"User graph\" src=\"" . $TPL["url_alloc_statsImage"] . "id=" . $person->get_id() . "&width=400&multiplier=2\"></a>";
if ($TPL["user_projects_total"] + $TPL["user_tasks_total"] + $TPL["user_comments_total"] > 0) {
$TPL["odd_even"] = $TPL["odd_even"] == "odd" ? "even" : "odd";
include_template($template);
}
}
}
示例8: show_filter
function show_filter()
{
global $TPL;
global $defaults;
$arr = timeSheetGraph::load_filter($defaults);
is_array($arr) and $TPL = array_merge($TPL, $arr);
include_template("templates/timeSheetGraphFilterS.tpl");
}
示例9: show_new_person
function show_new_person($template)
{
global $TPL;
$TPL["person_buttons"] = '
<button type="submit" name="person_save" value="1" class="save_button">Add<i class="icon-plus-sign"></i></button>';
$tfPerson = new tfPerson();
$tfPerson->set_values("person_");
include_template($template);
}
示例10: show
function show()
{
global $TPL;
if ($this->template) {
//$TPL["this"] = $this;
$TPL[$this->module] = $this;
include_template($this->get_template_dir() . $this->template);
}
}
示例11: show_filter
function show_filter()
{
global $TPL;
global $defaults;
$_FORM = transaction::load_form_data($defaults);
$arr = transaction::load_transaction_filter($_FORM);
is_array($arr) and $TPL = array_merge($TPL, $arr);
include_template("templates/searchTransactionFilterS.tpl");
}
示例12: show_filter
function show_filter()
{
global $TPL;
global $defaults;
$_FORM = timeSheet::load_form_data($defaults);
$arr = timeSheet::load_timeSheet_filter($_FORM);
is_array($arr) and $TPL = array_merge($TPL, $arr);
include_template("templates/timeSheetListFilterS.tpl");
}
示例13: show_filter
function show_filter()
{
global $TPL;
global $defaults;
$_FORM = person::load_form_data($defaults);
$arr = person::load_person_filter($_FORM);
is_array($arr) and $TPL = array_merge($TPL, $arr);
include_template("templates/personListFilterS.tpl");
}
示例14: template_part
/**
* Locates and loads a theme template.
*
* Replacement for WordPress function get_template_part()
*
* @see get_template_part()
*
* @param string $slug Template slug.
* @param string $name [Optional] Optional template name.
* @return void
*/
function template_part($slug, $name = null)
{
$slug = App::instance()->get('theme')->getTemplatePartPath($slug);
do_action("get_template_part_{$slug}", $slug, $name);
$templates = array();
if (!empty($name)) {
$templates[] = "{$slug}-{$name}.php";
}
$templates[] = "{$slug}.php";
include_template(locate_template($templates));
}
示例15: show_productCost_new
function show_productCost_new($template, $percent = false)
{
global $TPL;
$t = new meta("currencyType");
$currency_array = $t->get_assoc_array("currencyTypeID", "currencyTypeID");
$productCost = new productCost();
$productCost->set_values();
// wipe clean
$TPL["currencyOptions"] = page::select_options($currency_array, $productCost->get_value("currencyTypeID"));
$TPL["taxOptions"] = page::select_options(array("" => "Exempt", 1 => "Included", 0 => "Excluded"), "1");
$TPL["display"] = "display:none";
include_template($template);
}