本文整理汇总了PHP中convert_time函数的典型用法代码示例。如果您正苦于以下问题:PHP convert_time函数的具体用法?PHP convert_time怎么用?PHP convert_time使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了convert_time函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_time_conversions
public function test_time_conversions()
{
$this->assertEquals(172800, convert_time(2, 'days', 'seconds'));
$this->assertEquals(2880, convert_time(2, 'days', 'minutes'));
$this->assertEquals(48, convert_time(2, 'days', 'hours'));
$this->assertEquals(1, convert_time(450, 'days', 'years'));
$this->assertEquals(1209600, convert_time(2, 'weeks', 'seconds'));
$this->assertEquals(20160, convert_time(2, 'weeks', 'minutes'));
$this->assertEquals(336, convert_time(2, 'weeks', 'hours'));
$this->assertEquals(1, convert_time(60, 'weeks', 'years'));
}
示例2: date_to_select
/**
* Turn a date/timestamp into select boxes
*
* @param mixed $time
* @param string $prefix prefix elements with
* @return string
*/
function date_to_select($time = null, $name = 'date')
{
//If it is a timestamp - make an array
if (!ctype_digit($time) or !$time) {
$time = convert_time($time);
}
//Convert to an array
$time = timestamp_to_array($time);
$output = array();
foreach ($time as $type => $value) {
$output[$type] = '<select name="' . $name . '[' . $type . ']" class="' . $type . '">' . "\n";
//Create years
if ($type == 'year') {
for ($x = -2; $x <= 2; $x++) {
$year = $value + $x;
$output[$type] .= "\t" . '<option value="' . $year . '"' . ($year == $value ? ' selected="selected"' : '') . '>' . $year . '</option>' . "\n";
}
}
//Create months
if ($type == 'month') {
/*
We need to hard code the months because timezones can
throw off the PHP date function and return two month
choices that are the same.
*/
$months = array(1 => 'Jan', 2 => 'Feb', 3 => 'Mar', 4 => 'Apr', 5 => 'May', 6 => 'Jun', 7 => 'Jul', 8 => 'Aug', 9 => 'Sep', 10 => 'Oct', 11 => 'Nov', 12 => 'Dec');
for ($x = 1; $x <= 12; $x++) {
$output[$type] .= "\t" . '<option value="' . $x . '"' . ($x == $value ? ' selected="selected"' : '') . '>' . $months[$x] . '</option>' . "\n";
}
}
// Cannot caculate days based off current month! So we must just list all 32!
if ($type == 'day') {
for ($x = 1; $x < 32; $x++) {
$output[$type] .= "\t" . '<option value="' . $x . '"' . ($x == $value ? ' selected="selected"' : '') . '>' . $x . '</option>' . "\n";
}
}
if ($type == 'hour') {
for ($x = 1; $x < 24; $x++) {
$output[$type] .= "\t" . '<option value="' . $x . '"' . ($x == $value ? ' selected="selected"' : '') . '>' . $x . '</option>' . "\n";
}
}
if ($type == 'minute' or $type == 'second') {
for ($x = 0; $x < 60; $x += 5) {
$output[$type] .= "\t" . '<option value="' . $x . '"' . ($value >= $x && $value <= $x + 4 ? ' selected="selected"' : '') . '>' . $x . '</option>' . "\n";
}
}
//Close
$output[$type] .= '</select>' . "\n";
}
return $output;
}
示例3: index_json
public function index_json()
{
$dateFrom = $this->input->post('dateFrom');
$dateTo = $this->input->post('dateTo');
// do we have valid dates?
is_date($dateFrom);
is_date($dateTo);
// include timezone adjustment
$dateFromTimeZone = $this->input->post('dateFromTimeZone');
$dateToTimeZone = $this->input->post('dateToTimeZone');
// convert strings to date objects including the time zone
$dateFrom = new DateTime($dateFrom . ' ' . $dateFromTimeZone);
$dateTo = new DateTime($dateTo . ' ' . $dateToTimeZone);
// check if dateFrom is earlier than dateTo, if not then swap them over, we are caldulating
// the difference so this should be fine.
if ($dateFrom->getTimestamp() > $dateTo->getTimestamp()) {
$tempDate2 = $dateFrom;
$dateFrom = $dateTo;
$dateTo = $tempDate2;
}
// build up an objct to return as json
$numberOfDays = number_of_days($dateFrom, $dateTo);
$numberOfDaysResults = new stdClass();
$numberOfDaysResults->days = $numberOfDays;
$numberOfDaysResults->seconds = convert_time($numberOfDays, "days", "seconds");
$numberOfDaysResults->minutes = convert_time($numberOfDays, "days", "minutes");
$numberOfDaysResults->hours = convert_time($numberOfDays, "days", "hours");
$numberOfDaysResults->years = convert_time($numberOfDays, "days", "years");
$numberOfWeekDays = number_of_weekdays($dateFrom, $dateTo);
$numberOfWeekDaysResults = new stdClass();
$numberOfWeekDaysResults->days = $numberOfWeekDays;
$numberOfWeekDaysResults->seconds = convert_time($numberOfWeekDays, "days", "seconds");
$numberOfWeekDaysResults->minutes = convert_time($numberOfWeekDays, "days", "minutes");
$numberOfWeekDaysResults->hours = convert_time($numberOfWeekDays, "days", "hours");
$numberOfWeekDaysResults->years = convert_time($numberOfWeekDays, "days", "years");
$numberOfCompleteWeeks = number_of_complete_weeks($dateFrom, $dateTo);
$numberOfCompleteWeeksResults = new stdClass();
$numberOfCompleteWeeksResults->weeks = $numberOfCompleteWeeks;
$numberOfCompleteWeeksResults->seconds = convert_time($numberOfCompleteWeeks, "weeks", "seconds");
$numberOfCompleteWeeksResults->minutes = convert_time($numberOfCompleteWeeks, "weeks", "minutes");
$numberOfCompleteWeeksResults->hours = convert_time($numberOfCompleteWeeks, "weeks", "hours");
$numberOfCompleteWeeksResults->years = convert_time($numberOfCompleteWeeks, "weeks", "years");
$dateCalcResults = new stdClass();
$dateCalcResults->numberOfDays = $numberOfDaysResults;
$dateCalcResults->numberOfWeekDays = $numberOfWeekDaysResults;
$dateCalcResults->numberOfCompleteWeeks = $numberOfCompleteWeeksResults;
// output as json
$this->output->set_content_type('application/json')->set_output(json_encode($dateCalcResults));
}
示例4: tzs_tr_sh_table_record_out
function tzs_tr_sh_table_record_out($row, $form_type, $profile_td_text = null)
{
// $user_info = tzs_get_user_meta($row->user_id);
if ($form_type === 'shipments') {
$prefix = 'sh';
} else {
$prefix = 'tr';
}
$type = trans_types_to_str($row->trans_type, $row->tr_type);
$path_segment_cities = explode(";", $row->path_segment_cities);
//$cost = tzs_cost_to_str($row->cost, true);
$cost = tzs_price_query_to_str($row);
$dt_created = convert_time($row->time, "d.m.Y (Hч:iмин)");
$dt_created = explode(" ", $dt_created);
if ($row->dt_pickup != '0000-00-00 00:00:00') {
$dt_pickup = convert_time($row->dt_pickup, "d.m.Y (Hч:iмин)");
$dt_pickup = explode(" ", $dt_pickup);
} else {
$dt_pickup = '';
}
// Определение статуса записи
$output_tbody = '<tr rid="' . $row->id . '"';
if ($row->top_status == 2) {
$output_tbody .= $row->order_status == 1 ? ' class="vip_top_record"' : ($profile_td_text && $row->order_status !== null && $row->order_status == 0 ? ' class="pre_vip_top_record"' : '');
} else {
if ($row->top_status == 1) {
$output_tbody .= ' class="top_record"';
} else {
}
}
$output_tbody .= '>';
if ($profile_td_text == 'no') {
$output_tbody .= '<td><input type="radio" order-status="' . ($row->order_status == null ? '' : $row->order_status) . '" top-status="' . $row->top_status . '" order-id="' . $row->order_id . '" record-active="' . $row->active . '" id="r_table_record_id" name="r_table_record_id" value="' . $row->id . '"';
if (isset($_POST['table_record_id']) && $_POST['table_record_id'] == "{$row->id}") {
$output_tbody .= 'checked="checked"';
}
$output_tbody .= '></td>';
}
/*
<div class="record_number">
<span class="middle" title="Номер заявки">
№ '.$row->id.'
</span>
</div><br>
*/
$output_tbody .= '
<td>
<div class="date_label" title="Дата публикации заявки">
' . $dt_created[0] . '
</div>
<div class="time_label" title="Время публикации заявки">
' . str_replace(':', ' : ', $dt_created[1]) . '
</div><br>';
if ($dt_pickup != '') {
$output_tbody .= '<div class="date_label" title="Дата бесплатного поднятия заявки в ТОП">
' . $dt_pickup[0] . '
</div>
<div class="time_label" title="Время бесплатного поднятия заявки в ТОП">
' . str_replace(':', ' : ', $dt_pickup[1]) . '
</div>';
}
$output_tbody .= '</td>
<td style="min-width: 260px; width: 260px;">
<div class="tbl_trucks_path_td">
<div class="city_label">' . htmlspecialchars(tzs_get_city($row->from_sid)) . (count($path_segment_cities) > 2 ? '...' : '') . '</div>
<div class="country_flag"><img id ="first_city_flag" src="/wp-content/plugins/tzs/assets/images/flags/' . $row->from_code . '.png" width=18 height=12 alt=""></div>
</div>
<div class="tbl_trucks_dtc_td">
<div class="date_from_label" title="Дата погрузки">
' . convert_date_year2($prefix === 'tr' ? $row->tr_date_from : $row->sh_date_from) . '<br/>
</div>
</div>
<div class="tbl_trucks_path_td">
<div class="region_label">' . ($row->from_rid != NULL && $row->from_rid > 0 && $row->from_rid != 20070188 ? str_replace('область', 'обл.', htmlspecialchars(tzs_get_region($row->from_rid))) : ' ') . '</div>
</div>
<div class="tbl_distance_td2">
<div class="distance_label">
';
if ($row->distance > 0 && $prefix === 'tr') {
//$output_tbody .= ' расстояние '.tzs_make_distance_link($row->distance, false, array($row->tr_city_from, $row->tr_city_to));
$output_tbody .= ' расстояние ' . tzs_make_distance_link($row->distance, false, explode(";", $row->path_segment_cities));
} else {
if ($row->distance > 0 && $prefix === 'sh') {
//$output_tbody .= ' расстояние '.tzs_make_distance_link($row->distance, false, array($row->sh_city_from, $row->sh_city_to));
$output_tbody .= ' расстояние ' . tzs_make_distance_link($row->distance, false, explode(";", $row->path_segment_cities));
}
}
$output_tbody .= ' (см. карту)</div>';
$output_tbody .= ' </div>
<div class="tbl_trucks_path_td">
<div class="city_label">' . (count($path_segment_cities) > 2 ? '...' : '') . htmlspecialchars(tzs_get_city($row->to_sid)) . '</div>
<div class="country_flag"><img id ="second_city_flag" src="/wp-content/plugins/tzs/assets/images/flags/' . $row->to_code . '.png" width=18 height=12 alt=""></div>
</div>
<div class="tbl_trucks_dtc_td">
<div class="date_to_label" title="Дата выгрузки">
' . convert_date_year2($prefix === 'tr' ? $row->tr_date_to : $row->sh_date_to) . '
</div>
</div>
<div class="tbl_trucks_path_td">
<div class="region_label">' . ($row->to_rid != NULL && $row->to_rid > 0 && $row->to_rid != 20070188 ? str_replace('область', 'обл.', htmlspecialchars(tzs_get_region($row->to_rid))) : ' ') . '</div>';
//.........这里部分代码省略.........
示例5: mysql_query
mysql_query("UPDATE users SET money=money+" . $money . " WHERE login='" . $login . "'");
mysql_query("INSERT INTO les (user_id, take) VALUES('" . $db["id"] . "','" . $_POST['takemoney'] . "')");
$money = $money . " Зл.";
history($login, 'Нашел ', $money, $ip, 'Темный Лес');
echo "<b style='color:green'>Вы нашли " . $money . " !!!</b>";
} else {
echo "<b style='color:#ff0000'>Ничего не произошло!!!</b>";
}
} else {
if ($_SESSION['captcha_keystring'] != $_POST['keystring']) {
echo "<b style='color:#ff0000'>Ошибка при введении кода!!!</b>";
}
}
}
unset($_SESSION['captcha_keystring']);
echo "<div align=right><b style='color:#ff0000'>Ещё: " . convert_time($db['walktime']) . "</b>";
echo " <input type='button' class='btn' onclick=\"window.location='?action=vixod'\" value='Выход'></div>";
//----------------------------------------------------
if (!isset($_SESSION["xy"])) {
$_SESSION["xy"] = "9x4";
$xx = 9;
$yy = 4;
} else {
$cor = explode("x", $_SESSION["xy"]);
$xx = $cor[0];
$yy = $cor[1];
}
//------------BATLLE WHEN WALK--------------------------------------
if ($_GET["action"] == 'walk') {
$at = rand(0, 100);
if ($at > 75) {
示例6: convert_time
echo " <a href='?action=del_topic_full&fid={$fid}&tid={$tid}&id={$top_id}' style='text-decoration:none;font-size:8pt;color:#99CC99;'>[Удалить Полностью]</a>";
}
echo "</td></tr></table>";
echo "<br>" . $msg . "<br><br></td>\n\t\t\t\t</tr>";
}
echo "</table>";
}
}
if (isset($_SESSION["login"]) && $USER_DATA['forum_shut'] < time() && $USER_DATA["level"] >= 4) {
include "inc_message.php";
} else {
if (!isset($_SESSION["login"])) {
echo "<center><i>Вы не авторизованы</i></center>";
} else {
if ($USER_DATA['forum_shut'] > time()) {
echo "<center><small>Персонаж бедет молчать на форуме ещё " . convert_time($USER_DATA['forum_shut']) . " </small></center>";
}
}
}
}
?>
<table border=0 cellspacing=0 cellpadding=0 bgcolor=#d0eed0 width=100%>
<tr><td bgcolor=#003300></td></tr>
<tr><td width=30% align=right>
<?php
include "../counter.php";
?>
</td></tr>
<tr><td bgcolor=#003300></td></tr>
</table>
<div id=hint4 style="VISIBILITY: hidden; WIDTH: 240px; POSITION: absolute;top:160px; left:40px;"></div>
示例7: foreach
$abodata['listes'][$row['liste_id']]['archives'][] = $row;
}
$output->addHiddenfield('mode', 'archives');
$output->page_header();
$output->set_filenames(array('body' => 'archives_body.tpl'));
$output->assign_vars(array('TITLE' => $lang['Title']['archives'], 'L_EXPLAIN' => $lang['Explain']['archives'], 'L_VALID_BUTTON' => $lang['Button']['valid'], 'S_HIDDEN_FIELDS' => $output->getHiddenFields()));
foreach ($abodata['listes'] as $liste_id => $listdata) {
if (!isset($abodata['listes'][$liste_id]['archives'])) {
continue;
}
$num_logs = count($abodata['listes'][$liste_id]['archives']);
$size = $num_logs > 8 ? 8 : $num_logs;
$select_log = '<select id="liste_' . $liste_id . '" name="log[' . $liste_id . '][]" class="logList" size="' . $size . '" multiple="multiple" style="min-width: 200px;">';
for ($i = 0; $i < $num_logs; $i++) {
$logrow = $abodata['listes'][$liste_id]['archives'][$i];
$select_log .= '<option value="' . $logrow['log_id'] . '"> – ' . htmlspecialchars(cut_str($logrow['log_subject'], 40), ENT_NOQUOTES);
$select_log .= ' [' . convert_time('d/m/Y', $logrow['log_date']) . ']</option>';
}
$select_log .= '</select>';
$output->assign_block_vars('listerow', array('LISTE_ID' => $liste_id, 'LISTE_NAME' => $listdata['liste_name'], 'SELECT_LOG' => $select_log));
}
$output->pparse('body');
break;
default:
$output->page_header();
$output->set_filenames(array('body' => 'index_body.tpl'));
$output->assign_vars(array('TITLE' => $lang['Title']['profil_cp'], 'L_EXPLAIN' => nl2br($lang['Welcome_profil_cp'])));
$output->pparse('body');
break;
}
$output->page_footer();
示例8: sprintf
if ($num_inscrits == 1) {
$l_num_inscrits = sprintf($lang['Registered_subscriber'], wa_number_format($num_inscrits / $days));
} else {
$l_num_inscrits = $lang['No_registered_subscriber'];
}
}
if ($num_temp > 1) {
$l_num_temp = sprintf($lang['Tmp_subscribers'], $num_temp);
} else {
if ($num_temp == 1) {
$l_num_temp = $lang['Tmp_subscriber'];
} else {
$l_num_temp = $lang['No_tmp_subscriber'];
}
}
$output->build_listbox(AUTH_VIEW, false, './view.php?mode=liste');
$output->page_header();
$output->set_filenames(array('body' => 'index_body.tpl'));
if ($num_logs > 0) {
if ($num_logs > 1) {
$l_num_logs = sprintf($lang['Total_newsletters'], $num_logs, wa_number_format($num_logs / $month));
} else {
$l_num_logs = sprintf($lang['Total_newsletter'], wa_number_format($num_logs / $month));
}
$output->assign_block_vars('switch_last_newsletter', array('DATE_LAST_NEWSLETTER' => sprintf($lang['Last_newsletter'], convert_time($nl_config['date_format'], $last_log))));
} else {
$l_num_logs = $lang['No_newsletter_sended'];
}
$output->assign_vars(array('TITLE_HOME' => $lang['Title']['accueil'], 'L_EXPLAIN' => nl2br($lang['Explain']['accueil']), 'L_DBSIZE' => $lang['Dbsize'], 'L_FILESIZE' => $lang['Total_Filesize'], 'REGISTERED_SUBSCRIBERS' => $l_num_inscrits, 'TEMP_SUBSCRIBERS' => $l_num_temp, 'NEWSLETTERS_SENDED' => $l_num_logs, 'DBSIZE' => is_numeric($dbsize) ? formateSize($dbsize) : $dbsize, 'FILESIZE' => formateSize($filesize)));
$output->pparse('body');
$output->page_footer();
示例9: mysql_fetch_array
echo "<b style='color:brown'>Doyuw sisteminin Deyiwenleri:</b><BR>";
echo "creator: <b>" . $res['battle_pos'] . "</b><BR>";
echo "bid: <b>" . $res['battle'] . "</b><BR>";
echo "zayavka: <b>" . $res['zayavka'] . "</b><BR>";
echo "team: <b>" . $res['battle_team'] . "</b><hr>";
$k = mysql_fetch_array(mysql_query("SELECT * FROM teams WHERE player='" . $res['login'] . "'"));
echo "team: <b>" . (int) $k['team'] . "</b><BR>";
echo "battle_id: <b>" . (int) $k['battle_id'] . "</b><hr>";
echo "Zayava: <b>" . (int) $res['zayava'] . "</b><hr>";
echo "</TD></TR></TABLE>";
echo "<br><table width=500 class='l3' cellpadding=5 cellspacing=1><tr class='l1'><td>";
echo "<b style='color:brown'>—осто¤ние:</b><br>";
$s = mysql_query("SELECT * FROM effects LEFT JOIN scroll on scroll.id=effects.elik_id WHERE effects.user_id=" . $res["id"]);
while ($sc = mysql_fetch_array($s)) {
$kkk++;
echo "<img src='img/" . $sc["img"] . "' border=0 alt='" . $sc["name"] . "\n" . $sc["descs"] . "\n" . "≈ще " . convert_time($sc['end_time']) . "'> ";
if ($kkk % 6 == 0) {
echo "<br>";
}
}
echo "</TD></TR></TABLE>";
echo "<br><table width=500 class='l3' cellpadding=5 cellspacing=1><tr class='l1'><td>";
echo "<b style='color:brown'>”ровень брони:</b><br>";
echo " Х Ѕрон¤ головы: <b>" . ceil($res["bron_head"]) . "</b><br>\n\t\t\t Х Ѕрон¤ корпуса: <b>\t" . ceil($res["bron_corp"]) . "</b><br>\n\t\t\t Х Ѕрон¤ по¤са: <b>\t" . ceil($res["bron_poyas"]) . "</b><br>\n\t\t\t Х Ѕрон¤ ног: <b>\t\t" . ceil($res["bron_legs"]) . "</b><br><br>\n\t\t\t\n\t\t\t Х «ащита от режущего урона: <b>" . ceil($res["protect_rej"] + $effect["p_rej"]) . "</b><br>\n\t\t\t Х «ащита от дроб¤щего урона:<b>" . ceil($res["protect_drob"] + $effect["p_drob"]) . "</b><br>\n\t\t\t Х «ащита от колющего урона: <b>" . ceil($res["protect_kol"] + $effect["p_kol"]) . "</b><br>\n\t\t\t Х «ащита от руб¤щего урона: <b>" . ceil($res["protect_rub"] + $effect["p_rub"]) . "</b><br><br>\n\t\t\n\t\t\t Х «ащита от урона: <b>" . ceil($res["protect_udar"] + $effect["add_bron"] + $res["power"] * 1.5) . "</b><br>\n\t\t\t Х «ащита от магии: <b>" . ceil($res["protect_mag"] + $effect["add_mg_bron"] + $res["power"] * 1.5) . "</b><br><br>\n\t\t\t\n\t\t\t Х ѕонижение защиты от магии ќгн¤: \t<b>" . ceil($res["protect_fire"] + $effect["protect_fire"]) . "</b><br>\n\t\t\t Х ѕонижение защиты от магии ¬оды: \t<b>" . ceil($res["protect_water"] + $effect["protect_water"]) . "</b><br>\n\t\t\t Х ѕонижение защиты от магии ¬оздуха: \t<b>" . ceil($res["protect_air"] + $effect["protect_air"]) . "</b><br>\n\t\t\t Х ѕонижение защиты от магии «емли: \t<b>" . ceil($res["protect_earth"] + $effect["protect_earth"]) . "</b><br>\n\t\t\t Х ѕонижение защиты от магии —вета: \t<b>" . ceil($res["protect_svet"] + $effect["protect_svet"]) . "</b><br>\n\t\t\t Х ѕонижение защиты от магии “ьмы: \t<b>" . ceil($res["protect_tma"] + $effect["protect_tma"]) . "</b><br>\n\t\t\t Х ѕонижение защиты от —ерой магии: \t<b>" . ceil($res["protect_gray"] + $effect["protect_gray"]) . "</b><br><br>\n\t\t\t\t\n\t\t\t Х ћф.блока щитом: <b>" . ceil($res["shieldblock"]) . "</b><br><br>\n\t\n\t\t\t</td></tr></table>";
echo "<br><table width=500 class='l3' cellpadding=5 cellspacing=1><tr class='l1'>\n\t\t\t<td valign=top>";
$k1 = mysql_fetch_array(mysql_query("SELECT is_modified, add_rej, add_drob, add_kol, add_rub FROM `inv` WHERE id=" . $res["hand_r"]));
$k2 = mysql_fetch_array(mysql_query("SELECT is_modified, add_rej, add_drob, add_kol, add_rub FROM `inv` WHERE id=" . $res["hand_l"]));
$mf_rub1 = $k1["add_rub"];
$mf_kol1 = $k1["add_kol"];
$mf_drob1 = $k1["add_drob"];
$mf_rej1 = $k1["add_rej"];
示例10: foreach
$bottommenu = "<a href='?panel=all&{$getinc}bots'><b>All Bots</b></a> ||\n\t\t<a href='?panel=online&{$getinc}bots'><b>Online Bots</b></a> ||\n\t\t<a href='?panel=offline&{$getinc}bots'><b>Offline Bots</b></a> ||\n\t\t<a href='?panel=active&{$getinc}bots'><b>Active Bots</b></a> ||\n\t\t<a href='?panel=dead&{$getinc}bots'><b>Dead Bots</b></a>";
if (isset($_GET['del'])) {
$del = $db->prepare("DELETE FROM bots WHERE id = ? LIMIT 1;");
if ($del->execute(array($_GET['del']))) {
echo "Deleted";
}
}
foreach ($db->query("SELECT * FROM bots") as $bot) {
$lasttime = round($bot['connect']);
$disptime = $time - $lasttime;
if ($disptime > $knocktime) {
$lastconnect = "<span style='color: #CC0000;'>" . convert_time($disptime) . "</span>";
} else {
$lastconnect = convert_time($disptime);
}
$info = '<tr><td>' . $bot['id'] . "</td><td>" . $bot['version'] . "</td><td>" . $bot['os'] . "</td><td>" . $bot['ip'] . "</td><td>" . $bot['country'] . "</td><td>" . convert_time($bot['idle']) . "</td><td>" . $lastconnect . "</td><td style='text-align: center;'><a href='?panel={$_GET['panel']}&{$getinc}bots&del={$bot['id']}'>X</a></td></tr>";
$offlinetime = $knocktime * 3;
if ($disptime <= $offlinetime) {
$online[] = $info;
$onlinebots++;
} else {
if ($disptime <= $deadtime) {
$offlinebots++;
$offline[] = $info;
} else {
$deadbots++;
$dead[] = $info;
}
}
}
$totalbots = $onlinebots + $offlinebots;
示例11: htmlspecialchars
}
//---------------------------------------------------
if (isset($_POST['text']) && $_POST['text'] != "") {
$text = htmlspecialchars(addslashes(trim($_POST['text'])));
$text = wordwrap($text, 40, " ", 1);
$next_time = time() + 24 * 3600;
$now = time();
$find = @mysql_fetch_array(mysql_query("SELECT * FROM elka WHERE login='" . $login . "' ORDER BY time DESC LIMIT 1"));
$my_time = $find['time'];
if ($my_time <= $now) {
mysql_query("LOCK TABLES elka WRITE");
mysql_query("INSERT INTO elka (text,login,time,type,year) VALUES ('" . $text . "','" . $login . "','" . $next_time . "','" . $text_type . "','" . $year . "')");
mysql_query("UNLOCK TABLES");
$msg = " Ваше пожелание успешно добавлено...";
} else {
$msg = "Ещё: " . convert_time($my_time);
}
}
//---------------------------------------------------
//type=1 Ad gunu
//type=2 New Year
//---------------------------------------------------
?>
<body style="background-image: url(img/index/elka.jpg);background-repeat:no-repeat;background-position:top right">
<h3><?php
echo $h3;
if ($veteran) {
echo " (Вы ветеран)";
}
?>
</h3>
示例12: nl2br
echo $item['title'];
?>
</a>
<br />
<?php
echo $data['category'][$item['cate_id']];
?>
</td>
<td>
<?php
echo nl2br($item['short_text']);
?>
</td>
<td>
<?php
echo convert_time($item['created']);
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<?php
if (!empty($data['listItem'])) {
echo '<div class="dataTables_paginate paging_bootstrap">';
示例13: mysql_query
$zbm_id = $_GET['zbm_id'];
$round = $_GET['round'];
$r = mysql_query("select * from fails_zbm where id = " . $zbm_id . " order by id");
while ($m = mysql_fetch_array($r)) {
$metode = $m['metode'];
// izdzēšam ierakstu kas jau tur varētu būt
mysql_query("delete from pavadzime where import_type = 'zbm' and import_id = " . $m['id']);
mysql_query("delete from batch_fails where import_type = 'zbm' and import_id = " . $m['id']);
// insertējam jaunu ierakstu bačos
mysql_query("insert into batch_fails (nosaukums, datums, import_type, import_id) values ('" . $m['pas_nos'] . ' ' . $m['pavaddok'] . "', '" . date('Y-m-d') . "', 'zbm', " . $m['id'] . ") ");
//dabonam pēdējo baču
$rid = mysql_query("select max(id) as x from batch_fails");
$mid = mysql_fetch_array($rid);
$new_id = $mid['x'];
// insertējam jaunu ierakstu pavadzīmēs
mysql_query("insert into pavadzime (piegadataju_kods,batch_fails,piegad_grupa, kad_piegad, iecirknis, cirsmas_kods, fsc, pavadzime, transp_darba_uzd, piegad_kods, iecirknis_pieg, attalums, auto, soferis, cenu_matrica, kravas_id, import_type, import_id) select pasutitajs, {$new_id},'', '" . sqltime(convert_time($m['started'])) . "', '', '', '', pavaddok, transp_darba_uzd, '', '', 0, autonr, sofer, '', '', 'zbm', id from fails_zbm where id = " . $m['id']);
// dabonam jauno id
$rid = mysql_query("select max(id) as x from pavadzime");
$mid = mysql_fetch_array($rid);
$new_id = $mid['x'];
// updeitojam ierakstu ar jauno id
mysql_query("update fails_zbm set export_id = " . $new_id . " where id = " . $m['id']);
}
// jaunie ieraksti no fails_zbm_ui
$r = mysql_query("select * from fails_zbm_ui where fails_zbm_id = {$zbm_id} and anuled = 0 order by id");
while ($m = mysql_fetch_array($r)) {
// izdzēšam ierakstu kas jau tur varētu būt
mysql_query("delete from balkis where import_id = " . $m['id']);
// atrodam pārnestās pavadzīmes id
$rpav = mysql_query("select * from fails_zbm where id = " . $m['fails_zbm_id']);
$mpav = mysql_fetch_array($rpav);
示例14: mysql_fetch_array
<input type=button value='Вернуться' class=newbut onclick="document.location='main.php?act=go&level=remesl'">
<input type=button value='Обновить' class=newbut onClick="location.href='?act=none'">
</td>
</tr>
</table>
<div id=hint3></div>
<?php
echo "<center><font color=red><b>" . $msg . "</b></font></center><br>";
//Подача заявки
echo "\n<table width='100%'>\n\t<tr><td align=center><b>Подача заявки на проверку</b></td></tr>";
$me = mysql_fetch_array(mysql_query("SELECT * FROM proverka where login='" . $login . "'"));
if ($db["metka"] + 5 * 24 * 60 * 60 > time()) {
echo "<td align=center><I>Вы уже прошли проверку на чистоту. Будет ещё длится: <b>" . convert_time($db["metka"] + 5 * 24 * 60 * 60) . "</I></td>";
} else {
if ($db["metka"] + 20 * 24 * 60 * 60 > time()) {
echo "<td align=center><I>До следующий проверки: <b>" . convert_time($db["metka"] + 20 * 24 * 60 * 60) . "</I></td>";
} else {
if ($me["zstatus"] == 1 || $me["zstatus"] == 3) {
echo "<td align=center><I>Ваша заявка находится на рассмотрении.</I></td>";
} else {
if ($me["zstatus"] == 2) {
echo "<td align=center><font color=red><b>Состояния проверки:</b> " . $me["prichina"] . "</font></td>";
} else {
echo "<td>Для подачи заявки вам нужно иметь:<br>\n\t- Иметь при себе <b>" . $z_money[$db["level"]] . "</b> Зл.<br>\n\t- Ваш уровень должен быть равен или более <b>8-го</b><br>\n\t<input type='button' value='Подать заявку на проверку' class=input onclick='document.location.href=\"?podat=1\"'></td>";
}
}
}
}
echo "</tr>\n</table>";
//----------------------------------------
echo "\n\t<TABLE width=100% cellspacing=1 cellpadding=5 class='l3' align=center>\n\t<TR style='font-weight:bold'>\n\t\t<TD width=10% align=center>№</TD><TD width=10% align=center>Действия</TD><TD align=center>Логин</TD><TD align=center>Состояние</TD><TD align=center>Время</TD><TD align=center>Модератор</TD>\n\t</TR>";
示例15: convert_time
echo "<img src='http://www.meydan.az/img/index/travma.gif' border='0' /> ";
echo "У персонажа <b>" . $travm . ".</b> ";
echo "Ослабленна характеристика <b style='color:#ff0000'>{$kstat}-{$stats}</b> ";
echo "(Еще " . convert_time($db['travm']) . ")<br/><br/>";
}
if ($db["oslab"] > time()) {
echo "<img src='http://www.meydan.az/img/index/travma.gif' border='0' /> ";
echo "Персонаж ослаблен из-за смерти в бою, еще " . convert_time($db['oslab']) . "<br/><br/>";
}
if ($db["shut"] > time()) {
echo "<img src='http://www.meydan.az/img/index/molch.gif' border='0' /> ";
echo "Молчит еще " . convert_time($db['shut']) . "<br/><br/>";
}
if ($db["travm_protect"] > time()) {
echo "<img src='http://www.meydan.az/img/index/travm_protect.gif' border='0' />";
echo "<b>Магические способности:</b> Защита от травм, еще " . convert_time($db['travm_protect']) . "<br/><br/>";
}
echo "</div>";
}
############################################################################################################
if ($_GET["view"] == 2) {
?>
<div class="aheader">
<b>Защита</b><br/>
</div>
<div>
• Броня головы: <b><?php
echo ceil($db["bron_head"]);
?>
</b><br/>
• Броня корпуса: <b><?php