Exemplo n.º 1
0
 public function getFilterListProduct()
 {
     $jshopConfig = JSFactory::getConfig();
     $request = JSFactory::getModel('searchrequest', 'jshop');
     $manufacturer_id = $request->getManufacturerId();
     $date_to = $request->getDateTo();
     $date_from = $request->getDateFrom();
     $price_to = $request->getPriceTo();
     $price_from = $request->getPriceFrom();
     $search = $request->getSearch();
     $search_type = $request->getSearchType();
     $extra_fields = $request->getExtraFields();
     $categorys = $request->getCategorys();
     $filters = array();
     $filters['categorys'] = $categorys;
     if ($manufacturer_id) {
         $filters['manufacturers'][] = $manufacturer_id;
     }
     $filters['price_from'] = $price_from;
     $filters['price_to'] = $price_to;
     if ($jshopConfig->admin_show_product_extra_field) {
         $filters['extra_fields'] = $extra_fields;
     }
     $filters['search'] = $search;
     $filters['date_from'] = $date_from;
     $filters['date_to'] = $date_to;
     $filters['search_type'] = $search_type;
     return $filters;
 }
Exemplo n.º 2
0
 function display($cachable = false, $urlparams = false)
 {
     $db = JFactory::getDBO();
     $addons = JSFactory::getModel("addons");
     $rows = $addons->getList();
     $back64 = base64_encode("index.php?option=com_jshopping&controller=addons");
     foreach ($rows as $k => $v) {
         if (file_exists(JPATH_COMPONENT_SITE . "/addons/" . $v->alias . "/config.tmpl.php")) {
             $rows[$k]->config_file_exist = 1;
         } else {
             $rows[$k]->config_file_exist = 0;
         }
         if (file_exists(JPATH_COMPONENT_SITE . "/addons/" . $v->alias . "/info.tmpl.php")) {
             $rows[$k]->info_file_exist = 1;
         } else {
             $rows[$k]->info_file_exist = 0;
         }
         if (file_exists(JPATH_COMPONENT_SITE . "/addons/" . $v->alias . "/version.tmpl.php")) {
             $rows[$k]->version_file_exist = 1;
         } else {
             $rows[$k]->version_file_exist = 0;
         }
     }
     $view = $this->getView("addons", 'html');
     $view->setLayout("list");
     $view->assign('rows', $rows);
     $view->assign('back64', $back64);
     $view->sidebar = JHtmlSidebar::render();
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeDisplayAddons', array(&$view));
     $view->displayList();
 }
Exemplo n.º 3
0
 function edit()
 {
     $country_id = JRequest::getInt("country_id");
     $countries = JSFactory::getModel("countries");
     $country = JSFactory::getTable('country', 'jshop');
     $country->load($country_id);
     $first[] = JHTML::_('select.option', '0', _JSHOP_ORDERING_FIRST, 'ordering', 'name');
     $rows = array_merge($first, $countries->getAllCountries(0));
     $lists['order_countries'] = JHTML::_('select.genericlist', $rows, 'ordering', 'class="inputbox" size="1"', 'ordering', 'name', $country->ordering);
     $_lang = JSFactory::getModel("languages");
     $languages = $_lang->getAllLanguages(1);
     $multilang = count($languages) > 1;
     $edit = $country_id ? $edit = 1 : ($edit = 0);
     JFilterOutput::objectHTMLSafe($country, ENT_QUOTES);
     $view = $this->getView("countries", 'html');
     $view->setLayout("edit");
     $view->assign('country', $country);
     $view->assign('lists', $lists);
     $view->assign('edit', $edit);
     $view->assign('languages', $languages);
     $view->assign('etemplatevar', '');
     $view->assign('multilang', $multilang);
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeEditCountries', array(&$view));
     $view->displayEdit();
 }
