Ejemplo n.º 1
0
 function _loadFormEditRecord()
 {
     parent::_loadFormEditRecord();
     // TODO: Change the autogenerated stub
     $list_cat = category_type($this->cat_type);
     $array_cat = array(' -- Chọn danh mục thực đơn -- ');
     foreach ($list_cat as $cat) {
         if (!$cat['cat_parent_id']) {
             $array_cat[$cat['cat_id']] = ' ☛ ' . $cat['cat_name'];
         }
         foreach ($list_cat as $cat_child) {
             if ($cat_child['cat_parent_id'] == $cat['cat_id']) {
                 $array_cat[$cat_child['cat_id']] = '   ♦ ' . $cat_child['cat_name'];
             }
         }
     }
     $array_unit = array(0 => ' - Chọn đơn vị tính - ');
     $db_query = new db_query('SELECT * FROM units');
     while ($row = mysqli_fetch_assoc($db_query->result)) {
         $array_unit[$row['uni_id']] = $row['uni_name'];
     }
     $this->add($this->form->text(array('label' => 'Tên thực đơn', 'name' => 'men_name', 'id' => 'men_name', 'require' => 1, 'errorMsg' => 'Bạn chưa nhập tên thực đơn', 'value' => $this->f['men_name'])));
     $this->add($this->form->select(array('label' => 'Đơn vị tính', 'name' => 'men_unit_id', 'id' => 'men_unit_id', 'option' => $array_unit, 'selected' => $this->f['men_unit_id'], 'require' => 1, 'errorMsg' => 'Bạn chưa nhập đơn vị tính')));
     $this->add($this->form->select(array('label' => 'Danh mục', 'name' => 'men_cat_id', 'id' => 'men_cat_id', 'option' => $array_cat, 'selected' => $this->f['men_cat_id'], 'require' => 1, 'errorMsg' => 'Bạn chưa chọn danh mục thực đơn')));
     $this->add($this->form->number(array('label' => 'Giá bán chính', 'name' => 'men_price', 'id' => 'men_price', 'require' => 1, 'addon' => 'vnđ', 'errorMsg' => 'Bạn chưa nhập giá bán chính', 'value' => $this->f['men_price'])));
     $this->add($this->form->number(array('label' => 'Giá bán 2', 'name' => 'men_price1', 'id' => 'men_price1', 'addon' => 'vnđ', 'value' => $this->f['men_price1'])));
     $this->add($this->form->number(array('label' => 'Giá bán 3', 'name' => 'men_price2', 'id' => 'men_price2', 'addon' => 'vnđ', 'value' => $this->f['men_price2'])));
     $this->add($this->form->textarea(array('label' => 'Ghi chú', 'name' => 'men_note', 'id' => 'men_note', 'value' => $this->f['men_note'])));
     $this->add($this->form->ajaxUploadFile(array('label' => 'Ảnh đại diện', 'name' => 'men_image', 'id' => 'men_image', 'browse_id' => 'browse_img', 'viewer_id' => 'viewer_img', 'value' => get_picture_path($this->f['men_image']))));
 }
Ejemplo n.º 2
0
 function _loadFormEditRecord()
 {
     $list_cat = category_type($this->cat_type);
     $array_cat = array('' => ' -- Chọn nhóm nhân viên -- ');
     foreach ($list_cat as $cat) {
         $array_cat[$cat['cat_id']] = $cat['cat_name'];
     }
     unset($db_query);
     parent::_loadFormEditRecord();
     // TODO: Change the autogenerated stub
     $db_age = new db_query('SELECT * FROM agencies');
     $list_agencies = array();
     while ($row = mysqli_fetch_assoc($db_age->result)) {
         $list_agencies[$row['age_id']] = $row['age_name'];
     }
     $this->add($this->form->text(array('label' => 'Tên nhân viên', 'name' => 'use_name', 'id' => 'use_name', 'require' => 1, 'errorMsg' => 'Bạn chưa nhập tên nhân viên', 'value' => $this->f['use_name'])));
     $this->add($this->form->select(array('label' => 'Thuộc cửa hàng', 'name' => 'use_agency_id', 'id' => 'use_agency_id', 'option' => $list_agencies, 'selected' => $this->f['use_agency_id'], 'require' => 1, 'errorMsg' => 'Bạn chưa chọn cửa hàng')));
     $this->add($this->form->text(array('label' => 'Địa chỉ', 'name' => 'use_address', 'id' => 'use_address', 'require' => 1, 'errorMsg' => 'Bạn chưa nhập địa chỉ', 'value' => $this->f['use_address'])));
     $this->add($this->form->text(array('label' => 'Điện thoại', 'name' => 'use_phone', 'id' => 'use_phone', 'value' => $this->f['use_phone'])));
     $this->add($this->form->number(array('label' => 'Lương ca', 'name' => 'use_pay', 'id' => 'use_pay', 'addon' => 'vnđ', 'value' => $this->f['use_pay'])));
     $this->add($this->form->number(array('label' => 'Chiết khấu', 'name' => 'use_discount', 'id' => 'use_discount', 'addon' => '%', 'value' => $this->f['use_discount'])));
     $this->add($this->form->select(array('label' => 'Nhóm nhân viên', 'name' => 'use_group_id', 'id' => 'use_group_id', 'option' => $array_cat, 'selected' => $this->f['use_group_id'], 'require' => 1, 'errorMsg' => 'Bạn chưa chọn nhóm nhân viên')));
     $this->add($this->form->text(array('label' => 'Mã nhân viên tự nhập', 'name' => 'use_code', 'id' => 'use_code', 'value' => $this->f['use_code'])));
     $this->add($this->form->textarea(array('label' => 'Ghi chú', 'name' => 'use_note', 'id' => 'use_note', 'value' => $this->f['use_note'])));
     $this->add($this->form->ajaxUploadFile(array('label' => 'Ảnh đại diện', 'name' => 'use_image', 'id' => 'use_image', 'browse_id' => 'browse_img', 'viewer_id' => 'viewer_img', 'value' => get_picture_path($this->f['use_image']))));
 }
