Exemple #1
0
 function piclens_gallery()
 {
     $item_id = EClassApi::getParam('item_id');
     $entry = '';
     if ($item_id) {
         $sql = 'select id, original_image_url, title, position from item_image where item_id = ' . intval($item_id) . ' ORDER BY position ';
         DB::query($sql);
         if (DB::num_rows()) {
             $entry = '';
             while ($rows = DB::fetch_row()) {
                 $rows['title'] = $rows['title'] ? $rows['title'] : "Image {$rows['position']}";
                 $rows['title'] = trim(XMLLib::_xml_encode_attribute($rows['title']));
                 if (ereg('/', $rows['original_image_url'])) {
                     $url = trim(XMLLib::_xml_encode_attribute("http://" . IMAGE_PATH . "{$rows['original_image_url']}"));
                 } else {
                     $url = trim(XMLLib::_xml_encode_attribute("http://" . IMAGE_PATH . "uploaded/items/{$rows['original_image_url']}"));
                 }
                 $entry .= "\n\t\t \t \t<item>\n\t\t \t \t\t\t<title>" . stripslashes($rows['title']) . "</title>\n\t\t\t\t\t\t<link>{$url}</link>\n\t\t\t\t\t\t<guid>Image {$rows['position']}</guid>\n\t\t\t\t\t\t<media:thumbnail url=\"{$url}\" />\n\t\t\t\t\t\t<media:content url=\"{$url}\" />\n\t\t\t\t</item>\n\t\t \t \t";
             }
             @header("Content-type: text/xml");
             echo "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n\t\t\t <rss version=\"2.0\" xmlns:media=\"http://search.yahoo.com/mrss\">\n\t\t\t <channel>\t\t\t\n\t\t\t <title>Enbac.com</title>\n\t\t\t <link>http://www.chonmon.vn/</link>\n\t\t\t <description>Enbac.com - </description>\n\t\t\t <logo url=\"style/images/logo.piclens.png\" />\n\t\t\t";
             echo $entry;
             echo "\n\t\t \t </channel>\n\t\t\t </rss>\n\t\t\t";
         } else {
             die("no_info");
         }
     } else {
         die("no_info");
     }
 }
Exemple #2
0
 function draw()
 {
     $this->beginForm();
     if (Url::get('cmd') == 'edit' && ($row = DB::select('bad_words', 'id=' . intval(EClassApi::getParam('id'))))) {
         $contents = $row['contents'];
         $reason = $row['reason'];
         $exact = $row['exact'];
         if ($row['is_phone'] == 1) {
             $contents = BadWord::filter_badword_show($contents);
         }
         $is_phone = $row['is_phone'];
     } else {
         $contents = '';
         $exact = '';
         $is_phone = '';
         $reason = '';
     }
     global $display;
     $display->add('msg', $this->showFormErrorMessages());
     $display->add('contents', $contents);
     $display->add('reason', $reason);
     $display->add('exact', $exact);
     $display->add('is_phone', $is_phone);
     $display->add('cmd', Url::get('cmd'));
     $display->output('edit');
     $this->endForm();
 }
Exemple #3
0
 function ManageSupport($row)
 {
     Module::Module($row);
     if (User::is_admin() || User::have_permit(support_all_perm)) {
         CGlobal::$website_title = 'Quản lý thư góp ý của khách hàng';
         switch (Url::get('cmd')) {
             case 'delete':
                 DB::query('DELETE FROM support WHERE id=' . EClassApi::getParam('id'));
                 Url::redirect_url(Url::build_all(array('chk_id', 'del_all', 'cmd', 'id')));
                 break;
             case "edit":
                 /*case "add":
                 		require_once 'forms/edit.php';		
                 		$this->add_form(new EditBadWordForm());
                 		break;*/
             /*case "add":
             		require_once 'forms/edit.php';		
             		$this->add_form(new EditBadWordForm());
             		break;*/
             default:
                 require_once 'forms/list.php';
                 $this->add_form(new ManageSupportForm());
                 break;
         }
     } else {
         Url::access_denied();
     }
 }
Exemple #4
0
 function playme()
 {
     $code = EClassApi::getParam('code');
     if (method_exists($this, $code)) {
         $this->{$code}();
     } else {
         $this->home();
     }
 }
Exemple #5
0
 function playme()
 {
     $code = EClassApi::getParam('code');
     switch ($code) {
         case 'search_more':
             $this->search_more();
             break;
         default:
             $this->search_more();
             break;
     }
 }
Exemple #6
0
 function playme()
 {
     $code = EClassApi::getParam('code');
     switch ($code) {
         case 'trans':
             $this->transaction();
             break;
         default:
             $this->home();
             break;
     }
 }
Exemple #7
0
 function playme()
 {
     $code = EClassApi::getParam('code');
     switch ($code) {
         case 'search':
             $this->searchProduct();
             break;
         case 'search_box_advance':
             $this->searchBoxAdvance();
             break;
         case 'init_overlay_product':
             $this->initOverlayProduct();
             break;
         case 'init_overlay_news':
             $this->initOverlayNews();
             break;
         case 'build_link_product':
             $this->buildLinkProduct();
             break;
         case 'build_related_product':
             $this->buildRelatedProduct();
             break;
         case 'build_link_news':
             $this->buildLinkNews();
             break;
         case 'make_link_product':
             $this->makeLinkProduct();
             break;
         case 'make_link_news':
             $this->makeLinkNews();
             break;
         case 'get_list_product_filter':
             $this->getListProductByFilter();
             break;
         case 'get_list_product_extra_field':
             $this->getListProductByCondOfExtraField();
             break;
         case 'get_list_district_by_city':
             $this->getListDistrictCity();
             break;
         case 'get_cate':
             $this->get_cate();
             break;
         case 'make_link':
             $this->make_link();
             break;
         default:
             $this->home();
             break;
     }
 }
Exemple #8
0
 function playme()
 {
     $code = EClassApi::getParam('code');
     switch ($code) {
         case 'home':
             $this->home();
             break;
         default:
             $this->home();
             break;
     }
     //$print->html = $skin->index();
     //$print->display();
 }
Exemple #9
0
 function playme()
 {
     $code = EClassApi::getParam('code');
     switch ($code) {
         case 'getDataForMap':
             $this->getDataForMap();
             break;
         case 'getDataForMapByLatLng':
             $this->getDataForMapByLatLng();
             break;
         default:
             $this->home();
             break;
     }
 }
Exemple #10
0
 function playme()
 {
     $code = EClassApi::getParam('code');
     switch ($code) {
         case 'piclens_gallery':
             $this->piclens_gallery();
             break;
         case 'flash_view_gallery':
             $this->flash_view_gallery();
             break;
         default:
             $this->home();
             break;
     }
 }
Exemple #11
0
 function playme()
 {
     $code = EClassApi::getParam('code');
     switch ($code) {
         case 'change_item':
             $this->change_item();
             break;
         case 'change_status':
             $this->change_status();
             break;
         default:
             $this->change_item();
             break;
     }
 }
Exemple #12
0
 function playme()
 {
     $code = EClassApi::getParam('code');
     switch ($code) {
         case 'show_more':
             $this->show_more();
             break;
         case 'show_detail':
             $this->show_detail();
             break;
         default:
             $this->show_more();
             break;
     }
 }
Exemple #13
0
 function playme()
 {
     $code = EClassApi::getParam('code');
     switch ($code) {
         case 'show_more_teacher':
             $this->show_more_teacher();
             break;
         case 'search_more':
             $this->search_more();
             break;
         case 'filter_more':
             $this->filter_more();
             break;
         default:
             $this->show_more();
             break;
     }
 }
Exemple #14
0
 function playme()
 {
     $code = EClassApi::getParam('code');
     switch ($code) {
         case 'check_lesson_teacher':
             $this->lessonTeacher();
             break;
         case 'choice_lesson_teacher':
             $this->choiceTeacher();
             break;
         case 'request_product':
             $this->requestProduct();
             break;
         case 'show_content':
             $this->show_content();
             break;
         default:
             $this->home();
             break;
     }
 }