Exemplo n.º 4
0
 function edit()
 {
     $mainframe = JFactory::getApplication();
     $jshopConfig = JSFactory::getConfig();
     $db = JFactory::getDBO();
     $id = JRequest::getInt("id");
     $vendor = JSFactory::getTable('vendor', 'jshop');
     $vendor->load($id);
     if (!$id) {
         $vendor->publish = 1;
     }
     $_countries = JSFactory::getModel("countries");
     $countries = $_countries->getAllCountries(0);
     $lists['country'] = JHTML::_('select.genericlist', $countries, 'country', 'class = "inputbox" size = "1"', 'country_id', 'name', $vendor->country);
     $nofilter = array();
     JFilterOutput::objectHTMLSafe($vendor, ENT_QUOTES, $nofilter);
     $view = $this->getView("vendors", 'html');
     $view->setLayout("edit");
     $view->assign('vendor', $vendor);
     $view->assign('lists', $lists);
     $view->assign('etemplatevar', '');
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeEditVendors', array(&$view));
     $view->displayEdit();
 }
 function showEndForm($pmconfigs, $order)
 {
     $jshopConfig = JSFactory::getConfig();
     $pm_method = $this->getPmMethod();
     $db = JFactory::getDBO();
     $query = $db->getQuery(true);
     $query->clear();
     $query->update('#__jshopping_orders')->set($db->quoteName('order_created') . ' = 1 ')->where($db->quoteName('order_id') . ' = ' . (int) $order->order_id);
     $db->setQuery($query);
     echo '<div id="begateway_erip">';
     try {
         $db->execute();
         $model = JSFactory::getModel('orderMail', 'jshop');
         $model->setData($order->order_id, 0);
         $model->send();
         if ($pmconfigs['auto'] == '1') {
             JPluginHelper::importPlugin('PlgSystemJoomShoppingErip');
             $dispatcher = JEventDispatcher::getInstance();
             $result = $dispatcher->trigger('onBeforeChangeOrderStatusAdmin', array($order->order_id, $this->getStatusId(), 'auto'));
             if (!$result) {
                 throw new Exception(JText::_('PLG_JSERIPPAYMENT_ORDER_ERROR'));
             }
             $instruction = JText::_('PLG_JSERIPPAYMENT_ERIP_INSTRUCTION');
             $instruction = str_replace('#TABS#', '<strong>' . $pmconfigs['tree_path_email'] . '</strong>', $instruction);
             $instruction = str_replace('#ORDER_ID#', '<strong>' . $order->order_id . '</strong>', $instruction);
             echo nl2br($instruction);
         } else {
             echo nl2br(JText::_('PLG_JSERIPPAYMENT_ORDER_CONFIRMATION'));
         }
     } catch (RuntimeException $e) {
         echo JText::_('PLG_JSERIPPAYMENT_ORDER_ERROR');
     }
     echo '</div>';
 }
Exemplo n.º 6
0
 function edit()
 {
     $id = JRequest::getInt("id");
     $configdisplayprice = JSFactory::getTable('configDisplayPrice', 'jshop');
     $configdisplayprice->load($id);
     $list_c = $configdisplayprice->getZones();
     $zone_countries = array();
     foreach ($list_c as $v) {
         $obj = new stdClass();
         $obj->country_id = $v;
         $zone_countries[] = $obj;
     }
     $display_price_list = array();
     $display_price_list[] = JHTML::_('select.option', 0, _JSHOP_PRODUCT_BRUTTO_PRICE, 'id', 'name');
     $display_price_list[] = JHTML::_('select.option', 1, _JSHOP_PRODUCT_NETTO_PRICE, 'id', 'name');
     $lists['display_price'] = JHTML::_('select.genericlist', $display_price_list, 'display_price', '', 'id', 'name', $configdisplayprice->display_price);
     $lists['display_price_firma'] = JHTML::_('select.genericlist', $display_price_list, 'display_price_firma', '', 'id', 'name', $configdisplayprice->display_price_firma);
     $countries = JSFactory::getModel("countries");
     $lists['countries'] = JHTML::_('select.genericlist', $countries->getAllCountries(0), 'countries_id[]', 'size = "10", multiple = "multiple"', 'country_id', 'name', $zone_countries);
     JFilterOutput::objectHTMLSafe($configdisplayprice, ENT_QUOTES);
     $view = $this->getView("config_display_price", 'html');
     $view->setLayout("edit");
     $view->assign('row', $configdisplayprice);
     $view->assign('lists', $lists);
     $view->assign('etemplatevar', '');
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeEditConfigDisplayPrice', array(&$view));
     $view->displayEdit();
 }
