Esempio n. 1
0
 /**
  * กำหนดคุณสมบัติของหน้าจอ มีตัวแปรที่ต้องกำหนดค่าคือ
  * $sql : คำสั่งเพื่อคัดข้อมูลจาก Table
  * $table : ชื่อ Table
  * $key_field : ชื่อ Field ที่เป็น PRIMARY
  * $my_form : Object เพื่อจัดการเกี่ยวกับ Form และข้อมูล
  * ตรวจสอบค่าใน config.inc.php มีค่าถูกต้อง
  */
 function __construct()
 {
     parent::__construct();
     /*$ajax = new OrAjax();
     		$this->set_script_src($ajax->OP_[ajax_src]->get());
     		$this->set_script($ajax->require_selectbox());*/
     $this->set_skin_ccs("my_form.css");
     /**กำหนดค่าตัวแปร ของหน้า**/
     $sql = 'SELECT * FROM `my_sys` ';
     $my_sec = new OrSec();
     /****************/
     /**สร้าง Form กำหนด Control***/
     $my_form = new OrDbFrmForm('my_form', $this->get_my_db(), 'my_sys', 'sys_id');
     $my_form->OP_[list_page_url]->set('my_sys_list.php');
     $my_form->OP_[column]->set(2);
     $my_form->set_controls(new OrDoJoTextbox('sys_id'));
     $my_form->controls[sys_id]->set_size(20, 50);
     $my_form->controls[sys_id]->set_clip('sys_id');
     $my_form->set_controls(new OrSelectbox('any_use'));
     $my_form->controls[any_use]->OP_[option]->set(array('0 ระบุ' => 0, '1 ไม่ระบุ' => 1));
     $opt = array();
     $opt["0 ไม่มีสิทธิ์ใช้งาน"] = 0;
     $opt["1 สิทธิ์อ่านข้อมูล"] = 1;
     $opt["2 สิทธิ์อ่านเขียน"] = 2;
     $opt["3 สิทธิ์อ่านเขียนลบ"] = 3;
     $my_form->set_controls(new OrSelectbox('aut_user'));
     $my_form->controls[aut_user]->OP_[option]->set($opt);
     $my_form->set_controls(new OrSelectbox('aut_group'));
     $my_form->controls[aut_group]->OP_[option]->set($opt);
     $my_form->set_controls(new OrSelectbox('aut_any'));
     $my_form->controls[aut_any]->OP_[option]->set($opt);
     $my_form->set_controls(new OrSelectbox('aut_god'));
     $my_form->controls[aut_god]->OP_[option]->set(array('0 ไม่' => 0, '1 ใช่' => 1));
     $my_form->set_controls(new OrDojoSelectbox('aut_can_from'));
     $my_form->controls[aut_can_from]->OP_[option]->set(array_merge(array('ไม่กำหนด' => ''), $my_sec->get_sys_list()));
     $my_form->controls[aut_can_from]->OP_[check_null]->set(false);
     $my_form->set_controls(new OrTextbox('title'));
     $my_form->controls[sys_id]->set_size(20, 50);
     $my_form->set_controls(new OrDojoTextarea('description'));
     $my_form->controls['description']->set_rowcol('3', '50');
     //กำหนดจำนวนแถวที่ Row จำนวน
     $my_form->controls['description']->OP_[check_null]->set(false);
     $my_form->fetch_record($sql);
     if ($my_form->controls[any_use]->OP_[value]->get() == '0') {
         //$link = 'my_can.php?val_filter[sys_id]=' . $my_form->controls[sys_id]->OP_[value]->get() .'&val_msg[btn_filter]=Filter';
         //$link = 'javascript:open("my_sys_list.php",null,"height=800,width=1000,status=yes,toolbar=no,menubar=yes,location=no");';
         //$my_form->controls[any_use]->OP_[description]->set('<a href=\'' . $link . '\' ><img src="' . $this->get_skins_path("/image/button/link_about.png") . '" title="คลิกกำหนดผู้ใช้ระบบ"></a>');
         $this->set_subpage('my_can_list.php?val_filter[sys_id]=' . $my_form->controls[sys_id]->OP_[value]->get() . '&val_compare[sys_id]==&val_msg[btn_filter]=Filter');
     }
     $my_form->set_header($my_form->get_control_filter() . ' ' . $my_form->get_button_filter());
     //$my_message = 'ข้อมูลต่างๆ ที่ต้องการแจ้ง ผู้ใช้ระบบ';
     $this->set_form($my_form->get_tag($this->get_skins_path('form_button.html')));
     $this->set_status($my_form->OP_[message]->get());
     //TODO :  version 2554 แจ้งใน my_form แทน
     $this->set_filter_msg($my_form->OP_[cmd_msg]->get());
     //TODO : version 2554 แจ้งใน my_form แทน
     //$this->set_my_message( $my_message);
     //$this->set_footer($this->get_text('footer.inc'));
     $this->show();
 }
