Esempio n. 1
0
 function index()
 {
     $valid = $this->form_validation;
     $valid->set_rules('txtemail', 'Email', 'trim|required|valid_email');
     $valid->set_rules('txttitle', 'Tiêu đề', 'trim|required');
     $valid->set_rules('txtnoidung', 'Nội dung', 'trim|required');
     if ($valid->run() == FALSE) {
         $data['error'] = "Bạn điền thông tin đầy đủ";
         $this->render($this->load->view('contact/show', $data, TRUE));
     } else {
         $now = getdate();
         $currentDate = $now["mday"] . "-" . $now["mon"] . "-" . $now["year"];
         $data['email'] = $this->input->post('txtemail');
         $data['title'] = $this->input->post('txttitle');
         $data['info'] = $this->input->post('txtnoidung');
         $data['add_date'] = $currentDate;
         $act = $this->input->post('ok');
         if ($act == "Liên hệ") {
             if (!$this->Mcontact->add($data)) {
                 $data['error'] = "Cảm ơn bạn chúng tôi sẽ hồi âm lại!";
             }
         }
         $this->render($this->load->view('contact/show', $data, TRUE));
     }
 }
 /** Make a foursquare API request.
  * @param str $endpoint API endpoint to access
  * @param str $access_token OAuth token for the user
  * @param arr $fields Array of URL parameters
  * @return array Decoded JSON response
  */
 public function apiRequest($endpoint, $access_token, $fields = null)
 {
     // Add endpoint and OAuth token to the URL
     $url = $this->api_domain . $endpoint . '?oauth_token=' . $access_token;
     // If there are additional parameters passed in add them to the URL also
     if ($fields != null) {
         foreach ($fields as $key => $value) {
             $url = $url . '&' . $key . '=' . $value;
         }
     }
     // Foursquare requires us to add the date at the end of the request so get a date array
     $date = getdate();
     // Add the year month and day at the end of the URL
     $url = $url . "&v=" . $date['year'] . $date['mon'] . $date['mday'];
     // Get any results returned from this request
     $result = Utils::getURLContents($url);
     // Return the results
     $parsed_result = json_decode($result);
     if (isset($parsed_result->meta->errorType)) {
         $exception_description = $parsed_result->meta->errorType;
         if (isset($parsed_result->meta->errorDetail)) {
             $exception_description .= ": " . $parsed_result->meta->errorDetail;
         }
         throw new Exception($exception_description);
     } else {
         return $parsed_result;
     }
 }
Esempio n. 3
0
function macro_Age($formatter, $value = '')
{
    if (empty($value)) {
        $text = '';
    } else {
        if (is_numeric($value)) {
            $n_year = (int) date('Y');
            $text = $n_year - $value;
        } else {
            $now_date = getdate(time());
            $n_year = (int) date('Y');
            $n_month = (int) date('m');
            $n_day = (int) date('d');
            $values = explode('/', $value);
            $v_year = $values[0];
            $v_month = $values[1];
            $v_day = $values[2];
            $age = 0;
            $age = $n_year - $v_year;
            if ($n_month >= $v_month && $n_day >= $v_day) {
                $age = $age + 1;
            }
            $text = $age;
        }
    }
    return "{$text}";
}
Esempio n. 4
0
 /**
  * timestamp转换成显示时间格式
  * @param $timestamp
  * @return unknown_type
  */
 public static function tTimeFormat($timestamp)
 {
     $curTime = time();
     $space = $curTime - $timestamp;
     //1分钟
     if ($space < 60) {
         $string = "刚刚";
         return $string;
     } elseif ($space < 3600) {
         //一小时前
         $string = floor($space / 60) . "分钟前";
         return $string;
     }
     $curtimeArray = getdate($curTime);
     $timeArray = getDate($timestamp);
     if ($curtimeArray['year'] == $timeArray['year']) {
         if ($curtimeArray['yday'] == $timeArray['yday']) {
             $format = "%H:%M";
             $string = strftime($format, $timestamp);
             return "今天 {$string}";
         } elseif ($curtimeArray['yday'] - 1 == $timeArray['yday']) {
             $format = "%H:%M";
             $string = strftime($format, $timestamp);
             return "昨天 {$string}";
         } else {
             $string = sprintf("%d月%d日 %02d:%02d", $timeArray['mon'], $timeArray['mday'], $timeArray['hours'], $timeArray['minutes']);
             return $string;
         }
     }
     $string = sprintf("%d年%d月%d日 %02d:%02d", $timeArray['year'], $timeArray['mon'], $timeArray['mday'], $timeArray['hours'], $timeArray['minutes']);
     return $string;
 }
