本文整理汇总了PHP中getmonth函数的典型用法代码示例。如果您正苦于以下问题:PHP getmonth函数的具体用法?PHP getmonth怎么用?PHP getmonth使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getmonth函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
} else {
$action = @$_REQUEST["action"];
$VipUser = $_COOKIE["AdminUser"];
$title = @$_REQUEST["biaoti"];
$content = @$_REQUEST["yaoqiu"];
$pianshu = @$_REQUEST["pianshu"];
$price = @$_REQUEST["jiage"];
$data = date("Y-m-d H:i:s");
$flag = @$_REQUEST["flag"];
$encontent = @$_REQUEST["yijian"];
$ID = @$_REQUEST["userid"];
switch ($action) {
case "add":
$flag = 0;
$flag1 = 3;
$order_id = getyear($data) . getmonth($data) . getday($data) . rand(10000, 99999);
$sqls = "select * from admin where AdminUser='" . $VipUser . "'";
$results = mysql_db_query($dbname, $sqls);
$rss = mysql_fetch_array($results);
if ($rss != NULL) {
$leixing = "软文代写";
$sqlc = "insert into caiwu (order_id,VipUser,operator,leixing,jine,flag,data) values ('" . $order_id . "','" . $VipUser . "','" . $VipUser . "','" . $leixing . "'," . $price . "," . $flag1 . ",'" . $data . "')";
mysql_db_query($dbname, $sqlc);
$yue = $rss["yue"] - $price;
$sqlu = "update admin set yue=" . $yue . " where AdminUser='" . $VipUser . "'";
mysql_db_query($dbname, $sqlu);
$sql = "insert into daixie_info (order_id,title,content,pianshu,price,VipUser,data,flag) values ('" . $order_id . "','" . $title . "','" . $content . "'," . $pianshu . "," . $price . ",'" . $VipUser . "','" . $data . "'," . $flag . ")";
mysql_db_query($dbname, $sql);
//mysql_select_db($dbname);
//$result=mysql_query($sql);
echo "<script>alert('提交代写成功!');location.href='daixie.php';</script>";
示例2: date
$bdsel = '';
}
echo "<option value='" . $i . "'" . $bdsel . ">" . $i . "</option>\n";
}
?>
</select>
<select name="to_month">
<?php
$to_month = $gpc->get('to_month', int, date('n'));
for ($i = 1; $i <= 12; $i++) {
if ($to_month == $i) {
$bmsel = ' selected="selected"';
} else {
$bmsel = '';
}
echo "<option value='" . $i . "'" . $bmsel . ">" . getmonth($i) . "</option>\n";
}
?>
</select>
<select name="to_year">
<?php
$to_year = $gpc->get('to_year', int, date('Y'));
for ($i = $to_year; $i >= 2000; $i--) {
if (date('Y') == $i) {
$bysel = ' selected="selected"';
} else {
$bysel = '';
}
echo "<option value='" . $i . "'" . $bysel . ">" . $i . "</option>\n";
}
?>
示例3: edit
/**
* Cnews::edit()
*
* @param integer $catalogue_id
* @param integer $news_id
* @return
*/
function edit($catalogue_id = 0, $news_id = 0)
{
$newscatalogue = new newscatalogue($catalogue_id);
if (!$newscatalogue->exists()) {
show_404();
}
$news = new article($news_id);
if ($_SERVER['REQUEST_METHOD'] == "GET") {
if (!$news->exists()) {
} else {
if (getconfigkey('use_ftp')) {
$this->load->library('ftp');
$config['hostname'] = $this->cauhinh->where('fieldname', 'ftp_server')->get()->value;
$config['username'] = $this->cauhinh->where('fieldname', 'ftp_username')->get()->value;
$config['password'] = $this->cauhinh->where('fieldname', 'ftp_password')->get()->value;
if (empty($news->dir)) {
$ex = explode(' ', $news->created);
$createdate = $ex[0];
$y = getyear($createdate);
$m = getmonth($createdate);
$d = getday($createdate);
$ddir = "img/news/" . $y . '/' . $m . '/' . $d . '/' . md5(date("Y-m-d h:i:s")) . '/';
$news->dir = $ddir;
$news->save();
$this->_create_dir($ddir);
} else {
if ($this->ftp->list_files($news->dir) == FALSE) {
$this->_create_dir($news->dir);
}
}
$this->ftp->close();
} else {
if (empty($news->dir)) {
$news->dir = getconfigkey("default_news_dir");
}
}
}
} else {
$this->load->helper('remove_vn_helper');
$this->load->library('file_lib');
$news->title_vietnamese = $this->input->post('title_vietnamese');
$news->title_english = $this->input->post('title_english');
$news->title_japanese = $this->input->post('title_japanese');
$news->title_none = remove_vn($news->title_vietnamese);
$news->author = $this->input->post('author');
$news->tag = $this->input->post('tag');
$tags = remove_vn($this->input->post('tag') . ' ' . $this->input->post('title_vietnamese') . ' ' . $this->input->post('short_vietnamese'));
$tags = explode('-', $tags);
$news->tag_search = implode(' ', $tags);
$news->short_vietnamese = strip_tags($this->input->post('txtShort_vietnamese'));
$news->full_vietnamese = $this->input->post('txtFull_vietnamese');
$news->short_english = strip_tags($this->input->post('txtShort_english'));
$news->full_english = $this->input->post('txtFull_english');
$news->short_japanese = strip_tags($this->input->post('txtShort_japanese'));
$news->full_japanese = $this->input->post('txtFull_japanese');
$news->dir = $this->input->post('dir');
$news->pagi = $this->input->post('pagi');
if ($this->logged_in_user->adminrole->id == 1) {
$news->navigation = $this->input->post('navigation');
$news->menu_active = $this->input->post('menu_active');
$news->old_id = $this->input->post('old_id');
}
$new_image = $this->input->post('newimage');
if ($new_image == '1') {
$dataupload = $this->file_lib->upload('image', "img/news");
if (!is_array($dataupload)) {
flash_message('error', $dataupload);
} else {
$news->image = $dataupload['file_name'];
$this->resize_image($news->dir . $dataupload['file_name']);
}
} else {
$news->image = trim($this->input->post('imagelink'));
}
//newstopic
$newstp = new newstopic($this->input->post('newstopic'));
$newsc = new newscatalogue($this->input->post('newscatalogue'));
if (!$news->exists()) {
$news->active = 0;
}
if ($news->save(array($newsc, $newstp))) {
$this->session->unset_userdata('dir_for_news');
redirect($this->admin . 'cnews/edit/' . $news->newscatalogue->id . '/' . $news->id);
} else {
flash_message("error", "Lỗi");
}
}
//setup start folder for kfm
$newscat = new newscatalogue();
$newscat->where('parentcat_id !=', 'NULL');
$newscat->where('parentcat_id', $newscatalogue->parentcat_id);
$newscat->order_by('position', 'asc');
$newscat->get();
//.........这里部分代码省略.........
示例4: list
require "modules/{$module_name}/functions.inc";
global $nowyear, $nowmonth, $nowdate, $nowhour, $MAIN_CFG, $prefix, $db, $now;
list($total) = $db->sql_ufetchrow('SELECT SUM(count) FROM ' . $prefix . "_counter \n\tWHERE type='os'", SQL_NUM);
require_once 'header.php';
$total++;
OpenTable();
echo '<table class="forumline" cellspacing="1" width="100%">
<tr>
<td class="cat"><div class="cattitle" style="text-align:center;">' . $MAIN_CFG['global']['sitename'] . ' ' . _STATS . '</div></td>
</tr><tr>
<td class="row1" align="center"><span class="gen">' . _WERECEIVED . " <b>{$total}</b> " . _PAGESVIEWS . " {$MAIN_CFG['global']['startdate']}<br />" . _TODAYIS . ": " . sprintf(_DATESTRING4, getmonth($now[1]), $now[0], $now[2]) . "<br />";
list($year, $month, $hits) = $db->sql_ufetchrow("SELECT year, month, SUM(hits) as hits FROM " . $prefix . "_stats_hour \n\tGROUP BY month, year \n\tORDER BY hits DESC", SQL_NUM);
echo _MOSTMONTH . ": " . getmonth($month) . " {$year} ({$hits} " . _HITS . ")<br />";
list($year, $month, $date, $hits) = $db->sql_ufetchrow("SELECT year, month, date, SUM(hits) as hits FROM " . $prefix . "_stats_hour \n\tGROUP BY date, month, year \n\tORDER BY hits DESC", SQL_NUM);
echo _MOSTDAY . ": {$date} " . getmonth($month) . " {$year} ({$hits} " . _HITS . ")<br />";
list($year, $month, $date, $hour, $hits) = $db->sql_ufetchrow("SELECT year, month, date, hour, hits from " . $prefix . "_stats_hour \n\tORDER BY hits DESC", SQL_NUM);
if ($hour < 10) {
$hour = "0{$hour}:00 - 0{$hour}:59";
} else {
$hour = "{$hour}:00 - {$hour}:59";
}
echo _MOSTHOUR . ": {$hour} " . _ON . " " . getmonth($month) . " {$date}, {$year} ({$hits} " . _HITS . ")<br /><br />[ <a href=\"" . URL::index() . "\">" . _RETURNBASICSTATS . '</a> ]</span><br /> </td>
</tr></table><br />';
showYearStats($nowyear);
echo '<br />';
showMonthStats($nowyear, $nowmonth);
echo '<br />';
showDailyStats($nowyear, $nowmonth, $nowdate);
echo '<br />';
showHourlyStats($nowyear, $nowmonth, $nowdate);
CloseTable();
示例5: getmonth
$next_month = 1;
$next_year = $next_year + 1;
}
echo "<h1>";
echo getmonth($working_month) . " / " . $working_year . " » " . __('Totals for this month') . " » ({$total_hours})";
echo "</h1>";
echo "<form method='post' action='index.php?sec=users&sec2=operation/user_report/report_monthly'>";
echo "<table class='search-table' style='width:99%'><tr><td style='width: 200px;'>";
echo "<table text-align: center;'>";
echo "<tr><td>";
echo "<a href='index.php?sec=users&sec2=operation/user_report/report_monthly&working_month={$prev_month}&working_year={$prev_year}'><img src='images/control_rewind_blue.png' title='" . __('Prev') . "'></a> ";
echo "</td><td>";
echo "<select name='working_month' style='width: 100%;'>";
echo "<option value='{$working_month}'>" . getmonth($working_month);
for ($ax = 1; $ax <= $now_month; $ax++) {
echo "<option value='{$ax}'>" . getmonth($ax);
}
echo "</select>";
echo "</td><td>";
echo "<a href='index.php?sec=users&sec2=operation/user_report/report_monthly&working_month={$next_month}&working_year={$next_year}'><img src='images/control_fastforward_blue.png' title='" . __('Next') . "'></a> ";
echo "</table>";
echo "</td><td>";
echo "<table>";
echo "<tr><td>";
echo __('Filter');
echo "</td><td>";
$search = get_parameter("search", '');
print_input_text('search', $search, '', 25);
echo "</table>";
echo "</td><td style='text-align: right;'>";
echo "<input type=submit class='sub search' value='" . __('Search') . "'>";
示例6: showHourlyStats
function showHourlyStats($year, $month, $date)
{
global $prefix, $bgcolor1, $bgcolor2, $db, $ThemeSel;
$l_size = getimagesize("themes/{$ThemeSel}/images/leftbar.gif");
$m_size = getimagesize("themes/{$ThemeSel}/images/mainbar.gif");
$r_size = getimagesize("themes/{$ThemeSel}/images/rightbar.gif");
$resulttotal = $db->sql_query("SELECT sum(hits) as TotalHitsHour from " . $prefix . "_stats_hour where year='{$year}' and month='{$month}' and date='{$date}'");
list($TotalHitsHour) = $resulttotal->fetch_row();
$db->sql_freeresult($resulttotal);
$nowdate = date("d-m-Y");
$nowdate_arr = explode("-", $nowdate);
echo "<center><b>" . _HOURLYSTATS . " ";
echo getmonth($month) . " " . $date . ", " . $year . "</b></center><br>";
echo "<table align=\"center\" bgcolor=\"#000000\" cellspacing=\"1\" cellpadding=\"3\" border=\"0\">";
echo "<tr><td width=\"25%\" bgcolor=\"{$bgcolor2}\">" . _HOUR . "</td><td bgcolor=\"{$bgcolor2}\" width=\"70%\">" . _SPAGESVIEWS . "</td></tr>";
for ($k = 0; $k <= 23; $k++) {
$result = $db->sql_query("select hour,hits from " . $prefix . "_stats_hour where year='{$year}' and month='{$month}' and date='{$date}' and hour='{$k}'");
if ($db->sql_numrows($result) == 0) {
$hits = 0;
} else {
$row = $db->sql_fetchrow($result);
$hour = intval($row['hour']);
$hits = intval($row['hits']);
}
echo "<tr><td bgcolor=\"{$bgcolor1}\">";
if ($k < 10) {
$a = "0{$k}";
} else {
$a = $k;
}
echo "{$a}:00 - {$a}:59";
$a = "";
echo "</td><td bgcolor=\"{$bgcolor1}\">";
if ($hits == 0) {
$WidthIMG = 0;
$d_percent = 0;
} else {
$WidthIMG = round(100 * $hits / $TotalHitsHour, 0);
$d_percent = substr(100 * $hits / $TotalHitsHour, 0, 5);
}
echo "<img src=\"themes/{$ThemeSel}/images/leftbar.gif\" Alt=\"\" width=\"{$l_size['0']}\" height=\"{$l_size['1']}\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" height=\"{$m_size['1']}\" width=", $WidthIMG * 2, " Alt=\"\">" . "<img src=\"themes/{$ThemeSel}/images/rightbar.gif\" Alt=\"\" width=\"{$r_size['0']}\" height=\"{$r_size['1']}\"> {$d_percent}% ({$hits})</td></tr>" . "</td></tr>";
}
$db->sql_freeresult($result);
echo "</table>";
}
示例7: count
$first_limit = 0;
} else {
$first_limit = $reports_per_page * ($page_clicked - 1);
}
$second_limit = $reports_per_page;
$query = "select * , `pa`.`id` , `pa`.`notice_link` as `proxyaddid` from `companies` `c` INNER JOIN `proxy_ad` `pa` ON `c`.`com_id`=`pa`.`com_id` ";
$query_result_count = "select count(*) from `companies` `c` INNER JOIN `proxy_ad` `pa` ON `c`.`com_id`=`pa`.`com_id` ";
if ($cname != '') {
$str_cname = " `c`.`com_name` LIKE '%{$cname}%' ";
$str = $str_cname;
}
if ($dp1 != '' && $dp2 != '') {
$m1 = substr($dp1, -8, 3);
$m2 = substr($dp2, -8, 3);
$mon1 = getmonth($m1);
$mon2 = getmonth($m2);
$y1 = substr($dp1, -4, 4);
$y2 = substr($dp2, -4, 4);
$d1 = substr($dp1, -11, 2);
$d2 = substr($dp2, -11, 2);
$date1 = $d1 . '-' . $mon1 . '-' . $y1;
$date2 = $d2 . '-' . $mon2 . '-' . $y2;
$t1 = strtotime($date1);
$t2 = strtotime($date2);
$str_date = " `pa`.`meeting_date` between '{$t1}' and '{$t2}' ";
if ($cname != '') {
$str = $str . " AND " . $str_date;
} else {
$str = $str . $str_date;
}
}
示例8:
}
if($flag==1)
{
for($i=6;$i<=12;$i++)
{
$options.="<option value='$i,$previousyear'>".getmonth($i)."-$previousyear</option>";
}
for($i=1;$i<=$currentmonth;$i++)
{
if($i==$currentmonth)
{
$options.="<option value='$i,$currentyear' selected>".getmonth($i)."-$currentyear</option>";
}
else
{
$options.="<option value='$i,$currentyear'>".getmonth($i)."-$currentyear</option>";
}
}
}
?>
<select name='month' id='month' onChange='getcalendar();'>
<?
echo $options;
?>
</select>
示例9: fp_hk_id
echo $body;
}
if ($action == "edit_budget") {
$hk_id_query = fp_hk_id($hk_id);
$hk_result = mysql_query($hk_id_query);
while ($hk_row = mysql_fetch_array($hk_result, MYSQL_ASSOC)) {
// var_dump($hk_row);
$loc = $hk_row['loc'];
$dept = $hk_row['dept'];
$hk_budget = number_format($hk_row['budget'], 2);
$hk_expenses = number_format($hk_row['actual_budget'], 2);
$mos = $hk_row['mos'];
$yr = $hk_row['yr'];
$year = get_year_by_id($yr);
}
$mos_def = getmonth($mos);
$loc_def = getloc($loc);
$dept_def = getdept($dept);
$emp_querys = emp_querys($eid, null);
// echo $emp_querys;
$emp_result = mysql_query($emp_querys);
while ($emp_row = mysql_fetch_array($emp_result, MYSQL_ASSOC)) {
$last = $emp_row['last'];
$first = $emp_row['first'];
$middle = $emp_row['middle'];
$pos = $emp_row['position'];
$name = $last . ", " . $first . " " . $middle;
}
$body = '<div class="box-content responsive" style="font-size: 12px;">
<center>
<h3>' . $loc_def . '(' . $dept_def . ')' . '</h3></center><br>
示例10: getmonth
echo "<h2>";
echo getmonth($working_month). " / ". $working_year. "</h2><h4>".__('Totals for this month'). " » $total_hours";
echo "</h4>";
echo '<div class="divform">';
echo "<form method='post' action='index.php?sec=users&sec2=operation/user_report/report_monthly'>";
echo "<table class='search-table' style='width:100%'>";
echo "<tr><td>";
echo "<a href='index.php?sec=users&sec2=operation/user_report/report_monthly&working_month=$prev_month&working_year=$prev_year'><img src='images/control_rewind_blue.png' title='" . __('Prev') . "'></a> ";
echo "<select name='working_month' style='width: 125px !important;'>";
//echo "<option value='$working_month'>".getmonth($working_month);
for ($ax=1; $ax <= $now_month; $ax++){
if ($working_month == $ax)
echo "<option selected value='$ax'>".getmonth($ax);
else
echo "<option value='$ax'>".getmonth($ax);
}
echo "</select>";
echo "<a href='index.php?sec=users&sec2=operation/user_report/report_monthly&working_month=$next_month&working_year=$next_year'><img src='images/control_fastforward_blue.png' title='" . __('Next') . "'></a> ";
echo "</td>";
echo "<tr><td>";
echo "<b>" . __('Filter') . print_help_tip (__("Search according to users ID and name"), true) . "</b><br>";
$search = get_parameter ("search", '');
print_input_text ('search', $search, '', 25);
echo "</td></tr>";
echo "<tr><td>";
echo "<input type=submit class='sub search' value='".__('Search')."'>";
示例11: void
if($i<=$num)
{
echo "<a id='$year-$month-$i' href='javascript: void(0)' onclick='viewhomework($i,$month,$year);highlight($firstday,$num,$i,$month,$year);'>";
echo $i;
echo "</a>";
$i++;
}
echo "</td>";
}
echo "</tr>";
}
?>
</table>
<?
}
$monthyear=$_REQUEST['monthyear'];
$monthyeararr=explode(',',$monthyear);
$month=$monthyeararr[0];
$year="20".$monthyeararr[1];
$num = cal_days_in_month(CAL_GREGORIAN, $month, $year);
$getmonthname=getmonth($month);
$firstday=firstDayOfMonth($getmonthname,$year);
//echo 'First day of the month: ' . date('m/d/y h:i a',(strtotime('this month',strtotime(date('m/01/y')))));
displaycalendar($num,$firstday,$month,$year);
?>
示例12: date
break;
}
}
$mois = date("m");
$annee = date("Y");
$jours = date("t");
$values = array();
$days = array();
for ($i = 1; $i <= $jours; $i++) {
$values[] = ca_mois($mois, $annee, "{$i}", 100, 1);
$days[] = $i;
}
require_once "../lib/artichow/LinePlot.class.php";
$graph = new archiGraph(968, 200);
$graph->border->hide();
$graph->title = new archiLabel(trad('progression_graph', 'admin') . " " . getmonth($mois) . " : " . ca_mois($mois, $annee, "%", 100, 1) . " €", new archiFileFont(ARTICHOW_FONT . '/Arial', 10));
$plot = new archiLinePlot($values);
$plot->setAbsSize(968, 200);
// $plot->setBackgroundColor(new archiColor(240, 240, 240));
$plot->hideLine(TRUE);
$plot->setFillColor(new archiColor(180, 180, 180, 75));
//$plot->grid->setBackgroundColor(new archiColor(235, 235, 180, 60));
$plot->grid->hideVertical();
/*
$plot->setBackgroundGradient(
new archiLinearGradient(
new archiColor(210, 210, 210),
new archiColor(250, 250, 250),
0
)
);
示例13: gethomework
function gethomework($schoolid,$classid,$sectionid,$homeworkdate)
{
$flag=0;
$j=1;
$sql="select * from homeworkmessage where SchoolId='$schoolid' and ClassId='$classid' and SectionId='$sectionid' and HomeworkDate='$homeworkdate' order by DateTimeRecordInserted desc";
$result = mysql_query($sql) or die('Query failed1: ' . mysql_error());
while($row=mysql_fetch_array($result))
{
$flag=1;
$homeworkarr=explode('#',$row['Homework']);
$subjectidarr=explode(',',$row['SubjectIDs']);
$homework="";
for($j=0;$j<count($subjectidarr);$j++)
{
$subjectid=$subjectidarr[$j];
if($subjectid==0)
{
$subjectname="EXTRA";
}
else
{
$subjectname=strtoupper(getsubjectname($subjectid));
}
if($homeworkarr[$j]!="")
{
$homework.="<tr><td>$subjectname</td><td>$homeworkarr[$j]</td></tr>";
}
}
}
if($flag==0)
{
$homework="<tr><td colspan='2'>Homework has not been uploaded.</td></tr>";
}
$date=$homeworkdate;
$datearr=explode('-',$date);
$monthname=getmonth($datearr[1]);
$day=$datearr[2];
?>
<table class="table table-striped">
<tr>
<th align='left'>
<?
echo "$day $monthname";
?>
</th>
<th>
</th>
</tr>
<?
echo $homework;
?>
</table>
<?
}
示例14: getallmonths
/**
* get all month names (eventually with short name)
*
* @param boolean $shortName define output format of month
*
* @return array with all month names
*/
function getallmonths($shortName = false)
{
$ret = array();
for ($i = 1; $i < 13; $i++) {
$ret[$i] = getmonth($i, $shortName);
}
return $ret;
}