/** * Display an event * [event title="Our event" text="A bit of information" date="YYYY-MM-DD" url="http://example.com/example"] */ function event_shortcode($atts) { if (!isset($atts['title']) || !isset($atts['date'])) { return; } $event = array('day' => get_day($atts['date']), 'month' => get_month($atts['date']), 'year' => get_year($atts['date']), 'title' => isset($atts['title']) ? $atts['title'] : null, 'desc' => isset($atts['text']) ? $atts['text'] : null, 'url' => isset($atts['url']) ? $atts['url'] : null); $link = '<a class="Type-ignore Event Event--linked" href="' . $event['url'] . '">'; $open = $event['url'] ? $link : '<div class="Event">'; $close = $event['url'] ? '</a>' : '</div>'; return '<div class="Type-event u-cf">' . $open . '<div class="Event-figure"> <div class="Event-date"> <span>' . $event['month'] . '</span> <span>' . $event['year'] . '</span> </div> <div class="Event-day"> <span>' . $event['day'] . '</span> </div> </div> <div class="Event-body"> <div class="Type Type--plain"> <span class="Event-title">' . $event['title'] . '<br></span> <span class="u-colorGreen u-sm-show">' . $event['desc'] . '</span> </div> </div>' . $close . '</div>'; }
function to_dateline($dt) { $m = get_month($dt); $y = get_year($dt); $d = intval(get_day($dt)); return $m . " " . $d . ", " . $y; }
function date_to_pdf($date) { $day = get_day($date); $month = get_month($date); monthnum_to_thai($month); $year = get_year($date); $year = gen_year($year); $day = check_zero_num($day); $date = $day . " " . $month . " " . $year; return $date; }
function get_events() { $num = 1; $events = array(); while ($num <= 4) { $date = get_field('event_' . $num . '_date'); $event = array('day' => get_day($date), 'month' => get_month($date), 'year' => get_year($date), 'title' => get_field('event_' . $num . '_title'), 'desc' => get_field('event_' . $num . '_desc'), 'url' => get_field('event_' . $num . '_url')); if ($event['day'] && $event['title']) { array_push($events, $event); } $num++; } return $events; }
function apprentice($id) { $ci = get_model(); $data['employee'] = $ci->db->where('id', $id)->get('employee')->result(); $check = $data['employee'][0]->firstday; $day = strtotime("+3 month"); $now = strtotime("now"); $day = $day - $now; $check = strtotime($check); $get = $check + $day; $get = date(Y . "-" . m . "-" . d, $get); $day3 = get_day($get); $month = get_month($get); $year = get_year($get); $year = gen_year($year); $day3 = check_zero_num($day3); $end['end'] = $day3 . " " . $month . " " . $year; $end['end2'] = $month . " " . $year; return $end; }
function gen_colour() { $month = get_month(); $hour = get_hour(); /*$weather = do_mysql ("SELECT weather FROM maps;"); $weather = mysql_result ($weather, 0);*/ switch ($month) { case 1: include 'modules/sp/sp_colour_1.php'; break; case 2: include 'modules/sp/sp_colour_2.php'; break; case 3: include 'modules/sp/sp_colour_3.php'; break; case 4: include 'modules/sp/sp_colour_4.php'; break; case 5: include 'modules/sp/sp_colour_5.php'; break; case 6: include 'modules/sp/sp_colour_6.php'; break; case 7: include 'modules/sp/sp_colour_7.php'; break; case 8: include 'modules/sp/sp_colour_8.php'; break; case 9: include 'modules/sp/sp_colour_9.php'; break; case 10: include 'modules/sp/sp_colour_10.php'; break; case 11: include 'modules/sp/sp_colour_11.php'; break; case 12: include 'modules/sp/sp_colour_12.php'; break; } /* //unset ($NIGHT); //$NIGHT = 1; //unset ($MORNING); //$MORNING = 1; //unset ($DAY); //$DAY = 1; global $UND; if ($UND) $NIGHT = 1; $colour[6] = '#000000'; // osnovnoj tekst $colour[7] = '#0000aa'; // sinie ssylki $colour[8] = '#ff0000'; // krasnye ssylki if (isset ($NIGHT)) { //$colour[3] = '#B5B5B5'; // main for <p> //$colour[4] = '#CFCFCF'; // fair //$colour[5] = '#9C9C9C'; // dark $colour[3] = '#2a2a40'; // main for <p> $colour[4] = '#44444a'; // fair $colour[5] = '#000000'; // dark $colour[6] = '#DEDEF1'; // osnovnoj tekst $colour[7] = '#EBE916'; // "sinie" ssylki $colour[8] = '#ff0000'; // "krasnye" ssylki } else if (isset ($MORNING)) { $colour[3] = '#fef6f8'; // main for <p> $colour[4] = '#fef1f4'; // fair $colour[5] = '#feecf1'; // dark } else if (isset ($DAY)) { $colour[3] = '#FDFBF0'; // main for <p> $colour[4] = '#FFFFFB'; // fair $colour[5] = '#FDFAD9'; // dark } else { //$colour[3] = '#f9eac1'; // main for <p> //$colour[4] = '#faf0d5'; // fair //$colour[5] = '#fee5a2'; // dark $colour[3] = '#f9eac1'; // main for <p> $colour[4] = '#faf0d5'; // fair $colour[5] = '#fee5a2'; // dark $colour[6] = '#000000'; // osnovnoj tekst $colour[7] = '#0000aa'; // sinie ssylki $colour[8] = '#ff0000'; // krasnye ssylki }*/ $colour[3] = '#FDFBF0'; // main for <p> $colour[4] = '#FFFFFB'; // fair $colour[5] = '#FDFAD9'; // dark $colour[6] = '#000000'; // osnovnoj tekst $colour[7] = '#0000aa'; // sinie ssylki $colour[8] = '#ff0000'; // krasnye ssylki return $colour; }
function get_month_name($date) { $monthname = 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"); return $monthname[get_month($date)]; }
?> </div> </div> <div class="form-group"> <label for="kategori" class="col-sm-3 control-label">End Date *</label> <div class="col-sm-9"> <?php echo form_input(array('name' => 'enddate', 'type' => 'date', 'value' => isset($_POST['enddate']) ? $_POST['enddate'] : set_value('enddate'), 'class' => 'form-control')); ?> </div> </div> <div class="form-group"> <label for="kategori" class="col-sm-3 control-label">Month *</label> <div class="col-sm-3"> <?php echo form_dropdown('month', get_month(), isset($_POST['month']) ? $_POST['month'] : set_value('month'), 'class="form-control col-md-3"'); ?> </div> <div class="col-sm-3"> <?php echo form_dropdown('year', array('2014' => '2014', '2015' => '2015'), isset($_POST['year']) ? $_POST['year'] : set_value('year'), 'class="form-control col-md-3"'); ?> </div> </div> <div class="form-group"> <?php //echo form_label('Parent Kategori', 'sub_kategori', array('class'=>"col-sm-3 control-label")) ?> <label for="kategori" class="col-sm-3 control-label">Tahun *</label> <div class="col-sm-9"> <?php
$pdf->SetXY(98, 263); $pdf->Write(0, $date_create[8] . $date_create[9]); //Наименование страхователя $unit_data = mysql_fetch_assoc(mysql_query("SELECT * FROM `unit` WHERE `unit_id` = '" . $contract_data['unit_id'] . "'")); if ($unit_data['unit_full_name'] == 'Физические лица') { $agent_data = mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `user_id` = '" . $contract_data['user_id'] . "'")); $agent = $agent_data['second_name'] . ' ' . $agent_data['first_name'] . ' ' . $agent_data['third_name']; $agent = iconv('utf-8', 'windows-1251', $agent); } elseif ($unit_data['unit_id'] == '44') { #Для нефтеюганска выходило наименование филиала.. просисили убрать $agent = ''; } else { $agent = iconv('utf-8', 'windows-1251', $unit_data['unit_full_name']); } $pdf->SetXY(135, 283); $pdf->Write(0, $agent); //Дата выдачи полиса $pdf->SetXY(52 + 27, 290); $pdf->Write(0, $date_create[0] . $date_create[1]); $month = get_month($date_create[3] . $date_create[4]); $month = iconv('utf-8', 'windows-1251', $month); $pdf->SetXY(68 + 27, 290); $pdf->Write(0, $month); $pdf->SetXY(98 + 26, 290); $pdf->Write(0, $date_create[8] . $date_create[9]); // echo "<pre>"; // print_r($date_create); // echo "</pre>"; // exit(); //Отдаём готовый pdf. D - выдаст запрос на скачивание. I - отобразит в браузере $pdf->Output('policy.pdf', 'I');
function create_archive($date) { foreach ($date as $year => $month) { $occurences = array_count_values($month); echo "<li><a href='#'>{$year}</a></li>"; $month = array_unique($month); asort($month); foreach ($month as $key) { echo "<ul><li><a href='archive/{$year}/{$key}'>" . get_month($key) . "</a>(" . $occurences[$key] . ")</li></ul>"; } } }
foreach ($rop_suspended_providers as $provider) { if (in_array(get_provider_info_by_id($row['providerid'], 'title'), $suspended) && get_provider_info_by_id($row['providerid'], 'title') == $provider['orgname']) { echo $provider['reason']; } } ?> </td> </tr> <?php } } else { if (in_array(get_provider_info_by_id($row['providerid'], 'title'), $suspended)) { $values[] = $row['providerid']; if ($row['providerid'] != 0 && get_month($month) == get_month(date('m', date_to_seconds($row['datereceived'])))) { $values[] = $row['providerid']; ?> <tr> <td><?php echo get_bid_invitation_info($row['bid_id'], 'procurement_ref_no'); ?> </td> <td><?php echo get_bid_invitation_info($row['bid_id'], 'procurement_method'); ?> </td> <td style="text-align: right;"><?php echo get_bid_invitation_info($row['bid_id'], 'procurement_value'); ?> </td>
function tep_date_only($date) { if (!is_int($date)) { $date = strtotime($date); } $year = date('Y', $date); $month = get_month(LANGUAGEID, date('m', $date)); $day = date('d', $date); return "{$day}. {$month} {$year}"; }
function show_rent_calendar($album_id) { global $locale; add_to_head("<link rel='stylesheet' href='" . INFUSIONS . "al_rent_calendar/asset/rent_calendar.css' />"); add_to_head("<script src='" . INFUSIONS . "al_rent_calendar/asset/rent_calendar.js'></script>"); $result = dbquery("SELECT * FROM " . DB_AL_RC_SPECIAL_DAYS . " WHERE alrc_special_album_id='" . $album_id . "' ORDER BY alrc_special_date_start ASC"); if (dbrows($result)) { opentable($locale['alrc3']); echo "<table width='100%'>"; echo "<tr>"; echo "<td class='tbl2'>" . $locale['alrc4'] . "</td>"; echo "<td class='tbl2'>" . $locale['alrc5'] . "</td>"; echo "<td class='tbl2'>" . $locale['alrc6'] . "</td>"; echo "<td class='tbl2'>" . $locale['alrc7'] . "</td>"; echo "</tr>"; while ($data = dbarray($result)) { $start_date = explode('-', $data['alrc_special_date_start']); $finish_date = explode('-', $data['alrc_special_date_finish']); echo "<tr>"; echo "<td class='tbl'>" . $data['alrc_special_title'] . " " . $start_date[2] . " " . $locale['alrc_month_short_' . trim($start_date[1], '0')] . " " . $start_date[0] . " - " . $finish_date[2] . " " . $locale['alrc_month_short_' . trim($finish_date[1], '0')] . " " . $finish_date[0] . "</td>"; echo "<td class='tbl'>" . $data['alrc_special_min_nights'] . "</td>"; echo "<td class='tbl'>" . $data['alrc_special_cost_two_person'] . "</td>"; echo "<td class='tbl'>" . $data['alrc_special_cost_next_person'] . "</td>"; echo "</tr>"; } echo "</table>"; closetable(); } opentable($locale['alrc8']); ///////////////////////////////// $total_monthes = 12; $per_page = 3; ///////////////////////////////// $start_month = date('n'); $start_year = date('Y'); $finish_year = $start_year + floor(($start_month + $total_monthes - 1) / 12); $i = 0; $page = 1; echo "<div class='calendar-page page1'>"; for ($y = $start_year; $y <= $finish_year; $y++) { if ($y == $finish_year && $y == $start_year) { $cur_month_start = $start_month; $cur_month_finish = $cur_month_start + $total_monthes - 1; } else { if ($y == $start_year && $finish_year > $y) { $cur_month_start = $start_month; $cur_month_finish = 12; } else { if ($y > $start_year && $y == $finish_year) { $cur_month_start = 1; $cur_month_finish = ($start_month + $total_monthes - 1) % 12; } else { $cur_month_start = 1; $cur_month_finish = 12; } } } for ($m = $cur_month_start; $m <= $cur_month_finish; $m++) { if ($i % $per_page == 0 && $i != 0) { $page++; echo "<div class='clear'></div></div><div class='calendar-page page" . $page . "'>"; } build_month($m, $y, get_month($m, $y), get_month_data($album_id, $m, $y)); $i++; } } echo "<div class='clear'></div></div>"; echo "<div class='calendar-map'>"; echo "<div class='calendar-map-item'>"; echo "<div class='calendar-map-item-icon calendar-map-item-icon-type1'></div>"; echo "<div class='calendar-map-item-desc'>" . $locale['alrc31'] . "</div>"; echo "</div>"; echo "<div class='calendar-map-item'>"; echo "<div class='calendar-map-item-icon calendar-map-item-icon-type2'></div>"; echo "<div class='calendar-map-item-desc'>" . $locale['alrc32'] . "</div>"; echo "</div>"; echo "<div class='calendar-map-item'>"; echo "<div class='calendar-map-item-icon calendar-map-item-icon-type3'></div>"; echo "<div class='calendar-map-item-desc'>" . $locale['alrc33'] . "</div>"; echo "</div>"; echo "<div class='calendar-map-item'>"; echo "<div class='calendar-map-item-icon calendar-map-item-icon-type4'></div>"; echo "<div class='calendar-map-item-desc'>" . $locale['alrc34'] . "</div>"; echo "</div>"; echo "<div class='clear'></div>"; echo "</div>"; echo "<div class='calendar-nav-container'>"; echo "<div class='calendar-nav calendar-nav-prev' data-nav-type='prev' data-current-page='1'>" . $locale['alrc29'] . "</div>"; echo "<div class='calendar-nav calendar-nav-next' data-nav-type='next' data-current-page='1'>" . $locale['alrc30'] . "</div>"; echo "<div class='clear'></div>"; echo "</div>"; closetable(); }
<?php $out = array(); require './header.php'; $addition = ''; if (isset($_GET['archive'])) { $year = get_year($_GET['archive']); $month = get_month($_GET['archive']); if (check_input('number', $year) && check_input('number', $month)) { $addition .= ' and year(post_time) = ' . $year . ' and month(post_time) = ' . $month . ' '; } } $sql0 = 'select count(*) from note, user where author_id = uid' . $addition; $count = $mysql_obj->fetch_array($mysql_obj->query($sql0)); $note_count = $count['count(*)']; $pager = new Paging($note_count, $config['articles_per_page']); $sql1 = 'select post_id, title, post_time, user_name from user, note where author_id = uid ' . $addition . 'order by `post_time` desc ' . 'limit ' . ($pager->mCurrentPage - 1) * $pager->mPageSize . ',' . $pager->mPageSize; $articles = $mysql_obj->query($sql1); $out['article_list'] = array(); $out['content'] = ''; if ($mysql_obj->get_rows_count()) { for (; $article = $mysql_obj->fetch_array($articles);) { $out['article_list'][] = $article; } foreach ($out['article_list'] as $article) { $out['content'] .= '<div class="blog-post">'; $out['content'] .= '<a class="title" href="article.php?id=' . $article['post_id'] . '"><h3 class="blog-post-title">' . $article['title'] . '</h3></a>'; $out['content'] .= '<p class="blog-post-meta article-info">' . $article['post_time'] . ' by ' . $article['user_name'] . '</p>'; $out['content'] .= '</div><!-- /.blog-post --> <hr>';
////////////////////////////// // sozdanie nuzhnyh veshej v lokacii // esli karta na kotoruju zashel igrok neaktivnaja // to zagruzim $pl_map = substr($p['location'], 0, 4); $qplm = do_mysql("SELECT * FROM maps WHERE map = '" . $pl_map . "';"); if (!mysql_num_rows($qplm)) { // zanesem kartu esli ja zabyl zanesti do_mysql("INSERT INTO maps VALUES ('" . $pl_map . "', 'no', '', '');"); $qplm = do_mysql("SELECT * FROM maps WHERE map = '" . $pl_map . "';"); } $plm = mysql_fetch_assoc($qplm); if ($plm['active'] == 'no') { $NEWMAP = 1; } //etime('ladmaps1'); //stime(); include_once 'modules/mapinfo/load_' . $pl_map . '.php'; //etime ('loadmaps incl'); //stime(); // celesoobrazno proverjatq action raz v 30 sec, kak i life regen $mon = get_month(); $time = time(); $all = do_mysql("SELECT * FROM gamesys WHERE month = '" . $mon . "';"); $all = mysql_fetch_assoc($all); $TESTALL = $all; //etime('loadmaps gamesys'); //stime(); if ($time - $p['last'][2] >= 30 || $NEWMAP) { include 'modules/sp/sp_loadmaps.php'; }
function date_to_month($datetime = "") { $unixdate = unixdatetime($datetime); $month = date("m", $unixdate); return get_month($month); }
foreach ($rep as $r) { $html .= '"' . $r['id_country'] . '" : "' . $r['name'] . '",'; } $html = Tools::substr($html, 0, -1); $html .= '}'; die($html); } if (Tools::getValue('action') == 'date') { include_once realpath(dirname(__FILE__) . '/../../..') . '/libraries/date.inc.php'; $ret = array(); switch (Tools::getValue('typedate')) { case 0: $ret = get_week(Tools::getValue('periode') - 1, Tools::getValue('years')); break; case 1: $ret = get_month(Tools::getValue('periode'), Tools::getValue('years')); break; case 2: $ret = get_trimester(Tools::getValue('periode'), Tools::getValue('years')); break; case 3: $ret['start'] = Tools::getValue('periode') . '-01-01'; $ret['end'] = Tools::getValue('periode') . '-12-31'; break; } die($ret['start'] . '/' . $ret['end']); } if (Tools::getValue('action') == 'Save') { $assignAuto = false; if (Tools::getIsset('assign-auto')) { $assignAuto = (bool) Tools::getValue('assign-auto');
<div id="main"> <div id="nav"> <h1>Dates</h1> <ul> <?php foreach ($years as $year => $months) { ?> <li class="year"><?php echo $year; ?> <ul> <?php foreach ($months as $month => $days) { ?> <li class="month"><?php echo get_month($month); ?> <ul> <?php foreach ($days as $day => $entries) { ?> <li class="day"><a href="/?date=<?php echo "{$year}-{$month}-{$day}"; ?> "><?php echo date("l, \\t\\h dS", strtotime("{$year}-{$month}-{$day}")); ?> </a></li> <?php } ?>
$mes == null ? $mesec = date("m") : ($mesec = $mes); $god == null ? $godina = date("Y") : ($godina = $god); // find number of days in this month $brojDana = $this->_brojDana($mesec, $godina); // calculate number of weeks $brojNedelja = ($brojDana % 7 == 0 ? 0 : 1) + intval($brojDana / 7); // gets numeric representation of a day (1 for Monday, 7 for Sunday) for the first and last day in the month $prviDan = date('N', strtotime($godina . '-' . $mesec . '-01')); $poslednjiDan = date('N', strtotime($godina . '-' . $mesec . '-' . $brojDana)); if ($poslednjiDan < $prviDan) { $brojNedelja++; } return $brojNedelja; } } // communication with jQuery Ajax methods if (isset($_POST['action']) && !empty($_POST['action'])) { $action = $_POST['action']; switch ($action) { case 'get_month': get_month(); break; } } function get_month() { $new_kalendar = Kalendar::getInstance(); $month = $new_kalendar->prikazKalendara(); $json = array('calendar' => $month); echo json_encode($json); }