当前位置: 首页>>代码示例>>PHP>>正文


PHP date::days方法代码示例

本文整理汇总了PHP中date::days方法的典型用法代码示例。如果您正苦于以下问题:PHP date::days方法的具体用法?PHP date::days怎么用?PHP date::days使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在date的用法示例。


在下文中一共展示了date::days方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __visitor_count_month

 public function __visitor_count_month($date)
 {
     $start_date;
     $start = date('Y-m-d H:i', strtotime($date['year'] . "-" . $date['month'] . "-01 00:00"));
     $final_date = $this->_plus_month($date);
     $end = date('Y-m-d H:i', strtotime($final_date['year'] . "-" . $final_date['month'] . "-01 00:00"));
     $html = "";
     $html .= "<p>total visits: " . stats::get_visitor_count($start, $end) . "</p>";
     $html .= "<p>unique visitors: " . stats::get_visitor_count($start, $end, true) . "</p>";
     $views = array();
     $unique = array();
     foreach (date::days($date['month'], $date['year']) as $day) {
         $start = date('Y-m-d H:i', strtotime($date['year'] . "-" . $date['month'] . "-" . $day . " 00:00"));
         $end_day = $day + 1;
         if (count(date::days($date['month'], $date['year'])) < $end_day) {
             $end = date('Y-m-d H:i', strtotime($final_date['year'] . "-" . $final_date['month'] . "-01 00:00"));
         } else {
             $end = date('Y-m-d H:i', strtotime($date['year'] . "-" . $date['month'] . "-" . ($day + 1) . " 00:00"));
         }
         $count = stats::get_visitor_count($start, $end);
         $views[$day] = $count;
         $count = stats::get_visitor_count($start, $end, true);
         $unique[$day] = $count;
     }
     $chart = new GoogChart();
     $dataMultiple = array("Page views" => $views, "Unique visitors" => $unique);
     $min = 0;
     $max = 10;
     //	chxr='y',$min,$max,(($max-$min)/10);
     /* # Chart 2 # */
     $chart->setChartAttrs(array('type' => 'line', 'title' => 'Visits for ' . date('F Y', strtotime($start)), 'data' => $dataMultiple, 'size' => array(750, 200), 'labelsXY' => true, 'color' => array('#27aae1', '#e127aa')));
     // Print chart
     $html .= $chart;
     return $html;
 }
开发者ID:sydlawrence,项目名称:SocialFeed,代码行数:35,代码来源:stats.php

示例2: confirm

 public function confirm()
 {
     if (@$_SESSION['conf']['order']['district_name'] == '' and @$_SESSION['conf']['order']['district_price'] == '') {
         $this->redirect($this->__("cart"));
     }
     if ($this->ispost()) {
         $this->redirect($this->__("cart") . '/' . $this->__("request"));
     }
     $errormsg = '';
     //$this->confirm_validation();
     $orderfpp = new fpp_order_Model();
     $this->refresh_prices_product();
     $yr = date("Y");
     $this->refresh_prices_shipping();
     $cart_content = $_SESSION['conf']['cart'];
     $total = $_SESSION['conf']['cart']['subtotal_noformat'] + $_SESSION['conf']['order']['district_price'];
     Basic::currency($total);
     $payment = new Paymentclass();
     $paymentinfo = $payment->infomod(@$_SESSION['conf']['order']['payment_type']);
     $href_shipping = $this->href($this->__("cart") . '/' . $this->__("shipping"));
     $this->title = __('Datos de Envio', false);
     $client = new fpp_client_Model();
     $client = $client->db2cls((int) @$_SESSION['conf']['client']['id']);
     $country = new fpp_country_Model();
     $country = $country->db2cls($client->country_client);
     $this->content = View::factory("main/confirm")->set("country", $country)->set("client", $client)->set("href_shipping", $href_shipping)->set("cart_content", $cart_content)->set("order", @$_SESSION['conf']['order'])->set("errormsg", $errormsg)->set("paymentinfo", $paymentinfo)->set("payment_type", $_SESSION['conf']['order']['payment_type'])->set("comments", @$_SESSION['conf']['order']['comments'])->set("total", $total)->set("select_turn", $orderfpp->turn)->set("select_day", date::days(1))->set("select_month", $this->__months())->set("select_year", date::years($yr, $yr + 2))->render();
 }
开发者ID:brojasmeneses,项目名称:floreriarosabel,代码行数:27,代码来源:Cart.php

