function day($date) { $change = gmdate($date, time() + 60 * 60 * 8); $split = explode("-", $change, 3); $date = $split[2]; $month = month($split[1]); $year = $split[0]; return $date . ' ' . $month . ' ' . $year; }
public function __construct(array $time) { $this->year = array_key_exists('year', $time) ? intval($time['year']) : 0; $this->month = array_key_exists('month', $time) ? intval(month($time['month'])) : 0; $this->day = array_key_exists('day', $time) ? intval($time['day']) : 0; $this->startTime = intval($time['startTime']); $this->endTime = intval($time['endTime']); $this->wkDay = intval(week($time['wkDay'])); $this->wkRepeat = array(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE); }
function extractLogDates($site) { $d = HTTP_DIR . '/' . $site . '/code'; $h = opendir($d) or die("Couldn't open {$d}"); $datalist = data($site); $fs = array(); while ($each = readdir($h)) { if (preg_match('/\\.log$/i', $each) && $datalist[$each]) { $fs[] = $d . '/' . $each; } } $sitelist = includes($site); $freq = array(); $sum = 0.0; foreach ($fs as $each) { $parts = explode(".", $each); $lang = $parts[2]; if (isset($sitelist[$lang])) { $fp = @fopen($each, "r") or die("Couldn't open {$each}"); while ($line = fgets($fp, 128)) { if ($found = preg_match('/([A-Z][a-z]{2})[0-9A-Z\\s\\:]+(\\d{4})/', $line, $match)) { break; } } if ($found) { $sum++; $mth = month($match[1]); $yr = intval($match[2]); if (!isset($freq[$yr][$mth][$site])) { $freq[$yr][$mth][$site] = 1; } else { $freq[$yr][$mth][$site] += 1; } } fclose($fp) or die("Couldn't close {$each}"); } } closedir($h); $a = array(); foreach ($freq as $yr => $mths) { foreach ($mths as $mth => $counts) { if (isset($counts[$site]) && $counts[$site] > 0) { $a[] = array($yr, $mth, $site, $counts[$site] / $sum); } } } usort($a, 'CompareYearMonth'); $cumulative = 0.0; for ($k = 0; $k < sizeof($a); $k++) { $cumulative += $a[$k][3]; $a[$k][3] = $cumulative; } return $a; }
function uploading() { $new_name = 'Import_sbu_all_' . date('d') . ' ' . month(date('m')) . ' ' . date('Y'); $config['upload_path'] = './upload/'; $config['allowed_types'] = 'xls|xlsx'; $config['file_name'] = $new_name; $this->load->library('upload', $config); //uploading file to directory upload if (!$this->upload->do_upload()) { $error = array('error' => $this->upload->display_errors()); $data = array("title" => "SPJ | Import", "judul" => "Import Data Error"); redirect('import', $error); } else { $res = array('upload_data' => $this->upload->data()); $filename = $res['upload_data']['file_name']; $file_ext = $res['upload_data']['file_ext']; //print_r($this->upload->data()); // application/vnd.ms-excel xls // application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx if ($file_ext == ".xls") { $objReader = PHPExcel_IOFactory::createReader('Excel5'); } else { if ($file_ext == ".xlsx") { $objReader = PHPExcel_IOFactory::createReader('Excel2007'); } else { if ($file_ext == ".ods") { $objReader = PHPExcel_IOFactory::createReader('OOCalc'); } else { redirect('home', 'refresh'); } } } $uploadpath = "./upload/" . $filename; $objReader->setReadDataOnly(TRUE); $objPHPExcel = $objReader->load($uploadpath); $this->showXls(); /**$data = array("title"=>"SDPPI | Import SBU", "judul"=>"Import Telah Sukses", "file"=>$this->input->post($filename)); $this->load->view('header',$data); $this->load->view('main',$data); $this->load->view('v_xls',$data); $this->load->view('footer',$data);**/ } }
<p> <?php echo '' . ucfirst(strtolower($name_search)); ?> contains <?php echo '' . $subcat; ?> subgroups and was <?php echo '' . $cpi_basket_value . '% of the ' . month($start, 5, 2) . '-' . year($start, 0, 4) . ' CPI Basket.'; ?> <p><?php echo '' . $msg_rose . 'in ' . month($end, 5, 2) . '-' . year($end, 0, 4) . $msg_higher . month($start, 5, 2) . '-' . year($start, 0, 4); ?> <?php } else { $sql_sub = "SELECT name_subgroup FROM cpi_subgroup,cpi_class WHERE cpi_class.id_subgroup=cpi_subgroup.id_subgroup and `id_" . $table_search . "`='" . $byDefaut . "'"; $sql_sub = mysql_query($sql_sub); $psub = ''; while ($row = mysql_fetch_array($sql_sub)) { $psub = $row['name_subgroup']; } echo '<p>' . ucfirst(strtolower($name_search)) . ' is a class of ' . $psub . ' and represents ' . $cpi_basket_value . '% of the ' . month($start, 5, 2) . '-' . year($start, 0, 4) . ' CPI Basket.'; echo '<p>' . $msg_rose . 'in ' . month($end, 5, 2) . '-' . year($end, 0, 4) . $msg_higher . month($start, 5, 2) . '-' . year($start, 0, 4); } } ?> <div id="container1" class="col-xs-6 col-md-6"> </div>
function testSelect_date() { $expect = array(); $expect[] = "[ \n]+<select name=\"fubar_day\" size=\"0\">"; for ($idx = 1; $idx < 32; $idx++) { $expect[] = "[ \n]+<option value=\"" . $idx . "\">" . $idx; } $expect[] = "[ \n]+<\\/select>"; $expect[] = "[ \n]+<select name=\"fubar_month\" size=\"0\">"; for ($idx = 1; $idx < 13; $idx++) { $expect[] = "[ \n]+<option value=\"" . $idx . "\">" . month($idx); } $expect[] = "[ \n]+<\\/select>"; $expect[] = "[ \n]+<select name=\"fubar_year\" size=\"0\">"; for ($idx = 2001; $idx <= 2005; $idx++) { $expect[] = "[ \n]+<option value=\"" . $idx . "\">" . $idx; } $expect[] = "[ \n]+<\\/select>[ \n]+"; $this->set_text(select_date("fubar", "-1", "-1", "-1")); $this->_testFor_pattern(implode("", $expect)); $this->_testFor_string_length(1597); }
<?php if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { header("HTTP/1.1 404 Not Found"); exit; } global $url_situs; ob_start(); echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">'; include "mod/statistik/counter.php"; include "mod/statistik/online.php"; include "mod/statistik/hits.php"; include "mod/statistik/useronline.php"; echo ' <tr><td><img src="' . $url_situs . '/mod/statistik/images/visitor.png" alt="Visitors"/></td><td>Visitors</td><td>:</td><td><b>' . $theCount . '</b></td></tr> <tr><td><img src="' . $url_situs . '/mod/statistik/images/hits.png" alt="Hits"/></td><td>Hits</td><td>:</td><td><b>' . $hits . '</b></td></tr> <tr><td><img src="' . $url_situs . '/mod/statistik/images/month.png" alt="Month"/></td><td>Month</td><td>:</td><td><b>' . month() . '</b></td></tr> <tr><td><img src="' . $url_situs . '/mod/statistik/images/today.png" alt="Today"/></td><td>Today</td><td>:</td><td><b>' . day() . '</b></td></tr> </table>'; $out = ob_get_contents(); ob_end_clean();
public function other() { $Other = M('AssetOther'); $this->assign('table', $Other->select()); //其他列表 $select = M('OtherSelect'); $othername = $select->field('name,count(name)')->group('name')->select(); $this->assign('othername', $othername); //其他名称 $unit = M('AssetUnit'); $assetunit = $unit->select(); $this->assign('assetunit', $assetunit); //其他单位 $otherstate = $Other->field('names,unit,count(names) as numberall ')->group('names,unit')->select(); $this->assign('otherstate', $otherstate); //现有其他的数量 // $nowtime = strtotime() // $mintime = $Other->field('start')->order('start')->find(); $maxtime = $Other->field('start')->order('start desc')->find(); $m = month(strtotime($maxtime['start'])); $othertime = array(); $timenum = 0; foreach ($m as $item) { $map['start'] = array('like', $item . '%'); $othershow = $Other->where($map)->field('start,count(number) as num')->select(); $othershow[0]['start'] = $item; array_push($othertime, $othershow[0]); $timenum++; } $this->assign('othertime', $othertime); if ($othertime[0]['num'] == 0) { $this->assign('color', 'bg-red-gradient'); } else { $subnum = $othertime[0]['num'] - $othertime[$timenum]['num']; if ($subnum > 0) { $this->assign('color', 'bg-green-gradient'); } else { $this->assign('color', 'bg-yellow-gradient'); } } $this->display(); }
$sql_query = "select distinct time_cpi_group from cpi_data_group order by time_cpi_group"; $date_query = mysql_query($sql_query) or die(mysql_error()); $count = mysql_num_rows($date_query); $last = ''; if ($count > 0) { // $selected = $count - 1; // $i = 0; $optgroup = "2009"; echo '<optgroup label=' . $optgroup . '>'; while ($row = mysql_fetch_array($date_query)) { $period = $row['time_cpi_group']; if ($optgroup !== year($period, 0, 4)) { $optgroup = year($period, 0, 4); echo '<optgroup label=' . $optgroup . '>'; } else { $last = month($period, 5, 2, 0); if ($period === $ending) { echo '<option value=' . $period . ' selected="selected"> ' . $last . ' ' . year($period, 2, 2) . ' </option>'; } else { echo '<option value=' . $period . '> ' . $last . ' ' . year($period, 2, 2) . ' </option>'; } if ($last === 'Dec') { echo '</optgroup>'; } } // $i++; } if ($last !== '12') { echo '</optgroup>'; } }
<dt>Civil Status</dt> <dd> <select name="strCivilStatus" class="selectpicker" data-live-search="false"> <option value="">-- Select Status --</option> <option value="single">Single</option> <option value="married">Married</option> <option value="separated">Separated</option> <option value="widowed">Widowed</option> </select> </dd> <dt>Birthday</dt> <dd> <select name="strMonth" class="span2 selectpicker" data-live-search="true"> <option value="">-- Month --</option> <?php $month = month(); for ($x = 1; $x <= 12; $x++) { echo '<option value="' . $month[$x] . '">' . $month[$x] . '</option>'; } ?> </select> <select name="strDays" class="span2 selectpicker" data-live-search="true"> <option value="">-- Day --</option> <?php $day = day(); for ($x = 1; $x <= 31; $x++) { echo '<option value="' . $day[$x] . '">' . $day[$x] . '</option>'; } ?> </select> <select name="strYear" class="span2 selectpicker" data-live-search="true">
<?php if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { header("HTTP/1.1 404 Not Found"); exit; } ob_start(); /* echo '<div style="text-align:center;"><!-- Histats.com START --> <script type="text/javascript" > var s_sid = 508946; var st_dominio = 4; var cimg = 30; var cwi =130; var che =80; </script> <script type="text/javascript" language="javascript" src="http://s10.histats.com/js9.js"></script> <noscript><p> <img src="http://s4.histats.com/stats/0.gif?508946&1" alt="cool hit counter" /></p> </noscript> <!-- Histats.com END --></div>'; */ echo "<table><tr><td>"; include "mod/statistik/counter.php"; include "mod/statistik/online.php"; include "mod/statistik/hits.php"; include "mod/statistik/useronline.php"; echo "\n<img src=\"{url}/images/8.gif\" border=\"0\" alt=\"\" /> Visitors :<b>{$theCount}</b> Users<br />\n<img src=\"{url}/images/9.gif\" border=\"0\" alt=\"\" /> Hits : <b>{$hits}</b> hits<br />\n<img src=\"{url}/images/10.gif\" border=\"0\" alt=\"\" /> Month : <b>" . month() . "</b> Users<br />\n<img src=\"{url}/images/8.gif\" border=\"0\" alt=\"\" /> Today : <b>" . day() . "</b> Users<br />\n<img src=\"{url}/images/9.gif\" border=\"0\" alt=\"\" /> Online : <b>" . useronline() . "</b> Member\n</td></tr></table><br />"; $out = ob_get_contents(); ob_end_clean();
?> </option> <?php } ?> </select>年 <select name="month"> <option value="">--</option> <?php for ($i = 1; $i <= 12; $i++) { ?> <option value="<?php echo $i; ?> " <?php if ($i == month($result[0]['birthday'])) { echo "selected"; } ?> ><?php echo $i; ?> </option> <?php } ?> </select>月 <select name="day"> <option value="">--</option> <?php for ($i = 1; $i <= 31; $i++) {
$inWord = '09'; break; case 'Oct': $inWord = '10'; break; case 'Nov': $inWord = '11'; break; case 'Dec': $inWord = '12'; break; } return $inWord; } $ukwezi = $_POST[month]; $umuba = month($ukwezi); echo $time = $_POST[year] . '-' . $umuba . '-01' . ' 00:00:00'; $CSVfp = fopen($path, 'r'); if ($CSVfp !== FALSE) { while (!feof($CSVfp)) { $data = fgetcsv($CSVfp, 100000, ","); // $row = str_getcsv($path, "\n"); $tablefro = $data[3]; if ($data[0] != '' and $data[0] != 'CODE') { $sd = "INSERT INTO cpi_data_" . $tablefro . " (`id_" . $tablefro . "`, `weight`, `cpi_" . $tablefro . "_value`, `time_cpi_" . $tablefro . "`, `index_cpi_" . $tablefro . "`, `area`) VALUES ('" . $data[0] . "', '0', '" . $data[2] . "', '{$time}', '0', 'URBAN')"; $inte = mysql_query($sd); } } mysql_query("UPDATE `nisr_cpi`.`cpi_file_track` SET `status` = 'Saved' WHERE `cpi_file_track`.`id_file` ='{$id}'"); } }
<div class="eventList">'; foreach ($pageposts as $post) { setup_postdata($post); $eventTitle = get_field('title'); $image = wp_get_attachment_image_src(get_field('image'), 'eventsFull'); $imageAlt = get_field('image_alt'); $link = get_field('link'); $startDate = get_field('start_date'); $endDate = get_field('end_date'); $target = get_field('target'); $monthStartDateInt = intval(substr(get_field('start_date'), -5, 2)); $monthStartDateName = month($monthStartDateInt); $dayStartDateInt = intval(substr(get_field('start_date'), -2, 2)); $yearStartDateInt = intval(substr(get_field('start_date'), -10, 4)); $monthEndDateInt = intval(substr(get_field('end_date'), -5, 2)); $monthEndDateName = month($monthEndDateInt); $dayEndDateInt = intval(substr(get_field('end_date'), -2, 2)); $yearEndDateInt = intval(substr(get_field('end_date'), -10, 4)); //echo 'CurMonth = '. $monthEndDateInt . ' LastMonth = ' . $lastEventMonthInt; if ($dayStartDateInt == $dayEndDateInt) { $date = $dayStartDateInt; } else { $date = $dayStartDateInt . ' - ' . $dayEndDateInt; } if ($monthEndDateInt != $lastEventMonthInt) { if ($monthEndDateInt > $lastEventMonthInt && $bluediv || $lastEventMonthInt == 12 && $monthEndDateInt == 1) { echo ' </ul> </div>'; }
function datetime_string($datetime, $time) { // $datetime - дата время, $time = 'yes / <любое значение > ' выводить / не выводить время $y = substr($datetime, 0, 4); $m = month(substr($datetime, 5, 2)); $d = substr($datetime, 8, 2); if ($d[0] == '0') { $d = substr($datetime, 9, 1); } if ($time == 'yes') { $stringtime = substr($datetime, 11, 8); } else { $stringtime = ''; } $data = $d . ' ' . $m . ' ' . $y . ' г. ' . $stringtime; return $data; }
function get_end($local_func) { switch ($local_func) { case 1: // Today // Today case 2: // Yesterday+ // Yesterday+ case 3: // This week // This week case 5: // Last week+ // Last week+ case 6: // This month // This month case 8: // This year return mysql_format_date(mktime(23, 59, 59, month(), day(), year())); // m, d, y -- date ('D, M j', // return mysql_format_date(now()); // m, d, y -- date ('D, M j', break; case 4: // Last week return mysql_format_date(monday() - 1); // m, d, y -- last monday break; case 7: // Last month return mysql_format_date(mktime(0, 0, 0, month(), 1, year())); // m, d, y -- date ('D, M j', break; case 9: // Last year return mysql_format_date(mktime(23, 59, 59, 12, 31, year() - 1)); // m, d, y -- date ('D, M j', break; default: echo __LINE__ . " error error error error error \n"; } }
</a> </li> <?php } } else { for ($j = 12; $j >= $firstMonth; $j--) { if ($j <= 9) { $m = "0{$j}"; } else { $m = $j; } ?> <li> » <a href="<?php print path("blog/{$i}/{$m}/"); ?> " title="<?php print month($m) . ' ' . $i; ?> "><?php print month($m) . ' ' . $i; ?> </a> </li> <?php } } } ?> </ul> </div>
case 5: echo $month . " May "; break; case 6: echo $month . " June "; break; case 7: echo $month . " July "; break; case 8: echo $month . " August "; break; case 9: echo $month . " September "; break; case 10: echo $month . " October "; break; case 11: echo $month . " November "; break; case 12: echo $month . " December "; break; default: echo "12 months of the year!!!"; break; } } month(11);
</head> <body> <h1>Nieuwe verjaardag</h1> <form action="create.php" method="post"> naam: <input type="text" name="name"><br> datum: <select name="day"> <?php echo day(); ?> </select> <select name="month"> <?php echo month(); ?> </select> <select name="year"> <?php echo year(); ?> </select> <button value"create" name="submit">toevoegen</button> </form> </body> </html>
PDF_show_xy($pdf, $cogsheader, 400, 680); PDF_show_xy($pdf, $pnlheader, 490, 680); PDF_show_xy($pdf, $line, 20, 675); $y = 660; //information if (count($revenue) == count($cogs) && count($revenue) == count($expenditure)) { for ($i = 0; $i < count($revenue); $i++) { $profit = $revenue[$i] - $expenditure[$i] - $cogs[$i]; if ($profit < 0) { $profit = '( ' . $profit . ')'; } $total_pnl += round($profit, 2); $total_revenue += round($revenue[$i], 2); $total_expenditure += round($expenditure[$i], 2); $total_cogs += round($cogs[$i], 2); $starting = strtoupper(month($startMonth)); PDF_show_xy($pdf, $starting, 20, $y); PDF_show_xy($pdf, "\$ " . $revenue[$i], 150, $y); PDF_show_xy($pdf, "\$ " . $expenditure[$i], 275, $y); PDF_show_xy($pdf, "\$ " . $cogs[$i], 400, $y); PDF_show_xy($pdf, "\$ " . $profit, 490, $y); if ($startMonth + 1 == 13) { $startMonth = 1; } else { $startMonth++; } $y -= 20; } } PDF_show_xy($pdf, $line, 20, $y); PDF_show_xy($pdf, $totalheader, 20, $y - 20);
<h1><?php echo the_title(); ?> </h1> <div class="post-info"> <?php if (!empty($event)) { ?> <i class="fa fa-map-marker" aria-hidden="true"></i> <?php echo $location['address']; ?> <i class="fa fa-clock-o" aria-hidden="true"></i><?php echo month(date('d n Y', strtotime($date))); ?> <?php } ?> </div> </div> <div id="share-it"><p>Partager : <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo urlencode(get_permalink()); ?> /"><i class="fa fa-facebook-official" aria-hidden="true"></i></a> <a href="https://twitter.com/home?status=<?php echo urlencode(the_title() . ' - ' . get_permalink()); ?> "><i class="fa fa-twitter" aria-hidden="true"></i></a> <a href="https://plus.google.com/share?url=<?php
$time = array_filter($t); if ($t != $time) { echo "Wrong Format\n"; return; } if (!to_day($time[0]) || !is_numeric($time[1]) || strlen($time[1]) > 2 || $time[1] > 31 || !is_numeric($time[3]) || strlen($time[3]) > 4 || $time[3] < 1970) { echo "Wrong Format\n"; return; } if (!month($time[2])) { echo "Wrong Format\n"; return; } $h = explode(":", $time[4]); $h2 = array_filter($h); if ($h != $h2) { echo "Wrong Format\n"; return; } foreach ($h as $elem) { if (!is_numeric($elem) || strlen($elem) != 2) { echo "Wrong Format\n"; return; } } if ($h[0] >= 24 || $h[1] >= 60 || $h[2] >= 60) { echo "Wrong Format\n"; return; } echo gmmktime($h[0], $h[1], $h[2], month($time[2]), $time[1], $time[3]) - 3600 . "\n";
public function index() { $Card = M('ServiceCard'); $bossUser = D('Login', 'Service')->getuserInfo(); //显示每日可预约服务单数量 $areaquantity = M("ServiceQuantity"); $aquantity = $areaquantity->where('area = "%s"', $bossUser['area'])->find(); $this->assign('aquantity', $aquantity); //未维修服务单 $servicecardinfo = $Card->where('status = 0 AND area = "%s"', $bossUser['area'])->order('dormitory')->select(); $CardRepair = M('ServiceRepair'); foreach ($servicecardinfo as $key => $value) { $servicecardinfo[$key]['isrepair'] = count($CardRepair->where('servicecard_id = %d', $value['id'])->select()); } $this->assign('servicecardinfo', $servicecardinfo); //服务单表 //已维修未确认服务单 // $servicecardinfo2 = $Card->where('status = 2 AND area = "%s"',$bossUser['area'])->order('dormitory')->select(); // $this -> assign('servicecardinfo2',$servicecardinfo2 );//服务单表 $staff = D('Admin/StaffUserView')->where('status = 1')->field('uname')->select(); $this->assign('staff', $staff); //----------------------------------------tool--------------------------------------- $Tool = M('AssetTool'); $maxtime = $Tool->field('start')->order('start desc')->find(); $m = month(strtotime($maxtime['start'])); $tooltime = array(); $timenum = 0; foreach ($m as $item) { $map['start'] = array('like', $item . '%'); $toolshow = $Tool->where($map)->field('start,count(start) as number')->select(); $toolshow[0]['start'] = $item; array_push($tooltime, $toolshow[0]); $timenum++; } $this->assign('tooltime', $tooltime); if ($tooltime[0]['number'] == 0) { $this->assign('toolcolor', 'bg-red-gradient'); } else { $subnum = $tooltime[0]['number'] - $tooltime[1]['number']; if ($subnum > 0) { $this->assign('toolcolor', 'bg-green-gradient'); } else { $this->assign('toolcolor', 'bg-yellow-gradient'); } } //---------------------------------------exhaust------------------------------------------ $Exhaust = M('AssetExhaust'); $maxtime = $Exhaust->field('start')->order('start desc')->find(); $m = month(strtotime($maxtime['start'])); $exhausttime = array(); $timenum = 0; foreach ($m as $item) { $map['start'] = array('like', $item . '%'); $exhaustshow = $Exhaust->where($map)->field('start,count(start) as num')->select(); $exhaustshow[0]['start'] = $item; array_push($exhausttime, $exhaustshow[0]); $timenum++; } $this->assign('exhausttime', $exhausttime); // trace($exhausttime); if ($exhausttime[0]['num'] == 0) { $this->assign('exhaustcolor', 'bg-red-gradient'); } else { $subnum = $exhausttime[0]['num'] - $exhausttime[1]['num']; if ($subnum > 0) { $this->assign('exhaustcolor', 'bg-green-gradient'); } else { $this->assign('exhaustcolor', 'bg-yellow-gradient'); } } //----------------------------------------device--------------------------------------------- $Device = M('AssetDevice'); $maxtime = $Device->field('start')->order('start desc')->find(); $m = month(strtotime($maxtime['start'])); $devicetime = array(); $timenum = 0; foreach ($m as $item) { $map['start'] = array('like', $item . '%'); $deviceshow = $Device->where($map)->field('start,count(start) as number')->select(); $deviceshow[0]['start'] = $item; array_push($devicetime, $deviceshow[0]); $timenum++; } $this->assign('devicetime', $devicetime); if ($devicetime[0]['number'] == 0) { $this->assign('devicecolor', 'bg-red-gradient'); } else { $subnum = $devicetime[0]['number'] - $devicetime[1]['number']; if ($subnum > 0) { $this->assign('devicecolor', 'bg-green-gradient'); } else { $this->assign('devicecolor', 'bg-yellow-gradient'); } } $this->display(); }
foreach ($v1 as $k2 => $v2) { ?> <li> <!-- Or you can use longer form archives' And key archives' value' key --> <a href="<?php echo $data['rootUrl']; ?> archive/<?php echo $k1; ?> /<?php echo $k2; ?> "> <span><?php echo month($k2); ?> </span> <?php echo $k1; ?> </a> (<?php echo $v2; ?> ) </li> <?php } ?> <?php }
$sql_query = "select distinct time_cpi_group from cpi_data_group order by time_cpi_group"; $date_query = mysql_query($sql_query) or die(mysql_error()); $count = mysql_num_rows($date_query); $last = ''; if ($count > 0) { $selected = $count * 0.8; $i = 0; $optgroup = "2009"; echo '<optgroup label=' . $optgroup . '>'; while ($row = mysql_fetch_array($date_query)) { $period = $row['time_cpi_group']; if ($optgroup !== year($period, 0, 4)) { $optgroup = year($period, 0, 4); echo '<optgroup label=' . $optgroup . '>'; } else { $last = month($period, 5, 2); if ($i == $selected) { echo '<option value=' . $period . ' selected="selected"> ' . $last . ' ' . year($period, 2, 2) . ' </option>'; } else { echo '<option value=' . $period . '> ' . $last . ' ' . year($period, 2, 2) . ' </option>'; } if ($last === 'Dec') { echo '</optgroup>'; } } $i++; } if ($last !== '12') { echo '</optgroup>'; } }
public function query() { $Card = M('ServiceCard'); $cardtable = $Card->select(); $this->assign('table', $cardtable); //服务单表 /*未完成服务单数量*/ $maxtime = $Card->field('start')->order('start desc')->find(); $m = month(strtotime($maxtime['start'])); $cardtime1 = array(); foreach ($m as $item) { $map['start'] = array('like', $item . '%'); $cardshow = $Card->where($map)->field('start,count(start) as num')->select(); $cardshow[0]['start'] = $item; array_push($cardtime1, $cardshow[0]); } $this->assign('cardtime1', $cardtime1); /*已完成服务单数量*/ $cardstate2 = $Card->where('status = 1')->field('name,count(id) as number ')->group('id')->select(); $this->assign('cardstate1', $cardstate1); //现有服务单的数量 $maxtime = $Card->field('start')->order('start desc')->find(); $m = month(strtotime($maxtime['start'])); $cardtime2 = array(); foreach ($m as $item) { $map['start'] = array('like', $item . '%'); $cardshow = $Card->where($map)->field('start,count(start) as num')->select(); $cardshow[0]['start'] = $item; array_push($cardtime2, $cardshow[0]); } $this->assign('cardtime2', $cardtime2); $this->display(); }
function shamsi($dat = '', $far = False) { $d = array(); for ($row = 1; $row <= 12; $row++) { $d[$row] = 0; } $dy = array(); for ($row = 1; $row <= 7; $row++) { $dy[$row] = ''; } $yy = year($dat); $d[1] = 31; if ($yy % 4 == 0) { $d[2] = 29; } else { $d[2] = 28; } $dy[1] = 'يکشنبه'; $dy[2] = 'دوشنبه'; $dy[3] = 'سه شنبه'; $dy[4] = 'چهار شنبه'; $dy[5] = 'پنج شنبه'; $dy[6] = 'جمعه'; $dy[7] = 'شنبه'; $d[3] = 31; $d[4] = 30; $d[5] = 31; $d[6] = 30; $d[7] = 31; $d[8] = 31; $d[9] = 30; $d[10] = 31; $d[11] = 30; $d[12] = 31; $mm = 0; for ($i = 1; $i <= month($dat) - 1; $i++) { $mm = $mm + $d[$i]; } $yy = $yy - 1; $dd = day($dat); $ldays = $yy * 365 + floor(($yy - 1) / 4) + $mm + $dd; //print "<br>ldays:".$ldays; $idays = $ldays - 226899; $ff = ltrim(month($dat)); $gg = ltrim(day($dat)); if (strlen($ff) < 2) { $ff = '0' . $ff; } if (strlen($gg) < 2) { $gg = '0' . $gg; } $hh = $ff . $gg; if ($hh < '0320' or $hh == '0320' and year($dat) / 4 != floor(year($dat) / 4)) { $yy = year($dat) - 622; } else { $yy = year($dat) - 621; } $mm = $idays - floor(($yy - 1) / 4) - ($yy - 1) * 365; $yy1 = year($dat) - 1; if ($yy1 / 4 == floor($yy1 / 4) and $hh <= '0320') { $mm = $mm + 1; } if (year($dat) / 2 == floor(year($dat) / 2) and year($dat) / 4 != floor(year($dat) / 4) and $hh <= '0320') { $mm = $mm - 1; } if ($mm <= 186) { $dd = $mm % 31; if ($dd == 0) { $dd = 31; $mm = floor($mm / 31); } else { $mm = floor($mm / 31) + 1; } } else { $mm = $mm - 186; $dd = $mm % 30; if ($dd == 0) { $dd = 30; $mm = floor($mm / 30) + 6; } else { $mm = floor($mm / 30) + 7; } } if ($far) { $qstr = strr($yy, 4) . '/'; if ($mm < 10) { $qstr = $qstr . '0' . strr($mm, 1) . '/'; } else { $qstr = $qstr . strr($mm, 2) . '/'; } if ($dd < 10) { $qstr = $qstr . '0' . strr($dd, 1); } else { $qstr = $qstr . strr($dd, 2); } // $qstr=strr($yy,4).'/'.strr($mm,2).'/'.strr($dd,2); } else { $yy = $yy % 100; $qstr = strr($yy, 2) . '/'; if ($mm < 10) { $qstr = $qstr . '0' . strr($mm, 1) . '/'; } else { $qstr = $qstr . strr($mm, 2) . '/'; } if ($dd < 10) { $qstr = $qstr . '0' . strr($dd, 1); } else { $qstr = $qstr . strr($dd, 2); } } return $qstr; }
public function getMonthlyReport() { $userseq = $this->input->post("UserSeq"); $prescriptdate = $this->input->post("PrescriptDate"); $this->load->model("achiveratio"); try { $ratio = array(); $ratio[] = $this->achiveratio->getratio($userseq, month($prescriptdate)); $ratio[] = $this->achiveratio->getratio($userseq, monthbefore2(1, $prescriptdate)); $ratio[] = $this->achiveratio->getratio($userseq, monthbefore2(2, $prescriptdate)); $ratio[] = $this->achiveratio->getratio($userseq, monthbefore2(3, $prescriptdate)); $ratio[] = $this->achiveratio->getratio($userseq, monthbefore2(4, $prescriptdate)); $ratio[] = $this->achiveratio->getratio($userseq, monthbefore2(5, $prescriptdate)); $healthgrade = $this->getMonthlyHealthGrade($userseq, $prescriptdate); echo json_capsule(array('Response' => 'Success', 'AchiveRatio' => $ratio, 'MonthRatio' => $ratio[0], 'HealthGrade' => $healthgrade)); } catch (Exception $e) { echo json_capsule(array('Response' => 'Fail', 'RtMsg' => 'Failed to set today exercises.', 'Error' => $e->getMessage())); } }
exit; } if (isset($_GET["hour"])) { hour(); exit; } if (isset($_GET["today"])) { today(); exit; } if (isset($_GET["week"])) { week(); exit; } if (isset($_GET["month"])) { month(); exit; } if (isset($_GET["year"])) { year(); exit; } if (isset($_POST["LoadAvgClean"])) { LoadAvgClean(); exit; } if (isset($_GET["apache-front-end-status"])) { apache_status(); exit; } if (isset($_GET["squid-front-end-status"])) {
include_once('ressources/class.artica.graphs.inc'); if(posix_getuid()==0){die();} $user=new usersMenus(); if($user->AsSquidAdministrator==false){ $tpl=new templates(); echo "alert('". $tpl->javascript_parse_text("{ERROR_NO_PRIVS}")."');"; die();exit(); } if($_GET["tabs"]){tabs();exit;} if(isset($_GET["title-caches-perf"])){title_caches_perf();exit;} if($_GET["period"]=="howto"){howto();exit;} if($_GET["period"]=="today"){today();exit;} if($_GET["period"]=="week"){week();exit;} if($_GET["period"]=="month"){month();exit;} js(); function js(){ $page=CurrentPageName(); $tpl=new templates(); if(isset($_GET["inline"])){echo "$('#BodyContent').load('$page?tabs=yes');";return;} $title=$tpl->_ENGINE_parse_body("{cache_performance}::{statistics}"); $html="YahooWin4('750','$page?tabs=yes','$title')"; echo $html; } function tabs(){ $tpl=new templates();