Ejemplo n.º 1
0
 /**
  * การใช้ Class my_page
  * 
  * 
  */
 function __construct($title = '')
 {
     global $my_cfg;
     $my_sec = new OrSec(false);
     //$caption = 'ทดสอบ Caption';
     $caption = $my_sec->OP_[title]->get();
     debug_mode(__FILE__, __LINE__, $my_sec->OP_[title]->get(), 'Title');
     if ($title == '') {
         $title .= $my_cfg[title] . ' : ' . $caption;
     }
     parent::__construct($title);
     //$this->set_ccs_src($my_cfg[skins_path] . 'my_page.css');
     $this->set_skin($my_cfg[skins_path] . 'default.html');
     //รูปแบบหน้าจอปกติ
     //$my_menu = new OrJsMenu('my_menu_utf8.inc.js' , $my_cfg[skins_path] . "xp.css");
     //$this->set_ccs_src($my_menu->OP_[js_ccs]->get());
     //$this->set_script_src($my_menu->OP_[js_src]->get());
     //$my_calendar = new OrJsCalendar();
     //$this->set_ccs_src($my_calendar->OP_[js_ccs]->get());
     //$this->set_script_src($my_calendar->OP_[js_src]->get());
     //$this->OP_[script_event_body]->set($my_menu->get_script_event('OnLoad'));
     /**
      * คำสั่งใช้ Ajax Copy ที่ต้องการใช้งาน
      * $ajax = new OrAjax();
      * $this->set_script_src($ajax->OP_[ajax_src]->get());
      * $this->set_script($ajax->require_tooltip());
      * $this->set_ccs_src($ajax->require_tooltip_css());
      */
     $this->set_title($my_cfg[title]);
     $this->set_caption($caption);
     $link_logout = '<a href="welcome.php?val_controls[logout]=logout" >ออกจากระบบ</a>';
     $this->set_login($my_sec->get_user_text() . '</b> [ <u>' . $my_sec->OP_[user]->get() . '</u> ]' . $link_logout);
 }
Ejemplo n.º 2
0
 function auto_post()
 {
     $val_ = new OrSysvalue();
     $id = $this->OP_[id]->get();
     $name = $this->OP_[name]->get();
     if (!is_null($val_->controls[$id])) {
         $val = $val_->controls[$id];
     } else {
         if (!is_null($val_->controls['db_field'][$id])) {
             $val = $val_->controls['db_field'][$id];
         } else {
             if (!is_null($val_->filter[$id]) and substr($name, 0, 10) == 'val_filter') {
                 $val = $val_->filter[$id];
             } else {
                 if (substr($name, 0, 11) == 'val_compare') {
                     /*ต้องแปลงค่า val_compare[$id] โดยดึงเอา $id มาใข้*/
                     $id = substr($name, 12);
                     $id = substr($id, 0, strlen($id) - 1);
                     //echo '<b>compare_id</b> = ' . $id . '<br>';
                     $val = $val_->compare[$id];
                 } else {
                     $val = $val_->message[$id];
                 }
             }
         }
     }
     debug_mode(__FILE__, __LINE__, $val, $id . ' : Value');
     $this->OP_[post_value]->set($val);
     return null;
 }
Ejemplo n.º 3
0
function debug_dump_json($opts, $pipe = null, $cmd = __FUNCTION__)
{
    if (debug_mode()) {
        return dump_json($opts, $pipe);
    }
    return get_opts_or_pipe($opts, $pipe);
}
Ejemplo n.º 4
0
function debug_message($cmd, $msg, $type)
{
    if (!debug_mode()) {
        return;
    }
    return message($cmd, $msg, $type, true);
}
Ejemplo n.º 5
0
function debug_dump_yaml($opts, $pipe = null, $offset = 0)
{
    if (debug_mode()) {
        return dump_yaml($opts, $pipe, $offset);
    }
    return get_opts_or_pipe($opts, $pipe);
}
Ejemplo n.º 6
0
 function get_query($sql)
 {
     $this->OP_[sql]->set($sql);
     debug_mode(__FILE__, __LINE__, $sql, 'function get_query');
     $result = @mysql_query($this->OP_[sql]->get(), $this->get_host_conn());
     if (!$result) {
         $this->set_error('sql=' . $sql . ' [' . mysql_error() . ']<br>');
     }
     return $this->result = $result;
 }