Exemplo n.º 7
0
 function products()
 {
     $jshopConfig = JSFactory::getConfig();
     $dispatcher = JDispatcher::getInstance();
     $vendor_id = JRequest::getInt("vendor_id");
     JSFactory::getModel('productShop', 'jshop')->storeEndPages();
     $vendor = JSFactory::getTable('vendor', 'jshop');
     $vendor->load($vendor_id);
     $dispatcher->trigger('onBeforeDisplayVendor', array(&$vendor));
     JshopHelpersMetadata::vendorProducts($vendor);
     $productlist = JSFactory::getModel('productList', 'jshop');
     $productlist->setModel($vendor);
     $productlist->load();
     $orderby = $productlist->getOrderBy();
     $image_sort_dir = $productlist->getImageSortDir();
     $filters = $productlist->getFilters();
     $action = $productlist->getAction();
     $products = $productlist->getProducts();
     $pagination = $productlist->getPagination();
     $pagenav = $productlist->getPagenav();
     $sorting_sel = $productlist->getHtmlSelectSorting();
     $product_count_sel = $productlist->getHtmlSelectCount();
     $willBeUseFilter = $productlist->getWillBeUseFilter();
     $display_list_products = $productlist->getDisplayListProducts();
     $manufacuturers_sel = $productlist->getHtmlSelectFilterManufacturer(1);
     $categorys_sel = $productlist->getHtmlSelectFilterCategory(1);
     $allow_review = $productlist->getAllowReview();
     $view = $this->getView('vendor');
     $view->setLayout("products");
     $view->assign('config', $jshopConfig);
     $view->assign('template_block_list_product', $productlist->getTmplBlockListProduct());
     $view->assign('template_no_list_product', $productlist->getTmplNoListProduct());
     $view->assign('template_block_form_filter', $productlist->getTmplBlockFormFilter());
     $view->assign('template_block_pagination', $productlist->getTmplBlockPagination());
     $view->assign('path_image_sorting_dir', $jshopConfig->live_path . 'images/' . $image_sort_dir);
     $view->assign('filter_show', 1);
     $view->assign('filter_show_category', 1);
     $view->assign('filter_show_manufacturer', 1);
     $view->assign('pagination', $pagenav);
     $view->assign('pagination_obj', $pagination);
     $view->assign('display_pagination', $pagenav != "");
     $view->assign("rows", $products);
     $view->assign("count_product_to_row", $productlist->getCountProductsToRow());
     $view->assign("vendor", $vendor);
     $view->assign('action', $action);
     $view->assign('allow_review', $allow_review);
     $view->assign('orderby', $orderby);
     $view->assign('product_count', $product_count_sel);
     $view->assign('sorting', $sorting_sel);
     $view->assign('categorys_sel', $categorys_sel);
     $view->assign('manufacuturers_sel', $manufacuturers_sel);
     $view->assign('filters', $filters);
     $view->assign('willBeUseFilter', $willBeUseFilter);
     $view->assign('display_list_products', $display_list_products);
     $view->assign('shippinginfo', SEFLink($jshopConfig->shippinginfourl, 1));
     $dispatcher->trigger('onBeforeDisplayProductListView', array(&$view));
     $view->display();
 }
Exemplo n.º 8
0
 public function mailSend()
 {
     $data = array();
     $data['product_id'] = $this->getProductId();
     $data['review'] = $this->review;
     $mail = JSFactory::getModel('reviewMail', 'jshop');
     $mail->setData($data);
     return $mail->send();
 }
Exemplo n.º 9
0
 public function clearAllDataCheckout()
 {
     extract(js_add_trigger(get_defined_vars(), "before"));
     $cart = JSFactory::getModel('cart', 'jshop');
     $cart->load();
     $cart->getSum();
     $cart->clear();
     $this->deleteSession();
     extract(js_add_trigger(get_defined_vars(), "after"));
 }
Exemplo n.º 10
0
 function start()
 {
     $_GET['noredirect'] = 1;
     $_POST['noredirect'] = 1;
     $_REQUEST['noredirect'] = 1;
     $key = JRequest::getVar("key");
     $model = JSFactory::getModel('importExportStart', 'jshop');
     if ($model->checkKey($key)) {
         $model->executeList();
     }
     die;
 }
Exemplo n.º 11
0
 function showAdminFormParams($params)
 {
     $array_params = array('user_id', 'project_id', 'project_password', 'notify_password', 'transaction_end_status', 'transaction_pending_status', 'transaction_failed_status');
     foreach ($array_params as $key) {
         if (!isset($params[$key])) {
             $params[$key] = '';
         }
     }
     $orders = JSFactory::getModel('orders', 'JshoppingModel');
     //admin model
     include dirname(__FILE__) . "/adminparamsform.php";
 }
Exemplo n.º 12
0
 function remove_to_cart()
 {
     header("Cache-Control: no-cache, must-revalidate");
     $ajax = JRequest::getInt('ajax');
     $number_id = JRequest::getInt('number_id');
     $cart = JSFactory::getModel('checkout', 'jshop')->removeWishlistItemToCart($number_id);
     if ($ajax) {
         print getOkMessageJson($cart);
         die;
     }
     $this->setRedirect(SEFLink('index.php?option=com_jshopping&controller=cart&task=view', 1, 1));
 }
Exemplo n.º 13
0
 function display($cachable = false, $urlparams = false)
 {
     $languages = JSFactory::getModel("languages");
     $rows = $languages->getAllLanguages(0);
     $jshopConfig = JSFactory::getConfig();
     $view = $this->getView("languages_list", 'html');
     $view->assign('rows', $rows);
     $view->assign('default_front', $jshopConfig->getFrontLang());
     $view->assign('defaultLanguage', $jshopConfig->defaultLanguage);
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeDisplayLanguage', array(&$view));
     $view->display();
 }