Esempio n. 2
0
 function __construct()
 {
     parent::__construct();
     $this->set_skin_ccs("my_form.css");
     /*
      * กำหนดคุณสมบัติของหน้าจอดังนี้
      * $table : ชื่อ Table
      * $sql : คำสั่ง SQL
      * $key : ชื่อ Field ที่เป็น PRIMARY
      */
     $table = 'my_statistics';
     $sql = 'SELECT * FROM `' . $table . '` ';
     $key = 'id';
     $my_form = new OrDbFrmForm('my_form', $this->get_my_db(), $table, $key);
     $my_form->OP_[list_page_url]->set('_list.php');
     //$my_form->OP_[column]->set(2);
     /*
      * สร้าง Control ในฟอร์ม ประกอบด้วย Class ในกลุ่ม GUI
      */
     $my_form->set_controls(new OrLabel('id'));
     $my_form->controls[id]->OP_[check_null]->set(false);
     /*
      * ตัวอย่างการสร้าง controls textbox ความกว้าง 10 ฟิลด์ชื่อ name
      * $my_form->set_controls(new OrTextbox('name'));
      * $my_form->controls[name]->set_size(10);
      * เพิ่ม control ต่อไว้ด้านล่างนี้
      */
     $my_form->set_controls(new OrTextbox('name'));
     $my_form->set_controls(new OrTextbox('month_01'));
     $my_form->set_controls(new OrTextbox('month_02'));
     $my_form->set_controls(new OrTextbox('month_03'));
     $my_form->set_controls(new OrTextbox('month_04'));
     $my_form->set_controls(new OrTextbox('month_05'));
     $my_form->set_controls(new OrTextbox('month_06'));
     $my_form->set_controls(new OrTextbox('month_07'));
     $my_form->set_controls(new OrTextbox('month_08'));
     $my_form->set_controls(new OrTextbox('month_09'));
     $my_form->set_controls(new OrTextbox('month_10'));
     $my_form->set_controls(new OrTextbox('month_11'));
     $my_form->set_controls(new OrTextbox('month_12'));
     /*
      * กำหนดข้อมูลการคัดกรองข้อมูล ใหม่กรณีเกิดข้อผิดพลาด เช่น ฟิลด์ name เกิดจากคำสั่ง concat ดังดัวอย่าง
      * $my_form->set_filter_name('name',"concat(`prefix`,`fname`, ' ' , `lname`)");
      */
     /*
      * กระบวนการจัดการข้อมูลจากฐานข้อมูล
      */
     $my_form->fetch_record($sql);
     /*
      * กำหนดส่วนหัวของฟอร์ม ปกติจะแสดงช่อง Filter สำหรับกรองข้อมูล
      */
     $my_form->set_header('ค้นหา ' . $my_form->get_control_filter() . ' เรียง ' . $my_form->get_control_order() . ' ' . $my_form->get_button_filter());
     /*
      * กำหนดฟอร์มลงในหน้า และแสดงหน้าจอ
      */
     $this->set_form($my_form->get_tag());
     $this->set_filter_msg($my_form->OP_[cmd_msg]->get());
     $this->show();
 }
Esempio n. 3
0
 function __construct()
 {
     parent::__construct();
     $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_skin_ccs("my_list.css");
     //$this->set_skin_ccs("my_sys_list.css");
     /*
      * กำหนดคุณสมบัติของหน้าจอดังนี้
      * $sql : คำสั่ง SQL
      */
     $sql = "SELECT *  FROM `my_sys`";
     $my_form = new OrDbFrmList('my_form', $this->get_my_db());
     $my_form->OP_[edit_page_url]->set('my_sys.php');
     $my_form->OP_[edit_field_link]->set('sys_id');
     $my_form->OP_[edit_key_field]->set('sys_id');
     //$my_form->OE_[current_record]->set("include('my_sys_list.OE_current_record.php');");
     /*
      * สร้าง Control ในฟอร์ม ประกอบด้วย Class ในกลุ่ม GUI
      */
     $my_form->set_controls(new OrLabelAjax('sys_id'));
     $my_form->set_controls(new OrLabel('any_use'));
     $my_form->set_controls(new OrLabel('aut_user'));
     $my_form->set_controls(new OrLabel('aut_group'));
     $my_form->set_controls(new OrLabel('aut_any'));
     $my_form->set_controls(new OrLabel('aut_god'));
     $my_form->set_controls(new OrLabel('aut_can_from'));
     $my_form->set_controls(new OrLabel('title'));
     $my_form->set_controls(new OrLabel('description'));
     /*
      * ตัวอย่างการสร้าง controls textbox ความกว้าง 10 ฟิลด์ชื่อ name
      * $my_form->set_controls(new OrTextbox('name'));
      * $my_form->controls[name]->set_size(10);
      * เพิ่ม control ต่อไว้ด้านล่างนี้
      */
     /*
      * กำหนดข้อมูลการคัดกรองข้อมูล ใหม่กรณีเกิดข้อผิดพลาด เช่น ฟิลด์ name เกิดจากคำสั่ง concat ดังดัวอย่าง
      * $my_form->set_filter_name('name',"concat(`prefix`,`fname`, ' ' , `lname`)");
      */
     $my_form->set_filter_name('name', "concat(`prefix`,`fname`, ' ' , `lname`)");
     /*
      * กระบวนการจัดการข้อมูลจากฐานข้อมูล
      */
     $my_form->fetch_record($sql);
     /*
      * กำหนดส่วนหัวของฟอร์ม ปกติจะแสดงช่อง Filter สำหรับกรองข้อมูล
      */
     // $my_form->set_header('ค้นหา ' . $my_form->get_control_filter() .' เรียง ' . $my_form->get_control_order() . ' ' . $my_form->get_button_filter());
     /*
      * กำหนดฟอร์มลงในหน้า และแสดงหน้าจอ
      */
     $this->set_form($my_form->get_tag());
     $this->set_filter_msg($my_form->OP_[cmd_msg]->get());
     $this->show();
 }