Ejemplo n.º 7
0
 function count($log_path, $download_path, $file_name)
 {
     unset($log_template_content);
     $query_file_name = trim($file_name);
     $current_time = mktime();
     if (is_file($log_path)) {
         $count_file_content = file($log_path);
         $log_template_content = array();
         while (list($key, $line) = each($count_file_content)) {
             $line = trim($line);
             if (!empty($line)) {
                 $data = explode(' - ', $line);
                 $stored_file_name = trim($data[0]);
                 if (trim($data[0]) == trim($file_name)) {
                     $download_number = trim($data[1]);
                     $first_download = trim($data[4]);
                     $last_download = mktime();
                     $log_template_content_temp = $this->count_content($stored_file_name, $download_number, $first_download, $last_download);
                     $log_template_content[] = $log_template_content_temp;
                     debug_mode($log_template_content_temp, 'Replace Entry');
                     unset($log_template_content_temp);
                     $check = 'true';
                 } else {
                     $log_template_content[] = $line;
                 }
             }
         }
         if (!isset($check) or $check != 'true') {
             $log_template_content_temp = $this->count_content($query_file_name, 0, $current_time, $current_time);
             $log_template_content[] = $log_template_content_temp;
             debug_mode($log_template_content_temp, 'New Entry');
             unset($log_template_content_temp);
         }
         $new_file_content = join("\n", $log_template_content);
         if ($logfile = @fopen($log_path, 'w+')) {
             @flock($logfile, 2);
             @fputs($logfile, $new_file_content);
             @fclose($logfile);
         }
     } else {
         $log_template_content = $this->count_content($query_file_name, 0, mktime(), mktime());
         debug_mode($log_template_content, 'First Entry');
         if ($logfile = fopen($log_path, 'a')) {
             @flock($logfile, 2);
             @fputs($logfile, $log_template_content . "\n");
             @fclose($logfile);
         }
     }
 }
Ejemplo n.º 8
0
 function get_tag($value = null)
 {
     if ($value != null) {
         $this->OP_[value]->set($value);
     }
     if ($this->OP_[auto_post]->get()) {
         debug_mode(__FILE__, __LINE__, $this->OP_[auto_post]->get(), $this->OP_[id]->get() . ' : auto_post');
         $this->auto_post();
     }
     $id = $this->get_id_tag();
     $value = $this->OP_[value]->get();
     $has_in_list = false;
     if ($value == null and !is_numeric($value)) {
         $value = $this->OP_[post_value]->get();
         debug_mode(__FILE__, __LINE__, $value, $this->OP_[id]->get() . ' : Value');
     }
     if ($value == null) {
         $value = $this->OP_[default_value]->get();
     }
     if ($this->OP_[class_name]->get() == null) {
         $class = null;
     } else {
         $class = 'class="' . $this->OP_[class_name]->get() . '"';
     }
     if ($this->OP_[check_null]->get()) {
         $dojo_required = ' required="true" ';
     } else {
         $dojo_required = ' required="false" ';
     }
     $dojo_invalid_message = ' invalidMessage="' . $this->OP_[invalid_message]->get() . '" ';
     $title = 'title="' . $this->OP_[title]->get() . '"';
     $dojo_property = 'dojoType="dijit.form.FilteringSelect"  ' . $dojo_required . $dojo_invalid_message;
     $tag = "<select {$dojo_property} {$id} {$class} {$title}>\n";
     foreach ($this->OP_[option]->get() as $key => $val) {
         $selected = "";
         if ($value == $val) {
             $selected = 'selected="selected"';
             $has_in_list = true;
         }
         $tag .= '		<option value="' . $val . '" ' . $selected . '>' . $key . '</option>' . "\n";
     }
     if (!$has_in_list) {
         $selected = 'selected="selected"';
         $val_error = "#{$value}#";
         $tag .= '		<option value="' . $value . '" ' . $selected . '>' . $val_error . '</option>' . "\n";
     }
     return $tag .= "</select>\n" . $this->get_properties_tag();
 }