Exemplo n.º 14
0
 function result()
 {
     $jshopConfig = JSFactory::getConfig();
     JSFactory::getModel('productShop', 'jshop')->storeEndPages();
     JshopHelpersMetadata::searchResult();
     $modellist = JSFactory::getModel('productssearch', 'jshop');
     $productlist = JSFactory::getModel('productList', 'jshop');
     $productlist->setModel($modellist);
     $productlist->load();
     $orderby = $productlist->getOrderBy();
     $image_sort_dir = $productlist->getImageSortDir();
     $action = $productlist->getAction();
     $products = $productlist->getProducts();
     $pagination = $productlist->getPagination();
     $pagenav = $productlist->getPagenav();
     $total = $productlist->getTotal();
     $filters = $productlist->getFilters();
     $sorting_sel = $productlist->getHtmlSelectSorting();
     $product_count_sel = $productlist->getHtmlSelectCount();
     $allow_review = $productlist->getAllowReview();
     $search = $filters['search'];
     if (!$total) {
         $this->noresult($search);
         return 0;
     }
     $view = $this->getView("search");
     $view->setLayout("products");
     $view->assign('search', $search);
     $view->assign('total', $total);
     $view->assign('config', $jshopConfig);
     $view->assign('template_block_list_product', $productlist->getTmplBlockListProduct());
     $view->assign('template_block_form_filter', $productlist->getTmplBlockFormFilter());
     $view->assign('template_block_pagination', $productlist->getTmplBlockPagination());
     $view->assign('path_image_sorting_dir', $jshopConfig->live_path . 'images/' . $image_sort_dir);
     $view->assign('filter_show', 0);
     $view->assign('filter_show_category', 0);
     $view->assign('filter_show_manufacturer', 0);
     $view->assign('pagination', $pagenav);
     $view->assign('pagination_obj', $pagination);
     $view->assign('display_pagination', $pagenav != "");
     $view->assign('product_count', $product_count_sel);
     $view->assign('sorting', $sorting_sel);
     $view->assign('action', $action);
     $view->assign('orderby', $orderby);
     $view->assign('count_product_to_row', $productlist->getCountProductsToRow());
     $view->assign('rows', $products);
     $view->assign('allow_review', $allow_review);
     $view->assign('shippinginfo', SEFLink($jshopConfig->shippinginfourl, 1));
     JDispatcher::getInstance()->trigger('onBeforeDisplayProductListView', array(&$view));
     $view->display();
 }
Exemplo n.º 15
0
 function showAdminFormParams($params)
 {
     $lang = JFactory::getLanguage();
     require_once dirname(dirname(__DIR__)) . '/lang/' . __CLASS__ . '/' . $lang->getTag() . '.php';
     $array_params = array('email_received', 'token', 'test_token', 'transaction_end_status', 'transaction_pending_status', 'transaction_failed_status');
     foreach ($array_params as $key) {
         if (!isset($params[$key])) {
             $params[$key] = '';
         }
     }
     $orders = JSFactory::getModel('orders', 'JshoppingModel');
     // Admin model
     include dirname(__FILE__) . "/adminparamsform.php";
 }
Exemplo n.º 16
0
 public function activate($token)
 {
     $config = JFactory::getConfig();
     $userParams = $this->getUserParams();
     JPluginHelper::importPlugin('user');
     $userId = $this->getUserId($token);
     if (!$userId) {
         $this->setError(JText::_('COM_USERS_ACTIVATION_TOKEN_NOT_FOUND'));
         return false;
     }
     $user = JFactory::getUser($userId);
     $usermail = JSFactory::getModel('usermailactivation', 'jshop');
     $uri = JURI::getInstance();
     $base = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port'));
     $data = $user->getProperties();
     $data['fromname'] = $config->get('fromname');
     $data['mailfrom'] = $config->get('mailfrom');
     $data['sitename'] = $config->get('sitename');
     $data['siteurl'] = JUri::base();
     // Admin activation is on and user is verifying their email
     if ($userParams->get('useractivation') == 2 && !$user->getParam('activate', 0)) {
         $data['activation'] = JApplication::getHash(JUserHelper::genRandomPassword());
         $data['activate'] = $base . JRoute::_('index.php?option=com_jshopping&controller=user&task=activate&token=' . $data['activation'], false);
         $user->set('activation', $data['activation']);
         $user->setParam('activate', 1);
         $usermail->setData($data);
         if (!$usermail->sendToAdmin()) {
             $this->setError($usermail->getError());
             return false;
         }
     } elseif ($userParams->get('useractivation') == 2 && $user->getParam('activate', 0)) {
         $user->set('activation', '');
         $user->set('block', '0');
         $user->setParam('activate', 0);
         $usermail->setData($data);
         if (!$usermail->send()) {
             $this->setError($usermail->getError());
             return false;
         }
     } else {
         $user->set('activation', '');
         $user->set('block', '0');
     }
     if (!$user->save()) {
         $this->setError(JText::sprintf('COM_USERS_REGISTRATION_ACTIVATION_SAVE_FAILED', $user->getError()));
         $user = false;
     }
     JDispatcher::getInstance()->trigger('onAfterUserActivate', array(&$this, &$token, &$user));
     return $user;
 }