Esempio n. 4
0
 function __construct()
 {
     parent::__construct();
     $this->set_skin_ccs("my_form.css");
     /*
      * กำหนดคุณสมบัติของหน้าจอดังนี้
      * $table : ชื่อ Table
      * $sql : คำสั่ง SQL
      * $key : ชื่อ Field ที่เป็น PRIMARY
      */
     $table = 'my_can';
     $sql = 'SELECT * FROM `' . $table . '` ';
     $key = array('sys_id', 'user');
     $my_sec = new OrSec();
     $user_list = $my_sec->get_user_list();
     $sys_list = $my_sec->get_sys_list();
     $clip_sys_id = new OrClip('sys_id');
     $my_form = new OrDbFrmForm('my_form', $this->get_my_db(), $table, $key);
     $my_form->OP_[list_page_url]->set('my_can_list.php');
     //$my_form->OP_[column]->set(2);
     /*
      * สร้าง Control ในฟอร์ม ประกอบด้วย Class ในกลุ่ม GUI
      */
     $my_form->set_controls(new OrDojoTextSearch('sys_id'));
     $my_form->controls[sys_id]->OP_[default_value]->set($clip_sys_id->OP_[value]->get());
     //$my_form->controls[sys_id]->OP_[option]->set($sys_list);
     $my_form->controls[sys_id]->OP_[popup_url]->set('my_sys_popup_list.php');
     $my_form->set_controls(new OrDojoTextSearch('user'));
     //$my_form->controls['user']->OP_[option]->set($user_list);
     $my_form->controls[user]->OP_[popup_url]->set('my_user_popup_list.php');
     $my_form->set_controls(new OrSelectbox('aut_to_group'));
     $my_form->controls['aut_to_group']->OP_[option]->set(array('ไม่มีสิทธิ์' => '0', 'ให้สิทธ์' => '1'));
     $my_form->set_controls(new OrTextarea('str_sql'));
     $my_form->controls['str_sql']->set_rowcol('5', '50');
     //กำหนดจำนวนแถวที่ Row จำนวน
     $my_form->controls['str_sql']->OP_[check_null]->set(false);
     /*
      * ตัวอย่างการสร้าง controls textbox ความกว้าง 10 ฟิลด์ชื่อ name
      * $my_form->set_controls(new OrTextbox('name'));
      * $my_form->controls[name]->set_size(10);
      * เพิ่ม control ต่อไว้ด้านล่างนี้
      */
     /*
      * กระบวนการจัดการข้อมูลจากฐานข้อมูล
      */
     $my_form->fetch_record($sql);
     /*
      * กำหนดส่วนหัวของฟอร์ม ปกติจะแสดงช่อง Filter สำหรับกรองข้อมูล
      */
     $my_form->set_header('ค้นหา ' . $my_form->get_control_filter() . ' เรียง ' . $my_form->get_control_order() . ' ' . $my_form->get_button_filter());
     /*
      * กำหนดฟอร์มลงในหน้า และแสดงหน้าจอ
      */
     $this->set_form($my_form->get_tag());
     $this->set_filter_msg($my_form->OP_[cmd_msg]->get());
     $this->show();
 }
Esempio n. 5
0
 public function __construct()
 {
     global $my_cfg;
     parent::__construct();
     $this->set_ip_reg();
     $this->set_skin($my_cfg[skins_path] . 'default_welcome.html');
     //เรียกใช้รูปแบบหน้าจอ
     $this->set_caption($my_cfg[title]);
     $my_sec = new OrSec(false);
     $val_ = new OrSysvalue();
     $val_controls = $val_->controls;
     if ($val_controls[login] == 'login') {
         $my_sec->login($val_controls[user], $val_controls[pass]);
         if ($my_sec->OP_[user]->get() == '') {
             header("Location:index.php");
         }
         //แก้ไขในอนาคตให้ไปที่หน้าสมัครสมาชิกใหม่
     }
     if ($val_controls[logout] == 'logout') {
         $my_sec->logout();
         header("Location:index.php");
     }
     if ($my_sec->OP_[user]->get() == '') {
         $my_form = new OrDojoForm('my_form');
         $my_form->set_controls(new OrDojoTextbox('user'));
         $my_form->controls[user]->set_size(10);
         $my_form->set_controls(new OrDojoTextbox('pass'));
         $my_form->controls[pass]->set_size(10);
         $my_form->controls[pass]->OP_[type]->set('password');
         $my_form->set_controls(new OrButton('login'));
         $my_form->set_skin($my_cfg[skins_path] . "frm_login.html");
         $my_form->skin->set_skin_tag('user', $my_form->controls[user]->get_tag());
         $my_form->skin->set_skin_tag('pass', $my_form->controls[pass]->get_tag());
         $my_form->skin->set_skin_tag('login', $my_form->controls[login]->get_tag('login'));
         $my_form->set_body($my_form->skin->get_tag());
         //
         $this->set_user_info('เข้าใช้ระบบ');
         $this->set_login($my_form->get_tag());
         $this->set_subpage($my_cfg[default_page_url]);
     } else {
         //header("Location:portal.php");
         $link_logout = '<a href="welcome.php?val_controls[logout]=logout" >ออกจากระบบ</a>';
         $this->set_user_info('ผู้ใช้ระบบ : ' . $my_sec->get_user_text());
         $this->set_login($my_sec->get_user_text() . '</b> [ <u>' . $my_sec->OP_[user]->get() . '</u> ] ต้องการ ->' . $link_logout);
         $this->set_subpage($my_cfg[default_login_url]);
         //$this->set_login(' ผู้ใช้ระบบ '.$my_sec->get_user_text() . '</b> [ <u>' . $my_sec->OP_[user]->get() . '</u> ] ');
     }
     /* ส่วนแสดงข้อมูลหน้าจอแรก */
     //$this->set_subpage('ฟอร์มข้อมูลหลัก');
     /* รายการเมนูหลัก */
     /* $src = "'http://www.facebook.com/'";
        $this->set_leading('<a href="javascript:change_subpage_src('. $src . ')">ดูแลระบบ</a>'); */
     $this->set_category_menu($my_cfg[menu_category]);
     $this->set_main_menu();
     $this->show();
 }