Esempio n. 5
0
 /**
  * Получить timestamp следующей даты с указанным днём недели
  */
 protected function get_day_of_month_future_timestamp($day_of_month, $hours, $minutes)
 {
     if ($day_of_month > 31) {
         $day_of_month = 1;
     }
     // WTF do you want?
     // (а) день будет в этом месяце
     // (б) в этом месяце уже прошёл этот день
     // (в) в месяце нет этого дня (29, 30, 31 число)
     $now = getdate();
     $month = $now["mon"];
     $year = $now["year"];
     if ($now["mday"] > $day_of_month || $now["mday"] == $day_of_month && $now["hours"] * 60 + $now["minutes"] > $hours * 60 + $minutes) {
         // поезд ушёл
         if ($month == 12) {
             $year++;
             $month = 1;
         } else {
             $month++;
         }
     }
     $days_in_month = array(0, 31, $year % 4 ? 28 : 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
     if ($days_in_month[$month] < $day_of_month) {
         // к счастью в декабре 31 день, а за коротким месяцем всегда идёт длинный
         $month++;
     }
     return mktime($hours, $minutes, 0, $month, $day_of_month, $year);
 }
Esempio n. 6
0
 protected function specific_definition($mform)
 {
     global $CFG, $DB;
     $alerttypes = array(0 => 'NONE', 1 => 'In Zero Cluster', 2 => 'Lowest 10% scores in Cluster');
     $tabletypes = array('overall' => 'All activities and marks(Overall)', 'overall_activities' => 'All activities(Overall Activities)', 'overall_marks' => 'Overall marks received (Overall Marks)', 'log' => 'Any activity (Log)', 'post' => 'Post activity (Post)', 'comments' => 'Comments activity (Comments)', 'forum_discussions' => 'Forum discussions (Forum Discussions)', 'forum_posts' => 'Forum posts (Forum Posts)', 'forum_postsResponder' => 'Responding to forum posts(Forum Posts Responder)', 'user_lastaccess' => 'User last access (User Lastaccess)', 'quiz_attempts' => 'Attempting quizzes (Quiz Attempt)', 'quiz_grades' => 'Grade in quizzes (Quiz Grades)', 'grade_grades' => 'Grades received (Grade Grades)', 'grade_gradesParticipation' => 'Participation in grade activity (Grade Grades Participation)', 'assignment_submissions' => 'Submission of assignment (Assignment Submisstions)', 'lesson_grades' => 'Grades received from lesson (Lesson Grades)', 'question_attempt_steps' => 'Attempts at question (Question Attempt Steps)', 'message' => 'Unread message created by user (Message)', 'messageTo' => 'Unread message created to user (Message To)', 'message_read' => 'Read message created by user (Message Read)', 'message_readTo' => 'Read message created to user (Lesson Grades)', 'chat_messages' => 'Chat messages (Chat message)', 'tag' => 'Tags (Tags)', 'files' => 'Files created (Files)', 'my_pages' => 'My page created by user(My Pages)', 'wiki_pages' => 'Created wiki pages (Wiki |Pages)', 'event' => 'Events created (Events)');
     $today = getdate();
     $courseid = $this->page->course->id;
     $mform->addElement('header', 'configheader', get_string('alerts', 'block_itutor_profiler'));
     $alerts = $DB->get_records('block_itutor_profiler_alerts', array('course_id' => $courseid));
     foreach ($alerts as $alert) {
         $dateOfAlert = getdate($alert->alert_date);
         if ($today['yday'] > $dateOfAlert['yday'] && $today['year'] == $dateOfAlert['year'] || $today['year'] < $dateOfAlert['year']) {
             $DB->delete_records('block_itutor_profiler_alerts', array('id' => $alert->id));
         } else {
             $s = 'config_isalerting' . $alert->id;
             $mform->addElement('checkbox', $s, "DATE: {$dateOfAlert['mday']}/{$dateOfAlert['mon']}/{$dateOfAlert['year']} TYPE: {$alerttypes[$alert->alert_type]} DATA: {$alert->alert_data}");
             $mform->setDefault($s, true);
             $mform->setType($s, PARAM_BOOL);
         }
     }
     $mform->addElement('header', 'addalertheader', get_string('addalert', 'block_itutor_profiler'));
     $mform->addElement('hidden', 'config_courseid', $courseid);
     $mform->addElement('date_selector', 'config_alertdate', get_string('alertday', 'block_itutor_profiler'), array('optional' => false));
     $mform->addElement('select', 'config_alerttype', get_string('alerttype', 'block_itutor_profiler'), $alerttypes);
     $mform->addElement('select', 'config_alertdata', get_string('alertdata', 'block_itutor_profiler'), $tabletypes);
     $mform->addElement('textarea', 'config_alertmessage', get_string('alertmessage', 'block_itutor_profiler'), 'wrap="virtual" rows="20" cols="50"');
     $mform->addElement('checkbox', 'config_sendtostaff', get_string('alerttostaff', 'block_itutor_profiler'));
     $mform->setDefault('config_sendtostaff', true);
     $mform->setType('config_sendtostaff', PARAM_BOOL);
 }
 public function api()
 {
     $this->loadLanguage('default_authorizenet_aim/default_authorizenet_aim');
     $data['text_credit_card'] = $this->language->get('text_credit_card');
     $data['entry_cc_owner'] = $this->language->get('entry_cc_owner');
     $data['cc_owner'] = array('type' => 'input', 'name' => 'cc_owner', 'required' => true, 'value' => '');
     $data['entry_cc_number'] = $this->language->get('entry_cc_number');
     $data['cc_number'] = array('type' => 'input', 'name' => 'cc_number', 'required' => true, 'value' => '');
     $data['entry_cc_expire_date'] = $this->language->get('entry_cc_expire_date');
     $data['entry_cc_cvv2'] = $this->language->get('entry_cc_cvv2');
     $data['entry_cc_cvv2_short'] = $this->language->get('entry_cc_cvv2_short');
     $data['cc_cvv2_help_url'] = $this->html->getURL('r/extension/default_authorizenet_aim/cvv2_help');
     $data['cc_cvv2'] = array('type' => 'input', 'name' => 'cc_cvv2', 'value' => '', 'style' => 'short input-small', 'required' => true, 'attr' => ' size="3"');
     $data['button_confirm'] = $this->language->get('button_confirm');
     $data['button_back'] = $this->language->get('button_back');
     $months = array();
     for ($i = 1; $i <= 12; $i++) {
         $months[sprintf('%02d', $i)] = strftime('%B', mktime(0, 0, 0, $i, 1, 2000));
     }
     $data['cc_expire_date_month'] = array('type' => 'selectbox', 'name' => 'cc_expire_date_month', 'value' => sprintf('%02d', date('m')), 'options' => $months, 'required' => true, 'style' => 'short input-small');
     $today = getdate();
     $years = array();
     for ($i = $today['year']; $i < $today['year'] + 11; $i++) {
         $years[strftime('%Y', mktime(0, 0, 0, 1, 1, $i))] = strftime('%Y', mktime(0, 0, 0, 1, 1, $i));
     }
     $data['cc_expire_date_year'] = array('type' => 'selectbox', 'name' => 'cc_expire_date_year', 'value' => sprintf('%02d', date('Y') + 1), 'options' => $years, 'required' => true, 'style' => 'short input-small');
     $data['process_rt'] = 'default_authorizenet_aim/send';
     $this->load->library('json');
     $this->response->setOutput(AJson::encode($data));
 }
Esempio n. 8
0
 function contact()
 {
     $this->load->model('log_model');
     $user_id = '';
     //header
     $header = new header();
     $header->index("Liên hệ", '', '');
     //proccessing
     $is_logged_in = $this->session->userdata('is_logged_in');
     if (!isset($is_logged_in) || $is_logged_in != true) {
         $user_id = '0';
         $data['name'] = '';
         $data['email'] = '';
     } else {
         $user_id = $this->log_model->getId();
         $user_data = $this->db->select('NAME,EMAIL')->from('qtht_users')->where('ID_U', $user_id)->get()->result_array();
         foreach ($user_data as $key) {
         }
         $data['name'] = $key['NAME'];
         $data['email'] = $key['EMAIL'];
     }
     //end proccessing
     if (isset($_REQUEST['csrf_test_name'])) {
         $date = getdate();
         $date_send = $date['year'] . '-' . $date['mon'] . '-' . $date['mday'] . ' ' . $date['hours'] . ':' . $date['minutes'] . ':' . $date['seconds'];
         $data = array('DATE_SEND' => $date_send, 'ID_U' => $user_id, 'EMAIL' => $_REQUEST['email'], 'NAME' => $_REQUEST['name'], 'CONTENT' => $_REQUEST['content']);
         $this->db->insert('qtht_contact', $data);
     }
     //view
     $data['csrf_test_name'] = $this->security->get_csrf_hash();
     $this->load->view('home/contact', $data);
 }
Esempio n. 9
0
function log_msg($message)
{
    global $logfp;
    $now_array = getdate();
    $now_string = sprintf("%04d-%02d-%02d %02d:%02d:%02d", $now_array['year'], $now_array['mon'], $now_array['mday'], $now_array['hours'], $now_array['minutes'], $now_array['seconds']);
    fwrite($logfp, "[{$now_string}] {$message}\n");
}
Esempio n. 10
0
 private function _init_search_engine($data)
 {
     $CI =& get_instance();
     $min_duration = $CI->config->item('parking_min_duration');
     $max_duration = $CI->config->item('parking_max_duration');
     $assets_version = $CI->config->item('parking_assets_version');
     $data_search = array();
     $day = empty($data['day']) ? -1 : $data['day'];
     $hour = empty($data['hour']) ? -1 : $data['hour'];
     $duration = empty($data['duration']) ? -1 : $data['duration'];
     $now = getdate();
     $year_day = $now['yday'];
     if (!is_numeric($day) || $day < 1 || $day > 7) {
         $day = $now['wday'] == 0 ? 7 : $now['wday'];
         // We start on monday (ISO), php getdate() returns 0 (for Sunday) through 6 (for Saturday)
     }
     if (!is_numeric($hour) || $hour < 1 || $hour > 24) {
         $hour = $now['hours'] + ($now['minutes'] < 30 ? 0 : 0.5);
     }
     if (!is_numeric($duration) || $duration < $min_duration || $duration > $max_duration) {
         $duration = 2;
     }
     $data_search['day'] = $day;
     $data_search['hour'] = $hour;
     $data_search['duration'] = $duration;
     $data_search['assets_version'] = $assets_version;
     return $data_search;
 }
Esempio n. 11
0
function datetimetransform($input)
{
    $todayh = getdate($input);
    if ($todayh["seconds"] < 10) {
        $todayh["seconds"] = "0" . $todayh["seconds"] . "";
    }
    if ($todayh["minutes"] < 10) {
        $todayh["minutes"] = "0" . $todayh["minutes"] . "";
    }
    if ($todayh["hours"] < 10) {
        $todayh["hours"] = "0" . $todayh["hours"] . "";
    }
    if ($todayh["mday"] < 10) {
        $todayh["mday"] = "0" . $todayh["mday"] . "";
    }
    if ($todayh["mon"] < 10) {
        $todayh["mon"] = "0" . $todayh["mon"] . "";
    }
    $sec = $todayh[seconds];
    $min = $todayh[minutes];
    $hours = $todayh[hours];
    $d = $todayh[mday];
    $m = $todayh[mon];
    $y = $todayh[year];
    $input = "{$d}-{$m}-{$y} {$hours}:{$min}:{$sec}";
    return $input;
}
 public function esMayorDeEdad($datFecha, $strCampo)
 {
     $ahora = getdate();
     $datCurrentYear = $ahora['year'];
     $datHace18anos = $datCurrentYear - 18;
     $datMes = $ahora['mon'];
     $datDia = $ahora['mday'];
     if ($this->esFechaCorta($datFecha, $strCampo)) {
         $datFecha = str_replace('-', '/', $datFecha);
         $arrFecha = explode('/', $datFecha);
         if ($arrFecha[2] < $datHace18anos) {
             return $this->esValido;
         } elseif ($arrFecha[2] = $datHace18anos && $arrFecha[1] < $datMes) {
             return $this->esValido;
         } elseif ($arrFecha[2] = $datHace18anos && ($arrFecha[1] = $datMes && $arrFecha[0] <= $datDia)) {
             return $this->esValido;
         } else {
             $this->esValido = false;
             $this->error .= '- Lo siento, Debe ser mayor de edad.\\n';
         }
     } else {
         $this->esValido = false;
         $this->error .= '- Lo siento, Debe ser mayor de edad.\\n';
     }
 }
Esempio n. 13
0
 public function __construct()
 {
     $this->aDatos = new aDatos();
     $this->idVenta = 0;
     $this->total = 0;
     $this->fechaRegistro = getdate();
 }
Esempio n. 14
0
 function index()
 {
     $now = getdate();
     $year = (int) $now['year'];
     $month = (int) $now['mon'];
     $this->show($year, $month);
 }
Esempio n. 15
0
 /**
  * Get the selected time
  *
  * @return mixed An array containing 'h'=>xx, 'm'=>xx, or null if not set
  */
 public function get_setting()
 {
     $result = $this->config_read($this->name);
     $datearr = getdate($result);
     $data = array('h' => $datearr['hours'], 'm' => $datearr['minutes'], 'y' => $datearr['year'], 'M' => $datearr['mon'], 'd' => $datearr['mday']);
     return $data;
 }
 public function toSlot($epoch, $slotsize)
 {
     $dsttime = $this->getDST($epoch) + $epoch;
     $parsed = getdate($dsttime);
     $slot = ($parsed['year'] - 2000) * 12 + $parsed['mon'] - 1;
     return $slot;
 }
Esempio n. 17
0
 function index()
 {
     global $viewhelper;
     require CACHE_COMMON_PATH . "cache_type.php";
     $title = L("industry_info", "tpl");
     //cal
     require CLASS_PATH . "calendar.class.php";
     $cal = new Calendar();
     $cal->setMonthNames(explode(",", L("month_unit", "tpl")));
     $cal->setDayNames(explode(",", L("week_unit", "tpl")));
     $d = getdate(time());
     $day = $_GET['day'];
     if ($day == "") {
         $day = $d['mday'];
     }
     $month = $_GET['month'];
     if ($month == "") {
         $month = $d["mon"];
     }
     $year = $_GET['year'];
     if ($year == "") {
         $year = $d["year"];
     }
     if (isset($_GET['year']) && isset($_GET['month']) && isset($_GET['day'])) {
         $title .= L("journal", "tpl", $year . $month . $day);
         setvar("date_line", $year . "-" . $month . "-" . $day);
     }
     $viewhelper->setTitle($title);
     setvar("Calendar", $cal->getMonthView($month, $year));
     $cache_id = $year . $month . $day;
     //end cal
     render("news/index");
 }
Esempio n. 18
0
 /**
  * set dates for a week
  *
  * @param string $p_when date string to expand to a week (Sun to Sat)
  * @param int $p_weeks number of weeks
  */
 function a_week($p_when, $p_weeks = 1)
 {
     list($t_year, $t_month, $t_day) = explode("-", $p_when);
     $t_now = getdate(mktime(0, 0, 0, $t_month, $t_day, $t_year));
     $this->end = strftime("%Y-%m-%d 23:59:59", mktime(0, 0, 0, $t_month, $t_day - $t_now['wday'] + $p_weeks * 7 - 1, $t_year));
     $this->start = strftime("%Y-%m-%d 00:00:00", mktime(0, 0, 0, $t_month, $t_day - $t_now['wday'], $t_year));
 }
Esempio n. 19
0
function mkNextActString($nextTimeStamp, $nextAct, $top)
{
    global $daysOfWeek;
    if ($nextAct) {
        $color = "#00BB00";
        //        $label = " on: ";
    } else {
        $color = "#EE0000";
        $label = "off: ";
        //
    }
    $label = "";
    $nextDate = getdate($nextTimeStamp);
    $hour = $nextDate['hours'];
    $min = $nextDate['minutes'];
    $sec = $nextDate['seconds'];
    $nextTimeS = sprintf("%02d:%02d:%02d", $hour, $min, $sec);
    $nextS = $label . $nextTimeS;
    if ($nextTimeStamp - time() > 24 * 3600) {
        $myWeekDay = $nextDate['wday'] - 1;
        if ($myWeekDay < 0) {
            $myWeekDay += 7;
        }
        $weekDayName = $daysOfWeek[$myWeekDay];
        $nextS = $nextS . ", " . substr($weekDayName, 0, 3);
    }
    $actString = '<div class="next" style="top:' . $top . 'vh; color:' . $color . ';"><span>' . $nextS . '</span>   </div>';
    return $actString;
}
Esempio n. 20
0
 public function getContent()
 {
     if (Tools::isSubmit('submit')) {
         if (!sizeof($this->_postErrors)) {
             $t = getdate();
             $date = $t["year"] . "-" . $t["mon"] . "-" . $t["mday"] . "(" . $t["hours"] . ":" . $t["minutes"] . ":" . $t["seconds"] . ")";
             Configuration::updateValue('gw_alipay_mer_id', Tools::getValue('shop_code'), true);
             Configuration::updateValue('gw_alipay_encryption', Tools::getValue('encryption_code'), true);
             $this->_html .= '<div class="conf confirm">' . $this->l('Success Updata') . "   " . $date . '</div>';
         } else {
             foreach ($this->_postErrors as $err) {
                 $this->_html .= '<div class"alert error">' . $err . "</div>";
             }
         }
     }
     //如果Configuration資料庫已經有greenworld_vacc_encryption_code 與 greenworld_vacc_shop_code
     //的值,則直接抓取出來資料並顯示。
     if (!Configuration::get($this->name . '_encry_code') == null) {
         $this->_encryption_code = Configuration::get($this->name . '_encry_code');
     } else {
         $this->_encryption_code = 'Enter Encryption Code';
     }
     if (!Configuration::get($this->name . '_shop_code') == null) {
         $this->_shop_code = Configuration::get($this->name . '_shop_code');
     } else {
         $this->_shop_code = 'Enter Shop Code';
     }
     $this->_displayForm();
     return $this->_html;
 }
Esempio n. 21
0
 function registraException($e)
 {
     $string = "ERRO: " . $e->getMessage() . ";CODIGO: " . $e->getCode() . ";ARQUIVO: " . $e->getFile() . ";LINHA: " . $e->getLine() . ";DATA: " . getdate() . " " . localtime() . "|";
     $pointer = fopen(BASEPATH . '/application/txt/exceptions.txt', 'w');
     fwrite($pointer, $string);
     fclose($pointer);
 }
Esempio n. 22
0
 private function _getTimestamp($input)
 {
     $timestamp = 0;
     if (empty($input)) {
         //输出当前时间
         $timestamp = time();
     } elseif (strval(intval($input)) === strval($input)) {
         //如果输入时间戳
         $timestamp = $input;
     } elseif (strpos($input, ',') !== false) {
         //如果以半角逗号分隔
         $time_arr = explode(',', $input);
         $count = count($time_arr);
         if ($count == 3) {
             $now_time_arr = getdate();
             $timestamp = mktime($time_arr[0], $time_arr[1], $time_arr[2], $now_time_arr['mon'], $now_time_arr['mday'], $now_time_arr['year']);
         } elseif ($count == 6) {
             $timestamp = mktime($time_arr[3], $time_arr[4], $time_arr[5], $time_arr[1], $time_arr[2], $time_arr[0]);
         }
     } else {
         $timestamp = strtotime($input);
         $timestamp === false && ($timestamp = 0);
     }
     return $timestamp;
 }
Esempio n. 23
0
 protected function index()
 {
     $this->language->load('payment/sagepay_us');
     $this->data['text_credit_card'] = $this->language->get('text_credit_card');
     $this->data['text_wait'] = $this->language->get('text_wait');
     $this->data['entry_cc_owner'] = $this->language->get('entry_cc_owner');
     $this->data['entry_cc_number'] = $this->language->get('entry_cc_number');
     $this->data['entry_cc_expire_date'] = $this->language->get('entry_cc_expire_date');
     $this->data['entry_cc_cvv2'] = $this->language->get('entry_cc_cvv2');
     $this->data['button_confirm'] = $this->language->get('button_confirm');
     $this->data['months'] = array();
     for ($i = 1; $i <= 12; $i++) {
         $this->data['months'][] = array('text' => strftime('%B', mktime(0, 0, 0, $i, 1, 2000)), 'value' => sprintf('%02d', $i));
     }
     $today = getdate();
     $this->data['year_expire'] = array();
     for ($i = $today['year']; $i < $today['year'] + 11; $i++) {
         $this->data['year_expire'][] = array('text' => strftime('%Y', mktime(0, 0, 0, 1, 1, $i)), 'value' => strftime('%Y', mktime(0, 0, 0, 1, 1, $i)));
     }
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/sagepay_us.tpl')) {
         $this->template = $this->config->get('config_template') . '/template/payment/sagepay_us.tpl';
     } else {
         $this->template = 'default/template/payment/sagepay_us.tpl';
     }
     $this->render();
 }