Exemplo n.º 17
0
 function display($cachable = false, $urlparams = false)
 {
     if ($this->getTask() != "" && $this->getTask() != "backtolistie" && JRequest::getInt("ie_id")) {
         $this->view();
         return 1;
     }
     $importexport = JSFactory::getModel("importexport");
     $rows = $importexport->getList();
     $view = $this->getView("import_export_list", 'html');
     $view->assign('rows', $rows);
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeDisplayImportExport', array(&$view));
     $view->display();
 }
Exemplo n.º 18
0
 function edit()
 {
     $mainframe = JFactory::getApplication();
     $jshopConfig = JSFactory::getConfig();
     $db = JFactory::getDBO();
     $me = JFactory::getUser();
     $user_id = JRequest::getInt("user_id");
     $user = JSFactory::getTable('userShop', 'jshop');
     $user->load($user_id);
     $user_site = new JUser($user_id);
     $_countries = JSFactory::getModel("countries");
     $countries = $_countries->getAllCountries(0);
     $lists['country'] = JHTML::_('select.genericlist', $countries, 'country', 'class = "inputbox" size = "1"', 'country_id', 'name', $user->country);
     $lists['d_country'] = JHTML::_('select.genericlist', $countries, 'd_country', 'class = "inputbox endes" size = "1"', 'country_id', 'name', $user->d_country);
     $user->birthday = getDisplayDate($user->birthday, $jshopConfig->field_birthday_format);
     $user->d_birthday = getDisplayDate($user->d_birthday, $jshopConfig->field_birthday_format);
     $option_title = array();
     foreach ($jshopConfig->user_field_title as $key => $value) {
         $option_title[] = JHTML::_('select.option', $key, $value, 'title_id', 'title_name');
     }
     $lists['select_titles'] = JHTML::_('select.genericlist', $option_title, 'title', 'class = "inputbox"', 'title_id', 'title_name', $user->title);
     $lists['select_d_titles'] = JHTML::_('select.genericlist', $option_title, 'd_title', 'class = "inputbox endes"', 'title_id', 'title_name', $user->d_title);
     $client_types = array();
     foreach ($jshopConfig->user_field_client_type as $key => $value) {
         $client_types[] = JHTML::_('select.option', $key, $value, 'id', 'name');
     }
     $lists['select_client_types'] = JHTML::_('select.genericlist', $client_types, 'client_type', 'class = "inputbox" ', 'id', 'name', $user->client_type);
     $_usergroups = JSFactory::getModel("userGroups");
     $usergroups = $_usergroups->getAllUsergroups();
     $lists['usergroups'] = JHTML::_('select.genericlist', $usergroups, 'usergroup_id', 'class = "inputbox" size = "1"', 'usergroup_id', 'usergroup_name', $user->usergroup_id);
     $lists['block'] = JHTML::_('select.booleanlist', 'block', 'class="inputbox" size="1"', $user_site->get('block'));
     filterHTMLSafe($user, ENT_QUOTES);
     $tmp_fields = $jshopConfig->getListFieldsRegister();
     $config_fields = $tmp_fields['editaccount'];
     $count_filed_delivery = $jshopConfig->getEnableDeliveryFiledRegistration('editaccount');
     JHTML::_('behavior.calendar');
     $view = $this->getView("users", 'html');
     $view->setLayout("edit");
     $view->assign('config', $jshopConfig);
     $view->assign('user', $user);
     $view->assign('me', $me);
     $view->assign('user_site', $user_site);
     $view->assign('lists', $lists);
     $view->assign('etemplatevar', '');
     $view->assign('config_fields', $config_fields);
     $view->assign('count_filed_delivery', $count_filed_delivery);
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeEditUsers', array(&$view));
     $view->displayEdit();
 }