Exemple #15
0
 function build_user_rss()
 {
     $user_id = (int) EClassApi::getParam('user_id');
     $user = User::getUser($user_id);
     if ($user) {
         $subDir = 'rss1/' . floor($user_id / 1000);
         //echo
         $user_id = $user['id'];
         $user['full_name'] != '' ? $user_name = trim(XMLLib::_xml_encode_attribute($user['full_name'])) : ($user_name = trim(XMLLib::_xml_encode_attribute($user['user_name'])));
         $cachefile = 'rss1_user_' . $user_id;
         header("content-type: text/xml");
         if (StaticCache::notExistCache($cachefile, 3600, false, $subDir)) {
             StaticCache::startCache();
             $user_name = "Tin &#273;&#259;ng c&#7911;a " . $user_name;
             $rss = $this->build_rss_cat(0, $user_name, 100, $user_id);
             echo $rss;
             StaticCache::endCache();
         }
     } else {
         REWRITE_ON ? header("Location:" . WEB_ROOT . "rss/") : header("Location:" . WEB_ROOT . "?page=rss");
     }
     System::halt();
 }
Exemple #16
0
 function on_submit()
 {
     if (User::id() != 0) {
         $uid = User::id();
         // Validate User
         if (empty($uid)) {
             if ($_COOKIE['lang'] == 1) {
                 $this->setErrorMessage('personal/change_password', 'Your account is locked, you can not perform this function!');
             } else {
                 $this->setErrorMessage('personal/change_password', 'Tài khoản của bạn hiện đang bị khóa, bạn không thể thực hiện chức năng này!');
             }
             Url::redirect_url('personal.html?cmd=manage_order');
             exit;
         }
         // Get Parameters
         $email = trim(strip_tags(Url::get('email')));
         $full_name = trim(strip_tags(Url::get('full_name')));
         $user_name = trim(strip_tags(Url::get('user_name')));
         // Get Default Address
         $default_address = trim(strip_tags(Url::get('default_address')));
         $default_city = trim(strip_tags(Url::get('default_city')));
         $default_district = trim(strip_tags(Url::get('default_district')));
         $this->setSuccessMessage('personal/form_data', array('email' => $email, 'full_name' => $full_name, 'user_name' => $user_name));
         // Check Parameters
         if (empty($email)) {
             if ($_COOKIE['lang'] == 1) {
                 $this->setErrorMessage('personal/change_password', 'Email address can not be empty');
             } else {
                 $this->setErrorMessage('personal/change_password', 'Địa chỉ email không được để trống');
             }
             Url::redirect_url('personal.html?cmd=manage_order');
             exit;
         }
         if (empty($full_name)) {
             if ($_COOKIE['lang'] == 1) {
                 $this->setErrorMessage('personal/change_password', 'Full name can not be empty');
             } else {
                 $this->setErrorMessage('personal/change_password', 'Tên đầy đủ không được để trống');
             }
             Url::redirect_url('personal.html?cmd=manage_order');
             exit;
         }
         if (empty($default_address)) {
             if ($_COOKIE['lang'] == 1) {
                 $this->setErrorMessage('personal/change_password', 'Address can not be empty');
             } else {
                 $this->setErrorMessage('personal/change_password', 'Địa chỉ không được để trống');
             }
             Url::redirect_url('personal.html?cmd=manage_order');
             exit;
         }
         $this->checkFormInput('Email', 'email', $email, 'email', true, '', 6, 50);
         if (DB::exists('SELECT id FROM `account` WHERE `email` LIKE "' . $email . '" AND id != ' . $uid)) {
             if ($_COOKIE['lang'] == 1) {
                 $this->setErrorMessage('personal/change_password', "Email you choose already exists, please choose a different email!");
             } else {
                 $this->setErrorMessage('personal/change_password', "Email bạn chọn đã tồn tại, hãy chọn lại một email khác!");
             }
             Url::redirect_url('personal.html?cmd=manage_order');
             exit;
         }
         if (DB::exists('SELECT id FROM `account` WHERE `user_name` LIKE "' . $user_name . '" AND id != ' . $uid)) {
             if ($_COOKIE['lang'] == 1) {
                 $this->setErrorMessage('personal/change_password', "Already have an account to use this phone number, please leave a phone number to use!");
             } else {
                 $this->setErrorMessage('personal/change_password', "Đã có tài khoản sử dụng số điện thoại này, hãy chọn lại một số điện thoại khác để sử dụng!");
             }
             Url::redirect_url('personal.html?cmd=manage_order');
             exit;
         }
         $new_row = array('full_name' => trim($full_name), 'user_name' => trim($user_name), 'email' => $email);
         $confirm_phone = trim(strip_tags(Url::get('confirm_phone')));
         $confirm_mail = trim(strip_tags(Url::get('confirm_mail')));
         if ($confirm_phone == '0000' || isset($_SESSION['uname_pin']) && $confirm_phone == $_SESSION['uname_pin']) {
             $check1 = true;
         } else {
             $check1 = false;
         }
         if ($confirm_mail == '0000' || isset($_SESSION['mail_pin']) && $confirm_mail == $_SESSION['mail_pin']) {
             $check2 = true;
         } else {
             $check2 = false;
         }
         $u = DB::select('account', 'id=' . $uid);
         if ($check1 && $check2) {
             if (isset($_SESSION['uname_pin']) && $confirm_phone == $_SESSION['uname_pin'] && (isset($_SESSION['mail_pin']) && $confirm_mail == $_SESSION['mail_pin'])) {
                 $row = array('uid' => $uid, 'old_user_name' => $u['user_name'], 'new_user_name' => $user_name, 'old_email' => $u['email'], 'new_email' => $email);
                 Log::insertLog($row, 'account');
             } elseif (isset($_SESSION['uname_pin']) && $confirm_phone == $_SESSION['uname_pin']) {
                 $row = array('uid' => $uid, 'old_user_name' => $u['user_name'], 'new_user_name' => $user_name);
                 Log::insertLog($row, 'account');
             } elseif (isset($_SESSION['mail_pin']) && $confirm_mail == $_SESSION['mail_pin']) {
                 $row = array('uid' => $uid, 'old_email' => $u['email'], 'new_email' => $email);
                 Log::insertLog($row, 'account');
             }
             PersonalDB::update_account_information($new_row);
             unset($_SESSION['uname_pin']);
             unset($_SESSION['mail_pin']);
             // Add Address
             $exists_address_id = PersonalDB::exists_address($uid, $default_address, $default_district);
             if (!$exists_address_id) {
                 $new_address = array('uid' => $uid, 'full_name' => $full_name, 'tel' => $user_name, 'address' => $default_address, 'did' => $default_district);
                 $exists_address_id = PersonalDB::add_address($new_address);
             }
             // Set Default Address
             PersonalDB::set_default_address($uid, $exists_address_id);
         } else {
             unset($new_row);
             if ($_COOKIE['lang'] == 1) {
                 $this->setErrorMessage('personal/change_password', 'You enter the confirmation code, please re-operation');
             } else {
                 $this->setErrorMessage('personal/change_password', 'Bạn nhập sai mã xác nhận, vui lòng thực hiện lại thao tác');
             }
             Url::redirect_url('personal.html?cmd=manage_order');
         }
         // Update Password
         $new_password = trim(strip_tags(EClassApi::getParam('new_password')));
         $confirm_password = trim(strip_tags(EClassApi::getParam('confirm_password')));
         if (!empty($new_password) && strlen($new_password) > 0 && !empty($confirm_password) && strlen($confirm_password) > 0) {
             if ($new_password == $confirm_password) {
                 $new_password = User::eat_encode_password($new_password, SALTAUTH);
                 if ($new_password) {
                     $new_row = array('password' => trim($new_password));
                     PersonalDB::update_account_information($new_row);
                 }
             } else {
                 if ($_COOKIE['lang'] == 1) {
                     $this->setErrorMessage('personal/change_password', 'Confirm password wrong');
                 } else {
                     $this->setErrorMessage('personal/change_password', 'Xác nhận mật khẩu sai');
                 }
                 Url::redirect_url('personal.html?cmd=manage_order');
                 exit;
             }
         }
         if ($_COOKIE['lang'] == 1) {
             $this->setSuccessMessage('personal/change_password', 'Your information has been changed');
         } else {
             $this->setSuccessMessage('personal/change_password', 'Thông tin của bạn đã được thay đổi');
         }
         Url::redirect_url('personal.html?cmd=manage_order');
     } else {
         if ($_COOKIE['lang'] == 1) {
             $this->setErrorMessage('user/login', 'You must login to access this area');
         } else {
             $this->setErrorMessage('user/login', 'Bạn phải đăng nhập trước khi truy cập khu vực này');
         }
         Url::redirect_url('home');
     }
 }