Esempio n. 6
0
 function __construct()
 {
     parent::__construct();
     $this->set_skin_ccs("my_form.css");
     $my_sec = new OrSec();
     $user_list = $my_sec->get_user_list();
     /*
      * กำหนดคุณสมบัติของหน้าจอดังนี้
      * $table : ชื่อ Table
      * $sql : คำสั่ง SQL
      * $key : ชื่อ Field ที่เป็น PRIMARY
      */
     $table = 'my_group';
     $sql = 'SELECT * FROM `' . $table . '` ';
     $key = array('group', 'user');
     $clip_user = new OrClip('user');
     $my_form = new OrDbFrmForm('my_form', $this->get_my_db(), $table, $key);
     $my_form->OP_[list_page_url]->set('my_group_list.php');
     $my_form->OP_[column]->set(3);
     /*$my_form->OE_[after_add]->set($my_cmd);
     		$my_form->OE_[after_save]->set($my_cmd);
     		$my_form->OE_[after_delete]->set($my_cmd);*/
     /*
      * สร้าง Control ในฟอร์ม ประกอบด้วย Class ในกลุ่ม GUI
      */
     //$my_form->set_controls(new OrLabel('id'));
     //$my_form->controls[id]->OP_[check_null]->set(false);
     /*
      * ตัวอย่างการสร้าง controls textbox ความกว้าง 10 ฟิลด์ชื่อ name
      * $my_form->set_controls(new OrTextbox('name'));
      * $my_form->controls[name]->set_size(10);
      * เพิ่ม control ต่อไว้ด้านล่างนี้
      */
     $my_form->set_controls(new OrSelectbox('group'));
     $my_form->controls[group]->OP_[option]->set($user_list);
     $my_form->set_controls(new OrSelectbox('user'));
     $my_form->controls['user']->OP_[default_value]->set($clip_user->OP_[value]->get());
     $my_form->controls['user']->OP_[option]->set($user_list);
     $my_form->set_controls(new OrTextbox('description'));
     $my_form->controls[description]->set_size(20, 50);
     $my_form->controls[description]->OP_[check_null]->set(false);
     /*
      * กระบวนการจัดการข้อมูลจากฐานข้อมูล
      */
     $my_form->fetch_record($sql);
     /*
      * กำหนดส่วนหัวของฟอร์ม ปกติจะแสดงช่อง Filter สำหรับกรองข้อมูล
      */
     $my_form->set_header('ค้นหา ' . $my_form->get_control_filter() . ' เรียง ' . $my_form->get_control_order() . ' ' . $my_form->get_button_filter());
     /*
      * กำหนดฟอร์มลงในหน้า และแสดงหน้าจอ
      */
     $this->set_form($my_form->get_tag($this->get_skins_path('form_button.html')));
     $this->set_filter_msg($my_form->OP_[cmd_msg]->get());
     $this->show();
 }
Esempio n. 7
0
 function __construct()
 {
     parent::__construct();
     $val_ = new OrSysvalue();
     if (is_null($val_->message[content_key_value])) {
         $this->popup();
     } else {
         $this->content($val_->message[content_key_value]);
     }
 }
