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'])))); }
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']))); }
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']))); }
public function getAllCategories($parent_id = 0) { $list = []; $parent_id = intval($parent_id); foreach ($this->fields('id,name,icon,active,image,has_child')->where('parent_id', $parent_id)->get_all() as $item) { $item->icon = $this->icon_list[intval($item->icon)]; $item->image = get_picture_path($item->image); if ($item->has_child) { $item->child = $this->getAllCategories($item->id); } else { $item->child = []; } $list[] = $item; } return $list; }
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'])))); }
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']))); }
function prepare_hoidap_record(&$row_news, $type_image = 'mobile') { if (isset($row_news['que_title']) && $row_news['que_title']) { $row_news['que_title'] = htmlspecialbo($row_news['que_title']); } if (isset($row_news['que_image']) && $row_news['que_image']) { $row_news['que_image_low'] = get_picture_path($row_news['que_image'], $type_image . '_low'); $row_news['que_image'] = get_picture_path($row_news['que_image'], $type_image); } if (isset($row_news['que_question_content']) && $row_news['que_question_content']) { $row_news['full_question_content'] = $row_news['que_question_content']; $row_news['que_question_content'] = removeHTML($row_news['que_question_content']); $row_news['que_question_content'] = cut_string($row_news['que_question_content'], 50); } if (isset($row_news['que_date']) && $row_news['que_date']) { $row_news['post_time'] = date('d/m/Y | H:i', $row_news['que_date']); } $row_news['link_detail'] = generate_hoidap_detail($row_news); return $row_news; }
function _loadFormEditCategory() { parent::_loadFormEditCategory(); // TODO: Change the autogenerated stub //kiểm tra quyền edit checkPermission('edit'); global $cat_table; //lấy ra cat_id cần chỉnh sửa $cat_id = getValue('cat_id', 'int', 'POST', 0); //lấy ra data cat id $db_data = new db_query('SELECT * FROM ' . $cat_table . ' WHERE age_id = ' . $cat_id . ' LIMIT 1'); if ($row = mysqli_fetch_assoc($db_data->result)) { extract($row); } else { exit; } $this->add($this->form->text(array('label' => 'Nhập tên', 'name' => 'age_name', 'id' => 'age_name', 'require' => 1, 'errorMsg' => 'Bạn chưa nhập tên nhóm khách hàng', 'value' => $this->f['age_name']))); $this->add($this->form->text(array('label' => 'Địa chỉ', 'name' => 'age_address', 'id' => 'age_address', 'value' => $this->f['age_address']))); $this->add($this->form->text(array('label' => 'Điện thoại', 'name' => 'age_phone', 'id' => 'age_phone', 'value' => $this->f['age_phone']))); $this->add($this->form->ajaxUploadFile(array('label' => 'Ảnh đại diện', 'name' => 'age_image', 'id' => 'age_image', 'browse_id' => 'browse_img', 'viewer_id' => 'viewer_img', 'value' => get_picture_path($this->f['age_image'])))); $this->add($this->form->textarea(array('label' => 'Ghi chú', 'name' => 'age_note', 'id' => 'age_note', 'value' => $this->f['age_note']))); }
} } //lấy dữ liệu record cần sửa đổi $db_data = new db_query("SELECT * FROM " . $bg_table . " WHERE " . $id_field . " = " . $record_id); if ($row = mysqli_fetch_assoc($db_data->result)) { foreach ($row as $key => $value) { ${$key} = $value; } } else { exit; } #Phần hiển thị $rainTpl = new RainTPL(); $rainTpl->assign('load_header', $load_header); $rainTpl->assign('module_name', $module_name); $rainTpl->assign('error_msg', print_error_msg($bg_errorMsg)); $html_page = ''; $form = new form(); $html_page .= $form->form_open(); $html_page .= $form->textnote('Các trường có dấu (<span class="form-asterick">*</span>) là bắt buộc nhập'); /** * something here */ $html_page .= $form->text(array('label' => 'Tiêu đề tin', 'name' => 'new_title', 'id' => 'new_title', 'require' => 1, 'errorMsg' => 'Bạn chưa nhập tiêu đề tin', 'value' => getValue('new_title', 'str', 'POST', $new_title))); $html_page .= $form->ajaxUploadFile(array('label' => 'Ảnh đại diện', 'name' => 'new_picture', 'id' => 'new_picture', 'browse_id' => 'btn_picture', 'viewer_id' => 'viewer_picture', 'value' => get_picture_path($new_picture))); $html_page .= $form->checkbox(array('name' => 'new_active', 'id' => 'new_active', 'label' => 'Active', 'value' => 1, 'currentValue' => $new_active)); $html_page .= $form->form_redirect(); $html_page .= $form->form_action(array('label' => array('Cập nhật', 'Nhập lại'), 'type' => array('submit', 'reset'))); $html_page .= $form->form_close(); $rainTpl->assign('html_page', $html_page); $rainTpl->draw('add');
$list->add('sec_type', 'Loại', 'array', 1, 0); $list->add('sec_body_system', 'Hệ cơ quan', 'array', 1, 0); $list->add('', 'Mô tả'); $list->add('', 'Edit', 'edit'); $list->add('', 'Delete', 'delete'); $db_count = new db_count('SELECT count(*) as count FROM ' . $bg_table . ' WHERE 1 ' . $list->sqlSearch() . ' '); $total = $db_count->total; unset($db_count); $db_listing = new db_query('SELECT * FROM ' . $bg_table . ' WHERE 1 ' . $list->sqlSearch() . ' ORDER BY ' . $list->sqlSort() . ' ' . $id_field . ' DESC ' . $list->limit($total)); $total_row = mysqli_num_rows($db_listing->result); $table_header = $list->showHeader($total_row); $rainTpl->assign('table_header', $table_header); $table_footer = $list->showFooter(); $rainTpl->assign('table_footer', $table_footer); $table_listing = array(); $i = 0; while ($row = mysqli_fetch_assoc($db_listing->result)) { $i++; $row['sec_picture'] = get_picture_path($row['sec_picture'], 'small'); $array_td = array('<td class="center" width="150"><img src="' . $row['sec_picture'] . '" /></td>', '<td class="center">' . $row['sec_name'] . '</td>', '<td class="center">' . ($row['sec_parent_id'] ? $sec_parent_id[$row['sec_parent_id']] : '') . '</td>', '<td class="center">' . $array_type[$row['sec_type']] . '</td>', '<td class="center">' . ($row['sec_body_system'] ? $array_he_co_quan[$row['sec_body_system']] : '') . '</td>', '<td width="500">' . $row['sec_desc'] . '</td>', $list->showEdit($row[$id_field]), $list->showDelete($row[$id_field])); $table_listing[] = array('start_tr' => $list->start_tr($i, $row[$id_field]), 'end_tr' => $list->end_tr(), 'array_td' => $array_td); } $rainTpl->assign('table_listing', $table_listing); $rainTpl->draw('listing');
FROM questions STRAIGHT_JOIN categories ON cat_id = que_cat_id WHERE que_id = ' . $que_id . ' AND que_type = 0 AND que_status = 1'; $db_query = new db_query($sql); $detail_data = mysqli_fetch_assoc($db_query->result); unset($db_query); if (!$detail_data) { error_404_document(); } $detail_data['link_hoidap'] = generate_qaa_url(); $detail_data['link_cat'] = generate_qaa_url($detail_data); $detail_data['que_question_content'] = nl2br($detail_data['que_question_content']); $detail_data['que_title'] = htmlspecialbo($detail_data['que_title']); $datetime_facebook = $detail_data['que_date']; $detail_data['que_date'] = date('d/m/Y H:i', $detail_data['que_date']); $detail_data['que_image'] = get_picture_path($detail_data['que_image']); //phân tag ra thành link search if ($detail_data['que_tags']) { $detail_data['array_tag_search'] = array(); $array_tag = explode(',', $detail_data['que_tags']); $array_tag = array_slice($array_tag, 0, 6); foreach ($array_tag as $key => $value) { $detail_data['array_tag_search'][] = array('tag_link' => '#', 'tag_name' => $value); } } $detail_data['facebook_share_link'] = 'http://khang.vn' . generate_hoidap_detail($detail_data); $detail_data['facebook_social'] = array(); $detail_data['facebook_social']['like'] = get_facebook_like_button($detail_data['facebook_share_link']); $detail_data['facebook_social']['comment'] = get_facebook_comment_frame($detail_data['facebook_share_link']); $detail_data['facebook_social']['embed'] = get_facebook_embedded_post($detail_data['facebook_share_link']); $rainTpl->assign('detail_data', $detail_data);
public function getImagePath() { return get_picture_path($this->name); }
$db_query = new db_query('SELECT * FROM law WHERE law_link_cat LIKE "' . $domain . '%" LIMIT 1'); $law_detail = mysqli_fetch_assoc($db_query->result); unset($db_query); if (!$law_detail) { break; } //lấy tin theo luật này $news_data = pre_cron_news_detail(array('lin_id' => 0, 'lin_url' => $url, 'lin_cat_id' => 0, 'law_detail_title' => $law_detail['law_detail_title'], 'law_detail_content' => $law_detail['law_detail_content'], 'law_detail_teaser' => $law_detail['law_detail_teaser'], 'law_detail_tag' => $law_detail['law_detail_tag'], 'law_detail_remove' => $law_detail['law_detail_remove']), 1); if (!$news_data['success']) { $return_json['success'] = 0; $return_json['error'] = $news_data['error']; } else { $return_json['success'] = 1; $return_json['title'] = $news_data['title']; $return_json['content'] = $news_data['content']; $return_json['teaser'] = $news_data['teaser']; $return_json['picture'] = $news_data['image']; $return_json['link_picture'] = get_picture_path($news_data['image']); } $return_json = json_encode($return_json); echo $return_json; break; case 'loadCatChild': $cat_id = getValue('value', 'int', 'POST', 0); $db = new db_query('SELECT * FROM cat_disease WHERE cdi_parent_id = ' . $cat_id); while ($row = mysqli_fetch_assoc($db->result)) { echo '<option value="' . $row['cdi_id'] . '">' . $row['cdi_name'] . '</option>'; } break; } exit;
if (isset($_GET['cus_id'])) { $cus_id = getValue('cus_id', 'int', 'GET', 0); $ten_ma = 'Mã KH'; $ten_nhom = 'Nhóm khách hàng'; $name_object = 'Tên khách hàng'; if ($cus_id == 0) { $name = 'Khách lẻ'; } if ($cus_id != 0) { $db_custemor = new db_query('SELECT * FROM customers INNER JOIN customer_cat ON customers.cus_cat_id = customer_cat.cus_cat_id WHERE cus_id = ' . intval($cus_id)); $data_cus = mysqli_fetch_assoc($db_custemor->result); unset($db_custemor); $id = format_codenumber($data_cus['cus_id'], 6, 'KH'); $avata = '<img src="' . get_picture_path($data_cus['cus_picture']) . '"/>'; $name = $data_cus['cus_name']; $address = $data_cus['cus_address']; $phone = $data_cus['cus_phone']; $email = $data_cus['cus_email']; $team_obj = $data_cus['cus_cat_name']; $note = $data_cus['cus_note']; } } if (isset($_GET['user_id'])) { $user_id = getValue('user_id', 'int', 'GET', 0); $ten_ma = 'Mã NV'; $ten_nhom = 'Nhóm nhân viên'; $name_object = 'Tên nhà cung cấp'; if ($user_id == 0) { $name = 'Không chọn nhân viên';
function prepare_pharma_record(&$ss) { if (isset($ss['pha_title']) && $ss['pha_title']) { $ss['pha_title'] = htmlspecialbo($ss['pha_title']); } if (isset($ss['pha_image']) && $ss['pha_image']) { $ss['pha_image'] = get_picture_path($ss['pha_image']); } $ss['link_detail'] = generate_tuthuoc_detail($ss); return $ss; }
$sql_value .= '"' . $value . '",'; } } } $sql = rtrim($sql, ',') . ')' . rtrim($sql_value, ',') . ')'; //insert vào database $db_insert = new db_execute($sql, 1, 0); //insert số lượng vào menu_products $sql_product = 'INSERT INTO menu_products (mep_menu_id, mep_product_id, mep_quantity) VALUES'; foreach ($data_menu['menu_products'] as $value) { $sql_product .= '(' . $value['mep_menu_id'] . ',' . $value['mep_product_id'] . ', ' . $value['mep_quantity'] . '),'; } $sql_product = rtrim($sql_product, ','); $db_insert = new db_execute($sql_product, 1, 0); unset($db_insert); $picture_path = get_picture_path($data_menu['men_image']); generate_dir_upload($data_menu['men_image'], 'organic'); @copy($domain_server_url . $data_menu['men_image_path'], '..' . $picture_path); $array_return = array('success' => 1, 'data' => $data_menu, 'step' => $record + 1); echo json_encode($array_return); } break; case 'desk': $curl = curl_get_content($api_download_url, array('action' => 'getListDesk', 'username' => $admin, 'password' => $password, 'agency' => $agency_id)); $data = json_decode($curl, 1); if (!isset($data['desk']) || !isset($data['section']) || !isset($data['service_desk'])) { http_response_code(404); die; } //insert dữ liệu //insert bảng service_desks và sections ở lần request đầu tiên
$list->add('', 'Ảnh danh mục'); $list->add('cat_name', 'Tên danh mục', 'string', 1, 0); $list->add('cat_title', 'Tiêu đề danh mục', 'string', 1, 0); $list->add('cat_type', 'Loại danh mục', 'string', 1, 0); $list->add('', 'Edit', 'edit'); $list->add('', 'Delete', 'delete'); $db_count = new db_count('SELECT count(*) as count FROM ' . $bg_table . ' WHERE 1 ' . $list->sqlSearch() . ' '); $total = $db_count->total; unset($db_count); $db_listing = new db_query('SELECT * FROM ' . $bg_table . ' WHERE 1 ' . $list->sqlSearch() . ' ORDER BY ' . $list->sqlSort() . ' ' . $id_field . ' DESC ' . $list->limit($total)); $total_row = mysqli_num_rows($db_listing->result); $table_header = $list->showHeader($total_row); $rainTpl->assign('table_header', $table_header); $table_footer = $list->showFooter(); $rainTpl->assign('table_footer', $table_footer); $table_listing = array(); $i = 0; while ($row = mysqli_fetch_assoc($db_listing->result)) { $i++; $array_td = array('<td><img src="' . get_picture_path($row['cat_picture']) . '" /></td>', '<td>' . $row['cat_name'] . '</td>', '<td>' . $row['cat_title'] . '</td>', '<td class="center">' . $cat_type[$row['cat_type']] . '</td>', $list->showEdit($row[$id_field]), $list->showDelete($row[$id_field])); $table_listing[] = array('start_tr' => $list->start_tr($i, $row[$id_field]), 'end_tr' => $list->end_tr(), 'array_td' => $array_td); } $rainTpl->assign('table_listing', $table_listing); $rainTpl->draw('listing');
$list->add('adv_position', 'Vị trí', 'array', 1, 0); $list->add('adv_link', 'Đường dẫn', 'string', 1, 0); $list->add('', 'Ảnh', 'string', 1, 0); $list->add('', 'Active', 'string', 0, 0); $list->add('', 'Edit', 'edit'); $list->add('', 'Delete', 'delete'); $db_count = new db_count('SELECT count(*) as count FROM ' . $bg_table . ' WHERE 1 ' . $list->sqlSearch() . ' '); $total = $db_count->total; unset($db_count); $db_listing = new db_query('SELECT * FROM ' . $bg_table . ' WHERE 1 ' . $list->sqlSearch() . ' ORDER BY ' . $list->sqlSort() . ' ' . $id_field . ' DESC ' . $list->limit($total)); $total_row = mysqli_num_rows($db_listing->result); $table_header = $list->showHeader($total_row); $rainTpl->assign('table_header', $table_header); $table_footer = $list->showFooter(); $rainTpl->assign('table_footer', $table_footer); $table_listing = array(); $i = 0; while ($row = mysqli_fetch_assoc($db_listing->result)) { $i++; $array_td = array('<td>' . $row['adv_name'] . '</td>', '<td>' . $array_position[$row['adv_position']] . '</td>', '<td>' . $row['adv_link'] . '</td>', '<td><img src="' . get_picture_path($row['adv_image'], 'small') . '"/></td>', $list->showCheckbox('adv_active', $row['adv_active'], $row[$id_field]), $list->showEdit($row[$id_field]), $list->showDelete($row[$id_field])); $table_listing[] = array('start_tr' => $list->start_tr($i, $row[$id_field]), 'end_tr' => $list->end_tr(), 'array_td' => $array_td); } $rainTpl->assign('table_listing', $table_listing); $rainTpl->draw('listing');
// lay ra ten kho $db_store = new db_query('SELECT cat_name FROM categories_multi WHERE cat_id = ' . $data_sup['bio_store_id']); $data_store = mysqli_fetch_assoc($db_store->result); unset($db_store); $store = $data_store['cat_name']; // lay ra ten nha cung cap $db_nhacc = new db_query('SELECT sup_image, sup_name FROM suppliers WHERE sup_id = ' . $data_sup['bio_supplier_id']); $data_nhacc = mysqli_fetch_assoc($db_nhacc->result); unset($db_nhacc); $nhacc = $data_nhacc['sup_name']; if ($data_nhacc['sup_image'] == '') { $avata = '<span class="ava-cus"><i class="fa fa-camera-retro fa-2x"></i></span><p>Không có hình</p>'; } else { $avata = '<img src="' . get_picture_path($data_nhacc['sup_image']) . '"/>'; } } $ngay_nhap = date('d-m-Y', $data_sup['bio_start_time']); $da_thanhtoan = $data_sup['bio_total_money'] - $data_sup['bio_money_debit']; if ($data_sup['bio_status'] == 0) { $thanhtoan = 'Còn nợ lại'; $con_lai = $data_sup['bio_money_debit']; $ngay_hen_tra = date("d-m-Y", $data_sup['bio_date_debit']); } else { $thanhtoan = 'Thanh toán đủ'; } ///// HTML $right_content .= '<div class="box-content-inf-bill">'; $right_content .= '<div class="box-content-inf-bill-left"><form method="" action="">'; $right_content .= '<p>Ngày nhập:</p><input name="" class="inp-cnkh text-right" readonly="readonly" value="' . $ngay_nhap . '"/>';
private function getArrayMenu($desk_id) { $sql_menu = 'SELECT *,uni_name AS men_unit FROM current_desk_menu LEFT JOIN menus ON men_id = cdm_menu_id LEFT JOIN units ON uni_id = men_unit_id WHERE cdm_desk_id = ' . $desk_id; $db_query = new db_query($sql_menu); $array_data = array(); while ($row = mysqli_fetch_assoc($db_query->result)) { $row['men_image'] = $row['men_image'] ? get_picture_path($row['men_image']) : ''; $array_data[] = $row; } return $array_data; }
<?php require_once '../home/config.php'; require_once '../classes/CurlClient.php'; require_once '../classes/MyLog.php'; $db_query = new db_query('SELECT * FROM news LEFT JOIN news_detail ON new_id = ndt_id WHERE new_uploaded = 0 LIMIT 1'); $news_data = mysqli_fetch_assoc($db_query->result); if (!$news_data) { reload(3600 * 8); die('Hết tin để lấy'); } $news_data['data_picture'] = '@' . $_SERVER['DOCUMENT_ROOT'] . get_picture_path($news_data['new_picture']); $CurlClient = new CurlClient(10); $username = '******'; $password = '******'; $url_post = 'http://khang.vn/cron/get_news_local.php'; $CurlClient->setAuthenDigest($username, $password); $response = $CurlClient->post($url_post, $news_data); if ($response) { echo 'Up thành công tin ' . $response; //update tin đã upload thành công $db_ex = new db_execute('UPDATE news SET new_uploaded = 1 WHERE new_id = ' . $news_data['new_id']); } else { echo 'Lỗi'; } reload(3);
//khai báo các biến hiển thị $res_name = ''; $res_address = ''; $res_phone = ''; $start_time = ''; $location = ''; $admin_name = ''; $pay_money = 0; $total = 0; $res_logo = ''; $bill_id = ''; $customer_name = 'Khách lẻ'; // thong tin nha hang $res_name = $configuration['con_restaurant_name']; $res_address = $configuration['con_restaurant_address']; $res_logo = get_picture_path($configuration['con_restaurant_image']); $res_phone = $configuration['con_restaurant_phone']; unset($db_query_res); // query thông tin bàn ăn $db_query_desk = new db_query('SELECT * FROM current_desk WHERE cud_desk_id = ' . $desk_id . ''); $row_desk = mysqli_fetch_assoc($db_query_desk->result); $start_time = date(' h:i d/m/Y', $row_desk['cud_start_time']); $desk_discount = $row_desk['cud_customer_discount']; $desk_vat = $row_desk['cud_vat']; $desk_extra = $row_desk['cud_extra_fee']; $customer_id = $row_desk['cud_customer_id']; unset($db_query_desk); //lấy ra tên khách hàng $db_customer = new db_query('SELECT cus_name FROM customers WHERE cus_id = ' . $customer_id . ''); $row_customer = mysqli_fetch_assoc($db_customer->result); $customer_name = $row_customer['cus_name'];
if ($isAdmin) { $sql_configuration = 'SELECT * FROM configurations WHERE con_admin_id = ' . $admin_id . ' LIMIT 1'; } else { $sql_configuration = 'SELECT * FROM configurations LEFT JOIN admin_users ON adm_id WHERE con_admin_id = ' . $user_config . ' LIMIT 1'; } // lấy ra các trường trong bảng configuration $db_query_con = new db_query($sql_configuration); $row_con = mysqli_fetch_assoc($db_query_con->result); // gán dữ liệu vào các biến $con_restaurant_name = $row_con['con_restaurant_name']; $con_restaurant_address = $row_con['con_restaurant_address']; $con_restaurant_phone = $row_con['con_restaurant_phone']; $con_restaurant_image = get_picture_path($row_con['con_restaurant_image']); $con_default_svdesk = $row_con['con_default_svdesk']; $con_default_store = $row_con['con_default_store']; $con_default_agency = $row_con['con_default_agency']; unset($db_query_con); //lấy ra quầy phục vụ mà đã được cấu hình chọn và selected $db_query = new db_query('SELECT * FROM service_desks LEFT JOIN agencies ON sed_agency_id = age_id WHERE sed_agency_id = ' . $con_default_agency . ''); while ($row = mysqli_fetch_assoc($db_query->result)) { if ($con_default_svdesk == $row['sed_id']) { $selected_check = 'selected="selected"'; } else { $selected_check = ''; } $array_option_desk .= '<option value="' . $row['sed_id'] . '" ' . $selected_check . '>' . $row['age_name'] . ' - ' . $row['sed_name'] . '</option>';
* something here */ $html_page .= $form->text(array('label' => 'Tên thuốc', 'name' => 'pha_name', 'id' => 'pha_name', 'value' => $pha_name, 'require' => 1, 'errorMsg' => 'Bạn chưa nhập tên thuốc', 'placeholder' => 'tên thuốc', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->text(array('label' => 'Tiêu đề thuốc', 'name' => 'pha_title', 'id' => 'pha_title', 'value' => $pha_title, 'require' => 1, 'errorMsg' => 'Bạn chưa nhập tiêu đề thuốc', 'placeholder' => 'tiêu đề thuốc', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->textarea(array('label' => 'Mô tả', 'name' => 'pha_description', 'id' => 'pha_description', 'value' => $pha_description, 'require' => 0, 'placeholder' => 'Mô tả thuốc', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->textarea(array('label' => 'Nội dung', 'name' => 'pha_content', 'id' => 'pha_content', 'value' => $pha_content, 'require' => 0, 'placeholder' => 'Nội dung thuốc', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->text(array('label' => 'Mã đăng ký', 'name' => 'pha_so_dang_ky', 'id' => 'pha_so_dang_ky', 'value' => $pha_so_dang_ky, 'require' => 1, 'placeholder' => 'Mã đăng ký', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->text(array('label' => 'Dạng bào chế', 'name' => 'pha_dang_bao_che', 'id' => 'pha_dang_bao_che', 'value' => $pha_dang_bao_che, 'require' => 1, 'placeholder' => 'Dạng bào chế', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->text(array('label' => 'Đóng gói', 'name' => 'pha_dong_goi', 'id' => 'pha_dong_goi', 'value' => $pha_dong_goi, 'require' => 0, 'placeholder' => 'Pha đóng gói', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->text(array('label' => 'Giá bán buôn', 'name' => 'pha_gia_buon', 'id' => 'pha_gia_buon', 'value' => $pha_gia_buon, 'require' => 0, 'placeholder' => '', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->text(array('label' => 'Giá bán lẻ', 'name' => 'pha_gia_le', 'id' => 'pha_gia_le', 'value' => $pha_gia_le, 'require' => 0, 'placeholder' => '', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->text(array('label' => 'Nhà sản xuất', 'name' => 'pha_nha_sx_name', 'id' => 'pha_nha_sx_name', 'value' => $pha_nha_sx_name, 'require' => 0, 'placeholder' => '', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->text(array('label' => 'Nhà đăng ký', 'name' => 'pha_nha_dk_name', 'id' => 'pha_nha_dk_name', 'value' => $pha_nha_dk_name, 'require' => 0, 'placeholder' => '', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->text(array('label' => 'Nhóm dược lý', 'name' => 'pha_nhom_duoc_ly', 'id' => 'pha_nhom_duoc_ly', 'value' => $check_name_ndl, 'require' => 1, 'placeholder' => '', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->textarea(array('label' => 'Thành phần', 'name' => 'pha_thanh_phan', 'id' => 'pha_thanh_phan', 'value' => $pha_thanh_phan, 'require' => 1, 'placeholder' => '', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->text(array('label' => 'Hàm lượng', 'name' => 'pha_ham_luong', 'id' => 'pha_ham_luong', 'value' => $pha_ham_luong, 'require' => 0, 'placeholder' => '', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->textarea(array('label' => 'Chỉ định', 'name' => 'pha_chi_dinh', 'id' => 'pha_chi_dinh', 'value' => $pha_chi_dinh, 'require' => 1, 'placeholder' => '', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->textarea(array('label' => 'Chống chỉ định', 'name' => 'pha_chong_chi_dinh', 'id' => 'pha_chong_chi_dinh', 'value' => $pha_chong_chi_dinh, 'require' => 0, 'placeholder' => '', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->textarea(array('label' => 'Tương tác thuốc', 'name' => 'pha_tuong_tac_thuoc', 'id' => 'pha_tuong_tac_thuoc', 'value' => $pha_tuong_tac_thuoc, 'require' => 0, 'placeholder' => '', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->textarea(array('label' => 'Tác dụng phụ', 'name' => 'pha_tac_dung_phu', 'id' => 'pha_tac_dung_phu', 'value' => $pha_tac_dung_phu, 'require' => 0, 'placeholder' => '', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->textarea(array('label' => 'Chú ý đề phòng', 'name' => 'pha_chu_y_de_phong', 'id' => 'pha_chu_y_de_phong', 'value' => $pha_chu_y_de_phong, 'require' => 0, 'placeholder' => '', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->textarea(array('label' => 'Liều lượng', 'name' => 'pha_lieu_luong', 'id' => 'pha_lieu_luong', 'value' => $pha_lieu_luong, 'require' => 0, 'placeholder' => '', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->textarea(array('label' => 'Bảo quản', 'name' => 'pha_bao_quan', 'id' => 'pha_bao_quan', 'value' => $pha_bao_quan, 'require' => 0, 'placeholder' => '', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->ajaxUploadFile(array('label' => 'Ảnh sản phẩm', 'name' => 'pha_image', 'id' => 'pha_image', 'browse_id' => 'btn_picture', 'viewer_id' => 'viewer_picture', 'value' => get_picture_path($pha_image))); $html_page .= $form->text(array('label' => 'Tag', 'name' => 'pha_tag', 'id' => 'pha_tag', 'value' => '', 'require' => 0, 'placeholder' => '', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= file_get_contents('script.html'); $html_page .= $form->form_redirect(); $html_page .= $form->form_action(array('label' => array('Cập nhật', 'Nhập lại'), 'type' => array('submit', 'reset'))); $html_page .= $form->form_close(); $rainTpl->assign('html_page', $html_page); $rainTpl->draw('add');
<?php $list_hoidap = array(); $db_query = new db_query('SELECT que_id,que_title, que_image, que_date,cat_name,que_question_content FROM questions LEFT JOIN categories ON cat_id = que_cat_id WHERE que_date <= ' . TIMESTAMP . ' AND que_type = 0 AND que_status = 1 AND que_cat_id = ' . $cat_id . ' ORDER BY que_date DESC LIMIT ' . $limit_start . ',' . $limit_size); while ($row = mysqli_fetch_assoc($db_query->result)) { $cat_name = $row['cat_name']; $row['cat_name'] = $row['cat_name'] ? $row['cat_name'] : 'Tư vấn'; $row['link_detail'] = generate_hoidap_detail($row); $row['que_title'] = htmlspecialbo($row['que_title']); $row['que_date_str'] = getDateTime(1, 1, 1, 1, '', $row['que_date']); $row['que_date'] = date('d/m/Y H:i', $row['que_date']); $row['que_image'] = $row['que_image'] ? get_picture_path($row['que_image'], 'small') : ''; $list_hoidap[] = $row; } if (!$list_hoidap && $iPage > 1) { redirect(generate_qaa_url(array('cat_id' => $cat_id, 'cat_name' => $cat_name)), 1); } $rainTpl->assign('list_hoidap', $list_hoidap);
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'])))); }
if (!$check_i) { //tin hot mục sức khỏe không có tin mới trong khoảng thời gian MIN_TIME_NEWS_HOT hoặc chưa thỏa mãn MIN_NEWS_VIEW $db_news_tsk_hot = new db_query('SELECT new_id, new_title, new_picture FROM news WHERE new_active = 1 AND new_cat_id = ' . $cat_tsk['cat_id'] . ' ORDER BY new_view DESC LIMIT 3'); while ($row = mysqli_fetch_assoc($db_news_tsk_hot->result)) { $check_i++; $row['new_title'] = htmlspecialbo($row['new_title']); $row['cat_name'] = $cat_tsk['cat_name']; $row['link_detail'] = generate_news_detail_url($row); $row['new_picture'] = get_picture_path($row['new_picture'], 'medium'); $list_news_tsk['array_news'][] = $row; } } shuffle($list_news_category); array_pop($list_news_category); $rainTpl->assign('list_news_category', $list_news_category); $rainTpl->assign('list_news_tsk', $list_news_tsk); //list câu hỏi và bệnh khối hỏi đáp bên phải $list_qaa_sidebar = get_qaa_listing_sidebar(); $rainTpl->assign('list_qaa_sidebar', $list_qaa_sidebar); //khối sơ đồ cơ thể $anatomy_sex = get_cookie_anatomy_sex(); $anatomy_sex_str = getValue('anatomy-sex', 'str', 'COOKIE', 'male', 3); $sex_male_active = $anatomy_sex == DOITUONG_NAMGIOI ? 'color-base' : 'text-muted'; $sex_female_active = $anatomy_sex == DOITUONG_NUGIOI ? 'color-base' : 'text-muted';
$list_section['sec_desc'] = $sec_desc; while ($row = mysqli_fetch_assoc($db_query->result)) { $row['link_detail'] = generate_section_detail($row); $list_section['sec_child'][] = $row; } unset($db_query); } } else { //neu khong co section $db_query = new db_query('SELECT * FROM sections WHERE sec_parent_id = 0 LIMIT 1'); if ($row = mysqli_fetch_assoc($db_query->result)) { $list_section['sec_id'] = $row['sec_id']; $list_section['sec_name'] = $row['sec_name']; $sec_name = $row['sec_name']; $sec_desc = $row['sec_desc']; $sec_picture = get_picture_path($row['sec_picture']); $list_section['link_detail'] = generate_section_detail($list_section); $list_section['sec_child'] = array(); $db_child = new db_query('SELECT * FROM sections WHERE sec_parent_id = ' . $row['sec_id']); while ($row_child = mysqli_fetch_assoc($db_child->result)) { $row_child['link_detail'] = generate_section_detail($row_child); $list_section['sec_child'][] = $row_child; } } unset($db_query); } $rainTpl->assign('section_exits', $section_exist); if ($section_exist) { $rainTpl->assign('is_section_child', $is_section_child); } $sec_id = $sec_id ? $sec_id : $list_section['sec_id'];
$status = 'bio_status'; $name_key = 'sup_name'; $totalmoney = 'bio_money_debit'; $image = 'sup_image'; } $db_bill_debit = new db_query('SELECT * FROM ' . $tabel . ' ' . $left_join . ' WHERE ' . $id_column . ' AND ' . $status . ' = 0'); $number_bill = mysqli_num_rows($db_bill_debit->result); while ($data_bill_debit = mysqli_fetch_assoc($db_bill_debit->result)) { $name = $data_bill_debit[$name_key]; $total_debit += $data_bill_debit[$totalmoney]; if ($data_bill_debit[$image] == '') { $avatar = $avatars; } else { $avatar = '<img src="' . get_picture_path($data_bill_debit[$image]) . '"/>'; } } $total_money = '<span class="total_money" data-total_money="' . $total_debit . '">' . number_format($total_debit) . '</span>'; $rainTpl = new RainTPL(); add_more_css('pay_debit.css', $load_header); $rainTpl->assign('load_header', $load_header); $rainTpl->assign('name_object', $name_object); $rainTpl->assign('name', $name); $rainTpl->assign('id', $id); $rainTpl->assign('record_id', $record_id); $rainTpl->assign('type', $type); $rainTpl->assign('avatar', $avatar); $rainTpl->assign('number_bill', $number_bill); $rainTpl->assign('total_debit', $total_debit); $rainTpl->assign('total_money', $total_money);
$iPage = $iPage > 1 ? $iPage : 1; $limit_size = 12; $limit_start = isset($iPage) && $iPage ? intval(($iPage - 1) * $limit_size) : 0; if ($limit_start < 0) { $iPage = 1; $limit_start = 0; } $og_url = generate_mbox_url(); $og_description = 'Thuốc - Thuốc y dược - phục vụ 24/24'; $og_title = 'Thông tin thuốc và cách sử dụng'; $link_next_page = generate_mbox_url(array(), $iPage + 1); if ($iPage > 1) { $link_pre_page = generate_mbox_url(array(), $iPage - 1); } else { $link_pre_page = '#'; } $rainTpl->assign('iPage', $iPage); $rainTpl->assign('limit_size', $limit_size); $rainTpl->assign('limit_start', $limit_start); $rainTpl->assign('link_next_page', $link_next_page); $rainTpl->assign('link_pre_page', $link_pre_page); $page_title = t('Khang.vn - Trang thuốc, danh sách thuốc y dược | Trang ' . $iPage); $db_query_1 = new db_query("SELECT pha_id,pha_name, pha_image, pha_gia_le,cat_name\n FROM pharma,categories WHERE pha_cat_id = cat_id\n ORDER BY pha_id DESC LIMIT " . $limit_start . "," . $limit_size); while ($row = mysqli_fetch_assoc($db_query_1->result)) { $row['linkSeo'] = generate_tuthuoc_detail($row); $row['pha_image'] = get_picture_path($row['pha_image']); $list_new_thuoc[] = $row; } $count_new = count($list_new_thuoc); $rainTpl->assign('list_new_thuoc', $list_new_thuoc); $rainTpl->assign('count_new', $count_new);