Exemple #17
0
 function add_edit_ban_ip()
 {
     if (!User::have_permit(ADMIN_ITEM)) {
         echo "no_perm";
         exit;
     }
     $user_name = User::user_name();
     $create_time = TIME_NOW;
     $ban_id = Url::get('ban_id', 0);
     $ban_ip = Url::get('ban_ip', 0);
     $ban_reason = EClassApi::getParam('ban_reason', "");
     if ($ban_ip) {
         $ban_ip = str_replace(' ', '', $ban_ip);
         $item_array = array('ip' => $ban_ip, 'reason' => $ban_reason, 'create_time' => $create_time, 'user_name' => $user_name);
         if (!$ban_id) {
             DB::insert('ban_ip', $item_array);
             $ban_id = mysql_insert_id();
         } else {
             DB::update('ban_ip', $item_array, 'id = ' . $ban_id);
         }
         $item_array += array('id' => $ban_id);
         $item_array['create_time'] = date('d/m - h:i', $item_array['create_time']);
         // cho mang vao memcache
         $sql = "SELECT * FROM ban_ip Order by id desc";
         $result = DB::query($sql);
         while ($row = mysql_fetch_assoc($result)) {
             $row['create_time'] = date('d/m - h:i', $row['create_time']);
             $arr_mem_cache[$row['ip']] = $row;
         }
         eb_memcache::do_put('list_ban_ip', $arr_mem_cache);
         echo json_encode($item_array);
     } else {
         echo "not_ip";
     }
     exit;
 }
Exemple #18
0
 function remove_mem()
 {
     if (!User::is_login()) {
         echo "not_login";
         exit;
     }
     if (User::is_block()) {
         echo "no_permission";
         exit;
     }
     if (User::have_permit(ADMIN_ITEM)) {
         $item_id = EClassApi::getParam('item_id');
         $id = "item:{$item_id}";
         eb_memcache::do_remove($id);
         echo "success";
     } else {
         die("no_permission");
     }
 }