Esempio n. 8
0
 function __construct()
 {
     parent::__construct();
     $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_skin_ccs("my_list.css");
     $this->set_skin_ccs("my_user_list.css");
     /*
      * กำหนดคุณสมบัติของหน้าจอดังนี้
      * $sql : คำสั่ง SQL
      */
     $sql = "SELECT * ,concat(`prefix`,`fname`, ' ' , `lname`) AS `name` FROM `my_user`";
     $my_form = new OrDbFrmList('my_form', $this->get_my_db());
     $my_form->OP_[edit_page_url]->set('my_user.php');
     $my_form->OP_[edit_field_link]->set('user');
     $my_form->OP_[edit_key_field]->set('id');
     $my_form->OE_[current_record]->set("include('my_user_list.OE_current_record.php');");
     /*
      * สร้าง Control ในฟอร์ม ประกอบด้วย Class ในกลุ่ม GUI
      */
     $my_form->set_controls(new OrLabel('id'));
     $my_form->set_controls(new OrLabelAjax('user'));
     $my_form->set_controls(new OrLabel('name'));
     $my_form->set_controls(new OrLabel('status'));
     $my_form->set_filter_controls(new select_ok_cancel('status'));
     /*
      * กำหนด Function คำนวณการคำสั่ง SQL
      */
     /*
      * กำหนดข้อมูลการคัดกรองข้อมูล ใหม่กรณีเกิดข้อผิดพลาด เช่น ฟิลด์ name เกิดจากคำสั่ง concat ดังดัวอย่าง
      * $my_form->set_filter_name('name',"concat(`prefix`,`fname`, ' ' , `lname`)");
      */
     $my_form->set_filter_name('name', "concat(`prefix`,`fname`, ' ' , `lname`)");
     /*
      * กระบวนการจัดการข้อมูลจากฐานข้อมูล
      */
     $my_form->fetch_record($sql);
     /*
      * กำหนดส่วนหัวของฟอร์ม ปกติจะแสดงช่อง Filter สำหรับกรองข้อมูล
      */
     /*
      * กำหนดส่วนล่างของฟอร์ม กรณีที่ต้องการ เช่นแสดง ยอดรวม
      */
     // $my_form->set_footer('จำนวน ' . $my_form->total_controls[count_name]->get_tag() . ' คน<br>รหัสล่าสุด ' . $my_form->total_controls[max_id]->get_tag() . ' --- ');
     /*
     		 /*
     * กำหนดฟอร์มลงในหน้า และแสดงหน้าจอ
     */
     $this->set_form($my_form->get_tag());
     $this->set_filter_msg($my_form->OP_[cmd_msg]->get());
     $this->show();
 }
 function __construct()
 {
     parent::__construct();
     $this->set_skin_ccs("my_list.css");
     $this->set_skin_ccs("my_activity_list.css");
     /*
      * กำหนดคุณสมบัติของหน้าจอดังนี้
      * $sql : คำสั่ง SQL
      */
     $sql = "SELECT *  FROM `my_activity`";
     $my_form = new OrDbFrmList('my_form', $this->get_my_db());
     /*
      * กำหนดคำสั่งที่ต้องในเหตุการณ์ของ Form เช่น on current record ดังตัวอย่าง
      * $my_form->OE_[current_record]->set("include('my_group_list.OE_current_record.php');");
      */
     /*
      * สร้าง Control ในฟอร์ม ประกอบด้วย Class ในกลุ่ม GUI
      */
     $my_form->set_controls(new OrLabel('description'));
     $my_form->set_controls(new OrLabel('sec_time'));
     $my_form->controls[sec_time]->OP_[db_type]->set('time');
     //กำหนดข้อมูลที่ไม่ใช่ text เพื่อป้องกัน filter แล้ว Error
     $my_form->set_controls(new OrLabel('sec_user'));
     $my_form->set_controls(new OrLabel('sec_ip'));
     $my_form->set_controls(new OrLabel('sec_script'));
     /*
      * ตัวอย่างการสร้าง controls textbox ความกว้าง 10 ฟิลด์ชื่อ name
      * $my_form->set_controls(new OrTextbox('name'));
      * $my_form->controls[name]->set_size(10);
      * เพิ่ม control ต่อไว้ด้านล่างนี้
      */
     /*
      * กำหนดข้อมูลการคัดกรองข้อมูล ใหม่กรณีเกิดข้อผิดพลาด เช่น ฟิลด์ name เกิดจากคำสั่ง concat ดังดัวอย่าง
      * $my_form->set_filter_name('name',"concat(`prefix`,`fname`, ' ' , `lname`)");
      */
     //$my_form->set_filter_name('name',"concat(`prefix`,`fname`, ' ' , `lname`)");
     /*
      * กระบวนการจัดการข้อมูลจากฐานข้อมูล
      */
     $my_form->fetch_record($sql);
     /*
      * กำหนดส่วนหัวของฟอร์ม ปกติจะแสดงช่อง Filter สำหรับกรองข้อมูล
      */
     //$my_form->set_header('ค้นหา ' . $my_form->get_control_filter() .' เรียง ' . $my_form->get_control_order() . ' ' . $my_form->get_button_filter());
     /*
      * กำหนดฟอร์มลงในหน้า และแสดงหน้าจอ
      */
     $this->set_form($my_form->get_tag());
     $this->set_filter_msg($my_form->OP_[cmd_msg]->get());
     $this->show();
 }