Ejemplo n.º 3
0
 function _loadFormAddRecord()
 {
     parent::_loadFormAddRecord();
     // TODO: Change the autogenerated stub
     $list_cat = category_type($this->cat_type);
     $array_cat = array(' -- Chọn danh mục nguyên liệu -- ');
     foreach ($list_cat as $cat) {
         if (!$cat['cat_parent_id']) {
             $array_cat[$cat['cat_id']] = ' ☛ ' . $cat['cat_name'];
         }
         foreach ($list_cat as $cat_child) {
             if ($cat_child['cat_parent_id'] == $cat['cat_id']) {
                 $array_cat[$cat_child['cat_id']] = '   ♦ ' . $cat_child['cat_name'];
             }
         }
     }
     $array_unit = array('' => ' - Chọn đơn vị tính - ');
     $db_query = new db_query('SELECT * FROM units');
     while ($row = mysqli_fetch_assoc($db_query->result)) {
         $array_unit[$row['uni_id']] = $row['uni_name'];
     }
     unset($db_query);
     $this->add($this->form->text(array('label' => 'Tên hàng', 'name' => 'pro_name', 'id' => 'pro_name', 'require' => 1, 'errorMsg' => 'Bạn chưa nhập tên mặt hàng')));
     $this->add($this->form->select(array('label' => 'Đơn vị tính', 'name' => 'pro_unit_id', 'id' => 'pro_unit_id', 'option' => $array_unit, 'selected' => 0, 'require' => 1, 'errorMsg' => 'Bạn chưa nhập đơn vị tính')));
     $this->add($this->form->select(array('label' => 'Danh mục', 'name' => 'pro_cat_id', 'id' => 'pro_cat_id', 'option' => $array_cat, 'selected' => 0, 'require' => 1, 'errorMsg' => 'Bạn chưa chọn danh mục nguyên liệu')));
     $this->add($this->form->number(array('label' => 'Tồn tối thiểu', 'name' => 'pro_instock', 'id' => 'pro_instock')));
     $this->add($this->form->text(array('label' => 'Mã hàng tự nhập', 'name' => 'pro_code', 'id' => 'pro_code')));
     $this->add($this->form->textarea(array('label' => 'Ghi chú', 'name' => 'pro_note', 'id' => 'pro_note')));
     $this->add($this->form->ajaxUploadFile(array('label' => 'Ảnh đại diện', 'name' => 'pro_image', 'id' => 'pro_image', 'browse_id' => 'browse_img', 'viewer_id' => 'viewer_img')));
 }
Ejemplo n.º 4
0
 public function __construct()
 {
     parent::__construct();
     // TODO: Change the autogenerated stub
     //Set option_filter
     global $configuration;
     $this->option_filter = 'agency_' . $configuration['con_default_agency'];
 }