Ejemplo n.º 9
0
 function get_control_text($text)
 {
     debug_mode(__FILE__, __LINE__, $text, 'ค่า Text');
     $EV_[EV_text] = $text;
     $this->OE_before_text($EV_);
     if (!$this->OP_[text]->check_update()) {
         if (!is_null($this->get_format())) {
             $text = $this->get_format();
         } else {
             $text = nl2br($text);
         }
         $this->OP_[text]->set($text);
     }
     debug_mode(__FILE__, __LINE__, $text, 'ค่า Text');
     return $this->OP_[text]->get();
 }
Ejemplo n.º 10
0
 function get_tag($value = null)
 {
     if ($value != null) {
         $this->OP_[value]->set($value);
     }
     if ($this->OP_[auto_post]->get()) {
         debug_mode(__FILE__, __LINE__, $this->OP_[auto_post]->get(), $this->OP_[id]->get() . ' : auto_post');
         $this->auto_post();
     }
     $id = $this->get_id_tag();
     $value = $this->OP_[value]->get();
     $has_in_list = false;
     if ($value == null and !is_numeric($value)) {
         $value = $this->OP_[post_value]->get();
         debug_mode(__FILE__, __LINE__, $value, $this->OP_[id]->get() . ' : Value');
     }
     if ($value == null) {
         $value = $this->OP_[default_value]->get();
     }
     if ($this->OP_[class_name]->get() == null) {
         $class = null;
     } else {
         $class = 'class="' . $this->OP_[class_name]->get() . '"';
     }
     $title = 'title="' . $this->OP_[title]->get() . '"';
     if ($this->use_ajax) {
         $tag = "<select dojoType=\"combobox\" {$id} {$class} {$title}>\n";
     } else {
         $tag = "<select {$id} {$class} {$title}>\n";
     }
     foreach ($this->OP_[option]->get() as $key => $val) {
         $selected = "";
         if ($value == $val) {
             $selected = 'selected="selected"';
             $has_in_list = true;
         }
         $tag .= '		<option value="' . $val . '" ' . $selected . '>' . $key . '</option>' . "\n";
     }
     if (!$has_in_list) {
         $selected = 'selected="selected"';
         $val_error = "#{$value}#";
         $tag .= '		<option value="' . $value . '" ' . $selected . '>' . $val_error . '</option>' . "\n";
     }
     return $tag .= "</select>\n" . $this->get_properties_tag();
 }
Ejemplo n.º 11
0
 function OrSysvalue()
 {
     global $val_controls, $val_msg, $val_filter, $val_compare, $evt_form_db, $evt_list_navigator;
     if (is_array($val_controls)) {
         $this->controls = $val_controls;
     }
     if (is_array($val_msg)) {
         $this->message = $val_msg;
     }
     if (is_array($val_filter)) {
         $this->filter = $val_filter;
         debug_mode(__FILE__, __LINE__, $val_filter, 'val_filter');
     }
     if (is_array($val_compare)) {
         $this->compare = $val_compare;
     }
     if (is_array($evt_form_db)) {
         $this->db_event = $evt_form_db;
     }
 }
Ejemplo n.º 12
0
 public function __construct()
 {
     parent::__construct();
     $this->load->model('order_model');
     $this->load->model('ebay_order_model');
     $this->load->model('product_model');
     $this->load->model('product_makeup_sku_model');
     $this->load->model('order_shipping_record_model');
     $this->load->model('shipping_code_model');
     $this->load->model('shipping_subarea_model');
     $this->load->library('excel');
     $this->load->helper('shipping_helper');
     $this->load->helper('db_helper');
     date_default_timezone_set(DEFAULT_TIMEZONE);
     // check user session
     $current_uri = fetch_request_uri();
     if (!$this->input->is_post()) {
         if (debug_mode()) {
             $this->output->enable_profiler(TRUE);
         }
     }
     $this->load->driver('cache', array('backup' => 'file'));
 }
Ejemplo n.º 13
0
function debug_dump_list($opts, $pipe = null, $offset = null, $cmd = __FUNCTION__)
{
    if (debug_mode()) {
        return dump_list($opts, $pipe, $offset, $cmd);
    }
    return get_opts_or_pipe($opts, $pipe);
}
Ejemplo n.º 14
0
 protected function set_nav()
 {
     $sys_file = $this->get_nav_filename();
     $this->nav = $this->get_nav_info($sys_file);
     $data = array('home' => 'mallerp/home', 'nav' => $this->nav, 'user' => $this->account->get_account());
     // debug model
     if (!$this->input->is_post()) {
         if (debug_mode()) {
             $this->output->enable_profiler(TRUE);
         }
     }
     $this->template->write_view('nav_inner', 'default/inner_nav', $data);
 }