Esempio n. 10
0
 function __construct()
 {
     parent::__construct();
     $this->set_skin_ccs("my_list.css");
     /*
      * กำหนดไฟล์ css ที่ใช้กำหนดความกว้างในแต่ละช่องข้อมูล
      * โดยปกติจะตั้งชื่อเดียวกับ ชื่อไฟล์โปรแกรมแต่มีนามสกุลเป็น .css
      * อ่านรายละเอียด การกำหนดค่าได้ในไฟล์ new_page_list.css
      */
     $this->set_skin_ccs("new_page_list.css");
     //<-กำหนดชื่อไฟล์ css
     /*
      * กำหนดคำสั่ง SQL ที่ใช้ในการแสดงข้อมูลในฐานข้อมูล ในดัวแปร $sql
      * ตัวอย่างเป็นแสดงข้อมูลจากตาราง my_user
      */
     //$sql = "SELECT * ,concat(`prefix`,`fname`, ' ' , `lname`) AS `name` FROM `my_user`";//<-กำหนดคำสั่ง SQL
     $sql = "SELECT * FROM `my_group`";
     //<-กำหนดคำสั่ง SQL
     $my_form = new OrDbFrmList('my_form', $this->get_my_db());
     $my_form->OP_[edit_page_url]->set('my_group.php');
     //กำหนด URL ของหน้าแก้ไขข้อมูล
     $my_form->OP_[edit_field_link]->set('group');
     //กำหนด ชื่อ Field ที่ต้องการให้เป็น Link หนาแก้ไขข้อมูล
     $my_form->OP_[edit_key_field]->set('user');
     //กำหนด ชื่อ Field ที่เป็นคีย์แก้ไข
     /*
      * กำหนดคำสั่งที่ต้องในเหตุการณ์ของ Form เช่น on current record โดยปกติจากสร้างไฟล์เก็บคำสั่งไว้
      * โดยใช้ [ชื่อไฟล์โปรแกรม] .[ชื่อเหตุการณ์] เช่น new_page_list.OE_current_record.php เป็นต้น
      * สามารถดูรายละเอียดได้ในไฟล์ดังกล่าว
      */
     //$my_form->OE_[current_record]->set("include('new_page_list.OE_current_record.php');");//<-แก้ไขถ้าต้องการใช้คำสั่งตามเหตุการณ์
     /*
      * สร้าง Control ในฟอร์ม โดยปกติจะใช้ class OrLabel
      * ตามตัวอย่างประกอบด้วยฟิลด์ตามคำสั่ง SQL ในตาราง my_user
      */
     $my_form->set_controls(new OrLabel('group'));
     $my_form->set_controls(new OrLabel('user'));
     $my_form->set_controls(new OrLabel('description'));
     /*
      * กำหนดชนิด filter controls ตามตัวอย่างคำสั่ง
      * $my_form->set_filter_controls(new OrSelectbox('status'));
      * $my_form->set_filter_controls(new OrTextCalendar2('service_reg_date'));
      */
     /*
      * กำหนด Function คำนวณการคำสั่ง SQL
      * $my_form->set_total_function('id' , 'count');
      */
     /*
      * กำหนดข้อมูลการคัดกรองข้อมูล ใหม่กรณีเกิดข้อผิดพลาด เช่น ฟิลด์ name เกิดจากคำสั่ง concat ดังดัวอย่าง
      * $my_form->set_filter_name('name',"concat(`prefix`,`fname`, ' ' , `lname`)");
      */
     /*
      * กำหนดเงื่อนไขการเปรียบเทียบเริ่มต้น ฟิลด์ frequency ต้องให้เริ่มเปรียบเทียบด้วย = ให้กำหนดตามตัวอย่างด้านล่าง
      * $my_form->set_filter_compare('frequency',"=");
      */
     /*
      * กระบวนการจัดการข้อมูลจากฐานข้อมูล
      */
     $my_form->fetch_record($sql);
     /*
      * กำหนดส่วนหัวของฟอร์ม ปกติจะแสดงช่อง Filter สำหรับกรองข้อมูล
      */
     //$my_form->set_header('This is Header.');
     /*
      * กำหนดส่วนล่างของฟอร์ม กรณีที่ต้องการ เช่นแสดง ยอดรวม
      */
     //$my_form->set_footer($my_form->total_controls[conunt_id]->get_tag());
     /*
      * กำหนดฟอร์มลงในหน้า และแสดงหน้าจอ
      */
     $this->set_form($my_form->get_tag());
     $this->set_filter_msg($my_form->OP_[cmd_msg]->get());
     $this->show();
 }