Exemplo n.º 19
0
 public function getBackUrlShop()
 {
     $jshopConfig = JSFactory::getConfig();
     $modelproduct = JSFactory::getModel('productShop', 'jshop');
     $shopurl = SEFLink('index.php?option=com_jshopping&controller=category', 1);
     if ($jshopConfig->cart_back_to_shop == "product") {
         $endpagebuyproduct = xhtmlUrl($modelproduct->getEndPageBuy());
     } elseif ($jshopConfig->cart_back_to_shop == "list") {
         $endpagebuyproduct = xhtmlUrl($modelproduct->getEndPageList());
     }
     if (isset($endpagebuyproduct) && $endpagebuyproduct) {
         $shopurl = $endpagebuyproduct;
     }
     return $shopurl;
 }
Exemplo n.º 20
0
 function edit()
 {
     $id = JRequest::getVar('id');
     $filename = str_replace(array('..', '/'), '', $id);
     $model = JSFactory::getModel("logs");
     $data = $model->read($filename);
     $data = htmlspecialchars($data, ENT_QUOTES, 'UTF-8');
     $view = $this->getView("logs", 'html');
     $view->setLayout("edit");
     $view->assign('filename', $filename);
     $view->assign('data', $data);
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeEditLogs', array(&$view));
     $view->displayEdit();
 }
Exemplo n.º 21
0
 function display($cachable = false, $urlparams = false)
 {
     $jshopConfig = JSFactory::getConfig();
     $_statisctic = JSFactory::getModel("statistic");
     $rows = $_statisctic->getAllOrderStatus();
     $today = $_statisctic->getOrderStatistics('day');
     $week = $_statisctic->getOrderStatistics('week');
     $month = $_statisctic->getOrderStatistics('month');
     $year = $_statisctic->getOrderStatistics('year');
     $category = $_statisctic->getCategoryStatistics();
     $manufacture = $_statisctic->getManufactureStatistics();
     $product = $_statisctic->getProductStatistics();
     $pr_instok = $_statisctic->getProductStatistics('1');
     $pr_outstok = $_statisctic->getProductStatistics('2');
     $pr_download = $_statisctic->getProductDownloadStatistics();
     $customer = $_statisctic->getUsersStatistics();
     $customer_enabled = $_statisctic->getUsersStatistics('1');
     $customer_loggedin = $_statisctic->getUsersStatistics('2');
     $stuff1 = $_statisctic->getUsersStaffStatistics('1');
     $stuff2 = $_statisctic->getUsersStaffStatistics('2');
     $stuff3 = $_statisctic->getUsersStaffStatistics('3');
     $usergroups = $_statisctic->getUserGroupsStatistics();
     $view = $this->getView("statistic", 'html');
     $view->assign('rows', $rows);
     $view->assign('today', $today);
     $view->assign('week', $week);
     $view->assign('month', $month);
     $view->assign('year', $year);
     $view->assign('paid_status', $jshopConfig->payment_status_enable_download_sale_file);
     $view->assign('category', $category);
     $view->assign('manufacture', $manufacture);
     $view->assign('product', $product);
     $view->assign('pr_instok', $pr_instok);
     $view->assign('pr_outstok', $pr_outstok);
     $view->assign('pr_download', $pr_download);
     $view->assign('customer', $customer);
     $view->assign('customer_enabled', $customer_enabled);
     $view->assign('customer_loggedin', $customer_loggedin);
     $view->assign('stuff1', $stuff1);
     $view->assign('stuff2', $stuff2);
     $view->assign('stuff3', $stuff3);
     $view->assign('usergroups', $usergroups);
     $view->sidebar = JHtmlSidebar::render();
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeDisplayStatistic', array(&$view));
     $view->display();
 }