Ejemplo n.º 5
0
 function _loadFormEditRecord()
 {
     parent::_loadFormEditRecord();
     // TODO: Change the autogenerated stub
     $this->add($this->form->text(array('label' => 'Nhập tên', 'name' => 'cat_name', 'id' => 'cat_name', 'require' => 1, 'errorMsg' => 'Bạn chưa nhập lý do', 'value' => $this->f['cat_name'])));
     $this->add($this->form->ajaxUploadFile(array('label' => 'Ảnh đại diện', 'name' => 'cat_picture', 'id' => 'cat_picture', 'browse_id' => 'browse_img', 'viewer_id' => 'viewer_img', 'value' => get_picture_path($this->f['cat_picture']))));
     $this->add($this->form->textarea(array('label' => 'Ghi chú', 'name' => 'cat_note', 'id' => 'cat_note', 'value' => $this->f['cat_note'])));
 }
Ejemplo n.º 6
0
 public function __construct()
 {
     parent::__construct();
     // TODO: Change the autogenerated stub
     //lấy ra configuration
     $db_query = new db_query('SELECT * FROM configurations LIMIT 1');
     $this->config = mysqli_fetch_assoc($db_query->result);
     unset($db_query);
     $this->start_menu = json_decode(base64_decode($this->config['con_start_menu']), 1);
 }
Ejemplo n.º 7
0
 function _loadFormEditRecord()
 {
     parent::_loadFormEditRecord();
     // TODO: Change the autogenerated stub
     global $cat_type_in, $cat_type_out;
     $this->add($this->form->text(array('label' => 'Nhập tên', 'name' => 'cat_name', 'id' => 'cat_name', 'require' => 1, 'errorMsg' => 'Bạn chưa nhập lý do', 'value' => $this->f['cat_name'])));
     $this->add($this->form->list_radio(array('label' => 'Loại lý do', 'list' => array(array('label' => 'Lý do thu', 'name' => 'cat_type', 'id' => 'money_in', 'value' => $cat_type_in, 'is_check' => 0), array('label' => 'Lý do chi', 'name' => 'cat_type', 'id' => 'money_out', 'value' => $cat_type_out, 'is_check' => 1)), 'column' => 2)));
     $this->add($this->form->ajaxUploadFile(array('label' => 'Ảnh đại diện', 'name' => 'cat_picture', 'id' => 'cat_picture', 'browse_id' => 'browse_img', 'viewer_id' => 'viewer_img', 'value' => get_picture_path($this->f['cat_picture']))));
     $this->add($this->form->textarea(array('label' => 'Ghi chú', 'name' => 'cat_note', 'id' => 'cat_note', 'value' => $this->f['cat_note'])));
 }
Ejemplo n.º 8
0
 function _loadFormEditRecord()
 {
     parent::_loadFormEditRecord();
     // TODO: Change the autogenerated stub
     $list_cat = category_type($this->cat_type);
     $array_cat = array('' => ' -- Chọn nhóm nhà cung cấp -- ');
     foreach ($list_cat as $cat) {
         $array_cat[$cat['cat_id']] = $cat['cat_name'];
     }
     $this->add($this->form->text(array('label' => 'Tên nhà cung cấp', 'name' => 'sup_name', 'id' => 'sup_name', 'require' => 1, 'errorMsg' => 'Bạn chưa nhập tên nhà cung cấp', 'value' => $this->f['sup_name'])));
     $this->add($this->form->text(array('label' => 'Địa chỉ', 'name' => 'sup_address', 'id' => 'sup_address', 'require' => 1, 'errorMsg' => 'Bạn chưa nhập địa chỉ nhà cung cấp', 'value' => $this->f['sup_address'])));
     $this->add($this->form->ajaxUploadFile(array('label' => 'Ảnh đại diện', 'name' => 'sup_image', 'id' => 'sup_image', 'browse_id' => 'browse_img', 'viewer_id' => 'viewer_img', 'value' => get_picture_path($this->f['sup_image']))));
     $this->add($this->form->select(array('label' => 'Nhóm', 'name' => 'sup_cat_id', 'id' => 'sup_cat_id', 'option' => $array_cat, 'selected' => $this->f['sup_cat_id'], 'require' => 1, 'errorMsg' => 'Bạn chưa chọn nhóm nhà cung cấp')));
     $this->add($this->form->text(array('label' => 'Điện thoại', 'name' => 'sup_phone', 'id' => 'sup_phone', 'value' => $this->f['sup_phone'])));
     $this->add($this->form->text(array('label' => 'Di động', 'name' => 'sup_mobile', 'id' => 'sup_mobile', 'value' => $this->f['sup_mobile'])));
     $this->add($this->form->text(array('label' => 'Fax', 'name' => 'sup_fax', 'id' => 'sup_fax', 'value' => $this->f['sup_fax'])));
     $this->add($this->form->text(array('label' => 'Email', 'name' => 'sup_email', 'id' => 'sup_email', 'value' => $this->f['sup_email'])));
     $this->add($this->form->text(array('label' => 'Website', 'name' => 'sup_website', 'id' => 'sup_website', 'value' => $this->f['sup_website'])));
 }