Esempio n. 11
0
 function __construct()
 {
     parent::__construct();
     $my_sec = new OrSec();
     $this->set_skin_ccs("my_form.css");
     $val_ = new OrSysvalue();
     $val_controls = $val_->controls;
     /*
      * กำหนดคุณสมบัติของหน้าจอดังนี้
      * $table : ชื่อ Table
      * $sql : คำสั่ง SQL
      * $key : ชื่อ Field ที่เป็น PRIMARY
      */
     $table = 'my_user';
     $sql = 'SELECT * FROM `' . $table . "` WHERE `user` = '" . $my_sec->OP_[user]->get() . "'";
     $key = 'id';
     $my_form = new OrDbFrmForm('my_form', $this->get_my_db(), $table, $key);
     //$my_form->OP_[list_page_url]->set('_list.php');
     //$my_form->OP_[column]->set(2);
     if ($val_controls[pass] != '') {
         $my_cmd = '$this->set_controls(new OrFieldHidden("val_pass") );';
         $my_cmd .= '$this->val_controls[db_field][val_pass] = md5("' . $val_controls[pass] . '");';
         $my_form->OE_[before_add]->set($my_cmd);
         $my_form->OE_[before_save]->set($my_cmd);
     }
     /*
      * สร้าง Control ในฟอร์ม ประกอบด้วย Class ในกลุ่ม GUI
      */
     $my_form->set_controls(new OrLabel('id'));
     $my_form->controls[id]->OP_[check_null]->set(false);
     /*
      * ตัวอย่างการสร้าง controls textbox ความกว้าง 10 ฟิลด์ชื่อ name
      * $my_form->set_controls(new OrTextbox('name'));
      * $my_form->controls[name]->set_size(10);
      * เพิ่ม control ต่อไว้ด้านล่างนี้
      */
     $my_form->set_controls(new OrLabel('user'));
     $my_form->set_controls(new OrTextbox('pass'), 'รหัสผ่าน ', false);
     $my_form->controls[pass]->OP_[title]->set('ควรมีความยาวมากกว่า 6 ');
     $my_form->controls[pass]->set_size(10);
     $my_form->controls[pass]->OP_[password]->set(true);
     $my_form->set_controls(new OrTextbox('prefix'));
     $my_form->controls[prefix]->set_size(10);
     $my_form->set_controls(new OrLabel(''), '', false);
     $my_form->set_controls(new OrTextbox('fname'));
     $my_form->controls[fname]->set_size(20, 50);
     $my_form->set_controls(new OrTextbox('lname'));
     $my_form->controls[lname]->set_size(20, 50);
     /*
      * กำหนดข้อมูลการคัดกรองข้อมูล ใหม่กรณีเกิดข้อผิดพลาด เช่น ฟิลด์ name เกิดจากคำสั่ง concat ดังดัวอย่าง
      * $my_form->set_filter_name('name',"concat(`prefix`,`fname`, ' ' , `lname`)");
      */
     /*
      * กระบวนการจัดการข้อมูลจากฐานข้อมูล
      */
     $my_form->fetch_record($sql);
     /*
      * กำหนดส่วนหัวของฟอร์ม ปกติจะแสดงช่อง Filter สำหรับกรองข้อมูล
      */
     $my_form->set_header('ค้นหา ' . $my_form->get_control_filter() . ' เรียง ' . $my_form->get_control_order() . ' ' . $my_form->get_button_filter());
     /*
      * กำหนดฟอร์มลงในหน้า และแสดงหน้าจอ
      */
     $this->set_form($my_form->get_tag());
     $this->set_filter_msg($my_form->OP_[cmd_msg]->get());
     $this->show();
 }
Esempio n. 12
0
 function __construct()
 {
     parent::__construct();
     $this->set_skin_ccs("my_list.css");
     /*
      * กำหนดไฟล์ css ที่ใช้กำหนดความกว้างในแต่ละช่องข้อมูล
      * โดยปกติจะตั้งชื่อเดียวกับ ชื่อไฟล์โปรแกรมแต่มีนามสกุลเป็น .css
      * อ่านรายละเอียด การกำหนดค่าได้ในไฟล์ new_page_list.css
      */
     $this->set_skin_ccs("new_page_list.css");
     //<-กำหนดชื่อไฟล์ css
     /*
      * กำหนดคำสั่ง SQL ที่ใช้ในการแสดงข้อมูลในฐานข้อมูล ในดัวแปร $sql
      * ตัวอย่างเป็นแสดงข้อมูลจากตาราง my_user
      */
     $sql = "SELECT  `sec_user` FROM `my_activity` GROUP BY `sec_user`";
     //<-กำหนดคำสั่ง SQL
     //$graph= new OrGraph('การใช้งาน Script','ครั้ง','',600 ,400);
     /*$data_array[1]  = array(11,3, 8,10,5 ,1,9, 13,5,7 ,20,12); 
     		$data_array[2]  = array(8,2, 18,20,9 ,3,5, 21,18,15 ,18,15);
     		$data_array[3]  = array(2,12, 8,12,15 ,23,15, 13,28,25 ,30,25);
     		$data_array[4]  = array(26,20,12,21,13 ,32,25, 3,20,23 ,10,5);
     		$graph->set_data_array($data_array);*/
     /*$cross_tab = new OrSqlCrossTab($sql);
     		$cross_tab->OP_[col_field_name]->set('status');
     		$cross_tab->OP_[data_field_name]->set('status');
     		$sql = $cross_tab->get_sql($this->get_my_db() , $sql);*/
     $my_form = new OrDbFrmCrossTab('my_form', $this->get_my_db());
     $my_form->set_cross_tab('sec_script', 'sec_user', 'count');
     /*
      * กำหนดคำสั่งที่ต้องในเหตุการณ์ของ Form เช่น on current record โดยปกติจากสร้างไฟล์เก็บคำสั่งไว้
      * โดยใช้ [ชื่อไฟล์โปรแกรม] .[ชื่อเหตุการณ์] เช่น new_page_list.OE_current_record.php เป็นต้น
      * สามารถดูรายละเอียดได้ในไฟล์ดังกล่าว
      */
     //$my_form->OE_[current_record]->set("include('new_page_list.OE_current_record.php');");//<-แก้ไขถ้าต้องการใช้คำสั่งตามเหตุการณ์
     /*
      * สร้าง Control ในฟอร์ม โดยปกติจะใช้ class OrLabel
      * ตามตัวอย่างประกอบด้วยฟิลด์ตามคำสั่ง SQL ในตาราง my_user
      */
     $my_form->set_controls(new OrLabel('sec_user'));
     //$my_form->OP_[default_mode]->set('list');
     /*
      * กำหนด Function คำนวณการคำสั่ง SQL
      */
     //$my_form->set_total_function('col_1' , '');
     /*
      * กำหนดข้อมูลการคัดกรองข้อมูล ใหม่กรณีเกิดข้อผิดพลาด เช่น ฟิลด์ name เกิดจากคำสั่ง concat ดังดัวอย่าง
      * $my_form->set_filter_name('name',"concat(`prefix`,`fname`, ' ' , `lname`)");
      */
     //$my_form->set_filter_name('name',"concat(`prefix`,`fname`, ' ' , `lname`)");//<-แก้ไขคำสั่งที่ใช้แทนเวลาที่กรองข้อมูล
     /*
      * กระบวนการจัดการข้อมูลจากฐานข้อมูล
      */
     $my_form->fetch_record($sql);
     /*if($my_form->OP_[on_load]->get() ==0 ){
     			$my_form->form_mode = 'query';
     		}
     		/*
     		 * กำหนดส่วนหัวของฟอร์ม ปกติจะแสดงช่อง Filter สำหรับกรองข้อมูล
     		 */
     //$my_form->set_header('ค้นหา ' . $my_form->get_control_filter() .' เรียง ' . $my_form->get_control_order() . ' ' . $my_form->get_button_filter() . '<br>' );
     /*
      * กำหนดส่วนล่างของฟอร์ม กรณีที่ต้องการ เช่นแสดง ยอดรวม
      */
     //$my_form->set_footer('รวมทั้งหมด ' . $my_form->total_controls[_col_1]->get_tag() . ' รายการ');
     /*
      * กำหนดฟอร์มลงในหน้า และแสดงหน้าจอ
      */
     $this->set_form($my_form->get_tag());
     /* if($my_form->form_mode == 'list'){
     			 $graph->set_data_array($my_form->page_data);
     			 $graph->create_image();
     		 }*/
     $this->set_filter_msg($my_form->OP_[cmd_msg]->get());
     $this->show();
 }
