本文整理汇总了PHP中sec_to_time函数的典型用法代码示例。如果您正苦于以下问题:PHP sec_to_time函数的具体用法?PHP sec_to_time怎么用?PHP sec_to_time使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sec_to_time函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetQuestInfo
function GetQuestInfo(&$data, $dataflag = QUEST_DATAFLAG_MINIMUM)
{
global $DB, $quest_class, $quest_faction_reward;
// Локализация
if ($dataflag & QUEST_DATAFLAG_LOCALE && $_SESSION['locale'] > 0) {
$loc = $_SESSION['locale'];
$row = $DB->selectRow('
SELECT
Title_loc?d AS Title_loc,
Details_loc?d AS Details_loc,
Objectives_loc?d AS Objectives_loc,
OfferRewardText_loc?d AS OfferRewardText_loc,
RequestItemsText_loc?d AS RequresItemsText_loc,
EndText_loc?d AS EndText_loc,
ObjectiveText1_loc?d AS ObjectiveText1_loc,
ObjectiveText2_loc?d AS ObjectiveText2_loc,
ObjectiveText3_loc?d AS ObjectiveText3_loc,
ObjectiveText4_loc?d AS ObjectiveText4_loc
FROM locales_quest
WHERE Id = ?d
LIMIT 1
', $loc, $loc, $loc, $loc, $loc, $loc, $loc, $loc, $loc, $loc, $data['entry']);
if ($row) {
$data = @array_merge($data, $row);
}
}
// Минимальные данные
// ID квеста
$data['Id'] = $data['Id'];
// Имя квеста
$data['Title'] = GetQuestTitle($data);
// Описания
if ($dataflag & QUEST_DATAFLAG_STRINGS) {
GetQuestStrings($data);
}
// Свойства
if ($dataflag & QUEST_DATAFLAG_PROPS) {
// Уровень квеста
$data['Level'] = $data['Level'];
// Требуемый уровень квеста
$data['MinLevel'] = $data['MinLevel'];
// Доступен расам
$data['side'] = races($data['RequiredRaces']);
// Флаги
$data['Flags'] = $data['Flags'];
// Ежедневный квест?
if ($data['Flags'] & QUEST_FLAGS_DAILY) {
$data['Daily'] = true;
}
// Тип квеста
$data['type'] = $data['Type'];
global $quest_type;
if (isset($quest_type[$data['type']])) {
$data['typename'] = $quest_type[$data['type']];
} else {
$data['typename'] = $data['type'];
}
// Путь к этому разделу (главная категория)
foreach ($quest_class as $i => $class) {
if (in_array($data['ZoneOrSort'], $class)) {
$data['maincat'] = $i;
break;
}
}
// Категория 1
$data['category'] = $data['ZoneOrSort'];
// Категория 2 ???
$data['category2'] = $data['Flags'];
// Требуемое пати
if ($data['SuggestedPlayers'] > 1) {
$data['splayers'] = $data['SuggestedPlayers'];
}
// Лимит времени
if ($data['LimitTime'] > 0) {
$data['LimitTime'] = sec_to_time($data['LimitTime']);
} else {
unset($data['LimitTime']);
}
if ($data['Flags'] & QUEST_FLAGS_SHARABLE) {
$data['Sharable'] = true;
}
if ($data['SpecialFlags'] & QUEST_SPECIALFLAGS_REPEATABLE) {
$data['Repeatable'] = true;
}
if ($data['RewardTitleId'] > 0) {
$data['titlereward'] = $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM ?_char_titles WHERE id=?d LIMIT 1', $data['RewardTitleId']);
}
}
// Награды и задания
if ($dataflag & QUEST_DATAFLAG_REWARDS) {
// Опыт/деньги@70
$data['xp'] = GetQuestXpOrMoney($data);
// Награды вещей
for ($j = 0; $j <= 6; ++$j) {
if ($data['RewardChoiceItemId' . $j] != 0 and $data['RewardChoiceItemCount' . $j] != 0) {
$data['itemchoices'][] = @array_merge(allitemsinfo($data['RewardChoiceItemId' . $j], 0), array('count' => $data['RewardChoiceItemCount' . $j]));
}
}
for ($j = 0; $j <= 4; ++$j) {
if ($data['RewardItemId' . $j] != 0 and $data['RewardItemCount' . $j] != 0) {
//.........这里部分代码省略.........
示例2: strftime
echo '<li><a class="clock inactive" href="index.php?c=' . $i . '">+</a></li>';
echo '</ul>';
echo '</div>';
echo '<div class="container">';
echo '<div class="stats">';
echo '<div class="b">';
echo '<label>start <span>' . ($c['start'] == '0000-00-00 00:00:00' ? null : strftime("%a %d %b", strtotime($c['start']))) . '</span></label>';
echo '<input type="text" readonly="readonly" style="margin-right:10px;" class="block start help" title="..." value="' . ($c['start'] == '0000-00-00 00:00:00' ? null : strftime("%H:%M:%S", strtotime($c['start']))) . '" />';
echo '</div>';
echo '<div class="b">';
echo '<label>end <span>' . ($c['end'] == '0000-00-00 00:00:00' ? null : strftime("%a %d %b", strtotime($c['end']))) . '</span></label>';
echo '<input type="text" readonly="readonly" class="block end help" title="..." value="' . ($c['end'] == '0000-00-00 00:00:00' ? null : strftime("%H:%M:%S", strtotime($c['end']))) . '" />';
echo '</div>';
echo '<div class="b">';
echo '<label>duration</label>';
echo '<input type="text" readonly="readonly" style="margin-right:10px;" class="block diff' . ($c['status'] != 1 ? ' ' : ' active') . '" value="' . sec_to_time($c['elapsed']) . '" />';
echo '</div>';
echo '<div class="b">';
echo '<label>decimal</label>';
echo '<input type="text" readonly="readonly" class="block dec' . ($c['status'] != 1 || empty($printable_decimal_time) ? ' ' : ' active') . '" value="' . printable_decimal_time($c['elapsed']) . '" />';
echo '</div>';
echo '</div>';
echo '<form method="get" id="change">';
echo '<input type="hidden" name="c" value="' . $current . '" />';
echo '<input type="text" name="desc" class="desc help" id="desc" value="' . $c['desc'] . '" title="a descriptive name." maxlength="12" /><br />';
echo '<input type="submit" class="btn" name="action" value="update"' . ($c['status'] == 1 ? ' disabled="disabled"' : null) . ' />';
echo '<input type="submit" class="btn" name="action" value="reset"' . ($c['status'] == 1 ? ' disabled="disabled"' : null) . ' /> ';
if ($c['start'] != '0000-00-00 00:00:00' && $c['end'] != '0000-00-00 00:00:00' && $c['status'] == 0) {
echo '<input class="btn big" type="submit" name="action" value="continue" />';
} else {
echo '<input class="btn big' . ($sw == 'pause' ? ' hot' : null) . '" type="submit" name="action" value="' . $sw . '" />';
示例3: get_daily_program_report
function get_daily_program_report($date)
{
$sql = "select * from tb_kategori_daily_program order by id";
$result = $this->db->query($sql)->result();
foreach ($result as $key => $value) {
$sql_child = "select d.*, ff.id as id_ff, ff.id_daily_program, ff.callsign, CONCAT_WS(' ',k.kode, jl.kode) as excercise, ff.freq, k.warna, TIME_TO_SEC(TIMEDIFF(d.time_end, d.time_start))/60 as selisih, \r\n (TIME_TO_SEC(TIMEDIFF(d.time_start, '00:00:00'))/60)-(TIME_TO_SEC(TIMEDIFF((select awal from tb_daily_time where tanggal = '" . $date . "'), '00:00:00'))/60) as start \r\n from tb_daily_program d\r\n left join tb_flight_formasi ff on (ff.id_daily_program = d.id)\r\n left join tb_kode_latihan k on (ff.id_kode_latihan = k.id)\r\n left join tb_jenis_latihan jl on (ff.id_jenis_latihan = jl.id)\r\n where d.id_kategori = '" . $value->id . "' \r\n and d.tanggal = '" . $date . "' ORDER BY d.time_start";
//echo $sql_child."<br/>";
$child = $this->db->query($sql_child)->result();
$result[$key]->program = $child;
foreach ($child as $key2 => $value2) {
$sql_child2 = "select c.id, pf.kode_dragon, pf.nama as nama_fs, p.kode_tail, c.jam_ops_total,\r\n TIME_TO_SEC(c.jam_ops_total) as total_sec, pf.id as id_penerbang_fs, pb.id as id_penerbang_bs,\r\n pb.kode_dragon as kd_dragon_bs, pb.nama as nama_bs, pf.kode_nrp as nrp_front, pb.kode_nrp as nrp_back\r\n from tb_configuration c\r\n join tb_pesawat p on (c.id_pesawat = p.id)\r\n join tb_penerbang pf on (c.id_penerbang_fs = pf.id)\r\n left join tb_penerbang pb on (c.id_penerbang_bs = pb.id)\r\n where c.id_flight_formasi = '" . $value2->id_ff . "'\r\n ";
$child2 = $this->db->query($sql_child2)->result();
$result[$key]->program[$key2]->program = $child2;
foreach ($child2 as $key3 => $value3) {
$sql_child3a = "select warna, total_resiko from tb_hurt \r\n where id_configuration = '" . $value3->id . "' \r\n and id_penerbang = '" . $value3->id_penerbang_fs . "'";
$child3a = $this->db->query($sql_child3a)->result();
$result[$key]->program[$key2]->program[$key3]->hurt_fs = $child3a;
$sql_child3b = "select warna, total_resiko from tb_hurt \r\n where id_configuration = '" . $value3->id . "' \r\n and id_penerbang = '" . $value3->id_penerbang_bs . "'";
$child3b = $this->db->query($sql_child3b)->result();
$result[$key]->program[$key2]->program[$key3]->hurt_bs = $child3b;
// CEK BENTROK PENERBANG
$sql_child3c = "select count(*) as jumlah_bentrok \r\n from tb_configuration c\r\n join tb_flight_formasi ff on (c.id_flight_formasi = ff.id)\r\n join tb_daily_program dp on (ff.id_daily_program = dp.id)\r\n where c.id_penerbang_fs = '" . $value3->id_penerbang_fs . "'\r\n and ff.tanggal = '" . $date . "'\r\n and dp.id != '" . $value2->id . "'\r\n and \r\n ('" . $value2->time_start . "' between dp.time_start and dp.time_end\r\n or '" . $value2->time_end . "' between dp.time_start and dp.time_end)\r\n ";
//echo $sql_child3c; die;
$child3c = $this->db->query($sql_child3c)->row()->jumlah_bentrok;
$result[$key]->program[$key2]->program[$key3]->bentrok_fs = $child3c;
$sql_child3d = "select count(*) as jumlah_bentrok \r\n from tb_configuration c\r\n join tb_flight_formasi ff on (c.id_flight_formasi = ff.id)\r\n join tb_daily_program dp on (ff.id_daily_program = dp.id)\r\n where c.id_penerbang_bs = '" . $value3->id_penerbang_bs . "'\r\n and ff.tanggal = '" . $date . "'\r\n and dp.id != '" . $value2->id . "'\r\n and \r\n ('" . $value2->time_start . "' between dp.time_start and dp.time_end\r\n or '" . $value2->time_end . "' between dp.time_start and dp.time_end)\r\n ";
//echo $sql_child3d; die;
$child3d = $this->db->query($sql_child3d)->row()->jumlah_bentrok;
$result[$key]->program[$key2]->program[$key3]->bentrok_bs = $child3d;
}
$sql_child3 = "select SUM(TIME_TO_SEC(c.jam_ops_total)) as total\r\n from tb_configuration c\r\n join tb_pesawat p on (c.id_pesawat = p.id)\r\n join tb_penerbang pf on (c.id_penerbang_fs = pf.id)\r\n left join tb_penerbang pb on (c.id_penerbang_bs = pb.id)\r\n where c.id_flight_formasi = '" . $value2->id_ff . "'\r\n ";
$result[$key]->program[$key2]->total_ops = $this->db->query($sql_child3)->row()->total;
$start = time_to_second($value2->time_start) + 60;
$sql_child4 = "select count(*) as jumlah\r\n from tb_daily_program \r\n where '" . time_formation(sec_to_time($start)) . ':00' . "' between time_start and time_end\r\n and tanggal = '" . $value2->tanggal . "' \r\n and id_kategori = '" . $value->id . "'\r\n and id != '" . $value2->id . "' \r\n and (time_start < '" . time_formation(sec_to_time($start)) . ':00' . "' or id < '" . $value2->id . "')\r\n ";
$result[$key]->program[$key2]->bentrok = $this->db->query($sql_child4)->row()->jumlah;
}
}
//die(json_encode($result));
return $result;
}
示例4: event_description
function event_description($entry)
{
global $DB;
$result = event_infoline(array(array('eventEntry' => $entry)));
if (is_array($result) && count($result) > 0) {
$result = reset($result);
} else {
return NULL;
}
$result['period'] = sec_to_time(intval($result['occurence']) * 60);
$result['npcs_guid'] = $DB->selectCol('SELECT guid FROM game_event_creature WHERE eventEntry=?d OR eventEntry=?d', $entry, -$entry);
$result['objects_guid'] = $DB->selectCol('SELECT guid FROM game_event_gameobject WHERE eventEntry=?d OR eventEntry=?d', $entry, -$entry);
$result['creatures_quests_id'] = $DB->select('SELECT id AS creature, quest FROM game_event_creature_quest WHERE eventEntry=?d OR eventEntry=?d GROUP BY quest', $entry, -$entry);
$result['exdesc'] = $DB->selectCell('SELECT name_loc?d FROM aowow_events WHERE id=?d', $_SESSION['locale'], $entry);
$result['exdescimg'] = $DB->selectCell('SELECT img FROM aowow_events WHERE id=?d', $entry);
$icon = $DB->selectCell('SELECT icon FROM aowow_events WHERE id=?d', $entry);
$result['icon'] = '/images/events/' . $icon;
return $result;
}
示例5: array
', $_SESSION['locale'], $_SESSION['locale'], array(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST), $quest['Id'], $_SESSION['locale']);
if ($rows) {
$quest['criteria_of'] = array();
foreach ($rows as $row) {
allachievementsinfo2($row['id']);
$quest['criteria_of'][] = achievementinfo2($row);
}
}
// Награды и благодарности, присылаемые почтой
if ($quest['RewardMailTemplateId']) {
if (!($quest['mailrewards'] = loot('mail_loot_template', $quest['RewardMailTemplateId']))) {
unset($quest['mailrewards']);
}
}
if ($quest['RewardMailDelay']) {
$quest['maildelay'] = sec_to_time($quest['RewardMailDelay']);
}
save_cache(QUEST_PAGE, $cache_key, $quest);
}
global $page;
$page = array('Mapper' => false, 'Book' => false, 'Title' => $quest['Title'] . ' - ' . $smarty->get_config_vars('Quests'), 'tab' => 0, 'type' => 5, 'typeid' => $quest['Id'], 'username' => $_SESSION['username'], 'path' => path(0, 5));
$smarty->assign('page', $page);
// Комментарии
$smarty->assign('comments', getcomments($page['type'], $page['typeid']));
$smarty->assign('screenshots', getscreenshots($page['type'], $page['typeid']));
$smarty->assign('reputation', getreputation($page['username']));
// Данные о квесте
$smarty->assign('quest', $quest);
// Количество MySQL запросов
$smarty->assign('mysql', $DB->getStatistics());
// Загружаем страницу
示例6: time_formation
?>
</td>
<td align="center"><?php
echo time_formation(sec_to_time(abs($ttl_bulan)));
?>
</td>
<td align="center"><?php
echo $start_pm_thn < 0 ? '-' : '';
?>
</td>
<td align="center"><?php
echo time_formation(sec_to_time(abs($start_pm_thn)));
?>
</td>
<td align="center"><?php
echo time_formation(sec_to_time(abs($ttl_thn_yll)));
?>
</td>
<td align="center"><?php
echo $value['sorties'];
?>
</td>
<td align="center"><?php
echo $sorties;
?>
</td>
<td align="center"><?php
echo $ttl_ytll;
?>
</td>
</tr>
示例7: home_user
public function home_user()
{
// We are gathering the data for the insert
$location = $this->session->userdata('logged_in');
$messages = '';
if ($this->input->post('calcvalues') != NULL) {
$clerk = $this->input->post('calcvalues');
$action = $this->input->post('action');
$date = date('Y-m-d');
$time = date('H:i:s');
$clerk_id = $this->load_file->get_data_extend_where('clerk', 'clerk_id, clerk_name', 'secret_no =' . $clerk);
// Check if the clerk exists or not
if ($clerk_id != NULL) {
$temp = array('locations' => $location['name']);
$location_id = $this->load_file->get_data_extend_where('locations', 'location_id', $temp);
// we get the time margins for the clock in and out of this particular clerk
$temp = $this->load_file->get_clerks($clerk_id[0]['clerk_id']);
$time_in_margin = $temp[0]['in_time_margin'];
$time_out_margin = $temp[0]['out_time_margin'];
// We check if the database has any data for this clerk at this date
$check = $this->load_file->get_data_extend_where('clerks_check', 'clerk_id, status, time', 'clerk_id =' . $clerk_id[0]['clerk_id'], $date);
// we build the array
$data_for = array('clerk_id' => $clerk_id[0]['clerk_id'], 'location_id' => $location_id[0]['location_id'], 'sign_time' => $time, 'status' => $action, 'date' => $date, 'time' => $time);
// set defaults for the check in case that they don't exist
if (!isset($check[0])) {
$check[0] = array('clerk_id' => -1, 'status' => 'not set');
}
if (!isset($check[1])) {
$check[1] = array('clerk_id' => -1, 'status' => 'not set');
}
if ($data_for['status'] == 'out' && ($check[0]['status'] == 'out' || $check[0]['status'] == 'not set')) {
$messages = '<h4 class="error_msg">You need to clock in first ' . $clerk_id[0]['clerk_name'] . '!</h4>';
// with that condition we prevent someone to clock out first
} else {
if ($action == 'in') {
######################################################
## clock IN condition ##
######################################################
if ($check[0]['clerk_id'] == $clerk_id[0]['clerk_id'] && $check[0]['status'] == $action) {
if ($check[0]['status'] == 'in' && $check[1]['status'] == 'out') {
$messages = '<h4 class="error_msg">You have finished your shift for today ' . $clerk_id[0]['clerk_name'] . '!</h4>';
} else {
$messages = '<h4 class="error_msg">You are already clocked in ' . $clerk_id[0]['clerk_name'] . '!</h4>';
}
} else {
// check the rota first
$cond = array('clerk_id' => $clerk_id[0]['clerk_id']);
$cond3 = array('status_id' => 1);
// Get the rota from the database
$time_check = $this->load_file->get_data_extend_where('clerks_list_rota', 'location_id, rota_from, status_id', $cond, $date);
// we check if it exists
if ($time_check != NULL) {
// this is for testing later is gonna be from database
$time_margin = '- ' . $time_in_margin . ' minutes';
// debug msg
echo 'the real time in is: ' . $data_for['sign_time'] . '<br>';
// we put the margin to the current time, and we move the time some minutes earlier
$data_for['sign_time'] = date('H:i:s', strtotime($time_margin));
$clock_in_time = time_to_sec($data_for['sign_time']);
$rota_in_time = time_to_sec($time_check[0]['rota_from']);
// We check the times to see if we gonna add deductions
if ($clock_in_time <= $rota_in_time) {
##
## NOTE: You can use this in order to set early clock ins
##
$messages = $messages . '<br><h4 class="norm_msg">Great! ' . $clerk_id[0]['clerk_name'] . ' are on time! ;) </h4><br>';
$data_for['sign_time'] = '00:00:00';
} else {
// debug msg //
echo 'the calculated time in is: ' . $data_for['sign_time'] . '<br>';
// We calculate how many the deductions would be and we put them to the variable for the insert
$deduction = time_filter(sec_to_time(abs($clock_in_time - $rota_in_time)));
$data_for['sign_time'] = $deduction;
$messages = $messages . '<br><h4 class="error_msg">You late for ' . $deduction . ' ' . $clerk_id[0]['clerk_name'] . '!</h4><br>';
}
} else {
$messages = '<h4 class="error_msg">Rota for ' . $clerk_id[0]['clerk_name'] . ' not found!</h4><br>';
$data_for['sign_time'] = '00:00:00';
}
// insert to database
$this->load_file->insert_data('clerks_check', $data_for);
$data_temp = array('clerk_id' => $clerk_id[0]['clerk_id'], 'location_id' => $location_id[0]['location_id'], 'sign_time' => '00:00:00', 'status' => 'out', 'date' => $date, 'time' => '00:00:00');
$this->load_file->insert_data('clerks_check', $data_temp);
$messages = $messages . '<h4 class="norm_msg">You clocked in Successfuly ' . $clerk_id[0]['clerk_name'] . '!</h4>';
}
} else {
######################################################
## clock OUT condition ##
######################################################
if ($check[1]['clerk_id'] == $clerk_id[0]['clerk_id'] && $check[1]['status'] == $action && $check[1]['time'] != '00:00:00') {
if ($check[0]['status'] == 'in' && $check[1]['status'] == 'out') {
$messages = '<h4 class="error_msg">You have finished your shift for today ' . $clerk_id[0]['clerk_name'] . '!</h4>';
} else {
$messages = '<h4 class="error_msg">You are already clocked out ' . $clerk_id[0]['clerk_name'] . '!</h4>';
}
} else {
// check the rota first
$cond = array('clerk_id' => $clerk_id[0]['clerk_id']);
$cond3 = array('status_id' => 1);
// Get the rota from the database
//.........这里部分代码省略.........
示例8: transform_point
function transform_point($at, $point)
{
$result = $point;
$result['x'] = round(100 - ($point['y'] - $at['y_min']) / (($at['y_max'] - $at['y_min']) / 100), 2);
$result['y'] = round(100 - ($point['x'] - $at['x_min']) / (($at['x_max'] - $at['x_min']) / 100), 2);
if (isset($point['spawntimesecs'])) {
$result['r'] = sec_to_time($point['spawntimesecs']);
}
unset($result['spawntimesecs']);
return $result;
}
示例9: form_hidden
$approval[] = form_hidden($value2['id']) . form_checkbox($value2['id'], $value2['approval'], $value2['approval']);
}
$this->table->set_heading($dates);
$this->table->add_row($time);
$this->table->add_row($real_time);
$this->table->add_row($approval);
echo $this->table->generate();
unset($dates);
unset($time);
unset($real_time);
unset($approval);
echo '<hr>';
// DEDUCTIONS SECTION ################################################################
$this->table->set_caption('Deductions');
$dates[] = 'Total';
$time[] = sec_to_time($clerk_list[$key]['total_deductions']);
$real_time[] = '';
$approval[] = '';
foreach ($clerk_list[$key]['deductions'] as $key_over => $value2) {
$dates[] = date('d-m-Y', strtotime($value2['date']));
$time[] = $value2['time'];
$real_time[] = $value2['real_time'];
$approval[] = form_hidden($value2['id']) . form_checkbox($value2['id'], $value2['approval'], $value2['approval']);
}
$this->table->set_heading($dates);
$this->table->add_row($time);
$this->table->add_row($real_time);
$this->table->add_row($approval);
echo $this->table->generate();
echo '<br>';
unset($dates);
示例10: time_formation
<tr>
<td colspan="2" align="center"><b>TOTAL</b></td>
<td align="center"><?php
echo time_formation($total_rencana);
?>
</td>
<td align="center"><?php
echo time_formation(sec_to_time($total_bln_ini));
?>
</td>
<td align="center"><?php
echo time_formation(sec_to_time($total_bln_bf));
?>
</td>
<td align="center"><?php
echo time_formation(sec_to_time($total_bln));
?>
</td>
<td align="center"><?php
echo round2Two($persen_tercapai);
?>
%</td>
<td></td>
</tr>
</tfoot>
</table>
<table>
<tr>
<td colspan="5"></td>
<td colspan="3" align="center">Komandan Skadron Udara 3</td>
</tr>
示例11: event_description
function event_description($entry)
{
global $DB;
$result = event_infoline(array(array('eventEntry' => $entry)));
if (is_array($result) && count($result) > 0) {
$result = reset($result);
} else {
return NULL;
}
$result['period'] = sec_to_time(intval($result['occurence']) * 60);
$result['npcs_guid'] = $DB->selectCol('SELECT guid FROM game_event_creature WHERE eventEntry=?d OR eventEntry=?d', $entry, -$entry);
$result['objects_guid'] = $DB->selectCol('SELECT guid FROM game_event_gameobject WHERE eventEntry=?d OR eventEntry=?d', $entry, -$entry);
$result['creatures_quests_id'] = $DB->select('SELECT id AS creature, quest FROM game_event_creature_quest WHERE eventEntry=?d OR eventEntry=?d GROUP BY quest', $entry, -$entry);
return $result;
}
示例12: time_formation
?>
</td>
<td align="center"><?php
echo time_formation(sec_to_time($value->total_yll));
?>
</td>
<td align="center"><?php
echo time_formation(sec_to_time($value->total_jet));
?>
</td>
<td align="center"><?php
echo time_formation(sec_to_time($value->total_propeler));
?>
</td>
<td align="center"><?php
echo time_formation(sec_to_time($value->total_jet + $value->total_propeler));
?>
</td>
<td><?php
echo $value->jabatan;
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<table>
<tr>
<td colspan="14"></td>
示例13: function
ActiveForm::end();
?>
</div>
<div class="clearfix"></div>
<?php
echo Highcharts::widget(['options' => ['title' => false, 'xAxis' => ['categories' => ArrayHelper::getColumn($returt->row, function ($element) {
return date('d.m', strtotime($element['date']));
})], 'yAxis' => ['title' => ['text' => 'Количество']], 'series' => [['name' => 'Визиты', 'data' => ArrayHelper::getColumn($returt->row, function ($element) {
return (int) $element['visits'];
})], ['name' => 'Просмотры', 'data' => ArrayHelper::getColumn($returt->row, function ($element) {
return (int) $element['page_views'];
})], ['name' => 'Посетители', 'data' => ArrayHelper::getColumn($returt->row, function ($element) {
return (int) $element['visitors'];
})], ['name' => 'Новые посетители', 'data' => ArrayHelper::getColumn($returt->row, function ($element) {
return (int) $element['new_visitors'];
})]]]]);
function sec_to_time($seconds)
{
$hours = floor($seconds / 3600);
$minutes = floor($seconds % 3600 / 60);
$seconds = $seconds % 60;
return sprintf("%d:%02d:%02d", $hours, $minutes, $seconds);
}
ArrayHelper::multisort($returt->row, 'id', SORT_DESC);
echo GridView::widget(['dataProvider' => new ArrayDataProvider(['allModels' => $returt->row]), 'columns' => [['attribute' => 'date', 'header' => 'Дата', 'value' => function ($model) {
return strftime('%e %b %Y', strtotime($model['date']));
}], ['attribute' => 'visits', 'header' => 'Визиты<br/><div style="font-size: 12px;font-weight: normal;">Всего: <strong style="float: right;">' . $returt->totals['visits'] . '</strong></div>'], ['attribute' => 'page_views', 'header' => 'Просмотры<br/><div style="font-size: 12px;font-weight: normal;">Всего:<strong style="float: right;">' . $returt->totals['page_views'] . '</strong></div>'], ['attribute' => 'visitors', 'header' => 'Посетители<br/><div style="font-size: 12px;font-weight: normal;">Всего:<strong style="float: right;">' . $returt->totals['visitors'] . '</strong></div>'], ['attribute' => 'new_visitors', 'header' => 'Новые посетители<br/><div style="font-size: 12px;font-weight: normal;">Всего:<strong style="float: right;">' . $returt->totals['new_visitors'] . '</strong></div>'], ['attribute' => 'denial', 'header' => 'Отказы<br/><div style="font-size: 12px;font-weight: normal;">Среднее:<strong style="float: right;">' . (double) str_replace(",", ".", $returt->totals['denial']) * 100 . '%</strong></div>', 'value' => function ($model) {
return (double) str_replace(",", ".", $model['denial']) * 100 . '%';
}], ['attribute' => 'depth', 'header' => 'Глубина просмотра<br/><div style="font-size: 12px;font-weight: normal;">Среднее:<strong style="float: right;">' . $returt->totals['depth'] . '</strong></div>'], ['attribute' => 'visit_time', 'header' => 'Время на сайте<br/><div style="font-size: 12px;font-weight: normal;">Всего:<strong style="float: right;">' . $returt->totals['visit_time'] . '</strong></div>', 'value' => function ($model) {
return sec_to_time($model['visit_time']);
}]]]);
示例14: array
', $_SESSION['locale'], $_SESSION['locale'], array(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST), $quest['entry'], $_SESSION['locale']);
if ($rows) {
$quest['criteria_of'] = array();
foreach ($rows as $row) {
allachievementsinfo2($row['id']);
$quest['criteria_of'][] = achievementinfo2($row);
}
}
// Награды и благодарности, присылаемые почтой
if ($quest['RewMailTemplateId']) {
if (!($quest['mailrewards'] = loot('mail_loot_template', $quest['RewMailTemplateId']))) {
unset($quest['mailrewards']);
}
}
if ($quest['RewMailDelaySecs']) {
$quest['maildelay'] = sec_to_time($quest['RewMailDelaySecs']);
}
save_cache(QUEST_PAGE, $cache_key, $quest);
}
global $page;
$page = array('Mapper' => false, 'Book' => false, 'Title' => $quest['Title'] . ' - ' . $smarty->get_config_vars('Quests'), 'tab' => 0, 'type' => 5, 'typeid' => $quest['entry'], 'path' => path(0, 5));
$smarty->assign('page', $page);
// Комментарии
$smarty->assign('comments', getcomments($page['type'], $page['typeid']));
$smarty->assign('screenshots', getscreenshots($page['type'], $page['typeid']));
// Данные о квесте
$smarty->assign('quest', $quest);
// Количество MySQL запросов
$smarty->assign('mysql', $DB->getStatistics());
// Загружаем страницу
$smarty->display('quest.tpl');
示例15: time_formation
echo time_formation(sec_to_time($nig_dual_total));
?>
</td>
<td align="center"><?php
echo time_formation($flight_total);
?>
</td>
<td align="center"><?php
echo time_formation(sec_to_time($first_total));
?>
</td>
<td align="center"><?php
echo time_formation(sec_to_time($inst_sim_total));
?>
</td>
<td align="center"><?php
echo time_formation(sec_to_time($inst_act_total));
?>
</td>
<td align="center"><?php
echo time_formation(sec_to_time($inst_fly_day));
?>
</td>
<td align="center"><?php
echo time_formation(sec_to_time($inst_fly_night));
?>
</td>
</tr>
</tbody>
<tfoot></tfoot>
</table>