protected function getListQuery() { $id = JRequest::getUInt('id'); jimport('joomla.application.categories'); $catObj = JCategories::getInstance('JNT_Hanhphuc', array('extension' => 'com_jnt_hanhphuc', 'table' => '')); $category = $catObj->get($id); $query = FrontJntHanhphucHelper::getUsers($category->id, true); return $query; }
/** * Method override to check if you can edit an existing record. * * @param array $data An array of input data. * @param string $key The name of the key for the primary key. * * @return boolean * * @since 1.6 */ protected function allowEdit($data = array(), $key = 'id') { if (isset($data['id']) && (int) $data['id'] > 0) { if (!FrontJntHanhphucHelper::checkUserPermissionOnItem($data['id'], '#__hp_business_content')) { return false; } } return true; }
static function getList($params) { $app = JFactory::getApplication(); $db = JFactory::getDbo(); $result = array(); $query = $db->getQuery(true); jimport('joomla.application.categories'); $catObj = JCategories::getInstance('JNT_Hanhphuc'); $categories = $catObj->get()->getChildren(); foreach ($categories as &$cat) { $cat->subCategories = $cat->getChildren(); } $result['categories'] = $categories; $result['provinces'] = FrontJntHanhphucHelper::getProvinces(); return $result; }
public function getCategories() { jimport('joomla.application.categories'); $catObj = JCategories::getInstance('JNT_Hanhphuc', array('extension' => 'com_jnt_hanhphuc', 'table' => '')); $categories = $catObj->get()->getChildren(); // var_dump($categories); $arrCat = array(); foreach ($categories as $key => $cat) { $sub = $cat->getChildren(); foreach ($sub as &$c) { $users = FrontJntHanhphucHelper::getUsers($c->id); if (!empty($users)) { $c->users = $users; $arrCat[] = $c; } } } return $arrCat; }
public function save($data) { // always set state is unpublish for each save $data['state'] = 0; $id = $data['id']; if (isset($id) && (int) $id > 0) { if (!FrontJntHanhphucHelper::checkUserPermissionOnItem($id, '#__hp_business_content')) { exit('Cannot edit this content!'); } } if (parent::save($data)) { $id = (int) $this->getState($this->getName() . '.id'); if ($id) { $data['id'] = $id; } $delImage = isset($data['del_image']) ? $data['del_image'] : null; // Upload thumb $item = $this->getItem(); $data['images'] = Jnt_HanhPhucHelper::uploadImages('images', $item, $delImage, 'hp_content'); // update content $content = $this->copyFilesOnSave($data['content'], $data['id']); if ($content) { $data['content'] = $content; } return parent::save($data); } return false; }
<?php /** * @version $Id: default.php 21020 2011-03-27 06:52:01Z infograf768 $ * @package Joomla.Site * @subpackage com_content * @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // no direct access defined('_JEXEC') or die; JHtml::addIncludePath(JPATH_COMPONENT . DS . 'helpers'); $paymentMethods = FrontJntHanhphucHelper::getPaymentMethods(); ?> <div class="container"> <div class="float-left left-side"> <div class="sub-container list-services shopping-cart relative"> <h2>Thông tin giỏ hàng</h2> <div> <?php $items = $this->order->items; if ($items) { ?> <table class="gridtable" width="650"> <thead> <tr> <th>Dịch vụ</th> <th>Doanh nghiệp cung cấp</th> <th width="50" nowrap="nowrap">Số lượng</th>
public function save($data) { // always set state is unpublish for each save $data['state'] = 0; $id = $data['id']; if (isset($id) && (int) $id > 0) { if (!FrontJntHanhphucHelper::checkUserPermissionOnItem($id, '#__hp_albums')) { exit('Cannot edit this album!'); } } if (parent::save($data)) { $id = (int) $this->getState($this->getName() . '.id'); // Update images $currentImages = isset($_POST['current_images']) ? $_POST['current_images'] : array(); $currentDesc = isset($_POST['current_desc']) ? $_POST['current_desc'] : array(); Jnt_HanhPhucHelper::updateImages($id, $currentImages, $currentDesc, 'albums'); // Temp files if (isset($_POST['tmp_other_img'])) { // Copy file Jnt_HanhPhucHelper::copyTempFiles($id, $_POST['tmp_other_img'], 'albums'); // Insert images Jnt_HanhPhucHelper::insertImages($id, $_POST['tmp_other_img'], $_POST['tmp_desc'], 'albums'); } if ($id) { $data['id'] = $id; } $delImage = isset($data['del_image']) ? $data['del_image'] : null; // Upload thumb $item = $this->getItem(); $data['images'] = Jnt_HanhPhucHelper::uploadImages('images', $item, $delImage, 'albums', 300); return parent::save($data); } return false; }
public function save($data) { $id = $data['id']; if (isset($id) && (int) $id > 0) { if (!FrontJntHanhphucHelper::checkUserPermissionOnItem($id, '#__user_addresses')) { exit('Cannot edit this content!'); } } $data['created_by'] = JFactory::getUser()->id; $saveResult = parent::save($data); return true; }