Esempio n. 1
0
 function get_tag($value = null)
 {
     $str_date = new OrMySqlThDate();
     /**
      * Checking $vaule
      */
     if ($value != null) {
         $this->OP_[value]->set($value);
     }
     /**
      * Checking auto_post property
      */
     if ($this->OP_[auto_post]->get()) {
         $this->auto_post();
     }
     $id = $this->get_id_tag();
     $value = $str_date->get_th_str($this->OP_[value]->get());
     //echo "<b>debug</b> ".__FILE__." | ".__LINE__." | value =".$value."<br>";
     if ($value == null) {
         $value = $this->OP_[post_value]->get();
     }
     if ($value == null) {
         $value = $str_date->get_th_str($this->OP_[default_value]->get());
     }
     if ($this->OP_[class_name]->get() == null) {
         $class = null;
     } else {
         $class = 'class="' . $this->OP_[class_name]->get() . '"';
     }
     $this->clip_value($str_date->get_mysql_str($value));
     $type = 'type = "text"';
     $value = 'value="' . $value . '"';
     $title = 'title="' . $this->OP_[title]->get() . '"';
     $this_id = $this->OP_[id]->get();
     $this_format = 'dd/mm/bbbb';
     //$my_value = '<input type="text" name="theDate" readonly="" value="2004/02/02"/>';
     $my_value = "<input {$id} {$class}  {$type} {$value} {$title} maxlength=\"10\" size=\"10\" >" . $this->get_properties_tag();
     $my_value .= '<button title="ปฏิทิน" value="Cal" class="toolbar" type="button" onclick="displayCalendar(document.forms[0].' . $this_id . ',\'' . $this_format . '\',this)" ><img src="../../lib/calendar/image/calendar.png"/></button>';
     //$my_value .= '<input type="button" onclick="displayCalendar(document.forms[0].' . $this_id . ',\'' . $this_format . '\',this)" value="Cal">';
     return $my_value;
 }
Esempio n. 2
0
 function get_filter_value($value)
 {
     if (!is_numeric($value)) {
         /*ตรวจสอบการเป็นข้อมูลวันที่เวลาไทยหรือไม่*/
         $mysql_th_datetime = new OrMySqlThDatetime($value);
         if ($mysql_th_datetime->is_datetime) {
             return $mysql_th_datetime->get_mysql_str();
         } else {
             $mysql_th_date = new OrMySqlThDate($value);
             if ($mysql_th_date->is_date) {
                 return $mysql_th_date->get_mysql_str();
             } else {
                 return AddSlashes($value);
             }
         }
     } else {
         return AddSlashes($value);
         // แก้ไขกรณีบันทึกเลข ทศนิยม สุชาติ บุญหชัยรัตน์  14/10/2547
     }
 }
Esempio n. 3
0
 function get_sql_value($id)
 {
     /* เช็คประเภทของข้อมูล */
     if (!is_numeric($this->val_controls[db_field][$id])) {
         /* ตรวจสอบการเป็นข้อมูลวันที่เวลาไทยหรือไม่ */
         $mysql_th_datetime = new OrMySqlThDatetime($this->val_controls[db_field][$id]);
         if ($mysql_th_datetime->is_datetime) {
             return "'" . $mysql_th_datetime->get_mysql_str() . "'";
         } else {
             $mysql_th_date = new OrMySqlThDate($this->val_controls[db_field][$id]);
             if ($mysql_th_date->is_date) {
                 return "'" . $mysql_th_date->get_mysql_str() . "'";
             } else {
                 return "'" . AddSlashes($this->val_controls[db_field][$id]) . "'";
             }
         }
     } else {
         return "'" . AddSlashes($this->val_controls[db_field][$id]) . "'";
         // แก้ไขกรณีบันทึกเลข ทศนิยม สุชาติ บุญหชัยรัตน์  14/10/2547
     }
     //return null;
 }