本文整理汇总了PHP中base::convert_date方法的典型用法代码示例。如果您正苦于以下问题:PHP base::convert_date方法的具体用法?PHP base::convert_date怎么用?PHP base::convert_date使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类base
的用法示例。
在下文中一共展示了base::convert_date方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
$base_instance->show_message('Contact not found', '', 1);
}
$datetime = $data[1]->datetime;
$firstname = $data[1]->firstname;
$lastname = $data[1]->lastname;
$telephone = $data[1]->telephone;
$fax = $data[1]->fax;
$mobile = $data[1]->mobile;
$email = $data[1]->email;
$address = $data[1]->address;
$notes = $data[1]->notes;
$company = $data[1]->company;
$url = $data[1]->url;
$category_id = $data[1]->category;
$public = $data[1]->public;
$datetime_converted = $base_instance->convert_date($datetime);
}
$html_instance->add_parameter(array('ACTION' => 'show_form', 'HEADER' => 'Edit Contact', 'FORM_ACTION' => $_SERVER['PHP_SELF'], 'BUTTON_TEXT' => 'Save Contact'));
# build category select box
$select_box = ' <select name="category_id">';
$data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['CONTACT']['CATEGORY']} WHERE user='{$userid}' ORDER BY title");
for ($index = 1; $index <= sizeof($data); $index++) {
$category_title = $data[$index]->title;
$ID = $data[$index]->ID;
if ($ID == $category_id) {
$select_box .= "<option selected value={$ID}>{$category_title}";
} else {
$select_box .= "<option value={$ID}>{$category_title}";
}
}
$select_box .= '</select> or <b>New Category:</b> <input type="text" name="new_category" value="">';
示例2: date
$ID = $data[1]->ID;
$diary_text = $data[1]->text;
$title = $data[1]->title;
} else {
$ID = '';
$diary_text = '';
$title = '';
}
}
if (empty($ID)) {
$ID_text = '';
} else {
$ID_text = '<strong>ID:</strong> ' . $ID;
}
$current_month = $diary_instance->get_month_view($month, $year);
$weekday = date('l', mktime(0, 0, 0, $month, $day, $year));
$date_converted = $base_instance->convert_date($year . '-' . $month . '-' . $day . ' 00:00:00');
$all_text .= '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="form1">
<input type="Hidden" name="day" value="' . $day . '">
<input type="Hidden" name="month" value="' . $month . '">
<input type="Hidden" name="year" value="' . $year . '">
<div align="center"><br>
<table><tr><td><table cellpadding=4 cellspacing=0 border=0 bgcolor="#ffffff" width=40% class="pastel2"><tr><td align="right"><b>Date:</b></td><td>' . $date_converted . ' - ' . $weekday . ' ' . $ID_text . '</td></tr><tr><td align="right"><b>Title:</b></td><td align="left">
<input type="text" name="title" size="65" value="' . $title . '"></td></tr><tr><td colspan=2 align=center><textarea rows=15 cols=100 name="diary_text" wrap>' . $diary_text . '</textarea></td></tr><tr><td colspan=2 align=center><input type="SUBMIT" value="Save Diary" name="save"></td></tr></form></td></tr></table>
</td><td valign="top">' . $current_month . '</td></tr></table>
</div>';
$html_instance->add_parameter(array('TEXT_CENTER' => "{$all_text}", 'BODY' => 'onLoad="javascript:document.form1.title.focus()"'));
$html_instance->process();
示例3: floor
$logins = $data[$index]->logins;
$firstname = $data[$index]->firstname;
$lastname = $data[$index]->lastname;
$newsletter_opt_in = $data[$index]->newsletter_opt_in;
if ($newsletter_opt_in == 1) {
$newsletter = 'Yes';
} else {
$newsletter = 'No';
}
if (!$firstname) {
$firstname = ' ';
}
if (!$lastname) {
$lastname = ' ';
}
$lastlogin_converted = $base_instance->convert_date($lastlogin);
$datetime_converted = $base_instance->convert_date($datetime);
$data2 = $base_instance->get_data("SELECT last_active,create_time FROM {$base_instance->entity['SESSION']['MAIN']} WHERE user='{$ID}'");
if ($data2) {
$last_active = $data2[1]->last_active;
$create_time = $data2[1]->create_time;
$online_for = floor(($now - $create_time) / 60);
$active_seconds_ago = $now - $last_active;
$active_minutes_ago = floor(($now - $last_active) / 60);
if ($active_minutes_ago == 0) {
$time_active_ago = $active_seconds_ago . ' Sec';
} else {
$time_active_ago = $active_minutes_ago . ' Min';
}
$online_for = $online_for . ' Min';
} else {
示例4: base
require 'class.base.php';
require 'class.html.php';
require 'class.user.php';
$base_instance = new base();
$html_instance = new html();
$user_instance = new user();
$user_instance->check_for_admin();
$news_id = isset($_REQUEST['news_id']) ? (int) $_REQUEST['news_id'] : exit;
if (isset($_POST['save'])) {
$base_instance->query("DELETE FROM {$base_instance->entity['NEWS']['MAIN']} WHERE ID='{$news_id}'");
header('Location: close-me.php');
exit;
}
$data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['NEWS']['MAIN']} WHERE ID='{$news_id}'");
if (!$data) {
$base_instance->show_message('News not found');
exit;
}
$datetime = $data[1]->datetime;
$text = $data[1]->text;
$title = $data[1]->title;
$text2 = substr($text, 0, 50);
$datetime_converted = $base_instance->convert_date($datetime . ' 00:00:00');
$html_instance->add_parameter(array('ACTION' => 'show_form', 'HEADER' => '<font color="#ff0000">Delete this News?</font>', 'FORM_ACTION' => $_SERVER['PHP_SELF'], 'BUTTON_TEXT' => 'Delete News'));
$html_instance->add_form_field(array('TYPE' => 'hidden', 'NAME' => 'news_id', 'VALUE' => "{$news_id}"));
if ($title) {
$text2 = "<b>{$title}</b>: {$text2}";
}
$html_instance->add_form_field(array('TYPE' => 'label', 'TEXT' => "<strong>Added:</strong> {$datetime_converted}<p>{$text2}"));
$html_instance->process();
示例5: createRequestObject
<?php
require 'class.base.php';
$base_instance = new base();
$userid = $base_instance->get_userid();
if (isset($_GET['initial'])) {
$data = $base_instance->get_data("SELECT logins,lastlogin,online_status FROM organizer_user WHERE ID={$userid}");
$user_logins = $data[1]->logins;
$user_lastlogin = $data[1]->lastlogin;
$online_status = $data[1]->online_status;
if ($online_status == 3) {
$online_status = '<tr><td><font size="2"><b><u><a href="edit-online-status.php" target="main">Status:</a></u></b></font> <font color="#FF0000" size="1">Offline</font></td></tr>';
} else {
$online_status = '';
}
$datetime_converted = $base_instance->convert_date($user_lastlogin);
$stats = '<table cellpadding="0">' . $online_status . '<tr><td><font size="2"><b><u><a href="show-account-stats.php" target="main">Logins:</a></u></b></font> <font size="1">' . $user_logins . '</font></td>
</tr><tr><td><font size="2"><b><u><a href="show-account-stats.php" target="main">Last Login:</a></u></b></font><br><font size="1">' . $datetime_converted . '</font></td></tr></table>';
} else {
$stats = '';
}
echo '<head><meta http-equiv="cache-control" content="no-cache">
', _CSS_NAV, '
<script language="JavaScript" type="text/javascript">
<!--
function createRequestObject() {
try { var requester=new XMLHttpRequest(); }
catch (error) {
try { var requester=new ActiveXObject("Microsoft.XMLHTTP"); }