Esempio n. 24
0
function pleac_Finding_Today_s_Date()
{
    define(SEP, '-');
    // ------------
    $today = getdate();
    $day = $today['mday'];
    $month = $today['mon'];
    $year = $today['year'];
    // Either do this to use interpolation:
    $sep = SEP;
    echo "Current date is: {$year}{$sep}{$month}{$sep}{$day}\n";
    // or simply concatenate:
    echo 'Current date is: ' . $year . SEP . $month . SEP . $day . "\n";
    // ------------
    $today = localtime(time(), TRUE);
    $day = $today['tm_mday'];
    $month = $today['tm_mon'] + 1;
    $year = $today['tm_year'] + 1900;
    printf("Current date is: %4d%s%2d%s%2d\n", $year, SEP, $month, SEP, $day);
    // ------------
    $format = 'Y' . SEP . 'n' . SEP . 'd';
    $today = date($format);
    echo "Current date is: {$today}\n";
    // ------------
    $sep = SEP;
    $today = strftime("%Y{$sep}%m{$sep}%d");
    echo "Current date is: {$today}\n";
}
Esempio n. 25
0
 public function index()
 {
     $this->load->language('extension/payment/globalpay_remote');
     $data['text_credit_card'] = $this->language->get('text_credit_card');
     $data['text_loading'] = $this->language->get('text_loading');
     $data['text_wait'] = $this->language->get('text_wait');
     $data['entry_cc_type'] = $this->language->get('entry_cc_type');
     $data['entry_cc_number'] = $this->language->get('entry_cc_number');
     $data['entry_cc_name'] = $this->language->get('entry_cc_name');
     $data['entry_cc_expire_date'] = $this->language->get('entry_cc_expire_date');
     $data['entry_cc_cvv2'] = $this->language->get('entry_cc_cvv2');
     $data['entry_cc_issue'] = $this->language->get('entry_cc_issue');
     $data['help_start_date'] = $this->language->get('help_start_date');
     $data['help_issue'] = $this->language->get('help_issue');
     $data['button_confirm'] = $this->language->get('button_confirm');
     $accounts = $this->config->get('globalpay_remote_account');
     $card_types = array('visa' => $this->language->get('text_card_visa'), 'mc' => $this->language->get('text_card_mc'), 'amex' => $this->language->get('text_card_amex'), 'switch' => $this->language->get('text_card_switch'), 'laser' => $this->language->get('text_card_laser'), 'diners' => $this->language->get('text_card_diners'));
     $data['cards'] = array();
     foreach ($accounts as $card => $account) {
         if (isset($account['enabled']) && $account['enabled'] == 1) {
             $data['cards'][] = array('code' => $card, 'text' => $card_types[$card]);
         }
     }
     $data['months'] = array();
     for ($i = 1; $i <= 12; $i++) {
         $data['months'][] = array('text' => strftime('%B', mktime(0, 0, 0, $i, 1, 2000)), 'value' => sprintf('%02d', $i));
     }
     $today = getdate();
     $data['year_expire'] = array();
     for ($i = $today['year']; $i < $today['year'] + 11; $i++) {
         $data['year_expire'][] = array('text' => strftime('%Y', mktime(0, 0, 0, 1, 1, $i)), 'value' => strftime('%y', mktime(0, 0, 0, 1, 1, $i)));
     }
     return $this->load->view('extension/payment/globalpay_remote', $data);
 }