Exemple #19
0
 function register_service_exten()
 {
     if (!User::is_login()) {
         echo "not_login";
         exit;
     }
     if (User::is_block()) {
         echo "no_permission";
         exit;
     }
     //get user
     $user = User::$current->data;
     $user_name = $user['user_name'];
     //Kieu thanh toan
     $payment_types = (int) Url::get('payment_types');
     //Thong tin gia han
     $order_service_id = (int) Url::get('order_service_id', 0);
     //id order service
     $time_exten = (int) Url::get('time_exten', 0);
     //thoi gian gia han (thang)
     $aryOrderService = array();
     if ($order_service_id) {
         $aryOrderService = DB::select("order_services", "id={$order_service_id}");
     }
     if ($aryOrderService) {
         //kiểm tra thông tin đầu vào
         if ($aryOrderService['user_use'] != $user_name) {
             echo "error";
             exit;
         }
         if ($aryOrderService['active'] != 1) {
             echo "error";
             exit;
         }
         $price = $aryOrderService['price'] / $aryOrderService['time_use'] * $time_exten;
     } else {
         echo "error";
         exit;
     }
     if ($payment_types == 1) {
         $full_name = Url::get("full_name");
         $mobile = Url::get("mobile");
         if (!$full_name || !$mobile) {
             echo "error";
             exit;
         }
         $price = $aryOrderService['price'] / $aryOrderService['time_use'] * $time_exten;
         $orderInfo = array("user_use" => $user_name, "type_scs" => $aryOrderService['type_scs'], "date_reg" => TIME_NOW, "up_count" => $aryOrderService['up_count'], "cpc_count" => $aryOrderService['cpc_count'], "item_count" => $aryOrderService['item_count'], "take_care" => $aryOrderService['take_care'], "price" => $price, "payment_types" => $payment_types, "time_use" => $time_exten, "active" => -4, "reg_exten_stt" => 1);
         //insert
         $id = DB::insert('order_services', $orderInfo);
         if ($id) {
             $order_code = "GH_{$order_service_id}_{$id}";
             $return_url = WEB_ROOT . "payment_scs.html?cmd=complete_exten&exten_order_id={$id}&payment_types=1&order_service_id={$order_service_id}&time_exten={$time_exten}";
             $transaction_info = "Thanh toán DV gia hạn Siêu Chăm Sóc {$aryOrderService['type_scs']} cho {$full_name} [ {$user['user_name']} ], số ĐT liên hệ: {$mobile}";
             $order_email = $user['email'];
             //insert payment_scs exten
             $pay_info = $full_name . "," . $user['email'] . "," . $mobile . "," . $aryOrderService['type_scs'];
             $paymentInfo = array("order_service_id" => $id, "user_id" => $user['id'], "user_name" => $user['user_name'], "payment_types" => $payment_types, "payment_type_soha" => 0, "payment_info" => $pay_info, "order_code" => $order_code, "price" => $price, "time" => time(), "error_text" => "Đang chờ thanh toán", "payment_status" => -1, "reg_exten_stt" => 1);
             //insert
             DB::insert('payment_scs', $paymentInfo);
             //Tạo link thanh toán đến Soha Payment
             /*note_soha #5*/
             require_once ROOT_PATH . "includes/sohapay/class_payment.php";
             $pg = new PG_checkout();
             $url = $pg->buildCheckoutUrl($return_url, $transaction_info, $order_code, $price, $order_email, $mobile);
             // $url= $soha->buildCheckoutUrl($return_url, $transaction_info, $order_code, $price, $order_email,$mobile);
             echo $url;
             exit;
         } else {
             echo "error_connect";
             exit;
         }
     } else {
         if ($payment_types == 2) {
             global $display;
             if ($aryOrderService) {
                 $orderInfo = array("user_use" => $user_name, "type_scs" => $aryOrderService['type_scs'], "date_reg" => TIME_NOW, "up_count" => $aryOrderService['up_count'], "cpc_count" => $aryOrderService['cpc_count'], "item_count" => $aryOrderService['item_count'], "take_care" => $aryOrderService['take_care'], "price" => $price, "payment_types" => $payment_types, "time_use" => $time_exten, "active" => -3, "reg_exten_stt" => 1);
                 //insert
                 $id = DB::insert('order_services', $orderInfo);
             }
             if ($id) {
                 $payment_info = "";
                 $full_name = EClassApi::getParam('ho_ten');
                 $dienthoai = EClassApi::getParam('dien_thoai');
                 $dia_chi = EClassApi::getParam('dia_chi');
                 $thanh_pho = EClassApi::getParam('thanh_pho');
                 $ngay = EClassApi::getParam('ngay');
                 $time = EClassApi::getParam('time');
                 $payment_info .= $full_name . "," . $dienthoai . "," . $dia_chi . "," . $thanh_pho . "," . $ngay . "," . $time;
                 //Send email here;
                 $display->add('eb_url', WEB_ROOT);
                 $display->add('user_id', $user['id']);
                 $display->add('user_name', $user['user_name']);
                 $display->add('full_name', $full_name);
                 $display->add('dia_chi', $dia_chi);
                 $display->add('thanh_pho', SohaPay::infoForUser($thanh_pho, 'tp'));
                 $display->add('ngay', $ngay);
                 $display->add('time', SohaPay::infoForUser($time, 'time'));
                 $display->add('service_name', $aryOrderService['type_scs']);
                 $display->add('price', number_format($price));
                 $display->add('time_exten', $time_exten);
                 $content_email = $display->output('payment_online_exten_2', 1, 'PaymentScs');
                 $send_mail_stt = "-1";
                 if (System::sendEBEmail($user['email'], '[ChọnMón.vn] Gia hạn thành công dịch vụ Siêu Chăm Sóc!', $content_email)) {
                     $send_mail_stt = "1";
                 }
                 //tao mang du lieu cho bang payment scs
                 $paymentInfo = array("order_service_id" => $id, "user_id" => $user['id'], "user_name" => $user['user_name'], "payment_types" => $payment_types, "payment_info" => $payment_info, "price" => $price, "payment_status" => 0, "send_mail_stt" => $send_mail_stt, "reg_exten_stt" => 1);
                 //insert
                 DB::insert('payment_scs', $paymentInfo);
                 $url = WEB_ROOT . "payment_scs.html?cmd=payment_finish&id={$id}&exten=1";
                 echo $url;
                 exit;
             }
         } else {
             if ($payment_types == 3) {
                 global $display;
                 if ($aryOrderService) {
                     $orderInfo = array("user_use" => $user_name, "type_scs" => $aryOrderService['type_scs'], "date_reg" => TIME_NOW, "up_count" => $aryOrderService['up_count'], "cpc_count" => $aryOrderService['cpc_count'], "item_count" => $aryOrderService['item_count'], "take_care" => $aryOrderService['take_care'], "price" => $price, "payment_types" => $payment_types, "time_use" => $time_exten, "active" => -3, "reg_exten_stt" => 1);
                     //insert
                     $id = DB::insert('order_services', $orderInfo);
                 }
                 if ($id) {
                     $payment_info = "";
                     if ($user['mobile_phone'] == "") {
                         $phone = $user['home_phone'];
                     } else {
                         $phone = $user['mobile_phone'];
                     }
                     $payment_info .= $user['email'] . "," . $phone;
                     //Send email here;
                     $display->add('eb_url', WEB_ROOT);
                     $display->add('user_id', $user['id']);
                     $display->add('user_name', $user['user_name']);
                     $display->add('service_name', $aryOrderService['type_scs']);
                     $display->add('price', number_format($price));
                     $display->add('time_exten', $time_exten);
                     $content_email = $display->output('payment_online_reg_3', 1, 'PaymentScs');
                     $send_mail_stt = "-1";
                     if (System::sendEBEmail($user['email'], '[ChọnMón.vn] Gia hạn thành công dịch vụ Siêu Chăm Sóc!', $content_email)) {
                         $send_mail_stt = "1";
                     }
                     //tao mang du lieu cho bang payment scs
                     $paymentInfo = array("order_service_id" => $id, "user_id" => $user['id'], "user_name" => $user['user_name'], "payment_types" => $payment_types, "payment_info" => $payment_info, "price" => $price, "payment_status" => 0, "send_mail_stt" => $send_mail_stt, "reg_exten_stt" => 1);
                     //insert
                     DB::insert('payment_scs', $paymentInfo);
                     $url = WEB_ROOT . "payment_scs.html?cmd=payment_finish&id={$id}&exten=1";
                     echo $url;
                     exit;
                 }
             } else {
                 if ($payment_types == 4) {
                     global $display;
                     if ($aryOrderService) {
                         $orderInfo = array("user_use" => $user_name, "type_scs" => $aryOrderService['type_scs'], "date_reg" => TIME_NOW, "up_count" => $aryOrderService['up_count'], "cpc_count" => $aryOrderService['cpc_count'], "item_count" => $aryOrderService['item_count'], "take_care" => $aryOrderService['take_care'], "price" => $price, "payment_types" => $payment_types, "time_use" => $time_exten, "active" => -3, "reg_exten_stt" => 1);
                         //insert
                         $id = DB::insert('order_services', $orderInfo);
                     }
                     if ($id) {
                         $banking_type = Url::get('banking_type');
                         $banking_code = SohaPay::listBankCode($banking_type);
                         $payment_info = "";
                         if ($user['mobile_phone'] == "") {
                             $phone = $user['home_phone'];
                         } else {
                             $phone = $user['mobile_phone'];
                         }
                         $payment_info .= $user['email'] . "," . $phone . "," . $banking_code;
                         //Send email here;
                         $display->add('eb_url', WEB_ROOT);
                         $display->add('user_id', $user['id']);
                         $display->add('user_name', $user['user_name']);
                         $display->add('service_name', $aryOrderService['type_scs']);
                         $display->add('price', number_format($price));
                         $display->add('banking_type', $banking_type);
                         $display->add('accNumber', SohaPay::listAccountNumber($banking_code));
                         $display->add('banking_name', SohaPay::listBanking($banking_code));
                         $display->add('banking_note', SohaPay::listBanking($banking_code, true));
                         $display->add('time_exten', $time_exten);
                         $content_email = $display->output('payment_online_reg_4', 1, 'PaymentScs');
                         $send_mail_stt = "-1";
                         if (System::sendEBEmail($user['email'], '[ChọnMón.vn] Gia hạn thành công dịch vụ Siêu Chăm Sóc!', $content_email)) {
                             $send_mail_stt = "1";
                         }
                         //tao mang du lieu cho ban payment scs
                         $paymentInfo = array("order_service_id" => $id, "user_id" => $user['id'], "user_name" => $user['user_name'], "payment_types" => $payment_types, "payment_info" => $payment_info, "price" => $price, "payment_status" => 0, "send_mail_stt" => $send_mail_stt, "reg_exten_stt" => 1);
                         //insert
                         DB::insert('payment_scs', $paymentInfo);
                         $url = WEB_ROOT . "payment_scs.html?cmd=payment_finish&id={$id}&exten=1";
                         echo $url;
                         exit;
                     }
                 }
             }
         }
     }
 }
Exemple #20
0
<?php