Ejemplo n.º 9
0
 function _loadFormEditRecord()
 {
     parent::_loadFormEditRecord();
     // TODO: Change the autogenerated stub
     $db_query = new db_query('SELECT * FROM customer_cat');
     $array_cus_cat = array('' => ' - Chọn nhóm khách hàng - ');
     while ($row = mysqli_fetch_assoc($db_query->result)) {
         $array_cus_cat[$row['cus_cat_id']] = $row['cus_cat_name'];
     }
     unset($db_query);
     $this->add($this->form->text(array('label' => 'Tên khách hàng', 'name' => 'cus_name', 'id' => 'cus_name', 'require' => 1, 'errorMsg' => 'Bạn chưa nhập tên khách hàng', 'value' => $this->f['cus_name'])));
     $this->add($this->form->text(array('label' => 'Địa chỉ', 'name' => 'cus_address', 'id' => 'cus_address', 'require' => 1, 'errorMsg' => 'Bạn chưa nhập địa chỉ khách hàng', 'value' => $this->f['cus_address'])));
     $this->add($this->form->text(array('label' => 'Điện thoại', 'name' => 'cus_phone', 'id' => 'cus_phone', 'value' => $this->f['cus_phone'])));
     $this->add($this->form->text(array('label' => 'Email', 'name' => 'cus_email', 'id' => 'cus_email', 'value' => $this->f['cus_email'])));
     $this->add($this->form->select(array('label' => 'Nhóm khách hàng', 'name' => 'cus_cat_id', 'id' => 'cus_cat_id', 'option' => $array_cus_cat, 'selected' => $this->f['cus_cat_id'])));
     $this->add($this->form->text(array('label' => 'Mã khách hàng tự nhập', 'name' => 'cus_code', 'id' => 'cus_code', 'value' => $this->f['cus_code'])));
     $this->add($this->form->textarea(array('label' => 'Ghi chú', 'name' => 'cus_note', 'id' => 'cus_note', 'value' => $this->f['cus_note'])));
     $this->add($this->form->ajaxUploadFile(array('label' => 'Ảnh đại diện', 'name' => 'cus_picture', 'id' => 'cus_picture', 'browse_id' => 'browse_img', 'viewer_id' => 'viewer_img', 'value' => get_picture_path($this->f['cus_picture']))));
 }
Ejemplo n.º 10
0
 function _loadFormEditRecord()
 {
     parent::_loadFormEditRecord();
     // TODO: Change the autogenerated stub
 }
Ejemplo n.º 11
0
 function _loadFormEditRecord()
 {
     parent::_loadFormEditRecord();
     // TODO: Change the autogenerated stub
     //kiểm tra quyền edit
     checkPermission('edit');
     global $cat_table;
     global $bg_table;
     global $id_field;
     $record_id = getValue('record_id', 'int', 'POST', 0);
     //lấy ra danh sách các cửa hàng
     $list_agencies = array('' => ' -- Chọn cửa hàng -- ');
     $db_agen = new db_query('SELECT * FROM ' . $cat_table);
     while ($row = mysqli_fetch_assoc($db_agen->result)) {
         $list_agencies[$row['age_id']] = $row['age_name'];
     }
     unset($db_agen);
     //lấy ra data cat id
     $db_data = new db_query('SELECT * FROM ' . $bg_table . ' WHERE ' . $id_field . ' = ' . $record_id . ' LIMIT 1');
     if ($row = mysqli_fetch_assoc($db_data->result)) {
         extract($row);
     } else {
         exit;
     }
     $this->add($this->form->text(array('label' => 'Tên quầy phục vụ', 'name' => 'sed_name', 'id' => 'sed_name', 'require' => 1, 'errorMsg' => 'Bạn chưa nhập tên quầy phục vụ', 'value' => $this->f['sed_name'])));
     $this->add($this->form->text(array('label' => 'Điện thoại', 'name' => 'sed_phone', 'id' => 'sed_phone', 'value' => $this->f['sed_phone'])));
     $this->add($this->form->select(array('label' => 'Cửa hàng', 'name' => 'sed_agency_id', 'id' => 'sed_agency_id', 'selected' => $this->f['sed_agency_id'], 'require' => 1, 'errorMsg' => 'Bạn chưa chọn cửa hàng', 'option' => $list_agencies)));
     $this->add($this->form->text(array('label' => 'Ghi chú', 'name' => 'sed_note', 'id' => 'sed_note', 'value' => $this->f['sed_note'])));
 }