示例#1
0
 function on_submit()
 {
     $reply_content = trim(Url::get('reply_content'));
     $subject = AZLib::stripUnicode(trim(Url::get('subject')));
     if (strlen($reply_content) > 20) {
         //Gửi mail đã:
         if ($subject == '') {
             $subject = "Tra loi lien he cua ban... ( Reply for your feedback... )";
         }
         $content = $reply_content . MAIL_FOOTER . "<hr />" . "<b>Nội dung ý kiến / liên hệ của bạn đã gửi cho chúng tôi vào lúc: " . date('H:i:s d/m/Y', $this->contact['time']) . ":</b><br />\n\t\t\t\t\t\t<b>&quot;</b>" . stripslashes($this->contact['content']) . "<b>&quot;</b>";
         if (System::sendEBEmail($this->contact['email'], "[" . WEB_NAME . "] {$subject}", $content)) {
             $reply_content = stripslashes($this->contact['reply_content']) . "<a href='" . Url::build('profile', array('id' => User::id())) . "'>" . User::user_name() . "</a> Gửi lúc: " . date('H:i:s d/m/Y', TIME_NOW) . "<br /><b>Email Subject:</b> " . $subject . "<br /><br />" . $reply_content . '<hr />';
             if (DB::update('feedback', array('reply_content' => addslashes($reply_content), 'status' => 1), 'id=' . $this->contact['id'])) {
                 //Gửi mail cho admin
                 System::sendEBEmail(FEEDBACK_EMAIL, "[" . WEB_NAME . "] " . 'Reply for feedback: ' . $this->contact['name'] . ' - ' . $this->contact['address'] . ' - ' . $this->contact['email'], $content);
                 Url::redirect_current();
             } else {
                 $this->setFormError('', 'Không cập nhật được dữ liệu');
             }
         } else {
             $this->setFormError('subject', 'Không gửi được email tới khách hàng!');
         }
         //End gửi mail
     } else {
         $this->setFormError('reply_content', 'Nội dung phản hồi phải lớn hơn 20 ký tự');
     }
 }
示例#2
0
 function draw()
 {
     global $display;
     $this->item['price'] = AZLib::convertCurrency($this->item['price'], $this->item['currency_id']);
     $this->item['price_out'] = AZLib::convertCurrency($this->item['price_out'], $this->item['currency_id']);
     $this->item['currency_id'] = 1;
     //For ajax_upload form
     $display->add('url_gallery', WEB_ROOT . AZRewrite::formatUrl('?page=gallery&is_popup=1&user_id=' . $this->item['user_id']));
     ////$display->add('no_img_upload',AZLib::getImageSrc('',100,100));
     $display->add('browser_is_ie', $this->browser_is_ie);
     $display->add('no_img_upload', $this->no_image);
     $display->add('user_id', User::id());
     $display->add('item_user_id', $this->item['user_id']);
     $display->add('is_can_edit', (int) User::have_permit(ADMIN_ITEM));
     $display->add('user_name', $this->item['user_name']);
     if (isset($_POST["avatar_img_server"])) {
         $avatar['img_server'] = $_POST["avatar_img_server"];
         $avatar['img_url'] = $_POST["avatar_img_url"];
         $avatar['thumb280_280'] = AZLib::getImageThumb($_POST["avatar_img_url"], 280, 280, 0, $_POST["avatar_img_server"]);
         $avatar['max_path'] = AZLib::getImageThumbMax($_POST["avatar_img_url"], 'thumb_max', 1, $_POST["avatar_img_server"]);
         $display->add('avatarInfo', $avatar);
         $display->add('avatar', json_encode($avatar));
     } elseif ($this->item['img_url']) {
         $avatar['img_server'] = $this->item['img_server'];
         $avatar['img_url'] = $this->item['img_url'];
         $avatar['thumb280_280'] = AZLib::getImageThumb($this->item['img_url'], 280, 280, 0, $this->item['img_server']);
         $avatar['max_path'] = AZLib::getImageThumbMax($this->item['img_url'], $this->item['name'], 1, $this->item['img_server']);
         $display->add('avatarInfo', $avatar);
         $display->add('avatar', json_encode($avatar));
     }
     $display->output('ajax_upload');
     //For ajax_upload form
     $this->beginForm(true);
     //$display->add('img_fnkjgk',json_encode($bakjgkj));
     $display->add('max_image_page', $this->max_image_page);
     $display->add('images_per_page', $this->images_per_page);
     $display->add('post_item_images', $this->item_images);
     $display->add('jsImages', json_encode($this->jsImages));
     if ($this->item['level_1_catid'] != $this->item['category_id']) {
         $first = $this->item['level_1_catid'];
         $second = $this->item['category_id'];
     } else {
         $first = $this->item['category_id'];
         $second = 0;
     }
     $display->add('first_combo', (int) Url::get('first_combo', $first));
     $display->add('second_combo', (int) Url::get('second_combo', $second));
     ///$display->add('category_tree',json_encode(AZLib::getCategoriesTree(0,true)));
     $display->add('category_tree', json_encode(AZLib::getCategoriesTree(true)));
     $display->add('currency_tree', json_encode(CGlobal::$currency));
     $display->add('az_filters', json_encode(CGlobal::$filters));
     $display->add('item_filters', $this->item['filter_ids']);
     $display->add('image_path', 'http://' . IMAGE_PATH);
     $display->add('img_cur_server', IMAGE_SERVER_NO);
     $display->add('img_server', json_encode(CGlobal::$img_server));
     $display->add('multi_upload', User::have_permit(ADMIN_ITEM));
     $display->add('no_img', $this->no_image);
     $display->add('post_img', $display->output('post_img', true));
     $display->add('currency_id_option', AZLib::getOption(CGlobal::$currency, Url::get('currency_id', $this->item['currency_id'])));
     $display->add('msg', $this->showFormErrorMessages(1));
     $display->add('name', stripslashes(Url::get('name', $this->item['name'])));
     $display->add('sku', Url::get('sku', $this->item['sku']));
     $display->add('offer', stripslashes(Url::get('offer', $this->item['offer'])));
     if (isset(CGlobal::$allCategories[$this->item['category_id']])) {
         $item_href = WEB_DIR . CGlobal::$allCategories[$this->item['category_id']]['nice_name'] . "/p{$this->item['id']}/" . AZLib::safe_title($this->item['name']) . ".html";
     } else {
         $item_href = WEB_DIR . "p{$this->item['id']}/" . AZLib::safe_title($this->item['name']) . ".html";
     }
     $display->add('item_href', $item_href);
     $display->add('name_length', 120 - mb_strlen(AZLib::stripUnicode(Url::get('name', $this->item['name'])), "UTF-8"));
     $display->add('brief', stripslashes(Url::get('brief', $this->item['brief'])));
     $display->add('item_description', stripslashes(Url::get('item_description', $this->item['description'])));
     $display->add('mode', "CẬP NHẬT");
     $display->add('price', number_format(Url::get('price', $this->item['price']), 0, ',', '.'));
     $display->add('price_out', number_format(Url::get('price_out', $this->item['price_out']), 0, ',', '.'));
     $display->add('quantity', number_format(Url::cdouble(Url::get('quantity', $this->item['quantity'])), 0, ',', '.'));
     $display->add('item_order', (int) Url::get('item_order', $this->item['item_order']));
     $display->add('made_in', Url::get('made_in', $this->item['made_in']));
     $display->add('warranty', Url::get('warranty', $this->item['warranty']));
     $display->output('post_sale');
     $this->endForm();
 }