Exemplo n.º 22
0
 function edit()
 {
     $jshopConfig = JSFactory::getConfig();
     $db = JFactory::getDBO();
     $attr_id = JRequest::getInt("attr_id");
     $attribut = JSFactory::getTable('attribut', 'jshop');
     $attribut->load($attr_id);
     if (!$attribut->independent) {
         $attribut->independent = 0;
     }
     $_lang = JSFactory::getModel("languages");
     $languages = $_lang->getAllLanguages(1);
     $multilang = count($languages) > 1;
     $types[] = JHTML::_('select.option', '1', 'Select', 'attr_type_id', 'attr_type');
     $types[] = JHTML::_('select.option', '2', 'Radio', 'attr_type_id', 'attr_type');
     $type_attribut = JHTML::_('select.genericlist', $types, 'attr_type', 'class = "inputbox" size = "1"', 'attr_type_id', 'attr_type', $attribut->attr_type);
     $dependent[] = JHTML::_('select.option', '0', _JSHOP_YES, 'id', 'name');
     $dependent[] = JHTML::_('select.option', '1', _JSHOP_NO, 'id', 'name');
     $dependent_attribut = JHTML::_('select.radiolist', $dependent, 'independent', 'class = "inputbox" size = "1"', 'id', 'name', $attribut->independent);
     $all = array();
     $all[] = JHTML::_('select.option', 1, _JSHOP_ALL, 'id', 'value');
     $all[] = JHTML::_('select.option', 0, _JSHOP_SELECTED, 'id', 'value');
     if (!isset($attribut->allcats)) {
         $attribut->allcats = 1;
     }
     $lists['allcats'] = JHTML::_('select.radiolist', $all, 'allcats', 'onclick="PFShowHideSelectCats()"', 'id', 'value', $attribut->allcats);
     $categories_selected = $attribut->getCategorys();
     $categories = buildTreeCategory(0, 1, 0);
     $lists['categories'] = JHTML::_('select.genericlist', $categories, 'category_id[]', 'class="inputbox" size="10" multiple = "multiple"', 'category_id', 'name', $categories_selected);
     $mgroups = JSFactory::getModel("attributesgroups");
     $groups = $mgroups->getList();
     $groups0 = array();
     $groups0[] = JHTML::_('select.option', 0, "- - -", 'id', 'name');
     $lists['group'] = JHTML::_('select.genericlist', array_merge($groups0, $groups), 'group', 'class="inputbox"', 'id', 'name', $attribut->group);
     JFilterOutput::objectHTMLSafe($attribut, ENT_QUOTES);
     $view = $this->getView("attributes", 'html');
     $view->setLayout("edit");
     $view->assign('attribut', $attribut);
     $view->assign('type_attribut', $type_attribut);
     $view->assign('dependent_attribut', $dependent_attribut);
     $view->assign('languages', $languages);
     $view->assign('multilang', $multilang);
     $view->assign('lists', $lists);
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeEditAtribut', array(&$view, &$attribut));
     $view->displayEdit();
 }
Exemplo n.º 23
0
 function showAdminFormParams($params)
 {
     $array_params = array('testmode', 'email_received', 'transaction_end_status', 'transaction_pending_status', 'transaction_failed_status');
     foreach ($array_params as $key) {
         if (!isset($params[$key])) {
             $params[$key] = '';
         }
     }
     if (!isset($params['use_ssl'])) {
         $params['use_ssl'] = 0;
     }
     if (!isset($params['address_override'])) {
         $params['address_override'] = 0;
     }
     $orders = JSFactory::getModel('orders', 'JshoppingModel');
     //admin model
     include dirname(__FILE__) . "/adminparamsform.php";
 }
Exemplo n.º 24
0
 function edit()
 {
     $id = JRequest::getInt("id");
     $productfieldgroup = JSFactory::getTable('productFieldGroup', 'jshop');
     $productfieldgroup->load($id);
     $_lang = JSFactory::getModel("languages");
     $languages = $_lang->getAllLanguages(1);
     $multilang = count($languages) > 1;
     $view = $this->getView("product_field_groups", 'html');
     $view->setLayout("edit");
     JFilterOutput::objectHTMLSafe($productfieldgroup, ENT_QUOTES);
     $view->assign('row', $productfieldgroup);
     $view->assign('languages', $languages);
     $view->assign('multilang', $multilang);
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeEditProductFieldGroups', array(&$view));
     $view->displayEdit();
 }
Exemplo n.º 25
0
 function display($cachable = false, $urlparams = false)
 {
     $db = JFactory::getDBO();
     $mainframe = JFactory::getApplication();
     $context = "jshoping.list.admin.taxes";
     $filter_order = $mainframe->getUserStateFromRequest($context . 'filter_order', 'filter_order', "tax_name", 'cmd');
     $filter_order_Dir = $mainframe->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', "asc", 'cmd');
     $taxes = JSFactory::getModel("taxes");
     $rows = $taxes->getAllTaxes($filter_order, $filter_order_Dir);
     $view = $this->getView("taxes", 'html');
     $view->setLayout("list");
     $view->assign('rows', $rows);
     $view->assign('filter_order', $filter_order);
     $view->assign('filter_order_Dir', $filter_order_Dir);
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeDisplayTaxes', array(&$view));
     $view->displayList();
 }