function get_current_day_in_german()
{
    $datum = getdate();
    if ($datum["weekday"] == "Monday") {
        $datum["weekday"] = "Montag";
    }
    if ($datum["weekday"] == "Tuesday") {
        $datum["weekday"] = "Dienstag";
    }
    if ($datum["weekday"] == "Wednesday") {
        $datum["weekday"] = "Mittwoch";
    }
    if ($datum["weekday"] == "Thursday") {
        $datum["weekday"] = "Donnerstag";
    }
    if ($datum["weekday"] == "Friday") {
        $datum["weekday"] = "Freitag";
    }
    if ($datum["weekday"] == "Saturday") {
        $datum["weekday"] = "Samstag";
    }
    if ($datum["weekday"] == "Sunday") {
        $datum["weekday"] = "Sonntag";
    }
    return $datum["weekday"];
}
Esempio n. 27
0
function getdateTime()
{
    $dateToday = getdate(date("U"));
    $datenow = "{$dateToday['month']} {$dateToday['mday']}, {$dateToday['year']}";
    $date = $datenow;
    echo "{$date}";
}
Esempio n. 28
0
 /**
  * __construct
  *
  * @param string  $caption  caption
  * @param string  $name     name
  * @param integer $size     size
  * @param integer $value    value unix timestamp
  * @param boolean $showtime true to show time, false for date only
  */
 public function __construct($caption, $name, $size = 2, $value = 0, $showtime = true)
 {
     parent::__construct($caption, '');
     $value = (int) $value;
     $value = $value > 0 ? $value : time();
     $datetime = getdate($value);
     $date = new DateSelect('', $name . '[date]', $size, $value);
     $date->setAttribute('id', $name . '-date');
     $this->addElement($date);
     if ($showtime) {
         $timearray = array();
         for ($i = 0; $i < 24; ++$i) {
             for ($j = 0; $j < 60; $j = $j + 10) {
                 $key = $i * 3600 + $j * 60;
                 $timearray[$key] = $j != 0 ? $i . ':' . $j : $i . ':0' . $j;
             }
         }
         ksort($timearray);
         $timeselect = new Select('', $name . '[time]', $datetime['hours'] * 3600 + 600 * ceil($datetime['minutes'] / 10));
         $timeselect->setAttribute('id', $name . '-time');
         $timeselect->addOptionArray($timearray);
         $timeselect->setClass('span2');
         $this->addElement($timeselect);
     } else {
         $this->addElement(new Hidden($name . '[time]', 0));
     }
 }