require_once '../../../core/config.php';
//System Config...
require_once '../../../core/Init.php';
//System Init...
require_once '../../../core/Util.php';
//System Init...
$user_name = trim(EClassApi::getParam('u'));
$full_name = strip_tags(trim(EClassApi::getParam('f', '')));
$password = trim(EClassApi::getParam('p'));
$mobile = strip_tags(trim(EClassApi::getParam('m')));
//if (!preg_match('/[A-Za-z0-9_]+$/', $user_name)) {
//    Util::requestToMobile(false, 9);
//}
if ($user_name == '') {
    Util::requestToMobile(false, 7);
}
if (strlen($user_name) < 6 || strlen($user_name) > 20) {
    Util::requestToMobile(false, 10);
}
if (strlen($password) < 6 || strlen($password) > 20) {
    Util::requestToMobile(false, 8);
}
if (substr($user_name, 0, 3) != 'fb_' && substr($user_name, 0, 3) != 'zm_') {
    if (!ctype_alnum($user_name)) {
        Util::requestToMobile(false, 9);
    }
}
if (DB::exists('SELECT id FROM `account` WHERE `user_name`="' . $user_name . '"')) {
    Util::requestToMobile(false, 12);
Exemple #21
0
    function flash_view()
    {
        $item_id = EClassApi::getParam('item_id');
        if (!$item_id) {
            die("no_info");
        }
        $html = <<<EOF
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Flash view mode - Enbac.com</title>
<script type="text/javascript" src="javascript/swfobject.js"></script>
<script>
function close_block() { 
  window.parent.jQuery.unblockUI();
}\t
</script>
 
<style type="text/css">\t
\t/* hide from ie on mac \\*/
\t* {
\t\tbackground-color: #000000;
\t\tmargin:0px;
\t\tpadding:0px;
\t}
\t
\thtml {
\t\theight: 100%;
\t\toverflow: hidden;
\t\ttext-align:center;
\t\tmargin:0px;
\t\tpadding:0px;
\t\tbackground-color: #000000;
\t}
\tdiv {
\t\tbackground-color: #000000;
\t\tmargin:0px;
\t\tpadding:0px;
\t\tcolor:#fff;
\t}
\t
\t#flashcontent {
\t\theight: 100%;
\t\tmargin:0px;
\t\tpadding:0px;\t\t
\t}
\t/* end hide */
\t
\tbody {
\t\theight: 100%;
\t\tmargin:0px;
\t\tpadding:0px;
\t\tbackground-color: #000000;
\t\tcolor:#ffffff;
\t\tfont-family:sans-serif;
\t\tfont-size:60;
\t\ttext-align:center;

\t}

\t.close{
\t\tfont-size:22px;
\t\ttext-align:right;
\t\tcursor: pointer;\t\t
\t}
\t#vwraper{
\t\ttext-align:center;\t
\t\theight: 100%;\t
\t} 
\ta {\t
\t\tcolor:#cccccc;
\t}
</style>
</head>
<body>
\t<div id="vwraper">
\t<div class="close" onclick="close_block();">[X] Đóng lại</div>
\t<div id="flashcontent">TiltViewer requires the latest Flash player. <a href="http://www.macromedia.com/go/getflashplayer/">Get Flash here.</a> If you have Flash installed, <a href="index.html?detectflash=false">click to view</a>.</div>
\t<script type="text/javascript">
\t\tvar fo = new SWFObject("includes/extra/TiltViewer.swf", "viewer", "100%", "100%", "9", "#000000");\t\t\t
\t\t
\t\t// TILTVIEWER-PRO CONFIGURATION OPTIONS
\t\t// To use these options, uncomment them by removing the '//' at the start of the line
\t\t// For a description of config options, go to: 
\t\t// http://www.airtightinteractive.com/projects/tiltviewer/pro/config_options.html
\t\t//
\t\t
\t\tfo.addVariable('useFlickr', 'false');
\t\tfo.addVariable('xmlURL', 'ebxml.php%3Fact%3Ditem%26code%3Dtiltviewer_gallery%26item_id%3D{$item_id}');
\t\tfo.addVariable('maxJPGSize','740');
\t\tfo.addVariable('columns', '5');
\t\tfo.addVariable('rows', '3');
\t\tfo.addVariable('linkLabel', "Xem chi tiết");
\t\tfo.addVariable('backColor', "0xDDDDDD");
\t\tfo.addVariable('frameWidth', "-5");
\t\tfo.addVariable('showLinkButton', "false");
\t\t
\t\t//fo.addVariable('showLinkButton', 'true');
\t\tfo.addVariable('zoomedInDistance', '1000');
\t\tfo.addVariable('zoomedOutDistance', '4000');
\t\t//fo.addVariable('fontName', 'Times');
\t\t//fo.addVariable('titleFontSize', '50');
\t\t//fo.addVariable('descriptionFontSize', '20');
\t\t//fo.addVariable('linkFontSize', '40');\t
\t\t//fo.addVariable('textColor', '0xff0000');
\t\t//fo.addVariable('linkTextColor', '0x00ff00');
\t\t//fo.addVariable('linkBkgndColor', '0x0000ff');\t\t
\t\t//fo.addVariable('frameColor', '0xff0000');
\t\t//fo.addVariable('bkgndInnerColor', '0xff00ff');
\t\t//fo.addVariable('bkgndOuterColor', '0x0000ff');\t\t
\t\t//
\t\t// END TILTVIEWER-PRO CONFIGURATION OPTIONS
\t\t
\t\tfo.addParam("allowFullScreen","true");
\t\tfo.addParam("enableSounds","false");
\t    fo.addParam('allowscriptaccess','always');
\t    fo.addParam('allowfullscreen','true');
\t\tfo.write("flashcontent");\t
\t</script>
\t</div>
</body>
</html>
EOF;
        echo $html;
        exit;
    }