Exemplo n.º 26
0
 /**
  * This method is called for each of the shipping methods options in the checkout
  * (and also on subsequent pages for the chosen method)
  */
 function getPrices($cart, $params, $prices, &$shipping_ext_row, &$shipping_method_price)
 {
     $weight = $cart->getWeightProducts();
     $id = $shipping_method_price->shipping_method_id;
     $type = plgSystemCorreios::getShippingMethodName($id);
     // Redirect the page stright to payment methods if weight is zero
     if ($weight == 0) {
         static $done = false;
         if (!$done) {
             $done = true;
             $url = JSFactory::getModel('checkoutStep', 'jshop')->getCheckoutUrl('step4save');
             header("Location: {$url}?sh_pr_method_id={$id}");
         }
     }
     // Check if all products are in cats that allow carta registrada and that all are 500g or less
     plgSystemCorreios::$allbooks = true;
     foreach ($cart->products as $item) {
         if (!in_array($item['category_id'], plgSystemCorreios::$bookCats) || $item['weight'] > 0.5) {
             plgSystemCorreios::$allbooks = false;
         }
     }
     // If it's one of ours, calculate the price
     if ($type == 'PAC') {
         $prices['shipping'] = $this->getFreightPrice($weight, 1);
         $prices['package'] = 0;
     } elseif ($type == 'SEDEX') {
         $prices['shipping'] = $this->getFreightPrice($weight, 2);
         $prices['package'] = 0;
     } elseif (preg_match('/carta\\s*registrada/i', $type)) {
         $packages = plgSystemCorreios::makeCartaPackages($cart->products);
         $costs = preg_match('/módico/i', $type) ? plgSystemCorreios::$cartaPricesMod : plgSystemCorreios::$cartaPrices;
         $price = 0;
         foreach ($packages as $package) {
             $weight = $package[0];
             $i = 50 * (int) ($weight * 20);
             // price divisions are in multiples of 50 grams
             $price += $costs[$i];
         }
         $prices['shipping'] = $price;
         $prices['package'] = 0;
     }
     return $prices;
 }
Exemplo n.º 27
0
 function view()
 {
     $model = JSFactory::getModel('contentPage', 'jshop');
     $page = JRequest::getVar('page');
     $order_id = JRequest::getInt('order_id');
     $cartp = JRequest::getInt('cart');
     $seodata = JshopHelpersMetadata::content($page);
     $model->setSeodata($seodata);
     $text = $model->load($page, $order_id, $cartp);
     if ($text === false) {
         JError::raiseError(404, $model->getError());
         return 0;
     }
     $view = $this->getView("content");
     $view->setLayout("content");
     $view->assign('text', $text);
     JDispatcher::getInstance()->trigger('onBeforeDisplayContentView', array(&$view));
     $view->display();
 }
 function edit()
 {
     $jshopConfig = JSFactory::getConfig();
     $db = JFactory::getDBO();
     $id = JRequest::getInt("id");
     $attribut = JSFactory::getTable('freeattribut', 'jshop');
     $attribut->load($id);
     $_lang = JSFactory::getModel("languages");
     $languages = $_lang->getAllLanguages(1);
     $multilang = count($languages) > 1;
     JFilterOutput::objectHTMLSafe($attribut, ENT_QUOTES);
     $view = $this->getView("freeattributes", 'html');
     $view->setLayout("edit");
     $view->assign('attribut', $attribut);
     $view->assign('languages', $languages);
     $view->assign('multilang', $multilang);
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeEditFreeAtribut', array(&$view, &$attribut));
     $view->displayEdit();
 }
Exemplo n.º 29
0
 function display($cachable = false, $urlparams = false)
 {
     checkAccessController("info");
     addSubmenu("info");
     $jshopConfig = JSFactory::getConfig();
     $data = JApplicationHelper::parseXMLInstallFile($jshopConfig->admin_path . "jshopping.xml");
     if ($jshopConfig->display_updates_version) {
         $update_model = JSFactory::getModel("info");
         $update = $update_model->getUpdateObj($data['version'], $jshopConfig);
     } else {
         $update = new stdClass();
     }
     $view = $this->getView("panel", 'html');
     $view->setLayout("info");
     $view->assign("data", $data);
     $view->assign("update", $update);
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeDisplayInfo', array(&$view));
     $view->displayInfo();
 }
Exemplo n.º 30
0
 function edit()
 {
     $status_id = JRequest::getInt("status_id");
     $order_status = JSFactory::getTable('orderStatus', 'jshop');
     $order_status->load($status_id);
     $edit = $status_id ? $edit = 1 : ($edit = 0);
     $_lang = JSFactory::getModel("languages");
     $languages = $_lang->getAllLanguages(1);
     $multilang = count($languages) > 1;
     JFilterOutput::objectHTMLSafe($order_status, ENT_QUOTES);
     $view = $this->getView("orderstatus", 'html');
     $view->setLayout("edit");
     $view->assign('order_status', $order_status);
     $view->assign('edit', $edit);
     $view->assign('languages', $languages);
     $view->assign('multilang', $multilang);
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeEditOrderStatus', array(&$view));
     $view->displayEdit();
 }