示例3: date_dropdown

 /**
  * Creates a group of dropdown boxes for date selection
  * 
  * @param	string		comma seperated list of parts to be included
  * @param	string		form element name prefix example: user_
  * @param	array		variables to be used within the function
  * @return	string		html for specified elements
  */
 public static function date_dropdown($parts = 'month,day,year,time', $prefix = '', $other = array(), $selected = array())
 {
     if (!is_array($parts)) {
         $parts = explode(',', $parts);
     }
     // Blank HTML string.
     $html = '';
     foreach ($parts as $part) {
         switch ($part) {
             case 'month':
                 if (!isset($selected['month'])) {
                     $selected['month'] = date('n');
                 }
                 $html .= form::dropdown($prefix . 'month', date::months(), $selected['month']);
                 break;
             case 'day':
                 if (!isset($selected['month'])) {
                     $selected['day'] = date('j');
                 }
                 $html .= form::dropdown($prefix . 'day', date::days(date('n')), $selected['day']);
                 break;
             case 'year':
                 if (!isset($selected['year'])) {
                     $selected['year'] = date('Y');
                 }
                 if (!isset($other['year']['start'])) {
                     $other['year']['start'] = false;
                 }
                 if (!isset($other['year']['end'])) {
                     $other['year']['end'] = false;
                 }
                 $html .= form::dropdown($prefix . 'year', date::years($other['year']['start'], $other['year']['end']), $selected['year']);
                 break;
             case 'time':
                 if (!isset($selected['hour'])) {
                     $selected['hour'] = date('g');
                 }
                 $html .= form::dropdown($prefix . 'hour', date::hours(), $selected['hour']);
                 if (!isset($selected['min'])) {
                     $selected['min'] = date('i');
                 }
                 $html .= form::dropdown($prefix . 'min', date::minutes(1), $selected['min']);
                 if (!isset($selected['ampm'])) {
                     $selected['ampm'] = date('a');
                 }
                 $html .= form::dropdown($prefix . 'ampm', array('am' => 'am', 'pm' => 'pm'), $selected['ampm']);
         }
     }
     return $html;
 }
开发者ID:enormego,项目名称:EightPHP,代码行数:58,代码来源:html.php

示例4: register

 public function register()
 {
     $config_store_name = $this->config_store_name;
     $mail_store = $this->mail_store;
     $href_store = $this->href_store;
     $address_store = $this->address_store;
     $logged = $this->_islogged();
     if ($this->ispost()) {
         if ($this->_validate() == true) {
             if ($logged == false) {
                 $view = View::factory("extras/confirm_mail")->set("client_name", $_POST['fname'] . ' ' . $_POST['lname'])->set("store_name", $config_store_name)->set("mail_store", $mail_store)->set("href_store", $href_store)->set("address_store", $address_store)->set("password", $_POST['password'])->set("user", $_POST['mail'])->render();
                 basics::mail_html_utf8($_POST['mail'], __("Bienvenido Estimado Cliente", false), $view, $mail_store, $config_store_name);
             }
             // Save in DB
             $id = $logged ? $this->id_client : null;
             $orm = $this->table->db2cls($id);
             if ($this->information_print == true) {
                 $data['mail_client'] = @$_POST['mail'];
                 $data['fname_client'] = @$_POST['fname'];
                 $data['lname_client'] = @$_POST['lname'];
                 $data['country_client'] = @$_POST['select_country'];
                 $data['district_client'] = @$_POST['district'];
                 $data['address_client'] = @$_POST['address'];
                 $data['gender_client'] = @$_POST['gender'];
                 $data['birthdate_cliente'] = @$_POST['select_year'] . '-' . @$_POST['select_month'] . '-' . @$_POST['datebirth_day'];
                 $data['company_client'] = @$_POST['company'];
                 $data['ruc_client'] = @$_POST['ruc'];
                 $data['company_address'] = @$_POST['company_address'];
                 $data['departament_client'] = @$_POST['departament'];
                 $data['province_client'] = @$_POST['province'];
                 $data['postalcode_client'] = @$_POST['postalcode'];
                 $data['phone_client'] = @$_POST['phone'];
                 $data['fax_client'] = @$_POST['fax'];
                 $data['dni_client'] = @$_POST['dni'];
             }
             if ($this->password_print == true) {
                 $data['password_client'] = fpp::cryptme($_POST['password']);
             }
             $orm->set_fields($data);
             $orm->save();
             $this->html_error = basics::divmessage(array(__("Datos Guardados correctamente", false)));
             if ($logged == false) {
                 $this->_login($orm->mail_client, $orm->password_client);
                 $this->process_continue();
                 $view = View::factory("main/register_ok")->render();
                 $this->content = $view;
                 return true;
             }
         }
     }
     $select_month = array('1' => 'Enero', '2' => 'Febrero', '3' => 'Marzo', '4' => 'Abril', '5' => 'Mayo', '6' => 'Junio', '7' => 'Julio', '8' => 'Agosto', '9' => 'Septiembre', '10' => 'Octubre', '11' => 'Noviembre', '12' => 'Diciembre');
     $form = $this->GetHrefClientRegister();
     if ($this->password_print == false) {
         $form = $this->_url('client', 'change_info');
     }
     if ($this->information_print == false) {
         $form = $this->_url('client', 'change_password');
     }
     $view = View::factory("main/register")->set("form_register", form::open($form))->set("error_message", $this->html_error)->set("select_day", form::dropdown("datebirth_day", date::days(1), @$_POST['datebirth_day']))->set("select_month", form::dropdown("select_month", $select_month, @$_POST['select_month']))->set("select_year", form::dropdown("select_year", date::years(1940, date("Y")), @$_POST['select_year']))->set("select_country", basics::countryselect("select_country", @$_POST['select_country']))->set("password_print", $this->password_print)->set("information_print", $this->information_print)->set("logged", $logged)->set("title", "Registro de Cliente")->render();
     $this->title = __('Registro', false);
     $this->content = $view;
 }
开发者ID:brojasmeneses,项目名称:floreriarosabel,代码行数:62,代码来源:Client.php


注:本文中的date::days方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。