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();
 }
Beispiel #2
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);
 }