Exemple #22
0
    function get_more_comment()
    {
        $parent_id = EClassApi::getParam('comment_id');
        $item_user_name = EClassApi::getParam('item_user_name');
        $item_id = EClassApi::getParam('item_id');
        $cat_id = EClassApi::getParam('cat_id');
        $guest_email = EClassApi::getParam('guest_email');
        $guest_name = EClassApi::getParam('guest_name');
        //$cur_id  		= EClassApi::getParam('cur_id',0);
        $cur_id = User::id();
        $item_user_id = EClassApi::getParam('user_id');
        $show_guest_email = User::have_cat_permit($cat_id) || User::id() == $item_user_id;
        $sql = 'SELECT `comment`.`id`, `time`, `content`, `item_id`, `sender_email`, `sender_user_name`, account.img_server, `receiver_user_name`,`sender_user_id`, `receiver_user_id`, `parent_id`, `have_child`, account.avatar_url, account.id as user_id, account.gids, account.block_time FROM `comment` LEFT JOIN `account` ON account.id=comment.sender_user_id
					WHERE `comment`.`parent_id` =' . $parent_id . ' AND `comment`.`display`=0 ORDER BY time DESC LIMIT 0,100';
        $re = DB::query($sql);
        $i = 0;
        $result = '';
        $str_user_id = '';
        while ($item = mysql_fetch_assoc($re)) {
            $item['index'] = $i;
            $i++;
            if ($item['block_time'] > TIME_NOW) {
                $item['is_block'] = 1;
            } else {
                $item['is_block'] = 0;
            }
            $str_user_id .= ($str_user_id != '' ? ',' : '') . $item['sender_user_id'];
            //set quyen quan tri
            if ($item['gids']) {
                $is_admin_mod = CGlobal::$group[User::check_admin($item['gids'])];
            } else {
                $is_admin_mod = array();
            }
            $item['is_admin_mod'] = $is_admin_mod;
            if (TIME_NOW - $item['time'] < 24 * 3600) {
                $time_left = TIME_NOW - $item['time'];
                $hour = floor($time_left / 3600);
                $day = '';
                $minute = floor($time_left % 3600 / 60) . ' phút';
                $time_left = ($hour ? $hour . ' giờ ' : '') . $minute;
                if ($time_left == 0) {
                    $time_left = 'Vài giây';
                }
                $item['created_time'] = $time_left . ' trước';
            } elseif (date('Y') != date('Y', $item['time'])) {
                $item['created_time'] = date('H:i | d.m.Y', $item['time']);
            } else {
                $item['created_time'] = date('H:i | d.m', $item['time']);
            }
            $item['content'] = EClassApi::parseBBCode($item['content']);
            if ($item['sender_user_id']) {
                $item['sender_link'] = Url::build('shop', array('user_name' => $item['sender_user_name']));
            } else {
                $item['sender_link'] = '';
            }
            $item['URL_badcontent'] = Url::build('item_detail', array('id' => Url::get('id'), 'ctype' => 'comment', 'id_comment' => $item['id']));
            $result .= '<tr id="' . $item['id'] . '"';
            $result .= ' onmouseover="show_hide_menu(' . $item['id'] . ')" onmouseout="show_hide_menu(' . $item['id'] . ')" ';
            $result .= '><td width="28" align="right" valign="top"><div style="height:5px"><span></span></div>';
            if ($item['sender_user_id'] == 0) {
                /*	if($item['id']%3 == 0){
                				$item['sender_avatar_url'] = 'style/avatar/1.png';//'style/images/eb_small.gif';
                			}
                			elseif($item['id']%3 == 1){
                				$item['sender_avatar_url'] = 'style/avatar/2.png';
                			}
                			else{
                				$item['sender_avatar_url'] = 'style/avatar/3.png';
                			}*/
                $item['sender_avatar_url'] = WEB_DIR . '_cache/eb_avatar/' . md5($item['sender_user_name']) . '.gif';
                $html_content = '';
                $result .= '<div class="feedbackAvatarSub" id="avatar_content_' . $item['user_id'] . '"><img src="' . $item['sender_avatar_url'] . '" width="40" height="40" /></div>';
            } else {
                if ($item['avatar_url']) {
                    $item['sender_avatar_url'] = EClassApi::getImageThumb($item['avatar_url'], 60, 0, 1, $item['img_server']);
                    if ($item['parent_id'] > 0) {
                        $html_content = '<a href="' . $item['sender_link'] . '"><img src="' . $item['sender_avatar_url'] . '" width="40"/></a>';
                    } else {
                        $html_content = '<a href="' . $item['sender_link'] . '"><img src="' . $item['sender_avatar_url'] . '" width="40"/></a>';
                    }
                } else {
                    $item['sender_avatar_url'] = WEB_DIR . '_cache/eb_avatar/' . md5($item['sender_user_name']) . '.gif';
                    /*if ($item['parent_id'] > 0){
                    			$html_content = '<a href="'.$item['sender_link'].'"><img src="style/avatar/2.png" width="40" height="40" /></a>';
                    		}else{
                    			$html_content = '<a href="'.$item['sender_link'].'"><img src="style/avatar/1.png" width="40" height="40" /></a>';
                    		}*/
                }
                $result .= '<div class="profile_load"  id="c' . $item['id'] . '" lang="' . $item['user_id'] . '"><div class="feedbackAvatarSub" ';
                $result .= ' id="avatar_content_' . $item['user_id'] . '"><div class="bubbleInfo" id="info_' . $item['id'] . '" lang="' . $item['user_id'] . '"><div class="commentAva trigger">' . $html_content . '</div><!-- BEGIN POPUP MENU --><div class="popup" style="text-align: left;"><div id="show_mini_profile_c' . $item['id'] . '" style="display:none;"></div><div id="hide_mini_profile_c' . $item['id'] . '"><div class="contentPop" style="background-color:#fff"><div style="margin:4px;"><div class="blastTopLeft"><div class="blastTopRight"><div class="blastTopbg"><span></span></div></div></div><div class="blast"><img src="style/images/ajax-loader4.gif" width="62" height="13" /></div><div class="blastBottomLeft"><div class="blastBottomRight"><div class="blastBottombg"><span></span></div></div></div></div></div></div></div><!--END POPUP MENU --></div></div></div>';
            }
            $result .= '</td><td valign="top"><div class="contentFeedback" align="left"><div ';
            if (isset($item['is_admin_mod']['id']) && ($item['is_admin_mod']['id'] == 9 || $item['is_admin_mod']['id'] == 1)) {
                $result .= ' class="topFeedback_admin" ';
            } elseif (isset($item['is_admin_mod']['id']) && ($item['is_admin_mod']['id'] == 2 || $item['is_admin_mod']['id'] == 3)) {
                $result .= ' class="topFeedback_mod" ';
            } elseif ($item['sender_user_name'] == $item_user_name) {
                $result .= ' class="topFeedbackSelf" ';
            } else {
                $result .= ' class="topFeedback"';
            }
            $result .= ' >';
            if ($item['sender_user_id'] == 0) {
                $result .= ' <span class="guest_name">' . $item['sender_user_name'];
                /*$result .= ($show_guest_email)?'<a href="mailto:'.$item['sender_email'].'" title="Gửi e-mail cho người dùng này!"><img src="style/images/comment_email/email.gif" border="0" width="15" height="11"/></a>':'';*/
                $result .= $show_guest_email ? '' : '';
                $result .= '</span>';
            } else {
                $result .= ' <a ';
                $result .= $item['is_block'] == 1 ? ' title="Đang bị khóa nick" ' : ' ';
                $result .= $item['is_admin_mod'] ? ' title="' . $item['is_admin_mod']['des'] . '" ' : ' ';
                $result .= '  href="' . WEB_DIR . $item['sender_user_name'] . '">';
                $result .= $item['is_block'] == 1 ? ' <s><i> ' : ' ';
                $result .= $item['sender_user_name'];
                $result .= $item['is_block'] == 1 ? ' </i></s> ' : ' ';
                $result .= '</a>';
            }
            $result .= ' <span class="fb_time">' . $item['created_time'] . '</span> ';
            $result .= '<div class="floatRight" style="margin-top:-12px; height:16px"><div id="show_menu_' . $item['id'] . '" style="display:none">';
            if ($item['user_id'] != $cur_id && $item['sender_user_id'] != 0) {
                $result .= ' <span class="send_pm_fb" onclick="fn_send_pm_fb(' . $item['user_id'] . ',\'' . $item['sender_user_name'] . '\');" id="' . $item['user_id'] . '-' . $item['sender_user_name'] . '" style="margin-left:5px"><a href="javascript: void(0)">gửi tin nhắn </a></span>|<span class="send_fb"><a href="' . WEB_DIR . ECRewrite::formatUrl('?page=shop&user_name=' . $item['sender_user_name'] . '&mode=comment') . '">viết lưu bút</a></span> ';
                if ($item && $item['sender_user_id'] == 0 && $cur_id == $item['receiver_user_id'] || User::have_permit(ADMIN_ITEM)) {
                    $result .= ' | ';
                }
            }
            if ($item && $item['sender_user_id'] == 0 && $cur_id == $item['receiver_user_id'] || User::have_permit(ADMIN_ITEM)) {
                $result .= '<span onclick="fn_click_del_comment_aj(' . $item['id'] . ',' . $item_id . ')" id="' . $item['id'] . '|' . $item_id . '"><a href="javascript:void()"><img src="style/images/icon_delete.gif" width="9" height="9" /></a></span>';
            }
            $result .= '</div></div><div style="clear:both"><span></span></div>';
            $result .= ' </div> <div align="center" id="mess_success_' . $item['id'] . '" style="display:none" class="mess_success"></div> <div class="detailFeedback" align="left"  style="width:92%; overflow:hidden">' . $item['content'] . '</div> ';
            if ($item['user_id'] != $cur_id) {
                $result .= '<div id="reply_' . $item['id'] . '" ><div  class="btn_fast_reply" onmouseout="if(this.className==\'btn_fast_reply_hover\')this.className=\'btn_fast_reply\'" onmouseover="if(this.className==\'btn_fast_reply\')this.className=\'btn_fast_reply_hover\'" style="float:right" onclick="show_box_reply(' . $item['id'] . ',' . $item['parent_id'] . ',\'' . $guest_name . '\',\'' . $guest_email . '\',\'' . $item['sender_user_name'] . '\',' . $item['sender_user_id'] . '); return true;">trả lời</div></div>';
                $result .= ' <div style="clear:right" id="box_reply_' . $item['id'] . '"></div>';
            }
            $result .= '</div></td></tr><tr id="space_' . $item['id'] . '"><td height="1" colspan="2"><div style="height:1px; margin:5px 0; background-color:#fff"><span></span></div></td></tr>';
            $result .= '</tr>';
        }
        echo $result;
        System::halt();
    }
Exemple #23
0
    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!";
        }
    }
Exemple #24
0
 function remove_favourite()
 {
     $json = array();
     if (!User::is_login()) {
         $json['msg'] = 'no_login';
         die(json_encode($json));
     }
     $uid = User::id();
     $fid = EClassApi::getParam('fid');
     DB::delete('account_food_favourites', 'uid=' . $uid . ' AND fid=' . $fid);
     // get count like of food
     $sql = 'SELECT count_like, rid FROM food_res WHERE id = ' . $fid . ' ORDER BY id DESC LIMIT 0, 1';
     $result = DB::query($sql);
     $row = mysql_fetch_assoc($result);
     mysql_free_result($result);
     $count_like = intval($row['count_like']) - 1;
     $update_row = array('count_like' => $count_like);
     DB::update_id('food_res', $update_row, $fid);
     if (MEMCACHE_ON) {
         eb_memcache::do_remove('list_favourites_' . $uid);
         eb_memcache::do_remove('supplier_food_' . $row['rid']);
         eb_memcache::do_remove('supplier_spec_food_' . $row['rid']);
     }
     $json['fid'] = $fid;
     $json['msg'] = 'success';
     die(json_encode($json));
 }
