Example #1
0
 function get_navigator_tag($skin_file = 'Or!Lib/db/form_navigator.html')
 {
     /* รับค่า Skin ของชุดปุ่่ม */
     $my_value = new OrSkin($skin_file);
     $cur_rec = new OrFieldHidden('evt_form_db[cur_rec]');
     $cur_rec->OP_[value]->set($this->OP_[cur_rec]->get());
     $total_rec = new OrFieldHidden("evt_form_db[total_rec]");
     $total_rec->OP_[value]->set($this->OP_[total_rec]->get());
     $btn_record = new OrButton("btn_record", "evt_form_db[navigator]");
     if ($this->OP_[cur_rec]->get() == 0) {
         $btn_record->OP_[value]->set('Add');
     } else {
         $btn_record->OP_[value]->set('Save');
     }
     $my_value->set_skin_tag('btn_record', $btn_record->get_tag());
     $my_value->set_skin_tag('cur_rec', $cur_rec->get_tag());
     $my_value->set_skin_tag('total_rec', $total_rec->get_tag());
     $my_value->set_skin_tag('description', $this->OP_[cur_rec]->get() . ' of ' . $this->OP_[total_rec]->get());
     return $my_value->get_tag();
 }
Example #2
0
 /**
  * get_button_filter : html tag ของปุ่ม filtter
  * @param string $cmd_filter คำสั่ง filter ข้อมูล
  * @return string html tag ของปุ่ม filter
  */
 function get_button_filter($cmd_filter = '')
 {
     echo 'ยกเลิกคำสั่ง get_button_filter ใน my_page';
     global $my_cfg;
     $btn_filter = new OrButton('btn_filter', 'val_msg[btn_filter]');
     $btn_filter->OP_[class_name]->set("toolbar");
     $btn_filter->OP_[title]->set("ค้นหา");
     $btn_filter->OP_[value]->set("Filter");
     $btn_filter->OP_[image_source]->set($my_cfg[skins_path] . 'image/button/filter.png');
     $my_tag = $btn_filter->get_tag();
     $btn_query = new OrButton('btn_query', 'val_msg[btn_query]');
     $btn_query->OP_[class_name]->set("toolbar");
     $btn_query->OP_[title]->set("ตั้งคำถาม");
     $btn_query->OP_[value]->set("Query");
     $btn_query->OP_[image_source]->set($my_cfg[skins_path] . 'image/button/query.png');
     $my_tag .= $btn_query->get_tag();
     if ($cmd_filter != '') {
         $btn_filter->OP_[title]->set("ยกเลิก ค้นหา");
         $btn_filter->OP_[value]->set("No Filter");
         $btn_filter->OP_[image_source]->set($my_cfg[skins_path] . 'image/button/no_filter.png');
         $my_tag .= $btn_filter->get_tag();
     }
     return $my_tag;
 }
Example #3
0
 function get_button_filter($cmd_filter = '')
 {
     global $my_cfg;
     $btn_filter = new OrButton('btn_filter', 'val_msg[btn_filter]');
     $btn_filter->OP_[class_name]->set("toolbar");
     $btn_filter->OP_[title]->set("ค้นหา");
     $btn_filter->OP_[value]->set("Filter");
     $btn_filter->OP_[image_source]->set($my_cfg[skins_path] . 'image/button/filter.png');
     $my_tag = $btn_filter->get_tag();
     $btn_query = new OrButton('btn_query', 'val_msg[btn_query]');
     $btn_query->OP_[class_name]->set("toolbar");
     $btn_query->OP_[title]->set("ตั้งคำถาม");
     $btn_query->OP_[value]->set("Query");
     $btn_query->OP_[image_source]->set($my_cfg[skins_path] . 'image/button/query.png');
     $my_tag .= $btn_query->get_tag();
     if ($cmd_filter != '' or $this->OP_[cmd_filter]->get() != '' or $this->OP_[cmd_group_filter]->get() != '') {
         $btn_filter->OP_[title]->set("ยกเลิก ค้นหา");
         $btn_filter->OP_[value]->set("No Filter");
         $btn_filter->OP_[image_source]->set($my_cfg[skins_path] . 'image/button/no_filter.png');
         $my_tag .= $btn_filter->get_tag();
     }
     if ($this->OP_[edit_page_url]->get() != '') {
         $btn_new = new OrButton('btn_new', 'val_msg[btn_new]');
         $btn_new->OP_[class_name]->set("toolbar");
         $btn_new->OP_[title]->set("เพิ่มรายการใหม่");
         $btn_new->OP_[value]->set("New");
         $btn_new->OP_[image_source]->set($my_cfg[skins_path] . 'image/button/new_document.png');
         $btn_new->OP_[type]->set('button');
         $event = "onClick";
         $js_script = "window.location.href = '" . $this->OP_[edit_page_url]->get() . "?evt_form_db[navigator]=New'";
         $btn_new->OP_[js_event]->set("{$event} = \"" . $js_script . "\"");
         $my_tag .= $btn_new->get_tag();
     }
     return $my_tag;
 }