Esempio n. 29
0
 public function index()
 {
     $this->load->language('payment/authorizenet_aim');
     $data['text_credit_card'] = $this->language->get('text_credit_card');
     $data['text_wait'] = $this->language->get('text_wait');
     $data['entry_cc_owner'] = $this->language->get('entry_cc_owner');
     $data['entry_cc_number'] = $this->language->get('entry_cc_number');
     $data['entry_cc_expire_date'] = $this->language->get('entry_cc_expire_date');
     $data['entry_cc_cvv2'] = $this->language->get('entry_cc_cvv2');
     $data['button_confirm'] = $this->language->get('button_confirm');
     $data['months'] = array();
     for ($i = 1; $i <= 12; $i++) {
         $data['months'][] = array('text' => strftime('%B', mktime(0, 0, 0, $i, 1, 2000)), 'value' => sprintf('%02d', $i));
     }
     $today = getdate();
     $data['year_expire'] = array();
     for ($i = $today['year']; $i < $today['year'] + 11; $i++) {
         $data['year_expire'][] = array('text' => strftime('%Y', mktime(0, 0, 0, 1, 1, $i)), 'value' => strftime('%Y', mktime(0, 0, 0, 1, 1, $i)));
     }
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/authorizenet_aim.tpl')) {
         return $this->load->view($this->config->get('config_template') . '/template/payment/authorizenet_aim.tpl', $data);
     } else {
         return $this->load->view('default/template/payment/authorizenet_aim.tpl', $data);
     }
 }
Esempio n. 30
0
function output_row($row)
{
    global $ajax, $json_data;
    $values = array();
    // booking name
    $html_name = htmlspecialchars($row['name']);
    $values[] = "<a title=\"{$html_name}\" href=\"view_entry.php?id=" . $row['entry_id'] . "\">{$html_name}</a>";
    // created by
    $values[] = htmlspecialchars($row['create_by']);
    // start time and link to day view
    $date = getdate($row['start_time']);
    $link = "<a href=\"day.php?day={$date['mday']}&amp;month={$date['mon']}&amp;year={$date['year']}&amp;area=" . $row['area_id'] . "\">";
    if (empty($row['enable_periods'])) {
        $link_str = time_date_string($row['start_time']);
    } else {
        list(, $link_str) = period_date_string($row['start_time']);
    }
    $link .= "{$link_str}</a>";
    //    add a span with the numeric start time in the title for sorting
    $values[] = "<span title=\"" . $row['start_time'] . "\"></span>" . $link;
    // description
    $values[] = htmlspecialchars($row['description']);
    if ($ajax) {
        $json_data['aaData'][] = $values;
    } else {
        echo "<tr>\n<td>\n";
        echo implode("</td>\n<td>", $values);
        echo "</td>\n</tr>\n";
    }
}