Exemple #25
0
 function draw()
 {
     global $display;
     $this->beginForm(false, 'post', false, Url::build_current());
     $item_per_page = 15;
     $sql_count = 'SELECT count(*) AS total_row FROM `order` o INNER JOIN account a ON o.uid = a.id';
     $list_orders = array();
     $paging = '';
     // Get Filter Parameters
     $order_code = EClassApi::getParam('order_code');
     $from_date = EClassApi::getParam('from_date');
     $fdo = $from_date;
     $uid = Url::get('id');
     $to_date = EClassApi::getParam('to_date');
     $tdo = $to_date;
     $rid = EClassApi::getParam('rid');
     $scope = EClassApi::getParam('scope');
     if (!empty($from_date)) {
         $from_date = SupplierHelper::get_time_stamp($from_date);
     }
     if (!empty($to_date)) {
         $to_date = SupplierHelper::get_time_stamp($to_date, 1);
     }
     $conditions = '';
     if (intval($uid) > 0) {
         if (strstr($conditions, 'WHERE')) {
             $conditions .= " AND o.uid = " . $uid;
         } else {
             $conditions .= " WHERE o.uid = " . $uid;
         }
     }
     if (!empty($order_code)) {
         if (strstr($conditions, 'WHERE')) {
             $conditions .= " AND order_code LIKE '" . $order_code . "%'";
         } else {
             $conditions .= " WHERE order_code LIKE '" . $order_code . "%'";
         }
     }
     if (!empty($from_date)) {
         if (strstr($conditions, 'WHERE')) {
             $conditions .= " AND time >= " . $from_date;
         } else {
             $conditions .= " WHERE time >= " . $from_date;
         }
     }
     if (!empty($to_date)) {
         if (strstr($conditions, 'WHERE')) {
             $conditions .= " AND time <= " . $to_date;
         } else {
             $conditions .= " WHERE time <= " . $to_date;
         }
     }
     if (strstr($conditions, 'WHERE')) {
         $conditions .= " AND o.status <> 0 ";
     } else {
         $conditions .= " WHERE o.status <> 0 ";
     }
     $sql_count .= $conditions . ' LIMIT 0, 1';
     $total_row = DB::fetch($sql_count, 'total_row', 0);
     if ($total_row) {
         $limit = '';
         require_once ROOT_PATH . 'core/ECPagging.php';
         $paging = ECPagging::pagingSE($limit, $total_row, $item_per_page, 10, 'page_no', true);
         $sql = 'SELECT p.name AS city_name, d.name AS district_name, s.name AS cod_name, o.*, a.user_name, a.id as account_id, a.email AS account_email FROM `order` o INNER JOIN account a ON o.uid = a.id LEFT JOIN cod s ON o.cod_id = s.id INNER JOIN district d ON o.ship_district = d.id INNER JOIN city p ON d.pid = p.id' . $conditions . ' ORDER BY id DESC ' . $limit;
         $res = DB::query($sql);
         $today = date('d/m/Y');
         if ($res) {
             while ($row = mysql_fetch_assoc($res)) {
                 $row['order_time'] = trim(date('d/m/Y', $row['time']));
                 if ($today == $row['order_time']) {
                     $row['order_time'] = date('H:i', $row['time']);
                 }
                 $row['total'] = EClassApi::numberFormat($row['total']);
                 $list_orders[] = $row;
             }
         }
         mysql_free_result($res);
     }
     $display->add('list_orders', $list_orders);
     $display->add('total_row', $total_row);
     $display->add('id', $uid);
     $display->add('order_code', $order_code);
     $display->add('from_date', $fdo);
     $display->add('to_date', $tdo);
     $display->add('rid', $rid);
     $display->add('scope', $scope);
     $display->add('paging', $paging);
     $display->output('list_order');
     $this->endForm();
 }
Exemple #26
0
<?php

//TuấnNK add (20080617_10h):
//Các xử lý cho ajax:
//echo basename($_SERVER['PHP_SELF']);
require_once 'core/Debug.php';
//System Debug...
require_once 'core/config.php';
//System Config...
require_once 'core/Init.php';
//System Init...
//System process & output for ajax request
$choice = array("index" => "index", "user" => "ajax_user", "item" => "ajax_item", "comment" => "ajax_comment", "search" => "ajax_search", "searchinfo" => "ajax_searchinfo", "misc" => "ajax_misc", "personal" => "ajax_personal", "log" => "ajax_log", "admin" => "ajax_admin", "news" => "ajax_news", "faq" => "ajax_faq", "customer" => "ajax_customer", "manage" => "ajax_manage", "upload" => "ajax_upload", "ad" => "ajax_ad", "payment" => "ajax_payment", "notification" => 'ajax_notification', 'widget' => 'ajax_widget', 'build_url' => 'ajax_build_url', 'default' => 'ajax_default', 'map' => 'ajax_map', 'openid' => 'ajax_openid');
$action = EClassApi::getParam('act');
if ($action == "" || $choice[$action] == "") {
    $choice[$action] = "index";
}
require_once ROOT_PATH . "includes/ajax_action/" . $choice[$action] . ".ajax.php";
$run_me = new $choice[$action]();
$run_me->playme();
//End process & ouput
//Stop System
System::halt();
Exemple #27
0
 function draw()
 {
     global $display;
     if (User::is_login()) {
         Url::redirect_url("");
     }
     $error = '';
     $this->beginForm(false, 'post', false, Url::build_current());
     if ($_COOKIE['lang'] == 1) {
         $display->add('lng', language::$LNG['forgotpass']['en']);
     } else {
         $display->add('lng', language::$LNG['forgotpass']['vn']);
     }
     if ($_COOKIE['lang'] == 1) {
         $display->add('msg', $this->showFormErrorMessages(1, 'Error Messages'));
         $display->add('msg_success', $this->showFormSuccesMessages(1, 'Messages'));
     } else {
         $display->add('msg', $this->showFormErrorMessages(1, 'Thông báo Lỗi'));
         $display->add('msg_success', $this->showFormSuccesMessages(1, 'Thông báo'));
     }
     if (isset($_SESSION['reseted_pass']) && $_SESSION['reseted_pass']) {
         $display->add('reseted_pass', 1);
     } else {
         $display->add('reseted_pass', 0);
     }
     $_SESSION['reseted_pass'] = false;
     //$display->add('captcha', recaptcha_get_html(CGlobal::$captcha_publickey, @$error));
     $display->add('register_user_tel', trim(EClassApi::getParam('register_user_tel')));
     $display->add('lang' . $_COOKIE['lang']);
     $display->output('forgot_password');
     $this->endForm();
 }
