예제 #1
0
 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();
 }
예제 #2
0
     $month = '';
     $day = '';
     /* Deal with cases where we feed in a UNIX timestamp value instead - Steve does this a lot (feed DB rows directly in as_array) */
     if ($value && is_numeric($value)) {
         $year = date('Y', $value);
         $month = date('n', $value);
         $day = date('d', $value);
     } else {
         if ($value && $value != '0000-00-00') {
             $date = strtotime($value);
             $year = date('Y', $date);
             $month = date('n', $date);
             $day = date('d', $date);
         }
     }
     $years = array_values(date::years(1900, date('Y', time() + 31536000 * 5)));
     //Allow for up to 5 years ahead.
     $years = array_combine($years, $years);
     $years[-1] = "";
     ksort($years);
     $days = array_merge(array(-1 => " "), array_combine(range(1, 31), range(1, 31)));
     $days[-1] = "";
     ksort($years);
     echo form::select($field . '-year', $years, $year, $attributes);
     echo ' ';
     echo form::select($field . '-month', $months, $month, $attributes);
     echo ' ';
     echo form::select($field . '-day', $days, $day, $attributes);
     echo '<br />';
     break;
 default:
예제 #3
0
파일: html.php 프로젝트: enormego/EightPHP
 /**
  * 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;
 }
예제 #4
0
 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;
 }