Esempio n. 13
0
 function __construct()
 {
     parent::__construct();
     global $my_cfg;
     $this->set_skin_ccs("my_form.css");
     /*
      * กำหนดคุณสมบัติของหน้าจอดังนี้
      * $table : ชื่อ Table
      * $sql : คำสั่ง SQL
      * $key : ชื่อ Field ที่เป็น PRIMARY
      */
     $table = 'my_menu';
     $sql = 'SELECT * FROM `' . $table . '` ';
     $key = 'id';
     $my_form = new OrDbFrmForm('my_form', $this->get_my_db(), $table, $key);
     //$my_form->OP_[list_page_url]->set('_list.php');
     $my_form->OP_[column]->set(1);
     /*
      * สร้าง Control ในฟอร์ม ประกอบด้วย Class ในกลุ่ม GUI
      */
     $my_form->set_controls(new OrLabel('id'));
     $my_form->controls[id]->OP_[check_null]->set(false);
     /*
      * ตัวอย่างการสร้าง controls textbox ความกว้าง 10 ฟิลด์ชื่อ name
      * $my_form->set_controls(new OrTextbox('name'));
      * $my_form->controls[name]->set_size(10);
      * เพิ่ม control ต่อไว้ด้านล่างนี้
      */
     //$my_form->set_controls(new OrLabel('blank'),'สำหรับเพิ่มช่องว่าง'); //TODO : ทดสอบ controls สำหรับจัดแต่งหน้าจอ
     $my_form->set_controls(new OrSelectbox('category_id'));
     $my_form->controls[category_id]->OP_[option]->set($my_cfg[menu_category]);
     $my_form->set_controls(new OrTextbox('name'));
     $my_form->controls[name]->set_size(50);
     $my_form->set_controls(new OrTextbox('sort_id'));
     $my_form->controls[sort_id]->set_size(3);
     $my_form->set_controls(new OrTextbox('href'));
     $my_form->controls[href]->set_size(80);
     $my_form->set_controls(new OrSelectbox('href_type'));
     $my_form->controls[href_type]->OP_[option]->set(array('ปกติ' => 0, 'หน้าใหม่' => 1, 'หน้าเดิม' => 2));
     $my_form->set_controls(new OrSelectbox('status'));
     $my_form->controls[status]->OP_[option]->set(array('Ok' => 0, 'Cancel' => 1));
     //$my_form->set_controls(new OrDojoTextarea('href'));
     /*
      * กำหนดข้อมูลการคัดกรองข้อมูล ใหม่กรณีเกิดข้อผิดพลาด เช่น ฟิลด์ name เกิดจากคำสั่ง concat ดังดัวอย่าง
      * $my_form->set_filter_name('name',"concat(`prefix`,`fname`, ' ' , `lname`)");
      */
     /*
      * กระบวนการจัดการข้อมูลจากฐานข้อมูล
      */
     $my_form->fetch_record($sql);
     /*
      * กำหนดส่วนหัวของฟอร์ม ปกติจะแสดงช่อง Filter สำหรับกรองข้อมูล
      */
     $my_form->set_header('ค้นหา ' . $my_form->get_control_filter() . ' เรียง ' . $my_form->get_control_order() . ' ' . $my_form->get_button_filter());
     /*
      * กำหนดฟอร์มลงในหน้า และแสดงหน้าจอ
      */
     $this->set_form($my_form->get_tag());
     $this->set_filter_msg($my_form->OP_[cmd_msg]->get());
     //$this->set_my_message($my_form->OP[message]->get());
     $this->show();
 }