function draw() { global $display; $this->beginForm(); $display->add('mode', "Thêm"); $display->add('msg', $this->showFormErrorMessages(1)); $display->add('user_name', Url::get('user_name', $this->a_row['user_name'])); $status_arr = array(0 => "Chưa KH", 1 => "Đã KH", 2 => "Vi phạm, không KH"); $display->add('status_option', EClassApi::getOption($status_arr, Url::get('status', $this->a_row['status']))); $display->add('sms_total', Url::get('sms_total', $this->a_row['sms_total'])); $display->add('note', Url::get('note', $this->a_row['note'])); $display->output('UserActiveAdd'); $this->endForm(); }
function draw() { global $display; $this->beginForm(); if (Url::get('cmd') == 'edit') { $display->add('mode', "Sửa"); } elseif (Url::get('cmd') == 'copy') { $display->add('mode', "Copy"); } else { $display->add('mode', "Thêm"); } $display->add('msg', $this->showFormErrorMessages(1)); $display->add('name', Url::get('name', $this->page['name'])); $display->add('title', Url::get('title', $this->page['title'])); $display->add('description', Url::get('description', $this->page['description'])); $display->add('option_layout', EClassApi::getOption($this->get_all_layouts(), Url::get('status', $this->page['layout']))); $display->output('edit'); $this->endForm(); }
function draw() { global $display; $re = DB::query('SELECT block.id, block.module_id, block.page_id, block.region, block.position,module.name FROM `block` INNER JOIN module ON module.id=module_id WHERE page_id=' . $_REQUEST['id'] . ' ORDER BY position'); $this->all_blocks = array(); if ($re) { while ($block = mysql_fetch_assoc($re)) { $this->all_blocks[$block['id']] = $block; } } if (file_exists($this->page['layout'])) { $this->layout_text = file_get_contents($this->page['layout']); } $this->get_regions(); $text = $this->layout_text . ($this->undefined_regions ? '<p><h1>Các module ngoài Layout</h1>[[|undefined_regions|]]</p>' : ''); $result = ''; while (($pos = strpos($text, '[[|')) !== false) { if ($pos2 = strpos($text, '|', $pos + 3)) { $var = substr($text, $pos + 3, $pos2 - $pos - 3); if (isset($this->regions[$var])) { $item = $this->regions[$var]; } if ($item) { $result .= substr($text, 0, $pos) . $item; $text = substr($text, $pos2 + 3, strlen($text) - $pos2 - 3); } else { $result .= substr($text, 0, $pos + 3); $text = substr($text, $pos + 3, strlen($text) - $pos - 3); } } else { $result .= substr($text, 0, $pos + 3); $text = substr($text, $pos + 3, strlen($text) - $pos - 3); } } $regions = $result . $text; $display->add('name', $this->page['name']); $display->add('id', $this->page['id']); $display->add('regions', $regions); $display->add('option_layout', EClassApi::getOption($this->get_all_layouts(), Url::get('status', $this->page['layout']))); $display->add('page_content', $this->page); $display->output('page_content'); }
function get_gallery_entry() { if (User::is_login()) { global $display; if ((User::have_permit(ADMIN_ITEM) || User::is_mod_cat()) && (int) Url::get('user_id', 0) && (int) Url::get('user_id', 0) != User::id()) { $user_id = (int) Url::get('user_id', 0); $display->add('user_id', $user_id); } else $user_id=User::id(); $search_value = ' user_id=' . $user_id . ' AND root_id=0 '; //search theo ngay thang nam //$year=(int)Url::get('year',date('Y')); $year = (int) Url::get('year', -1); //$mon= (int)Url::get('month',(int)date('m')); $mon = (int) Url::get('month', -1); $day = (int) Url::get('day', -1); if ($year == 0 )$year = -1; if ($mon == 0 )$mon = -1; if ($day == 0 )$day = -1; $created_time_from = 0; $created_time_to = 0; if ($year != -1) { if ($mon != -1) { if ($day != -1) { $created_time_from = mktime(0, 0, 0, $mon, $day, $year); $created_time_to = mktime(23, 59, 59, $mon, $day, $year); } else { $max_day = 31; if (in_array($mon, array(4, 6, 9, 11)) )$max_day = 30; elseif ($mon == 2) ($year % 4) ? $max_day = 28 : $max_day = 29; $created_time_from = mktime(0, 0, 0, $mon, 1, $year); $created_time_to = mktime(23, 59, 59, $mon, $max_day, $year); } } else { $created_time_from = mktime(0, 0, 0, 1, 1, $year); $created_time_to = mktime(23, 59, 59, 12, 31, $year); } } $y_arr = array(-1 => '-Lọc theo Năm-'); for ($i = 2008; $i <= date('Y'); $i++) { $y_arr[$i] = "---Năm $i-"; } $m_arr = array(-1 => '-Lọc theo Tháng-'); for ($i = 1; $i <= 12; $i++) { $m_arr[$i] = "---Tháng $i-"; } $d_arr = array(0 => '-Lọc theo Ngày-'); for ($i = 1; $i <= 31; $i++) { $d_arr[$i] = "---Ngày $i-"; } $display->add('option_year', EClassApi::getOption($y_arr, $year)); $display->add('option_month', EClassApi::getOption($m_arr, $mon)); $display->add('option_day', EClassApi::getOption($d_arr, $day)); if ($created_time_from) { $search_value .= ' AND time >= ' . $created_time_from; } if ($created_time_to) { $search_value .= ' AND time <= ' . $created_time_to; } $keywords = EClassApi::trimSpace(EClassApi::getParam('keywords')); $display->add('keywords', $keywords); if ($keywords) { $search_value .= ' AND des LIKE "%' . $keywords . '%" '; } $item_per_page = 20; $sql_count = 'SELECT count(*) AS total_img FROM item_image WHERE ' . $search_value; $total = DB::fetch($sql_count, 'total_img', 0); $paging = ''; $items = array(); $gallery_url = WEB_DIR . 'ajax.php' . Url::build_all(array('page_no')); if ($total) { $limit = ''; $paging = AjaxGalleryPaging($limit, $total, $item_per_page, 5, $gallery_url, 'gallery_content'); $sql = 'SELECT id, des, item_id, title, img_server, original_image_url, time FROM `item_image` WHERE ' . $search_value . ' ORDER BY id DESC ' . $limit; $re = DB::query($sql); if ($re) { while ($row = mysql_fetch_assoc($re)) { $row['image_url'] = $row['original_image_url']; $row['original_image_url'] = EClassApi::getImageThumb($row['original_image_url'], 100, 100, 0, $row['img_server']); $items[$row['id']] = $row; } } } $display->add('items', $items); $display->add('total', $total); $display->add('paging', $paging); $display->output('gallery_ajax_entry', false, 'Personal'); System::halt(); } else { echo "Bạn chưa đăng nhập hoặc đã thoát khỏi hệ thống - Hãy đăng nhập lại!"; } }