Exemple #28
0
 function produc_hot()
 {
     if (!User::is_login()) {
         echo 'no_login';
         exit;
     }
     if (!User::have_permit(ADMIN_CATEGORY)) {
         echo 'no_perm';
         exit;
     }
     $cat_id = EClassApi::getParam('cat_id', '0');
     $item_ids = EClassApi::getParam('item_ids');
     $vip_item_ids = EClassApi::getParam('vip_item_ids');
     if ($item_ids == '' && $vip_item_ids == '') {
         //$file = DIR_CACHE."html/product_hot/data_".$cat_id.".js";
         //if(@file_exists($file)){
         //	StaticCache::delCache("product_hot/data_".$cat_id,"js");
         //}
         $sql = "update configs set conf_val = '' where conf_key = 'product_hot_" . $cat_id . "'";
         $sql_vip = "delete from item_vip where product_hot_cat_id =" . $cat_id;
         DB::query($sql);
         DB::query($sql_vip);
         EClassApi::get_item_vip(0, true);
         EClassApi::get_config(0, true);
         exit;
     }
     // item thuong
     $item_array = explode(',', $item_ids);
     $items = array();
     foreach ($item_array as $item) {
         if ($item) {
             $items[] = intval($item);
         }
     }
     $id_items_after = '';
     $item_ids = join(',', $items);
     $sql = "delete from configs where conf_key = 'product_hot_" . $cat_id . "'";
     DB::query($sql);
     EClassApi::get_config(0, true);
     if ($item_ids != '') {
         $sql = "SELECT id, name, brief, price, currency_id, original_image_url\n\t\t\t\t\t   FROM item \n\t\t\t\t\t   WHERE status = 1 AND id IN({$item_ids})";
         $result = DB::query($sql);
         $i = 0;
         while ($item = mysql_fetch_array($result)) {
             if (isset($item['id'])) {
                 $id_items[$i] = $item['id'];
                 $i++;
             }
         }
         $id_items_after = '';
         for ($i = 0; $i < count($item_array); $i++) {
             for ($j = 0; $j < count($id_items); $j++) {
                 if ($item_array[$i] == $id_items[$j]) {
                     $id_items_after .= $id_items[$j] . ",";
                 }
             }
         }
         if ($id_items_after != '') {
             $id_items_after = substr($id_items_after, 0, -1);
         }
         $sql_check = "SELECT id FROM configs WHERE conf_key = 'product_hot_" . $cat_id . "'";
         DB::query($sql_check);
         $row = DB::fetch_row();
         if ($row['id'] != '') {
             $sql = "UPDATE configs SET conf_val = '" . $id_items_after . "' WHERE conf_key = 'product_hot_" . $cat_id . "'";
             DB::query($sql);
             EClassApi::get_config(0, true);
             // xoa cache config
         } else {
             $sql = "INSERT INTO configs (`conf_key`,`conf_val`) values ('product_hot_" . $cat_id . "','" . $id_items_after . "')";
             DB::query($sql);
             EClassApi::get_config(0, true);
             // xoa cache config
         }
     }
     //item vip
     $vip_item_array = explode(',', $vip_item_ids);
     $vip_items = array();
     foreach ($vip_item_array as $vip_item) {
         if ($vip_item) {
             $vip_items[] = intval($vip_item);
         }
     }
     $vip_id_items_after = '';
     $vip_item_ids = join(',', $vip_items);
     $sql_vip = "delete from item_vip where product_hot_cat_id =" . $cat_id;
     DB::query($sql_vip);
     EClassApi::get_item_vip(0, true);
     if ($vip_item_ids != '') {
         $sql = "SELECT id, name, brief, price, currency_id, original_image_url\n\t\t\t\t\t   FROM item \n\t\t\t\t\t   WHERE status > 0 AND id IN({$vip_item_ids})";
         $result = DB::query($sql);
         while ($item = mysql_fetch_array($result)) {
             if (isset($item['id'])) {
                 $vip_id_items_after .= $item['id'] . ",";
                 $sql_check = "select count(*) AS total from item_vip where item_id = " . $item['id'] . " And product_hot_cat_id=" . $cat_id;
                 DB::query($sql_check);
                 $row = DB::fetch_row();
                 if ($row['total'] == 0) {
                     $sql = "insert into item_vip (`item_id`,`product_hot_cat_id`) values (" . $item['id'] . "," . $cat_id . ")";
                     DB::query($sql);
                     EClassApi::get_item_vip(0, true);
                 }
             }
         }
         if ($vip_id_items_after != '') {
             $vip_id_items_after = substr($vip_id_items_after, 0, -1);
         }
     }
     $id_items_after .= '|' . $vip_id_items_after;
     // check file
     //if(@file_exists(DIR_CACHE."html/product_hot/data_".$cat_id.".js")){
     //StaticCache::delCache("product_hot/data_".$cat_id,"js");
     //}
     EBArrCache::del_cache('arrProductHotCache');
     echo $id_items_after;
     exit;
 }
Exemple #29
0
 function on_submit()
 {
     if (User::id() != 0) {
         $uid = User::id();
         if (empty($uid)) {
             $this->setErrorMessage('personal/change_password', 'Tài khoản của bạn hiện đang bị khóa, bạn không thể thực hiện chức năng này!');
             Url::redirect_url('personal.html?cmd=change_password');
             exit;
         }
         $email = trim(strip_tags(Url::get('email')));
         $full_name = trim(strip_tags(Url::get('full_name')));
         $user_name = trim(strip_tags(Url::get('user_name')));
         $facebook = trim(strip_tags(Url::get('facebook')));
         $this->setSuccessMessage('personal/form_data', array('email' => $email, 'full_name' => $full_name, 'user_name' => $user_name));
         if (empty($email)) {
             $this->setErrorMessage('personal/change_password', 'Địa chỉ email không được để trống');
             Url::redirect_url('personal.html?cmd=change_password');
             exit;
         }
         if (empty($full_name)) {
             $this->setErrorMessage('personal/change_password', 'Tên đầy đủ không được để trống');
             Url::redirect_url('personal.html?cmd=change_password');
             exit;
         }
         $this->checkFormInput('Email', 'email', $email, 'email', true, '', 6, 50);
         if (DB::exists('SELECT id FROM `account` WHERE `email` LIKE "' . $email . '" AND id != ' . $uid)) {
             $this->setErrorMessage('personal/change_password', "Email bạn chọn đã tồn tại, hãy chọn lại một email khác, xin cám ơn!");
             Url::redirect_url('personal.html?cmd=change_password');
             exit;
         }
         if (DB::exists('SELECT id FROM `account` WHERE `user_name` LIKE "' . $user_name . '" AND id != ' . $uid)) {
             $this->setErrorMessage('personal/change_password', "Đã có tài khoản sử dụng số điện thoại này, hãy chọn lại một số điện thoại khác để sử dụng, xin cám ơn!");
             Url::redirect_url('personal.html?cmd=change_password');
             exit;
         }
         $new_row = array('full_name' => trim($full_name), 'user_name' => trim($user_name), 'email' => $email, 'facebook' => $facebook);
         $confirm_phone = trim(strip_tags(Url::get('confirm_phone')));
         $confirm_mail = trim(strip_tags(Url::get('confirm_mail')));
         if ($confirm_phone == '0000' || isset($_SESSION['uname_pin']) && $confirm_phone == $_SESSION['uname_pin']) {
             $check1 = true;
         } else {
             $check1 = false;
         }
         if ($confirm_mail == '0000' || isset($_SESSION['mail_pin']) && $confirm_mail == $_SESSION['mail_pin']) {
             $check2 = true;
         } else {
             $check2 = false;
         }
         $u = DB::select('account', 'id=' . $uid);
         if ($check1 && $check2) {
             PersonalDB::update_account_information($new_row);
             unset($_SESSION['uname_pin']);
             unset($_SESSION['mail_pin']);
         } else {
             unset($new_row);
             $this->setErrorMessage('personal/change_password', 'Bạn nhập sai mã xác nhận, vui lòng thực hiện lại thao tác');
             Url::redirect_url('personal.html?cmd=change_password');
         }
         // Update Password
         $new_password = trim(strip_tags(EClassApi::getParam('new_password')));
         $confirm_password = trim(strip_tags(EClassApi::getParam('confirm_password')));
         if (!empty($new_password) && strlen($new_password) > 0 && !empty($confirm_password) && strlen($confirm_password) > 0) {
             if ($new_password == $confirm_password) {
                 $new_password = User::eat_encode_password($new_password, SALTAUTH);
                 if ($new_password) {
                     $new_row = array('password' => trim($new_password));
                     PersonalDB::update_account_information($new_row);
                 }
             } else {
                 $this->setErrorMessage('personal/change_password', 'Xác nhận mật khẩu sai');
                 Url::redirect_url('personal.html?cmd=change_password');
                 exit;
             }
         }
         $this->setSuccessMessage('personal/change_password', 'Thông tin của bạn đã được thay đổi');
         Url::redirect_url('personal.html?cmd=change_password');
     } else {
         $this->setErrorMessage('user/login', 'Bạn phải đăng nhập trước khi truy cập khu vực này');
         Url::redirect_url('home');
     }
 }