Ejemplo n.º 15
0
 function get_group_list($user)
 {
     global $my_cfg_sec;
     /* ตรวจสอบกลุ่มผู้ใช้งาน  สุชาติ บุญหชัยรัตน์ 23/2/2547 */
     $db_sec = new OrMysql($my_cfg_sec[db]);
     //(กำหนด Object ฐานข้อมูลที่จะใช้)
     $sql = "SELECT * FROM `my_group`WHERE `user`='" . $user . "';";
     $db_sec->get_query($sql);
     if ($db_sec->total_error > 0) {
         $db_sec->show_error();
     }
     $my_list = array();
     while ($db_sec->get_record()) {
         $my_list[] = $db_sec->record[group];
         debug_mode(__FILE__, __LINE__, $db_sec->record[group], 'กลุ่ม');
     }
     return $my_list;
 }
Ejemplo n.º 16
0
 /**
  * Write csv file
  */
 function write_csv_file($post_data)
 {
     global $log_messages, $txt, $filepath;
     if ($log_messages == 'yes') {
         unset($post_data['fs']);
         unset($post_data['fn']);
         $config = array('mailvars' => $post_data, 'type' => G10E_ATTACH_TYPE_CSV, 'control' => $this->control_fields, 'csv_head' => false);
         if ($res = attach_mail_variables::get_content($config)) {
             if ($logfile = @fopen($filepath['logfile'] . 'formdata.csv', 'a')) {
                 @flock($logfile, 2) or debug_mode($txt['txt_cannot_lock_file'] . $filepath['logfile'] . 'formdata.csv');
                 $line = date('Y-m-d');
                 $line .= G10E_ATTACH_TYPE_CSV_DELIMITER . date('H:i:s');
                 $line .= G10E_ATTACH_TYPE_CSV_DELIMITER . $res;
                 $line = str_replace("\n", ' ', str_replace("\r", ' ', $line));
                 @fputs($logfile, $line . "\n");
                 @fclose($logfile);
             } else {
                 debug_mode($filepath['logfile'] . 'formdata.csv', $txt['txt_cannot_open_file']);
             }
         }
     }
 }
Ejemplo n.º 17
0
 function set_total_page($count_sql, $sql)
 {
     /*ปรับปรุงความเร็วการหาจำนวนรายการ สุชาติ บุญหชัยรัตน์ 16/4/2547*/
     //echo "<b>debug</b> ".__FILE__." | ".__LINE__." | sql =".$sql."<br>";
     $db_page = $this->db;
     if ($count_sql == '') {
         debug_mode(__FILE__, __LINE__, $sql, 'function set_total_page');
         $db_page->get_query($sql);
         if ($db_page->is_error()) {
             die("error set_cmd_sql 99 : <br>" . $db_page->show_error());
         }
         $total_row = $db_page->get_total_row();
     } else {
         debug_mode(__FILE__, __LINE__, $count_sql, 'function set_total_page');
         $db_page->get_query($count_sql);
         if ($db_page->is_error()) {
             //echo("@...........");
             $db_page->reset_error();
             debug_mode(__FILE__, __LINE__, $sql, 'function set_total_page');
             $db_page->get_query($sql);
             if ($db_page->is_error()) {
                 die("error set_cmd_sql 99 : <br>" . $db_page->show_error());
             }
             $total_row = $db_page->get_total_row();
         } else {
             /*ค่ารายการที่ได้จาก Function count ที่เร็วที่สุด*/
             $db_page->get_record();
             $total_row = $db_page->record[total_row];
         }
     }
     $total_page = round($total_row / $this->OP_[row_per_page]->get());
     if ($total_page * $this->OP_[row_per_page]->get() < $total_row) {
         $total_page = $total_page + 1;
     }
     $this->OP_[total_page]->set($total_page);
     $this->OP_[total_row]->set($total_row);
     $EV_[EV_sql] = $sql;
     $this->OE_on_total($EV_);
     return null;
 }
Ejemplo n.º 18
0
/*****************************************************
 ** Register language file and additional text array
 *****************************************************/
if (isset($txt) and is_array($txt)) {
    reset($txt);
    while (list($key, $val) = each($txt)) {
        ${$key} = $val;
        $tpl->register($tplt, $key);
    }
}
if (isset($add_text) and is_array($add_text)) {
    reset($add_text);
    while (list($key, $val) = each($add_text)) {
        ${$key} = $val;
        $tpl->register($tplt, $key);
    }
}
/*****************************************************
 ** Parse template
 *****************************************************/
$tpl->register($tplt, array('bar_image_name', 'document_self', 'intern_vote_name', 'max_bar_width', 'rating', 'rating_image', 'script_self', 'total_votes', 'vote_form_fields', 'vote_text', 'vote_title', 'captcha_content', 'email_address'));
$tpl->parse_if($tplt, 'display_form');
$tpl->parse_if($tplt, 'display_results');
$tpl->parse_if($tplt, 'display_link');
$tpl->parse_if($tplt, 'display_email');
$tpl->parse_if($tplt, 'display_captcha');
$tpl->parse_loop($tplt, 'vote_result');
$tpl->parse_loop($tplt, 'message');
@eval($conf_var);
debug_mode(script_runtime($runtime_start), 'Script Runtime');
Ejemplo n.º 19
0
 function get_form_query()
 {
     $my_table = new OrTable('table_query');
     $my_table->OP_[align_table]->set('center');
     $my_table->OP_[class_name]->set('tbl_query_body');
     $my_table->set_col($this->get_button_filter());
     $my_table->set_col('เงื่อนไข ');
     $my_table->set_col(' ค่าที่ค้นหา ');
     $my_table->set_row();
     foreach ($this->caption_fields as $caption => $id) {
         if (!is_object($this->filter_controls[$id])) {
             $this->set_filter_controls(new OrTextbox($id));
         }
         $my_compare = new OrSelectbox('val_compare_' . $id . '_', 'val_compare[' . $id . ']');
         $my_compare->OP_[option]->set(array('=' => '=', '<>' => '<>', '>=' => '>=', '<=' => '<=', 'BETWEEN' => 'BETWEEN', 'LIKE' => 'LIKE', 'IN' => 'IN'));
         $my_compare->OP_[default_value]->set($this->get_filter_compare($id));
         //สร้าง Function เพื่อค้นหาค่า Default compare
         $my_compare->OP_[auto_post]->set(true);
         //$my_table->set_col($my_control->OP_[caption]->get() , "td_caption");
         debug_mode(__FILE__, __LINE__, $this->filter_controls[$id]->OP_[caption]->get(), 'Filter_controls');
         $my_table->set_col($this->filter_controls[$id]->OP_[caption]->get(), "td_query_caption");
         $my_table->set_col($my_compare->get_tag(), "td_query_compare");
         $my_table->set_col($this->filter_controls[$id]->get_tag(), "td_query_value");
         $my_table->set_row('tr_query_body');
     }
     $my_table->set_col('ค้นคำ เรียงลำดับ');
     $my_table->set_col($this->get_control_filter());
     $my_table->set_col($this->get_control_order());
     $my_table->set_row();
     return $my_table->get_tag();
 }
Ejemplo n.º 20
0
    require_once ABSPATH . '/config.php';
}
/**
 * Load defaults, compatibility and helpful standalone functions
 */
require_once ABSPATH . '/includes/defaults.php';
require_once ABSPATH . '/includes/compat.php';
require_once ABSPATH . '/includes/functions.php';
/**
 * Check requirements or die are not met.
 */
check_requirements();
/**
 * Debug mode initialization
 */
debug_mode();
/**
 * Enqueue autoloader
 */
require_once ABSPATH . '/core/controllers/Autoload.php';
$loader = new Autoload();
$loader->register();
$loader->addNamespace('de\\codeschubser\\honeycomb\\core\\controllers', ABSPATH . '/core/controllers');
$loader->addNamespace('de\\codeschubser\\honeycomb\\core\\exceptions', ABSPATH . '/core/exceptions');
$loader->addNamespace('de\\codeschubser\\honeycomb\\core\\models', ABSPATH . '/core/models');
$loader->addNamespace('de\\codeschubser\\honeycomb\\core\\vendors', ABSPATH . '/core/vendors');
$loader->addNamespace('de\\codeschubser\\honeycomb\\core\\views', ABSPATH . '/core/views');
/**
 * Start global timer
 */
timer_start();