Spade
Mini Shell
PK�"�[G�5�..
access.xmlnu�[���<?xml version="1.0"
encoding="utf-8"?>
<access component="com_phocacart">
<section name="component">
<action name="core.admin" title="JAction_Admin"
description="JAction_Admin_Component_Desc" />
<action name="core.admin" title="JAction_Admin"
description="JAction_Admin_Component_Desc" />
<action name="core.manage" title="JAction_Manage"
description="JAction_Manage_Component_Desc" />
<action name="core.create" title="JAction_Create"
description="JAction_Create_Component_Desc" />
<action name="core.delete" title="JAction_Delete"
description="JAction_Delete_Component_Desc" />
<action name="core.edit" title="JAction_Edit"
description="JAction_Edit_Component_Desc" />
<action name="core.edit.state"
title="JACTION_EDITSTATE"
description="JAction_EditState_Component_Desc" />
</section>
</access>PK�"�[b�`�����
config.xmlnu�[���<?xml version="1.0"
encoding="utf-8"?>
<config>
<fields
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fieldset name="display"
label="COM_PHOCACART_CONFIG_HEAD_DISPLAY_LABEL">
<field name="phocahead1"
type="phocahead"
default="COM_PHOCACART_CATEGORIES_VIEW_LABEL" label=""
description=""/>
<field name="columns_cats" type="list"
default="3"
label="COM_PHOCACART_FIELD_COLUMNS_CATEGORIES_VIEW_LABEL"
description="COM_PHOCACART_FIELD_COLUMNS_CATEGORIES_VIEW_DESC">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="6">6</option>
<option value="12">12</option>
</field>
<field name="csv_display_subcategories"
default="0" size="10" type="text"
label="COM_PHOCACART_FIELD_DISPLAY_SUBCATEGORIES_CSV_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_SUBCATEGORIES_CSV_DESC"/>
<field name="csv_display_category_desc"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_CATEGORY_DESCRIPTION_CSV_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_CATEGORY_DESCRIPTION_CSV_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="image_width_cats"
default="" size="10" type="text"
label="COM_PHOCACART_FIELD_IMAGE_WIDTH_CATEGORIES_VIEW_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_WIDTH_CATEGORIES_VIEW_DESC"/>
<field name="image_height_cats"
default="" size="10" type="text"
label="COM_PHOCACART_FIELD_IMAGE_HEIGHT_CATEGORIES_VIEW_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_HEIGHT_CATEGORIES_VIEW_DESC"/>
<field name="display_view_category_button"
type="list" default="1"
label="COM_PHOCACART_FIELD_DISPLAY_VIEW_CATEGORY_BUTTON_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_VIEW_CATEGORY_BUTTON_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
<option
value="2">COM_PHOCACART_YES_ICON_ONLY</option>
</field>
<field name="display_category_header" type="list"
default="h3"
label="COM_PHOCACART_FIELD_DISPLAY_CATEGORY_HEADER_CATEGORIES_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_CATEGORY_HEADER_CATEGORIES_DESC">
<option value="h1">h1</option>
<option value="h2">h2</option>
<option value="h3">h3</option>
<option value="h4">h4</option>
<option value="h5">h5</option>
<option value="h6">h6</option>
<option value="div">div</option>
<option value="p">p</option>
<option
value="-1">COM_PHOCACART_HIDE_HEADER</option>
</field>
<field name="category_name_link"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_CATEGORY_NAME_AS_LINK_LABEL"
description="COM_PHOCACART_FIELD_CATEGORY_NAME_AS_LINK_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="categories_view_layout"
type="radio" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_CATEGORIES_VIEW_LAYOUT_LABEL"
description="COM_PHOCACART_FIELD_CATEGORIES_VIEW_LAYOUT_DESC">
<option
value="1">COM_PHOCACART_STANDARD</option>
<option
value="2">COM_PHOCACART_COLSPAN</option>
</field>
<field name="lazy_load_categories" type="radio"
class="btn-group btn-group-yesno" default="0"
label="COM_PHOCACART_FIELD_LAZY_LOAD_IMAGES_CATEGORIES_VIEW_LABEL"
description="COM_PHOCACART_FIELD_LAZY_LOAD_IMAGES_CATEGORIES_VIEW_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="image_categories_view" type="media"
default="" directoryimg="1"
label="COM_PHOCACART_FIELD_IMAGE_CATEGORIES_VIEW_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_CATEGORIES_VIEW_DESC"/>
<!--
<field name="phocahead2"
type="phocahead"
default="COM_PHOCACART_CATEGORY_VIEW_LABEL" label=""
description=""/>
<field name="category_addtocart"
type="list" default="1"
label="COM_PHOCACART_FIELD_ADD_TO_CART_CATEGORY_VIEW_LABEL"
description="COM_PHOCACART_FIELD_ADD_TO_CART_CATEGORY_VIEW_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES_STANDARD</option>
<option
value="4">COM_PHOCACART_YES_STANDARD_ICON_ONLY</option>
<option
value="2">COM_PHOCACART_YES_BUY_NOW_PADDLE</option>
<option
value="3">COM_PHOCACART_YES_EXTERNAL_LINK</option>
</field>
<field name="phocahead3"
type="phocahead"
default="COM_PHOCACART_ITEMS_VIEW_LABEL" label=""
description=""/>
<field name="items_addtocart"
type="list" default="1"
label="COM_PHOCACART_FIELD_ADD_TO_CART_ITEMS_VIEW_LABEL"
description="COM_PHOCACART_FIELD_ADD_TO_CART_ITEMS_VIEW_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES_STANDARD</option>
<option
value="4">COM_PHOCACART_YES_STANDARD_ICON_ONLY</option>
<option
value="2">COM_PHOCACART_YES_BUY_NOW_PADDLE</option>
<option
value="3">COM_PHOCACART_YES_EXTERNAL_LINK</option>
</field>
-->
<field name="phocahead4"
type="phocahead"
default="COM_PHOCACART_CATEGORY_AND_ITEMS_VIEW_LABEL"
label="" description=""/>
<field name="columns_cat" type="list"
default="3"
label="COM_PHOCACART_FIELD_COLUMNS_CATEGORY_ITEMS_VIEW_LABEL"
description="COM_PHOCACART_FIELD_COLUMNS_CATEGORY_ITEMS_VIEW_DESC">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="6">6</option>
<option value="12">12</option>
</field>
<field name="cv_display_subcategories"
default="0" size="10" type="text"
label="COM_PHOCACART_FIELD_DISPLAY_SUBCATEGORIES_CV_ITEMS_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_SUBCATEGORIES_CV_ITEMS_DESC"/>
<field name="cv_subcategories_layout"
type="radio" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_SUBCATEGORIES_LAYOUT_LABEL"
description="COM_PHOCACART_FIELD_SUBCATEGORIES_LAYOUT_DESC">
<option
value="1">COM_PHOCACART_LISTS</option>
<option
value="2">COM_PHOCACART_IMAGE_BOXES</option>
</field>
<field name="columns_subcat_cat"
type="list" default="3"
label="COM_PHOCACART_FIELD_COLUMNS_SUBCATEGORIES_CATEGORY_VIEW_LABEL"
description="COM_PHOCACART_FIELD_COLUMNS_SUBCATEGORIES_CATEGORY_VIEW_DESC">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="6">6</option>
<option value="12">12</option>
</field>
<field name="cv_display_description"
type="radio" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_DISPLAY_PRODUCT_DESCRIPTION_CATEGORY_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_PRODUCT_DESCRIPTION_CATEGORY_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="display_product_header"
type="list" default="h3"
label="COM_PHOCACART_FIELD_DISPLAY_PRODUCT_HEADER_CATEGORY_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_PRODUCT_HEADER_CATEGORY_DESC">
<option value="h1">h1</option>
<option value="h2">h2</option>
<option value="h3">h3</option>
<option value="h4">h4</option>
<option value="h5">h5</option>
<option value="h6">h6</option>
<option value="div">div</option>
<option value="p">p</option>
<option
value="-1">COM_PHOCACART_HIDE_HEADER</option>
</field>
<field name="category_addtocart"
type="list" default="1"
label="COM_PHOCACART_FIELD_ADD_TO_CART_CATEGORY_ITEMS_VIEW_LABEL"
description="COM_PHOCACART_FIELD_ADD_TO_CART_CATEGORY_ITEMS_VIEW_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES_STANDARD</option>
<option
value="4">COM_PHOCACART_YES_STANDARD_ICON_ONLY</option>
<option
value="102">COM_PHOCACART_YES_BUY_NOW_PADDLE</option>
<option
value="103">COM_PHOCACART_YES_EXTERNAL_LINK</option>
<option
value="104">COM_PHOCACART_YES_QUICK_VIEW_BUTTON</option>
</field>
<field name="hide_attributes_category"
default="1" type="radio" class="btn-group
btn-group-yesno"
label="COM_PHOCACART_FIELD_HIDE_ATTRIBUTES_CATEGORY_LABEL"
description="COM_PHOCACART_FIELD_HIDE_ATTRIBUTES_CATEGORY_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="item_ordering" type="list"
default="1"
label="COM_PHOCACART_FIELD_PRODUCT_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_ORDERING_DESC">
<option
value="1">COM_PHOCACART_ORDERING_ASC</option>
<option
value="2">COM_PHOCACART_ORDERING_DESC</option>
<option
value="3">COM_PHOCACART_TITLE_ASC</option>
<option
value="4">COM_PHOCACART_TITLE_DESC</option>
<option
value="5">COM_PHOCACART_PRICE_ASC</option>
<option
value="6">COM_PHOCACART_PRICE_DESC</option>
<option
value="7">COM_PHOCACART_DATE_ASC</option>
<option
value="8">COM_PHOCACART_DATE_DESC</option>
<option
value="21">COM_PHOCACART_DATE_UPDATED_ASC</option>
<option
value="22">COM_PHOCACART_DATE_UPDATED_DESC</option>
<option
value="9">COM_PHOCACART_RATING_ASC</option>
<option
value="10">COM_PHOCACART_RATING_DESC</option>
<option
value="19">COM_PHOCACART_SKU_ASC</option>
<option
value="20">COM_PHOCACART_SKU_DESC</option>
<option
value="13">COM_PHOCACART_MOST_POPULAR_ASC</option>
<option
value="14">COM_PHOCACART_MOST_POPULAR_DESC</option>
<option
value="15">COM_PHOCACART_MOST_VIEWED_ASC</option>
<option
value="16">COM_PHOCACART_MOST_VIEWED_DESC</option>
</field>
<field name="item_ordering_values"
default="1,2,3,4,5,6,7,8,21,22,9,10,19,20" size="18"
type="text"
label="COM_PHOCACART_FIELD_PRODUCT_ORDERING_VALUES_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_ORDERING_VALUES_DESC"/>
<field name="ordering_asc_desc_arrows"
default="0" type="radio" class="btn-group
btn-group-yesno"
label="COM_PHOCACART_FIELD_ORDERING_ASC_DESC_ARROWS_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_ASC_DESC_ARROWS_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="show_pagination"
type="radio" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_DISPLAY_PAGINATION_CATEGORY_ITEMS_VIEW_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_PAGINATION_CATEGORY_ITEMS_VIEW_DESC">
<option
value="0">COM_PHOCACART_HIDE</option>
<option
value="1">COM_PHOCACART_DISPLAY</option>
</field>
<field name="show_pagination_top"
type="radio" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_DISPLAY_PAGINATION_TOP_CATEGORY_ITEMS_VIEW_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_PAGINATION_TOP_CATEGORY_ITEMS_VIEW_DESC">
<option
value="0">COM_PHOCACART_HIDE</option>
<option
value="1">COM_PHOCACART_DISPLAY</option>
</field>
<field name="show_pagination_limit"
class="btn-group btn-group-yesno" type="radio"
default="1"
label="COM_PHOCACART_FIELD_DISPLAY_SELECT_CATEGORY_ITEMS_VIEW_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_SELECT_CATEGORY_ITEMS_VIEW_DESC">
<option
value="0">COM_PHOCACART_HIDE</option>
<option
value="1">COM_PHOCACART_DISPLAY</option>
</field>
<field name="show_pagination_limit_top"
class="btn-group btn-group-yesno" type="radio"
default="1"
label="COM_PHOCACART_FIELD_DISPLAY_SELECT_TOP_CATEGORY_ITEMS_VIEW_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_SELECT_TOP_CATEGORY_ITEMS_VIEW_DESC">
<option
value="0">COM_PHOCACART_HIDE</option>
<option
value="1">COM_PHOCACART_DISPLAY</option>
</field>
<field name="display_item_ordering"
class="btn-group btn-group-yesno" type="radio"
default="1"
label="COM_PHOCACART_FIELD_DISPLAY_ORDERING_CATEGORY_ITEMS_VIEW_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_ORDERING_CATEGORY_ITEMS_VIEW_DESC">
<option
value="0">COM_PHOCACART_HIDE</option>
<option
value="1">COM_PHOCACART_DISPLAY</option>
</field>
<field name="display_item_ordering_top"
class="btn-group btn-group-yesno" type="radio"
default="1"
label="COM_PHOCACART_FIELD_DISPLAY_ORDERING_TOP_CATEGORY_ITEMS_VIEW_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_ORDERING_TOP_CATEGORY_ITEMS_VIEW_DESC">
<option
value="0">COM_PHOCACART_HIDE</option>
<option
value="1">COM_PHOCACART_DISPLAY</option>
</field>
<field name="ajax_pagination_category"
class="btn-group btn-group-yesno" type="radio"
default="0"
label="COM_PHOCACART_FIELD_AJAX_PAGINATION_CATEGORY_ITEMS_VIEW_LABEL"
description="COM_PHOCACART_FIELD_AJAX_PAGINATION_CATEGORY_ITEMS_VIEW_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<field name="ajax_searching_filtering_items"
class="btn-group btn-group-yesno" type="radio"
default="0"
label="COM_PHOCACART_FIELD_AJAX_SEARCHING_FILTERING_ITEMS_VIEW_LABEL"
description="COM_PHOCACART_FIELD_AJAX_SEARCHING_FILTERING_ITEMS_VIEW_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<field name="display_pagination_labels"
type="radio" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_DISPLAY_PAGINATION_LABELS_CATEGORY_ITEMS_VIEW_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_PAGINATION_LABELS_CATEGORY_ITEMS_VIEW_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="layout_type" type="list"
default="grid"
label="COM_PHOCACART_FIELD_DEFAULT_LAYOUT_CATEGORY_ITEMS_LABEL"
description="COM_PHOCACART_FIELD_DEFAULT_LAYOUT_CATEGORY_ITEMS_DESC">
<option
value="grid">COM_PHOCACART_GRID</option>
<option
value="gridlist">COM_PHOCACART_GRID_LIST</option>
<option
value="list">COM_PHOCACART_LIST</option>
</field>
<field name="show_switch_layout_type" class="btn-group
btn-group-yesno" type="radio" default="1"
label="COM_PHOCACART_FIELD_DISPLAY_SWITCH_LAYOUT_TYPE_CATEGORY_ITEMS_VIEW_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_SWITCH_LAYOUT_TYPE_CATEGORY_ITEMS_VIEW_DESC">
<option
value="0">COM_PHOCACART_HIDE</option>
<option
value="1">COM_PHOCACART_DISPLAY</option>
</field>
<field name="category_layout_plugin"
type="PhocaCartLayoutPlugin" typeview="category"
default="" class="inputbox"
label="COM_PHOCACART_FIELD_CATEGORY_LAYOUT_PLUGIN_LABEL"
description="COM_PHOCACART_FIELD_CATEGORY_LAYOUT_PLUGIN_DESC"
/>
<field name="items_layout_plugin"
type="PhocaCartLayoutPlugin" typeview="items"
default="" class="inputbox"
label="COM_PHOCACART_FIELD_ITEMS_LAYOUT_PLUGIN_LABEL"
description="COM_PHOCACART_FIELD_ITEMS_LAYOUT_PLUGIN_DESC" />
<field name="item_pagination"
default="5,10,15,20,50" size="18" type="text"
label="COM_PHOCACART_FIELD_PRODUCT_PAGINATION_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_PAGINATION_DESC"/>
<field name="item_pagination_default"
default="20" size="18" type="text"
label="COM_PHOCACART_FIELD_DEFAULT_VALUE_PAGINATION_PRODUCTS_LABEL"
description="COM_PHOCACART_FIELD_DEFAULT_VALUE_PAGINATION_PRODUCTS_DESC"/>
<field name="item_pagination_limit"
class="btn-group btn-group-yesno" type="radio"
default="0"
label="COM_PHOCACART_FIELD_PRODUCT_PAGINATION_LIMIT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_PAGINATION_LIMIT_DESC">
<option
value="0">COM_PHOCACART_DISABLE</option>
<option
value="1">COM_PHOCACART_ENABLE</option>
</field>
<field name="image_width_cat" default=""
size="10" type="text"
label="COM_PHOCACART_FIELD_IMAGE_WIDTH_CATEGORY_ITEMS_VIEW_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_WIDTH_CATEGORY_ITEMS_VIEW_DESC"/>
<field name="image_height_cat"
default="" size="10" type="text"
label="COM_PHOCACART_FIELD_IMAGE_HEIGHT_CATEGORY_ITEMS_VIEW_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_HEIGHT_CATEGORY_ITEMS_VIEW_DESC"/>
<field name="display_view_product_button"
type="list" default="1"
label="COM_PHOCACART_FIELD_DISPLAY_VIEW_PRODUCT_BUTTON_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_VIEW_PRODUCT_BUTTON_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
<option
value="2">COM_PHOCACART_YES_ICON_ONLY</option>
</field>
<field name="display_star_rating"
type="list" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_STAR_RATING_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_STAR_RATING_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="2">COM_PHOCACART_YES_INCLUDING_INACTIVE_RATING</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="product_name_link"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_PRODUCT_NAME_AS_LINK_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_NAME_AS_LINK_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="switch_image_category_items"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_SWITCH_IMAGE_CATEGORY_ITEMS_VIEW_LABEL"
description="COM_PHOCACART_FIELD_SWITCH_IMAGE_CATEGORY_ITEMS_VIEW_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="lazy_load_category_items"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_LAZY_LOAD_IMAGES_CATEGORY_ITEMS_VIEW_LABEL"
description="COM_PHOCACART_FIELD_LAZY_LOAD_IMAGES_CATEGORY_ITEMS_VIEW_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="join_tag_label_filter" type="radio"
class="btn-group btn-group-yesno" default="0"
label="COM_PHOCACART_FIELD_JOIN_TAG_LABEL_FILTER_LABEL"
description="COM_PHOCACART_FIELD_JOIN_TAG_LABEL_FILTER_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="category_askquestion"
type="list" default="0"
label="COM_PHOCACART_FIELD_ASK_A_QUESTION_BUTTON_CATEGORY_VIEW_LABEL"
description="COM_PHOCACART_FIELD_ASK_A_QUESTION_BUTTON_CATEGORY_VIEW_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
<option
value="2">COM_PHOCACART_YES_ONLY_IF_ADD_TO_CART_NOT_DISPLAYED</option>
</field>
<field name="category_display_labels"
type="list" default="1"
label="COM_PHOCACART_FIELD_DISPLAY_LABELS_CATEGORY_VIEW_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_LABELS_CATEGORY_VIEW_DESC">
<option
value="2">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
<option
value="3">COM_PHOCACART_YES_TAGS_AND_LABELS</option>
</field>
<field name="category_display_tags" type="list"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_TAGS_CATEGORY_VIEW_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_TAGS_CATEGORY_VIEW_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="category_display_manufacturer"
type="list" default="0"
label="COM_PHOCACART_FIELD_DISPLAY_MANUFACTURER_CATEGORY_VIEW_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_MANUFACTURER_CATEGORY_VIEW_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="2">COM_PHOCACART_YES_INCLUDING_SEARCH_LINK</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="image_items_view" type="media"
default="" directoryimg="1"
label="COM_PHOCACART_FIELD_IMAGE_ITEMS_VIEW_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_ITEMS_VIEW_DESC"/>
<field name="phocahead5"
type="phocahead"
default="COM_PHOCACART_ITEM_VIEW_LABEL" label=""
description=""/>
<field name="item_addtocart" type="list"
default="1"
label="COM_PHOCACART_FIELD_ADD_TO_CART_ITEM_VIEW_LABEL"
description="COM_PHOCACART_FIELD_ADD_TO_CART_ITEM_VIEW_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES_STANDARD</option>
<option
value="4">COM_PHOCACART_YES_STANDARD_ICON_ONLY</option>
<option
value="102">COM_PHOCACART_YES_BUY_NOW_PADDLE</option>
<option
value="103">COM_PHOCACART_YES_EXTERNAL_LINK</option>
</field>
<field name="hide_attributes_item"
default="0" type="radio" class="btn-group
btn-group-yesno"
label="COM_PHOCACART_FIELD_HIDE_ATTRIBUTES_ITEM_LABEL"
description="COM_PHOCACART_FIELD_HIDE_ATTRIBUTES_ITEM_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="enable_item_navigation"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_NAVIGATION_ITEM_VIEW_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_NAVIGATION_ITEM_VIEW_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="tags_links" type="list"
default="0"
label="COM_PHOCACART_FIELD_TAGS_LINKS_LABEL"
description="COM_PHOCACART_FIELD_TAGS_LINKS_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_EXTERNAL_LINK</option>
<option
value="2">COM_PHOCACART_CATEGORY_LINK</option>
<option
value="3">COM_PHOCACART_SEARCH_OUTCOME</option>
</field>
<field name="item_display_labels"
type="list" default="1"
label="COM_PHOCACART_FIELD_DISPLAY_LABELS_ITEM_VIEW_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_LABELS_ITEM_VIEW_DESC">
<option
value="2">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
<option
value="3">COM_PHOCACART_YES_TAGS_AND_LABELS</option>
</field>
<field name="item_display_tags"
type="list" default="1"
label="COM_PHOCACART_FIELD_DISPLAY_TAGS_ITEM_VIEW_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_TAGS_ITEM_VIEW_LABEL">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="item_display_parameters" type="list"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_PARAMETERS_ITEM_VIEW_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_PARAMETERS_ITEM_VIEW_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="item_askquestion"
type="list" default="0"
label="COM_PHOCACART_FIELD_ASK_A_QUESTION_BUTTON_ITEM_VIEW_LABEL"
description="COM_PHOCACART_FIELD_ASK_A_QUESTION_BUTTON_ITEM_VIEW_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
<option
value="2">COM_PHOCACART_YES_ONLY_IF_ADD_TO_CART_NOT_DISPLAYED</option>
</field>
<field name="display_public_download"
type="radio" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_DISPLAY_PUBLIC_DOWNLOAD_BUTTON_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_PUBLIC_DOWNLOAD_BUTTON_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="display_file_play" type="radio"
class="btn-group btn-group-yesno" default="1"
label="COM_PHOCACART_FIELD_DISPLAY_FILE_PLAY_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_FILE_PLAY_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="display_external_link"
type="radio" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_DISPLAY_EXTERNAL_LINK_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_EXTERNAL_LINK_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="title_next_prev"
type="list" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_NEXT_PREVIOUS_TITLE_LABEL"
description="COM_PHOCACART_FIELD_NEXT_PREVIOUS_TITLE_DESC">
<option
value="1">COM_PHOCACART_YES_INCLUDING_PRODUCT_NAME</option>
<option
value="2">COM_PHOCACART_YES_EXCLUDING_PRODUCT_NAME</option>
<option
value="3">COM_PHOCACART_YES_ONLY_PRODUCT_NAME</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="enable_price_history"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_PRODUCT_PRICE_HISTORY_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_PRODUCT_PRICE_HISTORY_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="item_display_size_options"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_SIZE_OPTIONS_ITEM_VIEW_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_SIZE_OPTIONS_ITEM_VIEW_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="item_display_delivery_date"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_DELIVERY_DATE_ITEM_VIEW_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_DELIVERY_DATE_ITEM_VIEW_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="phocahead6"
type="phocahead"
default="COM_PHOCACART_CHECKOUT_VIEW_LABEL" label=""
description=""/>
<field name="checkout_desc"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_CHECKOUT_DESCRIPTION_LABEL"
description="COM_PHOCACART_FIELD_CHECKOUT_DESCRIPTION_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="display_shipping_desc"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_SHIPPING_DESCRIPTION_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_SHIPPING_DESCRIPTION_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="zero_shipping_price"
type="list" default="1"
label="COM_PHOCACART_FIELD_ZERO_SHIPPING_PRICE_LABEL"
description="COM_PHOCACART_FIELD_ZERO_SHIPPING_PRICE_DESC">
<option
value="1">COM_PHOCACART_DISPLAY_PRICE</option>
<option
value="2">COM_PHOCACART_DISPLAY_FREE_TEXT</option>
<option
value="0">COM_PHOCACART_DISPLAY_BLANK_PRICE_FIELD</option>
</field>
<field name="zero_shipping_price_calculation"
type="list" default="0"
label="COM_PHOCACART_FIELD_ZERO_SHIPPING_PRICE_CALCULATION_LABEL"
description="COM_PHOCACART_FIELD_ZERO_SHIPPING_PRICE_CALCULATION_DESC">
<option
value="1">COM_PHOCACART_DISPLAY_PRICE</option>
<option
value="2">COM_PHOCACART_DISPLAY_FREE_TEXT</option>
<option
value="0">COM_PHOCACART_DISPLAY_BLANK_PRICE_FIELD</option>
<option
value="-1">COM_PHOCACART_HIDE_COMPLETELY</option>
</field>
<field name="display_payment_desc"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_PAYMENT_DESCRIPTION_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_PAYMENT_DESCRIPTION_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="zero_payment_price"
type="list" default="1"
label="COM_PHOCACART_FIELD_ZERO_PAYMENT_PRICE_LABEL"
description="COM_PHOCACART_FIELD_ZERO_PAYMENT_PRICE_DESC">
<option
value="1">COM_PHOCACART_DISPLAY_PRICE</option>
<option
value="2">COM_PHOCACART_DISPLAY_FREE_TEXT</option>
<option
value="0">COM_PHOCACART_DISPLAY_BLANK_PRICE_FIELD</option>
</field>
<field name="zero_payment_price_calculation"
type="list" default="0"
label="COM_PHOCACART_FIELD_ZERO_PAYMENT_PRICE_CALCULATION_LABEL"
description="COM_PHOCACART_FIELD_ZERO_PAYMENT_PRICE_CALCULATION_DESC">
<option
value="1">COM_PHOCACART_DISPLAY_PRICE</option>
<option
value="2">COM_PHOCACART_DISPLAY_FREE_TEXT</option>
<option
value="0">COM_PHOCACART_DISPLAY_BLANK_PRICE_FIELD</option>
<option
value="-1">COM_PHOCACART_HIDE_COMPLETELY</option>
</field>
<field name="display_discount_product"
type="list" default="1"
label="COM_PHOCACART_FIELD_DISPLAY_DISCOUNT_PRICE_PRODUCT_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_DISCOUNT_PRICE_PRODUCT_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="enable_captcha_checkout"
type="list" class="btn-group btn-group-yesno"
default="2"
label="COM_PHOCACART_FIELD_ENABLE_CAPTCHA_CHECKOUT_LABEL"
description="COM_PHOCACART_FIELD_ENABLE_CAPTCHA_CHECKOUT_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_ALL_CUSTOMERS</option>
<option
value="2">COM_PHOCACART_GUESTS_ONLY</option>
</field>
<field name="checkout_scroll"
type="radio" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_SCROLL_CHECKOUT_LABEL"
description="COM_PHOCACART_FIELD_SCROLL_CHECKOUT_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="checkout_icon_status"
type="radio" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_CHECKOUT_STATUS_ICON_LABEL"
description="COM_PHOCACART_FIELD_CHECKOUT_STATUS_ICON_DESC">
<option
value="0">COM_PHOCACART_DEFAULT_ICONS</option>
<option
value="1">COM_PHOCACART_DEFAULT_NUMBERS</option>
</field>
<field name="display_reward_points_receive_info"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_REWARD_POINTS_INFO_RECEIVED_POINTS_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_REWARD_POINTS_INFO_RECEIVED_POINTS_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<field name="display_zero_total" type="radio"
class="btn-group btn-group-yesno" default="0"
label="COM_PHOCACART_FIELD_DISPLAY_ZERO_TOTAL_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_ZERO_TOTAL_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="display_apply_coupon_form"
type="list" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_APPLY_COUPON_FORM_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_APPLY_COUPON_FORM_DESC">
<option
value="1">COM_PHOCACART_IN_PAYMENT_METHOD_FORM</option>
<option
value="2">COM_PHOCACART_BEFORE_LOGIN_FORM</option>
<option
value="3">COM_PHOCACART_AFTER_LOGIN_FORM</option>
</field>
<field name="display_apply_reward_points_form"
type="list" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_APPLY_REWARD_POINTS_FORM_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_APPLY_REWARD_POINTS_FORM_DESC">
<option
value="1">COM_PHOCACART_IN_PAYMENT_METHOD_FORM</option>
<option
value="2">COM_PHOCACART_BEFORE_LOGIN_FORM</option>
<option
value="3">COM_PHOCACART_AFTER_LOGIN_FORM</option>
</field>
<field name="delivery_billing_same_enabled"
type="list" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_SAME_DELIVERY_BILLING_ADDRESS_CHECKED_LABEL"
description="COM_PHOCACART_SAME_DELIVERY_BILLING_ADDRESS_CHECKED_DESC">
<option
value="-1">COM_PHOCACART_DISABLED</option>
<option value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES_NEW_USERS</option>
<option
value="2">COM_PHOCACART_YES_NEW_GUEST_USERS</option>
<option
value="3">COM_PHOCACART_YES_NEW_USERS_NEW_GUEST_USERS</option>
</field>
<field name="phocahead30"
type="phocahead"
default="COM_PHOCACART_USER_ACCOUNT_VIEW_LABEL"
label="" description=""/>
<field name="display_reward_points_total_info"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_REWARD_POINTS_INFO_USER_ACCOUNT_VIEW_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_REWARD_POINTS_INFO_USER_ACCOUNT_VIEW_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<field name="phocahead31"
type="phocahead"
default="COM_PHOCACART_USER_ORDERS_VIEW_LABEL" label=""
description=""/>
<field name="display_reward_points_user_orders"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_REWARD_POINTS_INFO_USER_ORDERS_VIEW_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_REWARD_POINTS_INFO_USER_ORDERS_VIEW_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<field name="phocahead39" type="phocahead"
default="COM_PHOCACART_INFO_VIEW_LABEL" label=""
description=""/>
<field name="info_view_description"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_INFO_VIEW_DESCRIPTION_LABEL"
description="COM_PHOCACART_FIELD_INFO_VIEW_DESCRIPTION_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="phocahead7"
type="phocahead"
default="COM_PHOCACART_GENERAL_DISPLAY_OPTIONS_LABEL"
label="" description=""/>
<field name="main_description"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_MAIN_DESCRIPTION_LABEL"
description="COM_PHOCACART_FIELD_MAIN_DESCRIPTION_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="display_header_type"
type="list" default="h1"
label="COM_PHOCACART_FIELD_DISPLAY_HEADER_TYPE_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_HEADER_TYPE_DESC">
<option value="h1">h1</option>
<option value="h2">h2</option>
<option value="h3">h3</option>
<option value="h4">h4</option>
<option value="h5">h5</option>
<option value="h6">h6</option>
<option value="div">div</option>
<option value="p">p</option>
<option
value="-1">COM_PHOCACART_HIDE_HEADER</option>
</field>
<field name="hide_header_view"
type="list" default=""
label="COM_PHOCACART_FIELD_HIDE_HEADER_VIEW_LABEL"
description="COM_PHOCACART_FIELD_HIDE_HEADER_VIEW_DESC"
multiple="true">
<option
value="categories">COM_PHOCACART_CATEGORIES_LAYOUT</option>
<option
value="category">COM_PHOCACART_CATEGORY_LAYOUT</option>
<option
value="items">COM_PHOCACART_ITEM_LIST_LAYOUT</option>
<option
value="item">COM_PHOCACART_ITEM_LAYOUT</option>
<option
value="checkout">COM_PHOCACART_CHECKOUT_LAYOUT</option>
<option
value="account">COM_PHOCACART_ACCOUNT_LAYOUT</option>
<option
value="orders">COM_PHOCACART_ORDERS_LAYOUT</option>
<option
value="download">COM_PHOCACART_DOWNLOAD_LAYOUT</option>
<option
value="terms">COM_PHOCACART_TERMS_LAYOUT</option>
<option
value="comparison">COM_PHOCACART_COMPARISON_LAYOUT</option>
<option
value="wishlist">COM_PHOCACART_WISH_LIST_LAYOUT</option>
<option
value="info">COM_PHOCACART_INFO_LAYOUT</option>
<option
value="payment">COM_PHOCACART_PAYMENT_LAYOUT</option>
<option
value="submit">COM_PHOCACART_SUBMIT_ITEM_LAYOUT</option>
<option
value="question">COM_PHOCACART_ASK_QUESTION_LAYOUT</option>
</field>
<field name="display_compare"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_COMPARE_ICON_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_COMPARE_ICON_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="display_wishlist"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_WISH_LIST_ICON_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_WISH_LIST_ICON_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="display_quickview"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_QUICK_VIEW_ICON_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_QUICK_VIEW_ICON_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="display_addtocart_icon"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_ADD_TO_CART_ICON_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_ADD_TO_CART_ICON_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="fade_in_action_icons"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_FADE_IN_ACTION_ICONS_LABEL"
description="COM_PHOCACART_FIELD_FADE_IN_ACTION_ICONS_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="dynamic_change_price"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DYNAMIC_CHANGE_PRICE_LABEL"
description="COM_PHOCACART_FIELD_DYNAMIC_CHANGE_PRICE_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="dynamic_change_stock"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DYNAMIC_CHANGE_STOCK_LABEL"
description="COM_PHOCACART_FIELD_DYNAMIC_CHANGE_STOCK_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="dynamic_change_image"
type="list" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DYNAMIC_CHANGE_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_DYNAMIC_CHANGE_IMAGE_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="2">COM_PHOCACART_YES_ADVANCED_STOCK_MANAGEMENT</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="dynamic_change_id" type="radio"
class="btn-group btn-group-yesno" default="0"
label="COM_PHOCACART_FIELD_DYNAMIC_CHANGE_ID_LABEL"
description="COM_PHOCACART_FIELD_DYNAMIC_CHANGE_ID_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="dynamic_change_url_attributes"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DYNAMIC_CHANGE_URL_ATTRIBUTES_LABEL"
description="COM_PHOCACART_FIELD_DYNAMIC_CHANGE_URL_ATTRIBUTES_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="remove_select_option_attribute"
type="radio" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_REMOVE_SELECT_OPTION_ATTRIBUTE_LABEL"
description="COM_PHOCACART_FIELD_REMOVE_SELECT_OPTION_ATTRIBUTE_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="display_new" default="0"
size="10" type="text"
label="COM_PHOCACART_FIELD_DISPLAY_NEW_ICON_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_NEW_ICON_DESC"/>
<field name="display_hot" default="0"
size="10" type="text"
label="COM_PHOCACART_FIELD_DISPLAY_HOT_ICON_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_HOT_ICON_DESC"/>
<field name="display_featured"
default="" size="20" type="text"
label="COM_PHOCACART_FIELD_DISPLAY_FEATURED_TEXT_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_FEATURED_TEXT_DESC"/>
<field name="display_unit_price"
type="radio" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_DISPLAY_UNIT_PRICE_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_UNIT_PRICE_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="display_back" type="list"
class="btn-group btn-group-yesno" default="3"
label="COM_PHOCACART_FIELD_DISPLAY_BACK_BUTTON_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_BACK_BUTTON_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_CATEGORY_VIEW</option>
<option
value="2">COM_PHOCACART_ITEM_VIEW</option>
<option
value="3">COM_PHOCACART_CATEGORY_ITEM_VIEW</option>
</field>
<field name="category_ordering"
type="list" default="1"
label="COM_PHOCACART_FIELD_CATEGORY_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_CATEGORY_ORDERING_DESC">
<option
value="1">COM_PHOCACART_ORDERING_ASC</option>
<option
value="2">COM_PHOCACART_ORDERING_DESC</option>
<option
value="3">COM_PHOCACART_TITLE_ASC</option>
<option
value="4">COM_PHOCACART_TITLE_DESC</option>
<option
value="5">COM_PHOCACART_DATE_ASC</option>
<option
value="6">COM_PHOCACART_DATE_DESC</option>
</field>
<field name="equal_height" type="radio"
class="btn-group btn-group-yesno" default="1"
label="COM_PHOCACART_FIELD_BOX_EQUAL_HEIGHT_LABEL"
description="COM_PHOCACART_FIELD_BOX_EQUAL_HEIGHT_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="cart_metakey" default=""
type="textarea"
label="COM_PHOCACART_FIELD_META_KEYWORDS_LABEL"
description="COM_PHOCACART_FIELD_META_KEYWORDS_DESC"/>
<field name="cart_metadesc" default=""
type="textarea"
label="COM_PHOCACART_FIELD_META_DESCRIPTION_LABEL"
description="COM_PHOCACART_FIELD_META_DESCRIPTION_DESC"/>
<field name="image_popup_method"
type="list" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_IMAGE_POPUP_METHOD_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_POPUP_METHOD_DESC">
<option
value="0">COM_PHOCACART_NONE</option>
<option
value="1">COM_PHOCACART_PRETTYPHOTO</option>
<option
value="2">COM_PHOCACART_MAGNIFIC</option>
</field>
<field name="video_width" default=""
size="20" type="text"
label="COM_PHOCACART_FIELD_VIDEO_WIDTH_LABEL"
description="COM_PHOCACART_FIELD_VIDEO_WIDTH_DESC"/>
<field name="video_height" default=""
size="20" type="text"
label="COM_PHOCACART_FIELD_VIDEO_HEIGHT_LABEL"
description="COM_PHOCACART_FIELD_VIDEO_HEIGHT_DESC"/>
<field name="icon_suffix"
default="-circle" size="20" type="text"
label="COM_PHOCACART_FIELD_ICON_SUFFIX_LABEL"
description="COM_PHOCACART_FIELD_ICON_SUFFIX_DESC"/>
<field name="display_attribute_image"
type="radio" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_DISPLAY_ATTRIBUTE_IMAGE_CATEGORY_ITEMS_ITEM_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_ATTRIBUTE_IMAGE_CATEGORY_ITEMS_ITEM_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="display_attribute_image_checkout"
type="radio" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_DISPLAY_ATTRIBUTE_IMAGE_CHECKOUT_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_ATTRIBUTE_IMAGE_CHECKOUT_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<!--<field name="display_discount_price"
type="radio" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_DISPLAY_DISCOUNT_PRICE_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_DISCOUNT_PRICE_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>-->
<field name="display_discount_product_views"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_PRODUCT_DISCOUNT_PRICE_CATEGORY_ITEMS_ITEM_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_PRODUCT_DISCOUNT_PRICE_CATEGORY_ITEMS_ITEM_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="display_discount_cart_product_views"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_CART_DISCOUNT_PRICE_CATEGORY_ITEMS_ITEM_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_CART_DISCOUNT_PRICE_CATEGORY_ITEMS_ITEM_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="hide_add_to_cart_stock"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_HIDE_ADD_TO_CART_PRODUCT_OUT_OF_STOCK_LABEL"
description="COM_PHOCACART_FIELD_HIDE_ADD_TO_CART_PRODUCT_OUT_OF_STOCK_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="quantity_input_spinner"
type="list" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_QUANTITY_INPUT_SPINNER_LABEL"
description="COM_PHOCACART_FIELD_QUANTITY_INPUT_SPINNER_DESC">
<option
value="0">COM_PHOCACART_NONE</option>
<option
value="1">COM_PHOCACART_PLUS_MINUS</option>
<option
value="2">COM_PHOCACART_UP_DOWN</option>
</field>
<field name="zero_price_label"
default="" size="20" type="text"
label="COM_PHOCACART_FIELD_ZERO_PRICE_LABEL_LABEL"
description="COM_PHOCACART_FIELD_ZERO_PRICE_LABEL_DESC"/>
<field name="zero_price_text" default=""
size="20" type="text"
label="COM_PHOCACART_FIELD_ZERO_PRICE_TEXT_LABEL"
description="COM_PHOCACART_FIELD_ZERO_PRICE_TEXT_DESC"/>
<field name="price_on_demand_label"
default="" size="20" type="text"
label="COM_PHOCACART_FIELD_PRICE_ON_DEMAND_LABEL_LABEL"
description="COM_PHOCACART_FIELD_PRICE_ON_DEMAND_LABEL_DESC"/>
<field name="price_on_demand_text"
default="" size="20" type="text"
label="COM_PHOCACART_FIELD_PRICE_ON_DEMAND_TEXT_LABEL"
description="COM_PHOCACART_FIELD_PRICE_ON_DEMAND_TEXT_DESC"/>
<field name="hide_add_to_cart_zero_price"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_HIDE_ADD_TO_CART_PRODUCT_ZERO_PRICE_LABEL"
description="COM_PHOCACART_FIELD_HIDE_ADD_TO_CART_PRODUCT_ZERO_PRICE_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="zero_attribute_price"
type="list" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_ATTRIBUTE_PRICE_LABEL"
description="COM_PHOCACART_FIELD_ATTRIBUTE_PRICE_DESC">
<option
value="1">COM_PHOCACART_DISPLAY</option>
<option
value="0">COM_PHOCACART_HIDE_ZERO_PRICE</option>
<option
value="2">COM_PHOCACART_HIDE_ANY_PRICE</option>
</field>
<field name="alt_value" type="list"
default="1" label="COM_PHOCACART_FIELD_ALT_VALUE_LABEL"
description="COM_PHOCACART_FIELD_ALT_VALUE_DESC">
<option
value="0">COM_PHOCACART_EMPTY_VALUE</option>
<option
value="1">COM_PHOCACART_TITLE_CATEGORY_OR_PRODUCT_TITLE</option>
<option
value="2">COM_PHOCACART_IMAGE_NAME</option>
</field>
<field name="display_webp_images" type="radio"
class="btn-group btn-group-yesno" default="0"
label="COM_PHOCACART_FIELD_DISPLAY_WEBP_IMAGES_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_WEBP_IMAGES_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="popup_askquestion"
type="list" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_ASK_A_QUESTION_POPUP_ITEM_VIEW_LABEL"
description="COM_PHOCACART_FIELD_ASK_A_QUESTION_POPUP_ITEM_VIEW_DESC">
<option
value="1">COM_PHOCACART_YES_WINDOW_POPUP</option>
<option
value="2">COM_PHOCACART_YES_MODAL_POPUP</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="phocahead8"
type="phocahead"
default="COM_PHOCACART_AJAX_OPTIONS_LABEL" label=""
description=""/>
<field name="add_cart_method"
type="list" default="0"
label="COM_PHOCACART_FIELD_ADD_TO_CART_METHOD_LABEL"
description="COM_PHOCACART_FIELD_ADD_TO_CART_METHOD_DESC">
<option
value="0">COM_PHOCACART_STANDARD</option>
<option
value="1">COM_PHOCACART_AJAX</option>
<option
value="2">COM_PHOCACART_AJAX_WITH_POPUP_WINDOW</option>
</field>
<field name="add_compare_method"
type="list" default="0"
label="COM_PHOCACART_FIELD_ADD_TO_COMPARISON_METHOD_LABEL"
description="COM_PHOCACART_FIELD_ADD_TO_COMPARISON_METHOD_DESC">
<option
value="0">COM_PHOCACART_STANDARD</option>
<option
value="1">COM_PHOCACART_AJAX</option>
<option
value="2">COM_PHOCACART_AJAX_WITH_POPUP_WINDOW</option>
</field>
<field name="add_wishlist_method"
type="list" default="0"
label="COM_PHOCACART_FIELD_ADD_TO_WISH_LIST_METHOD_LABEL"
description="COM_PHOCACART_FIELD_ADD_TO_WISH_LIST_METHOD_DESC">
<option
value="0">COM_PHOCACART_STANDARD</option>
<option
value="1">COM_PHOCACART_AJAX</option>
<option
value="2">COM_PHOCACART_AJAX_WITH_POPUP_WINDOW</option>
</field>
<field name="phocahead35" type="phocahead"
default="COM_PHOCACART_CONFIG_THEME_OPTIONS_LABEL"
label="" description=""/>
<field name="theme" type="list"
class="btn-group btn-group-yesno" default="bs3"
label="COM_PHOCACART_FIELD_THEME_LABEL"
description="COM_PHOCACART_FIELD_THEME_DESC">
<option value="bs3">Bootstrap
3</option>
<option value="bs4">Bootstrap
4</option>
</field>
<field name="icon_type" type="list"
class="btn-group btn-group-yesno" default="bs"
label="COM_PHOCACART_FIELD_ICON_TYPE_LABEL"
description="COM_PHOCACART_FIELD_ICON_TYPE_DESC">
<option value="bs">Bootstrap</option>
<option value="fa">Font
Awesome</option>
<option value="fa5">Font Awesome 5</option>
</field>
<field name="load_main_css" type="radio"
class="btn-group btn-group-yesno" default="1"
label="COM_PHOCACART_FIELD_LOAD_MAIN_CSS_LABEL"
description="COM_PHOCACART_FIELD_LOAD_MAIN_CSS_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="load_spec_css" type="list"
class="btn-group btn-group-yesno" default=""
label="COM_PHOCACART_FIELD_LOAD_SPECIFIC_CSS_LABEL"
description="COM_PHOCACART_FIELD_LOAD_SPECIFIC_CSS_DESC">
<option
value="">COM_PHOCACART_NO</option>
<option
value="gantry">Gantry</option>
<option value="astroid">Astroid</option>
</field>
<field name="load_rtl_css" type="radio"
class="btn-group btn-group-yesno" default="0"
label="COM_PHOCACART_FIELD_LOAD_RTL_CSS_LABEL"
description="COM_PHOCACART_FIELD_LOAD_RTL_CSS_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="load_bootstrap" type="list"
class="btn-group btn-group-yesno" default="1"
label="COM_PHOCACART_FIELD_LOAD_BOOTSTRAP_LABEL"
description="COM_PHOCACART_FIELD_LOAD_BOOTSTRAP_DESC">
<option value="2">Bootstrap
4</option>
<option value="1">Bootstrap 3</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="load_chosen" type="list"
default="1"
label="COM_PHOCACART_FIELD_LOAD_CHOSEN_LABEL"
description="COM_PHOCACART_FIELD_LOAD_CHOSEN_DESC">
<option
value="1">COM_PHOCACART_YES_EXCLUDING_BOOTSTRAP_JS</option>
<option
value="2">COM_PHOCACART_YES_INCLUDING_BOOTSTRAP_JS</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
</fieldset>
<fieldset name="calculation"
label="COM_PHOCACART_CONFIG_HEAD_CALCULATION_LABEL">
<field name="tax_calculation"
type="list" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_TAX_CALCULATION_LABEL"
description="COM_PHOCACART_FIELD_TAX_CALCULATION_DESC">
<option
value="2">COM_PHOCACART_TAX_INCLUSIVE_PRICE</option>
<option
value="1">COM_PHOCACART_TAX_EXCLUSIVE_PRICE</option>
<option
value="0">COM_PHOCACART_NO_TAX_PRICE</option>
</field>
<field name="tax_calculation_shipping"
type="list" default="0"
label="COM_PHOCACART_FIELD_TAX_CALCULATION_SHIPPING_LABEL"
description="COM_PHOCACART_FIELD_TAX_CALCULATION_SHIPPING_DESC">
<option
value="2">COM_PHOCACART_TAX_INCLUSIVE_PRICE</option>
<option
value="1">COM_PHOCACART_TAX_EXCLUSIVE_PRICE</option>
<option
value="0">COM_PHOCACART_NO_TAX_PRICE</option>
</field>
<field name="shipping_amount_rule"
type="list" default="0"
label="COM_PHOCACART_FIELD_AMOUNT_RULE_SHIPPING_LABEL"
description="COM_PHOCACART_FIELD_AMOUNT_RULE_SHIPPING_DESC">
<option
value="2">COM_PHOCACART_TAX_INCLUSIVE_AMOUNT</option>
<option
value="1">COM_PHOCACART_TAX_EXCLUSIVE_AMOUNT</option>
<option
value="0">COM_PHOCACART_NO_TAX_AMOUNT</option>
</field>
<field name="shipping_country_rule" type="list"
default="1"
label="COM_PHOCACART_FIELD_COUNTRY_RULE_SHIPPING_LABEL"
description="COM_PHOCACART_FIELD_COUNTRY_RULE_SHIPPING_DESC">
<option
value="1">COM_PHOCACART_BASED_CUSTOMER_BILLING_ADDRESS</option>
<option
value="2">COM_PHOCACART_BASED_CUSTOMER_SHIPPING_ADDRESS</option>
<option
value="3">COM_PHOCACART_BASED_CUSTOMER_BILLING_ADDRESS_IF_EMPTY_SHIPPING_ADDRESS</option>
<option
value="4">COM_PHOCACART_BASED_CUSTOMER_SHIPPING_ADDRESS_IF_EMPTY_BILLING_ADDRESS</option>
</field>
<field name="shipping_region_rule" type="list"
default="1"
label="COM_PHOCACART_FIELD_REGION_RULE_SHIPPING_LABEL"
description="COM_PHOCACART_FIELD_REGION_RULE_SHIPPING_DESC">
<option
value="1">COM_PHOCACART_BASED_CUSTOMER_BILLING_ADDRESS</option>
<option
value="2">COM_PHOCACART_BASED_CUSTOMER_SHIPPING_ADDRESS</option>
<option
value="3">COM_PHOCACART_BASED_CUSTOMER_BILLING_ADDRESS_IF_EMPTY_SHIPPING_ADDRESS</option>
<option
value="4">COM_PHOCACART_BASED_CUSTOMER_SHIPPING_ADDRESS_IF_EMPTY_BILLING_ADDRESS</option>
</field>
<field name="shipping_zip_rule" type="list"
default="1"
label="COM_PHOCACART_FIELD_ZIP_RULE_SHIPPING_LABEL"
description="COM_PHOCACART_FIELD_ZIP_RULE_SHIPPING_DESC">
<option
value="1">COM_PHOCACART_BASED_CUSTOMER_BILLING_ADDRESS</option>
<option
value="2">COM_PHOCACART_BASED_CUSTOMER_SHIPPING_ADDRESS</option>
<option
value="3">COM_PHOCACART_BASED_CUSTOMER_BILLING_ADDRESS_IF_EMPTY_SHIPPING_ADDRESS</option>
<option
value="4">COM_PHOCACART_BASED_CUSTOMER_SHIPPING_ADDRESS_IF_EMPTY_BILLING_ADDRESS</option>
</field>
<field name="tax_calculation_payment"
type="list" default="0"
label="COM_PHOCACART_FIELD_TAX_CALCULATION_PAYMENT_LABEL"
description="COM_PHOCACART_FIELD_TAX_CALCULATION_PAYMENT_DESC">
<option
value="2">COM_PHOCACART_TAX_INCLUSIVE_PRICE</option>
<option
value="1">COM_PHOCACART_TAX_EXCLUSIVE_PRICE</option>
<option
value="0">COM_PHOCACART_NO_TAX_PRICE</option>
</field>
<field name="payment_amount_rule"
type="list" default="0"
label="COM_PHOCACART_FIELD_AMOUNT_RULE_PAYMENT_LABEL"
description="COM_PHOCACART_FIELD_AMOUNT_RULE_PAYMENT_DESC">
<option
value="2">COM_PHOCACART_TAX_INCLUSIVE_AMOUNT</option>
<option
value="1">COM_PHOCACART_TAX_EXCLUSIVE_AMOUNT</option>
<option
value="0">COM_PHOCACART_NO_TAX_AMOUNT</option>
</field>
<field name="payment_country_rule" type="list"
default="1"
label="COM_PHOCACART_FIELD_COUNTRY_RULE_PAYMENT_LABEL"
description="COM_PHOCACART_FIELD_COUNTRY_RULE_PAYMENT_DESC">
<option
value="1">COM_PHOCACART_BASED_CUSTOMER_BILLING_ADDRESS</option>
<option
value="2">COM_PHOCACART_BASED_CUSTOMER_SHIPPING_ADDRESS</option>
<option
value="3">COM_PHOCACART_BASED_CUSTOMER_BILLING_ADDRESS_IF_EMPTY_SHIPPING_ADDRESS</option>
<option
value="4">COM_PHOCACART_BASED_CUSTOMER_SHIPPING_ADDRESS_IF_EMPTY_BILLING_ADDRESS</option>
</field>
<field name="payment_region_rule" type="list"
default="1"
label="COM_PHOCACART_FIELD_REGION_RULE_PAYMENT_LABEL"
description="COM_PHOCACART_FIELD_REGION_RULE_PAYMENT_DESC">
<option
value="1">COM_PHOCACART_BASED_CUSTOMER_BILLING_ADDRESS</option>
<option
value="2">COM_PHOCACART_BASED_CUSTOMER_SHIPPING_ADDRESS</option>
<option
value="3">COM_PHOCACART_BASED_CUSTOMER_BILLING_ADDRESS_IF_EMPTY_SHIPPING_ADDRESS</option>
<option
value="4">COM_PHOCACART_BASED_CUSTOMER_SHIPPING_ADDRESS_IF_EMPTY_BILLING_ADDRESS</option>
</field>
<field name="dynamic_tax_rate"
type="list" default="0"
label="COM_PHOCACART_FIELD_DYNAMIC_TAX_RATE_LABEL"
description="COM_PHOCACART_FIELD_DYNAMIC_TAX_RATE_DESC">
<option
value="1">COM_PHOCACART_ENABLE_CUSTOMER_BILLING_ADDRESS</option>
<option
value="2">COM_PHOCACART_ENABLE_CUSTOMER_SHIPPING_ADDRESS</option>
<option
value="0">COM_PHOCACART_DISABLE</option>
</field>
<field name="dynamic_tax_rate_priority"
type="list" default="0"
label="COM_PHOCACART_FIELD_DYNAMIC_TAX_RATE_PRIORITY_LABEL"
description="COM_PHOCACART_FIELD_DYNAMIC_TAX_RATE_PRIORITY_DESC">
<option
value="1">COM_PHOCACART_COUNTRY_TAX_RATE</option>
<option
value="2">COM_PHOCACART_REGION_TAX_RATE</option>
</field>
<field name="exchange_rate_order"
type="list" default="0"
label="COM_PHOCACART_FIELD_EXCHANGE_RATE_CURRENCY_ORDER_LABEL"
description="COM_PHOCACART_FIELD_EXCHANGE_RATE_CURRENCY_ORDER_DESC">
<option
value="0">COM_PHOCACART_HISTORIC</option>
<option
value="1">COM_PHOCACART_CURRENT</option>
</field>
<field name="rounding_calculation"
type="list" default="1"
label="COM_PHOCACART_FIELD_ROUNDING_CALCULATION_LABEL"
description="COM_PHOCACART_FIELD_ROUNDING_CALCULATION_DESC">
<option
value="1">COM_PHOCACART_ROUND_HALF_UP</option>
<option
value="2">COM_PHOCACART_ROUND_HALF_DOWN</option>
</field>
<field name="tax_recapitulation"
type="list" default="1"
label="COM_PHOCACART_FIELD_TAX_RECAPITULATION_LABEL"
description="COM_PHOCACART_FIELD_TAX_RECAPITULATION_DESC">
<option
value="0">COM_PHOCACART_DO_NOT_CHANGE_CALCULATION</option>
<option
value="1">COM_PHOCACART_CHANGE_TOTAL_AMOUNT_AND_ROUNDING_CALCULATION</option>
<option
value="2">COM_PHOCACART_CHANGE_TAXES_TOTAL_AMOUNT_AND_ROUNDING_CALCULATION</option>
</field>
<field name="enable_coupons" type="list"
default="2"
label="COM_PHOCACART_FIELD_ENABLE_COUPONS_LABEL"
description="COM_PHOCACART_FIELD_ENABLE_COUPONS_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
<option
value="2">COM_PHOCACART_YES_USER_LOGGED_IN_GUEST_CHECKOUT_ENABLED</option>
</field>
<field name="enable_rewards" type="list"
default="1"
label="COM_PHOCACART_FIELD_ENABLE_REWARD_POINTS_LABEL"
description="COM_PHOCACART_FIELD_ENABLE_REWARD_POINTS_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<!--
<field name="rounding_calculation_subtotal"
type="list" default="2"
label="COM_PHOCACART_FIELD_ROUNDING_SUBTOTAL_AMOUNT_LABEL"
description="COM_PHOCACART_FIELD_ROUNDING_SUBTOTAL_AMOUNT_LABEL">
<option
value="-1">COM_PHOCACART_NO</option>
<option
value="0">COM_PHOCACART_YES_0_DIGITS</option>
<option
value="1">COM_PHOCACART_YES_1_DIGITS</option>
<option
value="2">COM_PHOCACART_YES_2_DIGITS</option>
</field>
-->
<field name="rounding_calculation_total"
type="list" default="2"
label="COM_PHOCACART_FIELD_ROUNDING_TOTAL_AMOUNT_LABEL"
description="COM_PHOCACART_FIELD_ROUNDING_TOTAL_AMOUNT_DESC">
<option
value="-1">COM_PHOCACART_NO</option>
<option
value="0">COM_PHOCACART_YES_0_DIGITS</option>
<option
value="1">COM_PHOCACART_YES_1_DIGITS</option>
<option
value="2">COM_PHOCACART_YES_2_DIGITS</option>
</field>
<field
name="rounding_calculation_fixed_amount_discount"
type="list" default="-1"
label="COM_PHOCACART_FIELD_ROUNDING_CALCULATION_FIXED_AMOUNT_DISCOUNT_LABEL"
description="COM_PHOCACART_FIELD_ROUNDING_CALCULATION_FIXED_AMOUNT_DISCOUNT_DESC">
<option
value="-1">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<field
name="rounding_calculation_fixed_amount_coupon"
type="list" default="-1"
label="COM_PHOCACART_FIELD_ROUNDING_CALCULATION_FIXED_AMOUNT_COUPON_LABEL"
description="COM_PHOCACART_FIELD_ROUNDING_CALCULATION_FIXED_AMOUNT_COUPON_DESC">
<option
value="-1">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<field name="display_discount_price_product"
type="list" default="1"
label="COM_PHOCACART_FIELD_DISPLAY_DISCOUNT_PRICE_PRODUCT_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_DISCOUNT_PRICE_PRODUCT_DESC">
<option
value="0">COM_PHOCACART_HIDE</option>
<option
value="1">COM_PHOCACART_PRICE_AFTER_DISCOUNT</option>
<option
value="2">COM_PHOCACART_DISCOUNT_PRICE</option>
</field>
<field name="phocahead9"
type="phocahead"
default="COM_PHOCACART_CONFIG_STOCK_LABEL" label=""
description=""/>
<field name="stock_checking" default="0"
type="radio" class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_STOCK_CHECKING_LABEL"
description="COM_PHOCACART_FIELD_STOCK_CHECKING_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="stock_checkout" default="0"
type="radio" class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_DISPLAY_STOCK_CHECKOUT_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_STOCK_CHECKOUT_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="negative_stocks"
default="1" type="radio" class="btn-group
btn-group-yesno"
label="COM_PHOCACART_FIELD_NEGATIVE_STOCKS_LABEL"
description="COM_PHOCACART_FIELD_NEGATIVE_STOCKS_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="display_stock_status"
default="1" type="list" class="btn-group
btn-group-yesno"
label="COM_PHOCACART_FIELD_DISPLAY_STOCK_STATUS_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_STOCK_STATUS_DESC">
<option
value="1">COM_PHOCACART_YES_ITEM_VIEW</option>
<option
value="2">COM_PHOCACART_YES_CATEGORY_ITEMS_VIEW</option>
<option
value="3">COM_PHOCACART_YES_CATEGORY_ALL_VIEWS</option>
<option
value="4">COM_PHOCACART_YES_XML_FEED</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="stock_status_display_count"
default="0" type="radio" class="btn-group
btn-group-yesno"
label="COM_PHOCACART_FIELD_DISPLAY_STOCK_AMOUNT_IN_STOCK_STATUS_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_STOCK_AMOUNT_IN_STOCK_STATUS_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="hide_products_out_of_stock"
default="0" type="radio" class="btn-group
btn-group-yesno"
label="COM_PHOCACART_FIELD_HIDE_PRODUCTS_OUT_OF_STOCK_LABEL"
description="COM_PHOCACART_FIELD_HIDE_PRODUCTS_OUT_OF_STOCK_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="phocahead10"
type="phocahead"
default="COM_PHOCACART_CONFIG_CHECKOUT_LABEL" label=""
description=""/>
<field name="min_order_amount"
default="0" size="4" type="text"
label="COM_PHOCACART_FIELD_MINIMUM_ORDER_AMOUNT_LABEL"
description="COM_PHOCACART_FIELD_MINIMUM_ORDER_AMOUNT_DESC"/>
<field name="check_product_attributes"
default="3" type="list"
label="COM_PHOCACART_FIELD_CHECK_PRODUCT_ATTRIBUTES_LABEL"
description="COM_PHOCACART_FIELD_CHECK_PRODUCT_ATTRIBUTES_DESC"
multiple="true">
<option
value="1">COM_PHOCACART_IN_CART</option>
<option
value="2">COM_PHOCACART_IN_CHECKOUT</option>
<option
value="3">COM_PHOCACART_IN_ORDER</option>
</field>
<field name="default_order_status"
default="1" type="PhocacartOrderstatus"
label="COM_PHOCACART_FIELD_DEFAULT_ORDER_STATUS_LABEL"
description="COM_PHOCACART_FIELD_DEFAULT_ORDER_STATUS_DESC">
</field>
<field name="automatic_shipping_method_setting"
default="0" type="list"
label="COM_PHOCACART_FIELD_AUTOMATIC_SHIPPING_METHOD_SETTING_LABEL"
description="COM_PHOCACART_FIELD_AUTOMATIC_SHIPPING_METHOD_SETTING_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<field name="automatic_payment_method_setting"
default="0" type="list"
label="COM_PHOCACART_FIELD_AUTOMATIC_PAYMENT_METHOD_SETTING_LABEL"
description="COM_PHOCACART_FIELD_AUTOMATIC_PAYMENT_METHOD_SETTING_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<field name="skip_shipping_method"
default="0" type="list"
label="COM_PHOCACART_FIELD_SKIP_SHIPPING_METHOD_LABEL"
description="COM_PHOCACART_FIELD_SKIP_SHIPPING_METHOD_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES_ALL_PRODUCTS_ARE_DOWNLOADABLE</option>
<option
value="2">COM_PHOCACART_YES_OVERALL_NO_SHIPPING_METHOD_PUBLISHED</option>
<option
value="3">COM_PHOCACART_YES_OVERALL_NO_SHIPPING_METHOD_FOUND_DESPITE_CHECKING_RULES</option>
</field>
<field name="skip_payment_method"
default="0" type="list"
label="COM_PHOCACART_FIELD_SKIP_PAYMENT_METHOD_LABEL"
description="COM_PHOCACART_FIELD_SKIP_PAYMENT_METHOD_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES_ORDER_AMOUNT_IS_ZERO</option>
<option
value="2">COM_PHOCACART_YES_OVERALL_NO_PAYMENT_METHOD_PUBLISHED</option>
<option
value="3">COM_PHOCACART_YES_OVERALL_NO_PAYMENT_METHOD_FOUND_DESPITE_CHECKING_RULES</option>
</field>
<field name="change_remove_shipping_method"
default="1" type="list"
label="COM_PHOCACART_FIELD_REMOVE_SHIPPING_METHOD_CHANGE_LABEL"
description="COM_PHOCACART_FIELD_REMOVE_SHIPPING_METHOD_CHANGE_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
</field>
<field name="change_remove_payment_method"
default="1" type="list"
label="COM_PHOCACART_FIELD_REMOVE_PAYMENT_METHOD_CHANGE_LABEL"
description="COM_PHOCACART_FIELD_REMOVE_PAYMENT_METHOD_CHANGE_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
</field>
<field name="default_order_status_free_download"
default="1" type="PhocacartOrderstatus"
label="COM_PHOCACART_FIELD_DEFAULT_ORDER_STATUS_FREE_DOWNLOAD_LABEL"
description="COM_PHOCACART_FIELD_DEFAULT_ORDER_STATUS_FREE_DOWNLOAD_DESC">
</field>
<field name="phocahead11"
type="phocahead" default="COM_PHOCACART_CONFIG_UNITS"
label="" description=""/>
<field name="unit_size" default="mm"
type="list" label="COM_PHOCACART_FIELD_SIZE_UNIT_LABEL"
description="COM_PHOCACART_FIELD_SIZE_UNIT_DESC">
<option
value="mm">COM_PHOCACART_MILLIMETER</option>
<option
value="cm">COM_PHOCACART_CENTIMETER</option>
<option
value="in">COM_PHOCACART_INCH</option>
<option
value="ft">COM_PHOCACART_FOOT</option>
</field>
<field name="unit_weight" default="g"
type="list"
label="COM_PHOCACART_FIELD_WEIGHT_UNIT_LABEL"
description="COM_PHOCACART_FIELD_WEIGHT_UNIT_DESC">
<option
value="g">COM_PHOCACART_GRAM</option>
<option
value="kg">COM_PHOCACART_KILOGRAM</option>
<option
value="lb">COM_PHOCACART_POUND</option>
<option
value="oz">COM_PHOCACART_OUNCE</option>
</field>
<field name="unit_volume" default="ml"
type="list"
label="COM_PHOCACART_FIELD_VOLUME_UNIT_LABEL"
description="COM_PHOCACART_FIELD_VOLUME_UNIT_DESC">
<option
value="ml">COM_PHOCACART_MILLILITER</option>
<option
value="cl">COM_PHOCACART_CENTILITER</option>
<option
value="l">COM_PHOCACART_LITER</option>
<option
value="pt">COM_PHOCACART_PINT</option>
<option
value="qt">COM_PHOCACART_QUART</option>
<option
value="gal">COM_PHOCACART_GALLON</option>
<option value="fl
oz">COM_PHOCACART_OUNCE</option>
</field>
<field name="phocahead20"
type="phocahead"
default="COM_PHOCACART_CONFIG_GENERAL_CALCULATION_OPTIONS_LABEL"
label="" description=""/>
<field name="max_wishlist_items"
default="20" size="4" type="text"
label="COM_PHOCACART_FIELD_MAX_COUNT_WISH_LIST_ITEMS_LABEL"
description="COM_PHOCACART_FIELD_MAX_COUNT_WISH_LIST_ITEMS_DESC"/>
</fieldset>
<fieldset name="discount"
label="COM_PHOCACART_CONFIG_HEAD_DISCOUNT_LABEL">
<field name="discount_priority"
default="1" type="list" class="btn-group
btn-group-yesno"
label="COM_PHOCACART_FIELD_DISCOUNT_PRIORITY_LABEL"
description="COM_PHOCACART_FIELD_DISCOUNT_PRIORITY_DESC">
<option
value="1">COM_PHOCACART_HIGHEST_DISCOUNT</option>
<option
value="2">COM_PHOCACART_HIGHEST_QUANTITY</option>
</field>
<field name="discount_subtotal_amount"
default="1" type="list" class="btn-group
btn-group-yesno"
label="COM_PHOCACART_FIELD_DISCOUNT_SUBTOTAL_AMOUNT_LABEL"
description="COM_PHOCACART_FIELD_DISCOUNT_SUBTOTAL_AMOUNT_DESC">
<option
value="1">COM_PHOCACART_SUBTOTAL_REDUCED_BY_OTHER_TYPES_OF_DISCOUNTS</option>
<option
value="2">COM_PHOCACART_FIXED_SUBTOTAL</option>
</field>
<field name="phocahead21"
type="phocahead"
default="COM_PHOCACART_CONFIG_PRODUCT_DISCOUNT_OPTIONS_LABEL"
label="" description=""/>
<field name="discount_product_variations_quantity"
default="1" type="radio" class="btn-group
btn-group-yesno"
label="COM_PHOCACART_FIELD_QUANTITY_RULE_PRODUCT_VARIATIONS_LABEL"
description="COM_PHOCACART_FIELD_QUANTITY_RULE_PRODUCT_VARIATIONS_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<!--<field name="phocahead22"
type="phocahead"
default="COM_PHOCACART_CONFIG_CART_DISCOUNT_OPTIONS_LABEL"
label="" description=""/>
<field name="phocahead23"
type="phocahead"
default="COM_PHOCACART_CONFIG_COUPON_OPTIONS_LABEL"
label="" description=""/>-->
</fieldset>
<fieldset name="users"
label="COM_PHOCACART_CONFIG_HEAD_USERS_LABEL">
<field name="display_edit_profile"
default="1" type="radio" class="btn-group
btn-group-yesno"
label="COM_PHOCACART_FIELD_DISPLAY_EDIT_PROFILE_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_EDIT_PROFILE_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="guest_checkout" default="0"
type="radio" class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_GUEST_CHECKOUT_LABEL"
description="COM_PHOCACART_FIELD_GUEST_CHECKOUT_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="guest_checkout_auto_enable"
default="0" type="radio" class="btn-group
btn-group-yesno"
label="COM_PHOCACART_FIELD_GUEST_CHECKOUT_AUTO_ENABLE_LABEL"
description="COM_PHOCACART_FIELD_GUEST_CHECKOUT_AUTO_ENABLE_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="order_guest_access"
default="0" type="radio" class="btn-group
btn-group-yesno"
label="COM_PHOCACART_FIELD_ORDER_GUEST_ACCESS_LABEL"
description="COM_PHOCACART_FIELD_ORDER_GUEST_ACCESS_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="download_guest_access"
default="0" type="radio" class="btn-group
btn-group-yesno"
label="COM_PHOCACART_FIELD_DOWNLOAD_GUEST_ACCESS_LABEL"
description="COM_PHOCACART_FIELD_DOWNLOAD_GUEST_ACCESS_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="enable_review" default="1"
type="radio" class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_ENABLE_REVIEW_LABEL"
description="COM_PHOCACART_FIELD_ENABLE_REVIEW_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="approve_review" default="0"
type="radio" class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_APPROVE_REVIEW_LABEL"
description="COM_PHOCACART_FIELD_APPROVE_REVIEW_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="user_group_change_rule"
default="0" type="list" class="btn-group
btn-group-yesno"
label="COM_PHOCACART_FIELD_USER_GROUP_CHANGE_RULE_LABEL"
description="COM_PHOCACART_FIELD_USER_GROUP_CHANGE_RULE_DESC">
<option
value="0">COM_PHOCACART_NEVER_CHANGE_USER_GROUP</option>
<option
value="1">COM_PHOCACART_ONE_GROUP_HIGHEST_MINIMAL_SUM_OF_PURCHASES_INCLUDING_DEFAULT</option>
<option
value="2">COM_PHOCACART_ALL_GROUPS_INCLUDING_DEFAULT</option>
</field>
<field name="phocahead15" type="phocahead"
default="COM_PHOCACART_CATALOG_OPTIONS_LABEL" label=""
description=""/>
<field name="display_price" default="1"
type="list"
label="COM_PHOCACART_FIELD_DISPLAY_PRICE_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_PRICE_DESC">
<option
value="0">COM_PHOCACART_NO_ONE</option>
<option value="1">COM_PHOCACART_ALL</option>
<option
value="2">COM_PHOCACART_BASED_ON_ACCESS_LEVELS</option>
<option
value="3">COM_PHOCACART_BASED_ON_CUSTOMER_GROUP</option>
</field>
<field name="display_price_access_levels"
type="accesslevel"
label="COM_PHOCACART_FIELD_DISPLAY_PRICE_ACCESS_LEVELS_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_PRICE_ACCESS_LEVELS_DESC"
class="inputbox" multiple="true" size="1"
showon="display_price:2" />
<field name="display_addtocart" default="1"
type="list"
label="COM_PHOCACART_FIELD_DISPLAY_ADD_TO_CART_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_ADD_TO_CART_DESC">
<option
value="0">COM_PHOCACART_NO_ONE</option>
<option value="1">COM_PHOCACART_ALL</option>
<option
value="2">COM_PHOCACART_BASED_ON_ACCESS_LEVELS</option>
<option
value="3">COM_PHOCACART_BASED_ON_CUSTOMER_GROUP</option>
</field>
<field name="display_addtocart_access_levels"
type="accesslevel"
label="COM_PHOCACART_FIELD_DISPLAY_ADD_TO_CART_ACCESS_LEVELS_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_ADD_TO_CART_ACCESS_LEVELS_DESC"
class="inputbox" multiple="true" size="1"
showon="display_addtocart:2" />
<field name="display_attributes" default="1"
type="list"
label="COM_PHOCACART_FIELD_DISPLAY_ATTRIBUTES_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_ATTRIBUTES_DESC">
<option
value="0">COM_PHOCACART_NO_ONE</option>
<option value="1">COM_PHOCACART_ALL</option>
<option
value="2">COM_PHOCACART_BASED_ON_ACCESS_LEVELS</option>
<option
value="3">COM_PHOCACART_BASED_ON_CUSTOMER_GROUP</option>
</field>
<field name="display_attributes_access_levels"
type="accesslevel"
label="COM_PHOCACART_FIELD_DISPLAY_ATTRIBUTES_ACCESS_LEVELS_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_ATTRIBUTES_ACCESS_LEVELS_DESC"
class="inputbox" multiple="true" size="1"
showon="display_attributes:2" />
<field name="phocahead12"
type="phocahead"
default="COM_PHOCACART_CONFIG_DOWNLOAD_LABEL" label=""
description=""/>
<field name="download_days" default="0"
size="4" type="text"
label="COM_PHOCACART_FIELD_DOWNLOAD_EXPIRATION_DATE_DAYS_LABEL"
description="COM_PHOCACART_FIELD_DOWNLOAD_EXPIRATION_DATE_DAYS_DESC"/>
<field name="download_count" default="0"
size="4" type="text"
label="COM_PHOCACART_FIELD_MAX_COUNT_FILE_DOWNLOADS_LABEL"
description="COM_PHOCACART_FIELD_MAX_COUNT_FILE_DOWNLOADS_DESC"/>
<field name="download_product_attribute_options"
default="0" type="list" class="btn-group
btn-group-yesno"
label="COM_PHOCACART_FIELD_DOWNLOAD_FILE_PRODUCT_ATTRIBUTE_OPTIONS_LABEL"
description="COM_PHOCACART_FIELD_DOWNLOAD_FILE_PRODUCT_ATTRIBUTE_OPTIONS_DESC">
<option
value="0">COM_PHOCACART_INCLUDE_MAIN_PRODUCT_DOWNLOAD_FILE</option>
<option
value="1">COM_PHOCACART_EXCLUDE_MAIN_PRODUCT_DOWNLOAD_FILE</option>
</field>
<field name="phocahead29"
type="phocaheadexpert"
default="COM_PHOCACART_DOWNLOAD_EXPERTS_ONLY_LABEL"
label="" description=""/>
<field name="absolute_path" default=""
size="40" type="text"
label="COM_PHOCACART_FIELD_ABSOLUTE_PATH_LABEL"
description="COM_PHOCACART_FIELD_ABSOLUTE_PATH_DESC"/>
<field name="absolute_path_upload" default=""
size="40" type="text"
label="COM_PHOCACART_FIELD_ABSOLUTE_PATH_UPLOAD_LABEL"
description="COM_PHOCACART_FIELD_ABSOLUTE_PATH_UPLOAD_DESC"/>
</fieldset>
<fieldset name="main"
label="COM_PHOCACART_CONFIG_HEAD_MAIN_LABEL">
<field name="enable_logging" default="0"
type="radio" class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_ENABLE_LOGGING_LABEL"
description="COM_PHOCACART_FIELD_ENABLE_LOGGING_DESC">
<option
value="1">COM_PHOCACART_YES_ALL</option>
<option
value="2">COM_PHOCACART_YES_ERRORS_ONLY</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="phocahead13"
type="phocahead"
default="COM_PHOCACART_IMAGES_AND_THUMBNAILS_LABEL"
label="" description=""/>
<field name="large_image_width"
default="640" size="4" type="text"
label="COM_PHOCACART_FIELD_LARGE_IMAGE_WIDTH_LABEL"
description="COM_PHOCACART_FIELD_LARGE_IMAGE_WIDTH_DESC"/>
<field name="large_image_height"
default="480" size="4" type="text"
label="COM_PHOCACART_FIELD_LARGE_IMAGE_HEIGHT_LABEL"
description="COM_PHOCACART_FIELD_LARGE_IMAGE_HEIGHT_DESC"/>
<field name="medium_image_width"
default="300" size="4" type="text"
label="COM_PHOCACART_FIELD_MEDIUM_IMAGE_WIDTH_LABEL"
description="COM_PHOCACART_FIELD_MEDIUM_IMAGE_WIDTH_DESC"/>
<field name="medium_image_height"
default="200" size="4" type="text"
label="COM_PHOCACART_FIELD_MEDIUM_IMAGE_HEIGHT_LABEL"
description="COM_PHOCACART_FIELD_MEDIUM_IMAGE_HEIGHT_DESC"/>
<field name="small_image_width"
default="180" size="4" type="text"
label="COM_PHOCACART_FIELD_SMALL_IMAGE_WIDTH_LABEL"
description="COM_PHOCACART_FIELD_SMALL_IMAGE_WIDTH_DESC"/>
<field name="small_image_height"
default="120" size="4" type="text"
label="COM_PHOCACART_FIELD_SMALL_IMAGE_HEIGHT_LABEL"
description="COM_PHOCACART_FIELD_SMALL_IMAGE_HEIGHT_DESC"/>
<field name="crop_thumbnail" type="list"
default="5"
label="COM_PHOCACART_FIELD_CROP_THUMBNAIL_LABEL"
description="COM_PHOCACART_FIELD_CROP_THUMBNAIL_DESC">
<option
value="0">COM_PHOCACART_NONE</option>
<option
value="1">COM_PHOCACART_ONLY_LARGE_THUMBNAIL</option>
<option
value="2">COM_PHOCACART_ONLY_MEDIUM_THUMBNAIL</option>
<option
value="3">COM_PHOCACART_ONLY_SMALL_THUMBNAIL</option>
<option
value="4">COM_PHOCACART_LARGE_AND_MEDIUM_THUMBNAIL</option>
<option
value="5">COM_PHOCACART_MEDIUM_AND_SMALL_THUMBNAIL</option>
<option
value="6">COM_PHOCACART_SMALL_AND_LARGE_THUMBNAIL</option>
<option
value="7">COM_PHOCACART_ALL</option>
</field>
<field name="create_webp_copy" default="0"
type="radio" class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_CREATE_WEBP_COPY_LABEL"
description="COM_PHOCACART_FIELD_CREATE_WEBP_COPY_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="phocahead36" type="phocahead"
default="COM_PHOCACART_HEAD_COPY_PASTE_IMAGES_OPTIONS_LABEL"
label="" description=""/>
<field name="copypaste_enable" default="0"
type="radio" class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_ENABLE_COPY_PASTE_IMAGES_LABEL"
description="COM_PHOCACART_FIELD_ENABLE_COPY_PASTE_IMAGES_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="copypaste_width" default="0"
size="4" type="text"
label="COM_PHOCACART_FIELD_COPY_PASTE_IMAGE_WIDTH_LABEL"
description="COM_PHOCACART_FIELD_COPY_PASTE_IMAGE_WIDTH_DESC"/>
<field name="copypaste_height"
default="0" size="4" type="text"
label="COM_PHOCACART_FIELD_COPY_PASTE_IMAGE_HEIGHT_LABEL"
description="COM_PHOCACART_FIELD_COPY_PASTE_IMAGE_HEIGHT_DESC"/>
<field name="copypaste_overwrite_file"
default="0" type="radio" class="btn-group
btn-group-yesno"
label="COM_PHOCACART_FIELD_ENABLE_COPY_PASTE_IMAGE_OVERWRITE_FILE_LABEL"
description="COM_PHOCACART_FIELD_ENABLE_COPY_PASTE_IMAGE_OVERWRITE_FILE_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="copypaste_folder_creation"
default="0" type="list" class="btn-group
btn-group-yesno"
label="COM_PHOCACART_FIELD_ENABLE_COPY_PASTE_IMAGE_CREATING_FOLDER_LABEL"
description="COM_PHOCACART_FIELD_ENABLE_COPY_PASTE_IMAGE_CREATING_FOLDER_DESC">
<option
value="0">COM_PHOCACART_NO_FOLDER</option>
<option
value="1">COM_PHOCACART_SPECIFIC_FOLDER</option>
<option
value="2">COM_PHOCACART_FOLDER_CREATED_FROM_FIRST_LETTER_OF_IMAGE</option>
</field>
<field name="copypaste_folder" default=""
size="4" type="text"
label="COM_PHOCACART_FIELD_COPY_PASTE_IMAGE_SPECIFIC_FOLDER_LABEL"
description="COM_PHOCACART_FIELD_COPY_PASTE_IMAGE_SPECIFIC_FOLDER_DESC"/>
<field name="phocahead14"
type="phocahead"
default="COM_PHOCACART_GENERAL_OPTIONS_LABEL" label=""
description=""/>
<!--
<field name="invoice_prefix" default=""
size="4" type="text"
label="COM_PHOCACART_FIELD_INVOICE_PREFIX_LABEL"
description="COM_PHOCACART_FIELD_INVOICE_PREFIX_DESC"/>
<field name="invoice_number_format"
default="" size="4" type="text"
label="COM_PHOCACART_FIELD_INVOICE_NUMBER_FORMAT_LABEL"
description="COM_PHOCACART_FIELD_INVOICE_NUMBER_FORMAT_DESC"/>
<field name="invoice_number_chars"
default="12" size="4" type="text"
label="COM_PHOCACART_FIELD_INVOICE_NUMBER_LENGTH_LABEL"
description="COM_PHOCACART_FIELD_INVOICE_NUMBER_LENGTH_DESC"/>-->
<!--<field name="attachment_format"
default="0" type="list"
label="COM_PHOCACART_FIELD_EMAIL_ATTACHMENT_TYPE_LABEL"
description="COM_PHOCACART_FIELD_EMAIL_ATTACHMENT_TYPE_DESC">
<option
value="0">COM_PHOCACART_HTML</option>
<option
value="1">COM_PHOCACART_PDF</option>
<option
value="2">COM_PHOCACART_BOTH</option>
</field>-->
<field name="additional_hits" default=""
type="list"
label="COM_PHOCACART_FIELD_ADDITIONAL_HITS_LABEL"
description="COM_PHOCACART_FIELD_ADDITIONAL_HITS_DESC"
multiple="true">
<option
value="1">COM_PHOCACART_PRODUCT_VIEW</option>
<option
value="2">COM_PHOCACART_SEARCH_TERM</option>
</field>
<field name="delete_regions" default="0"
type="radio" class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_DELETE_REGIONS_LABEL"
description="COM_PHOCACART_FIELD_DELETE_REGIONS_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="enable_wizard" default="1"
type="list"
label="COM_PHOCACART_FIELD_ENABLE_WIZARD_LABEL"
description="COM_PHOCACART_FIELD_ENABLE_WIZARD_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
<option
value="2">COM_PHOCACART_YES_FORCE_ENABLE_WIZARD</option>
</field>
<field name="comma_point" type="list"
default="0"
label="COM_PHOCACART_FIELD_REPLACE_COMMA_WITH_POINT_LABEL"
description="COM_PHOCACART_FIELD_REPLACE_COMMA_WITH_POINT_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="load_extension_list"
type="list" default="1"
label="COM_PHOCACART_FIELD_LOAD_EXTENSION_LIST_LABEL"
description="COM_PHOCACART_FIELD_LOAD_EXTENSION_LIST_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="phocahead34" type="phocahead"
default="COM_PHOCACART_SEARCH_AND_FILTER_OPTIONS_LABEL"
label="" description=""/>
<field name="search_matching_option"
type="list" default="any"
label="COM_PHOCACART_FIELD_SEARCH_MATCHING_OPTION_LABEL"
description="COM_PHOCACART_FIELD_SEARCH_MATCHING_OPTION_DESC">
<option
value="any">COM_PHOCACART_SEARCH_ANY</option>
<option
value="all">COM_PHOCACART_SEARCH_ALL</option>
<option
value="exact">COM_PHOCACART_SEARCH_EXACT</option>
</field>
<field name="search_matching_option_admin"
type="list" default="exact"
label="COM_PHOCACART_FIELD_SEARCH_MATCHING_OPTION_ADMIN_LABEL"
description="COM_PHOCACART_FIELD_SEARCH_MATCHING_OPTION_ADMIN_DESC">
<option
value="any">COM_PHOCACART_SEARCH_ANY</option>
<option
value="all">COM_PHOCACART_SEARCH_ALL</option>
<option
value="exact">COM_PHOCACART_SEARCH_EXACT</option>
</field>
<field name="search_deep" type="radio"
class="btn-group btn-group-yesno" default="0"
label="COM_PHOCACART_FIELD_DEEP_SEARCH_LABEL"
description="COM_PHOCACART_FIELD_DEEP_SEARCH_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="phocahead24"
type="phocaheadexpert"
default="COM_PHOCACART_ADVANCED_OPTIONS_EXPERTS_ONLY_LABEL"
label="" description=""/>
<field name="admin_columns_products" default="sku=E,
image, title, published, categories, price=E, price_original=E, stock=E,
access_level, language, association, hits, id"
type="textarea"
label="COM_PHOCACART_FIELD_COLUMNS_PRODUCT_LIST_ADMINISTRATION_LABEL"
description="COM_PHOCACART_FIELD_COLUMNS_PRODUCT_LIST_ADMINISTRATION_DESC"/>
<field name="admin_eip_title" type="list"
class="btn-group btn-group-yesno" default="4"
label="COM_PHOCACART_FIELD_TITLE_EDIT_IN_PLACE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_EDIT_IN_PLACE_DESC">
<option
value="1">COM_PHOCACART_ALIAS_NOT_EDITED_NOT_OVERWRITTEN</option>
<option
value="2">COM_PHOCACART_ALIAS_NOT_EDITED_OVERWRITTEN</option>
<option
value="3">COM_PHOCACART_ALIAS_EDITED_NOT_OVERWRITTEN</option>
<option
value="4">COM_PHOCACART_ALIAS_EDITED_OVERWRITTEN</option>
</field>
<field name="display_products_all_subcategories"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_PRODUCTS_FROM_ALL_SUBCATEGORIES_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_PRODUCTS_FROM_ALL_SUBCATEGORIES_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="sql_only_full_group_by" type="radio"
class="btn-group btn-group-yesno" default="0"
label="COM_PHOCACART_FIELD_SQL_ONLY_FULL_GROUP_BY_LABEL"
description="COM_PHOCACART_FIELD_SQL_ONLY_FULL_GROUP_BY_DESC">
<option
value="0">COM_PHOCACART_DISABLED</option>
<option
value="1">COM_PHOCACART_ENABLED</option>
</field>
<field name="sql_products_skip_access"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_ACCESS_LABEL"
description="COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_ACCESS_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="sql_products_skip_group"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_GROUP_LABEL"
description="COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_GROUP_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="sql_products_skip_attributes"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_ATTRIBUTES_LABEL"
description="COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_ATTRIBUTES_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="sql_products_skip_category_type"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_CATEGORY_TYPE_LABEL"
description="COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_CATEGORY_TYPE_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="sql_products_skip_tax" type="radio"
class="btn-group btn-group-yesno" default="0"
label="COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_TAX_LABEL"
description="COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_TAX_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="sql_product_skip_access"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_ACCESS_LABEL"
description="COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_ACCESS_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="sql_product_skip_group" type="radio"
class="btn-group btn-group-yesno" default="0"
label="COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_GROUP_LABEL"
description="COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_GROUP_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="sql_product_skip_attributes"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_ATTRIBUTES_LABEL"
description="COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_ATTRIBUTES_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="sql_product_skip_category_type"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_CATEGORY_TYPE_LABEL"
description="COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_CATEGORY_TYPE_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="sql_product_skip_tax" type="radio"
class="btn-group btn-group-yesno" default="0"
label="COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_TAX_LABEL"
description="COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_TAX_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="sql_search_skip_id" type="list"
class="btn-group btn-group-yesno" default="1"
label="COM_PHOCACART_FIELD_SQL_SEARCH_SKIP_ID_ATTRIBUTES_LABEL"
description="COM_PHOCACART_FIELD_SQL_SEARCH_SKIP_ID_ATTRIBUTES_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="2">COM_PHOCACART_ONLINE_SHOP_ONLY</option>
<option value="3">COM_PHOCACART_POS_ONLY</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="product_image_path"
default="images/phocacartproducts" size="4"
type="text"
label="COM_PHOCACART_FIELD_PRODUCT_IMAGE_PATH_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_IMAGE_PATH_DESC"/>
<field name="category_image_path"
default="images/phocacartcategories" size="4"
type="text"
label="COM_PHOCACART_FIELD_CATEGORY_IMAGE_PATH_LABEL"
description="COM_PHOCACART_FIELD_CATEGORY_IMAGE_PATH_DESC"/>
<field name="thumb_name_prefix"
default="phoca_thumb" size="4" type="text"
label="COM_PHOCACART_FIELD_THUMBNAIL_NAME_PREFIX_LABEL"
description="COM_PHOCACART_FIELD_THUMBNAIL_NAME_PREFIX_DESC"/>
<field name="skip_category_view" type="radio"
class="btn-group btn-group-yesno" default="0"
label="COM_PHOCACART_FIELD_SKIP_CATEGORY_VIEW_LABEL"
description="COM_PHOCACART_FIELD_SKIP_CATEGORY_VIEW_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="manufacturer_alias"
default="manufacturer" size="10" type="text"
label="COM_PHOCACART_FIELD_MANUFACTURER_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_MANUFACTURER_ALIAS_DESC"/>
<field name="load_min_js" type="radio"
class="btn-group btn-group-yesno" default="1"
label="COM_PHOCACART_FIELD_LOAD_MINIFIED_JS_LIBRARIES_LABEL"
description="COM_PHOCACART_FIELD_LOAD_MINIFIED_JS_LIBRARIES_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="category_alias_prefix" default=""
size="10" type="text"
label="COM_PHOCACART_FIELD_CATEGORY_ALIAS_PREFIX_LABEL"
description="COM_PHOCACART_FIELD_CATEGORY_ALIAS_PREFIX_DESC"/>
<!--<field name="sef_advanced" type="radio"
class="btn-group btn-group-yesno btn-group-reversed"
default="0" label="JGLOBAL_SEF_ADVANCED_LABEL"
description="JGLOBAL_SEF_ADVANCED_DESC"
filter="integer" >
<option
value="0">JGLOBAL_SEF_ADVANCED_LEGACY</option>
<option
value="1">JGLOBAL_SEF_ADVANCED_MODERN</option>
</field>
<field name="sef_ids" type="radio"
class="btn-group btn-group-yesno" default="0"
label="JGLOBAL_SEF_NOIDS_LABEL"
description="JGLOBAL_SEF_NOIDS_DESC"
showon="sef_advanced:1" filter="integer" >
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>-->
<field name="remove_sef_ids" type="radio"
class="btn-group btn-group-yesno" default="0"
label="COM_PHOCACART_SEF_NOIDS_LABEL"
description="COM_PHOCACART_SEF_NOIDS_DESC"
filter="integer" >
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="phocahead18" type="phocahead"
default="COM_PHOCACART_IMPORT_EXPORT_OPTIONS_LABEL"
label="" description=""/>
<field name="import_export_type"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_IMPORT_EXPORT_TYPE_LABEL"
description="COM_PHOCACART_FIELD_IMPORT_EXPORT_TYPE_DESC">
<option
value="0">COM_PHOCACART_CSV</option>
<option
value="1">COM_PHOCACART_XML</option>
</field>
<field name="import_encoding"
type="text" default=""
label="COM_PHOCACART_FIELD_IMPORT_ENCODING_LABEL"
description="COM_PHOCACART_FIELD_IMPORT_ENCODING_DESC"/>
<field name="import_encoding_method"
type="list" default="0"
label="COM_PHOCACART_FIELD_IMPORT_ENCODING_METHOD_LABEL"
description="COM_PHOCACART_FIELD_IMPORT_ENCODING_METHOD_DESC">
<option
value="1">COM_PHOCACART_ICONV</option>
<option
value="2">COM_PHOCACART_MB_CONVERT_ENCODING</option>
<option
value="0">COM_PHOCACART_NONE</option>
</field>
<field name="export_attributes"
type="radio" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_EXPORT_ATTRIBUTES_LABEL"
description="COM_PHOCACART_FIELD_EXPORT_ATTRIBUTES_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<field name="export_advanced_stock_options"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_EXPORT_ADVANCED_STOCK_OPTIONS_LABEL"
description="COM_PHOCACART_FIELD_EXPORT_ADVANCED_STOCK_OPTIONS_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<field name="export_specifications"
type="radio" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_EXPORT_SPECIFICATIONS_LABEL"
description="COM_PHOCACART_FIELD_EXPORT_SPECIFICATIONS_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<field name="export_discounts"
type="radio" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_EXPORT_DISCOUNTS_LABEL"
description="COM_PHOCACART_FIELD_EXPORT_DISCOUNTS_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<field name="export_downloads"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_EXPORT_DOWNLOADS_LABEL"
description="COM_PHOCACART_FIELD_EXPORT_DOWNLOADS_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<field name="export_parameters" type="radio"
class="btn-group btn-group-yesno" default="0"
label="COM_PHOCACART_FIELD_EXPORT_PARAMETERS_LABEL"
description="COM_PHOCACART_FIELD_EXPORT_PARAMETERS_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<!--<field name="export_add_title"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_ADD_TITLE_ATTRIBUTE_EXPORT_LABEL"
description="COM_PHOCACART_FIELD_ADD_TITLE_ATTRIBUTE_EXPORT_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>-->
<field name="phocahead19"
type="phocaheadexpert"
default="COM_PHOCACART_IMPORT_EXPORT_ADVANCED_OPTIONS_EXPERTS_ONLY_LABEL"
label="" description=""/>
<field name="import_export_pagination"
type="text" default="20"
label="COM_PHOCACART_FIELD_EXPORT_PAGINATION_LABEL"
description="COM_PHOCACART_FIELD_EXPORT_PAGINATION_DESC"/>
<field name="export_download_limit_offset"
type="text" default="0"
label="COM_PHOCACART_FIELD_EXPORT_DOWNLOAD_LIMIT_OFFSET_LABEL"
description="COM_PHOCACART_FIELD_EXPORT_DOWNLOAD_LIMIT_OFFSET_DESC"/>
<field name="export_download_limit_count"
type="text" default="0"
label="COM_PHOCACART_FIELD_EXPORT_DOWNLOAD_LIMIT_COUNT_LABEL"
description="COM_PHOCACART_FIELD_EXPORT_DOWNLOAD_LIMIT_COUNT_DESC"/>
<field name="fgets_line_length"
class="btn-group" type="list" default="24576"
label="COM_PHOCACART_FIELD_FGETS_LINE_LENGTH_LABEL"
description="COM_PHOCACART_FIELD_FGETS_LINE_LENGTH_DESC">
<option value="8192">8192</option>
<option value="16384">16384</option>
<option value="24576">24576</option>
<option value="32768">32768</option>
</field>
<field name="import_column" type="radio"
class="btn-group btn-group-yesno" default="1"
label="COM_PHOCACART_FIELD_IMPORT_COLUMN_LABEL"
description="COM_PHOCACART_FIELD_IMPORT_COLUMN_DESC">
<option
value="1">COM_PHOCACART_ID</option>
<option
value="2">COM_PHOCACART_SKU</option>
</field>
<field name="phocahead25"
type="phocahead"
default="COM_PHOCACART_STATISTICS_OPTIONS_LABEL"
label="" description=""/>
<field name="statistics_order_status"
type="PhocacartOrderstatus" default="-1"
label="COM_PHOCACART_FIELD_STATISTICS_ORDER_STATUS_LABEL"
description="COM_PHOCACART_FIELD_STATISTICS_ORDER_STATUS_DESC"
multiple="true"/>
<field name="phocahead27"
type="phocahead"
default="COM_PHOCACART_REPORT_OPTIONS_LABEL" label=""
description=""/>
<field name="report_header"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_REPORT_HEADER_LABEL"
description="COM_PHOCACART_FIELD_REPORT_HEADER_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="report_calculation"
type="list" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_REPORT_CALCULATION_LABEL"
description="COM_PHOCACART_FIELD_REPORT_CALCULATION_DESC">
<option
value="1">COM_PHOCACART_CALCULATION</option>
<option
value="2">COM_PHOCACART_TAX_RECAPITULATION</option>
</field>
<field name="report_display_tax"
type="radio" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_REPORT_DISPLAY_TAX_LABEL"
description="COM_PHOCACART_FIELD_REPORT_DISPLAY_TAX_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<field name="report_display_rounding"
type="radio" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_REPORT_DISPLAY_ROUNDING_LABEL"
description="COM_PHOCACART_FIELD_REPORT_DISPLAY_ROUNDING_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<field name="phocahead40" type="phocahead"
default="COM_PHOCACART_GIFT_VOUCHER_OPTIONS_LABEL"
label="" description=""/>
<field name="gift_code_length" type="text"
default="8"
label="COM_PHOCACART_FIELD_GIFT_CODE_LENGTH_LABEL"
description="COM_PHOCACART_FIELD_GIFT_CODE_LENGTH_DESC"/>
<field name="gift_code_characters" type="text"
default="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
label="COM_PHOCACART_FIELD_GIFT_CODE_CHARACTERS_LABEL"
description="COM_PHOCACART_FIELD_GIFT_CODE_CHARACTERS_DESC"/>
<field name="gift_sender_message_length"
type="text" default="500"
label="COM_PHOCACART_FIELD_GIFT_SENDER_MESSAGE_LENGTH_LABEL"
description="COM_PHOCACART_FIELD_GIFT_SENDER_MESSAGE_LENGTH_DESC"/>
<field name="phocahead38" type="phocahead"
default="COM_PHOCACART_PRINTED_CATALOG_OPTIONS_LABEL"
label="" description=""/>
<field name="printed_catalog_enable"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_ENABLE_CREATING_PRINTED_CATALOG_LABEL"
description="COM_PHOCACART_FIELD_ENABLE_CREATING_PRINTED_CATALOG_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<field name="printed_catalog_header"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_PRINTED_CATALOG_HEADER_LABEL"
description="COM_PHOCACART_FIELD_PRINTED_CATALOG_HEADER_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="printed_catalog_document_title"
type="text" default=""
label="COM_PHOCACART_FIELD_PRINTED_CATALOG_DOCUMENT_TITLE_LABEL"
description="COM_PHOCACART_FIELD_PRINTED_CATALOG_DOCUMENT_TITLE_DESC"
filter="string"/>
<field name="printed_catalog_css" default=""
type="textarea"
label="COM_PHOCACART_FIELD_PRINTED_CATALOG_CSS_LABEL"
description="COM_PHOCACART_FIELD_PRINTED_CATALOG_CSS_DESC"/>
<field name="printed_catalog_display_category_title"
type="radio" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_PRINTED_CATALOG_DISPLAY_CATEGORY_TITLE_LABEL"
description="COM_PHOCACART_FIELD_PRINTED_CATALOG_DISPLAY_CATEGORY_TITLE_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<field name="printed_catalog_display_price_label"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_PRINTED_CATALOG_DISPLAY_PRICE_LABEL_LABEL"
description="COM_PHOCACART_FIELD_PRINTED_CATALOG_DISPLAY_PRICE_LABEL_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<field name="phocahead32"
type="phocahead"
default="COM_PHOCACART_ADMINISTRATION_OPTIONS_LABEL"
label="" description=""/>
<field name="display_admin_description"
type="text" default="35"
label="COM_PHOCACART_FIELD_DISPLAY_DESCRIPTION_ADMINISTRATION_LISTS_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_DESCRIPTION_ADMINISTRATION_LISTS_DESC"
filter="integer"/>
<field name="phocahead33"
type="phocahead"
default="COM_PHOCACART_MULTILINGUAL_OPTIONS_LABEL"
label="" description=""/>
<field name="order_language" type="list"
class="btn-group btn-group-yesno" default="1"
label="COM_PHOCACART_FIELD_ORDER_LANGUAGE_LABEL"
description="COM_PHOCACART_FIELD_ORDER_LANGUAGE_DESC">
<option
value="0">COM_PHOCACART_DEFAULT_LANGUAGE_FRONTEND</option>
<option
value="1">COM_PHOCACART_CUSTOMERS_LANGUAGE</option>
</field>
<field name="order_language_variables"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_ORDER_LANGUAGE_VARIABLE_LABEL"
description="COM_PHOCACART_FIELD_ORDER_LANGUAGE_VARIABLE_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
</fieldset>
<fieldset name="store"
label="COM_PHOCACART_CONFIG_HEAD_STORE_LABEL">
<field name="store_title" type="text"
default=""
label="COM_PHOCACART_FIELD_STORE_TITLE_LABEL"
description="COM_PHOCACART_FIELD_STORE_TITLE_DESC"
filter="string"/>
<field name="store_logo" type="media"
default="" directoryimg="1"
label="COM_PHOCACART_FIELD_STORE_LOGO_LABEL"
description="COM_PHOCACART_FIELD_STORE_LOGO_DESC"/>
<field name="store_info"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_STORE_INFORMATION_LABEL"
description="COM_PHOCACART_FIELD_STORE_INFORMATION_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="phocahead26"
type="phocahead"
default="COM_PHOCACART_PRIVACY_TERMS_AND_CONDITIONS_SETTINGS_LABEL"
label="" description=""/>
<field name="display_checkout_toc_checkbox"
type="radio" class="btn-group btn-group-yesno"
default="2"
label="COM_PHOCACART_FIELD_DISPLAY_CHECKOUT_TERMS_AND_CONDITIONS_CHECKBOX_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_CHECKOUT_TERMS_AND_CONDITIONS_CHECKBOX_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="2">COM_PHOCACART_YES_REQUIRED</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="terms_conditions_custom_label_text"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_MAIN_TERMS_AND_CONDITIONS_CUSTOM_LABEL_TEXT_LABEL"
description="COM_PHOCACART_FIELD_MAIN_TERMS_AND_CONDITIONS_CUSTOM_LABEL_TEXT_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="terms_conditions"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_MAIN_TERMS_AND_CONDITIONS_LABEL"
description="COM_PHOCACART_FIELD_MAIN_TERMS_AND_CONDITIONS_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="cofirm_order_text"
default="" type="text"
label="COM_PHOCACART_FIELD_CONFIRM_ORDER_TEXT_LABEL"
description="COM_PHOCACART_FIELD_CONFIRM_ORDER_TEXT_DESC"/>
<field name="cofirm_order_text_zero"
default="" type="text"
label="COM_PHOCACART_FIELD_CONFIRM_ORDER_TEXT_ZERO_LABEL"
description="COM_PHOCACART_FIELD_CONFIRM_ORDER_TEXT_ZERO_DESC"/>
<field name="display_checkout_privacy_checkbox"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_CHECKOUT_PRIVACY_CHECKBOX_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_CHECKOUT_PRIVACY_CHECKBOX_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="2">COM_PHOCACART_YES_REQUIRED</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="checkout_privacy_checkbox_label_text"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_CHECKOUT_PRIVACY_CHECKBOX_LABEL_TEXT_LABEL"
description="COM_PHOCACART_FIELD_CHECKOUT_PRIVACY_CHECKBOX_LABEL_TEXT_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="display_checkout_newsletter_checkbox"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_CHECKOUT_NEWSLETTER_CHECKBOX_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_CHECKOUT_NEWSLETTER_CHECKBOX_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field
name="checkout_newsletter_checkbox_label_text"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_CHECKOUT_NEWSLETTER_CHECKBOX_LABEL_TEXT_LABEL"
description="COM_PHOCACART_FIELD_CHECKOUT_NEWSLETTER_CHECKBOX_LABEL_TEXT_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="phocahead28"
type="phocahead"
default="COM_PHOCACART_OPENING_TIMES_OPTIONS_LABEL"
label="" description=""/>
<field name="checking_opening_times"
type="list" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_CHECKING_OPENING_TIMES_LABEL"
description="COM_PHOCACART_FIELD_CHECKING_OPENING_TIMES_DESC">
<option
value="0">COM_PHOCACART_DISABLED</option>
<option
value="1">COM_PHOCACART_ENABLED_ORDER_POSSIBLE</option>
<option
value="2">COM_PHOCACART_ENABLED_ORDER_NOT_POSSIBLE</option>
</field>
<field name="store_closed_checkout_message"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_STORE_CLOSED_CHECKOUT_MESSAGE_LABEL"
description="COM_PHOCACART_FIELD_STORE_CLOSED_CHECKOUT_MESSAGE_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
</fieldset>
<fieldset name="billing"
label="COM_PHOCACART_CONFIG_HEAD_BILLING_LABEL">
<field name="bank_account_number"
default="" size="18" type="text"
label="COM_PHOCACART_FIELD_BANK_ACCOUNT_NUMBER_LABEL"
description="COM_PHOCACART_FIELD_BANK_ACCOUNT_NUMBER_DESC"/>
<field name="iban" default=""
size="18" type="text"
label="COM_PHOCACART_FIELD_IBAN_LABEL"
description="COM_PHOCACART_FIELD_IBAN_DESC"/>
<field name="bic_swift" default=""
size="18" type="text"
label="COM_PHOCACART_FIELD_BIC_SWIFT_LABEL"
description="COM_PHOCACART_FIELD_BIC_SWIFT_DESC"/>
<field name="order_creating_numbers"
type="list" class="btn-group btn-group-yesno"
default="A"
label="COM_PHOCACART_FIELD_CREATING_ORDER_NUMBERS_METHOD_LABEL"
description="COM_PHOCACART_FIELD_CREATING_ORDER_NUMBERS_METHOD_DESC">
<option
value="A">COM_PHOCACART_STANDARD_AUTO_INCREMENT</option>
<option
value="Y">COM_PHOCACART_ON_ANNUAL_BASIS</option>
<option
value="M">COM_PHOCACART_ON_MONTHLY_BASIS</option>
</field>
<field name="order_number_format"
default="{prefix}{year}{orderid}{suffix}" size="18"
type="text"
label="COM_PHOCACART_FIELD_ORDER_NUMBER_FORMAT_LABEL"
description="COM_PHOCACART_FIELD_ORDER_NUMBER_FORMAT_DESC"/>
<field name="order_number_prefix"
default="" size="18" type="text"
label="COM_PHOCACART_FIELD_ORDER_NUMBER_PREFIX_LABEL"
description="COM_PHOCACART_FIELD_ORDER_NUMBER_PREFIX_DESC"/>
<field name="order_number_suffix"
default="" size="18" type="text"
label="COM_PHOCACART_FIELD_ORDER_NUMBER_SUFFIX_LABEL"
description="COM_PHOCACART_FIELD_ORDER_NUMBER_SUFFIX_DESC"/>
<field name="order_id_length_order"
default="10" size="18" type="text"
label="COM_PHOCACART_FIELD_ORDER_ID_LENGTH_ORDER_NUMBER_LABEL"
description="COM_PHOCACART_FIELD_ORDER_ID_LENGTH_ORDER_NUMBER_DESC"/>
<field name="receipt_creating_numbers"
type="list" class="btn-group btn-group-yesno"
default="A"
label="COM_PHOCACART_FIELD_CREATING_RECEIPT_NUMBERS_METHOD_LABEL"
description="COM_PHOCACART_FIELD_CREATING_RECEIPT_NUMBERS_METHOD_DESC">
<option
value="A">COM_PHOCACART_STANDARD_AUTO_INCREMENT</option>
<option
value="Y">COM_PHOCACART_ON_ANNUAL_BASIS</option>
<option
value="M">COM_PHOCACART_ON_MONTHLY_BASIS</option>
</field>
<field name="receipt_number_format"
default="{prefix}{year}{orderid}{suffix}" size="18"
type="text"
label="COM_PHOCACART_FIELD_RECEIPT_NUMBER_FORMAT_LABEL"
description="COM_PHOCACART_FIELD_RECEIPT_NUMBER_FORMAT_DESC"/>
<field name="receipt_number_prefix"
default="" size="18" type="text"
label="COM_PHOCACART_FIELD_RECEIPT_NUMBER_PREFIX_LABEL"
description="COM_PHOCACART_FIELD_RECEIPT_NUMBER_PREFIX_DESC"/>
<field name="receipt_number_suffix"
default="" size="18" type="text"
label="COM_PHOCACART_FIELD_RECEIPT_NUMBER_SUFFIX_LABEL"
description="COM_PHOCACART_FIELD_RECEIPT_NUMBER_SUFFIX_DESC"/>
<field name="order_id_length_receipt"
default="10" size="18" type="text"
label="COM_PHOCACART_FIELD_ORDER_ID_LENGTH_RECEIPT_NUMBER_LABEL"
description="COM_PHOCACART_FIELD_ORDER_ID_LENGTH_RECEIPT_NUMBER_DESC"/>
<field name="invoice_creating_numbers"
type="list" class="btn-group btn-group-yesno"
default="A"
label="COM_PHOCACART_FIELD_CREATING_INVOICE_NUMBERS_METHOD_LABEL"
description="COM_PHOCACART_FIELD_CREATING_INVOICE_NUMBERS_METHOD_DESC">
<option
value="A">COM_PHOCACART_STANDARD_AUTO_INCREMENT</option>
<option
value="Y">COM_PHOCACART_ON_ANNUAL_BASIS</option>
<option
value="M">COM_PHOCACART_ON_MONTHLY_BASIS</option>
</field>
<field name="invoice_creating_status_based"
class="btn-group" default="0"
type="PhocacartOrderstatus" typemethod="1"
label="COM_PHOCACART_FIELD_CREATING_INVOICE_NUMBER_BASED_ON_ORDER_STATUS_LABEL"
description="COM_PHOCACART_FIELD_CREATING_INVOICE_NUMBER_BASED_ON_ORDER_STATUS_DESC">
</field>
<field name="invoice_number_format"
default="{prefix}{year}{orderid}{suffix}" size="18"
type="text"
label="COM_PHOCACART_FIELD_INVOICE_NUMBER_FORMAT_LABEL"
description="COM_PHOCACART_FIELD_INVOICE_NUMBER_FORMAT_DESC"/>
<field name="invoice_number_prefix"
default="" size="18" type="text"
label="COM_PHOCACART_FIELD_INVOICE_NUMBER_PREFIX_LABEL"
description="COM_PHOCACART_FIELD_INVOICE_NUMBER_PREFIX_DESC"/>
<field name="invoice_number_suffix"
default="" size="18" type="text"
label="COM_PHOCACART_FIELD_INVOICE_NUMBER_SUFFIX_LABEL"
description="COM_PHOCACART_FIELD_INVOICE_NUMBER_SUFFIX_DESC"/>
<field name="order_id_length_invoice"
default="10" size="18" type="text"
label="COM_PHOCACART_FIELD_ORDER_ID_LENGTH_INVOICE_NUMBER_LABEL"
description="COM_PHOCACART_FIELD_ORDER_ID_LENGTH_INVOICE_NUMBER_DESC"/>
<field name="invoice_due_date_days"
default="30" size="18" type="text"
label="COM_PHOCACART_FIELD_INVOICE_DUE_DATE_DAYS_LABEL"
description="COM_PHOCACART_FIELD_INVOICE_DUE_DATE_DAYS_DESC"/>
<field name="invoice_terms_payment"
default="" size="4" type="text"
label="COM_PHOCACART_FIELD_INVOICE_TERMS_OF_PAYMENT_LABEL"
description="COM_PHOCACART_FIELD_INVOICE_TERMS_OF_PAYMENT_DESC"/>
<field name="prn_number_id_basis"
type="list" class="btn-group btn-group-yesno"
default="A"
label="COM_PHOCACART_FIELD_BASIS_FOR_CREATING_PAYMENT_REFERENCE_NUMBER_LABEL"
description="COM_PHOCACART_FIELD_BASIS_FOR_CREATING_PAYMENT_REFERENCE_NUMBER_DESC">
<option
value="A">COM_PHOCACART_STANDARD_AUTO_INCREMENT</option>
<option
value="O">COM_PHOCACART_ORDER_NUMBER</option>
<option
value="I">COM_PHOCACART_INVOICE_NUMBER</option>
<option
value="R">COM_PHOCACART_RECEIPT_NUMBER</option>
</field>
<field name="prn_number_format"
default="{prefix}{year}{orderid}{suffix}" size="18"
type="text"
label="COM_PHOCACART_FIELD_PRN_NUMBER_FORMAT_LABEL"
description="COM_PHOCACART_FIELD_PRN_NUMBER_FORMAT_DESC"/>
<field name="prn_number_prefix"
default="" size="18" type="text"
label="COM_PHOCACART_FIELD_PRN_NUMBER_PREFIX_LABEL"
description="COM_PHOCACART_FIELD_PRN_NUMBER_PREFIX_DESC"/>
<field name="prn_number_suffix"
default="" size="18" type="text"
label="COM_PHOCACART_FIELD_PRN_NUMBER_SUFFIX_LABEL"
description="COM_PHOCACART_FIELD_PRN_NUMBER_SUFFIX_DESC"/>
<field name="order_id_length_prn"
default="10" size="18" type="text"
label="COM_PHOCACART_FIELD_ORDER_ID_LENGTH_PRN_NUMBER_LABEL"
description="COM_PHOCACART_FIELD_ORDER_ID_LENGTH_PRN_NUMBER_DESC"/>
<field name="queue_number_prefix" default=""
size="18" type="text"
label="COM_PHOCACART_FIELD_QUEUE_NUMBER_PREFIX_LABEL"
description="COM_PHOCACART_FIELD_QUEUE_NUMBER_PREFIX_DESC"/>
<field name="queue_number_suffix"
default="" size="18" type="text"
label="COM_PHOCACART_FIELD_QUEUE_NUMBER_SUFFIX_LABEL"
description="COM_PHOCACART_FIELD_QUEUE_NUMBER_SUFFIX_DESC"/>
<field name="queue_creating_numbers" type="list"
class="btn-group btn-group-yesno" default="A"
label="COM_PHOCACART_FIELD_CREATING_QUEUE_NUMBERS_METHOD_LABEL"
description="COM_PHOCACART_FIELD_CREATING_QUEUE_NUMBERS_METHOD_DESC">
<option
value="A">COM_PHOCACART_STANDARD_AUTO_INCREMENT</option>
<option
value="Y">COM_PHOCACART_ON_ANNUAL_BASIS</option>
<option
value="M">COM_PHOCACART_ON_MONTHLY_BASIS</option>
<option
value="D">COM_PHOCACART_ON_DAILY_BASIS</option>
</field>
<field name="queue_number_length" default="5"
size="18" type="text"
label="COM_PHOCACART_FIELD_QUEUE_NUMBER_LENGTH_LABEL"
description="COM_PHOCACART_FIELD_QUEUE_NUMBER_LENGTH_DESC"/>
<field name="pdf_invoice_qr_information"
default="" type="textarea"
label="COM_PHOCACART_FIELD_PDF_INVOICE_QR_INFORMATION_LABEL"
description="COM_PHOCACART_FIELD_PDF_INVOICE_QR_INFORMATION_DESC"/>
<field name="pdf_invoice_qr_code"
default="" type="textarea"
label="COM_PHOCACART_FIELD_PDF_INVOICE_QR_CODE_LABEL"
description="COM_PHOCACART_FIELD_PDF_INVOICE_QR_CODE_DESC"/>
<field name="pdf_invoice_signature_image"
type="media" default="" directoryimg="1"
label="COM_PHOCACART_FIELD_PDF_INVOICE_SIGNATURE_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_PDF_INVOICE_SIGNATURE_IMAGE_DESC"/>
<field name="invoice_global_top_desc"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_INVOICE_GLOBAL_TOP_DESCRIPTION_LABEL"
description="COM_PHOCACART_FIELD_INVOICE_GLOBAL_TOP_DESCRIPTION_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="invoice_global_middle_desc"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_INVOICE_GLOBAL_MIDDLE_DESCRIPTION_LABEL"
description="COM_PHOCACART_FIELD_INVOICE_GLOBAL_MIDDLE_DESCRIPTION_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="invoice_global_bottom_desc"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_INVOICE_GLOBAL_BOTTOM_DESCRIPTION_LABEL"
description="COM_PHOCACART_FIELD_INVOICE_GLOBAL_BOTTOM_DESCRIPTION_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="order_global_top_desc"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_ORDER_GLOBAL_TOP_DESCRIPTION_LABEL"
description="COM_PHOCACART_FIELD_ORDER_GLOBAL_TOP_DESCRIPTION_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="order_global_middle_desc"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_ORDER_GLOBAL_MIDDLE_DESCRIPTION_LABEL"
description="COM_PHOCACART_FIELD_ORDER_GLOBAL_MIDDLE_DESCRIPTION_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="order_global_bottom_desc"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_ORDER_GLOBAL_BOTTOM_DESCRIPTION_LABEL"
description="COM_PHOCACART_FIELD_ORDER_GLOBAL_BOTTOM_DESCRIPTION_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="dn_global_top_desc"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_DN_GLOBAL_TOP_DESCRIPTION_LABEL"
description="COM_PHOCACART_FIELD_DN_GLOBAL_TOP_DESCRIPTION_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="dn_global_middle_desc"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_DN_GLOBAL_MIDDLE_DESCRIPTION_LABEL"
description="COM_PHOCACART_FIELD_DN_GLOBAL_MIDDLE_DESCRIPTION_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="dn_global_bottom_desc"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_DN_GLOBAL_BOTTOM_DESCRIPTION_LABEL"
description="COM_PHOCACART_FIELD_DN_GLOBAL_BOTTOM_DESCRIPTION_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="oidn_global_billing_desc"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_ORDER_INVOICE_DELIVERY_NOTE_GLOBAL_BILLING_DESCRIPTION_LABEL"
description="COM_PHOCACART_FIELD_ORDER_INVOICE_DELIVERY_NOTE_GLOBAL_BILLING_DESCRIPTION_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="oidn_global_shipping_desc"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_ORDER_INVOICE_DELIVERY_NOTE_GLOBAL_SHIPPING_DESCRIPTION_LABEL"
description="COM_PHOCACART_FIELD_ORDER_INVOICE_DELIVERY_NOTE_GLOBAL_SHIPPING_DESCRIPTION_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="display_tax_recapitulation_invoice"
class="btn-group" type="radio" default="0"
label="COM_PHOCACART_FIELD_DISPLAY_TAX_RECAPITULATION_INVOICE_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_TAX_RECAPITULATION_INVOICE_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="display_time_of_supply_invoice"
class="btn-group" type="radio" default="0"
label="COM_PHOCACART_FIELD_DISPLAY_DATE_OF_TAXABLE_SUPPLY_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_DATE_OF_TAXABLE_SUPPLY_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="display_reward_points_invoice"
class="btn-group" type="radio" default="0"
label="COM_PHOCACART_FIELD_DISPLAY_REWARD_POINTS_INVOICE_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_REWARD_POINTS_INVOICE_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
</fieldset>
<fieldset name="pos"
label="COM_PHOCACART_CONFIG_HEAD_POS_LABEL">
<field name="pos_enabled" default="0"
type="radio" class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_ENABLE_POS_LABEL"
description="COM_PHOCACART_FIELD_ENABLE_POS_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="pos_filter_category"
default="1" type="list" class="btn-group
btn-group-yesno"
label="COM_PHOCACART_FIELD_POS_FILTER_CATEGORY_LABEL"
description="COM_PHOCACART_FIELD_POS_FILTER_CATEGORY_DESC">
<option
value="1">COM_PHOCACART_ONLY_ONE_CATEGORY</option>
<option
value="2">COM_PHOCACART_MORE_CATEGORIES</option>
</field>
<field name="pos_categories"
default="-1" type="PhocacartCategory"
typemethod="allnone" categorytype="2"
label="COM_PHOCACART_FIELD_POS_CATEGORIES_LABEL"
description="COM_PHOCACART_FIELD_POS_CATEGORIES_DESC"
multiple="true"/>
<field name="pos_customers"
type="usergroup"
label="COM_PHOCACART_POS_CUSTOMERS_LABEL"
description="COM_PHOCACART_POS_CUSTOMERS_DESC"
class="inputbox" size="1"
multiple="true"/>
<field name="pos_shipping_force"
type="PhocaCartShippingMethod" typemethod="2"
label="COM_PHOCACART_FIELD_FORCE_SHIPPING_METHOD_POS_LABEL"
description="COM_PHOCACART_FIELD_FORCE_SHIPPING_METHOD_POS_DESC"
class="inputbox" size="1"/>
<field name="pos_payment_force"
type="PhocaCartPayMentMethod" typemethod="2"
label="COM_PHOCACART_FIELD_FORCE_PAYMENT_METHOD_POS_LABEL"
description="COM_PHOCACART_FIELD_FORCE_PAYMENT_METHOD_POS_DESC"
class="inputbox" size="1"/>
<field name="pos_preferred_sku"
class="btn-group" type="list" default="sku"
label="COM_PHOCACART_FIELD_POS_PREFERRED_SKU_LABEL"
description="COM_PHOCACART_FIELD_POS_PREFERRED_SKU_DESC">
<option
value="sku">COM_PHOCACART_FIELD_SKU_LABEL</option>
<option
value="upc">COM_PHOCACART_FIELD_UPC_LABEL</option>
<option
value="ean">COM_PHOCACART_FIELD_EAN_LABEL</option>
<option
value="jan">COM_PHOCACART_FIELD_JAN_LABEL</option>
<option
value="isbn">COM_PHOCACART_FIELD_ISBN_LABEL</option>
<option
value="mpn">COM_PHOCACART_FIELD_MPN_LABEL</option>
<option
value="serial_number">COM_PHOCACART_FIELD_SERIAL_NUMBER_LABEL</option>
<option
value="registration_key">COM_PHOCACART_FIELD_REGISTRATION_KEY_LABEL</option>
</field>
<field name="pos_sku_input_type"
class="btn-group" type="radio" default="text"
label="COM_PHOCACART_FIELD_POS_SKU_INPUT_TYPE_LABEL"
description="COM_PHOCACART_FIELD_POS_SKU_INPUT_TYPE_DESC">
<option
value="text">COM_PHOCACART_TEXT</option>
<option
value="number">COM_PHOCACART_NUMBER</option>
</field>
<field name="pos_loyalty_card_number_input_type"
class="btn-group" type="radio" default="text"
label="COM_PHOCACART_FIELD_POS_LOYALTY_CARD_NUMBER_INPUT_TYPE_LABEL"
description="COM_PHOCACART_FIELD_POS_LOYALTY_CARD_NUMBER_INPUT_TYPE_DESC">
<option
value="text">COM_PHOCACART_TEXT</option>
<option
value="number">COM_PHOCACART_NUMBER</option>
</field>
<field name="pos_focus_input_fields"
class="btn-group" type="radio" default="0"
label="COM_PHOCACART_FIELD_POS_FOCUS_INPUT_FIELDS_LABEL"
description="COM_PHOCACART_FIELD_POS_FOCUS_INPUT_FIELDS_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="phocahead22"
type="phocahead"
default="COM_PHOCACART_POS_RECEIPT_SETTINGS_LABEL"
label="" description=""/>
<field name="store_logo_pos"
type="media" default="" directoryimg="1"
label="COM_PHOCACART_FIELD_STORE_LOGO_POS_LABEL"
description="COM_PHOCACART_FIELD_STORE_LOGO_POS_DESC"/>
<field name="store_title_pos" default=""
type="textarea"
label="COM_PHOCACART_FIELD_STORE_TITLE_POS_LABEL"
description="COM_PHOCACART_FIELD_STORE_TITLE_POS_DESC"/>
<field name="store_info_pos" default=""
type="textarea"
label="COM_PHOCACART_FIELD_STORE_INFORMATION_POS_LABEL"
description="COM_PHOCACART_FIELD_STORE_INFORMATION_POS_DESC"/>
<field name="store_info_footer_pos"
default="" type="textarea"
label="COM_PHOCACART_FIELD_STORE_FOOTER_INFORMATION_POS_LABEL"
description="COM_PHOCACART_FIELD_STORE_FOOTER_INFORMATION_POS_DESC"/>
<field name="display_tax_recapitulation_pos"
class="btn-group" type="radio" default="0"
label="COM_PHOCACART_FIELD_DISPLAY_TAX_RECAPITULATION_POS_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_TAX_RECAPITULATION_POS_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="display_reward_points_pos"
class="btn-group" type="radio" default="0"
label="COM_PHOCACART_FIELD_DISPLAY_REWARD_POINTS_POS_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_REWARD_POINTS_POS_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="phocahead23"
type="phocahead"
default="COM_PHOCACART_POS_LAYOUT_SETTINGS_LABEL"
label="" description=""/>
<field name="columns_pos" type="list"
default="6"
label="COM_PHOCACART_FIELD_COLUMNS_POS_VIEW_LABEL"
description="COM_PHOCACART_FIELD_COLUMNS_POS_VIEW_DESC">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="6">6</option>
<option value="12">12</option>
</field>
<field name="pos_display_stock_status"
default="0" type="list" class="btn-group
btn-group-yesno"
label="COM_PHOCACART_FIELD_DISPLAY_STOCK_STATUS_POS_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_STOCK_STATUS_POS_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="pos_hide_attributes"
default="1" type="radio" class="btn-group
btn-group-yesno"
label="COM_PHOCACART_FIELD_HIDE_ATTRIBUTES_POS_LABEL"
description="COM_PHOCACART_FIELD_HIDE_ATTRIBUTES_POS_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="pos_pagination"
default="6,12,24,36,48,60" size="18"
type="text"
label="COM_PHOCACART_FIELD_PRODUCT_POS_PAGINATION_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_POS_PAGINATION_DESC"/>
<field name="pos_pagination_default"
default="24" size="18" type="text"
label="COM_PHOCACART_FIELD_DEFAULT_VALUE_PAGINATION_POS_LABEL"
description="COM_PHOCACART_FIELD_DEFAULT_VALUE_PAGINATION_POS_DESC"/>
<field name="pos_ordering" type="list"
default="1"
label="COM_PHOCACART_FIELD_PRODUCT_POS_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_POS_ORDERING_DESC">
<option
value="1">COM_PHOCACART_ORDERING_ASC</option>
<option
value="2">COM_PHOCACART_ORDERING_DESC</option>
<option
value="3">COM_PHOCACART_TITLE_ASC</option>
<option
value="4">COM_PHOCACART_TITLE_DESC</option>
<option
value="5">COM_PHOCACART_PRICE_ASC</option>
<option
value="6">COM_PHOCACART_PRICE_DESC</option>
<option
value="7">COM_PHOCACART_DATE_ASC</option>
<option
value="8">COM_PHOCACART_DATE_DESC</option>
<option
value="9">COM_PHOCACART_RATING_ASC</option>
<option
value="10">COM_PHOCACART_RATING_DESC</option>
</field>
<field type="spacer" name="spacer"
hr="true"/>
<field name="pos_layout_top" default="8"
size="18" type="text"
label="COM_PHOCACART_FIELD_POS_LAYOUT_TOP_LABEL"
description="COM_PHOCACART_FIELD_POS_LAYOUT_TOP_DESC"/>
<field name="pos_layout_bottom"
default="6" size="18" type="text"
label="COM_PHOCACART_FIELD_POS_LAYOUT_BOTTOM_LABEL"
description="COM_PHOCACART_FIELD_POS_LAYOUT_BOTTOM_DESC"/>
<field name="pos_layout_mainfilter"
default="8" size="18" type="text"
label="COM_PHOCACART_FIELD_POS_LAYOUT_MAIN_FILTER_LABEL"
description="COM_PHOCACART_FIELD_POS_LAYOUT_MAIN_FILTER_DESC"/>
<field name="pos_layout_maincategories"
default="6" size="18" type="text"
label="COM_PHOCACART_FIELD_POS_LAYOUT_MAIN_CATEGORIES_LABEL"
description="COM_PHOCACART_FIELD_POS_LAYOUT_MAIN_CATEGORIES_DESC"/>
<field name="pos_layout_maincart"
default="50" size="18" type="text"
label="COM_PHOCACART_FIELD_POS_LAYOUT_MAIN_CART_LABEL"
description="COM_PHOCACART_FIELD_POS_LAYOUT_MAIN_CART_DESC"/>
<field name="pos_layout_media_maxheight"
default="24rem" size="18" type="text"
label="COM_PHOCACART_FIELD_POS_LAYOUT_MEDIA_MAX_HEIGHT_LABEL"
description="COM_PHOCACART_FIELD_POS_LAYOUT_MEDIA_MAX_HEIGHT_DESC"/>
<field name="pos_layout_top_maxheight"
default="16" size="18" type="text"
label="COM_PHOCACART_FIELD_POS_LAYOUT_TOP_MAX_HEIGHT_LABEL"
description="COM_PHOCACART_FIELD_POS_LAYOUT_TOP_MAX_HEIGHT_DESC"/>
<field name="pos_layout_bottom_maxheight"
default="1" size="18" type="text"
label="COM_PHOCACART_FIELD_POS_LAYOUT_BOTTOM_MAX_HEIGHT_LABEL"
description="COM_PHOCACART_FIELD_POS_LAYOUT_BOTTOM_MAX_HEIGHT_DESC"/>
<field name="pos_layout_mainfilter_maxheight"
default="16" size="18" type="text"
label="COM_PHOCACART_FIELD_POS_LAYOUT_MAIN_FILTER_MAX_HEIGHT_LABEL"
description="COM_PHOCACART_FIELD_POS_LAYOUT_MAIN_FILTER_MAX_HEIGHT_DESC"/>
<field name="pos_layout_maincategories_maxheight"
default="13" size="18" type="text"
label="COM_PHOCACART_FIELD_POS_LAYOUT_MAIN_CATEGORIES_MAX_HEIGHT_LABEL"
description="COM_PHOCACART_FIELD_POS_LAYOUT_MAIN_CATEGORIES_MAX_HEIGHT_DESC"/>
<field name="pos_layout_maincart_maxheight"
default="70" size="18" type="text"
label="COM_PHOCACART_FIELD_POS_LAYOUT_MAIN_CART_MAX_HEIGHT_LABEL"
description="COM_PHOCACART_FIELD_POS_LAYOUT_MAIN_CART_MAX_HEIGHT_DESC"/>
<field name="phocahead24"
type="phocaheadexpert"
default="COM_PHOCACART_POS_PRINT_SETTINGS_LABEL"
label="" description=""/>
<field name="pos_server_print"
class="btn-group" type="list" default="0"
label="COM_PHOCACART_FIELD_POS_SERVER_PRINT_FIELDS_LABEL"
description="COM_PHOCACART_FIELD_POS_SERVER_PRINT_FIELDS_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES_PURCHASE_EVENT</option>
<option
value="2">COM_PHOCACART_YES_CLICK_EVENT</option>
<option
value="3">COM_PHOCACART_YES_PURCHASE_AND_CLICK_EVENT</option>
</field>
<field name="pos_print_connector"
class="btn-group" type="list" default="1"
label="COM_PHOCACART_FIELD_POS_PRINT_CONNECTOR_LABEL"
description="COM_PHOCACART_FIELD_POS_PRINT_CONNECTOR_DESC">
<option
value="1">FilePrintConnector</option>
<option
value="2">NetworkPrintConnector</option>
<option
value="3">WindowsPrintConnector</option>
<option
value="4">CupsPrintConnector</option>
</field>
<field name="pos_print_connector_file"
default="" size="40" type="text"
label="COM_PHOCACART_FIELD_POS_PRINT_CONNECTOR_FILE_LABEL"
description="COM_PHOCACART_FIELD_POS_PRINT_CONNECTOR_FILE_DESC"/>
<field name="pos_print_connector_dest"
default="" size="40" type="text"
label="COM_PHOCACART_FIELD_POS_PRINT_CONNECTOR_DESTINATION_LABEL"
description="COM_PHOCACART_FIELD_POS_PRINT_CONNECTOR_DESTINATION_DESC"/>
<field name="pos_print_connector_ip"
default="" size="40" type="text"
label="COM_PHOCACART_FIELD_POS_PRINT_CONNECTOR_IP_LABEL"
description="COM_PHOCACART_FIELD_POS_PRINT_CONNECTOR_IP_DESC"/>
<field name="pos_print_connector_port"
default="" size="40" type="text"
label="COM_PHOCACART_FIELD_POS_PRINT_CONNECTOR_PORT_LABEL"
description="COM_PHOCACART_FIELD_POS_PRINT_CONNECTOR_PORT_DESC"/>
<field name="pos_print_connector_timeout"
class="btn-group" type="list" default="0"
label="COM_PHOCACART_FIELD_POS_PRINT_CONNECTOR_TIMEOUT_LABEL"
description="COM_PHOCACART_FIELD_POS_PRINT_CONNECTOR_TIMEOUT_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="pos_print_line_length"
default="42" size="40" type="text"
label="COM_PHOCACART_FIELD_POS_PRINT_LINE_LENGTH_LABEL"
description="COM_PHOCACART_FIELD_POS_PRINT_LINE_LENGTH_DESC"/>
<field name="pos_print_line_length_double"
default="21" size="40" type="text"
label="COM_PHOCACART_FIELD_POS_PRINT_LINE_LENGTH_DOUBLE_SIZE_LABEL"
description="COM_PHOCACART_FIELD_POS_PRINT_LINE_LENGTH_DOUBLE_SIZE_DESC"/>
<field name="pos_print_line_sep"
default="-" size="1" type="text"
label="COM_PHOCACART_FIELD_POS_PRINT_LINE_SEPARATOR_LABEL"
description="COM_PHOCACART_FIELD_POS_PRINT_LINE_SEPARATOR_DESC"/>
<!--<field name="pos_print_line_end"
default="\n" size="40" type="text"
label="COM_PHOCACART_FIELD_POS_PRINT_LINE_END_LABEL"
description="COM_PHOCACART_FIELD_POS_PRINT_LINE_END_DESC"/>-->
</fieldset>
<fieldset name="form"
label="COM_PHOCACART_CONFIG_HEAD_FORM_LABEL">
<field name="phocahead16" type="phocahead"
default="COM_PHOCACART_ASK_QUESTION_FEEDBACK_REPORT_OPTIONS_LABEL"
label="" description=""/>
<field name="enable_ask_question"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_ENABLE_ASK_QUESTION_LABEL"
description="COM_PHOCACART_FIELD_ENABLE_ASK_QUESTION_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="question_description"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_ASK_QUESTION_DESCRIPTION_LABEL"
description="COM_PHOCACART_FIELD_ASK_QUESTION_DESCRIPTION_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="display_name_form"
type="radio" class="btn-group btn-group-yesno"
default="2"
label="COM_PHOCACART_FIELD_DISPLAY_NAME_FORM_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_NAME_FORM_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="2">COM_PHOCACART_YES_REQUIRED</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="display_email_form"
type="radio" class="btn-group btn-group-yesno"
default="2"
label="COM_PHOCACART_FIELD_DISPLAY_EMAIL_FORM_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_EMAIL_FORM_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="2">COM_PHOCACART_YES_REQUIRED</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="display_phone_form"
type="radio" class="btn-group btn-group-yesno"
default="2"
label="COM_PHOCACART_FIELD_DISPLAY_PHONE_FORM_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_PHONE_FORM_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="2">COM_PHOCACART_YES_REQUIRED</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="display_message_form"
type="radio" class="btn-group btn-group-yesno"
default="2"
label="COM_PHOCACART_FIELD_DISPLAY_MESSAGE_FORM_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_MESSAGE_FORM_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="2">COM_PHOCACART_YES_REQUIRED</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="enable_captcha_question"
type="radio" class="btn-group btn-group-yesno"
default="2"
label="COM_PHOCACART_FIELD_ENABLE_CAPTCHA_FORM_LABEL"
description="COM_PHOCACART_FIELD_ENABLE_CAPTCHA_FORM_DESC">
<option
value="2">COM_PHOCACART_YES_REQUIRED</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="enable_hidden_field_question"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_ENABLE_HIDDEN_FIELD_QUESTION_LABEL"
description="COM_PHOCACART_FIELD_ENABLE_HIDDEN_FIELD_QUESTION_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="enable_time_check_question"
type="text" default="0"
label="COM_PHOCACART_FIELD_ENABLE_TIME_CHECK_QUESTION_LABEL"
description="COM_PHOCACART_FIELD_ENABLE_TIME_CHECK_QUESTION_DESC">
</field>
<field name="ip_ban" type="textarea"
rows="2" cols="40" default=""
label="COM_PHOCACART_FIELD_IP_BAN_LABEL"
description="COM_PHOCACART_FIELD_IP_BAN_DESC"/>
<field name="forbidden_word_filter"
type="textarea" rows="3" cols="40"
default=""
label="COM_PHOCACART_FIELD_FORBIDDEN_WORD_FILTER_QUESTION_LABEL"
description="COM_PHOCACART_FIELD_FORBIDDEN_WORD_FILTER_QUESTION_DESC"/>
<field name="forbidden_whole_word_filter"
type="textarea" rows="3" cols="40"
default=""
label="COM_PHOCACART_FIELD_FORBIDDEN_WHOLE_WORD_FILTER_QUESTION_LABEL"
description="COM_PHOCACART_FIELD_FORBIDDEN_WHOLE_WORD_FILTER_QUESTION_DESC"/>
<field name="max_char_question"
default="3000" type="text"
label="COM_PHOCACART_FIELD_MAXIMUM_CHARACTERS_MESSAGE_LABEL"
description="COM_PHOCACART_FIELD_MAXIMUM_CHARACTERS_MESSAGE_DESC"/>
<field name="max_char_question_email"
default="1000" type="text"
label="COM_PHOCACART_FIELD_MAXIMUM_CHARACTERS_MESSAGE_EMAIL_LABEL"
description="COM_PHOCACART_FIELD_MAXIMUM_CHARACTERS_MESSAGE_EMAIL_DESC"/>
<field name="send_email_question"
type="user" section="com_phocacart"
default=""
label="COM_PHOCACART_FIELD_SEND_EMAIL_QUESTION_LABEL"
description="COM_PHOCACART_FIELD_SEND_EMAIL_QUESTION_DESC"/>
<field name="send_email_question_others"
type="textarea" class="inputbox"
label="COM_PHOCACART_FIELD_SEND_EMAIL_QUESTION_OTHERS_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_SEND_EMAIL_QUESTION_OTHERS_DESC"
/>
<field name="display_question_privacy_checkbox"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_ASK_QUESTION_PRIVACY_CHECKBOX_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_ASK_QUESTION_PRIVACY_CHECKBOX_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="2">COM_PHOCACART_YES_REQUIRED</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="question_privacy_checkbox_label_text"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_ASK_QUESTION_PRIVACY_CHECKBOX_LABEL"
description="COM_PHOCACART_FIELD_ASK_QUESTION_PRIVACY_CHECKBOX_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="phocahead37" type="phocahead"
default="COM_PHOCACART_SUBMIT_ITEM_OPTIONS_LABEL"
label="" description=""/>
<field name="enable_submit_item" type="radio"
class="btn-group btn-group-yesno" default="0"
label="COM_PHOCACART_FIELD_ENABLE_SUBMIT_ITEM_LABEL"
description="COM_PHOCACART_FIELD_ENABLE_SUBMIT_ITEM_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="submit_item_registered_only"
type="radio" class="btn-group btn-group-yesno"
default="1"
label="COM_PHOCACART_FIELD_SUBMIT_ITEM_REGISTERED_ONLY_LABEL"
description="COM_PHOCACART_FIELD_SUBMIT_ITEM_REGISTERED_ONLY_DESC">
<option
value="1">COM_PHOCACART_REGISTERED_USERS</option>
<option
value="0">COM_PHOCACART_ALL_USERS</option>
</field>
<field name="submit_item_description"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_SUBMIT_ITEM_DESCRIPTION_LABEL"
description="COM_PHOCACART_FIELD_SUBMIT_ITEM_DESCRIPTION_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="enable_captcha_submit_item"
type="radio" class="btn-group btn-group-yesno"
default="2"
label="COM_PHOCACART_FIELD_ENABLE_CAPTCHA_FORM_SUBMIT_ITEM_LABEL"
description="COM_PHOCACART_FIELD_ENABLE_CAPTCHA_FORM_SUBMIT_ITEM_DESC">
<option
value="2">COM_PHOCACART_YES_REQUIRED</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="enable_hidden_field_submit_item"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_ENABLE_HIDDEN_FIELD_SUBMIT_ITEM_LABEL"
description="COM_PHOCACART_FIELD_ENABLE_HIDDEN_FIELD_SUBMIT_ITEM_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="enable_time_check_submit_item"
type="text" default="0"
label="COM_PHOCACART_FIELD_ENABLE_TIME_CHECK_SUBMIT_ITEM_LABEL"
description="COM_PHOCACART_FIELD_ENABLE_TIME_CHECK_SUBMIT_ITEM_DESC">
</field>
<field name="submit_item_form_fields"
type="textarea" rows="2" cols="40"
default=""
label="COM_PHOCACART_FIELD_SUBMIT_ITEMS_FORM_FIELDS_LABEL"
description="COM_PHOCACART_FIELD_SUBMIT_ITEMS_FORM_FIELDS_DESC"/>
<field name="submit_item_form_fields_parameters"
type="textarea" rows="2" cols="40"
default=""
label="COM_PHOCACART_FIELD_SUBMIT_ITEMS_FORM_FIELDS_PARAMETERS_INFO_LABEL"
description="COM_PHOCACART_FIELD_SUBMIT_ITEMS_FORM_FIELDS_PARAMETERS_INFO_DESC"/>
<field name="submit_item_form_fields_contact"
type="textarea" rows="2" cols="40"
default=""
label="COM_PHOCACART_FIELD_SUBMIT_ITEMS_FORM_FIELDS_CONTACT_INFO_LABEL"
description="COM_PHOCACART_FIELD_SUBMIT_ITEMS_FORM_FIELDS_CONTACT_INFO_DESC"/>
<field name="display_submit_item_privacy_checkbox"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_SUBMIT_ITEM_PRIVACY_CHECKBOX_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_SUBMIT_ITEM_PRIVACY_CHECKBOX_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="2">COM_PHOCACART_YES_REQUIRED</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field
name="submit_item_privacy_checkbox_label_text"
type="modal_article" select="true" new="true"
edit="true" clear="true" class="inputbox"
label="COM_PHOCACART_FIELD_SUBMIT_ITEM_PRIVACY_CHECKBOX_LABEL"
description="COM_PHOCACART_FIELD_SUBMIT_ITEM_PRIVACY_CHECKBOX_DESC"
addfieldpath="/administrator/components/com_content/models/fields"/>
<field name="submit_item_max_char_textarea"
default="1000" type="text"
label="COM_PHOCACART_FIELD_MAXIMUM_CHARACTERS_SUBMIT_ITEM_TEXTAREA_FIELDS_LABEL"
description="COM_PHOCACART_FIELD_MAXIMUM_CHARACTERS_SUBMIT_ITEM_TEXTAREA_FIELDS_DESC"/>
<field name="send_email_submit_item" type="user"
section="com_phocacart" default=""
label="COM_PHOCACART_FIELD_SEND_EMAIL_SUBMIT_ITEM_LABEL"
description="COM_PHOCACART_FIELD_SEND_EMAIL_SUBMIT_ITEM_DESC"/>
<field name="send_email_submit_item_others"
type="textarea" class="inputbox"
label="COM_PHOCACART_FIELD_SEND_EMAIL_SUBMIT_ITEM_OTHERS_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_SEND_EMAIL_SUBMIT_ITEM_OTHERS_DESC"
/>
<field name="submit_item_upload_image_maxsize"
type="text" size="20" default="512000"
label="COM_PHOCACART_FIELD_MAXIMUM_SIZE_UPLOAD_IMAGE_SUBMIT_ITEM_LABEL"
description="COM_PHOCACART_FIELD_MAXIMUM_SIZE_UPLOAD_IMAGE_SUBMIT_ITEM_DESC"/>
<field name="submit_item_upload_image_count"
type="text" size="20" default="1"
label="COM_PHOCACART_FIELD_MAXIMUM_COUNT_UPLOAD_IMAGE_SUBMIT_ITEM_LABEL"
description="COM_PHOCACART_FIELD_MAXIMUM_COUNT_UPLOAD_IMAGE_SUBMIT_ITEM_DESC"/>
<field name="submit_item_move_image_folder"
type="list" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_FOLDER_SUBMIT_ITEM_MOVE_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_FOLDER_SUBMIT_ITEM_MOVE_IMAGE_DESC">
<option
value="0">COM_PHOCACART_NO_FOLDER_ROOT_PHOCACART_PRODUCT_IMAGES</option>
<option
value="1">COM_PHOCACART_SPECIFIC_FOLDER</option>
<option
value="2">COM_PHOCACART_FOLDER_CREATED_FROM_FIRST_LETTER_OF_IMAGE</option>
<option
value="3">COM_PHOCACART_FOLDER_CREATED_FROM_FIRST_LETTER_OF_TITLE</option>
</field>
<field name="submit_item_move_image_folder_specific"
default="" size="4" type="text"
label="COM_PHOCACART_FIELD_SUBMIT_ITEM_MOVE_IMAGE_SPECIFIC_FOLDER_LABEL"
description="COM_PHOCACART_FIELD_SUBMIT_ITEM_MOVE_IMAGE_SPECIFIC_FOLDER_DESC"/>
<field name="submit_item_remove_item_create_product"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_DELETING_SUBMITTED_ITEM_WHEN_CREATING_PRODUCT_LABEL"
description="COM_PHOCACART_FIELD_DELETING_SUBMITTED_ITEM_WHEN_CREATING_PRODUCT_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
</field>
<field name="submit_item_convert_markdown_create_product"
type="radio" class="btn-group btn-group-yesno"
default="0"
label="COM_PHOCACART_FIELD_SUBMITTED_ITEM_COVERT_MARKDOWN_WHEN_CREATING_PRODUCT_LABEL"
description="COM_PHOCACART_FIELD_SUBMITTED_ITEM_COVERT_MARKDOWN_WHEN_CREATING_PRODUCT_DESC">
<option
value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
</field>
<field name="phocahead17"
type="phocahead"
default="COM_PHOCACART_SECURITY_OPTIONS_LABEL" label=""
description=""/>
<field name="session_suffix" default=""
type="text"
label="COM_PHOCACART_FIELD_SESSION_SUFFIX_LABEL"
description="COM_PHOCACART_FIELD_SESSION_SUFFIX_DESC"/>
<field name="recaptcha_sitekey"
type="text" default=""
label="COM_PHOCACART_FIELD_RECAPTCHA_SITEKEY_LABEL"
description="COM_PHOCACART_FIELD_RECAPTCHA_SITEKEY_DESC"/>
<field name="recaptcha_privatekey"
type="text" default=""
label="COM_PHOCACART_FIELD_RECAPTCHA_PRIVATEKEY_LABEL"
description="COM_PHOCACART_FIELD_RECAPTCHA_PRIVATEKEY_DESC"/>
<field name="recaptcha_lang" type="text"
default=""
label="COM_PHOCACART_FIELD_RECAPTCHA_LANGUAGE_LABEL"
description="COM_PHOCACART_FIELD_RECAPTCHA_LANGUAGE_DESC"/>
<field name="recaptcha_request_method"
type="list" class="btn-group btn-group-yesno"
default="2"
label="COM_PHOCACART_FIELD_RECAPTCHA_REQUEST_METHOD_LABEL"
description="COM_PHOCACART_FIELD_RECAPTCHA_REQUEST_METHOD_DESC">
<option
value="1">file_get_contents</option>
<option value="2">cUrl</option>
</field>
<field name="allowed_file_types_upload_frontend"
type="textarea" size="20"
default="{gif=image/gif}{jpeg=image/jpeg}{jpg=image/jpeg}{png=image/png}{webp=image/webp}"
label="COM_PHOCACART_FIELD_ALLOWED_FILE_TYPES_FRONTEND_UPLOAD_LABEL"
description="COM_PHOCACART_FIELD_ALLOWED_FILE_TYPES_FRONTEND_UPLOAD_DESC"/>
<field name="allowed_file_types_upload_backend"
type="textarea" size="20"
default="{gif=image/gif}{jpeg=image/jpeg}{jpg=image/jpeg}{png=image/png}{webp=image/webp}{tar=application/x-tar}{tgz=application/x-tar}{zip=application/x-zip}{rar=application/x-rar-compressed}{tar=application/tar}{tgz=application/tar}{zip=application/zip}{rar=application/rar-compressed}{pdf=application/pdf}{txt=text/plain}{xml=text/xml}{doc=application/msword}{xls=application/vnd.ms-excel}{ppt=application/powerpoint}{odt=application/vnd.oasis.opendocument.text}{ods=application/vnd.oasis.opendocument.spreadsheet}{odp=application/vnd.oasis.opendocument.presentation}{docx=application/vnd.openxmlformats-officedocument.wordprocessingml.document}{xlsx=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet}{pptx=application/vnd.openxmlformats-officedocument.presentationml.presentation}{mp3=audio/mpeg}{mp4=video/mp4}"
label="COM_PHOCACART_FIELD_ALLOWED_FILE_TYPES_BACKEND_UPLOAD_LABEL"
description="COM_PHOCACART_FIELD_ALLOWED_FILE_TYPES_BACKEND_UPLOAD_DESC"/>
<field name="upload_maxsize" type="text"
size="20" default="3145728"
label="COM_PHOCACART_FIELD_MAXIMUM_SIZE_UPLOAD_FILE_LABEL"
description="COM_PHOCACART_FIELD_MAXIMUM_SIZE_UPLOAD_FILE_DESC"/>
<field name="upload_maxsize_frontend" type="text"
size="20" default="3145728"
label="COM_PHOCACART_FIELD_MAXIMUM_SIZE_UPLOAD_FILE_LABEL"
description="COM_PHOCACART_FIELD_MAXIMUM_SIZE_UPLOAD_FILE_DESC"/>
<field name="ignore_file_types_check" default="0"
type="list"
label="COM_PHOCACART_IGNORE_FILE_TYPES_CHECK_LABEL"
description="COM_PHOCACART_IGNORE_FILE_TYPES_CHECK_DESC" >
<!--<option
value="1">COM_PHOCACART_YES_UPLOAD_PARAM</option>
<option
value="2">COM_PHOCACART_YES_UPLOAD_PARAM_ADMIN</option>
<option
value="3">COM_PHOCACART_YES_DOWNLOAD_PARAM</option>
<option
value="4">COM_PHOCACART_YES_DOWNLOAD_UPLOAD_PARAM</option>-->
<option value="1">COM_PHOCACART_YES</option>
<option
value="4">COM_PHOCACART_YES_ONLY_FRONTEND</option>
<option
value="5">COM_PHOCACART_YES_ONLY_BACKEND</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="phocahead38" type="phocahead"
default="COM_PHOCACART_NEWSLETTER_OPTIONS_PHOCA_EMAIL_LABEL"
label="" description=""/>
<field name="newsletter_enable" type="radio"
class="btn-group btn-group-yesno" default="0"
label="COM_PHOCACART_FIELD_ENABLE_NEWSLETTER_LABEL"
description="COM_PHOCACART_FIELD_ENABLE_NEWSLETTER_DESC">
<option value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
</field>
<field name="newsletter_activate" type="list"
class="btn-group btn-group-yesno" default="0"
label="COM_PHOCACART_FIELD_ACTIVATE_NEWSLETTER_LABEL"
description="COM_PHOCACART_FIELD_ACTIVATE_NEWSLETTER_DESC">
<option value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
<option
value="2">COM_PHOCACART_NO_ACTIVATION_EMAIL_SEND</option>
</field>
<field name="newsletter_mailinglist"
type="PhocaCartMailingList" size=""
default="" manager="subscriber"
multiple="true"
label="COM_PHOCACART_FIELD_NEWSLETTER_MAILING_LIST_LABEL"
description="COM_PHOCACART_FIELD_NEWSLETTER_MAILING_LIST_DESC"/>
</fieldset>
<fieldset name="permissions_label"
description="JCONFIG_PERMISSIONS_DESC"
label="JCONFIG_PERMISSIONS_LABEL">
<field name="rules" type="rules"
component="com_phocacart" filter="rules"
label="COM_PHOCACART_FIELD_JCONFIG_PERMISSIONS_LABEL"
section="component" description=""/>
</fieldset>
</fields>
</config>
PK�"�[@�� ��controller.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.application.component.controller');
$app = JFactory::getApplication();
$option = $app->input->get('option');
$l['cp'] = array('COM_PHOCACART_CONTROL_PANEL',
'');
$l['ps'] = array('COM_PHOCACART_PRODUCTS',
'phocacartitems');
$l['cs'] = array('COM_PHOCACART_CATEGORIES',
'phocacartcategories');
$l['sp'] = array('COM_PHOCACART_SPECIFICATIONS',
'phocacartspecifications');
$l['mn'] = array('COM_PHOCACART_MANUFACTURERS',
'phocacartmanufacturers');
$l['os'] = array('COM_PHOCACART_ORDERS',
'phocacartorders');
$l['st'] = array('COM_PHOCACART_ORDER_STATUSES',
'phocacartstatuses');
$l['sk'] = array('COM_PHOCACART_STOCK_STATUSES',
'phocacartstockstatuses');
$l['sh'] = array('COM_PHOCACART_SHIPPING',
'phocacartshippings');
$l['ct'] = array('COM_PHOCACART_COUNTRIES',
'phocacartcountries');
$l['re'] = array('COM_PHOCACART_REGIONS',
'phocacartregions');
$l['zo'] = array('COM_PHOCACART_ZONES',
'phocacartzones');
$l['pa'] = array('COM_PHOCACART_PAYMENT',
'phocacartpayments');
$l['cu'] = array('COM_PHOCACART_CURRENCIES',
'phocacartcurrencies');
$l['tx'] = array('COM_PHOCACART_TAXES',
'phocacarttaxes');
$l['us'] = array('COM_PHOCACART_CUSTOMERS',
'phocacartusers');
$l['gr'] = array('COM_PHOCACART_CUSTOMER_GROUPS',
'phocacartgroups');
$l['rp'] = array('COM_PHOCACART_REWARD_POINTS',
'phocacartrewards');
$l['ff'] = array('COM_PHOCACART_FORM_FIELDS',
'phocacartformfields');
$l['rw'] = array('COM_PHOCACART_REVIEWS',
'phocacartreviews');
//$l['vo'] = array('COM_PHOCACART_VOUCHERS',
'phocacartvouchers');
$l['co'] = array('COM_PHOCACART_COUPONS',
'phocacartcoupons');
$l['di'] = array('COM_PHOCACART_DISCOUNTS',
'phocacartdiscounts');
$l['do'] = array('COM_PHOCACART_DOWNLOADS',
'phocacartdownloads');
$l['tg'] = array('COM_PHOCACART_TAGS',
'phocacarttags');
$l['pr'] = array('COM_PHOCACART_PARAMETERS',
'phocacartparameters');
$l['pv'] = array('COM_PHOCACART_PARAMETER_VALUES',
'phocacartparametervalues');
$l['fd'] = array('COM_PHOCACART_XML_FEEDS',
'phocacartfeeds');
$l['wl'] = array('COM_PHOCACART_WISH_LISTS',
'phocacartwishlists');
$l['qu'] = array('COM_PHOCACART_QUESTIONS',
'phocacartquestions');
$l['ot'] = array('COM_PHOCACART_OPENING_TIMES',
'phocacarttimes');
$l['si'] = array('COM_PHOCACART_SUBMITTED_ITEMS',
'phocacartsubmititems');
$l['sc'] = array('COM_PHOCACART_STATISTICS',
'phocacartstatistics');
$l['rt'] = array('COM_PHOCACART_REPORTS',
'phocacartreports');
$l['hi'] = array('COM_PHOCACART_HITS',
'phocacarthits');
$l['im'] = array('COM_PHOCACART_IMPORT',
'phocacartimports');
$l['ex'] = array('COM_PHOCACART_EXPORT',
'phocacartexports');
$l['lo'] = array('COM_PHOCACART_SYSTEM_LOG',
'phocacartlogs');
$l['in'] = array('COM_PHOCACART_INFO',
'phocacartinfo');
$l['et'] = array('COM_PHOCACART_EXTENSIONS',
'phocacartextensions');
$l['ve'] = array('COM_PHOCACART_VENDORS',
'phocacartvendors');
$l['se'] = array('COM_PHOCACART_SECTIONS',
'phocacartsections');
$l['un'] = array('COM_PHOCACART_UNITS',
'phocacartunits');
$l['bp'] = array('COM_PHOCACART_BULK_PRICE_EDITOR',
'phocacartbulkprices');
// Submenu view
$view = JFactory::getApplication()->input->get('view');
$layout = JFactory::getApplication()->input->get('layout');
if ($layout == 'edit') {
} else {
foreach ($l as $k => $v) {
if ($v[1] == '') {
$link = 'index.php?option='.$option;
} else {
$link = 'index.php?option='.$option.'&view=';
}
if ($view == $v[1]) {
JHtmlSidebar::addEntry(JText::_($v[0]), $link.$v[1], true );
} else {
JHtmlSidebar::addEntry(JText::_($v[0]), $link.$v[1]);
}
}
}
class phocaCartCpController extends JControllerLegacy
{
function display($cachable = false, $urlparams = array()) {
parent::display($cachable, $urlparams);
}
}
?>
PK�"�[��%�
controllers/ajax.json.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\LanguageHelper;
/**
* The contact controller for ajax requests
*
* @since 3.9.0
*/
class PhocaCartCpControllerAjax extends JControllerLegacy
{
/**
* Method to fetch associations of a contact
*
* The method assumes that the following http parameters are passed in an
Ajax Get request:
* token: the form token
* assocId: the id of the contact whose associations are to be returned
* excludeLang: the association for this language is to be excluded
*
* @return null
*
* @since 3.9.0
*/
public function fetchAssociations()
{
if (!JSession::checkToken('get'))
{
echo new JResponseJson(null, JText::_('JINVALID_TOKEN'),
true);
}
else
{
$input = JFactory::getApplication()->input;
$assocId = $input->getInt('assocId', 0);
$view = $input->get('view', '');
if ($assocId == 0)
{
echo new JResponseJson(null,
JText::sprintf('JLIB_FORM_VALIDATE_FIELD_INVALID',
'assocId'), true);
return;
}
$excludeLang = $input->get('excludeLang', '',
'STRING');
if ($view == 'phocacartcategory') {
$associations =
JLanguageAssociations::getAssociations('com_phocacart',
'#__phocacart_products', 'com_phocacart.item',
(int)$assocId, 'id', 'alias', false);
} else if ($view == 'phocacartitem') {
$associations =
JLanguageAssociations::getAssociations('com_phocacart',
'#__phocacart_products', 'com_phocacart.item',
(int)$assocId, 'id', 'alias', false);
} else {
echo new JResponseJson(null,
JText::_('COM_PHOCACART_ERROR_NO_VIEW_SET'), true);
return;
}
unset($associations[$excludeLang]);
// Add the title to each of the associated records
JTable::addIncludePath(JPATH_ADMINISTRATOR .
'/components/com_phocacart/tables');
$table = JTable::getInstance('PhocaCartItem',
'Table');
if ($view == 'phocacartcategory') {
$table = JTable::getInstance('PhocaCartItem',
'Table');
} else if ($view == 'phocacartitem') {
$table = JTable::getInstance('PhocaCartCategory',
'Table');
} else {
echo new JResponseJson(null,
JText::_('COM_PHOCACART_ERROR_NO_VIEW_SET'), true);
return;
}
foreach ($associations as $lang => $association)
{
$table->load($association->id);
$associations[$lang]->title = $table->title;
}
$countContentLanguages =
count(LanguageHelper::getContentLanguages(array(0, 1)));
if (count($associations) == 0)
{
$message =
JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_NONE');
}
elseif ($countContentLanguages > count($associations) + 2)
{
$tags = implode(', ', array_keys($associations));
$message =
JText::sprintf('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_SOME',
$tags);
}
else
{
$message =
JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_ALL');
}
echo new JResponseJson($associations, $message);
}
}
}
PK�"�[�#o,,controllers/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�S�=�*�*'controllers/phocacartbulkprice.json.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocaCartBulkprice extends
PhocaCartCpControllerPhocaCartCommon {
public function run() {
if (!JSession::checkToken('request')) {
$response = array('status' => '0',
'output' => '<div class="alert
alert-error">' . JText::_('JINVALID_TOKEN') .
'</div>');
echo json_encode($response);
return;
}
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$paramsC = PhocacartUtils::getComponentParameters();
$price = new PhocacartPrice();
$continue = 0;
$pagination = 5;
$page = $app->input->get('p', 0, 'int');
$id = $app->input->get('id', 0, 'int');
// BULK PRICE
$item = PhocacartPriceBulkprice::getItem($id);
$item_save_price_history_run =
$item->params->get('save_price_history_run', 1);
if (isset($item->status) && $item->status == 1) {
$response = array('status' => '1',
'output' => '<div class="alert
alert-error">' .
JText::_('COM_PHOCACART_THIS_BULK_PRICE_JOB_HAS_ALREADY_BEEN_RUN_AND_IS_ACTIVE')
. '</div>');
echo json_encode($response);
return;
}
$limitOffset = ((int)$page * (int)$pagination) - (int)$pagination;
if ($limitOffset < 0) {
$limitOffset = 0;
}
$limitCount = $pagination;
$wheres = array();
$lefts = array();
if (!empty($item->categories)) {
$wheres[] = ' c.id IN
('.$item->categories_string.')';
$lefts[] = ' #__phocacart_product_categories AS pc ON pc.product_id
= p.id';
$lefts[] = ' #__phocacart_categories AS c ON c.id =
pc.category_id';
}
$q = 'SELECT p.id, p.title, p.price, p.price_original';
$q .= ' FROM #__phocacart_products AS p';
if (!empty($lefts)) {
$q .= ' LEFT JOIN ' . implode(' LEFT JOIN ',
$lefts);
}
if (!empty($wheres)) {
$q .= ' WHERE ' . implode(' AND ',
$wheres);
}
$q .= ' ORDER BY p.id';
if ((int)$limitCount > 0) {
$q .= ' LIMIT ' . (int)$limitOffset . ', '
. (int)$limitCount;
}
$db->setQuery($q);
$products = $db->loadAssocList();
$o = array();
if (!empty($products)) {
$count = count($products);
if ($count == $pagination) {
// Pagination full, continue with adding next round of
products
$continue = 1;
}
foreach ($products as $k => $v) {
$o[] = '<div class="ph-bulk-price-item alert
alert-info">';
if (isset($v['title'])) {
$o[] = '<div
class="ph-bulk-price-title">'.$v['title'].'</div>';
}
if (isset($v['price']) ) {
$newPrice =
PhocacartPriceBulkprice::setNewPrice($v['id'],
$v['price'], $item->params);
$o[] = '<div
class="ph-bulk-price-price">' .
JText::_('COM_PHOCACART_PRICE') . ': <b>'.
$price->getPriceFormat($v['price']) . '</b>
<span class="ph-bulk-price-arrow">→</span>
<b>' .$price->getPriceFormat($newPrice).
'</b></div>';
}
if (isset($v['price_original']) ) {
$newPriceOriginal =
PhocacartPriceBulkprice::setNewOriginalPrice($v['id'],
$v['price_original'], $v['price'], $item->params);
$o[] = '<div
class="ph-bulk-price-original-price">' .
JText::_('COM_PHOCACART_ORIGINAL_PRICE') . ':
<b>'. $price->getPriceFormat($v['price_original'])
. '</b> <span
class="ph-bulk-price-arrow">→</span>
<b>' .$price->getPriceFormat($newPriceOriginal).
'</b></div>';
}
if (isset($v['price']) &&
isset($v['price_original'])) {
// Price history
// 0 ... display in price history (standard change of price)
// 1 ... display in price history (bulk price change)
// 2 ... don't display in price history (only bulk price info for
possible revert) ... specific type of price history
//
// BE AWARE
// Standard price history (0,1) is applied only once a day
// Bulk price history (2) can have more items per day
// Price history table is used for storing standard price and bulk
price
// So when storing bulk price, there can be two records: one for bulk
price (2), second for standard price (1)
// Both are independent (2) is used because of revert, (1) one is used
because of price history, updated only once a day
// Bulk price history
$type = 2;
PhocacartPriceHistory::storePriceHistoryBulkPriceById($v['id'],
$newPrice, $newPriceOriginal, $id, $v['price'],
$v['price_original'], $type);
// Standard price history
if ($item_save_price_history_run == 1) {
$type = 1;
PhocacartPriceHistory::storePriceHistoryById((int)$v['id'],
$newPrice, $type);
}
// Update group price
PhocacartGroup::updateGroupProductPriceById((int)$v['id'],
$newPrice);
}
$o[] = '</div>';
}
}
$output = implode('', $o);
$oFinished = array();
if ($continue == 0) {
// Job finished
$oFinished[] = '<div class="ph-bulk-price-item alert
alert-success">';
$oFinished[] =
JText::_('COM_PHOCACART_BULK_PRICE_CHANGE_FINISHED');
$oFinished[] = '</div>';
$output = implode('', $oFinished) . $output;
PhocacartPriceBulkprice::setStatus($id, 1);
}
$response = array('status' => '1',
'output' => $output, 'continue' => $continue);
echo json_encode($response);
return;
}
public function revert() {
if (!JSession::checkToken('request')) {
$response = array('status' => '0',
'output' => '<div class="alert
alert-error">' . JText::_('JINVALID_TOKEN') .
'</div>');
echo json_encode($response);
return;
}
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$paramsC = PhocacartUtils::getComponentParameters();
$price = new PhocacartPrice();
$continue = 0;
$pagination = 5;
$page = $app->input->get('p', 0, 'int');
$id = $app->input->get('id', 0, 'int');
// BULK PRICE
$item = PhocacartPriceBulkprice::getItem($id);
$item_save_price_history_revert =
$item->params->get('save_price_history_revert', 1);
if (isset($item->status) && $item->status == 0) {
$response = array('status' => '1',
'output' => '<div class="alert
alert-error">' .
JText::_('COM_PHOCACART_THIS_BULK_PRICE_JOB_HAS_NOT_BEEN_RUN_AND_IS_NOT_ACTIVE')
. '</div>');
echo json_encode($response);
return;
}
$limitOffset = ((int)$page * (int)$pagination) - (int)$pagination;
if ($limitOffset < 0) {
$limitOffset = 0;
}
$limitCount = $pagination;
$wheres = array();
$lefts = array();
if (!empty($item->categories)) {
$wheres[] = ' c.id IN
('.$item->categories_string.')';
$lefts[] = ' #__phocacart_product_categories AS pc ON pc.product_id
= p.id';
$lefts[] = ' #__phocacart_categories AS c ON c.id =
pc.category_id';
}
$q = 'SELECT p.id, p.title, p.price, p.price_original';
$q .= ' FROM #__phocacart_products AS p';
if (!empty($lefts)) {
$q .= ' LEFT JOIN ' . implode(' LEFT JOIN ',
$lefts);
}
if (!empty($wheres)) {
$q .= ' WHERE ' . implode(' AND ',
$wheres);
}
$q .= ' ORDER BY p.id';
if ((int)$limitCount > 0) {
$q .= ' LIMIT ' . (int)$limitOffset . ', '
. (int)$limitCount;
}
$db->setQuery($q);
$products = $db->loadAssocList();
$o = array();
if (!empty($products)) {
$count = count($products);
if ($count == $pagination) {
// Pagination full, continue with adding next round of
products
$continue = 1;
}
foreach ($products as $k => $v) {
$o[] = '<div class="ph-bulk-price-item alert
alert-info">';
if (isset($v['title'])) {
$o[] = '<div
class="ph-bulk-price-title">'.$v['title'].'</div>';
}
if (isset($v['price']) ) {
$newPrice =
PhocacartPriceBulkprice::setRevertPrice($v['id'], $id,
$v['price'], $item->params);
$o[] = '<div
class="ph-bulk-price-price">' .
JText::_('COM_PHOCACART_PRICE') . ': <b>'.
$price->getPriceFormat($v['price']) . '</b>
<span class="ph-bulk-price-arrow">→</span>
<b>' .$price->getPriceFormat($newPrice).
'</b></div>';
}
if (isset($v['price_original']) ) {
$newPriceOriginal =
PhocacartPriceBulkprice::setRevertOriginalPrice($v['id'], $id,
$v['price_original'], $v['price'], $item->params);
$o[] = '<div
class="ph-bulk-price-original-price">' .
JText::_('COM_PHOCACART_ORIGINAL_PRICE') . ':
<b>'. $price->getPriceFormat($v['price_original'])
. '</b> <span
class="ph-bulk-price-arrow">→</span>
<b>' .$price->getPriceFormat($newPriceOriginal).
'</b></div>';
}
if (isset($v['price']) &&
isset($v['price_original'])) {
// Price history
// 0 ... display in price history (standard change of price)
// 1 ... display in price history (bulk price change)
// 2 ... don't display in price history (only bulk price info for
possible revert) ... specific type of price history
//
// BE AWARE
// Standard price history (0,1) is applied only once a day
// Bulk price history (2) can have more items per day
// Bulk price history
$type = 2;
PhocacartPriceHistory::storePriceHistoryBulkPriceById($v['id'],
$newPrice, $newPriceOriginal, $id, $v['price'],
$v['price_original'], $type);
// Standard price history
if ($item_save_price_history_revert == 1) {
$type = 1;
PhocacartPriceHistory::storePriceHistoryById((int)$v['id'],
$newPrice, $type);
}
// Update group price
PhocacartGroup::updateGroupProductPriceById((int)$v['id'],
$newPrice);
}
$o[] = '</div>';
}
}
$output = implode('', $o);
$oFinished = array();
if ($continue == 0) {
// Job finished
$oFinished[] = '<div class="ph-bulk-price-item alert
alert-success">';
$oFinished[] =
JText::_('COM_PHOCACART_BULK_PRICE_CHANGE_FINISHED');
$oFinished[] = '</div>';
$output = implode('', $oFinished) . $output;
PhocacartPriceBulkprice::setStatus($id, 0);
PhocacartPriceBulkprice::removePriceHistoryItem($id);
}
$response = array('status' => '1',
'output' => $output, 'continue' => $continue);
echo json_encode($response);
return;
}
}
?>
PK�"�[g~����"controllers/phocacartbulkprice.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocaCartBulkprice extends
PhocaCartCpControllerPhocaCartCommon
{
}
?>
PK�"�[�b�!!#controllers/phocacartbulkprices.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartBulkprices extends
PhocaCartCpControllerPhocaCartCommons
{
public function __construct($config = array()) {
parent::__construct($config);
}
public function &getModel($name = 'PhocaCartBulkprice',
$prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[�
�9((controllers/phocacartcart.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartCart extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartCart', $prefix =
'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
function emptycart() {
$app = JFactory::getApplication();
if (!JSession::checkToken('request')) {
$app->enqueueMessage('Invalid Token', 'message');
return false;
}
$userid = $app->input->get('userid', 0,
'int');
$vendorid = $app->input->get('vendorid', 0,
'int');
$ticketid = $app->input->get('ticketid', 0,
'int');
$unitid = $app->input->get('unitid', 0,
'int');
$sectionid = $app->input->get('sectionid', 0,
'int');
if ((int)$userid > 0) {
$model = $this->getModel( 'phocacartcart' );
if(!$model->emptycart($userid, $vendorid, $ticketid, $unitid,
$sectionid)) {
$message = JText::_( 'COM_PHOCACART_ERROR_EMPTY_CART' );
$app->enqueueMessage($message, 'error');
} else {
$message = JText::_( 'COM_PHOCACART_SUCCESS_EMPTY_CART' );
$app->enqueueMessage($message, 'message');
}
$app->redirect('index.php?option=com_phocacart&view=phocacartcart&tmpl=component&userid='.(int)$userid);
} else {
$app->enqueueMessage(JText::_('COM_PHOCACART_NO_ITEM_FOUND'),
'error');
$app->redirect('index.php?option=com_phocacart&view=phocacartcart&tmpl=component');
}
}
}
?>
PK�"�[���V��#controllers/phocacartcategories.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartCategories extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartCategory',
$prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[<
��!controllers/phocacartcategory.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartCategory extends
PhocaCartCpControllerPhocaCartCommon
{
public function batch($model = null) {
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$model = $this->getModel('phocacartcategory', '',
array());
$this->setRedirect(JRoute::_('index.php?option=com_phocacart&view=phocacartcategories'.$this->getRedirectToListAppend(),
false));
return parent::batch($model);
}
function recreate() {
$app = JFactory::getApplication();
$cid = JFactory::getApplication()->input->get( 'cid',
array(), '', 'array' );
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$message = '';
if (count( $cid ) < 1) {
$message = JText::_( 'COM_PHOCACART_SELECT_ITEM_RECREATE' );
$app->enqueueMessage($message, 'error');
$app->redirect('index.php?option=com_phocacart&view=phocacartcategories');
}
$model = $this->getModel( 'phocacartcategory' );
if(!$model->recreate($cid, $message)) {
$message = PhocacartUtils::setMessage($message, JText::_(
'COM_PHOCACART_ERROR_THUMBS_REGENERATING' ));
$app->enqueueMessage($message, 'error');
} else {
$message = PhocacartUtils::setMessage($message, JText::_(
'COM_PHOCACART_SUCCESS_THUMBS_REGENERATING' ));
$app->enqueueMessage($message, 'message');
}
$app->redirect('index.php?option=com_phocacart&view=phocacartcategories');
}
function countproducts() {
$app = JFactory::getApplication();
$cid = JFactory::getApplication()->input->get( 'cid',
array(), '', 'array' );
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$redirect =
'index.php?option=com_phocacart&view=phocacartcategories';
if (count( $cid ) < 1) {
$app->enqueueMessage(JText::_(
'COM_PHOCACART_SELECT_ITEM_COUNT_PRODUCTS' ), 'error');
$app->redirect($redirect);
}
PhocacartCount::setProductCount($cid, 'category');// Message
set by Count Class
$app->redirect($redirect);
}
}
?>
PK�"�[S�EW``controllers/phocacartcommon.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport('joomla.application.component.controllerform');
class PhocaCartCpControllerPhocaCartCommon extends JControllerForm
{
protected $option = 'com_phocacart';
function __construct($config=array()) {
parent::__construct($config);
}
protected function allowAdd($data = array()) {
$user = JFactory::getUser();
$allow = null;
$allow = $user->authorise('core.create',
'com_phocacart');
if ($allow === null) {
return parent::allowAdd($data);
} else {
return $allow;
}
}
protected function allowEdit($data = array(), $key = 'id') {
$user = JFactory::getUser();
$allow = null;
$allow = $user->authorise('core.edit',
'com_phocacart');
if ($allow === null) {
return parent::allowEdit($data, $key);
} else {
return $allow;
}
}
}
?>PK�"�[��Fmm
controllers/phocacartcommons.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport('joomla.application.component.controlleradmin');
class PhocaCartCpControllerPhocaCartCommons extends JControllerAdmin
{
protected $option = 'com_phocacart';
public function &getModel($name = 'PhocaCartCommon', $prefix
= 'PhocaCartCpModel', $config = array())
{
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
public function saveOrderAjax() {
//JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$pks = $this->input->post->get('cid', array(),
'array');
$order = $this->input->post->get('order', array(),
'array');
// TEST per URL
//$pks = $this->input->get->get('cid', array(),
'array');
//$order = $this->input->get->get('order', array(),
'array');
//print r($pks);
//print r($order);
\Joomla\Utilities\ArrayHelper::toInteger($pks);
\Joomla\Utilities\ArrayHelper::toInteger($order);
$model = $this->getModel();
$return = $model->saveorder($pks, $order);
if ($return) { echo "1";}
JFactory::getApplication()->close();
}
}
?>PK�"�[DmT���"controllers/phocacartcountries.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartCountries extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartCountry',
$prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[�_����
controllers/phocacartcountry.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartCountry extends
PhocaCartCpControllerPhocaCartCommon {
function importcountries() {
$app = JFactory::getApplication();
$model = $this->getModel( 'phocacartcountry' );
if(!$model->importcountries()) {
$message = JText::_( 'COM_PHOCACART_ERROR_COUNTRIES_IMPORT' );
$app->enqueueMessage($message, 'error');
} else {
$message = JText::_( 'COM_PHOCACART_SUCCESS_COUNTRIES_IMPORT'
);
$app->enqueueMessage($message, 'message');
}
$app->redirect('index.php?option=com_phocacart&view=phocacartcountries');
}
}
?>PK�"�[�ˠW��controllers/phocacartcoupon.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartCoupon extends
PhocaCartCpControllerPhocaCartCommon {}
?>PK�"�[���@��
controllers/phocacartcoupons.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartCoupons extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartCoupon', $prefix
= 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[��.��#controllers/phocacartcurrencies.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartCurrencies extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartCurrency',
$prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[MJ#V��!controllers/phocacartcurrency.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartCurrency extends
PhocaCartCpControllerPhocaCartCommon {}
?>
PK�"�[���!controllers/phocacartdiscount.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartDiscount extends
PhocaCartCpControllerPhocaCartCommon {}
?>PK�"�[�U����"controllers/phocacartdiscounts.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartDiscounts extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartDiscount',
$prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[�(ճ��!controllers/phocacartdownload.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartDownload extends
PhocaCartCpControllerPhocaCartCommon {}
?>PK�"�[#��4��"controllers/phocacartdownloads.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartDownloads extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartDownload',
$prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[�=���&controllers/phocacarteditbulkprice.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartEditBulkprice extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocaCartEditBulkprice',
$prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[�����)controllers/phocacarteditinplace.json.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\Language\Text;
defined('_JEXEC') or die();
class PhocaCartCpControllerPhocacartEditinplace extends JControllerForm
{
public function editinplacetext() {
if (!JSession::checkToken('request')) {
$response = array(
'status' => '0',
'error' => '<div class="ph-result-txt
ph-error-txt">' . JText::_('JINVALID_TOKEN') .
'</div>',
'result' => '');
echo json_encode($response);
exit;
}
$app = JFactory::getApplication();
$value = $app->input->get('value', '',
'raw');
$id = $app->input->get('id', '',
'string');
$options = array();
$options['id'] = $id;
$options['msg'] = '';
$options['value'] = $value;
$options['valuecombined'] = '';
$options['idcombined'] = '';
$saved = PhocacartEdit::store($options);
if ($saved !== false) {
$response = array();
$response['status'] = 1;
$response['result'] =
htmlspecialchars($options['value']);
if ($options['valuecombined'] != '') {
$response['resultcombined'] =
htmlspecialchars($options['valuecombined']);
}
if ($options['idcombined'] != '') {
// will be replaced in JS
//$response['idcombined'] =
strip_tags(str_replace(':', '\\:',
$options['idcombined']));
$response['idcombined'] =
htmlspecialchars($options['idcombined']);
}
echo json_encode($response);
exit;
}
$options['msg'] = $options['msg'] != '' ?
'<br />' . $options['msg'] : '';
$response = array(
'status' => '0',
'error' => '<div class="ph-result-txt
ph-error-txt">' .
Text::_('COM_PHOCACART_ERROR_ITEM_NOT_SAVED') .
$options['msg'] . '</div>',
'result' => '');
echo json_encode($response);
exit;
}
}
?>
PK�"�[a����.controllers/phocacarteditproductpointgroup.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartEditProductPointGroup extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name =
'PhocaCartEditProductPointGroup', $prefix =
'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
function save() {
if (!JSession::checkToken('request')) {
$app->enqueueMessage('Invalid Token', 'message');
return false;
}
$app = JFactory::getApplication();
$jform = $app->input->get('jform', array(),
'array');
$id = $app->input->get('id', 0, 'int');
if (!empty($jform)) {
$model = $this->getModel( 'phocacarteditproductpointgroup'
);
if(!$model->save($jform, $id)) {
$message = JText::_(
'COM_PHOCACART_ERROR_ADD_CUSTOMER_GROUP_DATA' );
$app->enqueueMessage($message, 'error');
} else {
$message = JText::_(
'COM_PHOCACART_SUCCESS_ADD_CUSTOMER_GROUP_DATA' );
$app->enqueueMessage($message, 'message');
}
$app->redirect('index.php?option=com_phocacart&view=phocacarteditproductpointgroup&tmpl=component&id='.(int)$id);
} else {
$app->enqueueMessage(JText::_('COM_PHOCACART_NO_ITEM_FOUND'),
'error');
$app->redirect('index.php?option=com_phocacart&view=phocacarteditproductpointgroup&tmpl=component');
}
}
}
?>PK�"�[c͞���.controllers/phocacarteditproductpricegroup.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartEditProductPriceGroup extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name =
'PhocaCartEditProductPriceGroup', $prefix =
'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
function save() {
if (!JSession::checkToken('request')) {
$app->enqueueMessage('Invalid Token', 'message');
return false;
}
$app = JFactory::getApplication();
$jform = $app->input->get('jform', array(),
'array');
$id = $app->input->get('id', 0, 'int');
if (!empty($jform)) {
$model = $this->getModel( 'phocacarteditproductpricegroup'
);
if(!$model->save($jform, $id)) {
$message = JText::_(
'COM_PHOCACART_ERROR_ADD_CUSTOMER_GROUP_DATA' );
$app->enqueueMessage($message, 'error');
} else {
$message = JText::_(
'COM_PHOCACART_SUCCESS_ADD_CUSTOMER_GROUP_DATA' );
$app->enqueueMessage($message, 'message');
}
$app->redirect('index.php?option=com_phocacart&view=phocacarteditproductpricegroup&tmpl=component&id='.(int)$id);
} else {
$app->enqueueMessage(JText::_('COM_PHOCACART_NO_ITEM_FOUND'),
'error');
$app->redirect('index.php?option=com_phocacart&view=phocacarteditproductpricegroup&tmpl=component');
}
}
}
?>PK�"�[��B���0controllers/phocacarteditproductpricehistory.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartEditProductPriceHistory extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name =
'PhocaCartEditProductPriceHistory', $prefix =
'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
function save() {
if (!JSession::checkToken('request')) {
$app->enqueueMessage('Invalid Token', 'message');
return false;
}
$app = JFactory::getApplication();
$jform = $app->input->get('jform', array(),
'array');
$id = $app->input->get('id', 0, 'int');
if (!empty($jform)) {
$model = $this->getModel(
'phocacarteditproductpricehistory' );
if(!$model->save($jform)) {
$message = JText::_(
'COM_PHOCACART_ERROR_ADD_PRODUCT_PRICE_HISTORY' );
$app->enqueueMessage($message, 'error');
} else {
$message = JText::_(
'COM_PHOCACART_SUCCESS_ADD_PRODUCT_PRICE_HISTORY' );
$app->enqueueMessage($message, 'message');
}
$app->redirect('index.php?option=com_phocacart&view=phocacarteditproductpricehistory&tmpl=component&id='.(int)$id);
} else {
$app->enqueueMessage(JText::_('COM_PHOCACART_NO_ITEM_FOUND'),
'error');
$app->redirect('index.php?option=com_phocacart&view=phocacarteditproductpricehistory&tmpl=component&id='.(int)$id);
}
}
}
?>PK�"�[�b�6� � #controllers/phocacarteditstatus.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartEditStatus extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocaCartEditStatus',
$prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
function editstatus() {
if (!JSession::checkToken('request')) {
$app->enqueueMessage('Invalid Token', 'message');
return false;
}
$app = JFactory::getApplication();
//$id = $app->input->get('id', 0, 'int');
$jform = $app->input->get('jform', array(),
'array');
if ((int)$jform['id'] > 0 &&
$jform['status_id']) {
$model = $this->getModel( 'phocacarteditstatus' );
if(!$model->editStatus($jform)) {
$message = JText::_( 'COM_PHOCACART_ERROR_UPDATE_STATUS' );
$app->enqueueMessage($message, 'error');
} else {
$message = JText::_( 'COM_PHOCACART_SUCCESS_UPDATE_STATUS' );
$app->enqueueMessage($message, 'message');
}
$app->redirect('index.php?option=com_phocacart&view=phocacarteditstatus&tmpl=component&id='.(int)$jform['id']);
} else {
$app->enqueueMessage(JText::_('COM_PHOCACART_NO_ITEM_FOUND'),
'error');
$app->redirect('index.php?option=com_phocacart&view=phocacarteditstatus&tmpl=component');
}
}
function emptyhistory() {
$app = JFactory::getApplication();
$jform = $app->input->get('jform', array(),
'array');
if ((int)$jform['id'] > 0) {
$model = $this->getModel( 'phocacarteditstatus' );
if(!$model->emptyHistory($jform['id'])) {
$message = JText::_( 'COM_PHOCACART_ERROR_EMPTY_STATUSES' );
$app->enqueueMessage($message, 'error');
} else {
$message = JText::_( 'COM_PHOCACART_SUCCESS_EMPTY_STATUSES'
);
$app->enqueueMessage($message, 'message');
}
$app->redirect('index.php?option=com_phocacart&view=phocacarteditstatus&tmpl=component&id='.(int)$jform['id']);
} else {
$app->enqueueMessage(JText::_('COM_PHOCACART_NO_ITEM_FOUND'),
'error');
$app->redirect('index.php?option=com_phocacart&view=phocacarteditstatus&tmpl=component');
}
}
}
?>PK�"�[a��>��*controllers/phocacarteditstockadvanced.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartEditStockAdvanced extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name =
'PhocaCartEditStockAdvanced', $prefix =
'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
function save() {
if (!JSession::checkToken('request')) {
$app->enqueueMessage('Invalid Token', 'message');
return false;
}
$app = JFactory::getApplication();
$jform = $app->input->get('jform', array(),
'array');
$id = $app->input->get('id', 0, 'int');
if (!empty($jform)) {
$model = $this->getModel( 'phocacarteditstockadvanced' );
if(!$model->save($jform, $id)) {
$message = JText::_( 'COM_PHOCACART_ERROR_ADD_STOCK_QUANTITY'
);
$app->enqueueMessage($message, 'error');
} else {
$message = JText::_(
'COM_PHOCACART_SUCCESS_ADD_STOCK_QUANTITY' );
$app->enqueueMessage($message, 'message');
}
$app->redirect('index.php?option=com_phocacart&view=phocacarteditstockadvanced&tmpl=component&id='.(int)$id);
} else {
$app->enqueueMessage(JText::_('COM_PHOCACART_NO_ITEM_FOUND'),
'error');
$app->redirect('index.php?option=com_phocacart&view=phocacarteditstockadvanced&tmpl=component');
}
}
}
?>PK�"�[�^�
�
controllers/phocacartedittax.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartEditTax extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocaCartEditTax',
$prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
function edittax() {
if (!JSession::checkToken('request')) {
$app->enqueueMessage('Invalid Token', 'message');
return false;
}
$app = JFactory::getApplication();
//$id = $app->input->get('id', 0, 'int');
$jform = $app->input->get('jform', array(),
'array');
if (!isset($jform['type'])) {
$jform['type'] = 1;// country
}
if ((int)$jform['id'] > 0) {
$model = $this->getModel( 'phocacartedittax' );
if(!$model->editTax($jform)) {
$message = JText::_(
'COM_PHOCACART_ERROR_UPDATE_TAX_INFORMATION' );
$app->enqueueMessage($message, 'error');
} else {
$message = JText::_(
'COM_PHOCACART_SUCCESS_UPDATE_TAX_INFORMATION' );
$app->enqueueMessage($message, 'message');
}
$app->redirect('index.php?option=com_phocacart&view=phocacartedittax&type='.(int)$jform['type'].'&tmpl=component&id='.(int)$jform['id']);
} else {
$app->enqueueMessage(JText::_('COM_PHOCACART_NO_ITEM_FOUND'),
'error');
$app->redirect('index.php?option=com_phocacart&view=phocacartedittax&type='.(int)$jform['type'].'&tmpl=component');
}
}
function emptyinformation() {
$app = JFactory::getApplication();
$jform = $app->input->get('jform', array(),
'array');
if (!isset($jform['type'])) {
$jform['type'] = 1;// country
}
if ((int)$jform['id'] > 0) {
$model = $this->getModel( 'phocacartedittax' );
if(!$model->emptyInformation($jform['id'],
$jform['type'])) {
$message = JText::_(
'COM_PHOCACART_ERROR_EMPTY_TAX_INFORMATION' );
$app->enqueueMessage($message, 'error');
} else {
$message = JText::_(
'COM_PHOCACART_SUCCESS_EMPTY_TAX_INFORMATION' );
$app->enqueueMessage($message, 'message');
}
$app->redirect('index.php?option=com_phocacart&view=phocacartedittax&type='.(int)$jform['type'].'&tmpl=component&id='.(int)$jform['id']);
} else {
$app->enqueueMessage(JText::_('COM_PHOCACART_NO_ITEM_FOUND'),
'error');
$app->redirect('index.php?option=com_phocacart&view=phocacartedittax&type='.(int)$jform['type'].'&tmpl=component');
}
}
}
?>PK�"�[J���
$controllers/phocacartexport.json.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocaCartExport extends
PhocaCartCpControllerPhocaCartCommon {
public function export() {
if (!JSession::checkToken('request')) {
$response = array('status' => '0',
'error' => '<div class="alert
alert-error">' . JText::_('JINVALID_TOKEN') .
'</div>');
echo json_encode($response);
return;
}
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$paramsC = PhocacartUtils::getComponentParameters();
$this->t['import_export_pagination'] = $paramsC->get(
'import_export_pagination', 20 );
//$this->t['import_export_type'] = $paramsC->get(
'import_export_type', 0 );
//$this->t['export_add_title'] = $paramsC->get(
'export_add_title', 0 );
$page = $app->input->get('p', 0, 'int');
$last_page = $app->input->get('lp', 0, 'int');
$limitOffset = ((int)$page *
(int)$this->t['import_export_pagination']) -
(int)$this->t['import_export_pagination'];
if ($limitOffset < 0) {
$limitOffset = 0;
}
$limitCount = $this->t['import_export_pagination'];
$d = array();
$d['products'] =
PhocacartProduct::getProductsFull($limitOffset, $limitCount, 11);
//$d['productcolumns'] =
PhocacartProduct::getProductColumns();// 1 and 2 line - Header - Filtering
of columns Set in layout
$d['page'] = $page;// Pagination
$d['last_page'] = $last_page;// Pagination
// line cca: 588: libraries/cms/layout/file.php
//$layout = new JLayoutFile('product_export', null,
array('client' => 0));
$layout = new JLayoutFile('product_export', null,
array('component' => 'com_phocacart'));
/*if ($this->t['import_export_type'] == 0) {
$d['type'] = 'csv';
} else {
$d['type'] = 'xml';
}*/
$output = $layout->render($d);
if ($page == 1) {
$q = 'TRUNCATE TABLE #__phocacart_export;'. " ";
$db->setQuery($q);
$db->execute();
}
$q = 'INSERT INTO #__phocacart_export (user_id, item, type) VALUES
'.(string)$output;
// Type 0 - standard item, 1 - header, 2 - footer
//echo $q;
$db->setQuery($q);
$db->execute();
$response = array('status' => '1',
'message' => '<div class="alert
alert-success">OK</div>');
echo json_encode($response);
return;
}
}
?>
PK�"�[K3ϑ��controllers/phocacartexport.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocaCartExport extends
PhocaCartCpControllerPhocaCartCommon {
function download() {
$db = JFactory::getDBO();
$user = JFactory::getUser();
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$import_export_type = $paramsC->get( 'import_export_type', 0
);
$prefix = '';
$suffix = '';
// Possible parameters when download problems
// Export - ajax and pagination is used
// Download - no ajax and pagination used
$limitOffset = $paramsC->get(
'export_download_limit_offset', 0 );
$limitCount = $paramsC->get( 'export_download_limit_count',
0 );
$rowH = array();// Specific Header for divided files
$rowF = array();// Specific Footer for divided files
$q = 'SELECT a.item'
.' FROM #__phocacart_export AS a'
.' WHERE a.user_id = '.(int) $user->id;
if ((int)$limitCount > 0) {
$q .= ' AND a.type = 0';// only standard items (not header, no
footer)
}
$q .= ' ORDER BY a.id';
if ((int)$limitCount > 0) {
$q .= ' LIMIT '.(int)$limitOffset. ',
'.(int)$limitCount;
}
$db->setQuery($q);
$rows = $db->loadColumn();
if ((int)$limitCount > 0) {
// Partialy download - download divided to more download files - we need
to do header and footer for each file
$q = 'SELECT a.item'
.' FROM #__phocacart_export AS a'
.' WHERE a.user_id = '.(int) $user->id
.' AND a.type = 1' //Header
.' ORDER BY a.id';
$db->setQuery($q);
$rowH = $db->loadColumn();
$q = 'SELECT a.item'
.' FROM #__phocacart_export AS a'
.' WHERE a.user_id = '.(int) $user->id
.' AND a.type = 2' //Header
.' ORDER BY a.id';
$db->setQuery($q);
$rowF = $db->loadColumn();
}
$o = '';
if (!empty($rows)) {
// Header only - in case of divided file
if (!empty($rowH)) {
foreach ($rowH as $k => $v) {
$o .= $v. "\n";
}
}
// All items
foreach ($rows as $k => $v) {
$o .= $v. "\n";
}
// Footer only - in case of divided file
if (!empty($rowF)) {
foreach ($rowF as $k => $v) {
$o .= $v. "\n";
}
}
} else {
$message = JText::_(
'COM_PHOCACART_THERE_IS_NO_FILE_READY_TO_DOWNLOAD_EXPORT_PRODUCTS_FIRST'
);
$app->enqueueMessage($message, 'error');
$app->redirect('index.php?option=com_phocacart&view=phocacartexports');
return;
}
$download = PhocacartDownload::downloadContent($o, $prefix, $suffix);
if ($download) {
$q = 'TRUNCATE TABLE #__phocacart_export;';
$db->setQuery($q);
$db->execute();
}
exit;
}
}
?>
PK�"�[,���
controllers/phocacartexports.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartExports extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocaCartExport', $prefix
= 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[3߁l[ [ "controllers/phocacartextension.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartExtension extends
PhocaCartCpControllerPhocaCartCommon {
public function refresh() {
$app = JFactory::getApplication('administrator');
$type =
$app->getUserStateFromRequest($this->context.'.filter.category_id',
'filter_category_id', 'modules');
$app->setUserState('com_phocacart.getExtensions.'.$type,
null);
$app->setUserState('com_phocacart.getNews.news', null);
$msg = JText::_('COM_PHOCACART_EXTENSION_LIST_REFRESHED');
$app->enqueueMessage($msg, 'message');
$app->redirect('index.php?option=com_phocacart&view=phocacartextensions');
}
public function install() {
if (!JSession::checkToken('request')) {
$app->enqueueMessage('Invalid Token', 'message');
return false;
}
$app = JFactory::getApplication('administrator');
$msg = '';
try {
$downloadUrl = $app->input->getBase64('link');
if (!$downloadUrl) {
throw new
Exception(JText::_('COM_PHOCACART_ERROR_EXTENSION_URL_NOT_FOUND'));
}
$file = JInstallerHelper::downloadPackage(base64_decode($downloadUrl));
if (!$file) {
throw new
Exception(JText::_('COM_PHOCACART_ERROR_EXTENSION_FILE_NOT_FOUND'));
}
$tmpPath = $app->get('tmp_path');
$package = JInstallerHelper::unpack($tmpPath . '/' . $file,
true);
if (!$package) {
throw new
Exception(JText::_('COM_PHOCACART_ERROR_EXTENSION_FILE_NOT_FOUND'));
}
$installer = new JInstaller;
if ($installer->install($package['extractdir'])) {
$msg =
JText::sprintf('COM_PHOCACART_SUCCESS_EXTENSION_INSTALLED',
$package['type']);
JInstallerHelper::cleanupInstall($package['packagefile'],
$package['extractdir']);
}
} catch (RuntimeException $e) {
$app->enqueueMessage($e->getMessage(), 'message');
$app->redirect('index.php?option=com_phocacart&view=phocacartextensions');
}
$app->enqueueMessage($msg, 'message');
$app->redirect('index.php?option=com_phocacart&view=phocacartextensions');
}
}
?>PK�"�[$���#controllers/phocacartextensions.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartExtensions extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocaCartExtension',
$prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[!�QP��controllers/phocacartfeed.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartFeed extends
PhocaCartCpControllerPhocaCartCommon {}
?>PK�"�[��aF��controllers/phocacartfeeds.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartFeeds extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartFeed', $prefix =
'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[�C���"controllers/phocacartformfield.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocaCartFormfield extends
PhocaCartCpControllerPhocaCartCommon {
}
?>PK�"�[��~X#controllers/phocacartformfields.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartFormfields extends
PhocaCartCpControllerPhocaCartCommons
{
public function __construct($config = array())
{
parent::__construct($config);
$this->registerTask('hidebilling', 'displaybilling');
$this->registerTask('hideshipping', 'displayshipping');
$this->registerTask('hideaccount', 'displayaccount');
$this->registerTask('disablerequired', 'enablerequired');
}
public function &getModel($name = 'PhocaCartFormfield',
$prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
function displaybilling() {
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
$app = JFactory::getApplication();
$cid = $app->input->get('cid', array(), '',
'array');
$data = array('displaybilling' => 1, 'hidebilling'
=> 0);
$task = $this->getTask();
$value = \Joomla\Utilities\ArrayHelper::getValue($data, $task, 0,
'int');
if (empty($cid)) {
$app->enqueueMessage(JText::_($this->text_prefix.'_NO_ITEM_SELECTED'),
'error');
} else {
$model = $this->getModel();
\Joomla\Utilities\ArrayHelper::toInteger($cid);
if (!$model->displayItem($cid, $value, 'display_billing'))
{
$app->enqueueMessage($model->getError(), 'error');
} else {
if ($value == 1) {
$ntext = $this->text_prefix.'_N_ITEMS_DISPLAYED';
} else if ($value == 0) {
$ntext = $this->text_prefix.'_N_ITEMS_HIDDEN';
}
$this->setMessage(JText::plural($ntext, count($cid)));
}
}
$this->setRedirect(JRoute::_('index.php?option='.$this->option.'&view='.$this->view_list,
false));
}
function displayshipping() {
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
$app = JFactory::getApplication();
$cid = $app->input->get('cid', array(), '',
'array');
$data = array('displayshipping' => 1,
'hideshipping' => 0);
$task = $this->getTask();
$value = \Joomla\Utilities\ArrayHelper::getValue($data, $task, 0,
'int');
if (empty($cid)) {
$app->enqueueMessage(JText::_($this->text_prefix.'_NO_ITEM_SELECTED'),
'error');
} else {
$model = $this->getModel();
\Joomla\Utilities\ArrayHelper::toInteger($cid);
if (!$model->displayItem($cid, $value, 'display_shipping'))
{
$app->enqueueMessage($model->getError(), 'error');
} else {
if ($value == 1) {
$ntext = $this->text_prefix.'_N_ITEMS_DISPLAYED';
} else if ($value == 0) {
$ntext = $this->text_prefix.'_N_ITEMS_HIDDEN';
}
$this->setMessage(JText::plural($ntext, count($cid)));
}
}
$this->setRedirect(JRoute::_('index.php?option='.$this->option.'&view='.$this->view_list,
false));
}
function enablerequired() {
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
$app = JFactory::getApplication();
$cid = $app->input->get('cid', array(), '',
'array');
$data = array('enablerequired' => 1,
'disablerequired' => 0);
$task = $this->getTask();
$value = \Joomla\Utilities\ArrayHelper::getValue($data, $task, 0,
'int');
if (empty($cid)) {
$app->enqueueMessage(JText::_($this->text_prefix.'_NO_ITEM_SELECTED'),
'error');
} else {
$model = $this->getModel();
\Joomla\Utilities\ArrayHelper::toInteger($cid);
if (!$model->displayItem($cid, $value, 'required')) {
$app->enqueueMessage($model->getError(), 'error');
} else {
if ($value == 1) {
$ntext = $this->text_prefix.'_N_ITEMS_MADE_REQUIRED';
} else if ($value == 0) {
$ntext = $this->text_prefix.'_N_ITEMS_MADE_NOT_REQUIRED';
}
$this->setMessage(JText::plural($ntext, count($cid)));
}
}
$this->setRedirect(JRoute::_('index.php?option='.$this->option.'&view='.$this->view_list,
false));
}
function displayaccount() {
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
$app = JFactory::getApplication();
$cid = $app->input->get('cid', array(), '',
'array');
$data = array('displayaccount' => 1, 'hideaccount'
=> 0);
$task = $this->getTask();
$value = \Joomla\Utilities\ArrayHelper::getValue($data, $task, 0,
'int');
if (empty($cid)) {
$app->enqueueMessage(JText::_($this->text_prefix.'_NO_ITEM_SELECTED'),
'error');
} else {
$model = $this->getModel();
\Joomla\Utilities\ArrayHelper::toInteger($cid);
if (!$model->displayItem($cid, $value, 'display_account'))
{
$app->enqueueMessage($model->getError(), 'error');
} else {
if ($value == 1) {
$ntext = $this->text_prefix.'_N_ITEMS_DISPLAYED';
} else if ($value == 0) {
$ntext = $this->text_prefix.'_N_ITEMS_HIDDEN';
}
$this->setMessage(JText::plural($ntext, count($cid)));
}
}
$this->setRedirect(JRoute::_('index.php?option='.$this->option.'&view='.$this->view_list,
false));
}
}
?>PK�"�[9
H6��controllers/phocacartgroup.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartGroup extends
PhocaCartCpControllerPhocaCartCommon {}
?>PK�"�[��a��controllers/phocacartgroups.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartGroups extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartGroup', $prefix
= 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[^���controllers/phocacarthits.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartHits extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocaCartHit', $prefix =
'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[�QD� � $controllers/phocacartimport.json.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocaCartImport extends
PhocaCartCpControllerPhocaCartCommon {
public function import() {
if (!JSession::checkToken('request')) {
$response = array('status' => '0',
'error' => '<div class="alert
alert-error">' . JText::_('JINVALID_TOKEN') .
'</div>');
echo json_encode($response);
return;
}
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$paramsC = PhocacartUtils::getComponentParameters();
$this->t['import_export_pagination'] = $paramsC->get(
'import_export_pagination', 20 );
$page = $app->input->get('p', 0, 'int');
$last_page = $app->input->get('lp', 0, 'int');
$limitOffset = ((int)$page *
(int)$this->t['import_export_pagination']) -
(int)$this->t['import_export_pagination'];
if ($limitOffset < 0) {
$limitOffset = 0;
}
$limitCount = $this->t['import_export_pagination'];
$model = $this->getModel();
$d = array();
$d['file_type'] = $model->getFileType();
$d['products'] =
$model->getUploadedProducts($limitOffset, $limitCount);
$d['productcolumns'] =
$model->getUploadedProductColumns();// 1 and 2 line - Header - Filtering
of columns Set in layout
$d['page'] = $page;// Pagination
$d['last_page'] = $last_page;// Pagination
// line cca: 588: libraries/cms/layout/file.php
//$layout = new JLayoutFile('product_import', null,
array('client' => 0, 'component' =>
'com_phocacart'));
$layout = new JLayoutFile('product_import', null,
array('component' => 'com_phocacart'));
/*if ($this->t['import_export_type'] == 0) {
$d['type'] = 'csv';
} else {
$d['type'] = 'xml';
}*/
$output = $layout->render($d);
if ($d['page'] == $d['last_page']) {
$q = 'TRUNCATE TABLE #__phocacart_import;'. " ";
$db->setQuery($q);
$db->execute();
}
//$q = 'INSERT INTO #__phocacart_export (user_id, item, type) VALUES
'.(string)$output;
// Type 0 - standard item, 1 - header, 2 - footer
//$db->setQuery($q);
//$db->execute();
$response = array('status' => '1',
'message' => '<div class="alert
alert-success">OK</div>');
echo json_encode($response);
return;
}
}
?>
PK�"�[|+���controllers/phocacartimport.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocaCartImport extends
PhocaCartCpControllerPhocaCartCommon {
public function upload() {
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$user = JFactory::getUser();
$userId = $user->id;
$redirect =
'index.php?option=com_phocacart&view=phocacartimports';
//$file = JFactory::getApplication()->input->files->get(
'Filedata', null, 'raw');
$file = JFactory::getApplication()->input->files->get(
'Filedata');
$paramsC = PhocacartUtils::getComponentParameters();
$fgets_line_length = $paramsC->get( 'fgets_line_length',
24576 );
if (!JFile::exists($file['tmp_name'])) {
$app->enqueueMessage(JText::_('COM_PHOCACART_ERROR_FILE_NOT_EXIST'),
'error');
$app->redirect($redirect);
}
if (!isset($file['name'])) {
$app->enqueueMessage(JText::_('COM_PHOCACART_ERROR_FILE_NOT_EXIST'),
'error');
$app->redirect($redirect);
}
$ext = JFile::getExt($file['name']);
if ($ext != 'csv' && $ext != 'txt' &&
$ext != 'xml') {
$app->enqueueMessage(JText::_('COM_PHOCACART_ERROR_FILE_TYPE_NOT_SUPPORTED'),
'error');
$app->redirect($redirect);
}
$valA = array();
switch($ext) {
case 'xml':
$row = 1;
$xml = simplexml_load_file($file['tmp_name']);
if ($xml) {
if (!empty($xml->product)) {
foreach($xml->product as $k => $v) {
$dataC = (string)$v->asXML();
$dataC = str_replace(array("\n","\r"),
"", $dataC);
$valA[] = '('.(int)$userId.',
'.(int)$row.', '.$db->quote($dataC).', 0, 1)';
$row++;
}
}
}
break;
case 'csv':
case 'txt':
default:
$row = 1;
if (($handle = fopen($file['tmp_name'], "r")) !==
false) {
while (($data = fgets($handle, (int)$fgets_line_length)) !== false) {
$dataC = PhocacartUtils::convertEncoding($data);
// First two rows are headers
$type = 0;
if ($row == 1) {
$type = 1;
} else if ($row == 2) {
$type = 1;
}
$valA[] = '('.(int)$userId.', '.(int)$row.',
'.$db->quote($dataC).', '.(int)$type.', 0)';
$row++;
}
fclose($handle);
}
break;
}
$valS = '';
if (!empty($valA)) {
$valS = implode(', ', $valA);
$q = ' TRUNCATE TABLE #__phocacart_import;';
$db->setQuery($q);
$db->execute();
$q = ' INSERT INTO #__phocacart_import (user_id, row_id, item,
type, file_type)'
.' VALUES '.(string)$valS;
$db->setQuery($q);
$db->execute();
$app->enqueueMessage(JText::_('COM_PHOCACART_SUCCESS_FILE_UPLOADED'),
'success');
}
$app->redirect($redirect);
}
/*
public function import() {
if (!JSession::checkToken('request')) {
$response = array('status' => '0',
'error' => '<div class="alert
alert-error">' . JText::_('JINVALID_TOKEN') .
'</div>');
echo json_encode($response);
return;
}
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$paramsC = PhocacartUtils::getComponentParameters();
$this->t['import_export_pagination'] = $paramsC->get(
'import_export_pagination', 20 );
$page = $app->input->get('p', 0, 'int');
$last_page = $app->input->get('lp', 0, 'int');
$limitOffset = ((int)$page *
(int)$this->t['import_export_pagination']) -
(int)$this->t['import_export_pagination'];
if ($limitOffset < 0) {
$limitOffset = 0;
}
$limitCount = $this->t['import_export_pagination'];
$model = $this->getModel();
$d = array();
$d['file_type'] = $model->getFileType();
$d['products'] =
$model->getUploadedProducts($limitOffset, $limitCount);
$d['productcolumns'] =
$model->getUploadedProductColumns();// 1 and 2 line - Header - Filtering
of columns Set in layout
$d['page'] = $page;// Pagination
$d['last_page'] = $last_page;// Pagination
// IMPORTANT - Layout of component is frontend, but to override it -
administration template must be used
// line cca: 588: libraries/cms/layout/file.php
$layout = new JLayoutFile('product_import', null,
array('client' => 0, 'component' =>
'com_phocacart'));
/*if ($this->t['import_export_type'] == 0) {
$d['type'] = 'csv';
} else {
$d['type'] = 'xml';
}*/
/*
$output = $layout->render($d);
if ($d['page'] == $d['last_page']) {
$q = 'TRUNCATE TABLE #__phocacart_import;'. " ";
$db->setQuery($q);
$db->execute();
}
//$q = 'INSERT INTO #__phocacart_export (user_id, item, type) VALUES
'.(string)$output;
// Type 0 - standard item, 1 - header, 2 - footer
//$db->setQuery($q);
//$db->execute();
$response = array('status' => '1',
'message' => '<div class="alert
alert-success">OK</div>');
echo json_encode($response);
//return;
}*/
}
?>
PK�"�[6q��
controllers/phocacartimports.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartImports extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocaCartImport', $prefix
= 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[�9u��controllers/phocacartinfo.phpnu�[���<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
version 2 or later;
*/
defined('_JEXEC') or die();
class PhocaCartCpControllerPhocaMapsInfo extends PhocaCartCpController{}
?>
PK�"�[�U����controllers/phocacartitem.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocaCartItem extends
PhocaCartCpControllerPhocaCartCommon
{
public function batch($model = null) {
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$model = $this->getModel('phocacartitem', '',
array());
$this->setRedirect(JRoute::_('index.php?option=com_phocacart&view=phocacartitems'.$this->getRedirectToListAppend(),
false));
return parent::batch($model);
}
public function copyattributes($model = null) {
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$model = $this->getModel('phocacartitem', '',
array());
$app = JFactory::getApplication();
$cid = JFactory::getApplication()->input->get( 'cid',
array(),'array' );
$idSource = JFactory::getApplication()->input->get(
'copy_attributes', 0, 'int' );
\Joomla\Utilities\ArrayHelper::toInteger($cid);
if(!$model->copyattributes($cid, $idSource)) {
$app->enqueueMessage(JText::_('COM_PHOCACART_ERROR_ATTRIBUTES_NOT_COPIED'),
'error');
} else {
$app->enqueueMessage(JText::_('COM_PHOCACART_SUCCESS_ATTRIBUTES_COPIED'),
'message');
}
$this->setRedirect(JRoute::_('index.php?option=com_phocacart&view=phocacartitems'.$this->getRedirectToListAppend(),
false));
}
function recreate() {
$app = JFactory::getApplication();
$cid = JFactory::getApplication()->input->get( 'cid',
array(), '', 'array' );
\Joomla\Utilities\ArrayHelper::toInteger($cid);
if (count( $cid ) < 1) {
$message = JText::_( 'COM_PHOCACART_SELECT_ITEM_RECREATE' );
$app->enqueueMessage($message, 'error');
$app->redirect('index.php?option=com_phocacart&view=phocacartitems');
}
$message = '';
$model = $this->getModel( 'phocacartitem' );
if(!$model->recreate($cid, $message)) {
$message = PhocacartUtils::setMessage($message, JText::_(
'COM_PHOCACART_ERROR_THUMBS_REGENERATING' ));
$app->enqueueMessage($message, 'error');
} else {
//$message = JText::_(
'COM_PHOCACART_SUCCESS_THUMBS_REGENERATING' );
$message = PhocacartUtils::setMessage($message, JText::_(
'COM_PHOCACART_SUCCESS_THUMBS_REGENERATING' ));
$app->enqueueMessage($message, 'message');
}
$app->redirect('index.php?option=com_phocacart&view=phocacartitems');
}
/*
function removeduplicates() {
$app = JFactory::getApplication();
if (PhocacartCategoryMultiple::removeDuplicates()) {
$message = JText::_(
'COM_PHOCACART_SUCCESS_DUPLICATES_REMOVED' );
} else {
$message = JText::_(
'COM_PHOCACART_ERROR_DUPLICATES_NOT_REMOVED' );
}
$app->enqueueMessage($message, 'message');
$app->redirect('index.php?option=com_phocacart&view=phocacartitems');
}*/
}
?>
PK�"�[�2��controllers/phocacartitems.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartItems extends
PhocaCartCpControllerPhocaCartCommons
{
public function __construct($config = array()) {
parent::__construct($config);
$this->registerTask('unfeatured', 'featured');
}
public function &getModel($name = 'PhocaCartItem', $prefix =
'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
public function featured()
{
// Check for request forgeries
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$app = JFactory::getApplication();
$user = JFactory::getUser();
$ids = $this->input->get('cid', array(),
'array');
$values = array('featured' => 1, 'unfeatured'
=> 0);
$task = $this->getTask();
$value = \Joomla\Utilities\ArrayHelper::getValue($values, $task, 0,
'int');
// Access checks.
foreach ($ids as $i => $id)
{
if (!$user->authorise('core.edit.state',
'com_phocacart.phocacartitem.'.(int) $id))
{
// Prune items that you can't change.
unset($ids[$i]);
$this->setError(JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'));
$this->setMessage($this->getError(), 'error');
}
}
if (empty($ids)) {
$app->enqueueMessage(JText::_('COM_PHOCACART_ERROR_NO_ITEMS_SELECTED'),
'error');
} else {
$model = $this->getModel();
if (!$model->featured($ids, $value)) {
$app->enqueueMessage($model->getError(), 'error');
}
}
$this->setRedirect('index.php?option=com_phocacart&view=phocacartitems');
}
}
?>PK�"�[����controllers/phocacartlogs.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartLogs extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartLog', $prefix =
'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[@M�%controllers/phocacartmanufacturer.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartManufacturer extends
PhocaCartCpControllerPhocaCartCommon {
function countproducts() {
$app = JFactory::getApplication();
$cid = JFactory::getApplication()->input->get( 'cid',
array(), '', 'array' );
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$redirect =
'index.php?option=com_phocacart&view=phocacartmanufacturers';
if (count( $cid ) < 1) {
$app->enqueueMessage(JText::_(
'COM_PHOCACART_SELECT_ITEM_COUNT_PRODUCTS' ), 'error');
$app->redirect($redirect);
}
PhocacartCount::setProductCount($cid, 'manufacturer');//
Message set by Count Class
$app->redirect($redirect);
}
}
?>
PK�"�[���y��&controllers/phocacartmanufacturers.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartManufacturers extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartManufacturer',
$prefix = 'PhocaCartCpModel', $config = array()){
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[^���>>controllers/phocacartorder.phpnu�[���<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
version 2 or later;
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartOrder extends
PhocaCartCpControllerPhocaCartCommon {}
?>
PK�"�[$1S���controllers/phocacartorders.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartOrders extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartOrder', $prefix
= 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[p�Y���"controllers/phocacartparameter.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartParameter extends
PhocaCartCpControllerPhocaCartCommon {}
?>
PK�"�[SG
���#controllers/phocacartparameters.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartParameters extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartParameter',
$prefix = 'PhocaCartCpModel', $config = array()){
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>
PK�"�[`<@�
'controllers/phocacartparametervalue.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartParameterValue extends
PhocaCartCpControllerPhocaCartCommon {
function countproducts() {
$app = JFactory::getApplication();
$cid = JFactory::getApplication()->input->get( 'cid',
array(), '', 'array' );
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$redirect =
'index.php?option=com_phocacart&view=phocacartparametervalues';
if (count( $cid ) < 1) {
$app->enqueueMessage(JText::_(
'COM_PHOCACART_SELECT_ITEM_COUNT_PRODUCTS' ), 'error');
$app->redirect($redirect);
}
PhocacartCount::setProductCount($cid, 'parameter');// Message
set by Count Class
$app->redirect($redirect);
}
}
?>
PK�"�[�����(controllers/phocacartparametervalues.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartParameterValues extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartParameterValue',
$prefix = 'PhocaCartCpModel', $config = array()){
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>
PK�"�[��Mz��
controllers/phocacartpayment.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartPayment extends
PhocaCartCpControllerPhocaCartCommon {}
?>PK�"�[O��!controllers/phocacartpayments.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
use Joomla\Utilities\ArrayHelper;
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartPayments extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartPayment',
$prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
public function setDefault() {
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$pks = $this->input->post->get('cid', array(),
'array');
try {
if (empty($pks)) {
throw new
Exception(JText::_('COM_PHOCACART_NO_ITEM_SELECTED'));
}
$pks = ArrayHelper::toInteger($pks);
// Pop off the first element.
$id = array_shift($pks);
$model = $this->getModel();
$model->setDefault($id);
$this->setMessage(JText::_('COM_PHOCACART_SUCCESS_DEFAULT_SET'));
} catch (Exception $e) {
throw new Exception($e->getMessage(), 500);
}
$this->setRedirect('index.php?option=com_phocacart&view=phocacartpayments');
}
public function unsetDefault(){
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$pks = $this->input->post->get('cid', array(),
'array');
try {
if (empty($pks)) {
throw new
Exception(JText::_('COM_PHOCACART_NO_ITEM_SELECTED'));
}
$pks = ArrayHelper::toInteger($pks);
// Pop off the first element.
$id = array_shift($pks);
$model = $this->getModel();
$model->unsetDefault($id);
$this->setMessage(JText::_('COM_PHOCACART_SUCCESS_DEFAULT_UNSET'));
} catch (Exception $e) {
throw new Exception($e->getMessage(), 500);
}
$this->setRedirect('index.php?option=com_phocacart&view=phocacartpayments');
}
}
?>PK�"�[��]���!controllers/phocacartquestion.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocaCartQuestion extends
PhocaCartCpControllerPhocaCartCommon {}
?>PK�"�[2�����"controllers/phocacartquestions.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartQuestions extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocaCartQuestion',
$prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[Hz�:��controllers/phocacartregion.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartRegion extends
PhocaCartCpControllerPhocaCartCommon {
function importregions() {
$app = JFactory::getApplication();
$model = $this->getModel( 'phocacartregion' );
if(!$model->importregions()) {
$message = JText::_( 'COM_PHOCACART_ERROR_REGIONS_IMPORT' );
$app->enqueueMessage($message, 'error');
} else {
$message = JText::_( 'COM_PHOCACART_SUCCESS_REGIONS_IMPORT' );
$app->enqueueMessage($message, 'message');
}
$app->redirect('index.php?option=com_phocacart&view=phocacartregions');
}
}
?>PK�"�[嫃���
controllers/phocacartregions.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartRegions extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartRegion', $prefix
= 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[�#r��
controllers/phocacartreports.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartReports extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocaCartReport', $prefix
= 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[�'���controllers/phocacartreview.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartReview extends
PhocaCartCpControllerPhocaCartCommon {}
?>PK�"�[�AD���
controllers/phocacartreviews.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartReviews extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartReview', $prefix
= 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[$#��controllers/phocacartreward.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartReward extends
PhocaCartCpControllerPhocaCartCommon {}
?>PK�"�[&����
controllers/phocacartrewards.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartRewards extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartReward', $prefix
= 'PhocaCartCpModel', $config = array()){
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[Xe���
controllers/phocacartsection.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocaCartSection extends
PhocaCartCpControllerPhocaCartCommon
{
}
?>PK�"�[�A��!controllers/phocacartsections.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartSections extends
PhocaCartCpControllerPhocaCartCommons
{
public function __construct($config = array()) {
parent::__construct($config);
}
public function &getModel($name = 'PhocaCartSection',
$prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[@GE��!controllers/phocacartshipping.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartShipping extends
PhocaCartCpControllerPhocaCartCommon {
}
?>PK�"�[.9D�"controllers/phocacartshippings.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
use Joomla\Utilities\ArrayHelper;
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartShippings extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartShipping',
$prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
public function setDefault() {
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$pks = $this->input->post->get('cid', array(),
'array');
try {
if (empty($pks)) {
throw new
Exception(JText::_('COM_PHOCACART_NO_ITEM_SELECTED'));
}
$pks = ArrayHelper::toInteger($pks);
// Pop off the first element.
$id = array_shift($pks);
$model = $this->getModel();
$model->setDefault($id);
$this->setMessage(JText::_('COM_PHOCACART_SUCCESS_DEFAULT_SET'));
} catch (Exception $e) {
throw new Exception($e->getMessage(), 500);
}
$this->setRedirect('index.php?option=com_phocacart&view=phocacartshippings');
}
public function unsetDefault(){
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$pks = $this->input->post->get('cid', array(),
'array');
try {
if (empty($pks)) {
throw new
Exception(JText::_('COM_PHOCACART_NO_ITEM_SELECTED'));
}
$pks = ArrayHelper::toInteger($pks);
// Pop off the first element.
$id = array_shift($pks);
$model = $this->getModel();
$model->unsetDefault($id);
$this->setMessage(JText::_('COM_PHOCACART_SUCCESS_DEFAULT_UNSET'));
} catch (Exception $e) {
throw new Exception($e->getMessage(), 500);
}
$this->setRedirect('index.php?option=com_phocacart&view=phocacartshippings');
}
}
?>PK�"�[>�t.��&controllers/phocacartspecification.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartSpecification extends
PhocaCartCpControllerPhocaCartCommon {}
?>PK�"�[�x(���'controllers/phocacartspecifications.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartSpecifications extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartSpecification',
$prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[��Kg��#controllers/phocacartstatistics.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartStatistics extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocaCartStatistic',
$prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[\�o�uucontrollers/phocacartstatus.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocaCartStatus extends
PhocaCartCpControllerPhocaCartCommon {
public function __construct($config = array()) {
$this->view_list = 'phocacartstatuses';
parent::__construct($config);
}
}
?>PK�"�[�m�B��!controllers/phocacartstatuses.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartStatuses extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocaCartStatus', $prefix
= 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[�B�0$controllers/phocacartstockstatus.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartStockStatus extends
PhocaCartCpControllerPhocaCartCommon {
public function __construct($config = array()) {
$this->view_list = 'phocacartstockstatuses';
parent::__construct($config);
}
}
?>PK�"�[��^���&controllers/phocacartstockstatuses.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartStockStatuses extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartStockStatus',
$prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[��%((#controllers/phocacartsubmititem.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocaCartSubmititem extends
PhocaCartCpControllerPhocaCartCommon
{
function create() {
$app = JFactory::getApplication();
$cid = JFactory::getApplication()->input->get( 'cid',
array(), '', 'array' );
\Joomla\Utilities\ArrayHelper::toInteger($cid);
if (count( $cid ) < 1) {
$message = JText::_(
'COM_PHOCACART_SELECT_ITEM_CREATE_PRODUCT' );
$app->enqueueMessage($message, 'error');
$app->redirect('index.php?option=com_phocacart&view=phocacartsubmititems');
}
$message = '';
$model = $this->getModel( 'phocacartsubmititem' );
if(!$model->create($cid, $message)) {
$message = PhocacartUtils::setMessage($message, JText::_(
'COM_PHOCACART_ERROR_PRODUCT_CREATING' ));
$app->enqueueMessage($message, 'error');
$app->redirect('index.php?option=com_phocacart&view=phocacartsubmititems');
} else {
//$message = JText::_(
'COM_PHOCACART_SUCCESS_THUMBS_REGENERATING' );
$message = PhocacartUtils::setMessage($message, JText::_(
'COM_PHOCACART_SUCCESS_PRODUCT_CREATED' ));
$app->enqueueMessage($message, 'message');
$app->redirect('index.php?option=com_phocacart&view=phocacartitems');
}
}
}
?>
PK�"�[��~�##$controllers/phocacartsubmititems.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartSubmititems extends
PhocaCartCpControllerPhocaCartCommons
{
public function __construct($config = array()) {
parent::__construct($config);
}
public function &getModel($name = 'PhocaCartSubmititem',
$prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[�HMTTcontrollers/phocacarttag.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartTag extends
PhocaCartCpControllerPhocaCartCommon {
function countproducts() {
$app = JFactory::getApplication();
$cid = JFactory::getApplication()->input->get( 'cid',
array(), '', 'array' );
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$redirect =
'index.php?option=com_phocacart&view=phocacarttags';
if (count( $cid ) < 1) {
$app->enqueueMessage(JText::_(
'COM_PHOCACART_SELECT_ITEM_COUNT_PRODUCTS' ), 'error');
$app->redirect($redirect);
}
PhocacartCount::setProductCount($cid, 'tag');// Message set by
Count Class
PhocacartCount::setProductCount($cid, 'label');// Message set
by Count Class
$app->redirect($redirect);
}
}
?>
PK�"�[�vTe��controllers/phocacarttags.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartTags extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartTag', $prefix =
'PhocaCartCpModel', $config = array()){
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[�[����controllers/phocacarttax.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartTax extends
PhocaCartCpControllerPhocaCartCommon {}
?>
PK�"�[���)��controllers/phocacarttaxes.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartTaxes extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartTax', $prefix =
'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[-a�{��controllers/phocacarttime.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartTime extends
PhocaCartCpControllerPhocaCartCommon {}
?>PK�"�[��,!��controllers/phocacarttimes.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartTimes extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartTime', $prefix =
'PhocaCartCpModel', $config = array()){
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[l����controllers/phocacarttool.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocaCartTool extends
PhocaCartCpControllerPhocaCartCommon {
}
?>
PK�"�[O����controllers/phocacarttools.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartTools extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocaCartTool', $prefix =
'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[~�O���controllers/phocacartunit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocaCartUnit extends
PhocaCartCpControllerPhocaCartCommon
{
}
?>PK�"�[�!2controllers/phocacartunits.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartUnits extends
PhocaCartCpControllerPhocaCartCommons
{
public function __construct($config = array()) {
parent::__construct($config);
}
public function &getModel($name = 'PhocaCartUnit', $prefix =
'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[*�tv�
�
controllers/phocacartupload.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die( 'Restricted access' );
jimport('joomla.client.helper');
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
class PhocaCartCpControllerPhocaCartUpload extends PhocaCartCpController
{
function __construct() {
parent::__construct();
}
function createfolder() {
JSession::checkToken() or jexit(
'COM_PHOCADOWNLOAD_INVALID_TOKEN' );
$app = JFactory::getApplication();
// Set FTP credentials, if given
jimport('joomla.client.helper');
JClientHelper::setCredentialsFromRequest('ftp');
$paramsC = PhocacartUtils::getComponentParameters();
$folder_permissions = $paramsC->get( 'folder_permissions',
0755 );
//$folder_permissions = octdec((int)$folder_permissions);
$folderNew = $app->input->get( 'foldername',
'');
$folderCheck = $app->input->get( 'foldername', null,
'raw');
$parent = $app->input->get( 'folderbase', '',
'path' );
$tab = $app->input->get( 'tab', 0, 'string'
);
$field = $app->input->get( 'field');
$viewBack = $app->input->get( 'viewback',
'phocacartmanager' );
$manager = $app->input->get( 'manager',
'file', 'string' );
$link = '';
if ($manager != '') {
$group = PhocacartUtilsSettings::getManagerGroup($manager);
$link =
'index.php?option=com_phocacart&view='.(string)$viewBack.'&manager='.(string)$manager
.str_replace('&', '&',
$group['c']).'&folder='.$parent.'&tab='.(string)$tab.'&field='.$field;
$path = PhocacartPath::getPath($manager);// we use viewback to get right
path
} else {
$app->redirect('index.php?option=com_phocacart',
JText::_('COM_PHOCACART_ERROR_CONTROLLER_MANAGER_NOT_SET'));
exit;
}
JFactory::getApplication()->input->set('folder',
$parent);
if (($folderCheck !== null) && ($folderNew !== $folderCheck)) {
$app->redirect($link,
JText::_('COM_PHOCACART_WARNING_DIRNAME'));
}
if (strlen($folderNew) > 0) {
$folder =
JPath::clean($path['orig_abs_ds'].$parent.'/'.$folderNew);
if (!JFolder::exists($folder) && !JFile::exists($folder)) {
//JFolder::create($path, $folder_permissions );
switch((int)$folder_permissions) {
case 777:
JFolder::create($folder, 0777 );
break;
case 705:
JFolder::create($folder, 0705 );
break;
case 666:
JFolder::create($folder, 0666 );
break;
case 644:
JFolder::create($folder, 0644 );
break;
case 755:
Default:
JFolder::create($folder, 0755 );
break;
}
if (isset($folder)) {
$data = "<html>\n<body
bgcolor=\"#FFFFFF\">\n</body>\n</html>";
JFile::write($folder."/index.html", $data);
} else {
$app->redirect($link,
JText::_('COM_PHOCACART_ERROR_FOLDER_CREATING'));
}
$app->redirect($link,
JText::_('COM_PHOCACART_SUCCESS_FOLDER_CREATING'));
} else {
$app->redirect($link,
JText::_('COM_PHOCACART_ERROR_FOLDER_CREATING_EXISTS'));
}
//JFactory::getApplication()->input->set('folder',
($parent) ? $parent.'/'.$folder : $folder);
}
$app->redirect($link);
}
function multipleupload() {
$result = PhocacartFileUpload::realMultipleUpload();
return true;
}
function upload() {
$result = PhocacartFileUpload::realSingleUpload();
return true;
}
}
PK�"�[�o3��"controllers/phocacartuser.json.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
class PhocaCartCpControllerPhocacartUser extends JControllerForm
{
public function setregion() {
if (!JSession::checkToken('request')) {
$response = array(
'status' => '0',
'error' => '<div class="alert
alert-danger">' . JText::_('JINVALID_TOKEN') .
'</div>');
echo json_encode($response);
exit;
}
$app = JFactory::getApplication();
$id = $app->input->get('countryid', 0, 'int');
//$model = $this->getModel('checkout');
//$options = $model->getRegions($id);
$options = PhocacartRegion::getRegionsByCountry($id);
$o = '';
if(!empty($options)) {
$o .= '<option
value="">- '.JText::_('COM_PHOCACART_SELECT_REGION').' -</option>';
foreach($options as $k => $v) {
$o .= '<option
value="'.$v->id.'">'.htmlspecialchars($v->title).'</option>';
}
}
$response = array(
'status' => '1',
'content' => $o);
echo json_encode($response);
exit;
}
}
?>PK�"�[��)t7'7'controllers/phocacartuser.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartUser extends
PhocaCartCpControllerPhocaCartCommon {
public function save($key = null, $urlVar = null)
{
// Check for request forgeries.
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$app = JFactory::getApplication();
$lang = JFactory::getLanguage();
$model = $this->getModel();
$table = $model->getTable();
$data = $this->input->post->get('jform', array(),
'array');
//$checkin = property_exists($table, 'checked_out');
$context = "$this->option.edit.$this->context";
$task = $this->getTask();
// Determine the name of the primary key for the data.
if (empty($key))
{
$key = $table->getKeyName();
}
// To avoid data collisions the urlVar may be different from the primary
key.
if (empty($urlVar))
{
$urlVar = $key;
}
//$recordId = $this->input->getInt('user_id');
// Populate the row id from the session.
//$data[$key] = $recordId;
$recordId = $data['user_id'];
// The save2copy task needs to be handled slightly differently.
if ($task == 'save2copy')
{
// Check-in the original row.
/*if ($checkin && $model->checkin($data[$key]) === false)
{
// Check-in failed. Go back to the item and display a notice.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED',
$model->getError()));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option .
'&view=' . $this->view_item
. $this->getRedirectToItemAppend($recordId, $urlVar), false
)
);
return false;
}*/
// Reset the ID and then treat the request as for Apply.
$data[$key] = 0;
$task = 'apply';
}
// Access check.
if (!$this->allowSave($data, $key))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option .
'&view=' . $this->view_list
. $this->getRedirectToListAppend(), false
)
);
return false;
}
// Validate the posted data.
// Sometimes the form needs some posted data, such as for plugins and
modules.
/*$form = $model->getForm($data, false);
if (!$form)
{
$app->enqueueMessage($model->getError(), 'error');
return false;
}
// Test whether the data is valid.
/*$validData = $model->validate($form, $data);
// Check for validation errors.
if ($validData === false)
{
// Get the validation messages.
$errors = $model->getErrors();
// Push up to three validation messages out to the user.
for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++)
{
if ($errors[$i] instanceof Exception)
{
$app->enqueueMessage($errors[$i]->getMessage(),
'warning');
}
else
{
$app->enqueueMessage($errors[$i], 'warning');
}
}
// Save the data in the session.
$app->setUserState($context . '.data', $data);
// Redirect back to the edit screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option .
'&view=' . $this->view_item
. $this->getRedirectToItemAppend($recordId, $urlVar), false
)
);
return false;
}
*/
/*if (!isset($validData['tags']))
{
$validData['tags'] = null;
}*/
$validData = $data;
//$error = 0;
if(!empty($data)) {
$data['user_id_phs'] = $data['user_id'];// clone
user id for shipping
// Form Data
$billing = array();
$shipping = array();
foreach($data as $k => $v) {
$pos = strpos($k, '_phs');
if ($pos === false) {
$billing[$k] = $v;
} else {
$k = str_replace('_phs', '', $k);
$shipping[$k] = $v;
}
}
// Form Items
/*$items = PhocacartFormItems::getFormItems(1,1,0);
if(!empty($items)) {
foreach($items as $k => $v) {
if ($v->required == 1) {
if (isset($billing[$v->title]) && $billing[$v->title]
== '') {
$msg = JText::_('COM_PHOCACART_FILL_OUT_THIS_FIELD') .
': '.JText::_($v->label)
. '
<small>('.JText::_('COM_PHOCACART_BILLING_ADDRESS').')</small>';
$app->enqueueMessage($msg, 'error');
$error = 1;
}
// Don't check the shipping as it is not required
if ($item['phcheckoutbsas']) {
$billing['ba_sa'] = 1;
$shipping['ba_sa'] = 1;
// CHECKBOX IS ON
} else {
// CHECKBOX IS OFF
$billing['ba_sa'] = 0;
$shipping['ba_sa'] = 0;
if (isset($shipping[$v->title]) &&
$shipping[$v->title] == '') {
$msg = JText::_('COM_PHOCACART_FILL_OUT_THIS_FIELD') .
': '.JText::_($v->label)
. '
<small>('.JText::_('COM_PHOCACART_SHIPPING_ADDRESS').')</small>';
$app->enqueueMessage($msg, 'error');
$error = 1;
}
}
}
}
} else {
$app->enqueueMessage(JText::_('COM_PHOCACART_ERROR_NO_FORM_LOADED'),
'error');
$error = 1;
}*/
} else {
$this->setRedirect(JRoute::_('index.php?option=' .
$this->option . '&view=' . $this->view_list.
$this->getRedirectToListAppend(), false));
return false;
}
/*if ($error == 1) {
$app->redirect(base64_decode($item['return']));
}*/
if (!empty($billing)) {
//$model = $this->getModel('checkout');
if(!$model->save($billing)) {
$msg = JText::_('COM_PHOCACART_ERROR_DATA_NOT_STORED');
$this->setMessage($msg, 'error');
$this->setRedirect(JRoute::_('index.php?option=' .
$this->option . '&view=' . $this->view_item.
$this->getRedirectToItemAppend($recordId, $urlVar), false));
return false;
} else {
//$msg = JText::_('COM_PHOCACART_SUCCESS_DATA_STORED');
//$app->enqueueMessage($msg, 'success');
// Waiting for shipping
}
//$app->redirect(base64_decode($item['return']));
}
if (!empty($shipping)) {
//$model = $this->getModel('checkout');
if(!$model->save($shipping, 1)) {
$msg = JText::_('COM_PHOCACART_ERROR_DATA_NOT_STORED');
$this->setMessage($msg, 'error');
$this->setRedirect(JRoute::_('index.php?option=' .
$this->option . '&view=' . $this->view_item.
$this->getRedirectToItemAppend($recordId, $urlVar), false));
return false;
} else {
//$msg = JText::_('COM_PHOCACART_SUCCESS_DATA_STORED');
//$app->enqueueMessage($msg, 'success');
// Waiting for shipping
}
//$app->redirect(base64_decode($item['return']));
}
// Remove shipping because shipping methods can change while chaning
address
/*PhocacartShipping::removeShipping();
$msg = JText::_('COM_PHOCACART_SUCCESS_DATA_STORED');
$app->enqueueMessage($msg, 'success');
$app->redirect(base64_decode($item['return']));*/
// Attempt to save the data.
/*if (!$model->save($validData))
{
// Save the data in the session.
$app->setUserState($context . '.data', $validData);
// Redirect back to the edit screen.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED',
$model->getError()));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(JRoute::_('index.php?option=' .
$this->option . '&view=' . $this->view_item.
$this->getRedirectToItemAppend($recordId, $urlVar), false));
return false;
}*/
// Save succeeded, so check-in the record.
/*if ($checkin && $model->checkin($validData[$key]) === false)
{
// Save the data in the session.
$app->setUserState($context . '.data', $validData);
// Check-in failed, so go back to the record and display a notice.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED',
$model->getError()));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option .
'&view=' . $this->view_item
. $this->getRedirectToItemAppend($recordId, $urlVar), false
)
);
return false;
}*/
$this->setMessage(
JText::_(
($lang->hasKey($this->text_prefix . ($recordId == 0 &&
$app->isClient('site') ? '_SUBMIT' : '') .
'_SAVE_SUCCESS')
? $this->text_prefix
: 'JLIB_APPLICATION') . ($recordId == 0 &&
$app->isClient('site') ? '_SUBMIT' : '') .
'_SAVE_SUCCESS'
)
);
// Redirect the user and adjust session state based on the chosen task.
switch ($task)
{
case 'apply':
// Set the record data in the session.
//$recordId = $model->getState($this->context . '.id');
$this->holdEditId($context, $recordId);
$app->setUserState($context . '.data', null);
$model->checkout($recordId);
// Redirect back to the edit screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option .
'&view=' . $this->view_item
. $this->getRedirectToItemAppend($recordId, $urlVar), false
)
);
break;
/*case 'save2new':
// Clear the record id and data from the session.
$this->releaseEditId($context, $recordId);
$app->setUserState($context . '.data', null);
// Redirect back to the edit screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option .
'&view=' . $this->view_item
. $this->getRedirectToItemAppend(null, $urlVar), false
)
);
break;*/
default:
// Clear the record id and data from the session.
$this->releaseEditId($context, $recordId);
$app->setUserState($context . '.data', null);
// Redirect to the list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option .
'&view=' . $this->view_list
. $this->getRedirectToListAppend(), false
)
);
break;
}
// Invoke the postSave method to allow for the child class to access the
model.
$this->postSaveHook($model, $validData);
return true;
}
}
?>
PK�"�[��<��controllers/phocacartusers.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartUsers extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartUser', $prefix =
'PhocaCartCpModel', $config = array()){
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[P���controllers/phocacartvendor.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocaCartVendor extends
PhocaCartCpControllerPhocaCartCommon
{
}
?>
PK�"�[�##�
controllers/phocacartvendors.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartVendors extends
PhocaCartCpControllerPhocaCartCommons
{
public function __construct($config = array()) {
parent::__construct($config);
}
public function &getModel($name = 'PhocaCartVendor', $prefix
= 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[?72��!controllers/phocacartwishlist.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartWishlist extends
PhocaCartCpControllerPhocaCartCommon {}
?>PK�"�[�����"controllers/phocacartwishlists.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartWishlists extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartWishlist',
$prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[�,�8gg$controllers/phocacartwizard.json.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocaCartWizard extends
PhocaCartCpControllerPhocaCartCommon
{
public function skipwizard() {
if (!JSession::checkToken('request')) {
$response = array(
'status' => '0',
'error' => '<span class="ph-result-txt
ph-error-txt">' . JText::_('JINVALID_TOKEN') .
'</span>');
echo json_encode($response);
return;
}
PhocacartUtils::setOptionParameter('enable_wizard', 0);
$response = array('status' => '1');
echo json_encode($response);
return;
}
public function enablewizard() {
if (!JSession::checkToken('request')) {
$response = array(
'status' => '0',
'error' => '<span class="ph-result-txt
ph-error-txt">' . JText::_('JINVALID_TOKEN') .
'</span>');
echo json_encode($response);
return;
}
PhocacartUtils::setWizard(2);
$response = array('status' => '1');
echo json_encode($response);
return;
}
public function updatestatus() {
if (!JSession::checkToken('request')) {
$response = array(
'status' => '0',
'error' => '<span class="ph-result-txt
ph-error-txt">' . JText::_('JINVALID_TOKEN') .
'</span>');
echo json_encode($response);
return;
}
$category = PhocacartUtils::doesExist('category');
$tax = PhocacartUtils::doesExist('tax');
$product = PhocacartUtils::doesExist('product');
$shipping = PhocacartUtils::doesExist('shipping');
$payment = PhocacartUtils::doesExist('payment');
$country = PhocacartUtils::doesExist('country');
$region = PhocacartUtils::doesExist('region');
$menu = PhocacartUtils::doesExist('menu');
$module = PhocacartUtils::doesExist('module');
$option = PhocacartUtils::doesExist('option');
$response = array(
'status' => '1',
'category' => $category,
'tax' => $tax,
'product' => $product,
'shipping' => $shipping,
'payment' => $payment,
'country' => $country,
'region' => $region,
'menu' => $menu,
'module' => $module,
'option' => $option
);
echo json_encode($response);
return;
/*
$app = JFactory::getApplication();
$item = array();
$item['id'] = $this->input->get( 'id', 0,
'int' );
$item['catid'] = $this->input->get( 'catid',
0, 'int' );
$item['return'] = $this->input->get(
'return', '', 'string' );
$item['comparisonview'] = $this->input->get(
'comparisonview', 0, 'int' );
$compare = new PhocacartCompare();
$added = $compare->addItem((int)$item['id'],
(int)$item['catid']);
//$catid =
PhocacartProduct::getCategoryByProductId((int)$item['id']);
$o = $o2 = '';
// Content of the comparison list
ob_start();
echo $compare->renderList();
$o = ob_get_contents();
ob_end_clean();
// Render the layout
$d = array();
$layoutC = new JLayoutFile('popup_add_to_compare', null,
array('component' => 'com_phocacart'));
$d['link_comparison'] =
JRoute::_(PhocacartRoute::getComparisonRoute((int)$item['id']),
(int)$item['catid']);
$d['link_continue'] = '';
// We need to know if module is displayed on comparison site
// If yes and one item will be deleted per AJAX, we need to refresh
comparison site
// If now and one item will be deleted per AJAX, everything is OK,
nothing needs to be refreshed
$d['comparison_view'] =
(int)$item['comparisonview'];
if ($added) {
$d['info_msg'] =
JText::_('COM_PHOCACART_PRODUCT_ADDED_TO_COMPARISON_LIST');
} else {
$d['info_msg'] =
JText::_('COM_PHOCACART_PRODUCT_NOT_ADDED_TO_COMPARISON_LIST');
$mO = PhocacartRenderFront::renderMessageQueue();
$d['info_msg_additional'] = $mO;
}
// Popup with info - Continue,Proceed to Comparison list
//ob_start();
$o2 = $layoutC->render($d);
//$o2 = ob_get_contents();
//ob_end_clean();
$count = $compare->getComapareCountItems();
*/
}
}
?>PK�"�[�W!0�
�
controllers/phocacartwizard.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocaCartWizard extends
PhocaCartCpControllerPhocaCartCommon
{
// WIZARD
// 1 ... automatically opened when there are no items set
// 2 ... force wizard
// 10 ... force wizard page 1 (not the main page)
public function skipwizard() {
$app = JFactory::getApplication();
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
PhocacartUtils::setWizard(0);
$redirect = 'index.php?option=com_phocacart';
$app->redirect($redirect);
}
public function enablewizard() {
$app = JFactory::getApplication();
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
PhocacartUtils::setWizard(2);
$redirect = 'index.php?option=com_phocacart';
$app->redirect($redirect);
}
public function backtowizard() {
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$app = JFactory::getApplication();
$taskGroup = $app->input->get('taskgroup', '');
if ($taskGroup != '') {
$this->unlockTable($taskGroup);
}
PhocacartUtils::setWizard(11);
$redirect = 'index.php?option=com_phocacart';
$app->redirect($redirect);
}
public function unlockTable($taskGroup) {
$a = str_replace('phocacart', '', $taskGroup);
$b = ucfirst($a);
$c = 'Phocacart'.strip_tags($b);
$model = $this->getModel($c, 'PhocaCartCpModel');
$context = 'com_phocacart.edit.'.strip_tags($taskGroup);
$table = $model->getTable();
$key = $table->getKeyName();
$recordId = $this->input->getInt($key);
// Attempt to check-in the current record.
if ($recordId)
{
if (property_exists($table, 'checked_out'))
{
if ($model->checkin($recordId) === false)
{
// Check-in failed, go back to the record and display a notice.
/*$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED',
$model->getError()));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option .
'&view=' . $this->view_item
. $this->getRedirectToItemAppend($recordId, $key), false
)
);*/
return false;
}
}
}
// Clean the session data and redirect.
$this->releaseEditId($context, $recordId);
JFactory::getApplication()->setUserState($context . '.data',
null);
return true;
}
}
?>PK�"�[W���controllers/phocacartzone.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartZone extends
PhocaCartCpControllerPhocaCartCommon {
}
?>PK�"�[�4;��controllers/phocacartzones.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartZones extends
PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartZone', $prefix =
'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix,
array('ignore_request' => true));
return $model;
}
}
?>PK�"�[�#o,,help/en-GB/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[#*�JJhelp/en-GB/logo-phoca.pngnu�[����PNG
IHDR�����sBIT��O�oPLTE������������fff���)))��ֹ�����������{{{���JJJ������sss���:::���!!!SSSkkk333ZZZBBB��������������F��� pHYs��~�tEXtSoftwareAdobe
FireworksO�NNIDATx��{�8���0J�m�x������W�4�|G�lw�!�_$˲l����<���=��[%���|�܊��>���b��$W��࿃5�ESZ��n���ݮE��%�+щ��i���4�A�o�n�3�נO��]��
��K�������R �T�R�1��b�a$�G��/FG�JB�ޕ���M�4�4
�m@��:���Bt�h�O�h��3KC��]�i�ᛌ�?����e�H�'�����T|�b��[�%��|5"�@����a�QV�Z��c��~7
DEp0oO]��K9v߹ǟEdžgr�/�q����H=\ـ�`���?�N�^��r�otg�y^�÷�`��ʾ+�tlt>�'Y������Z-���Wū��58��it$�v�R0�܂���� ��G��>��F۫af2���M�v��B��7`���г�E�!�m�r/�����=���'Б�s����4w�w��!<��a]"��H>O�܁�����}��~��4])�F[����V��N��7c�B�lC���Q�g�~��<{�Bb�{�6z{�R�o��ͩ�,vD���t����l��s��|
��g�G��'a�?��Ծ��*' =�g��my2rV�g���X��b�MYE���n49�kK~1�1;����jt]�ob��hq�s"���3;��:f��u�w��5tlv���
�ׁv�vNgqPX�5��)���Ǧf�6r�gv���4��<ӟ����t�q+\�A��q̞��i8��QF;�߅?F����
e�6��;vw����5EH3ZC��~=�'�s��{k������N)������΄�u?�mr�NJS���{bo��,�iL;���_EWe)I���o�=�W�v���-e�(R������a�ѽ{s��V���F���<&�T���s��qL�N���GG�#[����DX�Z5�[�u�(�����������6�W��:�'��twKk�8����xn:�毅_�C�&pr�R�����Q�v��@ϊ��|)|�N�^L����*�#�F�����Kc���$���w_�^e`�am��rn�̟�2��W�Gt����~���-|���:��ڇ�d���tR/��xi���beQ'��e��+�)��;v�|�JG�)&��S�-6��Y���4��ĕ��Cą���>���z6L����whug��ۏoﲛ��[|Dbz{����m7�m�m��'�H)���̟HM�����K���ޫ*����'����&{�Cs��_������v���s�z�i�,1zf��(j�aϓom���R84��^���s�W��n������7ga���X25���0������C|=��a|e�7��v�R�xzz����E({������]�#��@_9�ן��%z��z�r<]E��?O��_kɻu�Õ�3|<�_�ʏ�J���5�Ӣ�~���g� :|q�^��(�V��P����c��U.Q��d��鷈,>������DmP�'��#tY���3u��I~�9r��
t�2�I��E�Ⱦ�I<�S�o��1>B��ގ�h¨^�n��yکu�n���Y-\<��n�@"x�}>����
� ^�ޗ@���U}����ہ]���X\�'}c��Vbt�w
�x/��@�-77m>$���Ԩ3�X�՜e��D�����Iy���6�U��z�F����Oe����_���Q��,��]n(�]*%�~^�;Y5ˏ�ڟ�]��������[�O�:�ؔ����ϑ��d��Zx�x��#��j�"t?������|�^��ѣ
��ű�q�jS1��Q������9���}F��{����N�O�c���gM��uu��8�u%?�?" ��/K�G����t�_�c,+1�{�/Y���d_?L��p+z`��>��-���I��|{6;y�V��w�,�:7W\�n�O�����=�1:������ȹ�d����=f��K�����5�X�{�=;�6���$��rk�w��Eo�Dg��?p�U�.?}&tq�gW�{�\&Ew�i�=���|�:������gi_/]]�\t�l6��Y.���3{����|��)@�I�It��V�.���t7�{;�G
�1���vS��~Һ��:�M!���و��܍��]�
7��k@���mv����A�q�QJ��������vls���Ta�������R�=��[<LP�NL���~�������g�Ӯ� ����Sw�Г�KD�q�V�떌+�#N?�����EWw�7�Z�Q,�!�=NU�����쳢Z������w�֧�EW�N��KPmފ��GD6K�^H�6�bW$^�-c��d��vu�r7o��h1R
0�$?N�.��}�N+�U����u<��-[tu6[��`��1��t)��G~.m][���'IV��O���n�>7:x{�����+R�+��aƞ����r���\Twj�AX���|�^�쭪ĕ�����Ї�vv�=����b�������MFN��ރ�[�W��z���u��tTF*I��U�q��U��z3��ҹ:����`�$X�j�����h�>���R�Ed�*/0xQs���f�<�`��u�ދ-/�#��d� �н)��
:Vڑ��m���b��|W.��y>�vY�6,>�Ց��G���s�9��9�%�L�qg��7���� 7�W9vd����꼟�\�K��*��ǣ�I�F�Hq{�.P<����t��L�۴��xPW�g�i'[h��n�~�����$�k��mrƧ�2���Fo���uz8���^U澬E�.J���5��(��u�*�Y��N���O+U�5��٩��T��]�U����~ �������������|�e-b�abt��x�r����}_���������JJ�����T�u���A�_�[����Nk��>ܵ���z�@%Ip[c��3n��p�6q�VVU��Clj�b�u����m]��ܣ��ȫy�?��4�U�]�}�� �,��I?sש,�
��Cg�0�ٸ��C������qG��b�oڻew��p�����
�b���F���5u惂xm�"��ԓ�LJ&Q�Ɨ��6Wt���Jߴw_yx���﮻k��绀� ���Mm71�J5�XDY��C�b�0�{��m�U�98��{cc�W[��܆+�t3/|��c�١��B�36&���m�ؽ���JXtU�0��]�:����J?=k�O�m��8��G��[2ss���AhS��`�IR�j�9���as
�{$���U����v���^�=Y���}�%����)I�j�*�X�c��z�<���LLy�u�La����)�r���T�B����[�cгq:���W�9D;�d��Ǥ�Wh�����:���8�G�Ycs�L釃�1��r��w��ۇ�d?�Dt����Fh疊���6b��c��n��ݹL%�$��AeTl��b�{xN̵=�����w���}tA�&�����[�;��hk���T����a��
f��~�3�䮮�ug�F_�ޏ��
��w����'�fihV��Z� �ܨ�T��L�{�/�eP�߭�
5Xs�5+�v/�;Z��Q�
�w�}&�Y�4�RwW�����wS���5�Qc,yb�W��y��7~�ot]ɛ���r��l��6�5��Eu��s�*T4�B�[V]6�g���W~}z�g,��l�����T̾���wY��d9"�Z����$��u}��?��G���i[Q�:+��U���I �큼�%g��;��nO,�Y�\�'.^\S�q��St�s��r캑��4���3*Q�j��9��|���·�/�����=/mg�;Ndb���V8���ֵ�;Eճ=��澊���칚*��/Z��F;GǾ�Y���B�c����R�jcxf{Xq��� >���xj���s��;{c���
���
�A5��
��\r�I����}��<��;L}���̤-؇.ԕP9�.�n`Z��2��$�^�1�[�?=L8��W�Y9���_V-�ˑ݂�D�
�ε�����Q9]����ݭ��{��{tJ�u\�M��3��?M��-��P���Nu�<;tx���G�˜RR����9��u�^��1y�.ב��ECE��>�W�H�#�ItU�{�3x��@��ڑc��j�^_����Ln�I*��7
ֵ[r�c�i��n��\+�nZ��;;��vGՈ$Z�����m}H\�y=���{a�����x��3���p�ն��a�V���?*�ځ�V��������Z���J�um�9Y҃4L����e��� ����\%�x�<�@�\wb�)o�W�l~y~�eG7��W�g�[g�
�l�������=Z�k��'�JWg�\|tJV��R�l�{���*�.�B�A:�#���`<Lٱ�
��
�SP���%�IxP;���_{#���_`�Z���S����8g�f�:
Pܯz�'n�U�j�P�|��gv#���QRנ�_u4���ܚMTS]�Q��[�.�)sjW�}�ilT7�:�K��kt���N��<�w�`����v���˳}�`kw��N�/�p��C��<v�X����}�.E���l��ȽF�J���>��&������c���p[�_^_�<�+��ʭsѯ�rw]pM���kָ7�7��1�'���M��f�C���MA%���V��ǯI�ۮyxG�ѫ2�U���-�x�#�ة��,���vb����O;V�`ޱ�s0�����q�}"�#���=oiy
5Z���j}��|�P����a5Xv��*���b���b� }�/bS��Y�M�r�
I�s��
Aue�՞�s}��Vr�$&��y^�\��+�+�n� ��jc_$F��z��nO��Vǽ]��[O+J��ޓ7�_A[疛qh7�.r�Ɏ����� Z~g{��<M2c�;F�Kʾ'�3<�Ы#k!��I�o��?'�aNʯ:��-ۋn��B�`�.�������z�6��y�i�^��_ɮ�$�v�2�����^�S�9[|^%�\�8x�nm�ig��j�1D�S�3�ǬW�:v��O;��P� �~zK=�L��p�ql���N�i��R�(�_Շ|~<��/�{��-�m�]w=��˴�x�O='~`d��N�zc\�T��=x���eIL�{��zB4h��fE�Y;����s^�w1jlx��b??�G<��B�{}�����C�*�>�-|]N���9�'n��M��~b}�Ҙ䕆��D�3R��g�c�S���3��#���Fvt�I�6M��[�����M�+e��k�<9���Z��w�̺�K��G�E#�l��o^�S�e`��-E���}���<���դd�j0���;T;_�+����'{R��w:�c���T�qڽ��=��l���I[�..�����WN�y��[J��X�G�4_���o�0�:��T�y�9Yh7��r��`��{��yW�\�"�KE�
�:�m�s���EYͨ�a:ˤ�@��ނ�}Nz]S�w%ER�y,�8������&6��VD����)��_�0�f\08��璏kFG��ԑ�
�K�s�IM�f�U�µ!�i�q��w����/K�0����yl])�뾇�����k/DȲ(e���V�vHpC�~����u������,#��q�~���>wy)tĮ5��B\�4�;�°���ةs�[o�I�c�gw���R�#j���w���/����D�>��ňr�����;�Q�����,�~�5��e'N��ͮ,�n!�8��`xZ@��
0�ml�R��k�
��/�6ͮ�و�Ru8�t%��_�w�,Q�v�]�M�^��ݖ�G!9r���/+]����=r{1c�3����#��\�d�9M%W�����Г��Tp�Sٸ��2lX�LZv�J�U�G�
]4�|w�ں�ed����6��o�\�}p���cY����8�)��<}E6q��sE>�{���/�����d�IEND�B`�PK�"�[�Z`77
help/en-GB/screen.phocacart.htmlnu�[���<?php
defined('_JEXEC') or die;?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
lang="en_GB" xml:lang="en_GB">
<head>
<title>Phoca Cart</title>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<style type="text/css">
body {
font-family: "Roboto", sans, Arial;
}
</style>
</head>
<body>
<h1>Phoca Cart</h1>
<div style="float:right;margin:10px;"><img
src="logo-phoca.png" alt="" /></div>
<p> </p>
<p> </p>
<div><a
href="https://www.phoca.cz/project/phocacart-joomla-ecommerce"
target="_blank">Phoca Cart Main Site</a></div>
<p> </p>
<h2>Documentation</h2>
<div><a
href="https://www.phoca.cz/documentation/category/116-phoca-cart-component"
target="_blank">Documentation</a></div>
<ul>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/786-features"
target="_blank">Features</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/957-phoca-cart"
target="_blank">Phoca Cart</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/796-screenshots"
target="_blank">Screenshots</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/1038-system-requirements"
target="_blank">System Requirements</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/1037-installation"
target="_blank">Installation</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/807-installing-sample-data"
target="_blank">Installing Sample Data</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/1039-basic-settings"
target="_blank">Basic Settings</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/922-administration"
target="_blank">Administration</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/880-options"
target="_blank">Options</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/828-views"
target="_blank">Views</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/924-tax-management-vat"
target="_blank">Tax Management (VAT)</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/932-stock-management"
target="_blank">Stock Management</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/935-order-statuses"
target="_blank">Order Statuses</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/946-reward-points"
target="_blank">Reward Points</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/990-opening-times"
target="_blank">Opening Times</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/986-icons-labels-and-tags"
target="_blank">Icons, Labels and Tags</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/966-sending-emails-to-customer-or-vendors"
target="_blank">Sending emails to customer or
vendors</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/980-multilingual-feature"
target="_blank">Multilingual Feature</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/1067-billing"
target="_blank">Billing</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/829-payment-paypal-standard"
target="_blank">Payment - PayPal Standard</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/964-point-of-sale-pos"
target="_blank">Point of Sale (POS)</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/1001-xml-feed-example-google-merchant-feed"
target="_blank">XML Feed - Example - Google Merchant
Feed</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/920-examples-of-use-cases"
target="_blank">Examples Of Use Cases</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/939-phoca-cart-development"
target="_blank">Phoca Cart - Development</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/995-phoca-cart-template-overrides"
target="_blank">Phoca Cart - Template
Overrides</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/989-setting-up-phoca-cart-and-gantry-5-template"
target="_blank">Setting Up Phoca Cart and Gantry5
Template</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/1042-setting-up-phoca-cart-and-astroid-template"
target="_blank">Setting Up Phoca Cart and Astroid
Template</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/1070-tips-and-tricks"
target="_blank">Tips and Tricks</a></li>
</ul>
<p> </p>
<h2>Support</h2>
<ul>
<li><a href="https://www.phoca.cz/forum"
target="_blank">Phoca Forum</a></li>
<li><a href="https://www.phoca.cz/forum/app.php/feed"
target="_blank">Phoca Forum RSS</a></li>
</ul>
<p> </p>
<h2>News</h2>
<ul>
<li><a href="https://www.phoca.cz/news"
target="_blank">Phoca News</a></li>
<li><a
href="https://www.phoca.cz/news?format=feed&type=rss"
target="_blank">Phoca News RSS</a></li>
<li><a
href="https://www.phoca.cz/download/feed/111?format=feed&type=rss"
target="_blank">Phoca Latest Releases RSS</a></li>
</ul>
<p> </p>
<h2>Demo</h2>
<ul>
<li><a href="https://www.phoca.cz/phocacartdemo/"
target="_blank">Phoca Cart Demo</a></li>
<li><a
href="https://www.phoca.cz/phocacartdemo/premiere/"
target="_blank">Phoca Cart - Phoca Premiere Template
Demo</a></li>
<li><a href="https://www.phoca.cz/stockphoto/"
target="_blank">Phoca Cart Demo - Phoca Stock
Photo</a></li>
<li><a
href="https://www.phoca.cz/phocacartdemo/astroid/"
target="_blank">Phoca Cart - Astroid Framework
Demo</a></li>
<li><a href="https://www.phoca.cz/jtd/"
target="_blank">Joomla! Templates
Directory</a></li>
</ul>
<p> </p>
<h2>Phoca Cart Extensions</h2>
<ul>
<li><a href="https://www.phoca.cz/phocacart-extensions"
target="_blank">Phoca Cart Extensions</a></li>
</ul>
<p> </p>
<p> </p>
<a href="javascript:void(0);"
onclick="javascript:window.close();"><span
class="small">Close window</span></a>
</body>
</html>PK�"�[�#o,,help/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[#*�JJhelp/logo-phoca.pngnu�[����PNG
IHDR�����sBIT��O�oPLTE������������fff���)))��ֹ�����������{{{���JJJ������sss���:::���!!!SSSkkk333ZZZBBB��������������F��� pHYs��~�tEXtSoftwareAdobe
FireworksO�NNIDATx��{�8���0J�m�x������W�4�|G�lw�!�_$˲l����<���=��[%���|�܊��>���b��$W��࿃5�ESZ��n���ݮE��%�+щ��i���4�A�o�n�3�נO��]��
��K�������R �T�R�1��b�a$�G��/FG�JB�ޕ���M�4�4
�m@��:���Bt�h�O�h��3KC��]�i�ᛌ�?����e�H�'�����T|�b��[�%��|5"�@����a�QV�Z��c��~7
DEp0oO]��K9v߹ǟEdžgr�/�q����H=\ـ�`���?�N�^��r�otg�y^�÷�`��ʾ+�tlt>�'Y������Z-���Wū��58��it$�v�R0�܂���� ��G��>��F۫af2���M�v��B��7`���г�E�!�m�r/�����=���'Б�s����4w�w��!<��a]"��H>O�܁�����}��~��4])�F[����V��N��7c�B�lC���Q�g�~��<{�Bb�{�6z{�R�o��ͩ�,vD���t����l��s��|
��g�G��'a�?��Ծ��*' =�g��my2rV�g���X��b�MYE���n49�kK~1�1;����jt]�ob��hq�s"���3;��:f��u�w��5tlv���
�ׁv�vNgqPX�5��)���Ǧf�6r�gv���4��<ӟ����t�q+\�A��q̞��i8��QF;�߅?F����
e�6��;vw����5EH3ZC��~=�'�s��{k������N)������΄�u?�mr�NJS���{bo��,�iL;���_EWe)I���o�=�W�v���-e�(R������a�ѽ{s��V���F���<&�T���s��qL�N���GG�#[����DX�Z5�[�u�(�����������6�W��:�'��twKk�8����xn:�毅_�C�&pr�R�����Q�v��@ϊ��|)|�N�^L����*�#�F�����Kc���$���w_�^e`�am��rn�̟�2��W�Gt����~���-|���:��ڇ�d���tR/��xi���beQ'��e��+�)��;v�|�JG�)&��S�-6��Y���4��ĕ��Cą���>���z6L����whug��ۏoﲛ��[|Dbz{����m7�m�m��'�H)���̟HM�����K���ޫ*����'����&{�Cs��_������v���s�z�i�,1zf��(j�aϓom���R84��^���s�W��n������7ga���X25���0������C|=��a|e�7��v�R�xzz����E({������]�#��@_9�ן��%z��z�r<]E��?O��_kɻu�Õ�3|<�_�ʏ�J���5�Ӣ�~���g� :|q�^��(�V��P����c��U.Q��d��鷈,>������DmP�'��#tY���3u��I~�9r��
t�2�I��E�Ⱦ�I<�S�o��1>B��ގ�h¨^�n��yکu�n���Y-\<��n�@"x�}>����
� ^�ޗ@���U}����ہ]���X\�'}c��Vbt�w
�x/��@�-77m>$���Ԩ3�X�՜e��D�����Iy���6�U��z�F����Oe����_���Q��,��]n(�]*%�~^�;Y5ˏ�ڟ�]��������[�O�:�ؔ����ϑ��d��Zx�x��#��j�"t?������|�^��ѣ
��ű�q�jS1��Q������9���}F��{����N�O�c���gM��uu��8�u%?�?" ��/K�G����t�_�c,+1�{�/Y���d_?L��p+z`��>��-���I��|{6;y�V��w�,�:7W\�n�O�����=�1:������ȹ�d����=f��K�����5�X�{�=;�6���$��rk�w��Eo�Dg��?p�U�.?}&tq�gW�{�\&Ew�i�=���|�:������gi_/]]�\t�l6��Y.���3{����|��)@�I�It��V�.���t7�{;�G
�1���vS��~Һ��:�M!���و��܍��]�
7��k@���mv����A�q�QJ��������vls���Ta�������R�=��[<LP�NL���~�������g�Ӯ� ����Sw�Г�KD�q�V�떌+�#N?�����EWw�7�Z�Q,�!�=NU�����쳢Z������w�֧�EW�N��KPmފ��GD6K�^H�6�bW$^�-c��d��vu�r7o��h1R
0�$?N�.��}�N+�U����u<��-[tu6[��`��1��t)��G~.m][���'IV��O���n�>7:x{�����+R�+��aƞ����r���\Twj�AX���|�^�쭪ĕ�����Ї�vv�=����b�������MFN��ރ�[�W��z���u��tTF*I��U�q��U��z3��ҹ:����`�$X�j�����h�>���R�Ed�*/0xQs���f�<�`��u�ދ-/�#��d� �н)��
:Vڑ��m���b��|W.��y>�vY�6,>�Ց��G���s�9��9�%�L�qg��7���� 7�W9vd����꼟�\�K��*��ǣ�I�F�Hq{�.P<����t��L�۴��xPW�g�i'[h��n�~�����$�k��mrƧ�2���Fo���uz8���^U澬E�.J���5��(��u�*�Y��N���O+U�5��٩��T��]�U����~ �������������|�e-b�abt��x�r����}_���������JJ�����T�u���A�_�[����Nk��>ܵ���z�@%Ip[c��3n��p�6q�VVU��Clj�b�u����m]��ܣ��ȫy�?��4�U�]�}�� �,��I?sש,�
��Cg�0�ٸ��C������qG��b�oڻew��p�����
�b���F���5u惂xm�"��ԓ�LJ&Q�Ɨ��6Wt���Jߴw_yx���﮻k��绀� ���Mm71�J5�XDY��C�b�0�{��m�U�98��{cc�W[��܆+�t3/|��c�١��B�36&���m�ؽ���JXtU�0��]�:����J?=k�O�m��8��G��[2ss���AhS��`�IR�j�9���as
�{$���U����v���^�=Y���}�%����)I�j�*�X�c��z�<���LLy�u�La����)�r���T�B����[�cгq:���W�9D;�d��Ǥ�Wh�����:���8�G�Ycs�L釃�1��r��w��ۇ�d?�Dt����Fh疊���6b��c��n��ݹL%�$��AeTl��b�{xN̵=�����w���}tA�&�����[�;��hk���T����a��
f��~�3�䮮�ug�F_�ޏ��
��w����'�fihV��Z� �ܨ�T��L�{�/�eP�߭�
5Xs�5+�v/�;Z��Q�
�w�}&�Y�4�RwW�����wS���5�Qc,yb�W��y��7~�ot]ɛ���r��l��6�5��Eu��s�*T4�B�[V]6�g���W~}z�g,��l�����T̾���wY��d9"�Z����$��u}��?��G���i[Q�:+��U���I �큼�%g��;��nO,�Y�\�'.^\S�q��St�s��r캑��4���3*Q�j��9��|���·�/�����=/mg�;Ndb���V8���ֵ�;Eճ=��澊���칚*��/Z��F;GǾ�Y���B�c����R�jcxf{Xq��� >���xj���s��;{c���
���
�A5��
��\r�I����}��<��;L}���̤-؇.ԕP9�.�n`Z��2��$�^�1�[�?=L8��W�Y9���_V-�ˑ݂�D�
�ε�����Q9]����ݭ��{��{tJ�u\�M��3��?M��-��P���Nu�<;tx���G�˜RR����9��u�^��1y�.ב��ECE��>�W�H�#�ItU�{�3x��@��ڑc��j�^_����Ln�I*��7
ֵ[r�c�i��n��\+�nZ��;;��vGՈ$Z�����m}H\�y=���{a�����x��3���p�ն��a�V���?*�ځ�V��������Z���J�um�9Y҃4L����e��� ����\%�x�<�@�\wb�)o�W�l~y~�eG7��W�g�[g�
�l�������=Z�k��'�JWg�\|tJV��R�l�{���*�.�B�A:�#���`<Lٱ�
��
�SP���%�IxP;���_{#���_`�Z���S����8g�f�:
Pܯz�'n�U�j�P�|��gv#���QRנ�_u4���ܚMTS]�Q��[�.�)sjW�}�ilT7�:�K��kt���N��<�w�`����v���˳}�`kw��N�/�p��C��<v�X����}�.E���l��ȽF�J���>��&������c���p[�_^_�<�+��ʭsѯ�rw]pM���kָ7�7��1�'���M��f�C���MA%���V��ǯI�ۮyxG�ѫ2�U���-�x�#�ة��,���vb����O;V�`ޱ�s0�����q�}"�#���=oiy
5Z���j}��|�P����a5Xv��*���b���b� }�/bS��Y�M�r�
I�s��
Aue�՞�s}��Vr�$&��y^�\��+�+�n� ��jc_$F��z��nO��Vǽ]��[O+J��ޓ7�_A[疛qh7�.r�Ɏ����� Z~g{��<M2c�;F�Kʾ'�3<�Ы#k!��I�o��?'�aNʯ:��-ۋn��B�`�.�������z�6��y�i�^��_ɮ�$�v�2�����^�S�9[|^%�\�8x�nm�ig��j�1D�S�3�ǬW�:v��O;��P� �~zK=�L��p�ql���N�i��R�(�_Շ|~<��/�{��-�m�]w=��˴�x�O='~`d��N�zc\�T��=x���eIL�{��zB4h��fE�Y;����s^�w1jlx��b??�G<��B�{}�����C�*�>�-|]N���9�'n��M��~b}�Ҙ䕆��D�3R��g�c�S���3��#���Fvt�I�6M��[�����M�+e��k�<9���Z��w�̺�K��G�E#�l��o^�S�e`��-E���}���<���դd�j0���;T;_�+����'{R��w:�c���T�qڽ��=��l���I[�..�����WN�y��[J��X�G�4_���o�0�:��T�y�9Yh7��r��`��{��yW�\�"�KE�
�:�m�s���EYͨ�a:ˤ�@��ނ�}Nz]S�w%ER�y,�8������&6��VD����)��_�0�f\08��璏kFG��ԑ�
�K�s�IM�f�U�µ!�i�q��w����/K�0����yl])�뾇�����k/DȲ(e���V�vHpC�~����u������,#��q�~���>wy)tĮ5��B\�4�;�°���ةs�[o�I�c�gw���R�#j���w���/����D�>��ňr�����;�Q�����,�~�5��e'N��ͮ,�n!�8��`xZ@��
0�ml�R��k�
��/�6ͮ�و�Ru8�t%��_�w�,Q�v�]�M�^��ݖ�G!9r���/+]����=r{1c�3����#��\�d�9M%W�����Г��Tp�Sٸ��2lX�LZv�J�U�G�
]4�|w�ں�ed����6��o�\�}p���cY����8�)��<}E6q��sE>�{���/�����d�IEND�B`�PK�"�[�Z`77help/screen.phocacart.htmlnu�[���<?php
defined('_JEXEC') or die;?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
lang="en_GB" xml:lang="en_GB">
<head>
<title>Phoca Cart</title>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<style type="text/css">
body {
font-family: "Roboto", sans, Arial;
}
</style>
</head>
<body>
<h1>Phoca Cart</h1>
<div style="float:right;margin:10px;"><img
src="logo-phoca.png" alt="" /></div>
<p> </p>
<p> </p>
<div><a
href="https://www.phoca.cz/project/phocacart-joomla-ecommerce"
target="_blank">Phoca Cart Main Site</a></div>
<p> </p>
<h2>Documentation</h2>
<div><a
href="https://www.phoca.cz/documentation/category/116-phoca-cart-component"
target="_blank">Documentation</a></div>
<ul>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/786-features"
target="_blank">Features</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/957-phoca-cart"
target="_blank">Phoca Cart</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/796-screenshots"
target="_blank">Screenshots</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/1038-system-requirements"
target="_blank">System Requirements</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/1037-installation"
target="_blank">Installation</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/807-installing-sample-data"
target="_blank">Installing Sample Data</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/1039-basic-settings"
target="_blank">Basic Settings</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/922-administration"
target="_blank">Administration</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/880-options"
target="_blank">Options</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/828-views"
target="_blank">Views</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/924-tax-management-vat"
target="_blank">Tax Management (VAT)</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/932-stock-management"
target="_blank">Stock Management</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/935-order-statuses"
target="_blank">Order Statuses</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/946-reward-points"
target="_blank">Reward Points</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/990-opening-times"
target="_blank">Opening Times</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/986-icons-labels-and-tags"
target="_blank">Icons, Labels and Tags</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/966-sending-emails-to-customer-or-vendors"
target="_blank">Sending emails to customer or
vendors</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/980-multilingual-feature"
target="_blank">Multilingual Feature</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/1067-billing"
target="_blank">Billing</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/829-payment-paypal-standard"
target="_blank">Payment - PayPal Standard</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/964-point-of-sale-pos"
target="_blank">Point of Sale (POS)</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/1001-xml-feed-example-google-merchant-feed"
target="_blank">XML Feed - Example - Google Merchant
Feed</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/920-examples-of-use-cases"
target="_blank">Examples Of Use Cases</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/939-phoca-cart-development"
target="_blank">Phoca Cart - Development</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/995-phoca-cart-template-overrides"
target="_blank">Phoca Cart - Template
Overrides</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/989-setting-up-phoca-cart-and-gantry-5-template"
target="_blank">Setting Up Phoca Cart and Gantry5
Template</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/1042-setting-up-phoca-cart-and-astroid-template"
target="_blank">Setting Up Phoca Cart and Astroid
Template</a></li>
<li><a
href="https://www.phoca.cz/documents/116-phoca-cart-component/1070-tips-and-tricks"
target="_blank">Tips and Tricks</a></li>
</ul>
<p> </p>
<h2>Support</h2>
<ul>
<li><a href="https://www.phoca.cz/forum"
target="_blank">Phoca Forum</a></li>
<li><a href="https://www.phoca.cz/forum/app.php/feed"
target="_blank">Phoca Forum RSS</a></li>
</ul>
<p> </p>
<h2>News</h2>
<ul>
<li><a href="https://www.phoca.cz/news"
target="_blank">Phoca News</a></li>
<li><a
href="https://www.phoca.cz/news?format=feed&type=rss"
target="_blank">Phoca News RSS</a></li>
<li><a
href="https://www.phoca.cz/download/feed/111?format=feed&type=rss"
target="_blank">Phoca Latest Releases RSS</a></li>
</ul>
<p> </p>
<h2>Demo</h2>
<ul>
<li><a href="https://www.phoca.cz/phocacartdemo/"
target="_blank">Phoca Cart Demo</a></li>
<li><a
href="https://www.phoca.cz/phocacartdemo/premiere/"
target="_blank">Phoca Cart - Phoca Premiere Template
Demo</a></li>
<li><a href="https://www.phoca.cz/stockphoto/"
target="_blank">Phoca Cart Demo - Phoca Stock
Photo</a></li>
<li><a
href="https://www.phoca.cz/phocacartdemo/astroid/"
target="_blank">Phoca Cart - Astroid Framework
Demo</a></li>
<li><a href="https://www.phoca.cz/jtd/"
target="_blank">Joomla! Templates
Directory</a></li>
</ul>
<p> </p>
<h2>Phoca Cart Extensions</h2>
<ul>
<li><a href="https://www.phoca.cz/phocacart-extensions"
target="_blank">Phoca Cart Extensions</a></li>
</ul>
<p> </p>
<p> </p>
<a href="javascript:void(0);"
onclick="javascript:window.close();"><span
class="small">Close window</span></a>
</body>
</html>PK�"�[(��helpers/associations.phpnu�[���<?php
/**
* @package Joomla.Administrator
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Association\AssociationExtensionHelper;
JTable::addIncludePath(__DIR__ . '/../tables');
/**
* Content associations helper.
*
* @since 3.7.0
*/
class PhocaCartAssociationsHelper extends AssociationExtensionHelper
{
/**
* The extension name
*
* @var array $extension
*
* @since 3.7.0
*/
protected $extension = 'com_phocacart';
/**
* Array of item types
*
* @var array $itemTypes
*
* @since 3.7.0
*/
protected $itemTypes = array('phocacartitem',
'phocacartcategory');
/**
* Has the extension association support
*
* @var boolean $associationsSupport
*
* @since 3.7.0
*/
protected $associationsSupport = true;
/**
* Get the associated items for an item
*
* @param string $typeName The item type
* @param int $id The id of item for which we need the
associated items
*
* @return array
*
* @since 3.7.0
*/
public function getAssociations($typeName, $id)
{
$type = $this->getType($typeName);
$context = 'com_phocacart.item';
$catidField = '';
if ($typeName === 'phocacartcategory') {
$context = 'com_phocacart.category';
$catidField = '';
}
// Get the associations.
$associations = JLanguageAssociations::getAssociations(
$this->extension,
$type['tables']['a'],
$context,
$id,
'id',
'alias',
$catidField
);
return $associations;
}
/**
* Get item information
*
* @param string $typeName The item type
* @param int $id The id of item for which we need the
associated items
*
* @return JTable|null
*
* @since 3.7.0
*/
public function getItem($typeName, $id)
{
if (empty($id))
{
return null;
}
$table = null;
switch ($typeName)
{
case 'phocacartitem':
$table = JTable::getInstance('PhocacartItem',
'Table');
break;
case 'phocacartcategory':
$table = JTable::getInstance('PhocacartCategory',
'Table');
break;
}
if (empty($table))
{
return null;
}
$table->load($id);
return $table;
}
/**
* Get information about the type
*
* @param string $typeName The item type
*
* @return array Array of item types
*
* @since 3.7.0
*/
public function getType($typeName = '')
{
$fields = $this->getFieldsTemplate();
$tables = array();
$joins = array();
$support = $this->getSupportTemplate();
$title = '';
if (in_array($typeName, $this->itemTypes))
{
switch ($typeName)
{
case 'phocacartitem':
$fields['created_user_id'] = false;
$fields['title'] = 'a.title';
$fields['state'] = 'a.published';
$support['state'] = true;
$support['acl'] = true;
$support['checkout'] = true;
$support['category'] = true;
$support['save2copy'] = true;
$tables = array(
'a' => '#__phocacart_products'
);
$title = 'product';
break;
case 'phocacartcategory':
$fields['created_user_id'] = false;
//$fields['created_user_id'] =
'a.created_user_id';
//$fields['ordering'] = 'a.lft';
//$fields['level'] = 'a.level';
$fields['catid'] = '';
$fields['state'] = 'a.published';
$support['state'] = true;
$support['acl'] = true;
$support['checkout'] = true;
$support['level'] = true;
$tables = array(
'a' => '#__phocacart_categories'
);
$title = 'category';
break;
}
}
return array(
'fields' => $fields,
'support' => $support,
'tables' => $tables,
'joins' => $joins,
'title' => $title
);
}
}
PK�"�[�#o,,helpers/html/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[g�cYY"helpers/html/phocacartcategory.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
use Joomla\Utilities\ArrayHelper;
JLoader::register('PhocacartcategoryHelper', JPATH_ADMINISTRATOR
. '/components/com_phocacart/helpers/phocacartcategory.php');
/**
* Contact HTML helper class.
*
* @since 1.6
*/
abstract class JHtmlPhocacartcategory
{
/**
* Get the associated language flags
*
* @param integer $productId The item id to search associations
*
* @return string The language HTML
*
* @throws Exception
*/
public static function association($productId)
{
// Defaults
$html = '';
// Get the associations
if ($associations =
JLanguageAssociations::getAssociations('com_phocacart',
'#__phocacart_categories', 'com_phocacart.category',
$productId, 'id', 'alias', false))
{
foreach ($associations as $tag => $associated)
{
$associations[$tag] = (int) $associated->id;
}
// Get the associated contact items
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('pi.id, pi.title as title')
->select('l.sef as lang_sef, lang_code')
->from('#__phocacart_categories as pi')
//->select('cat.title as category_title')
//->join('LEFT', '#__categories as cat ON
cat.id=c.catid')
->where('pi.id IN (' . implode(',',
array_values($associations)) . ')')
->where('pi.id != ' . $productId)
->join('LEFT', '#__languages as l ON
pi.language=l.lang_code')
->select('l.image')
->select('l.title as language_title');
$db->setQuery($query);
try
{
$items = $db->loadObjectList('id');
}
catch (RuntimeException $e)
{
throw new Exception($e->getMessage(), 500, $e);
}
if ($items)
{
foreach ($items as &$item)
{
$text = strtoupper($item->lang_sef);
$url =
JRoute::_('index.php?option=com_phocacart&task=phocacartcategory.edit&id='
. (int) $item->id);
$tooltip = htmlspecialchars($item->title, ENT_QUOTES,
'UTF-8');// . '<br />' .
JText::sprintf('JCATEGORY_SPRINTF', $item->category_title);
$classes = 'hasPopover label label-association label-' .
$item->lang_sef;
$item->link = '<a href="' . $url . '"
title="' . $item->language_title . '"
class="' . $classes
. '" data-content="' . $tooltip . '"
data-placement="top">'
. $text . '</a>';
}
}
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.popover');
$html = JLayoutHelper::render('joomla.content.associations',
$items);
}
return $html;
}
/**
* Show the featured/not-featured icon.
*
* @param integer $value The featured value.
* @param integer $i Id of the item.
* @param boolean $canChange Whether the value can be changed or not.
*
* @return string The anchor tag to toggle featured/unfeatured contacts.
*
* @since 1.6
*/
/*
public static function featured($value = 0, $i, $canChange = true)
{
// Array of image, task, title, action
$states = array(
0 => array('unfeatured', 'contacts.featured',
'COM_CONTACT_UNFEATURED', 'JGLOBAL_TOGGLE_FEATURED'),
1 => array('featured', 'contacts.unfeatured',
'JFEATURED', 'JGLOBAL_TOGGLE_FEATURED'),
);
$state = ArrayHelper::getValue($states, (int) $value, $states[1]);
$icon = $state[0];
if ($canChange)
{
$html = '<a href="#" onclick="return
listItemTask(\'cb' . $i . '\',\'' . $state[1]
. '\')" class="btn btn-micro hasTooltip'
. ($value == 1 ? ' active' : '') . '"
title="' . Joomla\CMS\HTML\HTMLHelper::_('tooltipText',
$state[3])
. '"><span class="icon-' . $icon .
'" aria-hidden="true"></span></a>';
}
else
{
$html = '<a class="btn btn-micro hasTooltip disabled'
. ($value == 1 ? ' active' : '') . '"
title="'
. Joomla\CMS\HTML\HTMLHelper::_('tooltipText', $state[2]) .
'"><span class="icon-' . $icon . '"
aria-hidden="true"></span></a>';
}
return $html;
}*/
}
PK�"�[
ad,,helpers/html/phocacartitem.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
use Joomla\Utilities\ArrayHelper;
JLoader::register('PhocacartitemHelper', JPATH_ADMINISTRATOR .
'/components/com_phocacart/helpers/phocacartitem.php');
/**
* Contact HTML helper class.
*
* @since 1.6
*/
abstract class JHtmlPhocacartitem
{
/**
* Get the associated language flags
*
* @param integer $productId The item id to search associations
*
* @return string The language HTML
*
* @throws Exception
*/
public static function association($productId)
{
// Defaults
$html = '';
// Get the associations
if ($associations =
JLanguageAssociations::getAssociations('com_phocacart',
'#__phocacart_products', 'com_phocacart.item',
$productId, 'id', 'alias', false)) {
foreach ($associations as $tag => $associated) {
$associations[$tag] = (int) $associated->id;
}
// Get the associated contact items
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('pi.id, pi.title as title')
->select('l.sef as lang_sef, lang_code')
->from('#__phocacart_products as pi')
//->select('cat.title as category_title')
//->join('LEFT', '#__categories as cat ON
cat.id=c.catid')
->where('pi.id IN (' . implode(',',
array_values($associations)) . ')')
->where('pi.id != ' . $productId)
->join('LEFT', '#__languages as l ON
pi.language=l.lang_code')
->select('l.image')
->select('l.title as language_title');
$db->setQuery($query);
try {
$items = $db->loadObjectList('id');
} catch (RuntimeException $e) {
throw new Exception($e->getMessage(), 500, $e);
}
if ($items) {
foreach ($items as &$item) {
$text = strtoupper($item->lang_sef);
$url =
JRoute::_('index.php?option=com_phocacart&task=phocacartitem.edit&id='
. (int) $item->id);
$tooltip = htmlspecialchars($item->title, ENT_QUOTES,
'UTF-8');// . '<br />' .
JText::sprintf('JCATEGORY_SPRINTF', $item->category_title);
$classes = 'hasPopover label label-association label-' .
$item->lang_sef;
$item->link = '<a href="' . $url . '"
title="' . $item->language_title . '"
class="' . $classes
. '" data-content="' . $tooltip . '"
data-placement="top">'
. $text . '</a>';
}
}
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.popover');
$html = JLayoutHelper::render('joomla.content.associations',
$items);
}
return $html;
}
/**
* Show the featured/not-featured icon.
*
* @param integer $value The featured value.
* @param integer $i Id of the item.
* @param boolean $canChange Whether the value can be changed or not.
*
* @return string The anchor tag to toggle featured/unfeatured contacts.
*
* @since 1.6
*/
/*
public static function featured($value = 0, $i, $canChange = true)
{
// Array of image, task, title, action
$states = array(
0 => array('unfeatured', 'contacts.featured',
'COM_CONTACT_UNFEATURED', 'JGLOBAL_TOGGLE_FEATURED'),
1 => array('featured', 'contacts.unfeatured',
'JFEATURED', 'JGLOBAL_TOGGLE_FEATURED'),
);
$state = ArrayHelper::getValue($states, (int) $value, $states[1]);
$icon = $state[0];
if ($canChange)
{
$html = '<a href="#" onclick="return
listItemTask(\'cb' . $i . '\',\'' . $state[1]
. '\')" class="btn btn-micro hasTooltip'
. ($value == 1 ? ' active' : '') . '"
title="' . Joomla\CMS\HTML\HTMLHelper::_('tooltipText',
$state[3])
. '"><span class="icon-' . $icon .
'" aria-hidden="true"></span></a>';
}
else
{
$html = '<a class="btn btn-micro hasTooltip disabled'
. ($value == 1 ? ' active' : '') . '"
title="'
. Joomla\CMS\HTML\HTMLHelper::_('tooltipText', $state[2]) .
'"><span class="icon-' . $icon . '"
aria-hidden="true"></span></a>';
}
return $html;
}*/
}
PK�"�[�#o,,helpers/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��g���helpers/phocacartbulkprices.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocaCartBulkpricesHelper extends PhocaCartCommonHelper
{
}
?>PK�"�[[��$��helpers/phocacartcategories.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocaCartCategoriesHelper extends PhocaCartCommonHelper
{
}
?>PK�"�[��eBBhelpers/phocacartcommon.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
class PhocaCartCommonHelper
{
public static function getActions($t, $id = 0) {
$user = JFactory::getUser();
$result = new JObject;
if (empty($id)) {
$assetName = $t['o'];
} else {
$assetName =
$t['o'].'.'.$t['tasks'].'.'.(int)
$id;
}
$actions = array('core.admin', 'core.manage',
'core.create', 'core.edit',
'core.edit.state', 'core.delete');
foreach ($actions as $action) {
$result->set($action, $user->authorise($action, $assetName));
}
return $result;
}
}
?>PK�"�[q���helpers/phocacartcountries.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocaCartCountriesHelper extends PhocaCartCommonHelper {}
?>PK�"�[�����helpers/phocacartcoupons.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartCouponsHelper extends PhocaCartCommonHelper {}
?>PK�"�[��|�22helpers/phocacartcp.phpnu�[���<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
version 2 or later;
*/
defined('_JEXEC') or die();
class PhocaCartCpHelper
{
public static function getActions()
{
$user = JFactory::getUser();
$result = new JObject;
$assetName = 'com_phocacart';
$actions = array(
'core.admin', 'core.manage',
'core.create', 'core.edit',
'core.edit.state', 'core.delete'
);
foreach ($actions as $action) {
$result->set($action, $user->authorise($action, $assetName));
}
return $result;
}
}PK�"�[
ʬ?��helpers/phocacartcurrencies.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocaCartCurrenciesHelper extends PhocaCartCommonHelper {}
?>PK�"�[�3<��helpers/phocacartdiscounts.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartDiscountsHelper extends PhocaCartCommonHelper {}
?>PK�"�[=���helpers/phocacartdownloads.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartDownloadsHelper extends PhocaCartCommonHelper
{
}
?>PK�"�[.o����helpers/phocacartexports.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocaCartExportsHelper extends PhocaCartCommonHelper
{
}
?>PK�"�[7����helpers/phocacartextensions.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartExtensionsHelper extends PhocaCartCommonHelper
{
}
?>PK�"�[��|b��helpers/phocacartfeeds.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartFeedsHelper extends PhocaCartCommonHelper {}
?>PK�"�[D4׆��helpers/phocacartformfields.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocaCartFormfieldsHelper extends PhocaCartCommonHelper {}
?>PK�"�[ޥ#��helpers/phocacartgroups.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartGroupsHelper extends PhocaCartCommonHelper {}
?>PK�"�[�=WS��helpers/phocacarthits.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocaCartHitsHelper extends PhocaCartCommonHelper
{
}
?>PK�"�[E���helpers/phocacartimports.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocaCartImportsHelper extends PhocaCartCommonHelper
{
}
?>PK�"�[��u���helpers/phocacartitems.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocaCartItemsHelper extends PhocaCartCommonHelper
{
}
?>PK�"�[/iA���helpers/phocacartlogs.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartLogsHelper extends PhocaCartCommonHelper
{
}
?>PK�"�[lζ]��helpers/phocacartmanager.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocaCartManagerHelper extends PhocaCartCommonHelper{}
?>PK�"�[Y©\��"helpers/phocacartmanufacturers.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartManufacturersHelper extends PhocaCartCommonHelper {}
?>PK�"�[Zj����helpers/phocacartorders.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartOrdersHelper extends PhocaCartCommonHelper {}
?>PK�"�[U�4��helpers/phocacartparameters.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartParametersHelper extends PhocaCartCommonHelper {}
?>
PK�"�[�<.��$helpers/phocacartparametervalues.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartParametervaluesHelper extends PhocaCartCommonHelper {}
?>
PK�"�[�}1���helpers/phocacartpayments.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartPaymentsHelper extends PhocaCartCommonHelper {}
?>PK�"�[�C���helpers/phocacartquestions.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocaCartQuestionsHelper extends PhocaCartCommonHelper
{
}
?>PK�"�[�ט��helpers/phocacartregions.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartRegionsHelper extends PhocaCartCommonHelper
{
}
?>PK�"�[��5���helpers/phocacartreports.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartReportsHelper extends PhocaCartCommonHelper
{
}
?>PK�"�[uk!���helpers/phocacartreviews.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartReviewsHelper extends PhocaCartCommonHelper
{
}
?>PK�"�[#����helpers/phocacartrewards.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartRewardsHelper extends PhocaCartCommonHelper {}
?>PK�"�[i�u/��helpers/phocacartsections.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocaCartSectionsHelper extends PhocaCartCommonHelper
{
}
?>PK�"�[�]F4��helpers/phocacartshippings.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartShippingsHelper extends PhocaCartCommonHelper
{
}
?>PK�"�[����#helpers/phocacartspecifications.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartSpecificationsHelper extends PhocaCartCommonHelper{}
?>PK�"�[c�7��helpers/phocacartstatistics.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartStatisticsHelper extends PhocaCartCommonHelper
{
}
?>PK�"�[C�j��helpers/phocacartstatuses.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocaCartStatusesHelper extends PhocaCartCommonHelper {}
?>PK�"�[V^�T��"helpers/phocacartstockstatuses.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartStockStatusesHelper extends PhocaCartCommonHelper {}
?>PK�"�[՚(���
helpers/phocacartsubmititems.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocaCartSubmititemsHelper extends PhocaCartCommonHelper
{
}
?>PK�"�[_)���helpers/phocacarttags.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartTagsHelper extends PhocaCartCommonHelper {}
?>PK�"�[����helpers/phocacarttaxes.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartTaxesHelper extends PhocaCartCommonHelper {}
?>PK�"�[�����helpers/phocacarttimes.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartTimesHelper extends PhocaCartCommonHelper {}
?>PK�"�[K�����helpers/phocacarttools.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocaCartToolsHelper extends PhocaCartCommonHelper
{
}
?>PK�"�[�2v���helpers/phocacartunits.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocaCartUnitsHelper extends PhocaCartCommonHelper
{
}
?>PK�"�[�ѫ���helpers/phocacartusers.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartUsersHelper extends PhocaCartCommonHelper {}
?>PK�"�[�B��helpers/phocacartvendors.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocaCartVendorsHelper extends PhocaCartCommonHelper
{
}
?>PK�"�[��z���helpers/phocacartwishlists.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocaCartWishlistsHelper extends PhocaCartCommonHelper
{
}
?>PK�"�[���~��helpers/phocacartzones.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocacartZonesHelper extends PhocaCartCommonHelper {}
?>PK�"�[�#o,,
index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[V�b::install/index.htmlnu�[���<html><body
style="background-color:
#000;"></body></html>PK�"�[V�b::install/sql/index.htmlnu�[���<html><body
style="background-color:
#000;"></body></html>PK�"�[�7���W�W$install/sql/mysql/countries.utf8.sqlnu�[���--
-------------------------------------------------------------------- --
-- Phoca Cart Regions --
-- -------------------------------------------------------------------- --
-- See documentation on https://www.phoca.cz/
--
-- --
-- Change all prefixes #__ to prefix which is set in your Joomla! site --
-- (e.g. from #__phocacart to jos_phocacart) --
-- Run this SQL queries in your database tool, e.g. in phpMyAdmin --
-- If you have questions, just ask in Phoca Forum --
-- https://www.phoca.cz/forum/
--
-- -------------------------------------------------------------------- --
INSERT INTO `#__phocacart_countries` (`id`, `title`, `alias`, `type`,
`code2`, `code3`, `published`, `checked_out`, `checked_out_time`,
`ordering`, `params`, `language`) VALUES
(1, 'Afghanistan', '', 0, 'AF',
'AFG', 1, 0, '0000-00-00 00:00:00', 1, NULL,
''),
(2, 'Albania', '', 0, 'AL', 'ALB',
1, 0, '0000-00-00 00:00:00', 2, NULL, ''),
(3, 'Algeria', '', 0, 'DZ', 'DZA',
1, 0, '0000-00-00 00:00:00', 3, NULL, ''),
(4, 'American Samoa', '', 0, 'AS',
'ASM', 1, 0, '0000-00-00 00:00:00', 4, NULL,
''),
(5, 'Andorra', '', 0, 'AD', 'AND',
1, 0, '0000-00-00 00:00:00', 5, NULL, ''),
(6, 'Angola', '', 0, 'AO', 'AGO',
1, 0, '0000-00-00 00:00:00', 6, NULL, ''),
(7, 'Anguilla', '', 0, 'AI', 'AIA',
1, 0, '0000-00-00 00:00:00', 7, NULL, ''),
(8, 'Antarctica', '', 0, 'AQ',
'ATA', 1, 0, '0000-00-00 00:00:00', 8, NULL,
''),
(9, 'Antigua and Barbuda', '', 0, 'AG',
'ATG', 1, 0, '0000-00-00 00:00:00', 9, NULL,
''),
(10, 'Argentina', '', 0, 'AR',
'ARG', 1, 0, '0000-00-00 00:00:00', 10, NULL,
''),
(11, 'Armenia', '', 0, 'AM', 'ARM',
1, 0, '0000-00-00 00:00:00', 11, NULL, ''),
(12, 'Aruba', '', 0, 'AW', 'ABW',
1, 0, '0000-00-00 00:00:00', 12, NULL, ''),
(13, 'Australia', '', 0, 'AU',
'AUS', 1, 0, '0000-00-00 00:00:00', 13, NULL,
''),
(14, 'Austria', '', 0, 'AT', 'AUT',
1, 0, '0000-00-00 00:00:00', 14, NULL, ''),
(15, 'Azerbaijan', '', 0, 'AZ',
'AZE', 1, 0, '0000-00-00 00:00:00', 15, NULL,
''),
(16, 'Bahamas', '', 0, 'BS', 'BHS',
1, 0, '0000-00-00 00:00:00', 16, NULL, ''),
(17, 'Bahrain', '', 0, 'BH', 'BHR',
1, 0, '0000-00-00 00:00:00', 17, NULL, ''),
(18, 'Bangladesh', '', 0, 'BD',
'BGD', 1, 0, '0000-00-00 00:00:00', 18, NULL,
''),
(19, 'Barbados', '', 0, 'BB',
'BRB', 1, 0, '0000-00-00 00:00:00', 19, NULL,
''),
(20, 'Belarus', '', 0, 'BY', 'BLR',
1, 0, '0000-00-00 00:00:00', 20, NULL, ''),
(21, 'Belgium', '', 0, 'BE', 'BEL',
1, 0, '0000-00-00 00:00:00', 21, NULL, ''),
(22, 'Belize', '', 0, 'BZ', 'BLZ',
1, 0, '0000-00-00 00:00:00', 22, NULL, ''),
(23, 'Benin', '', 0, 'BJ', 'BEN',
1, 0, '0000-00-00 00:00:00', 23, NULL, ''),
(24, 'Bermuda', '', 0, 'BM', 'BMU',
1, 0, '0000-00-00 00:00:00', 24, NULL, ''),
(25, 'Bhutan', '', 0, 'BT', 'BTN',
1, 0, '0000-00-00 00:00:00', 25, NULL, ''),
(26, 'Bolivia', '', 0, 'BO', 'BOL',
1, 0, '0000-00-00 00:00:00', 26, NULL, ''),
(27, 'Bosnia and Herzegovina', '', 0, 'BA',
'BIH', 1, 0, '0000-00-00 00:00:00', 27, NULL,
''),
(28, 'Botswana', '', 0, 'BW',
'BWA', 1, 0, '0000-00-00 00:00:00', 28, NULL,
''),
(29, 'Bouvet Island', '', 0, 'BV',
'BVT', 1, 0, '0000-00-00 00:00:00', 29, NULL,
''),
(30, 'Brazil', '', 0, 'BR', 'BRA',
1, 0, '0000-00-00 00:00:00', 30, NULL, ''),
(31, 'British Indian Ocean Territory', '', 0,
'IO', 'IOT', 1, 0, '0000-00-00 00:00:00', 31,
NULL, ''),
(32, 'Brunei Darussalam', '', 0, 'BN',
'BRN', 1, 0, '0000-00-00 00:00:00', 32, NULL,
''),
(33, 'Bulgaria', '', 0, 'BG',
'BGR', 1, 0, '0000-00-00 00:00:00', 33, NULL,
''),
(34, 'Burkina Faso', '', 0, 'BF',
'BFA', 1, 0, '0000-00-00 00:00:00', 34, NULL,
''),
(35, 'Burundi', '', 0, 'BI', 'BDI',
1, 0, '0000-00-00 00:00:00', 35, NULL, ''),
(36, 'Cambodia', '', 0, 'KH',
'KHM', 1, 0, '0000-00-00 00:00:00', 36, NULL,
''),
(37, 'Cameroon', '', 0, 'CM',
'CMR', 1, 0, '0000-00-00 00:00:00', 37, NULL,
''),
(38, 'Canada', '', 0, 'CA', 'CAN',
1, 0, '0000-00-00 00:00:00', 38, NULL, ''),
(39, 'Cape Verde', '', 0, 'CV',
'CPV', 1, 0, '0000-00-00 00:00:00', 39, NULL,
''),
(40, 'Cayman Islands', '', 0, 'KY',
'CYM', 1, 0, '0000-00-00 00:00:00', 40, NULL,
''),
(41, 'Central African Republic', '', 0, 'CF',
'CAF', 1, 0, '0000-00-00 00:00:00', 41, NULL,
''),
(42, 'Chad', '', 0, 'TD', 'TCD', 1,
0, '0000-00-00 00:00:00', 42, NULL, ''),
(43, 'Chile', '', 0, 'CL', 'CHL',
1, 0, '0000-00-00 00:00:00', 43, NULL, ''),
(44, 'China', '', 0, 'CN', 'CHN',
1, 0, '0000-00-00 00:00:00', 44, NULL, ''),
(45, 'Christmas Island', '', 0, 'CX',
'CXR', 1, 0, '0000-00-00 00:00:00', 45, NULL,
''),
(46, 'Cocos (Keeling) Islands', '', 0, 'CC',
'CCK', 1, 0, '0000-00-00 00:00:00', 46, NULL,
''),
(47, 'Colombia', '', 0, 'CO',
'COL', 1, 0, '0000-00-00 00:00:00', 47, NULL,
''),
(48, 'Comoros', '', 0, 'KM', 'COM',
1, 0, '0000-00-00 00:00:00', 48, NULL, ''),
(49, 'Congo', '', 0, 'CG', 'COG',
1, 0, '0000-00-00 00:00:00', 49, NULL, ''),
(50, 'Cook Islands', '', 0, 'CK',
'COK', 1, 0, '0000-00-00 00:00:00', 50, NULL,
''),
(51, 'Costa Rica', '', 0, 'CR',
'CRI', 1, 0, '0000-00-00 00:00:00', 51, NULL,
''),
(52, 'Cote D''Ivoire', '', 0, 'CI',
'CIV', 1, 0, '0000-00-00 00:00:00', 52, NULL,
''),
(53, 'Croatia', '', 0, 'HR', 'HRV',
1, 0, '0000-00-00 00:00:00', 53, NULL, ''),
(54, 'Cuba', '', 0, 'CU', 'CUB', 1,
0, '0000-00-00 00:00:00', 54, NULL, ''),
(55, 'Cyprus', '', 0, 'CY', 'CYP',
1, 0, '0000-00-00 00:00:00', 55, NULL, ''),
(56, 'Czech Republic', '', 0, 'CZ',
'CZE', 1, 0, '0000-00-00 00:00:00', 56, NULL,
''),
(57, 'Denmark', '', 0, 'DK', 'DNK',
1, 0, '0000-00-00 00:00:00', 57, NULL, ''),
(58, 'Djibouti', '', 0, 'DJ',
'DJI', 1, 0, '0000-00-00 00:00:00', 58, NULL,
''),
(59, 'Dominica', '', 0, 'DM',
'DMA', 1, 0, '0000-00-00 00:00:00', 59, NULL,
''),
(60, 'Dominican Republic', '', 0, 'DO',
'DOM', 1, 0, '0000-00-00 00:00:00', 60, NULL,
''),
(61, 'East Timor', '', 0, 'TL',
'TLS', 1, 0, '0000-00-00 00:00:00', 61, NULL,
''),
(62, 'Ecuador', '', 0, 'EC', 'ECU',
1, 0, '0000-00-00 00:00:00', 62, NULL, ''),
(63, 'Egypt', '', 0, 'EG', 'EGY',
1, 0, '0000-00-00 00:00:00', 63, NULL, ''),
(64, 'El Salvador', '', 0, 'SV',
'SLV', 1, 0, '0000-00-00 00:00:00', 64, NULL,
''),
(65, 'Equatorial Guinea', '', 0, 'GQ',
'GNQ', 1, 0, '0000-00-00 00:00:00', 65, NULL,
''),
(66, 'Eritrea', '', 0, 'ER', 'ERI',
1, 0, '0000-00-00 00:00:00', 66, NULL, ''),
(67, 'Estonia', '', 0, 'EE', 'EST',
1, 0, '0000-00-00 00:00:00', 67, NULL, ''),
(68, 'Ethiopia', '', 0, 'ET',
'ETH', 1, 0, '0000-00-00 00:00:00', 68, NULL,
''),
(69, 'Falkland Islands (Malvinas)', '', 0,
'FK', 'FLK', 1, 0, '0000-00-00 00:00:00', 69,
NULL, ''),
(70, 'Faroe Islands', '', 0, 'FO',
'FRO', 1, 0, '0000-00-00 00:00:00', 70, NULL,
''),
(71, 'Fiji', '', 0, 'FJ', 'FJI', 1,
0, '0000-00-00 00:00:00', 71, NULL, ''),
(72, 'Finland', '', 0, 'FI', 'FIN',
1, 0, '0000-00-00 00:00:00', 72, NULL, ''),
(74, 'France, Metropolitan', '', 0, 'FR',
'FRA', 1, 0, '0000-00-00 00:00:00', 74, NULL,
''),
(75, 'French Guiana', '', 0, 'GF',
'GUF', 1, 0, '0000-00-00 00:00:00', 75, NULL,
''),
(76, 'French Polynesia', '', 0, 'PF',
'PYF', 1, 0, '0000-00-00 00:00:00', 76, NULL,
''),
(77, 'French Southern Territories', '', 0,
'TF', 'ATF', 1, 0, '0000-00-00 00:00:00', 77,
NULL, ''),
(78, 'Gabon', '', 0, 'GA', 'GAB',
1, 0, '0000-00-00 00:00:00', 78, NULL, ''),
(79, 'Gambia', '', 0, 'GM', 'GMB',
1, 0, '0000-00-00 00:00:00', 79, NULL, ''),
(80, 'Georgia', '', 0, 'GE', 'GEO',
1, 0, '0000-00-00 00:00:00', 80, NULL, ''),
(81, 'Germany', '', 0, 'DE', 'DEU',
1, 0, '0000-00-00 00:00:00', 81, NULL, ''),
(82, 'Ghana', '', 0, 'GH', 'GHA',
1, 0, '0000-00-00 00:00:00', 82, NULL, ''),
(83, 'Gibraltar', '', 0, 'GI',
'GIB', 1, 0, '0000-00-00 00:00:00', 83, NULL,
''),
(84, 'Greece', '', 0, 'GR', 'GRC',
1, 0, '0000-00-00 00:00:00', 84, NULL, ''),
(85, 'Greenland', '', 0, 'GL',
'GRL', 1, 0, '0000-00-00 00:00:00', 85, NULL,
''),
(86, 'Grenada', '', 0, 'GD', 'GRD',
1, 0, '0000-00-00 00:00:00', 86, NULL, ''),
(87, 'Guadeloupe', '', 0, 'GP',
'GLP', 1, 0, '0000-00-00 00:00:00', 87, NULL,
''),
(88, 'Guam', '', 0, 'GU', 'GUM', 1,
0, '0000-00-00 00:00:00', 88, NULL, ''),
(89, 'Guatemala', '', 0, 'GT',
'GTM', 1, 0, '0000-00-00 00:00:00', 89, NULL,
''),
(90, 'Guinea', '', 0, 'GN', 'GIN',
1, 0, '0000-00-00 00:00:00', 90, NULL, ''),
(91, 'Guinea-Bissau', '', 0, 'GW',
'GNB', 1, 0, '0000-00-00 00:00:00', 91, NULL,
''),
(92, 'Guyana', '', 0, 'GY', 'GUY',
1, 0, '0000-00-00 00:00:00', 92, NULL, ''),
(93, 'Haiti', '', 0, 'HT', 'HTI',
1, 0, '0000-00-00 00:00:00', 93, NULL, ''),
(94, 'Heard and Mc Donald Islands', '', 0,
'HM', 'HMD', 1, 0, '0000-00-00 00:00:00', 94,
NULL, ''),
(95, 'Honduras', '', 0, 'HN',
'HND', 1, 0, '0000-00-00 00:00:00', 95, NULL,
''),
(96, 'Hong Kong', '', 0, 'HK',
'HKG', 1, 0, '0000-00-00 00:00:00', 96, NULL,
''),
(97, 'Hungary', '', 0, 'HU', 'HUN',
1, 0, '0000-00-00 00:00:00', 97, NULL, ''),
(98, 'Iceland', '', 0, 'IS', 'ISL',
1, 0, '0000-00-00 00:00:00', 98, NULL, ''),
(99, 'India', '', 0, 'IN', 'IND',
1, 0, '0000-00-00 00:00:00', 99, NULL, ''),
(100, 'Indonesia', '', 0, 'ID',
'IDN', 1, 0, '0000-00-00 00:00:00', 100, NULL,
''),
(101, 'Iran (Islamic Republic of)', '', 0,
'IR', 'IRN', 1, 0, '0000-00-00 00:00:00',
101, NULL, ''),
(102, 'Iraq', '', 0, 'IQ', 'IRQ',
1, 0, '0000-00-00 00:00:00', 102, NULL, ''),
(103, 'Ireland', '', 0, 'IE',
'IRL', 1, 0, '0000-00-00 00:00:00', 103, NULL,
''),
(104, 'Israel', '', 0, 'IL', 'ISR',
1, 0, '0000-00-00 00:00:00', 104, NULL, ''),
(105, 'Italy', '', 0, 'IT', 'ITA',
1, 0, '0000-00-00 00:00:00', 105, NULL, ''),
(106, 'Jamaica', '', 0, 'JM',
'JAM', 1, 0, '0000-00-00 00:00:00', 106, NULL,
''),
(107, 'Japan', '', 0, 'JP', 'JPN',
1, 0, '0000-00-00 00:00:00', 107, NULL, ''),
(108, 'Jordan', '', 0, 'JO', 'JOR',
1, 0, '0000-00-00 00:00:00', 108, NULL, ''),
(109, 'Kazakhstan', '', 0, 'KZ',
'KAZ', 1, 0, '0000-00-00 00:00:00', 109, NULL,
''),
(110, 'Kenya', '', 0, 'KE', 'KEN',
1, 0, '0000-00-00 00:00:00', 110, NULL, ''),
(111, 'Kiribati', '', 0, 'KI',
'KIR', 1, 0, '0000-00-00 00:00:00', 111, NULL,
''),
(112, 'North Korea', '', 0, 'KP',
'PRK', 1, 0, '0000-00-00 00:00:00', 112, NULL,
''),
(113, 'Korea, Republic of', '', 0, 'KR',
'KOR', 1, 0, '0000-00-00 00:00:00', 113, NULL,
''),
(114, 'Kuwait', '', 0, 'KW', 'KWT',
1, 0, '0000-00-00 00:00:00', 114, NULL, ''),
(115, 'Kyrgyzstan', '', 0, 'KG',
'KGZ', 1, 0, '0000-00-00 00:00:00', 115, NULL,
''),
(116, 'Lao People''s Democratic Republic',
'', 0, 'LA', 'LAO', 1, 0, '0000-00-00
00:00:00', 116, NULL, ''),
(117, 'Latvia', '', 0, 'LV', 'LVA',
1, 0, '0000-00-00 00:00:00', 117, NULL, ''),
(118, 'Lebanon', '', 0, 'LB',
'LBN', 1, 0, '0000-00-00 00:00:00', 118, NULL,
''),
(119, 'Lesotho', '', 0, 'LS',
'LSO', 1, 0, '0000-00-00 00:00:00', 119, NULL,
''),
(120, 'Liberia', '', 0, 'LR',
'LBR', 1, 0, '0000-00-00 00:00:00', 120, NULL,
''),
(121, 'Libyan Arab Jamahiriya', '', 0, 'LY',
'LBY', 1, 0, '0000-00-00 00:00:00', 121, NULL,
''),
(122, 'Liechtenstein', '', 0, 'LI',
'LIE', 1, 0, '0000-00-00 00:00:00', 122, NULL,
''),
(123, 'Lithuania', '', 0, 'LT',
'LTU', 1, 0, '0000-00-00 00:00:00', 123, NULL,
''),
(124, 'Luxembourg', '', 0, 'LU',
'LUX', 1, 0, '0000-00-00 00:00:00', 124, NULL,
''),
(125, 'Macau', '', 0, 'MO', 'MAC',
1, 0, '0000-00-00 00:00:00', 125, NULL, ''),
(126, 'FYROM', '', 0, 'MK', 'MKD',
1, 0, '0000-00-00 00:00:00', 126, NULL, ''),
(127, 'Madagascar', '', 0, 'MG',
'MDG', 1, 0, '0000-00-00 00:00:00', 127, NULL,
''),
(128, 'Malawi', '', 0, 'MW', 'MWI',
1, 0, '0000-00-00 00:00:00', 128, NULL, ''),
(129, 'Malaysia', '', 0, 'MY',
'MYS', 1, 0, '0000-00-00 00:00:00', 129, NULL,
''),
(130, 'Maldives', '', 0, 'MV',
'MDV', 1, 0, '0000-00-00 00:00:00', 130, NULL,
''),
(131, 'Mali', '', 0, 'ML', 'MLI',
1, 0, '0000-00-00 00:00:00', 131, NULL, ''),
(132, 'Malta', '', 0, 'MT', 'MLT',
1, 0, '0000-00-00 00:00:00', 132, NULL, ''),
(133, 'Marshall Islands', '', 0, 'MH',
'MHL', 1, 0, '0000-00-00 00:00:00', 133, NULL,
''),
(134, 'Martinique', '', 0, 'MQ',
'MTQ', 1, 0, '0000-00-00 00:00:00', 134, NULL,
''),
(135, 'Mauritania', '', 0, 'MR',
'MRT', 1, 0, '0000-00-00 00:00:00', 135, NULL,
''),
(136, 'Mauritius', '', 0, 'MU',
'MUS', 1, 0, '0000-00-00 00:00:00', 136, NULL,
''),
(137, 'Mayotte', '', 0, 'YT',
'MYT', 1, 0, '0000-00-00 00:00:00', 137, NULL,
''),
(138, 'Mexico', '', 0, 'MX', 'MEX',
1, 0, '0000-00-00 00:00:00', 138, NULL, ''),
(139, 'Micronesia, Federated States of', '', 0,
'FM', 'FSM', 1, 0, '0000-00-00 00:00:00',
139, NULL, ''),
(140, 'Moldova, Republic of', '', 0, 'MD',
'MDA', 1, 0, '0000-00-00 00:00:00', 140, NULL,
''),
(141, 'Monaco', '', 0, 'MC', 'MCO',
1, 0, '0000-00-00 00:00:00', 141, NULL, ''),
(142, 'Mongolia', '', 0, 'MN',
'MNG', 1, 0, '0000-00-00 00:00:00', 142, NULL,
''),
(143, 'Montserrat', '', 0, 'MS',
'MSR', 1, 0, '0000-00-00 00:00:00', 143, NULL,
''),
(144, 'Morocco', '', 0, 'MA',
'MAR', 1, 0, '0000-00-00 00:00:00', 144, NULL,
''),
(145, 'Mozambique', '', 0, 'MZ',
'MOZ', 1, 0, '0000-00-00 00:00:00', 145, NULL,
''),
(146, 'Myanmar', '', 0, 'MM',
'MMR', 1, 0, '0000-00-00 00:00:00', 146, NULL,
''),
(147, 'Namibia', '', 0, 'NA',
'NAM', 1, 0, '0000-00-00 00:00:00', 147, NULL,
''),
(148, 'Nauru', '', 0, 'NR', 'NRU',
1, 0, '0000-00-00 00:00:00', 148, NULL, ''),
(149, 'Nepal', '', 0, 'NP', 'NPL',
1, 0, '0000-00-00 00:00:00', 149, NULL, ''),
(150, 'Netherlands', '', 0, 'NL',
'NLD', 1, 0, '0000-00-00 00:00:00', 150, NULL,
''),
(151, 'Netherlands Antilles', '', 0, 'AN',
'ANT', 1, 0, '0000-00-00 00:00:00', 151, NULL,
''),
(152, 'New Caledonia', '', 0, 'NC',
'NCL', 1, 0, '0000-00-00 00:00:00', 152, NULL,
''),
(153, 'New Zealand', '', 0, 'NZ',
'NZL', 1, 0, '0000-00-00 00:00:00', 153, NULL,
''),
(154, 'Nicaragua', '', 0, 'NI',
'NIC', 1, 0, '0000-00-00 00:00:00', 154, NULL,
''),
(155, 'Niger', '', 0, 'NE', 'NER',
1, 0, '0000-00-00 00:00:00', 155, NULL, ''),
(156, 'Nigeria', '', 0, 'NG',
'NGA', 1, 0, '0000-00-00 00:00:00', 156, NULL,
''),
(157, 'Niue', '', 0, 'NU', 'NIU',
1, 0, '0000-00-00 00:00:00', 157, NULL, ''),
(158, 'Norfolk Island', '', 0, 'NF',
'NFK', 1, 0, '0000-00-00 00:00:00', 158, NULL,
''),
(159, 'Northern Mariana Islands', '', 0,
'MP', 'MNP', 1, 0, '0000-00-00 00:00:00',
159, NULL, ''),
(160, 'Norway', '', 0, 'NO', 'NOR',
1, 0, '0000-00-00 00:00:00', 160, NULL, ''),
(161, 'Oman', '', 0, 'OM', 'OMN',
1, 0, '0000-00-00 00:00:00', 161, NULL, ''),
(162, 'Pakistan', '', 0, 'PK',
'PAK', 1, 0, '0000-00-00 00:00:00', 162, NULL,
''),
(163, 'Palau', '', 0, 'PW', 'PLW',
1, 0, '0000-00-00 00:00:00', 163, NULL, ''),
(164, 'Panama', '', 0, 'PA', 'PAN',
1, 0, '0000-00-00 00:00:00', 164, NULL, ''),
(165, 'Papua New Guinea', '', 0, 'PG',
'PNG', 1, 0, '0000-00-00 00:00:00', 165, NULL,
''),
(166, 'Paraguay', '', 0, 'PY',
'PRY', 1, 0, '0000-00-00 00:00:00', 166, NULL,
''),
(167, 'Peru', '', 0, 'PE', 'PER',
1, 0, '0000-00-00 00:00:00', 167, NULL, ''),
(168, 'Philippines', '', 0, 'PH',
'PHL', 1, 0, '0000-00-00 00:00:00', 168, NULL,
''),
(169, 'Pitcairn', '', 0, 'PN',
'PCN', 1, 0, '0000-00-00 00:00:00', 169, NULL,
''),
(170, 'Poland', '', 0, 'PL', 'POL',
1, 0, '0000-00-00 00:00:00', 170, NULL, ''),
(171, 'Portugal', '', 0, 'PT',
'PRT', 1, 0, '0000-00-00 00:00:00', 171, NULL,
''),
(172, 'Puerto Rico', '', 0, 'PR',
'PRI', 1, 0, '0000-00-00 00:00:00', 172, NULL,
''),
(173, 'Qatar', '', 0, 'QA', 'QAT',
1, 0, '0000-00-00 00:00:00', 173, NULL, ''),
(174, 'Reunion', '', 0, 'RE',
'REU', 1, 0, '0000-00-00 00:00:00', 174, NULL,
''),
(175, 'Romania', '', 0, 'RO',
'ROM', 1, 0, '0000-00-00 00:00:00', 175, NULL,
''),
(176, 'Russian Federation', '', 0, 'RU',
'RUS', 1, 0, '0000-00-00 00:00:00', 176, NULL,
''),
(177, 'Rwanda', '', 0, 'RW', 'RWA',
1, 0, '0000-00-00 00:00:00', 177, NULL, ''),
(178, 'Saint Kitts and Nevis', '', 0, 'KN',
'KNA', 1, 0, '0000-00-00 00:00:00', 178, NULL,
''),
(179, 'Saint Lucia', '', 0, 'LC',
'LCA', 1, 0, '0000-00-00 00:00:00', 179, NULL,
''),
(180, 'Saint Vincent and the Grenadines', '', 0,
'VC', 'VCT', 1, 0, '0000-00-00 00:00:00',
180, NULL, ''),
(181, 'Samoa', '', 0, 'WS', 'WSM',
1, 0, '0000-00-00 00:00:00', 181, NULL, ''),
(182, 'San Marino', '', 0, 'SM',
'SMR', 1, 0, '0000-00-00 00:00:00', 182, NULL,
''),
(183, 'Sao Tome and Principe', '', 0, 'ST',
'STP', 1, 0, '0000-00-00 00:00:00', 183, NULL,
''),
(184, 'Saudi Arabia', '', 0, 'SA',
'SAU', 1, 0, '0000-00-00 00:00:00', 184, NULL,
''),
(185, 'Senegal', '', 0, 'SN',
'SEN', 1, 0, '0000-00-00 00:00:00', 185, NULL,
''),
(186, 'Seychelles', '', 0, 'SC',
'SYC', 1, 0, '0000-00-00 00:00:00', 186, NULL,
''),
(187, 'Sierra Leone', '', 0, 'SL',
'SLE', 1, 0, '0000-00-00 00:00:00', 187, NULL,
''),
(188, 'Singapore', '', 0, 'SG',
'SGP', 1, 0, '0000-00-00 00:00:00', 188, NULL,
''),
(189, 'Slovak Republic', '', 0, 'SK',
'SVK', 1, 0, '0000-00-00 00:00:00', 189, NULL,
''),
(190, 'Slovenia', '', 0, 'SI',
'SVN', 1, 0, '0000-00-00 00:00:00', 190, NULL,
''),
(191, 'Solomon Islands', '', 0, 'SB',
'SLB', 1, 0, '0000-00-00 00:00:00', 191, NULL,
''),
(192, 'Somalia', '', 0, 'SO',
'SOM', 1, 0, '0000-00-00 00:00:00', 192, NULL,
''),
(193, 'South Africa', '', 0, 'ZA',
'ZAF', 1, 0, '0000-00-00 00:00:00', 193, NULL,
''),
(194, 'South Georgia & South Sandwich Islands',
'', 0, 'GS', 'SGS', 1, 0, '0000-00-00
00:00:00', 194, NULL, ''),
(195, 'Spain', '', 0, 'ES', 'ESP',
1, 0, '0000-00-00 00:00:00', 195, NULL, ''),
(196, 'Sri Lanka', '', 0, 'LK',
'LKA', 1, 0, '0000-00-00 00:00:00', 196, NULL,
''),
(197, 'St. Helena', '', 0, 'SH',
'SHN', 1, 0, '0000-00-00 00:00:00', 197, NULL,
''),
(198, 'St. Pierre and Miquelon', '', 0, 'PM',
'SPM', 1, 0, '0000-00-00 00:00:00', 198, NULL,
''),
(199, 'Sudan', '', 0, 'SD', 'SDN',
1, 0, '0000-00-00 00:00:00', 199, NULL, ''),
(200, 'Suriname', '', 0, 'SR',
'SUR', 1, 0, '0000-00-00 00:00:00', 200, NULL,
''),
(201, 'Svalbard and Jan Mayen Islands', '', 0,
'SJ', 'SJM', 1, 0, '0000-00-00 00:00:00',
201, NULL, ''),
(202, 'Swaziland', '', 0, 'SZ',
'SWZ', 1, 0, '0000-00-00 00:00:00', 202, NULL,
''),
(203, 'Sweden', '', 0, 'SE', 'SWE',
1, 0, '0000-00-00 00:00:00', 203, NULL, ''),
(204, 'Switzerland', '', 0, 'CH',
'CHE', 1, 0, '0000-00-00 00:00:00', 204, NULL,
''),
(205, 'Syrian Arab Republic', '', 0, 'SY',
'SYR', 1, 0, '0000-00-00 00:00:00', 205, NULL,
''),
(206, 'Taiwan', '', 0, 'TW', 'TWN',
1, 0, '0000-00-00 00:00:00', 206, NULL, ''),
(207, 'Tajikistan', '', 0, 'TJ',
'TJK', 1, 0, '0000-00-00 00:00:00', 207, NULL,
''),
(208, 'Tanzania, United Republic of', '', 0,
'TZ', 'TZA', 1, 0, '0000-00-00 00:00:00',
208, NULL, ''),
(209, 'Thailand', '', 0, 'TH',
'THA', 1, 0, '0000-00-00 00:00:00', 209, NULL,
''),
(210, 'Togo', '', 0, 'TG', 'TGO',
1, 0, '0000-00-00 00:00:00', 210, NULL, ''),
(211, 'Tokelau', '', 0, 'TK',
'TKL', 1, 0, '0000-00-00 00:00:00', 211, NULL,
''),
(212, 'Tonga', '', 0, 'TO', 'TON',
1, 0, '0000-00-00 00:00:00', 212, NULL, ''),
(213, 'Trinidad and Tobago', '', 0, 'TT',
'TTO', 1, 0, '0000-00-00 00:00:00', 213, NULL,
''),
(214, 'Tunisia', '', 0, 'TN',
'TUN', 1, 0, '0000-00-00 00:00:00', 214, NULL,
''),
(215, 'Turkey', '', 0, 'TR', 'TUR',
1, 0, '0000-00-00 00:00:00', 215, NULL, ''),
(216, 'Turkmenistan', '', 0, 'TM',
'TKM', 1, 0, '0000-00-00 00:00:00', 216, NULL,
''),
(217, 'Turks and Caicos Islands', '', 0,
'TC', 'TCA', 1, 0, '0000-00-00 00:00:00',
217, NULL, ''),
(218, 'Tuvalu', '', 0, 'TV', 'TUV',
1, 0, '0000-00-00 00:00:00', 218, NULL, ''),
(219, 'Uganda', '', 0, 'UG', 'UGA',
1, 0, '0000-00-00 00:00:00', 219, NULL, ''),
(220, 'Ukraine', '', 0, 'UA',
'UKR', 1, 0, '0000-00-00 00:00:00', 220, NULL,
''),
(221, 'United Arab Emirates', '', 0, 'AE',
'ARE', 1, 0, '0000-00-00 00:00:00', 221, NULL,
''),
(222, 'United Kingdom', '', 0, 'GB',
'GBR', 1, 0, '0000-00-00 00:00:00', 222, NULL,
''),
(223, 'United States', '', 0, 'US',
'USA', 1, 0, '0000-00-00 00:00:00', 223, NULL,
''),
(224, 'United States Minor Outlying Islands', '', 0,
'UM', 'UMI', 1, 0, '0000-00-00 00:00:00',
224, NULL, ''),
(225, 'Uruguay', '', 0, 'UY',
'URY', 1, 0, '0000-00-00 00:00:00', 225, NULL,
''),
(226, 'Uzbekistan', '', 0, 'UZ',
'UZB', 1, 0, '0000-00-00 00:00:00', 226, NULL,
''),
(227, 'Vanuatu', '', 0, 'VU',
'VUT', 1, 0, '0000-00-00 00:00:00', 227, NULL,
''),
(228, 'Vatican City State (Holy See)', '', 0,
'VA', 'VAT', 1, 0, '0000-00-00 00:00:00',
228, NULL, ''),
(229, 'Venezuela', '', 0, 'VE',
'VEN', 1, 0, '0000-00-00 00:00:00', 229, NULL,
''),
(230, 'Viet Nam', '', 0, 'VN',
'VNM', 1, 0, '0000-00-00 00:00:00', 230, NULL,
''),
(231, 'Virgin Islands (British)', '', 0,
'VG', 'VGB', 1, 0, '0000-00-00 00:00:00',
231, NULL, ''),
(232, 'Virgin Islands (U.S.)', '', 0, 'VI',
'VIR', 1, 0, '0000-00-00 00:00:00', 232, NULL,
''),
(233, 'Wallis and Futuna Islands', '', 0,
'WF', 'WLF', 1, 0, '0000-00-00 00:00:00',
233, NULL, ''),
(234, 'Western Sahara', '', 0, 'EH',
'ESH', 1, 0, '0000-00-00 00:00:00', 234, NULL,
''),
(235, 'Yemen', '', 0, 'YE', 'YEM',
1, 0, '0000-00-00 00:00:00', 235, NULL, ''),
(237, 'Democratic Republic of Congo', '', 0,
'CD', 'COD', 1, 0, '0000-00-00 00:00:00',
237, NULL, ''),
(238, 'Zambia', '', 0, 'ZM', 'ZMB',
1, 0, '0000-00-00 00:00:00', 238, NULL, ''),
(239, 'Zimbabwe', '', 0, 'ZW',
'ZWE', 1, 0, '0000-00-00 00:00:00', 239, NULL,
''),
(240, 'Jersey', '', 0, 'JE', 'JEY',
1, 0, '0000-00-00 00:00:00', 240, NULL, ''),
(241, 'Guernsey', '', 0, 'GG',
'GGY', 1, 0, '0000-00-00 00:00:00', 241, NULL,
''),
(242, 'Montenegro', '', 0, 'ME',
'MNE', 1, 0, '0000-00-00 00:00:00', 242, NULL,
''),
(243, 'Serbia', '', 0, 'RS', 'SRB',
1, 0, '0000-00-00 00:00:00', 243, NULL, ''),
(244, 'Aaland Islands', '', 0, 'AX',
'ALA', 1, 0, '0000-00-00 00:00:00', 244, NULL,
''),
(245, 'Bonaire, Sint Eustatius and Saba', '', 0,
'BQ', 'BES', 1, 0, '0000-00-00 00:00:00',
245, NULL, ''),
(246, 'Curacao', '', 0, 'CW',
'CUW', 1, 0, '0000-00-00 00:00:00', 246, NULL,
''),
(247, 'Palestinian Territory', '', 0, 'PS',
'PSE', 1, 0, '0000-00-00 00:00:00', 247, NULL,
''),
(248, 'South Sudan', '', 0, 'SS',
'SSD', 1, 0, '0000-00-00 00:00:00', 248, NULL,
''),
(249, 'St. Barthelemy', '', 0, 'BL',
'BLM', 1, 0, '0000-00-00 00:00:00', 249, NULL,
''),
(250, 'St. Martin (French part)', '', 0,
'MF', 'MAF', 1, 0, '0000-00-00 00:00:00',
250, NULL, ''),
(251, 'Canary Islands', '', 0, 'IC',
'ICA', 1, 0, '0000-00-00 00:00:00', 251, NULL,
'');
-- UTF-8 test:
ä,ö,üPK�"�[V�b::install/sql/mysql/index.htmlnu�[���<html><body
style="background-color:
#000;"></body></html>PK�"�[��tlE�E�"install/sql/mysql/install.utf8.sqlnu�[���--
-------------------------------------------------------------------- --
-- Phoca Cart manual installation --
-- -------------------------------------------------------------------- --
-- See documentation on https://www.phoca.cz/
--
-- --
-- Change all prefixes #__ to prefix which is set in your Joomla! site --
-- (e.g. from #__phocacart to #__phocacart) --
-- Run this SQL queries in your database tool, e.g. in phpMyAdmin --
-- If you have questions, just ask in Phoca Forum --
-- https://www.phoca.cz/forum/
--
-- -------------------------------------------------------------------- --
CREATE TABLE IF NOT EXISTS `#__phocacart_categories` (
`id` int(11) NOT NULL auto_increment,
`parent_id` int(11) NOT NULL DEFAULT '0',
`user_id` int(11) NOT NULL DEFAULT '0',
`vendor_id` int(11) NOT NULL DEFAULT '0',
`owner_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`title_feed` varchar(255) NOT NULL DEFAULT '',
`type` tinyint(3) NOT NULL default '0',
`icon_class` varchar(64) NOT NULL DEFAULT '',
`type_feed` text,
`description` text,
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`created_by` int(11) NOT NULL DEFAULT '0',
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified_by` int(11) NOT NULL DEFAULT '0',
`modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`access` int(11) unsigned NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`count` int(11) NOT NULL DEFAULT '0',
`hits` int(11) NOT NULL DEFAULT '0',
`count_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`count_products` int(11) NOT NULL DEFAULT '0',
`params` text,
`metatitle` varchar(255) NOT NULL DEFAULT '',
`metakey` text,
`metadesc` text,
`metadata` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `cat_idx` (`published`,`access`),
KEY `idx_access` (`access`),
KEY `idx_checkout` (`checked_out`),
KEY `idx_published` (`published`),
KEY `idx_alias` (`alias`),
KEY `idx_language` (`language`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_products` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`catid` int(11) NOT NULL DEFAULT '0',
`tax_id` int(11) NOT NULL DEFAULT '0',
`manufacturer_id` int(11) NOT NULL DEFAULT '0',
`user_id` int(11) NOT NULL DEFAULT '0',
`vendor_id` int(11) NOT NULL DEFAULT '0',
`owner_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`type` tinyint(3) NOT NULL default '0',
`type_feed` text,
`type_category_feed` text,
`description` text,
`description_long` text,
`features` text,
`price` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`price_original` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`length` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0',
`width` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0',
`height` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0',
`unit_size` int(2) NOT NULL DEFAULT '0',
`weight` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0',
`unit_weight` int(2) NOT NULL DEFAULT '0',
`volume` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0',
`unit_volume` int(2) NOT NULL DEFAULT '0',
`stock` int(11) NOT NULL DEFAULT '0',
`stock_calculation` int(11) NOT NULL DEFAULT '0',
`unit_amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`unit_unit` varchar(64) NOT NULL DEFAULT '',
`min_quantity` int(11) NOT NULL DEFAULT '0',
`min_multiple_quantity` int(11) NOT NULL DEFAULT '0',
`min_quantity_calculation` int(11) NOT NULL DEFAULT '0',
`stockstatus_a_id` int(11) NOT NULL DEFAULT '0',
`stockstatus_n_id` int(11) NOT NULL DEFAULT '0',
`availability` text,
`sku` varchar(255) NOT NULL DEFAULT '',
`upc` varchar(15) NOT NULL DEFAULT '',
`ean` varchar(15) NOT NULL DEFAULT '',
`jan` varchar(15) NOT NULL DEFAULT '',
`isbn` varchar(20) NOT NULL DEFAULT '',
`mpn` varchar(255) NOT NULL DEFAULT '',
`serial_number` varchar(255) NOT NULL DEFAULT '',
`registration_key` varchar(255) NOT NULL DEFAULT '',
`external_id` varchar(255) NOT NULL DEFAULT '',
`external_key` varchar(255) NOT NULL DEFAULT '',
`external_link` varchar(255) NOT NULL DEFAULT '',
`external_text` varchar(255) NOT NULL DEFAULT '',
`external_link2` varchar(255) NOT NULL DEFAULT '',
`external_text2` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`video` varchar(255) NOT NULL DEFAULT '',
`public_download_file` varchar(255) NOT NULL DEFAULT '',
`public_download_text` varchar(255) NOT NULL DEFAULT '',
`public_play_file` varchar(255) NOT NULL DEFAULT '',
`public_play_text` varchar(255) NOT NULL DEFAULT '',
`featured` tinyint(1) NOT NULL DEFAULT '0',
`featured_background_image` varchar(255) NOT NULL DEFAULT '',
`allow_upload` tinyint(1) NOT NULL DEFAULT '0',
`custom_text` text,
`download_token` char(64) NOT NULL DEFAULT '',
`download_folder` varchar(255) NOT NULL DEFAULT '',
`download_file` varchar(255) NOT NULL DEFAULT '',
`download_hits` int(11) NOT NULL DEFAULT '0',
`download_days` int(11) NOT NULL DEFAULT '-1',
`condition` tinyint(2) NOT NULL DEFAULT 0,
`delivery_date` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`published` tinyint(1) NOT NULL DEFAULT '0',
`active` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`access` int(11) unsigned NOT NULL DEFAULT '0',
`created_by` int(11) NOT NULL DEFAULT '0',
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified_by` int(11) NOT NULL DEFAULT '0',
`modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`date_update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`hits` int(11) NOT NULL DEFAULT '0',
`sales` int(11) NOT NULL DEFAULT '0',
`points_received` int(11) NOT NULL DEFAULT '0',
`points_needed` int(11) NOT NULL DEFAULT '0',
`params` text,
`params_feed` text,
`gift_types` text,
`metatitle` varchar(255) NOT NULL DEFAULT '',
`metakey` text,
`metadesc` text,
`metadata` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `product_idx` (`published`,`access`),
KEY `idx_price` (`price`),
KEY `idx_access` (`access`),
KEY `idx_checkout` (`checked_out`),
KEY `idx_alias` (`alias`),
KEY `idx_manufacturer` (`manufacturer_id`),
KEY `idx_tax` (`tax_id`),
KEY `stockstatus_a_id` (`stockstatus_a_id`),
KEY `stockstatus_n_id` (`stockstatus_n_id`),
KEY `idx_language` (`language`),
KEY `sales` ( `sales` )
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_product_categories` (
`product_id` int(11) NOT NULL DEFAULT '0',
`category_id` int(11) NOT NULL DEFAULT '0',
`ordering` int(11) NOT NULL DEFAULT '0',
UNIQUE KEY `idx_category` (`product_id`,`category_id`),
KEY `ordering` ( `ordering` )
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_product_featured` (
`product_id` int(11) NOT NULL DEFAULT '0',
`ordering` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`product_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_product_images` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`product_id` int(11) NOT NULL DEFAULT '0',
`image` varchar(255) NOT NULL DEFAULT '',
`type` tinyint(1) NOT NULL DEFAULT '0',
`ordering` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `idx_product` (`product_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_product_files` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`product_id` int(11) NOT NULL DEFAULT '0',
`download_token` char(64) NOT NULL DEFAULT '',
`download_folder` varchar(255) NOT NULL DEFAULT '',
`download_file` varchar(255) NOT NULL DEFAULT '',
`download_hits` int(11) NOT NULL DEFAULT '0',
`download_days` int(11) NOT NULL DEFAULT '-1',
`type` tinyint(1) NOT NULL DEFAULT '0',
`ordering` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `idx_product` (`product_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_product_discounts` (
`id` int(11) NOT NULL auto_increment,
`product_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`code` varchar(255) NOT NULL DEFAULT '',
`discount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`total_amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`calculation_type` tinyint(1) NOT NULL DEFAULT '0',
`valid_from` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`valid_to` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`quantity` int(11) NOT NULL DEFAULT '0',
`quantity_from` int(11) NOT NULL DEFAULT '0',
`quantity_to` int(11) NOT NULL DEFAULT '0',
`available_quantity` int(11) NOT NULL DEFAULT '0',
`available_quantity_user` int(11) NOT NULL DEFAULT '0',
`image` varchar(255) NOT NULL DEFAULT '',
`background_image` varchar(255) NOT NULL DEFAULT '',
`description` text,
`access` int(11) unsigned NOT NULL DEFAULT '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_product_price_groups` (
`id` int(11) NOT NULL auto_increment,
`product_id` int(11) NOT NULL DEFAULT '0',
`group_id` int(11) NOT NULL DEFAULT '0',
`price` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `idx_product` (`product_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_product_point_groups` (
`id` int(11) NOT NULL auto_increment,
`product_id` int(11) NOT NULL DEFAULT '0',
`group_id` int(11) NOT NULL DEFAULT '0',
`points_received` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `idx_product` (`product_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_product_stock` (
`id` int(11) NOT NULL auto_increment,
`product_id` int(11) NOT NULL DEFAULT '0',
`product_key` text,
`attributes` text,
`sku` varchar(255) NOT NULL DEFAULT '',
`ean` varchar(15) NOT NULL DEFAULT '',
`stock` int(11) NOT NULL DEFAULT '0',
`image` varchar(255) NOT NULL DEFAULT '',
`image_small` varchar(255) NOT NULL DEFAULT '',
`image_medium` varchar(255) NOT NULL DEFAULT '',
`operator` char(1) NOT NULL DEFAULT '',
`amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`price` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`active_price` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_product_price_history` (
`id` int(11) NOT NULL auto_increment,
`product_id` int(11) NOT NULL DEFAULT '0',
`bulk_id` int(11) NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`price` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`price_original` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`current_price` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`current_price_original` DECIMAL( 15, 4 ) NOT NULL DEFAULT
'0',
`type` tinyint(1) NOT NULL DEFAULT '0',
`ordering` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_bulk_prices` (
`id` int(11) NOT NULL auto_increment,
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`description` text,
`type` tinyint(1) NOT NULL DEFAULT '0',
`status` tinyint(1) NOT NULL default '0',
`access` int(11) unsigned NOT NULL DEFAULT '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_attributes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`product_id` int(11) NOT NULL,
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`required` tinyint(1) NOT NULL DEFAULT '0',
`type` tinyint(1) NOT NULL DEFAULT '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `idx_product` (`product_id`),
KEY `idx_alias` (`alias`),
KEY `idx_language` (`language`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_attribute_values` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`attribute_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`operator` char(1) NOT NULL DEFAULT '',
`stock` int(11) NOT NULL DEFAULT '0',
`weight` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0',
`operator_weight` char(1) NOT NULL DEFAULT '0',
`volume` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0',
`operator_volume` char(1) NOT NULL DEFAULT '0',
`image` varchar(255) NOT NULL DEFAULT '',
`image_small` varchar(255) NOT NULL DEFAULT '',
`image_medium` varchar(255) NOT NULL DEFAULT '',
`download_token` char(64) NOT NULL DEFAULT '',
`download_folder` varchar(255) NOT NULL DEFAULT '',
`download_file` varchar(255) NOT NULL DEFAULT '',
`download_hits` int(11) NOT NULL DEFAULT '0',
`ordering` int(11) NOT NULL DEFAULT '0',
`language` char(7) NOT NULL DEFAULT '',
`color` varchar(50) NOT NULL DEFAULT '',
`sku` varchar(255) NOT NULL DEFAULT '',
`ean` varchar(15) NOT NULL DEFAULT '',
`type` tinyint(1) NOT NULL DEFAULT '0',
`required` tinyint(1) NOT NULL DEFAULT '0',
`default_value` tinyint(1) NOT NULL DEFAULT '0',
`params` text,
PRIMARY KEY (`id`),
KEY `idx_attribute` (`attribute_id`) ,
KEY `idx_alias` (`alias`),
KEY `idx_language` (`language`)
) DEFAULT CHARSET=utf8;
-- CREATE TABLE IF NOT EXISTS `#__phocacart_product_attributes` (
-- `product_id` int(11) NOT NULL,
-- `attribute_id` int(11) NOT NULL,
-- KEY `idx_product` (`product_id`, `attribute_id`)
-- ) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_specifications` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`product_id` int(11) NOT NULL DEFAULT '0',
`group_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`value` text,
`alias_value` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`image_medium` varchar(255) NOT NULL DEFAULT '',
`image_small` varchar(255) NOT NULL DEFAULT '',
`color` varchar(50) NOT NULL DEFAULT '',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `idx_product` (`product_id`) ,
KEY `idx_group` (`group_id`) ,
KEY `idx_alias` (`alias`),
KEY `idx_alias_value` (`alias_value`),
KEY `idx_language` (`language`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_specification_groups` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `idx_language` (`language`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_product_related` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`product_a` int(11) NOT NULL DEFAULT '0',
`product_b` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `product_a` (`product_a`),
KEY `product_b` (`product_b`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_countries` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`type` int(11) NOT NULL DEFAULT '0',
`code2` varchar(20) NOT NULL DEFAULT '',
`code3` varchar(20) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_regions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`country_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`type` int(11) NOT NULL DEFAULT '0',
`code2` varchar(20) NOT NULL DEFAULT '',
`code3` varchar(20) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_zones` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`type` int(11) NOT NULL DEFAULT '0',
`code2` varchar(20) NOT NULL DEFAULT '',
`code3` varchar(20) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_zone_countries` (
`zone_id` int(11) NOT NULL DEFAULT '0',
`country_id` int(11) NOT NULL DEFAULT '0',
KEY `idx_zonecountry` (`zone_id`, `country_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_zone_regions` (
`zone_id` int(11) NOT NULL DEFAULT '0',
`region_id` int(11) NOT NULL DEFAULT '0',
KEY `idx_zoneregion` (`zone_id`, `region_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_shipping_methods` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`tax_id` int(11) NOT NULL DEFAULT '0',
`cost` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`cost_additional` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`calculation_type` tinyint(1) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`type` tinyint(3) NOT NULL default '0',
`description` text,
`description_info` text,
`tracking_title` varchar(255) NOT NULL DEFAULT '',
`tracking_description` text,
`tracking_link` varchar(255) NOT NULL DEFAULT '',
`lowest_weight` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0',
`highest_weight` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0',
`active_volume` tinyint(1) NOT NULL DEFAULT '0',
`lowest_volume` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0',
`highest_volume` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0',
`active_weight` tinyint(1) NOT NULL DEFAULT '0',
`lowest_amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`highest_amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
-- `lowest_width` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
-- `largest_width` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
-- `lowest_height` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
-- `highest_height` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
-- `longest_length` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
-- `shortest_length` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`active_size` tinyint(1) NOT NULL DEFAULT '0',
`maximal_width` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`maximal_height` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`maximal_length` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`minimal_width` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`minimal_height` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`minimal_length` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`active_quantity` tinyint(1) NOT NULL DEFAULT '0',
`minimal_quantity` int(11) NOT NULL DEFAULT '0',
`maximal_quantity` int(11) NOT NULL DEFAULT '0',
`active_amount` tinyint(1) NOT NULL DEFAULT '0',
`active_country` tinyint(1) NOT NULL DEFAULT '0',
`active_region` tinyint(1) NOT NULL DEFAULT '0',
`active_zone` tinyint(1) NOT NULL DEFAULT '0',
`zip` text,
`active_zip` tinyint(1) NOT NULL DEFAULT '0',
`method` varchar(100) NOT NULL DEFAULT '',
`access` int(11) unsigned NOT NULL DEFAULT '0',
`privacy` tinyint(1) NOT NULL default '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`default` tinyint(1) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
INDEX (`published`),
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_shipping_method_countries` (
`shipping_id` int(11) NOT NULL DEFAULT '0',
`country_id` int(11) NOT NULL DEFAULT '0',
KEY `idx_shipping` (`shipping_id`, `country_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_shipping_method_regions` (
`shipping_id` int(11) NOT NULL DEFAULT '0',
`region_id` int(11) NOT NULL DEFAULT '0',
KEY `idx_shipping` (`shipping_id`, `region_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_shipping_method_zones` (
`shipping_id` int(11) NOT NULL DEFAULT '0',
`zone_id` int(11) NOT NULL DEFAULT '0',
KEY `idx_shipping` (`shipping_id`, `zone_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_manufacturers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`link` varchar(255) NOT NULL DEFAULT '',
`description` text,
`count_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`count_products` int(11) NOT NULL DEFAULT '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `idx_language` (`language`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_stock_statuses` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`title_feed` varchar(255) NOT NULL DEFAULT '',
`link` varchar(255) NOT NULL DEFAULT '',
`link_target` varchar(10) NOT NULL DEFAULT '',
`description` text,
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`type` tinyint(1) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_tags` (
`id` int(11) NOT NULL auto_increment,
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`type` tinyint(1) NOT NULL default '0',
`display_format` tinyint(1) NOT NULL default '0',
`icon_class` varchar(64) NOT NULL DEFAULT '',
`link_ext` varchar(255) NOT NULL DEFAULT '',
`link_cat` int(11) unsigned NOT NULL DEFAULT '0',
`description` text,
`count_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`count_products` int(11) NOT NULL DEFAULT '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
-- `id` SERIAL,
-- PRIMARY KEY (`id`),
CREATE TABLE IF NOT EXISTS `#__phocacart_tags_related` (
`item_id` int(11) NOT NULL DEFAULT '0',
`tag_id` int(11) NOT NULL DEFAULT '0',
UNIQUE KEY `i_tag_id` (`item_id`,`tag_id`)
) DEFAULT CHARSET=utf8;
-- `id` SERIAL,
-- PRIMARY KEY (`id`),
CREATE TABLE IF NOT EXISTS `#__phocacart_taglabels_related` (
`item_id` int(11) NOT NULL DEFAULT '0',
`tag_id` int(11) NOT NULL DEFAULT '0',
UNIQUE KEY `i_taglabel_id` (`item_id`,`tag_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_parameters` (
`id` int(11) NOT NULL auto_increment,
`title` varchar(255) NOT NULL DEFAULT '',
`title_header` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`type` tinyint(1) NOT NULL DEFAULT '0',
`link_type` tinyint(1) NOT NULL DEFAULT '0',
`limit_count` int(11) NOT NULL DEFAULT '0',
`description` text,
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_parameter_values` (
`id` int(11) NOT NULL auto_increment,
`parameter_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`type` tinyint(1) NOT NULL default '0',
`display_format` tinyint(1) NOT NULL default '0',
`icon_class` varchar(64) NOT NULL DEFAULT '',
`link_ext` varchar(255) NOT NULL DEFAULT '',
`link_cat` int(11) unsigned NOT NULL DEFAULT '0',
`description` text,
`count_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`count_products` int(11) NOT NULL DEFAULT '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
-- `id` SERIAL,
-- PRIMARY KEY (`id`),
CREATE TABLE IF NOT EXISTS `#__phocacart_parameter_values_related` (
`item_id` int(11) NOT NULL DEFAULT '0',
`parameter_value_id` int(11) NOT NULL DEFAULT '0',
`parameter_id` int(11) NOT NULL DEFAULT '0',
UNIQUE KEY `i_parameter_id` (`item_id`,`parameter_value_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_taxes` (
`id` int(11) NOT NULL auto_increment,
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`code` varchar(5) NOT NULL DEFAULT '',
`tax_rate` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0',
`calculation_type` tinyint(1) NOT NULL DEFAULT '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_tax_countries` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`tax_id` int(11) NOT NULL DEFAULT '0',
`country_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`tax_rate` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `tax_id` (`tax_id`),
KEY `country_id` (`country_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_tax_regions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`tax_id` int(11) NOT NULL DEFAULT '0',
`region_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`tax_rate` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `tax_id` (`tax_id`),
KEY `region_id` (`region_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_currencies` (
`id` int(11) NOT NULL auto_increment,
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`code` varchar(5) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`exchange_rate` DECIMAL( 15, 8 ) NOT NULL DEFAULT '0',
`price_format` tinyint(1) NOT NULL DEFAULT '0',
`price_currency_symbol` varchar(10) NOT NULL DEFAULT '',
`price_dec_symbol` char(1) NOT NULL DEFAULT '',
`price_decimals` tinyint(1) NOT NULL DEFAULT '0',
`price_thousands_sep` char(1) NOT NULL DEFAULT '',
`price_suffix` varchar(255) NOT NULL DEFAULT '',
`price_prefix` varchar(255) NOT NULL DEFAULT '',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_coupons` (
`id` int(11) NOT NULL auto_increment,
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`code` varchar(255) NOT NULL DEFAULT '',
`discount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`total_amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`calculation_type` tinyint(1) NOT NULL DEFAULT '0',
`free_shipping` tinyint(1) NOT NULL DEFAULT '0',
`free_payment` tinyint(1) NOT NULL DEFAULT '0',
`valid_from` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`valid_to` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`quantity` int(11) NOT NULL DEFAULT '0',
`quantity_from` int(11) NOT NULL DEFAULT '0',
`quantity_to` int(11) NOT NULL DEFAULT '0',
`available_quantity` int(11) NOT NULL DEFAULT '0',
`available_quantity_user` int(11) NOT NULL DEFAULT '0',
`category_filter` tinyint(1) NOT NULL DEFAULT '1',
`product_filter` tinyint(1) NOT NULL DEFAULT '1',
`type` tinyint(1) NOT NULL default '0',
`coupon_type` tinyint(1) NOT NULL default '0',
`description` text,
`gift_title` varchar(255) NOT NULL DEFAULT '',
`gift_description` text,
`gift_image` varchar(255) NOT NULL DEFAULT '',
`gift_recipient_name` varchar(100) NOT NULL default '',
`gift_recipient_email` varchar(50) NOT NULL default '',
`gift_sender_name` varchar(100) NOT NULL default '',
`gift_sender_message` text,
`gift_type` tinyint(1) NOT NULL DEFAULT '-1',
`gift_order_id` int(11) NOT NULL DEFAULT '0',
`gift_product_id` int(11) NOT NULL DEFAULT '0',
`gift_order_product_id` int(11) NOT NULL DEFAULT '0',
`gift_class_name` varchar(50) NOT NULL default '',
`access` int(11) unsigned NOT NULL DEFAULT '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_coupon_count` (
`id` int(11) NOT NULL auto_increment,
`coupon_id` int(11) NOT NULL DEFAULT '0',
`count` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_coupon_count_user` (
`coupon_id` int(11) NOT NULL DEFAULT '0',
`user_id` int(11) NOT NULL DEFAULT '0',
`count` int(11) NOT NULL DEFAULT '0',
KEY `idx_coupon` (`coupon_id`,`user_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_coupon_products` (
`coupon_id` int(11) NOT NULL DEFAULT '0',
`product_id` int(11) NOT NULL DEFAULT '0',
KEY `idx_coupon` (`coupon_id`,`product_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_coupon_categories` (
`coupon_id` int(11) NOT NULL DEFAULT '0',
`category_id` int(11) NOT NULL DEFAULT '0',
KEY `idx_coupon` (`coupon_id`,`category_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_discounts` (
`id` int(11) NOT NULL auto_increment,
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`code` varchar(255) NOT NULL DEFAULT '',
`discount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`total_amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`calculation_type` tinyint(1) NOT NULL DEFAULT '0',
`free_shipping` tinyint(1) NOT NULL DEFAULT '0',
`free_payment` tinyint(1) NOT NULL DEFAULT '0',
`valid_from` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`valid_to` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`quantity` int(11) NOT NULL DEFAULT '0',
`quantity_from` int(11) NOT NULL DEFAULT '0',
`quantity_to` int(11) NOT NULL DEFAULT '0',
`available_quantity` int(11) NOT NULL DEFAULT '0',
`available_quantity_user` int(11) NOT NULL DEFAULT '0',
`category_filter` tinyint(1) NOT NULL DEFAULT '1',
`product_filter` tinyint(1) NOT NULL DEFAULT '1',
`type` tinyint(3) NOT NULL default '0',
`description` text,
`access` int(11) unsigned NOT NULL DEFAULT '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_discount_products` (
`discount_id` int(11) NOT NULL DEFAULT '0',
`product_id` int(11) NOT NULL DEFAULT '0',
KEY `idx_discountproduct` (`discount_id`,`product_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_discount_categories` (
`discount_id` int(11) NOT NULL DEFAULT '0',
`category_id` int(11) NOT NULL DEFAULT '0',
KEY `idx_discountcategory` (`discount_id`,`category_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_payment_methods` (
`id` int(11) NOT NULL auto_increment,
`tax_id` int(11) NOT NULL DEFAULT '0',
`cost` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`cost_additional` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`operator` char(1) NOT NULL DEFAULT '0',
`calculation_type` tinyint(1) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`type` tinyint(3) NOT NULL default '0',
`description` text,
`description_info` text,
`lowest_amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`highest_amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`active_amount` tinyint(1) NOT NULL DEFAULT '0',
`active_country` tinyint(1) NOT NULL DEFAULT '0',
`active_region` tinyint(1) NOT NULL DEFAULT '0',
`active_zone` tinyint(1) NOT NULL DEFAULT '0',
`active_shipping` tinyint(1) NOT NULL DEFAULT '0',
`method` varchar(100) NOT NULL DEFAULT '',
`access` int(11) unsigned NOT NULL DEFAULT '0',
`privacy` tinyint(1) NOT NULL default '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`default` tinyint(1) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_payment_method_countries` (
`payment_id` int(11) NOT NULL DEFAULT '0',
`country_id` int(11) NOT NULL DEFAULT '0',
KEY `idx_payment` (`payment_id`, `country_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_payment_method_regions` (
`payment_id` int(11) NOT NULL DEFAULT '0',
`region_id` int(11) NOT NULL DEFAULT '0',
KEY `idx_payment` (`payment_id`, `region_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_payment_method_zones` (
`payment_id` int(11) NOT NULL DEFAULT '0',
`zone_id` int(11) NOT NULL DEFAULT '0',
KEY `idx_payment` (`payment_id`, `zone_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_payment_method_shipping` (
`payment_id` int(11) NOT NULL DEFAULT '0',
`shipping_id` int(11) NOT NULL DEFAULT '0',
KEY `idx_payment` (`payment_id`, `shipping_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_reviews` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`product_id` int(11) NOT NULL DEFAULT '0',
`user_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`name` varchar(255) NOT NULL DEFAULT '',
`review` text,
`rating` int(1) NOT NULL,
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_form_fields` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(50) NOT NULL DEFAULT '',
`alias` varchar(50) NOT NULL DEFAULT '',
`label` varchar(255) NOT NULL DEFAULT '',
`description` text,
`id_input` varchar(50) NOT NULL DEFAULT '',
`type` varchar(50) NOT NULL DEFAULT '',
`predefined_values` text,
`predefined_values_first_option` varchar(100) NOT NULL DEFAULT
'',
`type_default` tinyint(3) NOT NULL DEFAULT '0',
`default` varchar(255) NOT NULL DEFAULT '',
`size` varchar(50) NOT NULL DEFAULT '',
`cols` varchar(5) NOT NULL DEFAULT '',
`rows` varchar(5) NOT NULL DEFAULT '',
`class` varchar(100) NOT NULL DEFAULT '',
`filter` varchar(25) NOT NULL DEFAULT '',
`read_only` tinyint(1) NOT NULL DEFAULT '0',
`required` tinyint(1) NOT NULL DEFAULT '0',
`validate` varchar(50) NOT NULL DEFAULT '',
`unique` tinyint(1) NOT NULL DEFAULT '0',
`preicon` varchar(100) NOT NULL DEFAULT '',
`format` varchar(50) NOT NULL DEFAULT '',
`pattern` text,
`maxlength` int(11) NOT NULL DEFAULT '0',
`additional` text,
`published` tinyint(1) NOT NULL DEFAULT '0',
`display_billing` tinyint(1) NOT NULL DEFAULT '0',
`display_shipping` tinyint(1) NOT NULL DEFAULT '0',
`display_account` tinyint(1) NOT NULL DEFAULT '0',
`display_docs` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`access` int(11) unsigned NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`type` tinyint(1) NOT NULL DEFAULT '0',
`ba_sa` tinyint(1) NOT NULL DEFAULT '0',
`newsletter` tinyint(1) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`loyalty_card_number` varchar(30) NOT NULL DEFAULT '',
`name_first` varchar(100) NOT NULL DEFAULT '',
`name_middle` varchar(100) NOT NULL DEFAULT '',
`name_last` varchar(100) NOT NULL DEFAULT '',
`name_degree` varchar(100) NOT NULL DEFAULT '',
`company` varchar(255) NOT NULL DEFAULT '',
`vat_1` varchar(25) NOT NULL DEFAULT '',
`vat_2` varchar(25) NOT NULL DEFAULT '',
`vat_valid` tinyint(1) NOT NULL DEFAULT '0',
`address_1` varchar(255) NOT NULL DEFAULT '',
`address_2` varchar(255) NOT NULL DEFAULT '',
`city` varchar(255) NOT NULL DEFAULT '',
`zip` varchar(20) NOT NULL DEFAULT '',
`country` int(11) NOT NULL DEFAULT '0',
`region` int(11) NOT NULL DEFAULT '0',
`email` varchar(100) NOT NULL DEFAULT '',
`email_contact` varchar(100) NOT NULL DEFAULT '',
`phone_1` varchar(20) NOT NULL DEFAULT '',
`phone_2` varchar(20) NOT NULL DEFAULT '',
`phone_mobile` varchar(20) NOT NULL DEFAULT '',
`fax` varchar(20) NOT NULL DEFAULT '',
`privacy` tinyint(1) NOT NULL default '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
/*
CREATE TABLE IF NOT EXISTS `#__phocacart_cart` (
`user_id` int(11) NOT NULL DEFAULT '0',
`cart` text,
`shipping` int(11) NOT NULL DEFAULT '0',
`coupon` int(11) NOT NULL DEFAULT '0',
`payment` int(11) NOT NULL DEFAULT '0',
`reward` int(11) NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`user_id`)
) DEFAULT CHARSET=utf8;
*/
CREATE TABLE IF NOT EXISTS `#__phocacart_cart_multiple` (
`user_id` int(11) NOT NULL DEFAULT '0',
`vendor_id` int(11) NOT NULL DEFAULT '0',
`ticket_id` int(11) NOT NULL DEFAULT '0',
`unit_id` int(11) NOT NULL DEFAULT '0',
`section_id` int(11) NOT NULL DEFAULT '0',
`loyalty_card_number` varchar(30) NOT NULL DEFAULT '',
`cart` text,
`shipping` int(11) NOT NULL DEFAULT '0',
`coupon` int(11) NOT NULL DEFAULT '0',
`payment` int(11) NOT NULL DEFAULT '0',
`reward` int(11) NOT NULL DEFAULT '0',
`type` tinyint(3) NOT NULL default '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
KEY `idx_uvtus` (`user_id`, `vendor_id`, `ticket_id`, `unit_id`,
`section_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_order_statuses` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`description` text,
`stock_movements` char(1) NOT NULL DEFAULT '',
`change_user_group` tinyint(1) NOT NULL DEFAULT '0',
`change_points_needed` tinyint(1) NOT NULL DEFAULT '0',
`change_points_received` tinyint(1) NOT NULL DEFAULT '0',
`email_customer` tinyint(1) NOT NULL DEFAULT '0',
`email_others` text,
`email_text` text,
`email_footer` text,
`email_text_others` text,
`email_attachments` text,
`email_subject` varchar(255) NOT NULL DEFAULT '',
`email_subject_others` varchar(255) NOT NULL DEFAULT '',
`email_send` int(2) NOT NULL DEFAULT '0',
`email_send_format` int(2) NOT NULL DEFAULT '0',
`activate_gift` tinyint(1) NOT NULL DEFAULT '0',
`email_gift` tinyint(1) NOT NULL DEFAULT '0',
`email_subject_gift_sender` varchar(255) NOT NULL DEFAULT '',
`email_text_gift_sender` text,
`email_subject_gift_recipient` varchar(255) NOT NULL DEFAULT
'',
`email_text_gift_recipient` text,
`email_gift_format` tinyint(1) NOT NULL DEFAULT '0',
`orders_view_display` text,
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`params` text,
`type` tinyint(1) NOT NULL DEFAULT '0',
`download` tinyint(1) NOT NULL DEFAULT '0',
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY (`type`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_orders` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_token` char(64) NOT NULL DEFAULT '',
`user_id` int(11) NOT NULL DEFAULT '0',
`group_id` int(11) NOT NULL DEFAULT '0',
`invoice_id` int(11) NOT NULL DEFAULT '0',
`credit_id` int(11) NOT NULL DEFAULT '0',
`status_id` int(11) NOT NULL DEFAULT '0',
`shipping_id` int(11) NOT NULL DEFAULT '0',
`payment_id` int(11) NOT NULL DEFAULT '0',
`coupon_id` int(11) NOT NULL DEFAULT '0',
`discount_id` int(11) NOT NULL DEFAULT '0',
`currency_id` int(11) NOT NULL DEFAULT '0',
`amount_pay` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`amount_tendered` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`amount_change` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`type` tinyint(3) NOT NULL default '0',
`vendor_id` int(11) NOT NULL DEFAULT '0',
`ticket_id` int(11) NOT NULL DEFAULT '0',
`unit_id` int(11) NOT NULL DEFAULT '0',
`section_id` int(11) NOT NULL DEFAULT '0',
`loyalty_card_number` varchar(30) NOT NULL DEFAULT '',
`tax_calculation` int(11) NOT NULL DEFAULT '0',
`currency_code` varchar(5) NOT NULL DEFAULT '',
`currency_exchange_rate` DECIMAL( 15, 8 ) NOT NULL DEFAULT '0',
`unit_weight` varchar(50) NOT NULL DEFAULT '',
`unit_volume` varchar(50) NOT NULL DEFAULT '',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`comment` text,
`ip` varchar(40) NOT NULL DEFAULT '',
`user_agent` varchar(255) NOT NULL DEFAULT '',
`tracking_id` int(11) NOT NULL DEFAULT '0',
`tracking_title` varchar(255) NOT NULL DEFAULT '',
`tracking_description_custom` text,
`tracking_link_custom` varchar(255) NOT NULL DEFAULT '',
`tracking_number` varchar(255) NOT NULL DEFAULT '',
`tracking_date_shipped` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`reference_field1` varchar(128) NOT NULL DEFAULT '',
`reference_field2` varchar(128) NOT NULL DEFAULT '',
`reference_data` text,
`order_number` varchar(64) NOT NULL DEFAULT '',
`receipt_number` varchar(64) NOT NULL DEFAULT '',
`invoice_number` varchar(64) NOT NULL DEFAULT '',
`credit_number` varchar(64) NOT NULL DEFAULT '',
`queue_number` varchar(64) NOT NULL DEFAULT '',
`order_number_id` int(11) NOT NULL DEFAULT '0',
`receipt_number_id` int(11) NOT NULL DEFAULT '0',
`invoice_number_id` int(11) NOT NULL DEFAULT '0',
`credit_number_id` int(11) NOT NULL DEFAULT '0',
`queue_number_id` int(11) NOT NULL DEFAULT '0',
`invoice_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`invoice_due_date` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`invoice_time_of_supply` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`invoice_prn` varchar(64) NOT NULL DEFAULT '',
`required_delivery_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`invoice_spec_top_desc` text,
`invoice_spec_middle_desc` text,
`invoice_spec_bottom_desc` text,
`oidn_spec_billing_desc` text,
`oidn_spec_shipping_desc` text,
`terms` tinyint(1) NOT NULL default '0',
`privacy` tinyint(1) NOT NULL default '0',
`newsletter` tinyint(1) NOT NULL default '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`params` text,
`params_shipping` text,
`params_payment` text,
`user_lang` char(7) NOT NULL DEFAULT '',
`default_lang` char(7) NOT NULL DEFAULT '',
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_order_users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` int(11) NOT NULL DEFAULT '0',
`user_token` char(64) NOT NULL DEFAULT '',
`user_address_id` int(11) NOT NULL DEFAULT '0',
`user_groups` text,
`type` tinyint(1) NOT NULL DEFAULT '0',
`ba_sa` tinyint(1) NOT NULL DEFAULT '0',
`name_first` varchar(100) NOT NULL DEFAULT '',
`name_middle` varchar(100) NOT NULL DEFAULT '',
`name_last` varchar(100) NOT NULL DEFAULT '',
`name_degree` varchar(100) NOT NULL DEFAULT '',
`company` varchar(255) NOT NULL DEFAULT '',
`vat_1` varchar(25) NOT NULL DEFAULT '',
`vat_2` varchar(25) NOT NULL DEFAULT '',
`address_1` varchar(255) NOT NULL DEFAULT '',
`address_2` varchar(255) NOT NULL DEFAULT '',
`city` varchar(255) NOT NULL DEFAULT '',
`zip` varchar(20) NOT NULL DEFAULT '',
`country` int(11) NOT NULL DEFAULT '0',
`region` int(11) NOT NULL DEFAULT '0',
`email` varchar(100) NOT NULL DEFAULT '',
`email_contact` varchar(100) NOT NULL DEFAULT '',
`phone_1` varchar(20) NOT NULL DEFAULT '',
`phone_2` varchar(20) NOT NULL DEFAULT '',
`phone_mobile` varchar(20) NOT NULL DEFAULT '',
`fax` varchar(20) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `order_id` (`order_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_order_products` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` int(11) NOT NULL DEFAULT '0',
`product_id` int(11) NOT NULL DEFAULT '0',
`category_id` int(11) NOT NULL DEFAULT '0',
`owner_id` int(11) NOT NULL DEFAULT '0',
`product_id_key` text,
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`sku` varchar(255) NOT NULL DEFAULT '',
`netto` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`tax` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`brutto` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`dnetto` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`dtax` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`dbrutto` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`dtype` int(11) NOT NULL DEFAULT '0',
`damount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`stock_calculation` int(11) NOT NULL DEFAULT '0',
`quantity` int(11) NOT NULL DEFAULT '0',
`weight` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0',
`volume` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0',
`points_received` int(11) NOT NULL DEFAULT '0',
`points_needed` int(11) NOT NULL DEFAULT '0',
`default_price` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0',
`default_tax_rate` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0',
`default_tax_id` int(11) NOT NULL DEFAULT '0',
`default_tax_id_c` int(11) NOT NULL DEFAULT '0',
`default_tax_id_r` int(11) NOT NULL DEFAULT '0',
`default_calculation_type` tinyint(1) NOT NULL DEFAULT '0',
`default_points_received` int(11) NOT NULL DEFAULT '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `order_id` (`order_id`),
KEY `product_id` (`product_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_order_attributes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` int(11) NOT NULL DEFAULT '0',
`product_id` int(11) NOT NULL DEFAULT '0',
`order_product_id` int(11) NOT NULL DEFAULT '0',
`attribute_id` int(11) NOT NULL DEFAULT '0',
`option_id` int(11) NOT NULL DEFAULT '0',
`attribute_title` varchar(255) NOT NULL DEFAULT '',
`option_title` varchar(255) NOT NULL DEFAULT '',
`type` tinyint(1) NOT NULL DEFAULT '0',
`option_value` text,
PRIMARY KEY (`id`),
KEY `order_id` (`order_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_order_coupons` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` int(11) NOT NULL DEFAULT '0',
`coupon_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`code` varchar(255) NOT NULL DEFAULT '',
`amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`netto` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`brutto` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `order_id` (`order_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_order_discounts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` int(11) NOT NULL DEFAULT '0',
`discount_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`code` varchar(255) NOT NULL DEFAULT '',
`type` tinyint(3) NOT NULL default '0',
`amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`netto` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`brutto` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `order_id` (`order_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_order_product_discounts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` int(11) NOT NULL DEFAULT '0',
`product_id` int(11) NOT NULL DEFAULT '0',
`order_product_id` int(11) NOT NULL DEFAULT '0',
`discount_id` int(11) NOT NULL DEFAULT '0',
`category_id` int(11) NOT NULL DEFAULT '0',
`product_id_key` text,
`type` tinyint(3) NOT NULL default '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`code` varchar(255) NOT NULL DEFAULT '',
`amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`netto` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`brutto` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`tax` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`quantity` int(11) NOT NULL DEFAULT '0',
`final` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `product_id` (`product_id`),
KEY `order_id` (`order_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_order_total` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` int(11) NOT NULL DEFAULT '0',
`item_id` int(11) NOT NULL DEFAULT '0',
`item_id_c` int(11) NOT NULL DEFAULT '0',
`item_id_r` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`title_lang` varchar(255) NOT NULL DEFAULT '',
`title_lang_suffix` varchar(100) NOT NULL DEFAULT '',
`title_lang_suffix2` varchar(100) NOT NULL DEFAULT '',
`type` varchar(50) NOT NULL DEFAULT '',
`amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`amount_currency` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`text` varchar(255) NOT NULL DEFAULT '',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `order_id` (`order_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_order_tax_recapitulation` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` int(11) NOT NULL DEFAULT '0',
`item_id` int(11) NOT NULL DEFAULT '0',
`item_id_c` int(11) NOT NULL DEFAULT '0',
`item_id_r` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`title_lang` varchar(255) NOT NULL DEFAULT '',
`title_lang_suffix` varchar(100) NOT NULL DEFAULT '',
`title_lang_suffix2` varchar(100) NOT NULL DEFAULT '',
`type` varchar(50) NOT NULL DEFAULT '',
`amount_netto` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`amount_tax` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`amount_brutto` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`amount_brutto_currency` DECIMAL( 15, 4 ) NOT NULL DEFAULT
'0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `order_id` (`order_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_order_history` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` int(11) NOT NULL DEFAULT '0',
`order_status_id` int(11) NOT NULL DEFAULT '0',
`user_id` int(11) NOT NULL DEFAULT '0',
`notify` tinyint(1) NOT NULL DEFAULT '0',
`comment` varchar(255) NOT NULL DEFAULT '',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
KEY `order_id` (`order_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_order_downloads` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` int(11) NOT NULL DEFAULT '0',
`product_id` int(11) NOT NULL DEFAULT '0',
`attribute_id` int(11) NOT NULL DEFAULT '0',
`option_id` int(11) NOT NULL DEFAULT '0',
`order_product_id` int(11) NOT NULL DEFAULT '0',
`order_attribute_id` int(11) NOT NULL DEFAULT '0',
`order_option_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`download_token` char(64) NOT NULL DEFAULT '',
`download_folder` varchar(255) NOT NULL DEFAULT '',
`download_file` varchar(255) NOT NULL DEFAULT '',
`download_hits` int(11) NOT NULL DEFAULT '0',
`download_days` int(11) NOT NULL DEFAULT '-1',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`type` tinyint(1) NOT NULL DEFAULT '0',
`ordering` int(11) NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`published` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_logs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL default '0',
`type_id` int(11) NOT NULL default '0',
`type` tinyint(3) NOT NULL default '0',
`priority` tinyint(1) NOT NULL default '0',
`status` tinyint(1) NOT NULL default '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`ip` varchar(20) NOT NULL default '',
`incoming_page` varchar(255) NOT NULL,
`description` text,
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `idx_language` (`language`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_feeds` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`description` text,
`header` text,
`footer` text,
`root` varchar(64) NOT NULL DEFAULT '',
`item` varchar(64) NOT NULL DEFAULT '',
`feed_plugin` varchar(64) NOT NULL DEFAULT '',
`item_params` text,
`feed_params` text,
`params` text,
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`type` tinyint(1) NOT NULL DEFAULT '0',
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY (`type`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_wishlists` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`product_id` int(11) NOT NULL DEFAULT '0',
`category_id` int(11) NOT NULL DEFAULT '0',
`user_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`wishlist` text,
`ip` varchar(40) NOT NULL DEFAULT '',
`user_agent` varchar(255) NOT NULL DEFAULT '',
`quantity` int(11) NOT NULL DEFAULT '0',
`type` tinyint(1) NOT NULL DEFAULT '0',
`priority` tinyint(1) NOT NULL DEFAULT '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`params` text,
PRIMARY KEY (`id`),
KEY `idx_product_user` (`product_id`, `user_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_questions` (
`id` int(11) unsigned NOT NULL auto_increment,
`product_id` int(11) NOT NULL default '0',
`category_id` int(11) NOT NULL default '0',
`user_id` int(11) NOT NULL default '0',
`question_id` int(11) NOT NULL default '0',
`name` varchar(100) NOT NULL default '',
`email` varchar(50) NOT NULL default '',
`phone` varchar(20) NOT NULL default '',
`phone_mobile` varchar(20) NOT NULL default '',
`ip` varchar(20) NOT NULL default '',
`title` varchar(200) NOT NULL default '',
`alias` varchar(255) NOT NULL default '',
`message` text,
`date` datetime NOT NULL default '0000-00-00 00:00:00',
`privacy` tinyint(1) NOT NULL default '0',
`published` tinyint(1) NOT NULL default '0',
`checked_out` int(11) NOT NULL default '0',
`checked_out_time` datetime NOT NULL default '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL default '',
PRIMARY KEY (`id`),
KEY `published` (`published`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_import` (
`id` int(11) unsigned NOT NULL auto_increment,
`user_id` int(11) NOT NULL default '0',
`product_id` int(11) NOT NULL default '0',
`row_id` int(11) NOT NULL default '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`item` text,
`type` int(3) NOT NULL default '0',
`file_type` int(3) NOT NULL default '0',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_export` (
`id` int(11) unsigned NOT NULL auto_increment,
`user_id` int(11) NOT NULL default '0',
`product_id` int(11) NOT NULL default '0',
`row_id` int(11) NOT NULL default '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`item` text,
`type` int(3) NOT NULL default '0',
`file_type` int(3) NOT NULL default '0',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_hits` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`catid` int(11) NOT NULL default '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`user_id` int(11) NOT NULL default '0',
`product_id` int(11) NOT NULL default '0',
`item` varchar(255) NOT NULL DEFAULT '',
`ip` varchar(20) NOT NULL default '',
`type` tinyint(3) NOT NULL default '0',
`hits` int(11) NOT NULL DEFAULT '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`params` text,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_groups` (
`id` int(11) NOT NULL auto_increment,
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`description` text,
`display_price` tinyint(1) unsigned NOT NULL DEFAULT '0',
`display_price_method` tinyint(3) unsigned NOT NULL DEFAULT
'0',
`display_addtocart` tinyint(1) unsigned NOT NULL DEFAULT '0',
`display_attributes` tinyint(1) unsigned NOT NULL DEFAULT '0',
`minimum_sum` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`product_id` int(11) NOT NULL DEFAULT '0',
`valid_from` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`valid_to` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`type` tinyint(3) NOT NULL default '0',
`access` int(11) unsigned NOT NULL DEFAULT '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_reward_points` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT '0',
`order_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`points` int(11) NOT NULL DEFAULT '0',
`type` tinyint(3) NOT NULL default '0',
`description` text,
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`params` text,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
-- access tables - one table replace all the listed tables - tables are
identified by type
-- #__phocacart_categories
-- #__phocacart_products
-- #__phocacart_coupons
-- #__phocacart_discounts
-- #__phocacart_shipping_methods
-- #__phocacart_payment_methods
-- #__phocacart_product_discounts
-- #__phocacart_form_fields
CREATE TABLE IF NOT EXISTS `#__phocacart_item_access` (
`item_id` int(11) NOT NULL DEFAULT '0',
`access_id` int(11) NOT NULL DEFAULT '0',
`type` tinyint(3) NOT NULL DEFAULT '0',
KEY `idx_itemaccess` (`item_id`, `access_id`)
) DEFAULT CHARSET=utf8;
-- group tables - one table replace all the listed tables - tables are
identified by type
-- #__phocacart_categories
-- #__phocacart_products
-- #__phocacart_coupons
-- #__phocacart_discounts
-- #__phocacart_shipping_methods
-- #__phocacart_payment_methods
-- #__phocacart_product_discounts - product_id column needed
-- #__phocacart_form_fields
-- #__phocacart_users
CREATE TABLE IF NOT EXISTS `#__phocacart_item_groups` (
`item_id` int(11) NOT NULL DEFAULT '0',
`group_id` int(11) NOT NULL DEFAULT '0',
`product_id` int(11) NOT NULL DEFAULT '0',
`type` tinyint(3) NOT NULL DEFAULT '0',
KEY `idx_itemgroup` (`item_id`, `group_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_vendors` (
`id` int(11) NOT NULL auto_increment,
`user_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`description` text,
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`access` int(11) unsigned NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `cat_idx` (`published`,`access`),
KEY `idx_access` (`access`),
KEY `idx_checkout` (`checked_out`),
KEY `idx_published` (`published`),
KEY `idx_alias` (`alias`),
KEY `idx_language` (`language`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_sections` (
`id` int(11) NOT NULL auto_increment,
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`description` text,
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`access` int(11) unsigned NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `cat_idx` (`published`,`access`),
KEY `idx_access` (`access`),
KEY `idx_checkout` (`checked_out`),
KEY `idx_published` (`published`),
KEY `idx_alias` (`alias`),
KEY `idx_language` (`language`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_units` (
`id` int(11) NOT NULL auto_increment,
`section_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`description` text,
`class_name` varchar(255) NOT NULL DEFAULT '',
`custom_css` text,
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`access` int(11) unsigned NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `cat_idx` (`published`,`access`),
KEY `idx_access` (`access`),
KEY `idx_checkout` (`checked_out`),
KEY `idx_published` (`published`),
KEY `idx_alias` (`alias`),
KEY `idx_language` (`language`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_opening_times` (
`id` int(11) NOT NULL auto_increment,
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`type` tinyint(1) NOT NULL default '0',
`status` tinyint(1) NOT NULL default '0',
`day` tinyint(1) NOT NULL default '0',
`hour_from` int(2) NOT NULL default '0',
`minute_from` int(2) NOT NULL default '0',
`hour_to` int(2) NOT NULL default '0',
`minute_to` int(2) NOT NULL default '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`description` text,
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_submit_items` (
`id` int(11) unsigned NOT NULL auto_increment,
`user_id` int(11) NOT NULL default '0',
`title` varchar(200) NOT NULL default '',
`alias` varchar(255) NOT NULL default '',
`ip` varchar(20) NOT NULL default '',
`items_item` text,
`items_contact` text,
`items_parameter` text,
`access` int(11) unsigned NOT NULL DEFAULT '0',
`upload_token` char(64) NOT NULL DEFAULT '',
`upload_folder` varchar(255) NOT NULL DEFAULT '',
`date_submit` datetime NOT NULL default '0000-00-00 00:00:00',
`privacy` tinyint(1) NOT NULL default '0',
`published` tinyint(1) NOT NULL default '0',
`checked_out` int(11) NOT NULL default '0',
`checked_out_time` datetime NOT NULL default '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL default '',
PRIMARY KEY (`id`),
KEY `published` (`published`)
) DEFAULT CHARSET=utf8;
-- Data
INSERT INTO `#__phocacart_order_statuses` (`id`, `title`, `published`,
`ordering`, `stock_movements`, `type`, `download`, `change_user_group`,
`change_points_needed`, `change_points_received`, `orders_view_display`)
VALUES
(1, 'COM_PHOCACART_STATUS_PENDING', '1', '1',
'-', '1', '0', '0', '1',
'0', '[1]'),
(2, 'COM_PHOCACART_STATUS_CONFIRMED', '1',
'2', '=', '1', '0', '1',
'1', '1', '[1,3]'),
(3, 'COM_PHOCACART_STATUS_CANCELED', '1',
'3', '+', '1', '0', '1',
'2', '2', '[1]'),
(4, 'COM_PHOCACART_STATUS_SHIPPED', '1', '4',
'=', '1', '0', '1', '1',
'1', '[1,2,3]'),
(5, 'COM_PHOCACART_STATUS_REFUNDED', '1',
'5', '=', '1', '0', '1',
'2', '2', '[1]'),
(6, 'COM_PHOCACART_STATUS_COMPLETED', '1',
'6', '=', '1', '1', '1',
'1', '1', '[1,2,3]');
-- -
INSERT INTO `#__phocacart_stock_statuses` (`id`, `title`, `published`,
`ordering`) VALUES (NULL, 'COM_PHOCACART_STATUS_OUT_OF_STOCK',
'1', '1');
INSERT INTO `#__phocacart_stock_statuses` (`id`, `title`, `published`,
`ordering`) VALUES (NULL, 'COM_PHOCACART_STATUS_IN_STOCK',
'1', '2');
INSERT INTO `#__phocacart_stock_statuses` (`id`, `title`, `published`,
`ordering`) VALUES (NULL, 'COM_PHOCACART_STATUS_2_3_DAYS',
'1', '3');
-- -
INSERT INTO `#__phocacart_currencies` (`id`, `title`, `code`,
`exchange_rate`, `price_currency_symbol`, `price_format`,
`price_dec_symbol`, `price_decimals`, `price_thousands_sep`,
`price_suffix`, `price_prefix`, `published`) VALUES
(1, 'Euro', 'EUR', 1, '€', 3,
',', 2, '.', '', '', 1);
-- -
INSERT INTO `#__phocacart_form_fields` ( `title`, `label`, `description`,
`type`, `type_default`, `published`, `display_billing`, `display_shipping`,
`display_account`, `required`, `read_only`, `filter`, `unique`, `class`,
`validate`, `ordering`, `access`) VALUES
('name_first', 'COM_PHOCACART_FIRST_NAME_LABEL',
'COM_PHOCACART_FIRST_NAME_DESC', 'text:varchar(100)',
1, 1, 1, 1, 1, 1, 0, '', 0, '', '', 1, 1),
('name_middle', 'COM_PHOCACART_MIDDLE_NAME_LABEL',
'COM_PHOCACART_MIDDLE_NAME_DESC', 'text:varchar(100)',
1, 0, 0, 0, 0, 0, 0, '', 0, '', '', 2, 1),
('name_last', 'COM_PHOCACART_LAST_NAME_LABEL',
'COM_PHOCACART_LAST_NAME_DESC', 'text:varchar(100)', 1,
1, 1, 1, 1, 1, 0, '', 0, '', '', 3, 1),
('name_degree', 'COM_PHOCACART_DEGREE_LABEL',
'COM_PHOCACART_DEGREE_DESC', 'text:varchar(100)', 1, 0,
0, 0, 0, 0, 0, '', 0, '', '', 4, 1),
('company', 'COM_PHOCACART_COMPANY_LABEL',
'COM_PHOCACART_COMPANY_DESC', 'text:varchar(255)', 1,
1, 1, 1, 1, 0, 0, '', 0, '', '', 5, 1),
('vat_1', 'COM_PHOCACART_VAT_1_LABEL',
'COM_PHOCACART_VAT_1_DESC', 'text:varchar(25)', 1, 0,
0, 0, 0, 0, 0, '', 0, '', '', 6, 1),
('vat_2', 'COM_PHOCACART_VAT_2_LABEL',
'COM_PHOCACART_VAT_2_DESC', 'text:varchar(25)', 1, 0,
0, 0, 0, 0, 0, '', 0, '', '', 7, 1),
('address_1', 'COM_PHOCACART_ADDRESS_1_LABEL',
'COM_PHOCACART_ADDRESS_1_DESC', 'text:varchar(255)', 1,
1, 1, 1, 1, 1, 0, '', 0, '', '', 8, 1),
('address_2', 'COM_PHOCACART_ADDRESS_2_LABEL',
'COM_PHOCACART_ADDRESS_2_DESC', 'text:varchar(255)', 1,
0, 0, 0, 0, 0, 0, '', 0, '', '', 9, 1),
('zip', 'COM_PHOCACART_ZIP_LABEL',
'COM_PHOCACART_ZIP_DESC', 'text:varchar(20)', 1, 1, 1,
1, 1, 1, 0, '', 0, '', '', 10, 1),
('city', 'COM_PHOCACART_CITY_LABEL',
'COM_PHOCACART_CITY_DESC', 'text:varchar(255)', 1, 1,
1, 1, 1, 1, 0, '', 0, '', '', 11, 1),
('country', 'COM_PHOCACART_COUNTRY_LABEL',
'COM_PHOCACART_COUNTRY_DESC',
'phocaformcountry:int(11)', 1, 1, 1, 1, 1, 1, 0, '', 0,
'', '', 12, 1),
('region', 'COM_PHOCACART_REGION_LABEL',
'COM_PHOCACART_REGION_DESC', 'phocaformregion:int(11)',
1, 1, 1, 1, 1, 0, 0, '', 0, '', '', 13, 1),
('email', 'COM_PHOCACART_EMAIL_LABEL',
'COM_PHOCACART_EMAIL_DESC', 'text:varchar(100)', 1, 1,
1, 0, 1, 1, 2, 'string', 1, '', 'email', 14,
1),
('email_contact', 'COM_PHOCACART_CONTACT_EMAIL_LABEL',
'COM_PHOCACART_CONTACT_EMAIL_DESC',
'text:varchar(100)', 1, 0, 0, 0, 0, 0, 0, 'string', 1,
'', 'email', 15, 1),
('phone_1', 'COM_PHOCACART_PHONE_1_LABEL',
'COM_PHOCACART_PHONE_1_DESC', 'text:varchar(20)', 1, 0,
0, 0, 0, 0, 0, '',0, '', '', 16, 1),
('phone_2', 'COM_PHOCACART_PHONE_2_LABEL',
'COM_PHOCACART_PHONE_2_DESC', 'text:varchar(20)', 1, 0,
0, 0, 0, 0, 0, '', 0, '', '', 17, 1),
('phone_mobile', 'COM_PHOCACART_MOBILE_PHONE_LABEL',
'COM_PHOCACART_MOBILE_PHONE_DESC', 'text:varchar(20)',
1, 0, 0, 0, 0, 0, 0, '', 0, '', '', 18, 1),
('fax', 'COM_PHOCACART_FAX_LABEL',
'COM_PHOCACART_FAX_DESC', 'text:varchar(20)', 1, 0, 0,
0, 0, 0, 0, '', 0, '', '', 19, 1);
INSERT INTO `#__phocacart_groups` (`id`, `title`, `published`,
`display_price`, `display_addtocart`, `display_attributes`, `ordering`,
`type`) VALUES (1, 'COM_PHOCACART_DEFAULT', '1',
'1', '1', '1', '1',
'1');
-- UTF-8 test: ä,ö,ü
-- Using text NOT NULL DEFAULT '' instead of text NOT NULL
DEFAULT '' NOT NULL because of possible problems with strict
rules: Field 'text' doesn't have a default value
-- all formats are problematic:
-- text not null default ''
-- text not null
-- text
-- so reverting back to "text" only
-- ----------------
-- ALPHA1 -> ALPHA2
-- ----------------
-- `type` tinyint(1) NOT NULL DEFAULT '0' added -
`#__phocacart_order_statuses`
-- `download` tinyint(1) NOT NULL DEFAULT '0' added -
`#__phocacart_order_statuses`
-- `email_text` text added - `#__phocacart_order_statuses`
-- `email_subject` varchar(255) added - `#__phocacart_order_statuses`
-- `email_send` int(2) NOT NULL DEFAULT '0' -
`#__phocacart_order_statuses`
-- `type` tinyint(1) NOT NULL DEFAULT '0' added -
`#__phocacart_stock_statuses`
-- `weight` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0' added -
`#__phocacart_order_products`
-- `volume` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0' added -
`#__phocacart_order_products`
-- `unit_weight` varchar(50) NOT NULL DEFAULT '' -
`#__phocacart_orders`
-- `unit_volume` varchar(50) NOT NULL DEFAULT '' -
`#__phocacart_orders`
-- `lowest_amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0', -
`#__phocacart_payment_methods`
-- `highest_amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0', -
`#__phocacart_payment_methods`
-- `active_amount` tinyint(1) NOT NULL DEFAULT '0', -
`#__phocacart_payment_methods`
-- `active_country` tinyint(1) NOT NULL DEFAULT '0', -
`#__phocacart_payment_methods`
-- `active_region` tinyint(1) NOT NULL DEFAULT '0', -
`#__phocacart_payment_methods`
-- `active_shipping` tinyint(1) NOT NULL DEFAULT '0', -
`#__phocacart_payment_methods`
-- `access` int(11) unsigned NOT NULL DEFAULT '0', -
`#__phocacart_payment_methods`
-- `access` int(11) unsigned NOT NULL DEFAULT '0', -
`#__phocacart_payment_methods`
-- `access` int(11) unsigned NOT NULL DEFAULT '0', -
`#__phocacart_form_fields`
-- CREATE TABLE IF NOT EXISTS `#__phocacart_payment_method_countries` (
-- `payment_id` int(11) NOT NULL DEFAULT '0',
-- `country_id` int(11) NOT NULL DEFAULT '0',
-- KEY `idx_payment` (`payment_id`, `country_id`)
-- ) DEFAULT CHARSET=utf8;
-- CREATE TABLE IF NOT EXISTS `#__phocacart_payment_method_regions` (
-- `payment_id` int(11) NOT NULL DEFAULT '0',
-- `region_id` int(11) NOT NULL DEFAULT '0',
-- KEY `idx_payment` (`payment_id`, `region_id`)
-- ) DEFAULT CHARSET=utf8;
-- CREATE TABLE IF NOT EXISTS `#__phocacart_payment_method_shipping` (
-- `payment_id` int(11) NOT NULL DEFAULT '0',
-- `shipping_id` int(11) NOT NULL DEFAULT '0',
-- KEY `idx_payment` (`payment_id`, `shipping_id`)
-- ) DEFAULT CHARSET=utf8;
-- `free_payment` tinyint(1) NOT NULL DEFAULT '0' -
`#__phocacart_coupons`
-- --------------
-- BETA1 -> BETA2
-- --------------
-- CREATE TABLE IF NOT EXISTS `#__phocacart_product_featured` (
-- `product_id` int(11) NOT NULL DEFAULT '0',
-- `ordering` int(11) NOT NULL DEFAULT '0',
-- PRIMARY KEY (`product_id`)
-- ) DEFAULT CHARSET=utf8;
-- `sales` int(11) NOT NULL DEFAULT '0', -
`#__phocacart_products`
-- `alias_value` varchar(255) NOT NULL DEFAULT '', -
`#__phocacart_specifications`
-- `serial_number` varchar(255) NOT NULL DEFAULT '', -
`#__phocacart_products`
-- `registration_key` varchar(255) NOT NULL DEFAULT '', -
`#__phocacart_products`
-- `external_id` varchar(255) NOT NULL DEFAULT '', -
`#__phocacart_products`
-- `external_key` varchar(255) NOT NULL DEFAULT '', -
`#__phocacart_products`
-- -----------
-- BETA2 -> RC
-- -----------
-- ALTER TABLE `#__phocacart_order_downloads` ADD `ordering` int(11) NOT
NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_products` ADD `video` varchar(255) NOT
NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_categories` ADD `title_feed` varchar(255)
NOT NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_stock_statuses` ADD `title_feed`
varchar(255) NOT NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_products` ADD `unit_amount` DECIMAL( 15, 4
) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_products` ADD `unit_unit` varchar(64) NOT
NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_attribute_values` ADD `image` varchar(255)
NOT NULL DEFAULT '';
-- CREATE TABLE IF NOT EXISTS `#__phocacart_feeds` (
-- `id` int(11) NOT NULL AUTO_INCREMENT,
-- `title` varchar(255) NOT NULL DEFAULT '',
-- `alias` varchar(255) NOT NULL DEFAULT '',
-- `description` text,
-- `header` text,
-- `footer` text,
-- `root` varchar(64) NOT NULL DEFAULT '',
-- `item` varchar(64) NOT NULL DEFAULT '',
-- `item_params` text,
-- `feed_params` text,
-- `params` text,
-- `published` tinyint(1) NOT NULL DEFAULT '0',
-- `checked_out` int(11) unsigned NOT NULL DEFAULT '0',
-- `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
-- `ordering` int(11) NOT NULL DEFAULT '0',
-- `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
-- `type` tinyint(1) NOT NULL DEFAULT '0',
-- `language` char(7) NOT NULL DEFAULT '',
-- PRIMARY KEY (`id`),
-- KEY (`type`)
-- ) DEFAULT CHARSET=utf8;
-- ---------
-- RC -> RC2
-- ---------
-- New table added
-- ---------------
-- CREATE TABLE IF NOT EXISTS `#__phocacart_product_categories` (
-- `product_id` int(11) NOT NULL DEFAULT '0',
-- `category_id` int(11) NOT NULL DEFAULT '0',
-- `ordering` int(11) NOT NULL DEFAULT '0',
-- KEY `idx_category` (`product_id`,`category_id`),
-- KEY `ordering` ( `ordering` )
-- ) DEFAULT CHARSET=utf8;
-- Run this sql query to convert categories to multiple categories
-- ---------------------------------------------------------------
-- INSERT INTO `#__phocacart_product_categories` (product_id, category_id,
ordering)
-- SELECT id, catid, ordering FROM `#__phocacart_products`;
-- Altered columns
-- ---------------
-- ALTER TABLE `#__phocacart_order_products` ADD `category_id` int(11) NOT
NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_products` ADD `external_link` varchar(255)
NOT NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_products` ADD `external_text` varchar(255)
NOT NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_products` CHANGE `price` `price` DECIMAL(
15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_products` CHANGE `price_original`
`price_original` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_products` CHANGE `length` `length` DECIMAL(
10, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_products` CHANGE `width` `width` DECIMAL(
10, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_products` CHANGE `height` `height` DECIMAL(
10, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_products` CHANGE `weight` `weight` DECIMAL(
10, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_products` CHANGE `volume` `volume` DECIMAL(
10, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_products` CHANGE `unit_amount`
`unit_amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_attribute_values` CHANGE `amount` `amount`
DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_attribute_values` CHANGE `weight` `weight`
DECIMAL( 10, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_attribute_values` CHANGE `volume` `volume`
DECIMAL( 10, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_shipping_methods` CHANGE `cost` `cost`
DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_shipping_methods` CHANGE `lowest_weight`
`lowest_weight` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_shipping_methods` CHANGE `highest_weight`
`highest_weight` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_shipping_methods` CHANGE `lowest_volume`
`lowest_volume` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_shipping_methods` CHANGE `highest_volume`
`highest_volume` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_shipping_methods` CHANGE `lowest_amount`
`lowest_amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_shipping_methods` CHANGE `highest_amount`
`highest_amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_taxes` CHANGE `tax_rate` `tax_rate`
DECIMAL( 10, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_currencies` CHANGE `exchange_rate`
`exchange_rate` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_coupons` CHANGE `discount` `discount`
DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_coupons` CHANGE `total_amount`
`total_amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_payment_methods` CHANGE `cost` `cost`
DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_payment_methods` CHANGE `lowest_amount`
`lowest_amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_payment_methods` CHANGE `highest_amount`
`highest_amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_orders` CHANGE `currency_exchange_rate`
`currency_exchange_rate` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_products` CHANGE `netto` `netto`
DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_products` CHANGE `tax` `tax`
DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_products` CHANGE `brutto` `brutto`
DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_products` CHANGE `dnetto` `dnetto`
DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_products` CHANGE `dtax` `dtax`
DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_products` CHANGE `dbrutto` `dbrutto`
DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_products` CHANGE `damount` `damount`
DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_products` CHANGE `weight` `weight`
DECIMAL( 10, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_products` CHANGE `volume` `volume`
DECIMAL( 10, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_coupons` CHANGE `amount` `amount`
DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_coupons` CHANGE `netto` `netto`
DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_coupons` CHANGE `brutto` `brutto`
DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_total` CHANGE `amount` `amount`
DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ---------
-- RC2 -> RC3
-- ---------
-- ALTER TABLE `#__phocacart_countries` ADD `image` varchar(255) NOT
NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_regions` ADD `image` varchar(255) NOT NULL
DEFAULT '';
-- ALTER TABLE `#__phocacart_currencies` ADD `image` varchar(255) NOT
NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_users` ADD `image` varchar(255) NOT NULL
DEFAULT '';
-- ALTER TABLE `#__phocacart_order_statuses` ADD `image` varchar(255) NOT
NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_taxes` ADD `image` varchar(255) NOT NULL
DEFAULT '';
-- ALTER TABLE `#__phocacart_feeds` ADD `image` varchar(255) NOT NULL
DEFAULT '';
-- ALTER TABLE `#__phocacart_tags` ADD `image` varchar(255) NOT NULL
DEFAULT '';
-- ALTER TABLE `#__phocacart_products` ADD `min_multiple_quantity`
int(11) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_attribute_values` ADD `color` varchar(50)
NOT NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_attribute_values` ADD `type` tinyint(1) NOT
NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_attribute_values` ADD `params` text;
-- ALTER TABLE `#__phocacart_attribute_values` ADD `image_small`
varchar(255) NOT NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_attribute_values` ADD `image_medium`
varchar(255) NOT NULL DEFAULT '';
-- New table added
-- ---------------
--CREATE TABLE IF NOT EXISTS `#__phocacart_wishlists` (
-- `id` int(11) NOT NULL AUTO_INCREMENT,
-- `product_id` int(11) NOT NULL DEFAULT '0',
-- `category_id` int(11) NOT NULL DEFAULT '0',
-- `user_id` int(11) NOT NULL DEFAULT '0',
-- `title` varchar(255) NOT NULL DEFAULT '',
-- `alias` varchar(255) NOT NULL DEFAULT '',
-- `ip` varchar(40) NOT NULL DEFAULT '',
-- `user_agent` varchar(255) NOT NULL DEFAULT '',
-- `quantity` int(11) NOT NULL DEFAULT '0',
-- `type` tinyint(1) NOT NULL DEFAULT '0',
-- `priority` tinyint(1) NOT NULL DEFAULT '0',
-- `published` tinyint(1) NOT NULL DEFAULT '0',
-- `checked_out` int(11) unsigned NOT NULL DEFAULT '0',
-- `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
-- `ordering` int(11) NOT NULL DEFAULT '0',
-- `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
-- `params` text,
-- PRIMARY KEY (`id`),
-- KEY `idx_product_user` (`product_id`, `user_id`)
--) DEFAULT CHARSET=utf8;
--CREATE TABLE IF NOT EXISTS `#__phocacart_questions` (
-- `id` int(11) unsigned NOT NULL auto_increment,
-- `product_id` int(11) NOT NULL default '0',
-- `category_id` int(11) NOT NULL default '0',
-- `user_id` int(11) NOT NULL default '0',
-- `question_id` int(11) NOT NULL default '0',
-- `name` varchar(100) NOT NULL default '',
-- `email` varchar(50) NOT NULL default '',
-- `phone` varchar(20) NOT NULL default '',
-- `phone_mobile` varchar(20) NOT NULL default '',
-- `ip` varchar(20) NOT NULL default '',
-- `title` varchar(200) NOT NULL default '',
-- `alias` varchar(255) NOT NULL default '',
-- `message` text,
-- `date` datetime NOT NULL default '0000-00-00 00:00:00',
-- `published` tinyint(1) NOT NULL default '0',
-- `checked_out` int(11) NOT NULL default '0',
-- `checked_out_time` datetime NOT NULL default '0000-00-00
00:00:00',
-- `ordering` int(11) NOT NULL DEFAULT '0',
-- `params` text,
-- `language` char(7) NOT NULL default '',
-- PRIMARY KEY (`id`),
-- KEY `published` (`published`)
--) DEFAULT CHARSET=utf8;
-- ---------
-- RC3 -> RC4
-- ---------
-- ALTER TABLE `#__phocacart_wishlists` ADD `wishlist` text;
-- ALTER TABLE `#__phocacart_attribute_values` ADD `default_value`
tinyint(1) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_products` ADD `public_download_file`
varchar(255) NOT NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_products` ADD `public_download_text`
varchar(255) NOT NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_attribute_values` ADD `sku` varchar(255) NOT
NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_attribute_values` ADD `ean` varchar(15) NOT
NULL DEFAULT '';
-- CREATE TABLE IF NOT EXISTS `#__phocacart_import` (
-- `id` int(11) unsigned NOT NULL auto_increment,
-- `user_id` int(11) NOT NULL default '0',
-- `product_id` int(11) NOT NULL default '0',
-- `row_id` int(11) NOT NULL default '0',
-- `title` varchar(255) NOT NULL DEFAULT '',
-- `alias` varchar(255) NOT NULL DEFAULT '',
-- `item` text,
-- `type` int(3) NOT NULL default '0',
-- `file_type` int(3) NOT NULL default '0',
-- PRIMARY KEY (`id`)
-- ) DEFAULT CHARSET=utf8;
-- CREATE TABLE IF NOT EXISTS `#__phocacart_export` (
-- `id` int(11) unsigned NOT NULL auto_increment,
-- `user_id` int(11) NOT NULL default '0',
-- `product_id` int(11) NOT NULL default '0',
-- `row_id` int(11) NOT NULL default '0',
-- `title` varchar(255) NOT NULL DEFAULT '',
-- `alias` varchar(255) NOT NULL DEFAULT '',
-- `item` text,
-- `type` int(3) NOT NULL default '0',
-- `file_type` int(3) NOT NULL default '0',
-- PRIMARY KEY (`id`)
-- ) DEFAULT CHARSET=utf8;
-- CREATE TABLE IF NOT EXISTS `#__phocacart_hits` (
-- `id` int(11) NOT NULL AUTO_INCREMENT,
-- `catid` int(11) NOT NULL default '0',
-- `title` varchar(255) NOT NULL DEFAULT '',
-- `alias` varchar(255) NOT NULL DEFAULT '',
-- `user_id` int(11) NOT NULL default '0',
-- `product_id` int(11) NOT NULL default '0',
-- `item` varchar(255) NOT NULL DEFAULT '',
-- `ip` varchar(20) NOT NULL default '',
-- `type` tinyint(3) NOT NULL default '0',
-- `hits` int(11) NOT NULL DEFAULT '0',
-- `published` tinyint(1) NOT NULL DEFAULT '0',
-- `checked_out` int(11) unsigned NOT NULL DEFAULT '0',
-- `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
-- `ordering` int(11) NOT NULL DEFAULT '0',
-- `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
-- `params` text,
-- PRIMARY KEY (`id`)
-- ) DEFAULT CHARSET=utf8;
-- ---------
-- RC4 -> RC5
-- ---------
-- CREATE TABLE IF NOT EXISTS `#__phocacart_tax_countries` (
-- `id` int(11) NOT NULL AUTO_INCREMENT,
-- `tax_id` int(11) NOT NULL DEFAULT '0',
-- `country_id` int(11) NOT NULL DEFAULT '0',
-- `title` varchar(255) NOT NULL DEFAULT '',
-- `alias` varchar(255) NOT NULL DEFAULT '',
-- `tax_rate` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0',
-- PRIMARY KEY (`id`),
-- KEY `tax_id` (`tax_id`),
-- KEY `country_id` (`country_id`)
-- ) DEFAULT CHARSET=utf8;
-- CREATE TABLE IF NOT EXISTS `#__phocacart_tax_regions` (
-- `id` int(11) NOT NULL AUTO_INCREMENT,
-- `tax_id` int(11) NOT NULL DEFAULT '0',
-- `region_id` int(11) NOT NULL DEFAULT '0',
-- `title` varchar(255) NOT NULL DEFAULT '',
-- `alias` varchar(255) NOT NULL DEFAULT '',
-- `tax_rate` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0',
-- PRIMARY KEY (`id`),
-- KEY `tax_id` (`tax_id`),
-- KEY `region_id` (`region_id`)
-- ) DEFAULT CHARSET=utf8;
-- ---------
-- RC5 -> RC6
-- ---------
-- CREATE TABLE IF NOT EXISTS `#__phocacart_payment_method_zones` (
-- `payment_id` int(11) NOT NULL DEFAULT '0',
-- `zone_id` int(11) NOT NULL DEFAULT '0',
-- KEY `idx_payment` (`payment_id`, `zone_id`)
-- ) DEFAULT CHARSET=utf8;
--
-- CREATE TABLE IF NOT EXISTS `#__phocacart_shipping_method_zones` (
-- `shipping_id` int(11) NOT NULL DEFAULT '0',
-- `zone_id` int(11) NOT NULL DEFAULT '0',
-- KEY `idx_shipping` (`shipping_id`, `zone_id`)
-- ) DEFAULT CHARSET=utf8;
--
-- CREATE TABLE IF NOT EXISTS `#__phocacart_zones` (
-- `id` int(11) NOT NULL AUTO_INCREMENT,
-- `title` varchar(255) NOT NULL DEFAULT '',
-- `alias` varchar(255) NOT NULL DEFAULT '',
-- `type` int(11) NOT NULL DEFAULT '0',
-- `code2` varchar(20) NOT NULL DEFAULT '',
-- `code3` varchar(20) NOT NULL DEFAULT '',
-- `image` varchar(255) NOT NULL DEFAULT '',
-- `published` tinyint(1) NOT NULL DEFAULT '0',
-- `checked_out` int(11) unsigned NOT NULL DEFAULT '0',
-- `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
-- `ordering` int(11) NOT NULL DEFAULT '0',
-- `params` text,
-- `language` char(7) NOT NULL DEFAULT '',
-- PRIMARY KEY (`id`)
-- ) DEFAULT CHARSET=utf8;
--
-- CREATE TABLE IF NOT EXISTS `#__phocacart_zone_countries` (
-- `zone_id` int(11) NOT NULL DEFAULT '0',
-- `country_id` int(11) NOT NULL DEFAULT '0',
-- KEY `idx_zonecountry` (`zone_id`, `country_id`)
-- ) DEFAULT CHARSET=utf8;
--
-- CREATE TABLE IF NOT EXISTS `#__phocacart_zone_regions` (
-- `zone_id` int(11) NOT NULL DEFAULT '0',
-- `region_id` int(11) NOT NULL DEFAULT '0',
-- KEY `idx_zoneregion` (`zone_id`, `region_id`)
-- ) DEFAULT CHARSET=utf8;
-- CREATE TABLE IF NOT EXISTS `#__phocacart_product_discounts` (
-- `id` int(11) NOT NULL auto_increment,
-- `product_id` int(11) NOT NULL DEFAULT '0',
-- `title` varchar(255) NOT NULL DEFAULT '',
-- `alias` varchar(255) NOT NULL DEFAULT '',
-- `code` varchar(255) NOT NULL DEFAULT '',
-- `discount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
-- `total_amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
-- `calculation_type` tinyint(1) NOT NULL DEFAULT '0',
-- `valid_from` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
-- `valid_to` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
-- `quantity` int(11) NOT NULL DEFAULT '0',
-- `quantity_from` int(11) NOT NULL DEFAULT '0',
-- `quantity_to` int(11) NOT NULL DEFAULT '0',
-- `available_quantity` int(11) NOT NULL DEFAULT '0',
-- `available_quantity_user` int(11) NOT NULL DEFAULT '0',
-- `description` text,
-- `access` int(11) unsigned NOT NULL DEFAULT '0',
-- `published` tinyint(1) NOT NULL DEFAULT '0',
-- `checked_out` int(11) unsigned NOT NULL DEFAULT '0',
-- `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
-- `ordering` int(11) NOT NULL DEFAULT '0',
-- `params` text,
-- `language` char(7) NOT NULL DEFAULT '',
-- PRIMARY KEY (`id`)
-- ) DEFAULT CHARSET=utf8;
-- CREATE TABLE IF NOT EXISTS `#__phocacart_discounts` (
-- `id` int(11) NOT NULL auto_increment,
-- `title` varchar(255) NOT NULL DEFAULT '',
-- `alias` varchar(255) NOT NULL DEFAULT '',
-- `code` varchar(255) NOT NULL DEFAULT '',
-- `discount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
-- `total_amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
-- `calculation_type` tinyint(1) NOT NULL DEFAULT '0',
-- `free_shipping` tinyint(1) NOT NULL DEFAULT '0',
-- `free_payment` tinyint(1) NOT NULL DEFAULT '0',
-- `valid_from` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
-- `valid_to` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
-- `quantity` int(11) NOT NULL DEFAULT '0',
-- `quantity_from` int(11) NOT NULL DEFAULT '0',
-- `quantity_to` int(11) NOT NULL DEFAULT '0',
-- `available_quantity` int(11) NOT NULL DEFAULT '0',
-- `available_quantity_user` int(11) NOT NULL DEFAULT '0',
-- `description` text,
-- `access` int(11) unsigned NOT NULL DEFAULT '0',
-- `published` tinyint(1) NOT NULL DEFAULT '0',
-- `checked_out` int(11) unsigned NOT NULL DEFAULT '0',
-- `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
-- `ordering` int(11) NOT NULL DEFAULT '0',
-- `params` text,
-- `language` char(7) NOT NULL DEFAULT '',
-- PRIMARY KEY (`id`)
-- ) DEFAULT CHARSET=utf8;
--
-- CREATE TABLE IF NOT EXISTS `#__phocacart_discount_products` (
-- `discount_id` int(11) NOT NULL DEFAULT '0',
-- `product_id` int(11) NOT NULL DEFAULT '0',
-- KEY `idx_discountproduct` (`discount_id`,`product_id`)
-- ) DEFAULT CHARSET=utf8;
--
-- CREATE TABLE IF NOT EXISTS `#__phocacart_discount_categories` (
-- `discount_id` int(11) NOT NULL DEFAULT '0',
-- `category_id` int(11) NOT NULL DEFAULT '0',
-- KEY `idx_discountcategory` (`discount_id`,`category_id`)
-- ) DEFAULT CHARSET=utf8;
--
-- CREATE TABLE IF NOT EXISTS `#__phocacart_item_access` (
-- `item_id` int(11) NOT NULL DEFAULT '0',
-- `access_id` int(11) NOT NULL DEFAULT '0',
-- `type` tinyint(3) NOT NULL DEFAULT '0',
-- KEY `idx_itemaccess` (`item_id`, `access_id`)
-- ) DEFAULT CHARSET=utf8;
--
-- CREATE TABLE IF NOT EXISTS `#__phocacart_order_discounts` (
-- `id` int(11) NOT NULL AUTO_INCREMENT,
-- `order_id` int(11) NOT NULL DEFAULT '0',
-- `discount_id` int(11) NOT NULL DEFAULT '0',
-- `title` varchar(255) NOT NULL DEFAULT '',
-- `code` varchar(255) NOT NULL DEFAULT '',
-- `type` tinyint(3) NOT NULL default '0',
-- `amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
-- `netto` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
-- `brutto` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
-- PRIMARY KEY (`id`),
-- KEY `order_id` (`order_id`)
-- ) DEFAULT CHARSET=utf8;
--
--CREATE TABLE IF NOT EXISTS `#__phocacart_order_product_discounts` (
-- `id` int(11) NOT NULL AUTO_INCREMENT,
-- `order_id` int(11) NOT NULL DEFAULT '0',
-- `product_id` int(11) NOT NULL DEFAULT '0',
-- `order_product_id` int(11) NOT NULL DEFAULT '0',
-- `discount_id` int(11) NOT NULL DEFAULT '0',
-- `category_id` int(11) NOT NULL DEFAULT '0',
-- `product_id_key` text,
-- `type` tinyint(3) NOT NULL default '0',
-- `title` varchar(255) NOT NULL DEFAULT '',
-- `alias` varchar(255) NOT NULL DEFAULT '',
-- `code` varchar(255) NOT NULL DEFAULT '',
-- `amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
-- `netto` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
-- `brutto` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
-- `tax` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
-- `quantity` int(11) NOT NULL DEFAULT '0',
-- `final` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
-- `published` tinyint(1) NOT NULL DEFAULT '0',
-- PRIMARY KEY (`id`),
-- KEY `product_id` (`product_id`),
-- KEY `order_id` (`order_id`)
--) DEFAULT CHARSET=utf8;
--
-- CREATE TABLE IF NOT EXISTS `#__phocacart_product_stock` (
-- `id` int(11) NOT NULL auto_increment,
-- `product_id` int(11) NOT NULL DEFAULT '0',
-- `product_key` text,
-- `attributes` text,
-- `stock` int(11) NOT NULL DEFAULT '0',
-- PRIMARY KEY (`id`)
-- ) DEFAULT CHARSET=utf8;
--
-- ALTER TABLE `#__phocacart_shipping_methods` ADD `method` varchar(100)
NOT NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_shipping_methods` ADD `active_zone`
tinyint(1) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_payment_methods` ADD `active_zone`
tinyint(1) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_coupons` ADD `access` int(11) unsigned
NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_coupons` ADD `quantity` int(11) NOT NULL
DEFAULT '0';
-- ALTER TABLE `#__phocacart_coupons` ADD `quantity_from` int(11) NOT
NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_coupons` ADD `quantity_to` int(11) NOT
NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_products` ADD `stock_calculation` int(11)
NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_products` ADD `min_quantity_calculation`
int(11) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_products` ADD `stock_calculation`
int(11) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_payment_methods` ADD `calculation_type`
tinyint(1) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_shipping_methods` ADD `calculation_type`
tinyint(1) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_orders` ADD `discount_id` int(11) NOT NULL
DEFAULT '0';
-- ---------
-- RC6 -> RC7
-- ---------
-- CREATE TABLE IF NOT EXISTS `#__phocacart_groups` (
-- `id` int(11) NOT NULL auto_increment,
-- `title` varchar(255) NOT NULL DEFAULT '',
-- `alias` varchar(255) NOT NULL DEFAULT '',
-- `image` varchar(255) NOT NULL DEFAULT '',
-- `description` text,
-- `display_price` tinyint(1) unsigned NOT NULL DEFAULT '0',
-- `display_price_method` tinyint(3) unsigned NOT NULL DEFAULT
'0',
-- `minimum_sum` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
-- `product_id` int(11) NOT NULL DEFAULT '0',
-- `valid_from` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
-- `valid_to` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
-- `type` tinyint(3) NOT NULL default '0',
-- `access` int(11) unsigned NOT NULL DEFAULT '0',
-- `published` tinyint(1) NOT NULL DEFAULT '0',
-- `checked_out` int(11) unsigned NOT NULL DEFAULT '0',
-- `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
-- `ordering` int(11) NOT NULL DEFAULT '0',
-- `params` text,
-- `language` char(7) NOT NULL DEFAULT '',
-- PRIMARY KEY (`id`)
-- ) DEFAULT CHARSET=utf8;
-- INSERT INTO `#__phocacart_groups` (`id`, `title`, `published`,
`display_price`, `ordering`, `type`) VALUES (1,
'COM_PHOCACART_DEFAULT', '1', '1',
'1', '1');
-- CREATE TABLE IF NOT EXISTS `#__phocacart_product_groups` (
-- `id` int(11) NOT NULL auto_increment,
-- `product_id` int(11) NOT NULL DEFAULT '0',
-- `group_id` int(11) NOT NULL DEFAULT '0',
-- `price` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
-- PRIMARY KEY (`id`),
-- KEY `idx_product` (`product_id`)
-- ) DEFAULT CHARSET=utf8;
-- CREATE TABLE IF NOT EXISTS `#__phocacart_product_price_groups` (
-- `id` int(11) NOT NULL auto_increment,
-- `product_id` int(11) NOT NULL DEFAULT '0',
-- `group_id` int(11) NOT NULL DEFAULT '0',
-- `price` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
-- PRIMARY KEY (`id`),
-- KEY `idx_product` (`product_id`)
-- ) DEFAULT CHARSET=utf8;
--
-- CREATE TABLE IF NOT EXISTS `#__phocacart_product_point_groups` (
-- `id` int(11) NOT NULL auto_increment,
-- `product_id` int(11) NOT NULL DEFAULT '0',
-- `group_id` int(11) NOT NULL DEFAULT '0',
-- `points_received` int(11) NOT NULL DEFAULT '0',
-- PRIMARY KEY (`id`),
-- KEY `idx_product` (`product_id`)
-- ) DEFAULT CHARSET=utf8;
-- CREATE TABLE IF NOT EXISTS `#__phocacart_item_groups` (
-- `item_id` int(11) NOT NULL DEFAULT '0',
-- `group_id` int(11) NOT NULL DEFAULT '0',
-- `product_id` int(11) NOT NULL DEFAULT '0',
-- `type` tinyint(3) NOT NULL DEFAULT '0',
-- KEY `idx_itemgroup` (`item_id`, `group_id`)
-- ) DEFAULT CHARSET=utf8;
-- CREATE TABLE IF NOT EXISTS `#__phocacart_reward_points` (
-- `id` int(11) NOT NULL AUTO_INCREMENT,
-- `user_id` int(11) NOT NULL DEFAULT '0',
-- `order_id` int(11) NOT NULL DEFAULT '0',
-- `title` varchar(255) NOT NULL DEFAULT '',
-- `alias` varchar(255) NOT NULL DEFAULT '',
-- `points` int(11) NOT NULL DEFAULT '0',
-- `type` tinyint(3) NOT NULL default '0',
-- `description` text,
-- `published` tinyint(1) NOT NULL DEFAULT '0',
-- `checked_out` int(11) unsigned NOT NULL DEFAULT '0',
-- `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
-- `ordering` int(11) NOT NULL DEFAULT '0',
-- `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
-- `params` text,
-- PRIMARY KEY (`id`)
-- ) DEFAULT CHARSET=utf8;
-- ALTER TABLE `#__phocacart_orders` ADD `group_id` int(11) NOT NULL
DEFAULT '0';
-- ALTER TABLE `#__phocacart_products` ADD `points_received` int(11) NOT
NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_products` ADD `points_needed` int(11) NOT
NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_products` ADD `points_received` int(11)
NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_products` ADD `points_needed` int(11)
NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_cart` ADD `reward` int(11) NOT NULL
DEFAULT '0';
-- ALTER TABLE `#__phocacart_form_fields` ADD `type_default` tinyint(3)
NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_users` ADD `user_groups` text;
-- ALTER TABLE `#__phocacart_order_products` ADD `default_price` DECIMAL(
10, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_products` ADD `default_tax_rate`
DECIMAL( 10, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_products` ADD
`default_calculation_type` tinyint(1) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_products` ADD `default_points_received`
int(11) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_statuses` ADD `change_user_group`
tinyint(1) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_statuses` ADD `change_points_needed`
tinyint(1) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_statuses` ADD `change_points_received`
tinyint(1) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_users` ADD `vat_valid` tinyint(1) NOT NULL
DEFAULT '0';
-- ALTER TABLE `#__phocacart_products` ADD `active` tinyint(1) NOT NULL
DEFAULT '0';
-- ---------
-- RC7 -> RC8
-- ---------
-- CREATE TABLE IF NOT EXISTS `#__phocacart_product_price_history` (
-- `id` int(11) NOT NULL auto_increment,
-- `product_id` int(11) NOT NULL DEFAULT '0',
-- `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
-- `price` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
-- PRIMARY KEY (`id`)
-- ) DEFAULT CHARSET=utf8;
-- ALTER TABLE `#__phocacart_shipping_methods` ADD `default` tinyint(1)
NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_payment_methods` ADD `default` tinyint(1) NOT
NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_shipping_methods` ADD `tracking_title`
varchar(255) NOT NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_shipping_methods` ADD `tracking_description`
text;
-- ALTER TABLE `#__phocacart_shipping_methods` ADD `tracking_link`
varchar(255) NOT NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_orders` ADD `tracking_id` int(11) NOT NULL
DEFAULT '0';
-- ALTER TABLE `#__phocacart_orders` ADD `tracking_title` varchar(255)
NOT NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_orders` ADD `tracking_description_custom`
text;
-- ALTER TABLE `#__phocacart_orders` ADD `tracking_link_custom`
varchar(255) NOT NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_orders` ADD `tracking_number` varchar(255)
NOT NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_orders` ADD `tracking_date_shipped`
datetime NOT NULL DEFAULT '0000-00-00 00:00:00';
-- ALTER TABLE `#__phocacart_shipping_methods` ADD `maximal_width`
DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_shipping_methods` ADD `maximal_height`
DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_shipping_methods` ADD `maximal_length`
DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_shipping_methods` ADD `active_size`
tinyint(1) NOT NULL DEFAULT '0';
-- ---------
-- RC8 -> RC9
-- ---------
-- ALTER TABLE `#__phocacart_currencies` CHANGE `exchange_rate`
`exchange_rate` DECIMAL( 15, 8 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_orders` CHANGE `currency_exchange_rate`
`currency_exchange_rate` DECIMAL( 15, 8 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_total` ADD `amount_currency` DECIMAL(
15, 4 ) NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_order_products` ADD `default_tax_id` int(11)
NOT NULL DEFAULT '0';
-- ALTER TABLE `#__phocacart_categories` ADD `metatitle` varchar(255)
NOT NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_products` ADD `metatitle` varchar(255) NOT
NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_order_total` ADD `item_id` int(11) NOT NULL
DEFAULT '0';
-- ---------
-- RC9 -> RC9.1
-- ---------
-- ALTER TABLE `#__phocacart_product_stock` ADD `image` varchar(255) NOT
NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_product_stock` ADD `image_small`
varchar(255) NOT NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_product_stock` ADD `image_medium`
varchar(255) NOT NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_products` CHANGE `isbn` `isbn` varchar(20)
NOT NULL DEFAULT '';
-- ---------
-- RC9.1 -> STABLE
-- ---------
-- ALTER TABLE `#__phocacart_manufacturers` ADD `link` varchar(255) NOT
NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_coupons` ADD `category_filter` tinyint(1)
NOT NULL DEFAULT '1';
-- ALTER TABLE `#__phocacart_coupons` ADD `product_filter` tinyint(1)
NOT NULL DEFAULT '1';
-- ALTER TABLE `#__phocacart_discounts` ADD `category_filter` tinyint(1)
NOT NULL DEFAULT '1';
-- ALTER TABLE `#__phocacart_discounts` ADD `product_filter` tinyint(1)
NOT NULL DEFAULT '1';
-- ---------
-- 3.0.0 - 3.0.1 and newer versions
-- ---------
-- SEE: administrator/components/com_phocacart/update/ - SQL should be
updated automatically by Joomla! extension manager rules
PK�"�[}������"install/sql/mysql/regions.utf8.sqlnu�[���--
-------------------------------------------------------------------- --
-- Phoca Cart Regions --
-- -------------------------------------------------------------------- --
-- See documentation on https://www.phoca.cz/
--
-- --
-- Change all prefixes #__ to prefix which is set in your Joomla! site --
-- (e.g. from #__phocacart to jos_phocacart) --
-- Run this SQL queries in your database tool, e.g. in phpMyAdmin --
-- If you have questions, just ask in Phoca Forum --
-- https://www.phoca.cz/forum/
--
-- -------------------------------------------------------------------- --
INSERT INTO `#__phocacart_regions` (`country_id`, `title`, `code3`,
`published`) VALUES
( 1, 'Badakhshan', 'BDS', 1),
( 1, 'Badghis', 'BDG', 1),
( 1, 'Baghlan', 'BGL', 1),
( 1, 'Balkh', 'BAL', 1),
( 1, 'Bamian', 'BAM', 1),
( 1, 'Farah', 'FRA', 1),
( 1, 'Faryab', 'FYB', 1),
( 1, 'Ghazni', 'GHA', 1),
( 1, 'Ghowr', 'GHO', 1),
( 1, 'Helmand', 'HEL', 1),
( 1, 'Herat', 'HER', 1),
( 1, 'Jowzjan', 'JOW', 1),
( 1, 'Kabul', 'KAB', 1),
( 1, 'Kandahar', 'KAN', 1),
( 1, 'Kapisa', 'KAP', 1),
( 1, 'Khost', 'KHO', 1),
( 1, 'Konar', 'KNR', 1),
( 1, 'Kondoz', 'KDZ', 1),
( 1, 'Laghman', 'LAG', 1),
( 1, 'Lowgar', 'LOW', 1),
( 1, 'Nangrahar', 'NAN', 1),
( 1, 'Nimruz', 'NIM', 1),
( 1, 'Nurestan', 'NUR', 1),
( 1, 'Oruzgan', 'ORU', 1),
( 1, 'Paktia', 'PIA', 1),
( 1, 'Paktika', 'PKA', 1),
( 1, 'Parwan', 'PAR', 1),
( 1, 'Samangan', 'SAM', 1),
( 1, 'Sar-e Pol', 'SAR', 1),
( 1, 'Takhar', 'TAK', 1),
( 1, 'Wardak', 'WAR', 1),
( 1, 'Zabol', 'ZAB', 1),
( 2, 'Berat', 'BR', 1),
( 2, 'Bulqize', 'BU', 1),
( 2, 'Delvine', 'DL', 1),
( 2, 'Devoll', 'DV', 1),
( 2, 'Diber', 'DI', 1),
( 2, 'Durres', 'DR', 1),
( 2, 'Elbasan', 'EL', 1),
( 2, 'Kolonje', 'ER', 1),
( 2, 'Fier', 'FR', 1),
( 2, 'Gjirokaster', 'GJ', 1),
( 2, 'Gramsh', 'GR', 1),
( 2, 'Has', 'HA', 1),
( 2, 'Kavaje', 'KA', 1),
( 2, 'Kurbin', 'KB', 1),
( 2, 'Kucove', 'KC', 1),
( 2, 'Korce', 'KO', 1),
( 2, 'Kruje', 'KR', 1),
( 2, 'Kukes', 'KU', 1),
( 2, 'Librazhd', 'LB', 1),
( 2, 'Lezhe', 'LE', 1),
( 2, 'Lushnje', 'LU', 1),
( 2, 'Malesi e Madhe', 'MM', 1),
( 2, 'Mallakaster', 'MK', 1),
( 2, 'Mat', 'MT', 1),
( 2, 'Mirdite', 'MR', 1),
( 2, 'Peqin', 'PQ', 1),
( 2, 'Permet', 'PR', 1),
( 2, 'Pogradec', 'PG', 1),
( 2, 'Puke', 'PU', 1),
( 2, 'Shkoder', 'SH', 1),
( 2, 'Skrapar', 'SK', 1),
( 2, 'Sarande', 'SR', 1),
( 2, 'Tepelene', 'TE', 1),
( 2, 'Tropoje', 'TP', 1),
( 2, 'Tirane', 'TR', 1),
( 2, 'Vlore', 'VL', 1),
( 3, 'Adrar', 'ADR', 1),
( 3, 'Ain Defla', 'ADE', 1),
( 3, 'Ain Temouchent', 'ATE', 1),
( 3, 'Alger', 'ALG', 1),
( 3, 'Annaba', 'ANN', 1),
( 3, 'Batna', 'BAT', 1),
( 3, 'Bechar', 'BEC', 1),
( 3, 'Bejaia', 'BEJ', 1),
( 3, 'Biskra', 'BIS', 1),
( 3, 'Blida', 'BLI', 1),
( 3, 'Bordj Bou Arreridj', 'BBA', 1),
( 3, 'Bouira', 'BOA', 1),
( 3, 'Boumerdes', 'BMD', 1),
( 3, 'Chlef', 'CHL', 1),
( 3, 'Constantine', 'CON', 1),
( 3, 'Djelfa', 'DJE', 1),
( 3, 'El Bayadh', 'EBA', 1),
( 3, 'El Oued', 'EOU', 1),
( 3, 'El Tarf', 'ETA', 1),
( 3, 'Ghardaia', 'GHA', 1),
( 3, 'Guelma', 'GUE', 1),
( 3, 'Illizi', 'ILL', 1),
( 3, 'Jijel', 'JIJ', 1),
( 3, 'Khenchela', 'KHE', 1),
( 3, 'Laghouat', 'LAG', 1),
( 3, 'Muaskar', 'MUA', 1),
( 3, 'Medea', 'MED', 1),
( 3, 'Mila', 'MIL', 1),
( 3, 'Mostaganem', 'MOS', 1),
( 3, 'M''Sila', 'MSI', 1),
( 3, 'Naama', 'NAA', 1),
( 3, 'Oran', 'ORA', 1),
( 3, 'Ouargla', 'OUA', 1),
( 3, 'Oum el-Bouaghi', 'OEB', 1),
( 3, 'Relizane', 'REL', 1),
( 3, 'Saida', 'SAI', 1),
( 3, 'Setif', 'SET', 1),
( 3, 'Sidi Bel Abbes', 'SBA', 1),
( 3, 'Skikda', 'SKI', 1),
( 3, 'Souk Ahras', 'SAH', 1),
( 3, 'Tamanghasset', 'TAM', 1),
( 3, 'Tebessa', 'TEB', 1),
( 3, 'Tiaret', 'TIA', 1),
( 3, 'Tindouf', 'TIN', 1),
( 3, 'Tipaza', 'TIP', 1),
( 3, 'Tissemsilt', 'TIS', 1),
( 3, 'Tizi Ouzou', 'TOU', 1),
( 3, 'Tlemcen', 'TLE', 1),
( 4, 'Eastern', 'E', 1),
( 4, 'Manu''a', 'M', 1),
( 4, 'Rose Island', 'R', 1),
( 4, 'Swains Island', 'S', 1),
( 4, 'Western', 'W', 1),
( 5, 'Andorra la Vella', 'ALV', 1),
( 5, 'Canillo', 'CAN', 1),
( 5, 'Encamp', 'ENC', 1),
( 5, 'Escaldes-Engordany', 'ESE', 1),
( 5, 'La Massana', 'LMA', 1),
( 5, 'Ordino', 'ORD', 1),
( 5, 'Sant Julia de Loria', 'SJL', 1),
( 6, 'Bengo', 'BGO', 1),
( 6, 'Benguela', 'BGU', 1),
( 6, 'Bie', 'BIE', 1),
( 6, 'Cabinda', 'CAB', 1),
( 6, 'Cuando-Cubango', 'CCU', 1),
( 6, 'Cuanza Norte', 'CNO', 1),
( 6, 'Cuanza Sul', 'CUS', 1),
( 6, 'Cunene', 'CNN', 1),
( 6, 'Huambo', 'HUA', 1),
( 6, 'Huila', 'HUI', 1),
( 6, 'Luanda', 'LUA', 1),
( 6, 'Lunda Norte', 'LNO', 1),
( 6, 'Lunda Sul', 'LSU', 1),
( 6, 'Malange', 'MAL', 1),
( 6, 'Moxico', 'MOX', 1),
( 6, 'Namibe', 'NAM', 1),
( 6, 'Uige', 'UIG', 1),
( 6, 'Zaire', 'ZAI', 1),
( 9, 'Saint George', 'ASG', 1),
( 9, 'Saint John', 'ASJ', 1),
( 9, 'Saint Mary', 'ASM', 1),
( 9, 'Saint Paul', 'ASL', 1),
( 9, 'Saint Peter', 'ASR', 1),
( 9, 'Saint Philip', 'ASH', 1),
( 9, 'Barbuda', 'BAR', 1),
( 9, 'Redonda', 'RED', 1),
( 10, 'Antartida e Islas del Atlantico', 'AN', 1),
( 10, 'Buenos Aires', 'BA', 1),
( 10, 'Catamarca', 'CA', 1),
( 10, 'Chaco', 'CH', 1),
( 10, 'Chubut', 'CU', 1),
( 10, 'Cordoba', 'CO', 1),
( 10, 'Corrientes', 'CR', 1),
( 10, 'Distrito Federal', 'DF', 1),
( 10, 'Entre Rios', 'ER', 1),
( 10, 'Formosa', 'FO', 1),
( 10, 'Jujuy', 'JU', 1),
( 10, 'La Pampa', 'LP', 1),
( 10, 'La Rioja', 'LR', 1),
( 10, 'Mendoza', 'ME', 1),
( 10, 'Misiones', 'MI', 1),
( 10, 'Neuquen', 'NE', 1),
( 10, 'Rio Negro', 'RN', 1),
( 10, 'Salta', 'SA', 1),
( 10, 'San Juan', 'SJ', 1),
( 10, 'San Luis', 'SL', 1),
( 10, 'Santa Cruz', 'SC', 1),
( 10, 'Santa Fe', 'SF', 1),
( 10, 'Santiago del Estero', 'SD', 1),
( 10, 'Tierra del Fuego', 'TF', 1),
( 10, 'Tucuman', 'TU', 1),
( 11, 'Aragatsotn', 'AGT', 1),
( 11, 'Ararat', 'ARR', 1),
( 11, 'Armavir', 'ARM', 1),
( 11, 'Geghark''unik''', 'GEG',
1),
( 11, 'Kotayk''', 'KOT', 1),
( 11, 'Lorri', 'LOR', 1),
( 11, 'Shirak', 'SHI', 1),
( 11, 'Syunik''', 'SYU', 1),
( 11, 'Tavush', 'TAV', 1),
( 11, 'Vayots'' Dzor', 'VAY', 1),
( 11, 'Yerevan', 'YER', 1),
( 13, 'Australian Capital Territory', 'ACT', 1),
( 13, 'New South Wales', 'NSW', 1),
( 13, 'Northern Territory', 'NT', 1),
( 13, 'Queensland', 'QLD', 1),
( 13, 'South Australia', 'SA', 1),
( 13, 'Tasmania', 'TAS', 1),
( 13, 'Victoria', 'VIC', 1),
( 13, 'Western Australia', 'WA', 1),
( 14, 'Burgenland', 'BUR', 1),
( 14, 'Kärnten', 'KAR', 1),
( 14, 'Niederösterreich', 'NOS', 1),
( 14, 'Oberösterreich', 'OOS', 1),
( 14, 'Salzburg', 'SAL', 1),
( 14, 'Steiermark', 'STE', 1),
( 14, 'Tirol', 'TIR', 1),
( 14, 'Vorarlberg', 'VOR', 1),
( 14, 'Wien', 'WIE', 1),
( 15, 'Ali Bayramli', 'AB', 1),
( 15, 'Abseron', 'ABS', 1),
( 15, 'AgcabAdi', 'AGC', 1),
( 15, 'Agdam', 'AGM', 1),
( 15, 'Agdas', 'AGS', 1),
( 15, 'Agstafa', 'AGA', 1),
( 15, 'Agsu', 'AGU', 1),
( 15, 'Astara', 'AST', 1),
( 15, 'Baki', 'BA', 1),
( 15, 'BabAk', 'BAB', 1),
( 15, 'BalakAn', 'BAL', 1),
( 15, 'BArdA', 'BAR', 1),
( 15, 'Beylaqan', 'BEY', 1),
( 15, 'Bilasuvar', 'BIL', 1),
( 15, 'Cabrayil', 'CAB', 1),
( 15, 'Calilabab', 'CAL', 1),
( 15, 'Culfa', 'CUL', 1),
( 15, 'Daskasan', 'DAS', 1),
( 15, 'Davaci', 'DAV', 1),
( 15, 'Fuzuli', 'FUZ', 1),
( 15, 'Ganca', 'GA', 1),
( 15, 'Gadabay', 'GAD', 1),
( 15, 'Goranboy', 'GOR', 1),
( 15, 'Goycay', 'GOY', 1),
( 15, 'Haciqabul', 'HAC', 1),
( 15, 'Imisli', 'IMI', 1),
( 15, 'Ismayilli', 'ISM', 1),
( 15, 'Kalbacar', 'KAL', 1),
( 15, 'Kurdamir', 'KUR', 1),
( 15, 'Lankaran', 'LA', 1),
( 15, 'Lacin', 'LAC', 1),
( 15, 'Lankaran', 'LAN', 1),
( 15, 'Lerik', 'LER', 1),
( 15, 'Masalli', 'MAS', 1),
( 15, 'Mingacevir', 'MI', 1),
( 15, 'Naftalan', 'NA', 1),
( 15, 'Neftcala', 'NEF', 1),
( 15, 'Oguz', 'OGU', 1),
( 15, 'Ordubad', 'ORD', 1),
( 15, 'Qabala', 'QAB', 1),
( 15, 'Qax', 'QAX', 1),
( 15, 'Qazax', 'QAZ', 1),
( 15, 'Qobustan', 'QOB', 1),
( 15, 'Quba', 'QBA', 1),
( 15, 'Qubadli', 'QBI', 1),
( 15, 'Qusar', 'QUS', 1),
( 15, 'Saki', 'SA', 1),
( 15, 'Saatli', 'SAT', 1),
( 15, 'Sabirabad', 'SAB', 1),
( 15, 'Sadarak', 'SAD', 1),
( 15, 'Sahbuz', 'SAH', 1),
( 15, 'Saki', 'SAK', 1),
( 15, 'Salyan', 'SAL', 1),
( 15, 'Sumqayit', 'SM', 1),
( 15, 'Samaxi', 'SMI', 1),
( 15, 'Samkir', 'SKR', 1),
( 15, 'Samux', 'SMX', 1),
( 15, 'Sarur', 'SAR', 1),
( 15, 'Siyazan', 'SIY', 1),
( 15, 'Susa', 'SS', 1),
( 15, 'Susa', 'SUS', 1),
( 15, 'Tartar', 'TAR', 1),
( 15, 'Tovuz', 'TOV', 1),
( 15, 'Ucar', 'UCA', 1),
( 15, 'Xankandi', 'XA', 1),
( 15, 'Xacmaz', 'XAC', 1),
( 15, 'Xanlar', 'XAN', 1),
( 15, 'Xizi', 'XIZ', 1),
( 15, 'Xocali', 'XCI', 1),
( 15, 'Xocavand', 'XVD', 1),
( 15, 'Yardimli', 'YAR', 1),
( 15, 'Yevlax', 'YEV', 1),
( 15, 'Zangilan', 'ZAN', 1),
( 15, 'Zaqatala', 'ZAQ', 1),
( 15, 'Zardab', 'ZAR', 1),
( 15, 'Naxcivan', 'NX', 1),
( 16, 'Acklins', 'ACK', 1),
( 16, 'Berry Islands', 'BER', 1),
( 16, 'Bimini', 'BIM', 1),
( 16, 'Black Point', 'BLK', 1),
( 16, 'Cat Island', 'CAT', 1),
( 16, 'Central Abaco', 'CAB', 1),
( 16, 'Central Andros', 'CAN', 1),
( 16, 'Central Eleuthera', 'CEL', 1),
( 16, 'City of Freeport', 'FRE', 1),
( 16, 'Crooked Island', 'CRO', 1),
( 16, 'East Grand Bahama', 'EGB', 1),
( 16, 'Exuma', 'EXU', 1),
( 16, 'Grand Cay', 'GRD', 1),
( 16, 'Harbour Island', 'HAR', 1),
( 16, 'Hope Town', 'HOP', 1),
( 16, 'Inagua', 'INA', 1),
( 16, 'Long Island', 'LNG', 1),
( 16, 'Mangrove Cay', 'MAN', 1),
( 16, 'Mayaguana', 'MAY', 1),
( 16, 'Moore''s Island', 'MOO', 1),
( 16, 'North Abaco', 'NAB', 1),
( 16, 'North Andros', 'NAN', 1),
( 16, 'North Eleuthera', 'NEL', 1),
( 16, 'Ragged Island', 'RAG', 1),
( 16, 'Rum Cay', 'RUM', 1),
( 16, 'San Salvador', 'SAL', 1),
( 16, 'South Abaco', 'SAB', 1),
( 16, 'South Andros', 'SAN', 1),
( 16, 'South Eleuthera', 'SEL', 1),
( 16, 'Spanish Wells', 'SWE', 1),
( 16, 'West Grand Bahama', 'WGB', 1),
( 17, 'Capital', 'CAP', 1),
( 17, 'Central', 'CEN', 1),
( 17, 'Muharraq', 'MUH', 1),
( 17, 'Northern', 'NOR', 1),
( 17, 'Southern', 'SOU', 1),
( 18, 'Barisal', 'BAR', 1),
( 18, 'Chittagong', 'CHI', 1),
( 18, 'Dhaka', 'DHA', 1),
( 18, 'Khulna', 'KHU', 1),
( 18, 'Rajshahi', 'RAJ', 1),
( 18, 'Sylhet', 'SYL', 1),
( 19, 'Christ Church', 'CC', 1),
( 19, 'Saint Andrew', 'AND', 1),
( 19, 'Saint George', 'GEO', 1),
( 19, 'Saint James', 'JAM', 1),
( 19, 'Saint John', 'JOH', 1),
( 19, 'Saint Joseph', 'JOS', 1),
( 19, 'Saint Lucy', 'LUC', 1),
( 19, 'Saint Michael', 'MIC', 1),
( 19, 'Saint Peter', 'PET', 1),
( 19, 'Saint Philip', 'PHI', 1),
( 19, 'Saint Thomas', 'THO', 1),
( 20, 'Brestskaya (Brest)', 'BR', 1),
( 20, 'Homyel''skaya (Homyel'')',
'HO', 1),
( 20, 'Horad Minsk', 'HM', 1),
( 20, 'Hrodzyenskaya (Hrodna)', 'HR', 1),
( 20, 'Mahilyowskaya (Mahilyow)', 'MA', 1),
( 20, 'Minskaya', 'MI', 1),
( 20, 'Vitsyebskaya (Vitsyebsk)', 'VI', 1),
( 21, 'Antwerpen', 'VAN', 1),
( 21, 'Brabant Wallon', 'WBR', 1),
( 21, 'Hainaut', 'WHT', 1),
( 21, 'Liège', 'WLG', 1),
( 21, 'Limburg', 'VLI', 1),
( 21, 'Luxembourg', 'WLX', 1),
( 21, 'Namur', 'WNA', 1),
( 21, 'Oost-Vlaanderen', 'VOV', 1),
( 21, 'Vlaams Brabant', 'VBR', 1),
( 21, 'West-Vlaanderen', 'VWV', 1),
( 22, 'Belize', 'BZ', 1),
( 22, 'Cayo', 'CY', 1),
( 22, 'Corozal', 'CR', 1),
( 22, 'Orange Walk', 'OW', 1),
( 22, 'Stann Creek', 'SC', 1),
( 22, 'Toledo', 'TO', 1),
( 23, 'Alibori', 'AL', 1),
( 23, 'Atakora', 'AK', 1),
( 23, 'Atlantique', 'AQ', 1),
( 23, 'Borgou', 'BO', 1),
( 23, 'Collines', 'CO', 1),
( 23, 'Donga', 'DO', 1),
( 23, 'Kouffo', 'KO', 1),
( 23, 'Littoral', 'LI', 1),
( 23, 'Mono', 'MO', 1),
( 23, 'Oueme', 'OU', 1),
( 23, 'Plateau', 'PL', 1),
( 23, 'Zou', 'ZO', 1),
( 24, 'Devonshire', 'DS', 1),
( 24, 'Hamilton City', 'HC', 1),
( 24, 'Hamilton', 'HA', 1),
( 24, 'Paget', 'PG', 1),
( 24, 'Pembroke', 'PB', 1),
( 24, 'Saint George City', 'GC', 1),
( 24, 'Saint George''s', 'SG', 1),
( 24, 'Sandys', 'SA', 1),
( 24, 'Smith''s', 'SM', 1),
( 24, 'Southampton', 'SH', 1),
( 24, 'Warwick', 'WA', 1),
( 25, 'Bumthang', 'BUM', 1),
( 25, 'Chukha', 'CHU', 1),
( 25, 'Dagana', 'DAG', 1),
( 25, 'Gasa', 'GAS', 1),
( 25, 'Haa', 'HAA', 1),
( 25, 'Lhuntse', 'LHU', 1),
( 25, 'Mongar', 'MON', 1),
( 25, 'Paro', 'PAR', 1),
( 25, 'Pemagatshel', 'PEM', 1),
( 25, 'Punakha', 'PUN', 1),
( 25, 'Samdrup Jongkhar', 'SJO', 1),
( 25, 'Samtse', 'SAT', 1),
( 25, 'Sarpang', 'SAR', 1),
( 25, 'Thimphu', 'THI', 1),
( 25, 'Trashigang', 'TRG', 1),
( 25, 'Trashiyangste', 'TRY', 1),
( 25, 'Trongsa', 'TRO', 1),
( 25, 'Tsirang', 'TSI', 1),
( 25, 'Wangdue Phodrang', 'WPH', 1),
( 25, 'Zhemgang', 'ZHE', 1),
( 26, 'Beni', 'BEN', 1),
( 26, 'Chuquisaca', 'CHU', 1),
( 26, 'Cochabamba', 'COC', 1),
( 26, 'La Paz', 'LPZ', 1),
( 26, 'Oruro', 'ORU', 1),
( 26, 'Pando', 'PAN', 1),
( 26, 'Potosi', 'POT', 1),
( 26, 'Santa Cruz', 'SCZ', 1),
( 26, 'Tarija', 'TAR', 1),
( 27, 'Brcko district', 'BRO', 1),
( 27, 'Unsko-Sanski Kanton', 'FUS', 1),
( 27, 'Posavski Kanton', 'FPO', 1),
( 27, 'Tuzlanski Kanton', 'FTU', 1),
( 27, 'Zenicko-Dobojski Kanton', 'FZE', 1),
( 27, 'Bosanskopodrinjski Kanton', 'FBP', 1),
( 27, 'Srednjebosanski Kanton', 'FSB', 1),
( 27, 'Hercegovacko-neretvanski Kanton', 'FHN', 1),
( 27, 'Zapadnohercegovacka Zupanija', 'FZH', 1),
( 27, 'Kanton Sarajevo', 'FSA', 1),
( 27, 'Zapadnobosanska', 'FZA', 1),
( 27, 'Banja Luka', 'SBL', 1),
( 27, 'Doboj', 'SDO', 1),
( 27, 'Bijeljina', 'SBI', 1),
( 27, 'Vlasenica', 'SVL', 1),
( 27, 'Sarajevo-Romanija or Sokolac', 'SSR', 1),
( 27, 'Foca', 'SFO', 1),
( 27, 'Trebinje', 'STR', 1),
( 28, 'Central', 'CE', 1),
( 28, 'Ghanzi', 'GH', 1),
( 28, 'Kgalagadi', 'KD', 1),
( 28, 'Kgatleng', 'KT', 1),
( 28, 'Kweneng', 'KW', 1),
( 28, 'Ngamiland', 'NG', 1),
( 28, 'North East', 'NE', 1),
( 28, 'North West', 'NW', 1),
( 28, 'South East', 'SE', 1),
( 28, 'Southern', 'SO', 1),
( 30, 'Acre', 'AC', 1),
( 30, 'Alagoas', 'AL', 1),
( 30, 'Amapá', 'AP', 1),
( 30, 'Amazonas', 'AM', 1),
( 30, 'Bahia', 'BA', 1),
( 30, 'Ceará', 'CE', 1),
( 30, 'Distrito Federal', 'DF', 1),
( 30, 'Espírito Santo', 'ES', 1),
( 30, 'Goiás', 'GO', 1),
( 30, 'Maranhão', 'MA', 1),
( 30, 'Mato Grosso', 'MT', 1),
( 30, 'Mato Grosso do Sul', 'MS', 1),
( 30, 'Minas Gerais', 'MG', 1),
( 30, 'Pará', 'PA', 1),
( 30, 'Paraíba', 'PB', 1),
( 30, 'Paraná', 'PR', 1),
( 30, 'Pernambuco', 'PE', 1),
( 30, 'Piauí', 'PI', 1),
( 30, 'Rio de Janeiro', 'RJ', 1),
( 30, 'Rio Grande do Norte', 'RN', 1),
( 30, 'Rio Grande do Sul', 'RS', 1),
( 30, 'Rondônia', 'RO', 1),
( 30, 'Roraima', 'RR', 1),
( 30, 'Santa Catarina', 'SC', 1),
( 30, 'São Paulo', 'SP', 1),
( 30, 'Sergipe', 'SE', 1),
( 30, 'Tocantins', 'TO', 1),
( 31, 'Peros Banhos', 'PB', 1),
( 31, 'Salomon Islands', 'SI', 1),
( 31, 'Nelsons Island', 'NI', 1),
( 31, 'Three Brothers', 'TB', 1),
( 31, 'Eagle Islands', 'EA', 1),
( 31, 'Danger Island', 'DI', 1),
( 31, 'Egmont Islands', 'EG', 1),
( 31, 'Diego Garcia', 'DG', 1),
( 32, 'Belait', 'BEL', 1),
( 32, 'Brunei and Muara', 'BRM', 1),
( 32, 'Temburong', 'TEM', 1),
( 32, 'Tutong', 'TUT', 1),
( 33, 'Blagoevgrad', '', 1),
( 33, 'Burgas', '', 1),
( 33, 'Dobrich', '', 1),
( 33, 'Gabrovo', '', 1),
( 33, 'Haskovo', '', 1),
( 33, 'Kardjali', '', 1),
( 33, 'Kyustendil', '', 1),
( 33, 'Lovech', '', 1),
( 33, 'Montana', '', 1),
( 33, 'Pazardjik', '', 1),
( 33, 'Pernik', '', 1),
( 33, 'Pleven', '', 1),
( 33, 'Plovdiv', '', 1),
( 33, 'Razgrad', '', 1),
( 33, 'Shumen', '', 1),
( 33, 'Silistra', '', 1),
( 33, 'Sliven', '', 1),
( 33, 'Smolyan', '', 1),
( 33, 'Sofia', '', 1),
( 33, 'Sofia - town', '', 1),
( 33, 'Stara Zagora', '', 1),
( 33, 'Targovishte', '', 1),
( 33, 'Varna', '', 1),
( 33, 'Veliko Tarnovo', '', 1),
( 33, 'Vidin', '', 1),
( 33, 'Vratza', '', 1),
( 33, 'Yambol', '', 1),
( 34, 'Bale', 'BAL', 1),
( 34, 'Bam', 'BAM', 1),
( 34, 'Banwa', 'BAN', 1),
( 34, 'Bazega', 'BAZ', 1),
( 34, 'Bougouriba', 'BOR', 1),
( 34, 'Boulgou', 'BLG', 1),
( 34, 'Boulkiemde', 'BOK', 1),
( 34, 'Comoe', 'COM', 1),
( 34, 'Ganzourgou', 'GAN', 1),
( 34, 'Gnagna', 'GNA', 1),
( 34, 'Gourma', 'GOU', 1),
( 34, 'Houet', 'HOU', 1),
( 34, 'Ioba', 'IOA', 1),
( 34, 'Kadiogo', 'KAD', 1),
( 34, 'Kenedougou', 'KEN', 1),
( 34, 'Komondjari', 'KOD', 1),
( 34, 'Kompienga', 'KOP', 1),
( 34, 'Kossi', 'KOS', 1),
( 34, 'Koulpelogo', 'KOL', 1),
( 34, 'Kouritenga', 'KOT', 1),
( 34, 'Kourweogo', 'KOW', 1),
( 34, 'Leraba', 'LER', 1),
( 34, 'Loroum', 'LOR', 1),
( 34, 'Mouhoun', 'MOU', 1),
( 34, 'Nahouri', 'NAH', 1),
( 34, 'Namentenga', 'NAM', 1),
( 34, 'Nayala', 'NAY', 1),
( 34, 'Noumbiel', 'NOU', 1),
( 34, 'Oubritenga', 'OUB', 1),
( 34, 'Oudalan', 'OUD', 1),
( 34, 'Passore', 'PAS', 1),
( 34, 'Poni', 'PON', 1),
( 34, 'Sanguie', 'SAG', 1),
( 34, 'Sanmatenga', 'SAM', 1),
( 34, 'Seno', 'SEN', 1),
( 34, 'Sissili', 'SIS', 1),
( 34, 'Soum', 'SOM', 1),
( 34, 'Sourou', 'SOR', 1),
( 34, 'Tapoa', 'TAP', 1),
( 34, 'Tuy', 'TUY', 1),
( 34, 'Yagha', 'YAG', 1),
( 34, 'Yatenga', 'YAT', 1),
( 34, 'Ziro', 'ZIR', 1),
( 34, 'Zondoma', 'ZOD', 1),
( 34, 'Zoundweogo', 'ZOW', 1),
( 35, 'Bubanza', 'BB', 1),
( 35, 'Bujumbura', 'BJ', 1),
( 35, 'Bururi', 'BR', 1),
( 35, 'Cankuzo', 'CA', 1),
( 35, 'Cibitoke', 'CI', 1),
( 35, 'Gitega', 'GI', 1),
( 35, 'Karuzi', 'KR', 1),
( 35, 'Kayanza', 'KY', 1),
( 35, 'Kirundo', 'KI', 1),
( 35, 'Makamba', 'MA', 1),
( 35, 'Muramvya', 'MU', 1),
( 35, 'Muyinga', 'MY', 1),
( 35, 'Mwaro', 'MW', 1),
( 35, 'Ngozi', 'NG', 1),
( 35, 'Rutana', 'RT', 1),
( 35, 'Ruyigi', 'RY', 1),
( 36, 'Phnom Penh', 'PP', 1),
( 36, 'Preah Seihanu (Kompong Som or Sihanoukville)',
'PS', 1),
( 36, 'Pailin', 'PA', 1),
( 36, 'Keb', 'KB', 1),
( 36, 'Banteay Meanchey', 'BM', 1),
( 36, 'Battambang', 'BA', 1),
( 36, 'Kampong Cham', 'KM', 1),
( 36, 'Kampong Chhnang', 'KN', 1),
( 36, 'Kampong Speu', 'KU', 1),
( 36, 'Kampong Som', 'KO', 1),
( 36, 'Kampong Thom', 'KT', 1),
( 36, 'Kampot', 'KP', 1),
( 36, 'Kandal', 'KL', 1),
( 36, 'Kaoh Kong', 'KK', 1),
( 36, 'Kratie', 'KR', 1),
( 36, 'Mondul Kiri', 'MK', 1),
( 36, 'Oddar Meancheay', 'OM', 1),
( 36, 'Pursat', 'PU', 1),
( 36, 'Preah Vihear', 'PR', 1),
( 36, 'Prey Veng', 'PG', 1),
( 36, 'Ratanak Kiri', 'RK', 1),
( 36, 'Siemreap', 'SI', 1),
( 36, 'Stung Treng', 'ST', 1),
( 36, 'Svay Rieng', 'SR', 1),
( 36, 'Takeo', 'TK', 1),
( 37, 'Adamawa (Adamaoua)', 'ADA', 1),
( 37, 'Centre', 'CEN', 1),
( 37, 'East (Est)', 'EST', 1),
( 37, 'Extreme North (Extreme-Nord)', 'EXN', 1),
( 37, 'Littoral', 'LIT', 1),
( 37, 'North (Nord)', 'NOR', 1),
( 37, 'Northwest (Nord-Ouest)', 'NOT', 1),
( 37, 'West (Ouest)', 'OUE', 1),
( 37, 'South (Sud)', 'SUD', 1),
( 37, 'Southwest (Sud-Ouest).', 'SOU', 1),
( 38, 'Alberta', 'AB', 1),
( 38, 'British Columbia', 'BC', 1),
( 38, 'Manitoba', 'MB', 1),
( 38, 'New Brunswick', 'NB', 1),
( 38, 'Newfoundland and Labrador', 'NL', 1),
( 38, 'Northwest Territories', 'NT', 1),
( 38, 'Nova Scotia', 'NS', 1),
( 38, 'Nunavut', 'NU', 1),
( 38, 'Ontario', 'ON', 1),
( 38, 'Prince Edward Island', 'PE', 1),
( 38, 'Québec', 'QC', 1),
( 38, 'Saskatchewan', 'SK', 1),
( 38, 'Yukon Territory', 'YT', 1),
( 39, 'Boa Vista', 'BV', 1),
( 39, 'Brava', 'BR', 1),
( 39, 'Calheta de Sao Miguel', 'CS', 1),
( 39, 'Maio', 'MA', 1),
( 39, 'Mosteiros', 'MO', 1),
( 39, 'Paul', 'PA', 1),
( 39, 'Porto Novo', 'PN', 1),
( 39, 'Praia', 'PR', 1),
( 39, 'Ribeira Grande', 'RG', 1),
( 39, 'Sal', 'SL', 1),
( 39, 'Santa Catarina', 'CA', 1),
( 39, 'Santa Cruz', 'CR', 1),
( 39, 'Sao Domingos', 'SD', 1),
( 39, 'Sao Filipe', 'SF', 1),
( 39, 'Sao Nicolau', 'SN', 1),
( 39, 'Sao Vicente', 'SV', 1),
( 39, 'Tarrafal', 'TA', 1),
( 40, 'Creek', 'CR', 1),
( 40, 'Eastern', 'EA', 1),
( 40, 'Midland', 'ML', 1),
( 40, 'South Town', 'ST', 1),
( 40, 'Spot Bay', 'SP', 1),
( 40, 'Stake Bay', 'SK', 1),
( 40, 'West End', 'WD', 1),
( 40, 'Western', 'WN', 1),
( 41, 'Bamingui-Bangoran', 'BBA', 1),
( 41, 'Basse-Kotto', 'BKO', 1),
( 41, 'Haute-Kotto', 'HKO', 1),
( 41, 'Haut-Mbomou', 'HMB', 1),
( 41, 'Kemo', 'KEM', 1),
( 41, 'Lobaye', 'LOB', 1),
( 41, 'Mambere-KadeÔ', 'MKD', 1),
( 41, 'Mbomou', 'MBO', 1),
( 41, 'Nana-Mambere', 'NMM', 1),
( 41, 'Ombella-M''Poko', 'OMP', 1),
( 41, 'Ouaka', 'OUK', 1),
( 41, 'Ouham', 'OUH', 1),
( 41, 'Ouham-Pende', 'OPE', 1),
( 41, 'Vakaga', 'VAK', 1),
( 41, 'Nana-Grebizi', 'NGR', 1),
( 41, 'Sangha-Mbaere', 'SMB', 1),
( 41, 'Bangui', 'BAN', 1),
( 42, 'Batha', 'BA', 1),
( 42, 'Biltine', 'BI', 1),
( 42, 'Borkou-Ennedi-Tibesti', 'BE', 1),
( 42, 'Chari-Baguirmi', 'CB', 1),
( 42, 'Guera', 'GU', 1),
( 42, 'Kanem', 'KA', 1),
( 42, 'Lac', 'LA', 1),
( 42, 'Logone Occidental', 'LC', 1),
( 42, 'Logone Oriental', 'LR', 1),
( 42, 'Mayo-Kebbi', 'MK', 1),
( 42, 'Moyen-Chari', 'MC', 1),
( 42, 'Ouaddai', 'OU', 1),
( 42, 'Salamat', 'SA', 1),
( 42, 'Tandjile', 'TA', 1),
( 43, 'Aisen del General Carlos Ibanez', 'AI', 1),
( 43, 'Antofagasta', 'AN', 1),
( 43, 'Araucania', 'AR', 1),
( 43, 'Atacama', 'AT', 1),
( 43, 'Bio-Bio', 'BI', 1),
( 43, 'Coquimbo', 'CO', 1),
( 43, 'Libertador General Bernardo O''Hi',
'LI', 1),
( 43, 'Los Lagos', 'LL', 1),
( 43, 'Magallanes y de la Antartica Chi', 'MA', 1),
( 43, 'Maule', 'ML', 1),
( 43, 'Region Metropolitana', 'RM', 1),
( 43, 'Tarapaca', 'TA', 1),
( 43, 'Valparaiso', 'VS', 1),
( 44, 'Anhui', 'AN', 1),
( 44, 'Beijing', 'BE', 1),
( 44, 'Chongqing', 'CH', 1),
( 44, 'Fujian', 'FU', 1),
( 44, 'Gansu', 'GA', 1),
( 44, 'Guangdong', 'GU', 1),
( 44, 'Guangxi', 'GX', 1),
( 44, 'Guizhou', 'GZ', 1),
( 44, 'Hainan', 'HA', 1),
( 44, 'Hebei', 'HB', 1),
( 44, 'Heilongjiang', 'HL', 1),
( 44, 'Henan', 'HE', 1),
( 44, 'Hong Kong', 'HK', 1),
( 44, 'Hubei', 'HU', 1),
( 44, 'Hunan', 'HN', 1),
( 44, 'Inner Mongolia', 'IM', 1),
( 44, 'Jiangsu', 'JI', 1),
( 44, 'Jiangxi', 'JX', 1),
( 44, 'Jilin', 'JL', 1),
( 44, 'Liaoning', 'LI', 1),
( 44, 'Macau', 'MA', 1),
( 44, 'Ningxia', 'NI', 1),
( 44, 'Shaanxi', 'SH', 1),
( 44, 'Shandong', 'SA', 1),
( 44, 'Shanghai', 'SG', 1),
( 44, 'Shanxi', 'SX', 1),
( 44, 'Sichuan', 'SI', 1),
( 44, 'Tianjin', 'TI', 1),
( 44, 'Xinjiang', 'XI', 1),
( 44, 'Yunnan', 'YU', 1),
( 44, 'Zhejiang', 'ZH', 1),
( 46, 'Direction Island', 'D', 1),
( 46, 'Home Island', 'H', 1),
( 46, 'Horsburgh Island', 'O', 1),
( 46, 'South Island', 'S', 1),
( 46, 'West Island', 'W', 1),
( 47, 'Amazonas', 'AMZ', 1),
( 47, 'Antioquia', 'ANT', 1),
( 47, 'Arauca', 'ARA', 1),
( 47, 'Atlantico', 'ATL', 1),
( 47, 'Bogota D.C.', 'BDC', 1),
( 47, 'Bolivar', 'BOL', 1),
( 47, 'Boyaca', 'BOY', 1),
( 47, 'Caldas', 'CAL', 1),
( 47, 'Caqueta', 'CAQ', 1),
( 47, 'Casanare', 'CAS', 1),
( 47, 'Cauca', 'CAU', 1),
( 47, 'Cesar', 'CES', 1),
( 47, 'Choco', 'CHO', 1),
( 47, 'Cordoba', 'COR', 1),
( 47, 'Cundinamarca', 'CAM', 1),
( 47, 'Guainia', 'GNA', 1),
( 47, 'Guajira', 'GJR', 1),
( 47, 'Guaviare', 'GVR', 1),
( 47, 'Huila', 'HUI', 1),
( 47, 'Magdalena', 'MAG', 1),
( 47, 'Meta', 'MET', 1),
( 47, 'Narino', 'NAR', 1),
( 47, 'Norte de Santander', 'NDS', 1),
( 47, 'Putumayo', 'PUT', 1),
( 47, 'Quindio', 'QUI', 1),
( 47, 'Risaralda', 'RIS', 1),
( 47, 'San Andres y Providencia', 'SAP', 1),
( 47, 'Santander', 'SAN', 1),
( 47, 'Sucre', 'SUC', 1),
( 47, 'Tolima', 'TOL', 1),
( 47, 'Valle del Cauca', 'VDC', 1),
( 47, 'Vaupes', 'VAU', 1),
( 47, 'Vichada', 'VIC', 1),
( 48, 'Grande Comore', 'G', 1),
( 48, 'Anjouan', 'A', 1),
( 48, 'Moheli', 'M', 1),
( 49, 'Bouenza', 'BO', 1),
( 49, 'Brazzaville', 'BR', 1),
( 49, 'Cuvette', 'CU', 1),
( 49, 'Cuvette-Ouest', 'CO', 1),
( 49, 'Kouilou', 'KO', 1),
( 49, 'Lekoumou', 'LE', 1),
( 49, 'Likouala', 'LI', 1),
( 49, 'Niari', 'NI', 1),
( 49, 'Plateaux', 'PL', 1),
( 49, 'Pool', 'PO', 1),
( 49, 'Sangha', 'SA', 1),
( 50, 'Pukapuka', 'PU', 1),
( 50, 'Rakahanga', 'RK', 1),
( 50, 'Manihiki', 'MK', 1),
( 50, 'Penrhyn', 'PE', 1),
( 50, 'Nassau Island', 'NI', 1),
( 50, 'Surwarrow', 'SU', 1),
( 50, 'Palmerston', 'PA', 1),
( 50, 'Aitutaki', 'AI', 1),
( 50, 'Manuae', 'MA', 1),
( 50, 'Takutea', 'TA', 1),
( 50, 'Mitiaro', 'MT', 1),
( 50, 'Atiu', 'AT', 1),
( 50, 'Mauke', 'MU', 1),
( 50, 'Rarotonga', 'RR', 1),
( 50, 'Mangaia', 'MG', 1),
( 51, 'Alajuela', 'AL', 1),
( 51, 'Cartago', 'CA', 1),
( 51, 'Guanacaste', 'GU', 1),
( 51, 'Heredia', 'HE', 1),
( 51, 'Limon', 'LI', 1),
( 51, 'Puntarenas', 'PU', 1),
( 51, 'San Jose', 'SJ', 1),
( 52, 'Abengourou', 'ABE', 1),
( 52, 'Abidjan', 'ABI', 1),
( 52, 'Aboisso', 'ABO', 1),
( 52, 'Adiake', 'ADI', 1),
( 52, 'Adzope', 'ADZ', 1),
( 52, 'Agboville', 'AGB', 1),
( 52, 'Agnibilekrou', 'AGN', 1),
( 52, 'Alepe', 'ALE', 1),
( 52, 'Bocanda', 'BOC', 1),
( 52, 'Bangolo', 'BAN', 1),
( 52, 'Beoumi', 'BEO', 1),
( 52, 'Biankouma', 'BIA', 1),
( 52, 'Bondoukou', 'BDK', 1),
( 52, 'Bongouanou', 'BGN', 1),
( 52, 'Bouafle', 'BFL', 1),
( 52, 'Bouake', 'BKE', 1),
( 52, 'Bouna', 'BNA', 1),
( 52, 'Boundiali', 'BDL', 1),
( 52, 'Dabakala', 'DKL', 1),
( 52, 'Dabou', 'DBU', 1),
( 52, 'Daloa', 'DAL', 1),
( 52, 'Danane', 'DAN', 1),
( 52, 'Daoukro', 'DAO', 1),
( 52, 'Dimbokro', 'DIM', 1),
( 52, 'Divo', 'DIV', 1),
( 52, 'Duekoue', 'DUE', 1),
( 52, 'Ferkessedougou', 'FER', 1),
( 52, 'Gagnoa', 'GAG', 1),
( 52, 'Grand-Bassam', 'GBA', 1),
( 52, 'Grand-Lahou', 'GLA', 1),
( 52, 'Guiglo', 'GUI', 1),
( 52, 'Issia', 'ISS', 1),
( 52, 'Jacqueville', 'JAC', 1),
( 52, 'Katiola', 'KAT', 1),
( 52, 'Korhogo', 'KOR', 1),
( 52, 'Lakota', 'LAK', 1),
( 52, 'Man', 'MAN', 1),
( 52, 'Mankono', 'MKN', 1),
( 52, 'Mbahiakro', 'MBA', 1),
( 52, 'Odienne', 'ODI', 1),
( 52, 'Oume', 'OUM', 1),
( 52, 'Sakassou', 'SAK', 1),
( 52, 'San-Pedro', 'SPE', 1),
( 52, 'Sassandra', 'SAS', 1),
( 52, 'Seguela', 'SEG', 1),
( 52, 'Sinfra', 'SIN', 1),
( 52, 'Soubre', 'SOU', 1),
( 52, 'Tabou', 'TAB', 1),
( 52, 'Tanda', 'TAN', 1),
( 52, 'Tiebissou', 'TIE', 1),
( 52, 'Tingrela', 'TIN', 1),
( 52, 'Tiassale', 'TIA', 1),
( 52, 'Touba', 'TBA', 1),
( 52, 'Toulepleu', 'TLP', 1),
( 52, 'Toumodi', 'TMD', 1),
( 52, 'Vavoua', 'VAV', 1),
( 52, 'Yamoussoukro', 'YAM', 1),
( 52, 'Zuenoula', 'ZUE', 1),
( 53, 'Bjelovar-Bilogora', 'BB', 1),
( 53, 'City of Zagreb', 'CZ', 1),
( 53, 'Dubrovnik-Neretva', 'DN', 1),
( 53, 'Istra', 'IS', 1),
( 53, 'Karlovac', 'KA', 1),
( 53, 'Koprivnica-Krizevci', 'KK', 1),
( 53, 'Krapina-Zagorje', 'KZ', 1),
( 53, 'Lika-Senj', 'LS', 1),
( 53, 'Medimurje', 'ME', 1),
( 53, 'Osijek-Baranja', 'OB', 1),
( 53, 'Pozega-Slavonia', 'PS', 1),
( 53, 'Primorje-Gorski Kotar', 'PG', 1),
( 53, 'Sibenik', 'SI', 1),
( 53, 'Sisak-Moslavina', 'SM', 1),
( 53, 'Slavonski Brod-Posavina', 'SB', 1),
( 53, 'Split-Dalmatia', 'SD', 1),
( 53, 'Varazdin', 'VA', 1),
( 53, 'Virovitica-Podravina', 'VP', 1),
( 53, 'Vukovar-Srijem', 'VS', 1),
( 53, 'Zadar-Knin', 'ZK', 1),
( 53, 'Zagreb', 'ZA', 1),
( 54, 'Camaguey', 'CA', 1),
( 54, 'Ciego de Avila', 'CD', 1),
( 54, 'Cienfuegos', 'CI', 1),
( 54, 'Ciudad de La Habana', 'CH', 1),
( 54, 'Granma', 'GR', 1),
( 54, 'Guantanamo', 'GU', 1),
( 54, 'Holguin', 'HO', 1),
( 54, 'Isla de la Juventud', 'IJ', 1),
( 54, 'La Habana', 'LH', 1),
( 54, 'Las Tunas', 'LT', 1),
( 54, 'Matanzas', 'MA', 1),
( 54, 'Pinar del Rio', 'PR', 1),
( 54, 'Sancti Spiritus', 'SS', 1),
( 54, 'Santiago de Cuba', 'SC', 1),
( 54, 'Villa Clara', 'VC', 1),
( 55, 'Famagusta', 'F', 1),
( 55, 'Kyrenia', 'K', 1),
( 55, 'Larnaca', 'A', 1),
( 55, 'Limassol', 'I', 1),
( 55, 'Nicosia', 'N', 1),
( 55, 'Paphos', 'P', 1),
( 56, 'Ústecký', 'U', 1),
( 56, 'Jihočeský', 'C', 1),
( 56, 'Jihomoravský', 'B', 1),
( 56, 'Karlovarský', 'K', 1),
( 56, 'Královehradecký', 'H', 1),
( 56, 'Liberecký', 'L', 1),
( 56, 'Moravskoslezský', 'T', 1),
( 56, 'Olomoucký', 'M', 1),
( 56, 'Pardubický', 'E', 1),
( 56, 'Plzeňský', 'P', 1),
( 56, 'Praha', 'A', 1),
( 56, 'Středočeský', 'S', 1),
( 56, 'Vysočina', 'J', 1),
( 56, 'Zlínský', 'Z', 1),
( 57, 'Arhus', 'AR', 1),
( 57, 'Bornholm', 'BH', 1),
( 57, 'Copenhagen', 'CO', 1),
( 57, 'Faroe Islands', 'FO', 1),
( 57, 'Frederiksborg', 'FR', 1),
( 57, 'Fyn', 'FY', 1),
( 57, 'Kobenhavn', 'KO', 1),
( 57, 'Nordjylland', 'NO', 1),
( 57, 'Ribe', 'RI', 1),
( 57, 'Ringkobing', 'RK', 1),
( 57, 'Roskilde', 'RO', 1),
( 57, 'Sonderjylland', 'SO', 1),
( 57, 'Storstrom', 'ST', 1),
( 57, 'Vejle', 'VK', 1),
( 57, 'Vestjælland', 'VJ', 1),
( 57, 'Viborg', 'VB', 1),
( 58, '''Ali Sabih', 'S', 1),
( 58, 'Dikhil', 'K', 1),
( 58, 'Djibouti', 'J', 1),
( 58, 'Obock', 'O', 1),
( 58, 'Tadjoura', 'T', 1),
( 59, 'Saint Andrew Parish', 'AND', 1),
( 59, 'Saint David Parish', 'DAV', 1),
( 59, 'Saint George Parish', 'GEO', 1),
( 59, 'Saint John Parish', 'JOH', 1),
( 59, 'Saint Joseph Parish', 'JOS', 1),
( 59, 'Saint Luke Parish', 'LUK', 1),
( 59, 'Saint Mark Parish', 'MAR', 1),
( 59, 'Saint Patrick Parish', 'PAT', 1),
( 59, 'Saint Paul Parish', 'PAU', 1),
( 59, 'Saint Peter Parish', 'PET', 1),
( 60, 'Distrito Nacional', 'DN', 1),
( 60, 'Azua', 'AZ', 1),
( 60, 'Baoruco', 'BC', 1),
( 60, 'Barahona', 'BH', 1),
( 60, 'Dajabon', 'DJ', 1),
( 60, 'Duarte', 'DU', 1),
( 60, 'Elias Pina', 'EL', 1),
( 60, 'El Seybo', 'SY', 1),
( 60, 'Espaillat', 'ET', 1),
( 60, 'Hato Mayor', 'HM', 1),
( 60, 'Independencia', 'IN', 1),
( 60, 'La Altagracia', 'AL', 1),
( 60, 'La Romana', 'RO', 1),
( 60, 'La Vega', 'VE', 1),
( 60, 'Maria Trinidad Sanchez', 'MT', 1),
( 60, 'Monsenor Nouel', 'MN', 1),
( 60, 'Monte Cristi', 'MC', 1),
( 60, 'Monte Plata', 'MP', 1),
( 60, 'Pedernales', 'PD', 1),
( 60, 'Peravia (Bani)', 'PR', 1),
( 60, 'Puerto Plata', 'PP', 1),
( 60, 'Salcedo', 'SL', 1),
( 60, 'Samana', 'SM', 1),
( 60, 'Sanchez Ramirez', 'SH', 1),
( 60, 'San Cristobal', 'SC', 1),
( 60, 'San Jose de Ocoa', 'JO', 1),
( 60, 'San Juan', 'SJ', 1),
( 60, 'San Pedro de Macoris', 'PM', 1),
( 60, 'Santiago', 'SA', 1),
( 60, 'Santiago Rodriguez', 'ST', 1),
( 60, 'Santo Domingo', 'SD', 1),
( 60, 'Valverde', 'VA', 1),
( 61, 'Aileu', 'AL', 1),
( 61, 'Ainaro', 'AN', 1),
( 61, 'Baucau', 'BA', 1),
( 61, 'Bobonaro', 'BO', 1),
( 61, 'Cova Lima', 'CO', 1),
( 61, 'Dili', 'DI', 1),
( 61, 'Ermera', 'ER', 1),
( 61, 'Lautem', 'LA', 1),
( 61, 'Liquica', 'LI', 1),
( 61, 'Manatuto', 'MT', 1),
( 61, 'Manufahi', 'MF', 1),
( 61, 'Oecussi', 'OE', 1),
( 61, 'Viqueque', 'VI', 1),
( 62, 'Azuay', 'AZU', 1),
( 62, 'Bolivar', 'BOL', 1),
( 62, 'Cañar', 'CAN', 1),
( 62, 'Carchi', 'CAR', 1),
( 62, 'Chimborazo', 'CHI', 1),
( 62, 'Cotopaxi', 'COT', 1),
( 62, 'El Oro', 'EOR', 1),
( 62, 'Esmeraldas', 'ESM', 1),
( 62, 'Galápagos', 'GPS', 1),
( 62, 'Guayas', 'GUA', 1),
( 62, 'Imbabura', 'IMB', 1),
( 62, 'Loja', 'LOJ', 1),
( 62, 'Los Rios', 'LRO', 1),
( 62, 'Manabí', 'MAN', 1),
( 62, 'Morona Santiago', 'MSA', 1),
( 62, 'Napo', 'NAP', 1),
( 62, 'Orellana', 'ORE', 1),
( 62, 'Pastaza', 'PAS', 1),
( 62, 'Pichincha', 'PIC', 1),
( 62, 'Sucumbíos', 'SUC', 1),
( 62, 'Tungurahua', 'TUN', 1),
( 62, 'Zamora Chinchipe', 'ZCH', 1),
( 63, 'Ad Daqahliyah', 'DHY', 1),
( 63, 'Al Bahr al Ahmar', 'BAM', 1),
( 63, 'Al Buhayrah', 'BHY', 1),
( 63, 'Al Fayyum', 'FYM', 1),
( 63, 'Al Gharbiyah', 'GBY', 1),
( 63, 'Al Iskandariyah', 'IDR', 1),
( 63, 'Al Isma''iliyah', 'IML', 1),
( 63, 'Al Jizah', 'JZH', 1),
( 63, 'Al Minufiyah', 'MFY', 1),
( 63, 'Al Minya', 'MNY', 1),
( 63, 'Al Qahirah', 'QHR', 1),
( 63, 'Al Qalyubiyah', 'QLY', 1),
( 63, 'Al Wadi al Jadid', 'WJD', 1),
( 63, 'Ash Sharqiyah', 'SHQ', 1),
( 63, 'As Suways', 'SWY', 1),
( 63, 'Aswan', 'ASW', 1),
( 63, 'Asyut', 'ASY', 1),
( 63, 'Bani Suwayf', 'BSW', 1),
( 63, 'Bur Sa''id', 'BSD', 1),
( 63, 'Dumyat', 'DMY', 1),
( 63, 'Janub Sina''', 'JNS', 1),
( 63, 'Kafr ash Shaykh', 'KSH', 1),
( 63, 'Matruh', 'MAT', 1),
( 63, 'Qina', 'QIN', 1),
( 63, 'Shamal Sina''', 'SHS', 1),
( 63, 'Suhaj', 'SUH', 1),
( 64, 'Ahuachapan', 'AH', 1),
( 64, 'Cabanas', 'CA', 1),
( 64, 'Chalatenango', 'CH', 1),
( 64, 'Cuscatlan', 'CU', 1),
( 64, 'La Libertad', 'LB', 1),
( 64, 'La Paz', 'PZ', 1),
( 64, 'La Union', 'UN', 1),
( 64, 'Morazan', 'MO', 1),
( 64, 'San Miguel', 'SM', 1),
( 64, 'San Salvador', 'SS', 1),
( 64, 'San Vicente', 'SV', 1),
( 64, 'Santa Ana', 'SA', 1),
( 64, 'Sonsonate', 'SO', 1),
( 64, 'Usulutan', 'US', 1),
( 65, 'Provincia Annobon', 'AN', 1),
( 65, 'Provincia Bioko Norte', 'BN', 1),
( 65, 'Provincia Bioko Sur', 'BS', 1),
( 65, 'Provincia Centro Sur', 'CS', 1),
( 65, 'Provincia Kie-Ntem', 'KN', 1),
( 65, 'Provincia Litoral', 'LI', 1),
( 65, 'Provincia Wele-Nzas', 'WN', 1),
( 66, 'Central (Maekel)', 'MA', 1),
( 66, 'Anseba (Keren)', 'KE', 1),
( 66, 'Southern Red Sea (Debub-Keih-Bahri)', 'DK', 1),
( 66, 'Northern Red Sea (Semien-Keih-Bahri)', 'SK',
1),
( 66, 'Southern (Debub)', 'DE', 1),
( 66, 'Gash-Barka (Barentu)', 'BR', 1),
( 67, 'Harjumaa (Tallinn)', 'HA', 1),
( 67, 'Hiiumaa (Kardla)', 'HI', 1),
( 67, 'Ida-Virumaa (Johvi)', 'IV', 1),
( 67, 'Jarvamaa (Paide)', 'JA', 1),
( 67, 'Jogevamaa (Jogeva)', 'JO', 1),
( 67, 'Laane-Virumaa (Rakvere)', 'LV', 1),
( 67, 'Laanemaa (Haapsalu)', 'LA', 1),
( 67, 'Parnumaa (Parnu)', 'PA', 1),
( 67, 'Polvamaa (Polva)', 'PO', 1),
( 67, 'Raplamaa (Rapla)', 'RA', 1),
( 67, 'Saaremaa (Kuessaare)', 'SA', 1),
( 67, 'Tartumaa (Tartu)', 'TA', 1),
( 67, 'Valgamaa (Valga)', 'VA', 1),
( 67, 'Viljandimaa (Viljandi)', 'VI', 1),
( 67, 'Vorumaa (Voru)', 'VO', 1),
( 68, 'Afar', 'AF', 1),
( 68, 'Amhara', 'AH', 1),
( 68, 'Benishangul-Gumaz', 'BG', 1),
( 68, 'Gambela', 'GB', 1),
( 68, 'Hariai', 'HR', 1),
( 68, 'Oromia', 'OR', 1),
( 68, 'Somali', 'SM', 1),
( 68, 'Southern Nations - Nationalities and Peoples Region',
'SN', 1),
( 68, 'Tigray', 'TG', 1),
( 68, 'Addis Ababa', 'AA', 1),
( 68, 'Dire Dawa', 'DD', 1),
( 71, 'Central Division', 'C', 1),
( 71, 'Northern Division', 'N', 1),
( 71, 'Eastern Division', 'E', 1),
( 71, 'Western Division', 'W', 1),
( 71, 'Rotuma', 'R', 1),
( 72, 'Ahvenanmaan Laani', 'AL', 1),
( 72, 'Etela-Suomen Laani', 'ES', 1),
( 72, 'Ita-Suomen Laani', 'IS', 1),
( 72, 'Lansi-Suomen Laani', 'LS', 1),
( 72, 'Lapin Lanani', 'LA', 1),
( 72, 'Oulun Laani', 'OU', 1),
( 74, 'Ain', '01', 1),
( 74, 'Aisne', '02', 1),
( 74, 'Allier', '03', 1),
( 74, 'Alpes de Haute Provence', '04', 1),
( 74, 'Hautes-Alpes', '05', 1),
( 74, 'Alpes Maritimes', '06', 1),
( 74, 'Ardèche', '07', 1),
( 74, 'Ardennes', '08', 1),
( 74, 'Ariège', '09', 1),
( 74, 'Aube', '10', 1),
( 74, 'Aude', '11', 1),
( 74, 'Aveyron', '12', 1),
( 74, 'Bouches du Rhône', '13', 1),
( 74, 'Calvados', '14', 1),
( 74, 'Cantal', '15', 1),
( 74, 'Charente', '16', 1),
( 74, 'Charente Maritime', '17', 1),
( 74, 'Cher', '18', 1),
( 74, 'Corrèze', '19', 1),
( 74, 'Corse du Sud', '2A', 1),
( 74, 'Haute Corse', '2B', 1),
( 74, 'Côte d'or', '21', 1),
( 74, 'Côtes d'Armor', '22', 1),
( 74, 'Creuse', '23', 1),
( 74, 'Dordogne', '24', 1),
( 74, 'Doubs', '25', 1),
( 74, 'Drôme', '26', 1),
( 74, 'Eure', '27', 1),
( 74, 'Eure et Loir', '28', 1),
( 74, 'Finistère', '29', 1),
( 74, 'Gard', '30', 1),
( 74, 'Haute Garonne', '31', 1),
( 74, 'Gers', '32', 1),
( 74, 'Gironde', '33', 1),
( 74, 'Hérault', '34', 1),
( 74, 'Ille et Vilaine', '35', 1),
( 74, 'Indre', '36', 1),
( 74, 'Indre et Loire', '37', 1),
( 74, 'Isére', '38', 1),
( 74, 'Jura', '39', 1),
( 74, 'Landes', '40', 1),
( 74, 'Loir et Cher', '41', 1),
( 74, 'Loire', '42', 1),
( 74, 'Haute Loire', '43', 1),
( 74, 'Loire Atlantique', '44', 1),
( 74, 'Loiret', '45', 1),
( 74, 'Lot', '46', 1),
( 74, 'Lot et Garonne', '47', 1),
( 74, 'Lozère', '48', 1),
( 74, 'Maine et Loire', '49', 1),
( 74, 'Manche', '50', 1),
( 74, 'Marne', '51', 1),
( 74, 'Haute Marne', '52', 1),
( 74, 'Mayenne', '53', 1),
( 74, 'Meurthe et Moselle', '54', 1),
( 74, 'Meuse', '55', 1),
( 74, 'Morbihan', '56', 1),
( 74, 'Moselle', '57', 1),
( 74, 'Nièvre', '58', 1),
( 74, 'Nord', '59', 1),
( 74, 'Oise', '60', 1),
( 74, 'Orne', '61', 1),
( 74, 'Pas de Calais', '62', 1),
( 74, 'Puy de Dôme', '63', 1),
( 74, 'Pyrénées Atlantiques',
'64', 1),
( 74, 'Hautes Pyrénées', '65',
1),
( 74, 'Pyrénées Orientales',
'66', 1),
( 74, 'Bas Rhin', '67', 1),
( 74, 'Haut Rhin', '68', 1),
( 74, 'Rhône', '69', 1),
( 74, 'Haute Saône', '70', 1),
( 74, 'Saône et Loire', '71', 1),
( 74, 'Sarthe', '72', 1),
( 74, 'Savoie', '73', 1),
( 74, 'Haute Savoie', '74', 1),
( 74, 'Paris', '75', 1),
( 74, 'Seine Maritime', '76', 1),
( 74, 'Seine et Marne', '77', 1),
( 74, 'Yvelines', '78', 1),
( 74, 'Deux Sèvres', '79', 1),
( 74, 'Somme', '80', 1),
( 74, 'Tarn', '81', 1),
( 74, 'Tarn et Garonne', '82', 1),
( 74, 'Var', '83', 1),
( 74, 'Vaucluse', '84', 1),
( 74, 'Vendée', '85', 1),
( 74, 'Vienne', '86', 1),
( 74, 'Haute Vienne', '87', 1),
( 74, 'Vosges', '88', 1),
( 74, 'Yonne', '89', 1),
( 74, 'Territoire de Belfort', '90', 1),
( 74, 'Essonne', '91', 1),
( 74, 'Hauts de Seine', '92', 1),
( 74, 'Seine St-Denis', '93', 1),
( 74, 'Val de Marne', '94', 1),
( 74, 'Val d''Oise', '95', 1),
( 76, 'Archipel des Marquises', 'M', 1),
( 76, 'Archipel des Tuamotu', 'T', 1),
( 76, 'Archipel des Tubuai', 'I', 1),
( 76, 'Iles du Vent', 'V', 1),
( 76, 'Iles Sous-le-Vent', 'S', 1),
( 77, 'Iles Crozet', 'C', 1),
( 77, 'Iles Kerguelen', 'K', 1),
( 77, 'Ile Amsterdam', 'A', 1),
( 77, 'Ile Saint-Paul', 'P', 1),
( 77, 'Adelie Land', 'D', 1),
( 78, 'Estuaire', 'ES', 1),
( 78, 'Haut-Ogooue', 'HO', 1),
( 78, 'Moyen-Ogooue', 'MO', 1),
( 78, 'Ngounie', 'NG', 1),
( 78, 'Nyanga', 'NY', 1),
( 78, 'Ogooue-Ivindo', 'OI', 1),
( 78, 'Ogooue-Lolo', 'OL', 1),
( 78, 'Ogooue-Maritime', 'OM', 1),
( 78, 'Woleu-Ntem', 'WN', 1),
( 79, 'Banjul', 'BJ', 1),
( 79, 'Basse', 'BS', 1),
( 79, 'Brikama', 'BR', 1),
( 79, 'Janjangbure', 'JA', 1),
( 79, 'Kanifeng', 'KA', 1),
( 79, 'Kerewan', 'KE', 1),
( 79, 'Kuntaur', 'KU', 1),
( 79, 'Mansakonko', 'MA', 1),
( 79, 'Lower River', 'LR', 1),
( 79, 'Central River', 'CR', 1),
( 79, 'North Bank', 'NB', 1),
( 79, 'Upper River', 'UR', 1),
( 79, 'Western', 'WE', 1),
( 80, 'Abkhazia', 'AB', 1),
( 80, 'Ajaria', 'AJ', 1),
( 80, 'Tbilisi', 'TB', 1),
( 80, 'Guria', 'GU', 1),
( 80, 'Imereti', 'IM', 1),
( 80, 'Kakheti', 'KA', 1),
( 80, 'Kvemo Kartli', 'KK', 1),
( 80, 'Mtskheta-Mtianeti', 'MM', 1),
( 80, 'Racha Lechkhumi and Kvemo Svanet', 'RL', 1),
( 80, 'Samegrelo-Zemo Svaneti', 'SZ', 1),
( 80, 'Samtskhe-Javakheti', 'SJ', 1),
( 80, 'Shida Kartli', 'SK', 1),
( 81, 'Baden-Württemberg', 'BAW', 1),
( 81, 'Bayern', 'BAY', 1),
( 81, 'Berlin', 'BER', 1),
( 81, 'Brandenburg', 'BRG', 1),
( 81, 'Bremen', 'BRE', 1),
( 81, 'Hamburg', 'HAM', 1),
( 81, 'Hessen', 'HES', 1),
( 81, 'Mecklenburg-Vorpommern', 'MEC', 1),
( 81, 'Niedersachsen', 'NDS', 1),
( 81, 'Nordrhein-Westfalen', 'NRW', 1),
( 81, 'Rheinland-Pfalz', 'RHE', 1),
( 81, 'Saarland', 'SAR', 1),
( 81, 'Sachsen', 'SAS', 1),
( 81, 'Sachsen-Anhalt', 'SAC', 1),
( 81, 'Schleswig-Holstein', 'SCN', 1),
( 81, 'Thüringen', 'THE', 1),
( 82, 'Ashanti Region', 'AS', 1),
( 82, 'Brong-Ahafo Region', 'BA', 1),
( 82, 'Central Region', 'CE', 1),
( 82, 'Eastern Region', 'EA', 1),
( 82, 'Greater Accra Region', 'GA', 1),
( 82, 'Northern Region', 'NO', 1),
( 82, 'Upper East Region', 'UE', 1),
( 82, 'Upper West Region', 'UW', 1),
( 82, 'Volta Region', 'VO', 1),
( 82, 'Western Region', 'WE', 1),
( 84, 'Attica', 'AT', 1),
( 84, 'Central Greece', 'CN', 1),
( 84, 'Central Macedonia', 'CM', 1),
( 84, 'Crete', 'CR', 1),
( 84, 'East Macedonia and Thrace', 'EM', 1),
( 84, 'Epirus', 'EP', 1),
( 84, 'Ionian Islands', 'II', 1),
( 84, 'North Aegean', 'NA', 1),
( 84, 'Peloponnesos', 'PP', 1),
( 84, 'South Aegean', 'SA', 1),
( 84, 'Thessaly', 'TH', 1),
( 84, 'West Greece', 'WG', 1),
( 84, 'West Macedonia', 'WM', 1),
( 85, 'Avannaa', 'A', 1),
( 85, 'Tunu', 'T', 1),
( 85, 'Kitaa', 'K', 1),
( 86, 'Saint Andrew', 'A', 1),
( 86, 'Saint David', 'D', 1),
( 86, 'Saint George', 'G', 1),
( 86, 'Saint John', 'J', 1),
( 86, 'Saint Mark', 'M', 1),
( 86, 'Saint Patrick', 'P', 1),
( 86, 'Carriacou', 'C', 1),
( 86, 'Petit Martinique', 'Q', 1),
( 89, 'Alta Verapaz', 'AV', 1),
( 89, 'Baja Verapaz', 'BV', 1),
( 89, 'Chimaltenango', 'CM', 1),
( 89, 'Chiquimula', 'CQ', 1),
( 89, 'El Peten', 'PE', 1),
( 89, 'El Progreso', 'PR', 1),
( 89, 'El Quiche', 'QC', 1),
( 89, 'Escuintla', 'ES', 1),
( 89, 'Guatemala', 'GU', 1),
( 89, 'Huehuetenango', 'HU', 1),
( 89, 'Izabal', 'IZ', 1),
( 89, 'Jalapa', 'JA', 1),
( 89, 'Jutiapa', 'JU', 1),
( 89, 'Quetzaltenango', 'QZ', 1),
( 89, 'Retalhuleu', 'RE', 1),
( 89, 'Sacatepequez', 'ST', 1),
( 89, 'San Marcos', 'SM', 1),
( 89, 'Santa Rosa', 'SR', 1),
( 89, 'Solola', 'SO', 1),
( 89, 'Suchitepequez', 'SU', 1),
( 89, 'Totonicapan', 'TO', 1),
( 89, 'Zacapa', 'ZA', 1),
( 90, 'Conakry', 'CNK', 1),
( 90, 'Beyla', 'BYL', 1),
( 90, 'Boffa', 'BFA', 1),
( 90, 'Boke', 'BOK', 1),
( 90, 'Coyah', 'COY', 1),
( 90, 'Dabola', 'DBL', 1),
( 90, 'Dalaba', 'DLB', 1),
( 90, 'Dinguiraye', 'DGR', 1),
( 90, 'Dubreka', 'DBR', 1),
( 90, 'Faranah', 'FRN', 1),
( 90, 'Forecariah', 'FRC', 1),
( 90, 'Fria', 'FRI', 1),
( 90, 'Gaoual', 'GAO', 1),
( 90, 'Gueckedou', 'GCD', 1),
( 90, 'Kankan', 'KNK', 1),
( 90, 'Kerouane', 'KRN', 1),
( 90, 'Kindia', 'KND', 1),
( 90, 'Kissidougou', 'KSD', 1),
( 90, 'Koubia', 'KBA', 1),
( 90, 'Koundara', 'KDA', 1),
( 90, 'Kouroussa', 'KRA', 1),
( 90, 'Labe', 'LAB', 1),
( 90, 'Lelouma', 'LLM', 1),
( 90, 'Lola', 'LOL', 1),
( 90, 'Macenta', 'MCT', 1),
( 90, 'Mali', 'MAL', 1),
( 90, 'Mamou', 'MAM', 1),
( 90, 'Mandiana', 'MAN', 1),
( 90, 'Nzerekore', 'NZR', 1),
( 90, 'Pita', 'PIT', 1),
( 90, 'Siguiri', 'SIG', 1),
( 90, 'Telimele', 'TLM', 1),
( 90, 'Tougue', 'TOG', 1),
( 90, 'Yomou', 'YOM', 1),
( 91, 'Bafata Region', 'BF', 1),
( 91, 'Biombo Region', 'BB', 1),
( 91, 'Bissau Region', 'BS', 1),
( 91, 'Bolama Region', 'BL', 1),
( 91, 'Cacheu Region', 'CA', 1),
( 91, 'Gabu Region', 'GA', 1),
( 91, 'Oio Region', 'OI', 1),
( 91, 'Quinara Region', 'QU', 1),
( 91, 'Tombali Region', 'TO', 1),
( 92, 'Barima-Waini', 'BW', 1),
( 92, 'Cuyuni-Mazaruni', 'CM', 1),
( 92, 'Demerara-Mahaica', 'DM', 1),
( 92, 'East Berbice-Corentyne', 'EC', 1),
( 92, 'Essequibo Islands-West Demerara', 'EW', 1),
( 92, 'Mahaica-Berbice', 'MB', 1),
( 92, 'Pomeroon-Supenaam', 'PM', 1),
( 92, 'Potaro-Siparuni', 'PI', 1),
( 92, 'Upper Demerara-Berbice', 'UD', 1),
( 92, 'Upper Takutu-Upper Essequibo', 'UT', 1),
( 93, 'Artibonite', 'AR', 1),
( 93, 'Centre', 'CE', 1),
( 93, 'Grand''Anse', 'GA', 1),
( 93, 'Nord', 'ND', 1),
( 93, 'Nord-Est', 'NE', 1),
( 93, 'Nord-Ouest', 'NO', 1),
( 93, 'Ouest', 'OU', 1),
( 93, 'Sud', 'SD', 1),
( 93, 'Sud-Est', 'SE', 1),
( 94, 'Flat Island', 'F', 1),
( 94, 'McDonald Island', 'M', 1),
( 94, 'Shag Island', 'S', 1),
( 94, 'Heard Island', 'H', 1),
( 95, 'Atlantida', 'AT', 1),
( 95, 'Choluteca', 'CH', 1),
( 95, 'Colon', 'CL', 1),
( 95, 'Comayagua', 'CM', 1),
( 95, 'Copan', 'CP', 1),
( 95, 'Cortes', 'CR', 1),
( 95, 'El Paraiso', 'PA', 1),
( 95, 'Francisco Morazan', 'FM', 1),
( 95, 'Gracias a Dios', 'GD', 1),
( 95, 'Intibuca', 'IN', 1),
( 95, 'Islas de la Bahia (Bay Islands)', 'IB', 1),
( 95, 'La Paz', 'PZ', 1),
( 95, 'Lempira', 'LE', 1),
( 95, 'Ocotepeque', 'OC', 1),
( 95, 'Olancho', 'OL', 1),
( 95, 'Santa Barbara', 'SB', 1),
( 95, 'Valle', 'VA', 1),
( 95, 'Yoro', 'YO', 1),
( 96, 'Central and Western Hong Kong Island', 'HCW',
1),
( 96, 'Eastern Hong Kong Island', 'HEA', 1),
( 96, 'Southern Hong Kong Island', 'HSO', 1),
( 96, 'Wan Chai Hong Kong Island', 'HWC', 1),
( 96, 'Kowloon City Kowloon', 'KKC', 1),
( 96, 'Kwun Tong Kowloon', 'KKT', 1),
( 96, 'Sham Shui Po Kowloon', 'KSS', 1),
( 96, 'Wong Tai Sin Kowloon', 'KWT', 1),
( 96, 'Yau Tsim Mong Kowloon', 'KYT', 1),
( 96, 'Islands New Territories', 'NIS', 1),
( 96, 'Kwai Tsing New Territories', 'NKT', 1),
( 96, 'North New Territories', 'NNO', 1),
( 96, 'Sai Kung New Territories', 'NSK', 1),
( 96, 'Sha Tin New Territories', 'NST', 1),
( 96, 'Tai Po New Territories', 'NTP', 1),
( 96, 'Tsuen Wan New Territories', 'NTW', 1),
( 96, 'Tuen Mun New Territories', 'NTM', 1),
( 96, 'Yuen Long New Territories', 'NYL', 1),
( 97, 'Bacs-Kiskun', 'BK', 1),
( 97, 'Baranya', 'BA', 1),
( 97, 'Bekes', 'BE', 1),
( 97, 'Bekescsaba', 'BS', 1),
( 97, 'Borsod-Abauj-Zemplen', 'BZ', 1),
( 97, 'Budapest', 'BU', 1),
( 97, 'Csongrad', 'CS', 1),
( 97, 'Debrecen', 'DE', 1),
( 97, 'Dunaujvaros', 'DU', 1),
( 97, 'Eger', 'EG', 1),
( 97, 'Fejer', 'FE', 1),
( 97, 'Gyor', 'GY', 1),
( 97, 'Gyor-Moson-Sopron', 'GM', 1),
( 97, 'Hajdu-Bihar', 'HB', 1),
( 97, 'Heves', 'HE', 1),
( 97, 'Hodmezovasarhely', 'HO', 1),
( 97, 'Jasz-Nagykun-Szolnok', 'JN', 1),
( 97, 'Kaposvar', 'KA', 1),
( 97, 'Kecskemet', 'KE', 1),
( 97, 'Komarom-Esztergom', 'KO', 1),
( 97, 'Miskolc', 'MI', 1),
( 97, 'Nagykanizsa', 'NA', 1),
( 97, 'Nograd', 'NO', 1),
( 97, 'Nyiregyhaza', 'NY', 1),
( 97, 'Pecs', 'PE', 1),
( 97, 'Pest', 'PS', 1),
( 97, 'Somogy', 'SO', 1),
( 97, 'Sopron', 'SP', 1),
( 97, 'Szabolcs-Szatmar-Bereg', 'SS', 1),
( 97, 'Szeged', 'SZ', 1),
( 97, 'Szekesfehervar', 'SE', 1),
( 97, 'Szolnok', 'SL', 1),
( 97, 'Szombathely', 'SM', 1),
( 97, 'Tatabanya', 'TA', 1),
( 97, 'Tolna', 'TO', 1),
( 97, 'Vas', 'VA', 1),
( 97, 'Veszprem', 'VE', 1),
( 97, 'Zala', 'ZA', 1),
( 97, 'Zalaegerszeg', 'ZZ', 1),
( 98, 'Austurland', 'AL', 1),
( 98, 'Hofuoborgarsvaeoi', 'HF', 1),
( 98, 'Norourland eystra', 'NE', 1),
( 98, 'Norourland vestra', 'NV', 1),
( 98, 'Suourland', 'SL', 1),
( 98, 'Suournes', 'SN', 1),
( 98, 'Vestfiroir', 'VF', 1),
( 98, 'Vesturland', 'VL', 1),
( 99, 'Andaman and Nicobar Islands', 'AN', 1),
( 99, 'Andhra Pradesh', 'AP', 1),
( 99, 'Arunachal Pradesh', 'AR', 1),
( 99, 'Assam', 'AS', 1),
( 99, 'Bihar', 'BI', 1),
( 99, 'Chandigarh', 'CH', 1),
( 99, 'Dadra and Nagar Haveli', 'DA', 1),
( 99, 'Daman and Diu', 'DM', 1),
( 99, 'Delhi', 'DE', 1),
( 99, 'Goa', 'GO', 1),
( 99, 'Gujarat', 'GU', 1),
( 99, 'Haryana', 'HA', 1),
( 99, 'Himachal Pradesh', 'HP', 1),
( 99, 'Jammu and Kashmir', 'JA', 1),
( 99, 'Karnataka', 'KA', 1),
( 99, 'Kerala', 'KE', 1),
( 99, 'Lakshadweep Islands', 'LI', 1),
( 99, 'Madhya Pradesh', 'MP', 1),
( 99, 'Maharashtra', 'MA', 1),
( 99, 'Manipur', 'MN', 1),
( 99, 'Meghalaya', 'ME', 1),
( 99, 'Mizoram', 'MI', 1),
( 99, 'Nagaland', 'NA', 1),
( 99, 'Orissa', 'OR', 1),
( 99, 'Pondicherry', 'PO', 1),
( 99, 'Punjab', 'PU', 1),
( 99, 'Rajasthan', 'RA', 1),
( 99, 'Sikkim', 'SI', 1),
( 99, 'Tamil Nadu', 'TN', 1),
( 99, 'Tripura', 'TR', 1),
( 99, 'Uttar Pradesh', 'UP', 1),
( 99, 'West Bengal', 'WB', 1),
( 100, 'Aceh', 'AC', 1),
( 100, 'Bali', 'BA', 1),
( 100, 'Banten', 'BT', 1),
( 100, 'Bengkulu', 'BE', 1),
( 100, 'BoDeTaBek', 'BD', 1),
( 100, 'Gorontalo', 'GO', 1),
( 100, 'Jakarta Raya', 'JK', 1),
( 100, 'Jambi', 'JA', 1),
( 100, 'Jawa Barat', 'JB', 1),
( 100, 'Jawa Tengah', 'JT', 1),
( 100, 'Jawa Timur', 'JI', 1),
( 100, 'Kalimantan Barat', 'KB', 1),
( 100, 'Kalimantan Selatan', 'KS', 1),
( 100, 'Kalimantan Tengah', 'KT', 1),
( 100, 'Kalimantan Timur', 'KI', 1),
( 100, 'Kepulauan Bangka Belitung', 'BB', 1),
( 100, 'Lampung', 'LA', 1),
( 100, 'Maluku', 'MA', 1),
( 100, 'Maluku Utara', 'MU', 1),
( 100, 'Nusa Tenggara Barat', 'NB', 1),
( 100, 'Nusa Tenggara Timur', 'NT', 1),
( 100, 'Papua', 'PA', 1),
( 100, 'Riau', 'RI', 1),
( 100, 'Sulawesi Selatan', 'SN', 1),
( 100, 'Sulawesi Tengah', 'ST', 1),
( 100, 'Sulawesi Tenggara', 'SG', 1),
( 100, 'Sulawesi Utara', 'SA', 1),
( 100, 'Sumatera Barat', 'SB', 1),
( 100, 'Sumatera Selatan', 'SS', 1),
( 100, 'Sumatera Utara', 'SU', 1),
( 100, 'Yogyakarta', 'YO', 1),
( 101, 'Tehran', 'TEH', 1),
( 101, 'Qom', 'QOM', 1),
( 101, 'Markazi', 'MKZ', 1),
( 101, 'Qazvin', 'QAZ', 1),
( 101, 'Gilan', 'GIL', 1),
( 101, 'Ardabil', 'ARD', 1),
( 101, 'Zanjan', 'ZAN', 1),
( 101, 'East Azarbaijan', 'EAZ', 1),
( 101, 'West Azarbaijan', 'WEZ', 1),
( 101, 'Kurdistan', 'KRD', 1),
( 101, 'Hamadan', 'HMD', 1),
( 101, 'Kermanshah', 'KRM', 1),
( 101, 'Ilam', 'ILM', 1),
( 101, 'Lorestan', 'LRS', 1),
( 101, 'Khuzestan', 'KZT', 1),
( 101, 'Chahar Mahaal and Bakhtiari', 'CMB', 1),
( 101, 'Kohkiluyeh and Buyer Ahmad', 'KBA', 1),
( 101, 'Bushehr', 'BSH', 1),
( 101, 'Fars', 'FAR', 1),
( 101, 'Hormozgan', 'HRM', 1),
( 101, 'Sistan and Baluchistan', 'SBL', 1);
INSERT INTO `#__phocacart_regions` (`country_id`, `title`, `code3`,
`published`) VALUES
( 101, 'Kerman', 'KRB', 1),
( 101, 'Yazd', 'YZD', 1),
( 101, 'Esfahan', 'EFH', 1),
( 101, 'Semnan', 'SMN', 1),
( 101, 'Mazandaran', 'MZD', 1),
( 101, 'Golestan', 'GLS', 1),
( 101, 'North Khorasan', 'NKH', 1),
( 101, 'Razavi Khorasan', 'RKH', 1),
( 101, 'South Khorasan', 'SKH', 1),
( 102, 'Baghdad', 'BD', 1),
( 102, 'Salah ad Din', 'SD', 1),
( 102, 'Diyala', 'DY', 1),
( 102, 'Wasit', 'WS', 1),
( 102, 'Maysan', 'MY', 1),
( 102, 'Al Basrah', 'BA', 1),
( 102, 'Dhi Qar', 'DQ', 1),
( 102, 'Al Muthanna', 'MU', 1),
( 102, 'Al Qadisyah', 'QA', 1),
( 102, 'Babil', 'BB', 1),
( 102, 'Al Karbala', 'KB', 1),
( 102, 'An Najaf', 'NJ', 1),
( 102, 'Al Anbar', 'AB', 1),
( 102, 'Ninawa', 'NN', 1),
( 102, 'Dahuk', 'DH', 1),
( 102, 'Arbil', 'AL', 1),
( 102, 'At Ta''mim', 'TM', 1),
( 102, 'As Sulaymaniyah', 'SL', 1),
( 103, 'Carlow', 'CA', 1),
( 103, 'Cavan', 'CV', 1),
( 103, 'Clare', 'CL', 1),
( 103, 'Cork', 'CO', 1),
( 103, 'Donegal', 'DO', 1),
( 103, 'Dublin', 'DU', 1),
( 103, 'Galway', 'GA', 1),
( 103, 'Kerry', 'KE', 1),
( 103, 'Kildare', 'KI', 1),
( 103, 'Kilkenny', 'KL', 1),
( 103, 'Laois', 'LA', 1),
( 103, 'Leitrim', 'LE', 1),
( 103, 'Limerick', 'LI', 1),
( 103, 'Longford', 'LO', 1),
( 103, 'Louth', 'LU', 1),
( 103, 'Mayo', 'MA', 1),
( 103, 'Meath', 'ME', 1),
( 103, 'Monaghan', 'MO', 1),
( 103, 'Offaly', 'OF', 1),
( 103, 'Roscommon', 'RO', 1),
( 103, 'Sligo', 'SL', 1),
( 103, 'Tipperary', 'TI', 1),
( 103, 'Waterford', 'WA', 1),
( 103, 'Westmeath', 'WE', 1),
( 103, 'Wexford', 'WX', 1),
( 103, 'Wicklow', 'WI', 1),
( 104, 'Be''er Sheva', 'BS', 1),
( 104, 'Bika''at Hayarden', 'BH', 1),
( 104, 'Eilat and Arava', 'EA', 1),
( 104, 'Galil', 'GA', 1),
( 104, 'Haifa', 'HA', 1),
( 104, 'Jehuda Mountains', 'JM', 1),
( 104, 'Jerusalem', 'JE', 1),
( 104, 'Negev', 'NE', 1),
( 104, 'Semaria', 'SE', 1),
( 104, 'Sharon', 'SH', 1),
( 104, 'Tel Aviv (Gosh Dan)', 'TA', 1),
( 105, 'Caltanissetta', 'CL', 1),
( 105, 'Agrigento', 'AG', 1),
( 105, 'Alessandria', 'AL', 1),
( 105, 'Ancona', 'AN', 1),
( 105, 'Aosta', 'AO', 1),
( 105, 'Arezzo', 'AR', 1),
( 105, 'Ascoli Piceno', 'AP', 1),
( 105, 'Asti', 'AT', 1),
( 105, 'Avellino', 'AV', 1),
( 105, 'Bari', 'BA', 1),
( 105, 'Belluno', 'BL', 1),
( 105, 'Benevento', 'BN', 1),
( 105, 'Bergamo', 'BG', 1),
( 105, 'Biella', 'BI', 1),
( 105, 'Bologna', 'BO', 1),
( 105, 'Bolzano', 'BZ', 1),
( 105, 'Brescia', 'BS', 1),
( 105, 'Brindisi', 'BR', 1),
( 105, 'Cagliari', 'CA', 1),
( 106, 'Clarendon Parish', 'CLA', 1),
( 106, 'Hanover Parish', 'HAN', 1),
( 106, 'Kingston Parish', 'KIN', 1),
( 106, 'Manchester Parish', 'MAN', 1),
( 106, 'Portland Parish', 'POR', 1),
( 106, 'Saint Andrew Parish', 'AND', 1),
( 106, 'Saint Ann Parish', 'ANN', 1),
( 106, 'Saint Catherine Parish', 'CAT', 1),
( 106, 'Saint Elizabeth Parish', 'ELI', 1),
( 106, 'Saint James Parish', 'JAM', 1),
( 106, 'Saint Mary Parish', 'MAR', 1),
( 106, 'Saint Thomas Parish', 'THO', 1),
( 106, 'Trelawny Parish', 'TRL', 1),
( 106, 'Westmoreland Parish', 'WML', 1),
( 107, 'Aichi', 'AI', 1),
( 107, 'Akita', 'AK', 1),
( 107, 'Aomori', 'AO', 1),
( 107, 'Chiba', 'CH', 1),
( 107, 'Ehime', 'EH', 1),
( 107, 'Fukui', 'FK', 1),
( 107, 'Fukuoka', 'FU', 1),
( 107, 'Fukushima', 'FS', 1),
( 107, 'Gifu', 'GI', 1),
( 107, 'Gumma', 'GU', 1),
( 107, 'Hiroshima', 'HI', 1),
( 107, 'Hokkaido', 'HO', 1),
( 107, 'Hyogo', 'HY', 1),
( 107, 'Ibaraki', 'IB', 1),
( 107, 'Ishikawa', 'IS', 1),
( 107, 'Iwate', 'IW', 1),
( 107, 'Kagawa', 'KA', 1),
( 107, 'Kagoshima', 'KG', 1),
( 107, 'Kanagawa', 'KN', 1),
( 107, 'Kochi', 'KO', 1),
( 107, 'Kumamoto', 'KU', 1),
( 107, 'Kyoto', 'KY', 1),
( 107, 'Mie', 'MI', 1),
( 107, 'Miyagi', 'MY', 1),
( 107, 'Miyazaki', 'MZ', 1),
( 107, 'Nagano', 'NA', 1),
( 107, 'Nagasaki', 'NG', 1),
( 107, 'Nara', 'NR', 1),
( 107, 'Niigata', 'NI', 1),
( 107, 'Oita', 'OI', 1),
( 107, 'Okayama', 'OK', 1),
( 107, 'Okinawa', 'ON', 1),
( 107, 'Osaka', 'OS', 1),
( 107, 'Saga', 'SA', 1),
( 107, 'Saitama', 'SI', 1),
( 107, 'Shiga', 'SH', 1),
( 107, 'Shimane', 'SM', 1),
( 107, 'Shizuoka', 'SZ', 1),
( 107, 'Tochigi', 'TO', 1),
( 107, 'Tokushima', 'TS', 1),
( 107, 'Tokyo', 'TK', 1),
( 107, 'Tottori', 'TT', 1),
( 107, 'Toyama', 'TY', 1),
( 107, 'Wakayama', 'WA', 1),
( 107, 'Yamagata', 'YA', 1),
( 107, 'Yamaguchi', 'YM', 1),
( 107, 'Yamanashi', 'YN', 1),
( 108, '''Amman', 'AM', 1),
( 108, 'Ajlun', 'AJ', 1),
( 108, 'Al ''Aqabah', 'AA', 1),
( 108, 'Al Balqa''', 'AB', 1),
( 108, 'Al Karak', 'AK', 1),
( 108, 'Al Mafraq', 'AL', 1),
( 108, 'At Tafilah', 'AT', 1),
( 108, 'Az Zarqa''', 'AZ', 1),
( 108, 'Irbid', 'IR', 1),
( 108, 'Jarash', 'JA', 1),
( 108, 'Ma''an', 'MA', 1),
( 108, 'Madaba', 'MD', 1),
( 109, 'Almaty', 'AL', 1),
( 109, 'Almaty City', 'AC', 1),
( 109, 'Aqmola', 'AM', 1),
( 109, 'Aqtobe', 'AQ', 1),
( 109, 'Astana City', 'AS', 1),
( 109, 'Atyrau', 'AT', 1),
( 109, 'Batys Qazaqstan', 'BA', 1),
( 109, 'Bayqongyr City', 'BY', 1),
( 109, 'Mangghystau', 'MA', 1),
( 109, 'Ongtustik Qazaqstan', 'ON', 1),
( 109, 'Pavlodar', 'PA', 1),
( 109, 'Qaraghandy', 'QA', 1),
( 109, 'Qostanay', 'QO', 1),
( 109, 'Qyzylorda', 'QY', 1),
( 109, 'Shyghys Qazaqstan', 'SH', 1),
( 109, 'Soltustik Qazaqstan', 'SO', 1),
( 109, 'Zhambyl', 'ZH', 1),
( 110, 'Central', 'CE', 1),
( 110, 'Coast', 'CO', 1),
( 110, 'Eastern', 'EA', 1),
( 110, 'Nairobi Area', 'NA', 1),
( 110, 'North Eastern', 'NE', 1),
( 110, 'Nyanza', 'NY', 1),
( 110, 'Rift Valley', 'RV', 1),
( 110, 'Western', 'WE', 1),
( 111, 'Abaiang', 'AG', 1),
( 111, 'Abemama', 'AM', 1),
( 111, 'Aranuka', 'AK', 1),
( 111, 'Arorae', 'AO', 1),
( 111, 'Banaba', 'BA', 1),
( 111, 'Beru', 'BE', 1),
( 111, 'Butaritari', 'bT', 1),
( 111, 'Kanton', 'KA', 1),
( 111, 'Kiritimati', 'KR', 1),
( 111, 'Kuria', 'KU', 1),
( 111, 'Maiana', 'MI', 1),
( 111, 'Makin', 'MN', 1),
( 111, 'Marakei', 'ME', 1),
( 111, 'Nikunau', 'NI', 1),
( 111, 'Nonouti', 'NO', 1),
( 111, 'Onotoa', 'ON', 1),
( 111, 'Tabiteuea', 'TT', 1),
( 111, 'Tabuaeran', 'TR', 1),
( 111, 'Tamana', 'TM', 1),
( 111, 'Tarawa', 'TW', 1),
( 111, 'Teraina', 'TE', 1),
( 112, 'Chagang-do', 'CHA', 1),
( 112, 'Hamgyong-bukto', 'HAB', 1),
( 112, 'Hamgyong-namdo', 'HAN', 1),
( 112, 'Hwanghae-bukto', 'HWB', 1),
( 112, 'Hwanghae-namdo', 'HWN', 1),
( 112, 'Kangwon-do', 'KAN', 1),
( 112, 'P''yongan-bukto', 'PYB', 1),
( 112, 'P''yongan-namdo', 'PYN', 1),
( 112, 'Ryanggang-do (Yanggang-do)', 'YAN', 1),
( 112, 'Rason Directly Governed City', 'NAJ', 1),
( 112, 'P''yongyang Special City', 'PYO',
1),
( 113, 'Ch''ungch''ong-bukto',
'CO', 1),
( 113, 'Ch''ungch''ong-namdo',
'CH', 1),
( 113, 'Cheju-do', 'CD', 1),
( 113, 'Cholla-bukto', 'CB', 1),
( 113, 'Cholla-namdo', 'CN', 1),
( 113, 'Inch''on-gwangyoksi', 'IG', 1),
( 113, 'Kangwon-do', 'KA', 1),
( 113, 'Kwangju-gwangyoksi', 'KG', 1),
( 113, 'Kyonggi-do', 'KD', 1),
( 113, 'Kyongsang-bukto', 'KB', 1),
( 113, 'Kyongsang-namdo', 'KN', 1),
( 113, 'Pusan-gwangyoksi', 'PG', 1),
( 113, 'Soul-t''ukpyolsi', 'SO', 1),
( 113, 'Taegu-gwangyoksi', 'TA', 1),
( 113, 'Taejon-gwangyoksi', 'TG', 1),
( 114, 'Al ''Asimah', 'AL', 1),
( 114, 'Al Ahmadi', 'AA', 1),
( 114, 'Al Farwaniyah', 'AF', 1),
( 114, 'Al Jahra''', 'AJ', 1),
( 114, 'Hawalli', 'HA', 1),
( 115, 'Bishkek', 'GB', 1),
( 115, 'Batken', 'B', 1),
( 115, 'Chu', 'C', 1),
( 115, 'Jalal-Abad', 'J', 1),
( 115, 'Naryn', 'N', 1),
( 115, 'Osh', 'O', 1),
( 115, 'Talas', 'T', 1),
( 115, 'Ysyk-Kol', 'Y', 1),
( 116, 'Vientiane', 'VT', 1),
( 116, 'Attapu', 'AT', 1),
( 116, 'Bokeo', 'BK', 1),
( 116, 'Bolikhamxai', 'BL', 1),
( 116, 'Champasak', 'CH', 1),
( 116, 'Houaphan', 'HO', 1),
( 116, 'Khammouan', 'KH', 1),
( 116, 'Louang Namtha', 'LM', 1),
( 116, 'Louangphabang', 'LP', 1),
( 116, 'Oudomxai', 'OU', 1),
( 116, 'Phongsali', 'PH', 1),
( 116, 'Salavan', 'SL', 1),
( 116, 'Savannakhet', 'SV', 1),
( 116, 'Vientiane', 'VI', 1),
( 116, 'Xaignabouli', 'XA', 1),
( 116, 'Xekong', 'XE', 1),
( 116, 'Xiangkhoang', 'XI', 1),
( 116, 'Xaisomboun', 'XN', 1),
( 117, 'Aizkraukles Rajons', 'AIZ', 1),
( 117, 'Aluksnes Rajons', 'ALU', 1),
( 117, 'Balvu Rajons', 'BAL', 1),
( 117, 'Bauskas Rajons', 'BAU', 1),
( 117, 'Cesu Rajons', 'CES', 1),
( 117, 'Daugavpils Rajons', 'DGR', 1),
( 117, 'Dobeles Rajons', 'DOB', 1),
( 117, 'Gulbenes Rajons', 'GUL', 1),
( 117, 'Jekabpils Rajons', 'JEK', 1),
( 117, 'Jelgavas Rajons', 'JGR', 1),
( 117, 'Kraslavas Rajons', 'KRA', 1),
( 117, 'Kuldigas Rajons', 'KUL', 1),
( 117, 'Liepajas Rajons', 'LPR', 1),
( 117, 'Limbazu Rajons', 'LIM', 1),
( 117, 'Ludzas Rajons', 'LUD', 1),
( 117, 'Madonas Rajons', 'MAD', 1),
( 117, 'Ogres Rajons', 'OGR', 1),
( 117, 'Preilu Rajons', 'PRE', 1),
( 117, 'Rezeknes Rajons', 'RZR', 1),
( 117, 'Rigas Rajons', 'RGR', 1),
( 117, 'Saldus Rajons', 'SAL', 1),
( 117, 'Talsu Rajons', 'TAL', 1),
( 117, 'Tukuma Rajons', 'TUK', 1),
( 117, 'Valkas Rajons', 'VLK', 1),
( 117, 'Valmieras Rajons', 'VLM', 1),
( 117, 'Ventspils Rajons', 'VSR', 1),
( 117, 'Daugavpils', 'DGV', 1),
( 117, 'Jelgava', 'JGV', 1),
( 117, 'Jurmala', 'JUR', 1),
( 117, 'Liepaja', 'LPK', 1),
( 117, 'Rezekne', 'RZK', 1),
( 117, 'Riga', 'RGA', 1),
( 117, 'Ventspils', 'VSL', 1),
( 119, 'Berea', 'BE', 1),
( 119, 'Butha-Buthe', 'BB', 1),
( 119, 'Leribe', 'LE', 1),
( 119, 'Mafeteng', 'MF', 1),
( 119, 'Maseru', 'MS', 1),
( 119, 'Mohale''s Hoek', 'MH', 1),
( 119, 'Mokhotlong', 'MK', 1),
( 119, 'Qacha''s Nek', 'QN', 1),
( 119, 'Quthing', 'QT', 1),
( 119, 'Thaba-Tseka', 'TT', 1),
( 120, 'Bomi', 'BI', 1),
( 120, 'Bong', 'BG', 1),
( 120, 'Grand Bassa', 'GB', 1),
( 120, 'Grand Cape Mount', 'CM', 1),
( 120, 'Grand Gedeh', 'GG', 1),
( 120, 'Grand Kru', 'GK', 1),
( 120, 'Lofa', 'LO', 1),
( 120, 'Margibi', 'MG', 1),
( 120, 'Maryland', 'ML', 1),
( 120, 'Montserrado', 'MS', 1),
( 120, 'Nimba', 'NB', 1),
( 120, 'River Cess', 'RC', 1),
( 120, 'Sinoe', 'SN', 1),
( 121, 'Ajdabiya', 'AJ', 1),
( 121, 'Al ''Aziziyah', 'AZ', 1),
( 121, 'Al Fatih', 'FA', 1),
( 121, 'Al Jabal al Akhdar', 'JA', 1),
( 121, 'Al Jufrah', 'JU', 1),
( 121, 'Al Khums', 'KH', 1),
( 121, 'Al Kufrah', 'KU', 1),
( 121, 'An Nuqat al Khams', 'NK', 1),
( 121, 'Ash Shati''', 'AS', 1),
( 121, 'Awbari', 'AW', 1),
( 121, 'Az Zawiyah', 'ZA', 1),
( 121, 'Banghazi', 'BA', 1),
( 121, 'Darnah', 'DA', 1),
( 121, 'Ghadamis', 'GD', 1),
( 121, 'Gharyan', 'GY', 1),
( 121, 'Misratah', 'MI', 1),
( 121, 'Murzuq', 'MZ', 1),
( 121, 'Sabha', 'SB', 1),
( 121, 'Sawfajjin', 'SW', 1),
( 121, 'Surt', 'SU', 1),
( 121, 'Tarabulus (Tripoli)', 'TL', 1),
( 121, 'Tarhunah', 'TH', 1),
( 121, 'Tubruq', 'TU', 1),
( 121, 'Yafran', 'YA', 1),
( 121, 'Zlitan', 'ZL', 1),
( 122, 'Vaduz', 'V', 1),
( 122, 'Schaan', 'A', 1),
( 122, 'Balzers', 'B', 1),
( 122, 'Triesen', 'N', 1),
( 122, 'Eschen', 'E', 1),
( 122, 'Mauren', 'M', 1),
( 122, 'Triesenberg', 'T', 1),
( 122, 'Ruggell', 'R', 1),
( 122, 'Gamprin', 'G', 1),
( 122, 'Schellenberg', 'L', 1),
( 122, 'Planken', 'P', 1),
( 123, 'Alytus', 'AL', 1),
( 123, 'Kaunas', 'KA', 1),
( 123, 'Klaipeda', 'KL', 1),
( 123, 'Marijampole', 'MA', 1),
( 123, 'Panevezys', 'PA', 1),
( 123, 'Siauliai', 'SI', 1),
( 123, 'Taurage', 'TA', 1),
( 123, 'Telsiai', 'TE', 1),
( 123, 'Utena', 'UT', 1),
( 123, 'Vilnius', 'VI', 1),
( 124, 'Diekirch', 'DD', 1),
( 124, 'Clervaux', 'DC', 1),
( 124, 'Redange', 'DR', 1),
( 124, 'Vianden', 'DV', 1),
( 124, 'Wiltz', 'DW', 1),
( 124, 'Grevenmacher', 'GG', 1),
( 124, 'Echternach', 'GE', 1),
( 124, 'Remich', 'GR', 1),
( 124, 'Luxembourg', 'LL', 1),
( 124, 'Capellen', 'LC', 1),
( 124, 'Esch-sur-Alzette', 'LE', 1),
( 124, 'Mersch', 'LM', 1),
( 125, 'Our Lady Fatima Parish', 'OLF', 1),
( 125, 'St. Anthony Parish', 'ANT', 1),
( 125, 'St. Lazarus Parish', 'LAZ', 1),
( 125, 'Cathedral Parish', 'CAT', 1),
( 125, 'St. Lawrence Parish', 'LAW', 1),
( 127, 'Antananarivo', 'AN', 1),
( 127, 'Antsiranana', 'AS', 1),
( 127, 'Fianarantsoa', 'FN', 1),
( 127, 'Mahajanga', 'MJ', 1),
( 127, 'Toamasina', 'TM', 1),
( 127, 'Toliara', 'TL', 1),
( 128, 'Balaka', 'BLK', 1),
( 128, 'Blantyre', 'BLT', 1),
( 128, 'Chikwawa', 'CKW', 1),
( 128, 'Chiradzulu', 'CRD', 1),
( 128, 'Chitipa', 'CTP', 1),
( 128, 'Dedza', 'DDZ', 1),
( 128, 'Dowa', 'DWA', 1),
( 128, 'Karonga', 'KRG', 1),
( 128, 'Kasungu', 'KSG', 1),
( 128, 'Likoma', 'LKM', 1),
( 128, 'Lilongwe', 'LLG', 1),
( 128, 'Machinga', 'MCG', 1),
( 128, 'Mangochi', 'MGC', 1),
( 128, 'Mchinji', 'MCH', 1),
( 128, 'Mulanje', 'MLJ', 1),
( 128, 'Mwanza', 'MWZ', 1),
( 128, 'Mzimba', 'MZM', 1),
( 128, 'Ntcheu', 'NTU', 1),
( 128, 'Nkhata Bay', 'NKB', 1),
( 128, 'Nkhotakota', 'NKH', 1),
( 128, 'Nsanje', 'NSJ', 1),
( 128, 'Ntchisi', 'NTI', 1),
( 128, 'Phalombe', 'PHL', 1),
( 128, 'Rumphi', 'RMP', 1),
( 128, 'Salima', 'SLM', 1),
( 128, 'Thyolo', 'THY', 1),
( 128, 'Zomba', 'ZBA', 1),
( 129, 'Johor', 'JO', 1),
( 129, 'Kedah', 'KE', 1),
( 129, 'Kelantan', 'KL', 1),
( 129, 'Labuan', 'LA', 1),
( 129, 'Melaka', 'ME', 1),
( 129, 'Negeri Sembilan', 'NS', 1),
( 129, 'Pahang', 'PA', 1),
( 129, 'Perak', 'PE', 1),
( 129, 'Perlis', 'PR', 1),
( 129, 'Pulau Pinang', 'PP', 1),
( 129, 'Sabah', 'SA', 1),
( 129, 'Sarawak', 'SR', 1),
( 129, 'Selangor', 'SE', 1),
( 129, 'Terengganu', 'TE', 1),
( 129, 'Wilayah Persekutuan', 'WP', 1),
( 130, 'Thiladhunmathi Uthuru', 'THU', 1),
( 130, 'Thiladhunmathi Dhekunu', 'THD', 1),
( 130, 'Miladhunmadulu Uthuru', 'MLU', 1),
( 130, 'Miladhunmadulu Dhekunu', 'MLD', 1),
( 130, 'Maalhosmadulu Uthuru', 'MAU', 1),
( 130, 'Maalhosmadulu Dhekunu', 'MAD', 1),
( 130, 'Faadhippolhu', 'FAA', 1),
( 130, 'Male Atoll', 'MAA', 1),
( 130, 'Ari Atoll Uthuru', 'AAU', 1),
( 130, 'Ari Atoll Dheknu', 'AAD', 1),
( 130, 'Felidhe Atoll', 'FEA', 1),
( 130, 'Mulaku Atoll', 'MUA', 1),
( 130, 'Nilandhe Atoll Uthuru', 'NAU', 1),
( 130, 'Nilandhe Atoll Dhekunu', 'NAD', 1),
( 130, 'Kolhumadulu', 'KLH', 1),
( 130, 'Hadhdhunmathi', 'HDH', 1),
( 130, 'Huvadhu Atoll Uthuru', 'HAU', 1),
( 130, 'Huvadhu Atoll Dhekunu', 'HAD', 1),
( 130, 'Fua Mulaku', 'FMU', 1),
( 130, 'Addu', 'ADD', 1),
( 131, 'Gao', 'GA', 1),
( 131, 'Kayes', 'KY', 1),
( 131, 'Kidal', 'KD', 1),
( 131, 'Koulikoro', 'KL', 1),
( 131, 'Mopti', 'MP', 1),
( 131, 'Segou', 'SG', 1),
( 131, 'Sikasso', 'SK', 1),
( 131, 'Tombouctou', 'TB', 1),
( 131, 'Bamako Capital District', 'CD', 1),
( 132, 'Attard', 'ATT', 1),
( 132, 'Balzan', 'BAL', 1),
( 132, 'Birgu', 'BGU', 1),
( 132, 'Birkirkara', 'BKK', 1),
( 132, 'Birzebbuga', 'BRZ', 1),
( 132, 'Bormla', 'BOR', 1),
( 132, 'Dingli', 'DIN', 1),
( 132, 'Fgura', 'FGU', 1),
( 132, 'Floriana', 'FLO', 1),
( 132, 'Gudja', 'GDJ', 1),
( 132, 'Gzira', 'GZR', 1),
( 132, 'Gargur', 'GRG', 1),
( 132, 'Gaxaq', 'GXQ', 1),
( 132, 'Hamrun', 'HMR', 1),
( 132, 'Iklin', 'IKL', 1),
( 132, 'Isla', 'ISL', 1),
( 132, 'Kalkara', 'KLK', 1),
( 132, 'Kirkop', 'KRK', 1),
( 132, 'Lija', 'LIJ', 1),
( 132, 'Luqa', 'LUQ', 1),
( 132, 'Marsa', 'MRS', 1),
( 132, 'Marsaskala', 'MKL', 1),
( 132, 'Marsaxlokk', 'MXL', 1),
( 132, 'Mdina', 'MDN', 1),
( 132, 'Melliea', 'MEL', 1),
( 132, 'Mgarr', 'MGR', 1),
( 132, 'Mosta', 'MST', 1),
( 132, 'Mqabba', 'MQA', 1),
( 132, 'Msida', 'MSI', 1),
( 132, 'Mtarfa', 'MTF', 1),
( 132, 'Naxxar', 'NAX', 1),
( 132, 'Paola', 'PAO', 1),
( 132, 'Pembroke', 'PEM', 1),
( 132, 'Pieta', 'PIE', 1),
( 132, 'Qormi', 'QOR', 1),
( 132, 'Qrendi', 'QRE', 1),
( 132, 'Rabat', 'RAB', 1),
( 132, 'Safi', 'SAF', 1),
( 132, 'San Giljan', 'SGI', 1),
( 132, 'Santa Lucija', 'SLU', 1),
( 132, 'San Pawl il-Bahar', 'SPB', 1),
( 132, 'San Gwann', 'SGW', 1),
( 132, 'Santa Venera', 'SVE', 1),
( 132, 'Siggiewi', 'SIG', 1),
( 132, 'Sliema', 'SLM', 1),
( 132, 'Swieqi', 'SWQ', 1),
( 132, 'Ta Xbiex', 'TXB', 1),
( 132, 'Tarxien', 'TRX', 1),
( 132, 'Valletta', 'VLT', 1),
( 132, 'Xgajra', 'XGJ', 1),
( 132, 'Zabbar', 'ZBR', 1),
( 132, 'Zebbug', 'ZBG', 1),
( 132, 'Zejtun', 'ZJT', 1),
( 132, 'Zurrieq', 'ZRQ', 1),
( 132, 'Fontana', 'FNT', 1),
( 132, 'Ghajnsielem', 'GHJ', 1),
( 132, 'Gharb', 'GHR', 1),
( 132, 'Ghasri', 'GHS', 1),
( 132, 'Kercem', 'KRC', 1),
( 132, 'Munxar', 'MUN', 1),
( 132, 'Nadur', 'NAD', 1),
( 132, 'Qala', 'QAL', 1),
( 132, 'Victoria', 'VIC', 1),
( 132, 'San Lawrenz', 'SLA', 1),
( 132, 'Sannat', 'SNT', 1),
( 132, 'Xagra', 'ZAG', 1),
( 132, 'Xewkija', 'XEW', 1),
( 132, 'Zebbug', 'ZEB', 1),
( 133, 'Ailinginae', 'ALG', 1),
( 133, 'Ailinglaplap', 'ALL', 1),
( 133, 'Ailuk', 'ALK', 1),
( 133, 'Arno', 'ARN', 1),
( 133, 'Aur', 'AUR', 1),
( 133, 'Bikar', 'BKR', 1),
( 133, 'Bikini', 'BKN', 1),
( 133, 'Bokak', 'BKK', 1),
( 133, 'Ebon', 'EBN', 1),
( 133, 'Enewetak', 'ENT', 1),
( 133, 'Erikub', 'EKB', 1),
( 133, 'Jabat', 'JBT', 1),
( 133, 'Jaluit', 'JLT', 1),
( 133, 'Jemo', 'JEM', 1),
( 133, 'Kili', 'KIL', 1),
( 133, 'Kwajalein', 'KWJ', 1),
( 133, 'Lae', 'LAE', 1),
( 133, 'Lib', 'LIB', 1),
( 133, 'Likiep', 'LKP', 1),
( 133, 'Majuro', 'MJR', 1),
( 133, 'Maloelap', 'MLP', 1),
( 133, 'Mejit', 'MJT', 1),
( 133, 'Mili', 'MIL', 1),
( 133, 'Namorik', 'NMK', 1),
( 133, 'Namu', 'NAM', 1),
( 133, 'Rongelap', 'RGL', 1),
( 133, 'Rongrik', 'RGK', 1),
( 133, 'Toke', 'TOK', 1),
( 133, 'Ujae', 'UJA', 1),
( 133, 'Ujelang', 'UJL', 1),
( 133, 'Utirik', 'UTK', 1),
( 133, 'Wotho', 'WTH', 1),
( 133, 'Wotje', 'WTJ', 1),
( 135, 'Adrar', 'AD', 1),
( 135, 'Assaba', 'AS', 1),
( 135, 'Brakna', 'BR', 1),
( 135, 'Dakhlet Nouadhibou', 'DN', 1),
( 135, 'Gorgol', 'GO', 1),
( 135, 'Guidimaka', 'GM', 1),
( 135, 'Hodh Ech Chargui', 'HC', 1),
( 135, 'Hodh El Gharbi', 'HG', 1),
( 135, 'Inchiri', 'IN', 1),
( 135, 'Tagant', 'TA', 1),
( 135, 'Tiris Zemmour', 'TZ', 1),
( 135, 'Trarza', 'TR', 1),
( 135, 'Nouakchott', 'NO', 1),
( 136, 'Beau Bassin-Rose Hill', 'BR', 1),
( 136, 'Curepipe', 'CU', 1),
( 136, 'Port Louis', 'PU', 1),
( 136, 'Quatre Bornes', 'QB', 1),
( 136, 'Vacoas-Phoenix', 'VP', 1),
( 136, 'Agalega Islands', 'AG', 1),
( 136, 'Cargados Carajos Shoals (Saint Brandon Islands)',
'CC', 1),
( 136, 'Rodrigues', 'RO', 1),
( 136, 'Black River', 'BL', 1),
( 136, 'Flacq', 'FL', 1),
( 136, 'Grand Port', 'GP', 1),
( 136, 'Moka', 'MO', 1),
( 136, 'Pamplemousses', 'PA', 1),
( 136, 'Plaines Wilhems', 'PW', 1),
( 136, 'Port Louis', 'PL', 1),
( 136, 'Riviere du Rempart', 'RR', 1),
( 136, 'Savanne', 'SA', 1),
( 138, 'Baja California Norte', 'BN', 1),
( 138, 'Baja California Sur', 'BS', 1),
( 138, 'Campeche', 'CA', 1),
( 138, 'Chiapas', 'CI', 1),
( 138, 'Chihuahua', 'CH', 1),
( 138, 'Coahuila de Zaragoza', 'CZ', 1),
( 138, 'Colima', 'CL', 1),
( 138, 'Distrito Federal', 'DF', 1),
( 138, 'Durango', 'DU', 1),
( 138, 'Guanajuato', 'GA', 1),
( 138, 'Guerrero', 'GE', 1),
( 138, 'Hidalgo', 'HI', 1),
( 138, 'Jalisco', 'JA', 1),
( 138, 'Mexico', 'ME', 1),
( 138, 'Michoacan de Ocampo', 'MI', 1),
( 138, 'Morelos', 'MO', 1),
( 138, 'Nayarit', 'NA', 1),
( 138, 'Nuevo Leon', 'NL', 1),
( 138, 'Oaxaca', 'OA', 1),
( 138, 'Puebla', 'PU', 1),
( 138, 'Queretaro de Arteaga', 'QA', 1),
( 138, 'Quintana Roo', 'QR', 1),
( 138, 'San Luis Potosi', 'SA', 1),
( 138, 'Sinaloa', 'SI', 1),
( 138, 'Sonora', 'SO', 1),
( 138, 'Tabasco', 'TB', 1),
( 138, 'Tamaulipas', 'TM', 1),
( 138, 'Tlaxcala', 'TL', 1),
( 138, 'Veracruz-Llave', 'VE', 1),
( 138, 'Yucatan', 'YU', 1),
( 138, 'Zacatecas', 'ZA', 1),
( 139, 'Chuuk', 'C', 1),
( 139, 'Kosrae', 'K', 1),
( 139, 'Pohnpei', 'P', 1),
( 139, 'Yap', 'Y', 1),
( 140, 'Gagauzia', 'GA', 1),
( 140, 'Chisinau', 'CU', 1),
( 140, 'Balti', 'BA', 1),
( 140, 'Cahul', 'CA', 1),
( 140, 'Edinet', 'ED', 1),
( 140, 'Lapusna', 'LA', 1),
( 140, 'Orhei', 'OR', 1),
( 140, 'Soroca', 'SO', 1),
( 140, 'Tighina', 'TI', 1),
( 140, 'Ungheni', 'UN', 1),
( 140, 'St‚nga Nistrului', 'SN', 1),
( 141, 'Fontvieille', 'FV', 1),
( 141, 'La Condamine', 'LC', 1),
( 141, 'Monaco-Ville', 'MV', 1),
( 141, 'Monte-Carlo', 'MC', 1),
( 142, 'Ulanbaatar', '1', 1),
( 142, 'Orhon', '035', 1),
( 142, 'Darhan uul', '037', 1),
( 142, 'Hentiy', '039', 1),
( 142, 'Hovsgol', '041', 1),
( 142, 'Hovd', '043', 1),
( 142, 'Uvs', '046', 1),
( 142, 'Tov', '047', 1),
( 142, 'Selenge', '049', 1),
( 142, 'Suhbaatar', '051', 1),
( 142, 'Omnogovi', '053', 1),
( 142, 'Ovorhangay', '055', 1),
( 142, 'Dzavhan', '057', 1),
( 142, 'DundgovL', '059', 1),
( 142, 'Dornod', '061', 1),
( 142, 'Dornogov', '063', 1),
( 142, 'Govi-Sumber', '064', 1),
( 142, 'Govi-Altay', '065', 1),
( 142, 'Bulgan', '067', 1),
( 142, 'Bayanhongor', '069', 1),
( 142, 'Bayan-Olgiy', '071', 1),
( 142, 'Arhangay', '073', 1),
( 143, 'Saint Anthony', 'A', 1),
( 143, 'Saint Georges', 'G', 1),
( 143, 'Saint Peter', 'P', 1),
( 144, 'Agadir', 'AGD', 1),
( 144, 'Al Hoceima', 'HOC', 1),
( 144, 'Azilal', 'AZI', 1),
( 144, 'Beni Mellal', 'BME', 1),
( 144, 'Ben Slimane', 'BSL', 1),
( 144, 'Boulemane', 'BLM', 1),
( 144, 'Casablanca', 'CBL', 1),
( 144, 'Chaouen', 'CHA', 1),
( 144, 'El Jadida', 'EJA', 1),
( 144, 'El Kelaa des Sraghna', 'EKS', 1),
( 144, 'Er Rachidia', 'ERA', 1),
( 144, 'Essaouira', 'ESS', 1),
( 144, 'Fes', 'FES', 1),
( 144, 'Figuig', 'FIG', 1),
( 144, 'Guelmim', 'GLM', 1),
( 144, 'Ifrane', 'IFR', 1),
( 144, 'Kenitra', 'KEN', 1),
( 144, 'Khemisset', 'KHM', 1),
( 144, 'Khenifra', 'KHN', 1),
( 144, 'Khouribga', 'KHO', 1),
( 144, 'Laayoune', 'LYN', 1),
( 144, 'Larache', 'LAR', 1),
( 144, 'Marrakech', 'MRK', 1),
( 144, 'Meknes', 'MKN', 1),
( 144, 'Nador', 'NAD', 1),
( 144, 'Ouarzazate', 'ORZ', 1),
( 144, 'Oujda', 'OUJ', 1),
( 144, 'Rabat-Sale', 'RSA', 1),
( 144, 'Safi', 'SAF', 1),
( 144, 'Settat', 'SET', 1),
( 144, 'Sidi Kacem', 'SKA', 1),
( 144, 'Tangier', 'TGR', 1),
( 144, 'Tan-Tan', 'TAN', 1),
( 144, 'Taounate', 'TAO', 1),
( 144, 'Taroudannt', 'TRD', 1),
( 144, 'Tata', 'TAT', 1),
( 144, 'Taza', 'TAZ', 1),
( 144, 'Tetouan', 'TET', 1),
( 144, 'Tiznit', 'TIZ', 1),
( 144, 'Ad Dakhla', 'ADK', 1),
( 144, 'Boujdour', 'BJD', 1),
( 144, 'Es Smara', 'ESM', 1),
( 145, 'Cabo Delgado', 'CD', 1),
( 145, 'Gaza', 'GZ', 1),
( 145, 'Inhambane', 'IN', 1),
( 145, 'Manica', 'MN', 1),
( 145, 'Maputo (city)', 'MC', 1),
( 145, 'Maputo', 'MP', 1),
( 145, 'Nampula', 'NA', 1),
( 145, 'Niassa', 'NI', 1),
( 145, 'Sofala', 'SO', 1),
( 145, 'Tete', 'TE', 1),
( 145, 'Zambezia', 'ZA', 1),
( 146, 'Ayeyarwady', 'AY', 1),
( 146, 'Bago', 'BG', 1),
( 146, 'Magway', 'MG', 1),
( 146, 'Mandalay', 'MD', 1),
( 146, 'Sagaing', 'SG', 1),
( 146, 'Tanintharyi', 'TN', 1),
( 146, 'Yangon', 'YG', 1),
( 146, 'Chin State', 'CH', 1),
( 146, 'Kachin State', 'KC', 1),
( 146, 'Kayah State', 'KH', 1),
( 146, 'Kayin State', 'KN', 1),
( 146, 'Mon State', 'MN', 1),
( 146, 'Rakhine State', 'RK', 1),
( 146, 'Shan State', 'SH', 1),
( 147, 'Caprivi', 'CA', 1),
( 147, 'Erongo', 'ER', 1),
( 147, 'Hardap', 'HA', 1),
( 147, 'Karas', 'KR', 1),
( 147, 'Kavango', 'KV', 1),
( 147, 'Khomas', 'KH', 1),
( 147, 'Kunene', 'KU', 1),
( 147, 'Ohangwena', 'OW', 1),
( 147, 'Omaheke', 'OK', 1),
( 147, 'Omusati', 'OT', 1),
( 147, 'Oshana', 'ON', 1),
( 147, 'Oshikoto', 'OO', 1),
( 147, 'Otjozondjupa', 'OJ', 1),
( 148, 'Aiwo', 'AO', 1),
( 148, 'Anabar', 'AA', 1),
( 148, 'Anetan', 'AT', 1),
( 148, 'Anibare', 'AI', 1),
( 148, 'Baiti', 'BA', 1),
( 148, 'Boe', 'BO', 1),
( 148, 'Buada', 'BU', 1),
( 148, 'Denigomodu', 'DE', 1),
( 148, 'Ewa', 'EW', 1),
( 148, 'Ijuw', 'IJ', 1),
( 148, 'Meneng', 'ME', 1),
( 148, 'Nibok', 'NI', 1),
( 148, 'Uaboe', 'UA', 1),
( 148, 'Yaren', 'YA', 1),
( 149, 'Bagmati', 'BA', 1),
( 149, 'Bheri', 'BH', 1),
( 149, 'Dhawalagiri', 'DH', 1),
( 149, 'Gandaki', 'GA', 1),
( 149, 'Janakpur', 'JA', 1),
( 149, 'Karnali', 'KA', 1),
( 149, 'Kosi', 'KO', 1),
( 149, 'Lumbini', 'LU', 1),
( 149, 'Mahakali', 'MA', 1),
( 149, 'Mechi', 'ME', 1),
( 149, 'Narayani', 'NA', 1),
( 149, 'Rapti', 'RA', 1),
( 149, 'Sagarmatha', 'SA', 1),
( 149, 'Seti', 'SE', 1),
( 150, 'Drenthe', 'DR', 1),
( 150, 'Flevoland', 'FL', 1),
( 150, 'Friesland', 'FR', 1),
( 150, 'Gelderland', 'GE', 1),
( 150, 'Groningen', 'GR', 1),
( 150, 'Limburg', 'LI', 1),
( 150, 'Noord Brabant', 'NB', 1),
( 150, 'Noord Holland', 'NH', 1),
( 150, 'Overijssel', 'OV', 1),
( 150, 'Utrecht', 'UT', 1),
( 150, 'Zeeland', 'ZE', 1),
( 150, 'Zuid Holland', 'ZH', 1),
( 152, 'Iles Loyaute', 'L', 1),
( 152, 'Nord', 'N', 1),
( 152, 'Sud', 'S', 1),
( 153, 'Auckland', 'AUK', 1),
( 153, 'Bay of Plenty', 'BOP', 1),
( 153, 'Canterbury', 'CAN', 1),
( 153, 'Coromandel', 'COR', 1),
( 153, 'Gisborne', 'GIS', 1),
( 153, 'Fiordland', 'FIO', 1),
( 153, 'Hawke''s Bay', 'HKB', 1),
( 153, 'Marlborough', 'MBH', 1),
( 153, 'Manawatu-Wanganui', 'MWT', 1),
( 153, 'Mt Cook-Mackenzie', 'MCM', 1),
( 153, 'Nelson', 'NSN', 1),
( 153, 'Northland', 'NTL', 1),
( 153, 'Otago', 'OTA', 1),
( 153, 'Southland', 'STL', 1),
( 153, 'Taranaki', 'TKI', 1),
( 153, 'Wellington', 'WGN', 1),
( 153, 'Waikato', 'WKO', 1),
( 153, 'Wairarapa', 'WAI', 1),
( 153, 'West Coast', 'WTC', 1),
( 154, 'Atlantico Norte', 'AN', 1),
( 154, 'Atlantico Sur', 'AS', 1),
( 154, 'Boaco', 'BO', 1),
( 154, 'Carazo', 'CA', 1),
( 154, 'Chinandega', 'CI', 1),
( 154, 'Chontales', 'CO', 1),
( 154, 'Esteli', 'ES', 1),
( 154, 'Granada', 'GR', 1),
( 154, 'Jinotega', 'JI', 1),
( 154, 'Leon', 'LE', 1),
( 154, 'Madriz', 'MD', 1),
( 154, 'Managua', 'MN', 1),
( 154, 'Masaya', 'MS', 1),
( 154, 'Matagalpa', 'MT', 1),
( 154, 'Nuevo Segovia', 'NS', 1),
( 154, 'Rio San Juan', 'RS', 1),
( 154, 'Rivas', 'RI', 1),
( 155, 'Agadez', 'AG', 1),
( 155, 'Diffa', 'DF', 1),
( 155, 'Dosso', 'DS', 1),
( 155, 'Maradi', 'MA', 1),
( 155, 'Niamey', 'NM', 1),
( 155, 'Tahoua', 'TH', 1),
( 155, 'Tillaberi', 'TL', 1),
( 155, 'Zinder', 'ZD', 1),
( 156, 'Abia', 'AB', 1),
( 156, 'Abuja Federal Capital Territory', 'CT', 1),
( 156, 'Adamawa', 'AD', 1),
( 156, 'Akwa Ibom', 'AK', 1),
( 156, 'Anambra', 'AN', 1),
( 156, 'Bauchi', 'BC', 1),
( 156, 'Bayelsa', 'BY', 1),
( 156, 'Benue', 'BN', 1),
( 156, 'Borno', 'BO', 1),
( 156, 'Cross River', 'CR', 1),
( 156, 'Delta', 'DE', 1),
( 156, 'Ebonyi', 'EB', 1),
( 156, 'Edo', 'ED', 1),
( 156, 'Ekiti', 'EK', 1),
( 156, 'Enugu', 'EN', 1),
( 156, 'Gombe', 'GO', 1),
( 156, 'Imo', 'IM', 1),
( 156, 'Jigawa', 'JI', 1),
( 156, 'Kaduna', 'KD', 1),
( 156, 'Kano', 'KN', 1),
( 156, 'Katsina', 'KT', 1),
( 156, 'Kebbi', 'KE', 1),
( 156, 'Kogi', 'KO', 1),
( 156, 'Kwara', 'KW', 1),
( 156, 'Lagos', 'LA', 1),
( 156, 'Nassarawa', 'NA', 1),
( 156, 'Niger', 'NI', 1),
( 156, 'Ogun', 'OG', 1),
( 156, 'Ondo', 'ONG', 1),
( 156, 'Osun', 'OS', 1),
( 156, 'Oyo', 'OY', 1),
( 156, 'Plateau', 'PL', 1),
( 156, 'Rivers', 'RI', 1),
( 156, 'Sokoto', 'SO', 1),
( 156, 'Taraba', 'TA', 1),
( 156, 'Yobe', 'YO', 1),
( 156, 'Zamfara', 'ZA', 1),
( 159, 'Northern Islands', 'N', 1),
( 159, 'Rota', 'R', 1),
( 159, 'Saipan', 'S', 1),
( 159, 'Tinian', 'T', 1),
( 160, 'Akershus', 'AK', 1),
( 160, 'Aust-Agder', 'AA', 1),
( 160, 'Buskerud', 'BU', 1),
( 160, 'Finnmark', 'FM', 1),
( 160, 'Hedmark', 'HM', 1),
( 160, 'Hordaland', 'HL', 1),
( 160, 'More og Romdal', 'MR', 1),
( 160, 'Nord-Trondelag', 'NT', 1),
( 160, 'Nordland', 'NL', 1),
( 160, 'Ostfold', 'OF', 1),
( 160, 'Oppland', 'OP', 1),
( 160, 'Oslo', 'OL', 1),
( 160, 'Rogaland', 'RL', 1),
( 160, 'Sor-Trondelag', 'ST', 1),
( 160, 'Sogn og Fjordane', 'SJ', 1),
( 160, 'Svalbard', 'SV', 1),
( 160, 'Telemark', 'TM', 1),
( 160, 'Troms', 'TR', 1),
( 160, 'Vest-Agder', 'VA', 1),
( 160, 'Vestfold', 'VF', 1),
( 161, 'Ad Dakhiliyah', 'DA', 1),
( 161, 'Al Batinah', 'BA', 1),
( 161, 'Al Wusta', 'WU', 1),
( 161, 'Ash Sharqiyah', 'SH', 1),
( 161, 'Az Zahirah', 'ZA', 1),
( 161, 'Masqat', 'MA', 1),
( 161, 'Musandam', 'MU', 1),
( 161, 'Zufar', 'ZU', 1),
( 162, 'Balochistan', 'B', 1),
( 162, 'Federally Administered Tribal Areas', 'T', 1),
( 162, 'Islamabad Capital Territory', 'I', 1),
( 162, 'North-West Frontier', 'N', 1),
( 162, 'Punjab', 'P', 1),
( 162, 'Sindh', 'S', 1),
( 163, 'Aimeliik', 'AM', 1),
( 163, 'Airai', 'AR', 1),
( 163, 'Angaur', 'AN', 1),
( 163, 'Hatohobei', 'HA', 1),
( 163, 'Kayangel', 'KA', 1),
( 163, 'Koror', 'KO', 1),
( 163, 'Melekeok', 'ME', 1),
( 163, 'Ngaraard', 'NA', 1),
( 163, 'Ngarchelong', 'NG', 1),
( 163, 'Ngardmau', 'ND', 1),
( 163, 'Ngatpang', 'NT', 1),
( 163, 'Ngchesar', 'NC', 1),
( 163, 'Ngeremlengui', 'NR', 1),
( 163, 'Ngiwal', 'NW', 1),
( 163, 'Peleliu', 'PE', 1),
( 163, 'Sonsorol', 'SO', 1),
( 164, 'Bocas del Toro', 'BT', 1),
( 164, 'Chiriqui', 'CH', 1),
( 164, 'Cocle', 'CC', 1),
( 164, 'Colon', 'CL', 1),
( 164, 'Darien', 'DA', 1),
( 164, 'Herrera', 'HE', 1),
( 164, 'Los Santos', 'LS', 1),
( 164, 'Panama', 'PA', 1),
( 164, 'San Blas', 'SB', 1),
( 164, 'Veraguas', 'VG', 1),
( 165, 'Bougainville', 'BV', 1),
( 165, 'Central', 'CE', 1),
( 165, 'Chimbu', 'CH', 1),
( 165, 'Eastern Highlands', 'EH', 1),
( 165, 'East New Britain', 'EB', 1),
( 165, 'East Sepik', 'ES', 1),
( 165, 'Enga', 'EN', 1),
( 165, 'Gulf', 'GU', 1),
( 165, 'Madang', 'MD', 1),
( 165, 'Manus', 'MN', 1),
( 165, 'Milne Bay', 'MB', 1),
( 165, 'Morobe', 'MR', 1),
( 165, 'National Capital', 'NC', 1),
( 165, 'New Ireland', 'NI', 1),
( 165, 'Northern', 'NO', 1),
( 165, 'Sandaun', 'SA', 1),
( 165, 'Southern Highlands', 'SH', 1),
( 165, 'Western', 'WE', 1),
( 165, 'Western Highlands', 'WH', 1),
( 165, 'West New Britain', 'WB', 1),
( 166, 'Alto Paraguay', 'AG', 1),
( 166, 'Alto Parana', 'AN', 1),
( 166, 'Amambay', 'AM', 1),
( 166, 'Asuncion', 'AS', 1),
( 166, 'Boqueron', 'BO', 1),
( 166, 'Caaguazu', 'CG', 1),
( 166, 'Caazapa', 'CZ', 1),
( 166, 'Canindeyu', 'CN', 1),
( 166, 'Central', 'CE', 1),
( 166, 'Concepcion', 'CC', 1),
( 166, 'Cordillera', 'CD', 1),
( 166, 'Guaira', 'GU', 1),
( 166, 'Itapua', 'IT', 1),
( 166, 'Misiones', 'MI', 1),
( 166, 'Neembucu', 'NE', 1),
( 166, 'Paraguari', 'PA', 1),
( 166, 'Presidente Hayes', 'PH', 1),
( 166, 'San Pedro', 'SP', 1),
( 167, 'Amazonas', 'AM', 1),
( 167, 'Ancash', 'AN', 1),
( 167, 'Apurimac', 'AP', 1),
( 167, 'Arequipa', 'AR', 1),
( 167, 'Ayacucho', 'AY', 1),
( 167, 'Cajamarca', 'CJ', 1),
( 167, 'Callao', 'CL', 1),
( 167, 'Cusco', 'CU', 1),
( 167, 'Huancavelica', 'HV', 1),
( 167, 'Huanuco', 'HO', 1),
( 167, 'Ica', 'IC', 1),
( 167, 'Junin', 'JU', 1),
( 167, 'La Libertad', 'LD', 1),
( 167, 'Lambayeque', 'LY', 1),
( 167, 'Lima', 'LI', 1),
( 167, 'Loreto', 'LO', 1),
( 167, 'Madre de Dios', 'MD', 1),
( 167, 'Moquegua', 'MO', 1),
( 167, 'Pasco', 'PA', 1),
( 167, 'Piura', 'PI', 1),
( 167, 'Puno', 'PU', 1),
( 167, 'San Martin', 'SM', 1),
( 167, 'Tacna', 'TA', 1),
( 167, 'Tumbes', 'TU', 1),
( 167, 'Ucayali', 'UC', 1),
( 168, 'Abra', 'ABR', 1),
( 168, 'Agusan del Norte', 'ANO', 1),
( 168, 'Agusan del Sur', 'ASU', 1),
( 168, 'Aklan', 'AKL', 1),
( 168, 'Albay', 'ALB', 1),
( 168, 'Antique', 'ANT', 1),
( 168, 'Apayao', 'APY', 1),
( 168, 'Aurora', 'AUR', 1),
( 168, 'Basilan', 'BAS', 1),
( 168, 'Bataan', 'BTA', 1),
( 168, 'Batanes', 'BTE', 1),
( 168, 'Batangas', 'BTG', 1),
( 168, 'Biliran', 'BLR', 1),
( 168, 'Benguet', 'BEN', 1),
( 168, 'Bohol', 'BOL', 1),
( 168, 'Bukidnon', 'BUK', 1),
( 168, 'Bulacan', 'BUL', 1),
( 168, 'Cagayan', 'CAG', 1),
( 168, 'Camarines Norte', 'CNO', 1),
( 168, 'Camarines Sur', 'CSU', 1),
( 168, 'Camiguin', 'CAM', 1),
( 168, 'Capiz', 'CAP', 1),
( 168, 'Catanduanes', 'CAT', 1),
( 168, 'Cavite', 'CAV', 1),
( 168, 'Cebu', 'CEB', 1),
( 168, 'Compostela', 'CMP', 1),
( 168, 'Davao del Norte', 'DNO', 1),
( 168, 'Davao del Sur', 'DSU', 1),
( 168, 'Davao Oriental', 'DOR', 1),
( 168, 'Eastern Samar', 'ESA', 1),
( 168, 'Guimaras', 'GUI', 1),
( 168, 'Ifugao', 'IFU', 1),
( 168, 'Ilocos Norte', 'INO', 1),
( 168, 'Ilocos Sur', 'ISU', 1),
( 168, 'Iloilo', 'ILO', 1),
( 168, 'Isabela', 'ISA', 1),
( 168, 'Kalinga', 'KAL', 1),
( 168, 'Laguna', 'LAG', 1),
( 168, 'Lanao del Norte', 'LNO', 1),
( 168, 'Lanao del Sur', 'LSU', 1),
( 168, 'La Union', 'UNI', 1),
( 168, 'Leyte', 'LEY', 1),
( 168, 'Maguindanao', 'MAG', 1),
( 168, 'Marinduque', 'MRN', 1),
( 168, 'Masbate', 'MSB', 1),
( 168, 'Mindoro Occidental', 'MIC', 1),
( 168, 'Mindoro Oriental', 'MIR', 1),
( 168, 'Misamis Occidental', 'MSC', 1),
( 168, 'Misamis Oriental', 'MOR', 1),
( 168, 'Mountain', 'MOP', 1),
( 168, 'Negros Occidental', 'NOC', 1),
( 168, 'Negros Oriental', 'NOR', 1),
( 168, 'North Cotabato', 'NCT', 1),
( 168, 'Northern Samar', 'NSM', 1),
( 168, 'Nueva Ecija', 'NEC', 1),
( 168, 'Nueva Vizcaya', 'NVZ', 1),
( 168, 'Palawan', 'PLW', 1),
( 168, 'Pampanga', 'PMP', 1),
( 168, 'Pangasinan', 'PNG', 1),
( 168, 'Quezon', 'QZN', 1),
( 168, 'Quirino', 'QRN', 1),
( 168, 'Rizal', 'RIZ', 1),
( 168, 'Romblon', 'ROM', 1),
( 168, 'Samar', 'SMR', 1),
( 168, 'Sarangani', 'SRG', 1),
( 168, 'Siquijor', 'SQJ', 1),
( 168, 'Sorsogon', 'SRS', 1),
( 168, 'South Cotabato', 'SCO', 1),
( 168, 'Southern Leyte', 'SLE', 1),
( 168, 'Sultan Kudarat', 'SKU', 1),
( 168, 'Sulu', 'SLU', 1),
( 168, 'Surigao del Norte', 'SNO', 1),
( 168, 'Surigao del Sur', 'SSU', 1),
( 168, 'Tarlac', 'TAR', 1),
( 168, 'Tawi-Tawi', 'TAW', 1),
( 168, 'Zambales', 'ZBL', 1),
( 168, 'Zamboanga del Norte', 'ZNO', 1),
( 168, 'Zamboanga del Sur', 'ZSU', 1),
( 168, 'Zamboanga Sibugay', 'ZSI', 1),
( 170, 'Dolnoslaskie', 'DO', 1),
( 170, 'Kujawsko-Pomorskie', 'KP', 1),
( 170, 'Lodzkie', 'LO', 1),
( 170, 'Lubelskie', 'LL', 1),
( 170, 'Lubuskie', 'LU', 1),
( 170, 'Malopolskie', 'ML', 1),
( 170, 'Mazowieckie', 'MZ', 1),
( 170, 'Opolskie', 'OP', 1),
( 170, 'Podkarpackie', 'PP', 1),
( 170, 'Podlaskie', 'PL', 1),
( 170, 'Pomorskie', 'PM', 1),
( 170, 'Slaskie', 'SL', 1),
( 170, 'Swietokrzyskie', 'SW', 1),
( 170, 'Warminsko-Mazurskie', 'WM', 1),
( 170, 'Wielkopolskie', 'WP', 1),
( 170, 'Zachodniopomorskie', 'ZA', 1),
( 198, 'Saint Pierre', 'P', 1),
( 198, 'Miquelon', 'M', 1),
( 171, 'Açores', 'AC', 1),
( 171, 'Aveiro', 'AV', 1),
( 171, 'Beja', 'BE', 1),
( 171, 'Braga', 'BR', 1),
( 171, 'Bragança', 'BA', 1),
( 171, 'Castelo Branco', 'CB', 1),
( 171, 'Coimbra', 'CO', 1),
( 171, 'Évora', 'EV', 1),
( 171, 'Faro', 'FA', 1),
( 171, 'Guarda', 'GU', 1),
( 171, 'Leiria', 'LE', 1),
( 171, 'Lisboa', 'LI', 1),
( 171, 'Madeira', 'ME', 1),
( 171, 'Portalegre', 'PO', 1),
( 171, 'Porto', 'PR', 1),
( 171, 'Santarém', 'SA', 1),
( 171, 'Setúbal', 'SE', 1),
( 171, 'Viana do Castelo', 'VC', 1),
( 171, 'Vila Real', 'VR', 1),
( 171, 'Viseu', 'VI', 1),
( 173, 'Ad Dawhah', 'DW', 1),
( 173, 'Al Ghuwayriyah', 'GW', 1),
( 173, 'Al Jumayliyah', 'JM', 1),
( 173, 'Al Khawr', 'KR', 1),
( 173, 'Al Wakrah', 'WK', 1),
( 173, 'Ar Rayyan', 'RN', 1),
( 173, 'Jarayan al Batinah', 'JB', 1),
( 173, 'Madinat ash Shamal', 'MS', 1),
( 173, 'Umm Sa''id', 'UD', 1),
( 173, 'Umm Salal', 'UL', 1),
( 175, 'Alba', 'AB', 1),
( 175, 'Arad', 'AR', 1),
( 175, 'Arges', 'AG', 1),
( 175, 'Bacau', 'BC', 1),
( 175, 'Bihor', 'BH', 1),
( 175, 'Bistrita-Nasaud', 'BN', 1),
( 175, 'Botosani', 'BT', 1),
( 175, 'Brasov', 'BV', 1),
( 175, 'Braila', 'BR', 1),
( 175, 'Bucuresti', 'B', 1),
( 175, 'Buzau', 'BZ', 1),
( 175, 'Caras-Severin', 'CS', 1),
( 175, 'Calarasi', 'CL', 1),
( 175, 'Cluj', 'CJ', 1),
( 175, 'Constanta', 'CT', 1),
( 175, 'Covasna', 'CV', 1),
( 175, 'Dimbovita', 'DB', 1),
( 175, 'Dolj', 'DJ', 1),
( 175, 'Galati', 'GL', 1),
( 175, 'Giurgiu', 'GR', 1),
( 175, 'Gorj', 'GJ', 1),
( 175, 'Harghita', 'HR', 1),
( 175, 'Hunedoara', 'HD', 1),
( 175, 'Ialomita', 'IL', 1),
( 175, 'Iasi', 'IS', 1),
( 175, 'Ilfov', 'IF', 1),
( 175, 'Maramures', 'MM', 1),
( 175, 'Mehedinti', 'MH', 1),
( 175, 'Mures', 'MS', 1),
( 175, 'Neamt', 'NT', 1),
( 175, 'Olt', 'OT', 1),
( 175, 'Prahova', 'PH', 1),
( 175, 'Satu-Mare', 'SM', 1),
( 175, 'Salaj', 'SJ', 1),
( 175, 'Sibiu', 'SB', 1),
( 175, 'Suceava', 'SV', 1),
( 175, 'Teleorman', 'TR', 1),
( 175, 'Timis', 'TM', 1),
( 175, 'Tulcea', 'TL', 1),
( 175, 'Vaslui', 'VS', 1),
( 175, 'Valcea', 'VL', 1),
( 175, 'Vrancea', 'VN', 1),
( 176, 'Abakan', 'AB', 1),
( 176, 'Aginskoye', 'AG', 1),
( 176, 'Anadyr', 'AN', 1),
( 176, 'Arkahangelsk', 'AR', 1),
( 176, 'Astrakhan', 'AS', 1),
( 176, 'Barnaul', 'BA', 1),
( 176, 'Belgorod', 'BE', 1),
( 176, 'Birobidzhan', 'BI', 1),
( 176, 'Blagoveshchensk', 'BL', 1),
( 176, 'Bryansk', 'BR', 1),
( 176, 'Cheboksary', 'CH', 1),
( 176, 'Chelyabinsk', 'CL', 1),
( 176, 'Cherkessk', 'CR', 1),
( 176, 'Chita', 'CI', 1),
( 176, 'Dudinka', 'DU', 1),
( 176, 'Elista', 'EL', 1),
( 176, 'Gomo-Altaysk', 'GO', 1),
( 176, 'Gorno-Altaysk', 'GA', 1),
( 176, 'Groznyy', 'GR', 1),
( 176, 'Irkutsk', 'IR', 1),
( 176, 'Ivanovo', 'IV', 1),
( 176, 'Izhevsk', 'IZ', 1),
( 176, 'Kalinigrad', 'KA', 1),
( 176, 'Kaluga', 'KL', 1),
( 176, 'Kasnodar', 'KS', 1),
( 176, 'Kazan', 'KZ', 1),
( 176, 'Kemerovo', 'KE', 1),
( 176, 'Khabarovsk', 'KH', 1),
( 176, 'Khanty-Mansiysk', 'KM', 1),
( 176, 'Kostroma', 'KO', 1),
( 176, 'Krasnodar', 'KR', 1),
( 176, 'Krasnoyarsk', 'KN', 1),
( 176, 'Kudymkar', 'KU', 1),
( 176, 'Kurgan', 'KG', 1),
( 176, 'Kursk', 'KK', 1),
( 176, 'Kyzyl', 'KY', 1),
( 176, 'Lipetsk', 'LI', 1),
( 176, 'Magadan', 'MA', 1),
( 176, 'Makhachkala', 'MK', 1),
( 176, 'Maykop', 'MY', 1),
( 176, 'Moscow', 'MO', 1),
( 176, 'Murmansk', 'MU', 1),
( 176, 'Nalchik', 'NA', 1),
( 176, 'Naryan Mar', 'NR', 1),
( 176, 'Nazran', 'NZ', 1),
( 176, 'Nizhniy Novgorod', 'NI', 1),
( 176, 'Novgorod', 'NO', 1),
( 176, 'Novosibirsk', 'NV', 1),
( 176, 'Omsk', 'OM', 1),
( 176, 'Orel', 'OR', 1),
( 176, 'Orenburg', 'OE', 1),
( 176, 'Palana', 'PA', 1),
( 176, 'Penza', 'PE', 1),
( 176, 'Perm', 'PR', 1),
( 176, 'Petropavlovsk-Kamchatskiy', 'PK', 1),
( 176, 'Petrozavodsk', 'PT', 1),
( 176, 'Pskov', 'PS', 1),
( 176, 'Rostov-na-Donu', 'RO', 1),
( 176, 'Ryazan', 'RY', 1),
( 176, 'Salekhard', 'SL', 1),
( 176, 'Samara', 'SA', 1),
( 176, 'Saransk', 'SR', 1),
( 176, 'Saratov', 'SV', 1),
( 176, 'Smolensk', 'SM', 1),
( 176, 'St. Petersburg', 'SP', 1),
( 176, 'Stavropol', 'ST', 1),
( 176, 'Syktyvkar', 'SY', 1),
( 176, 'Tambov', 'TA', 1),
( 176, 'Tomsk', 'TO', 1),
( 176, 'Tula', 'TU', 1),
( 176, 'Tura', 'TR', 1),
( 176, 'Tver', 'TV', 1),
( 176, 'Tyumen', 'TY', 1),
( 176, 'Ufa', 'UF', 1),
( 176, 'Ul''yanovsk', 'UL', 1),
( 176, 'Ulan-Ude', 'UU', 1),
( 176, 'Ust''-Ordynskiy', 'US', 1),
( 176, 'Vladikavkaz', 'VL', 1),
( 176, 'Vladimir', 'VA', 1),
( 176, 'Vladivostok', 'VV', 1),
( 176, 'Volgograd', 'VG', 1),
( 176, 'Vologda', 'VD', 1),
( 176, 'Voronezh', 'VO', 1),
( 176, 'Vyatka', 'VY', 1),
( 176, 'Yakutsk', 'YA', 1),
( 176, 'Yaroslavl', 'YR', 1),
( 176, 'Yekaterinburg', 'YE', 1),
( 176, 'Yoshkar-Ola', 'YO', 1),
( 177, 'Butare', 'BU', 1),
( 177, 'Byumba', 'BY', 1),
( 177, 'Cyangugu', 'CY', 1),
( 177, 'Gikongoro', 'GK', 1),
( 177, 'Gisenyi', 'GS', 1),
( 177, 'Gitarama', 'GT', 1),
( 177, 'Kibungo', 'KG', 1),
( 177, 'Kibuye', 'KY', 1),
( 177, 'Kigali Rurale', 'KR', 1),
( 177, 'Kigali-ville', 'KV', 1),
( 177, 'Ruhengeri', 'RU', 1),
( 177, 'Umutara', 'UM', 1),
( 178, 'Christ Church Nichola Town', 'CCN', 1),
( 178, 'Saint Anne Sandy Point', 'SAS', 1),
( 178, 'Saint George Basseterre', 'SGB', 1),
( 178, 'Saint George Gingerland', 'SGG', 1),
( 178, 'Saint James Windward', 'SJW', 1),
( 178, 'Saint John Capesterre', 'SJC', 1),
( 178, 'Saint John Figtree', 'SJF', 1),
( 178, 'Saint Mary Cayon', 'SMC', 1),
( 178, 'Saint Paul Capesterre', 'CAP', 1),
( 178, 'Saint Paul Charlestown', 'CHA', 1),
( 178, 'Saint Peter Basseterre', 'SPB', 1),
( 178, 'Saint Thomas Lowland', 'STL', 1),
( 178, 'Saint Thomas Middle Island', 'STM', 1),
( 178, 'Trinity Palmetto Point', 'TPP', 1),
( 179, 'Anse-la-Raye', 'AR', 1),
( 179, 'Castries', 'CA', 1),
( 179, 'Choiseul', 'CH', 1),
( 179, 'Dauphin', 'DA', 1),
( 179, 'Dennery', 'DE', 1),
( 179, 'Gros-Islet', 'GI', 1),
( 179, 'Laborie', 'LA', 1),
( 179, 'Micoud', 'MI', 1),
( 179, 'Praslin', 'PR', 1),
( 179, 'Soufriere', 'SO', 1),
( 179, 'Vieux-Fort', 'VF', 1),
( 180, 'Charlotte', 'C', 1),
( 180, 'Grenadines', 'R', 1),
( 180, 'Saint Andrew', 'A', 1),
( 180, 'Saint David', 'D', 1),
( 180, 'Saint George', 'G', 1),
( 180, 'Saint Patrick', 'P', 1),
( 181, 'A''ana', 'AN', 1),
( 181, 'Aiga-i-le-Tai', 'AI', 1),
( 181, 'Atua', 'AT', 1),
( 181, 'Fa''asaleleaga', 'FA', 1),
( 181, 'Gaga''emauga', 'GE', 1),
( 181, 'Gagaifomauga', 'GF', 1),
( 181, 'Palauli', 'PA', 1),
( 181, 'Satupa''itea', 'SA', 1),
( 181, 'Tuamasaga', 'TU', 1),
( 181, 'Va''a-o-Fonoti', 'VF', 1),
( 181, 'Vaisigano', 'VS', 1),
( 182, 'Acquaviva', 'AC', 1),
( 182, 'Borgo Maggiore', 'BM', 1),
( 182, 'Chiesanuova', 'CH', 1),
( 182, 'Domagnano', 'DO', 1),
( 182, 'Faetano', 'FA', 1),
( 182, 'Fiorentino', 'FI', 1),
( 182, 'Montegiardino', 'MO', 1),
( 182, 'Citta di San Marino', 'SM', 1),
( 182, 'Serravalle', 'SE', 1),
( 183, 'Sao Tome', 'S', 1),
( 183, 'Principe', 'P', 1),
( 184, 'Al Bahah', 'BH', 1),
( 184, 'Al Hudud ash Shamaliyah', 'HS', 1),
( 184, 'Al Jawf', 'JF', 1),
( 184, 'Al Madinah', 'MD', 1),
( 184, 'Al Qasim', 'QS', 1),
( 184, 'Ar Riyad', 'RD', 1),
( 184, 'Ash Sharqiyah (Eastern)', 'AQ', 1),
( 184, '''Asir', 'AS', 1),
( 184, 'Ha''il', 'HL', 1),
( 184, 'Jizan', 'JZ', 1),
( 184, 'Makkah', 'ML', 1),
( 184, 'Najran', 'NR', 1),
( 184, 'Tabuk', 'TB', 1),
( 185, 'Dakar', 'DA', 1),
( 185, 'Diourbel', 'DI', 1),
( 185, 'Fatick', 'FA', 1),
( 185, 'Kaolack', 'KA', 1),
( 185, 'Kolda', 'KO', 1),
( 185, 'Louga', 'LO', 1),
( 185, 'Matam', 'MA', 1),
( 185, 'Saint-Louis', 'SL', 1),
( 185, 'Tambacounda', 'TA', 1),
( 185, 'Thies', 'TH', 1),
( 185, 'Ziguinchor', 'ZI', 1),
( 186, 'Anse aux Pins', 'AP', 1),
( 186, 'Anse Boileau', 'AB', 1),
( 186, 'Anse Etoile', 'AE', 1),
( 186, 'Anse Louis', 'AL', 1),
( 186, 'Anse Royale', 'AR', 1),
( 186, 'Baie Lazare', 'BL', 1),
( 186, 'Baie Sainte Anne', 'BS', 1),
( 186, 'Beau Vallon', 'BV', 1),
( 186, 'Bel Air', 'BA', 1),
( 186, 'Bel Ombre', 'BO', 1),
( 186, 'Cascade', 'CA', 1),
( 186, 'Glacis', 'GL', 1),
( 186, 'Grand'' Anse (on Mahe)', 'GM', 1),
( 186, 'Grand'' Anse (on Praslin)', 'GP',
1),
( 186, 'La Digue', 'DG', 1),
( 186, 'La Riviere Anglaise', 'RA', 1),
( 186, 'Mont Buxton', 'MB', 1),
( 186, 'Mont Fleuri', 'MF', 1),
( 186, 'Plaisance', 'PL', 1),
( 186, 'Pointe La Rue', 'PR', 1),
( 186, 'Port Glaud', 'PG', 1),
( 186, 'Saint Louis', 'SL', 1),
( 186, 'Takamaka', 'TA', 1),
( 187, 'Eastern', 'E', 1),
( 187, 'Northern', 'N', 1),
( 187, 'Southern', 'S', 1),
( 187, 'Western', 'W', 1),
( 189, 'Banskobystrický', 'BA', 1),
( 189, 'Bratislavský', 'BR', 1),
( 189, 'Košický', 'KO', 1),
( 189, 'Nitriansky', 'NI', 1),
( 189, 'Prešovský', 'PR', 1),
( 189, 'Trenčiansky', 'TC', 1),
( 189, 'Trnavský', 'TV', 1),
( 189, 'Žilinský', 'ZI', 1),
( 191, 'Central', 'CE', 1),
( 191, 'Choiseul', 'CH', 1),
( 191, 'Guadalcanal', 'GC', 1),
( 191, 'Honiara', 'HO', 1),
( 191, 'Isabel', 'IS', 1),
( 191, 'Makira', 'MK', 1),
( 191, 'Malaita', 'ML', 1),
( 191, 'Rennell and Bellona', 'RB', 1),
( 191, 'Temotu', 'TM', 1),
( 191, 'Western', 'WE', 1),
( 192, 'Awdal', 'AW', 1),
( 192, 'Bakool', 'BK', 1),
( 192, 'Banaadir', 'BN', 1),
( 192, 'Bari', 'BR', 1),
( 192, 'Bay', 'BY', 1),
( 192, 'Galguduud', 'GA', 1),
( 192, 'Gedo', 'GE', 1),
( 192, 'Hiiraan', 'HI', 1),
( 192, 'Jubbada Dhexe', 'JD', 1),
( 192, 'Jubbada Hoose', 'JH', 1),
( 192, 'Mudug', 'MU', 1),
( 192, 'Nugaal', 'NU', 1),
( 192, 'Sanaag', 'SA', 1),
( 192, 'Shabeellaha Dhexe', 'SD', 1),
( 192, 'Shabeellaha Hoose', 'SH', 1),
( 192, 'Sool', 'SL', 1),
( 192, 'Togdheer', 'TO', 1),
( 192, 'Woqooyi Galbeed', 'WG', 1),
( 193, 'Eastern Cape', 'EC', 1),
( 193, 'Free State', 'FS', 1),
( 193, 'Gauteng', 'GT', 1),
( 193, 'KwaZulu-Natal', 'KN', 1),
( 193, 'Limpopo', 'LP', 1),
( 193, 'Mpumalanga', 'MP', 1),
( 193, 'North West', 'NW', 1),
( 193, 'Northern Cape', 'NC', 1),
( 193, 'Western Cape', 'WC', 1),
( 195, 'La Coruña', 'CA', 1),
( 195, 'Álava', 'AL', 1),
( 195, 'Albacete', 'AB', 1),
( 195, 'Alicante', 'AC', 1),
( 195, 'Almeria', 'AM', 1),
( 195, 'Asturias', 'AS', 1),
( 195, 'Ávila', 'AV', 1),
( 195, 'Badajoz', 'BJ', 1),
( 195, 'Baleares', 'IB', 1),
( 195, 'Barcelona', 'BA', 1),
( 195, 'Burgos', 'BU', 1),
( 195, 'Cáceres', 'CC', 1),
( 195, 'Cádiz', 'CZ', 1),
( 195, 'Cantabria', 'CT', 1),
( 195, 'Castellón', 'CL', 1),
( 195, 'Ceuta', 'CE', 1),
( 195, 'Ciudad Real', 'CR', 1),
( 195, 'Córdoba', 'CD', 1),
( 195, 'Cuenca', 'CU', 1),
( 195, 'Girona', 'GI', 1),
( 195, 'Granada', 'GD', 1),
( 195, 'Guadalajara', 'GJ', 1),
( 195, 'Guipúzcoa', 'GP', 1),
( 195, 'Huelva', 'HL', 1),
( 195, 'Huesca', 'HS', 1),
( 195, 'Jaén', 'JN', 1),
( 195, 'La Rioja', 'RJ', 1),
( 195, 'Las Palmas', 'PM', 1),
( 195, 'Leon', 'LE', 1),
( 195, 'Lleida', 'LL', 1),
( 195, 'Lugo', 'LG', 1),
( 195, 'Madrid', 'MD', 1),
( 195, 'Malaga', 'MA', 1),
( 195, 'Melilla', 'ML', 1),
( 195, 'Murcia', 'MU', 1),
( 195, 'Navarra', 'NV', 1),
( 195, 'Ourense', 'OU', 1),
( 195, 'Palencia', 'PL', 1),
( 195, 'Pontevedra', 'PO', 1),
( 195, 'Salamanca', 'SL', 1),
( 195, 'Santa Cruz de Tenerife', 'SC', 1),
( 195, 'Segovia', 'SG', 1),
( 195, 'Sevilla', 'SV', 1),
( 195, 'Soria', 'SO', 1),
( 195, 'Tarragona', 'TA', 1),
( 195, 'Teruel', 'TE', 1),
( 195, 'Toledo', 'TO', 1),
( 195, 'Valencia', 'VC', 1),
( 195, 'Valladolid', 'VD', 1),
( 195, 'Vizcaya', 'VZ', 1),
( 195, 'Zamora', 'ZM', 1),
( 195, 'Zaragoza', 'ZR', 1),
( 196, 'Central', 'CE', 1),
( 196, 'Eastern', 'EA', 1),
( 196, 'North Central', 'NC', 1),
( 196, 'Northern', 'NO', 1),
( 196, 'North Western', 'NW', 1),
( 196, 'Sabaragamuwa', 'SA', 1),
( 196, 'Southern', 'SO', 1),
( 196, 'Uva', 'UV', 1),
( 196, 'Western', 'WE', 1),
( 197, 'Ascension', 'A', 1),
( 197, 'Saint Helena', 'S', 1),
( 197, 'Tristan da Cunha', 'T', 1),
( 199, 'A''ali an Nil', 'ANL', 1),
( 199, 'Al Bahr al Ahmar', 'BAM', 1),
( 199, 'Al Buhayrat', 'BRT', 1),
( 199, 'Al Jazirah', 'JZR', 1),
( 199, 'Al Khartum', 'KRT', 1),
( 199, 'Al Qadarif', 'QDR', 1),
( 199, 'Al Wahdah', 'WDH', 1),
( 199, 'An Nil al Abyad', 'ANB', 1),
( 199, 'An Nil al Azraq', 'ANZ', 1),
( 199, 'Ash Shamaliyah', 'ASH', 1),
( 199, 'Bahr al Jabal', 'BJA', 1),
( 199, 'Gharb al Istiwa''iyah', 'GIS', 1),
( 199, 'Gharb Bahr al Ghazal', 'GBG', 1),
( 199, 'Gharb Darfur', 'GDA', 1),
( 199, 'Gharb Kurdufan', 'GKU', 1),
( 199, 'Janub Darfur', 'JDA', 1),
( 199, 'Janub Kurdufan', 'JKU', 1),
( 199, 'Junqali', 'JQL', 1),
( 199, 'Kassala', 'KSL', 1),
( 199, 'Nahr an Nil', 'NNL', 1),
( 199, 'Shamal Bahr al Ghazal', 'SBG', 1),
( 199, 'Shamal Darfur', 'SDA', 1),
( 199, 'Shamal Kurdufan', 'SKU', 1),
( 199, 'Sharq al Istiwa''iyah', 'SIS', 1),
( 199, 'Sinnar', 'SNR', 1);
INSERT INTO `#__phocacart_regions` (`country_id`, `title`, `code3`,
`published`) VALUES
( 199, 'Warab', 'WRB', 1),
( 200, 'Brokopondo', 'BR', 1),
( 200, 'Commewijne', 'CM', 1),
( 200, 'Coronie', 'CR', 1),
( 200, 'Marowijne', 'MA', 1),
( 200, 'Nickerie', 'NI', 1),
( 200, 'Para', 'PA', 1),
( 200, 'Paramaribo', 'PM', 1),
( 200, 'Saramacca', 'SA', 1),
( 200, 'Sipaliwini', 'SI', 1),
( 200, 'Wanica', 'WA', 1),
( 202, 'Hhohho', 'H', 1),
( 202, 'Lubombo', 'L', 1),
( 202, 'Manzini', 'M', 1),
( 202, 'Shishelweni', 'S', 1),
( 203, 'Blekinge', 'K', 1),
( 203, 'Dalarna', 'W', 1),
( 203, 'Gävleborg', 'X', 1),
( 203, 'Gotland', 'I', 1),
( 203, 'Halland', 'N', 1),
( 203, 'Jämtland', 'Z', 1),
( 203, 'Jönköping', 'F', 1),
( 203, 'Kalmar', 'H', 1),
( 203, 'Kronoberg', 'G', 1),
( 203, 'Norrbotten', 'BD', 1),
( 203, 'Örebro', 'T', 1),
( 203, 'Östergötland', 'E', 1),
( 203, 'Skåne', 'M', 1),
( 203, 'Södermanland', 'D', 1),
( 203, 'Stockholm', 'AB', 1),
( 203, 'Uppsala', 'C', 1),
( 203, 'Värmland', 'S', 1),
( 203, 'Västerbotten', 'AC', 1),
( 203, 'Västernorrland', 'Y', 1),
( 203, 'Västmanland', 'U', 1),
( 203, 'Västra Götaland', 'O', 1),
( 204, 'Aargau', 'AG', 1),
( 204, 'Appenzell Ausserrhoden', 'AR', 1),
( 204, 'Appenzell Innerrhoden', 'AI', 1),
( 204, 'Basel-Stadt', 'BS', 1),
( 204, 'Basel-Landschaft', 'BL', 1),
( 204, 'Bern', 'BE', 1),
( 204, 'Fribourg', 'FR', 1),
( 204, 'Genève', 'GE', 1),
( 204, 'Glarus', 'GL', 1),
( 204, 'Graubünden', 'GR', 1),
( 204, 'Jura', 'JU', 1),
( 204, 'Luzern', 'LU', 1),
( 204, 'Neuchâtel', 'NE', 1),
( 204, 'Nidwalden', 'NW', 1),
( 204, 'Obwalden', 'OW', 1),
( 204, 'St. Gallen', 'SG', 1),
( 204, 'Schaffhausen', 'SH', 1),
( 204, 'Schwyz', 'SZ', 1),
( 204, 'Solothurn', 'SO', 1),
( 204, 'Thurgau', 'TG', 1),
( 204, 'Ticino', 'TI', 1),
( 204, 'Uri', 'UR', 1),
( 204, 'Valais', 'VS', 1),
( 204, 'Vaud', 'VD', 1),
( 204, 'Zug', 'ZG', 1),
( 204, 'Zürich', 'ZH', 1),
( 205, 'Al Hasakah', 'HA', 1),
( 205, 'Al Ladhiqiyah', 'LA', 1),
( 205, 'Al Qunaytirah', 'QU', 1),
( 205, 'Ar Raqqah', 'RQ', 1),
( 205, 'As Suwayda', 'SU', 1),
( 205, 'Dara', 'DA', 1),
( 205, 'Dayr az Zawr', 'DZ', 1),
( 205, 'Dimashq', 'DI', 1),
( 205, 'Halab', 'HL', 1),
( 205, 'Hamah', 'HM', 1),
( 205, 'Hims', 'HI', 1),
( 205, 'Idlib', 'ID', 1),
( 205, 'Rif Dimashq', 'RD', 1),
( 205, 'Tartus', 'TA', 1),
( 206, 'Chang-hua', 'CH', 1),
( 206, 'Chia-i', 'CI', 1),
( 206, 'Hsin-chu', 'HS', 1),
( 206, 'Hua-lien', 'HL', 1),
( 206, 'I-lan', 'IL', 1),
( 206, 'Kao-hsiung county', 'KH', 1),
( 206, 'Kin-men', 'KM', 1),
( 206, 'Lien-chiang', 'LC', 1),
( 206, 'Miao-li', 'ML', 1),
( 206, 'Nan-t''ou', 'NT', 1),
( 206, 'P''eng-hu', 'PH', 1),
( 206, 'P''ing-tung', 'PT', 1),
( 206, 'T''ai-chung', 'TG', 1),
( 206, 'T''ai-nan', 'TA', 1),
( 206, 'T''ai-pei county', 'TP', 1),
( 206, 'T''ai-tung', 'TT', 1),
( 206, 'T''ao-yuan', 'TY', 1),
( 206, 'Yun-lin', 'YL', 1),
( 206, 'Chia-i city', 'CC', 1),
( 206, 'Chi-lung', 'CL', 1),
( 206, 'Hsin-chu', 'HC', 1),
( 206, 'T''ai-chung', 'TH', 1),
( 206, 'T''ai-nan', 'TN', 1),
( 206, 'Kao-hsiung city', 'KC', 1),
( 206, 'T''ai-pei city', 'TC', 1),
( 207, 'Gorno-Badakhstan', 'GB', 1),
( 207, 'Khatlon', 'KT', 1),
( 207, 'Sughd', 'SU', 1),
( 208, 'Arusha', 'AR', 1),
( 208, 'Dar es Salaam', 'DS', 1),
( 208, 'Dodoma', 'DO', 1),
( 208, 'Iringa', 'IR', 1),
( 208, 'Kagera', 'KA', 1),
( 208, 'Kigoma', 'KI', 1),
( 208, 'Kilimanjaro', 'KJ', 1),
( 208, 'Lindi', 'LN', 1),
( 208, 'Manyara', 'MY', 1),
( 208, 'Mara', 'MR', 1),
( 208, 'Mbeya', 'MB', 1),
( 208, 'Morogoro', 'MO', 1),
( 208, 'Mtwara', 'MT', 1),
( 208, 'Mwanza', 'MW', 1),
( 208, 'Pemba North', 'PN', 1),
( 208, 'Pemba South', 'PS', 1),
( 208, 'Pwani', 'PW', 1),
( 208, 'Rukwa', 'RK', 1),
( 208, 'Ruvuma', 'RV', 1),
( 208, 'Shinyanga', 'SH', 1),
( 208, 'Singida', 'SI', 1),
( 208, 'Tabora', 'TB', 1),
( 208, 'Tanga', 'TN', 1),
( 208, 'Zanzibar Central/South', 'ZC', 1),
( 208, 'Zanzibar North', 'ZN', 1),
( 208, 'Zanzibar Urban/West', 'ZU', 1),
( 209, 'Amnat Charoen', 'Amnat Charoen', 1),
( 209, 'Ang Thong', 'Ang Thong', 1),
( 209, 'Ayutthaya', 'Ayutthaya', 1),
( 209, 'Bangkok', 'Bangkok', 1),
( 209, 'Buriram', 'Buriram', 1),
( 209, 'Chachoengsao', 'Chachoengsao', 1),
( 209, 'Chai Nat', 'Chai Nat', 1),
( 209, 'Chaiyaphum', 'Chaiyaphum', 1),
( 209, 'Chanthaburi', 'Chanthaburi', 1),
( 209, 'Chiang Mai', 'Chiang Mai', 1),
( 209, 'Chiang Rai', 'Chiang Rai', 1),
( 209, 'Chon Buri', 'Chon Buri', 1),
( 209, 'Chumphon', 'Chumphon', 1),
( 209, 'Kalasin', 'Kalasin', 1),
( 209, 'Kamphaeng Phet', 'Kamphaeng Phet', 1),
( 209, 'Kanchanaburi', 'Kanchanaburi', 1),
( 209, 'Khon Kaen', 'Khon Kaen', 1),
( 209, 'Krabi', 'Krabi', 1),
( 209, 'Lampang', 'Lampang', 1),
( 209, 'Lamphun', 'Lamphun', 1),
( 209, 'Loei', 'Loei', 1),
( 209, 'Lop Buri', 'Lop Buri', 1),
( 209, 'Mae Hong Son', 'Mae Hong Son', 1),
( 209, 'Maha Sarakham', 'Maha Sarakham', 1),
( 209, 'Mukdahan', 'Mukdahan', 1),
( 209, 'Nakhon Nayok', 'Nakhon Nayok', 1),
( 209, 'Nakhon Pathom', 'Nakhon Pathom', 1),
( 209, 'Nakhon Phanom', 'Nakhon Phanom', 1),
( 209, 'Nakhon Ratchasima', 'Nakhon Ratchasima', 1),
( 209, 'Nakhon Sawan', 'Nakhon Sawan', 1),
( 209, 'Nakhon Si Thammarat', 'Nakhon Si Thammarat',
1),
( 209, 'Nan', 'Nan', 1),
( 209, 'Narathiwat', 'Narathiwat', 1),
( 209, 'Nong Bua Lamphu', 'Nong Bua Lamphu', 1),
( 209, 'Nong Khai', 'Nong Khai', 1),
( 209, 'Nonthaburi', 'Nonthaburi', 1),
( 209, 'Pathum Thani', 'Pathum Thani', 1),
( 209, 'Pattani', 'Pattani', 1),
( 209, 'Phangnga', 'Phangnga', 1),
( 209, 'Phatthalung', 'Phatthalung', 1),
( 209, 'Phayao', 'Phayao', 1),
( 209, 'Phetchabun', 'Phetchabun', 1),
( 209, 'Phetchaburi', 'Phetchaburi', 1),
( 209, 'Phichit', 'Phichit', 1),
( 209, 'Phitsanulok', 'Phitsanulok', 1),
( 209, 'Phrae', 'Phrae', 1),
( 209, 'Phuket', 'Phuket', 1),
( 209, 'Prachin Buri', 'Prachin Buri', 1),
( 209, 'Prachuap Khiri Khan', 'Prachuap Khiri Khan',
1),
( 209, 'Ranong', 'Ranong', 1),
( 209, 'Ratchaburi', 'Ratchaburi', 1),
( 209, 'Rayong', 'Rayong', 1),
( 209, 'Roi Et', 'Roi Et', 1),
( 209, 'Sa Kaeo', 'Sa Kaeo', 1),
( 209, 'Sakon Nakhon', 'Sakon Nakhon', 1),
( 209, 'Samut Prakan', 'Samut Prakan', 1),
( 209, 'Samut Sakhon', 'Samut Sakhon', 1),
( 209, 'Samut Songkhram', 'Samut Songkhram', 1),
( 209, 'Sara Buri', 'Sara Buri', 1),
( 209, 'Satun', 'Satun', 1),
( 209, 'Sing Buri', 'Sing Buri', 1),
( 209, 'Sisaket', 'Sisaket', 1),
( 209, 'Songkhla', 'Songkhla', 1),
( 209, 'Sukhothai', 'Sukhothai', 1),
( 209, 'Suphan Buri', 'Suphan Buri', 1),
( 209, 'Surat Thani', 'Surat Thani', 1),
( 209, 'Surin', 'Surin', 1),
( 209, 'Tak', 'Tak', 1),
( 209, 'Trang', 'Trang', 1),
( 209, 'Trat', 'Trat', 1),
( 209, 'Ubon Ratchathani', 'Ubon Ratchathani', 1),
( 209, 'Udon Thani', 'Udon Thani', 1),
( 209, 'Uthai Thani', 'Uthai Thani', 1),
( 209, 'Uttaradit', 'Uttaradit', 1),
( 209, 'Yala', 'Yala', 1),
( 209, 'Yasothon', 'Yasothon', 1),
( 210, 'Kara', 'K', 1),
( 210, 'Plateaux', 'P', 1),
( 210, 'Savanes', 'S', 1),
( 210, 'Centrale', 'C', 1),
( 210, 'Maritime', 'M', 1),
( 211, 'Atafu', 'A', 1),
( 211, 'Fakaofo', 'F', 1),
( 211, 'Nukunonu', 'N', 1),
( 212, 'Ha''apai', 'H', 1),
( 212, 'Tongatapu', 'T', 1),
( 212, 'Vava''u', 'V', 1),
( 213, 'Couva/Tabaquite/Talparo', 'CT', 1),
( 213, 'Diego Martin', 'DM', 1),
( 213, 'Mayaro/Rio Claro', 'MR', 1),
( 213, 'Penal/Debe', 'PD', 1),
( 213, 'Princes Town', 'PT', 1),
( 213, 'Sangre Grande', 'SG', 1),
( 213, 'San Juan/Laventille', 'SL', 1),
( 213, 'Siparia', 'SI', 1),
( 213, 'Tunapuna/Piarco', 'TP', 1),
( 213, 'Port of Spain', 'PS', 1),
( 213, 'San Fernando', 'SF', 1),
( 213, 'Arima', 'AR', 1),
( 213, 'Point Fortin', 'PF', 1),
( 213, 'Chaguanas', 'CH', 1),
( 213, 'Tobago', 'TO', 1),
( 214, 'Ariana', 'AR', 1),
( 214, 'Beja', 'BJ', 1),
( 214, 'Ben Arous', 'BA', 1),
( 214, 'Bizerte', 'BI', 1),
( 214, 'Gabes', 'GB', 1),
( 214, 'Gafsa', 'GF', 1),
( 214, 'Jendouba', 'JE', 1),
( 214, 'Kairouan', 'KR', 1),
( 214, 'Kasserine', 'KS', 1),
( 214, 'Kebili', 'KB', 1),
( 214, 'Kef', 'KF', 1),
( 214, 'Mahdia', 'MH', 1),
( 214, 'Manouba', 'MN', 1),
( 214, 'Medenine', 'ME', 1),
( 214, 'Monastir', 'MO', 1),
( 214, 'Nabeul', 'NA', 1),
( 214, 'Sfax', 'SF', 1),
( 214, 'Sidi', 'SD', 1),
( 214, 'Siliana', 'SL', 1),
( 214, 'Sousse', 'SO', 1),
( 214, 'Tataouine', 'TA', 1),
( 214, 'Tozeur', 'TO', 1),
( 214, 'Tunis', 'TU', 1),
( 214, 'Zaghouan', 'ZA', 1),
( 215, 'Adana', 'ADA', 1),
( 215, 'Adıyaman', 'ADI', 1),
( 215, 'Afyonkarahisar', 'AFY', 1),
( 215, 'Ağrı', 'AGR', 1),
( 215, 'Aksaray', 'AKS', 1),
( 215, 'Amasya', 'AMA', 1),
( 215, 'Ankara', 'ANK', 1),
( 215, 'Antalya', 'ANT', 1),
( 215, 'Ardahan', 'ARD', 1),
( 215, 'Artvin', 'ART', 1),
( 215, 'Aydın', 'AYI', 1),
( 215, 'Balıkesir', 'BAL', 1),
( 215, 'Bartın', 'BAR', 1),
( 215, 'Batman', 'BAT', 1),
( 215, 'Bayburt', 'BAY', 1),
( 215, 'Bilecik', 'BIL', 1),
( 215, 'Bingöl', 'BIN', 1),
( 215, 'Bitlis', 'BIT', 1),
( 215, 'Bolu', 'BOL', 1),
( 215, 'Burdur', 'BRD', 1),
( 215, 'Bursa', 'BRS', 1),
( 215, 'Çanakkale', 'CKL', 1),
( 215, 'Çankırı', 'CKR', 1),
( 215, 'Çorum', 'COR', 1),
( 215, 'Denizli', 'DEN', 1),
( 215, 'Diyarbakir', 'DIY', 1),
( 215, 'Düzce', 'DUZ', 1),
( 215, 'Edirne', 'EDI', 1),
( 215, 'Elazığ', 'ELA', 1),
( 215, 'Erzincan', 'EZC', 1),
( 215, 'Erzurum', 'EZR', 1),
( 215, 'Eskişehir', 'ESK', 1),
( 215, 'Gaziantep', 'GAZ', 1),
( 215, 'Giresun', 'GIR', 1),
( 215, 'Gümüşhane', 'GMS', 1),
( 215, 'Hakkari', 'HKR', 1),
( 215, 'Hatay', 'HTY', 1),
( 215, 'Iğdır', 'IGD', 1),
( 215, 'Isparta', 'ISP', 1),
( 215, 'İstanbul', 'IST', 1),
( 215, 'İzmir', 'IZM', 1),
( 215, 'Kahramanmaraş', 'KAH', 1),
( 215, 'Karabük', 'KRB', 1),
( 215, 'Karaman', 'KRM', 1),
( 215, 'Kars', 'KRS', 1),
( 215, 'Kastamonu', 'KAS', 1),
( 215, 'Kayseri', 'KAY', 1),
( 215, 'Kilis', 'KLS', 1),
( 215, 'Kırıkkale', 'KRK', 1),
( 215, 'Kırklareli', 'KLR', 1),
( 215, 'Kırşehir', 'KRH', 1),
( 215, 'Kocaeli', 'KOC', 1),
( 215, 'Konya', 'KON', 1),
( 215, 'Kütahya', 'KUT', 1),
( 215, 'Malatya', 'MAL', 1),
( 215, 'Manisa', 'MAN', 1),
( 215, 'Mardin', 'MAR', 1),
( 215, 'Mersin', 'MER', 1),
( 215, 'Muğla', 'MUG', 1),
( 215, 'Muş', 'MUS', 1),
( 215, 'Nevşehir', 'NEV', 1),
( 215, 'Niğde', 'NIG', 1),
( 215, 'Ordu', 'ORD', 1),
( 215, 'Osmaniye', 'OSM', 1),
( 215, 'Rize', 'RIZ', 1),
( 215, 'Sakarya', 'SAK', 1),
( 215, 'Samsun', 'SAM', 1),
( 215, 'Şanlıurfa', 'SAN', 1),
( 215, 'Siirt', 'SII', 1),
( 215, 'Sinop', 'SIN', 1),
( 215, 'Şırnak', 'SIR', 1),
( 215, 'Sivas', 'SIV', 1),
( 215, 'Tekirdağ', 'TEL', 1),
( 215, 'Tokat', 'TOK', 1),
( 215, 'Trabzon', 'TRA', 1),
( 215, 'Tunceli', 'TUN', 1),
( 215, 'Uşak', 'USK', 1),
( 215, 'Van', 'VAN', 1),
( 215, 'Yalova', 'YAL', 1),
( 215, 'Yozgat', 'YOZ', 1),
( 215, 'Zonguldak', 'ZON', 1),
( 216, 'Ahal Welayaty', 'A', 1),
( 216, 'Balkan Welayaty', 'B', 1),
( 216, 'Dashhowuz Welayaty', 'D', 1),
( 216, 'Lebap Welayaty', 'L', 1),
( 216, 'Mary Welayaty', 'M', 1),
( 217, 'Ambergris Cays', 'AC', 1),
( 217, 'Dellis Cay', 'DC', 1),
( 217, 'French Cay', 'FC', 1),
( 217, 'Little Water Cay', 'LW', 1),
( 217, 'Parrot Cay', 'RC', 1),
( 217, 'Pine Cay', 'PN', 1),
( 217, 'Salt Cay', 'SL', 1),
( 217, 'Grand Turk', 'GT', 1),
( 217, 'South Caicos', 'SC', 1),
( 217, 'East Caicos', 'EC', 1),
( 217, 'Middle Caicos', 'MC', 1),
( 217, 'North Caicos', 'NC', 1),
( 217, 'Providenciales', 'PR', 1),
( 217, 'West Caicos', 'WC', 1),
( 218, 'Nanumanga', 'NMG', 1),
( 218, 'Niulakita', 'NLK', 1),
( 218, 'Niutao', 'NTO', 1),
( 218, 'Funafuti', 'FUN', 1),
( 218, 'Nanumea', 'NME', 1),
( 218, 'Nui', 'NUI', 1),
( 218, 'Nukufetau', 'NFT', 1),
( 218, 'Nukulaelae', 'NLL', 1),
( 218, 'Vaitupu', 'VAI', 1),
( 219, 'Kalangala', 'KAL', 1),
( 219, 'Kampala', 'KMP', 1),
( 219, 'Kayunga', 'KAY', 1),
( 219, 'Kiboga', 'KIB', 1),
( 219, 'Luwero', 'LUW', 1),
( 219, 'Masaka', 'MAS', 1),
( 219, 'Mpigi', 'MPI', 1),
( 219, 'Mubende', 'MUB', 1),
( 219, 'Mukono', 'MUK', 1),
( 219, 'Nakasongola', 'NKS', 1),
( 219, 'Rakai', 'RAK', 1),
( 219, 'Sembabule', 'SEM', 1),
( 219, 'Wakiso', 'WAK', 1),
( 219, 'Bugiri', 'BUG', 1),
( 219, 'Busia', 'BUS', 1),
( 219, 'Iganga', 'IGA', 1),
( 219, 'Jinja', 'JIN', 1),
( 219, 'Kaberamaido', 'KAB', 1),
( 219, 'Kamuli', 'KML', 1),
( 219, 'Kapchorwa', 'KPC', 1),
( 219, 'Katakwi', 'KTK', 1),
( 219, 'Kumi', 'KUM', 1),
( 219, 'Mayuge', 'MAY', 1),
( 219, 'Mbale', 'MBA', 1),
( 219, 'Pallisa', 'PAL', 1),
( 219, 'Sironko', 'SIR', 1),
( 219, 'Soroti', 'SOR', 1),
( 219, 'Tororo', 'TOR', 1),
( 219, 'Adjumani', 'ADJ', 1),
( 219, 'Apac', 'APC', 1),
( 219, 'Arua', 'ARU', 1),
( 219, 'Gulu', 'GUL', 1),
( 219, 'Kitgum', 'KIT', 1),
( 219, 'Kotido', 'KOT', 1),
( 219, 'Lira', 'LIR', 1),
( 219, 'Moroto', 'MRT', 1),
( 219, 'Moyo', 'MOY', 1),
( 219, 'Nakapiripirit', 'NAK', 1),
( 219, 'Nebbi', 'NEB', 1),
( 219, 'Pader', 'PAD', 1),
( 219, 'Yumbe', 'YUM', 1),
( 219, 'Bundibugyo', 'BUN', 1),
( 219, 'Bushenyi', 'BSH', 1),
( 219, 'Hoima', 'HOI', 1),
( 219, 'Kabale', 'KBL', 1),
( 219, 'Kabarole', 'KAR', 1),
( 219, 'Kamwenge', 'KAM', 1),
( 219, 'Kanungu', 'KAN', 1),
( 219, 'Kasese', 'KAS', 1),
( 219, 'Kibaale', 'KBA', 1),
( 219, 'Kisoro', 'KIS', 1),
( 219, 'Kyenjojo', 'KYE', 1),
( 219, 'Masindi', 'MSN', 1),
( 219, 'Mbarara', 'MBR', 1),
( 219, 'Ntungamo', 'NTU', 1),
( 219, 'Rukungiri', 'RUK', 1),
( 220, 'Cherkasy', 'CK', 1),
( 220, 'Chernihiv', 'CH', 1),
( 220, 'Chernivtsi', 'CV', 1),
( 220, 'Crimea', 'CR', 1),
( 220, 'Dnipropetrovs''k', 'DN', 1),
( 220, 'Donets''k', 'DO', 1),
( 220, 'Ivano-Frankivs''k', 'IV', 1),
( 220, 'Kharkiv Kherson', 'KL', 1),
( 220, 'Khmel''nyts''kyy', 'KM',
1),
( 220, 'Kirovohrad', 'KR', 1),
( 220, 'Kiev', 'KV', 1),
( 220, 'Kyyiv', 'KY', 1),
( 220, 'Luhans''k', 'LU', 1),
( 220, 'L''viv', 'LV', 1),
( 220, 'Mykolayiv', 'MY', 1),
( 220, 'Odesa', 'OD', 1),
( 220, 'Poltava', 'PO', 1),
( 220, 'Rivne', 'RI', 1),
( 220, 'Sevastopol', 'SE', 1),
( 220, 'Sumy', 'SU', 1),
( 220, 'Ternopil''', 'TE', 1),
( 220, 'Vinnytsya', 'VI', 1),
( 220, 'Volyn''', 'VO', 1),
( 220, 'Zakarpattya', 'ZK', 1),
( 220, 'Zaporizhzhya', 'ZA', 1),
( 220, 'Zhytomyr', 'ZH', 1),
( 221, 'Abu Zaby', 'AZ', 1),
( 221, '''Ajman', 'AJ', 1),
( 221, 'Al Fujayrah', 'FU', 1),
( 221, 'Ash Shariqah', 'SH', 1),
( 221, 'Dubayy', 'DU', 1),
( 221, 'R''as al Khaymah', 'RK', 1),
( 221, 'Umm al Qaywayn', 'UQ', 1),
( 222, 'Aberdeen', 'ABN', 1),
( 222, 'Aberdeenshire', 'ABNS', 1),
( 222, 'Anglesey', 'ANG', 1),
( 222, 'Angus', 'AGS', 1),
( 222, 'Argyll and Bute', 'ARY', 1),
( 222, 'Bedfordshire', 'BEDS', 1),
( 222, 'Berkshire', 'BERKS', 1),
( 222, 'Blaenau Gwent', 'BLA', 1),
( 222, 'Bridgend', 'BRI', 1),
( 222, 'Bristol', 'BSTL', 1),
( 222, 'Buckinghamshire', 'BUCKS', 1),
( 222, 'Caerphilly', 'CAE', 1),
( 222, 'Cambridgeshire', 'CAMBS', 1),
( 222, 'Cardiff', 'CDF', 1),
( 222, 'Carmarthenshire', 'CARM', 1),
( 222, 'Ceredigion', 'CDGN', 1),
( 222, 'Cheshire', 'CHES', 1),
( 222, 'Clackmannanshire', 'CLACK', 1),
( 222, 'Conwy', 'CON', 1),
( 222, 'Cornwall', 'CORN', 1),
( 222, 'Denbighshire', 'DNBG', 1),
( 222, 'Derbyshire', 'DERBY', 1),
( 222, 'Devon', 'DVN', 1),
( 222, 'Dorset', 'DOR', 1),
( 222, 'Dumfries and Galloway', 'DGL', 1),
( 222, 'Dundee', 'DUND', 1),
( 222, 'Durham', 'DHM', 1),
( 222, 'East Ayrshire', 'ARYE', 1),
( 222, 'East Dunbartonshire', 'DUNBE', 1),
( 222, 'East Lothian', 'LOTE', 1),
( 222, 'East Renfrewshire', 'RENE', 1),
( 222, 'East Riding of Yorkshire', 'ERYS', 1),
( 222, 'East Sussex', 'SXE', 1),
( 222, 'Edinburgh', 'EDIN', 1),
( 222, 'Essex', 'ESX', 1),
( 222, 'Falkirk', 'FALK', 1),
( 222, 'Fife', 'FFE', 1),
( 222, 'Flintshire', 'FLINT', 1),
( 222, 'Glasgow', 'GLAS', 1),
( 222, 'Gloucestershire', 'GLOS', 1),
( 222, 'Greater London', 'LDN', 1),
( 222, 'Greater Manchester', 'MCH', 1),
( 222, 'Gwynedd', 'GDD', 1),
( 222, 'Hampshire', 'HANTS', 1),
( 222, 'Herefordshire', 'HWR', 1),
( 222, 'Hertfordshire', 'HERTS', 1),
( 222, 'Highlands', 'HLD', 1),
( 222, 'Inverclyde', 'IVER', 1),
( 222, 'Isle of Wight', 'IOW', 1),
( 222, 'Kent', 'KNT', 1),
( 222, 'Lancashire', 'LANCS', 1),
( 222, 'Leicestershire', 'LEICS', 1),
( 222, 'Lincolnshire', 'LINCS', 1),
( 222, 'Merseyside', 'MSY', 1),
( 222, 'Merthyr Tydfil', 'MERT', 1),
( 222, 'Midlothian', 'MLOT', 1),
( 222, 'Monmouthshire', 'MMOUTH', 1),
( 222, 'Moray', 'MORAY', 1),
( 222, 'Neath Port Talbot', 'NPRTAL', 1),
( 222, 'Newport', 'NEWPT', 1),
( 222, 'Norfolk', 'NOR', 1),
( 222, 'North Ayrshire', 'ARYN', 1),
( 222, 'North Lanarkshire', 'LANN', 1),
( 222, 'North Yorkshire', 'YSN', 1),
( 222, 'Northamptonshire', 'NHM', 1),
( 222, 'Northumberland', 'NLD', 1),
( 222, 'Nottinghamshire', 'NOT', 1),
( 222, 'Orkney Islands', 'ORK', 1),
( 222, 'Oxfordshire', 'OFE', 1),
( 222, 'Pembrokeshire', 'PEM', 1),
( 222, 'Perth and Kinross', 'PERTH', 1),
( 222, 'Powys', 'PWS', 1),
( 222, 'Renfrewshire', 'REN', 1),
( 222, 'Rhondda Cynon Taff', 'RHON', 1),
( 222, 'Rutland', 'RUT', 1),
( 222, 'Scottish Borders', 'BOR', 1),
( 222, 'Shetland Islands', 'SHET', 1),
( 222, 'Shropshire', 'SPE', 1),
( 222, 'Somerset', 'SOM', 1),
( 222, 'South Ayrshire', 'ARYS', 1),
( 222, 'South Lanarkshire', 'LANS', 1),
( 222, 'South Yorkshire', 'YSS', 1),
( 222, 'Staffordshire', 'SFD', 1),
( 222, 'Stirling', 'STIR', 1),
( 222, 'Suffolk', 'SFK', 1),
( 222, 'Surrey', 'SRY', 1),
( 222, 'Swansea', 'SWAN', 1),
( 222, 'Torfaen', 'TORF', 1),
( 222, 'Tyne and Wear', 'TWR', 1),
( 222, 'Vale of Glamorgan', 'VGLAM', 1),
( 222, 'Warwickshire', 'WARKS', 1),
( 222, 'West Dunbartonshire', 'WDUN', 1),
( 222, 'West Lothian', 'WLOT', 1),
( 222, 'West Midlands', 'WMD', 1),
( 222, 'West Sussex', 'SXW', 1),
( 222, 'West Yorkshire', 'YSW', 1),
( 222, 'Western Isles', 'WIL', 1),
( 222, 'Wiltshire', 'WLT', 1),
( 222, 'Worcestershire', 'WORCS', 1),
( 222, 'Wrexham', 'WRX', 1),
( 223, 'Alabama', 'AL', 1),
( 223, 'Alaska', 'AK', 1),
( 223, 'American Samoa', 'AS', 1),
( 223, 'Arizona', 'AZ', 1),
( 223, 'Arkansas', 'AR', 1),
( 223, 'Armed Forces Africa', 'AF', 1),
( 223, 'Armed Forces Americas', 'AA', 1),
( 223, 'Armed Forces Canada', 'AC', 1),
( 223, 'Armed Forces Europe', 'AE', 1),
( 223, 'Armed Forces Middle East', 'AM', 1),
( 223, 'Armed Forces Pacific', 'AP', 1),
( 223, 'California', 'CA', 1),
( 223, 'Colorado', 'CO', 1),
( 223, 'Connecticut', 'CT', 1),
( 223, 'Delaware', 'DE', 1),
( 223, 'District of Columbia', 'DC', 1),
( 223, 'Federated States Of Micronesia', 'FM', 1),
( 223, 'Florida', 'FL', 1),
( 223, 'Georgia', 'GA', 1),
( 223, 'Guam', 'GU', 1),
( 223, 'Hawaii', 'HI', 1),
( 223, 'Idaho', 'ID', 1),
( 223, 'Illinois', 'IL', 1),
( 223, 'Indiana', 'IN', 1),
( 223, 'Iowa', 'IA', 1),
( 223, 'Kansas', 'KS', 1),
( 223, 'Kentucky', 'KY', 1),
( 223, 'Louisiana', 'LA', 1),
( 223, 'Maine', 'ME', 1),
( 223, 'Marshall Islands', 'MH', 1),
( 223, 'Maryland', 'MD', 1),
( 223, 'Massachusetts', 'MA', 1),
( 223, 'Michigan', 'MI', 1),
( 223, 'Minnesota', 'MN', 1),
( 223, 'Mississippi', 'MS', 1),
( 223, 'Missouri', 'MO', 1),
( 223, 'Montana', 'MT', 1),
( 223, 'Nebraska', 'NE', 1),
( 223, 'Nevada', 'NV', 1),
( 223, 'New Hampshire', 'NH', 1),
( 223, 'New Jersey', 'NJ', 1),
( 223, 'New Mexico', 'NM', 1),
( 223, 'New York', 'NY', 1),
( 223, 'North Carolina', 'NC', 1),
( 223, 'North Dakota', 'ND', 1),
( 223, 'Northern Mariana Islands', 'MP', 1),
( 223, 'Ohio', 'OH', 1),
( 223, 'Oklahoma', 'OK', 1),
( 223, 'Oregon', 'OR', 1),
( 223, 'Palau', 'PW', 1),
( 223, 'Pennsylvania', 'PA', 1),
( 223, 'Puerto Rico', 'PR', 1),
( 223, 'Rhode Island', 'RI', 1),
( 223, 'South Carolina', 'SC', 1),
( 223, 'South Dakota', 'SD', 1),
( 223, 'Tennessee', 'TN', 1),
( 223, 'Texas', 'TX', 1),
( 223, 'Utah', 'UT', 1),
( 223, 'Vermont', 'VT', 1),
( 223, 'Virgin Islands', 'VI', 1),
( 223, 'Virginia', 'VA', 1),
( 223, 'Washington', 'WA', 1),
( 223, 'West Virginia', 'WV', 1),
( 223, 'Wisconsin', 'WI', 1),
( 223, 'Wyoming', 'WY', 1),
( 224, 'Baker Island', 'BI', 1),
( 224, 'Howland Island', 'HI', 1),
( 224, 'Jarvis Island', 'JI', 1),
( 224, 'Johnston Atoll', 'JA', 1),
( 224, 'Kingman Reef', 'KR', 1),
( 224, 'Midway Atoll', 'MA', 1),
( 224, 'Navassa Island', 'NI', 1),
( 224, 'Palmyra Atoll', 'PA', 1),
( 224, 'Wake Island', 'WI', 1),
( 225, 'Artigas', 'AR', 1),
( 225, 'Canelones', 'CA', 1),
( 225, 'Cerro Largo', 'CL', 1),
( 225, 'Colonia', 'CO', 1),
( 225, 'Durazno', 'DU', 1),
( 225, 'Flores', 'FS', 1),
( 225, 'Florida', 'FA', 1),
( 225, 'Lavalleja', 'LA', 1),
( 225, 'Maldonado', 'MA', 1),
( 225, 'Montevideo', 'MO', 1),
( 225, 'Paysandu', 'PA', 1),
( 225, 'Rio Negro', 'RN', 1),
( 225, 'Rivera', 'RV', 1),
( 225, 'Rocha', 'RO', 1),
( 225, 'Salto', 'SL', 1),
( 225, 'San Jose', 'SJ', 1),
( 225, 'Soriano', 'SO', 1),
( 225, 'Tacuarembo', 'TA', 1),
( 225, 'Treinta y Tres', 'TT', 1),
( 226, 'Andijon', 'AN', 1),
( 226, 'Buxoro', 'BU', 1),
( 226, 'Farg''ona', 'FA', 1),
( 226, 'Jizzax', 'JI', 1),
( 226, 'Namangan', 'NG', 1),
( 226, 'Navoiy', 'NW', 1),
( 226, 'Qashqadaryo', 'QA', 1),
( 226, 'Qoraqalpog''iston Republikasi', 'QR',
1),
( 226, 'Samarqand', 'SA', 1),
( 226, 'Sirdaryo', 'SI', 1),
( 226, 'Surxondaryo', 'SU', 1),
( 226, 'Toshkent City', 'TK', 1),
( 226, 'Toshkent Region', 'TO', 1),
( 226, 'Xorazm', 'XO', 1),
( 227, 'Malampa', 'MA', 1),
( 227, 'Penama', 'PE', 1),
( 227, 'Sanma', 'SA', 1),
( 227, 'Shefa', 'SH', 1),
( 227, 'Tafea', 'TA', 1),
( 227, 'Torba', 'TO', 1),
( 229, 'Amazonas', 'AM', 1),
( 229, 'Anzoategui', 'AN', 1),
( 229, 'Apure', 'AP', 1),
( 229, 'Aragua', 'AR', 1),
( 229, 'Barinas', 'BA', 1),
( 229, 'Bolivar', 'BO', 1),
( 229, 'Carabobo', 'CA', 1),
( 229, 'Cojedes', 'CO', 1),
( 229, 'Delta Amacuro', 'DA', 1),
( 229, 'Dependencias Federales', 'DF', 1),
( 229, 'Distrito Federal', 'DI', 1),
( 229, 'Falcon', 'FA', 1),
( 229, 'Guarico', 'GU', 1),
( 229, 'Lara', 'LA', 1),
( 229, 'Merida', 'ME', 1),
( 229, 'Miranda', 'MI', 1),
( 229, 'Monagas', 'MO', 1),
( 229, 'Nueva Esparta', 'NE', 1),
( 229, 'Portuguesa', 'PO', 1),
( 229, 'Sucre', 'SU', 1),
( 229, 'Tachira', 'TA', 1),
( 229, 'Trujillo', 'TR', 1),
( 229, 'Vargas', 'VA', 1),
( 229, 'Yaracuy', 'YA', 1),
( 229, 'Zulia', 'ZU', 1),
( 230, 'An Giang', 'AG', 1),
( 230, 'Bac Giang', 'BG', 1),
( 230, 'Bac Kan', 'BK', 1),
( 230, 'Bac Lieu', 'BL', 1),
( 230, 'Bac Ninh', 'BC', 1),
( 230, 'Ba Ria-Vung Tau', 'BR', 1),
( 230, 'Ben Tre', 'BN', 1),
( 230, 'Binh Dinh', 'BH', 1),
( 230, 'Binh Duong', 'BU', 1),
( 230, 'Binh Phuoc', 'BP', 1),
( 230, 'Binh Thuan', 'BT', 1),
( 230, 'Ca Mau', 'CM', 1),
( 230, 'Can Tho', 'CT', 1),
( 230, 'Cao Bang', 'CB', 1),
( 230, 'Dak Lak', 'DL', 1),
( 230, 'Dak Nong', 'DG', 1),
( 230, 'Da Nang', 'DN', 1),
( 230, 'Dien Bien', 'DB', 1),
( 230, 'Dong Nai', 'DI', 1),
( 230, 'Dong Thap', 'DT', 1),
( 230, 'Gia Lai', 'GL', 1),
( 230, 'Ha Giang', 'HG', 1),
( 230, 'Hai Duong', 'HD', 1),
( 230, 'Hai Phong', 'HP', 1),
( 230, 'Ha Nam', 'HM', 1),
( 230, 'Ha Noi', 'HI', 1),
( 230, 'Ha Tay', 'HT', 1),
( 230, 'Ha Tinh', 'HH', 1),
( 230, 'Hoa Binh', 'HB', 1),
( 230, 'Ho Chi Minh City', 'HC', 1),
( 230, 'Hau Giang', 'HU', 1),
( 230, 'Hung Yen', 'HY', 1),
( 232, 'Saint Croix', 'C', 1),
( 232, 'Saint John', 'J', 1),
( 232, 'Saint Thomas', 'T', 1),
( 233, 'Alo', 'A', 1),
( 233, 'Sigave', 'S', 1),
( 233, 'Wallis', 'W', 1),
( 235, 'Abyan', 'AB', 1),
( 235, 'Adan', 'AD', 1),
( 235, 'Amran', 'AM', 1),
( 235, 'Al Bayda', 'BA', 1),
( 235, 'Ad Dali', 'DA', 1),
( 235, 'Dhamar', 'DH', 1),
( 235, 'Hadramawt', 'HD', 1),
( 235, 'Hajjah', 'HJ', 1),
( 235, 'Al Hudaydah', 'HU', 1),
( 235, 'Ibb', 'IB', 1),
( 235, 'Al Jawf', 'JA', 1),
( 235, 'Lahij', 'LA', 1),
( 235, 'Ma''rib', 'MA', 1),
( 235, 'Al Mahrah', 'MR', 1),
( 235, 'Al Mahwit', 'MW', 1),
( 235, 'Sa''dah', 'SD', 1),
( 235, 'San''a', 'SN', 1),
( 235, 'Shabwah', 'SH', 1),
( 235, 'Ta''izz', 'TA', 1),
( 237, 'Bas-Congo', 'BC', 1),
( 237, 'Bandundu', 'BN', 1),
( 237, 'Equateur', 'EQ', 1),
( 237, 'Katanga', 'KA', 1),
( 237, 'Kasai-Oriental', 'KE', 1),
( 237, 'Kinshasa', 'KN', 1),
( 237, 'Kasai-Occidental', 'KW', 1),
( 237, 'Maniema', 'MA', 1),
( 237, 'Nord-Kivu', 'NK', 1),
( 237, 'Orientale', 'OR', 1),
( 237, 'Sud-Kivu', 'SK', 1),
( 238, 'Central', 'CE', 1),
( 238, 'Copperbelt', 'CB', 1),
( 238, 'Eastern', 'EA', 1),
( 238, 'Luapula', 'LP', 1),
( 238, 'Lusaka', 'LK', 1),
( 238, 'Northern', 'NO', 1),
( 238, 'North-Western', 'NW', 1),
( 238, 'Southern', 'SO', 1),
( 238, 'Western', 'WE', 1),
( 239, 'Bulawayo', 'BU', 1),
( 239, 'Harare', 'HA', 1),
( 239, 'Manicaland', 'ML', 1),
( 239, 'Mashonaland Central', 'MC', 1),
( 239, 'Mashonaland East', 'ME', 1),
( 239, 'Mashonaland West', 'MW', 1),
( 239, 'Masvingo', 'MV', 1),
( 239, 'Matabeleland North', 'MN', 1),
( 239, 'Matabeleland South', 'MS', 1),
( 239, 'Midlands', 'MD', 1),
( 105, 'Campobasso', 'CB', 1),
( 105, 'Carbonia-Iglesias', 'CI', 1),
( 105, 'Caserta', 'CE', 1),
( 105, 'Catania', 'CT', 1),
( 105, 'Catanzaro', 'CZ', 1),
( 105, 'Chieti', 'CH', 1),
( 105, 'Como', 'CO', 1),
( 105, 'Cosenza', 'CS', 1),
( 105, 'Cremona', 'CR', 1),
( 105, 'Crotone', 'KR', 1),
( 105, 'Cuneo', 'CN', 1),
( 105, 'Enna', 'EN', 1),
( 105, 'Ferrara', 'FE', 1),
( 105, 'Firenze', 'FI', 1),
( 105, 'Foggia', 'FG', 1),
( 105, 'Forli-Cesena', 'FC', 1),
( 105, 'Frosinone', 'FR', 1),
( 105, 'Genova', 'GE', 1),
( 105, 'Gorizia', 'GO', 1),
( 105, 'Grosseto', 'GR', 1),
( 105, 'Imperia', 'IM', 1),
( 105, 'Isernia', 'IS', 1),
( 105, 'L'Aquila', 'AQ', 1),
( 105, 'La Spezia', 'SP', 1),
( 105, 'Latina', 'LT', 1),
( 105, 'Lecce', 'LE', 1),
( 105, 'Lecco', 'LC', 1),
( 105, 'Livorno', 'LI', 1),
( 105, 'Lodi', 'LO', 1),
( 105, 'Lucca', 'LU', 1),
( 105, 'Macerata', 'MC', 1),
( 105, 'Mantova', 'MN', 1),
( 105, 'Massa-Carrara', 'MS', 1),
( 105, 'Matera', 'MT', 1),
( 105, 'Medio Campidano', 'VS', 1),
( 105, 'Messina', 'ME', 1),
( 105, 'Milano', 'MI', 1),
( 105, 'Modena', 'MO', 1),
( 105, 'Napoli', 'NA', 1),
( 105, 'Novara', 'NO', 1),
( 105, 'Nuoro', 'NU', 1),
( 105, 'Ogliastra', 'OG', 1),
( 105, 'Olbia-Tempio', 'OT', 1),
( 105, 'Oristano', 'OR', 1),
( 105, 'Padova', 'PD', 1),
( 105, 'Palermo', 'PA', 1),
( 105, 'Parma', 'PR', 1),
( 105, 'Pavia', 'PV', 1),
( 105, 'Perugia', 'PG', 1),
( 105, 'Pesaro e Urbino', 'PU', 1),
( 105, 'Pescara', 'PE', 1),
( 105, 'Piacenza', 'PC', 1),
( 105, 'Pisa', 'PI', 1),
( 105, 'Pistoia', 'PT', 1),
( 105, 'Pordenone', 'PN', 1),
( 105, 'Potenza', 'PZ', 1),
( 105, 'Prato', 'PO', 1),
( 105, 'Ragusa', 'RG', 1),
( 105, 'Ravenna', 'RA', 1),
( 105, 'Reggio Calabria', 'RC', 1),
( 105, 'Reggio Emilia', 'RE', 1),
( 105, 'Rieti', 'RI', 1),
( 105, 'Rimini', 'RN', 1),
( 105, 'Roma', 'RM', 1),
( 105, 'Rovigo', 'RO', 1),
( 105, 'Salerno', 'SA', 1),
( 105, 'Sassari', 'SS', 1),
( 105, 'Savona', 'SV', 1),
( 105, 'Siena', 'SI', 1),
( 105, 'Siracusa', 'SR', 1),
( 105, 'Sondrio', 'SO', 1),
( 105, 'Taranto', 'TA', 1),
( 105, 'Teramo', 'TE', 1),
( 105, 'Terni', 'TR', 1),
( 105, 'Torino', 'TO', 1),
( 105, 'Trapani', 'TP', 1),
( 105, 'Trento', 'TN', 1),
( 105, 'Treviso', 'TV', 1),
( 105, 'Trieste', 'TS', 1),
( 105, 'Udine', 'UD', 1),
( 105, 'Varese', 'VA', 1),
( 105, 'Venezia', 'VE', 1),
( 105, 'Verbano-Cusio-Ossola', 'VB', 1),
( 105, 'Vercelli', 'VC', 1),
( 105, 'Verona', 'VR', 1),
( 105, 'Vibo Valentia', 'VV', 1),
( 105, 'Vicenza', 'VI', 1),
( 105, 'Viterbo', 'VT', 1),
( 222, 'County Antrim', 'ANT', 1),
( 222, 'County Armagh', 'ARM', 1),
( 222, 'County Down', 'DOW', 1),
( 222, 'County Fermanagh', 'FER', 1),
( 222, 'County Londonderry', 'LDY', 1),
( 222, 'County Tyrone', 'TYR', 1),
( 222, 'Cumbria', 'CMA', 1),
( 190, 'Pomurska', '1', 1),
( 190, 'Podravska', '2', 1),
( 190, 'Koroška', '3', 1),
( 190, 'Savinjska', '4', 1),
( 190, 'Zasavska', '5', 1),
( 190, 'Spodnjeposavska', '6', 1),
( 190, 'Jugovzhodna Slovenija', '7', 1),
( 190, 'Osrednjeslovenska', '8', 1),
( 190, 'Gorenjska', '9', 1),
( 190, 'Notranjsko-kraška', '10', 1),
( 190, 'Goriška', '11', 1),
( 190, 'Obalno-kraška', '12', 1),
( 33, 'Ruse', '', 1),
( 101, 'Alborz', 'ALB', 1),
( 21, 'Brussels-Capital Region', 'BRU', 1),
( 138, 'Aguascalientes', 'AG', 1),
( 222, 'Isle of Man', 'IOM', 1),
( 242, 'Andrijevica', '01', 1),
( 242, 'Bar', '02', 1),
( 242, 'Berane', '03', 1),
( 242, 'Bijelo Polje', '04', 1),
( 242, 'Budva', '05', 1),
( 242, 'Cetinje', '06', 1),
( 242, 'Danilovgrad', '07', 1),
( 242, 'Herceg-Novi', '08', 1),
( 242, 'Kolašin', '09', 1),
( 242, 'Kotor', '10', 1),
( 242, 'Mojkovac', '11', 1),
( 242, 'Nikšić', '12', 1),
( 242, 'Plav', '13', 1),
( 242, 'Pljevlja', '14', 1),
( 242, 'Plužine', '15', 1),
( 242, 'Podgorica', '16', 1),
( 242, 'Rožaje', '17', 1),
( 242, 'Šavnik', '18', 1),
( 242, 'Tivat', '19', 1),
( 242, 'Ulcinj', '20', 1),
( 242, 'Žabljak', '21', 1),
( 243, 'Belgrade', '00', 1),
( 243, 'North Bačka', '01', 1),
( 243, 'Central Banat', '02', 1),
( 243, 'North Banat', '03', 1),
( 243, 'South Banat', '04', 1),
( 243, 'West Bačka', '05', 1),
( 243, 'South Bačka', '06', 1),
( 243, 'Srem', '07', 1),
( 243, 'Mačva', '08', 1),
( 243, 'Kolubara', '09', 1),
( 243, 'Podunavlje', '10', 1),
( 243, 'Braničevo', '11', 1),
( 243, 'Šumadija', '12', 1),
( 243, 'Pomoravlje', '13', 1),
( 243, 'Bor', '14', 1),
( 243, 'Zaječar', '15', 1),
( 243, 'Zlatibor', '16', 1),
( 243, 'Moravica', '17', 1),
( 243, 'Raška', '18', 1),
( 243, 'Rasina', '19', 1),
( 243, 'Nišava', '20', 1),
( 243, 'Toplica', '21', 1),
( 243, 'Pirot', '22', 1),
( 243, 'Jablanica', '23', 1),
( 243, 'Pčinja', '24', 1),
( 243, 'Kosovo', 'KM', 1),
( 245, 'Bonaire', 'BO', 1),
( 245, 'Saba', 'SA', 1),
( 245, 'Sint Eustatius', 'SE', 1),
( 248, 'Central Equatoria', 'EC', 1),
( 248, 'Eastern Equatoria', 'EE', 1),
( 248, 'Jonglei', 'JG', 1),
( 248, 'Lakes', 'LK', 1),
( 248, 'Northern Bahr el-Ghazal', 'BN', 1),
( 248, 'Unity', 'UY', 1),
( 248, 'Upper Nile', 'NU', 1),
( 248, 'Warrap', 'WR', 1),
( 248, 'Western Bahr el-Ghazal', 'BW', 1),
( 248, 'Western Equatoria', 'EW', 1);
-- UTF-8 test:
ä,ö,üPK�"�[�<�FF$install/sql/mysql/uninstall.utf8.sqlnu�[���DROP
TABLE IF EXISTS `#__phocacart_categories`;
DROP TABLE IF EXISTS `#__phocacart_category_access`;
DROP TABLE IF EXISTS `#__phocacart_products`;
DROP TABLE IF EXISTS `#__phocacart_product_categories`;
DROP TABLE IF EXISTS `#__phocacart_product_featured`;
DROP TABLE IF EXISTS `#__phocacart_product_images`;
DROP TABLE IF EXISTS `#__phocacart_product_files`;
DROP TABLE IF EXISTS `#__phocacart_product_access`;
DROP TABLE IF EXISTS `#__phocacart_product_discounts`;
DROP TABLE IF EXISTS `#__phocacart_product_discount_access`;
DROP TABLE IF EXISTS `#__phocacart_product_price_groups`;
DROP TABLE IF EXISTS `#__phocacart_product_point_groups`;
DROP TABLE IF EXISTS `#__phocacart_product_price_history`;
DROP TABLE IF EXISTS `#__phocacart_product_stock`;
DROP TABLE IF EXISTS `#__phocacart_attributes`;
DROP TABLE IF EXISTS `#__phocacart_attribute_values`;
DROP TABLE IF EXISTS `#__phocacart_specifications`;
DROP TABLE IF EXISTS `#__phocacart_specification_groups`;
DROP TABLE IF EXISTS `#__phocacart_product_related`;
DROP TABLE IF EXISTS `#__phocacart_shipping_methods`;
DROP TABLE IF EXISTS `#__phocacart_shipping_method_countries`;
DROP TABLE IF EXISTS `#__phocacart_shipping_method_regions`;
DROP TABLE IF EXISTS `#__phocacart_shipping_method_zones`;
DROP TABLE IF EXISTS `#__phocacart_shipping_method_access`;
DROP TABLE IF EXISTS `#__phocacart_countries`;
DROP TABLE IF EXISTS `#__phocacart_regions`;
DROP TABLE IF EXISTS `#__phocacart_zones`;
DROP TABLE IF EXISTS `#__phocacart_zone_countries`;
DROP TABLE IF EXISTS `#__phocacart_zone_regions`;
DROP TABLE IF EXISTS `#__phocacart_manufacturers`;
DROP TABLE IF EXISTS `#__phocacart_stock_statuses`;
DROP TABLE IF EXISTS `#__phocacart_tags`;
DROP TABLE IF EXISTS `#__phocacart_tags_related`;
DROP TABLE IF EXISTS `#__phocacart_taglabels_related`;
DROP TABLE IF EXISTS `#__phocacart_parameters`;
DROP TABLE IF EXISTS `#__phocacart_parameter_values`;
DROP TABLE IF EXISTS `#__phocacart_parameter_values_related`;
DROP TABLE IF EXISTS `#__phocacart_taxes`;
DROP TABLE IF EXISTS `#__phocacart_tax_countries`;
DROP TABLE IF EXISTS `#__phocacart_tax_regions`;
DROP TABLE IF EXISTS `#__phocacart_currencies`;
DROP TABLE IF EXISTS `#__phocacart_coupons`;
DROP TABLE IF EXISTS `#__phocacart_coupon_count`;
DROP TABLE IF EXISTS `#__phocacart_coupon_count_user`;
DROP TABLE IF EXISTS `#__phocacart_coupon_products`;
DROP TABLE IF EXISTS `#__phocacart_coupon_categories`;
DROP TABLE IF EXISTS `#__phocacart_coupon_access`;
DROP TABLE IF EXISTS `#__phocacart_discounts`;
DROP TABLE IF EXISTS `#__phocacart_discount_products`;
DROP TABLE IF EXISTS `#__phocacart_discount_categories`;
DROP TABLE IF EXISTS `#__phocacart_discount_access`;
DROP TABLE IF EXISTS `#__phocacart_payment_methods`;
DROP TABLE IF EXISTS `#__phocacart_payment_method_countries`;
DROP TABLE IF EXISTS `#__phocacart_payment_method_regions`;
DROP TABLE IF EXISTS `#__phocacart_payment_method_zones`;
DROP TABLE IF EXISTS `#__phocacart_payment_method_shipping`;
DROP TABLE IF EXISTS `#__phocacart_payment_method_access`;
DROP TABLE IF EXISTS `#__phocacart_reviews`;
DROP TABLE IF EXISTS `#__phocacart_form_fields`;
DROP TABLE IF EXISTS `#__phocacart_users`;
DROP TABLE IF EXISTS `#__phocacart_cart`;
DROP TABLE IF EXISTS `#__phocacart_cart_multiple`;
DROP TABLE IF EXISTS `#__phocacart_order_statuses`;
DROP TABLE IF EXISTS `#__phocacart_orders`;
DROP TABLE IF EXISTS `#__phocacart_order_users`;
DROP TABLE IF EXISTS `#__phocacart_order_products`;
DROP TABLE IF EXISTS `#__phocacart_order_attributes`;
DROP TABLE IF EXISTS `#__phocacart_order_coupons`;
DROP TABLE IF EXISTS `#__phocacart_order_total`;
DROP TABLE IF EXISTS `#__phocacart_order_tax_recapitulation`;
DROP TABLE IF EXISTS `#__phocacart_order_history`;
DROP TABLE IF EXISTS `#__phocacart_order_downloads`;
DROP TABLE IF EXISTS `#__phocacart_order_discounts`;
DROP TABLE IF EXISTS `#__phocacart_order_product_discounts`;
DROP TABLE IF EXISTS `#__phocacart_logs`;
DROP TABLE IF EXISTS `#__phocacart_feeds`;
DROP TABLE IF EXISTS `#__phocacart_wishlists`;
DROP TABLE IF EXISTS `#__phocacart_questions`;
DROP TABLE IF EXISTS `#__phocacart_hits`;
DROP TABLE IF EXISTS `#__phocacart_groups`;
DROP TABLE IF EXISTS `#__phocacart_item_groups`;
DROP TABLE IF EXISTS `#__phocacart_reward_points`;
DROP TABLE IF EXISTS `#__phocacart_item_access`;
DROP TABLE IF EXISTS `#__phocacart_export`;
DROP TABLE IF EXISTS `#__phocacart_import`;
DROP TABLE IF EXISTS `#__phocacart_vendors`;
DROP TABLE IF EXISTS `#__phocacart_sections`;
DROP TABLE IF EXISTS `#__phocacart_units`;
DROP TABLE IF EXISTS `#__phocacart_opening_times`;
DROP TABLE IF EXISTS `#__phocacart_submit_items`;
DROP TABLE IF EXISTS `#__phocacart_bulk_prices`;PK�"�[��e
layouts/catalog.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$d = $displayData;
$price = new PhocacartPrice();
$taxes = PhocacartTax::getAllTaxesIncludingCountryRegion();
$pathItem = PhocacartPath::getPath('productimage');
$p = array();
$p['printed_catalog_enable'] =
$d['params']->get( 'printed_catalog_enable', 0);
$p['printed_catalog_header'] =
$d['params']->get( 'printed_catalog_header',
'');
$p['printed_catalog_document_title'] =
$d['params']->get( 'printed_catalog_document_title',
'');
$p['printed_catalog_css'] =
$d['params']->get( 'printed_catalog_css',
'');
$p['printed_catalog_display_category_title'] =
$d['params']->get(
'printed_catalog_display_category_title', 1);
$p['printed_catalog_display_price_label'] =
$d['params']->get(
'printed_catalog_display_price_label', 0);
if ($p['printed_catalog_enable'] == 0) {
echo
JText::_('COM_PHOCACART_ERROR_CREATING_PRINTED_CATALOG_DISABLED');
exit;
}
$document = JFactory::getDocument();
$document->setTitle(JText::_($p['printed_catalog_document_title']));
$s = '<style>';
/*echo '.ph-catalog-doc {line-height:0.8;}
.ph-catalog-header {line-height:0.5;}
.ph-catalog-img {height: auto;width: auto;}
.ph-catalog-col1 {width: 10%;padding-right:3px;}
.ph-catalog-col2 {width: 90%;padding-left:3px;}
.ph-catalog-price {text-align: right;font-weight: bold;}
.ph-catalog-sep {border-bottom: 1px solid #f0f0f0;}
.ph-catalog-sep-margin {font-size: 8px;}
.ph-catalog-ean {line-height:0.1;}
.ph-catalog-table, .ph-catalog-table-in {width: 100%;}
.ph-catalog-title
{font-weight:bold;font-size:160%;color:blue;line-height:0.8;}
.ph-catalog-desc-long {font-size: 85%;line-height:1;}
.ph-catalog-price {line-height: 1;font-size: 90%;text-align:right;}
.ph-catalog-price-table {width: 200pt;}
.ph-catalog-price-item {text-align:right; font-weight: bold;}
.ph-catalog-price-item-txt {text-align:left;}';*/
$s .= trim(strip_tags($p['printed_catalog_css']));
$s .= '</style>';
if ($d['format'] == 'pdf'){
echo $s;
} else if ($d['format'] == 'html'){
$document->addCustomTag($s);
} else if ($d['format'] == 'raw') {
echo
'<html><head><title>'.JText::_('COM_PHOCACART_CATALOG').'</title>'.$s.'</head><body>';
}
echo '<div class="ph-catalog-doc">';// start doc
// HEADER
$header =
PhocacartRenderFront::renderArticle($p['printed_catalog_header'],
$d['format']);
if ($header != '') {
echo '<div class="ph-catalog-header">';
echo $header;
echo '</div>';
}
echo '<table class="ph-catalog-table"
cellspacing="0" cellpadding="0" >';
// ITEMS
$previousCatid = 0;
foreach($d['items'] as $k => $v) {
// Category Title
if ($p['printed_catalog_display_category_title'] == 1
&& $v['category_title'] != '' &&
$v['category_id'] != $previousCatid) {
echo '<tr nobr="true"><td
style="width:100%">';
echo '<div
class="ph-catalog-category-header">'.$v['category_title'].
'</div>';
$previousCatid = $v['category_id'];
echo '</td></tr>';
}
echo '<tr nobr="true"><td
style="width:100%">';
echo '<table class="ph-catalog-table-in"
cellspacing="0" cellpadding="1">';
echo '<tr>';
// 1) COLUMN - Image
echo '<td class="ph-catalog-col1">';
if ($v['image'] != '') {
$image = PhocacartImage::getThumbnailName($pathItem,
$v['image'], 'small');
echo '<img class="ph-catalog-img" src="'.
JURI::root(true) . '/' . $image->rel.'"
alt="'.PhocacartText::filterValue($v['title'],
'text').'" />';
}
echo '</td>';
// 2) COLUMN - Text
echo '<td class="ph-catalog-col2">';
echo '<div class="ph-catalog-title">'.
$v['title'].'</div>';
if ($v['description_long'] != '') {
echo '<div class="ph-catalog-desc-long">'.
$v['description_long'].'</div>';
} else if ($v['description']) {
echo '<div class="ph-catalog-desc">'.
$v['description'].'</div>';
} else if ($v['features']) {
echo '<div class="ph-catalog-features">'.
$v['features'].'</div>';
}
echo '<table><tr><td>';
// 2)1) SUBCLUMN SKU EAN
// SKU
if ($v['sku'] != '') {
echo '<div
class="ph-catalog-sku">'.$v['sku'].'</div>';
}
// EAN
if ($v['ean'] != '') {
if ($d['format'] == 'pdf') {
echo '<div
class="ph-catalog-ean">{phocapdfeancode|'.urlencode((int)$v['ean']).'}</div>';
} else {
echo '<div
class="ph-catalog-ean">'.(int)$v['ean'].'</div>';
}
}
echo '</td>';
echo '<td>';
// 2)2) SUBCOLUMN PRICE
$priceItems = $price->getPriceItems($v['price'],
$v['taxid'], $v['taxrate'],
$v['taxcalculationtype'], $v['taxtitle'],
$v['unit_amount'], $v['unit_unit'], 1, 1, NULL);
//echo '<div class="ph-catalog-price">'.
$price->getPriceFormat($v['price']).'</div>';
echo '<div class="ph-catalog-price"><br
/>';
if (!empty($priceItems)) {
if ($p['printed_catalog_display_price_label'] == 1) {
$priceItems['nettotxt'] .= ': ';
$priceItems['taxtxt'] .= ': ';
$priceItems['bruttotxt'] .= ': ';
} else {
$priceItems['nettotxt'] = '';
$priceItems['taxtxt'] = '';
$priceItems['bruttotxt'] = '';
}
echo '<table
class="ph-catalog-price-table">';
if ($priceItems['netto'] != 0 &&
$priceItems['netto'] != $priceItems['brutto']) {
echo '<tr><td
class="ph-catalog-price-item-txt">' .
$priceItems['nettotxt'] . ' </td><td
class="ph-catalog-price-item">' .
$priceItems['nettoformat'] . '</td></tr>';
} else {
echo
'<tr><td> </td><td> </td></tr>';
}
if ($priceItems['tax'] != 0 &&
$priceItems['netto'] != $priceItems['brutto']) {
echo '<tr><td
class="ph-catalog-price-item-txt">' .
$priceItems['taxtxt'] . ' </td><td
class="ph-catalog-price-item">' .
$priceItems['taxformat'] . '</td></tr>';
} else {
echo
'<tr><td> </td><td> </td></tr>';
}
if ($priceItems['brutto'] != 0) {
echo '<tr><td
class="ph-catalog-price-item-txt">' .
$priceItems['bruttotxt'] . ' </td><td
class="ph-catalog-price-item">' .
$priceItems['bruttoformat'] .
'</td></tr>';
} else {
echo
'<tr><td> </td><td> </td></tr>';
}
echo '</table>';
}
echo '</div>';
echo '</td></tr></table>';
echo '</td>';
echo '</tr>';
echo '</table>';
echo '<div
class="ph-catalog-sep"></div>';
echo '<div
class="ph-catalog-sep-margin"> </div>';
echo '</td></tr>';
}
echo '</table>';
echo '</div>';// end doc
echo '<p> </p>';
if ($d['format'] == 'raw') {
echo '</body></html>';
}
PK�"�[�#o,,layouts/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�V�layouts/joomla/index.htmlnu�[���<!DOCTYPE
html><title></title>
PK�"�[�V�!layouts/joomla/toolbar/index.htmlnu�[���<!DOCTYPE
html><title></title>
PK�"�[-Կv&&
layouts/joomla/toolbar/title.phpnu�[���<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_BASE') or die;
//$s = PhocacartRenderStyle::getStyles();
$icon = empty($displayData['icon']) ? 'generic' :
preg_replace('#\.[^ .]*$#', '',
$displayData['icon']);
?>
<h1 class="page-title">
<span class="glyphicon glyphicon-<?php echo $icon
?>"></span>
<?php echo $displayData['title']; ?>
</h1>
PK�"�[�������layouts/product_export.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
// Specific function for CSV
if (!function_exists('str_putcsv')) {
function str_putcsv($input, $delimiter = ';', $enclosure =
'"') {
$fp = fopen('php://temp', 'r+b');
fputcsv($fp, $input, $delimiter, $enclosure);
rewind($fp);
$data = rtrim(stream_get_contents($fp), "\n");
fclose($fp);
return $data;
}
}
// Params of component
$db = JFactory::getDBO();
$user = JFactory::getUser();
$paramsC = PhocacartUtils::getComponentParameters();
$import_export_type = $paramsC->get( 'import_export_type',
0 );
$export_attributes = $paramsC->get( 'export_attributes', 1
);
$export_advanced_stock_options = $paramsC->get(
'export_advanced_stock_options', 0 );
$export_specifications = $paramsC->get(
'export_specifications', 1 );
$export_discounts = $paramsC->get( 'export_discounts', 1
);
$export_downloads = $paramsC->get( 'export_downloads', 0
);
$export_add_title = $paramsC->get( 'export_add_title', 0);
$export_parameters = $paramsC->get( 'export_parameters',
0);
/*
*
* Unfortunately, add attributes to xml tags can be very problematic
* - it takes a lot of memory when managing (importing) it
* - and it takes a lot of place in exporting file
* Problems when importing XML:
* Because of bind columns when importing ( xml-> joomla database), we
need to remove '@attribute' array from xml
* The problem is, this action can stop server working when using simple xml
methods
*
<field name="export_add_title" class="btn-group"
type="radio" default="0"
label="COM_PHOCACART_FIELD_ADD_TITLE_ATTRIBUTE_EXPORT_LABEL"
description="COM_PHOCACART_FIELD_ADD_TITLE_ATTRIBUTE_EXPORT_DESC">
<option value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
</field>
* To enable it
* 1) uncomment in config.xml
* 2) comment "$export_add_title = 0;" here
* 3) ucomment foreach in
components\com_phocacart\layouts\product_import.php
*/
$export_add_title = 0;
$xml = false;
$csv = false;
if ($import_export_type == 1) {
$xml = true;
$csv = false;
} else if ($import_export_type == 0) {
$csv = true;
$xml = false;
}
$d = $displayData;
$iP = array();// Products rows
$iA = array();// Products formated to database
$iCN= array();// Product column name
$iCV= array();// Product column title (translated name)
$iO = array();// Final output
// Tabs for XML
$t0 = "\t";
$t1 = "\t\t";
$t2 = "\t\t\t";
$t3 = "\t\t\t\t";
$t4 = "\t\t\t\t\t";
$t5 = "\t\t\t\t\t\t";
// COLUMNS OF PRODUCTS
// Here you can comment columns you don't need to export
//
$a = array();
$a[] = array('id', 'JGLOBAL_FIELD_ID_LABEL');
$a[] = array('title',
'COM_PHOCACART_FIELD_TITLE_LABEL');
$a[] = array('alias',
'COM_PHOCACART_FIELD_ALIAS_LABEL');
$a[] = array('sku', 'COM_PHOCACART_FIELD_SKU_LABEL');
$a[] = array('ean', 'COM_PHOCACART_FIELD_EAN_LABEL');
$a[] = array('price',
'COM_PHOCACART_FIELD_PRICE_LABEL');
$a[] = array('price_original',
'COM_PHOCACART_FIELD_ORIGINAL_PRICE_LABEL');
$a[] = array('price_groups',
'COM_PHOCACART_FIELD_PRICE_GROUPS_LABEL');
$a[] = array('price_histories',
'COM_PHOCACART_FIELD_PRICE_HISTORY_LABEL');
// TAX***
//$a[] = array('tax_id',
'COM_PHOCACART_FIELD_TAX_LABEL');
$a[] = array('tax', 'COM_PHOCACART_FIELD_TAX_LABEL');
// CATEGORIES (not exist in query)
$a[] = array('categories',
'COM_PHOCACART_CATEGORIES');
// MANUFACTURER***
//$a[] = array('manufacturer_id',
'COM_PHOCACART_FIELD_MANUFACTURER_LABEL');
$a[] = array('manufacturer',
'COM_PHOCACART_FIELD_MANUFACTURER_LABEL');
$a[] = array('upc', 'COM_PHOCACART_FIELD_UPC_LABEL');
$a[] = array('jan', 'COM_PHOCACART_FIELD_JAN_LABEL');
$a[] = array('isbn',
'COM_PHOCACART_FIELD_ISBN_LABEL');
$a[] = array('mpn', 'COM_PHOCACART_FIELD_MPN_LABEL');
$a[] = array('serial_number',
'COM_PHOCACART_FIELD_SERIAL_NUMBER_LABEL');
$a[] = array('registration_key',
'COM_PHOCACART_FIELD_REGISTRATION_KEY_LABEL');
$a[] = array('external_id',
'COM_PHOCACART_FIELD_EXTERNAL_PRODUCT_ID_LABEL');
$a[] = array('external_key',
'COM_PHOCACART_FIELD_EXTERNAL_PRODUCT_KEY_LABEL');
$a[] = array('external_link',
'COM_PHOCACART_FIELD_EXTERNAL_LINK_LABEL');
$a[] = array('external_text',
'COM_PHOCACART_FIELD_EXTERNAL_TEXT_LABEL');
$a[] = array('external_link2',
'COM_PHOCACART_FIELD_EXTERNAL_LINK_2_LABEL');//-
$a[] = array('external_text2',
'COM_PHOCACART_FIELD_EXTERNAL_TEXT_2_LABEL');//-
$a[] = array('access', 'JFIELD_ACCESS_LABEL');
$a[] = array('groups',
'COM_PHOCACART_FIELD_GROUPS_LABEL');
$a[] = array('featured',
'COM_PHOCACART_FIELD_FEATURED_LABEL');
$a[] = array('video',
'COM_PHOCACART_FIELD_VIDEO_URL_LABEL');
$a[] = array('public_download_file',
'COM_PHOCACART_FIELD_PUBLIC_DOWNLOAD_FILE_LABEL');
$a[] = array('public_download_text',
'COM_PHOCACART_FIELD_PUBLIC_DOWNLOAD_FILE_TEXT_LABEL');
$a[] = array('public_play_file',
'COM_PHOCACART_FIELD_PUBLIC_FILE_PLAY_LABEL');//-
$a[] = array('public_play_text',
'COM_PHOCACART_FIELD_PUBLIC_FILE_PLAY_TEXT_LABEL');//-
$a[] = array('condition',
'COM_PHOCACART_FIELD_PRODUCT_CONDITION_LABEL');
$a[] = array('type_feed',
'COM_PHOCACART_FIELD_PRODUCT_TYPE_FEED_LABEL');
$a[] = array('type_category_feed',
'COM_PHOCACART_FIELD_PRODUCT_CATEGORY_TYPE_FEED_LABEL');
$a[] = array('description',
'COM_PHOCACART_FIELD_DESCRIPTION_LABEL');
$a[] = array('description_long',
'COM_PHOCACART_FIELD_DESCRIPTION_LONG_LABEL');
$a[] = array('features',
'COM_PHOCACART_FIELD_FEATURES_LABEL');//-
$a[] = array('image',
'COM_PHOCACART_FIELD_IMAGE_LABEL');
// IMAGES (not exist in query)
$a[] = array('images',
'COM_PHOCACART_ADDITIONAL_IMAGES');
if ($export_attributes == 1) {
// ATTRIBUTES (not exist in query)
$a[] = array('attributes',
'COM_PHOCACART_ATTRIBUTES');
}
if ($export_advanced_stock_options == 1) {
// ATTRIBUTES (not exist in query)
$a[] = array('advanced_stock_options',
'COM_PHOCACART_ADVANCED_STOCK_OPTIONS');
}
if ($export_specifications == 1) {
// SPECIFICATIONS (not exist in query)
$a[] = array('specifications',
'COM_PHOCACART_SPECIFICATIONS');
}
if ($export_discounts == 1) {
// DISCOUNTS (not exist in query)
$a[] = array('discounts', 'COM_PHOCACART_DISCOUNTS');
}
// RELATED_PRODUCTS (not exist in query)
$a[] = array('related',
'COM_PHOCACART_RELATED_PRODUCTS');
$a[] = array('stock',
'COM_PHOCACART_FIELD_IN_STOCK_LABEL');
$a[] = array('stock_calculation',
'COM_PHOCACART_FIELD_PRODUCT_STOCK_CALCULATION_LABEL');
$a[] = array('stockstatus_a_id',
'COM_PHOCACART_FIELD_STOCK_STATUS_A_LABEL');
$a[] = array('stockstatus_n_id',
'COM_PHOCACART_FIELD_STOCK_STATUS_B_LABEL');
$a[] = array('min_quantity',
'COM_PHOCACART_FIELD_MIN_ORDER_QUANTITY_LABEL');
$a[] = array('min_multiple_quantity',
'COM_PHOCACART_FIELD_MIN_MULTIPLE_ORDER_QUANTITY_LABEL');
$a[] = array('min_quantity_calculation',
'COM_PHOCACART_FIELD_MINIMUM_QUANTITY_CALCULATION_LABEL');
$a[] = array('delivery_date',
'COM_PHOCACART_FIELD_PRODUCT_DELIVERY_DATE_LABEL');//-
//$a[] = array('availability',
'COM_PHOCACART_FIELD_AVAILABILITY_LABEL');
if ($export_downloads == 1) {
$a[] = array('download_token',
'COM_PHOCACART_FIELD_DOWNLOAD_TOKEN_LABEL');
$a[] = array('download_folder',
'COM_PHOCACART_FIELD_DOWNLOAD_FOLDER_LABEL');
$a[] = array('download_file',
'COM_PHOCACART_FIELD_DOWNLOAD_FILE_LABEL');
$a[] = array('download_hits',
'COM_PHOCACART_FIELD_DOWNLOAD_HITS_LABEL');
$a[] = array('download_days',
'COM_PHOCACART_FIELD_DOWNLOAD_EXPIRATION_DATE_DAYS_LABEL');//-
// IMAGES (not exist in query)
$a[] = array('additional_download_files',
'COM_PHOCACART_ADDITIONAL_DOWNLOAD_FILES');//-
}
$a[] = array('type',
'COM_PHOCACART_FIELD_PRODUCT_TYPE_LABEL');
//$a[] = array('delivery_date',
'COM_PHOCACART_FIELD_PRODUCT_DELIVERY_DATE_LABEL');
$a[] = array('length',
'COM_PHOCACART_FIELD_LENGTH_LABEL');
$a[] = array('width',
'COM_PHOCACART_FIELD_WIDTH_LABEL');
$a[] = array('height',
'COM_PHOCACART_FIELD_HEIGHT_LABEL');
//$a[] = array('unit_size',
'COM_PHOCACART_FIELD_UNIT_SIZE_LABEL');
$a[] = array('weight',
'COM_PHOCACART_FIELD_WEIGHT_LABEL');
//$a[] = array('unit_weight',
'COM_PHOCACART_FIELD_UNIT_WEIGHT_LABEL');
$a[] = array('volume',
'COM_PHOCACART_FIELD_VOLUME_LABEL');
//$a[] = array('unit_volume',
'COM_PHOCACART_FIELD__LABEL');
$a[] = array('unit_amount',
'COM_PHOCACART_FIELD_UNIT_AMOUNT_LABEL');
$a[] = array('unit_unit',
'COM_PHOCACART_FIELD_UNIT_UNIT_LABEL');
$a[] = array('points_needed',
'COM_PHOCACART_FIELD_POINTS_NEEDED_LABEL');
$a[] = array('points_received',
'COM_PHOCACART_FIELD_POINTS_RECEIVED_LABEL');
$a[] = array('point_groups',
'COM_PHOCACART_FIELD_POINT_GROUPS_LABEL');
$a[] = array('published',
'COM_PHOCACART_FIELD_PUBLISHED_LABEL');
$a[] = array('language', 'JFIELD_LANGUAGE_LABEL');
$a[] = array('date',
'COM_PHOCACART_FIELD_DATE_LABEL');
$a[] = array('date_update',
'COM_PHOCACART_FIELD_UPDATE_DATE_LABEL');//-
$a[] = array('created_by',
'COM_PHOCACART_FIELD_CREATED_BY_LABEL');//-
$a[] = array('created',
'COM_PHOCACART_FIELD_CREATED_DATE_LABEL');//-
$a[] = array('modified_by',
'COM_PHOCACART_FIELD_MODIFIED_BY_LABEL');//-
$a[] = array('modified',
'COM_PHOCACART_FIELD_UPDATE_DATE_LABEL');//-
// TAGS (not exist in query)
$a[] = array('tags', 'COM_PHOCACART_TAGS');
$a[] = array('taglabels', 'COM_PHOCACART_LABELS');//-
if($export_parameters == 1){
$a[] = array('items_parameter',
'COM_PHOCACART_PARAMETERS');//-
$parameters = PhocacartParameter::getAllParameters();
}
$a[] = array('metakey', 'JFIELD_META_KEYWORDS_LABEL');
$a[] = array('metadesc',
'JFIELD_META_DESCRIPTION_LABEL');
$a[] = array('metatitle',
'COM_PHOCACART_FIELD_META_TITLE_LABEL');//-
$a[] = array('metadata',
'COM_PHOCACART_METADATA_LABEL');//-
$a[] = array('sales',
'COM_PHOCACART_FIELD_SALES_LABEL');//-
//$a[] = array('allow_upload',
'COM_PHOCACART_FIELD_ALLOW_UPLOAD_LABEL');
//$a[] = array('custom_text',
'COM_PHOCACART_FIELD_CUSTOM_TEXT_LABEL');
//$a[] = array('checked_out',
'COM_PHOCACART_FIELD__LABEL');
//$a[] = array('checked_out_time',
'COM_PHOCACART_FIELD__LABEL');
// Not used
//$a[] = array('hits',
'COM_PHOCACART_FIELD_HITS_LABEL');
//$a[] = array('sales', 'COM_PHOCACART_FIELD__LABEL');
//$a[] = array('params',
'COM_PHOCACART_FIELD__LABEL');
//$a[] = array('metadata',
'COM_PHOCACART_FIELD__LABEL');
$d['productcolumns'] = $a;
unset($a);
// RENDERING
// Header
if (!empty($d['productcolumns'])){
foreach($d['productcolumns'] as $k => $v) {
$iCN[] = JText::_($v[0]);
$iCV[] = JText::_($v[1]);
}
}
if (!empty($d['products'])){
foreach($d['products'] as $k => $v) {
if (!empty($d['productcolumns'])) {
$iP = array();
if ($xml) { $iP[] = $t0 . '<product>';}
foreach($d['productcolumns'] as $k2 => $v2) {
$col = $v2[0];
if (isset($v[$col])) {
// COLUMNS FROM PRODUCT TABLE
//$iP[] = $qT . $v[$col] . $qT;
$l = '';
$r = '';
switch($iCN[$k2]) {
case 'description':
case 'description_long':
case 'features':
case 'type_feed':
case 'type_category_feed':
if ($xml) {
$l = '<![CDATA[';
$r = ']]>';
} else {
// CSV
$v[$col] = str_replace("\n", '', $v[$col]);
$v[$col] = str_replace("\r", '', $v[$col]);
}
break;
default:
break;
}
if ($xml) {
$title = '';
if ($export_add_title == 1) {
$title = '
title="'.strip_tags(JText::_($iCV[$k2])).'"';
}
if (isset($v[$col])) {
$iP[] = $t1 .
'<'.strip_tags($iCN[$k2]).$title.'>' . $l .
$v[$col] . $r. '</'.strip_tags($iCN[$k2]).'>';
}
} else {
$iP[] = $v[$col];
}
} else {
// COLUMNS DYNAMICALLY CREATED BY OTHER TABLES
switch($col) { // we select col, so here we don't need to check:
if (isset($v[$col])) {
case 'categories':
if (isset($v['id']) && (int)$v['id']
> 0) {
$items =
PhocacartProduct::getCategoriesByProductId((int)$v['id']);
if (!empty($items)) {
if ($xml) {
$title = '';
if ($export_add_title == 1) {
$title = '
title="'.strip_tags(JText::_($v2[1])).'"';
}
$iP[] = $t1 .
'<'.strip_tags($v2[0]).$title.'>';
}
$x = array();
foreach($items as $kX => $vX) {
if ($xml) {
$iP[] = $t2 . '<category>';
$iP[] = $t3 .
'<id>'.$vX['category_id'].':'.$vX['alias'].'</id>';
$iP[] = $t3 .
'<ordering>'.$vX['ordering'].'</ordering>';
$iP[] = $t2 . '</category>';
} else {
$x[$kX]['id'] =
$vX['category_id'].':'.$vX['alias'];
$x[$kX]['ordering'] = $vX['ordering'];
}
}
if ($xml) {
$iP[] = $t1 .
'</'.strip_tags($v2[0]).'>';
} else {
//$iP[] = implode('|', $x);
$iP[] = json_encode($x);
}
} else {
if ($csv) {$iP[] = '';}// CSV set right column count
}
}
break;
case 'images':
if (isset($v['id']) && (int)$v['id']
> 0) {
$items =
PhocacartProduct::getImagesByProductId((int)$v['id']);
if (!empty($items)) {
if ($xml) {
$title = '';
if ($export_add_title == 1) {
$title = '
title="'.strip_tags(JText::_($v2[1])).'"';
}
$iP[] = $t1 .
'<'.strip_tags($v2[0]).$title.'>';
}
$x = array();
foreach($items as $kX => $vX) {
if ($xml) {
$iP[] = $t2 .
'<image>'.$vX['image'].'</image>';
} else {
$x[] = $vX['image'];
}
}
if ($xml) {
$iP[] = $t1 .
'</'.strip_tags($v2[0]).'>';
} else {
$iP[] = implode('|', $x);
}
} else {
if ($csv) {$iP[] = '';}// CSV set right column count
}
}
break;
case 'attributes':
if (isset($v['id']) && (int)$v['id']
> 0) {
$items =
PhocacartAttribute::getAttributesAndOptions((int)$v['id']);
if (!empty($items)) {
if ($xml) {
$title = '';
if ($export_add_title == 1) {
$title = '
title="'.strip_tags(JText::_($v2[1])).'"';
}
$iP[] = $t1 .
'<'.strip_tags($v2[0]).$title.'>';
}
$x = array();
foreach($items as $kX => $vX) {
if ($xml) {
$iP[] = $t2 . '<attribute>';
$iP[] = $t3 .
'<id>'.$vX->id.'</id>';
$iP[] = $t3 .
'<title>'.$vX->title.'</title>';
$iP[] = $t3 .
'<alias>'.$vX->alias.'</alias>';
$iP[] = $t3 .
'<required>'.$vX->required.'</required>';
$iP[] = $t3 .
'<type>'.$vX->type.'</type>';
if (!empty($vX->options)) {
$iP[] = $t3 . '<options>';
foreach($vX->options as $kX2 => $vX2) {
$iP[] = $t4 . '<option>';
$iP[] = $t5 .
'<id>'.$vX2->id.'</id>';
$iP[] = $t5 .
'<title>'.$vX2->title.'</title>';
$iP[] = $t5 .
'<alias>'.$vX2->alias.'</alias>';
$iP[] = $t5 .
'<amount>'.$vX2->amount.'</amount>';
$iP[] = $t5 .
'<operator>'.$vX2->operator.'</operator>';
$iP[] = $t5 .
'<stock>'.$vX2->stock.'</stock>';
//$iP[] = $t5 .
'<stock_calculation>'.$vX2->stock_calculation.'</stock_calculation>';
$iP[] = $t5 .
'<operator_weight>'.$vX2->operator_weight.'</operator_weight>';
$iP[] = $t5 .
'<weight>'.$vX2->weight.'</weight>';
$iP[] = $t5 .
'<image>'.$vX2->image.'</image>';
$iP[] = $t5 .
'<image_medium>'.$vX2->image_medium.'</image_medium>';
$iP[] = $t5 .
'<image_small>'.$vX2->image_small.'</image_small>';
$iP[] = $t5 .
'<download_folder>'.$vX2->download_folder.'</download_folder>';
$iP[] = $t5 .
'<download_token>'.$vX2->download_token.'</download_token>';
$iP[] = $t5 .
'<download_file>'.$vX2->download_file.'</download_file>';
$iP[] = $t5 .
'<color>'.$vX2->color.'</color>';
$iP[] = $t5 .
'<default_value>'.$vX2->image.'</default_value>';
$iP[] = $t4 .'</option>';
}
$iP[] = $t3 . '</options>';
}
$iP[] = $t2 . '</attribute>';
} else {
//$x[] = $vX['image'];
}
}
if ($xml) {
$iP[] = $t1 .
'</'.strip_tags($v2[0]).'>';
} else {
//$iP[] = implode('|', $x);
$iP[] = json_encode($items);
}
} else {
if ($csv) {$iP[] = '';}// CSV set right column count
}
}
break;
case 'specifications':
if (isset($v['id']) && (int)$v['id']
> 0) {
$items =
PhocacartSpecification::getSpecificationsById((int)$v['id'], 1);
if (!empty($items)) {
if ($xml) {
$title = '';
if ($export_add_title == 1) {
$title = '
title="'.strip_tags(JText::_($v2[1])).'"';
}
$iP[] = $t1 .
'<'.strip_tags($v2[0]).$title.'>';
}
$x = array();
foreach($items as $kX => $vX) {
if ($xml) {
$iP[] = $t2 . '<specification>';
$iP[] = $t3 .
'<id>'.$vX['id'].'</id>';
$iP[] = $t3 .
'<group_id>'.$vX['group_id'].'</group_id>';
$iP[] = $t3 .
'<title>'.$vX['title'].'</title>';
$iP[] = $t3 .
'<alias>'.$vX['alias'].'</alias>';
$iP[] = $t3 .
'<value>'.$vX['value'].'</value>';
$iP[] = $t3 .
'<alias_value>'.$vX['alias_value'].'</alias_value>';
$iP[] = $t3 .
'<image>'.$vX['image'].'</image>';
$iP[] = $t3 .
'<image_medium>'.$vX['image_medium'].'</image_medium>';
$iP[] = $t3 .
'<image_small>'.$vX['image_small'].'</image_small>';
$iP[] = $t3 .
'<color>'.$vX['color'].'</color>';
$iP[] = $t2 . '</specification>';
} else {
//$x[] = $vX['image'];
}
}
if ($xml) {
$iP[] = $t1 .
'</'.strip_tags($v2[0]).'>';
} else {
//$iP[] = implode('|', $x);
$iP[] = json_encode($items);
}
} else {
if ($csv) {$iP[] = '';}// CSV set right column count
}
}
break;
case 'discounts':
if (isset($v['id']) && (int)$v['id']
> 0) {
$items =
PhocacartDiscountProduct::getDiscountsById((int)$v['id'], 1);
if (!empty($items)) {
if ($xml) {
$title = '';
if ($export_add_title == 1) {
$title = '
title="'.strip_tags(JText::_($v2[1])).'"';
}
$iP[] = $t1 .
'<'.strip_tags($v2[0]).$title.'>';
}
$x = array();
foreach($items as $kX => $vX) {
$groups = PhocacartGroup::getGroupsById((int)$vX['id'],
4, 2, (int)$v['id']);
if ($xml) {
$iP[] = $t2 . '<discount>';
$iP[] = $t3 .
'<id>'.$vX['id'].'</id>';
$iP[] = $t3 .
'<title>'.$vX['title'].'</title>';
$iP[] = $t3 .
'<alias>'.$vX['alias'].'</alias>';
$iP[] = $t3 .
'<discount>'.$vX['discount'].'</discount>';
$iP[] = $t3 .
'<access>'.$vX['access'].'</access>';
$iP[] = $t3 .
'<calculation_type>'.$vX['calculation_type'].'</calculation_type>';
$iP[] = $t3 .
'<quantity_from>'.$vX['quantity_from'].'</quantity_from>';
$iP[] = $t3 .
'<valid_from>'.$vX['valid_from'].'</valid_from>';
$iP[] = $t3 .
'<valid_to>'.$vX['valid_to'].'</valid_to>';
if (!empty($groups)) {
$iP[] = $t3 . '<groups>';
foreach($groups as $kY => $vY) {
$iP[] = $t4 . '<group>';
$iP[] = $t5 .
'<id>'.$vY['id'].'</id>';
$iP[] = $t5 .
'<title>'.$vY['title'].'</title>';
$iP[] = $t4 . '</group>';
}
$iP[] = $t3 . '</groups>';
}
$iP[] = $t2 . '</discount>';
} else {
//$x[] = $vX['image'];
if (!empty($groups)) {
foreach($groups as $kY => $vY) {
unset($groups[$kY]['alias']);
unset($groups[$kY]['type']);
}
}
$items[$kX]['groups'] = $groups;// set it for CSV
}
}
if ($xml) {
$iP[] = $t1 .
'</'.strip_tags($v2[0]).'>';
} else {
//$iP[] = implode('|', $x);
$iP[] = json_encode($items);
}
} else {
if ($csv) {$iP[] = '';}// CSV set right column count
}
}
break;
case 'advanced_stock_options':
if (isset($v['id']) && (int)$v['id']
> 0) {
$items =
PhocacartAttribute::getCombinationsStockById((int)$v['id'], 1);
if (!empty($items)) {
if ($xml) {
$title = '';
if ($export_add_title == 1) {
$title = '
title="'.strip_tags(JText::_($v2[1])).'"';
}
$iP[] = $t1 .
'<'.strip_tags($v2[0]).$title.'>';
}
$x = array();
foreach($items as $kX => $vX) {
if ($xml) {
$iP[] = $t2 . '<advanced_stock_option>';
$iP[] = $t3 .
'<id>'.$vX['id'].'</id>';
$iP[] = $t3 .
'<product_id>'.$vX['product_id'].'</product_id>';
$iP[] = $t3 .
'<product_key>'.$vX['product_key'].'</product_key>';
$iP[] = $t3 .
'<stock>'.$vX['stock'].'</stock>';
$iP[] = $t2 . '</advanced_stock_option>';
} else {
//$x[] = $vX['image'];
}
}
if ($xml) {
$iP[] = $t1 .
'</'.strip_tags($v2[0]).'>';
} else {
//$iP[] = implode('|', $x);
$iP[] = json_encode($items);
}
} else {
if ($csv) {$iP[] = '';}// CSV set right column count
}
}
break;
case 'related':
if (isset($v['id']) && (int)$v['id']
> 0) {
$items =
PhocacartRelated::getRelatedItemsById((int)$v['id'], 2, 1);
if (!empty($items)) {
if ($xml) {
$title = '';
if ($export_add_title == 1) {
$title = '
title="'.strip_tags(JText::_($v2[1])).'"';
}
$iP[] = $t1 .
'<'.strip_tags($v2[0]).$title.'>';
}
$x = array();
foreach($items as $kX => $vX) {
if ($xml) {
$iP[] = $t2 .
'<related_product>'.$vX->id.':'.$vX->alias.'</related_product>';
} else {
$x[] = $vX->id.':'.$vX->alias;
}
}
if ($xml) {
$iP[] = $t1 .
'</'.strip_tags($v2[0]).'>';
} else {
$iP[] = implode('|', $x);
}
} else {
if ($csv) {$iP[] = '';}// CSV set right column count
}
}
break;
case 'tags':
if (isset($v['id']) && (int)$v['id']
> 0) {
$items = PhocacartTag::getTags((int)$v['id'], 2);
if (!empty($items)) {
if ($xml) {
$title = '';
if ($export_add_title == 1) {
$title = '
title="'.strip_tags(JText::_($v2[1])).'"';
}
$iP[] = $t1 .
'<'.strip_tags($v2[0]).$title.'>';
}
$x = array();
foreach($items as $kX => $vX) {
if ($xml) {
$iP[] = $t2 .
'<tag>'.$vX->id.':'.$vX->alias.'</tag>';
} else {
$x[] = $vX->id.':'.$vX->alias;
}
}
if ($xml) {
$iP[] = $t1 .
'</'.strip_tags($v2[0]).'>';
} else {
$iP[] = implode('|', $x);
}
} else {
if ($csv) {$iP[] = '';}// CSV set right column count
}
}
break;
case 'taglabels':
if (isset($v['id']) && (int)$v['id']
> 0) {
$items = PhocacartTag::getTagLabels((int)$v['id'], 2);
if (!empty($items)) {
if ($xml) {
$title = '';
if ($export_add_title == 1) {
$title = '
title="'.strip_tags(JText::_($v2[1])).'"';
}
$iP[] = $t1 .
'<'.strip_tags($v2[0]).$title.'>';
}
$x = array();
foreach($items as $kX => $vX) {
if ($xml) {
$iP[] = $t2 .
'<label>'.$vX->id.':'.$vX->alias.'</label>';
} else {
$x[] = $vX->id.':'.$vX->alias;
}
}
if ($xml) {
$iP[] = $t1 .
'</'.strip_tags($v2[0]).'>';
} else {
$iP[] = implode('|', $x);
}
} else {
if ($csv) {$iP[] = '';}// CSV set right column count
}
}
break;
case 'items_parameter':
if (isset($v['id']) && (int)$v['id']
> 0) {
// $parameters = Parameters defined at
start
if (!empty($parameters)) {
if ($xml) {
$title = '';
if ($export_add_title == 1) {
$title = '
title="'.strip_tags(JText::_($v2[1])).'"';
}
$iP[] = $t1 .
'<'.strip_tags($v2[0]).$title.'>';
}
$items = array();
foreach($parameters as $kX => $vX)
{
$idP = (int)$vX->id;
$items[$idP] = array();
if ($xml) {
$pA =
PhocacartParameter::getParameterValues((int)$v['id'], $idP,0);
if (!empty($pA)) {
$iP[] = $t2 . '<parameter>';
$iP[] = $t3 .
'<id>'.$vX->id.'</id>';
$iP[] = $t3 .
'<title>'.$vX->title.'</title>';
$iP[] = $t3 .
'<alias>'.$vX->alias.'</alias>';
$iP[] = $t3 . '<values>';
foreach($pA as $kX2 => $vX2) {
$iP[] = $t4 . '<value>';
$iP[] = $t5 .
'<id>'.$vX2->id.'</id>';
$iP[] = $t5 .
'<title>'.$vX2->title.'</title>';
$iP[] = $t5 .
'<alias>'.$vX2->alias.'</alias>';
$iP[] = $t4 .'</value>';
}
$iP[] = $t3 . '</values>';
$iP[] = $t2 . '</parameter>';
}
} else {
$items[$idP] =
PhocacartParameter::getParameterValues((int)$v['id'], $idP,2);//
CSV
}
}
if ($xml) {
$iP[] = $t1 .
'</'.strip_tags($v2[0]).'>';
} else {
//$iP[] = implode('|', $x);
$iP[] = json_encode($items);
}
} else {
if ($csv) {$iP[] = '';}// CSV set right column count
}
}
break;
case 'groups':
if (isset($v['id']) && (int)$v['id']
> 0) {
$items = PhocacartGroup::getGroupsById((int)$v['id'], 3,
2);
if (!empty($items)) {
if ($xml) {
$title = '';
if ($export_add_title == 1) {
$title = '
title="'.strip_tags(JText::_($v2[1])).'"';
}
$iP[] = $t1 .
'<'.strip_tags($v2[0]).$title.'>';
}
$x = array();
foreach($items as $kX => $vX) {
if ($xml) {
$iP[] = $t2 . '<group>';
$iP[] = $t3 .
'<id>'.$vX['id'].'</id>';
$iP[] = $t3 .
'<title>'.$vX['title'].'</title>';
$iP[] = $t2 . '</group>';
} else {
//$x[] = $vX['image'];
unset($items[$kX]['alias']);
unset($items[$kX]['type']);
}
}
if ($xml) {
$iP[] = $t1 .
'</'.strip_tags($v2[0]).'>';
} else {
//$iP[] = implode('|', $x);
$iP[] = json_encode($items);
}
} else {
if ($csv) {$iP[] = '';}// CSV set right column count
}
}
break;
case 'price_groups':
if (isset($v['id']) && (int)$v['id']
> 0) {
$items =
PhocacartGroup::getProductPriceGroupsById((int)$v['id']);
if (!empty($items)) {
if ($xml) {
$title = '';
if ($export_add_title == 1) {
$title = '
title="'.strip_tags(JText::_($v2[1])).'"';
}
$iP[] = $t1 .
'<'.strip_tags($v2[0]).$title.'>';
}
$x = array();
foreach($items as $kX => $vX) {
if ($xml) {
$iP[] = $t2 . '<price_group>';
$iP[] = $t3 .
'<id>'.$vX['id'].'</id>';
$iP[] = $t3 .
'<product_id>'.$vX['product_id'].'</product_id>';
$iP[] = $t3 .
'<group_id>'.$vX['group_id'].'</group_id>';
$iP[] = $t3 .
'<price>'.$vX['price'].'</price>';
$iP[] = $t2 . '</price_group>';
} else {
//$x[] = $vX['image'];
}
}
if ($xml) {
$iP[] = $t1 .
'</'.strip_tags($v2[0]).'>';
} else {
//$iP[] = implode('|', $x);
$iP[] = json_encode($items);
}
} else {
if ($csv) {$iP[] = '';}// CSV set right column count
}
}
break;
case 'point_groups':
if (isset($v['id']) && (int)$v['id']
> 0) {
$items =
PhocacartGroup::getProductPointGroupsById((int)$v['id']);
if (!empty($items)) {
if ($xml) {
$title = '';
if ($export_add_title == 1) {
$title = '
title="'.strip_tags(JText::_($v2[1])).'"';
}
$iP[] = $t1 .
'<'.strip_tags($v2[0]).$title.'>';
}
$x = array();
foreach($items as $kX => $vX) {
if ($xml) {
$iP[] = $t2 . '<point_group>';
$iP[] = $t3 .
'<id>'.$vX['id'].'</id>';
$iP[] = $t3 .
'<product_id>'.$vX['product_id'].'</product_id>';
$iP[] = $t3 .
'<group_id>'.$vX['group_id'].'</group_id>';
$iP[] = $t3 .
'<points_received>'.$vX['points_received'].'</points_received>';
$iP[] = $t2 . '</point_group>';
} else {
//$x[] = $vX['image'];
}
}
if ($xml) {
$iP[] = $t1 .
'</'.strip_tags($v2[0]).'>';
} else {
//$iP[] = implode('|', $x);
$iP[] = json_encode($items);
}
} else {
if ($csv) {$iP[] = '';}// CSV set right column count
}
}
break;
// Price history
case 'price_histories':
if (isset($v['id']) && (int)$v['id']
> 0) {
$items =
PhocacartPriceHistory::getPriceHistoryById((int)$v['id'], 0, 1);
if (!empty($items)) {
if ($xml) {
$title = '';
if ($export_add_title == 1) {
$title = '
title="'.strip_tags(JText::_($v2[1])).'"';
}
$iP[] = $t1 .
'<'.strip_tags($v2[0]).$title.'>';
}
$x = array();
foreach($items as $kX => $vX) {
if ($xml) {
$iP[] = $t2 . '<price_history>';
$iP[] = $t3 .
'<id>'.$vX['id'].'</id>';
$iP[] = $t3 .
'<product_id>'.$vX['product_id'].'</product_id>';
$iP[] = $t3 .
'<date>'.$vX['date'].'</date>';
$iP[] = $t3 .
'<price>'.$vX['price'].'</price>';
$iP[] = $t2 . '</price_history>';
} else {
//$x[] = $vX['image'];
}
}
if ($xml) {
$iP[] = $t1 .
'</'.strip_tags($v2[0]).'>';
} else {
//$iP[] = implode('|', $x);
$iP[] = json_encode($items);
}
} else {
if ($csv) {$iP[] = '';}// CSV set right column count
}
}
break;
case 'additional_download_files':
if (isset($v['id']) && (int)$v['id']
> 0) {
$items =
PhocacartFileAdditional::getProductFilesByProductId((int)$v['id'],
1);
if (!empty($items)) {
if ($xml) {
$title = '';
if ($export_add_title == 1) {
$title = '
title="'.strip_tags(JText::_($v2[1])).'"';
}
$iP[] = $t1 .
'<'.strip_tags($v2[0]).$title.'>';
}
$x = array();
foreach($items as $kX => $vX) {
if ($xml) {
$iP[] = $t2 . '<additional_download_file>';
$iP[] = $t3 .
'<id>'.$vX['id'].'</id>';
$iP[] = $t3 .
'<download_file>'.$vX['download_file'].'</download_file>';
$iP[] = $t3 .
'<download_token>'.$vX['download_token'].'</download_token>';
$iP[] = $t3 .
'<download_days>'.$vX['download_days'].'</download_days>';
$iP[] = $t2 . '</additional_download_file>';
} else {
//$x[] = $vX['image'];
}
}
if ($xml) {
$iP[] = $t1 .
'</'.strip_tags($v2[0]).'>';
} else {
//$iP[] = implode('|', $x);
$iP[] = json_encode($items);
}
} else {
if ($csv) {$iP[] = '';}// CSV set right column count
}
}
break;
default:
break;
}
}
}
if ($xml) { $iP[] = $t0 . '</product>'; }
if (!empty($iP)) {
//$iA[] = ' ('.(int)$user->id .', '.
$db->quote(implode($sP, $iP)).', 0)';
//$iA[] = ' ('.(int)$user->id .', '.
$db->quote(serialize($iP)).'), 0';
if ($xml) {
$iA[] = ' ('.(int)$user->id .', '.
$db->quote(implode("\n", $iP)).', 0)';
} else {
$iA[] = ' ('.(int)$user->id .', '.
$db->quote(str_putcsv($iP)).', 0)';
}
}
}
}
}
// First Row Head - column name (ID) CSV
if (!empty($iCN) && $d['page'] == 1 && !$xml) {
$iO[] = ' ('.(int)$user->id .', '.
$db->quote(str_putcsv($iCN)).', 1)';
}
// Second Row Head - column name translated CSV
if (!empty($iCV) && $d['page'] == 1 && !$xml) {
$iO[] = ' ('.(int)$user->id .', '.
$db->quote(str_putcsv($iCV)).', 1)';
}
// First and second Row Head - XML
if ($d['page'] == 1 && $xml) {
$iO[] = ' ('.(int)$user->id .', '.
$db->quote('<?xml version="1.0"
encoding="utf-8"?>').', 1)';
$iO[] = ' ('.(int)$user->id .', '.
$db->quote('<products>').', 1)';
}
// All product rows
if (!empty($iA)) {
$iO[] = implode(", ", $iA);
}
// Last Row - XML
if (($d['last_page'] == $d['page']) && $xml) {
$iO[] = ' ('.(int)$user->id .', '.
$db->quote('</products>').', 2)';
}
if (!empty($iO)) {
echo implode(", ", $iO);
}
PK�"�["3V�fefelayouts/product_import.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
function filter_xml($matches) {
return trim(htmlspecialchars($matches[1]));
}
$paramsC = PhocacartUtils::getComponentParameters();
$import_export_type = $paramsC->get( 'import_export_type', 0
);
$import_column = $paramsC->get( 'import_column', 1 );
$d = $displayData;
$data = array();
$xml = false;
$csv = false;
if (isset($d['file_type']) && $d['file_type']
== 1) {
$xml = true;
$csv = false;
} else if (isset($d['file_type']) &&
$d['file_type'] == 0) {
$csv = true;
$xml = false;
}
$productIdChange = array();// Needed for related table, when the product
changes its ID (autoincrement), recreat related table
if($xml) {
// --------
// XML
if (!empty($d['products'])){
foreach($d['products'] as $k => $v) {
$data = array();
if (isset($v['item']) && $v['item'] !=
'') {
$item = simplexml_load_string($v['item'], null,
LIBXML_NOCDATA);
// Remove @attributes in case xml includes parameters (this can be
enabled by customization)
// See comment in components\com_phocacart\layouts\product_export.php -
line cca 36
/*
foreach($item as $k => $v) {
switch($k) {
//case 'tax':
case 'categories':
//case 'manufacturer':
case 'images':
case 'attributes':
case 'specifications':
case 'discounts':
case 'related':
case 'tags':
$item2[$k] = $v;
break;
default:
$item2[$k] = (string)$item->$k;
break;
}
}
$json = json_encode($item2);*/
$json = json_encode($item);
$data = json_decode($json, true);
$data['tax_id'] = array();
$data['manufacturer_id'] = array();
$data['catid_multiple'] = array();
$data['catid_multiple_ordering']= array();
// TITLE
// No title - skip
if (isset($data['title']) && $data['title']
== '') {
continue;
}
// TAX
// Specific rules
if (isset($data['tax'])) {
$data['tax_id'] =
PhocacartUtils::getIntFromString($data['tax']);
unset($data['tax']);
}
// MANUFACTURER
if (isset($data['manufacturer'])) {
$data['manufacturer_id'] =
PhocacartUtils::getIntFromString($data['manufacturer']);
unset($data['manufacturer']);
}
// CATEGORY
if (!empty($data['categories']['category'])) {
if
(isset($data['categories']['category']['id'])
&&
$data['categories']['category']['ordering'])
{
$idC =
(int)PhocacartUtils::getIntFromString($data['categories']['category']['id']);
$data['catid_multiple'][0] =
(int)PhocacartUtils::getIntFromString($idC);
$data['catid_multiple_ordering'][$idC] =
(int)$data['categories']['category']['ordering'];
} else if
(is_array($data['categories']['category'])) {
$categories = $data['categories']['category'];
foreach($categories as $kC => $vC) {
$idC = (int)PhocacartUtils::getIntFromString($vC['id']);
$data['catid_multiple'][] = $idC;
$data['catid_multiple_ordering'][$idC] =
$vC['ordering'];
}
} else {
// skip
continue;
}
}
if(empty($data['catid_multiple'])) {
// skip no category found
continue;
}
// IMAGES
if (!empty($data['images']['image'])) {
if (is_array($data['images']['image'])) {
$images = $data['images']['image'];
$data['images'] = array();
foreach($images as $kI => $vI) {
$data['images'][]['image'] = $vI;
}
} else {
$image = $data['images']['image'];
$data['images'] = array();
$data['images'][0]['image'] = $image;
}
} else {
$data['images'] = array();
}
// ATTRIBUTES
if (!empty($data['attributes']['attribute'])) {
if
(isset($data['attributes']['attribute']['id']))
{
// ATTRIBUTES STRING
$attribute =
$data['attributes']['attribute'];
$data['attributes'] = array();
// OPTIONS
if
(isset($attribute['options']['option']['id']))
{
// OPTION STRING
$option = $attribute['options']['option'];
unset($attribute['options']['option']);
$attribute['options'][0] = $option;
} else if (isset($attribute['options']['option'])
&& is_array($attribute['options']['option']))
{
// OPTIONS ARRAY
$attribute['options'] =
$attribute['options']['option'];
}
$data['attributes'][0] = $attribute;
} else if
(is_array($data['attributes']['attribute'])) {
// ATTRIBUTES ARRAY
$attributes =
$data['attributes']['attribute'];
$data['attributes'] = array();
// OPTIONS
foreach($attributes as $kA => $vA) {
if
(isset($vA['options']['option']['id'])) {
// OPTION STRING
$option = $vA['options']['option'];
unset($attributes[$kA]['options']['option']);
$attributes[$kA]['options'][0] = $option;
} else if (isset($vA['options']['option'])
&& is_array($vA['options']['option'])) {
// OPTIONS ARRAY
$attributes[$kA]['options'] =
$vA['options']['option'];
}
}
$data['attributes'] = $attributes;
}
} else {
$data['attributes'] = array();
}
// SPECIFICATIONS
if
(!empty($data['specifications']['specification'])) {
if
(isset($data['specifications']['specification']['id']))
{
// SPECIFICATIONS STRING
$specification =
$data['specifications']['specification'];
$data['specifications'] = array();
$data['specifications'][0] = $specification;
} else if
(is_array($data['specifications']['specification'])) {
// SPECIFICATIONS ARRAY
$specifications =
$data['specifications']['specification'];
$data['specifications'] = array();
$data['specifications'] = $specifications;
}
} else {
$data['specifications'] = array();
}
// ADVANCED STOCK OPTIONS
if
(!empty($data['advanced_stock_options']['advanced_stock_option']))
{
if
(isset($data['advanced_stock_options']['advanced_stock_option']['id']))
{
// ADVANCED STOCK OPTIONS
$aso =
$data['advanced_stock_options']['advanced_stock_option'];
$data['advanced_stock_options'] = array();
$data['advanced_stock_options'][0] = $aso;
} else if
(is_array($data['advanced_stock_options']['advanced_stock_option']))
{
// ADVANCED STOCK OPTIONS
$asos =
$data['advanced_stock_options']['advanced_stock_option'];
$data['advanced_stock_options'] = array();
$data['advanced_stock_options'] = $asos;
}
} else {
$data['advanced_stock_options'] = array();
}
// DISCOUNTS
if (!empty($data['discounts']['discount'])) {
if
(isset($data['discounts']['discount']['id']))
{
// DISCOUNTS STRING
$discount = $data['discounts']['discount'];
$data['discounts'] = array();
$data['discounts'][0] = $discount;
} else if
(is_array($data['discounts']['discount'])) {
// DISCOUNTS ARRAY
$discounts = $data['discounts']['discount'];
$data['discounts'] = array();
$data['discounts'] = $discounts;
}
} else {
$data['discounts'] = array();
}
// GROUPS IN DISCOUNT
if (!empty($data['discounts'])) {
foreach ($data['discounts'] as $kD => $vD) {
if
(!empty($data['discounts'][$kD]['groups']['group']))
{
if
(is_array($data['discounts'][$kD]['groups']['group'])
&&
isset($data['discounts'][$kD]['groups']['group'][0]))
{
$groups =
$data['discounts'][$kD]['groups']['group'];
$data['discounts'][$kD]['groups'] = array();
foreach($groups as $kG => $vG) {
if (isset($vG['id'])) {
$data['discounts'][$kD]['groups'][] =
(int)PhocacartUtils::getIntFromString($vG['id']);
}
}
} else {
$group =
$data['discounts'][$kD]['groups']['group'];
$data['discounts'][$kD]['groups'] =
array();
$data['discounts'][$kD]['groups'][0] =
(int)PhocacartUtils::getIntFromString($group['id']);
}
} else {
$data['discounts'][$kD]['groups'] = array();
}
}
}
// GROUPS (USER)
if (!empty($data['groups']['group'])) {
if (is_array($data['groups']['group']) &&
isset($data['groups']['group'][0])) {
$groups = $data['groups']['group'];
$data['groups'] = array();
foreach($groups as $kG => $vG) {
if (isset($vG['id'])) {
$data['groups'][] =
(int)PhocacartUtils::getIntFromString($vG['id']);
}
}
} else {
$group = $data['groups']['group'];
$data['groups'] = array();
$data['groups'][0] =
(int)PhocacartUtils::getIntFromString($group['id']);
}
} else {
$data['groups'] = array();
}
// PRICE GROUPS
if (!empty($data['price_groups']['price_group']))
{
if (is_array($data['price_groups']['price_group'])
&&
isset($data['price_groups']['price_group'][0])) {
$groups =
$data['price_groups']['price_group'];
$data['price_groups'] = array();
foreach($groups as $kG => $vG) {
$data['price_groups'][$kG]['id'] =
(int)PhocacartUtils::getIntFromString($vG['id']);
$data['price_groups'][$kG]['product_id'] =
(int)PhocacartUtils::getIntFromString($vG['product_id']);
$data['price_groups'][$kG]['group_id'] =
(int)PhocacartUtils::getIntFromString($vG['group_id']);
$data['price_groups'][$kG]['price'] =
$vG['price'];
}
} else {
$group =
$data['price_groups']['price_group'];
$data['price_groups'] = array();
$data['price_groups'][0]['id'] =
(int)PhocacartUtils::getIntFromString($group['id']);
$data['price_groups'][0]['product_id'] =
(int)PhocacartUtils::getIntFromString($group['product_id']);
$data['price_groups'][0]['group_id'] =
(int)PhocacartUtils::getIntFromString($group['group_id']);
$data['price_groups'][0]['price'] =
$group['price'];
}
} else {
$data['price_groups'] = array();
}
// POINT GROUPS
if (!empty($data['point_groups']['point_group']))
{
if (is_array($data['point_groups']['point_group'])
&&
isset($data['point_groups']['point_group'][0])) {
$groups =
$data['point_groups']['point_group'];
$data['point_groups'] = array();
foreach($groups as $kG => $vG) {
$data['point_groups'][$kG]['id'] =
(int)PhocacartUtils::getIntFromString($vG['id']);
$data['point_groups'][$kG]['product_id'] =
(int)PhocacartUtils::getIntFromString($vG['product_id']);
$data['point_groups'][$kG]['group_id'] =
(int)PhocacartUtils::getIntFromString($vG['group_id']);
$data['point_groups'][$kG]['points_received'] =
$vG['points_received'];
}
} else {
$group =
$data['point_groups']['point_group'];
$data['point_groups'] = array();
$data['point_groups'][0]['id'] =
(int)PhocacartUtils::getIntFromString($group['id']);
$data['point_groups'][0]['product_id'] =
(int)PhocacartUtils::getIntFromString($group['product_id']);
$data['point_groups'][0]['group_id'] =
(int)PhocacartUtils::getIntFromString($group['group_id']);
$data['point_groups'][0]['points_received'] =
$group['points_received'];
}
} else {
$data['point_groups'] = array();
}
// PRICE HISTORIES
if
(!empty($data['price_histories']['price_history'])) {
if
(is_array($data['price_histories']['price_history'])
&&
isset($data['price_histories']['price_history'][0])) {
$histories =
$data['price_histories']['price_history'];
$data['price_histories'] = array();
foreach($histories as $kG => $vG) {
$data['price_histories'][$kG]['id'] =
(int)PhocacartUtils::getIntFromString($vG['id']);
$data['price_histories'][$kG]['product_id'] =
(int)PhocacartUtils::getIntFromString($vG['product_id']);
$data['price_histories'][$kG]['date'] =
$vG['date'];
$data['price_histories'][$kG]['price'] =
$vG['price'];
}
} else {
$group =
$data['price_histories']['price_history'];
$data['price_histories'] = array();
$data['price_histories'][0]['id'] =
(int)PhocacartUtils::getIntFromString($group['id']);
$data['price_histories'][0]['product_id'] =
(int)PhocacartUtils::getIntFromString($group['product_id']);
$data['price_histories'][0]['date'] =
$group['date'];
$data['price_histories'][0]['price'] =
$group['price'];
}
} else {
$data['price_histories'] = array();
}
// RELATED
if (!empty($data['related']['related_product'])) {
if (is_array($data['related']['related_product'])
&&
isset($data['related']['related_product'][0])) {
$relateds =
$data['related']['related_product'];
$data['related'] = array();
foreach($relateds as $kR => $vR) {
$data['related'][] =
(int)PhocacartUtils::getIntFromString($vR);
}
} else {
$related =
$data['related']['related_product'];
$data['related'] = array();
$data['related'][0] =
(int)PhocacartUtils::getIntFromString($related);
}
} else {
$data['related'] = array();
}
$data['related'] = implode(',',
$data['related']);
// TAG
if (!empty($data['tags']['tag'])) {
if (isset($data['tags']['tag']['id']))
{
// TAG STRING
$tag = $data['tags']['tag'];
$data['tags'] = array();
$data['tags'][0] = PhocacartUtils::getIntFromString($tag);
} else if (is_array($data['tags']['tag'])) {
// TAGS ARRAY
$tags = $data['tags']['tag'];
$data['tags'] = array();
foreach($tags as $kT => $vT) {
$vT = (int)PhocacartUtils::getIntFromString($vT);
$data['tags'][] = $vT;
}
}
} else {
$data['tags'] = array();
}
// LABELS
if (!empty($data['taglabels']['label'])) {
if
(isset($data['taglabels']['label']['id'])) {
// TAG STRING
$tag = $data['taglabels']['label'];
$data['taglabels'] = array();
$data['taglabels'][0] =
PhocacartUtils::getIntFromString($tag);
} else if (is_array($data['taglabels']['label']))
{
// TAGS ARRAY
$tags = $data['taglabels']['label'];
$data['taglabels'] = array();
foreach($tags as $kT => $vT) {
$vT = (int)PhocacartUtils::getIntFromString($vT);
$data['taglabels'][] = $vT;
}
}
} else {
$data['taglabels'] = array();
}
// ADDITIONAL DOWNLOAD FILES
if
(!empty($data['additional_download_files']['additional_download_file']))
{
if
(isset($data['additional_download_files']['additional_download_file']['id']))
{
// ADDITIONAL DOWNLOAD FILES STRING
$files =
$data['additional_download_files']['additional_download_file'];
$data['additional_download_files'] = array();
$data['additional_download_files'][0] = $files;
} else if
(is_array($data['additional_download_files']['additional_download_file']))
{
// ADDITIONAL DOWNLOAD FILES ARRAY
$files =
$data['additional_download_files']['additional_download_file'];
$data['additional_download_files'] = array();
$data['additional_download_files'] = $files;
}
} else {
$data['additional_download_files'] = array();
}
// PARAMETERS
if
(isset($data['items_parameter']['parameter']['id']))
{
// PARAMETER STRING
$parameters =
$data['items_parameter']['parameter'];
$data['items_parameter'] = array();
$data['items_parameter']['parameter'][0] =
$parameters;
}
if
(!empty($data['items_parameter']['parameter'])) {
$parameters =
$data['items_parameter']['parameter'];
$data['items_parameter'] = array();
foreach($parameters as $kP => $vP) {
if (isset($vP['id']) &&
(int)$vP['id'] > 0) {
$vPId = (int)$vP['id'];
if(!empty($vP['values']['value'])) {
if
(isset($vP['values']['value']['id'])) {
// VALUES STRING
$data['items_parameter'][$vPId][] =
(int)PhocacartUtils::getIntFromString($vP['values']['value']['id']);
} else if
(is_array($vP['values']['value'])) {
// ADDITIONAL DOWNLOAD FILES ARRAY
foreach
($vP['values']['value'] as $kPV => $vPV) {
if (isset($vPV['id'])
&& (int)$vPV['id'] > 0) {
$data['items_parameter'][$vPId][] =
(int)PhocacartUtils::getIntFromString($vPV['id']);
}
}
}
}
}
}
} else {
$data['items_parameter'] = array();
}
// correct simple xml
foreach($data as $k => $v) {
if (empty($v)) {
$data[$k] = '';
}
}
$a[] = $data;
$newId = PhocacartProduct::storeProduct($data, $import_column);
if ($newId > 0) {
$productIdChange[$newId] = $data['id'];
}
}
}
PhocacartRelated::correctProductId($productIdChange);// needed for
related when new IDs are created by auto increment
}
} else {
// --------
// CSV
if (isset($d['productcolumns'][0]['item']) &&
($d['productcolumns'][0]['item'] != '')) {
$pcAH = str_getcsv($d['productcolumns'][0]['item'],
';', '"');
if (!empty($d['products'])){
foreach($d['products'] as $k => $v) {
if (isset($v['item']) && $v['item'] !=
'') {
$pcAP = str_getcsv($v['item'], ';',
'"');
if (!empty($pcAH) && !empty($pcAP)) {
$cPcAH = count($pcAH);
$cPcAP = count($pcAP);
if ($cPcAH > $cPcAP) {
$pcAP = array_pad($pcAP, $cPcAH, '');
} else if ($cPcAH < $cPcAP) {
$pcAH = array_pad($pcAH, $cPcAP, '');
}
$data = array_combine($pcAH, $pcAP);
$data['tax_id'] = array();
$data['manufacturer_id'] = array();
$data['catid_multiple'] = array();
$data['catid_multiple_ordering']= array();
// No title - skip
if (isset($data['title']) &&
$data['title'] == '') {
continue;
}
// Specific rules
if (isset($data['tax'])) {
$data['tax_id'] =
PhocacartUtils::getIntFromString($data['tax']);
unset($data['tax']);
}
if (isset($data['manufacturer'])) {
$data['manufacturer_id'] =
PhocacartUtils::getIntFromString($data['manufacturer']);
unset($data['manufacturer']);
}
if (isset($data['categories'])) {
$categories = json_decode($data['categories'], true);
if (!empty($categories)) {
foreach($categories as $kC => $vC) {
$idC =
(int)PhocacartUtils::getIntFromString($vC['id']);
$data['catid_multiple'][] = $idC;
$data['catid_multiple_ordering'][$idC] =
$vC['ordering'];
}
} else {
// No categories - skip
continue;
}
unset($data['categories']);
}
if (isset($data['images'])) {
$images = array();
if ($data['images'] != '') {
$images = explode("|", $data['images']);
}
$data['images'] = array();
if (!empty($images)) {
foreach($images as $kI => $vI) {
$data['images'][]['image'] = $vI;
}
}
}
if (isset($data['attributes'])) {
$data['attributes'] =
json_decode($data['attributes'], true);
}
if (isset($data['specifications'])) {
$data['specifications'] =
json_decode($data['specifications'], true);
}
if (isset($data['advanced_stock_options'])) {
$data['advanced_stock_options'] =
json_decode($data['advanced_stock_options'], true);
}
// DISCOUNT GROUPS
if (isset($data['discounts'])) {
$data['discounts'] =
json_decode($data['discounts'], true);
$groupsD = array();
if (!empty($data['discounts'])) {
foreach($data['discounts'] as $kDG => $vDG) {
$groupsD = $vDG['groups'];
if (!empty($groupsD)) {
foreach($groupsD as $kR => $vR) {
$groupsD[$kR] =
PhocacartUtils::getIntFromString($vR['id']);
}
}
$data['discounts'][$kDG]['groups'] =
$groupsD;
}
}
}
if (isset($data['groups'])) {
$data['groups'] = json_decode($data['groups'],
true);
$groups = array();
$groups = $data['groups'];
if (!empty($groups)) {
foreach($groups as $kR => $vR) {
$groups[$kR] =
PhocacartUtils::getIntFromString($vR['id']);
}
}
$data['groups'] = $groups;
}
// Price Groups
if (isset($data['price_groups'])) {
$data['price_groups'] =
json_decode($data['price_groups'], true);
/*$groups = array();
$groups = $data['price_groups'];
if (!empty($groups)) {
foreach($groups as $kR => $vR) {
$groups[$kR] =
PhocacartUtils::getIntFromString($vR['id']);
}
}
$data['price_groups'] = $groups;*/
} else {
$data['price_groups'] = array();
}
// Point Groups
if (isset($data['point_groups'])) {
$data['point_groups'] =
json_decode($data['point_groups'], true);
/*$groups = array();
$groups = $data['point_groups'];
if (!empty($groups)) {
foreach($groups as $kR => $vR) {
$groups[$kR] =
PhocacartUtils::getIntFromString($vR['id']);
}
}
$data['point_groups'] = $groups;*/
} else {
$data['point_groups'] = array();
}
// Price Groups
if (isset($data['price_histories'])) {
$data['price_histories'] =
json_decode($data['price_histories'], true);
/*$groups = array();
$groups = $data['price_groups'];
if (!empty($groups)) {
foreach($groups as $kR => $vR) {
$groups[$kR] =
PhocacartUtils::getIntFromString($vR['id']);
}
}
$data['price_groups'] = $groups;*/
} else {
$data['price_histories'] = array();
}
if (isset($data['related'])) {
$related = array();
if ($data['related'] != '') {
$related = explode("|", $data['related']);
}
if (!empty($related)) {
foreach($related as $kR => $vR) {
$related[$kR] = PhocacartUtils::getIntFromString($vR);
}
}
$data['related'] = implode(',', $related);
}
if (isset($data['tags'])) {
$tags = array();
if ($data['tags'] != '') {
$tags = explode("|", $data['tags']);
}
if (!empty($tags)) {
foreach($tags as $kT => $vT) {
$tags[$kT] = PhocacartUtils::getIntFromString($vT);
}
}
$data['tags'] = $tags;
}
if (isset($data['taglabels'])) {
$tags = array();
if ($data['taglabels'] != '') {
$tags = explode("|", $data['taglabels']);
}
if (!empty($tags)) {
foreach($tags as $kT => $vT) {
$tags[$kT] = PhocacartUtils::getIntFromString($vT);
}
}
$data['taglabels'] = $tags;
}
if (isset($data['items_parameter'])) {
$data['items_parameter'] =
json_decode($data['items_parameter'], true);
$itemParameters = array();
if (!empty($data['items_parameter']))
{
foreach($data['items_parameter']
as $kT => $vT) {
if (!empty($vT)) {
foreach($vT as $kT2 => $vT2) {
if (isset($vT2['id'])
&& (int)$vT2['id'] > 0) {
$itemParameters[$kT][$kT2]
= (int)$vT2['id'];
}
}
}
}
}
$data['items_parameter'] =
$itemParameters;
}
if (isset($data['additional_download_files'])) {
$data['additional_download_files'] =
json_decode($data['additional_download_files'], true);
}
$newId = PhocacartProduct::storeProduct($data, $import_column);
if ($newId > 0) {
$productIdChange[$newId] = $data['id'];
}
}
}
}
PhocacartRelated::correctProductId($productIdChange);// needed for
related when new IDs are created by auto increment
}
}
}
PK�"�[۹��7�7layouts/report.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$d = $displayData;
$price = new PhocacartPrice();
$taxes = PhocacartTax::getAllTaxesIncludingCountryRegion();
$p = array();
$p['report_calculation'] = $d['params']->get(
'report_calculation', 1);
$p['report_display_tax'] = $d['params']->get(
'report_display_tax', 1);
$p['report_display_rounding'] = $d['params']->get(
'report_display_rounding', 1);
$p['report_header'] = $d['params']->get(
'report_header', '');
// STYLE
$cRDoc = 'class="ph-report-doc"';
$cRHead = 'class="ph-report-header"';
$cRDate = 'class="ph-report-date"';
$cRT = 'class="ph-report-table"';
$cRTRH = 'class="ph-report-table-row-header"';
$cRTRHC = 'class="ph-report-table-row-header-col"';
$cRTRI = 'class="ph-report-table-row-items"';
$cRD = 'class="ph-report-date"';
$cRON = 'class="ph-report-order-number"';
$cRC = 'class="ph-report-customer"';
$cRB = 'class="ph-report-bold"';
$cRCur = 'class="ph-report-currency"';
$cRNetto = 'class="ph-report-netto"';
$cRTax = 'class="ph-report-tax"';
$cRBrutto = 'class="ph-report-brutto"';
$cRRounding = 'class="ph-report-rounding"';
$cRTotalR = 'class="ph-report-total-row"';
$cRTotalC1 = 'class="ph-report-total-col1"';
$cRTotalC2 = 'class="ph-report-total-col2"';
switch($d['format']) {
case 'raw':
$cRDoc = 'style="font-family: sans-serif,arial;"';
$cRHead = 'style="padding: 3px;"';
$cRDate = 'style="padding: 3px;"';
$cRT = 'style="border: 1px solid
#f0f0f0;border-collapse:collapse;font-size:90%;width:100%"';
$cRTRH = 'style="border: 1px solid
#f0f0f0;padding:3px;"';
$cRTRHC = 'style="border: 1px solid
#f0f0f0;padding:3px;background: #f7f7f7;"';
$cRTRI = 'style=""';
$cRD = 'style="text-align:center;border: 1px solid
#f0f0f0;padding:5px;"';
$cRON = 'style="text-align:center;border: 1px solid
#f0f0f0;padding:5px;"';
$cRC = 'style="text-align:left;border: 1px solid
#f0f0f0;padding:5px;"';
$cRB = 'style="font-weight:bold"';
$cRCur = 'style="text-align:center;border: 1px solid
#f0f0f0;padding:5px;"';
$cRNetto = 'style="text-align:right;border: 1px solid
#f0f0f0;padding:5px;"';
$cRTax = 'style="text-align:right;border: 1px solid
#f0f0f0;padding:5px;"';
$cRBrutto = 'style="text-align:right;border: 1px solid
#f0f0f0;padding:5px;"';
$cRRounding = 'style="text-align:right;border: 1px solid
#f0f0f0;padding:5px;"';
$cRTotalR = 'style="background:
#ffffbf;vertical-align:top;text-align:right;font-weight:bold;border: 1px
solid #f0f0f0;padding:5px;"';
$cRTotalC1 =
'style="text-align:left;vertical-align:left;border: 1px solid
#f0f0f0;padding:5px;"';
$cRTotalC2 = 'style="border: 1px solid
#f0f0f0;padding:3px;"';
break;
case 'pdf':
$cRDoc = 'style="font-family: sans-serif,arial;"';
$cRHead = 'style="font-family: sans-serif,arial;margin:
0pt;padding: 0pt;"';
$cRDate = 'style="font-family: sans-serif,arial;margin:
0pt;padding: 0pt;"';
$cRT = 'style="border: 1pt solid
#f0f0f0;border-collapse:collapse;font-size:60%;width:100%"
cellpadding="1"';
$cRTRH = 'style="border: 1pt solid #f0f0f0;"';
$cRTRHC = 'style="border: 1pt solid #f0f0f0;background-color:
#f7f7f7;font-size: 90%"';
$cRTRI = 'style=""';
$cRD = 'style="text-align:center;border: 1pt solid
#f0f0f0;"';
$cRON = 'style="text-align:center;border: 1pt solid
#f0f0f0;"';
$cRC = 'style="text-align:left;border: 1pt solid
#f0f0f0;padding:5px;"';
$cRB = 'style="font-weight:bold"';
$cRCur = 'style="text-align:center;border: 1pt solid
#f0f0f0;"';
$cRNetto = 'style="text-align:right;border: 1pt solid
#f0f0f0;"';
$cRTax = 'style="text-align:right;border: 1pt solid
#f0f0f0;"';
$cRBrutto = 'style="text-align:right;border: 1pt solid
#f0f0f0;"';
$cRRounding = 'style="text-align:right;border: 1pt solid
#f0f0f0;"';
$cRTotalR = 'style="background-color:
#ffffbf;vertical-align:top;text-align:right;font-weight:bold;border: 1pt
solid #f0f0f0;"';
$cRTotalC1 =
'style="text-align:left;vertical-align:left;border: 1pt solid
#f0f0f0;"';
$cRTotalC2 = 'style="border: 1pt solid #f0f0f0;"';
break;
default:
break;
}
echo '<div '.$cRDoc.'>';// start doc
if ($d['format'] == 'raw' || $d['format'] ==
'pdf') {
$header =
PhocacartRenderFront::renderArticle($p['report_header'],
$d['format']);
if ($header != '') {
echo '<div '.$cRHead.'>';
echo $header;
echo '</div>';
}
echo '<div '.$cRDate.'>';
echo JText::_('COM_PHOCACART_DATE') . ': ';
echo $d['date_from'] . ' - ' .
$d['date_to'];
echo '</div>';
}
// HEADER
echo '<table '.$cRT.'>';
echo '<tr '.$cRTRH.'>';
echo '<th
'.$cRTRHC.'>'.JText::_('COM_PHOCACART_DATE').'</th>';
echo '<th
'.$cRTRHC.'>'.JText::_('COM_PHOCACART_ORDER_NUMBER').'</th>';
echo '<th
'.$cRTRHC.'>'.JText::_('COM_PHOCACART_CUSTOMER').'</th>';
echo '<th
'.$cRTRHC.'>'.JText::_('COM_PHOCACART_PAYMENT').'</th>';
echo '<th
'.$cRTRHC.'>'.JText::_('COM_PHOCACART_CURRENCY').'</th>';
if ($p['report_display_tax'] == 1) {
//echo '<th
'.$cRTRHC.'>'.JText::_('COM_PHOCACART_AMOUNT_EXCLUDING_TAX').'</th>';
// TRC
echo '<th
'.$cRTRHC.'>'.JText::_('COM_PHOCACART_AMOUNT_EXCLUDING_TAX').'</th>';
//echo '<th
'.$cRTRHC.'>'.JText::_('COM_PHOCACART_AMOUNT_TAX').'</th>';
// TRC
echo '<th
'.$cRTRHC.'>'.JText::_('COM_PHOCACART_AMOUNT_TAX').'</th>';
}
if ($p['report_display_rounding'] == 1) {
//echo '<th
'.$cRTRHC.'>'.JText::_('COM_PHOCACART_ROUNDING').'</th>';
// TRC
echo '<th
'.$cRTRHC.'>'.JText::_('COM_PHOCACART_ROUNDING').'</th>';
}
if ($p['report_display_tax'] == 1) {
echo '<th
'.$cRTRHC.'>'.JText::_('COM_PHOCACART_AMOUNT_INCLUDING_TAX').'</th>';
} else {
echo '<th
'.$cRTRHC.'>'.JText::_('COM_PHOCACART_AMOUNT').'</th>';
}
echo '</tr>';
// ITEMS
foreach($d['items'] as $k => $v) {
echo '<tr '.$cRTRI.'>';
// Date
echo '<td '.$cRD.'>';
$dateTime = new DateTime($v->date);
echo $dateTime->format('Y-m-d');
echo '</td>';
// Order Number
echo '<td
'.$cRON.'>'.$v->order_number.'</td>';
// Customer
echo '<td '.$cRC.'>';
echo isset($v->user_company) && $v->user_company !=
'' ? $v->user_company . '<br>' :
'';
echo isset($v->user_vat_1) && $v->user_vat_1 != ''
? '('.JText::_('COM_PHOCACART_VAT_NUMBER').':
' . $v->user_vat_1 . ')<br>' : '';
echo '<span '.$cRB.'>' . $v->user_name_first
. ' ' . $v->user_name_last .
'</span><br>';
echo isset($v->user_address_1) && $v->user_address_1 !=
'' ? $v->user_address_1 . '<br>' :
'';
echo isset($v->user_zip) && $v->user_zip != '' ?
' ' . $v->user_zip : '';
echo isset($v->user_city) && $v->user_city != '' ?
' ' . $v->user_city . '<br>' : '';
echo isset($v->user_country) && $v->user_country !=
'' ? ' ' . $v->user_country : '';
echo '</td>';
// Payment Title
echo '<td
'.$cRCur.'>'.$v->payment_title.'</td>';
// Currency
echo '<td
'.$cRCur.'>'.$v->currency_code.'</td>';
// Total
$price->setCurrency($v->currency_id, $v->id);
// Netto
if ($p['report_display_tax'] == 1) {
if ($p['report_calculation'] == 1) {
// C NETTO
echo '<td '.$cRNetto.'>';
if (isset($v->brutto)) {
$v->rouding = isset($v->rounding) ? $v->rounding : 0;
$v->taxsum = isset($v->taxsum) ? $v->taxsum : 0;
$netto = $v->brutto - $v->rounding - $v->taxsum;
echo $price->getPriceFormat($netto, 0, 1);
}
echo '</td>';
} else if ($p['report_calculation'] == 2) {
// TRC NETTO
echo '<td '.$cRNetto.'>';
/*if (isset($v->trcnetto)) {
echo $price->getPriceFormat($v->trcnetto, 0, 1);
}*/
if (isset($v->trcbrutto)) {
$v->trcrounding = isset($v->trcrounding) ? $v->trcrounding :
0;
$v->trctaxsum = isset($v->trctaxsum) ? $v->trctaxsum : 0;
// We use the brutto not TRCbrutto because Tax Recapitulation sum must
not be the same like Calculation sum
//$netto = $price->roundPrice($v->trcbrutto) -
$price->roundPrice($v->trcrounding) -
$price->roundPrice($v->trctaxsum);
$netto = $price->roundPrice($v->brutto) -
$price->roundPrice($v->trcrounding) -
$price->roundPrice($v->trctaxsum);
echo $price->getPriceFormat($netto, 0, 1);
}
echo '</td>';
}
if ($p['report_calculation'] == 1) {
// Tax C
echo '<td '.$cRTax.'>';
if (!empty($v->tax)) {
foreach($v->tax as $kT => $vT) {
echo isset($taxes[$kT]['title']) ?
$taxes[$kT]['title'] . ' ' : '';
echo isset($taxes[$kT]['tax_rate']) &&
isset($taxes[$kT]['calculation_type']) ?
'('.$price->getTaxFormat($taxes[$kT]['tax_rate'],
(int)$taxes[$kT]['calculation_type']).') ' :
'';
echo ': ';
echo $price->getPriceFormat($vT,0,1) . '<br>';
}
}
echo '</td>';
} else if ($p['report_calculation'] == 2) {
// TRC TAX
echo '<td '.$cRTax.'>';
if (!empty($v->trctax)) {
foreach($v->trctax as $kT => $vT) {
echo isset($taxes[$kT]['title']) ?
$taxes[$kT]['title'] . ' ' : '';
echo isset($taxes[$kT]['tax_rate']) &&
isset($taxes[$kT]['calculation_type']) ?
'('.$price->getTaxFormat($taxes[$kT]['tax_rate'],
(int)$taxes[$kT]['calculation_type']).') ' :
'';
echo ': ';
echo $price->getPriceFormat($vT,0,1) . '<br>';
}
}
echo '</td>';
}
}
// Rounding
if ($p['report_display_rounding'] == 1) {
if ($p['report_calculation'] == 1) {
// C ROUNDING
echo '<td '.$cRRounding.'>';
echo isset($v->rounding) ? $price->getPriceFormat($v->rounding,
0, 1): '';
echo '</td>';
} else if ($p['report_calculation'] == 2) {
// TRC ROUNDING
echo '<td '.$cRRounding.'>';
echo isset($v->trcrounding) ?
$price->getPriceFormat($v->trcrounding, 0, 1): '';
echo '</td>';
}
}
// Brutto
echo '<td '.$cRBrutto.'>';
echo isset($v->brutto) ? $price->getPriceFormat($v->brutto, 0,
1): '';
echo '</td>';
echo '</tr>';
}
// TOTAL
if (!empty($d['total'])) {
$i = 0;
foreach ($d['total'] as $k => $v) {
$netto = $brutto = $rounding = $tax = 0;
$nettoTxt = $bruttoTxt = $roundingTxt = $taxTxt = '';
$nettoTRC = $bruttoTRC = $roundingTRC = $taxTRC = 0;
$nettoTRCTxt= $bruttoTRCTxt = $roundingTRCTxt = $taxTRCTxt =
'';
if (!empty($v)) {
$price->setCurrency($k);
echo '<tr '.$cRTotalR.'
id="phReportTotalRow'.$i.'">';
echo '<td '.$cRTotalC1.'
colspan="5">';
echo '' . JText::_('COM_PHOCACART_TOTAL'). '
';
echo '('. $price->getPriceCurrencyTitle(). ')';
echo '</td>';
if (isset($v['brutto'])) {
$brutto = $price->roundPrice($v['brutto']);
$bruttoTxt = $price->getPriceFormat($v['brutto'], 0, 1);
}
if (isset($v['trcbrutto'])) {
$bruttoTRC = $price->roundPrice($v['trcbrutto']);
$bruttoTRCTxt = $price->getPriceFormat($v['trcbrutto'], 0,
1);
}
$rounding = isset($v['rounding']) ?
$price->getPriceFormat($v['rounding'], 0, 1) : '';
if (isset($v['rounding'])) {
$rounding = $price->roundPrice($v['rounding']);
$roundingTxt = $price->getPriceFormat($v['rounding'], 0,
1);
}
$roundingTRC = isset($v['trcrounding']) ?
$price->getPriceFormat($v['trcrounding'], 0, 1) :
'';
if (isset($v['trcrounding'])) {
$roundingTRC = $price->roundPrice($v['trcrounding']);
$roundingTRCTxt =
$price->getPriceFormat($v['trcrounding'], 0, 1);
}
if (!empty($v['tax'])) {
$taxTxt = '';
foreach($v['tax'] as $kT => $vT) {
$tax += $price->roundPrice($vT);
$taxTxt .= isset($taxes[$kT]['title']) ?
$taxes[$kT]['title'] . ' ' : '';
$taxTxt .= isset($taxes[$kT]['tax_rate']) &&
isset($taxes[$kT]['calculation_type']) ?
'('.$price->getTaxFormat($taxes[$kT]['tax_rate'],
(int)$taxes[$kT]['calculation_type']).') ' :
'';
$taxTxt .= ': ';
$taxTxt .= $price->getPriceFormat($vT,0,1) .
'<br>';
}
}
if (!empty($v['trctax'])) {
$taxTRCTxt = '';
foreach($v['trctax'] as $kT => $vT) {
$taxTRC += $price->roundPrice($vT);
$taxTRCTxt .= isset($taxes[$kT]['title']) ?
$taxes[$kT]['title'] . ' ' : '';
$taxTRCTxt .= isset($taxes[$kT]['tax_rate']) &&
isset($taxes[$kT]['calculation_type']) ?
'('.$price->getTaxFormat($taxes[$kT]['tax_rate'],
(int)$taxes[$kT]['calculation_type']).') ' :
'';
$taxTRCTxt .= ': ';
$taxTRCTxt .= $price->getPriceFormat($vT,0,1) .
'<br>';
}
}
$netto = $price->roundPrice($brutto) -
$price->roundPrice($rounding) - $price->roundPrice($tax);
$nettoTxt = $price->getPriceFormat($netto, 0, 1);
// We use brutto not bruttoTRC - because Tax Recapitualtion sum can be
different to tax calculation sum
// For example - products are with VAT, shipping and payment price
without VAT
// so the netto is the same but brutto is different
(Calculation: Products + Shipping + Payment, Tax Recapitulation: Products
only)
//$nettoTRC = $price->roundPrice($bruttoTRC) -
$price->roundPrice($roundingTRC) - $price->roundPrice($taxTRC);
$nettoTRC = $price->roundPrice($brutto) -
$price->roundPrice($roundingTRC) - $price->roundPrice($taxTRC);
$nettoTRCTxt = $price->getPriceFormat($nettoTRC, 0, 1);
if ($p['report_display_tax'] == 1) {
if ($p['report_calculation'] == 1) {
echo '<td
'.$cRTotalC2.'>'.$nettoTxt.'</td>';// C
echo '<td
'.$cRTotalC2.'>'.$taxTxt.'</td>';
} else if ($p['report_calculation'] == 2) {
echo '<td
'.$cRTotalC2.'>'.$nettoTRCTxt.'</td>';//
TRC
echo '<td
'.$cRTotalC2.'>'.$taxTRCTxt.'</td>';
}
}
if ($p['report_display_rounding'] == 1) {
if ($p['report_calculation'] == 1) {
echo '<td
'.$cRTotalC2.'>'.$roundingTxt.'</td>';//
C
} else if ($p['report_calculation'] == 2) {
echo '<td
'.$cRTotalC2.'>'.$roundingTRCTxt.'</td>';//
TRC
}
}
echo '<td
'.$cRTotalC2.'>'.$bruttoTxt.'</td>';
//echo '<td
'.$cRTotalC2.'>'.$bruttoTRCTxt.'</td>';//
TRC
echo '</tr>';
}
$i++;
}
}
echo '</table>';
echo '</div>';// end doc
echo '<p> </p>';
PK�"�[�4"�yylibraries/autoloadEscpos.phpnu�[���<?php
/**
* Users who do not have 'composer' to manage dependencies,
include this
* file to provide auto-loading of the classes in this library.
* require JPATH_ADMINISTRATOR .
'/components/com_phocacart/libraries/autoloadPhoca.php';
*/
spl_autoload_register ( function ($class) {
/*
* PSR-4 autoloader, based on PHP Framework Interop Group snippet (Under
MIT License.)
*
https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader-examples.md
*/
$prefix = "Mike42\\";
$base_dir = __DIR__ . "/";
/* Only continue for classes in this namespace */
$len = strlen ( $prefix );
if (strncmp ( $prefix, $class, $len ) !== 0) {
return;
}
/* Require the file if it exists */
$relative_class = substr ( $class, $len );
$file = $base_dir . str_replace ( '\\', '/',
$relative_class ) . '.php';
if (file_exists ( $file )) {
require $file;
}
} );
PK�"�[Ŕdwwlibraries/autoloadPhoca.phpnu�[���<?php
/**
* Users who do not have 'composer' to manage dependencies,
include this
* file to provide auto-loading of the classes in this library.
*/
spl_autoload_register ( function ($class) {
/*
* PSR-4 autoloader, based on PHP Framework Interop Group snippet (Under
MIT License.)
*
https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader-examples.md
*/
$prefix = "Phoca\\";
$base_dir = __DIR__ . "/";
/* Only continue for classes in this namespace */
$len = strlen ( $prefix );
if (strncmp ( $prefix, $class, $len ) !== 0) {
return;
}
/* Require the file if it exists */
//$relative_class = substr ( $class, $len );
//$relative_class = str_replace('Joomla/CMS/' . $class);
$relative_class = $class;
$file = $base_dir . str_replace ( '\\', '/',
$relative_class ) . '.php';
if (file_exists ( $file )) {
require $file;
}
} );
PK�"�[X���Y%Y%&libraries/Escpos/CapabilityProfile.phpnu�[���<?php
/**
* This file is part of escpos-php: PHP receipt printer library for use
with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington <
michael.billington@gmail.com >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full
list.
*
* This software is distributed under the terms of the MIT license. See
LICENSE.md
* for details.
*/
namespace Mike42\Escpos;
use Mike42\Escpos\CodePage;
use \InvalidArgumentException;
/**
* Store compatibility information about one printer.
*/
class CapabilityProfile
{
/**
*
* @var string $codePageCacheKey
* Hash of the code page data structure, to identify it for caching.
*/
protected $codePageCacheKey;
/**
*
* @var array $codePages
* Associtive array of CodePage objects, indicating which encodings
the printer supports.
*/
protected $codePages;
/**
*
* @var array $colors
* Not used.
*/
protected $colors;
/**
*
* @var array $features
* Feature values.
*/
protected $features;
/**
*
* @var array $fonts
* Not used
*/
protected $fonts;
/**
*
* @var array $media
* Not used
*/
protected $media;
/**
*
* @var string $name
* Name of the profile, including model number.
*/
protected $name;
/**
*
* @var string $notes
* Notes on the profile, null if not set.
*/
protected $notes;
/**
*
* @var string $profileId
* ID of the profile.
*/
protected $profileId;
/**
* @var string $vendor
* Name of manufacturer.
*/
protected $vendor;
/**
*
* @var array $encodings
* Data structure containing encodings loaded from disk, null if not
loaded yet.
*/
protected static $encodings = null;
/**
*
* @var array $profiles
* Data structure containing profiles loaded from disk, null if not
loaded yet.
*/
protected static $profiles = null;
/**
* Construct new CapabilityProfile.
* The encoding data must be loaded from disk before calling.
*
* @param unknown $profileId
* ID of the profile
* @param array $profileData
* Profile data from disk.
*/
protected function __construct($profileId, array $profileData)
{
// Basic primitive fields
$this->profileId = $profileId;
$this->name = $profileData['name'];
$this->notes = $profileData['notes'];
$this->vendor = $profileData['vendor'];
// More complex fields that are not currently loaded into custom
objects
$this->features = $profileData['features'];
$this->colors = $profileData['colors'];
$this->fonts = $profileData['fonts'];
$this->media = $profileData['media'];
// More complex fields that are loaded into custom objects
$this->codePages = array();
$this->codePageCacheKey =
md5(json_encode($profileData['codePages']));
foreach ($profileData['codePages'] as $k => $v) {
$this->codePages[$k] = new CodePage($v,
self::$encodings[$v]);
}
}
/**
*
* @return string Hash of the code page data structure, to identify it
for caching.
*/
public function getCodePageCacheKey()
{
return $this->codePageCacheKey;
}
/**
*
* @return array Associtive array of CodePage objects, indicating which
encodings the printer supports.
*/
public function getCodePages()
{
return $this->codePages;
}
/**
*
* @param string $featureName
* Name of the feature to retrieve.
* @throws \InvalidArgumentException Where the feature does not exist.
* The exception will contain suggestions for the closest-named
features.
* @return mixed feature value.
*/
public function getFeature($featureName)
{
if (isset($this->features[$featureName])) {
return $this->features[$featureName];
}
$suggestionsArr = $this->suggestFeatureName($featureName);
$suggestionsStr = implode(", ", $suggestionsArr);
$str = "The feature '$featureName' does not exist.
Try one that does exist, such as $suggestionsStr";
throw new \InvalidArgumentException($str);
}
/**
*
* @return string ID of the profile.
*/
public function getId()
{
return $this->profileId;
}
/**
*
* @return string Name of the printer.
*/
public function getName()
{
return $this->name;
}
/**
*
* @return boolean True if Barcode B command is supported, false
otherwise
*/
public function getSupportsBarcodeB()
{
return $this->getFeature('barcodeB') === true;
}
/**
*
* @return boolean True if Bit Image Raster command is supported, false
otherwise
*/
public function getSupportsBitImageRaster()
{
return $this->getFeature('bitImageRaster') === true;
}
/**
*
* @return boolean True if Graphics command is supported, false
otherwise
*/
public function getSupportsGraphics()
{
return $this->getFeature('graphics') === true;
}
/**
*
* @return boolean True if PDF417 code command is supported, false
otherwise
*/
public function getSupportsPdf417Code()
{
// TODO submit 'pdf417Code' as a new feature to be
tracked in upstream profiles
return $this->getFeature('qrCode') === true;
}
/**
*
* @return boolean True if QR code command is supported, false
otherwise
*/
public function getSupportsQrCode()
{
return $this->getFeature('qrCode') === true;
}
/**
*
* @return boolean True if Star mode commands are supported, false
otherwise
*/
public function getSupportsStarCommands()
{
return $this->getFeature('starCommands') === true;
}
/**
*
* @return string Vendor of this printer.
*/
public function getVendor()
{
return $this->vendor;
}
/**
*
* @param string $featureName
* Feature that does not exist
* @return array Three most similar feature names that do exist.
*/
protected function suggestFeatureName($featureName)
{
return self::suggestNearest($featureName,
array_keys($this->features), 3);
}
/**
*
* @return array Names of all profiles that exist.
*/
public static function getProfileNames()
{
self::loadCapabilitiesDataFile();
return array_keys(self::$profiles);
}
/**
* Retrieve the CapabilityProfile with the given ID.
*
* @param string $profileName
* The ID of the profile to load.
* @throws InvalidArgumentException Where the ID does not exist. Some
similarly-named profiles will be suggested in the Exception text.
* @return CapabilityProfile The CapabilityProfile that was requested.
*/
public static function load($profileName)
{
self::loadCapabilitiesDataFile();
if (! isset(self::$profiles[$profileName])) {
$suggestionsArray = self::suggestProfileName($profileName);
$suggestionsStr = implode(", ", $suggestionsArray);
throw new InvalidArgumentException("The CapabilityProfile
'$profileName' does not exist. Try one that does exist, such as
$suggestionsStr.");
}
return new CapabilityProfile($profileName,
self::$profiles[$profileName]);
}
/**
* Ensure that the capabilities.json data file has been loaded.
*/
protected static function loadCapabilitiesDataFile()
{
if (self::$profiles === null) {
$filename = dirname(__FILE__) .
"/resources/capabilities.json";
$capabilitiesData = json_decode(file_get_contents($filename),
true);
self::$profiles = $capabilitiesData['profiles'];
self::$encodings = $capabilitiesData['encodings'];
}
}
/**
* Return choices with smallest edit distance to an invalid input.
*
* @param string $input
* Input that is not a valid choice
* @param array $choices
* Array of valid choices.
* @param int $num
* Number of suggestions to return
*/
public static function suggestNearest($input, array $choices, $num)
{
$distances = array_fill_keys($choices, PHP_INT_MAX);
foreach ($distances as $word => $_) {
$distances[$word] = levenshtein($input, $word);
}
asort($distances);
return array_slice(array_keys($distances), 0, min($num,
count($choices)));
}
/**
*
* @param string $profileName
* profile name that does not exist
* @return array Three similar profile names that do exist, plus
'simple' and 'default' for good measure.
*/
protected static function suggestProfileName($profileName)
{
$suggestions = self::suggestNearest($profileName,
array_keys(self::$profiles), 3);
$alwaysSuggest = array(
'simple',
'default'
);
foreach ($alwaysSuggest as $item) {
if (array_search($item, $suggestions) === false) {
array_push($suggestions, $item);
}
}
return $suggestions;
}
}
PK�"�[���rr@libraries/Escpos/CapabilityProfiles/DefaultCapabilityProfile.phpnu�[���<?php
/**
* This file is part of escpos-php: PHP receipt printer library for use
with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington <
michael.billington@gmail.com >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full
list.
*
* This software is distributed under the terms of the MIT license. See
LICENSE.md
* for details.
*/
namespace Mike42\Escpos\CapabilityProfiles;
use Mike42\Escpos\CapabilityProfile;
class DefaultCapabilityProfile
{
public static function getInstance()
{
return CapabilityProfile::load('default');
}
}
PK�"�[�^��ss@libraries/Escpos/CapabilityProfiles/EposTepCapabilityProfile.phpnu�[���<?php
/**
* This file is part of escpos-php: PHP receipt printer library for use
with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington <
michael.billington@gmail.com >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full
list.
*
* This software is distributed under the terms of the MIT license. See
LICENSE.md
* for details.
*/
namespace Mike42\Escpos\CapabilityProfiles;
use Mike42\Escpos\CapabilityProfile;
class EposTepCapabilityProfile
{
public static function getInstance()
{
return CapabilityProfile::load('TEP-200M');
}
}
PK�"�[�#o,,.libraries/Escpos/CapabilityProfiles/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�,1nn>libraries/Escpos/CapabilityProfiles/P822DCapabilityProfile.phpnu�[���<?php
/**
* This file is part of escpos-php: PHP receipt printer library for use
with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington <
michael.billington@gmail.com >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full
list.
*
* This software is distributed under the terms of the MIT license. See
LICENSE.md
* for details.
*/
namespace Mike42\Escpos\CapabilityProfiles;
use Mike42\Escpos\CapabilityProfile;
class P822DCapabilityProfile
{
public static function getInstance()
{
return CapabilityProfile::load('P822D');
}
}
PK�"�[�Xpp?libraries/Escpos/CapabilityProfiles/SimpleCapabilityProfile.phpnu�[���<?php
/**
* This file is part of escpos-php: PHP receipt printer library for use
with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington <
michael.billington@gmail.com >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full
list.
*
* This software is distributed under the terms of the MIT license. See
LICENSE.md
* for details.
*/
namespace Mike42\Escpos\CapabilityProfiles;
use Mike42\Escpos\CapabilityProfile;
class SimpleCapabilityProfile
{
public static function getInstance()
{
return CapabilityProfile::load('simple');
}
}
PK�"�[���nn=libraries/Escpos/CapabilityProfiles/StarCapabilityProfile.phpnu�[���<?php
/**
* This file is part of escpos-php: PHP receipt printer library for use
with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington <
michael.billington@gmail.com >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full
list.
*
* This software is distributed under the terms of the MIT license. See
LICENSE.md
* for details.
*/
namespace Mike42\Escpos\CapabilityProfiles;
use Mike42\Escpos\CapabilityProfile;
class StarCapabilityProfile
{
public static function getInstance()
{
return CapabilityProfile::load('SP2000');
}
}
PK�"�[��K�HHlibraries/Escpos/CodePage.phpnu�[���<?php
/**
* This file is part of escpos-php: PHP receipt printer library for use
with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington <
michael.billington@gmail.com >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full
list.
*
* This software is distributed under the terms of the MIT license. See
LICENSE.md
* for details.
*/
namespace Mike42\Escpos;
use \InvalidArgumentException;
/**
* Class to handle data about a particular CodePage, as loaded from the
receipt print
* database.
*
* Also computes map between UTF-8 and this encoding if necessary, using
the iconv library.
*/
class CodePage
{
/**
* The input encoding for generating character maps with iconv.
*/
const INPUT_ENCODING = "UTF-8";
/**
* @var string $data
* Data string, null if not known (can be computed with iconv)
*/
protected $data;
/**
* @var string $iconv
* Iconv encoding name, null if not known
*/
protected $iconv;
/**
* @var string $id
* Internal ID of the CodePage
*/
protected $id;
/**
* @var string $name
* Name of the code page. Substituted with the ID if not set.
*/
protected $name;
/**
* @var string $notes
* Notes on this code page, or null if not set.
*/
protected $notes;
/**
*
* @param string $id
* Unique internal identifier for the CodePage.
* @param array $codePageData
* Associative array of CodePage data, as
* specified by the upstream
receipt-print-hq/escpos-printer-db database.
* May contain 'name', 'data',
'iconv', and 'notes' fields.
*/
public function __construct($id, array $codePageData)
{
$this->id = $id;
$this->name = isset($codePageData['name']) ?
$codePageData['name'] : $id;
$this->data = isset($codePageData['data']) ?
implode("", $codePageData['data']) : null;
$this->iconv = isset($codePageData['iconv']) ?
$codePageData['iconv'] : null;
$this->notes = isset($codePageData['notes']) ?
$codePageData['notes'] : null;
}
/**
* Get a 128-character data string representing this encoding.
* It will be
* calculated and cached if it was not previously known.
*
* @throws InvalidArgumentException Where the data is now known or
computable.
* @return string Data for this encoding.
*/
public function getData()
{
if ($this->data !== null) {
// Return data if known
return $this->data;
}
if ($this->iconv !== null) {
// Calculate with iconv if we know the encoding name
$this->data = self::generateEncodingMap($this->iconv);
return $this->data;
}
// Can't encode..
throw new InvalidArgumentException("Cannot encode this code
page");
}
/**
*
* @return string Iconv encoding name, or blank if not set.
*/
public function getIconv()
{
return $this->iconv;
}
/**
*
* @return string Unique identifier of the code page.
*/
public function getId()
{
return $this->id;
}
/**
* Name of the code page.
*/
public function getName()
{
return $this->name;
}
/**
* The notes may explain quirks about a code-page, such as a source if
it's non-standard or un-encodeable.
*
* @return string Notes on the code page, or null if not set.
*/
public function getNotes()
{
return $this->notes;
}
/**
*
* @return boolean True if we can encode with this code page (ie, we
know what data it holds).
*
* Many printers contain vendor-specific code pages, which are named
but have not been identified or
* typed out. For our purposes, this is an "un-encodeable"
code page.
*/
public function isEncodable()
{
return $this->iconv !== null || $this->data !== null;
}
/**
* Given an iconv encoding name, generate a 128-character UTF-8 string,
containing code points 128-255.
*
* This string is used to map UTF-8 characters to their location in
this code page.
*
* @param string $iconvName
* Name of the encoding
* @return string 128-character string in UTF-8.
*/
protected static function generateEncodingMap($iconvName)
{
// Start with array of blanks (" " indicates unknown
character).
$charMap = array_fill(0, 128, " ");
// Loop through 128 code points
for ($char = 128; $char <= 255; $char ++) {
// Try to identify the UTF-8 character that would go here
$utf8 = @iconv($iconvName, self::INPUT_ENCODING, chr($char));
if ($utf8 == '') {
continue;
}
if (iconv(self::INPUT_ENCODING, $iconvName, $utf8) !=
chr($char)) {
// Avoid non-canonical conversions (no known examples)
continue;
}
// Replace the ' ' with the correct character if we
found it
$charMap[$char - 128] = $utf8;
}
// Join into a 128-character string and return.
$charMapStr = implode("", $charMap);
assert(mb_strlen($charMapStr, self::INPUT_ENCODING) == 128);
return $charMapStr;
}
}
PK�"�[Z�;�
libraries/Escpos/CONTRIBUTING.mdnu�[���# How to contribute
This project is open to many different types of contribution. You can help
with improving the documentation and examples, sharing your insights on the
issue tracker, adding fixes to the code, providing test cases, or just
[writing about your hardware setup that you
use](https://github.com/mike42/escpos-php/issues/new).
## Issue tracker
Open issues of all sorts are tracked on the [issue
tracker](https://github.com/mike42/escpos-php/issues). Please check [the
FAQ](https://github.com/mike42/escpos-php/blob/development/doc/FAQ.md)
before you post, and practice good [bug tracker
etiquette](https://bugzilla.mozilla.org/page.cgi?id=etiquette.html) to keep
it running smoothly.
Issues are [loosely
categorised](https://github.com/mike42/escpos-php/labels), and will stay
open while there is still something that can be resolved.
Anybody may add to the discussion on the bug tracker. Just be sure to add
new questions as separate issues, and to avoid commenting on closed issues.
## Submitting changes
Code changes may be submitted as a "[pull
request](https://help.github.com/articles/about-pull-requests/)" at
[mike42/escpos-php](https://github.com/mike42/escpos-php). The description
should include some information about how the change improves the library.
The project is MIT-licensed (see
[LICENSE.md](https://github.com/mike42/escpos-php/blob/development/LICENSE.md)
for details). You are not required to assign copyright in order to submit
changes, but you do need to agree for your code to be distributed under
this license in order for it to be accepted.
### Documentation changes
The official documentaton is also located in the main repository, under the
[doc/](https://github.com/mike42/escpos-php/tree/development/doc) folder.
You are welcome to post any suggested improvements as pull requests.
### Release process
Once a pull request is accepted, it usually appears in a release a few days
later.
Branches:
- "development" is the most recent code, possibly containing
unreleased fixes
- "master" contains the most recently released code (old versions
are not maintained).
The release process for your changes is:
- Changes are submitted via pull request to the shared
"development" branch.
- A new release is staged on the "master" branch via another pull
request, and then tagged.
## Code style
This project uses the [PSR-2
standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)
for all PHP source code.
## Testing and CI
The tests are executed on [Travis
CI](https://travis-ci.org/mike42/escpos-php) over PHP 5.3, 5.4, 5.5, 5.7,
7, and HHVM. Earlier versions of PHP are not supported.
For development, it's suggested that you load `imagick`, `gd` and
`Xdebug` PHP exensions, and install `composer`.
Fetch a copy of this code and load dependencies with composer:
git clone https://github.com/mike42/escpos-php
cd escpos-php/
composer install
Execute unit tests via `phpunit`:
php vendor/bin/phpunit --coverage-text
Code style can be checked via
[PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer):
php vendor/bin/phpcs --standard=psr2 src/ -n
The developer docs are built with
[doxygen](https://github.com/doxygen/doxygen). Re-build them to check for
documentation warnings:
make -C doc clean && make -C doc
PK�"�[�PU\��
libraries/Escpos/CONTRIBUTORS.mdnu�[���# escpos-php contributors
This file contains a list of people who have made contributions of
code which appear in the public repository of escpos-php.
Main repository: [mike42/escpos-php](https://github.com/mike42/escpos-php)
([online contributor
list](https://github.com/mike42/escpos-php/graphs/contributors))
- [Michael Billington](https://github.com/mike42)
- [Alif Maulana El Fattah Nataly](https://github.com/alif25r)
- [Mareks Sudniks](https://github.com/marech)
- [matiasgaston](https://github.com/matiasgaston)
- [Mike Stivala](https://github.com/brndwgn)
- [Nicholas Long](https://github.com/longsview)
Via fork:
[wdoyle/EpsonESCPOS-PHP](https://github.com/wdoyle/EpsonESCPOS-PHP):
- [Warren Doyle](https://github.com/wdoyle)
Via fork: [ronisaha/php-esc-pos](https://github.com/ronisaha/php-esc-pos):
- [Roni Saha](https://github.com/ronisaha)
- [Gergely Radics](https://github.com/Gerifield)
- [vharo](https://github.com/vharo)
PK�"�[���1libraries/Escpos/Devices/AuresCustomerDisplay.phpnu�[���<?php
namespace Mike42\Escpos\Devices;
use Mike42\Escpos\Printer;
/**
* A class for sending ESC/POS-like code to an Aures customer display.
* The display has some features that printers do not, such as an ability
to "clear" the screen.
*/
class AuresCustomerDisplay extends Printer
{
/**
* Indicates that the text should wrap and type over
* existing text on the screen, rather than scroll.
*/
const TEXT_OVERWRITE = 1;
/**
* Indicates that overflowing text should cause the
* display to scroll vertically, like a computer terminal.
*/
const TEXT_VERTICAL_SCROLL = 2;
/**
* Indicates that overflowing text should cause the
* display to scroll horizontally, like a news ticker.
*/
const TEXT_HORIZONTAL_SCROLL = 3;
/**
*
* {@inheritdoc}
*
* @see \Mike42\Escpos\Printer::initialize()
*/
public function initialize()
{
// Select ESC/POS mode first
$this->selectEscposMode();
parent::initialize();
// ESC @ does not reset character table on this printer
$this->selectCharacterTable(0);
// Default to horizontal scroll mode. Behaves most like a printer.
$this->selectTextScrollMode(AuresCustomerDisplay::TEXT_VERTICAL_SCROLL);
}
/**
* Selects ESC/POS mode.
*
* This device supports other modes, which are not used.
*/
protected function selectEscposMode()
{
$this->connector->write("\x02\x05\x43\x31\x03");
}
/**
*
* @param int $mode
* The text scroll mode to use. One of
* AuresCustomerDisplay::TEXT_OVERWRITE,
* AuresCustomerDisplay::TEXT_VERTICAL_SCROLL or
* AuresCustomerDisplay::TEXT_HORIZONTAL_SCROLL
*/
public function selectTextScrollMode($mode =
AuresCustomerDisplay::TEXT_VERTICAL_SCROLL)
{
self::validateInteger($mode, 1, 3, __FUNCTION__);
$this->connector->write("\x1F" . chr($mode));
}
/**
* Clear the display.
*/
public function clear()
{
$this->connector->write("\x0c");
}
/**
* Instruct the display to show the firmware version.
*/
public function showFirmwareVersion()
{
$this->connector->write("\x02\x05\x56\x01\x03");
}
/**
* Instruct the display to begin a self-test/demo sequence.
*/
public function selfTest()
{
$this->connector->write("\x02\x05\x44\x08\x03");
}
/**
* Instruct the display to show a pre-loaded logo.
*
* Note that this driver is not capable of uploading a
* logo, but that the vendor supplies software
* which has this function.
*/
public function showLogo()
{
$this->connector->write("\x02\xFC\x55\xAA\x55\xAA");
}
/**
*
* {@inheritdoc}
*
* @see \Mike42\Escpos\Printer::text()
*/
public function text($str = "")
{
self::validateString($str, __FUNCTION__);
// Need to intercept line-feeds, since "\n" is
insufficient on this device.
foreach (explode("\n", $str) as $id => $line) {
if ($id > 0) {
$this->feed();
}
parent::text($line);
}
}
/**
*
* {@inheritdoc}
*
* @see \Mike42\Escpos\Printer::feed()
*/
public function feed($lines = 1)
{
self::validateInteger($lines, 1, 255, __FUNCTION__);
for ($i = 0; $i < $lines; $i ++) {
$this->connector->write("\r\n");
}
}
}
PK�"�[�#o,,#libraries/Escpos/Devices/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[ȥ�I=I=
libraries/Escpos/EscposImage.phpnu�[���<?php
/**
* This file is part of escpos-php: PHP receipt printer library for use
with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington <
michael.billington@gmail.com >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full
list.
*
* This software is distributed under the terms of the MIT license. See
LICENSE.md
* for details.
*/
namespace Mike42\Escpos;
use Exception;
use InvalidArgumentException;
/**
* This class deals with images in raster formats, and converts them into
formats
* which are suitable for use on thermal receipt printers. Currently, only
PNG
* images (in) and ESC/POS raster format (out) are implemeted.
*
* Input formats:
* - Currently, only PNG is supported.
* - Other easily read raster formats (jpg, gif) will be added at a later
date, as this is not complex.
* - The BMP format can be directly read by some commands, but this has
not yet been implemented.
*
* Output formats:
* - Currently, only ESC/POS raster format is supported
* - ESC/POS 'column format' support is partially implemented,
but is not yet used by Escpos.php library.
* - Output as multiple rows of column format image is not yet in the
works.
*
* Libraries:
* - Currently, php-gd is used to read the input. Support for imagemagick
where gd is not installed is
* also not complex to add, and is a likely future feature.
* - Support for native use of the BMP format is a goal, for maximum
compatibility with target environments.
*/
abstract class EscposImage
{
/**
* @var int $imgHeight
* height of the image.
*/
protected $imgHeight = 0;
/**
* @var int $imgWidth
* width of the image
*/
protected $imgWidth = 0;
/**
* @var string $imgData
* Image data in rows: 1 for black, 0 for white.
*/
private $imgData = null;
/**
* @var string $imgColumnData
* Cached column-format data to avoid re-computation
*/
private $imgColumnData = array();
/**
* @var array:string $imgRasterData
* Cached raster format data to avoid re-computation
*/
private $imgRasterData = null;
/**
* @var string $filename
* Filename of image on disk - null if not loaded from disk.
*/
private $filename = null;
/**
* @var boolean $allowOptimisations
* True to allow faster library-specific rendering shortcuts, false to
always just use
* image libraries to read pixels (more reproducible between systems).
*/
private $allowOptimisations = true;
/**
* Construct a new EscposImage.
*
* @param string $filename Path to image filename, or null to create an
empty image.
* @param boolean $allowOptimisations True (default) to use any
library-specific tricks
* to speed up rendering, false to force the image to be read in
pixel-by-pixel,
* which is easier to unit test and more reproducible between systems,
but slower.
*/
public function __construct($filename = null, $allowOptimisations =
true)
{
$this -> filename = $filename;
$this -> allowOptimisations = $allowOptimisations;
}
/**
* @return int height of the image in pixels
*/
public function getHeight()
{
return $this -> imgHeight;
}
/**
* @return int Number of bytes to represent a row of this image
*/
public function getHeightBytes()
{
return (int)(($this -> imgHeight + 7) / 8);
}
/**
* @return int Width of the image
*/
public function getWidth()
{
return $this -> imgWidth;
}
/**
* @return int Number of bytes to represent a row of this image
*/
public function getWidthBytes()
{
return (int)(($this -> imgWidth + 7) / 8);
}
/**
* Output the image in raster (row) format. This can result in padding
on the
* right of the image, if its width is not divisible by 8.
*
* @throws Exception Where the generated data is unsuitable for the
printer
* (indicates a bug or oversized image).
* @return string The image in raster format.
*/
public function toRasterFormat()
{
// Just wraps implementations for caching & lazy loading
if ($this -> imgRasterData !== null) {
/* Return cached value */
return $this -> imgRasterData;
}
if ($this -> allowOptimisations) {
/* Use optimised code if allowed */
$this -> imgRasterData = $this ->
getRasterFormatFromFile($this -> filename);
}
if ($this -> imgRasterData === null) {
/* Load in full image and render the slow way if no faster
implementation
is available, or if we've been asked not to use it */
if ($this -> imgData === null) {
$this -> loadImageData($this -> filename);
}
$this -> imgRasterData = $this -> getRasterFormat();
}
return $this -> imgRasterData;
}
/**
* Output the image in column format.
*
* @param boolean $doubleDensity True for double density (24px) lines,
false for single-density (8px) lines.
* @return string[] an array, one item per line of output. All lines
will be of equal size.
*/
public function toColumnFormat($doubleDensity = false)
{
// Just wraps implementations for caching and lazy loading
if (isset($this -> imgColumnData[$doubleDensity])) {
/* Return cached value */
return $this -> imgColumnData[$doubleDensity];
}
$this -> imgColumnData[$doubleDensity] = null;
if ($this -> allowOptimisations) {
/* Use optimised code if allowed */
$data = $this -> getColumnFormatFromFile($this ->
filename, $doubleDensity);
$this -> imgColumnData[$doubleDensity] = $data;
}
if ($this -> imgColumnData[$doubleDensity] === null) {
/* Load in full image and render the slow way if no faster
implementation
is available, or if we've been asked not to use it */
if ($this -> imgData === null) {
$this -> loadImageData($this -> filename);
}
$this -> imgColumnData[$doubleDensity] = $this ->
getColumnFormat($doubleDensity);
}
return $this -> imgColumnData[$doubleDensity];
}
/**
* Load an image from disk. This default implementation always gives a
zero-sized image.
*
* @param string $filename Filename to load from.
*/
protected function loadImageData($filename = null)
{
// Load image in to string of 1's and 0's, also set width
& height
$this -> setImgWidth(0);
$this -> setImgHeight(0);
$this -> setImgData("");
}
/**
* Set image data.
*
* @param string $data Image data to use, string of 1's (black)
and 0's (white) in row-major order.
*/
protected function setImgData($data)
{
$this -> imgData = $data;
}
/**
* Set image width.
*
* @param int $width width of the image
*/
protected function setImgWidth($width)
{
$this -> imgWidth = $width;
}
/**
* Set image height.
*
* @param int $height height of the image.
*/
protected function setImgHeight($height)
{
$this -> imgHeight = $height;
}
/**
* @param string $filename
* Filename to load from
* @return string|NULL
* Raster format data, or NULL if no optimised renderer is available
in
* this implementation.
*/
protected function getRasterFormatFromFile($filename = null)
{
// No optimised implementation to provide
return null;
}
/**
* @param string $filename
* Filename to load from
* @param boolean $highDensityVertical
* True for high density output (24px lines), false for regular
density (8px)
* @return string[]|NULL
* Column format data as array, or NULL if optimised renderer
isn't
* available in this implementation.
*/
protected function getColumnFormatFromFile($filename = null,
$highDensityVertical = true)
{
// No optimised implementation to provide
return null;
}
/**
* Get column fromat from loaded image pixels, line by line.
*
* @throws Exception
* Where wrong number of bytes has been generated.
* @return string
* Raster format data
*/
private function getRasterFormat()
{
/* Loop through and convert format */
$widthPixels = $this -> getWidth();
$heightPixels = $this -> getHeight();
$widthBytes = $this -> getWidthBytes();
$heightBytes = $this -> getHeightBytes();
$x = $y = $bit = $byte = $byteVal = 0;
$data = str_repeat("\0", $widthBytes * $heightPixels);
if (strlen($data) == 0) {
return $data;
}
do {
$byteVal |= (int)$this -> imgData[$y * $widthPixels + $x]
<< (7 - $bit);
$x++;
$bit++;
if ($x >= $widthPixels) {
$x = 0;
$y++;
$bit = 8;
if ($y >= $heightPixels) {
$data[$byte] = chr($byteVal);
break;
}
}
if ($bit >= 8) {
$data[$byte] = chr($byteVal);
$byteVal = 0;
$bit = 0;
$byte++;
}
} while (true);
if (strlen($data) != ($this -> getWidthBytes() * $this ->
getHeight())) {
throw new Exception("Bug in " . __FUNCTION__ .
", wrong number of bytes.");
}
return $data;
}
/**
* Get column fromat from loaded image pixels, line by line.
*
* @param boolean $highDensity
* True for high density output (24px lines), false for regular
density (8px)
* @return string[]
* Array of column format data, one item per row.
*/
private function getColumnFormat($highDensity)
{
$out = array();
$i = 0;
while (($line = $this -> getColumnFormatLine($i, $highDensity))
!== null) {
$out[] = $line;
$i++;
}
return $out;
}
/**
* Output image in column format. Must be called once for each line of
output.
*
* @param string $lineNo
* Line number to retrieve
* @param string $highDensity
* True for high density output (24px lines), false for regular
density (8px)
* @throws Exception
* Where wrong number of bytes has been generated.
* @return NULL|string
* Column format data, or null if there is no more data (when
iterating)
*/
private function getColumnFormatLine($lineNo, $highDensity)
{
// Currently double density in both directions, very experimental
$widthPixels = $this -> getWidth();
$heightPixels = $this -> getHeight();
$widthBytes = $this -> getWidthBytes();
$heightBytes = $this -> getHeightBytes();
$lineHeight = $highDensity ? 3 : 1; // Vertical density. 1 or 3
(for 8 and 24 pixel lines)
// Initialise to zero
$x = $y = $bit = $byte = $byteVal = 0;
$data = str_repeat("\x00", $widthPixels * $lineHeight);
$yStart = $lineHeight * 8 * $lineNo;
if ($yStart >= $heightPixels) {
return null;
}
if (strlen($data) == 0) {
return $data;
}
do {
$yReal = $y + $yStart;
if ($yReal < $heightPixels) {
$byteVal |= (int)$this -> imgData[$yReal * $widthPixels
+ $x] << (7 - $bit);
}
$y++;
$bit++;
if ($y >= $lineHeight * 8) {
$y = 0;
$x++;
$bit = 8;
if ($x >= $widthPixels) {
$data[$byte] = chr($byteVal);
break;
}
}
if ($bit >= 8) {
$data[$byte] = chr($byteVal);
$byteVal = 0;
$bit = 0;
$byte++;
}
} while (true);
if (strlen($data) != $widthPixels * $lineHeight) {
throw new Exception("Bug in " . __FUNCTION__ .
", wrong number of bytes.");
}
return $data;
}
/**
* @return boolean True if GD is loaded, false otherwise
*/
public static function isGdLoaded()
{
return extension_loaded('gd');
}
/**
* @return boolean True if Imagick is loaded, false otherwise
*/
public static function isImagickLoaded()
{
return extension_loaded('imagick');
}
/**
* This is a convinience method to load an image from file,
auto-selecting
* an EscposImage implementation which uses an available library.
*
* The sub-classes can be constructed directly if you know that you
will
* have Imagick or GD on the print server.
*
* @param string $filename
* File to load from
* @param string $allow_optimisations
* True to allow the fastest rendering shortcuts, false to force the
library
* to read the image into an internal raster format and use PHP to
render
* the image (slower but less fragile).
* @param array $preferred
* Order to try to load libraries in- escpos-php supports pluggable
image
* libraries. Items can be 'imagick', 'gd',
'native'.
* @throws Exception
* Where no suitable library could be found for the type of file being
loaded.
* @return EscposImage
*
*/
public static function load(
$filename,
$allow_optimisations = true,
array $preferred = array('imagick', 'gd',
'native')
) {
/* Fail early if file is not readble */
if (!file_exists($filename) || !is_readable($filename)) {
throw new Exception("File '$filename' does not
exist, or is not readable.");
}
$ext = pathinfo($filename, PATHINFO_EXTENSION);
/* Choose the first implementation which can handle this format */
foreach ($preferred as $implemetnation) {
if ($implemetnation === 'imagick') {
if (!self::isImagickLoaded()) {
// Skip option if Imagick is not loaded
continue;
}
return new \Mike42\Escpos\ImagickEscposImage($filename,
$allow_optimisations);
} elseif ($implemetnation === 'gd') {
if (!self::isGdLoaded()) {
// Skip option if GD not loaded
continue;
}
return new \Mike42\Escpos\GdEscposImage($filename,
$allow_optimisations);
} elseif ($implemetnation === 'native') {
if (!in_array($ext, array('wbmp',
'pbm', 'bmp'))) {
// Pure PHP is fastest way to generate raster output
from wbmp and pbm formats.
continue;
}
return new \Mike42\Escpos\NativeEscposImage($filename,
$allow_optimisations);
} else {
// Something else on the 'preferred' list.
throw new
InvalidArgumentException("'$implemetnation' is not a known
EscposImage implementation");
}
}
throw new InvalidArgumentException("No suitable EscposImage
implementation found for '$filename'.");
}
}
PK�"�[�GW���"libraries/Escpos/GdEscposImage.phpnu�[���<?php
/**
* This file is part of escpos-php: PHP receipt printer library for use
with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington <
michael.billington@gmail.com >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full
list.
*
* This software is distributed under the terms of the MIT license. See
LICENSE.md
* for details.
*/
namespace Mike42\Escpos;
use Mike42\Escpos\EscposImage;
use Exception;
/**
* Implementation of EscposImage using the GD PHP plugin.
*/
class GdEscposImage extends EscposImage
{
/**
* Load an image from disk, into memory, using GD.
*
* @param string $filename The filename to load from
* @throws Exception if the image format is not supported,
* or the file cannot be opened.
*/
protected function loadImageData($filename = null)
{
if ($filename === null) {
/* Set to blank image */
return parent::loadImageData($filename);
}
$ext = pathinfo($filename, PATHINFO_EXTENSION);
switch ($ext) {
case "png":
$im = @imagecreatefrompng($filename);
break;
case "jpg":
$im = @imagecreatefromjpeg($filename);
break;
case "gif":
$im = @imagecreatefromgif($filename);
break;
default:
throw new Exception("Image format not supported in
GD");
}
$this -> readImageFromGdResource($im);
}
/**
* Load actual image pixels from GD resource.
*
* @param resource $im GD resource to use
* @throws Exception Where the image can't be read.
*/
public function readImageFromGdResource($im)
{
if (!is_resource($im)) {
throw new Exception("Failed to load image.");
} elseif (!EscposImage::isGdLoaded()) {
throw new Exception(__FUNCTION__ . " requires
'gd' extension.");
}
/* Make a string of 1's and 0's */
$imgHeight = imagesy($im);
$imgWidth = imagesx($im);
$imgData = str_repeat("\0", $imgHeight * $imgWidth);
for ($y = 0; $y < $imgHeight; $y++) {
for ($x = 0; $x < $imgWidth; $x++) {
/* Faster to average channels, blend alpha and negate the
image here than via filters (tested!) */
$cols = imagecolorsforindex($im, imagecolorat($im, $x,
$y));
// 1 for white, 0 for black, ignoring transparency
$greyness = (int)(($cols['red'] +
$cols['green'] + $cols['blue']) / 3) >> 7;
// 1 for black, 0 for white, taking into account
transparency
$black = (1 - $greyness) >> ($cols['alpha']
>> 6);
$imgData[$y * $imgWidth + $x] = $black;
}
}
$this -> setImgWidth($imgWidth);
$this -> setImgHeight($imgHeight);
$this -> setImgData($imgData);
}
}
PK�"�[#Ռm'm''libraries/Escpos/ImagickEscposImage.phpnu�[���<?php
/**
* This file is part of escpos-php: PHP receipt printer library for use
with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington <
michael.billington@gmail.com >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full
list.
*
* This software is distributed under the terms of the MIT license. See
LICENSE.md
* for details.
*/
namespace Mike42\Escpos;
use Exception;
use Imagick;
use Mike42\Escpos\EscposImage;
/**
* Implementation of EscposImage using the Imagick PHP plugin.
*/
class ImagickEscposImage extends EscposImage
{
/**
* Load actual image pixels from Imagick object
*
* @param Imagick $im Image to load from
*/
public function readImageFromImagick(\Imagick $im)
{
/* Strip transparency */
$im = self::alphaRemove($im);
/* Threshold */
$im -> setImageType(\Imagick::IMGTYPE_TRUECOLOR); // Remove
transparency (good for PDF's)
$max = $im->getQuantumRange();
$max = $max["quantumRangeLong"];
$im -> thresholdImage(0.5 * $max);
/* Make a string of 1's and 0's */
$imgHeight = $im -> getimageheight();
$imgWidth = $im -> getimagewidth();
$imgData = str_repeat("\0", $imgHeight * $imgWidth);
for ($y = 0; $y < $imgHeight; $y++) {
for ($x = 0; $x < $imgWidth; $x++) {
/* Faster to average channels, blend alpha and negate the
image here than via filters (tested!) */
$cols = $im -> getImagePixelColor($x, $y);
$cols = $cols -> getcolor();
$greyness = (int)(($cols['r'] +
$cols['g'] + $cols['b']) / 3) >> 7; // 1 for
white, 0 for black
$imgData[$y * $imgWidth + $x] = (1 - $greyness); // 1 for
black, 0 for white
}
}
$this -> setImgWidth($imgWidth);
$this -> setImgHeight($imgHeight);
$this -> setImgData($imgData);
}
/**
* @param string $filename
* Filename to load from
* @param boolean $highDensityVertical
* True for high density output (24px lines), false for regular
density (8px)
* @return string[]|NULL
* Column format data as array, or NULL if optimised renderer
isn't
* available in this implementation.
*/
protected function getColumnFormatFromFile($filename = null,
$highDensityVertical = true)
{
if ($filename === null) {
return null;
}
$im = $this -> getImageFromFile($filename);
$this -> setImgWidth($im -> getimagewidth());
$this -> setImgHeight($im -> getimageheight());
/* Strip transparency */
$im = self::alphaRemove($im);
$im -> setformat('pbm');
$im -> getimageblob(); // Forces 1-bit rendering now, so that
subsequent operations are faster
$im -> rotateImage('#fff', 90.0);
$im -> flopImage();
$lineHeight = $highDensityVertical ? 3 : 1;
$blobs = $this -> getColumnFormatFromImage($im, $lineHeight *
8);
return $blobs;
}
/**
* Load an image from disk, into memory, using Imagick.
*
* @param string $filename The filename to load from
* @throws Exception if the image format is not supported,
* or the file cannot be opened.
*/
protected function loadImageData($filename = null)
{
if ($filename === null) {
/* Set to blank image */
return parent::loadImageData($filename);
}
$im = $this -> getImageFromFile($filename);
$this -> readImageFromImagick($im);
}
/**
* Return data in column format as array of slices.
* Operates recursively to save cloning larger image many times.
*
* @param Imagick $im
* @param int $lineHeight
* Height of printed line in dots. 8 or 24.
* @return string[]
*/
private function getColumnFormatFromImage(Imagick $im, $lineHeight)
{
$imgWidth = $im->getimagewidth();
if ($imgWidth == $lineHeight) {
// Return glob of this panel
return array($this -> getRasterBlobFromImage($im));
} elseif ($imgWidth > $lineHeight) {
// Calculations
$slicesLeft = ceil($imgWidth / $lineHeight / 2);
$widthLeft = $slicesLeft * $lineHeight;
$widthRight = $imgWidth - $widthLeft;
// Slice up (left)
$left = clone $im;
$left -> extentimage($widthLeft, $left ->
getimageheight(), 0, 0);
// Slice up (right - ensure width is divisible by lineHeight
also)
$right = clone $im;
$widthRightRounded = $widthRight < $lineHeight ? $lineHeight
: $widthRight;
$right -> extentimage($widthRightRounded, $right ->
getimageheight(), $widthLeft, 0);
// Recurse
$leftBlobs = $this -> getColumnFormatFromImage($left,
$lineHeight);
$rightBlobs = $this -> getColumnFormatFromImage($right,
$lineHeight);
return array_merge($leftBlobs, $rightBlobs);
} else {
/* Image is smaller than full width */
$im -> extentimage($lineHeight, $im -> getimageheight(),
0, 0);
return array($this -> getRasterBlobFromImage($im));
}
}
/**
* Load Imagick file from image
*
* @param string $filename Filename to load
* @throws Exception Wrapped Imagick error if image can't be
loaded
* @return Imagick Loaded image
*/
private function getImageFromFile($filename)
{
$im = new Imagick();
try {
$im->setResourceLimit(6, 1); // Prevent libgomp1 segfaults,
grumble grumble.
$im -> readimage($filename);
} catch (ImagickException $e) {
/* Re-throw as normal exception */
throw new Exception($e);
}
return $im;
}
/**
* Pull blob (from PBM-formatted image only!), and spit out a blob or
raster data.
* Will crash out on anything which is not a valid 'P4' file.
*
* @param Imagick $im Image which has format PBM.
* @return string raster data from the image
*/
private function getRasterBlobFromImage(Imagick $im)
{
$blob = $im -> getimageblob();
/* Find where header ends */
$i = strpos($blob, "P4\n") + 2;
while ($blob[$i + 1] == '#') {
$i = strpos($blob, "\n", $i + 1);
}
$i = strpos($blob, "\n", $i + 1);
/* Return raster data only */
$subBlob = substr($blob, $i + 1);
return $subBlob;
}
/**
* @param string $filename
* Filename to load from
* @return string|NULL
* Raster format data, or NULL if no optimised renderer is available
in
* this implementation.
*/
protected function getRasterFormatFromFile($filename = null)
{
if ($filename === null) {
return null;
}
$im = $this -> getImageFromFile($filename);
$this -> setImgWidth($im -> getimagewidth());
$this -> setImgHeight($im -> getimageheight());
/* Convert to PBM and extract raster portion */
$im = self::alphaRemove($im);
$im -> setFormat('pbm');
return $this -> getRasterBlobFromImage($im);
}
/**
* Load a PDF for use on the printer
*
* @param string $pdfFile
* The file to load
* @param string $pageWidth
* The width, in pixels, of the printer's output. The first page
of the
* PDF will be scaled to approximately fit in this area.
* @throws Exception Where Imagick is not loaded, or where a missing
file
* or invalid page number is requested.
* @return multitype:EscposImage Array of images, retrieved from the
PDF file.
*/
public static function loadPdf($pdfFile, $pageWidth = 550)
{
if (!EscposImage::isImagickLoaded()) {
throw new Exception(__FUNCTION__ . " requires imagick
extension.");
}
/*
* Load first page at very low density (resolution), to figure out
what
* density to use to achieve $pageWidth
*/
try {
$image = new \Imagick();
$testRes = 2; // Test resolution
$image -> setresolution($testRes, $testRes);
/* Load document just to measure geometry */
$image -> readimage($pdfFile);
$geo = $image -> getimagegeometry();
$image -> destroy();
$width = $geo['width'];
$newRes = $pageWidth / $width * $testRes;
/* Load entire document in */
$image -> setresolution($newRes, $newRes);
$image -> readImage($pdfFile);
$pages = $image -> getNumberImages();
/* Convert images to Escpos objects */
$ret = array();
for ($i = 0; $i < $pages; $i++) {
$image -> setIteratorIndex($i);
$ep = new ImagickEscposImage();
$ep -> readImageFromImagick($image);
$ret[] = $ep;
}
return $ret;
} catch (\ImagickException $e) {
/* Wrap in normal exception, so that classes which call this do
not
* themselves require imagick as a dependency. */
throw new Exception($e);
}
}
/**
* Paste image over white canvas to stip transparency reliably on
different
* versions of ImageMagick.
*
* There are other methods for this:
* - flattenImages() is deprecated
* - setImageAlphaChannel(Imagick::ALPHACHANNEL_REMOVE) is not
available on
* ImageMagick < 6.8.
*
* @param Imagick $im Image to flatten
* @return Imagick Flattened image
*/
private static function alphaRemove(Imagick $im)
{
$flat = new \Imagick();
$flat -> newImage($im -> getimagewidth(), $im ->
getimageheight(), "white", $im -> getimageformat());
$flat -> compositeimage($im, \Imagick::COMPOSITE_OVER, 0, 0);
return $flat;
}
}
PK�"�[�#o,,libraries/Escpos/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[���libraries/Escpos/LICENSE.mdnu�[���MIT
License
Copyright (c) 2014-2016 Michael Billington, incorporating modifications by
others.
See CONTRIBUTORS.md for a full list.
Permission is hereby granted, free of charge, to any person obtaining a
copy
of this software and associated documentation files (the
"Software"), to deal
in the Software without restriction, including without limitation the
rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE
SOFTWARE.
PK�"�[�g�j__&libraries/Escpos/NativeEscposImage.phpnu�[���<?php
/**
* This file is part of escpos-php: PHP receipt printer library for use
with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington <
michael.billington@gmail.com >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full
list.
*
* This software is distributed under the terms of the MIT license. See
LICENSE.md
* for details.
*/
namespace Mike42\Escpos;
use Mike42\Escpos\EscposImage;
/**
* Implementation of EscposImage using only native PHP.
* TODO: wbmp, pbm, bmp files.
*/
class NativeEscposImage extends EscposImage
{
}
PK�"�[V"t�4�4<libraries/Escpos/PrintBuffers/cache/Characters-default.ser.znu�[���x��isG������Z�_c��D8f��q#nttE���Z�}�j'-6ȋ�"@�)O/��:=ݜ�v���;D���PV
a�D��Y����7�9�x{�w�<�i୷���������|{`S�*�xkzG��=}?|w`��;=��d�{�����{(�Y�iB��M4�}�Q��E?Z���#ZՑަzDQO�>^s���U}\��Ξw;���m����]�]���(�u�қn����H�P\r�ߓl(�G�����}�k"�G��
{1��H\]㑸�]s#�-��L2���M��4�1F7���v�f۶ʚeWk
xO;���*��U~߃ε��:G2�Q��������L�LF��>���!Nd
�<�9�dkŨ�]˟���V�,B6���G'#6��.e҆����ov�wc]�74�x��_�qެ�����S�;�o_��C��p�N�Uy8��3'�dbw�����U�$�cc7�n��8�!1�s\ssp5ޒ��*o�Z��<��1��
���P@_��ӗ��X_�ݝ^�I�f�&]ɠ�1QZ��qH|���ħHf�f|���OZ�}�t6y�έ�*���uCe�t��Y�}ѣ�Z�6_.���X�ZG����74���v_�K�҈]�.Տ�o�7\cÝ;\c;�o���W�.���
>�|;~��?�·_�8�9�y
�����ҩ����v.�m|��ՊccܷTq�6��f�-����}�ྥ�����n��;�·�<S2�y]��y]��y]:�y]:�y]��y]��N
s����·_j�����c�|��v>|����·_o�&�X璟����ۑ��l�l�.�����^�}��X��u�g�rD��?܊S�[M��g�}"}
�3�#13�oq.�ʷlY�����NJ\moppf�L��Uy˱Uy˵Uy˃�����w��
q�bRo!5H�N�a+����3>�d�of|�'�:�� Us7MZMݧ��l�r�R�e�/��b�5r6�䏤������7L�M0���T��*��|�i�Y�ÞxZB'?�M������kQYi�Z)3;�۴'��L�E��I5ē�4��S���%�����-�U�i����6g$Zu*��y��LOHuhݮ��|h�;��?����
O[�d��r�fu`z�y�`�
���_6�+~���u�a�7
����6�;>a�w
����7����c�4�Ox���Sf���φ|����j��|���0���w�1�����?h�|�����1�~��
����0�~�O��z�����P��ǩ���{�����=���-�U���8�Q���^Vh�����!�#��a��}Iz���C�=��^u���j�'w��:C�/h�=�Q'�$y�5~ް]�73<,F�%���$9����-(�ug��o�Z����[ԉW���6���=�:9�<&Ým���˓{Jap�]3��o��y��گ��n�������\���-Zn�u�iz��Z'Z
���ϔ����<��}h�Jwm�ӡ�XyO?���u���g�����-���F:�:M1=�N�T���Am�n%逸�<5�0{*�N5�⒘��&�9i~?s���5y�x�"+C����y��,�$��$�P.������{����79ϫ9��/�\3ٸgBW���
��ku%~�z.�*�T�LH���������g�o[8ѱ�
�Aq�y/�si%o2�����M�$or4y���M�'or"y��ɛ�J��t�&g�79��ɹ�M.&or)y�+ɛ\M�䞯F�Dd��O��Gɛ<N�d2y�l�&Sɛ�7y�����M�%o�<q���ɛ'o�-y�ɛ�L�dW�A���ɭ�Mn'�����r'�[F�7ٛ�ɞ�M�%���ɛ$_cNk���L>/N#�?y��ɛ�H�$?$W�_3���jn�]s8v�-�kn�]s[��c������5wŮ�;v�=�k�Į�7v�}�k�]�@�c�<��h�c�k�]�H�Gc�<��x��c�<����5OŮy:v�3�j����$�`]9c�����^�����zQ�jKw�o��6���k�Ck�
�L5��Ql$��-m#sԸf#sԸf#U�D���'�$�q�����,����|?h{�y��;��՞w�]�!=�*�ZZR/��Γ�1�� tsb��Y<�(�J���9|Avվ�P�����t��S������G��;+؊6-�Sk���k�6F��c��Ϊ"��H�c�U��sm�S���)�dz����&��ʩ'%?k�?���Ҿ�p>�t0E�C)ڎ�h;����m��h{4E�c)ڎ�h{<E�)ڞL�T���S�=����mϥh{>E�)�^L�R���S������m��h{=E�)��L�V���S�����D��wS�����m�h�0E�G)�>N�v2E�l��S)��R�}����m��h�����m7�h;���m��h�-E��)��H�vg���R�ݝ��mGR�ݛ��m����42�f���ߪG��^7��IiG�M���(s}���OǪ�z�Rl��w��XY��55�a�Kco�p���x0v�l�)lO�6{��b�|����s<�|�H�b�^�]ss��ڛ���m��h{,E��s7��#)���r)��I�6�~�rն��\�Ҡ�m�h{��m�i�`�}���S�#�3O�~��5oǮ�h��.����3v�b�<��D���|y*v���h�p�ܑ�ɱ�O��������X5����&�+�2=��a�`�U��*�fl�
vX;��]V�n�`�U0b�
�Y���V�A��U0j�Y���#V�Q��U0n�
NX'��SV�i��Up�*8g��
.X��KV�e��Up�*�f\�
nX7��[V�m��U0aܵ
�Y���V�C��U��*��
�V��U��(�Y�n�Z�=k��۳�n�Z�=k��۳�n�Z�=k��۳�n�Z�=k��۳�n�Z�=k��۳�n�Z�=k��۳�n�Z�=�H�/��vus�zf���X��ң����m�@�9��Up�*xhܱ
[W��kV�
��Up�*�YO���Q��ll�
�Y�xn��a�jPP�Zc��c�
�Z�V�a��Up�*�
NYg�K
r'�K�r��nu�a���@s֒�Y+7g Z�|�%�9K�s���L!h��Z묯�Bِ^�;+Up�§��=���V��Up�*x`ܶ
Y����V�u��Up�*��
�X�FAn�*�
�Z�xf��n�lPPUk��v[�����U0f�
XǬ��V�i�����q���\��[Uk�[4g-霵rs���̗[R���<g�l��Fz��7�Z���p!��hD�⑨
G�^q#� {��p>��PT��Q�>�p;�+�EU��C�Hމz��
�s1ՇGQGU�EUx���QO8��m���p�?� 1�fy4�3��~�a�C'7l��P�o�����=q��~���x���{��~����<��{���d�F��p&�w�[�r���l��p0�¡�
�QƢ*��p$��Ѩ
Ǣ*�GU8U�DT��QNEU8U�LT��Q�EU8U�BT��Q.EU�U�JT��Q�EU��R�%��X��(��
rV��`j�*�j�
�[����KC3_��Ȣ�_hy�z�9��R�w-�5�F���
���_4p�?�
���_5�k�R8h���A�k��C�
k��L仆�Gn�
�X۬��m��c�
�[0j�
NXg��FK�-h�f�kq�:�����;V�}��RkS����Lg�Z9sέ��Yګ�����5���>g�}Κ��5�9k�s���)�YS���8gN�S�ňU`Y��%r9K�g��:a#'��NvLez�*��
�Y��|�,�[�j
Xf3����t��`�����W��[�V�w���܄��5�{~��Cd�
|��>e�9b�O
���?o�W�|���7�b�oŘߊ1��F�[]pC��%�.��W�Q�!�X�lc��v?f�;
���_3�
p�G���Ɠ����77����y�`�
���_6�+~�����n�7����2��n��� �k����?0������6o��c.��j��ܐ��nH��.�m�{���WqC���~?`���+��B�v��l��.
�Ѹ���xDg�����|��6�_3��s�m�9��F�q��y�`�w��o������Ty]�Zf��f�K���K����[�x�f�k0p��\�g=`�%�p�v\���7<`�U�
p�������`�����vy���p`�x���<`��y���x���x�8�I8�y���8 �4����J-�pګ����5�<�,�-8p��Ly���p�\�gL�e�q��J�Gx�5�0���z�
�M����6Su����B��BF=��ذ����<9Lo
aN a<r�C&�0�Y!�yJ�Q� 9�!O��Ğ
9�!����s!c�$�}!LU^�2�!!L_Q�9�!/��������Ï���>�ܿ�V{%�o�D��A�f���JBX e!Hqy-䘇|*�u����xE�7�q��BF<�V�N�\�_����B��a�� ����ʂ��|ԗ0�3���ϩ��~�X?�_R���g�~
����E�o����u;Y���k���
�����E�]�����S�����a-����~��c��?�� ��:��+Ux��T�d3��?i���/-
���T��o
���%���iz�D��b{ʷ���/>Ey�º�
�Q�(���$��pYB}EB}U�xM�v]�xC
���-!��B�Bw�0KBX3w�0�`��aI?}(��HI���
��O ���`���?��C� a�a���2���C����A�LAm�@)�B��B`�A�>�H�n�X�y)��J�^�D�>q��!(�(DY�fV���L�B�+� ��� ��T��|煠u��d���|.��/B�=?���L�O]œ�n���[�i�����f�`�~�vPU��Nl����
@�G�����l��v7�Su$��ض�8U��ɝ�0�)`g0�����z@���X�9�e[���R����&�bo��s�4͔�Y�F��,MC��,Mc����4���4&���4k���4����4���(�J��{�<��H�"���)
!��
���kLm�mRf�G�]��.)����.�x��Y�%s������L�a3�p����L�Sa]�L�&��5��
�%����Lٰ�
�`3]L L��|��^i���*RZ� ����&#,�]_�O\z��ޮ���{���k=�AI�DF<p].�*&Ú�Ɉ��L����b�L�ݒ�;��>���dP�-c2�{ �碽DF;��DF�"#�/"�3Dd�\��v���Z�c�2�.��2ƹ�d�L��t.������#K7��l&���2�.��2��.��2��e2뗘̺�.��Am�_==�����T����(���?Y[sg�H'질�Y]�S�������tsg��3b��Έ�ȝ���I�a��Ɍa���:jYfL滝��9h%h��LC;�q����0�� �p�zh�,��a�����8�
��=������p�D�xh��J�v8�dh��:��a�@;��!�����0������v��C;�1��a�A;V-��a B;(��2C;����C;���
���3eh��QЎ�4�C�(h�ڡ-�c�Aw}.]��`2���xH���>��Ø����8l@�&308��'����5�\`p�\f
}��(�|.(�\Ȋ÷@V:&����8���@�w�T��$�_������p��YDp�<��G��a�X8L����c,��|�a�8L����Yp�<�g��a�8L�� �ɳD�����38L��ɣ*�0y4&�����3p�<��Ǧ(E�ɳ^�0yV�R`�0r�`�0y�&v��î���,�!zvN]���g��/��D��W<
����'�}8��q�c>�`�}8��q��}>���u',�a=r7,��G`�J�S�
#xJ��H!�)���@F����}�՚��֪�g��sd�=d�}d$��L
#F��6B�G�����!�#d�cd�%2�
��/��~m��h#�_D!�
���F�#D���F��6B�����
��9�OD���O\�z��C���@<��v���vh���K��_
����@=�v
��d��C����h6ڡ��C�/|$�nqxH2H��_��
��4�Ρ�N�C(��N17�&"{���@]��2�X���S��;(�zE&�JVآ*��V!H�6!�v!H��%C�SUX���"O٭*,XE��*�,�}j�":(MtH�fT�fL{��BЛG��8a
/y�1�l�1P�"#s\OA�
E^W(��U �7��
S���!|cb���1+;6poF�h����҂LM�FQ��m-� r�B� �&ȝj�yO� r�B��7i��L&M�����4A�h��C��� ��@�&(֩(J�Z�LM0���4A�Qh����-� �@��&(lMP�BG��M�E> \����6(|��+|�#SbU<%pF�&�
oP�ޠ��A�x�����U,%p�E�&P�P
�C��B)��R�
��?JA��V(��S���V����?[Aر��Aq}x�"��M�7L���<�Aakx���Ś�@�佀7(oP\�0���7(ޠx��e�t�?��Q��bC
�RBx�S��%�^QBx�S��%�?E �OQBx�%�?E �R��%�FQBx`%�?E �OQBx�S��%�?E �OQBx�S��%�?E �OQBx`%�?E �|��%��QBx�%�?E ၌��H ၌��H ၌��H ၌��H ၌��H ၌��H)�(!<��R8ţ��@FJd���tc-�Xˠ�T��iu��y)Cn!/eD �R��B^�t�R��B^ʐ[�Kry)2��R��B^ʐ[�K����!���2��R��B^J|>䥌,C^J|-������8�K釼��䥌d�8в��@�?~�ec���1��o1sT�,K3G����J3G���3sT�d3G��3
0e���S�PB`�L5������Zd�<A�y�4����V�uL����
#7��V���3G�H? 0
F�ߎ����R�[��Z�q��
@]�#���])tx�j�Y��R�!8Y
�3G��q��RD�ƿ߭�Ziu�j�����4$+M$��d�&+E�
Y�/�"�3d��[�,�"��J{�~�"�?��%π��d�
+/Y���Lg[�Z_�|����i)��J�&��&�ɬ��ٴa�@N}Lf-�
u�
?�Dџ�:;/�u~AH���H���l���!��U!P�kB��ׅ��n SA�����-vG�pB��,�=!�}!�!�C!p�GB�����X&��X�B�SB̜�!,��B��τ��a��'���f^�fZ&�
zX�����@��C!Xя��)�X������'B�!�v3BPV%!袲|l�B
�����?���3!�9!(ӊ��vB`�o��(�)H6��w��V�E{y �G H l�]$��w����E;z l�]$��w����E�z l�]$��w����E��!$��w����7���Zz�B������_�v�.�����7�w��gI3���}������ �ުy\���ҋ�U҆���Gl���e���V�b�VI�����f��/�PB:d�F��I��
A�sB�'BէBPτ
�/����S�����>��X�KaYt�+UaC��0*˻K���@�}�C�
a�_A�?�sP.��⭍ڸ�*H7���Sl5���A�\E�TUdQ|�N��@���s!��/�
�����JK��B���H��L�o��F�]b�;!a��h墪��`�EFXqT��Wj��ZH
��E��? A�,�W�Eb�W!L�߄
B��T�*L�r&VoO@Wa��M
P�LMz���9��$Jy�����~��r@|]�ejr>���=_W�_W�%}]���
]��*h��� ������*Lľ�B���
���*]�
���*V����HW�|]��uc��*���U�_W��u�D�
��*�A�����B����e$]Y�u4D�
%#]��u��u�u��U_W��}]��u[_W���uk��U�_W����P���b�IW1��U<��U,>_W�@}]�r�u���*^��*���U����!_W�D�����B6=]�ӱ��e����fؤ��0��P��X�
���6�.6)`A�MZq�G���&K�&q��a�V�,����M
(?�&��6�ϝ��|�M�����ʰ+�e�,���8R'�M]"n�0��&�����huܤ��*n��팸I5IܤȲ쌸I1�)R�Pq���&�*�&�Iq؟�&�w�&Ed�Q�ydj��9)�X3r��u
�9)�����!9)���X�DN�"'�"',�b6
(���?����XR_ �>5u�Gf�=?���̠*Q�
a)�/)��*wF����rg��ʊ���YdJTer!,�0a)�@
,ʿQ�*��RF8���$BX�L�Ua0�2�P���
,eȆU�@Xʬ9%�"�e
)Q�M���h+Q
�EiPJT�AX�l�DU��R�*�DU��EiaJT�*(QæDU�U�9JTe��W���DU�U�%���;��(����f���u�+��n5_Q0|Ei�WJ0^����;����y(i��,{�����+J���(���<|����+J̇�(��y�'�C)�6[QV��R�[ѱ%�bY`+:G��T$
���JJ�~�Vt����y؊Z�V��[�q%�2��[Q֦�V����TdE��JE�����)+���R��ph
�CY�P���(�����*��w��xT�RR1�P�?k�o%Ƶ���J���h��\���TW�*������CW��"�|+�{S�}_�[�W���&�{��{�f�������c uo��J�ʬP�J�xp%|<�>\ ���2����J�xp%|<�>\ ���W�ǃ+�����J�xp%|<�>\ ���W�ǃ+,"�L%|<�>\ ���W�ǃ+��ѿ�;BV��
y�2,2]V��(L�3�T�Ke�t�L��t�L��xTf���7�ұ�p76�t��c[�V�h�?�K�u�̷A5����r�%��[Kh�Df�N�
A��f5�0�FW �[�0����F�f#�
��AՁ#���,��aQ�ym��9.��q!�:%�w+�%p�)S�����T8y3�b5�
���YW��c�&�|]�62>��8� �% �-I�>{�6w`�����o!��:$��a#��]�@�ACsR��E%�?N�_T�9W��%�r��!~_���Ĵ\�}�ʢ��!O�B���`�>#�X��R�JS��&��D�A(KB����"�B�g�ud�S!��gB��p�E�a��0�B��7L2K�s��j��
��DO�w
�XkZT.�Bx̗B���T�\S�!L�/�01���Z�!Ly��:��[� kZT��p/]Y��d��B�T�b.LF�����k!��?
�f�I���Bг����b���F�?����*�p/*��į�`>qr����@�
���I`�e���m�2��x���Gk���
��o���u�8-t�,;��eׅ�8-��pZ(m���Q6��X�T]������,t=/D@o����]����,t57>mC�Y�jn|���T]͍�BWs�.�:pY��5wYdj� �&�ph�� �&��V���qREt�x8+25���*���;�UQ�i&UDw��*���I��TݵN���Z'UD�fRE��'UD;REt�y�SE�_�h3��{[�{Bש�=�����S�{�&� ]��{Bש��u�rO�{��{B^��N�TyE�@��N�+��C̼�L�
�d�h�I��n`7�Zu%;�"���W��w2E�.mׅ��$tG{|�Ħ@x��+1�����S�sY�LE���+���"Ss�LE��]A�]AX`*:S�M^��,�ԪCY
��`*:<S)�J�����
|�`_F1�R��@��
��R�]RI��
^'2�L%��e�@�CPtY����1�:P���'��W���45XRj0Q0����]�KR��5X�S��9^]���O�P]9��6�(��@It��$�*x��%��
^�Gq�W��-Є��[���VD_�+�t�Eѵ_
��Nu"�g�Ft���� Ȱ� ѡN�H�U�:���
^��`#uW���7�H�U�p6�;?`#:�c�XB�]�Fꮂ�5����a#uW��.1؈.��L3��e�W���6Ȉn=[&#}�d�KF�����KS%����0����Fdlu$m�T��@��4�<��&~�F<6����ט`#��"�8l���4�6�a����H��il���4��l�Gw��ז��w�f0@W��\3�+�_���J��<����A��ĉ��vS}J�]IL�r�`��D�r�,�
�����3:#��0�3���f�tF
�$�?\�ן�'|]=�l����"C8I��7���!%�_�����멈�A!(�CBP��BP�cB0(�$���ޝ5ZA=�b/��!�=ܣ�'|y��*Q!M�&�h�h�O���mZ�)����yJ��۴�'|?2�6u���̸�Jݸ�2Ѝ�l"Ӎ�t�6&�<n�|F�+�u�!,l �L�]i:��*�!V�s-u�C7���CW��!8Ԓ���L�p�F7��HK��]�f���хl����uk&�
m���&G�d�q��dD�������'#�T@F����h����h?$��6�mwL6��a#��6�a#��F�I��ȓ
�'6"O*lD�T؈<��
����ȓ
�'6"O*lD�T؈<��yRa#��F�I��ȓ�;�؈<��yRa#��F�I��ȓ
�'6"O*lD�T؈<��yRa#��F�I��ȓ
�'6"O��?C``#��F�I��ȓ
�'6"O*lD�T؈<��yRa#��FJ�O؈<��yRa#��F�I��ȓ
��G�
4lD�؈<=�yz��@na#��ȳ�"����#��6"OlD�؈<=�yz`#��F���؈{̶�'�[#Ss�D��G�k�S�Nc
�~��V63[g�b�S�4ȳh��
�}v�K�ʼ
%��0�:I��@禰�:7e�g���>����
_�g��>;a�����N�>;a�����N�>;a�����N�>;a�����N�>;a���6�N�;as�ͱ6�N�;as�ͱ6�N�;as�ͱ6�N�;as�ͱ6�N�;as�ͱ6�N�;as�ͱ6�N�;as�ͱ6�3as<6�3as<6�3as<6�3as<6�3as<6�3as\w�d&l�g��x��W��{�4���w�/"{�'�@�FTe�v��x0�Q4T�E
*
<-ˮ\=���I�lKȠ��J]�b���C7�r�L�,����ɕ�B���+�N�,0@����B��LM��J�tϝ�[�m� ��k�A�m�:/���դK�uMzP��j��L��I�c<0�s�&}���1��9��>��a��L��I�cmc��L��I�c<0�s�&}��W�8��
�^��`�+PLz�1ŤWSLz�1ŤWSLz�1Ť�dl�nAƶ�dl�nAƶ�dl�nAƶ�dl�nAƶ�dl�nAƶ�dl�nAƶ�dl�nAƶ�dl�nAƶ�dl�nAƶ�dl�nAƶ�dl�nAƶ�dl�nAƶ�dl�nAƶ�d��
���0�\�Q�ל��7�K�\`!���b/
�q��K�Kt�
+��h?�7h���W������7m�m�[���)!�U�����M�����R���B[�����>�9f
�?��c��Y�y�v���ݟg}`��Y�y�v���ݟg}`��Q��y�v���ݟg}`��Y�y�v���ݟg}`��Y�y�v���ݟg}`��Y�V~��ݟg����g����G����zH��L6[�8[�8���_�ocn�p�@7��Ѝ9Ѝ4z[��x��x��o��A7ЧЍt2tc+on���ЍH����M��V~�s+MH��]�����؛���ךȄ��u�rՑ�o�Y���)a]�%�m��0�6]�F;��mD+m��fӧ#mz5�J�.?(6]�3��%ulzˠ�~�4�{^��t��t��~���������Ŧ�W����2�Sl�}vF?g���)��xe�c���:椌~>�t��|���,�=��&�t��;6�@ǔяڌ�W6>6�������a&l�~�^��1l�~4�^@�(�æ+fjg�#�{�ȷ�p�y�2��g�t�SF?g��u�G��������U��=����1���ƾcc����(F��oI�뫋ѿ�c�c�/�5�ѿ@
�`8���G�[��+�v�}�X_]���3~��c��1�(G��C#H���;�7��,�e��_�f�7�fY`���2!��Y� 6�2��kTC+��2c�d#��<�����\�,�ʤ#�YCБYVtd��E�v�-�s}:�=�7�#�s}�6:~�n^\���s���&��a�������
�5���?���F�n����o���U�����[�d�Rw�~��M����ݰn]����{g�?��q����M����l\���M�?�PK�"�[�#o,,.libraries/Escpos/PrintBuffers/cache/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[���/�&�&3libraries/Escpos/PrintBuffers/EscposPrintBuffer.phpnu�[���<?php
/**
* This file is part of escpos-php: PHP receipt printer library for use
with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington <
michael.billington@gmail.com >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full
list.
*
* This software is distributed under the terms of the MIT license. See
LICENSE.md
* for details.
*/
namespace Mike42\Escpos\PrintBuffers;
use LogicException;
use Mike42\Escpos\Printer;
/**
* This class manages newlines and character encoding for the target
printer, and
* can be interchanged for an image-bassed buffer (ImagePrintBuffer) if you
can't
* get it operating properly on your machine.
*/
class EscposPrintBuffer implements PrintBuffer
{
/**
* True to cache output as .z, false to leave un-compressed (useful
for debugging)
*/
const COMPRESS_CACHE = true;
/**
* The input encoding of the buffer.
*/
const INPUT_ENCODING = "UTF-8";
/**
* Un-recognised characters will be replaced with this.
*/
const REPLACEMENT_CHAR = "?";
/**
* @var array $available
* This array Maps ESC/POS character tables to names iconv encodings
*/
private $available = null;
/**
* @var array $encode
* Maps of UTF-8 to code-pages
*/
private $encode = null;
/**
* @var Printer $printer
* Printer for output
*/
private $printer;
/**
* Empty print buffer.
*/
public function __construct()
{
$this -> printer = null;
}
public function flush()
{
if ($this -> printer == null) {
throw new LogicException("Not attached to a
printer.");
}
// TODO Not yet implemented for this buffer: This indicates that
the printer needs the current line to be ended.
}
public function getPrinter()
{
return $this -> printer;
}
public function setPrinter(Printer $printer = null)
{
$this -> printer = $printer;
if ($printer != null) {
$this -> loadAvailableCharacters();
}
}
public function writeText($text)
{
if ($this -> printer == null) {
throw new LogicException("Not attached to a
printer.");
}
if ($text == null) {
return;
}
if (!mb_detect_encoding($text, self::INPUT_ENCODING, true)) {
// Assume that the user has already put non-UTF8 into the
target encoding.
return $this -> writeTextRaw($text);
}
$i = 0;
$j = 0;
$len = mb_strlen($text, self::INPUT_ENCODING);
while ($i < $len) {
$matching = true;
if (($encoding = $this -> identifyText(mb_substr($text, $i,
1, self::INPUT_ENCODING))) === false) {
// Un-encodeable text
$encoding = $this -> getPrinter() ->
getCharacterTable();
}
$i++;
$j = 1;
do {
$char = mb_substr($text, $i, 1, self::INPUT_ENCODING);
$matching = !isset($this -> available[$char]) ||
isset($this -> available[$char][$encoding]);
if ($matching) {
$i++;
$j++;
}
} while ($matching && $i < $len);
$this -> writeTextUsingEncoding(mb_substr($text, $i - $j,
$j, self::INPUT_ENCODING), $encoding);
}
}
public function writeTextRaw($text)
{
if ($this -> printer == null) {
throw new LogicException("Not attached to a
printer.");
}
if (strlen($text) == 0) {
return;
}
// Pass only printable characters
$j = 0;
$l = strlen($text);
$outp = str_repeat(self::REPLACEMENT_CHAR, $l);
for ($i = 0; $i < $l; $i++) {
$c = substr($text, $i, 1);
if ($c == "\r") {
/* Skip past Windows line endings (raw usage). */
continue;
} else if (self::asciiCheck($c, true)) {
$outp[$j] = $c;
}
$j++;
}
$this -> write(substr($outp, 0, $j));
}
/**
* Return an encoding which we can start to use for outputting this
text.
* Later parts of the text need not be included in the returned code
page.
*
* @param string $text Input text to check.
* @return boolean|integer Code page number, or FALSE if the text is
not
* printable on any supported encoding.
*/
private function identifyText($text)
{
// TODO Replace this with an algorithm to choose the encoding which
will
// encode the farthest into the string, to minimise code page
changes.
$char = mb_substr($text, 0, 1, self::INPUT_ENCODING);
if (!isset($this -> available[$char])) {
/* Character not available anywhere */
return false;
}
foreach ($this -> available[$char] as $encodingNo => $true) {
/* Return first code-page where it is available */
return $encodingNo;
}
return false;
}
/**
* Based on the printer's connector, compute (or load a cached
copy of) maps
* of UTF character to unicode characters for later use.
*/
private function loadAvailableCharacters()
{
$profile = $this -> printer -> getPrinterCapabilityProfile();
$supportedCodePages = $profile -> getCodePages();
$profileName = $profile -> getId();
$cacheFile = dirname(__FILE__) . "/cache/Characters-" .
$profileName . ".ser" .
(self::COMPRESS_CACHE ? ".z" : "");
$cacheKey = $profile -> getCodePageCacheKey();
/* Check for pre-generated file */
if (file_exists($cacheFile)) {
$cacheData = file_get_contents($cacheFile);
if (self::COMPRESS_CACHE) {
$cacheData = gzuncompress($cacheData);
}
if ($cacheData) {
$dataArray = unserialize($cacheData);
if (isset($dataArray["key"]) &&
isset($dataArray["available"]) &&
isset($dataArray["encode"]) &&
$dataArray["key"] == $cacheKey) {
$this -> available =
$dataArray["available"];
$this -> encode = $dataArray["encode"];
return;
}
}
}
/* Generate conversion tables */
$encode = array();
$available = array();
foreach ($supportedCodePages as $num => $codePage) {
$encode[$num] = array();
if (!$codePage -> isEncodable()) {
continue;
}
$map = $codePage -> getData();
for ($char = 128; $char <= 255; $char++) {
$utf8 = mb_substr($map, $char - 128, 1,
self::INPUT_ENCODING);
if ($utf8 == " ") { // Skip placeholders
continue;
}
if (!isset($available[$utf8])) {
$available[$utf8] = array();
}
$available[$utf8][$num] = true;
$encode[$num][$utf8] = chr($char);
}
}
/* Use generated data */
$dataArray = array("available" => $available,
"encode" => $encode, "key" => $cacheKey);
$this -> available = $dataArray["available"];
$this -> encode = $dataArray["encode"];
$cacheData = serialize($dataArray);
if (self::COMPRESS_CACHE) {
$cacheData = gzcompress($cacheData);
}
/* Attempt to cache, but don't worry if we can't */
@file_put_contents($cacheFile, $cacheData);
}
/**
* Encode a block of text using the specified map, and write it to the
printer.
*
* @param string $text Text to print, UTF-8 format.
* @param integer $encodingNo Encoding number to use- assumed to exist.
*/
private function writeTextUsingEncoding($text, $encodingNo)
{
$encodeMap = $this -> encode[$encodingNo];
$len = mb_strlen($text, self::INPUT_ENCODING);
$rawText = str_repeat(self::REPLACEMENT_CHAR, $len);
$j = 0;
for ($i = 0; $i < $len; $i++) {
$char = mb_substr($text, $i, 1, self::INPUT_ENCODING);
if (isset($encodeMap[$char])) {
$rawText[$j] = $encodeMap[$char];
} elseif (self::asciiCheck($char)) {
$rawText[$j] = $char;
} elseif ($char === "\r") {
/* Skip past Windows line endings (UTF-8 usage) */
continue;
}
$j++;
}
if ($this -> printer -> getCharacterTable() != $encodingNo) {
$this -> printer -> selectCharacterTable($encodingNo);
}
$this -> writeTextRaw(substr($rawText, 0, $j));
}
/**
* Write data to the underlying printer.
*
* @param string $data
*/
private function write($data)
{
$this -> printer -> getPrintConnector() -> write($data);
}
/**
* Return true if a character is an ASCII printable character.
*
* @param string $char Character to check
* @param boolean $extended True to allow 128-256 values also (excluded
by default)
* @return boolean True if the character is printable, false if it is
not.
*/
private static function asciiCheck($char, $extended = false)
{
if (strlen($char) != 1) {
// Multi-byte string
return false;
}
$num = ord($char);
if ($num > 31 && $num < 127) { // Printable
return true;
}
if ($num == 10) { // New-line (printer will take these)
return true;
}
if ($extended && $num > 127) {
return true;
}
return false;
}
}
PK�"�[zL�882libraries/Escpos/PrintBuffers/ImagePrintBuffer.phpnu�[���<?php
/**
* This file is part of escpos-php: PHP receipt printer library for use
with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington <
michael.billington@gmail.com >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full
list.
*
* This software is distributed under the terms of the MIT license. See
LICENSE.md
* for details.
*/
namespace Mike42\Escpos\PrintBuffers;
use Exception;
use LogicException;
use Mike42\Escpos\Printer;
use Mike42\Escpos\EscposImage;
use Mike42\Escpos\ImagickEscposImage;
/**
* This class renders text to small images on-the-fly. It attempts to mimic
the
* behaviour of text output, whilst supporting any fonts & character
encodings
* which your system can handle. This class currently requires Imagick.
*/
class ImagePrintBuffer implements PrintBuffer
{
private $printer;
private $font;
private $fontSize;
public function __construct()
{
if (!EscposImage::isImagickLoaded()) {
throw new Exception("ImagePrintBuffer requires the imagick
extension");
}
$this -> font = null;
$this -> fontSize = 24;
}
public function flush()
{
if ($this -> printer == null) {
throw new LogicException("Not attached to a
printer.");
}
}
public function getPrinter()
{
return $this -> printer;
}
public function setPrinter(Printer $printer = null)
{
$this -> printer = $printer;
}
public function writeText($text)
{
if ($this -> printer == null) {
throw new LogicException("Not attached to a
printer.");
}
if ($text == null) {
return;
}
$text = trim($text, "\n");
/* Create Imagick objects */
$image = new \Imagick();
$draw = new \ImagickDraw();
$color = new \ImagickPixel('#000000');
$background = new \ImagickPixel('white');
/* Create annotation */
if ($this->font !== null) {
// Allow fallback on defaults as necessary
$draw->setFont($this->font);
}
/* In Arial, size 21 looks good as a substitute for FONT_B, 24 for
FONT_A */
$draw -> setFontSize($this -> fontSize);
$draw -> setFillColor($color);
$draw -> setStrokeAntialias(true);
$draw -> setTextAntialias(true);
$metrics = $image -> queryFontMetrics($draw, $text);
$draw -> annotation(0, $metrics['ascender'], $text);
/* Create image & draw annotation on it */
$image -> newImage($metrics['textWidth'],
$metrics['textHeight'], $background);
$image -> setImageFormat('png');
$image -> drawImage($draw);
// debugging if you want to view the images yourself
//$image -> writeImage("test.png");
/* Save image */
$escposImage = new ImagickEscposImage();
$escposImage -> readImageFromImagick($image);
$size = Printer::IMG_DEFAULT;
$this -> printer -> bitImage($escposImage, $size);
}
public function writeTextRaw($text)
{
if ($this -> printer == null) {
throw new LogicException("Not attached to a
printer.");
}
$this -> printer -> getPrintConnector() -> write($data);
}
/**
* Set path on disk to TTF font that will be used to render text to
image,
* or 'null' to use a default.
*
* ImageMagick will also accept a font name, but this will not port as
well
* between systems.
*
* @param string $font
* Font name or a filename
*/
public function setFont($font)
{
$this->font = $font;
}
/**
* Numeric font size for rendering text to image
*/
public function setFontSize($fontSize)
{
$this->fontSize = $fontSize;
}
}
PK�"�[�#o,,(libraries/Escpos/PrintBuffers/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�['ʯj-libraries/Escpos/PrintBuffers/PrintBuffer.phpnu�[���<?php
/**
* This file is part of escpos-php: PHP receipt printer library for use
with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington <
michael.billington@gmail.com >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full
list.
*
* This software is distributed under the terms of the MIT license. See
LICENSE.md
* for details.
*/
namespace Mike42\Escpos\PrintBuffers;
use Mike42\Escpos\Printer;
/**
* Print buffers manage newlines and character encoding for the target
printer.
* They are used as a swappable component: text or image-based output.
*
* - Text output (EscposPrintBuffer) is the fast default, and is
recommended for
* most people, as the text output can be more directly manipulated by
ESC/POS
* commands.
* - Image output (ImagePrintBuffer) is designed to accept more encodings
than the
* physical printer supports, by rendering the text to small images
on-the-fly.
* This takes a lot more CPU than sending text, but is necessary for some
users.
* - If your use case fits outside these, then a further speed/flexibility
trade-off
* can be made by printing directly from generated HTML or PDF.
*/
interface PrintBuffer
{
/**
* Cause the buffer to send any partial input and wait on a newline.
* If the printer is already on a new line, this does nothing.
*/
public function flush();
/**
* Used by Escpos to check if a printer is set.
*/
public function getPrinter();
/**
* Used by Escpos to hook up one-to-one link between buffers and
printers.
*
* @param Escpos $printer New printer
*/
public function setPrinter(Printer $printer = null);
/**
* Accept UTF-8 text for printing.
*
* @param string $text Text to print
*/
public function writeText($text);
/**
* Accept 8-bit text in the current encoding and add it to the buffer.
*
* @param string $text Text to print, already the target encoding.
*/
public function writeTextRaw($text);
}
PK�"�[ɑ( 6libraries/Escpos/PrintConnectors/ApiPrintConnector.phpnu�[���<?php
namespace Mike42\Escpos\PrintConnectors;
use Guzzle\Http\Client;
use Guzzle\Http\Message\Request;
use Guzzle\Http\Message\Response;
use Exception;
class ApiPrintConnector implements PrintConnector
{
/**
* @var string
*/
protected $stream;
/**
* @var Client
*/
protected $httpClient;
/**
* @var string
*/
protected $printerId;
/**
* @var string
*/
protected $apiToken;
/**
* Construct new connector
*
* @param string $host
* @param string $printerId
* @param string $apiToken
*/
public function __construct($host, $printerId, $apiToken)
{
$this->httpClient = new Client(array('base_uri' =>
$host));
$this->printerId = $printerId;
$this->apiToken = $apiToken;
$this->stream = '';
}
/**
* Print connectors should cause a NOTICE if they are deconstructed
* when they have not been finalized.
*/
public function __destruct()
{
if (! empty($this->stream)) {
trigger_error("Print connector was not finalized. Did you
forget to close the printer?", E_USER_NOTICE);
}
}
/**
* Finish using this print connector (close file, socket, send
* accumulated output, etc).
*/
public function finalize()
{
/** @var Request $request */
$request = $this->httpClient->post(
'printers/'.$this->printerId.'/print?api_token='.$this->apiToken,
null,
$this->stream
);
/** @var Response $response */
$response = $request->send();
if (! $response->isSuccessful()) {
throw new Exception(
sprintf('Failed to print. API returned "%s:
%s"', $response->getStatusCode(),
$response->getReasonPhrase())
);
}
$this->stream = '';
}
/**
* Read data from the printer.
*
* @param string $len Length of data to read.
* @return string Data read from the printer.
*/
public function read($len)
{
return $this->stream;
}
/**
* Write data to the print connector.
*
* @param string $data The data to write
*/
public function write($data)
{
$this->stream .= $data;
}
}
PK�"�[�t����7libraries/Escpos/PrintConnectors/CupsPrintConnector.phpnu�[���<?php
/**
* This file is part of escpos-php: PHP receipt printer library for use
with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington <
michael.billington@gmail.com >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full
list.
*
* This software is distributed under the terms of the MIT license. See
LICENSE.md
* for details.
*/
namespace Mike42\Escpos\PrintConnectors;
use Exception;
use BadMethodCallException;
/**
* Print connector that passes print data to CUPS print commands.
* Your printer mut be installed on the local CUPS instance to use this
connector.
*/
class CupsPrintConnector implements PrintConnector
{
/**
* @var array $buffer
* Buffer of accumilated data.
*/
private $buffer;
/**
*
* @var string $printerName
* The name of the target printer.
*/
private $printerName;
/**
* Construct new CUPS print connector.
*
* @param string $dest
* The CUPS printer name to print to. This must be loaded
using a raw driver.
* @throws BadMethodCallException
*/
public function __construct($dest)
{
$valid = $this->getLocalPrinters();
if (count($valid) == 0) {
throw new BadMethodCallException("You do not have any
printers installed on " .
"this system via CUPS. Check 'lpr
-a'.");
}
if (array_search($dest, $valid, true) === false) {
throw new BadMethodCallException("'$dest' is not
a printer on this system. " .
"Printers are: [" . implode(", ",
$valid) . "]");
}
$this->buffer = array ();
$this->printerName = $dest;
}
/**
* Cause a NOTICE if deconstructed before the job was printed.
*/
public function __destruct()
{
if ($this->buffer !== null) {
trigger_error("Print connector was not finalized. Did you
forget to close the printer?", E_USER_NOTICE);
}
}
/**
* Send job to printer.
*/
public function finalize()
{
$data = implode($this->buffer);
$this->buffer = null;
// Build command to work on data
$tmpfname = tempnam(sys_get_temp_dir(), 'print-');
file_put_contents($tmpfname, $data);
$cmd = sprintf(
"lp -d %s %s",
escapeshellarg($this->printerName),
escapeshellarg($tmpfname)
);
try {
$this->getCmdOutput($cmd);
} catch (Exception $e) {
unlink($tmpfname);
throw $e;
}
unlink($tmpfname);
}
/**
* Run a command and throw an exception if it fails, or return the
output if it works.
* (Basically exec() with good error handling)
*
* @param string $cmd
* Command to run
*/
protected function getCmdOutput($cmd)
{
$descriptors = array (
1 => array (
"pipe",
"w"
),
2 => array (
"pipe",
"w"
)
);
$process = proc_open($cmd, $descriptors, $fd);
if (! is_resource($process)) {
throw new Exception("Command '$cmd' failed to
start.");
}
/* Read stdout */
$outputStr = stream_get_contents($fd [1]);
fclose($fd [1]);
/* Read stderr */
$errorStr = stream_get_contents($fd [2]);
fclose($fd [2]);
/* Finish up */
$retval = proc_close($process);
if ($retval != 0) {
throw new Exception("Command $cmd failed:
$errorStr");
}
return $outputStr;
}
/**
* Read data from the printer.
*
* @param string $len Length of data to read.
* @return Data read from the printer, or false where reading is not
possible.
*/
public function read($len)
{
return false;
}
/**
* @param string $data
*/
public function write($data)
{
$this->buffer [] = $data;
}
/**
* Load a list of CUPS printers.
*
* @return array A list of printer names installed on this system. Any
item
* on this list is valid for constructing a printer.
*/
protected function getLocalPrinters()
{
$outpStr = $this->getCmdOutput("lpstat -a");
$outpLines = explode("\n", trim($outpStr));
foreach ($outpLines as $line) {
$ret [] = $this->chopLpstatLine($line);
}
return $ret;
}
/**
* Get the item before the first space in a string
*
* @param string $line
* @return string the string, up to the first space, or the whole
string if it contains no spaces.
*/
private function chopLpstatLine($line)
{
if (($pos = strpos($line, " ")) === false) {
return $line;
} else {
return substr($line, 0, $pos);
}
}
}
PK�"�[E��?��8libraries/Escpos/PrintConnectors/DummyPrintConnector.phpnu�[���<?php
/**
* This file is part of escpos-php: PHP receipt printer library for use
with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington <
michael.billington@gmail.com >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full
list.
*
* This software is distributed under the terms of the MIT license. See
LICENSE.md
* for details.
*/
namespace Mike42\Escpos\PrintConnectors;
/**
* Print connector that writes to nowhere, but allows the user to retrieve
the
* buffered data. Used for testing.
*/
final class DummyPrintConnector implements PrintConnector
{
/**
* @var array $buffer
* Buffer of accumilated data.
*/
private $buffer;
/**
* @var string data which the printer will provide on next read
*/
private $readData;
/**
* Create new print connector
*/
public function __construct()
{
$this -> buffer = array();
}
public function __destruct()
{
if ($this -> buffer !== null) {
trigger_error("Print connector was not finalized. Did you
forget to close the printer?", E_USER_NOTICE);
}
}
public function finalize()
{
$this -> buffer = null;
}
/**
* @return string Get the accumulated data that has been sent to this
buffer.
*/
public function getData()
{
return implode($this -> buffer);
}
/**
* {@inheritDoc}
* @see PrintConnector::read()
*/
public function read($len)
{
return $len >= strlen($this -> readData) ? $this ->
readData : substr($this -> readData, 0, $len);
}
public function write($data)
{
$this -> buffer[] = $data;
}
}
PK�"�[��+���7libraries/Escpos/PrintConnectors/FilePrintConnector.phpnu�[���<?php
/**
* This file is part of escpos-php: PHP receipt printer library for use
with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington <
michael.billington@gmail.com >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full
list.
*
* This software is distributed under the terms of the MIT license. See
LICENSE.md
* for details.
*/
namespace Mike42\Escpos\PrintConnectors;
use Exception;
/**
* PrintConnector for passing print data to a file.
*/
class FilePrintConnector implements PrintConnector
{
/**
* @var resource $fp
* The file pointer to send data to.
*/
protected $fp;
/**
* Construct new connector, given a filename
*
* @param string $filename
*/
public function __construct($filename)
{
$this -> fp = fopen($filename, "wb+");
if ($this -> fp === false) {
throw new Exception("Cannot initialise
FilePrintConnector.");
}
}
public function __destruct()
{
if ($this -> fp !== false) {
trigger_error("Print connector was not finalized. Did you
forget to close the printer?", E_USER_NOTICE);
}
}
/**
* Close file pointer
*/
public function finalize()
{
fclose($this -> fp);
$this -> fp = false;
}
/* (non-PHPdoc)
* @see PrintConnector::read()
*/
public function read($len)
{
return fread($this -> fp, $len);
}
/**
* Write data to the file
*
* @param string $data
*/
public function write($data)
{
fwrite($this -> fp, $data);
}
}
PK�"�[�#o,,+libraries/Escpos/PrintConnectors/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[%���:libraries/Escpos/PrintConnectors/NetworkPrintConnector.phpnu�[���<?php
/**
* This file is part of escpos-php: PHP receipt printer library for use
with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington <
michael.billington@gmail.com >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full
list.
*
* This software is distributed under the terms of the MIT license. See
LICENSE.md
* for details.
*/
namespace Mike42\Escpos\PrintConnectors;
use Exception;
/**
* PrintConnector for directly opening a network socket to a printer to
send it commands.
*/
class NetworkPrintConnector extends FilePrintConnector
{
/**
* Construct a new NetworkPrintConnector
*
* @param string $ip IP address or hostname to use.
* @param string $port The port number to connect on.
* @param string $timeout The connection timeout, in seconds.
* @throws Exception Where the socket cannot be opened.
*/
public function __construct($ip, $port = "9100", $timeout =
false)
{
// Default to 60 if default_socket_timeout isn't defined in
the ini
$defaultSocketTimeout = ini_get("default_socket_timeout")
?: 60;
$timeout = $timeout ?: $defaultSocketTimeout;
$this -> fp = @fsockopen($ip, $port, $errno, $errstr, $timeout);
if ($this -> fp === false) {
throw new Exception("Cannot initialise
NetworkPrintConnector: " . $errstr);
}
}
}
PK�"�[�|�w3libraries/Escpos/PrintConnectors/PrintConnector.phpnu�[���<?php
/**
* This file is part of escpos-php: PHP receipt printer library for use
with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington <
michael.billington@gmail.com >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full
list.
*
* This software is distributed under the terms of the MIT license. See
LICENSE.md
* for details.
*/
namespace Mike42\Escpos\PrintConnectors;
/**
* Interface passed to Escpos class for receiving print data. Print
connectors
* are responsible for transporting this to the actual printer.
*/
interface PrintConnector
{
/**
* Print connectors should cause a NOTICE if they are deconstructed
* when they have not been finalized.
*/
public function __destruct();
/**
* Finish using this print connector (close file, socket, send
* accumulated output, etc).
*/
public function finalize();
/**
* Read data from the printer.
*
* @param string $len Length of data to read.
* @return Data read from the printer, or false where reading is not
possible.
*/
public function read($len);
/**
* Write data to the print connector.
*
* @param string $data The data to write
*/
public function write($data);
}
PK�"�[�d��33:libraries/Escpos/PrintConnectors/WindowsPrintConnector.phpnu�[���<?php
/**
* This file is part of escpos-php: PHP receipt printer library for use
with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington <
michael.billington@gmail.com >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full
list.
*
* This software is distributed under the terms of the MIT license. See
LICENSE.md
* for details.
*/
namespace Mike42\Escpos\PrintConnectors;
use Exception;
use BadMethodCallException;
/**
* Connector for sending print jobs to
* - local ports on windows (COM1, LPT1, etc)
* - shared (SMB) printers from any platform (smb://server/foo)
* For USB printers or other ports, the trick is to share the printer with
a
* generic text driver, then connect to the shared printer locally.
*/
class WindowsPrintConnector implements PrintConnector
{
/**
* @var array $buffer
* Accumulated lines of output for later use.
*/
private $buffer;
/**
* @var string $hostname
* The hostname of the target machine, or null if this is a local
connection.
*/
private $hostname;
/**
* @var boolean $isLocal
* True if a port is being used directly (must be Windows), false if
network shares will be used.
*/
private $isLocal;
/**
* @var int $platform
* Platform we're running on, for selecting different commands.
See PLATFORM_* constants.
*/
private $platform;
/**
* @var string $printerName
* The name of the target printer (eg "Foo Printer") or port
("COM1", "LPT1").
*/
private $printerName;
/**
* @var string $userName
* Login name for network printer, or null if not using
authentication.
*/
private $userName;
/**
* @var string $userPassword
* Password for network printer, or null if no password is required.
*/
private $userPassword;
/**
* @var string $workgroup
* Workgroup that the printer is located on
*/
private $workgroup;
/**
* Represents Linux
*/
const PLATFORM_LINUX = 0;
/**
* Represents Mac
*/
const PLATFORM_MAC = 1;
/**
* Represents Windows
*/
const PLATFORM_WIN = 2;
/**
* Valid local ports.
*/
const REGEX_LOCAL = "/^(LPT\d|COM\d)$/";
/**
* Valid printer name.
*/
const REGEX_PRINTERNAME = "/^[\d\w-]+(\s[\d\w-]+)*$/";
/**
* Valid smb:// URI containing hostname & printer with optional
user & optional password only.
*/
const REGEX_SMB =
"/^smb:\/\/([\s\d\w-]+(:[\s\d\w-+]+)?@)?([\d\w-]+\.)*[\d\w-]+\/([\d\w-]+\/)?[\d\w-]+(\s[\d\w-]+)*$/";
/**
* @param string $dest
* @throws BadMethodCallException
*/
public function __construct($dest)
{
$this -> platform = $this -> getCurrentPlatform();
$this -> isLocal = false;
$this -> buffer = null;
$this -> userName = null;
$this -> userPassword = null;
$this -> workgroup = null;
if (preg_match(self::REGEX_LOCAL, $dest) == 1) {
// Straight to LPT1, COM1 or other local port. Allowed only if
we are actually on windows.
if ($this -> platform !== self::PLATFORM_WIN) {
throw new
BadMethodCallException("WindowsPrintConnector can only be " .
"used to print to a local printer
('".$dest."') on a Windows computer.");
}
$this -> isLocal = true;
$this -> hostname = null;
$this -> printerName = $dest;
} elseif (preg_match(self::REGEX_SMB, $dest) == 1) {
// Connect to samba share, eg smb://host/printer
$part = parse_url($dest);
$this -> hostname = $part['host'];
/* Printer name and optional workgroup */
$path = ltrim($part['path'], '/');
if (strpos($path, "/") !== false) {
$pathPart = explode("/", $path);
$this -> workgroup = $pathPart[0];
$this -> printerName = $pathPart[1];
} else {
$this -> printerName = $path;
}
/* Username and password if set */
if (isset($part['user'])) {
$this -> userName = $part['user'];
if (isset($part['pass'])) {
$this -> userPassword = $part['pass'];
}
}
} elseif (preg_match(self::REGEX_PRINTERNAME, $dest) == 1) {
// Just got a printer name. Assume it's on the current
computer.
$hostname = gethostname();
if (!$hostname) {
$hostname = "localhost";
}
$this -> hostname = $hostname;
$this -> printerName = $dest;
} else {
throw new BadMethodCallException("Printer '" .
$dest . "' is not a valid " .
"printer name. Use local port (LPT1, COM1, etc) or
smb://computer/printer notation.");
}
$this -> buffer = array();
}
public function __destruct()
{
if ($this -> buffer !== null) {
trigger_error("Print connector was not finalized. Did you
forget to close the printer?", E_USER_NOTICE);
}
}
public function finalize()
{
$data = implode($this -> buffer);
$this -> buffer = null;
if ($this -> platform == self::PLATFORM_WIN) {
$this -> finalizeWin($data);
} elseif ($this -> platform == self::PLATFORM_LINUX) {
$this -> finalizeLinux($data);
} else {
$this -> finalizeMac($data);
}
}
/**
* Send job to printer -- platform-specific Linux code.
*
* @param string $data Print data
* @throws Exception
*/
protected function finalizeLinux($data)
{
/* Non-Windows samba printing */
$device = "//" . $this -> hostname . "/" .
$this -> printerName;
if ($this -> userName !== null) {
$user = ($this -> workgroup != null ? ($this -> workgroup
. "\\") : "") . $this -> userName;
if ($this -> userPassword == null) {
// No password
$command = sprintf(
"smbclient %s -U %s -c %s -N",
escapeshellarg($device),
escapeshellarg($user),
escapeshellarg("print -")
);
$redactedCommand = $command;
} else {
// With password
$command = sprintf(
"smbclient %s %s -U %s -c %s",
escapeshellarg($device),
escapeshellarg($this -> userPassword),
escapeshellarg($user),
escapeshellarg("print -")
);
$redactedCommand = sprintf(
"smbclient %s %s -U %s -c %s",
escapeshellarg($device),
escapeshellarg("*****"),
escapeshellarg($user),
escapeshellarg("print -")
);
}
} else {
// No authentication information at all
$command = sprintf(
"smbclient %s -c %s -N",
escapeshellarg($device),
escapeshellarg("print -")
);
$redactedCommand = $command;
}
$retval = $this -> runCommand($command, $outputStr, $errorStr,
$data);
if ($retval != 0) {
throw new Exception("Failed to print. Command
\"$redactedCommand\" " .
"failed with exit code $retval: " .
trim($errorStr) . trim($outputStr));
}
}
/**
* Send job to printer -- platform-specific Mac code.
*
* @param string $data Print data
* @throws Exception
*/
protected function finalizeMac($data)
{
throw new Exception("Mac printing not implemented.");
}
/**
* Send data to printer -- platform-specific Windows code.
*
* @param string $data
*/
protected function finalizeWin($data)
{
/* Windows-friendly printing of all sorts */
if (!$this -> isLocal) {
/* Networked printing */
$device = "\\\\" . $this -> hostname .
"\\" . $this -> printerName;
if ($this -> userName !== null) {
/* Log in */
$user = "/user:" . ($this -> workgroup != null
? ($this -> workgroup . "\\") : "") . $this ->
userName;
if ($this -> userPassword == null) {
$command = sprintf(
"net use %s %s",
escapeshellarg($device),
escapeshellarg($user)
);
$redactedCommand = $command;
} else {
$command = sprintf(
"net use %s %s %s",
escapeshellarg($device),
escapeshellarg($user),
escapeshellarg($this -> userPassword)
);
$redactedCommand = sprintf(
"net use %s %s %s",
escapeshellarg($device),
escapeshellarg($user),
escapeshellarg("*****")
);
}
$retval = $this -> runCommand($command, $outputStr,
$errorStr);
if ($retval != 0) {
throw new Exception("Failed to print. Command
\"$redactedCommand\" " .
"failed with exit code $retval: " .
trim($errorStr));
}
}
/* Final print-out */
$filename = tempnam(sys_get_temp_dir(), "escpos");
file_put_contents($filename, $data);
if (!$this -> runCopy($filename, $device)) {
throw new Exception("Failed to copy file to
printer");
}
unlink($filename);
} else {
/* Drop data straight on the printer */
if (!$this -> runWrite($data, $this -> printerName)) {
throw new Exception("Failed to write file to printer
at " . $this -> printerName);
}
}
}
/**
* @return string Current platform. Separated out for testing purposes.
*/
protected function getCurrentPlatform()
{
if (PHP_OS == "WINNT") {
return self::PLATFORM_WIN;
}
if (PHP_OS == "Darwin") {
return self::PLATFORM_MAC;
}
return self::PLATFORM_LINUX;
}
/* (non-PHPdoc)
* @see PrintConnector::read()
*/
public function read($len)
{
/* Two-way communication is not supported */
return false;
}
/**
* Run a command, pass it data, and retrieve its return value, standard
output, and standard error.
*
* @param string $command the command to run.
* @param string $outputStr variable to fill with standard output.
* @param string $errorStr variable to fill with standard error.
* @param string $inputStr text to pass to the command's standard
input (optional).
* @return number
*/
protected function runCommand($command, &$outputStr,
&$errorStr, $inputStr = null)
{
$descriptors = array(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
2 => array("pipe", "w"),
);
$process = proc_open($command, $descriptors, $fd);
if (is_resource($process)) {
/* Write to input */
if ($inputStr !== null) {
fwrite($fd[0], $inputStr);
}
fclose($fd[0]);
/* Read stdout */
$outputStr = stream_get_contents($fd[1]);
fclose($fd[1]);
/* Read stderr */
$errorStr = stream_get_contents($fd[2]);
fclose($fd[2]);
/* Finish up */
$retval = proc_close($process);
return $retval;
} else {
/* Method calling this should notice a non-zero exit and print
an error */
return -1;
}
}
/**
* Copy a file. Separated out so that nothing is actually printed
during test runs.
*
* @param string $from Source file
* @param string $to Destination file
* @return boolean True if copy was successful, false otherwise
*/
protected function runCopy($from, $to)
{
return copy($from, $to);
}
/**
* Write data to a file. Separated out so that nothing is actually
printed during test runs.
*
* @param string $data Data to print
* @param string $filename Destination file
* @return boolean True if write was successful, false otherwise
*/
protected function runWrite($data, $filename)
{
return file_put_contents($filename, $data) !== false;
}
public function write($data)
{
$this -> buffer[] = $data;
}
}
PK�"�[�G�<�<�libraries/Escpos/Printer.phpnu�[���<?php
/**
* This file is part of escpos-php: PHP receipt printer library for use
with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington <
michael.billington@gmail.com >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full
list.
*
* This software is distributed under the terms of the MIT license. See
LICENSE.md
* for details.
*/
namespace Mike42\Escpos;
use Exception;
use InvalidArgumentException;
use Mike42\Escpos\PrintBuffers\PrintBuffer;
use Mike42\Escpos\PrintBuffers\EscposPrintBuffer;
use Mike42\Escpos\PrintConnectors\PrintConnector;
use Mike42\Escpos\CapabilityProfile;
/**
* Main class for ESC/POS code generation
*/
class Printer
{
/**
* ASCII null control character
*/
const NUL = "\x00";
/**
* ASCII linefeed control character
*/
const LF = "\x0a";
/**
* ASCII escape control character
*/
const ESC = "\x1b";
/**
* ASCII form separator control character
*/
const FS = "\x1c";
/**
* ASCII form feed control character
*/
const FF = "\x0c";
/**
* ASCII group separator control character
*/
const GS = "\x1d";
/**
* ASCII data link escape control character
*/
const DLE = "\x10";
/**
* ASCII end of transmission control character
*/
const EOT = "\x04";
/**
* Indicates UPC-A barcode when used with Printer::barcode
*/
const BARCODE_UPCA = 65;
/**
* Indicates UPC-E barcode when used with Printer::barcode
*/
const BARCODE_UPCE = 66;
/**
* Indicates JAN13 barcode when used with Printer::barcode
*/
const BARCODE_JAN13 = 67;
/**
* Indicates JAN8 barcode when used with Printer::barcode
*/
const BARCODE_JAN8 = 68;
/**
* Indicates CODE39 barcode when used with Printer::barcode
*/
const BARCODE_CODE39 = 69;
/**
* Indicates ITF barcode when used with Printer::barcode
*/
const BARCODE_ITF = 70;
/**
* Indicates CODABAR barcode when used with Printer::barcode
*/
const BARCODE_CODABAR = 71;
/**
* Indicates CODE93 barcode when used with Printer::barcode
*/
const BARCODE_CODE93 = 72;
/**
* Indicates CODE128 barcode when used with Printer::barcode
*/
const BARCODE_CODE128 = 73;
/**
* Indicates that HRI (human-readable interpretation) text should not
be
* printed, when used with Printer::setBarcodeTextPosition
*/
const BARCODE_TEXT_NONE = 0;
/**
* Indicates that HRI (human-readable interpretation) text should be
printed
* above a barcode, when used with Printer::setBarcodeTextPosition
*/
const BARCODE_TEXT_ABOVE = 1;
/**
* Indicates that HRI (human-readable interpretation) text should be
printed
* below a barcode, when used with Printer::setBarcodeTextPosition
*/
const BARCODE_TEXT_BELOW = 2;
/**
* Use the first color (usually black), when used with
Printer::setColor
*/
const COLOR_1 = 0;
/**
* Use the second color (usually red or blue), when used with
Printer::setColor
*/
const COLOR_2 = 1;
/**
* Make a full cut, when used with Printer::cut
*/
const CUT_FULL = 65;
/**
* Make a partial cut, when used with Printer::cut
*/
const CUT_PARTIAL = 66;
/**
* Use Font A, when used with Printer::setFont
*/
const FONT_A = 0;
/**
* Use Font B, when used with Printer::setFont
*/
const FONT_B = 1;
/**
* Use Font C, when used with Printer::setFont
*/
const FONT_C = 2;
/**
* Use default (high density) image size, when used with
Printer::graphics,
* Printer::bitImage or Printer::bitImageColumnFormat
*/
const IMG_DEFAULT = 0;
/**
* Use lower horizontal density for image printing, when used with
Printer::graphics,
* Printer::bitImage or Printer::bitImageColumnFormat
*/
const IMG_DOUBLE_WIDTH = 1;
/**
* Use lower vertical density for image printing, when used with
Printer::graphics,
* Printer::bitImage or Printer::bitImageColumnFormat
*/
const IMG_DOUBLE_HEIGHT = 2;
/**
* Align text to the left, when used with Printer::setJustification
*/
const JUSTIFY_LEFT = 0;
/**
* Center text, when used with Printer::setJustification
*/
const JUSTIFY_CENTER = 1;
/**
* Align text to the right, when used with Printer::setJustification
*/
const JUSTIFY_RIGHT = 2;
/**
* Use Font A, when used with Printer::selectPrintMode
*/
const MODE_FONT_A = 0;
/**
* Use Font B, when used with Printer::selectPrintMode
*/
const MODE_FONT_B = 1;
/**
* Use text emphasis, when used with Printer::selectPrintMode
*/
const MODE_EMPHASIZED = 8;
/**
* Use double height text, when used with Printer::selectPrintMode
*/
const MODE_DOUBLE_HEIGHT = 16;
/**
* Use double width text, when used with Printer::selectPrintMode
*/
const MODE_DOUBLE_WIDTH = 32;
/**
* Underline text, when used with Printer::selectPrintMode
*/
const MODE_UNDERLINE = 128;
/**
* Indicates standard PDF417 code
*/
const PDF417_STANDARD = 0;
/**
* Indicates truncated PDF417 code
*/
const PDF417_TRUNCATED = 1;
/**
* Indicates error correction level L when used with Printer::qrCode
*/
const QR_ECLEVEL_L = 0;
/**
* Indicates error correction level M when used with Printer::qrCode
*/
const QR_ECLEVEL_M = 1;
/**
* Indicates error correction level Q when used with Printer::qrCode
*/
const QR_ECLEVEL_Q = 2;
/**
* Indicates error correction level H when used with Printer::qrCode
*/
const QR_ECLEVEL_H = 3;
/**
* Indicates QR model 1 when used with Printer::qrCode
*/
const QR_MODEL_1 = 1;
/**
* Indicates QR model 2 when used with Printer::qrCode
*/
const QR_MODEL_2 = 2;
/**
* Indicates micro QR code when used with Printer::qrCode
*/
const QR_MICRO = 3;
/**
* Indicates a request for printer status when used with
* Printer::getPrinterStatus (experimental)
*/
const STATUS_PRINTER = 1;
/**
* Indicates a request for printer offline cause when used with
* Printer::getPrinterStatus (experimental)
*/
const STATUS_OFFLINE_CAUSE = 2;
/**
* Indicates a request for error cause when used with
Printer::getPrinterStatus
* (experimental)
*/
const STATUS_ERROR_CAUSE = 3;
/**
* Indicates a request for error cause when used with
Printer::getPrinterStatus
* (experimental)
*/
const STATUS_PAPER_ROLL = 4;
/**
* Indicates a request for ink A status when used with
Printer::getPrinterStatus
* (experimental)
*/
const STATUS_INK_A = 7;
/**
* Indicates a request for ink B status when used with
Printer::getPrinterStatus
* (experimental)
*/
const STATUS_INK_B = 6;
/**
* Indicates a request for peeler status when used with
Printer::getPrinterStatus
* (experimental)
*/
const STATUS_PEELER = 8;
/**
* Indicates no underline when used with Printer::setUnderline
*/
const UNDERLINE_NONE = 0;
/**
* Indicates single underline when used with Printer::setUnderline
*/
const UNDERLINE_SINGLE = 1;
/**
* Indicates double underline when used with Printer::setUnderline
*/
const UNDERLINE_DOUBLE = 2;
/**
* @var PrintBuffer $buffer
* The printer's output buffer.
*/
protected $buffer;
/**
* @var PrintConnector $connector
* Connector showing how to print to this printer
*/
protected $connector;
/**
* @var CapabilityProfile $profile
* Profile showing supported features for this printer
*/
protected $profile;
/**
* @var int $characterTable
* Current character code table
*/
protected $characterTable;
/**
* Construct a new print object
*
* @param PrintConnector $connector The PrintConnector to send data to.
If not set, output is sent to standard output.
* @param CapabilityProfile $profile Supported features of this
printer. If not set, the "default" CapabilityProfile will be
used, which is suitable for Epson printers.
* @throws InvalidArgumentException
*/
public function __construct(PrintConnector $connector,
CapabilityProfile $profile = null)
{
/* Set connector */
$this -> connector = $connector;
/* Set capability profile */
if ($profile === null) {
$profile = CapabilityProfile::load('default');
}
$this -> profile = $profile;
/* Set buffer */
$buffer = new EscposPrintBuffer();
$this -> buffer = null;
$this -> setPrintBuffer($buffer);
$this -> initialize();
}
/**
* Print a barcode.
*
* @param string $content The information to encode.
* @param int $type The barcode standard to output. Supported values
are
* `Printer::BARCODE_UPCA`, `Printer::BARCODE_UPCE`,
`Printer::BARCODE_JAN13`,
* `Printer::BARCODE_JAN8`, `Printer::BARCODE_CODE39`,
`Printer::BARCODE_ITF`,
* `Printer::BARCODE_CODABAR`, `Printer::BARCODE_CODE93`, and
`Printer::BARCODE_CODE128`.
* If not specified, `Printer::BARCODE_CODE39` will be used. Note that
some
* barcode formats only support specific lengths or sets of characters,
and that
* available barcode types vary between printers.
* @throws InvalidArgumentException Where the length or characters used
in $content is invalid for the requested barcode format.
*/
public function barcode($content, $type = Printer::BARCODE_CODE39)
{
/* Validate input */
self::validateInteger($type, 65, 73, __FUNCTION__, "Barcode
type");
$len = strlen($content);
switch ($type) {
case self::BARCODE_UPCA:
self::validateInteger($len, 11, 12, __FUNCTION__,
"UPCA barcode content length");
self::validateStringRegex($content, __FUNCTION__,
"/^[0-9]{11,12}$/", "UPCA barcode content");
break;
case self::BARCODE_UPCE:
self::validateIntegerMulti($len, array(array(6, 8),
array(11, 12)), __FUNCTION__, "UPCE barcode content length");
self::validateStringRegex($content, __FUNCTION__,
"/^([0-9]{6,8}|[0-9]{11,12})$/", "UPCE barcode
content");
break;
case self::BARCODE_JAN13:
self::validateInteger($len, 12, 13, __FUNCTION__,
"JAN13 barcode content length");
self::validateStringRegex($content, __FUNCTION__,
"/^[0-9]{12,13}$/", "JAN13 barcode content");
break;
case self::BARCODE_JAN8:
self::validateInteger($len, 7, 8, __FUNCTION__, "JAN8
barcode content length");
self::validateStringRegex($content, __FUNCTION__,
"/^[0-9]{7,8}$/", "JAN8 barcode content");
break;
case self::BARCODE_CODE39:
self::validateInteger($len, 1, 255, __FUNCTION__,
"CODE39 barcode content length"); // 255 is a limitation of the
"function b" command, not the barcode format.
self::validateStringRegex($content, __FUNCTION__,
"/^([0-9A-Z \$\%\+\-\.\/]+|\*[0-9A-Z \$\%\+\-\.\/]+\*)$/",
"CODE39 barcode content");
break;
case self::BARCODE_ITF:
self::validateInteger($len, 2, 255, __FUNCTION__, "ITF
barcode content length"); // 255 is a limitation of the "function
b" command, not the barcode format.
self::validateStringRegex($content, __FUNCTION__,
"/^([0-9]{2})+$/", "ITF barcode content");
break;
case self::BARCODE_CODABAR:
self::validateInteger($len, 1, 255, __FUNCTION__,
"Codabar barcode content length"); // 255 is a limitation of the
"function b" command, not the barcode format.
self::validateStringRegex($content, __FUNCTION__,
"/^[A-Da-d][0-9\$\+\-\.\/\:]+[A-Da-d]$/", "Codabar barcode
content");
break;
case self::BARCODE_CODE93:
self::validateInteger($len, 1, 255, __FUNCTION__,
"Code93 barcode content length"); // 255 is a limitation of the
"function b" command, not the barcode format.
self::validateStringRegex($content, __FUNCTION__,
"/^[\\x00-\\x7F]+$/", "Code93 barcode content");
break;
case self::BARCODE_CODE128:
self::validateInteger($len, 1, 255, __FUNCTION__,
"Code128 barcode content length"); // 255 is a limitation of the
"function b" command, not the barcode format.
// The CODE128 encoder is quite complex, so only a very
basic header-check is applied here.
self::validateStringRegex($content, __FUNCTION__,
"/^\{[A-C][\\x00-\\x7F]+$/", "Code128 barcode
content");
break;
}
if (!$this -> profile -> getSupportsBarcodeB()) {
// A simpler barcode command which supports fewer codes
self::validateInteger($type, 65, 71, __FUNCTION__);
$this -> connector -> write(self::GS . "k" .
chr($type - 65) . $content . self::NUL);
return;
}
// More advanced function B, used in preference
$this -> connector -> write(self::GS . "k" .
chr($type) . chr(strlen($content)) . $content);
}
/**
* Print an image, using the older "bit image" command. This
creates padding on the right of the image,
* if its width is not divisible by 8.
*
* Should only be used if your printer does not support the graphics()
command.
* See also bitImageColumnFormat().
*
* @param EscposImage $img The image to print
* @param int $size Size modifier for the image. Must be either
`Printer::IMG_DEFAULT`
* (default), or any combination of the `Printer::IMG_DOUBLE_HEIGHT`
and
* `Printer::IMG_DOUBLE_WIDTH` flags.
*/
public function bitImage(EscposImage $img, $size =
Printer::IMG_DEFAULT)
{
self::validateInteger($size, 0, 3, __FUNCTION__);
$rasterData = $img -> toRasterFormat();
$header = Printer::dataHeader(array($img -> getWidthBytes(),
$img -> getHeight()), true);
$this -> connector -> write(self::GS . "v0" .
chr($size) . $header);
$this -> connector -> write($rasterData);
}
/**
* Print an image, using the older "bit image" command in
column format.
*
* Should only be used if your printer does not support the graphics()
or
* bitImage() commands.
*
* @param EscposImage $img The image to print
* @param int $size Size modifier for the image. Must be either
`Printer::IMG_DEFAULT`
* (default), or any combination of the `Printer::IMG_DOUBLE_HEIGHT`
and
* `Printer::IMG_DOUBLE_WIDTH` flags.
*/
public function bitImageColumnFormat(EscposImage $img, $size =
Printer::IMG_DEFAULT)
{
$highDensityVertical = ! (($size & self::IMG_DOUBLE_HEIGHT) ==
Printer::IMG_DOUBLE_HEIGHT);
$highDensityHorizontal = ! (($size & self::IMG_DOUBLE_WIDTH) ==
Printer::IMG_DOUBLE_WIDTH);
// Experimental column format printing
// This feature is not yet complete and may produce unpredictable
results.
$this -> setLineSpacing(16); // 16-dot line spacing. This is the
correct value on both TM-T20 and TM-U220
// Header and density code (0, 1, 32, 33) re-used for every line
$densityCode = ($highDensityHorizontal ? 1 : 0) +
($highDensityVertical ? 32 : 0);
$colFormatData = $img -> toColumnFormat($highDensityVertical);
$header = Printer::dataHeader(array($img -> getWidth()), true);
foreach ($colFormatData as $line) {
// Print each line, double density etc for printing are set
here also
$this -> connector -> write(self::ESC . "*" .
chr($densityCode) . $header . $line);
$this -> feed();
// sleep(0.1); // Reduces the amount of trouble that a TM-U220
has keeping up with large images
}
$this -> setLineSpacing(); // Revert to default line spacing
}
/**
* Close the underlying buffer. With some connectors, the
* job will not actually be sent to the printer until this is called.
*/
public function close()
{
$this -> connector -> finalize();
}
/**
* Cut the paper.
*
* @param int $mode Cut mode, either Printer::CUT_FULL or
Printer::CUT_PARTIAL. If not specified, `Printer::CUT_FULL` will be used.
* @param int $lines Number of lines to feed
*/
public function cut($mode = Printer::CUT_FULL, $lines = 3)
{
// TODO validation on cut() inputs
$this -> connector -> write(self::GS . "V" .
chr($mode) . chr($lines));
}
/**
* Print and feed line / Print and feed n lines.
*
* @param int $lines Number of lines to feed
*/
public function feed($lines = 1)
{
self::validateInteger($lines, 1, 255, __FUNCTION__);
if ($lines <= 1) {
$this -> connector -> write(self::LF);
} else {
$this -> connector -> write(self::ESC . "d" .
chr($lines));
}
}
/**
* Some printers require a form feed to release the paper. On most
printers, this
* command is only useful in page mode, which is not implemented in
this driver.
*/
public function feedForm()
{
$this -> connector -> write(self::FF);
}
/**
* Some slip printers require `ESC q` sequence to release the paper.
*/
public function release()
{
$this -> connector -> write(self::ESC . chr(113));
}
/**
* Print and reverse feed n lines.
*
* @param int $lines number of lines to feed. If not specified, 1 line
will be fed.
*/
public function feedReverse($lines = 1)
{
self::validateInteger($lines, 1, 255, __FUNCTION__);
$this -> connector -> write(self::ESC . "e" .
chr($lines));
}
/**
* @return number
*/
public function getCharacterTable()
{
return $this -> characterTable;
}
/**
* @return PrintBuffer
*/
public function getPrintBuffer()
{
return $this -> buffer;
}
/**
* @return PrintConnector
*/
public function getPrintConnector()
{
return $this -> connector;
}
/**
* @return CapabilityProfile
*/
public function getPrinterCapabilityProfile()
{
return $this -> profile;
}
/**
* Print an image to the printer.
*
* Size modifiers are:
* - Printer::IMG_DEFAULT (leave image at original size)
* - Printer::IMG_DOUBLE_WIDTH
* - Printer::IMG_DOUBLE_HEIGHT
*
* See the example/ folder for detailed examples.
*
* The functions bitImage() and bitImageColumnFormat() take the same
* parameters, and can be used if your printer doesn't support the
newer
* graphics commands.
*
* @param EscposImage $img The image to print.
* @param int $size Size modifier for the image. Must be either
`Printer::IMG_DEFAULT`
* (default), or any combination of the `Printer::IMG_DOUBLE_HEIGHT`
and
* `Printer::IMG_DOUBLE_WIDTH` flags.
*/
public function graphics(EscposImage $img, $size =
Printer::IMG_DEFAULT)
{
self::validateInteger($size, 0, 3, __FUNCTION__);
$rasterData = $img -> toRasterFormat();
$imgHeader = Printer::dataHeader(array($img -> getWidth(), $img
-> getHeight()), true);
$tone = '0';
$colors = '1';
$xm = (($size & self::IMG_DOUBLE_WIDTH) ==
Printer::IMG_DOUBLE_WIDTH) ? chr(2) : chr(1);
$ym = (($size & self::IMG_DOUBLE_HEIGHT) ==
Printer::IMG_DOUBLE_HEIGHT) ? chr(2) : chr(1);
$header = $tone . $xm . $ym . $colors . $imgHeader;
$this -> wrapperSendGraphicsData('0', 'p',
$header . $rasterData);
$this -> wrapperSendGraphicsData('0', '2');
}
/**
* Initialize printer. This resets formatting back to the defaults.
*/
public function initialize()
{
$this -> connector -> write(self::ESC . "@");
$this -> characterTable = 0;
}
/**
* Print a two-dimensional data code using the PDF417 standard.
*
* @param string $content Text or numbers to store in the code
* @param number $width Width of a module (pixel) in the printed code.
* Default is 3 dots.
* @param number $heightMultiplier Multiplier for height of a module.
* Default is 3 times the width.
* @param number $dataColumnCount Number of data columns to use. 0
(default)
* is to auto-calculate. Smaller numbers will result in a narrower
code,
* making larger pixel sizes possible. Larger numbers require smaller
pixel sizes.
* @param real $ec Error correction ratio, from 0.01 to 4.00. Default
is 0.10 (10%).
* @param number $options Standard code Printer::PDF417_STANDARD with
* start/end bars, or truncated code Printer::PDF417_TRUNCATED with
start bars only.
* @throws Exception If this profile indicates that PDF417 code is not
supported
*/
public function pdf417Code($content, $width = 3, $heightMultiplier = 3,
$dataColumnCount = 0, $ec = 0.10, $options = Printer::PDF417_STANDARD)
{
self::validateString($content, __FUNCTION__, 'content');
self::validateInteger($width, 2, 8, __FUNCTION__,
'width');
self::validateInteger($heightMultiplier, 2, 8, __FUNCTION__,
'heightMultiplier');
self::validateInteger($dataColumnCount, 0, 30, __FUNCTION__,
'dataColumnCount');
self::validateFloat($ec, 0.01, 4.00, __FUNCTION__, 'ec');
self::validateInteger($options, 0, 1, __FUNCTION__,
'options');
if ($content == "") {
return;
}
if (!$this -> profile -> getSupportsPdf417Code()) {
// TODO use software rendering via a library instead
throw new Exception("PDF417 codes are not supported on
your printer.");
}
$cn = '0'; // Code type for pdf417 code
// Select model: standard or truncated
$this -> wrapperSend2dCodeData(chr(70), $cn, chr($options));
// Column count
$this -> wrapperSend2dCodeData(chr(65), $cn,
chr($dataColumnCount));
// Set dot sizes
$this -> wrapperSend2dCodeData(chr(67), $cn, chr($width));
$this -> wrapperSend2dCodeData(chr(68), $cn,
chr($heightMultiplier));
// Set error correction ratio: 1% to 400%
$ec_int = (int)ceil(floatval($ec) * 10);
$this -> wrapperSend2dCodeData(chr(69), $cn, chr($ec_int),
'1');
// Send content & print
$this -> wrapperSend2dCodeData(chr(80), $cn, $content,
'0');
$this -> wrapperSend2dCodeData(chr(81), $cn, '',
'0');
}
/**
* Generate a pulse, for opening a cash drawer if one is connected.
* The default settings should open an Epson drawer.
*
* @param int $pin 0 or 1, for pin 2 or pin 5 kick-out connector
respectively.
* @param int $on_ms pulse ON time, in milliseconds.
* @param int $off_ms pulse OFF time, in milliseconds.
*/
public function pulse($pin = 0, $on_ms = 120, $off_ms = 240)
{
self::validateInteger($pin, 0, 1, __FUNCTION__);
self::validateInteger($on_ms, 1, 511, __FUNCTION__);
self::validateInteger($off_ms, 1, 511, __FUNCTION__);
$this -> connector -> write(self::ESC . "p" .
chr($pin + 48) . chr($on_ms / 2) . chr($off_ms / 2));
}
/**
* Print the given data as a QR code on the printer.
*
* @param string $content The content of the code. Numeric data will be
more efficiently compacted.
* @param int $ec Error-correction level to use. One of
Printer::QR_ECLEVEL_L (default), Printer::QR_ECLEVEL_M,
Printer::QR_ECLEVEL_Q or Printer::QR_ECLEVEL_H. Higher error correction
results in a less compact code.
* @param int $size Pixel size to use. Must be 1-16 (default 3)
* @param int $model QR code model to use. Must be one of
Printer::QR_MODEL_1, Printer::QR_MODEL_2 (default) or Printer::QR_MICRO
(not supported by all printers).
*/
public function qrCode($content, $ec = Printer::QR_ECLEVEL_L, $size =
3, $model = Printer::QR_MODEL_2)
{
self::validateString($content, __FUNCTION__);
self::validateInteger($ec, 0, 3, __FUNCTION__);
self::validateInteger($size, 1, 16, __FUNCTION__);
self::validateInteger($model, 1, 3, __FUNCTION__);
if ($content == "") {
return;
}
if (!$this -> profile -> getSupportsQrCode()) {
// TODO use software rendering via phpqrcode instead
throw new Exception("QR codes are not supported on your
printer.");
}
$cn = '1'; // Code type for QR code
// Select model: 1, 2 or micro.
$this -> wrapperSend2dCodeData(chr(65), $cn, chr(48 + $model) .
chr(0));
// Set dot size.
$this -> wrapperSend2dCodeData(chr(67), $cn, chr($size));
// Set error correction level: L, M, Q, or H
$this -> wrapperSend2dCodeData(chr(69), $cn, chr(48 + $ec));
// Send content & print
$this -> wrapperSend2dCodeData(chr(80), $cn, $content,
'0');
$this -> wrapperSend2dCodeData(chr(81), $cn, '',
'0');
}
/**
* Switch character table (code page) manually. Used in conjunction
with textRaw() to
* print special characters which can't be encoded automatically.
*
* @param int $table The table to select. Available code tables are
model-specific.
*/
public function selectCharacterTable($table = 0)
{
self::validateInteger($table, 0, 255, __FUNCTION__);
$supported = $this -> profile -> getCodePages();
if (!isset($supported[$table])) {
throw new InvalidArgumentException("There is no code table
$table allowed by this printer's capability profile.");
}
$this -> characterTable = $table;
if ($this -> profile -> getSupportsStarCommands()) {
/* Not an ESC/POS command: STAR printers stash all the extra
code pages under a different command. */
$this -> connector -> write(self::ESC . self::GS .
"t" . chr($table));
return;
}
$this -> connector -> write(self::ESC . "t" .
chr($table));
}
/**
* Select print mode(s).
*
* Several MODE_* constants can be OR'd together passed to this
function's `$mode` argument. The valid modes are:
* - Printer::MODE_FONT_A
* - Printer::MODE_FONT_B
* - Printer::MODE_EMPHASIZED
* - Printer::MODE_DOUBLE_HEIGHT
* - Printer::MODE_DOUBLE_WIDTH
* - Printer::MODE_UNDERLINE
*
* @param int $mode The mode to use. Default is Printer::MODE_FONT_A,
with no special formatting. This has a similar effect to running
initialize().
*/
public function selectPrintMode($mode = Printer::MODE_FONT_A)
{
$allModes = Printer::MODE_FONT_B | self::MODE_EMPHASIZED |
self::MODE_DOUBLE_HEIGHT | self::MODE_DOUBLE_WIDTH | self::MODE_UNDERLINE;
if (!is_integer($mode) || $mode < 0 || ($mode & $allModes)
!= $mode) {
throw new InvalidArgumentException("Invalid mode");
}
$this -> connector -> write(self::ESC . "!" .
chr($mode));
}
/**
* Set barcode height.
*
* @param int $height Height in dots. If not specified, 8 will be used.
*/
public function setBarcodeHeight($height = 8)
{
self::validateInteger($height, 1, 255, __FUNCTION__);
$this -> connector -> write(self::GS . "h" .
chr($height));
}
/**
* Set barcode bar width.
*
* @param int $width Bar width in dots. If not specified, 3 will be
used.
* Values above 6 appear to have no effect.
*/
public function setBarcodeWidth($width = 3)
{
self::validateInteger($width, 1, 255, __FUNCTION__);
$this -> connector -> write(self::GS . "w" .
chr($width));
}
/**
* Set the position for the Human Readable Interpretation (HRI) of
barcode characters.
*
* @param int $position. Use Printer::BARCODE_TEXT_NONE to hide the
text (default),
* or any combination of Printer::BARCODE_TEXT_ABOVE and
Printer::BARCODE_TEXT_BELOW
* flags to display the text.
*/
public function setBarcodeTextPosition($position =
Printer::BARCODE_TEXT_NONE)
{
self::validateInteger($position, 0, 3, __FUNCTION__, "Barcode
text position");
$this -> connector -> write(self::GS . "H" .
chr($position));
}
/**
* Turn double-strike mode on/off.
*
* @param boolean $on true for double strike, false for no double
strike
*/
public function setDoubleStrike($on = true)
{
self::validateBoolean($on, __FUNCTION__);
$this -> connector -> write(self::ESC . "G". ($on ?
chr(1) : chr(0)));
}
/**
* Select print color on printers that support multiple colors.
*
* @param int $color Color to use. Must be either Printer::COLOR_1
(default), or Printer::COLOR_2.
*/
public function setColor($color = Printer::COLOR_1)
{
self::validateInteger($color, 0, 1, __FUNCTION__,
"Color");
$this -> connector -> write(self::ESC . "r" .
chr($color));
}
/**
* Turn emphasized mode on/off.
*
* @param boolean $on true for emphasis, false for no emphasis
*/
public function setEmphasis($on = true)
{
self::validateBoolean($on, __FUNCTION__);
$this -> connector -> write(self::ESC . "E". ($on ?
chr(1) : chr(0)));
}
/**
* Select font. Most printers have two fonts (Fonts A and B), and some
have a third (Font C).
*
* @param int $font The font to use. Must be either Printer::FONT_A,
Printer::FONT_B, or Printer::FONT_C.
*/
public function setFont($font = Printer::FONT_A)
{
self::validateInteger($font, 0, 2, __FUNCTION__);
$this -> connector -> write(self::ESC . "M" .
chr($font));
}
/**
* Select justification.
*
* @param int $justification One of Printer::JUSTIFY_LEFT,
Printer::JUSTIFY_CENTER, or Printer::JUSTIFY_RIGHT.
*/
public function setJustification($justification =
Printer::JUSTIFY_LEFT)
{
self::validateInteger($justification, 0, 2, __FUNCTION__);
$this -> connector -> write(self::ESC . "a" .
chr($justification));
}
/**
* Set the height of the line.
*
* Some printers will allow you to overlap lines with a smaller line
feed.
*
* @param int $height The height of each line, in dots. If not set, the
printer
* will reset to its default line spacing.
*/
public function setLineSpacing($height = null)
{
if ($height === null) {
// Reset to default
$this -> connector -> write(self::ESC . "2");
// Revert to default line spacing
return;
}
self::validateInteger($height, 1, 255, __FUNCTION__);
$this -> connector -> write(self::ESC . "3" .
chr($height));
}
/**
* Set print area left margin. Reset to default with
Printer::initialize()
*
* @param int $margin The left margin to set on to the print area, in
dots.
*/
public function setPrintLeftMargin($margin = 0)
{
self::validateInteger($margin, 0, 65535, __FUNCTION__);
$this -> connector -> write(Printer::GS . 'L' .
self::intLowHigh($margin, 2));
}
/**
* Set print area width. This can be used to add a right margin to the
print area.
* Reset to default with Printer::initialize()
*
* @param int $width The width of the page print area, in dots.
*/
public function setPrintWidth($width = 512)
{
self::validateInteger($width, 1, 65535, __FUNCTION__);
$this -> connector -> write(Printer::GS . 'W' .
self::intLowHigh($width, 2));
}
/**
* Attach a different print buffer to the printer. Buffers are
responsible for handling text output to the printer.
*
* @param PrintBuffer $buffer The buffer to use.
* @throws InvalidArgumentException Where the buffer is already
attached to a different printer.
*/
public function setPrintBuffer(PrintBuffer $buffer)
{
if ($buffer === $this -> buffer) {
return;
}
if ($buffer -> getPrinter() != null) {
throw new InvalidArgumentException("This buffer is already
attached to a printer.");
}
if ($this -> buffer !== null) {
$this -> buffer -> setPrinter(null);
}
$this -> buffer = $buffer;
$this -> buffer -> setPrinter($this);
}
/**
* Set black/white reverse mode on or off. In this mode, text is
printed white on a black background.
*
* @param boolean $on True to enable, false to disable.
*/
public function setReverseColors($on = true)
{
self::validateBoolean($on, __FUNCTION__);
$this -> connector -> write(self::GS . "B" . ($on ?
chr(1) : chr(0)));
}
/**
* Set the size of text, as a multiple of the normal size.
*
* @param int $widthMultiplier Multiple of the regular height to use
(range 1 - 8)
* @param int $heightMultiplier Multiple of the regular height to use
(range 1 - 8)
*/
public function setTextSize($widthMultiplier, $heightMultiplier)
{
self::validateInteger($widthMultiplier, 1, 8, __FUNCTION__);
self::validateInteger($heightMultiplier, 1, 8, __FUNCTION__);
$c = pow(2, 4) * ($widthMultiplier - 1) + ($heightMultiplier - 1);
$this -> connector -> write(self::GS . "!" .
chr($c));
}
/**
* Set underline for printed text.
*
* Argument can be true/false, or one of UNDERLINE_NONE,
* UNDERLINE_SINGLE or UNDERLINE_DOUBLE.
*
* @param int $underline Either true/false, or one of
Printer::UNDERLINE_NONE, Printer::UNDERLINE_SINGLE or
Printer::UNDERLINE_DOUBLE. Defaults to Printer::UNDERLINE_SINGLE.
*/
public function setUnderline($underline = Printer::UNDERLINE_SINGLE)
{
/* Map true/false to underline constants */
if ($underline === true) {
$underline = Printer::UNDERLINE_SINGLE;
} elseif ($underline === false) {
$underline = Printer::UNDERLINE_NONE;
}
/* Set the underline */
self::validateInteger($underline, 0, 2, __FUNCTION__);
$this -> connector -> write(self::ESC . "-" .
chr($underline));
}
/**
* Add text to the buffer.
*
* Text should either be followed by a line-break, or feed() should be
called
* after this to clear the print buffer.
*
* @param string $str Text to print
*/
public function text($str = "")
{
self::validateString($str, __FUNCTION__);
$this -> buffer -> writeText((string)$str);
}
/**
* Add Chinese text to the buffer. This is a specific workaround for
the common Zijang printer- The printer will be switched to a two-byte mode
and sent GBK-encoded text.
*
* Support for this will be merged into a print buffer.
*
* @param string $str Text to print, as UTF-8
*/
public function textChinese($str = "")
{
self::validateString($str, __FUNCTION__);
$this -> connector -> write(self::FS . "&");
$str = iconv("UTF-8", "GBK//IGNORE", $str);
$this -> buffer -> writeTextRaw((string)$str);
$this -> connector -> write(self::FS . ".");
}
/**
* Add text to the buffer without attempting to interpret chararacter
codes.
*
* Text should either be followed by a line-break, or feed() should be
called
* after this to clear the print buffer.
*
* @param string $str Text to print
*/
public function textRaw($str = "")
{
self::validateString($str, __FUNCTION__);
$this -> buffer -> writeTextRaw((string)$str);
}
/**
* Wrapper for GS ( k, to calculate and send correct data length.
*
* @param string $fn Function to use
* @param string $cn Output code type. Affects available data
* @param string $data Data to send.
* @param string $m Modifier/variant for function. Often '0'
where used.
* @throws InvalidArgumentException Where the input lengths are bad.
*/
protected function wrapperSend2dCodeData($fn, $cn, $data =
'', $m = '')
{
if (strlen($m) > 1 || strlen($cn) != 1 || strlen($fn) != 1) {
throw new InvalidArgumentException("wrapperSend2dCodeData:
cn and fn must be one character each.");
}
$header = $this -> intLowHigh(strlen($data) + strlen($m) + 2,
2);
$this -> connector -> write(self::GS . "(k" .
$header . $cn . $fn . $m . $data);
}
/**
* Wrapper for GS ( L, to calculate and send correct data length.
*
* @param string $m Modifier/variant for function. Usually
'0'.
* @param string $fn Function number to use, as character.
* @param string $data Data to send.
* @throws InvalidArgumentException Where the input lengths are bad.
*/
protected function wrapperSendGraphicsData($m, $fn, $data =
'')
{
if (strlen($m) != 1 || strlen($fn) != 1) {
throw new
InvalidArgumentException("wrapperSendGraphicsData: m and fn must be
one character each.");
}
$header = $this -> intLowHigh(strlen($data) + 2, 2);
$this -> connector -> write(self::GS . "(L" .
$header . $m . $fn . $data);
}
/**
* Convert widths and heights to characters. Used before sending
graphics to set the size.
*
* @param array $inputs
* @param boolean $long True to use 4 bytes, false to use 2
* @return string
*/
protected static function dataHeader(array $inputs, $long = true)
{
$outp = array();
foreach ($inputs as $input) {
if ($long) {
$outp[] = Printer::intLowHigh($input, 2);
} else {
self::validateInteger($input, 0, 255, __FUNCTION__);
$outp[] = chr($input);
}
}
return implode("", $outp);
}
/**
* Generate two characters for a number: In lower and higher parts, or
more parts as needed.
*
* @param int $input Input number
* @param int $length The number of bytes to output (1 - 4).
*/
protected static function intLowHigh($input, $length)
{
$maxInput = (256 << ($length * 8) - 1);
self::validateInteger($length, 1, 4, __FUNCTION__);
self::validateInteger($input, 0, $maxInput, __FUNCTION__);
$outp = "";
for ($i = 0; $i < $length; $i++) {
$outp .= chr($input % 256);
$input = (int)($input / 256);
}
return $outp;
}
/**
* Throw an exception if the argument given is not a boolean
*
* @param boolean $test the input to test
* @param string $source the name of the function calling this
*/
protected static function validateBoolean($test, $source)
{
if (!($test === true || $test === false)) {
throw new InvalidArgumentException("Argument to $source
must be a boolean");
}
}
/**
* Throw an exception if the argument given is not a float within the
specified range
*
* @param float $test the input to test
* @param float $min the minimum allowable value (inclusive)
* @param float $max the maximum allowable value (inclusive)
* @param string $source the name of the function calling this
* @param string $argument the name of the invalid parameter
*/
protected static function validateFloat($test, $min, $max, $source,
$argument = "Argument")
{
if (!is_numeric($test)) {
throw new InvalidArgumentException("$argument given to
$source must be a float, but '$test' was given.");
}
if ($test < $min || $test > $max) {
throw new InvalidArgumentException("$argument given to
$source must be in range $min to $max, but $test was given.");
}
}
/**
* Throw an exception if the argument given is not an integer within
the specified range
*
* @param int $test the input to test
* @param int $min the minimum allowable value (inclusive)
* @param int $max the maximum allowable value (inclusive)
* @param string $source the name of the function calling this
* @param string $argument the name of the invalid parameter
*/
protected static function validateInteger($test, $min, $max, $source,
$argument = "Argument")
{
self::validateIntegerMulti($test, array(array($min, $max)),
$source, $argument);
}
/**
* Throw an exception if the argument given is not an integer within
one of the specified ranges
*
* @param int $test the input to test
* @param arrray $ranges array of two-item min/max ranges.
* @param string $source the name of the function calling this
* @param string $source the name of the function calling this
* @param string $argument the name of the invalid parameter
*/
protected static function validateIntegerMulti($test, array $ranges,
$source, $argument = "Argument")
{
if (!is_integer($test)) {
throw new InvalidArgumentException("$argument given to
$source must be a number, but '$test' was given.");
}
$match = false;
foreach ($ranges as $range) {
$match |= $test >= $range[0] && $test <=
$range[1];
}
if (!$match) {
// Put together a good error "range 1-2 or 4-6"
$rangeStr = "range ";
for ($i = 0; $i < count($ranges); $i++) {
$rangeStr .= $ranges[$i][0] . "-" .
$ranges[$i][1];
if ($i == count($ranges) - 1) {
continue;
} elseif ($i == count($ranges) - 2) {
$rangeStr .= " or ";
} else {
$rangeStr .= ", ";
}
}
throw new InvalidArgumentException("$argument given to
$source must be in $rangeStr, but $test was given.");
}
}
/**
* Throw an exception if the argument given can't be cast to a
string
*
* @param string $test the input to test
* @param string $source the name of the function calling this
* @param string $argument the name of the parameter being validated
* @throws InvalidArgumentException Where the argument is not valid
*/
protected static function validateString($test, $source, $argument =
"Argument")
{
if (is_object($test) && !method_exists($test,
'__toString')) {
throw new InvalidArgumentException("$argument to $source
must be a string");
}
}
/**
* Throw an exception if the argument doesn't match the given
regex.
*
* @param string $test the input to test
* @param string $source the name of the function calling this
* @param string $regex valid values for this attribute, as a regex
* @param string $argument the name of the parameter being validated
* @throws InvalidArgumentException Where the argument is not valid
*/
protected static function validateStringRegex($test, $source, $regex,
$argument = "Argument")
{
if (preg_match($regex, $test) === 0) {
throw new InvalidArgumentException("$argument given to
$source is invalid. It should match regex '$regex', but
'$test' was given.");
}
}
}
PK�"�[���,O,Olibraries/Escpos/README.mdnu�[���#
ESC/POS Print Driver for PHP
[](https://travis-ci.org/mike42/escpos-php)
[](https://packagist.org/packages/mike42/escpos-php)
[](https://packagist.org/packages/mike42/escpos-php)
[](https://packagist.org/packages/mike42/escpos-php)
[](https://coveralls.io/github/mike42/escpos-php?branch=development)
This project implements a subset of Epson's ESC/POS protocol for
thermal receipt printers. It allows you to generate and print receipts with
basic formatting, cutting, and barcodes on a compatible printer.
The library was developed to add drop-in support for receipt printing to
any PHP app, including web-based point-of-sale (POS) applications.
## Compatibility
### Interfaces and operating systems
This driver is known to work with the following OS/interface combinations:
<table>
<tr>
<th> </th>
<th>Linux</th>
<th>Mac</th>
<th>Windows</th>
</tr>
<tr>
<th>Ethernet</th>
<td><a
href="https://github.com/mike42/escpos-php/tree/master/example/interface/ethernet.php">Yes</a></td>
<td><a
href="https://github.com/mike42/escpos-php/tree/master/example/interface/ethernet.php">Yes</a></td>
<td><a
href="https://github.com/mike42/escpos-php/tree/master/example/interface/ethernet.php">Yes</a></td>
</tr>
<tr>
<th>USB</th>
<td><a
href="https://github.com/mike42/escpos-php/tree/master/example/interface/linux-usb.php">Yes</a></td>
<td>Not tested</td>
<td><a
href="https://github.com/mike42/escpos-php/tree/master/example/interface/windows-usb.php">Yes</a></td>
</tr>
<tr>
<th>USB-serial</th>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
</tr>
<tr>
<th>Serial</th>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
</tr>
<tr>
<th>Parallel</th>
<td><a
href="https://github.com/mike42/escpos-php/tree/master/example/interface/windows-lpt.php">Yes</a></td>
<td>Not tested</td>
<td>Yes</td>
</tr>
<tr>
<th>SMB shared</th>
<td><a
href="https://github.com/mike42/escpos-php/tree/master/example/interface/smb.php">Yes</a></td>
<td>No</td>
<td><a
href="https://github.com/mike42/escpos-php/tree/master/example/interface/smb.php">Yes</a></td>
</tr>
<tr>
<th>CUPS hosted</th>
<td><a
href="https://github.com/mike42/escpos-php/tree/master/example/interface/cups.php">Yes</a></td>
<td><a
href="https://github.com/mike42/escpos-php/tree/master/example/interface/cups.php">Yes</a></td>
<td>No</td>
</tr>
</table>
### Printers
Many thermal receipt printers support ESC/POS to some degree. This driver
has been known to work with:
- AURES ODP-333
- AURES ODP-500
- Bixolon SRP-350III
- Citizen CBM1000-II
- Citizen CT-S310II
- Daruma DR800
- EPOS TEP 220M
- Epson TM-T88II
- Epson TM-T88III
- Epson TM-T88IV
- Epson TM-T88V
- Epson TM-T70
- Epson TM-T82II
- Epson TM-T20
- Epson TM-T20II
- Epson TM-T70II
- Epson TM-T81
- Epson TM-U220
- Epson TM-U295 (requires `release()` to release slip).
- Epson TM-U590 and TM-U590P
- Epson FX-890 (requires `feedForm()` to release paper).
- Equal (EQ-IT-001) POS-58
- Excelvan HOP-E58
- Excelvan HOP-E200
- Excelvan HOP-E801
- Excelvan ZJ-8220
- Gainscha GP-5890x (Also marketed as EC Line 5890x)
- Gainscha GP-U80300I (Also marketed as gprinter GP-U80300I)
- gprinter GP-U80160I
- Hasar HTP 250
- Metapace T-1
- Metapace T-25
- Nexa PX700
- Okipos 80 Plus III
- Orient BTP-R580
- P-822D
- P85A-401 (make unknown)
- Rongta RP326US
- Rongta RP58-U
- SEYPOS PRP-300 (Also marketed as TYSSO PRP-300)
- Silicon SP-201 / RP80USE
- Star TSP100 ECO
- Star TSP100III FuturePRNT
- Star TSP-650
- Star TUP-592
- SPRT SP-POS88V
- Xprinter F-900
- XPrinter XP-Q20011
- Xprinter XP-Q800
- Xprinter XP-80C
- Venus V248T
- Zjiang NT-58H
- Zjiang ZJ-5870
- Zjiang ZJ-5890T (Marketed as POS 5890T)
- Zjiang ZJ-5890K
If you use any other printer with this code, please [let us
know](https://github.com/mike42/escpos-php/issues/new) so that it can be
added to the list.
## Basic usage
### Include the library
#### Composer
If you are using composer, then add `mike42/escpos-php` as a dependency:
```bash
composer require mike42/escpos-php
```
In this case, you would include composer's auto-loader at the top of
your source files:
```php
<?php
require __DIR__ . '/vendor/autoload.php';
```
#### Manually
If you don't have composer available, then simply download the code
and include `autoload.php`:
```bash
git clone https://github.com/mike42/escpos-php vendor/mike42/escpos-php
```
```php
<?php
require __DIR__ . '/vendor/mike42/escpos-php/autoload.php';
```
#### Requirements
To maintain compatibility with as many systems as possible, this driver has
few
hard dependencies:
- PHP 5.3 or above
- `mbstring` extension, since the driver accepts UTF-8 encoding.
It is also suggested that you install either `imagick` or `gd`, so that you
can
print images.
A number of optional packages can be added to enable more specific
features. These
are described in the "suggest" section of
[composer.json](https://github.com/mike42/escpos-php/tree/master/composer.json).
### The 'Hello World' receipt
To make use of this driver, your server (where PHP is installed) must be
able to communicate with your printer. Start by generating a simple receipt
and sending it to your printer using the command-line.
```php
<?php
/* Call this file 'hello-world.php' */
require __DIR__ . '/vendor/autoload.php';
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
use Mike42\Escpos\Printer;
$connector = new FilePrintConnector("php://stdout");
$printer = new Printer($connector);
$printer -> text("Hello World!\n");
$printer -> cut();
$printer -> close();
```
Some examples are below for common interfaces.
Communicate with a printer with an Ethernet interface using `netcat`:
```bash
php hello-world.php | nc 10.x.x.x. 9100
```
A USB local printer connected with `usblp` on Linux has a device file
(Includes USB-parallel interfaces):
```bash
php hello-world.php > /dev/usb/lp0
```
A computer installed into the local `cups` server is accessed through `lp`
or `lpr`:
```bash
php hello-world.php > foo.txt
lpr -o raw -H localhost -P printer foo.txt
```
A local or networked printer on a Windows computer is mapped in to a file,
and generally requires you to share the printer first:
```
php hello-world.php > foo.txt
net use LPT1 \\server\printer
copy foo.txt LPT1
del foo.txt
```
If you have troubles at this point, then you should consult your OS and
printer system documentation to try to find a working print command.
### Using a PrintConnector
To print receipts from PHP, use the most applicable
[PrintConnector](https://github.com/mike42/escpos-php/tree/master/src/Mike42/Escpos/PrintConnectors)
for your setup. The connector simply provides the plumbing to get data to
the printer.
For example, a `NetworkPrintConnector` accepts an IP address and port:
```php
use Mike42\Escpos\PrintConnectors\NetworkPrintConnector;
use Mike42\Escpos\Printer;
$connector = new NetworkPrintConnector("10.x.x.x", 9100);
$printer = new Printer($connector);
try {
// ... Print stuff
} finally {
$printer -> close();
}
```
While a serial printer might use:
```php
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
use Mike42\Escpos\Printer;
$connector = new FilePrintConnector("/dev/ttyS0");
$printer = new Printer($connector);
```
For each OS/interface combination that's supported, there are examples
in the compatibility section of how a `PrintConnector` would be
constructed. If you can't get a `PrintConnector` to work, then be sure
to include the working print command in bug.
### Using a CapabilityProfile
Support for commands and code pages varies between printer vendors and
models. By default, the driver will accept UTF-8, and output commands that
are suitable for Epson TM-series printers.
When trying out a new brand of printer, it's a good idea to use the
"simple" `CapabilityProfile`, which instructs the driver to avoid
the use of advanced features (generally simpler image handling, ASCII-only
text).
```php
use Mike42\Escpos\PrintConnectors\WindowsPrintConnector;
use Mike42\Escpos\CapabilityProfile;
$profile = CapabilityProfile::load("simple");
$connector = new WindowsPrintConnector("smb://computer/printer");
$printer = new Printer($connector, $profile);
```
As another example, Star-branded printers use different commands:
```php
use Mike42\Escpos\PrintConnectors\WindowsPrintConnector;
use Mike42\Escpos\CapabilityProfile;
$profile = CapabilityProfile::load("SP2000")
$connector = new WindowsPrintConnector("smb://computer/printer");
$printer = new Printer($connector, $profile);
```
For a list of available profiles, or to have support for your printer
improved, please see the upstream
[receipt-print-hq/escpos-printer-db](https://github.com/receipt-print-hq/escpos-printer-db)
project.
### Tips & examples
On Linux, your printer device file will be somewhere like `/dev/lp0`
(parallel), `/dev/usb/lp1` (USB), `/dev/ttyUSB0` (USB-Serial), `/dev/ttyS0`
(serial).
On Windows, the device files will be along the lines of `LPT1` (parallel)
or `COM1` (serial). Use the `WindowsPrintConnector` to tap into system
printing on Windows (eg. [Windows
USB](https://github.com/mike42/escpos-php/tree/master/example/interface/windows-usb.php),
[SMB](https://github.com/mike42/escpos-php/tree/master/example/interface/smb.php)
or [Windows
LPT](https://github.com/mike42/escpos-php/tree/master/example/interface/windows-lpt.php))
- this submits print jobs via a queue rather than communicating directly
with the printer.
A complete real-world receipt can be found in the code of
[Auth](https://github.com/mike42/Auth) in
[ReceiptPrinter.php](https://github.com/mike42/Auth/blob/master/lib/misc/ReceiptPrinter.php).
It includes justification, boldness, and a barcode.
Other examples are located in the
[example/](https://github.com/mike42/escpos-php/blob/master/example/)
directory.
## Available methods
### __construct(PrintConnector $connector, CapabilityProfile $profile)
Construct new print object.
Parameters:
- `PrintConnector $connector`: The PrintConnector to send data to.
- `CapabilityProfile $profile` Supported features of this printer. If not
set, the "default" CapabilityProfile will be used, which is
suitable for Epson printers.
See
[example/interface/](https://github.com/mike42/escpos-php/tree/master/example/interface/)
for ways to open connections for different platforms and interfaces.
### barcode($content, $type)
Print a barcode.
Parameters:
- `string $content`: The information to encode.
- `int $type`: The barcode standard to output. If not specified,
`Printer::BARCODE_CODE39` will be used.
Currently supported barcode standards are (depending on your printer):
- `BARCODE_UPCA`
- `BARCODE_UPCE`
- `BARCODE_JAN13`
- `BARCODE_JAN8`
- `BARCODE_CODE39`
- `BARCODE_ITF`
- `BARCODE_CODABAR`
Note that some barcode standards can only encode numbers, so attempting to
print non-numeric codes with them may result in strange behaviour.
### bitImage(EscposImage $image, $size)
See [graphics()](#graphicsescposimage-image-size) below.
### cut($mode, $lines)
Cut the paper.
Parameters:
- `int $mode`: Cut mode, either `Printer::CUT_FULL` or
`Printer::CUT_PARTIAL`. If not specified, `Printer::CUT_FULL` will be used.
- `int $lines`: Number of lines to feed before cutting. If not specified, 3
will be used.
### feed($lines)
Print and feed line / Print and feed n lines.
Parameters:
- `int $lines`: Number of lines to feed
### feedForm()
Some printers require a form feed to release the paper. On most printers,
this command is only useful in page mode, which is not implemented in this
driver.
### feedReverse($lines)
Print and reverse feed n lines.
Parameters:
- `int $lines`: number of lines to feed. If not specified, 1 line will be
fed.
### graphics(EscposImage $image, $size)
Print an image to the printer.
Parameters:
- `EscposImage $img`: The image to print.
- `int $size`: Output size modifier for the image.
Size modifiers are:
- `IMG_DEFAULT` (leave image at original size)
- `IMG_DOUBLE_WIDTH`
- `IMG_DOUBLE_HEIGHT`
A minimal example:
```php
<?php
$img = EscposImage::load("logo.png");
$printer -> graphics($img);
```
See the
[example/](https://github.com/mike42/escpos-php/blob/master/example/)
folder for detailed examples.
The function [bitImage()](#bitimageescposimage-image-size) takes the same
parameters, and can be used if your printer doesn't support the newer
graphics commands. As an additional fallback, the `bitImageColumnFormat()`
function is also provided.
### initialize()
Initialize printer. This resets formatting back to the defaults.
### pdf417Code($content, $width, $heightMultiplier, $dataColumnCount, $ec,
$options)
Print a two-dimensional data code using the PDF417 standard.
Parameters:
- `string $content`: Text or numbers to store in the code
- `number $width`: Width of a module (pixel) in the printed code. Default
is 3 dots.
- `number $heightMultiplier`: Multiplier for height of a module. Default is
3 times the width.
- `number $dataColumnCount`: Number of data columns to use. 0 (default) is
to auto-calculate. Smaller numbers will result in a narrower code, making
larger pixel sizes possible. Larger numbers require smaller pixel sizes.
- `real $ec`: Error correction ratio, from 0.01 to 4.00. Default is 0.10
(10%).
- `number $options`: Standard code `Printer::PDF417_STANDARD` with
start/end bars, or truncated code `Printer::PDF417_TRUNCATED` with start
bars only.
### pulse($pin, $on_ms, $off_ms)
Generate a pulse, for opening a cash drawer if one is connected. The
default settings (0, 120, 240) should open an Epson drawer.
Parameters:
- `int $pin`: 0 or 1, for pin 2 or pin 5 kick-out connector respectively.
- `int $on_ms`: pulse ON time, in milliseconds.
- `int $off_ms`: pulse OFF time, in milliseconds.
### qrCode($content, $ec, $size, $model)
Print the given data as a QR code on the printer.
- `string $content`: The content of the code. Numeric data will be more
efficiently compacted.
- `int $ec` Error-correction level to use. One of `Printer::QR_ECLEVEL_L`
(default), `Printer::QR_ECLEVEL_M`, `Printer::QR_ECLEVEL_Q` or
`Printer::QR_ECLEVEL_H`. Higher error correction results in a less compact
code.
- `int $size`: Pixel size to use. Must be 1-16 (default 3)
- `int $model`: QR code model to use. Must be one of `Printer::QR_MODEL_1`,
`Printer::QR_MODEL_2` (default) or `Printer::QR_MICRO` (not supported by
all printers).
### selectPrintMode($mode)
Select print mode(s).
Parameters:
- `int $mode`: The mode to use. Default is `Printer::MODE_FONT_A`, with no
special formatting. This has a similar effect to running `initialize()`.
Several MODE_* constants can be OR'd together passed to this
function's `$mode` argument. The valid modes are:
- `MODE_FONT_A`
- `MODE_FONT_B`
- `MODE_EMPHASIZED`
- `MODE_DOUBLE_HEIGHT`
- `MODE_DOUBLE_WIDTH`
- `MODE_UNDERLINE`
### setBarcodeHeight($height)
Set barcode height.
Parameters:
- `int $height`: Height in dots. If not specified, 8 will be used.
### setBarcodeWidth($width)
Set barcode bar width.
Parameters:
- `int $width`: Bar width in dots. If not specified, 3 will be used. Values
above 6 appear to have no effect.
### setColor($color)
Select print color - on printers that support multiple colors.
Parameters:
- `int $color`: Color to use. Must be either `Printer::COLOR_1` (default),
or `Printer::COLOR_2`
### setDoubleStrike($on)
Turn double-strike mode on/off.
Parameters:
- `boolean $on`: true for double strike, false for no double strike.
### setEmphasis($on)
Turn emphasized mode on/off.
Parameters:
- `boolean $on`: true for emphasis, false for no emphasis.
### setFont($font)
Select font. Most printers have two fonts (Fonts A and B), and some have a
third (Font C).
Parameters:
- `int $font`: The font to use. Must be either `Printer::FONT_A`,
`Printer::FONT_B`, or `Printer::FONT_C`.
### setJustification($justification)
Select justification.
Parameters:
- `int $justification`: One of `Printer::JUSTIFY_LEFT`,
`Printer::JUSTIFY_CENTER`, or `Printer::JUSTIFY_RIGHT`.
### setLineSpacing($height)
Set the height of the line.
Some printers will allow you to overlap lines with a smaller line feed.
Parameters:
- `int $height`: The height of each line, in dots. If not set, the printer
will reset to its default line spacing.
### setPrintLeftMargin($margin)
Set print area left margin. Reset to default with `Printer::initialize()`.
Parameters:
- `int $margin`: The left margin to set on to the print area, in dots.
### setPrintWidth($width)
Set print area width. This can be used to add a right margin to the print
area. Reset to default with `Printer::initialize()`.
Parameters:
- `int $width`: The width of the page print area, in dots.
### setReverseColors($on)
Set black/white reverse mode on or off. In this mode, text is printed white
on a black background.
Parameters:
- `boolean $on`: True to enable, false to disable.
### setTextSize($widthMultiplier, $heightMultiplier)
Set the size of text, as a multiple of the normal size.
Parameters:
- `int $widthMultiplier`: Multiple of the regular height to use (range 1 -
8).
- `int $heightMultiplier`: Multiple of the regular height to use (range 1 -
8).
### setUnderline($underline)
Set underline for printed text.
Parameters:
- `int $underline`: Either `true`/`false`, or one of
`Printer::UNDERLINE_NONE`, `Printer::UNDERLINE_SINGLE` or
`Printer::UNDERLINE_DOUBLE`. Defaults to `Printer::UNDERLINE_SINGLE`.
### text($str)
Add text to the buffer. Text should either be followed by a line-break, or
`feed()` should be called after this.
Parameters:
- `string $str`: The string to print.
# Further notes
Posts I've written up for people who are learning how to use receipt
printers:
* [What is ESC/POS, and how do I use
it?](https://mike42.me/blog/what-is-escpos-and-how-do-i-use-it), which
documents the output of `example/demo.php`.
* [Setting up an Epson receipt
printer](https://mike42.me/blog/2014-20-26-setting-up-an-epson-receipt-printer)
* [Getting a USB receipt printer working on
Linux](https://mike42.me/blog/2015-03-getting-a-usb-receipt-printer-working-on-linux)
# Development
This code is MIT licensed, and you are encouraged to contribute any
modifications back to the project.
For development, it's suggested that you load `imagick`, `gd` and
`Xdebug` PHP exensions, and install `composer`.
The tests are executed on [Travis
CI](https://travis-ci.org/mike42/escpos-php) over PHP 5.3, 5.4, 5.5, 5.7,
7, and HHVM. Earlier versions of PHP are not supported.
Fetch a copy of this code and load dependencies with composer:
git clone https://github.com/mike42/escpos-php
cd escpos-php/
composer install
Execute unit tests via `phpunit`:
php vendor/bin/phpunit --coverage-text
This project uses the PSR-2 standard, which can be checked via
[PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer):
php vendor/bin/phpcs --standard=psr2 src/ -n
The developer docs are build with
[doxygen](https://github.com/doxygen/doxygen). Re-build them to check for
documentation warnings:
make -C doc clean && make -C doc
Pull requests and bug reports welcome.
<!-- ## Other versions
TODO: Some notes about related OSS projects will go here.
Some forks of this project have been developed by others for specific use
cases. Improvements from the following projects have been incorporated into
escpos-php:
- [wdoyle/EpsonESCPOS-PHP](https://github.com/wdoyle/EpsonESCPOS-PHP)
- [ronisaha/php-esc-pos](https://github.com/ronisaha/php-esc-pos)-->
<!--
TODO: A table of printer models vs programming guides available via the web
would be good, but should go outside this README
## Vendor documentation
Epson notes that not all of its printers support all ESC/POS features, and
includes a table in their documentation:
* [FAQ about ESC/POS from
Epson](http://content.epson.de/fileadmin/content/files/RSD/downloads/escpos.pdf)
Note that many printers produced by other vendors use the same standard,
and are compatible by varying degrees.
-->
PK�"�[~�t�!�!�,libraries/Escpos/resources/capabilities.jsonnu�[���{
"encodings": {
"CP1001": {
"name": "Unimplemented Star-specific
CP1001"
},
"CP1098": {
"name": "CP1098"
},
"CP1125": {
"iconv": "CP1125",
"name": "CP1125",
"python_encode": "cp1125"
},
"CP1250": {
"iconv": "CP1250",
"name": "CP1250",
"python_encode": "cp1250"
},
"CP1251": {
"iconv": "CP1251",
"name": "CP1251",
"python_encode": "cp1251"
},
"CP1252": {
"iconv": "CP1252",
"name": "CP1252",
"python_encode": "cp1252"
},
"CP1253": {
"iconv": "CP1253",
"name": "CP1253",
"python_encode": "cp1253"
},
"CP1254": {
"iconv": "CP1254",
"name": "CP1254",
"python_encode": "cp1254"
},
"CP1255": {
"iconv": "CP1255",
"name": "CP1255",
"python_encode": "cp1255"
},
"CP1256": {
"iconv": "CP1256",
"name": "CP1256",
"python_encode": "cp1256"
},
"CP1257": {
"iconv": "CP1257",
"name": "CP1257",
"python_encode": "cp1257"
},
"CP1258": {
"iconv": "CP1258",
"name": "CP1258",
"python_encode": "cp1258"
},
"CP2001": {
"name": "Unimplemented Star-specific
CP2001"
},
"CP3001": {
"name": "Unimplemented Star-specific
CP3001"
},
"CP3002": {
"name": "Unimplemented Star-specific
CP3002"
},
"CP3011": {
"data": [
"\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5",
"\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00a2\u00a3\u00a5\u20a7\u0192",
"\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u2310\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb",
"\u2591\u2592\u2593\u2502\u2524\u0100\u2562\u0146\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510",
"\u2514\u2534\u252c\u251c\u2500\u253c\u0101\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567",
"\u0160\u2564\u010d\u010c\u2558\u2552\u0123\u012a\u012b\u2518\u250c\u2588\u2584\u016b\u016a\u2580",
"\u03b1\u00df\u0393\u03c0\u03a3\u03c3\u00b5\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u03c6\u03b5\u2229",
"\u0112\u0113\u0122\u0137\u0136\u013c\u013b\u017e\u017d\u2219\u00b7\u221a\u0145\u0161\u25a0
"
],
"name": "CP3011 Latvian"
},
"CP3012": {
"data": [
"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f",
"\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042a\u042b\u042c\u042d\u042e\u042f",
"\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f",
"\u2591\u2592\u2593\u2502\u2524\u0100\u2562\u0146\u2555\u2563\u2551\u2557\u255d\u014c\u255b\u2510",
"\u2514\u2534\u252c\u251c\u2500\u253c\u0101\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567",
"\u0160\u2564\u010d\u010c\u2558\u2552\u0123\u012a\u012b\u2518\u250c\u2588\u2584\u016b\u016a\u2580",
"\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e\u044f",
"\u0112\u0113\u0122\u0137\u0136\u013c\u013b\u017e\u017d\u2219\u00b7\u221a\u0145\u0161\u25a0
"
],
"name": "CP3012 Cyrillic"
},
"CP3021": {
"name": "Unimplemented Star-specific
CP3021"
},
"CP3041": {
"name": "Unimplemented Star-specific
CP3041"
},
"CP3840": {
"name": "Unimplemented Star-specific
CP3840"
},
"CP3841": {
"name": "Unimplemented Star-specific
CP3841"
},
"CP3843": {
"name": "Unimplemented Star-specific
CP3843"
},
"CP3844": {
"name": "Unimplemented Star-specific
CP3844"
},
"CP3845": {
"name": "Unimplemented Star-specific
CP3845"
},
"CP3846": {
"name": "Unimplemented Star-specific
CP3846"
},
"CP3847": {
"name": "Unimplemented Star-specific
CP3847"
},
"CP3848": {
"name": "Unimplemented Star-specific
CP3848"
},
"CP437": {
"iconv": "CP437",
"name": "CP437",
"python_encode": "cp437"
},
"CP720": {
"name": "CP720",
"python_encode": "cp720"
},
"CP737": {
"iconv": "CP737",
"name": "CP737",
"python_encode": "cp737"
},
"CP747": {
"name": "CP747"
},
"CP772": {
"iconv": "CP772",
"name": "CP772"
},
"CP774": {
"iconv": "CP774",
"name": "CP774"
},
"CP775": {
"iconv": "CP775",
"name": "CP775",
"python_encode": "cp775"
},
"CP850": {
"iconv": "CP850",
"name": "CP850",
"python_encode": "cp850"
},
"CP851": {
"name": "Greek CP851",
"notes": "Not used, due to inconsistencies
between implementations."
},
"CP852": {
"iconv": "CP852",
"name": "CP852",
"python_encode": "cp852"
},
"CP853": {
"name": "CP853"
},
"CP855": {
"iconv": "CP855",
"name": "CP855",
"python_encode": "cp855"
},
"CP857": {
"iconv": "CP857",
"name": "CP857",
"python_encode": "cp857"
},
"CP858": {
"name": "CP858",
"python_encode": "cp858"
},
"CP860": {
"iconv": "CP860",
"name": "CP860",
"python_encode": "cp860"
},
"CP861": {
"iconv": "CP861",
"name": "CP861",
"python_encode": "cp861"
},
"CP862": {
"iconv": "CP862",
"name": "CP862",
"python_encode": "cp862"
},
"CP863": {
"iconv": "CP863",
"name": "CP863",
"python_encode": "cp863"
},
"CP864": {
"iconv": "CP864",
"name": "CP864",
"python_encode": "cp864"
},
"CP865": {
"iconv": "CP865",
"name": "CP865",
"python_encode": "cp865"
},
"CP866": {
"iconv": "CP866",
"name": "CP866",
"python_encode": "cp866"
},
"CP869": {
"iconv": "CP869",
"name": "CP869",
"python_encode": "cp869"
},
"CP874": {
"iconv": "CP874",
"name": "CP874",
"python_encode": "cp874"
},
"CP928": {
"name": "CP928"
},
"CP932": {
"iconv": "CP932",
"name": "CP932",
"python_encode": "cp932"
},
"ISO_8859-15": {
"iconv": "ISO_8859-15",
"name": "ISO_8859-15",
"python_encode": "iso8859-15"
},
"ISO_8859-2": {
"iconv": "ISO_8859-2",
"name": "ISO_8859-2",
"python_encode": "iso8859_2"
},
"ISO_8859-7": {
"iconv": "ISO_8859-7",
"name": "ISO_8859-7",
"python_encode": "iso8859_7"
},
"RK1048": {
"iconv": "RK1048",
"name": "RK1048"
},
"TCVN-3-1": {
"data": [
" ",
" ",
" \u0103\u00e2\u00ea\u00f4\u01a1\u01b0\u0111
",
" \u00e0\u1ea3\u00e3\u00e1\u1ea1
\u1eb1\u1eb3\u1eb5\u1eaf ",
" \u1eb7\u1ea7\u1ea9\u1eab\u1ea5\u1ead\u00e8
\u1ebb\u1ebd",
"\u00e9\u1eb9\u1ec1\u1ec3\u1ec5\u1ebf\u1ec7\u00ec\u1ec9
\u0129\u00ed\u1ecb\u00f2",
"
\u1ecf\u00f5\u00f3\u1ecd\u1ed3\u1ed5\u1ed7\u1ed1\u1ed9\u1edd\u1edf\u1ee1\u1edb\u1ee3\u00f9",
"
\u1ee7\u0169\u00fa\u1ee5\u1eeb\u1eed\u1eef\u1ee9\u1ef1\u1ef3\u1ef7\u1ef9\u00fd\u1ef5
"
],
"name": "Vietnamese TCVN-3 1"
},
"TCVN-3-2": {
"data": [
" ",
" ",
" \u0102\u00c2 \u00d0 \u00ca\u00d4\u01a0\u01af
",
" \u00c0\u1ea2\u00c3\u00c1\u1ea0
\u1eb0\u1eb2\u1eb4\u1eae ",
" \u1eb6\u1ea6\u1ea8\u1eaa\u1ea4\u1eac\u00c8
\u1eba\u1ebc",
"\u00c9\u1eb8\u1ec0\u1ec2\u1ec4\u1ebe\u1ec6\u00cc\u1ec8
\u0128\u00cd\u1eca\u00d2",
"
\u1ece\u00d5\u00d3\u1ecc\u1ed2\u1ed4\u1ed6\u1ed0\u1ed8\u1edc\u1ede\u1ee0\u1eda\u1ee2\u00d9",
"
\u1ee6\u0168\u00da\u1ee4\u1eea\u1eec\u1eee\u1ee8\u1ef0\u1ef2\u1ef6\u1ef8\u00dd\u1ef4
"
],
"name": "Vietnamese TCVN-3 1"
},
"Unknown": {
"name": "Unknown",
"notes": "Code page that has not yet been
identified."
}
},
"profiles": {
"OCD-300": {
"codePages": {
"0": "CP437",
"1": "CP932",
"2": "CP850",
"3": "CP860",
"4": "CP863",
"5": "CP865",
"6": "Unknown",
"7": "Unknown",
"8": "Unknown",
"9": "CP852",
"10": "CP862",
"11": "CP866",
"12": "CP1251",
"13": "CP1254",
"14": "CP1255",
"15": "CP1257",
"16": "CP1252",
"17": "CP1253",
"18": "CP1250",
"19": "CP858",
"20": "Unknown"
},
"colors": {
"0": "black"
},
"features": {
"barcodeB": false,
"bitImageColumn": false,
"bitImageRaster": false,
"graphics": false,
"highDensity": true,
"pdf417Code": false,
"pulseBel": false,
"pulseStandard": true,
"qrCode": false,
"starCommands": false
},
"fonts": {
"0": {
"columns": 20,
"name": "Font A"
}
},
"media": {
"width": {
"mm": "Unknown",
"pixels": "Unknown"
}
},
"name": "Aures OCP-300 Customer Display",
"notes": "This is a two-line, ESC/POS-aware
customer display from Aures. It has some graphics support via
vendor-provided tools, but is otherwise text-only.\n",
"vendor": "Aures"
},
"P822D": {
"codePages": {
"0": "CP437",
"1": "Unknown",
"2": "CP850",
"3": "CP860",
"4": "CP863",
"5": "CP865",
"6": "Unknown",
"7": "Unknown",
"8": "Unknown",
"9": "Unknown",
"10": "Unknown",
"16": "CP1252",
"17": "CP866",
"18": "CP852",
"19": "CP858",
"20": "Unknown",
"21": "Unknown",
"22": "Unknown",
"23": "Unknown",
"24": "CP747",
"25": "CP1257",
"27": "Unknown",
"28": "CP864",
"29": "CP1001",
"30": "Unknown",
"31": "Unknown",
"32": "CP1255",
"33": "CP720",
"34": "CP1256",
"35": "CP1257",
"50": "CP437",
"51": "Unknown",
"52": "CP437",
"53": "CP858",
"54": "CP852",
"55": "CP860",
"56": "CP861",
"57": "CP863",
"58": "CP865",
"59": "CP866",
"60": "CP855",
"61": "CP857",
"62": "CP862",
"63": "CP864",
"64": "CP737",
"65": "CP851",
"66": "CP869",
"67": "CP928",
"68": "CP772",
"69": "CP774",
"70": "CP874",
"71": "CP1252",
"72": "CP1250",
"73": "CP1251",
"74": "CP3840",
"75": "CP3841",
"76": "CP3843",
"77": "CP3844",
"78": "CP3845",
"79": "CP3846",
"80": "CP3847",
"81": "CP3848",
"82": "CP1001",
"83": "CP2001",
"84": "CP3001",
"85": "CP3002",
"86": "CP3011",
"87": "CP3012",
"88": "CP3021",
"89": "CP3041",
"255": "Unknown"
},
"colors": {
"0": "black"
},
"features": {
"barcodeB": true,
"bitImageColumn": true,
"bitImageRaster": true,
"graphics": false,
"highDensity": true,
"pdf417Code": true,
"pulseBel": false,
"pulseStandard": true,
"qrCode": true,
"starCommands": false
},
"fonts": {
"0": {
"columns": 42,
"name": "Font A"
},
"1": {
"columns": 56,
"name": "Font B"
}
},
"media": {
"width": {
"mm": "Unknown",
"pixels": "Unknown"
}
},
"name": "P822D",
"notes": "",
"vendor": "PBM"
},
"POS-5890": {
"codePages": {
"0": "CP437",
"1": "CP932",
"2": "CP850",
"3": "CP860",
"4": "CP863",
"5": "CP865",
"6": "Unknown",
"7": "Unknown",
"8": "Unknown",
"9": "Unknown",
"10": "Unknown",
"16": "CP1252",
"17": "CP866",
"18": "CP852",
"19": "CP858",
"20": "Unknown",
"21": "Unknown",
"22": "Unknown",
"23": "Unknown",
"24": "CP747",
"25": "CP1257",
"27": "CP1258",
"28": "CP864",
"31": "Unknown",
"32": "CP1255",
"50": "CP437",
"52": "CP437",
"53": "CP858",
"54": "CP852",
"55": "CP860",
"56": "CP861",
"57": "CP863",
"58": "CP865",
"59": "CP866",
"60": "CP855",
"61": "CP857",
"62": "CP862",
"63": "CP864",
"64": "CP737",
"65": "CP851",
"66": "CP869",
"68": "CP772",
"69": "CP774",
"71": "CP1252",
"72": "CP1250",
"73": "CP1251",
"74": "CP3840",
"76": "CP3843",
"77": "CP3844",
"78": "CP3845",
"79": "CP3846",
"80": "CP3847",
"81": "CP3848",
"83": "CP2001",
"84": "CP3001",
"85": "CP3002",
"86": "CP3011",
"87": "CP3012",
"88": "CP3021",
"89": "CP3041",
"90": "CP1253",
"91": "CP1254",
"92": "CP1256",
"93": "CP720",
"94": "CP1258",
"95": "CP775",
"96": "Unknown",
"255": "Unknown"
},
"colors": {
"0": "black"
},
"features": {
"barcodeB": false,
"bitImageColumn": false,
"bitImageRaster": true,
"graphics": false,
"highDensity": true,
"pdf417Code": false,
"pulseBel": false,
"pulseStandard": true,
"qrCode": false,
"starCommands": false
},
"fonts": {
"0": {
"columns": 42,
"name": "Font A"
},
"1": {
"columns": 56,
"name": "Font B"
}
},
"media": {
"width": {
"mm": "Unknown",
"pixels": "Unknown"
}
},
"name": "POS5890 Series",
"notes": "POS-5890 thermal printer series, also
marketed under various other names.\n",
"vendor": "Zjiang"
},
"SP2000": {
"codePages": {
"0": "CP437",
"1": "CP437",
"2": "CP932",
"3": "CP437",
"4": "CP858",
"5": "CP852",
"6": "CP860",
"7": "CP861",
"8": "CP863",
"9": "CP865",
"10": "CP866",
"11": "CP855",
"12": "CP857",
"13": "CP862",
"14": "CP864",
"15": "CP737",
"16": "CP851",
"17": "CP869",
"18": "CP928",
"19": "CP772",
"20": "CP774",
"21": "CP874",
"32": "CP1252",
"33": "CP1250",
"34": "CP1251",
"64": "CP3840",
"65": "CP3841",
"66": "CP3843",
"67": "CP3844",
"68": "CP3845",
"69": "CP3846",
"70": "CP3847",
"71": "CP3848",
"72": "CP1001",
"73": "CP2001",
"74": "CP3001",
"75": "CP3002",
"76": "CP3011",
"77": "CP3012",
"78": "CP3021",
"79": "CP3041",
"96": "Unknown",
"97": "Unknown",
"98": "Unknown",
"99": "Unknown",
"100": "Unknown",
"101": "Unknown",
"102": "Unknown",
"255": "Unknown"
},
"colors": {
"0": "black"
},
"features": {
"barcodeB": true,
"bitImageColumn": true,
"bitImageRaster": true,
"graphics": true,
"highDensity": true,
"pdf417Code": true,
"pulseBel": false,
"pulseStandard": true,
"qrCode": true,
"starCommands": true
},
"fonts": {
"0": {
"columns": 42,
"name": "Font A"
},
"1": {
"columns": 56,
"name": "Font B"
}
},
"media": {
"width": {
"mm": "Unknown",
"pixels": "Unknown"
}
},
"name": "SP2000 Series",
"notes": "Star SP2000 impact printer series with
ESC/POS emulation enabled",
"vendor": "Star Micronics"
},
"TEP-200M": {
"codePages": {
"0": "CP437",
"1": "CP932",
"2": "CP850",
"3": "CP860",
"4": "CP863",
"5": "CP865",
"6": "Unknown",
"7": "Unknown",
"8": "Unknown",
"11": "CP851",
"12": "CP853",
"13": "CP857",
"14": "CP737",
"15": "ISO_8859-7",
"16": "CP1252",
"17": "CP866",
"18": "CP852",
"19": "CP858",
"20": "Unknown",
"21": "CP874",
"22": "Unknown",
"23": "Unknown",
"24": "Unknown",
"25": "Unknown",
"26": "Unknown",
"30": "TCVN-3-1",
"31": "TCVN-3-2",
"32": "CP720",
"33": "CP775",
"34": "CP855",
"35": "CP861",
"36": "CP862",
"37": "CP864",
"38": "CP869",
"39": "ISO_8859-2",
"40": "ISO_8859-15",
"41": "CP1098",
"42": "CP774",
"43": "CP772",
"44": "CP1125",
"45": "CP1250",
"46": "CP1251",
"47": "CP1253",
"48": "CP1254",
"49": "CP1255",
"50": "CP1256",
"51": "CP1257",
"52": "CP1258",
"53": "RK1048",
"66": "Unknown",
"67": "Unknown",
"68": "Unknown",
"69": "Unknown",
"70": "Unknown",
"71": "Unknown",
"72": "Unknown",
"73": "Unknown",
"74": "Unknown",
"75": "Unknown",
"82": "Unknown",
"254": "Unknown",
"255": "Unknown"
},
"colors": {
"0": "black"
},
"features": {
"barcodeB": true,
"bitImageColumn": true,
"bitImageRaster": true,
"graphics": true,
"highDensity": true,
"pdf417Code": true,
"pulseBel": false,
"pulseStandard": true,
"qrCode": true,
"starCommands": false
},
"fonts": {
"0": {
"columns": 42,
"name": "Font A"
},
"1": {
"columns": 56,
"name": "Font B"
}
},
"media": {
"width": {
"mm": "Unknown",
"pixels": "Unknown"
}
},
"name": "TEP200M Series",
"notes": "",
"vendor": "EPOS"
},
"TM-P80": {
"codePages": {
"0": "CP437",
"1": "CP932",
"2": "CP850",
"3": "CP860",
"4": "CP863",
"5": "CP865",
"6": "Unknown",
"7": "Unknown",
"8": "Unknown",
"11": "CP851",
"12": "CP853",
"13": "CP857",
"14": "CP737",
"15": "ISO_8859-7",
"16": "CP1252",
"17": "CP866",
"18": "CP852",
"19": "CP858",
"20": "Unknown",
"21": "CP874",
"22": "Unknown",
"23": "Unknown",
"24": "Unknown",
"25": "Unknown",
"26": "Unknown",
"30": "TCVN-3-1",
"31": "TCVN-3-2",
"32": "CP720",
"33": "CP775",
"34": "CP855",
"35": "CP861",
"36": "CP862",
"37": "CP864",
"38": "CP869",
"39": "ISO_8859-2",
"40": "ISO_8859-15",
"41": "CP1098",
"42": "CP774",
"43": "CP772",
"44": "CP1125",
"45": "CP1250",
"46": "CP1251",
"47": "CP1253",
"48": "CP1254",
"49": "CP1255",
"50": "CP1256",
"51": "CP1257",
"52": "CP1258",
"53": "RK1048",
"66": "Unknown",
"67": "Unknown",
"68": "Unknown",
"69": "Unknown",
"70": "Unknown",
"71": "Unknown",
"72": "Unknown",
"73": "Unknown",
"74": "Unknown",
"75": "Unknown",
"82": "Unknown",
"254": "Unknown",
"255": "Unknown"
},
"colors": {
"0": "black"
},
"features": {
"barcodeB": true,
"bitImageColumn": true,
"bitImageRaster": true,
"graphics": true,
"highDensity": true,
"pdf417Code": true,
"pulseBel": false,
"pulseStandard": true,
"qrCode": true,
"starCommands": false
},
"fonts": {
"0": {
"columns": 42,
"name": "Font A"
},
"1": {
"columns": 56,
"name": "Font B"
},
"2": {
"columns": 24,
"name": "Kanji"
}
},
"media": {
"width": {
"mm": 72,
"pixels": 576
}
},
"name": "TM-P80",
"notes": "Portable printer (48-column
mode)",
"vendor": "Epson"
},
"TM-P80-42col": {
"codePages": {
"0": "CP437",
"1": "CP932",
"2": "CP850",
"3": "CP860",
"4": "CP863",
"5": "CP865",
"6": "Unknown",
"7": "Unknown",
"8": "Unknown",
"11": "CP851",
"12": "CP853",
"13": "CP857",
"14": "CP737",
"15": "ISO_8859-7",
"16": "CP1252",
"17": "CP866",
"18": "CP852",
"19": "CP858",
"20": "Unknown",
"21": "CP874",
"22": "Unknown",
"23": "Unknown",
"24": "Unknown",
"25": "Unknown",
"26": "Unknown",
"30": "TCVN-3-1",
"31": "TCVN-3-2",
"32": "CP720",
"33": "CP775",
"34": "CP855",
"35": "CP861",
"36": "CP862",
"37": "CP864",
"38": "CP869",
"39": "ISO_8859-2",
"40": "ISO_8859-15",
"41": "CP1098",
"42": "CP774",
"43": "CP772",
"44": "CP1125",
"45": "CP1250",
"46": "CP1251",
"47": "CP1253",
"48": "CP1254",
"49": "CP1255",
"50": "CP1256",
"51": "CP1257",
"52": "CP1258",
"53": "RK1048",
"66": "Unknown",
"67": "Unknown",
"68": "Unknown",
"69": "Unknown",
"70": "Unknown",
"71": "Unknown",
"72": "Unknown",
"73": "Unknown",
"74": "Unknown",
"75": "Unknown",
"82": "Unknown",
"254": "Unknown",
"255": "Unknown"
},
"colors": {
"0": "black"
},
"features": {
"barcodeB": true,
"bitImageColumn": true,
"bitImageRaster": true,
"graphics": true,
"highDensity": true,
"pdf417Code": true,
"pulseBel": false,
"pulseStandard": true,
"qrCode": true,
"starCommands": false
},
"fonts": {
"0": {
"columns": 42,
"name": "Font A"
},
"1": {
"columns": 60,
"name": "Font B"
},
"2": {
"columns": 21,
"name": "Kanji"
}
},
"media": {
"width": {
"mm": 63.6,
"pixels": 546
}
},
"name": "TM-P80 (42 column mode)",
"notes": "Portable printer (42-column
mode)",
"vendor": "Epson"
},
"TM-T88II": {
"codePages": {
"0": "CP437",
"1": "CP932",
"2": "CP850",
"3": "CP860",
"4": "CP863",
"5": "CP865",
"19": "CP858",
"255": "Unknown"
},
"colors": {
"0": "black"
},
"features": {
"barcodeB": true,
"bitImageColumn": true,
"bitImageRaster": true,
"graphics": true,
"highDensity": true,
"pdf417Code": true,
"pulseBel": false,
"pulseStandard": true,
"qrCode": true,
"starCommands": false
},
"fonts": {
"0": {
"columns": 42,
"name": "Font A"
},
"1": {
"columns": 56,
"name": "Font B"
}
},
"media": {
"width": {
"mm": "Unknown",
"pixels": "Unknown"
}
},
"name": "TM-T88II",
"notes": "Epson TM-T88II profile. This printer
is discontinued by the Vendor, and has similar feature support to the
TM-T88III. The code page mapping is documented in the
\"TM-T88II/T88III Technical Reference Guide\".\n",
"vendor": "Epson"
},
"TM-T88III": {
"codePages": {
"0": "CP437",
"1": "CP932",
"2": "CP850",
"3": "CP860",
"4": "CP863",
"5": "CP865",
"16": "CP1252",
"17": "CP866",
"18": "CP862",
"19": "CP858",
"255": "Unknown"
},
"colors": {
"0": "black"
},
"features": {
"barcodeB": true,
"bitImageColumn": true,
"bitImageRaster": true,
"graphics": true,
"highDensity": true,
"pdf417Code": true,
"pulseBel": false,
"pulseStandard": true,
"qrCode": true,
"starCommands": false
},
"fonts": {
"0": {
"columns": 42,
"name": "Font A"
},
"1": {
"columns": 56,
"name": "Font B"
}
},
"media": {
"width": {
"mm": "Unknown",
"pixels": "Unknown"
}
},
"name": "TM-T88III",
"notes": "Epson TM-T88III profile. This printer
has similar feature support to the TM-T88II. The code page mapping is
documented in the \"TM-T88II/T88III Technical Reference
Guide\".\n",
"vendor": "Epson"
},
"TM-U220": {
"codePages": {
"0": "CP437"
},
"colors": {
"0": "black",
"1": "alternate"
},
"features": {
"barcodeB": false,
"bitImageColumn": true,
"bitImageRaster": false,
"graphics": false,
"highDensity": false,
"pdf417Code": false,
"pulseBel": false,
"pulseStandard": true,
"qrCode": false,
"starCommands": false
},
"fonts": {
"0": {
"columns": 42,
"name": "Font A"
},
"1": {
"columns": 56,
"name": "Font B"
}
},
"media": {
"width": {
"mm": 80,
"pixels": "Unknown"
}
},
"name": "TM-U220",
"notes": "Two-color impact printer with 80mm
output",
"vendor": "Epson"
},
"TSP600": {
"codePages": {
"0": "CP437",
"1": "CP437",
"2": "CP932",
"3": "CP437",
"4": "CP858",
"5": "CP852",
"6": "CP860",
"7": "CP861",
"8": "CP863",
"9": "CP865",
"10": "CP866",
"11": "CP855",
"12": "CP857",
"13": "CP862",
"14": "CP864",
"15": "CP737",
"16": "CP851",
"17": "CP869",
"18": "CP928",
"19": "CP772",
"20": "CP774",
"21": "CP874",
"32": "CP1252",
"33": "CP1250",
"34": "CP1251",
"64": "CP3840",
"65": "CP3841",
"66": "CP3843",
"67": "CP3844",
"68": "CP3845",
"69": "CP3846",
"70": "CP3847",
"71": "CP3848",
"72": "CP1001",
"73": "CP2001",
"74": "CP3001",
"75": "CP3002",
"76": "CP3011",
"77": "CP3012",
"78": "CP3021",
"79": "CP3041",
"96": "Unknown",
"97": "Unknown",
"98": "Unknown",
"99": "Unknown",
"100": "Unknown",
"101": "Unknown",
"102": "Unknown",
"255": "Unknown"
},
"colors": {
"0": "black"
},
"features": {
"barcodeB": true,
"bitImageColumn": true,
"bitImageRaster": true,
"graphics": true,
"highDensity": true,
"pdf417Code": true,
"pulseBel": false,
"pulseStandard": true,
"qrCode": true,
"starCommands": true
},
"fonts": {
"0": {
"columns": 42,
"name": "Font A"
},
"1": {
"columns": 56,
"name": "Font B"
}
},
"media": {
"width": {
"mm": "Unknown",
"pixels": "Unknown"
}
},
"name": "TSP600 Series",
"notes": "Star TSP600 thermal printer series
with ESC/POS emulation enabled",
"vendor": "Star Micronics"
},
"TUP500": {
"codePages": {
"0": "CP437",
"1": "CP437",
"2": "CP932",
"3": "CP437",
"4": "CP858",
"5": "CP852",
"6": "CP860",
"7": "CP861",
"8": "CP863",
"9": "CP865",
"10": "CP866",
"11": "CP855",
"12": "CP857",
"13": "CP862",
"14": "CP864",
"15": "CP737",
"16": "CP851",
"17": "CP869",
"18": "CP928",
"19": "CP772",
"20": "CP774",
"21": "CP874",
"32": "CP1252",
"33": "CP1250",
"34": "CP1251",
"64": "CP3840",
"65": "CP3841",
"66": "CP3843",
"67": "CP3844",
"68": "CP3845",
"69": "CP3846",
"70": "CP3847",
"71": "CP3848",
"72": "CP1001",
"73": "CP2001",
"74": "CP3001",
"75": "CP3002",
"76": "CP3011",
"77": "CP3012",
"78": "CP3021",
"79": "CP3041",
"96": "Unknown",
"97": "Unknown",
"98": "Unknown",
"99": "Unknown",
"100": "Unknown",
"101": "Unknown",
"102": "Unknown",
"255": "Unknown"
},
"colors": {
"0": "black"
},
"features": {
"barcodeB": true,
"bitImageColumn": true,
"bitImageRaster": true,
"graphics": true,
"highDensity": true,
"pdf417Code": true,
"pulseBel": false,
"pulseStandard": true,
"qrCode": true,
"starCommands": true
},
"fonts": {
"0": {
"columns": 42,
"name": "Font A"
},
"1": {
"columns": 56,
"name": "Font B"
}
},
"media": {
"width": {
"mm": "Unknown",
"pixels": "Unknown"
}
},
"name": "TUP500 Series",
"notes": "Star TUP500 thermal printer series
with ESC/POS emulation enabled",
"vendor": "Star Micronics"
},
"default": {
"codePages": {
"0": "CP437",
"1": "CP932",
"2": "CP850",
"3": "CP860",
"4": "CP863",
"5": "CP865",
"6": "Unknown",
"7": "Unknown",
"8": "Unknown",
"11": "CP851",
"12": "CP853",
"13": "CP857",
"14": "CP737",
"15": "ISO_8859-7",
"16": "CP1252",
"17": "CP866",
"18": "CP852",
"19": "CP858",
"20": "Unknown",
"21": "CP874",
"22": "Unknown",
"23": "Unknown",
"24": "Unknown",
"25": "Unknown",
"26": "Unknown",
"30": "TCVN-3-1",
"31": "TCVN-3-2",
"32": "CP720",
"33": "CP775",
"34": "CP855",
"35": "CP861",
"36": "CP862",
"37": "CP864",
"38": "CP869",
"39": "ISO_8859-2",
"40": "ISO_8859-15",
"41": "CP1098",
"42": "CP774",
"43": "CP772",
"44": "CP1125",
"45": "CP1250",
"46": "CP1251",
"47": "CP1253",
"48": "CP1254",
"49": "CP1255",
"50": "CP1256",
"51": "CP1257",
"52": "CP1258",
"53": "RK1048",
"66": "Unknown",
"67": "Unknown",
"68": "Unknown",
"69": "Unknown",
"70": "Unknown",
"71": "Unknown",
"72": "Unknown",
"73": "Unknown",
"74": "Unknown",
"75": "Unknown",
"82": "Unknown",
"254": "Unknown",
"255": "Unknown"
},
"colors": {
"0": "black"
},
"features": {
"barcodeB": true,
"bitImageColumn": true,
"bitImageRaster": true,
"graphics": true,
"highDensity": true,
"pdf417Code": true,
"pulseBel": false,
"pulseStandard": true,
"qrCode": true,
"starCommands": false
},
"fonts": {
"0": {
"columns": 42,
"name": "Font A"
},
"1": {
"columns": 56,
"name": "Font B"
}
},
"media": {
"width": {
"mm": "Unknown",
"pixels": "Unknown"
}
},
"name": "Default",
"notes": "Default ESC/POS profile, suitable for
standards-compliant or Epson-branded printers. This profile allows the use
of standard ESC/POS features, and can encode a variety of code
pages.\n",
"vendor": "Generic"
},
"simple": {
"codePages": {
"0": "CP437"
},
"colors": {
"0": "black"
},
"features": {
"barcodeB": false,
"bitImageColumn": false,
"bitImageRaster": true,
"graphics": false,
"highDensity": true,
"pdf417Code": false,
"pulseBel": false,
"pulseStandard": true,
"qrCode": false,
"starCommands": false
},
"fonts": {
"0": {
"columns": 42,
"name": "Font A"
},
"1": {
"columns": 56,
"name": "Font B"
}
},
"media": {
"width": {
"mm": "Unknown",
"pixels": "Unknown"
}
},
"name": "Simple",
"notes": "A profile for use in printers with
unknown or poor compatibility. This profile indicates that a small number
of features are supported, so that commands are not sent a printer that is
unlikely to understand them.\n",
"vendor": "Generic"
}
}
}PK�"�[�#o,,%libraries/Escpos/resources/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�#o,,libraries/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�[�O O libraries/loader.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
spl_autoload_register(array('JLoader','load'));
class PhocacartLoader extends JLoader
{
private static $paths = array();
protected static $classes = array();
public static function import($filePath, $base = null, $key =
'libraries.') {
$keyPath = $key ? $key . $filePath : $filePath;
if (!isset($paths[$keyPath])) {
if ( !$base ) {
$base =
JPATH_ADMINISTRATOR.'/components/com_phocacart/libraries';
}
$parts = explode( '.', $filePath );
$className = array_pop( $parts );
switch($className) {
case 'helper' :
$className = ucfirst(array_pop( $parts )).ucfirst($className);
break;
Default :
$className = ucfirst($className);
break;
}
$path = str_replace( '.', '/', $filePath );
if (strpos($filePath, 'phocacart') === 0) {
$className = 'PhocaCart'.$className;
$classes = JLoader::register($className,
$base.'/'.$path.'.php');
$rs = isset($classes[strtolower($className)]);
} else {
// If it is not in the joomla namespace then we have no idea if
// it uses our pattern for class names/files so just include
// if the file exists or set it to false if not
$filename = $base.'/'.$path.'.php';
if (is_file($filename)) {
$rs = (bool) include $filename;
} else {
// if the file doesn't exist fail
$rs = false;
// note: JLoader::register does an is_file check itself so we
don't need it above, we do it here because we
// try to load the file directly and it may not exist which could
cause php to throw up nasty warning messages
// at us so we set it to false here and hope that if the programmer is
good enough they'll check the return value
// instead of hoping it'll work. remmeber include only fires a
warning, so $rs was going to be false with a nasty
// warning message
}
}
PhocacartLoader::$paths[$keyPath] = $rs;
}
return PhocacartLoader::$paths[$keyPath];
}
}
function phocacartimport($path) {
return PhocacartLoader::import($path);
}
PK�"�[�#o,,libraries/Parsedown/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�@BIIlibraries/Parsedown/LICENSE.txtnu�[���The
MIT License (MIT)
Copyright (c) 2013-2018 Emanuil Rusev, erusev.com
Permission is hereby granted, free of charge, to any person obtaining a
copy of
this software and associated documentation files (the
"Software"), to deal in
the Software without restriction, including without limitation the rights
to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of
the Software, and to permit persons to whom the Software is furnished to do
so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
PK�"�[/H��b�b�!libraries/Parsedown/Parsedown.phpnu�[���<?php
#
#
# Parsedown
# http://parsedown.org
#
# (c) Emanuil Rusev
# http://erusev.com
#
# For the full license information, view the LICENSE file that was
distributed
# with this source code.
#
#
defined('_JEXEC') or die();
class Parsedown
{
# ~
const version = '1.8.0-beta-7';
# ~
function text($text)
{
$Elements = $this->textElements($text);
# convert to markup
$markup = $this->elements($Elements);
# trim line breaks
$markup = trim($markup, "\n");
return $markup;
}
protected function textElements($text)
{
# make sure no definitions are set
$this->DefinitionData = array();
# standardize line breaks
$text = str_replace(array("\r\n", "\r"),
"\n", $text);
# remove surrounding line breaks
$text = trim($text, "\n");
# split text into lines
$lines = explode("\n", $text);
# iterate through lines to identify blocks
return $this->linesElements($lines);
}
#
# Setters
#
function setBreaksEnabled($breaksEnabled)
{
$this->breaksEnabled = $breaksEnabled;
return $this;
}
protected $breaksEnabled;
function setMarkupEscaped($markupEscaped)
{
$this->markupEscaped = $markupEscaped;
return $this;
}
protected $markupEscaped;
function setUrlsLinked($urlsLinked)
{
$this->urlsLinked = $urlsLinked;
return $this;
}
protected $urlsLinked = true;
function setSafeMode($safeMode)
{
$this->safeMode = (bool) $safeMode;
return $this;
}
protected $safeMode;
function setStrictMode($strictMode)
{
$this->strictMode = (bool) $strictMode;
return $this;
}
protected $strictMode;
protected $safeLinksWhitelist = array(
'http://',
'https://',
'ftp://',
'ftps://',
'mailto:',
'tel:',
'data:image/png;base64,',
'data:image/gif;base64,',
'data:image/jpeg;base64,',
'irc:',
'ircs:',
'git:',
'ssh:',
'news:',
'steam:',
);
#
# Lines
#
protected $BlockTypes = array(
'#' => array('Header'),
'*' => array('Rule', 'List'),
'+' => array('List'),
'-' => array('SetextHeader',
'Table', 'Rule', 'List'),
'0' => array('List'),
'1' => array('List'),
'2' => array('List'),
'3' => array('List'),
'4' => array('List'),
'5' => array('List'),
'6' => array('List'),
'7' => array('List'),
'8' => array('List'),
'9' => array('List'),
':' => array('Table'),
'<' => array('Comment',
'Markup'),
'=' => array('SetextHeader'),
'>' => array('Quote'),
'[' => array('Reference'),
'_' => array('Rule'),
'`' => array('FencedCode'),
'|' => array('Table'),
'~' => array('FencedCode'),
);
# ~
protected $unmarkedBlockTypes = array(
'Code',
);
#
# Blocks
#
protected function lines(array $lines)
{
return $this->elements($this->linesElements($lines));
}
protected function linesElements(array $lines)
{
$Elements = array();
$CurrentBlock = null;
foreach ($lines as $line)
{
if (chop($line) === '')
{
if (isset($CurrentBlock))
{
$CurrentBlock['interrupted'] =
(isset($CurrentBlock['interrupted'])
? $CurrentBlock['interrupted'] + 1 : 1
);
}
continue;
}
while (($beforeTab = strstr($line, "\t", true)) !==
false)
{
$shortage = 4 - mb_strlen($beforeTab, 'utf-8') %
4;
$line = $beforeTab
. str_repeat(' ', $shortage)
. substr($line, strlen($beforeTab) + 1)
;
}
$indent = strspn($line, ' ');
$text = $indent > 0 ? substr($line, $indent) : $line;
# ~
$Line = array('body' => $line, 'indent'
=> $indent, 'text' => $text);
# ~
if (isset($CurrentBlock['continuable']))
{
$methodName = 'block' .
$CurrentBlock['type'] . 'Continue';
$Block = $this->$methodName($Line, $CurrentBlock);
if (isset($Block))
{
$CurrentBlock = $Block;
continue;
}
else
{
if
($this->isBlockCompletable($CurrentBlock['type']))
{
$methodName = 'block' .
$CurrentBlock['type'] . 'Complete';
$CurrentBlock =
$this->$methodName($CurrentBlock);
}
}
}
# ~
$marker = $text[0];
# ~
$blockTypes = $this->unmarkedBlockTypes;
if (isset($this->BlockTypes[$marker]))
{
foreach ($this->BlockTypes[$marker] as $blockType)
{
$blockTypes []= $blockType;
}
}
#
# ~
foreach ($blockTypes as $blockType)
{
$Block = $this->{"block$blockType"}($Line,
$CurrentBlock);
if (isset($Block))
{
$Block['type'] = $blockType;
if ( ! isset($Block['identified']))
{
if (isset($CurrentBlock))
{
$Elements[] =
$this->extractElement($CurrentBlock);
}
$Block['identified'] = true;
}
if ($this->isBlockContinuable($blockType))
{
$Block['continuable'] = true;
}
$CurrentBlock = $Block;
continue 2;
}
}
# ~
if (isset($CurrentBlock) and $CurrentBlock['type']
=== 'Paragraph')
{
$Block = $this->paragraphContinue($Line, $CurrentBlock);
}
if (isset($Block))
{
$CurrentBlock = $Block;
}
else
{
if (isset($CurrentBlock))
{
$Elements[] = $this->extractElement($CurrentBlock);
}
$CurrentBlock = $this->paragraph($Line);
$CurrentBlock['identified'] = true;
}
}
# ~
if (isset($CurrentBlock['continuable']) and
$this->isBlockCompletable($CurrentBlock['type']))
{
$methodName = 'block' .
$CurrentBlock['type'] . 'Complete';
$CurrentBlock = $this->$methodName($CurrentBlock);
}
# ~
if (isset($CurrentBlock))
{
$Elements[] = $this->extractElement($CurrentBlock);
}
# ~
return $Elements;
}
protected function extractElement(array $Component)
{
if ( ! isset($Component['element']))
{
if (isset($Component['markup']))
{
$Component['element'] = array('rawHtml'
=> $Component['markup']);
}
elseif (isset($Component['hidden']))
{
$Component['element'] = array();
}
}
return $Component['element'];
}
protected function isBlockContinuable($Type)
{
return method_exists($this, 'block' . $Type .
'Continue');
}
protected function isBlockCompletable($Type)
{
return method_exists($this, 'block' . $Type .
'Complete');
}
#
# Code
protected function blockCode($Line, $Block = null)
{
if (isset($Block) and $Block['type'] ===
'Paragraph' and ! isset($Block['interrupted']))
{
return;
}
if ($Line['indent'] >= 4)
{
$text = substr($Line['body'], 4);
$Block = array(
'element' => array(
'name' => 'pre',
'element' => array(
'name' => 'code',
'text' => $text,
),
),
);
return $Block;
}
}
protected function blockCodeContinue($Line, $Block)
{
if ($Line['indent'] >= 4)
{
if (isset($Block['interrupted']))
{
$Block['element']['element']['text'] .=
str_repeat("\n", $Block['interrupted']);
unset($Block['interrupted']);
}
$Block['element']['element']['text'] .=
"\n";
$text = substr($Line['body'], 4);
$Block['element']['element']['text'] .=
$text;
return $Block;
}
}
protected function blockCodeComplete($Block)
{
return $Block;
}
#
# Comment
protected function blockComment($Line)
{
if ($this->markupEscaped or $this->safeMode)
{
return;
}
if (strpos($Line['text'], '<!--') === 0)
{
$Block = array(
'element' => array(
'rawHtml' => $Line['body'],
'autobreak' => true,
),
);
if (strpos($Line['text'], '-->') !==
false)
{
$Block['closed'] = true;
}
return $Block;
}
}
protected function blockCommentContinue($Line, array $Block)
{
if (isset($Block['closed']))
{
return;
}
$Block['element']['rawHtml'] .= "\n"
. $Line['body'];
if (strpos($Line['text'], '-->') !== false)
{
$Block['closed'] = true;
}
return $Block;
}
#
# Fenced Code
protected function blockFencedCode($Line)
{
$marker = $Line['text'][0];
$openerLength = strspn($Line['text'], $marker);
if ($openerLength < 3)
{
return;
}
$infostring = trim(substr($Line['text'], $openerLength),
"\t ");
if (strpos($infostring, '`') !== false)
{
return;
}
$Element = array(
'name' => 'code',
'text' => '',
);
if ($infostring !== '')
{
/**
*
https://www.w3.org/TR/2011/WD-html5-20110525/elements.html#classes
* Every HTML element may have a class attribute specified.
* The attribute, if specified, must have a value that is a set
* of space-separated tokens representing the various classes
* that the element belongs to.
* [...]
* The space characters, for the purposes of this
specification,
* are U+0020 SPACE, U+0009 CHARACTER TABULATION (tab),
* U+000A LINE FEED (LF), U+000C FORM FEED (FF), and
* U+000D CARRIAGE RETURN (CR).
*/
$language = substr($infostring, 0, strcspn($infostring, "
\t\n\f\r"));
$Element['attributes'] = array('class'
=> "language-$language");
}
$Block = array(
'char' => $marker,
'openerLength' => $openerLength,
'element' => array(
'name' => 'pre',
'element' => $Element,
),
);
return $Block;
}
protected function blockFencedCodeContinue($Line, $Block)
{
if (isset($Block['complete']))
{
return;
}
if (isset($Block['interrupted']))
{
$Block['element']['element']['text'] .=
str_repeat("\n", $Block['interrupted']);
unset($Block['interrupted']);
}
if (($len = strspn($Line['text'],
$Block['char'])) >= $Block['openerLength']
and chop(substr($Line['text'], $len), ' ')
=== ''
) {
$Block['element']['element']['text'] =
substr($Block['element']['element']['text'],
1);
$Block['complete'] = true;
return $Block;
}
$Block['element']['element']['text']
.= "\n" . $Line['body'];
return $Block;
}
protected function blockFencedCodeComplete($Block)
{
return $Block;
}
#
# Header
protected function blockHeader($Line)
{
$level = strspn($Line['text'], '#');
if ($level > 6)
{
return;
}
$text = trim($Line['text'], '#');
if ($this->strictMode and isset($text[0]) and $text[0] !==
' ')
{
return;
}
$text = trim($text, ' ');
$Block = array(
'element' => array(
'name' => 'h' . $level,
'handler' => array(
'function' => 'lineElements',
'argument' => $text,
'destination' => 'elements',
)
),
);
return $Block;
}
#
# List
protected function blockList($Line, array $CurrentBlock = null)
{
list($name, $pattern) = $Line['text'][0] <=
'-' ? array('ul', '[*+-]') :
array('ol', '[0-9]{1,9}+[.\)]');
if (preg_match('/^('.$pattern.'([
]++|$))(.*+)/', $Line['text'], $matches))
{
$contentIndent = strlen($matches[2]);
if ($contentIndent >= 5)
{
$contentIndent -= 1;
$matches[1] = substr($matches[1], 0, -$contentIndent);
$matches[3] = str_repeat(' ', $contentIndent) .
$matches[3];
}
elseif ($contentIndent === 0)
{
$matches[1] .= ' ';
}
$markerWithoutWhitespace = strstr($matches[1], ' ',
true);
$Block = array(
'indent' => $Line['indent'],
'pattern' => $pattern,
'data' => array(
'type' => $name,
'marker' => $matches[1],
'markerType' => ($name === 'ul'
? $markerWithoutWhitespace : substr($markerWithoutWhitespace, -1)),
),
'element' => array(
'name' => $name,
'elements' => array(),
),
);
$Block['data']['markerTypeRegex'] =
preg_quote($Block['data']['markerType'],
'/');
if ($name === 'ol')
{
$listStart = ltrim(strstr($matches[1],
$Block['data']['markerType'], true), '0') ?:
'0';
if ($listStart !== '1')
{
if (
isset($CurrentBlock)
and $CurrentBlock['type'] ===
'Paragraph'
and ! isset($CurrentBlock['interrupted'])
) {
return;
}
$Block['element']['attributes'] =
array('start' => $listStart);
}
}
$Block['li'] = array(
'name' => 'li',
'handler' => array(
'function' => 'li',
'argument' => !empty($matches[3]) ?
array($matches[3]) : array(),
'destination' => 'elements'
)
);
$Block['element']['elements'] []= &
$Block['li'];
return $Block;
}
}
protected function blockListContinue($Line, array $Block)
{
if (isset($Block['interrupted']) and
empty($Block['li']['handler']['argument']))
{
return null;
}
$requiredIndent = ($Block['indent'] +
strlen($Block['data']['marker']));
if ($Line['indent'] < $requiredIndent
and (
(
$Block['data']['type'] ===
'ol'
and
preg_match('/^[0-9]++'.$Block['data']['markerTypeRegex'].'(?:[
]++(.*)|$)/', $Line['text'], $matches)
) or (
$Block['data']['type'] ===
'ul'
and
preg_match('/^'.$Block['data']['markerTypeRegex'].'(?:[
]++(.*)|$)/', $Line['text'], $matches)
)
)
) {
if (isset($Block['interrupted']))
{
$Block['li']['handler']['argument'] []=
'';
$Block['loose'] = true;
unset($Block['interrupted']);
}
unset($Block['li']);
$text = isset($matches[1]) ? $matches[1] : '';
$Block['indent'] = $Line['indent'];
$Block['li'] = array(
'name' => 'li',
'handler' => array(
'function' => 'li',
'argument' => array($text),
'destination' => 'elements'
)
);
$Block['element']['elements'] []= &
$Block['li'];
return $Block;
}
elseif ($Line['indent'] < $requiredIndent and
$this->blockList($Line))
{
return null;
}
if ($Line['text'][0] === '[' and
$this->blockReference($Line))
{
return $Block;
}
if ($Line['indent'] >= $requiredIndent)
{
if (isset($Block['interrupted']))
{
$Block['li']['handler']['argument'] []=
'';
$Block['loose'] = true;
unset($Block['interrupted']);
}
$text = substr($Line['body'], $requiredIndent);
$Block['li']['handler']['argument'] []=
$text;
return $Block;
}
if ( ! isset($Block['interrupted']))
{
$text = preg_replace('/^[
]{0,'.$requiredIndent.'}+/', '',
$Line['body']);
$Block['li']['handler']['argument'] []=
$text;
return $Block;
}
}
protected function blockListComplete(array $Block)
{
if (isset($Block['loose']))
{
foreach ($Block['element']['elements'] as
&$li)
{
if (end($li['handler']['argument']) !==
'')
{
$li['handler']['argument'] []=
'';
}
}
}
return $Block;
}
#
# Quote
protected function blockQuote($Line)
{
if (preg_match('/^>[ ]?+(.*+)/',
$Line['text'], $matches))
{
$Block = array(
'element' => array(
'name' => 'blockquote',
'handler' => array(
'function' =>
'linesElements',
'argument' => (array) $matches[1],
'destination' => 'elements',
)
),
);
return $Block;
}
}
protected function blockQuoteContinue($Line, array $Block)
{
if (isset($Block['interrupted']))
{
return;
}
if ($Line['text'][0] === '>' and
preg_match('/^>[ ]?+(.*+)/', $Line['text'],
$matches))
{
$Block['element']['handler']['argument'] []=
$matches[1];
return $Block;
}
if ( ! isset($Block['interrupted']))
{
$Block['element']['handler']['argument'] []=
$Line['text'];
return $Block;
}
}
#
# Rule
protected function blockRule($Line)
{
$marker = $Line['text'][0];
if (substr_count($Line['text'], $marker) >= 3 and
chop($Line['text'], " $marker") === '')
{
$Block = array(
'element' => array(
'name' => 'hr',
),
);
return $Block;
}
}
#
# Setext
protected function blockSetextHeader($Line, array $Block = null)
{
if ( ! isset($Block) or $Block['type'] !==
'Paragraph' or isset($Block['interrupted']))
{
return;
}
if ($Line['indent'] < 4 and
chop(chop($Line['text'], ' '),
$Line['text'][0]) === '')
{
$Block['element']['name'] =
$Line['text'][0] === '=' ? 'h1' :
'h2';
return $Block;
}
}
#
# Markup
protected function blockMarkup($Line)
{
if ($this->markupEscaped or $this->safeMode)
{
return;
}
if (preg_match('/^<[\/]?+(\w*)(?:[
]*+'.$this->regexHtmlAttribute.')*+[ ]*+(\/)?>/',
$Line['text'], $matches))
{
$element = strtolower($matches[1]);
if (in_array($element, $this->textLevelElements))
{
return;
}
$Block = array(
'name' => $matches[1],
'element' => array(
'rawHtml' => $Line['text'],
'autobreak' => true,
),
);
return $Block;
}
}
protected function blockMarkupContinue($Line, array $Block)
{
if (isset($Block['closed']) or
isset($Block['interrupted']))
{
return;
}
$Block['element']['rawHtml'] .= "\n"
. $Line['body'];
return $Block;
}
#
# Reference
protected function blockReference($Line)
{
if (strpos($Line['text'], ']') !== false
and preg_match('/^\[(.+?)\]:[ ]*+<?(\S+?)>?(?:[
]+["\'(](.+)["\')])?[ ]*+$/',
$Line['text'], $matches)
) {
$id = strtolower($matches[1]);
$Data = array(
'url' => $matches[2],
'title' => isset($matches[3]) ? $matches[3] :
null,
);
$this->DefinitionData['Reference'][$id] = $Data;
$Block = array(
'element' => array(),
);
return $Block;
}
}
#
# Table
protected function blockTable($Line, array $Block = null)
{
if ( ! isset($Block) or $Block['type'] !==
'Paragraph' or isset($Block['interrupted']))
{
return;
}
if (
strpos($Block['element']['handler']['argument'],
'|') === false
and strpos($Line['text'], '|') === false
and strpos($Line['text'], ':') === false
or
strpos($Block['element']['handler']['argument'],
"\n") !== false
) {
return;
}
if (chop($Line['text'], ' -:|') !==
'')
{
return;
}
$alignments = array();
$divider = $Line['text'];
$divider = trim($divider);
$divider = trim($divider, '|');
$dividerCells = explode('|', $divider);
foreach ($dividerCells as $dividerCell)
{
$dividerCell = trim($dividerCell);
if ($dividerCell === '')
{
return;
}
$alignment = null;
if ($dividerCell[0] === ':')
{
$alignment = 'left';
}
if (substr($dividerCell, - 1) === ':')
{
$alignment = $alignment === 'left' ?
'center' : 'right';
}
$alignments []= $alignment;
}
# ~
$HeaderElements = array();
$header =
$Block['element']['handler']['argument'];
$header = trim($header);
$header = trim($header, '|');
$headerCells = explode('|', $header);
if (count($headerCells) !== count($alignments))
{
return;
}
foreach ($headerCells as $index => $headerCell)
{
$headerCell = trim($headerCell);
$HeaderElement = array(
'name' => 'th',
'handler' => array(
'function' => 'lineElements',
'argument' => $headerCell,
'destination' => 'elements',
)
);
if (isset($alignments[$index]))
{
$alignment = $alignments[$index];
$HeaderElement['attributes'] = array(
'style' => "text-align:
$alignment;",
);
}
$HeaderElements []= $HeaderElement;
}
# ~
$Block = array(
'alignments' => $alignments,
'identified' => true,
'element' => array(
'name' => 'table',
'elements' => array(),
),
);
$Block['element']['elements'] []= array(
'name' => 'thead',
);
$Block['element']['elements'] []= array(
'name' => 'tbody',
'elements' => array(),
);
$Block['element']['elements'][0]['elements']
[]= array(
'name' => 'tr',
'elements' => $HeaderElements,
);
return $Block;
}
protected function blockTableContinue($Line, array $Block)
{
if (isset($Block['interrupted']))
{
return;
}
if (count($Block['alignments']) === 1 or
$Line['text'][0] === '|' or
strpos($Line['text'], '|'))
{
$Elements = array();
$row = $Line['text'];
$row = trim($row);
$row = trim($row, '|');
preg_match_all('/(?:(\\\\[|])|[^|`]|`[^`]++`|`)++/',
$row, $matches);
$cells = array_slice($matches[0], 0,
count($Block['alignments']));
foreach ($cells as $index => $cell)
{
$cell = trim($cell);
$Element = array(
'name' => 'td',
'handler' => array(
'function' =>
'lineElements',
'argument' => $cell,
'destination' => 'elements',
)
);
if (isset($Block['alignments'][$index]))
{
$Element['attributes'] = array(
'style' => 'text-align: ' .
$Block['alignments'][$index] . ';',
);
}
$Elements []= $Element;
}
$Element = array(
'name' => 'tr',
'elements' => $Elements,
);
$Block['element']['elements'][1]['elements']
[]= $Element;
return $Block;
}
}
#
# ~
#
protected function paragraph($Line)
{
return array(
'type' => 'Paragraph',
'element' => array(
'name' => 'p',
'handler' => array(
'function' => 'lineElements',
'argument' => $Line['text'],
'destination' => 'elements',
),
),
);
}
protected function paragraphContinue($Line, array $Block)
{
if (isset($Block['interrupted']))
{
return;
}
$Block['element']['handler']['argument'] .=
"\n".$Line['text'];
return $Block;
}
#
# Inline Elements
#
protected $InlineTypes = array(
'!' => array('Image'),
'&' => array('SpecialCharacter'),
'*' => array('Emphasis'),
':' => array('Url'),
'<' => array('UrlTag',
'EmailTag', 'Markup'),
'[' => array('Link'),
'_' => array('Emphasis'),
'`' => array('Code'),
'~' => array('Strikethrough'),
'\\' => array('EscapeSequence'),
);
# ~
protected $inlineMarkerList = '!*_&[:<`~\\';
#
# ~
#
public function line($text, $nonNestables = array())
{
return $this->elements($this->lineElements($text,
$nonNestables));
}
protected function lineElements($text, $nonNestables = array())
{
# standardize line breaks
$text = str_replace(array("\r\n", "\r"),
"\n", $text);
$Elements = array();
$nonNestables = (empty($nonNestables)
? array()
: array_combine($nonNestables, $nonNestables)
);
# $excerpt is based on the first occurrence of a marker
while ($excerpt = strpbrk($text, $this->inlineMarkerList))
{
$marker = $excerpt[0];
$markerPosition = strlen($text) - strlen($excerpt);
$Excerpt = array('text' => $excerpt,
'context' => $text);
foreach ($this->InlineTypes[$marker] as $inlineType)
{
# check to see if the current inline type is nestable in
the current context
if (isset($nonNestables[$inlineType]))
{
continue;
}
$Inline =
$this->{"inline$inlineType"}($Excerpt);
if ( ! isset($Inline))
{
continue;
}
# makes sure that the inline belongs to "our"
marker
if (isset($Inline['position']) and
$Inline['position'] > $markerPosition)
{
continue;
}
# sets a default inline position
if ( ! isset($Inline['position']))
{
$Inline['position'] = $markerPosition;
}
# cause the new element to 'inherit' our non
nestables
$Inline['element']['nonNestables'] =
isset($Inline['element']['nonNestables'])
?
array_merge($Inline['element']['nonNestables'],
$nonNestables)
: $nonNestables
;
# the text that comes before the inline
$unmarkedText = substr($text, 0,
$Inline['position']);
# compile the unmarked text
$InlineText = $this->inlineText($unmarkedText);
$Elements[] = $InlineText['element'];
# compile the inline
$Elements[] = $this->extractElement($Inline);
# remove the examined text
$text = substr($text, $Inline['position'] +
$Inline['extent']);
continue 2;
}
# the marker does not belong to an inline
$unmarkedText = substr($text, 0, $markerPosition + 1);
$InlineText = $this->inlineText($unmarkedText);
$Elements[] = $InlineText['element'];
$text = substr($text, $markerPosition + 1);
}
$InlineText = $this->inlineText($text);
$Elements[] = $InlineText['element'];
foreach ($Elements as &$Element)
{
if ( ! isset($Element['autobreak']))
{
$Element['autobreak'] = false;
}
}
return $Elements;
}
#
# ~
#
protected function inlineText($text)
{
$Inline = array(
'extent' => strlen($text),
'element' => array(),
);
$Inline['element']['elements'] =
self::pregReplaceElements(
$this->breaksEnabled ? '/[ ]*+\n/' : '/(?:[
]*+\\\\|[ ]{2,}+)\n/',
array(
array('name' => 'br'),
array('text' => "\n"),
),
$text
);
return $Inline;
}
protected function inlineCode($Excerpt)
{
$marker = $Excerpt['text'][0];
if (preg_match('/^(['.$marker.']++)[ ]*+(.+?)[
]*+(?<!['.$marker.'])\1(?!'.$marker.')/s',
$Excerpt['text'], $matches))
{
$text = $matches[2];
$text = preg_replace('/[ ]*+\n/', ' ',
$text);
return array(
'extent' => strlen($matches[0]),
'element' => array(
'name' => 'code',
'text' => $text,
),
);
}
}
protected function inlineEmailTag($Excerpt)
{
$hostnameLabel =
'[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?';
$commonMarkEmail =
'[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]++@'
. $hostnameLabel . '(?:\.' . $hostnameLabel .
')*';
if (strpos($Excerpt['text'], '>') !== false
and
preg_match("/^<((mailto:)?$commonMarkEmail)>/i",
$Excerpt['text'], $matches)
){
$url = $matches[1];
if ( ! isset($matches[2]))
{
$url = "mailto:$url";
}
return array(
'extent' => strlen($matches[0]),
'element' => array(
'name' => 'a',
'text' => $matches[1],
'attributes' => array(
'href' => $url,
),
),
);
}
}
protected function inlineEmphasis($Excerpt)
{
if ( ! isset($Excerpt['text'][1]))
{
return;
}
$marker = $Excerpt['text'][0];
if ($Excerpt['text'][1] === $marker and
preg_match($this->StrongRegex[$marker], $Excerpt['text'],
$matches))
{
$emphasis = 'strong';
}
elseif (preg_match($this->EmRegex[$marker],
$Excerpt['text'], $matches))
{
$emphasis = 'em';
}
else
{
return;
}
return array(
'extent' => strlen($matches[0]),
'element' => array(
'name' => $emphasis,
'handler' => array(
'function' => 'lineElements',
'argument' => $matches[1],
'destination' => 'elements',
)
),
);
}
protected function inlineEscapeSequence($Excerpt)
{
if (isset($Excerpt['text'][1]) and
in_array($Excerpt['text'][1], $this->specialCharacters))
{
return array(
'element' => array('rawHtml' =>
$Excerpt['text'][1]),
'extent' => 2,
);
}
}
protected function inlineImage($Excerpt)
{
if ( ! isset($Excerpt['text'][1]) or
$Excerpt['text'][1] !== '[')
{
return;
}
$Excerpt['text']= substr($Excerpt['text'], 1);
$Link = $this->inlineLink($Excerpt);
if ($Link === null)
{
return;
}
$Inline = array(
'extent' => $Link['extent'] + 1,
'element' => array(
'name' => 'img',
'attributes' => array(
'src' =>
$Link['element']['attributes']['href'],
'alt' =>
$Link['element']['handler']['argument'],
),
'autobreak' => true,
),
);
$Inline['element']['attributes'] +=
$Link['element']['attributes'];
unset($Inline['element']['attributes']['href']);
return $Inline;
}
protected function inlineLink($Excerpt)
{
$Element = array(
'name' => 'a',
'handler' => array(
'function' => 'lineElements',
'argument' => null,
'destination' => 'elements',
),
'nonNestables' => array('Url',
'Link'),
'attributes' => array(
'href' => null,
'title' => null,
),
);
$extent = 0;
$remainder = $Excerpt['text'];
if (preg_match('/\[((?:[^][]++|(?R))*+)\]/', $remainder,
$matches))
{
$Element['handler']['argument'] =
$matches[1];
$extent += strlen($matches[0]);
$remainder = substr($remainder, $extent);
}
else
{
return;
}
if (preg_match('/^[(]\s*+((?:[^ ()]++|[(][^ )]+[)])++)(?:[
]+("[^"]*+"|\'[^\']*+\'))?\s*+[)]/',
$remainder, $matches))
{
$Element['attributes']['href'] =
$matches[1];
if (isset($matches[2]))
{
$Element['attributes']['title'] =
substr($matches[2], 1, - 1);
}
$extent += strlen($matches[0]);
}
else
{
if (preg_match('/^\s*\[(.*?)\]/', $remainder,
$matches))
{
$definition = strlen($matches[1]) ? $matches[1] :
$Element['handler']['argument'];
$definition = strtolower($definition);
$extent += strlen($matches[0]);
}
else
{
$definition =
strtolower($Element['handler']['argument']);
}
if ( !
isset($this->DefinitionData['Reference'][$definition]))
{
return;
}
$Definition =
$this->DefinitionData['Reference'][$definition];
$Element['attributes']['href'] =
$Definition['url'];
$Element['attributes']['title'] =
$Definition['title'];
}
return array(
'extent' => $extent,
'element' => $Element,
);
}
protected function inlineMarkup($Excerpt)
{
if ($this->markupEscaped or $this->safeMode or
strpos($Excerpt['text'], '>') === false)
{
return;
}
if ($Excerpt['text'][1] === '/' and
preg_match('/^<\/\w[\w-]*+[ ]*+>/s',
$Excerpt['text'], $matches))
{
return array(
'element' => array('rawHtml' =>
$matches[0]),
'extent' => strlen($matches[0]),
);
}
if ($Excerpt['text'][1] === '!' and
preg_match('/^<!---?[^>-](?:-?+[^-])*-->/s',
$Excerpt['text'], $matches))
{
return array(
'element' => array('rawHtml' =>
$matches[0]),
'extent' => strlen($matches[0]),
);
}
if ($Excerpt['text'][1] !== ' ' and
preg_match('/^<\w[\w-]*+(?:[
]*+'.$this->regexHtmlAttribute.')*+[ ]*+\/?>/s',
$Excerpt['text'], $matches))
{
return array(
'element' => array('rawHtml' =>
$matches[0]),
'extent' => strlen($matches[0]),
);
}
}
protected function inlineSpecialCharacter($Excerpt)
{
if (substr($Excerpt['text'], 1, 1) !== ' ' and
strpos($Excerpt['text'], ';') !== false
and preg_match('/^&(#?+[0-9a-zA-Z]++);/',
$Excerpt['text'], $matches)
) {
return array(
'element' => array('rawHtml' =>
'&' . $matches[1] . ';'),
'extent' => strlen($matches[0]),
);
}
return;
}
protected function inlineStrikethrough($Excerpt)
{
if ( ! isset($Excerpt['text'][1]))
{
return;
}
if ($Excerpt['text'][1] === '~' and
preg_match('/^~~(?=\S)(.+?)(?<=\S)~~/',
$Excerpt['text'], $matches))
{
return array(
'extent' => strlen($matches[0]),
'element' => array(
'name' => 'del',
'handler' => array(
'function' =>
'lineElements',
'argument' => $matches[1],
'destination' => 'elements',
)
),
);
}
}
protected function inlineUrl($Excerpt)
{
if ($this->urlsLinked !== true or !
isset($Excerpt['text'][2]) or $Excerpt['text'][2] !==
'/')
{
return;
}
if (strpos($Excerpt['context'], 'http') !==
false
and
preg_match('/\bhttps?+:[\/]{2}[^\s<]+\b\/*+/ui',
$Excerpt['context'], $matches, PREG_OFFSET_CAPTURE)
) {
$url = $matches[0][0];
$Inline = array(
'extent' => strlen($matches[0][0]),
'position' => $matches[0][1],
'element' => array(
'name' => 'a',
'text' => $url,
'attributes' => array(
'href' => $url,
),
),
);
return $Inline;
}
}
protected function inlineUrlTag($Excerpt)
{
if (strpos($Excerpt['text'], '>') !== false
and preg_match('/^<(\w++:\/{2}[^ >]++)>/i',
$Excerpt['text'], $matches))
{
$url = $matches[1];
return array(
'extent' => strlen($matches[0]),
'element' => array(
'name' => 'a',
'text' => $url,
'attributes' => array(
'href' => $url,
),
),
);
}
}
# ~
protected function unmarkedText($text)
{
$Inline = $this->inlineText($text);
return $this->element($Inline['element']);
}
#
# Handlers
#
protected function handle(array $Element)
{
if (isset($Element['handler']))
{
if (!isset($Element['nonNestables']))
{
$Element['nonNestables'] = array();
}
if (is_string($Element['handler']))
{
$function = $Element['handler'];
$argument = $Element['text'];
unset($Element['text']);
$destination = 'rawHtml';
}
else
{
$function =
$Element['handler']['function'];
$argument =
$Element['handler']['argument'];
$destination =
$Element['handler']['destination'];
}
$Element[$destination] = $this->{$function}($argument,
$Element['nonNestables']);
if ($destination === 'handler')
{
$Element = $this->handle($Element);
}
unset($Element['handler']);
}
return $Element;
}
protected function handleElementRecursive(array $Element)
{
return $this->elementApplyRecursive(array($this,
'handle'), $Element);
}
protected function handleElementsRecursive(array $Elements)
{
return $this->elementsApplyRecursive(array($this,
'handle'), $Elements);
}
protected function elementApplyRecursive($closure, array $Element)
{
$Element = call_user_func($closure, $Element);
if (isset($Element['elements']))
{
$Element['elements'] =
$this->elementsApplyRecursive($closure, $Element['elements']);
}
elseif (isset($Element['element']))
{
$Element['element'] =
$this->elementApplyRecursive($closure, $Element['element']);
}
return $Element;
}
protected function elementApplyRecursiveDepthFirst($closure, array
$Element)
{
if (isset($Element['elements']))
{
$Element['elements'] =
$this->elementsApplyRecursiveDepthFirst($closure,
$Element['elements']);
}
elseif (isset($Element['element']))
{
$Element['element'] =
$this->elementsApplyRecursiveDepthFirst($closure,
$Element['element']);
}
$Element = call_user_func($closure, $Element);
return $Element;
}
protected function elementsApplyRecursive($closure, array $Elements)
{
foreach ($Elements as &$Element)
{
$Element = $this->elementApplyRecursive($closure, $Element);
}
return $Elements;
}
protected function elementsApplyRecursiveDepthFirst($closure, array
$Elements)
{
foreach ($Elements as &$Element)
{
$Element = $this->elementApplyRecursiveDepthFirst($closure,
$Element);
}
return $Elements;
}
protected function element(array $Element)
{
if ($this->safeMode)
{
$Element = $this->sanitiseElement($Element);
}
# identity map if element has no handler
$Element = $this->handle($Element);
$hasName = isset($Element['name']);
$markup = '';
if ($hasName)
{
$markup .= '<' . $Element['name'];
if (isset($Element['attributes']))
{
foreach ($Element['attributes'] as $name =>
$value)
{
if ($value === null)
{
continue;
}
$markup .= "
$name=\"".self::escape($value).'"';
}
}
}
$permitRawHtml = false;
if (isset($Element['text']))
{
$text = $Element['text'];
}
// very strongly consider an alternative if you're writing an
// extension
elseif (isset($Element['rawHtml']))
{
$text = $Element['rawHtml'];
$allowRawHtmlInSafeMode =
isset($Element['allowRawHtmlInSafeMode']) &&
$Element['allowRawHtmlInSafeMode'];
$permitRawHtml = !$this->safeMode ||
$allowRawHtmlInSafeMode;
}
$hasContent = isset($text) || isset($Element['element'])
|| isset($Element['elements']);
if ($hasContent)
{
$markup .= $hasName ? '>' : '';
if (isset($Element['elements']))
{
$markup .=
$this->elements($Element['elements']);
}
elseif (isset($Element['element']))
{
$markup .=
$this->element($Element['element']);
}
else
{
if (!$permitRawHtml)
{
$markup .= self::escape($text, true);
}
else
{
$markup .= $text;
}
}
$markup .= $hasName ? '</' .
$Element['name'] . '>' : '';
}
elseif ($hasName)
{
$markup .= ' />';
}
return $markup;
}
protected function elements(array $Elements)
{
$markup = '';
$autoBreak = true;
foreach ($Elements as $Element)
{
if (empty($Element))
{
continue;
}
$autoBreakNext = (isset($Element['autobreak'])
? $Element['autobreak'] :
isset($Element['name'])
);
// (autobreak === false) covers both sides of an element
$autoBreak = !$autoBreak ? $autoBreak : $autoBreakNext;
$markup .= ($autoBreak ? "\n" : '') .
$this->element($Element);
$autoBreak = $autoBreakNext;
}
$markup .= $autoBreak ? "\n" : '';
return $markup;
}
# ~
protected function li($lines)
{
$Elements = $this->linesElements($lines);
if ( ! in_array('', $lines)
and isset($Elements[0]) and
isset($Elements[0]['name'])
and $Elements[0]['name'] === 'p'
) {
unset($Elements[0]['name']);
}
return $Elements;
}
#
# AST Convenience
#
/**
* Replace occurrences $regexp with $Elements in $text. Return an array
of
* elements representing the replacement.
*/
protected static function pregReplaceElements($regexp, $Elements,
$text)
{
$newElements = array();
while (preg_match($regexp, $text, $matches, PREG_OFFSET_CAPTURE))
{
$offset = $matches[0][1];
$before = substr($text, 0, $offset);
$after = substr($text, $offset + strlen($matches[0][0]));
$newElements[] = array('text' => $before);
foreach ($Elements as $Element)
{
$newElements[] = $Element;
}
$text = $after;
}
$newElements[] = array('text' => $text);
return $newElements;
}
#
# Deprecated Methods
#
function parse($text)
{
$markup = $this->text($text);
return $markup;
}
protected function sanitiseElement(array $Element)
{
static $goodAttribute = '/^[a-zA-Z0-9][a-zA-Z0-9-_]*+$/';
static $safeUrlNameToAtt = array(
'a' => 'href',
'img' => 'src',
);
if ( ! isset($Element['name']))
{
unset($Element['attributes']);
return $Element;
}
if (isset($safeUrlNameToAtt[$Element['name']]))
{
$Element = $this->filterUnsafeUrlInAttribute($Element,
$safeUrlNameToAtt[$Element['name']]);
}
if ( ! empty($Element['attributes']))
{
foreach ($Element['attributes'] as $att => $val)
{
# filter out badly parsed attribute
if ( ! preg_match($goodAttribute, $att))
{
unset($Element['attributes'][$att]);
}
# d ump onevent attribute
elseif (self::striAtStart($att, 'on'))
{
unset($Element['attributes'][$att]);
}
}
}
return $Element;
}
protected function filterUnsafeUrlInAttribute(array $Element,
$attribute)
{
foreach ($this->safeLinksWhitelist as $scheme)
{
if
(self::striAtStart($Element['attributes'][$attribute], $scheme))
{
return $Element;
}
}
$Element['attributes'][$attribute] =
str_replace(':', '%3A',
$Element['attributes'][$attribute]);
return $Element;
}
#
# Static Methods
#
protected static function escape($text, $allowQuotes = false)
{
return htmlspecialchars($text, $allowQuotes ? ENT_NOQUOTES :
ENT_QUOTES, 'UTF-8');
}
protected static function striAtStart($string, $needle)
{
$len = strlen($needle);
if ($len > strlen($string))
{
return false;
}
else
{
return strtolower(substr($string, 0, $len)) ===
strtolower($needle);
}
}
static function instance($name = 'default')
{
if (isset(self::$instances[$name]))
{
return self::$instances[$name];
}
$instance = new static();
self::$instances[$name] = $instance;
return $instance;
}
private static $instances = array();
#
# Fields
#
protected $DefinitionData;
#
# Read-Only
protected $specialCharacters = array(
'\\', '`', '*', '_',
'{', '}', '[', ']', '(',
')', '>', '#', '+',
'-', '.', '!', '|', '~'
);
protected $StrongRegex = array(
'*' =>
'/^[*]{2}((?:\\\\\*|[^*]|[*][^*]*+[*])+?)[*]{2}(?![*])/s',
'_' =>
'/^__((?:\\\\_|[^_]|_[^_]*+_)+?)__(?!_)/us',
);
protected $EmRegex = array(
'*' =>
'/^[*]((?:\\\\\*|[^*]|[*][*][^*]+?[*][*])+?)[*](?![*])/s',
'_' =>
'/^_((?:\\\\_|[^_]|__[^_]*__)+?)_(?!_)\b/us',
);
protected $regexHtmlAttribute =
'[a-zA-Z_:][\w:.-]*+(?:\s*+=\s*+(?:[^"\'=<>`\s]+|"[^"]*+"|\'[^\']*+\'))?+';
protected $voidElements = array(
'area', 'base', 'br',
'col', 'command', 'embed', 'hr',
'img', 'input', 'link', 'meta',
'param', 'source',
);
protected $textLevelElements = array(
'a', 'br', 'bdo', 'abbr',
'blink', 'nextid', 'acronym',
'basefont',
'b', 'em', 'big', 'cite',
'small', 'spacer', 'listing',
'i', 'rp', 'del', 'code',
'strike', 'marquee',
'q', 'rt', 'ins', 'font',
'strong',
's', 'tt', 'kbd', 'mark',
'u', 'xm', 'sub', 'nobr',
'sup', 'ruby',
'var', 'span',
'wbr', 'time',
);
}
PK�"�[�W+55$libraries/Phoca/Render/Adminview.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
namespace Phoca\Render;
defined( '_JEXEC' ) or die( 'Restricted access' );
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Version;
class Adminview
{
public $view = '';
public $viewtype = 2;
public $option = '';
public $optionLang = '';
public $compatible = false;
public $sidebar = true;
protected $document = false;
public function __construct(){
$app = Factory::getApplication();
$version = new Version();
$this->compatible =
$version->isCompatible('4.0.0-alpha');
$this->view = $app->input->get('view');
$this->option = $app->input->get('option');
$this->optionLang = strtoupper($this->option);
$this->sidebar =
Factory::getApplication()->getTemplate(true)->params->get('menu',
1) ? true : false;
$this->document = Factory::getDocument();
//switch($this->view) {
// default:
HTMLHelper::_('behavior.formvalidator');
HTMLHelper::_('behavior.keepalive');
HTMLHelper::_('jquery.framework', false);
if (!$this->compatible) {
HTMLHelper::_('behavior.tooltip');
HTMLHelper::_('formbehavior.chosen', 'select');
}
// break;
//}
HTMLHelper::_('stylesheet',
'media/'.$this->option.'/duotone/joomla-fonts.css',
array('version' => 'auto'));
HTMLHelper::_('stylesheet',
'media/'.$this->option.'/css/administrator/'.str_replace('com_',
'', $this->option).'.css', array('version'
=> 'auto'));
if ($this->compatible) {
HTMLHelper::_('stylesheet',
'media/'.$this->option.'/css/administrator/4.css',
array('version' => 'auto'));
} else {
HTMLHelper::_('stylesheet',
'media/'.$this->option.'/css/administrator/3.css',
array('version' => 'auto'));
}
}
public function startCp() {
$o = array();
if ($this->compatible) {
if ($this->sidebar) {
} else {
$o[] = '<div class="row">';
$o[] = '<div id="j-main-container"
class="col-md-2">'.
\JHtmlSidebar::render().'</div>';
$o[] = '<div id="j-main-container"
class="col-md-10">';
}
} else {
$o[] = '<div id="j-sidebar-container"
class="span2">' . \JHtmlSidebar::render() .
'</div>'."\n";
$o[] = '<div id="j-main-container"
class="span10">'."\n";
}
return implode("\n", $o);
}
public function endCp() {
$o = array();
if ($this->compatible) {
if ($this->sidebar) {
} else {
$o[] = '</div></div>';
}
} else {
$o[] = '</div>';
}
return implode("\n", $o);
}
public function startForm($option, $view, $itemId, $id =
'adminForm', $name = 'adminForm', $class =
'', $layout = 'edit', $tmpl = '') {
if ($layout != '') {
$layout = '&layout='.$layout;
}
if ($view != '') {
$viewP = '&view='.$view;
}
if ($tmpl != '') {
$tmpl = '&tmpl='.$tmpl;
}
return '<div id="'.$view.'"><form
action="'.Route::_('index.php?option='.$option . $viewP
. $layout . '&id='.(int) $itemId . $tmpl).'"
method="post" name="'.$name.'"
id="'.$id.'" class="form-validate
'.$class.'" role="form">'."\n"
.'<div id="phAdminEdit"
class="row-fluid">'."\n";
}
public function endForm() {
return
'</div>'."\n".'</form>'."\n".'</div>'.
"\n" . $this->ajaxTopHtml();
}
public function startFormRoute($view, $route, $id = 'adminForm',
$name = 'adminForm') {
return '<div id="'.$view.'"><form
action="'.Route::_($route).'" method="post"
name="'.$name.'" id="'.$id.'"
class="form-validate">'."\n"
.'<div id="phAdminEdit"
class="row-fluid">'."\n";
}
public function ajaxTopHtml($text = '') {
$o = '<div id="ph-ajaxtop">';
if ($text != '') {
$o .= '<div id="ph-ajaxtop-message"><div
class="ph-loader-top"></div> '.
strip_tags(addslashes($text)) . '</div>';
}
$o .= '</div>';
return $o;
}
public function formInputs($task = '') {
$o = '';
$o .= '<input type="hidden" name="task"
value="" />'. "\n";
if ($task != '') {
$o .= '<input type="hidden" name="taskgroup"
value="'.strip_tags($task).'" />'.
"\n";
}
$o .= HTMLHelper::_('form.token'). "\n";
return $o;
}
public function group($form, $formArray, $clear = 0) {
$o = '';
if (!empty($formArray)) {
if ($clear == 1) {
foreach ($formArray as $value) {
$o .= '<div
class="control-group">'."\n"
. '<div class="control-label">'.
$form->getLabel($value) . '</div>'."\n"
. '<div class="clearfix"></div>'.
"\n"
. '<div>' . $form->getInput($value).
'</div>'."\n"
. '<div class="clearfix"></div>' .
"\n"
. '</div>'. "\n";
}
} else {
foreach ($formArray as $value) {
$o .= '<div
class="control-group">'."\n"
. '<div class="control-label">'.
$form->getLabel($value) . '</div>'."\n"
. '<div class="controls">' .
$form->getInput($value). '</div>'."\n"
. '</div>' . "\n";
}
}
}
return $o;
}
public function item($form, $item, $suffix = '', $realSuffix =
0) {
$value = $o = '';
if ($suffix != '' && $suffix !=
'<small>()</small>') {
if ($realSuffix) {
$value = $form->getInput($item) .' '. $suffix;
} else {
$value = $suffix;
}
} else {
$value = $form->getInput($item);
}
$o .= '<div
class="control-group">'."\n";
$o .= '<div class="control-label">'.
$form->getLabel($item) . '</div>'."\n"
. '<div class="controls">' .
$value.'</div>'."\n"
. '</div>' . "\n";
return $o;
}
public function itemLabel($item, $label) {
$o = '';
$o .= '<div
class="control-group">'."\n";
$o .= '<div class="control-label">'. $label .
'</div>'."\n"
. '<div class="controls">' .
$item.'</div>'."\n"
. '</div>' . "\n";
return $o;
}
public function itemText($item, $label, $class = '') {
$o = '';
$o .= '<div class="control-group
ph-control-group-text">'."\n";
$o .= '<div class="control-label">'. $label .
'</div>'."\n"
. '<div class="controls '.$class.'">'
. $item.'</div>'."\n"
. '</div>' . "\n";
return $o;
}
public static function getCalendarDate($dateCustom) {
$config = Factory::getConfig();
$user = Factory::getUser();
$filter = 'USER_UTC';//'SERVER_UTC'
switch (strtoupper($filter)){
case 'SERVER_UTC':
if ($dateCustom && $dateCustom !=
Factory::getDbo()->getNullDate()) {
$date = Factory::getDate($dateCustom, 'UTC');
$date->setTimezone(new
\DateTimeZone($config->get('offset')));
$dateCustom = $date->format('Y-m-d H:i:s', true, false);
}
break;
case 'USER_UTC':
if ($dateCustom && $dateCustom !=
Factory::getDbo()->getNullDate()) {
$date = Factory::getDate($dateCustom, 'UTC');
$date->setTimezone(new
\DateTimeZone($user->getParam('timezone',
$config->get('offset'))));
$dateCustom = $date->format('Y-m-d H:i:s', true, false);
}
break;
}
return $dateCustom;
}
/* CP */
public function quickIconButton( $link, $text = '', $icon =
'', $color = '', $item = '') {
$o = '<div class="ph-cp-item
'.$item.'-item-box">';
$o .= ' <div class="ph-cp-item-icon">';
$o .= ' <a class="ph-cp-item-icon-link"
href="'.$link.'"><span
style="background-color: '.$color.'20;"><i
style="color: '.$color.';" class="phi
'.$icon.'
ph-cp-item-icon-link-large"></i></span></a>';
$o .= ' </div>';
$o .= ' <div class="ph-cp-item-title"><a
class="ph-cp-item-title-link"
href="'.$link.'"><span>'.$text.'</span></a></div>';
$o .= '</div>';
return $o;
}
public function getLinks($internalLinksOnly = 0) {
$links = array();
switch ($this->option) {
case 'com_phocacart':
$links[] = array('Phoca Cart site',
'https://www.phoca.cz/phocacart');
$links[] = array('Phoca Cart documentation site',
'https://www.phoca.cz/documentation/category/116-phoca-cart-component');
$links[] = array('Phoca Cart download site',
'https://www.phoca.cz/download/category/100-phoca-cart-component');
$links[] = array('Phoca Cart extensions',
'https://www.phoca.cz/phocacart-extensions');
break;
case 'com_phocamenu':
$links[] = array('Phoca Restaurant Menu site',
'https://www.phoca.cz/phocamenu');
$links[] = array('Phoca Restaurant Menu documentation site',
'https://www.phoca.cz/documentation/category/52-phoca-restaurant-menu-component');
$links[] = array('Phoca Restaurant Menu download site',
'https://www.phoca.cz/download/category/36-phoca-restaurant-menu-component');
break;
}
$links[] = array('Phoca News',
'https://www.phoca.cz/news');
$links[] = array('Phoca Forum',
'https://www.phoca.cz/forum');
if ($internalLinksOnly == 1) {
return $links;
}
$components = array();
$components[] = array('Phoca Gallery','phocagallery',
'pg');
$components[] = array('Phoca
Guestbook','phocaguestbook', 'pgb');
$components[] = array('Phoca
Download','phocadownload', 'pd');
$components[] = array('Phoca
Documentation','phocadocumentation', 'pdc');
$components[] = array('Phoca Favicon','phocafavicon',
'pfv');
$components[] = array('Phoca SEF','phocasef',
'psef');
$components[] = array('Phoca PDF','phocapdf',
'ppdf');
$components[] = array('Phoca Restaurant
Menu','phocamenu', 'prm');
$components[] = array('Phoca Maps','phocamaps',
'pm');
$components[] = array('Phoca Font','phocafont',
'pf');
$components[] = array('Phoca Email','phocaemail',
'pe');
$components[] = array('Phoca Install','phocainstall',
'pi');
$components[] = array('Phoca
Template','phocatemplate', 'pt');
$components[] = array('Phoca
Panorama','phocapanorama', 'pp');
$components[] = array('Phoca
Commander','phocacommander', 'pcm');
$components[] = array('Phoca Photo','phocaphoto',
'ph');
$components[] = array('Phoca Cart','phocacart',
'pc');
$banners = array();
$banners[] = array('Phoca Restaurant
Menu','phocamenu', 'prm');
//$banners[] = array('Phoca Cart','phocacart',
'pc');
$o = '';
$o .= '<p> </p>';
$o .= '<h4
style="margin-bottom:5px;">'.Text::_($this->optionLang.'_USEFUL_LINKS').
'</h4>';
$o .= '<ul>';
foreach ($links as $k => $v) {
$o .= '<li><a style="text-decoration:underline"
href="'.$v[1].'"
target="_blank">'.$v[0].'</a></li>';
}
$o .= '</ul>';
$o .= '<div>';
$o .= '<p> </p>';
$o .= '<h4
style="margin-bottom:5px;">'.Text::_($this->optionLang.'_USEFUL_TIPS').
'</h4>';
$m = mt_rand(0, 10);
if ((int)$m > 0) {
$o .= '<div>';
$num = range(0,(count($components) - 1 ));
shuffle($num);
for ($i = 0; $i<3; $i++) {
$numO = $num[$i];
$o .= '<div style="float:left;width:33%;margin:0
auto;">';
$o .= '<div><a
style="text-decoration:underline;"
href="https://www.phoca.cz/'.$components[$numO][1].'"
target="_blank">'.HTMLHelper::_('image',
'media/'.$this->option.'/images/administrator/icon-box-'.$components[$numO][2].'.png',
''). '</a></div>';
$o .= '<div
style="margin-top:-10px;"><small><a
style="text-decoration:underline;"
href="https://www.phoca.cz/'.$components[$numO][1].'"
target="_blank">'.$components[$numO][0].'</a></small></div>';
$o .= '</div>';
}
$o .= '<div style="clear:both"></div>';
$o .= '</div>';
} else {
$num = range(0,(count($banners) - 1 ));
shuffle($num);
$numO = $num[0];
$o .= '<div><a
href="https://www.phoca.cz/'.$banners[$numO][1].'"
target="_blank">'.HTMLHelper::_('image',
'media/'.$this->option.'/images/administrator/b-'.$banners[$numO][2].'.png',
''). '</a></div>';
}
$o .= '<p> </p>';
$o .= '<h4
style="margin-bottom:5px;">'.Text::_($this->optionLang.'_PLEASE_READ').
'</h4>';
$o .= '<div><a style="text-decoration:underline"
href="https://www.phoca.cz/phoca-needs-your-help/"
target="_blank">'.Text::_($this->optionLang.'_PHOCA_NEEDS_YOUR_HELP').
'</a></div>';
$o .= '</div>';
return $o;
}
// TABS
public function navigation($tabs, $activeTab = '') {
if ($this->compatible) {
return '';
}
$o = '<ul class="nav nav-tabs">';
$i = 0;
foreach($tabs as $k => $v) {
$cA = 0;
if ($activeTab != '') {
if ($activeTab == $k) {
$cA = 'class="active"';
}
} else {
if ($i == 0) {
$cA = 'class="active"';
}
}
$o .= '<li '.$cA.'><a
href="#'.$k.'" data-toggle="tab">'.
$v.'</a></li>'."\n";
$i++;
}
$o .= '</ul>';
return $o;
}
public function startTabs($active = 'general') {
if ($this->compatible) {
return HTMLHelper::_('uitab.startTabSet', 'myTab',
array('active' => $active));
} else {
return '<div id="phAdminEditTabs"
class="tab-content">'. "\n";
}
}
public function endTabs() {
if ($this->compatible) {
return HTMLHelper::_('uitab.endTabSet');
} else {
return '</div>';
}
}
public function startTab($id, $name, $active = '') {
if ($this->compatible) {
return HTMLHelper::_('uitab.addTab', 'myTab', $id,
$name);
} else {
return '<div class="tab-pane '.$active.'"
id="'.$id.'">'."\n";
}
}
public function endTab() {
if ($this->compatible) {
return HTMLHelper::_('uitab.endTab');
} else {
return '</div>';
}
}
}
?>
PK�"�[
$6�G�G%libraries/Phoca/Render/Adminviews.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
namespace Phoca\Render;
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\Helpers\Sidebar;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Version;
class Adminviews
{
public $view = '';
public $viewtype = 1;
public $option = '';
public $optionLang = '';
public $tmpl = '';
public $compatible = false;
public $sidebar = true;
protected $document = false;
public function __construct() {
$app = Factory::getApplication();
$version = new Version();
$this->compatible =
$version->isCompatible('4.0.0-alpha');
$this->view = $app->input->get('view');
$this->option = $app->input->get('option');
$this->optionLang = strtoupper($this->option);
$this->tmpl = $app->input->get('tmpl');
$this->document = Factory::getDocument();
$this->sidebar =
Factory::getApplication()->getTemplate(true)->params->get('menu',
1) ? true : false;
/* switch($this->view) {
case 2:
HTMLHelper::_('behavior.keepalive');
if (!$this->compatible) {
HTMLHelper::_('formbehavior.chosen',
'select');
}
break;
case 1:
default:*/
HTMLHelper::_('bootstrap.tooltip');
HTMLHelper::_('behavior.multiselect');
HTMLHelper::_('dropdown.init');
if (!$this->compatible) {
HTMLHelper::_('formbehavior.chosen', 'select');
}
// break;
//}
// Modal
if ($this->tmpl == 'component') {
HTMLHelper::_('behavior.core');
HTMLHelper::_('behavior.polyfill',
array('event'), 'lt IE 9');
HTMLHelper::_('script', 'media/' .
$this->option .
'/js/administrator/admin-phocaitems-modal.min.js',
array('version' => 'auto', 'relative'
=> true));
HTMLHelper::_('bootstrap.tooltip',
'.hasTooltip', array('placement' =>
'bottom'));
HTMLHelper::_('bootstrap.popover',
'.hasPopover', array('placement' =>
'bottom'));
}
HTMLHelper::_('stylesheet', 'media/' .
$this->option . '/duotone/joomla-fonts.css',
array('version' => 'auto'));
HTMLHelper::_('stylesheet', 'media/' .
$this->option . '/css/administrator/' .
str_replace('com_', '', $this->option) .
'.css', array('version' => 'auto'));
if ($this->compatible) {
HTMLHelper::_('stylesheet', 'media/' .
$this->option . '/css/administrator/4.css',
array('version' => 'auto'));
} else {
HTMLHelper::_('stylesheet', 'media/' .
$this->option . '/css/administrator/3.css',
array('version' => 'auto'));
}
}
public function startMainContainer($id = 'phAdminView',
$class = 'ph-admin-box') {
$o = array();
if ($this->compatible) {
// Joomla! 4
$o[] = '<div class="row">';
if ($this->sidebar) {
$o[] = '<div id="j-main-container"
class="col-md-12">';
} else {
$o[] = '<div id="j-sidebar-container"
class="col-md-2">' . \JHtmlSidebar::render() .
'</div>';
$o[] = '<div id="j-main-container"
class="col-md-10">';
}
} else {
$o[] = '<div id="j-sidebar-container"
class="span2">' . \JHtmlSidebar::render() .
'</div>';
$o[] = '<div id="j-main-container"
class="span10">';
}
return implode("\n", $o);
}
public function endMainContainer() {
$o = array();
$o[] = '</div>';
if ($this->compatible) {
$o[] = '</div>';
}
return implode("\n", $o);
}
public function jsJorderTable($listOrder) {
$js = 'Joomla.orderTable = function() {' .
"\n"
. ' table =
document.getElementById("sortTable");' . "\n"
. ' direction =
document.getElementById("directionTable");' .
"\n"
. ' order =
table.options[table.selectedIndex].value;' . "\n"
. ' if (order != \'' . $listOrder .
'\') {' . "\n"
. ' dirn = \'asc\';' . "\n"
. ' } else {' . "\n"
. ' dirn =
direction.options[direction.selectedIndex].value;' . "\n"
. ' }' . "\n"
. ' Joomla.tableOrdering(order, dirn,
\'\');' . "\n"
. '}' . "\n";
Factory::getDocument()->addScriptDeclaration($js);
}
public function startForm($option, $view, $id = 'adminForm',
$name = 'adminForm') {
return '<div id="' . $view .
'"><form action="' .
Route::_('index.php?option=' . $option . '&view=' .
$view) . '" method="post" name="' . $name .
'" id="' . $id . '">' .
"\n" . '';
}
public function startFormModal($option, $view, $id =
'adminForm', $name = 'adminForm', $function =
'') {
return '<div id="' . $view .
'"><form action="' .
Route::_('index.php?option=' . $option . '&view=' .
$view . '&layout=modal&tmpl=component&function=' .
$function . '&' . Session::getFormToken() . '=1') .
'" method="post" name="' . $name .
'" id="' . $id . '">' .
"\n" . '';
}
public function endForm() {
return '</form>' . "\n" . '' .
"\n" . $this->ajaxTopHtml();
}
public function ajaxTopHtml($text = '') {
$o = '<div id="ph-ajaxtop">';
if ($text != '') {
$o .= '<div
id="ph-ajaxtop-message"><div
class="ph-loader-top"></div> ' .
strip_tags(addslashes($text)) . '</div>';
}
$o .= '</div>';
return $o;
}
/* Modal */
public function startMainContainerNoSubmenu() {
//return '<div id="j-main-container"
class="col-xs-12 col-sm-10 col-md-10">'. "\n";
$o = '<div id="j-main-container"
class="col-xs-12 col-sm-12 col-md-12 ph-admin-box-content
ph-admin-manage">' . "\n";
$o .= '<div
id="ph-system-message-container"></div>' .
"\n";// specific container for moving messages from joomla to
phoca
//$this->moveSystemMessageFromJoomlaToPhoca();
return $o;
}
public function moveSystemMessageFromJoomlaToPhoca() {
$s = array();
//$s[] =
'document.getElementById("system-message-container").style.display
= "none";';
$s[] = 'jQuery(document).ready(function() {';
//$s[] = '
jQuery("#system-message-container").removeClass("j-toggle-main");';
$s[] = '
jQuery("#system-message-container").css("display",
"none");';
$s[] = ' var phSystemMsg =
jQuery("#system-message-container").html();';
$s[] = '
jQuery("#ph-system-message-container").html(phSystemMsg);';
$s[] = '});';
Factory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}
public function startTable($id) {
return '<table class="table table-striped"
id="' . $id . '">' . "\n";
}
public function endTable() {
return '</table>' . "\n";
}
public function tblFoot($listFooter, $columns) {
return '<tfoot>' . "\n" .
'<tr><td colspan="' . (int)$columns .
'">' . $listFooter . '</td></tr>' .
"\n" . '</tfoot>' . "\n";
}
public function startTblHeader() {
return '<thead>' . "\n" .
'<tr>' . "\n";
}
public function endTblHeader() {
return '</tr>' . "\n" .
'</thead>' . "\n";
}
public function thOrderingXML($txtHo, $listDirn, $listOrder, $prefix =
'a', $empty = false) {
if ($empty) {
return '<th class="nowrap center
ph-ordering"></th>' . "\n";
}
return '<th class="nowrap center
ph-ordering">' . "\n"
. HTMLHelper::_('searchtools.sort', '',
strip_tags($prefix) . '.ordering', $listDirn, $listOrder, null,
'asc', $txtHo, 'icon-menu-2') . "\n"
. '</th>';
//HTMLHelper::_('searchtools.sort',
$this->t['l'].'_IN_STOCK', 'a.stock',
$listDirn, $listOrder ).'</th>'."\n";
}
public function thCheck($txtCh) {
return '<th class=" ph-check">' .
"\n"
. '<input type="checkbox"
name="checkall-toggle" value="" title="' .
Text::_($txtCh) . '" onclick="Joomla.checkAll(this)"
/>' . "\n"
. '</th>' . "\n";
}
public function tdOrder($canChange, $saveOrder, $orderkey, $ordering =
0, $catOrderingEnabled = true) {
$o = '<td class="order nowrap center ">'
. "\n";
if ($canChange) {
$disableClassName = '';
$disabledLabel = '';
if (!$saveOrder) {
$disabledLabel =
Text::_('JORDERINGDISABLED');
$disableClassName = 'inactive tip-top';
}
if (!$catOrderingEnabled && !$saveOrder) {
//$disableClassName = 'inactive tip-top';
$disabledLabel = Text::_($this->optionLang .
'_SELECT_CATEGORY_TO_ORDER_ITEMS');
}
$o .= '<span class="sortable-handler hasTooltip
' . $disableClassName . '" title="' .
$disabledLabel . '"><i
class="icon-menu"></i></span>' .
"\n";
} else {
$o .= '<span class="sortable-handler
inactive"><i
class="icon-menu"></i></span>' .
"\n";
}
$orderkeyPlus = $ordering; //$orderkey + 1;
$o .= '<input type="text"
style="display:none" name="order[]" size="5"
value="' . $orderkeyPlus . '" />' .
"\n"
. '</td>' . "\n";
return $o;
}
public function tdRating($ratingAvg) {
$o = '<td class="small ">';
$voteAvg = round(((float)$ratingAvg / 0.5)) * 0.5;
$voteAvgWidth = 16 * $voteAvg;
$o .= '<ul
class="star-rating-small">'
. '<li class="current-rating"
style="width:' . $voteAvgWidth .
'px"></li>'
. '<li><span
class="star1"></span></li>';
for ($ir = 2; $ir < 6; $ir++) {
$o .= '<li><span class="stars' . $ir .
'"></span></li>';
}
$o .= '</ul>';
$o .= '</td>' . "\n";
return $o;
}
public function tdLanguage($lang, $langTitle, $langTitleE) {
$o = '<td class="small nowrap ">';
if ($lang == '*') {
$o .= Text::_('JALL');
} else {
if ($langTitle) {
$o .= $langTitleE;
} else {
$o .= Text::_('JUNDEFINED');
}
}
$o .= '</td>' . "\n";
return $o;
}
public function tdEip($id, $value, $params = array()) {
$classBox = isset($params['classbox']) ?
$params['clasbox'] : 'small';
$classEip = isset($params['classeip']) ?
$params['classeip'] : 'ph-editinplace-text ph-eip-text
ph-eip-price';
$o = array();
$o[] = '<td class="' . $classBox .
'">';
$o[] = '<span class="' . $classEip . '"
id="' . $id . '">' . $value .
'</span>';
$o[] = '</td>';
return implode("\n", $o);
}
public function formInputsXml($listOrder, $listDirn, $originalOrders)
{
return '<input type="hidden"
name="task" value="" />' . "\n"
. '<input type="hidden"
name="boxchecked" value="0" />' .
"\n"
//.'<input type="hidden"
name="filter_order" value="'.$listOrder.'"
/>'. "\n"
//.'<input type="hidden"
name="filter_order_Dir" value="'.$listDirn.'"
/>'. "\n"
. HTMLHelper::_('form.token') . "\n"
. '<input type="hidden"
name="original_order_values" value="' .
implode(',', $originalOrders) . '" />' .
"\n";
}
public function td($value, $class = '') {
if ($class != '') {
return '<td class="' . $class .
'">' . $value . '</td>' .
"\n";
} else {
return '<td>' . $value .
'</td>' . "\n";
}
}
public function tdPublishDownUp($publishUp, $publishDown) {
$o = '';
$db = Factory::getDBO();
//$app = Factory::getApplication();
$nullDate = $db->getNullDate();
$now = Factory::getDate();
$config = Factory::getConfig();
$publish_up = Factory::getDate($publishUp);
$publish_down = Factory::getDate($publishDown);
$tz = new
\DateTimeZone($config->get('offset'));
$publish_up->setTimezone($tz);
$publish_down->setTimezone($tz);
if ($now->toUnix() <= $publish_up->toUnix()) {
$text = Text::_($this->optionLang . '_PENDING');
} else if (($now->toUnix() <= $publish_down->toUnix() ||
$publishDown == $nullDate)) {
$text = Text::_($this->optionLang . '_ACTIVE');
} else if ($now->toUnix() > $publish_down->toUnix()) {
$text = Text::_($this->optionLang . '_EXPIRED');
}
$times = '';
if (isset($publishUp)) {
if ($publishUp == $nullDate) {
$times .= Text::_($this->optionLang .
'_START') . ': ' . Text::_($this->optionLang .
'_ALWAYS');
} else {
$times .= Text::_($this->optionLang .
'_START') . ": " . $publish_up->format("D, d M
Y H:i:s");
}
}
if (isset($publishDown)) {
if ($publishDown == $nullDate) {
$times .= "<br />" .
Text::_($this->optionLang . '_FINISH') . ': ' .
Text::_($this->optionLang . '_NO_EXPIRY');
} else {
$times .= "<br />" .
Text::_($this->optionLang . '_FINISH') . ": " .
$publish_down->format("D, d M Y H:i:s");
}
}
if ($times) {
$o .= '<td align="center">'
. '<span class="editlinktip hasTip"
title="' . Text::_($this->optionLang .
'_PUBLISH_INFORMATION') . '::' . $times .
'">'
. '<a href="javascript:void(0);"
>' . $text . '</a></span>'
. '</td>' . "\n";
} else {
$o .= '<td></td>' . "\n";
}
return $o;
}
public function saveOrder($t, $listDirn) {
$saveOrderingUrl = 'index.php?option=' .
$t['o'] . '&task=' . $t['tasks'] .
'.saveOrderAjax&tmpl=component&' .
Session::getFormToken() . '=1';
if ($this->compatible) {
HTMLHelper::_('draggablelist.draggable');
} else {
HTMLHelper::_('sortablelist.sortable',
'categoryList', 'adminForm', strtolower($listDirn),
$saveOrderingUrl, false, true);
}
return $saveOrderingUrl;
}
public function firstColumnHeader($listDirn, $listOrder, $prefix =
'a', $empty = false) {
if ($this->compatible) {
return '<th class="w-1 text-center
ph-check">' . HTMLHelper::_('grid.checkall') .
'</td>';
} else {
return
$this->thOrderingXML('JGRID_HEADING_ORDERING', $listDirn,
$listOrder, $prefix, $empty);
}
}
public function secondColumnHeader($listDirn, $listOrder, $prefix =
'a', $empty = false) {
if ($this->compatible) {
return
$this->thOrderingXML('JGRID_HEADING_ORDERING', $listDirn,
$listOrder, $prefix, $empty);
} else {
return $this->thCheck('JGLOBAL_CHECK_ALL');
}
}
public function startTblBody($saveOrder, $saveOrderingUrl, $listDirn)
{
$o = array();
if ($this->compatible) {
$o[] = '<tbody';
if ($saveOrder) {
$o[] = ' class="js-draggable"
data-url="' . $saveOrderingUrl . '"
data-direction="' . strtolower($listDirn) . '"
data-nested="true"';
}
$o[] = '>';
} else {
$o[] = '<tbody>' . "\n";
}
return implode("", $o);
}
public function endTblBody() {
return '</tbody>' . "\n";
}
public function startTr($i, $catid = 0) {
$iD = $i % 2;
if ($this->compatible) {
return '<tr class="row' . $iD . '"
data-dragable-group="' . $catid . '">' .
"\n";
} else {
return '<tr class="row' . $iD . '"
sortable-group-id="' . $catid . '" >' .
"\n";
}
}
public function endTr() {
return '</tr>' . "\n";
}
public function firstColumn($i, $itemId, $canChange, $saveOrder,
$orderkey, $ordering, $catOrderingEnabled = true) {
if ($this->compatible) {
return $this->td(HTMLHelper::_('grid.id', $i,
$itemId), 'text-center');
} else {
return $this->tdOrder($canChange, $saveOrder, $orderkey,
$ordering, $catOrderingEnabled);
}
}
public function secondColumn($i, $itemId, $canChange, $saveOrder,
$orderkey, $ordering, $catOrderingEnabled = true) {
if ($this->compatible) {
$o = array();
$o[] = '<td class="text-center d-none
d-md-table-cell">';
$iconClass = '';
if (!$canChange) {
$iconClass = ' inactive';
} else if (!$saveOrder) {
$iconClass = ' inactive" title="' .
Text::_('JORDERINGDISABLED');
} else if (!$catOrderingEnabled) {
$iconClass = ' inactive" title="' .
Text::_($this->optionLang .
'_SELECT_CATEGORY_TO_ORDER_ITEMS');
}
$o[] = '<span class="sortable-handler' .
$iconClass . '"><span class="fas fa-ellipsis-v"
aria-hidden="true"></span></span>';
if ($canChange && $saveOrder) {
$o[] = '<input type="text"
name="order[]" size="5" value="' . $ordering
. '" class="width-20 text-area-order
hidden">';
}
$o[] = '</td>';
return implode("", $o);
} else {
return $this->td(HTMLHelper::_('grid.id', $i,
$itemId), "small ");
}
}
}
?>
PK�"�[B�n��%libraries/phocacart/access/access.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartAccess
{
public $login = 0; // 0 ... not logged in, 1 ... logged in, 2 ... guest
checkout
public $addressadded = 0;
public $addressedit = 0;
public $addressview = 0;
public $shippingadded = 0;
public $shippingedit = 0;
public $shippingview = 0;
public $shippingnotused = 0;
public $shippingdisplayeditbutton = 1;
public $paymentadded = 0;
public $paymentedit = 0;
public $paymentview = 0;
public $paymentnotused = 0;
public $paymentdisplayeditbutton = 1;
public $confirm = 0;
public function __construct() {
$this->login = 0;// User is only logged in
$this->addressadded = 0;// Address added and stored without errors
$this->addressedit = 0;// Address will be edited
$this->addressview = 0;
$this->shippingadded = 0;
$this->shippingedit = 0;
$this->shippingview = 0;
$this->shippingnotused = 0;
$this->shippingdisplayeditbutton = 1;// if shipping method is
only one and automatically selected then set to zero
$this->paymentadded = 0;
$this->paymentedit = 0;
$this->paymentview = 0;
$this->paymentnotused = 0;
$this->paymentdisplayeditbutton = 1;// if payment method is only
one and automatically selected then set to zero
$this->confirm = 0;
}
}
?>
PK�"�[�#o,,%libraries/phocacart/access/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[���L��%libraries/phocacart/access/rights.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartAccessRights
{
public $user = false;
public $params = array();
public function __construct() {
$this->user = PhocacartUser::getUser();
$this->params = PhocacartUtils::getComponentParameters() ;
}
public function canDisplayPrice() {
$display_price =
$this->params->get('display_price', 1);
$display_price_access_levels =
$this->params->get('display_price_access_levels',
'');
// 0) Display price for no one
if ($display_price == 0) {
return false;
}
// 1) Display price for all
if ($display_price == 1) {
return true;
}
// 2) Based on access levels
if ($display_price == 2) {
$levels = $this->user->getAuthorisedViewLevels();
if (!is_array($display_price_access_levels)) {
if (in_array((int)$display_price_access_levels, $levels)) {
return true;
}
} else {
if (count(array_intersect($display_price_access_levels,
$levels))) {
return true;
}
}
return false;
}
// 3) Based on customer group
// If user is inside at least on customer group which allows
displaying the price, the price can be displayed for him
if ($display_price == 3) {
$userGroups =
PhocacartGroup::getGroupsById($this->user->id, 1, 2);
if (!empty($userGroups)) {
foreach ($userGroups as $k => $v) {
if ($v['display_price'] == 1 &&
$v['published'] == 1) {
return true;
}
}
}
return false;
}
return true; // As default, display prices
}
/*
* Used in view functions and in checkout when adding or updating cart
*/
public function canDisplayAddtocart() {
$display_addtocart =
$this->params->get('display_addtocart', 1);
$display_addtocart_access_levels =
$this->params->get('display_addtocart_access_levels',
'');
// 0) Display price for no one
if ($display_addtocart == 0) {
return false;
}
// 1) Display price for all
if ($display_addtocart == 1) {
return true;
}
// 2) Based on access levels
if ($display_addtocart == 2) {
$levels = $this->user->getAuthorisedViewLevels();
if (!is_array($display_addtocart_access_levels)) {
if (in_array((int)$display_addtocart_access_levels,
$levels)) {
return true;
}
} else {
if (count(array_intersect($display_addtocart_access_levels,
$levels))) {
return true;
}
}
return false;
}
// 3) Based on customer group
// If user is inside at least on customer group which allows
displaying the add to cart, the add to cart can be displayed for him
if ($display_addtocart == 3) {
$userGroups =
PhocacartGroup::getGroupsById($this->user->id, 1, 2);
if (!empty($userGroups)) {
foreach ($userGroups as $k => $v) {
if ($v['display_addtocart'] == 1 &&
$v['published'] == 1) {
return true;
}
}
}
return false;
}
return true; // As default, display add to cart
}
/*
* Used in checkout to check products when adding or updating cart
*/
public function canDisplayAddtocartAdvanced($item) {
if ($this->canDisplayAddtocart()) {
if (isset($item->id) && (int)$item->id > 0) {
if ($item->type == 3) {
// PRODUCTTYPE - price on demand product cannot be
added to cart
// PhocacartLog::add(3, 'Warning',
$item->id, 'Product could not be added to cart or ordered because
its type (Product on demand) does not allow it' . ' ' .
JText::_('COM_PHOCACART_PRODUCT'). ': ' .
$item->title );
return false;
} else {
return true;
}
}
}
return false;
}
public function canDisplayAddtocartPrice($item, $price) {
if ($this->canDisplayAddtocart()) {
if (isset($item->id) && (int)$item->id > 0) {
$hide_add_to_cart_zero_price =
$this->params->get('hide_add_to_cart_zero_price', 0);
if ($hide_add_to_cart_zero_price == 1 && $price
< 0.01) {
// PhocacartLog::add(3, 'Warning',
$item->id, 'Product could not be added to cart or ordered because
its price is zero and option \'Hide Add To Cart Button (Zero
Price)\' is enabled' . ' ' .
JText::_('COM_PHOCACART_PRODUCT') . ': ' .
$item->title);
return false;
} else {
return true;
}
}
}
return false;
}
/*
* Used for display function - e.g. AJAX
* When ajax changes the product variants, product variants with zero
stock will not display add to cart button
*
*/
public function canDisplayAddtocartStock($item, $stock) {
if (isset($item->id) && (int)$item->id > 0) {
$item_addtocart =
$this->params->get('item_addtocart', 0);
$hide_add_to_cart_stock =
$this->params->get('hide_add_to_cart_stock', 0);
if ((int)$item_addtocart == 1 || (int)$item_addtocart == 4) {
if ($hide_add_to_cart_stock == 1 && (int)$stock
< 1) {
return false;
}
return true;
} else {
return true;
}
}
return false;
}
public function canDisplayAttributes() {
$display_attributes =
$this->params->get('display_attributes', 1);
$display_attributes_access_levels =
$this->params->get('display_attributes_access_levels',
'');
// 0) Display price for no one
if ($display_attributes == 0) {
return false;
}
// 1) Display price for all
if ($display_attributes == 1) {
return true;
}
// 2) Based on access levels
if ($display_attributes == 2) {
$levels = $this->user->getAuthorisedViewLevels();
if (!is_array($display_attributes_access_levels)) {
if (in_array((int)$display_attributes_access_levels,
$levels)) {
return true;
}
} else {
if
(count(array_intersect($display_attributes_access_levels, $levels))) {
return true;
}
}
return false;
}
// 3) Based on customer group
// If user is inside at least on customer group which allows
displaying the attributes, the attributes can be displayed for him
if ($display_attributes == 3) {
$userGroups =
PhocacartGroup::getGroupsById($this->user->id, 1, 2);
if (!empty($userGroups)) {
foreach ($userGroups as $k => $v) {
if ($v['display_attributes'] == 1 &&
$v['published'] == 1) {
return true;
}
}
}
return false;
}
return true; // As default, display attributes
}
}
?>
PK�"�[��68L8L+libraries/phocacart/attribute/attribute.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartAttribute
{
public static function getAttributesById($productId, $return = 0) {
$db = JFactory::getDBO();
$query = 'SELECT a.id, a.title, a.alias, a.required,
a.type'
. ' FROM #__phocacart_attributes AS a'
. ' WHERE a.product_id = ' . (int)$productId
. ' ORDER BY a.ordering';
$db->setQuery($query);
if ($return == 0) {
return $db->loadObjectList();
} else if ($return == 1) {
return $db->loadAssocList();
} else {
$attributes = $db->loadAssocList();
$attributesSubform = array();
$i = 0;
if (!empty($attributes)) {
foreach ($attributes as $k => $v) {
$attributesSubform['attributes' .
$i]['id'] = (int)$v['id'];
$attributesSubform['attributes' .
$i]['title'] = (string)$v['title'];
$attributesSubform['attributes' .
$i]['alias'] = (string)$v['alias'];
$attributesSubform['attributes' .
$i]['required'] = (int)$v['required'];
$attributesSubform['attributes' .
$i]['type'] = (int)$v['type'];
$i++;
}
}
return $attributesSubform;
}
return false;
}
public static function getOptionsById($attributeId, $return = 0) {
$db = JFactory::getDBO();
$query = 'SELECT a.id, a.title, a.alias, a.amount, a.operator,
a.stock, a.operator_weight, a.weight, a.image, a.image_medium,
a.image_small, a.download_folder, a.download_file, a.download_token,
a.color, a.default_value, a.required, a.type';
$query .= ' FROM #__phocacart_attribute_values AS a'
. ' WHERE a.attribute_id = ' . (int)$attributeId
. ' ORDER BY a.ordering';
$db->setQuery($query);
if ($return == 0) {
return $db->loadObjectList();
} else if ($return == 1) {
return $db->loadAssocList();
} else {
$options = $db->loadAssocList();
$optionsSubform = array();
$i = 0;
if (!empty($options)) {
foreach ($options as $k => $v) {
$optionsSubform['options' .
$i]['id'] = (int)$v['id'];
$optionsSubform['options' .
$i]['title'] = (string)$v['title'];
$optionsSubform['options' .
$i]['alias'] = (string)$v['alias'];
$optionsSubform['options' .
$i]['operator'] = (string)$v['operator'];
$optionsSubform['options' .
$i]['amount'] =
PhocacartPrice::cleanPrice($v['amount']);
$optionsSubform['options' .
$i]['stock'] = (string)$v['stock'];
$optionsSubform['options' .
$i]['operator_weight'] = (string)$v['operator_weight'];
$optionsSubform['options' .
$i]['weight'] =
PhocacartPrice::cleanPrice($v['weight']);
$optionsSubform['options' .
$i]['image'] = (string)$v['image'];
$optionsSubform['options' .
$i]['image_medium'] = (string)$v['image_medium'];
$optionsSubform['options' .
$i]['image_small'] = (string)$v['image_small'];
$optionsSubform['options' .
$i]['download_folder'] = (string)$v['download_folder'];
$optionsSubform['options' .
$i]['download_file'] = (string)$v['download_file'];
$optionsSubform['options' .
$i]['download_token'] = (string)$v['download_token'];
$optionsSubform['options' .
$i]['color'] = (string)$v['color'];
$optionsSubform['options' .
$i]['default_value'] = (int)$v['default_value'];
$optionsSubform['options' .
$i]['required'] = (int)$v['required'];
$optionsSubform['options' .
$i]['type'] = (int)$v['type'];
$i++;
}
}
return $optionsSubform;
}
return false;
}
public static function getTypeArray($returnId = 0, $returnValue = 0,
$returnFull = 0) {
// 0 ... Title
// 1 ... Default Value Type (1 ... multiple default values
(checkbox), 2 ... single default value (select box))
// EDIT PHOCACARTATTRIBUTE (attribute class, attribute layouts)
$o = array(
'1' =>
array(JText::_('COM_PHOCACART_ATTR_TYPE_SELECT'), 0),
'2' =>
array(JText::_('COM_PHOCACART_ATTR_TYPE_COLOR_SELECT'), 0),
'3' =>
array(JText::_('COM_PHOCACART_ATTR_TYPE_IMAGE_SELECT'), 0),
'4' =>
array(JText::_('COM_PHOCACART_ATTR_TYPE_CHECKBOX'), 1),
'5' =>
array(JText::_('COM_PHOCACART_ATTR_TYPE_COLOR_CHECKBOX'), 1),
'6' =>
array(JText::_('COM_PHOCACART_ATTR_TYPE_IMAGE_CHECKBOX'), 1),
'7' =>
array(JText::_('COM_PHOCACART_ATTR_TYPE_TEXT_64'), ''),
'8' =>
array(JText::_('COM_PHOCACART_ATTR_TYPE_TEXT_128'),
''),
'9' =>
array(JText::_('COM_PHOCACART_ATTR_TYPE_TEXT_256'),
''),
'10' =>
array(JText::_('COM_PHOCACART_ATTR_TYPE_TEXTAREA_1024'),
''),
'11' =>
array(JText::_('COM_PHOCACART_ATTR_TYPE_TEXTAREA_2048'),
''),
'12' =>
array(JText::_('COM_PHOCACART_ATTR_TYPE_TEXT_COLOR_PICKER'),
''),
'20' =>
array(JText::_('COM_PHOCACART_ATTR_TYPE_GIFT'), '')
);
if ((int)$returnId > 0 && (int)$returnValue > 0) {
return $o[(int)$returnId][(int)$returnValue];//returnValue: 0
... Title, 1 ... Default Value Type
}
if ((int)$returnId > 0) {
return $o[(int)$returnId];// whole row
}
if ($returnFull == 0) {
$o2 = array();
foreach ($o as $k => $v) {
$o2[$k] = $v[0];
}
return $o2; // text and value for select box
}
return $o;
}
public static function getAttributeLength($type, $typeOption = 0) {
// EDIT PHOCACARTATTRIBUTE ATTRIBUTETYPE
switch ($type) {
case 7:
return 64;
break;
case 8:
return 128;
break;
case 9:
return 256;
break;
case 10:
return 1024;
break;
case 11:
return 2048;
break;
case 12:
return 7;
break;
// GIFT
case 20:
if ($typeOption == 20) { return 100;} // recipient name
if ($typeOption == 21) { return 50;} // recipient email
if ($typeOption == 22) { return 100;} // sender name
if ($typeOption == 23) {
$paramsC =
PhocacartUtils::getComponentParameters();
$gift_sender_message_length = $paramsC->get(
'gift_sender_message_length', 500 );
return (int)$gift_sender_message_length;
} // sender message
if ($typeOption == 24) { return 3;} // gift type
return 0;
break;
default:
return 0;
break;
}
return 0;
}
/*
* type of attribute
* value of attribute
* encoded - is urlencoded yet
* display - are we asking it for display (we only want to display text
attributes value not checkbox or selectboxes which include
* numbers (their values are displayed other way
* type of option
*/
public static function setAttributeValue($type, $value, $encoded =
false, $display = false, $typeOption = 0) {
switch ($type) {
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 20:
if ($encoded || $display) {
$value = urldecode($value);
}
$value = strip_tags($value);
return urlencode(substr($value, 0,
self::getAttributeLength($type, $typeOption)));
break;
default:
if ($display) {
return '';
} else {
return (int)$value;
}
break;
}
return false;
}
public static function getRequiredArray() {
$o = array('0' =>
JText::_('COM_PHOCACART_NO'), '1' =>
JText::_('COM_PHOCACART_YES'));
return $o;
}
public static function getOperatorArray() {
$o = array('+' => '+', '-' =>
'-');
return $o;
}
/**
* @param $productId
* @param $attributesArray
* @param int $new
* @param int $copy used by BATCH and COPY ATTRIBUTES - if copy == 1
then only create new tokens, if copy == 2 then create new tokens and create
folder and copy the files from source
* @throws Exception
*/
public static function storeAttributesById($productId,
$attributesArray, $new = 0, $copy = 0) {
if ((int)$productId > 0) {
$db = JFactory::getDBO();
$app = JFactory::getApplication();
$pathAttributes =
PhocacartPath::getPath('attributefile');// to check if attribute
option download file exists
// When you add or update attributes and options, you need to
have some info about which attributes and options
// are now active - so all others will be removed
$notDeleteAttribs = array(); //
Select all attributes which will be not deleted
// Options are defined in attributes array
$i = 1;
// ADD ATTRIBUTES
if (!empty($attributesArray)) {
foreach ($attributesArray as $k => $v) {
if (empty($v['title'])) {
$v['title'] =
JFactory::getDate()->format("Y-m-d-H-i-s");
}
if (empty($v['alias'])) {
$v['alias'] = $v['title'];
}
$v['alias'] =
PhocacartUtils::getAliasName($v['alias']);
// correct simple xml
if (empty($v['title'])) {
$v['title'] = '';
}
if (empty($v['alias'])) {
$v['alias'] = '';
}
if (empty($v['required'])) {
$v['required'] = '';
}
if (empty($v['type'])) {
$v['type'] = '';
}
$idExists = 0;
if ($new == 0) {
if (isset($v['id']) &&
$v['id'] > 0) {
// Does the row exist
$query = ' SELECT id '
. ' FROM #__phocacart_attributes'
. ' WHERE id = ' .
(int)$v['id']
. ' ORDER BY id';
$db->setQuery($query);
$idExists = $db->loadResult();
}
}
if ((int)$idExists > 0) {
$query = 'UPDATE #__phocacart_attributes
SET'
. ' product_id = ' . (int)$productId
. ','
. ' title = ' .
$db->quote($v['title']) . ','
. ' alias = ' .
$db->quote($v['alias']) . ','
. ' required = ' .
(int)$v['required'] . ','
. ' type = ' .
(int)$v['type'] . ','
. ' ordering = ' . (int)$i
. ' WHERE id = ' . (int)$idExists;
$db->setQuery($query);
$db->execute();
$i++;
$newIdA = $idExists;
} else {
$valuesString = '';
$valuesString = '(' . (int)$productId .
', ' . $db->quote($v['title']) . ', ' .
$db->quote($v['alias']) . ', ' .
(int)$v['required'] . ', ' . (int)$v['type']
. ', ' . $i . ')';
$query = ' INSERT INTO
#__phocacart_attributes (product_id, title, alias, required, type,
ordering)'
. ' VALUES ' . (string)$valuesString;
$db->setQuery($query);
$db->execute(); // insert is not done together
but step by step because of getting last insert id
$i++;
// ADD OPTIONS
$newIdA = $db->insertid();
}
$notDeleteAttribs[] = $newIdA;
$notDeleteOptions = array();// Select all options which
will be not deleted
if (!empty($v['options']) &&
isset($newIdA) && (int)$newIdA > 0) {
$options = array();
// Get Default Value Type - if the attribute type
is single select box or multiple checkbox
// If 1 ... it is multiple, you don't need to
check for unique default value
// If 0 ... it is single, you need to check that
the attribute has selected only one value
$dTV = self::getTypeArray($v['type'], 1);
$dI = 0;// defaultValue $i
$dVR = 0;// defaultValue removed?
$j = 0;// ordering
foreach ($v['options'] as $k2 => $v2)
{
if (empty($v2['alias'])) {
$v2['alias'] =
$v2['title'];
}
$v2['alias'] =
PhocacartUtils::getAliasName($v2['alias']);
// Transform checkbox to INT (1 or 0)
// And check if there are more default values
which is not possible e.g. for select box
$defaultValue = 0;
//PhocacartLog::add(3, $v['title'] .
'- '. $v2['title']. $v2['type']. ' -
'. $v2['default_value']);
// can be "on" (sent by form) or
"0" or "1" sent by database e.g. in batch
if (isset($v2['default_value'])
&& $v2['default_value'] != '0') {
$defaultValue = 1;
// SELECTBOX OR TEXT
if ($dTV == 0 || $dTV == '') {
$dI++;
}
// Example: we are in loop of options of
select box
// User has selected two default values
(checked)
// But select box can have only one default
value, so we need to skip it and inform user
if ($dTV == 0 && (int)$dI > 1) {
// SELECT - only one default value
$defaultValue = 0;
$dVR = 1;
} else if ($dTV === '' &&
(int)$dI > 0) {
// TEXT - no default value
$defaultValue = 0;
$dVR = 1;
}
}
// correct simple xml
if (empty($v2['title'])) {
$v2['title'] = '';
}
if (empty($v2['alias'])) {
$v2['alias'] = '';
}
if (empty($v2['operator'])) {
$v2['operator'] = '';
}
if (empty($v2['amount'])) {
$v2['amount'] = '';
}
if (empty($v2['stock'])) {
$v2['stock'] = '';
}
if (empty($v2['operator_weight'])) {
$v2['operator_weight'] =
'';
}
if (empty($v2['weight'])) {
$v2['weight'] = '0.0';
}
if (empty($v2['image'])) {
$v2['image'] = '';
}
if (empty($v2['image_medium'])) {
$v2['image_medium'] =
'';
}
if (empty($v2['image_small'])) {
$v2['image_small'] =
'';
}
if (empty($v2['download_folder'])) {
$v2['download_folder'] =
'';
}
if (empty($v2['download_file'])) {
$v2['download_file'] =
'';
}
if (empty($v2['download_token'])) {
$v2['download_token'] =
'';
}
if (empty($v2['color'])) {
$v2['color'] = '';
}
if (empty($v2['required'])) {
$v2['required'] = '0';
}
if (empty($v2['type'])) {
$v2['type'] = '0';
}
//if (empty($v2['default_value']))
{$v2['default_value'] = '';}
// COPY OR BATCH functions - we cannot do the
same tokens so create new token and token folder and if set copy the files
// EACH ATTRIBUTE OPTION DOWNLOAD FILE MUST
HAVE UNIQUE DOWNLOAD TOKEN AND DOWNLOAD FOLDER
if ($copy > 0) {
// First create new token and token folder
$oldDownloadFolder =
$v2['download_folder'];
$v2['download_token'] =
PhocacartUtils::getToken();
$v2['download_folder'] =
PhocacartUtils::getToken('folder');
if ($copy == 2 &&
$v2['download_file'] != '' &&
\Joomla\CMS\Filesystem\File::exists($pathAttributes['orig_abs_ds']
. $v2['download_file'])) {
$newDownloadFile =
str_replace($oldDownloadFolder, $v2['download_folder'],
$v2['download_file']);
if
(!\Joomla\CMS\Filesystem\Folder::create($pathAttributes['orig_abs_ds']
. $v2['download_folder'])) {
// Error message will be set below:
COM_PHOCACART_ERROR_DOWNLOAD_FILE_OF_ATTRIBUTE_OPTION_DOES_NOT_EXIST
}
if
(!\Joomla\CMS\Filesystem\File::copy($pathAttributes['orig_abs_ds']
. $v2['download_file'], $pathAttributes['orig_abs_ds']
. $newDownloadFile)) {
// Error message will be set below:
COM_PHOCACART_ERROR_DOWNLOAD_FILE_OF_ATTRIBUTE_OPTION_DOES_NOT_EXIST
}
$v2['download_file'] =
$newDownloadFile;
} else {
$v2['download_file'] =
'';
}
}
// CHECK DOWNLOAD FILE
if ($v2['download_file'] !=
'' && $v2['download_folder'] == '') {
$msg =
JText::_('COM_PHOCACART_ATTRIBUTE') . ': ' .
$v['title'] . "<br />";
$msg .=
JText::_('COM_PHOCACART_ERROR_DOWNLOAD_FILE_DOES_NOT_INCLUDE_DOWNLOAD_FOLDER');
$app->enqueueMessage($msg,
'error');
}
// If download_file does not exist on the
server, remove it
if ($v2['download_file'] !=
'' &&
!JFile::exists($pathAttributes['orig_abs_ds'] .
$v2['download_file'])) {
$v2['download_file'] =
'';
$msg =
JText::_('COM_PHOCACART_ATTRIBUTE') . ': ' .
$v['title'] . "<br />";
$msg .=
JText::_('COM_PHOCACART_ERROR_DOWNLOAD_FILE_OF_ATTRIBUTE_OPTION_DOES_NOT_EXIST');
$app->enqueueMessage($msg,
'error');
}
$idExists = 0;
if ($new == 0) {
if (isset($v2['id']) &&
$v2['id'] > 0) {
// Does the row exist
$query = ' SELECT id '
. ' FROM
#__phocacart_attribute_values'
. ' WHERE id = ' .
(int)$v2['id']
. ' ORDER BY id';
$db->setQuery($query);
$idExists = $db->loadResult();
}
}
if ((int)$idExists > 0) {
$v2['amount'] =
PhocacartUtils::replaceCommaWithPoint($v2['amount']);
$v2['weight'] =
PhocacartUtils::replaceCommaWithPoint($v2['weight']);
$query = 'UPDATE
#__phocacart_attribute_values SET'
. ' attribute_id = ' .
(int)$newIdA . ','
. ' title = ' .
$db->quote($v2['title']) . ','
. ' alias = ' .
$db->quote($v2['alias']) . ','
. ' operator = ' .
$db->quote($v2['operator']) . ','
. ' amount = ' .
$db->quote($v2['amount']) . ','
. ' stock = ' .
(int)$v2['stock'] . ','
. ' operator_weight = ' .
$db->quote($v2['operator_weight']) . ','
. ' weight = ' .
$db->quote($v2['weight']) . ','
. ' image = ' .
$db->quote($v2['image']) . ','
. ' image_medium = ' .
$db->quote($v2['image_medium']) . ','
. ' image_small = ' .
$db->quote($v2['image_small']) . ','
. ' download_folder = ' .
$db->quote($v2['download_folder']) . ','
. ' download_file = ' .
$db->quote($v2['download_file']) . ','
. ' download_token = ' .
$db->quote($v2['download_token']) . ','
. ' color = ' .
$db->quote($v2['color']) . ','
. ' default_value = ' .
(int)$defaultValue . ','
. ' required = ' .
(int)$v2['required'] . ','
. ' type = ' .
(int)$v2['type'] . ','
. ' ordering = ' . (int)$j
. ' WHERE id = ' .
(int)$idExists;
$db->setQuery($query);
$db->execute();
$j++;
$newIdO = $idExists;
} else {
$v2['amount'] =
PhocacartUtils::replaceCommaWithPoint($v2['amount']);
$v2['weight'] =
PhocacartUtils::replaceCommaWithPoint($v2['weight']);
$options = '(' . (int)$newIdA .
', '
. $db->quote($v2['title'])
. ', '
. $db->quote($v2['alias'])
. ', '
.
$db->quote($v2['operator']) . ', '
.
$db->quote($v2['amount']) . ', '
. (int)$v2['stock'] . ',
'
.
$db->quote($v2['operator_weight']) . ', '
.
$db->quote($v2['weight']) . ', '
. $db->quote($v2['image'])
. ', '
.
$db->quote($v2['image_medium']) . ', '
.
$db->quote($v2['image_small']) . ', '
.
$db->quote($v2['download_folder']) . ','
.
$db->quote($v2['download_file']) . ','
.
$db->quote($v2['download_token']) . ','
. $db->quote($v2['color'])
. ', '
. (int)$defaultValue . ','
. (int)$v2['required'] .
', '
. (int)$v2['type'] . ',
'
. (int)$j . ')';
$query = ' INSERT INTO
#__phocacart_attribute_values (attribute_id, title, alias, operator,
amount, stock, operator_weight, weight, image, image_medium, image_small,
download_folder, download_file, download_token, color, default_value,
required, type, ordering)'
. ' VALUES ' . $options;
$db->setQuery($query);
$db->execute();
$j++;
$newIdO = $db->insertid();
}
$notDeleteOptions[] = $newIdO;
}
// One or more default values removed
if ($dVR == 1) {
$msg =
JText::_('COM_PHOCACART_ATTRIBUTE') . ': ' .
$v['title'] . "<br />";
$msg .=
JText::_('COM_PHOCACART_THIS_ATTRIBUTE_DOES_NOT_ALLOW_TO_STORE_DEFAULT_VALUES_OR_MULTIPLE_DEFAULT_VALUES');
$app->enqueueMessage($msg,
'error');
}
}
// Remove all options except the active
if (!empty($notDeleteOptions)) {
$notDeleteOptionsString = implode(',',
$notDeleteOptions);
// Remove all download files from not active
attribute values:
$qS = ' SELECT download_folder,
download_file'
. ' FROM
#__phocacart_attribute_values'
. ' WHERE attribute_id = ' .
(int)$newIdA
. ' AND id NOT IN (' .
$notDeleteOptionsString . ')';
$query = ' DELETE '
. ' FROM
#__phocacart_attribute_values'
. ' WHERE attribute_id = ' .
(int)$newIdA
. ' AND id NOT IN (' .
$notDeleteOptionsString . ')';
} else {
// Remove all download files from not active
attribute values:
$qS = ' SELECT download_folder,
download_file'
. ' FROM
#__phocacart_attribute_values'
. ' WHERE attribute_id = ' .
(int)$newIdA;
$query = ' DELETE '
. ' FROM
#__phocacart_attribute_values'
. ' WHERE attribute_id = ' .
(int)$newIdA;
}
$db->setQuery($qS);
$folderFiles = $db->loadAssocList();
self::removeDownloadFolderAndFiles($folderFiles,
$pathAttributes);
$db->setQuery($query);
$db->execute();
}
}
// Remove all attributes except the active
if (!empty($notDeleteAttribs)) {
$notDeleteAttribsString = implode(',',
$notDeleteAttribs);
// Remove all download files from not active attributes:
$qS = ' SELECT v.download_folder,
v.download_file'
. ' FROM #__phocacart_attribute_values AS v'
. ' LEFT JOIN #__phocacart_attributes AS a ON a.id
= v.attribute_id'
. ' WHERE a.product_id = ' . (int)$productId
. ' AND a.id NOT IN (' .
$notDeleteAttribsString . ')';
$query = ' DELETE '
. ' FROM #__phocacart_attributes'
. ' WHERE product_id = ' . (int)$productId
. ' AND id NOT IN (' .
$notDeleteAttribsString . ')';
} else {
// Remove all download files from not active attributes:
$qS = ' SELECT v.download_folder,
v.download_file'
. ' FROM #__phocacart_attribute_values AS v'
. ' LEFT JOIN #__phocacart_attributes AS a ON a.id
= v.attribute_id'
. ' WHERE a.product_id = ' . (int)$productId;
$query = ' DELETE '
. ' FROM #__phocacart_attributes'
. ' WHERE product_id = ' . (int)$productId;
}
$db->setQuery($qS);
$folderFiles = $db->loadAssocList();
self::removeDownloadFolderAndFiles($folderFiles,
$pathAttributes);
$db->setQuery($query);
$db->execute();
}
}
public static function removeDownloadFolderAndFiles($folderFiles,
$pathAttributes) {
if (!empty($folderFiles)) {
foreach ($folderFiles as $kF => $vF) {
// Folder will remove the file(s) too
if
(\Joomla\CMS\Filesystem\Folder::exists($pathAttributes['orig_abs_ds']
. $vF['download_folder'])) {
\Joomla\CMS\Filesystem\Folder::delete($pathAttributes['orig_abs_ds']
. $vF['download_folder']);
}
}
}
}
/*
public static function storeAttributesById($productId,
$attributesArray) {
if ((int)$productId > 0) {
$db = JFactory::getDBO();
$app = JFactory::getApplication();
// REMOVE OPTIONS
// Get attribute ids which will be removed (to remove options)
$query = ' SELECT id '
.' FROM #__phocacart_attributes'
. ' WHERE product_id = '. (int)$productId
.' ORDER BY id';
$db->setQuery($query);
$deleteIds = $db->loadColumn();
if (!empty($deleteIds)) {
$deleteString = implode(',', $deleteIds);
$query = ' DELETE '
.' FROM #__phocacart_attribute_values'
. ' WHERE attribute_id IN ('.
(string)$deleteString.')';
$db->setQuery($query);
$db->execute();
}
// REMOVE ATTRIBUTES
$query = ' DELETE '
.' FROM #__phocacart_attributes'
. ' WHERE product_id = '. (int)$productId;
$db->setQuery($query);
$db->execute();
// ADD ATTRIBUTES
if (!empty($attributesArray)) {
foreach($attributesArray as $k => $v) {
if(empty($v['alias'])) {
$v['alias'] = $v['title'];
}
$v['alias'] =
PhocacartUtils::getAliasName($v['alias']);
// correct simple xml
if (empty($v['title']))
{$v['title'] = '';}
if (empty($v['alias']))
{$v['alias'] = '';}
if (empty($v['required']))
{$v['required'] = '';}
if (empty($v['type']))
{$v['type'] = '';}
$valuesString = '';
$valuesString = '('.(int)$productId.',
'.$db->quote($v['title']).',
'.$db->quote($v['alias']).',
'.(int)$v['required'].',
'.(int)$v['type'].')';
$query = ' INSERT INTO #__phocacart_attributes
(product_id, title, alias, required, type)'
.' VALUES
'.(string)$valuesString;
$db->setQuery($query);
$db->execute(); // insert is not done together but
step by step because of getting last insert id
// ADD OPTIONS
$newId = $db->insertid();
if (!empty($v['options']) &&
isset($newId) && (int)$newId > 0) {
$options = array();
// Get Default Value Type - if the attribute type
is single select box or multiple checkbox
// If 1 ... it is multiple, you don't need to
check for unique default value
// If 0 ... it is single, you need to check that
the attribute has selected only one value
$dTV = self::getTypeArray($v['type'], 1);
$dI = 0;// defaultValue $i
$dVR = 0;// defaultValue removed?
foreach($v['options'] as $k2 => $v2) {
if(empty($v2['alias'])) {
$v2['alias'] =
$v2['title'];
}
$v2['alias'] =
PhocacartUtils::getAliasName($v2['alias']);
// Transform checkbox to INT (1 or 0)
// And check if there are more default values
which is not possible e.g. for select box
$defaultValue = 0;
//PhocacartLog::add(3, $v['title'] .
'- '. $v2['title']. $v2['type']. ' -
'. $v2['default_value']);
// can be "on" (sent by form) or
"0" or "1" sent by database e.g. in batch
if (isset($v2['default_value'])
&& $v2['default_value'] != '0') {
$defaultValue = 1;
if ($dTV == 0) {
$dI++;
}
// Example: we are in loop of options of
select box
// User has selected two default values
(checked)
// But select box can have only one default
value, so we need to skip it and inform user
if ((int)$dI > 1) {
$defaultValue = 0;
$dVR = 1;
}
}
// correct simple xml
if (empty($v2['title']))
{$v2['title'] = '';}
if (empty($v2['alias']))
{$v2['alias'] = '';}
if (empty($v2['operator']))
{$v2['operator'] = '';}
if (empty($v2['amount']))
{$v2['amount'] = '';}
if (empty($v2['stock']))
{$v2['stock'] = '';}
if (empty($v2['operator_weight']))
{$v2['operator_weight'] = '';}
if (empty($v2['weight']))
{$v2['weight'] = '';}
if (empty($v2['image']))
{$v2['image'] = '';}
if
(empty($v2['image_small'])) {$v2['image_small'] =
'';}
if (empty($v2['color']))
{$v2['color'] = '';}
$options[] = '('.(int)$newId.',
'.$db->quote($v2['title']).',
'.$db->quote($v2['alias']).',
'.$db->quote($v2['operator']).',
'.$db->quote($v2['amount']).',
'.(int)$v2['stock'].',
'.$db->quote($v2['operator_weight']).',
'.$db->quote($v2['weight']).',
'.$db->quote($v2['image']).',
'.$db->quote($v2['image_small']).',
'.$db->quote($v2['color']).',
'.(int)$defaultValue.')';
if (!empty($options)) {
$valuesString2 = implode(',',
$options);
}
}
$query = ' INSERT INTO
#__phocacart_attribute_values (attribute_id, title, alias, operator,
amount, stock, operator_weight, weight, image, image_small, color,
default_value)'
.' VALUES
'.(string)$valuesString2;
$db->setQuery($query);
$db->execute();
// One or more default values removed
if ($dVR == 1) {
$msg =
JText::_('COM_PHOCACART_ATTRIBUTE'). ': '.
$v['title'] . "<br />";
$msg .=
JText::_('COM_PHOCACART_THIS_ATTRIBUTE_DOES_NOT_ALLOW_TO_STORE_MULTIPLE_DEFAULT_VALUES');
$app->enqueueMessage($msg,
'error');
}
}
}
}
}
}*/
public static function getAttributesAndOptions($productId) {
$attributes = array();
$attributes = self::getAttributesById($productId);
$attributesKey = array();
if (!empty($attributes)) {
foreach ($attributes as $k => $v) {
$attributesKey[$v->id] = $v;
$options =
self::getOptionsById((int)$v->id);
if (!empty($options)) {
//$attributes[$k]->options = $options;
$optionsKey = array();
foreach ($options as $k2 => $v2) {
$optionsKey[$v2->id] = $v2;
}
$attributesKey[$v->id]->options = $optionsKey;
} else {
//$attributes[$k]->options = false;
$attributesKey[$v->id]->options = false;
}
}
}
return $attributesKey;
}
public static function getAllAttributesAndOptions($ordering = 1,
$onlyAvailableProducts = 0, $lang = '', $filterProducts =
array()) {
$db = JFactory::getDBO();
$orderingText = PhocacartOrdering::getOrderingText($ordering, 5);
$columns = 'v.id, v.title, v.alias, v.image,
v.image_medium, v.image_small, v.download_folder, v.download_file,
v.download_token, v.color, v.default_value, v.required, v.type, at.id AS
attrid, at.title AS attrtitle, at.alias AS attralias, at.type as
attrtype';
$groupsFull = 'v.id, v.title, v.alias, v.image,
v.image_medium, v.image_small, v.download_folder, v.download_file,
v.download_token, v.color, v.default_value, v.required, v.type attralias,
at.id, at.title, at.alias, at.type';
$groupsFast = 'v.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull
: $groupsFast;
$wheres = array();
$lefts = array();
$lefts[] = ' #__phocacart_attributes AS at ON at.id =
v.attribute_id';
if ($onlyAvailableProducts == 1) {
if ($lang != '' && $lang != '*') {
$wheres[] =
PhocacartUtilsSettings::getLangQuery('p.language', $lang);
}
$lefts[] = ' #__phocacart_products AS p ON at.product_id =
p.id';
$rules = PhocacartProduct::getOnlyAvailableProductRules();
$wheres = array_merge($wheres, $rules['wheres']);
$lefts = array_merge($lefts, $rules['lefts']);
} else {
if ($lang != '' && $lang != '*') {
$wheres[] =
PhocacartUtilsSettings::getLangQuery('p.language', $lang);
$lefts[] = ' #__phocacart_products AS p ON
at.product_id = p.id';
}
}
if (!empty($filterProducts)) {
$productIds = implode(',', $filterProducts);
$wheres[] = 'p.id IN (' . $productIds .
')';
}
$q = ' SELECT ' . $columns
. ' FROM #__phocacart_attribute_values AS v'
. (!empty($lefts) ? ' LEFT JOIN ' . implode('
LEFT JOIN ', $lefts) : '')
. (!empty($wheres) ? ' WHERE ' . implode(' AND
', $wheres) : '')
. ' GROUP BY ' . $groups
. ' ORDER BY ' . $orderingText;
$db->setQuery($q);
$attributes = $db->loadObjectList();
$a = array();
if (!empty($attributes)) {
foreach ($attributes as $k => $v) {
if (isset($v->attrtitle) && $v->attrtitle !=
''
&& isset($v->attrid) &&
$v->attrid != ''
&& isset($v->attralias) &&
$v->attralias != '') {
$a[$v->attralias]['title'] =
$v->attrtitle;
$a[$v->attralias]['id'] =
$v->attrid;
$a[$v->attralias]['alias'] =
$v->attralias;
$a[$v->attralias]['type'] =
$v->attrtype;
if (isset($v->title) && $v->title !=
''
&& isset($v->id) && $v->id !=
''
&& isset($v->alias) &&
$v->alias != '') {
$a[$v->attralias]['options'][$v->alias] =
new stdClass();
$a[$v->attralias]['options'][$v->alias]->title
= $v->title;
$a[$v->attralias]['options'][$v->alias]->id
= $v->id;
$a[$v->attralias]['options'][$v->alias]->alias
= $v->alias;
$a[$v->attralias]['options'][$v->alias]->image
= $v->image;
$a[$v->attralias]['options'][$v->alias]->image_small
= $v->image_small;
$a[$v->attralias]['options'][$v->alias]->download_folder
= $v->download_folder;
$a[$v->attralias]['options'][$v->alias]->download_file
= $v->download_file;
$a[$v->attralias]['options'][$v->alias]->download_token
= $v->download_token;
$a[$v->attralias]['options'][$v->alias]->color
= $v->color;
$a[$v->attralias]['options'][$v->alias]->default_value
= $v->default_value;
$a[$v->attralias]['options'][$v->alias]->required
= $v->required;
$a[$v->attralias]['options'][$v->alias]->type
= $v->type;
} else {
$a[$v->attralias]['options'] =
array();
}
}
}
}
return $a;
}
public static function getAttributeValue($id, $attributeId) {
$db = JFactory::getDBO();
$query = ' SELECT a.id, a.title, a.type, a.alias, a.amount,
a.operator, a.weight, a.operator_weight, a.stock, a.image, a.image_medium,
a.image_small, a.download_folder, a.download_file, a.download_token,
a.color, a.default_value, a.required, a.type,'
. ' aa.id as aid, aa.title as atitle, aa.type as
atype'
. ' FROM #__phocacart_attribute_values AS a'
. ' LEFT JOIN #__phocacart_attributes AS aa ON
a.attribute_id = aa.id'
. ' WHERE a.id = ' . (int)$id . ' AND
a.attribute_id = ' . (int)$attributeId
. ' ORDER BY a.id'
. ' LIMIT 1';
$db->setQuery($query);
$attrib = $db->loadObject();
return $attrib;
}
public static function getAttributeFullValues($attributes) {
$fullAttributes = array();
if (!empty($attributes)) {
foreach ($attributes as $k => $v) {
$fullAttributes[$k] = new stdClass();
// Could be set a function to get info about the attribute,
for now not needed
if (!empty($v)) {
foreach ($v as $k2 => $v2) {
if ((int)$k > 0 && (int)$k2 > 0) {
$attrib =
PhocacartAttribute::getAttributeValue((int)$k2, (int)$k);
$fullAttributes[$k]->options[$k2] = $attrib;
}
}
}
}
}
return $fullAttributes;
}
/*
* Check if attribute is required or not
* This is checked when adding products to cart (normally, this should
not happen, as html5 input form checking should do it)
* Adding products to cart - this is only security check
* Checking products before making order - this is only security check
* Standard user will not add empty attributes if required because
html5 form checking will tell him
* This is really only for cases, someone will try to forge the form -
server side checking
*/
/*public static function checkIfRequired($id, $value) {
// Multiple value
if ((int)$id > 0 && is_array($value) &&
!empty($value)) {
return true;
}
// One value
if ((int)$id > 0 && (int)$value > 0) {
return true;// Attribute set and value set too - we don't
have anything to check, as attribute value was selected
}
if ((int)$id > 0 && (int)$value == 0) {
$db =JFactory::getDBO();
$query = ' SELECT a.required'
.' FROM #__phocacart_attributes AS a'
.' WHERE a.id = '.(int)$id
.' ORDER BY a.id'
.' LIMIT 1';
$db->setQuery($query);
$attrib = $db->loadObject();
if (isset($attrib->required) && $attrib->required
== 0) {
return true;
} else {
return false;// seems like attribute is required but not
selected
}
}
return false;
}*/
/* Check if the product includes some required attribute
* If yes, but users tries to add the product without attribute
(forgery)
* just check it on server side
* BE AWARE - this test runs only in case when attributes are empty
* We don't check if attribute was selected or not or if is
required or not
* We didn't get any attribute when ordering this product and we
only check
* if the product includes some attribute
*/
/*public static function checkIfExistsAndRequired($productId) {
$wheres = array();
$wheres[] = ' a.id = '.(int)$productId;
$db = JFactory::getDBO();
$query = ' SELECT a.id,'
.' at.required AS attribute_required'
.' FROM #__phocacart_products AS a'
.' LEFT JOIN #__phocacart_attributes AS at ON a.id =
at.product_id AND at.id > 0 AND at.required = 1'
. ' WHERE ' . implode( ' AND ', $wheres )
. ' ORDER BY a.id'
. ' LIMIT 1';
$db->setQuery($query);
$attrib = $db->loadObject();
if ((int)$attrib->attribute_required > 0) {
return false;
} else {
return true;
}
return false;
}*/
public static function getAllRequiredAttributesByProduct($productId) {
$wheres = array();
$wheres[] = ' a.id = ' . (int)$productId;
$db = JFactory::getDBO();
// 1) Select required attributes
$query = ' SELECT at.id, at.type, "1" AS
required_type, "" AS options'
. ' FROM #__phocacart_products AS a'
. ' LEFT JOIN #__phocacart_attributes AS at ON a.id =
at.product_id AND at.id > 0 AND at.required = 1'
. ' WHERE ' . implode(' AND ', $wheres)
. ' ORDER BY a.id';
$db->setQuery($query);
$attributes = $db->loadAssocList('id');
// Select required options of specific attributes of attributes
which are not required (so $attributes and $attributesOptions will no cover
each other)
$query = ' SELECT av.id as option_id, at.id, at.type,
"2" AS required_type, "" as options'
. ' FROM #__phocacart_products AS a'
. ' LEFT JOIN #__phocacart_attributes AS at ON a.id =
at.product_id AND at.id > 0 AND at.required = 0'
. ' LEFT JOIN #__phocacart_attribute_values AS av ON at.id
= av.attribute_id AND av.id > 0 AND av.required = 1'
. ' WHERE ' . implode(' AND ', $wheres)
. ' ORDER BY a.id';
$db->setQuery($query);
$attributesOptions = $db->loadAssocList();
// correct empty attributes and add attributes which have required
options but are not required themselves
if (!empty($attributes)) {
if (!empty($attributesOptions)) {
foreach($attributesOptions as $k => $v) {
if (isset($v['id']) &&
$v['id'] > 0) {
$idA = $v['id'];
$idO = $v['option_id'];
$attributes[$idA]['id'] =
$idA;
$attributes[$idA]['options'][$idO] =
$v['option_id'];
$attributes[$idA]['required_type'] =
$v['required_type'];
$attributes[$idA]['type'] =
$v['type'];
}
}
}
foreach ($attributes as $k => $v) {
if (!$v['id'] && !$v['type']) {
unset($attributes[$k]);
}
}
}
return $attributes;
}
/*
public static function getType($id) {
switch((int)$id) {
case 4:
$type = 2;//Multiple Value - handle array
break;
case 1:
case 2:
case 3:
default:
$type = 1;//Single Value - handle string
break;
}
return $type;
}*/
public static function checkRequiredAttributes($id, $attributes) {
// PHOCARTATTRIBUTE ATTRIBUTETYPE
// Covert all attribute values from strings to array
if (!empty($attributes)) {
foreach ($attributes as $k => $v) {
if (!is_array($v)) {
$attributes[$k] = array(0 => $v);
}
}
}
// $attributes - attributes sent per form when adding product to
cart
// $requiredAttributes - all required attributes for selected
product
// Get all required attributes for this product
// Or required options of not required attributes (specific case
for text, textarea, gift, etc. attributes where only one option can be
required, not whole attribute)
$requiredAttributes =
PhocacartAttribute::getAllRequiredAttributesByProduct($id);
$msgA = array();
$passAll = true;
$passAttribute = array();
if (!empty($requiredAttributes)) {
foreach ($requiredAttributes as $k2 => $v2) {
if (isset($v2['id']) &&
$v2['id'] > 0) {
if (!empty($attributes)) {
foreach ($attributes as $k3 => $v3) {
if (isset($k3) && (int)$k3 ==
(int)$v2['id']) {
$passAttribute[$k3] = 0;
if (!empty($v3)) {
foreach ($v3 as $k4 => $v4) {
if (isset($v2['type'])
&& ($v2['type'] == 7 || $v2['type'] == 8 ||
$v2['type'] == 9 || $v2['type'] == 10 ||
$v2['type'] == 11 || $v2['type'] == 12 ||
$v2['type'] == 20)) {
//
-------------------------------------
// ATTRIBUTE TYPE = TEXT,
TEXTAREA, GIFT
//
-------------------------------------
// 1) FIRST test required
options (not required attribute)
// required options in
attributes which are not required
// because there can be
required whole attribute but only one option
if
($v2['required_type'] == 2 &&
!empty($v2['options'])) {
// Is current option
required - is current option ID included in required option field?
if (in_array($k4,
$v2['options'])) {
if
(isset($v4['ovalue']) &&
urldecode($v4['ovalue'] != '')) {
// Order product -
we found value in order of products - OK
$passAttribute[$k3]
= 1;
//break 2;
} else if
(!is_array($v4) && urldecode($v4 != '')) {
// Order product -
we found value in order of products - OK
$passAttribute[$k3]
= 1;
//break 2;
} else {
$passAll = false;
break 2;
}
} else {
// It is not in required
field, set is as OK (can be overriden in loop by other option for this
attribute)
$passAttribute[$k3] = 1;
}
} else {
// 2) SECOND test required
attribute
// There is reverse testing
to select or checkbox
// In select or checkbox we
can wait for some of the option will be selected
// but by text all input
text fields in one attribute must be required
if
(isset($v4['ovalue']) &&
urldecode($v4['ovalue'] != '')) {
// Order product - we
found value in order of products - OK
$passAttribute[$k3] =
1;
//break 2;
} else if (!is_array($v4)
&& urldecode($v4 != '')) {
// Order product - we
found value in order of products - OK
$passAttribute[$k3] =
1;
//break 2;
} else {
$passAll = false;
break 2;
}
}
} else {
//
---------------------------------
// ATTRIBUTE TYPE = CHECKBOX,
SELECT
//
---------------------------------
if (isset($v4['oid'])
&& $v4['oid'] > 0) {
// Order product - we found
value in order of products - OK
$passAttribute[$k3] = 1;
break 2;
} else if (!is_array($v4)
&& (int)$v4 > 0) {
// Add to cart - we found
value when adding product to cart - OK
$passAttribute[$k3] = 1;
break 2;
}
}
// possible break 3;
}
}
}
}
} else {
$msgA[] = 'No FORM ATTRIBUTE found';
}
} else {
$msgA[] = 'No ID found of REQUIRED
ATTRIBUTE';
}
// Summarization of passed values
$aId = (int)$v2['id'];// ID of attribute
if (isset($passAttribute[$aId]) &&
$passAttribute[$aId] == 1) {
// this required attribute is OK
} else {
// we didn't found any information - any passed
information about this required attribute
$passAll = false;
}
}
}
if (!empty($msgA)) {
//$u = PhocacartUser::getUserInfo();
//PhocacartLog::add(3, implode(' ', $msgA), $id,
'IP: '. $u['ip'].', User ID:
'.$u['id'] . ', User Name:
'.$u['username']);
}
return $passAll;
}
public static function isMultipleAttribute($type) {
switch ($type) {
case 4:
case 5:
case 6:
return true;
break;
default:
return false;
break;
}
}
/* When product is displayed, it has selected the default values
* We need to filter all attributes assigned to product so the product
only includes selected attributes and otpions
* and we can make by this selection productKey
*/
public static function getAttributesSelectedOnly($attributes) {
$sAttributes = array();
if (!empty($attributes)) {
foreach ($attributes as $k => $v) {
if (!empty($v->options)) {
foreach ($v->options as $k2 => $v2) {
if (isset($v2->default_value) &&
$v2->default_value == 1) {
$sAttributes[$k][$v2->id] = $v2->id;
}
}
}
}
}
return $sAttributes;
}
public static function getAttributesSanitizeOptionArray($attributes) {
$aA = array();
if (!empty($attributes)) {
foreach ($attributes as $k => $v) {
if (!empty($v)) {
foreach ($v as $k2 => $v2) {
if(isset($v2['oid']) &&
(int)$v2['oid'] > 0) {
$aInt = (int)$k;
$oInt = (int)$k2;
$aA[$aInt][$oInt] = (int)$v2['oid'];
}
}
}
}
}
return $aA;
}
public static function sanitizeAttributeArray($attribute) {
// Sanitanize data and do the same level for all attributes:
// select attribute = 1
// checkbox attribute = array(0 => 1, 1 => 1) attribute[]
$aA = array();
if (!empty($attribute)) {
foreach ($attribute as $k => $v) {
if (is_array($v) && !empty($v)) {
foreach ($v as $k2 => $v2) {
if ((int)$v2 > 0) {
$aA[(int)$k][(int)$v2] = (int)$v2;
}
}
} else {
if ((int)$v > 0) {
$aA[(int)$k][(int)$v] = $v;
}
}
}
}
return $aA;
}
public static function makeCombination($array, $requiredArray) {
$method = 0;
$workingArray = array();
$arrayNew = array();
if (!empty($array)) {
foreach ($array as $k => $v) {
if (isset($v['multiple']) &&
$v['multiple']) {
// One of the attribute is multiple - we need to use
method 1 which can be hard on the memory
$method = 1;
break;
}
if (isset($v['required']) &&
$v['required'] == 0) {
// One of the attribute is not required - we need to
use method 1 which can be hard on the memory
$method = 1;
break;
}
// Working array can be used only by 2. Method (no
multiple, all required)
$aid = (int)$v['aid'];
$oid = (int)$v['oid'];
$workingArray[$aid][$oid] = $v;
}
}
if ($method == 1) {
/* ==== 1. Method ====
- This method takes so much memory and time (because it
counts all possible combinations of each attribute)
- a) can be used by select boxes
- b) can be used by checkboxes
- c) can be used by not required attibutes
*/
/*
* based on:
stackoverflow.com/questions/1256117/algorithm-that-will-take-numbers-or-words-and-find-all-possible-combinations
* by Adi Bradfield
*/
$bits = count($array); //bits of binary number equal to
number of words in query;
$dec = 1; //Convert decimal number to binary
with set number of bits, and split into array
while ($dec < pow(2, $bits)) {
$binary = str_split(str_pad(decbin($dec), $bits,
'0', STR_PAD_LEFT));
$current = array();
$current['title'] = '';
$current['valid'] = 1;
$cannotCobminate = array();
$i = 0;
while ($i < ($bits)) {
if ($binary[$i] == 1) {
$current['product_id'] =
$array[$i]['pid'];
$current['product_title'] =
$array[$i]['ptitle'];
// Attribute, Option ID
$aid = $array[$i]['aid'];
$oid = $array[$i]['oid'];
// Title
if (isset($current['title']) &&
$current['title'] != '') {
$current['title'] .= ' <span
class="ph-attribute-option-item">' .
$array[$i]['atitle'] . ': ' .
$array[$i]['otitle'] . '</span>';
} else {
$current['title'] = '<span
class="ph-attribute-option-item">' .
$array[$i]['atitle'] . ': ' .
$array[$i]['otitle'] . '</span>';
}
$current['attributes'][$aid][$oid] =
(int)$oid;
// Options inside one select cannot be combinated
togeter
if (!$array[$i]['multiple']) {
if (isset($cannotCobminate[$aid]) &&
$cannotCobminate[$aid] > 0) {
// there is one option selected from select
box,
// this attribute cannot be combinated in
this form
$current['valid'] = 0;
} else {
$cannotCobminate[$aid] = 1;
}
}
}
$i++;
}
// Define
$key =
PhocacartProduct::getProductKey($current['product_id'],
$current['attributes']);
$current['product_id'] =
$current['product_id'];
$current['product_key'] = $key;
$current['product_title'] =
$current['product_title'];
$current['stock'] = 0;
$current['price'] = '';
$current['ean'] = '';
$current['sku'] = '';
$current['image'] = '';
// DEBUG
/* echo "Iteration: $dec <table
cellpadding=\"5\" border=\"1\"><tr>";
foreach($binary as $b){
echo "<td>$b</td>";
}
echo "</tr><tr>";
foreach($array as $l){
echo
"<td>".$l['otitle']."</td>";
}
echo "</tr></table>Output: ";
foreach($current as $c){
// echo $c." ";
}
echo "<br><br>";*/
if (!empty($requiredArray)) {
foreach ($requiredArray as $k => $v) {
if (!array_key_exists($v,
$current['attributes'])) {
$current['valid'] = 0;
}
}
}
// Add only such attribute combinations which are possible
(two options from select box is not possible)
if ($current['valid'] == 1) {
$arrayNew[$key] = $current;
}
$dec++;
}
} else {
/* ==== 2. Method ====
- This methods is faster than method 1 but can be used for
select boxes only.
- a) can be used by select boxes
- b) CANNOT be used by checkboxes
- c) CANNOT be used by not required attibutes
*/
// https://gist.github.com/cecilemuller/4688876
$result = array(array());
if (!empty($workingArray)) {
foreach ($workingArray as $property => $property_values)
{
$tmp = array();
foreach ($result as $result_item) {
foreach ($property_values as $property_value) {
$tmp[] = array_merge($result_item,
array($property => $property_value));
}
}
$result = $tmp;
}
if (!empty($result)) {
foreach ($result as $k => $v) {
if (!empty($v)) {
$current = array();
$current['title'] = '';
$current['valid'] = 1;
foreach ($v as $k2 => $v2) {
$current['product_id'] =
$v2['pid'];
$current['product_title'] =
$v2['ptitle'];
// Attribute, Option ID
$aid = (int)$v2['aid'];
$oid = (int)$v2['oid'];
// Title
if (isset($current['title'])
&& $current['title'] != '') {
$current['title'] .= '
<span class="ph-attribute-option-item">' .
$v2['atitle'] . ': ' . $v2['otitle'] .
'</span>';
} else {
$current['title'] =
'<span class="ph-attribute-option-item">' .
$v2['atitle'] . ': ' . $v2['otitle'] .
'</span>';
}
$current['attributes'][$aid][$oid] = $oid;
}
// Define
$key =
PhocacartProduct::getProductKey($current['product_id'],
$current['attributes']);
$current['product_id'] =
$current['product_id'];
$current['product_key'] = $key;
$current['product_title'] =
$current['product_title'];
$current['stock'] = 0;
$current['price'] =
'';
$current['ean'] =
'';
$current['sku'] =
'';
$current['image'] =
'';
if (!empty($requiredArray)) {
foreach ($requiredArray as $k3 => $v3) {
if (!array_key_exists($v3,
$current['attributes'])) {
$current['valid'] = 0;
}
}
}
// Add only such attribute combinations which
are possible (two options from select box is not possible)
if ($current['valid'] == 1) {
$arrayNew[$key] = $current;
}
}
}
}
}
}
;
return $arrayNew;
}
public static function getCombinations($id, $title, $attributes,
&$combinations = array()) {
$array = array();
$requiredArray = array();
if (!empty($attributes)) {
ksort($attributes);
$i = 0;
foreach ($attributes as $k => $v) {
if (!empty($v->options)) {
ksort($v->options);
foreach ($v->options as $k2 => $v2) {
$array[$i]['pid'] = $id;
$array[$i]['ptitle'] = $title;
$array[$i]['aid'] = $v->id;
$array[$i]['atitle'] = $v->title;
$array[$i]['oid'] = $v2->id;
$array[$i]['otitle'] = $v2->title;
$array[$i]['multiple'] =
self::isMultipleAttribute($v->type);
$array[$i]['required'] = $v->required;
$i++;
}
}
if ($v->required == 1) {
$requiredArray[] = $v->id;
}
}
}
// All combinations of attributes
$pA = self::makeCombination($array, $requiredArray);
// Add to the array product itself (product without any variation)
// Only in case, there is no required attribute
$pI = array();
if (empty($requiredArray)) {
$pIPK = $id . '::';
$pI[$pIPK]['title'] = '(' .
JText::_('COM_PHOCACART_NO_ATTRIBUTES') . ')';
$pI[$pIPK]['cannotcombinate'] = 0;
$pI[$pIPK]['product_id'] = $id;
$pI[$pIPK]['product_title'] = $title;
$pI[$pIPK]['attributes'] = array();
$pI[$pIPK]['product_key'] = $pIPK;
$pI[$pIPK]['stock'] = 0;
$pI[$pIPK]['price'] = '';
$pI[$pIPK]['sku'] = '';
$pI[$pIPK]['ean'] = '';
$pI[$pIPK]['image'] = '';
}
$combinations = array_merge($pI, $pA);
return true;
}
public static function getCombinationsDataByProductId($id) {
if ($id > 0) {
$db = JFactory::getDBO();
$query = ' SELECT a.product_id, a.product_key, a.stock,
a.price, a.sku, a.ean, a.image'
. ' FROM #__phocacart_product_stock AS a'
. ' WHERE a.product_id = ' . (int)$id
. ' ORDER BY a.id';
$db->setQuery($query);
$combinations = $db->loadAssocList();
$combinationsNew = array();
if (!empty($combinations)) {
foreach ($combinations as $k => $v) {
$newK = $v['product_key'];
$combinationsNew[$newK] = $v;
}
}
return $combinationsNew;
}
return false;
}
public static function getCombinationsDataByKey($productKey) {
$db = JFactory::getDBO();
$query = 'SELECT product_id, product_key, stock, price, sku,
ean, image'
. ' FROM #__phocacart_product_stock'
. ' WHERE product_key = ' .
$db->quote($productKey)
. ' ORDER BY product_key'
. ' LIMIT 1';
$db->setQuery($query);
$data = $db->loadAssoc();
return $data;
}
public static function getCombinationsStockByKey($productKey) {
$db = JFactory::getDBO();
$query = 'SELECT stock'
. ' FROM #__phocacart_product_stock'
. ' WHERE product_key = ' .
$db->quote($productKey)
. ' ORDER BY product_key'
. ' LIMIT 1';
$db->setQuery($query);
$stock = $db->loadResult();
if (isset($stock) && $stock > 0) {
return $stock;
}
return 0;
}
public static function getCombinationsPriceByKey($productKey) {
$db = JFactory::getDBO();
$query = 'SELECT price'
. ' FROM #__phocacart_product_stock'
. ' WHERE product_key = ' .
$db->quote($productKey)
. ' ORDER BY product_key'
. ' LIMIT 1';
$db->setQuery($query);
$price = $db->loadResult();
if (isset($price) && $price > 0) {
return $price;
}
return 0;
}
public static function getCombinationsStockById($productId,
$returnArray = 0) {
$db = JFactory::getDBO();
$query = 'SELECT a.id, a.product_id, a.product_key, a.stock,
a.attributes'
. ' FROM #__phocacart_product_stock AS a'
. ' WHERE a.product_id = ' . (int)$productId
. ' ORDER BY a.id';
$db->setQuery($query);
if ($returnArray) {
$items = $db->loadAssocList();
} else {
$items = $db->loadObjectList();
}
return $items;
}
public static function storeCombinationsById($productId, $aosArray,
$new = 0) {
if ((int)$productId > 0) {
$db = JFactory::getDBO();
$notDeleteItems = array();
if (!empty($aosArray)) {
$values = array();
foreach ($aosArray as $k => $v) {
if (!is_array($v)) {
$v = array();
}
// correct simple xml
if (!isset($v['product_id'])) {
$v['product_id'] = '';
}
if (!isset($v['product_key'])) {
$v['product_key'] = '';
}
if (!isset($v['attributes'])) {
$v['attributes'] = '';
}
if (!isset($v['stock'])) {
$v['stock'] = '';
}
if (empty($v['product_id'])) {
$v['product_id'] = '';
}
if (empty($v['product_key'])) {
$v['product_key'] = '';
}
if (empty($v['attributes'])) {
$v['attributes'] = '';
}
if (empty($v['stock'])) {
$v['stock'] = '';
}
if (empty($v['price'])) {
$v['price'] = '';
}
if (empty($v['sku'])) {
$v['sku'] = '';
}
if (empty($v['ean'])) {
$v['ean'] = '';
}
if (empty($v['image'])) {
$v['image'] = '';
}
if ($v['product_key'] == '') {
continue;
}
$idExists = 0;
if ($new == 0) {
if (isset($v['id']) &&
$v['id'] > 0) {
// Does the row exist
$query = ' SELECT id '
. ' FROM
#__phocacart_product_stock'
. ' WHERE id = ' .
(int)$v['id']
. ' ORDER BY id';
$db->setQuery($query);
$idExists = $db->loadResult();
}
}
if ((int)$idExists > 0) {
$query = 'UPDATE #__phocacart_product_stock
SET'
. ' product_id = ' . (int)$productId
. ','
. ' product_key = ' .
$db->quote($v['product_key']) . ','
. ' stock = ' .
(int)$v['stock'] . ','
. ' price = ' .
$db->quote($v['price']) . ','
. ' sku = ' .
$db->quote($v['sku']) . ','
. ' ean = ' .
$db->quote($v['ean']) . ','
. ' image = ' .
$db->quote($v['image']) . ','
. ' WHERE id = ' . (int)$idExists;
$db->setQuery($query);
$db->execute();
$newIdD = $idExists;
} else {
$values = '(' . (int)$productId . ',
' . $db->quote($v['product_key']) . ', ' .
$db->quote($v['attributes']) . ', ' .
(int)$v['stock'] . ', ' . (int)$v['price'].
', ' . (int)$v['sku']. ', ' .
(int)$v['ean']. ',
'.$db->quote($v['image']).')';
$query = ' INSERT INTO
#__phocacart_product_stock (product_id, product_key, attributes, stock,
price, sku, ean, image)'
. ' VALUES ' . $values;
$db->setQuery($query);
$db->execute();
$newIdD = $db->insertid();
}
$notDeleteItems[] = $newIdD;
}
}
// Remove all discounts except the active
if (!empty($notDeleteItems)) {
$notDeleteItemsString = implode(',',
$notDeleteItems);
$query = ' DELETE '
. ' FROM #__phocacart_product_stock'
. ' WHERE product_id = ' . (int)$productId
. ' AND id NOT IN (' . $notDeleteItemsString
. ')';
} else {
$query = ' DELETE '
. ' FROM #__phocacart_product_stock'
. ' WHERE product_id = ' . (int)$productId;
}
$db->setQuery($query);
$db->execute();
}
}
public static function getAttributeType($id) {
$db = JFactory::getDBO();
$wheres = array();
$wheres[] = ' id = ' . (int)$id;
$query = ' SELECT type'
. ' FROM #__phocacart_attributes'
. ' WHERE ' . implode(' AND ', $wheres)
. ' ORDER BY id LIMIT 1';
$db->setQuery($query);
$type = $db->loadResult();
return $type;
}
public static function getOptionType($id) {
$db = JFactory::getDBO();
$wheres = array();
$wheres[] = ' id = ' . (int)$id;
$query = ' SELECT type'
. ' FROM #__phocacart_attribute_values'
. ' WHERE ' . implode(' AND ', $wheres)
. ' ORDER BY id LIMIT 1';
$db->setQuery($query);
$type = $db->loadResult();
return $type;
}
public static function getAttributeOptionDownloadFilesByOrder($orderId,
$productId, $orderProductId) {
$db = JFactory::getDBO();
$wheres = array();
$wheres[] = ' oa.order_id = ' . (int)$orderId;
$wheres[] = ' oa.product_id = ' . (int)$productId;
$wheres[] = ' oa.order_product_id = ' .
(int)$orderProductId;
// only order_option_id not order_attribute_id - as stored is info
about ordered option, not about ordered attribute
$q = ' SELECT av.download_folder, av.download_file,
av.download_token, a.id AS attribute_id, av.id AS option_id, oa.id AS
order_option_id, av.title AS option_title, a.title AS attribute_title'
. ' FROM #__phocacart_attribute_values AS av'
. ' LEFT JOIN #__phocacart_attributes AS a ON a.id =
av.attribute_id'
. ' LEFT JOIN #__phocacart_order_attributes AS oa ON
oa.option_id = av.id'
. ' WHERE ' . implode(' AND ', $wheres)
. ' ORDER BY av.id';
$db->setQuery($q);
$files = $db->loadAssocList();
return $files;
}
/*
* Done in PhocacartProduct::getProductKey();
*
public static function correctArrtibutesFormat(&$attributes) {
if (!empty($attributes)) {
foreach ($attributes as $k => $v) {
if (!is_array($v)) {
$attributes[$k] = array($v => $v);
}
}
}
}*/
/* public static function storeOptionsByAttributeId($attributeId,
$optArray) {
if ((int)$attributeId > 0) {
$db =JFactory::getDBO();
$query = ' DELETE '
.' FROM #__phocacart_attribute_values'
. ' WHERE attribute_id = '.
(int)$attributeId;
$db->setQuery($query);
if (!empty($optArray)) {
$values = array();
$valuesString = '';
foreach($optArray as $k => $v) {
if (isset($v['title']) &&
$v['title'] != '' &&
isset($v['amount']) && isset($v['operator'])) {
$values[] = '
('.(int)$attributeId.',
\''.$v['title'].'\',
\''.$v['operator'].'\',
\''.(float)$v['amount'].'\')';
}
}
if (!empty($values)) {
$valuesString = implode(',', $values);
$query = ' INSERT INTO
#__phocacart_attribute_values (attribute_id, title, operator, amount)'
.' VALUES
'.(string)$valuesString;
$db->setQuery($query);
}
}
}
}
public static function getAllAttributesSelectBox($name, $id,
$activeArray, $javascript = NULL, $order = 'id' ) {
$db = JFactory::getDBO();
$query = 'SELECT a.id AS value,
CONCAT(a.title_attribute,\' (\', a.title, \')\') AS
text'
.' FROM #__phocacart_attributes AS a'
. ' ORDER BY '. $order;
$db->setQuery($query);
$attributes = $db->loadObjectList();
$attributesO =
Joomla\CMS\HTML\HTMLHelper::_('select.genericlist', $attributes,
$name, 'class="inputbox" size="4"
multiple="multiple"'. $javascript, 'value',
'text', $activeArray, $id);
return $attributesO;
}
*/
public static function getActiveAttributeValues($items, $ordering) {
$db = JFactory::getDbo();
$o = array();
$wheres = array();
$ordering = PhocacartOrdering::getOrderingText($ordering, 5);//at v
if (!empty($items)) {
foreach ($items as $k => $v) {
$wheres[] = '( v.alias = ' . $db->quote($k) .
' AND at.alias IN (' . $v . ') )';
}
if (!empty($wheres)) {
// FULL GROUP BY GROUP_CONCAT(DISTINCT o.title) AS title
$q = 'SELECT DISTINCT at.title, at.alias,
CONCAT(\'a[\', v.alias, \']\') AS parameteralias,
v.title AS parametertitle FROM #__phocacart_attribute_values AS at'
. ' LEFT JOIN #__phocacart_attributes AS v ON v.id
= at.attribute_id'
. (!empty($wheres) ? ' WHERE ' .
implode(' OR ', $wheres) : '')
. ' GROUP BY v.alias, at.alias, at.title'
. ' ORDER BY ' . $ordering;
$db->setQuery($q);
$o = $db->loadAssocList();
}
}
return $o;
}
}
?>
PK�"�[�#o,,(libraries/phocacart/attribute/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[D4���/libraries/phocacart/calculation/calculation.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartCalculation
{
public static function calculateDiscountPercentage($discount, $quantity,
&$priceItems, &$total, $taxKey = '') {
$price = new PhocacartPrice();
// $taxCalcType 1 ... percentage, 2 ... fixed amount (be aware it is not
the tax calculation set in options: brutto, netto, none)
$taxCalcType = $priceItems['taxcalctype'];
$dB = $price->roundPrice($priceItems['brutto'] *
$discount / 100);
$dN = $price->roundPrice($priceItems['netto'] *
$discount / 100);
$dT = $price->roundPrice($priceItems['tax'] * $discount
/ 100);
$priceItems['bruttodiscount'] = $taxCalcType == 2 ? $dN : $dB;
$priceItems['nettodiscount'] = $dN;
$priceItems['taxdiscount'] = $taxCalcType == 2 ? 0 : $dT;
$priceItems['brutto'] -=
$priceItems['bruttodiscount'];
$priceItems['netto'] -=
$priceItems['nettodiscount'];
$priceItems['tax'] -= $priceItems['taxdiscount'];
if (!empty($total)) {
$total['brutto'] -= $taxCalcType == 2 ? $dN * $quantity :
$dB * $quantity;
$total['netto'] -= $dN * $quantity;
$total['tax'][$taxKey]['tax'] -= $taxCalcType == 2 ?
0 : $dT * $quantity;
$total['tax'][$taxKey]['netto'] -= $taxCalcType == 2
? 0 : $dN * $quantity;
$total['tax'][$taxKey]['brutto'] -= $taxCalcType ==
2 ? 0 : $dB * $quantity;
}
return true;
}
public static function calculateDiscountFixedAmount($ratio, $quantity,
&$priceItems, &$total, $taxKey = '') {
$price = new PhocacartPrice();
// $taxCalcType type 1 ... percentage, 2 ... fixed amount (be aware it is
not the tax calculation set in options: brutto, netto, none)
$taxCalcType = $priceItems['taxcalctype'];
// Reset info about discount for each step (reward points, product
discount, cart discount, coupon)
$priceItems['bruttodiscount'] = 0;
$priceItems['nettodiscount'] = 0;
$priceItems['taxdiscount'] = 0;
$dB = $price->roundPrice($priceItems['brutto'] *
$ratio/100);
$dN = $price->roundPrice($priceItems['netto'] * $ratio/100);
$dT = $price->roundPrice($priceItems['tax'] * $ratio/100);
// Price before discount
$pbD = array();
$pbD['brutto'] = $priceItems['brutto'];
$pbD['netto'] = $priceItems['netto'];
$pbD['tax'] = $priceItems['tax'];
// Brutto If fixed VAT ($taxCalcType == 2) then we cannot reduce the
VAT, so we cannot reduce BRUTTO
if ($priceItems['brutto'] < $dB) {
$priceItems['bruttodiscount'] =
$priceItems['brutto'];
$priceItems['brutto'] = 0;
} else {
$priceItems['bruttodiscount'] = $taxCalcType == 2 ? $dN :
$dB;
$priceItems['brutto'] -=
$priceItems['bruttodiscount'];
}
// Netto
if ($priceItems['netto'] < $dN) {
$priceItems['nettodiscount'] =
$priceItems['netto'];
$priceItems['netto'] = 0;
} else {
$priceItems['nettodiscount'] = $dN;
$priceItems['netto'] -=
$priceItems['nettodiscount'];
}
// Tax
if ($priceItems['tax'] < $dT) {
$priceItems['taxdiscount'] = $priceItems['tax'];
$priceItems['tax'] = 0;
} else {
$priceItems['taxdiscount'] = $taxCalcType == 2 ? 0 : $dT;
$priceItems['tax'] -=
$priceItems['taxdiscount'];
}
if (!empty($total)) {
// Possible TO DO - add different condition for netto and brutto
/*
* if ($taxCalcType == 2) {
if ($pbD['netto'] < $dB) {
} else {
if ($pbD['brutto'] < $dB) {
}
*/
// Brutto
if ($pbD['brutto'] < $dB) {
$total['brutto'] -= $taxCalcType == 2 ?
$pbD['netto'] * $quantity : $pbD['brutto'] * $quantity;
$total['tax'][$taxKey]['brutto'] -= $taxCalcType ==
2 ? $pbD['netto'] * $quantity : $pbD['brutto'] *
$quantity;
} else {
$total['brutto'] -= $taxCalcType == 2 ? $dN * $quantity :
$dB * $quantity;
$total['tax'][$taxKey]['brutto'] -= $taxCalcType ==
2 ? $dN * $quantity : $dB * $quantity;
}
// Netto
if ($pbD['netto'] < $dN) {
$total['netto'] -= $pbD['netto'] * $quantity;
$total['tax'][$taxKey]['netto'] -=
$pbD['netto'] * $quantity;
} else {
$total['netto'] -= $dN * $quantity;
$total['tax'][$taxKey]['netto'] -= $dN * $quantity;
}
// Tax
if ($pbD['tax'] < $dT) {
$total['tax'][$taxKey]['tax'] -= $taxCalcType == 2
? 0 : $pbD['tax'] * $quantity;
} else {
$total['tax'][$taxKey]['tax'] -= $taxCalcType == 2
? 0 : $dT * $quantity;
}
}
return true;
}
public static function correctItemsIfNull(&$priceItems) {
if ($priceItems['netto'] < 0 ||
$priceItems['netto'] == 0) {
$priceItems['brutto'] = 0;
$priceItems['tax'] = 0;
}
if ($priceItems['nettodiscount'] < 0 ||
$priceItems['nettodiscount'] == 0) {
$priceItems['bruttodiscrount'] = 0;
$priceItems['taxdiscount'] = 0;
}
return true;
}
public static function correctTotalIfNull(&$total, $taxKey) {
if ($total['netto'] < 0 || $total['netto'] == 0) {
$total['brutto'] = 0;
$total['tax'][$taxKey]['tax'] = 0;
$total['tax'][$taxKey]['netto'] = 0;
$total['tax'][$taxKey]['brutto'] = 0;
}
return true;
}
public static function formatItems(&$priceItems) {
$price = new PhocacartPrice();
$priceItems['bruttoformat'] =
$price->getPriceFormat($priceItems['brutto']);
$priceItems['nettoformat'] =
$price->getPriceFormat($priceItems['netto']);
$priceItems['taxformat'] =
$price->getPriceFormat($priceItems['tax']);
return true;
}
}
?>
PK�"�[�#o,,*libraries/phocacart/calculation/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[=�M�77'libraries/phocacart/captcha/captcha.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('JPATH_BASE') or die;
class PhocacartCaptcha
{
public static function enableCaptchaCheckout() {
$document = JFactory::getDocument();
$pC = PhocacartUtils::getComponentParameters();
$enable_captcha_checkout = $pC->get(
'enable_captcha_checkout', 0 );
$guest = PhocacartUserGuestuser::getGuestUser();
if ($enable_captcha_checkout == 1) {
return true;// All
} else if ($enable_captcha_checkout == 2 && $guest) {
return true;// Guest user
} else if ($enable_captcha_checkout == 2 && !$guest) {
return false;// Guest user but in checkout there is standard user
} else {
return false;// Disabled
}
return false;
}
}
?>
PK�"�[�#o,,&libraries/phocacart/captcha/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[s�Q�
�
)libraries/phocacart/captcha/recaptcha.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('JPATH_BASE') or die;
class PhocacartCaptchaRecaptcha
{
public static function render() {
$document = JFactory::getDocument();
$pC = PhocacartUtils::getComponentParameters();
$siteKey = strip_tags(trim($pC->get( 'recaptcha_sitekey',
'' )));
$lang = strip_tags(trim($pC->get( 'recaptcha_lang',
'' )));
if ($lang != '') {
$lang = '?hl='.$lang;
}
$document->addScript('https://www.google.com/recaptcha/api.js'.$lang);
return '<div class="g-recaptcha"
data-sitekey="'.$siteKey.'"></div>';
}
public static function isValid() {
$app = JFactory::getApplication();
$pC = PhocacartUtils::getComponentParameters();
$secretKey = strip_tags(trim($pC->get(
'recaptcha_privatekey', '' )));
//$response =
$app->input->post->get('g-recaptcha-response',
'', 'string');
//$response = $ POST['g-recaptcha-response'];
$response =
$app->input->post->get('g-recaptcha-response',
'', 'string');
$remoteIp = $_SERVER['REMOTE_ADDR'];
$urlVerify = 'https://www.google.com/recaptcha/api/siteverify';
$recaptchaMethod = $pC->get( 'recaptcha_request_method', 2
);//1 file_get_contents, 2 curl
try {
if ($recaptchaMethod == 1) {
// FILE GET CONTENTS
$data = ['secret' => $secretKey,
'response' => $response,
'remoteip' => $remoteIp];
$options = [
'http' => [
'header' => "Content-type:
application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data)
]
];
$context = stream_context_create($options);
$result = file_get_contents($urlVerify, false, $context);
} else {
// CURL
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $urlVerify,
CURLOPT_POST => true,
// CURLOPT_SSL_VERIFYPEER => false,
// CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_POSTFIELDS => [
'secret' => $secretKey,
'response' => $response,
'remoteip' => $remoteIp],
CURLOPT_RETURNTRANSFER => true
]);
$result = curl_exec($ch);
curl_close($ch);
}
//$resultString = print r($result, true);
//PhocacartLog::add(3, 'Ask a Question - Captcha Result', 0,
$resultString);
if (!$result) {
return false;
}
return json_decode($result)->success;
}
catch (Exception $e) {
return null;
}
}
}
PK�"�[1���gYgY(libraries/phocacart/cart/calculation.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartCartCalculation
{
public $correctsubtotal = 1;// because of rounding 0.25 -> 0.3 or
0.2 it can come to difference e.g. 0.01
public $posbruttocalculation = 1;
protected $type = array(0, 1);
public function __construct() {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
// Affect only calculation in POS cart
// Not receipts, invoices
// Display or hide brutto prices in POS cart
$this->posbruttocalculation = PhocacartPos::isPos() ?
$paramsC->get('pos_brutto_calculation', 1) : 0;
}
public function setType($type = array(0, 1)) {
$this->type = $type;
}
// ==============
// BASIC PRODUCT
// ==============
public function calculateBasicProducts(&$fullItems,
&$fullItemsGroup, &$total, &$stock, &$minqty,
&$minmultipleqty, $items) {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$tax_calculation = $paramsC->get('tax_calculation',
0);
// Moved to product parameters
//$min_ quantity_calculation = $paramsC->get( 'min_
quantity_calculation', 0 );
//$stock_ calculation = $paramsC->get( 'stock_
calculation', 0 );
$price = new PhocacartPrice();
$total['netto'] = 0;
$total['brutto'] = 0;
$total['brutto_currency'] = 0;
$total['tax'] = array();
$total['weight'] = 0;
$total['volume'] = 0;
$total['dnetto'] = 0;
$total['quantity'] = 0;
$total['length'] = 0;
$total['width'] = 0;
$total['height'] = 0;
$total['points_needed'] = 0;
$total['points_received'] = 0;
// Free shipping or payment
$total['free_shipping'] = 0;
$total['free_payment'] = 0;
// Discount fixed amount
$total['discountcartfixedamount'] = array();
$total['couponcartfixedamount'] = array();
$total['discountcarttxtsuffix'] = '';
$total['couponcarttxtsuffix'] = '';
$total['rewardproductusedtotal'] = '';
$total['rewardproducttxtsuffix'] = '';
$total['countallproducts'] = 0;
$total['countphysicalproducts'] = 0;
$total['countdigitalproducts'] = 0;
$total['countpriceondemandproducts'] = 0;
// OPTIONS (VARIANTS) QUANTITY
// The same option can be in different items
$optionsQuantity = array();
// Rounding
$total['rounding'] = 0;
$total['rounding_currency'] = 0;
$total['wdnetto'] = 0;//Subtotal after all
discounts
$total['rounding_currency'] = 0;
foreach ($items as $k => $v) {
$item = explode(':', $k);
$itemId = $item[0];
// Define
$fullItems[$k]['id'] = (int)$itemId;
$fullItems[$k]['idkey'] = (string)$k;
$fullItems[$k]['netto'] = 0;
$fullItems[$k]['brutto'] = 0;
$fullItems[$k]['tax'] = 0;
$fullItems[$k]['final'] = 0;// netto or brutto *
quantity
$fullItems[$k]['nettodiscount'] = 0;
$fullItems[$k]['bruttodiscount'] = 0;
$fullItems[$k]['taxdiscount'] = 0;
$fullItems[$k]['finaldiscount'] = 0;
$fullItems[$k]['taxid'] = 0;
$fullItems[$k]['taxkey'] = '';// Tax Id:
Country Tax Id: Region Tax Id
$fullItems[$k]['taxtitle'] = '';
$fullItems[$k]['weight'] = '';
$fullItems[$k]['volume'] = '';
$fullItems[$k]['quantity'] = $fQ =
(int)$v['quantity'];// Quantity of product - one product
$fullItems[$k]['catid'] = 0;
$fullItems[$k]['alias'] = '';
$fullItems[$k]['sku'] = '';
$fullItems[$k]['image'] = '';
$fullItems[$k]['title'] = '';
$fullItems[$k]['stock'] = 0; //
database value set in product settings
$fullItems[$k]['stockvalid'] = 1; //
variable to inform if stock validity is ok
$fullItems[$k]['stockcalculation'] = 0;
$fullItems[$k]['minqty'] = 0; //
database value set in product settings
$fullItems[$k]['minmultipleqty'] = 0;
$fullItems[$k]['minqtyvalid'] = 1; //
variable to inform if minimum order is ok
$fullItems[$k]['minmultipleqtyvalid'] = 1;
// DISCOUNTS (Product, Cart, Voucher) / Fixed amount /
Percentage
$fullItems[$k]['discountproduct'] = 0;
$fullItems[$k]['discountproducttitle'] =
'';
$fullItems[$k]['discountcart'] = 0;
$fullItems[$k]['discountcarttitle'] =
'';
$fullItems[$k]['discountcartfixedid'] = 0;
$fullItems[$k]['discountcartid'] = 0;
$fullItems[$k]['couponcart'] = 0;
$fullItems[$k]['couponcarttitle'] = '';
$fullItems[$k]['couponcartfixedid'] = 0;
$fullItems[$k]['couponcartid'] = 0;
$fullItems[$k]['rewardproduct'] = 0;
$fullItems[$k]['rewardproducttitle'] =
JText::_('COM_PHOCACART_REWARD_POINTS');
$fullItems[$k]['rewardproductpoints'] = 0;
$fullItems[$k]['rewardproducttxtsuffix'] =
'';
$fullItems[$k]['points_needed'] = 0;
$fullItems[$k]['points_received'] = 0;
$fullItems[$k]['type'] = 0;
// GROUP QUANTITY
// Get quantity of a group. Group is sum of all product
variations
// - explained in PhocacartDiscountProduct::getProductDiscount
$fullItemsGroup[$itemId]['id'] = (int)$itemId;
$fullItemsGroup[$itemId]['title'] = '';
if (isset($fullItemsGroup[$itemId]['quantity'])) {
$fullItemsGroup[$itemId]['quantity'] +=
(int)$v['quantity'];
} else {
$fullItemsGroup[$itemId]['quantity'] =
(int)$v['quantity'];
}
$total['quantity'] += (int)$v['quantity'];
// ATTRIBUTES
$attribs = array();
if (!empty($item[1])) {
$attribs = unserialize(base64_decode($item[1]));
}
// ITEM D - product info from database
$itemD = PhocacartProduct::getProduct((int)$itemId,
(int)$v['catid'], $this->type);
// Correct the tax rate - no tax calculation, no tax rate for
each product
if (!empty($itemD) && $tax_calculation == 0) {
$itemD->taxrate = 0;
}
if (isset($itemD->id) && (int)$itemD->id > 0)
{
$fullItems[$k]['title'] = $itemD->title;
$fullItems[$k]['catid'] = $itemD->catid;
$fullItems[$k]['alias'] = $itemD->alias;
$fullItems[$k]['sku'] = $itemD->sku;
$fullItems[$k]['image'] = $itemD->image;
$fullItems[$k]['type'] = $itemD->type;
$fullItems[$k]['default_price'] =
$itemD->price;
$fullItems[$k]['price'] =
$price->getPriceItem($itemD->price, $itemD->group_price, 0);
$fullItems[$k]['taxid'] =
$itemD->taxid;
$fullItems[$k]['taxrate'] =
$itemD->taxrate;
$fullItems[$k]['taxtitle'] =
JText::_($itemD->taxtitle);
$fullItems[$k]['taxcountryid'] =
$itemD->taxcountryid;
$fullItems[$k]['taxregionid'] =
$itemD->taxregionid;
$taxKey =
PhocacartTax::getTaxKey($itemD->taxid, $itemD->taxcountryid,
$itemD->taxregionid);
$fullItems[$k]['taxkey'] = $taxKey;
$fullItems[$k]['taxcalctype'] =
$itemD->taxcalculationtype;
$fullItems[$k]['weight'] =
$itemD->weight;
$fullItems[$k]['volume'] =
$itemD->volume;
$fullItems[$k]['stock'] =
$itemD->stock;
$fullItems[$k]['stockadvanced'] = 0;
$fullItems[$k]['stockcalculation'] =
$itemD->stock_calculation;
$fullItems[$k]['minqty'] =
$itemD->min_quantity;
$fullItems[$k]['minmultipleqty'] =
$itemD->min_multiple_quantity;
$fullItems[$k]['minqtycalculation'] =
$itemD->min_quantity_calculation;
$fullItems[$k]['default_points_received'] =
$itemD->points_received;
$pointsN =
PhocacartReward::getPoints($itemD->points_needed, 'needed');
$pointsR =
PhocacartReward::getPoints($itemD->points_received,
'received', $itemD->group_points_received);
$fullItems[$k]['points_needed'] =
$pointsN;
$fullItems[$k]['points_received'] =
$pointsR;
// Group
$fullItemsGroup[$itemId]['minqty'] =
$itemD->min_quantity;
$fullItemsGroup[$itemId]['minmultipleqty'] =
$itemD->min_multiple_quantity;
$fullItemsGroup[$itemId]['title'] =
$itemD->title;
$fullItemsGroup[$itemId]['minqtyvalid'] =
1;
$fullItemsGroup[$itemId]['minmultipleqtyvalid'] =
1;
$priceI = $price->getPriceItems($itemD->price,
$itemD->taxid, $itemD->taxrate, $itemD->taxcalculationtype,
$itemD->taxtitle, 0, '', 0, 1, $itemD->group_price);
// Get price from advanced stock managment TO DO group
price
if ($fullItems[$k]['stockcalculation'] == 3) {
$aA =
PhocacartAttribute::sanitizeAttributeArray($attribs);
$price->getPriceItemsChangedByAttributes($priceI,
$aA, $price, $itemD, 1);
}
$fullItems[$k]['netto'] =
$priceI['netto'];
$fullItems[$k]['brutto'] =
$priceI['brutto'];
$fullItems[$k]['tax'] =
$priceI['tax'];
// Advanced Stock Calculation
if ($fullItems[$k]['stockcalculation'] == 2 ||
$fullItems[$k]['stockcalculation'] == 3) {
$fullItems[$k]['stockadvanced'] =
PhocacartAttribute::getCombinationsStockByKey($k);
}
// Total
$total['netto'] +=
($fullItems[$k]['netto'] * $fQ);
$total['brutto'] +=
($fullItems[$k]['brutto'] * $fQ);
$total['weight'] +=
($fullItems[$k]['weight'] * $fQ);
$total['volume'] +=
($fullItems[$k]['volume'] * $fQ);
$total['length'] = $itemD->length >
$total['length'] ? $itemD->length :
$total['length'];
$total['width'] = $itemD->width >
$total['width'] ? $itemD->width : $total['width'];
$total['height'] = $itemD->height >
$total['height'] ? $itemD->height :
$total['height'];
$total['points_needed'] +=
($fullItems[$k]['points_needed'] * $fQ);
$total['points_received'] +=
($fullItems[$k]['points_received'] * $fQ);
// TAX
if
(!isset($total['tax'][$taxKey]['tax'])) {
$total['tax'][$taxKey]['tax'] =
0;// Define
}
if
(!isset($total['tax'][$taxKey]['netto'])) {
$total['tax'][$taxKey]['netto'] =
0;// Define (set netto for each tax)
}
if
(!isset($total['tax'][$taxKey]['brutto'])) {
$total['tax'][$taxKey]['brutto'] =
0;// Define
}
$total['tax'][$taxKey]['tax'] +=
($fullItems[$k]['tax'] * $fQ);
$total['tax'][$taxKey]['netto'] +=
($fullItems[$k]['netto'] * $fQ);
$total['tax'][$taxKey]['brutto'] +=
($fullItems[$k]['brutto'] * $fQ);
$taxSuffix = '';
if ($itemD->taxcalculationtype == 1) {
$taxSuffix = ' (' .
($price->getTaxFormat($itemD->taxrate, $itemD->taxcalculationtype,
0)) . ')';
}
$total['tax'][$taxKey]['title']
= JText::_($itemD->taxtitle) . $taxSuffix;
$total['tax'][$taxKey]['title_lang']
= $itemD->taxtitle;
$total['tax'][$taxKey]['title_lang_suffix2'] =
'(' . $taxSuffix . ')';
$total['tax'][$taxKey]['type']
= $itemD->taxcalculationtype;
$total['tax'][$taxKey]['rate']
= $itemD->taxrate;
// PRODUCTTYPE Digital product
$total['countallproducts']++;
if ($itemD->type == 0) {
$total['countphysicalproducts']++;
} else if ($itemD->type == 1) {
$total['countdigitalproducts']++;
} else if ($itemD->type == 2) {
// physical and digital
// This rule can be changed but for now e.g. we test if
the product is digital to ensure that the shipping will be skipped
// if the product is both - digital and physical, we
cannot skip shipping so we do not count it as digital
// Uncomment if you need to opposite rule
//$total['countphysicalproducts']++;
//$total['countdigitalproducts']++;
} else if ($itemD->type == 3) {
$total['countpriceondemandproducts']++;
} else if ($itemD->type == 4) {
// Gift Vouchers are even digital products
$total['countdigitalproducts']++;
}
// ==========
// ATTRIBUTES
// ==========
//
// Stock handling - one variant can be set in e.g. two
products, so we need to count attributes stock:
if (!empty($attribs)) {
foreach ($attribs as $k2 => $v2) {
// Make array from all attributes even they are not
multiple - to go through the foreach
if (!is_array($v2)) {
$v2 = array(0 => $v2);
}
if (!empty($v2)) {
// Be aware the k3 is not the key of attribute
// this is the k2
foreach ($v2 as $k3 => $v3) {
if ((int)$k2 > 0 && (int)$k3
> 0) {
$attrib =
PhocacartAttribute::getAttributeValue((int)$k3, (int)$k2);
// Price is set as fixed with help of
advanced stock management
if
($fullItems[$k]['stockcalculation'] != 3) {
/* if (!$attrib->aid) {
$app->enqueueMessage(JText::_('COM_PHOCACART_ERROR_PRODUCT_ATTRIBUTE_NOT_EXISTS_PLEASE_RECHECK_PRODUCTS_IN_YOUR_CART'),
'error');
break;
}*/
if (isset($attrib->title)
&& isset($attrib->amount) &&
isset($attrib->operator)) {
// If there is fixed VAT -
don't change it in attributes - it is just fix - set taxtrate to 0
if
($itemD->taxcalculationtype == 2) {
$priceA =
$price->getPriceItems($attrib->amount, $itemD->taxid, 0,
$itemD->taxcalculationtype, $itemD->taxtitle);
} else {
$priceA =
$price->getPriceItems($attrib->amount, $itemD->taxid,
$itemD->taxrate, $itemD->taxcalculationtype, $itemD->taxtitle);
}
//$fQ =
(int)$fullItems[$k]['quantity'];
// Price
if ($attrib->operator ==
'-') {
$nettoBefore =
$fullItems[$k]['netto'];
$fullItems[$k]['netto'] -= $priceA['netto'];
if
($fullItems[$k]['netto'] < 0) {
$total['netto'] -= ($nettoBefore * $fQ);
$fullItems[$k]['netto'] = 0;
} else {
$total['netto'] -= ($priceA['netto'] * $fQ);
}
$bruttoBefore =
$fullItems[$k]['brutto'];
$fullItems[$k]['brutto'] -= $priceA['brutto'];
if
($fullItems[$k]['brutto'] < 0 ) {
$total['brutto'] -= ($bruttoBefore * $fQ);
$fullItems[$k]['brutto'] = 0;
} else {
$total['brutto'] -= ($priceA['brutto'] * $fQ);
}
$taxBefore =
$fullItems[$k]['tax'];
$fullItems[$k]['tax'] -= $priceA['tax'];
if
($fullItems[$k]['tax'] < 0 ) {
$total['tax'][$taxKey]['tax'] -= ($taxBefore * $fQ);
$total['tax'][$taxKey]['netto'] -= ($nettoBefore *
$fQ);
$total['tax'][$taxKey]['brutto'] -= ($bruttoBefore *
$fQ);
$fullItems[$k]['tax'] = 0;
} else {
$total['tax'][$taxKey]['tax'] -=
($priceA['tax'] * $fQ);
$total['tax'][$taxKey]['netto'] -=
($priceA['netto'] * $fQ);
$total['tax'][$taxKey]['brutto'] -=
($priceA['brutto'] * $fQ);
}
} else if ($attrib->operator
== '+') {
$fullItems[$k]['brutto'] +=
$priceA['brutto'];// * multiply in render checkout
$fullItems[$k]['netto'] += $priceA['netto'];
// * multiply in render checkout
$fullItems[$k]['tax'] += $priceA['tax'];
// * multiply in render checkout
$total['netto']
+= ($priceA['netto'] * $fQ);
$total['brutto']
+= ($priceA['brutto'] * $fQ);
$total['tax'][$taxKey]['tax'] +=
($priceA['tax'] * $fQ);
$total['tax'][$taxKey]['netto'] +=
($priceA['netto'] * $fQ);
$total['tax'][$taxKey]['brutto'] +=
($priceA['brutto'] * $fQ);
}
}
}
// Weight
if ($attrib->operator_weight ==
'-') {
$fullItems[$k]['weight']
-= $attrib->weight;
$fullItems[$k]['weight']
< 0 ? $fullItems[$k]['weight'] = 0 :
$total['weight'] -= ($attrib->weight *
$fullItems[$k]['quantity']);
} else if ($attrib->operator_weight
== '+') {
$fullItems[$k]['weight']
+= $attrib->weight;
$total['weight']
+= ($attrib->weight * $fullItems[$k]['quantity']);
}
// Volume - not used now
/* if ($attrib->operator_volume ==
'-') {
$fullItems[$k]['volume'] -= $attrib->volume;
$fullItems[$k]['volume'] < 0 ?
$fullItems[$k]['volume'] = 0 : $total['volume'] -=
($attrib->volume * $fullItems[$k]['quantity']);
} else if
($attrib->operator_volume == '+') {
$fullItems[$k]['volume'] += $attrib->volume;
$total['volume'] +=
($attrib->volume * $fullItems[$k]['quantity']);
} */
if
(isset($optionsQuantity[$attrib->id])) {
$optionsQuantity[$attrib->id] +=
(int)$fQ;
} else {
$optionsQuantity[$attrib->id] =
(int)$fQ;
}
// STOCK-1 ... we count each product
variation separately
if
($fullItems[$k]['stockcalculation'] == 1 &&
(int)$optionsQuantity[$attrib->id] > (int)$attrib->stock) {
$total['stockvalid']
= 0;
$fullItems[$k]['stockvalid'] = 0;
$stock['valid']
= 0;
}
// Attribute values
$fullItems[$k]['attributes'][$attrib->aid][$k3]['aid']
= $attrib->aid; // Attribute Id
$fullItems[$k]['attributes'][$attrib->aid][$k3]['atitle']
= $attrib->atitle;
$fullItems[$k]['attributes'][$attrib->aid][$k3]['atype']
= $attrib->atype;
$fullItems[$k]['attributes'][$attrib->aid][$k3]['oid']
= $attrib->id;// Option Id
$fullItems[$k]['attributes'][$attrib->aid][$k3]['otitle']
= $attrib->title;
$fullItems[$k]['attributes'][$attrib->aid][$k3]['oimage']
= $attrib->image;
$fullItems[$k]['attributes'][$attrib->aid][$k3]['ovalue']
= PhocacartAttribute::setAttributeValue($attrib->atype, $v3, false,
true, $attrib->type);
$fullItems[$k]['attributes'][$attrib->aid][$k3]['otype']
= $attrib->type;
//$fullItems[$k]['attributes'][$attrib->aid][$k3]['odownloadfile']=
$attrib->download_file;
}
}
}
}
}
// ==============================
// MINIUM ORDER AMOUNT
// ==============================
// THERE CAN BE THREE METHODS HOW TO COUNT MINIMUM ORDER
AMOUNT
// a) every product is unique (Product A - Option A,
Product A - Option B are two different products)
// b) there are product groups (Product A- Option A,
Product A - Option B is still one product - product A)
// c) advanced stock management - in this case it is the
same like a)
if ($fullItems[$k]['minqtycalculation'] == 1 ||
$fullItems[$k]['minqtycalculation'] == 2) {
// a)
// MINIMUM QUANTITY - FOR ITEM - PRODUCT VARIATION -
each product variation
if ((int)$fullItems[$k]['quantity'] <
(int)$fullItems[$k]['minqty']) {
$minqty['valid'] = 0;
$fullItems[$k]['minqtyvalid'] = 0;
}
if ((int)$fullItems[$k]['minmultipleqty'] ==
0) {
// Do not modulo by zero
// Set it back because we are in foreach
$minmultipleqty['valid'] =
1;
$fullItems[$k]['minmultipleqtyvalid'] =
1;
} else if (((int)$fullItems[$k]['quantity'])
% (int)$fullItems[$k]['minmultipleqty'] != 0) {
$minmultipleqty['valid'] =
0;
$fullItems[$k]['minmultipleqtyvalid'] =
0;
}
} else {
// b)
// MINIMUM QUANTITY - FOR GROUP (Group is the same
product but with different options values) - MAIN PRODUCT
if
(empty($fullItemsGroup[$itemId]['minqty'])) {
$minqty['valid'] =
1;
$fullItemsGroup[$itemId]['minqtyvalid'] =
1;
} else if
((int)$fullItemsGroup[$itemId]['quantity'] <
(int)$fullItemsGroup[$itemId]['minqty']) {
$minqty['valid'] =
0;
$fullItemsGroup[$itemId]['minqtyvalid'] =
0;
} else {
// Set it back because we are in foreach
$minqty['valid'] =
1;
$fullItemsGroup[$itemId]['minqtyvalid'] =
1;
}
// MINIMUM MULTIPLE QUANTITY
if
(empty($fullItemsGroup[$itemId]['minmultipleqty'])) {
$minmultipleqty['valid']
= 1;
$fullItemsGroup[$itemId]['minmultipleqtyvalid'] = 1;
} else if
($fullItemsGroup[$itemId]['minmultipleqty'] == 0) {
// Do not modulo by zero
// Set it back because we are in foreach
$minmultipleqty['valid']
= 1;
$fullItemsGroup[$itemId]['minmultipleqtyvalid'] = 1;
} else if
(((int)$fullItemsGroup[$itemId]['quantity']) %
(int)$fullItemsGroup[$itemId]['minmultipleqty'] != 0) {
$minmultipleqty['valid']
= 0;
$fullItemsGroup[$itemId]['minmultipleqtyvalid'] = 0;
} else {
// Set it back because we are in foreach
$minmultipleqty['valid']
= 1;
$fullItemsGroup[$itemId]['minmultipleqtyvalid'] = 1;
}
}
// ==============================
// STOCK VALID
// ==============================
// The difference between STOCK-1, STOCK-0
// b) STOCK-0 - There is only one main product even it is
divided into more product variations
// - so we count only main product - group
// a) STOCK-1 - Each product variation is one product but
this means that product without any variation
// - is in one one of the product variation:
// Product 1 Option A - one product
// Product 1 Option B - one product
// Product 1 (no options) - one product - as sum there are
3 products
// c) STOCK-2 - advanced stock management
// Product 1 Option A - one product
// Product 1 Option B - one product
// Product 1 (no options) - one product - as sum there are
3 products
// Product 1 Option A + Option B - one product
// STOCK-2 ... we count main product as own product
variation - only in case it does not have any attributes
// ... but combination of attributes can create
different products
if (($fullItems[$k]['stockcalculation'] == 2 ||
$fullItems[$k]['stockcalculation'] == 3) &&
(int)$fullItems[$k]['quantity'] >
(int)$fullItems[$k]['stockadvanced']) {
$stock['valid'] = 0;// Global -
some of the product is out of stock
$fullItems[$k]['stockvalid'] = 0;// Current
product is out of stock
}
// STOCK-1 ... we count main product as own product
variation - only in case it does not have any attributes
// variations of product are checked in ohter
place (cca line 271)
// THIS IS DIVEDED RULE - ONE HERE, SECOND ABOVE IN
ATTRIBUTES FOREACH
if ($fullItems[$k]['stockcalculation'] == 1
&& empty($fullItems[$k]['attributes']) &&
(int)$fullItems[$k]['quantity'] >
(int)$fullItems[$k]['stock']) {
$stock['valid'] = 0;// Global -
some of the product is out of stock
$fullItems[$k]['stockvalid'] = 0;// Current
product is out of stock
}
// STOCK-0 ... we count main product as group: Product 1
Option A ... 5 + Product 1 Option B ... 5 = 10
if ($fullItems[$k]['stockcalculation'] == 0
&& (int)$fullItemsGroup[$itemId]['quantity'] >
(int)$fullItems[$k]['stock']) {
$stock['valid'] = 0;// Global -
some of the product is out of stock
$fullItems[$k]['stockvalid'] = 0;// Current
product is out of stock
}
$fullItems[$k]['final'] =
$fullItems[$k]['netto'] &&
!$this->posbruttocalculation ? $fullItems[$k]['netto'] * $fQ :
$fullItems[$k]['brutto'] * $fQ;
}
if ($this->correctsubtotal) {
$this->correctSubTotal($fullItems[$k], $total);
}
}
}
// ================
// REWARD POINTS
// ================
public function calculateRewardDiscounts(&$fullItems,
&$fullItemsGroup, &$total, $rewardCart) {
$reward = new PhocacartReward();
$rewards = array();
$rewards['used'] =
$reward->checkReward((int)$rewardCart['used']);
$rewards['usedtotal'] = 0;
foreach ($fullItems as $k => $v) {
if (isset($v['points_needed']) &&
(int)$v['points_needed'] > 0) {
$rewards['needed'] = $v['quantity'] *
$v['points_needed'];
$reward->calculatedRewardDiscountProduct($rewards);
if (isset($rewards['percentage']) &&
$rewards['percentage'] > 0) {
$fullItems[$k]['rewardproduct'] = 1;
$fullItems[$k]['rewardproductpoints'] =
$rewards['usedproduct'];
$fullItems[$k]['rewardproducttitle'] =
JText::_('COM_PHOCACART_REWARD_POINTS');
PhocacartCalculation::calculateDiscountPercentage($rewards['percentage'],
$v['quantity'], $fullItems[$k], $total, $v['taxkey']);
$fullItems[$k]['rewardproducttxtsuffix'] =
' (' . $rewards['usedproduct'] . ')';
$total['rewardproducttxtsuffix'] =
' (' . $rewards['usedtotal'] . ')';
$total['rewardproductusedtotal'] =
$rewards['usedtotal'];
PhocacartCalculation::correctItemsIfNull($fullItems[$k]);
PhocacartCalculation::correctTotalIfNull($total,
$v['taxkey']);
}
$fullItems[$k]['final'] =
$fullItems[$k]['netto'] &&
!$this->posbruttocalculation ? $fullItems[$k]['netto'] *
$v['quantity'] : $fullItems[$k]['brutto'] *
$v['quantity'];
if (isset($fullItems[$k]['nettodiscount'])
&& !$this->posbruttocalculation) {
$fullItems[$k]['finaldiscount'] =
$fullItems[$k]['nettodiscount'] * $v['quantity'];
} else if
(isset($fullItems[$k]['bruttodiscount'])) {
$fullItems[$k]['finaldiscount'] =
$fullItems[$k]['bruttodiscount'] * $v['quantity'];
}
if ($this->correctsubtotal) {
$this->correctSubTotal($fullItems[$k], $total);
}
}
}
}
// ================
// PRODUCT DISCOUNT
// ================
public function calculateProductDiscounts(&$fullItems,
&$fullItemsGroup, &$total) {
foreach ($fullItems as $k => $v) {
// Get quantity of a group. Group is sum of all product
variations
// - explained in PhocacartDiscountProduct::getProductDiscount
$groupId = $v['id'];
$v['quantitygroup'] = $v['quantity'];//
define
if (isset($fullItemsGroup[$groupId]['quantity'])) {
$v['quantitygroup'] =
$fullItemsGroup[$groupId]['quantity'];
}
$discount =
PhocacartDiscountProduct::getProductDiscount($v['id'],
$v['quantitygroup'], $v['quantity']);
if (isset($discount['discount']) &&
isset($discount['calculation_type'])) {
$fullItems[$k]['discountproduct'] = 1;
$fullItems[$k]['discountproducttitle'] =
$discount['title'];
if ($discount['calculation_type'] == 0) {
// FIXED AMOUNT
if (isset($v['netto']) &&
$v['netto'] > 0) {
//$r = $discount['discount'] /
$v['quantity'] * 100 / $v['netto'];// Ratio to use it
for brutto and tax
// PRODUCT DISCOUNT - DON'T DIVIDE IT INTO
QUANTITY
//if you set 500 fixed amount as discount - it
applies to each quantity
$r = $discount['discount'] * 100 /
$v['netto'];
} else {
$r = 0;
}
PhocacartCalculation::calculateDiscountFixedAmount($r,
$v['quantity'], $fullItems[$k], $total, $v['taxkey']);
} else {
// PERCENTAGE
PhocacartCalculation::calculateDiscountPercentage($discount['discount'],
$v['quantity'], $fullItems[$k], $total, $v['taxkey']);
}
PhocacartCalculation::correctItemsIfNull($fullItems[$k]);
PhocacartCalculation::correctTotalIfNull($total,
$v['taxkey']);
}
$fullItems[$k]['final'] =
$fullItems[$k]['netto'] &&
!$this->posbruttocalculation ? $fullItems[$k]['netto'] *
$v['quantity'] : $fullItems[$k]['brutto'] *
$v['quantity'];
if (isset($fullItems[$k]['nettodiscount']) &&
!$this->posbruttocalculation) {
$fullItems[$k]['finaldiscount'] =
$fullItems[$k]['nettodiscount'] * $v['quantity'];
} else if (isset($fullItems[$k]['bruttodiscount'])) {
$fullItems[$k]['finaldiscount'] =
$fullItems[$k]['bruttodiscount'] * $v['quantity'];
}
if ($this->correctsubtotal) {
$this->correctSubTotal($fullItems[$k], $total);
}
}
}
// =============
// CART DISCOUNT
// =============
public function calculateCartDiscounts(&$fullItems,
&$fullItemsGroup, &$total, &$cartDiscount) {
// If there are more cart discounts e.g. separated by different
rules
// remove the suffix because it will be not valid
$discountSuffixItems = array();
foreach ($fullItems as $k => $v) {
$discount =
PhocacartDiscountCart::getCartDiscount($v['id'],
$v['catid'], $total['quantity'],
$total['netto'], $total['subtotalnetto']);
// First check if there is even some discount
if ($discount) {
$discountId = $discount['id'];
$discountAmount = $discount['discount'];
if ($discount['free_shipping'] == 1) {
$total['free_shipping'] =
$discount['free_shipping'];
}
if ($discount['free_payment'] == 1) {
$total['free_payment'] =
$discount['free_payment'];
}
if (isset($discount['discount']) &&
isset($discount['calculation_type'])) {
$fullItems[$k]['discountcart'] = 1;
$fullItems[$k]['discountcarttitle'] =
$discount['title'];
$fullItems[$k]['discountcartid'] =
$discount['id'];
if ($discount['calculation_type'] == 0) {
// FIXED AMOUNT
// We need to divide fixed discount amount to
products which meet the discount ID rule
// There can be two products in the cart and each
can meet other discount rules
if
(isset($total['discountcartfixedamount'][$discountId]['quantity']))
{
$total['discountcartfixedamount'][$discountId]['quantity']
+= $v['quantity'];
} else {
$total['discountcartfixedamount'][$discountId]['quantity']
= $v['quantity'];
}
if
(isset($total['discountcartfixedamount'][$discountId]['netto']))
{
$total['discountcartfixedamount'][$discountId]['netto']
+= $v['netto'] * $v['quantity'];
} else {
$total['discountcartfixedamount'][$discountId]['netto']
= $v['netto'] * $v['quantity'];
}
$total['discountcartfixedamount'][$discountId]['discount']
= $discountAmount;
$fullItems[$k]['discountcartfixedid']
= $discountId;
} else {
// PERCENTAGE
PhocacartCalculation::calculateDiscountPercentage($discount['discount'],
$v['quantity'], $fullItems[$k], $total, $v['taxkey']);
$discountSuffixItems[$discount['discount']] =
$discount['discount'];
if (count($discountSuffixItems) > 1) {
// There are different types of discounts,
remove the suffix Cart discount (10%) become Cart discount. Because if
there is
// e.g. 5% and 10% then the 10% in () will be
misleading
$total['discountcarttxtsuffix'] =
'';
} else {
$price = new
PhocacartPrice();
$total['discountcarttxtsuffix'] =
' (' . $price->cleanPrice($discount['discount']) .
' %)';
}
}
$cartDiscount['id'] =
$discount['id'];
$cartDiscount['title'] =
$discount['title'];
}
}
$fullItems[$k]['final'] =
$fullItems[$k]['netto'] &&
!$this->posbruttocalculation ? $fullItems[$k]['netto'] *
$v['quantity'] : $fullItems[$k]['brutto'] *
$v['quantity'];
/*
* Must be done in recalculateCartDiscounts()
*
if (isset($fullItems[$k]['nettodiscount']) &&
!$this->posbruttocalculation) {
$fullItems[$k]['finaldiscount'] =
$fullItems[$k]['nettodiscount'] * $v['quantity'];
} else if (isset($fullItems[$k]['bruttodiscount'])) {
$fullItems[$k]['finaldiscount'] =
$fullItems[$k]['bruttodiscount'] * $v['quantity'];
}*/
if ($this->correctsubtotal) {
//$this->correctSubTotal($fullItems[$k], $total);
}
}
}
/*
* Used only for fixed amount of discount
*/
public function recalculateCartDiscounts(&$fullItems,
&$fullItemsGroup, &$total) {
foreach ($fullItems as $k => $v) {
// Fixed amount - we need to recalculate
$dF = $v['discountcartfixedid'];
if
(isset($total['discountcartfixedamount'][$dF]['discount'])
&&
isset($total['discountcartfixedamount'][$dF]['netto']))
{
$dPRel = 0;
if
($total['discountcartfixedamount'][$dF]['netto'] >
0) {
$dPRel =
$total['discountcartfixedamount'][$dF]['discount'] /
$total['discountcartfixedamount'][$dF]['netto'];
}
// CART DISCOUNT - DIVIDE IT INTO QUANTITY
$dPFix = $dPRel * $v['netto'] *
$v['quantity'];
if ($v['netto'] > 0) {
$r = $dPFix * 100 / $v['netto'] /
$v['quantity'];// Ratio to use it for brutto and tax but you need
to divide it into qunatity
} else {
$r = 0;
}
PhocacartCalculation::calculateDiscountFixedAmount($r,
$v['quantity'], $fullItems[$k], $total, $v['taxkey']);
PhocacartCalculation::correctItemsIfNull($fullItems[$k]);
PhocacartCalculation::correctTotalIfNull($total,
$v['taxkey']);
}
$fullItems[$k]['final'] =
$fullItems[$k]['netto'] &&
!$this->posbruttocalculation ? $fullItems[$k]['netto'] *
$v['quantity'] : $fullItems[$k]['brutto'] *
$v['quantity'];
if (isset($fullItems[$k]['nettodiscount']) &&
!$this->posbruttocalculation) {
$fullItems[$k]['finaldiscount'] =
$fullItems[$k]['nettodiscount'] * $v['quantity'];
} else if (isset($fullItems[$k]['bruttodiscount'])) {
$fullItems[$k]['finaldiscount'] =
$fullItems[$k]['bruttodiscount'] * $v['quantity'];
}
if ($this->correctsubtotal) {
$this->correctSubTotal($fullItems[$k], $total);
}
}
}
// ============
// CART COUPON
// ============
/*
* $coupon ... coupon ID and Title set in checkout
* $couponO ... coupon object
* $couponDb ... all the information from coupon
* $validCoupon ... is or isn't valid TRUE/FALSE
*/
public function calculateCartCoupons(&$fullItems,
&$fullItemsGroup, &$total, &$coupon) {
$couponO = new PhocacartCoupon();
$couponO->setType($this->type);
$couponO->setCoupon($coupon['id']);
$couponDb = $couponO->getCoupon();
foreach ($fullItems as $k => $v) {
$validCoupon = $couponO->checkCoupon(0, $v['id'],
$v['catid'], $total['quantity'],
$total['netto'], $total['subtotalnetto']);
if ($validCoupon) {
$validCouponId = $couponDb['id'];
$validCouponAmount = $couponDb['discount'];
if ($couponDb['free_shipping'] == 1) {
$total['free_shipping'] =
$couponDb['free_shipping'];
}
if ($couponDb['free_payment'] == 1) {
$total['free_payment'] =
$couponDb['free_payment'];
}
if (isset($couponDb['discount']) &&
isset($couponDb['calculation_type'])) {
$fullItems[$k]['couponcart'] = 1;
$fullItems[$k]['couponcarttitle'] =
$couponDb['title'];
$fullItems[$k]['couponcartid'] =
$couponDb['id'];
if ($couponDb['calculation_type'] == 0) {
// FIXED AMOUNT
// We need to divide fixed couponDb amount to
products which meet the couponDb ID rule
// There can be two products in the cart and each
can meet other couponDb rules
if
(isset($total['couponcartfixedamount'][$validCouponId]['quantity']))
{
$total['couponcartfixedamount'][$validCouponId]['quantity']
+= $v['quantity'];
} else {
$total['couponcartfixedamount'][$validCouponId]['quantity']
= $v['quantity'];
}
if
(isset($total['couponcartfixedamount'][$validCouponId]['netto']))
{
$total['couponcartfixedamount'][$validCouponId]['netto']
+= $v['netto'] * $v['quantity'];
} else {
$total['couponcartfixedamount'][$validCouponId]['netto']
= $v['netto'] * $v['quantity'];
}
$total['couponcartfixedamount'][$validCouponId]['discount']
= $validCouponAmount;
$fullItems[$k]['couponcartfixedid']
= $validCouponId;
} else {
// PERCENTAGE
PhocacartCalculation::calculateDiscountPercentage($couponDb['discount'],
$v['quantity'], $fullItems[$k], $total, $v['taxkey']);
PhocacartCalculation::correctItemsIfNull($fullItems[$k]);
PhocacartCalculation::correctTotalIfNull($total,
$v['taxkey']);
$price = new
PhocacartPrice();
$total['couponcarttxtsuffix'] = '
(' . $price->cleanPrice($couponDb['discount']) . '
%)';
}
}
}
// !!! VALID COUPON
// In case the coupon is valid at least for one product or one
category it is then valid
// and will be divided into valid products/categories
// As global we mark it as valid - so change the valid coupon
variable only in case it is valid
if ($validCoupon == 1) {
$coupon['valid'] = $validCoupon;
}
$fullItems[$k]['final'] =
$fullItems[$k]['netto'] &&
!$this->posbruttocalculation ? $fullItems[$k]['netto'] *
$v['quantity'] : $fullItems[$k]['brutto'] *
$v['quantity'];
/*
*
* Must be done in recalculateCartCoupons for fixed coupons
*/
if (isset($couponDb['calculation_type']) &&
$couponDb['calculation_type'] != 0) {
if (isset($fullItems[$k]['nettodiscount'])
&& !$this->posbruttocalculation) {
$fullItems[$k]['finaldiscount'] =
$fullItems[$k]['nettodiscount'] * $v['quantity'];
} else if
(isset($fullItems[$k]['bruttodiscount'])) {
$fullItems[$k]['finaldiscount'] =
$fullItems[$k]['bruttodiscount'] * $v['quantity'];
}
}
if ($this->correctsubtotal) {
$this->correctSubTotal($fullItems[$k], $total);
}
}
}
/*
* Used only for fixed amount of coupon
*/
public function recalculateCartCoupons(&$fullItems,
&$fullItemsGroup, &$total) {
foreach ($fullItems as $k => $v) {
$dF = $v['couponcartfixedid'];
if
(isset($total['couponcartfixedamount'][$dF]['discount'])
&&
isset($total['couponcartfixedamount'][$dF]['netto'])) {
$dPRel = 0;
if
($total['couponcartfixedamount'][$dF]['netto'] > 0)
{
$dPRel =
$total['couponcartfixedamount'][$dF]['discount'] /
$total['couponcartfixedamount'][$dF]['netto'];
}
// CART DISCOUNT - DIVIDE IT INTO QUANTITY
$dPFix = $dPRel * $v['netto'] *
$v['quantity'];
if ($v['netto'] > 0) {
$r = $dPFix * 100 / $v['netto'] /
$v['quantity'];// Ratio to use it for brutto and tax but you need
to divide it into qunatity
} else {
$r = 0;
}
PhocacartCalculation::calculateDiscountFixedAmount($r,
$v['quantity'], $fullItems[$k], $total, $v['taxkey']);
PhocacartCalculation::correctItemsIfNull($fullItems[$k]);
PhocacartCalculation::correctTotalIfNull($total,
$v['taxkey']);
}
$fullItems[$k]['final'] =
$fullItems[$k]['netto'] &&
!$this->posbruttocalculation ? $fullItems[$k]['netto'] *
$v['quantity'] : $fullItems[$k]['brutto'] *
$v['quantity'];
if (isset($fullItems[$k]['nettodiscount']) &&
!$this->posbruttocalculation) {
$fullItems[$k]['finaldiscount'] =
$fullItems[$k]['nettodiscount'] * $v['quantity'];
} else if (isset($fullItems[$k]['bruttodiscount'])) {
$fullItems[$k]['finaldiscount'] =
$fullItems[$k]['bruttodiscount'] * $v['quantity'];
}
if ($this->correctsubtotal) {
$this->correctSubTotal($fullItems[$k], $total);
}
}
}
// Correct rounding errors
// When we count the tax and quantity, we need to do without rounding
because of VAT
// This is why we run $price->getPriceItems without rounding Output
// Ok, now rounding, this means, we can get difference e.g. 0.01 so
such we need to correct
// - in total, even on the row
// This can happen when using Exclusive Tax - this is common problem
with exclusive tax counting
public function correctSubTotal(&$item, &$total) {
// Fix when discount is larger than final netto (this can happen
due to rounding, so it can happen that netto is e.g. - 0.01
if ($total['netto'] < 0) {
$item['finaldiscount'] += $total['netto'];
$total['netto'] = 0;
}
// Fixed VAT
if ($item['taxcalctype'] == 2) {
//return;
}
$price = new PhocacartPrice();
$quantityCorrect = $item['quantity'] > 0 ?
$item['quantity'] : 1;
$nettoNotRounded = $item['netto'] * $quantityCorrect;
$taxNotRounded = $item['tax'] * $quantityCorrect;
$nettoRounded = $price->roundPrice($item['netto'] *
$quantityCorrect);
$bruttoRounded = $price->roundPrice($item['brutto'] *
$quantityCorrect);
$taxRounded = $price->roundPrice($item['tax'] *
$quantityCorrect);
//- $nettoRounded = $item['netto'] * $quantityCorrect;
//- $bruttoRounded = $item['brutto'] *
$quantityCorrect;
//- $taxRounded = $item['tax'] * $quantityCorrect;
$nettoRoundedCorrected = $bruttoRounded - $taxRounded;
if ($nettoNotRounded > 0) {
if (abs(($nettoRoundedCorrected - $nettoNotRounded) /
$nettoNotRounded) < 0.00001) {
// the floats are the same
} else {
$item['netto'] = $nettoRoundedCorrected /
$quantityCorrect;
$total['netto'] = $total['netto'] +
($nettoRoundedCorrected / $item['quantity']) - ($nettoNotRounded
/ $quantityCorrect);
if (!empty($total['tax'])) {
foreach ($total['tax'] as $kT => $vT) {
if ($kT == $item['taxkey']) {
$total['tax'][$kT]['netto']
= $vT['netto'] + ($nettoRoundedCorrected /
$item['quantity']) - ($nettoNotRounded / $quantityCorrect);
$total['tax'][$kT]['tax']
= $vT['tax'];
$total['tax'][$kT]['brutto'] =
$total['tax'][$kT]['tax'] +
$total['tax'][$kT]['netto'];
}
}
}
}
}
}
/*
public function correctSubTotalAll(&$fullItems, &$total) {
foreach($fullItems as $k => $v) {
$price = new PhocacartPrice();
$quantityCorrect = $v['quantity'] > 0 ?
$v['quantity'] : 1;
$nettoNotRounded = $v['netto'] * $quantityCorrect;
$taxNotRounded = $v['tax'] * $quantityCorrect;
$nettoRounded = $price->roundPrice($v['netto'] *
$quantityCorrect);
$bruttoRounded = $price->roundPrice($v['brutto']
* $quantityCorrect);
$taxRounded = $price->roundPrice($v['tax'] *
$quantityCorrect);
$nettoRoundedCorrected = $bruttoRounded - $taxRounded;
if ($nettoNotRounded > 0) {
if (abs(($nettoRoundedCorrected -
$nettoNotRounded)/$nettoNotRounded) < 0.00001) {
// the floats are the same
} else {
$fullItems[$k]['netto'] =
$nettoRoundedCorrected / $quantityCorrect;
$total['netto'] = $total['netto'] +
($nettoRoundedCorrected / $v['quantity']) - ($nettoNotRounded /
$quantityCorrect);
if (!empty($total['tax'])) {
foreach($total['tax'] as $kT => $vT) {
if ($kT == $v['taxkey']) {
$total['tax'][$kT]['tax'] = $vT['tax'] +
($taxRounded / $quantityCorrect) - ($taxNotRounded / $quantityCorrect);
}
}
}
}
}
}
}*/
public function roundFixedAmountDiscount(&$total) {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$rounding_calculation_fad =
$paramsC->get('rounding_calculation_fixed_amount_discount',
-1);
if ($rounding_calculation_fad < 0) {
return;
}
$discount = 0;
if (!empty($total['discountcartfixedamount'])) {
foreach ($total['discountcartfixedamount'] as $k
=> $v) {
if (isset($v['discount'])) {
if (isset($v['netto']) &&
$v['netto'] < $v['discount']) {
$discount = $v['netto']; // more pieces
of product - so the cart discount is divided to more pieces of products,
but max to cart discount fixed amount
} else {
$discount = $v['discount'];// one product
- whole cart discount goes to one product
}
}
}
}
if (isset($total['dnetto']) &&
$total['dnetto'] > 0 && $discount > 0) {
$dif = $discount - $total['dnetto'];
if ($dif > 0) {
$total['rounding'] += $dif;
$total['dnetto'] = $discount;
} else if ($dif < 0) {
$total['rounding'] -= $dif;
$total['dnetto'] = $discount;
$total['netto'] += $dif;
}
}
return;
}
public function roundFixedAmountCoupon(&$total) {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$rounding_calculation_fac =
$paramsC->get('rounding_calculation_fixed_amount_coupon', -1);
if ($rounding_calculation_fac < 0) {
return;
}
$discount = 0;
if (!empty($total['couponcartfixedamount'])) {
foreach ($total['couponcartfixedamount'] as $k =>
$v) {
if (isset($v['discount'])) {
if (isset($v['netto']) &&
$v['netto'] < $v['discount']) {
$discount = $v['netto']; // more pieces
of product - so the cart discount is divided to more pieces of products,
but max to cart discount fixed amount
} else {
$discount = $v['discount'];// one product
- whole cart discount goes to one product
}
}
}
}
if (isset($total['dnetto']) &&
$total['dnetto'] > 0 && $discount > 0) {
$dif = $discount - $total['dnetto'];
if ($dif > 0) {
$total['rounding'] += $dif;
$total['dnetto'] = $discount;
} else if ($dif < 0) {
$total['rounding'] -= $dif;
$total['dnetto'] = $discount;
}
}
return;
}
/**
*
* @param unknown $total
* @param unknown $shippingCosts
* @param unknown $paymentCosts
* @param array $options - set specific options - this function is
called twice so in second loop just set specific option (e.g. to not create
brutto currency again)
* @return boolean
*/
public function correctTotalItems(&$total, &$shippingCosts,
&$paymentCosts, $options = array()) {
if (!isset($total[0]['brutto'])) {
return false;
}
$price = new PhocacartPrice();
//$paramsC = PhocacartUtils::getComponentParameters();
//$rounding_calculation = $paramsC->get(
'rounding_calculation', 1 );
//$rounding_calculation_total = $paramsC->get(
'rounding_calculation_total', 2 );
//$currencyRate =
PhocacartCurrency::getCurrentCurrencyRateIfNotDefault();
//$currency = PhocacartCurrency::getCurrency();
//$cr = $currency->exchange_rate;
$cr = PhocacartCurrency::getCurrentCurrencyRateIfNotDefault();
$totalDC = 0; // total in default currency
$totalOR = 0; // total in order currency
// Subtotal
if (isset($total[1]['netto'])) {
$totalDC +=
$price->roundPrice($total[1]['netto']);
$totalOR += $price->roundPrice($total[1]['netto']
* $cr);
}
// - Reward points
if (isset($total[5]['dnetto'])) {
$totalDC -=
$price->roundPrice($total[5]['dnetto']);
$totalOR -= $price->roundPrice($total[5]['dnetto']
* $cr);
}
// - Product Discount
if (isset($total[2]['dnetto'])) {
$totalDC -=
$price->roundPrice($total[2]['dnetto']);
$totalOR -= $price->roundPrice($total[2]['dnetto']
* $cr);
}
// - Discount cart
if (isset($total[3]['dnetto'])) {
$totalDC -=
$price->roundPrice($total[3]['dnetto']);
$totalOR -= $price->roundPrice($total[3]['dnetto']
* $cr);
}
// - Coupon cart
if (isset($total[4]['dnetto'])) {
$totalDC -=
$price->roundPrice($total[4]['dnetto']);
$totalOR -= $price->roundPrice($total[4]['dnetto']
* $cr);
}
// + VAT
if (!empty($total[0]['tax'])) {
foreach ($total[0]['tax'] as $k => $v) {
$totalDC += $price->roundPrice($v['tax']);
$totalOR += $price->roundPrice($v['tax'] *
$cr);
}
}
// + Shipping Costs
if (isset($shippingCosts['brutto'])) {
$shippingCosts['bruttorounded'] =
$price->roundPrice($shippingCosts['brutto']);
$totalDC +=
$price->roundPrice($shippingCosts['brutto']);
$totalOR +=
$price->roundPrice($shippingCosts['brutto'] * $cr);
}
// + Payment Costs
if (isset($paymentCosts['brutto'])) {
$paymentCosts['bruttorounded'] =
$price->roundPrice($paymentCosts['brutto']);
$totalDC +=
$price->roundPrice($paymentCosts['brutto']);
$totalOR +=
$price->roundPrice($paymentCosts['brutto'] * $cr);
}
// ------------------------
// 1) NO ROUNDING - CORRECTION ONLY
// ------------------------
// 1a) CORRECT BRUTTO - DEFAULT CURRENCY
$diff = $total[0]['brutto'] - $totalDC;
if (!($price->roundPrice($diff) > -0.01 &&
$price->roundPrice($diff) < 0.01)) {
$total[0]['rounding'] = $price->roundPrice($diff);
} else {
$total[0]['rounding'] = 0;
}
// 1b) CORRECT BRUTTO - ORDER CURRENCY
if ($cr > 1 || $cr < 1) {
if (isset($options['brutto_currency_set']) &&
isset($options['brutto_currency_set']) == 1) {
$totalBruttoCurrency =
$price->roundPrice($total[0]['brutto_currency']);
} else {
$totalBruttoCurrency =
$price->roundPrice($total[0]['brutto'] * $cr);
$total[0]['brutto_currency'] =
$totalBruttoCurrency;
}
$diff = $price->roundPrice($totalBruttoCurrency) -
$price->roundPrice($totalOR);
if (!($price->roundPrice($diff) > -0.01 &&
$price->roundPrice($diff) < 0.01)) {
$total[0]['rounding_currency'] =
$price->roundPrice($diff);
} else {
$total[0]['rounding_currency'] = 0;
}
return true;
}
}
public function roundTotalAmount(&$total) {
$price = new PhocacartPrice();
$paramsC = PhocacartUtils::getComponentParameters();
$rounding_calculation =
$paramsC->get('rounding_calculation', 1);
$rounding_calculation_total =
$paramsC->get('rounding_calculation_total', 2);
$currencyRate =
PhocacartCurrency::getCurrentCurrencyRateIfNotDefault();
if (!isset($total['brutto'])) {
return false;
}
// ------------------------
// 2) ROUNDING
// ------------------------
// !Important
// Each currency has own total rounding and brutto
if ($rounding_calculation_total > -1) {
if ($currencyRate > 1 || $currencyRate < 1) {
/*$totalBruttoCurrency =
$total['brutto_currency'];//$total['brutto'] *
$currencyRate;
$totalBruttoCurrencyRound = round($totalBruttoCurrency ,
(int)$rounding_calculation_total, $rounding_calculation);
$bruttoCurrency =
round($total['brutto_currency'], 2, $rounding_calculation);
if ($totalBruttoCurrency != $bruttoCurrency) {
$total['rounding_currency'] +=
($totalBruttoCurrencyRound - $bruttoCurrency);
}
$total['brutto_currency'] =
$price->roundPrice($totalBruttoCurrencyRound);*/
// 2a) ROUNDING ORDER CURRENCY
$bruttoCurrency =
round($total['brutto_currency'],
(int)$rounding_calculation_total, $rounding_calculation);
$diff = $price->roundPrice($bruttoCurrency) -
$price->roundPrice($total['brutto_currency']);
if (!($price->roundPrice($diff) > -0.01 &&
$price->roundPrice($diff) < 0.01)) {
$total['rounding_currency'] += $diff;
// $total['taxrecapitulation']['rounding_currency'] +=
$diff;
}
$total['brutto_currency'] =
$price->roundPrice($bruttoCurrency);
// $total['taxrecapitulation']['brutto_currency'] =
$price->roundPrice($bruttoCurrency);
$bruttoCurrencyTax =
round($total['brutto_currency_tax'],
(int)$rounding_calculation_total, $rounding_calculation);
$diffTax =
$price->roundPrice($bruttoCurrencyTax) -
$price->roundPrice($total['brutto_currency_tax']);
if (!($price->roundPrice($diffTax) > -0.01 &&
$price->roundPrice($diffTax) < 0.01)) {
//$total['rounding_currency'] += $diff;
$total['taxrecapitulation']['rounding_currency'] +=
$diffTax;
}
$total['brutto_currency_tax'] =
$price->roundPrice($bruttoCurrencyTax);
$total['taxrecapitulation']['brutto_currency'] =
$price->roundPrice($bruttoCurrencyTax);
}
// We store default to database, so run it always
// 2b) ROUNDING DEFAULT CURRENCY
$brutto = round($total['brutto'],
(int)$rounding_calculation_total, $rounding_calculation);
$diff = $price->roundPrice($brutto) -
$price->roundPrice($total['brutto']);
if (!($price->roundPrice($diff) > -0.01 &&
$price->roundPrice($diff) < 0.01)) {
$total['rounding'] += $diff;
//$total['taxrecapitulation']['rounding'] += $diff;
}
$total['brutto'] = $price->roundPrice($brutto);
//$total['taxrecapitulation']['brutto'] =
$price->roundPrice($brutto);
$bruttoTax = round($total['brutto_tax'],
(int)$rounding_calculation_total, $rounding_calculation);
$diffTax = $price->roundPrice($bruttoTax) -
$price->roundPrice($total['brutto_tax']);
if (!($price->roundPrice($diffTax) > -0.01 &&
$price->roundPrice($diffTax) < 0.01)) {
//$total['rounding'] += $diff;
$total['taxrecapitulation']['rounding']
+= $diffTax;
}
$total['brutto_tax'] =
$price->roundPrice($bruttoTax);
$total['taxrecapitulation']['brutto'] =
$price->roundPrice($bruttoTax);
}
// Final correction
// Correct float, so we can compare to zero
if (isset($total['rounding'])) {
if ($price->roundPrice($total['rounding']) >
-0.01 && $price->roundPrice($total['rounding']) <
0.01) {
$total['rounding'] = (int)0;
}
}
// Correct float, so we can compare to zero
if (isset($total['rounding_currency'])) {
if
($price->roundPrice($total['rounding_currency']) > -0.01
&& $price->roundPrice($total['rounding_currency'])
< 0.01) {
$total['rounding_currency'] = (int)0;
}
}
// Correct float, so we can compare to zero
if (isset($total['brutto'])) {
if ($price->roundPrice($total['brutto']) >
-0.01 && $price->roundPrice($total['brutto']) <
0.01) {
$total['brutto'] = (int)0;
}
}
// Correct float, so we can compare to zero
if (isset($total['brutto_currency'])) {
if ($price->roundPrice($total['brutto_currency'])
> -0.01 &&
$price->roundPrice($total['brutto_currency']) < 0.01) {
$total['brutto_currency'] = (int)0;
}
}
// Correct float, so we can compare to zero
if
(isset($total['taxrecapitulation']['rounding'])) {
if
($price->roundPrice($total['taxrecapitulation']['rounding'])
> -0.01 &&
$price->roundPrice($total['taxrecapitulation']['rounding'])
< 0.01) {
$total['taxrecapitulation']['rounding']
= (int)0;
}
}
// Correct float, so we can compare to zero
if
(isset($total['taxrecapitulation']['rounding_currency']))
{
if
($price->roundPrice($total['taxrecapitulation']['rounding_currency'])
> -0.01 &&
$price->roundPrice($total['taxrecapitulation']['rounding_currency'])
< 0.01) {
$total['taxrecapitulation']['rounding_currency'] =
(int)0;
}
}
$total['taxrecapitulation']['brutto_incl_rounding']
= $total['taxrecapitulation']['brutto'];
$total['taxrecapitulation']['brutto_currency_incl_rounding']
= $total['taxrecapitulation']['brutto_currency'];
if ($rounding_calculation_total == -1) {
// If not rounded here: e.g. 0.87 -> 1, 0.93 -> 1
// We need to count standard rounding 0.8666 -> 0.87 (if
rounded here, such will be included)
if
($price->roundPrice($total['taxrecapitulation']['rounding'])
> 0) {
$total['taxrecapitulation']['brutto_incl_rounding'] =
$total['taxrecapitulation']['brutto'] +
$price->roundPrice($total['taxrecapitulation']['rounding']);
}
if
($price->roundPrice($total['taxrecapitulation']['rounding_currency'])
> 0) {
$total['taxrecapitulation']['brutto_currency_incl_rounding']
= $total['taxrecapitulation']['brutto_currency'] +
$price->roundPrice($total['taxrecapitulation']['rounding_currency']);
}
}
return true;
}
/*
public function resetVariables(&$fullItems, $levels = array()) {
if (!empty($levels)) {
foreach($levels as $k => $v) {
if (!empty($fullItems[$k])) {
foreach($fullItems[$k] as $k => $v) {
$fullItems[$k]['discountproduct'] = 0;
$fullItems[$k]['discountcartfixedid'] =
0;
$fullItems[$k]['discounttitle'] =
'';
}
}
}
}
}*/
public static function taxRecapitulation(&$total, $shippingCosts,
$paymentCosts) {
if (empty($total)) {
return;
}
//$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
//$dynamic_tax_rate = $paramsC->get(
'dynamic_tax_rate', 0 );
$tax_calculation =
$paramsC->get('tax_calculation', 0);
$tax_calculation_shipping =
$paramsC->get('tax_calculation_shipping', 0);
$tax_calculation_payment =
$paramsC->get('tax_calculation_payment', 0);
// 0 ... don't fix anything
// 1 ... fix TAX RECAPITULATION - when total brutto will change,
change the total brutto and rounding for CART CALCULATION
// 2 ... fix TAX RECAPITULATION - fix taxes in CART CALCULATION -
total brutto and rounding will change even
$tax_recapitulation =
$paramsC->get('tax_recapitulation', 0);
$round = 1;
$currencyRate =
PhocacartCurrency::getCurrentCurrencyRateIfNotDefault();
$price = new PhocacartPrice();
$total['taxrecapitulation'] = array();
$total['taxrecapitulation']['brutto'] = 0;
$total['taxrecapitulation']['netto'] =
0;
$total['taxrecapitulation']['netto_incl_sp'] =
0; // netto including shipping and payment costs
$total['taxrecapitulation']['tax'] =
0;
$total['taxrecapitulation']['rounding'] =
0;
$total['taxrecapitulation']['items'] = array();
// $total['taxrecapitulation']['diffbrutto'] =
0;// is cart calculation brutto different to tax recapitulation
// $total['taxrecapitulation']['corrected'] =
0;
//$total['taxrecapitulation']['corrected_currency']= 0;
// Currency
$total['taxrecapitulation']['currency_rate']
= $currencyRate;
$total['taxrecapitulation']['brutto_currency']
= 0;
$total['taxrecapitulation']['rounding_currency'] = 0;
$total['taxrecapitulation']['brutto_incl_rounding']
= 0;
$total['taxrecapitulation']['brutto_currency_incl_rounding']
= 0;
$total['taxsum'] = 0;// Sum all taxes in total so we can
compare them because of rounding with
$total['taxrecapitulation']['tax']
// We compare
$total['taxrecapitulation']['brutto'] and
$total['brutto'] at the end BUT
// there are 3 SETTINGS: Tax for products, Tax for Shipping and Tax
for Payment $total['brutto'] can include amount of products which
don't not belong to tax
// $total['brutto_tax'] is brutt but only for taxable
items (products, shipping, payment)
$total['brutto_tax'] =
$total['brutto'];
$total['brutto_currency_tax'] =
$total['brutto_currency'];
if ($tax_calculation == 0) {
$total['brutto_tax'] -=
$total['netto'];
$total['brutto_currency_tax'] -=
$price->roundPrice($total['netto'] * $currencyRate);
}
if (!empty($total['tax']) && $tax_calculation
> 0) {
foreach ($total['tax'] as $k => $v) {
$total['taxsum'] += $v['tax'];
$netto = $v['netto'];
$tax =
$price->roundPrice($v['tax']);
$brutto = $v['brutto'];
$rate =
$price->roundPrice($v['rate']);
//$bruttoCurrency =
$price->roundPrice(($v['brutto'] * $currencyRate));
if ($tax_recapitulation > 0) {
// Tax
// - Tax changed by country/region is set
// - $tax_calculation: no/inclusive/exclusive (set in
options)
// - $v['type']: fixed/percentage (set in
product)
// NO TAX
if ($tax_calculation == 0) {
$tax = 0;
// EXCLUSIVE TAX
} else if ($tax_calculation == 1) {
if ($v['type'] == 2) { // FIX
$brutto = $netto + $tax;
} else { // Percentage
$tax = $netto * ($rate / 100);
if ($round == 1) {
$tax = $price->roundPrice($tax);
}
$brutto = $netto + $tax;
}
// INCLUSIVE TAX
} else if ($tax_calculation == 2) {
if ($v['type'] == 2) { // FIX
$netto = $brutto - $tax;
} else { // Percentage
$tax = $brutto - ($brutto / (($rate / 100) +
1));
if ($round == 1) {
$tax = $price->roundPrice($tax);
}
$netto = $brutto - $tax;
}
}
}
if ($round == 1) {
$netto = $price->roundPrice($netto);
$brutto = $price->roundPrice($brutto);
$tax = $price->roundPrice($tax);
}
$total['taxrecapitulation']['items'][$k]['title']
= $v['title'];
$total['taxrecapitulation']['items'][$k]['title_lang']
= $v['title_lang'];
$total['taxrecapitulation']['items'][$k]['title_lang_suffix2']
= $v['title_lang_suffix2'];
$total['taxrecapitulation']['items'][$k]['netto']
= $netto;
$total['taxrecapitulation']['items'][$k]['tax']
= $tax;
$total['taxrecapitulation']['items'][$k]['brutto']
= $brutto;
// Currency
// $bruttoCurrency = $price->roundPrice($netto *
$currencyRate) + $price->roundPrice($tax * $currencyRate);
// $total['taxrecapitulation']['items'][$k]['brutto_currency']
= $bruttoCurrency;
$total['taxrecapitulation']['brutto']
+= $brutto;// changed when tax inclusive
$total['taxrecapitulation']['netto']
+= $netto; // changed when tax exclusive
$total['taxrecapitulation']['tax']
+= $tax; // changed when tax exclusive
// Currency
//$total['taxrecapitulation']['brutto_currency'] +=
$bruttoCurrency;
if ($tax_recapitulation == 2) {
$total['tax'][$k]['netto'] =
$netto;
$total['tax'][$k]['tax'] = $tax;
$total['tax'][$k]['brutto'] =
$brutto;
//$total['tax'][$k]['brutto_currency'] =
$bruttoCurrency;
}
if ($tax_recapitulation == 2) {
//$total['taxrecapitulation']['rounding'] +=
($price->roundPrice($total['tax'][$k]['tax']) -
$price->roundPrice($total['taxrecapitulation']['items'][$k]['tax']));
}
}
if ($tax_recapitulation == 2) {
//$total['taxrecapitulation']['rounding'] +=
($price->roundPrice($total['netto']) -
$price->roundPrice($total['taxrecapitulation']['netto']));
}
}
$total['taxrecapitulation']['netto_incl_sp'] =
$total['taxrecapitulation']['netto'];
// Shipping
if ($tax_calculation_shipping == 0 &&
isset($shippingCosts['brutto'])) {
$total['brutto_tax'] -=
$shippingCosts['brutto'];
$total['brutto_currency_tax'] -=
$price->roundPrice($shippingCosts['brutto'] * $currencyRate);
}
if (isset($shippingCosts['taxkey']) &&
(int)$shippingCosts['taxkey']) {
$netto = $shippingCosts['netto'];
$tax = $shippingCosts['tax'];
$brutto = $shippingCosts['brutto'];
$taxkey = $shippingCosts['taxkey'];
// Nothing to fix
/*if ($correct_tax_recapitulation == 1) {
if ($v['type'] == 1) {
$tax = $price->roundPrice($netto *
$shippingCosts['taxrate'] / 100);
$brutto = $shippingCosts['netto'] + $tax;
} else {
$brutto = $shippingCosts['netto'] + $tax;
}
}*/
if
(isset($total['taxrecapitulation']['items'][$taxkey]['netto']))
{
$total['taxrecapitulation']['items'][$taxkey]['netto']
+= $netto;
$total['taxrecapitulation']['netto_incl_sp']
+= $netto;
// $total['taxrecapitulation']['netto']
+= $netto;
} else {
$total['taxrecapitulation']['items'][$taxkey]['title']
= $shippingCosts['taxtxt'];
$total['taxrecapitulation']['items'][$taxkey]['title_lang']
= $shippingCosts['tax_title_lang'];
$total['taxrecapitulation']['items'][$taxkey]['title_lang_suffix']
= $shippingCosts['tax_title_suffix'];
$total['taxrecapitulation']['items'][$taxkey]['title_lang_suffix2']
= $shippingCosts['tax_title_suffix2'] != '' ?
'(' . $shippingCosts['tax_title_suffix2'] .
')' : '';
$total['taxrecapitulation']['items'][$taxkey]['netto']
= $netto;
$total['taxrecapitulation']['netto_incl_sp']
= $netto;
// $total['taxrecapitulation']['netto']
= $netto;
}
if
(isset($total['taxrecapitulation']['items'][$taxkey]['tax']))
{
$total['taxrecapitulation']['items'][$taxkey]['tax']
+= $tax;
$total['taxrecapitulation']['tax']
+= $tax;
} else {
//$total['taxrecapitulation']['items'][$taxkey]['title']
= $shippingCosts['taxtxt'];
$total['taxrecapitulation']['items'][$taxkey]['tax']
= $tax;
$total['taxrecapitulation']['tax']
+= $tax;
}
if
(isset($total['taxrecapitulation']['items'][$taxkey]['brutto']))
{
$total['taxrecapitulation']['items'][$taxkey]['brutto']
+= $brutto;
// $total['taxrecapitulation']['items'][$taxkey]['brutto_currency']
+= $price->roundPrice($brutto * $currencyRate);
$total['taxrecapitulation']['brutto']
+= $brutto;
// $total['taxrecapitulation']['brutto_currency'] +=
$price->roundPrice($brutto * $currencyRate);
} else {
//$total['taxrecapitulation']['items'][$taxkey]['title']
= $shippingCosts['taxtxt'];
$total['taxrecapitulation']['items'][$taxkey]['brutto']
= $brutto;
// $total['taxrecapitulation']['items'][$taxkey]['brutto_currency']
= $price->roundPrice($brutto * $currencyRate);
$total['taxrecapitulation']['brutto']
+= $brutto;
// $total['taxrecapitulation']['brutto_currency'] +=
$price->roundPrice($brutto * $currencyRate);
}
}
// Payment
if ($tax_calculation_payment == 0 &&
isset($paymentCosts['brutto'])) {
$total['brutto_tax'] -=
$paymentCosts['brutto'];
$total['brutto_currency_tax'] -=
$price->roundPrice($paymentCosts['brutto'] * $currencyRate);
}
if (isset($paymentCosts['taxkey']) &&
(int)$paymentCosts['taxkey']) {
$netto = $paymentCosts['netto'];
$tax = $paymentCosts['tax'];
$brutto = $paymentCosts['brutto'];
$taxkey = $paymentCosts['taxkey'];
/*if ($correct_tax_recapitulation == 1) {
if ($v['type'] == 1) {
$tax = $price->roundPrice($netto *
$paymentCosts['taxrate'] / 100);
$brutto = $paymentCosts['netto'] + $tax;
} else {
$brutto = $paymentCosts['netto'] + $tax;
}
}*/
if
(isset($total['taxrecapitulation']['items'][$taxkey]['netto']))
{
$total['taxrecapitulation']['items'][$taxkey]['netto']
+= $netto;
$total['taxrecapitulation']['netto_incl_sp']
+= $netto;
//$total['taxrecapitulation']['netto_incl_sp'] +=
$netto;
} else {
$total['taxrecapitulation']['items'][$taxkey]['title']
= $paymentCosts['taxtxt'];
$total['taxrecapitulation']['items'][$taxkey]['title_lang']
= $paymentCosts['tax_title_lang'];
$total['taxrecapitulation']['items'][$taxkey]['title_lang_suffix']
= $paymentCosts['tax_title_suffix'];
$total['taxrecapitulation']['items'][$taxkey]['title_lang_suffix2']
= $paymentCosts['tax_title_suffix2'] != '' ?
'(' . $paymentCosts['tax_title_suffix2'] .
')' : '';
$total['taxrecapitulation']['items'][$taxkey]['netto']
= $netto;
$total['taxrecapitulation']['netto_incl_sp']
= $netto;
//$total['taxrecapitulation']['netto']
= $netto;
}
if
(isset($total['taxrecapitulation']['items'][$taxkey]['tax']))
{
$total['taxrecapitulation']['items'][$taxkey]['tax']
+= $tax;
$total['taxrecapitulation']['tax']
+= $tax;
} else {
//$total['taxrecapitulation']['items'][$taxkey]['title']
= $paymentCosts['taxtxt'];
$total['taxrecapitulation']['items'][$taxkey]['tax']
= $tax;
$total['taxrecapitulation']['tax']
+= $tax;
}
if
(isset($total['taxrecapitulation']['items'][$taxkey]['brutto']))
{
$total['taxrecapitulation']['items'][$taxkey]['brutto']
+= $brutto;
// $total['taxrecapitulation']['items'][$taxkey]['brutto_currency']
+= $price->roundPrice($brutto * $currencyRate);
$total['taxrecapitulation']['brutto']
+= $brutto;
// $total['taxrecapitulation']['brutto_currency'] +=
$price->roundPrice($brutto * $currencyRate);
} else {
//$total['taxrecapitulation']['items'][$taxkey]['title']
= $paymentCosts['taxtxt'];
$total['taxrecapitulation']['items'][$taxkey]['brutto']
= $brutto;
//$total['taxrecapitulation']['items'][$taxkey]['brutto_currency']
= $price->roundPrice($brutto * $currencyRate);
$total['taxrecapitulation']['brutto']
+= $brutto;
// $total['taxrecapitulation']['brutto_currency'] +=
$price->roundPrice($brutto * $currencyRate);
}
}
// Currency is counted with shipping and payment
if
(!empty($total['taxrecapitulation']['items'])) {
foreach
($total['taxrecapitulation']['items'] as $k => $v) {
$bruttoCurrency
= $price->roundPrice($v['netto'] * $currencyRate) +
$price->roundPrice($v['tax'] * $currencyRate);
$total['taxrecapitulation']['items'][$k]['brutto_currency']
= $bruttoCurrency;
$total['taxrecapitulation']['brutto_currency']
+= $bruttoCurrency;
}
}
// MUST BE RUN AFTER PAYMENT AND SHIPPING - BRUTTO INCLUDES Payment
and Shipping methods
if ($tax_recapitulation > 0) {
// There are two options
// 1) tax_recapitulation == 1: Fix tax recapitulation but not
change cart calculation
// 2) tax_recapitulation == 2: Fix tax recapitulation and
change cart calculation (fixing means that tax is countent from sum not
from each product items - different rounding
//
// In case of 1) when TOTAL BRUTTO is smaller than FIXED TOTAL
BRUTTO - we need to add rounding
// In case of 2) when TOTAL BRUTTO is smaller than FIXED TOTAL
BRUTTO - we don't need to do rounding as we fixed whole CART
CALCULATION - so no need to fix as both are same
// BRUTTO MUST BE ALWAYS THE SAME - so when fixed brutto in tax
recapitulation is larger, we need to change the cart calculation brutto
// but not when the BRUTTO is
larger than tax recapitulation brutto
if ($tax_recapitulation > 0) {
// BRUTTO STANDARD
if ($total['brutto_tax'] >
$total['taxrecapitulation']['brutto']) {
$total['taxrecapitulation']['rounding'] +=
($price->roundPrice($total['brutto_tax']) -
$price->roundPrice($total['taxrecapitulation']['brutto']));
}/* else if ($total['brutto'] <
$total['taxrecapitulation']['brutto']) {
if ($tax_recapitulation == 1) {
// $total['taxrecapitulation']['rounding'] +=
$price->roundPrice($total['taxrecapitulation']['brutto'])
- $price->roundPrice($total['brutto']);
}
// Can be set for $tax_recapitulation == 2
$total['brutto'] =
$price->roundPrice($total['taxrecapitulation']['brutto']);
$total['brutto_tax'] =
$price->roundPrice($total['taxrecapitulation']['brutto']);
}*/
if ($total['brutto'] <
$total['taxrecapitulation']['brutto']) {
$total['brutto'] =
$price->roundPrice($total['taxrecapitulation']['brutto']);
}
if ($total['brutto_tax'] <
$total['taxrecapitulation']['brutto']) {
$total['brutto_tax'] =
$price->roundPrice($total['taxrecapitulation']['brutto']);
}
}
// Currency
if ($tax_recapitulation > 0) {
// BRUTTO STANDARD
if ($total['brutto_currency_tax'] >
$total['taxrecapitulation']['brutto_currency']) {
$total['taxrecapitulation']['rounding_currency'] +=
($price->roundPrice($total['brutto_currency_tax']) -
$price->roundPrice($total['taxrecapitulation']['brutto_currency']));
} /*else if ($total['brutto_currency'] <
$total['taxrecapitulation']['brutto_currency']) {
if ($tax_recapitulation == 1) {
// $total['taxrecapitulation']['rounding_currency']
+=
$price->roundPrice($total['taxrecapitulation']['brutto_currency'])
- $price->roundPrice($total['brutto_currency']);
}
$total['brutto_currency'] =
$price->roundPrice($total['taxrecapitulation']['brutto_currency']);
$total['brutto_currency_tax'] =
$price->roundPrice($total['taxrecapitulation']['brutto_currency']);
}*/
if ($total['brutto_currency'] <
$total['taxrecapitulation']['brutto_currency']) {
$total['brutto_currency'] =
$price->roundPrice($total['taxrecapitulation']['brutto_currency']);
}
if ($total['brutto_currency_tax'] <
$total['taxrecapitulation']['brutto_currency']) {
$total['brutto_currency_tax'] =
$price->roundPrice($total['taxrecapitulation']['brutto_currency']);
}
}
}
}
public function calculateShipping($priceI, &$total) {
if (!isset($total['brutto'])) {
return false;
}
if (isset($priceI['brutto']) &&
$priceI['brutto'] > 0) {
$total['brutto'] += $priceI['brutto'];
} else if (isset($priceI['netto']) &&
$priceI['netto'] > 0 &&
isset($priceI['tax']) && $priceI['tax'] > 0)
{
$total['brutto'] += ($priceI['netto'] +
$priceI['tax']);
}
}
public function calculatePayment($priceI, &$total) {
if (!isset($total['brutto'])) {
return false;
}
if (isset($priceI['brutto']) &&
$priceI['brutto'] > 0) {
$total['brutto'] += $priceI['brutto'];
} else if (isset($priceI['netto']) &&
$priceI['netto'] > 0 &&
isset($priceI['tax']) && $priceI['tax'] > 0)
{
$total['brutto'] += ($priceI['netto'] +
$priceI['tax']);
}
}
}
?>
PK�"�[Y�(�����!libraries/phocacart/cart/cart.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
/*
phocacart import('phocacart.user.user');
phocacart import('phocacart.user.guestuser');
phocacart import('phocacart.shipping.shipping');
phocacart import('phocacart.payment.payment');
*/
class PhocacartCart
{
protected $items = array();
protected $fullitems = array();
protected $fullitemsgroup = array();// Group of one product: Product A
(Option A) + Product A (Option B)
protected $user = array();
protected $vendor = array();
protected $ticket = array();
protected $unit = array();
protected $section = array();
protected $loyalty_card_number = '';
protected $total = array();
/*protected $shippingid = 0;
protected $shippingcosts = 0;
protected $paymentid = 0;
protected $paymenttitle = '';
protected $paymentmethod = '';
protected $paymentcosts = 0;*/
/*protected $couponid = 0;
protected $coupontitle = '';
protected $couponamount = 0;
protected $couponfreeshipping = 0;// Does the copoun cause free
shipping
protected $couponfreepayment = 0;// Does the copoun cause free payment
protected $couponvalid = 0;// is the coupon valid - all three tests
- basic, advanced, total*/
protected $coupon = array();
protected $reward = array();
protected $cartdiscount = array();
protected $shipping = array();
protected $payment = array();
protected $stock = array();
protected $minqty = array();
protected $minmultipleqty = array();
protected $pos = false;
protected $type = array(0, 1);// 0 all, 1 online shop, 2 pos (category
type, payment method type, shipping method type)
protected $removedproducts = array(); // Products which not more exit
(or their attributes/options) are removed
// if they were not removed previously - so e.g. when making an order
// the order will be not placed by user will get error message
protected $guest = 0;
protected $instance = 1; // 1.cart 2.checkout 3.order
public function __construct() {
$app = JFactory::getApplication();
$session = JFactory::getSession();
$dUser = PhocacartUser::defineUser($this->user,
$this->vendor, $this->ticket, $this->unit, $this->section);
$this->guest = PhocacartUserGuestuser::getGuestUser();
$this->pos = PhocacartPos::isPos();
$this->coupon['id'] = 0;
$this->coupon['title'] = '';
$this->coupon['valid'] = 0;
$this->coupon['code'] = '';
$this->reward['used'] = '';
$this->cartdiscount['id'] = 0;
$this->cartdiscount['title'] = '';
$this->shipping['id'] = 0;
$this->shipping['title'] = '';
$this->shipping['method'] = '';
$this->shipping['costs'] = 0;
$this->shipping['image'] = '';
$this->payment['id'] = 0;
$this->payment['title'] = '';
$this->payment['method'] = '';
$this->payment['costs'] = 0;
$this->payment['calculation_type'] = 0;
$this->payment['image'] = '';
$this->stock['valid'] = 1;// check stock
- products, attributes (no matter if stock checking is disabled or enabled)
$this->minqty['valid'] = 1;// check
minimum order quantity
$this->minmultipleqty['valid'] = 1;// check
minimum multiple order quantity
// Admin info - Administrator asks for information about
user's cart
if ($app->getName() == 'administrator') {
$userid =
$app->input->get('userid', 0, 'int');
$vendorid =
$app->input->get('vendorid', 0, 'int');
$ticketid =
$app->input->get('ticketid', 0, 'int');
$unitid =
$app->input->get('unitid', 0, 'int');
$sectionid =
$app->input->get('sectionid', 0, 'int');
$cartDb =
PhocacartCartDb::getCartDb($userid, $vendorid, $ticketid, $unitid,
$sectionid);
$this->items = $cartDb['cart'];
$this->coupon['id'] =
$cartDb['coupon'];
$this->coupon['title'] =
$cartDb['coupontitle'];
$this->coupon['code'] =
$cartDb['couponcode'];
$this->shipping['id'] =
$cartDb['shipping'];
$this->shipping['title'] =
$cartDb['shippingtitle'];
$this->shipping['method'] =
$cartDb['shippingmethod'];
$this->shipping['image'] =
$cartDb['shippingimage'];
$this->payment['id'] =
$cartDb['payment'];
$this->payment['title'] =
$cartDb['paymenttitle'];
$this->payment['method'] =
$cartDb['paymentmethod'];
$this->payment['image'] =
$cartDb['paymentimage'];
$this->reward['used'] =
$cartDb['reward'];
$this->loyalty_card_number =
$cartDb['loyalty_card_number'];
return;
}
// POS
if ($this->pos && (int)$this->vendor->id > 0) {
$cartDb =
PhocacartCartDb::getCartDb((int)$this->user->id,
(int)$this->vendor->id, (int)$this->ticket->id,
(int)$this->unit->id, (int)$this->section->id);
$this->items = $cartDb['cart'];
$this->coupon['id'] =
$cartDb['coupon'];
$this->coupon['title'] =
$cartDb['coupontitle'];
$this->coupon['code'] =
$cartDb['couponcode'];
$this->shipping['id'] =
$cartDb['shipping'];
$this->shipping['title'] =
$cartDb['shippingtitle'];
$this->shipping['method'] =
$cartDb['shippingmethod'];
$this->shipping['image'] =
$cartDb['shippingimage'];
$this->payment['id'] =
$cartDb['payment'];
$this->payment['title'] =
$cartDb['paymenttitle'];
$this->payment['method'] =
$cartDb['paymentmethod'];
$this->payment['image'] =
$cartDb['paymentimage'];
$this->reward['used'] =
$cartDb['reward'];
$this->loyalty_card_number =
$cartDb['loyalty_card_number'];
// Don't care about session (use in session is customer,
user in pos in db is vendor)
} else if ((int)$this->user->id > 0) {
// DATABASE - logged in user - Singleton because of not load
data from database every time cart instance is loaded
// 1. Not found in DATABASE - maybe user logged in now, so:
// 2. We try to find the data in SESSION, if they are still in
SESSION - load them to our cart class and then
// 3. Store them to DATABASE as all loged in users have cart in
database and:
// 4. Remove them from SESSION as they are stored in DATABASE
$cartDb =
PhocacartCartDb::getCartDb((int)$this->user->id);// user logged in -
try to get cart from db
$this->items = $cartDb['cart'];
$this->coupon['id'] =
$cartDb['coupon'];
$this->coupon['title'] =
$cartDb['coupontitle'];
$this->coupon['code'] =
$cartDb['couponcode'];
$this->shipping['id'] =
$cartDb['shipping'];
$this->shipping['title'] =
$cartDb['shippingtitle'];
$this->shipping['method'] =
$cartDb['shippingmethod'];
$this->shipping['image'] =
$cartDb['shippingimage'];
$this->payment['id'] =
$cartDb['payment'];
$this->payment['title'] =
$cartDb['paymenttitle'];
$this->payment['method'] =
$cartDb['paymentmethod'];
$this->payment['image'] =
$cartDb['paymentimage'];
$this->reward['used'] =
$cartDb['reward'];
$this->loyalty_card_number =
$cartDb['loyalty_card_number'];
$sessionItems = $session->get('cart',
array(), 'phocaCart');
if (empty($this->items)) {
$this->items = $session->get('cart',
array(), 'phocaCart');
// COUPONMOVE - we can move the cart items to logged in
user or guest checkout, so we do with coupon
$this->coupon['id'] =
$session->get('guestcoupon', false, 'phocaCart');
if ((int)$this->coupon['id'] > 0) {
$couponInfo =
PhocacartCoupon::getCouponInfoById($this->coupon['id']);
$this->coupon['title'] =
isset($couponInfo->title) ? $couponInfo->title : '';
$this->coupon['code'] =
isset($couponInfo->code) ? $couponInfo->code : '';
}
if (!empty($this->items)) {
$this->updateItemsDb();
// Very important - clean the static variable
// because more instances of cart are loading the
static variable once
// So if the FIRST instance loaded empty cart
// and then has filled this empty cart with data from
session
// SECOND instance must load the static variables newly
because if it does not do
// then it get the same data like FIRST instance (empty
cart) But the cart
// was filled in with data from session so there will
be contradiction
// between instances (FIRST INSTANCE - EMPTY CART BUT
REFILLED BY SESSION = FULL CART, SECOND INSTANCE EMPTY CART SET BY FIRST
INSTANCE)
PhocacartCartDb::clearCartDbVariable((int)$this->user->id);
$session->set('cart', array(),
'phocaCart');
$session->set('guestcoupon', array(),
'phocaCart');// guestcoupon is variable for both: for still not
logged in user or someone who enabled guest checkout
}
} else {
// we have stored items in database from previously
// and we have stored items in session now
if (!empty($sessionItems)) {
// inform users and clean session
$message =
JText::_('COM_PHOCACART_CART_UPDATED_BASED_ON_YOUR_PREVIOUS_VISIT');
$app->enqueueMessage($message, 'message');
$session->set('cart', array(),
'phocaCart');
$session->set('guestcoupon', array(),
'phocaCart');
}
}
} else if ($this->guest) {
$this->items = $session->get('cart', array(),
'phocaCart');
$this->shipping['id'] =
$session->get('guestshipping', false, 'phocaCart');
if ((int)$this->shipping['id'] > 0) {
$shippingObject = new PhocacartShipping();
$shippingObject->setType($this->type);
$shippingInfo =
$shippingObject->getShippingMethod((int)$this->shipping['id']);
$this->shipping['title'] =
isset($shippingInfo->title) ? $shippingInfo->title : '';
$this->shipping['method'] =
isset($shippingInfo->method) ? $shippingInfo->method : '';
$this->shipping['image'] =
isset($shippingInfo->image) ? $shippingInfo->image : '';
}
$this->payment['id'] =
$session->get('guestpayment', false, 'phocaCart');
if ((int)$this->payment['id'] > 0) {
$paymentObject = new PhocacartPayment();
$paymentObject->setType($this->type);
$paymentInfo =
$paymentObject->getPaymentMethod((int)$this->payment['id']);
$this->payment['title'] =
isset($paymentInfo->title) ? $paymentInfo->title : '';
$this->payment['method'] =
isset($paymentInfo->method) ? $paymentInfo->method : '';
$this->payment['image'] =
isset($paymentInfo->image) ? $paymentInfo->image : '';
}
$this->coupon['id'] =
$session->get('guestcoupon', false, 'phocaCart');//
COUPONMOVE
if ((int)$this->coupon['id'] > 0) {
$couponInfo =
PhocacartCoupon::getCouponInfoById($this->coupon['id']);
$this->coupon['title'] =
isset($couponInfo->title) ? $couponInfo->title : '';
$this->coupon['code'] =
isset($couponInfo->code) ? $couponInfo->code : '';
}
$this->loyalty_card_number =
$session->get('guestloyaltycardnumber', false,
'phocaCart');
} else {
// SESSION - not logged in user
$this->items = $session->get('cart',
array(), 'phocaCart');
$this->coupon['id'] =
$session->get('guestcoupon', false, 'phocaCart');//
COUPONMOVE
if ((int)$this->coupon['id'] > 0) {
$couponInfo =
PhocacartCoupon::getCouponInfoById($this->coupon['id']);
$this->coupon['title'] =
isset($couponInfo->title) ? $couponInfo->title : '';
$this->coupon['code'] =
isset($couponInfo->code) ? $couponInfo->code : '';
}
}
}
/*
* 1. cart
* 2. checkout
* 3. order
*/
public function setInstance($type) {
$this->instance = (int)$type;
}
/*
* 0 all, 1 online shop, 2 pos (category type, payment method type,
shipping method type)
*/
public function setType($type = array(0, 1)) {
$this->type = $type;
}
/*
* Catid is only for information from which place the product was added
to the cart
* When making order, this will be recheck
*/
public function addItems($id = 0, $catid = 0, $quantity = 0,
$attributes = array(), $idKey = '') {
$app = JFactory::getApplication();
if ($idKey != '') {
// we get idkey as string - from checkout update or remove -
used in CHECKOUT
} else {
// we get id as int standard id of product - attributes can be
listed in form - used in CATEGORY, ITEM, ITEMS
//- $k = (int)$id . ':';
$checkP = PhocacartProduct::checkIfAccessPossible($id, $catid,
$this->type);
if (!$checkP) {
//$uri = \Joomla\CMS\Uri\Uri::getInstance();
//$action = $uri->toString();
$app->enqueueMessage(JText::_('COM_PHOCACART_PRODUCT_NOT_ADDED_TO_SHOPPING_CART_NO_RIGHTS_FOR_ORDERING_PRODUCT'),
'error');
return false;
}
// Check if there is required attribute
// In fact this should not happen in item Online Shop view, as
this should be checked per html5 checking form
// This is security check on server side - e.g. when testing
attributes in items or category view
// But in POS EAN and SKU can be added with help of Advanced
stock management so check direct adding of SKU or EAN
$checkedA = PhocacartAttribute::checkRequiredAttributes($id,
$attributes);
if (!$checkedA) {
//$uri = \Joomla\CMS\Uri\Uri::getInstance();
//$action = $uri->toString();
$app->enqueueMessage(JText::_('COM_PHOCACART_PRODUCT_NOT_ADDED_TO_SHOPPING_CART_SELECTING_ATTRIBUTE_IS_REQUIRED'),
'error');
return false;
}
/*if (!empty($attributes)) {
// Remove empty values, so items with empty values (add to
cart item view) is the same
// like item without any values (add to cart category view)
foreach($attributes as $k2 => $v2) {
if ($v2 == 0 || $v2 == '') {
unset($attributes[$k2]);
}
}
if (!empty($attributes)) {
$k .= base64_encode(serialize($attributes));
}
}
$k .= ':';*/
$k = PhocacartProduct::getProductKey($id, $attributes);
}
if ($k != '' && (int)$catid > 0) {
$this->items[$k]['catid'] = (int)$catid;
}
if ($k != '' && (int)$quantity > 0) {
if (isset($this->items[$k]['quantity']) &&
(int)$this->items[$k]['quantity'] > 0) {
$this->items[$k]['quantity'] =
$this->items[$k]['quantity'] + (int)$quantity;
} else {
$this->items[$k]['quantity'] = (int)$quantity;
}
$this->updateItems();
//$this->updateSubTotal();
return true;
} else {
$app->enqueueMessage(JText::_('COM_PHOCACART_PRODUCT_NOT_ADDED_TO_SHOPPING_CART_QUANTITY_WAS_NOT_SET'),
'error');
}
return false;
}
/*
* UPDATE - public function to update from CHECKOUT (update, remove
buttons)
*/
public function updateItemsFromCheckout($idKey = '',
$quantity = 0) {
// Don't check for quantity as it can be NULL
if ($idKey != '' && (int)$quantity > 0) {
$this->items[$idKey]['quantity'] = (int)$quantity;
$this->updateItems();
return true;
} else if ($idKey != '' && (int)$quantity == 0) {
unset($this->items[$idKey]);
$this->updateItems();
return true;
}
}
/*
* UPDATE - protected internal function to update session or database
*/
protected function updateItems() {
$session = JFactory::getSession();
if ($this->pos && (int)$this->vendor->id > 0) {
$this->updateItemsDb();
} else if ((int)$this->user->id > 0) {
$this->updateItemsDb();
$session->set('cart', array(),
'phocaCart');
} else {
$session->set('cart', $this->items,
'phocaCart');
}
$this->updateShipping();
$this->updatePayment();
}
/*
* Check if after update shipping and payment method is still valid
* If not remove it
* If set in parameter to yes, remove it even it is valid
*/
public function updateShipping() {
$paramsC =
PhocacartUtils::getComponentParameters();
$change_remove_shipping_method =
$paramsC->get('change_remove_shipping_method', 1);
$currentShippingId = isset($this->shipping['id'])
&& $this->shipping['id'] > 0 ?
(int)$this->shipping['id'] : 0;
if ($this->pos && (int)$this->vendor->id > 0) {
$typeUser = 0;
} else if ((int)$this->user->id > 0) {
$typeUser = 0;
} else {
$typeUser = 1;
}
// $change_remove_shipping_method is not a POS parameter
// In POS we don't remove shpping or payment a priori but we
always validate it
if (!$this->pos && $change_remove_shipping_method == 1)
{
PhocacartShipping::removeShipping($typeUser);
return;
}
if (!isset($this->total[0])) {
$this->total[0] = array();
}
$isValidShipping = false;
$shippingObject = new PhocacartShipping();
$shippingObject->setType($this->type);
if ($currentShippingId > 0) {
$isValidShipping =
$shippingObject->checkAndGetShippingMethod((int)$currentShippingId,
$this->total[0]);
}
if (!$isValidShipping) {
PhocacartShipping::removeShipping($typeUser);
}
}
public function updatePayment($shippingId = 0) {
$paramsC =
PhocacartUtils::getComponentParameters();
$change_remove_payment_method =
$paramsC->get('change_remove_payment_method', 1);
$removeCoupon = 0;
if ((int)$shippingId > 0) {
// When we store shipping into database and immediately asking
shipping id from database, we get empty result
// this is why we need to know shipping ID here
$currentShippingId = (int)$shippingId;
} else {
$currentShippingId = isset($this->shipping['id'])
&& $this->shipping['id'] > 0 ?
(int)$this->shipping['id'] : 0;
}
$currentPaymentId = isset($this->payment['id'])
&& $this->payment['id'] > 0 ?
(int)$this->payment['id'] : 0;
if ($this->pos && (int)$this->vendor->id > 0) {
$typeUser = 0;
} else if ((int)$this->user->id > 0) {
$typeUser = 0;
} else {
$typeUser = 1;
}
// $change_remove_payment_method is not a POS parameter
// In POS we don't remove shpping or payment a priori but we
always validate it
if (!$this->pos && $change_remove_payment_method == 1) {
PhocacartPayment::removePayment($typeUser, $removeCoupon);
return;
}
if (!isset($this->total[0])) {
$this->total[0] = array();
}
$isValidPayment = false;
$paymentObject = new PhocacartPayment();
$paymentObject->setType($this->type);
if ($currentPaymentId > 0) {
$isValidPayment =
$paymentObject->checkAndGetPaymentMethod((int)$currentPaymentId,
$this->total[0], (int)$currentShippingId);
}
if (!$isValidPayment) {
PhocacartPayment::removePayment($typeUser, $removeCoupon);
}
}
/*
* UPDATE - protected internal function to update only database
*/
protected function updateItemsDb() {
$db = JFactory::getDBO();
$items = serialize($this->items);
$date = JFactory::getDate();
$now = $date->toSql();
// Update multiple cart (include vendor, ticket)
$query = ' SELECT user_id, vendor_id, ticket_id, unit_id,
section_id FROM #__phocacart_cart_multiple'
. ' WHERE user_id = ' . (int)$this->user->id
. ' AND vendor_id = ' . (int)$this->vendor->id
. ' AND ticket_id = ' . (int)$this->ticket->id
. ' AND unit_id = ' . (int)$this->unit->id
. ' AND section_id = ' .
(int)$this->section->id
. ' ORDER BY user_id LIMIT 1';
$db->setQuery($query);
$result = $db->loadRow();
if (!empty($result)) {
$query = 'UPDATE #__phocacart_cart_multiple'
. ' SET cart = ' . $db->quote($items) .
','
. ' coupon = ' .
(int)$this->coupon['id'] . ',' // COUPONMOVE
. ' date = ' . $db->quote($now)
. ' WHERE user_id = ' .
(int)$this->user->id
. ' AND vendor_id = ' .
(int)$this->vendor->id
. ' AND ticket_id = ' .
(int)$this->ticket->id
. ' AND unit_id = ' . (int)$this->unit->id
. ' AND section_id = ' .
(int)$this->section->id;
$db->setQuery($query);
$db->execute();
} else {
if ((int)$this->user->id == 0 &&
(int)$this->vendor->id == 0) {
// Not possible now
// guests do not store cart to database
// if userid == 0: 1) guest (not possible) 2) vendor uses
pos (vendor must be > 0)
// if vendorid == 0: 1) standard eshop - userid must be
> 0)
// ticket can be always zero
} else {
// COUPONMOVE
$query = 'INSERT INTO #__phocacart_cart_multiple
(user_id, vendor_id, ticket_id, unit_id, section_id, cart, coupon,
date)'
. ' VALUES (' . (int)$this->user->id .
', ' . (int)$this->vendor->id . ', ' .
(int)$this->ticket->id . ', ' . (int)$this->unit->id
. ', ' . (int)$this->section->id . ', ' .
$db->quote($items) . ', ' .
(int)$this->coupon['id'] . ', ' .
$db->quote($now) . ');';
$db->setQuery($query);
$db->execute();
}
}
// Update single cart (no vendor, no ticket)
/*$query = 'INSERT INTO #__phocacart_cart (user_id, cart,
date)'
.' VALUES ('.(int)$this->user->id.',
'.$db->quote($items).',
'.$db->quote($now).')'
.' ON DUPLICATE KEY UPDATE cart = VALUES (cart), date
= VALUES (date)';
$db->setQuery($query);
$db->execute();*/
return true;
}
/*
public function getItems() {
return $this->items;
}
public function updateSubTotal() {}
*/
/*
* Set full items - items in cart, total(netto, tax, brutto), coupon,
* We need to set it first, to count e.g. coupon
* After counting all possible factors (items, count of items, netto,
taxes, brutto, coupon, shipping)
* we can render the cart (for example, free shipping by coupon needs
to be set at the end as we check total netto amount)
*/
public function setFullItems() {
// posible to do fullitems[1];
if (empty($this->fullitems)) {
if (!empty($this->items)) {
$app = JFactory::getApplication();
$paramsC =
PhocacartUtils::getComponentParameters();
$tax_calculation =
$paramsC->get('tax_calculation', 0);
$check_product_attributes =
$paramsC->get('check_product_attributes', array(3));
$price = new PhocacartPrice();
$calc = new PhocacartCartCalculation();
$calc->setType($this->type);
// CHECK ACCESS OF ALL ITEMS IN CART, CHECK IF ATTRIBUTES
STILL EXIST
// (e.g. when someone open his/her cart after product
changes were made
foreach ($this->items as $k => $v) {
$item = explode(':', $k);
$itemId = $item[0];
// CHECK PRODUCT
$checkP =
PhocacartProduct::checkIfAccessPossible((int)$itemId,
(int)$v['catid'], $this->type);
if (!$checkP) {
if ($app->getName() ==
'administrator') {
$app->enqueueMessage(
JText::_('COM_PHOCACART_ERROR_PRODUCT_STORED_IN_CUSTOMER_CART_NOT_EXISTS')
. ' '
.
JText::_('COM_PHOCACART_ERROR_PRODUCT_REMOVED_FROM_CUSTOMER_CART')
. ' '
.
JText::_('COM_PHOCACART_CUSTOMER_WILL_BE_INFORMED_OF_SITUATION_DURING_NEXT_VISIT_TO_STORE'),
'warning');
} else {
$app->enqueueMessage(
JText::_('COM_PHOCACART_ERROR_PRODUCT_STORED_IN_CART_NOT_EXISTS')
. ' '
.
JText::_('COM_PHOCACART_ERROR_PRODUCT_REMOVED_FROM_CART') .
' '
.
JText::_('COM_PHOCACART_PLEASE_RECHECK_PRODUCTS_IN_YOUR_CART'),
'error');
}
unset($this->items[$k]);
$this->updateItemsFromCheckout($k, 0);
// In case this all happens when order is made -
stop the order and inform user
$this->updateProductsRemoved($k);
} else {
// Product access is OK - product still in cart,
check the attributes and options
// ATTRIBUTE AND OPTIONS CHECK
// Check if attributes and options of stored
products in cart are available (no change between ordering)
// Takes a lot of resources, so it will be checked
when making an order as default ($check_product_attributes = 3)
// ATTRIBUTES
if (in_array($this->instance,
$check_product_attributes)) {
$attribs = array();
if (!empty($item[1])) {
$attribs =
unserialize(base64_decode($item[1]));
}
$checkA =
PhocacartProduct::checkIfProductAttributesOptionsExist((int)$itemId, $k,
(int)$v['catid'], $this->type, $attribs);
if (!$checkA) {
$app->enqueueMessage(
JText::_('COM_PHOCACART_ERROR_ATTRIBUTE_OF_PRODUCT_STORED_IN_CART_NOT_EXISTS')
. ' '
.
JText::_('COM_PHOCACART_ERROR_PRODUCT_REMOVED_FROM_CART') .
' '
.
JText::_('COM_PHOCACART_PLEASE_RECHECK_PRODUCTS_IN_YOUR_CART'),
'error');
unset($this->items[$k]);
$this->updateItemsFromCheckout($k, 0);
// In case this all happens when order is
made - stop the order and inform user
$this->updateProductsRemoved($k);
}
}
}
}
if (empty($this->items)) {
return false;
}
// END ACCESS
// --------------------
// 1) Basic Calculation
// --------------------
$calc->calculateBasicProducts($this->fullitems[1],
$this->fullitemsgroup[1], $this->total[1], $this->stock,
$this->minqty, $this->minmultipleqty, $this->items);
//$calc->round($this->total[1]);
// Fixed subtotal amount
$this->total[1]['subtotalnetto'] =
$this->total[1]['netto'];
$this->total[1]['subtotalbrutto'] =
$this->total[1]['brutto'];
$this->fullitems[0] = $this->fullitems[4] =
$this->fullitems[3] = $this->fullitems[2]
= $this->fullitems[5] = $this->fullitems[1];
$this->fullitemsgroup[0] = $this->fullitemsgroup[4] =
$this->fullitemsgroup[3] = $this->fullitemsgroup[2]
= $this->fullitemsgroup[5] =
$this->fullitemsgroup[1];
$this->total[0] = $this->total[4] =
$this->total[3] = $this->total[2]
= $this->total[5] = $this->total[1];
// --------------------
// 5) Reward Points
// --------------------
$calc->calculateRewardDiscounts($this->fullitems[5],
$this->fullitemsgroup[5], $this->total[5], $this->reward);
$this->fullitems[0] = $this->fullitems[4] =
$this->fullitems[3] = $this->fullitems[2]
= $this->fullitems[5];
$this->fullitemsgroup[0] = $this->fullitemsgroup[4] =
$this->fullitemsgroup[3] = $this->fullitemsgroup[2]
= $this->fullitemsgroup[5];
$this->total[0] = $this->total[4] =
$this->total[3] = $this->total[2]
= $this->total[5];
// Subtotal after 2) Discount
$this->total[5]['dnetto'] =
$this->total[1]['netto'] -
$this->total[5]['netto'];
$this->total[5]['dbrutto'] =
$this->total[1]['brutto'] -
$this->total[5]['brutto'];
// --------------------
// 2) Product Discount
// --------------------
$calc->calculateProductDiscounts($this->fullitems[2],
$this->fullitemsgroup[2], $this->total[2]);
//$calc->round($this->total[2]);
$this->fullitems[0] = $this->fullitems[4] =
$this->fullitems[3] = $this->fullitems[2];
$this->fullitemsgroup[0] = $this->fullitemsgroup[4] =
$this->fullitemsgroup[3] = $this->fullitemsgroup[2];
$this->total[0] = $this->total[4] =
$this->total[3] = $this->total[2];
// Subtotal after 2) Discount
$this->total[2]['dnetto'] =
$this->total[5]['netto'] -
$this->total[2]['netto'];
$this->total[2]['dbrutto'] =
$this->total[5]['brutto'] -
$this->total[2]['brutto'];
// --------------------
// 3) Cart Discount
// --------------------
$calc->calculateCartDiscounts($this->fullitems[3],
$this->fullitemsgroup[3], $this->total[3], $this->cartdiscount);
// 3b) Cart Discount - we need to divide fixed amount
discount into products which meets the rules to get each discount
if
(!empty($this->total[3]['discountcartfixedamount'])) {
$calc->recalculateCartDiscounts($this->fullitems[3],
$this->fullitemsgroup[3], $this->total[3]);
}
$this->fullitems[0] = $this->fullitems[4] =
$this->fullitems[3];
$this->fullitemsgroup[0] = $this->fullitemsgroup[4] =
$this->fullitemsgroup[3];
$this->total[0] = $this->total[4] =
$this->total[3];
// Subtotal after 3) Discount
$this->total[3]['dnetto'] =
$this->total[2]['netto'] -
$this->total[3]['netto'];
$this->total[3]['dbrutto'] =
$this->total[2]['brutto'] -
$this->total[3]['brutto'];
$calc->roundFixedAmountDiscount($this->total[3]);//
Last because now we know the dnetto
// --------------------
// 4) Cart Coupon
// --------------------
$calc->calculateCartCoupons($this->fullitems[4],
$this->fullitemsgroup[4], $this->total[4], $this->coupon);
// 4b) Cart Coupon - we need to divide fixed amount coupon
into products which meets the rules to get each coupon
if
(!empty($this->total[4]['couponcartfixedamount'])) {
$calc->recalculateCartCoupons($this->fullitems[4],
$this->fullitemsgroup[4], $this->total[4]);
}
$this->fullitems[0] = $this->fullitems[4];
$this->fullitemsgroup[0] = $this->fullitemsgroup[4];
$this->total[0] = $this->total[4];
// Subtotal after 4) Coupon
$this->total[4]['dnetto'] =
$this->total[3]['netto'] -
$this->total[4]['netto'];
$this->total[4]['dbrutto'] =
$this->total[3]['brutto'] -
$this->total[4]['brutto'];
$calc->roundFixedAmountCoupon($this->total[4]);
//Subtotal after all discounts
$this->total[0]['wdnetto'] =
$this->total[1]['netto'] -
$this->total[5]['dnetto'] -
$this->total[2]['dnetto'] -
$this->total[3]['dnetto'] -
$this->total[4]['dnetto'];
//$this->total[0]['subtotalafterdiscounts'] =
$this->total[0]['netto'] -
$this->total[5]['dnetto'] -
$this->total[2]['dnetto'] -
$this->total[3]['dnetto'] -
$this->total[4]['dnetto'];
//$calc->taxRecapitulation($this->total[0]);
/*foreach($this->fullitems[0] as $k => $v) {
$item = explode(':', $k);
$attribs = unserialize(base64_decode($item[1]));
}*/
// TOTAL still not ready
// + Shipping addShippingCosts()
// + Payment addPaymentCosts()
if ($this->coupon['code'] != ''
&& $this->coupon['valid'] === 0) {
// coupon is not valid and will be not counted
// but it was added to database so remove it from db
// E.g. user added a coupon when not logged in (e.g.
he/she was in group "default"
// then he/she was logged in and after log in the
coupon was still here but e.g.
// the user changed its group to
"otherthandefault" and coupon does not meet rules
// it will be not counted in calculation but even we
can remove it from db
// Remove it from database
$this->removeCouponDb();
// And after removing it and using the ide in instance
- remove the instance
$this->coupon['id'] = 0;
$this->coupon['title'] = '';
$this->coupon['code'] = '';
}
}
}
}
/**
* This is a final cart function
* It is called roundTotalAmount() because of backward compatibility
* but is the place to do last checks in cart
*
*/
public function roundTotalAmount() {
$calc = new PhocacartCartCalculation();
$calc->setType($this->type);
$this->shipping['costs'] =
isset($this->shipping['costs']) ?
$this->shipping['costs'] : 0;
$this->payment['costs'] =
isset($this->payment['costs']) ?
$this->payment['costs'] : 0;
// 1) CORRECT TOTAL ITEMS (Rounding), CORRECT CURRENCY TOTAL ITEMS
(Rounding for each item)
$calc->correctTotalItems($this->total,
$this->shipping['costs'],
$this->payment['costs']);
// 2) MAKE TAX RECAPITULATION and correct total by tax
recapitulation if asked
$calc->taxRecapitulation($this->total[0],
$this->shipping['costs'],
$this->payment['costs']);
// 3) CORRECT TOTAL ITEMS (Rounding), CORRECT CURRENCY TOTAL ITEMS
(Rounding for each item) - AGAIN WHEN TOTAL CHANGED BY TAX RECAPITULATION
$options = array();
$options['brutto_currency_set'] = 1; // Brutto currency
exists yet, so don't create it again from "brutto *
currencyRating"
$calc->correctTotalItems($this->total,
$this->shipping['costs'],
$this->payment['costs'], $options);
// 4) ROUND TOTAL AMOUNT IF ASKED (e.g. 95.67 => 96)
$calc->roundTotalAmount($this->total[0]);
// ROUNDING VS: TRCROUNDING
// NETTO (Payment,Shipping incl. Tax) Rounding Brutto
// Rounding TC: 1370.79 + 25.94 + 0.14 = 1396,87
// Rounding: 1370.83 + 25.94 + 0.10 = 1396,87
// 0.14 - 0.10 = 0.04
// 1370.79 + 0.10 + 0.04 + 25.94 = 1396,87
}
public function getTaxRecapitulation() {
if (!empty($this->total[0]['taxrecapitulation'])) {
return $this->total[0]['taxrecapitulation'];
}
return false;
}
public function getTotal() {
$items = array('netto', 'brutto',
'quantity', 'weight', 'length',
'width', 'height');
foreach ($items as $k => $v) {
if (!isset($this->total[0][$v])) {
$this->total[0][$v] = 0;
}
}
return $this->total;
}
public function getItems() {
return $this->items;
}
public function getFullItems() {
return $this->fullitems;
}
public function getCoupon() {
$coupon = array();
$coupon['title'] = $this->coupon['title'];
$coupon['id'] = $this->coupon['id'];
// E.g. guest checkout
if (isset($coupon['id']) &&
(int)$coupon['id'] > 0 && $coupon['title']
== '') {
$cI =
PhocacartCoupon::getCouponTitleById((int)$coupon['id']);
if (isset($cI->title)) {
$coupon['title'] = $cI->title;
}
}
return $coupon;
}
public function getPaymentMethod() {
$payment = array();
$payment['title'] =
$this->payment['title'];
$payment['method'] =
$this->payment['method'];
$payment['id'] = $this->payment['id'];
$payment['image'] =
$this->payment['image'];
// E.g. guest checkout
if (isset($payment['id']) &&
(int)$payment['id'] > 0 && $payment['title']
== '' && $payment['method'] == '') {
$paymentObject = new PhocacartPayment();
$paymentObject->setType($this->type);
$pI =
$paymentObject->getPaymentMethod((int)$payment['id']);
if (isset($pI->title)) {
$payment['title'] = $pI->title;
}
if (isset($pI->method)) {
$payment['method'] = $pI->method;
}
if (isset($pI->image)) {
$payment['image'] = $pI->image;
}
}
return $payment;
}
public function getShippingMethod() {
$shipping = array();
$shipping['title'] =
$this->shipping['title'];
$shipping['method'] =
$this->shipping['method'];
$shipping['id'] = $this->shipping['id'];
$shipping['image'] =
$this->shipping['image'];
// E.g. guest checkout
if (isset($shipping['id']) &&
(int)$shipping['id'] > 0 &&
$shipping['title'] == '' &&
$shipping['method'] == '') {
$shippingObject = new PhocacartShipping();
$shippingObject->setType($this->type);
$sI =
$shippingObject->getShippingMethod((int)$shipping['id']);
if (isset($sI->title)) {
$shipping['title'] = $sI->title;
}
if (isset($sI->method)) {
$shipping['method'] = $sI->method;
}
if (isset($sI->image)) {
$shipping['image'] = $sI->image;
}
}
return $shipping;
}
public function getShippingId() {
return $this->shipping['id'];
}
public function getPaymentId() {
return $this->payment['id'];
}
public function getCouponTitle() {
return $this->coupon['title'];
}
public function getCouponCode() {
return $this->coupon['code'];
}
public function getCartDiscountTitle() {
return $this->cartdiscount['title'];
}
public function getCartDiscountId() {
return $this->cartdiscount['id'];
}
public function getCouponValid() {
return $this->coupon['valid'];
}
public function getShippingCosts() {
return isset($this->shipping['costs']) ?
$this->shipping['costs'] : false;
}
public function getPaymentCosts() {
return isset($this->payment['costs']) ?
$this->payment['costs'] : false;
}
public function getStockValid() {
return $this->stock['valid'];
}
public function getMinimumQuantityValid() {
return $this->minqty['valid'];
}
public function getMinimumMultipleQuantityValid() {
return $this->minmultipleqty['valid'];
}
public function getRewardPointsNeeded() {
return isset($this->total[0]['points_needed']) ?
$this->total[0]['points_needed'] : 0;
}
public function getRewardPointsReceived() {
return sset($this->total[0]['points_received']) ?
$this->total[0]['points_received'] : 0;
}
public function getRewardPointsUsed() {
return $this->reward['used'];
}
public function getProductsRemoved() {
return $this->removedproducts;
}
public function updateProductsRemoved($k) {
$this->removedproducts[] = $k;
}
public function getVendorId() {
if (isset($this->vendor->id) &&
(int)$this->vendor->id > 0) {
return $this->vendor->id;
} else {
return 0;
}
}
public function getTicketId() {
if (isset($this->ticket->id) &&
(int)$this->ticket->id > 0) {
return $this->ticket->id;
} else {
return 0;
}
}
public function getUnitId() {
if (isset($this->unit->id) &&
(int)$this->unit->id > 0) {
return $this->unit->id;
} else {
return 0;
}
}
public function getSectionId() {
if (isset($this->section->id) &&
(int)$this->section->id > 0) {
return $this->section->id;
} else {
return 0;
}
}
public function getLoyaltyCartNumber() {
return $this->loyalty_card_number;
}
public function addShippingCosts($shippingId = 0, $paymentId = 0) {
//$app = JFactory::getApplication();
if ($shippingId == 0) {
$shippingId = $this->shipping['id'];
}
$shippingObject = new PhocacartShipping();
$shippingObject->setType($this->type);
$sI = $shippingObject->getShippingMethod((int)$shippingId);
if (!isset($this->total[0])) {
$this->total[0] = array();
}
$shippingValid =
$shippingObject->checkAndGetShippingMethod((int)$shippingId,
$this->total[0]);
if (!$shippingValid) {
PhocacartShipping::removeShipping();// In case user has in cart
shipping method which does not exists
// Wait for payment costs
//PhocacartPayment::removePayment();// It does not remove
payment immediately (but after reload) or when ordering (order tests the
conditions)
//$app->enqueueMessage(JText::_('COM_PHOCACART_NO_SHIPPING_METHOD_FOUND'));
unset($sI);
}
if (!empty($sI)) {
$sI->freeshipping = 0;
if (isset($this->total[0]['free_shipping'])
&& $this->total[0]['free_shipping'] == 1) {
$sI->freeshipping = 1;
}
$price = new PhocacartPrice();
$priceI = $price->getPriceItemsShipping($sI->cost,
$sI->cost_additional, $sI->calculation_type, $this->total[0],
$sI->taxid, $sI->taxrate, $sI->taxcalculationtype,
$sI->taxtitle, $sI->freeshipping, 1);
// CALCULATION
$calc = new PhocacartCartCalculation();
$calc->setType($this->type);
$this->shipping['costs'] = $priceI;
if (!isset($this->total[0]['free_shipping']) ||
(isset($this->total[0]['free_shipping']) &&
$this->total[0]['free_shipping'] != 1)) {
$this->shipping['costs']['id']
= $sI->id;
$this->shipping['costs']['title']
= $sI->title;
$this->shipping['costs']['title_lang'] =
$sI->title;
$this->shipping['costs']['title_lang_suffix'] =
'';
$this->shipping['costs']['title_lang_suffix2'] =
'';
$this->shipping['costs']['description'] =
$sI->description;
$this->shipping['costs']['image']
= $sI->image;
$this->shipping['costs']['method']
= $sI->method;
// Update even the shipping info
$this->shipping['id'] = $sI->id;
$this->shipping['title'] = $sI->title;
$this->shipping['method'] = $sI->method;
$this->shipping['image'] = $sI->image;
}
$calc->calculateShipping($priceI, $this->total[0]);
//$calc->round($this->total[0], 0);
}
}
public function addPaymentCosts($paymentId = 0) {
if ($paymentId == 0) {
$paymentId = $this->payment['id'];
}
$paymentObject = new PhocacartPayment();
$paymentObject->setType($this->type);
$pI = $paymentObject->getPaymentMethod((int)$paymentId);
$shippingId = 0;
if (isset($this->shipping['id']) &&
(int)$this->shipping['id'] > 0) {
$shippingId = $this->shipping['id'];
} else if
(isset($this->shipping['costs']['id']) &&
(int)$this->shipping['costs']['id'] > 0) {
$shippingId =
$this->shipping['costs']['id'];
}
if (!isset($this->total[0])) {
$this->total[0] = array();
}
$paymentValid =
$paymentObject->checkAndGetPaymentMethod((int)$paymentId,
$this->total[0], $shippingId);
if (!$paymentValid) {
PhocacartPayment::removePayment();// In case user has in cart
payment method which does not exists
// Remove Shipping and Payment when updated
unset($pI);
}
if (!empty($pI)) {
$pI->freepayment = 0;
if (isset($this->total[0]['free_payment'])
&& $this->total[0]['free_payment'] == 1) {
$pI->freepayment = 1;
}
$price = new PhocacartPrice();
$priceI = $price->getPriceItemsPayment($pI->cost,
$pI->cost_additional, $pI->calculation_type, $this->total[0],
$pI->taxid, $pI->taxrate, $pI->taxcalculationtype,
$pI->taxtitle, $pI->freepayment, 1);
// CALCULATION
$calc = new PhocacartCartCalculation();
$calc->setType($this->type);
$this->payment['costs'] = $priceI;
if (!isset($this->total[0]['free_payment']) ||
(isset($this->total[0]['free_payment']) &&
$this->total[0]['free_payment'] != 1)) {
$this->payment['costs']['id']
= $pI->id;
$this->payment['costs']['title']
= $pI->title;
$this->payment['costs']['title_lang'] =
$pI->title;
$this->payment['costs']['title_lang_suffix'] =
'';
$this->payment['costs']['title_lang_suffix2'] =
'';
$this->payment['costs']['description'] =
$pI->description;
$this->payment['costs']['image']
= $pI->image;
$this->payment['costs']['method']
= $pI->method;
// Update even the payment info
$this->payment['id'] = $pI->id;
$this->payment['title'] = $pI->title;
$this->payment['method'] = $pI->method;
$this->payment['image'] = $pI->image;
}
$calc->calculatePayment($priceI, $this->total[0]);
//$calc->round($this->total[0], 0);
}
}
public function emptyCart() {
$session = JFactory::getSession();
$session->set('cart', array(), 'phocaCart');
//if((int)$this->user->id > 0) {
// this function to empty cart database is not use in POS, so
always set ticketid, unitid and sectionid to 1
//PhocacartCartDb::emptyCartDb((int)$this->user->id);
//}
PhocacartCartDb::emptyCartDb((int)$this->user->id,
(int)$this->vendor->id, (int)$this->ticket->id,
(int)$this->unit->id, (int)$this->section->id);
}
public function getCartCountItems() {
if (empty($this->fullitems)) {
$this->fullitems = $this->getFullItems();// get them from
parent
}
$count = 0;
if (!empty($this->fullitems[0])) {
foreach ($this->fullitems[0] as $k => $v) {
if (isset($v['quantity']) &&
(int)$v['quantity'] > 0) {
$count += (int)$v['quantity'];
}
}
}
return $count;
}
public function getCartTotalItems() {
// SUBTOTAL
if (empty($this->total)) {
$this->total = $this->getTotal();
}
// COUPONTITLE
if (empty($this->coupontitle)) {
$this->coupon['title'] =
$this->getCouponTitle();
}
return $this->total;
}
public function removeCouponDb() {
$db = JFactory::getDBO();
$date = JFactory::getDate();
$now = $date->toSql();
$query = 'UPDATE #__phocacart_cart_multiple'
. ' SET coupon = ' .
(int)$this->coupon['id'] . ', '
. ' date = ' . $db->quote($now)
. ' WHERE user_id = ' . (int)$this->user->id
. ' AND vendor_id = ' . (int)$this->vendor->id
. ' AND ticket_id = ' . (int)$this->ticket->id
. ' AND unit_id = ' . (int)$this->unit->id
. ' AND section_id = ' .
(int)$this->section->id;
$db->setQuery($query);
$db->execute();
return true;
}
}
?>
PK�"�[��Klibraries/phocacart/cart/db.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class PhocacartCartDb
{
private static $cart = array();
private function __construct(){}
public static function clearCartDbVariable($userId, $vendorId = 0,
$ticketId = 0, $unitId = 0, $sectionId = 0) {
unset(self::$cart[$userId][$vendorId][$ticketId][$unitId][$sectionId]);
}
public static function getCartDb($userId, $vendorId = 0, $ticketId = 0,
$unitId = 0, $sectionId = 0) {
if(!isset(self::$cart[$userId][$vendorId][$ticketId][$unitId][$sectionId])){
$db = JFactory::getDBO();
$query = ' SELECT c.cart, c.shipping, c.payment, c.coupon,
c.reward, c.loyalty_card_number,'
.' s.title as shippingtitle, s.method as shippingmethod, s.image
as shippingimage, p.title as paymenttitle, p.method as paymentmethod,
p.image as paymentimage,'
.' co.title as coupontitle, co.code as couponcode'
.' FROM #__phocacart_cart_multiple AS c'
.' LEFT JOIN #__phocacart_shipping_methods AS s ON c.shipping =
s.id'
.' LEFT JOIN #__phocacart_payment_methods AS p ON c.payment =
p.id'
.' LEFT JOIN #__phocacart_coupons AS co ON c.coupon = co.id'
.' WHERE c.user_id = '.(int)$userId
.' AND c.vendor_id = '.(int)$vendorId
.' AND c.ticket_id = '.(int)$ticketId
.' AND c.unit_id = '.(int)$unitId
.' AND c.section_id = '.(int)$sectionId
.' ORDER BY c.cart';
$db->setQuery($query);
$cartDb = $db->loadAssoc();
if (!empty($cartDb) && isset($cartDb['cart'])
&& $cartDb['cart'] != '') {
$cartDb['cart'] = unserialize($cartDb['cart']);
self::$cart[$userId][$vendorId][$ticketId][$unitId][$sectionId] =
$cartDb;
} else {
$pos_payment_force = 0;
$pos_shipping_force = 0;
if (PhocacartPos::isPos()) {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$pos_payment_force = $paramsC->get( 'pos_payment_force',
0 );
$pos_shipping_force = $paramsC->get(
'pos_shipping_force', 0 );
if ((int)$pos_payment_force > 0) {
$pos_payment_force =
PhocacartPayment::isPaymentMethodActive($pos_payment_force) === true ?
(int)$pos_payment_force : 0;
}
if ((int)$pos_shipping_force > 0) {
$pos_shipping_force =
PhocacartShipping::isShippingMethodActive($pos_shipping_force) === true ?
(int)$pos_shipping_force : 0;
}
}
$cartDb['cart'] = array();
$cartDb['shipping'] = $pos_shipping_force;
$cartDb['payment'] = $pos_payment_force;
$cartDb['coupon'] = 0;
$cartDb['discount'] = array();
$cartDb['shippingtitle'] = '';
$cartDb['shippingmethod'] = '';
$cartDb['shippingimage'] = '';
$cartDb['paymenttitle'] = '';
$cartDb['paymentmethod'] = '';
$cartDb['paymentimage'] = '';
$cartDb['coupontitle'] = '';
$cartDb['couponcode'] = '';
$cartDb['reward'] = '';
$cartDb['loyalty_card_number'] = '';
self::$cart[$userId][$vendorId][$ticketId][$unitId][$sectionId] =
$cartDb;
}
}
return self::$cart[$userId][$vendorId][$ticketId][$unitId][$sectionId];
}
public static function emptyCartDb($userId, $vendorId = 0, $ticketId = 0,
$unitId = 0, $sectionId = 0) {
self::$cart = false;
$db = JFactory::getDBO();
$query = ' DELETE FROM #__phocacart_cart_multiple'
.' WHERE user_id = '.(int)$userId
.' AND vendor_id = '.(int)$vendorId
.' AND ticket_id = '.(int)$ticketId
.' AND unit_id = '.(int)$unitId
.' AND section_id = '.(int)$sectionId;
$db->setQuery($query);
$db->execute();
return true;
}
public final function __clone() {
throw new Exception('Function Error: Cannot clone instance of
Singleton pattern', 500);
return false;
}
}
?>
PK�"�[�#o,,#libraries/phocacart/cart/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��=@
'libraries/phocacart/cart/rendercart.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
/*
phocacart import('phocacart.cart.cart');
phocacart import('phocacart.price.price');
*/
class PhocacartCartRendercart extends PhocacartCart
{
protected $fullitems;
protected $total;
public $params;
public function __construct() {
$this->setInstance(1);//cart
parent::__construct();
}
public function render() {
$pC = PhocacartUtils::getComponentParameters();
$s = PhocacartRenderStyle::getStyles();
if (empty($this->fullitems)) {
$this->fullitems = $this->getFullItems();// get them from parent
}
if (!empty($this->fullitems)) {
// SUBTOTAL
if (empty($this->total)) {
$this->total = $this->getTotal();
}
// COUPONTITLE
if (empty($this->coupon['title'])) {
$this->coupon['title'] = $this->getCouponTitle();
}
}
// Final Brutto
/* if ($this->total['brutto']) {
$this->total['fbrutto'] =
$this->total['brutto'];
if ($this->couponvalid) {
$this->total['fbrutto'] =
$this->total['brutto'] - $this->total['cbrutto'];
}
}*/
$app = JFactory::getApplication();
$d = array();
$d['s'] = $s;
if($app->isClient('administrator')) {
// client = 0, ask phoca cart frontend layouts
$d['client'] = 1;//admin
$layout = new JLayoutFile('cart_cart', null,
array('component' => 'com_phocacart',
'client' => 0));
} else {
$d['client'] = 0;//frontend
$layout = new JLayoutFile('cart_cart', null,
array('component' => 'com_phocacart'));
}
$d['paramsmodule'] = $this->params; // Module Parameters
$d['params'] = $pC; // Component Parameters
$d['fullitems'] = $this->fullitems;
$d['total'] = $this->total;
$d['fullitemsgroup'] = $this->fullitemsgroup;
$d['coupontitle'] = $this->coupon['title'];
$d['couponvalid'] = $this->coupon['valid'];
$d['shippingcosts'] = $this->shipping['costs'];
$d['paymentcosts'] = $this->payment['costs'];
$d['countitems'] = $this->getCartCountItems();
//$d['action'] = $url['action'];
//$d['actionbase64'] = $url['actionbase64'];
//$d['linkcheckout'] = $url['linkcheckout'];
$d['pathitem'] =
PhocacartPath::getPath('productimage');
return $layout->render($d);
}
}
?>
PK�"�[+�?�
�
+libraries/phocacart/cart/rendercheckout.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartCartRendercheckout extends PhocacartCart
{
protected $fullitems;
protected $total;
public $params;
public function __construct() {
$this->setInstance(2);//checkout
parent::__construct();
}
public function render() {
$app = JFactory::getApplication();
$s = PhocacartRenderStyle::getStyles();
$pC = PhocacartUtils::getComponentParameters();
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$url['action'] = $uri->toString();
$url['actionbase64'] = base64_encode($url['action']);
$pos = PhocacartPos::isPos();
if ($pos) {
$url['linkcheckout'] =
JRoute::_(PhocacartRoute::getPosRoute());
} else {
$url['linkcheckout'] =
JRoute::_(PhocacartRoute::getCheckoutRoute());
}
if (empty($this->fullitems)) {
$this->fullitems = $this->getFullItems();// get them from parent
// SUBTOTAL
if (empty($this->total)) {
$this->total = $this->getTotal();
}
// COUPONTITLE
if (empty($this->coupon['title'])) {
$this->coupon['title'] = $this->getCouponTitle();
}
}
$layout = new JLayoutFile('cart_checkout', null,
array('component' => 'com_phocacart'));
$d = array();
$d['s'] = $s;
/*if($app->isClient('administrator')) {
// client = 0, ask phoca cart frontend layouts
$d['client'] = 1;//admin
$layout = new JLayoutFile('cart_cart', null,
array('component' => 'com_phocacart',
'client' => 0));
} else {
$d['client'] = 0;//frontend
$layout = new JLayoutFile('cart_cart', null,
array('component' => 'com_phocacart'));
}*/
$d['params'] = $pC;
$d['fullitems'] = $this->fullitems;
$d['total'] = $this->total;
$d['fullitemsgroup'] = $this->fullitemsgroup;
$d['coupontitle'] = $this->coupon['title'];
$d['couponvalid'] = $this->coupon['valid'];
$d['shippingcosts'] = $this->shipping['costs'];
$d['paymentcosts'] = $this->payment['costs'];
$d['action'] = $url['action'];
$d['actionbase64'] = $url['actionbase64'];
$d['linkcheckout'] = $url['linkcheckout'];
$d['pathitem'] =
PhocacartPath::getPath('productimage');
$d['pos'] = $this->pos;
$d['ticketid'] = (int)$this->ticket->id;
$d['unitid'] = (int)$this->unit->id;
$d['sectionid'] = (int)$this->section->id;
return $layout->render($d);
}
}
?>
PK�"�[4U7O�:�:)libraries/phocacart/category/category.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
jimport('joomla.application.component.model');
final class PhocacartCategory
{
private static $categoryA = array();
private static $categoryF = array();
private static $categoryP = array();
private static $categoryI = array();
public function __construct() {}
public static function CategoryTreeOption($data, $tree, $id=0,
$text='', $currentId = 0) {
foreach ($data as $key) {
$show_text = $text . $key->text;
if ($key->parentid == $id && $currentId != $id &&
$currentId != $key->value) {
$tree[$key->value] = new JObject();
$tree[$key->value]->text = $show_text;
$tree[$key->value]->value = $key->value;
$tree = self::CategoryTreeOption($data, $tree, $key->value,
$show_text . " - ", $currentId );
}
}
return($tree);
}
public static function filterCategory($query, $active = NULL, $frontend =
NULL, $onChange = TRUE, $fullTree = NULL ) {
$db = JFactory::getDBO();
$form = 'adminForm';
if ($frontend == 1) {
$form = 'phocacartproductsform';
}
if ($onChange) {
$onChO = 'class="inputbox" size="1"
onchange="document.'.$form.'.submit( );"';
} else {
$onChO = 'class="inputbox" size="1"';
}
$categories[] = Joomla\CMS\HTML\HTMLHelper::_('select.option',
'0', '-
'.JText::_('COM_PHOCACART_SELECT_CATEGORY').' -');
$db->setQuery($query);
$catData = $db->loadObjectList();
if ($fullTree) {
// Start - remove in case there is a memory problem
$tree = array();
$text = '';
$queryAll = ' SELECT cc.id AS value, cc.title AS text, cc.parent_id
as parentid'
.' FROM #__phocacart_categories AS cc'
.' ORDER BY cc.ordering';
$db->setQuery($queryAll);
$catDataAll = $db->loadObjectList();
$catDataTree = PhocacartCategory::CategoryTreeOption($catDataAll, $tree,
0, $text, -1);
$catDataTreeRights = array();
/*foreach ($catData as $k => $v) {
foreach ($catDataTree as $k2 => $v2) {
if ($v->value == $v2->value) {
$catDataTreeRights[$k]->text = $v2->text;
$catDataTreeRights[$k]->value = $v2->value;
}
}
}*/
foreach ($catDataTree as $k => $v) {
foreach ($catData as $k2 => $v2) {
if ($v->value == $v2->value) {
$catDataTreeRights[$k] = new StdClass();
$catDataTreeRights[$k]->text = $v->text;
$catDataTreeRights[$k]->value = $v->value;
}
}
}
$catDataTree = array();
$catDataTree = $catDataTreeRights;
// End - remove in case there is a memory problem
// Uncomment in case there is a memory problem
//$catDataTree = $catData;
} else {
$catDataTree = $catData;
}
$categories = array_merge($categories, $catDataTree );
$category = Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$categories, 'catid', $onChO, 'value',
'text', $active);
return $category;
}
public static function options($type = 0)
{
$db = JFactory::getDBO();
//build the list of categories
$query = 'SELECT a.title AS text, a.id AS value, a.parent_id as
parentid'
. ' FROM #__phocacart_categories AS a'
. ' WHERE a.published = 1'
. ' ORDER BY a.ordering';
$db->setQuery( $query );
$items = $db->loadObjectList();
$catId = -1;
$javascript = 'class="inputbox" size="1"
onchange="submitform( );"';
$tree = array();
$text = '';
$tree = PhocacartCategory::CategoryTreeOption($items, $tree, 0, $text,
$catId);
return $tree;
}
public static function getCategoryById($id) {
$id = (int)$id;
if( empty(self::$categoryI[$id])) {
$db = JFactory::getDBO();
$query = 'SELECT a.title, a.alias, a.id, a.parent_id'
. ' FROM #__phocacart_categories AS a'
. ' WHERE a.id = '.(int)$id
. ' ORDER BY a.ordering'
. ' LIMIT 1';
$db->setQuery( $query );
self::$categoryI[$id] = $db->loadObject();
}
return self::$categoryI[$id];
}
public static function getChildren($id) {
$db = JFactory::getDBO();
$query = 'SELECT a.title, a.alias, a.id'
. ' FROM #__phocacart_categories AS a'
. ' WHERE a.parent_id = '.(int)$id
. ' ORDER BY a.ordering';
$db->setQuery( $query );
$categories = $db->loadObjectList();
return $categories;
}
public static function getPath($path = array(), $id = 0, $parent_id = 0,
$title = '', $alias = '') {
if( empty(self::$categoryA[$id])) {
self::$categoryP[$id] = self::getPathTree($path, $id, $parent_id,
$title, $alias);
}
return self::$categoryP[$id];
}
public static function getPathTree($path = array(), $id = 0, $parent_id =
0, $title = '', $alias = '') {
static $iCT = 0;
if ((int)$id > 0) {
$path[$iCT]['id'] = (int)$id;
$path[$iCT]['catid'] = (int)$parent_id;
$path[$iCT]['title'] = $title;
$path[$iCT]['alias'] = $alias;
}
if ((int)$parent_id > 0) {
$db = JFactory::getDBO();
$query = 'SELECT a.title, a.alias, a.id, a.parent_id'
. ' FROM #__phocacart_categories AS a'
. ' WHERE a.id = '.(int)$parent_id
. ' ORDER BY a.ordering';
$db->setQuery( $query );
$category = $db->loadObject();
if (isset($category->id)) {
$id = (int)$category->id;
$title = '';
if (isset($category->title)) {
$title = $category->title;
}
$alias = '';
if (isset($category->alias)) {
$alias = $category->alias;
}
$parent_id = 0;
if (isset($category->parent_id)) {
$parent_id = (int)$category->parent_id;
}
$iCT++;
$path = self::getPathTree($path, (int)$id, (int)$parent_id, $title,
$alias);
}
}
return $path;
}
public static function categoryTree($d, $r = 0, $pk =
'parent_id', $k = 'id', $c = 'children') {
$m = array();
foreach ($d as $e) {
isset($m[$e[$pk]]) ?: $m[$e[$pk]] = array();
isset($m[$e[$k]]) ?: $m[$e[$k]] = array();
$m[$e[$pk]][] = array_merge($e, array($c => &$m[$e[$k]]));
}
//return $m[$r][0]; // remove [0] if there could be more than one root
nodes
if (isset($m[$r])) {
return $m[$r];
}
return 0;
}
public static function nestedToUl($data, $currentCatid = 0) {
$result = array();
if (!empty($data) && count($data) > 0) {
$result[] = '<ul>';
foreach ($data as $k => $v) {
$link =
JRoute::_(PhocacartRoute::getCategoryRoute($v['id'],
$v['alias']));
// Current Category is selected
if ($currentCatid == $v['id']) {
$result[] = sprintf(
'<li
data-jstree=\'{"opened":true,"selected":true}\'
>%s%s</li>',
'<a href="'.$link.'">' .
$v['title']. '</a>',
self::nestedToUl($v['children'], $currentCatid)
);
} else {
$result[] = sprintf(
'<li>%s%s</li>',
'<a href="'.$link.'">' .
$v['title']. '</a>',
self::nestedToUl($v['children'], $currentCatid)
);
}
}
$result[] = '</ul>';
}
return implode("\n", $result);
}
public static function nestedToCheckBox($data, $d, $currentCatid = 0,
&$active = 0, $forceCategoryId = 0) {
$result = array();
if (!empty($data) && count($data) > 0) {
$result[] = '<ul
class="ph-filter-module-category-tree">';
foreach ($data as $k => $v) {
$checked = '';
$value = htmlspecialchars($v['alias']);
if (isset($d['nrinalias']) &&
$d['nrinalias'] == 1) {
$value = (int)$v['id'] .'-'.
htmlspecialchars($v['alias']);
}
if (in_array($value, $d['getparams'])) {
$checked = 'checked';
$active = 1;
}
// This only can happen in category view (category filters are empty,
id of category is larger then zero)
// This is only marking the category as active in category list
if (empty($d['getparams']) ||
(isset($d['getparams'][0]) &&
$d['getparams'][0] == '')) {
// Empty parameters, so we can set category id by id of category view
if ($forceCategoryId > 0 && (int)$forceCategoryId ==
(int)$v['id']) {
$checked = 'checked';
$active = 1;
}
}
$count = '';
// If we are in item view - one category is selected but if user click
on filter to select other category, this one should be still selected - we
go to items view with 2 selected
// because force category is on
if (isset($v['count_products']) &&
isset($d['params']['display_category_count'])
&& $d['params']['display_category_count'] == 1
) {
$count = ' <span
class="ph-filter-count">'.(int)$v['count_products'].'</span>';
}
$icon = '';
if ($v['icon_class'] != '') {
$icon = '<span class="' .
PhocacartText::filterValue($v['icon_class'], 'text') .
' ph-filter-item-icon"></span> ';
}
$jsSet = '';
if (isset($d['forcecategory']['idalias'])
&& $d['forcecategory']['idalias'] !=
'') {
// Category View - force the category parameter if set in parameters
$jsSet .= 'phChangeFilter(\'c\',
\''.$d['forcecategory']['idalias'].'\',
1, \'text\', 0, 1, 1);'; // ADD IS FIXED ( use
"text" as formType - it cannot by managed by checkbox, it is
fixed - always 1 - does not depends on checkbox, it is fixed 1
}
$jsSet .=
'phChangeFilter(\''.$d['param'].'\',
\''. $value.'\', this,
\''.$d['formtype'].'\',\''.$d['uniquevalue'].'\',
0, 1);';// ADD OR REMOVE
$result[] = '<li><div
class="checkbox">';
$result[] = '<label
class="ph-checkbox-container"><input
type="checkbox" name="tag"
value="'.$value.'" '.$checked.'
onchange="'.$jsSet.'" />'. $icon .
$v['title'].$count.'<span
class="ph-checkbox-checkmark"></span></label>';
$result[] = '</div></li>';
$result[] = self::nestedToCheckBox($v['children'], $d,
$currentCatid, $active);
}
$result[] = '</ul>';
}
return implode("\n", $result);
}
public static function getCategoryTreeFormat($ordering = 1, $display =
'', $hide = '', $type = array(0,1), $lang =
'') {
$cis = str_replace(',', '', 'o'.$ordering
.'d'. $display .'h'. $hide. 'l'. $lang);
if( empty(self::$categoryF[$cis])) {
/* phocacart import('phocacart.ordering.ordering');*/
$itemOrdering = PhocacartOrdering::getOrderingText($ordering,1);
$db = JFactory::getDBO();
$wheres = array();
$user = PhocacartUser::getUser();
$userLevels = implode (',',
$user->getAuthorisedViewLevels());
$userGroups = implode (',',
PhocacartGroup::getGroupsById($user->id, 1, 1));
$wheres[] = " c.access IN (".$userLevels.")";
$wheres[] = " (gc.group_id IN (".$userGroups.") OR
gc.group_id IS NULL)";
$wheres[] = " c.published = 1";
if ($lang != '' && $lang != '*') {
$wheres[] =
PhocacartUtilsSettings::getLangQuery('c.language', $lang);
}
if (!empty($type) && is_array($type)) {
$wheres[] = " c.type IN (".implode(',',
$type).")";
}
if ($display != '') {
$wheres[] = " c.id IN (".$display.")";
}
if ($hide != '') {
$wheres[] = " c.id NOT IN (".$hide.")";
}
$columns = 'c.id, c.title, c.alias, c.parent_id';
$groupsFull = $columns;
$groupsFast = 'c.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
$query = 'SELECT c.id, c.title, c.alias, c.parent_id'
. ' FROM #__phocacart_categories AS c'
. ' LEFT JOIN #__phocacart_item_groups AS gc ON c.id = gc.item_id
AND gc.type = 2'// type 2 is category
. ' WHERE ' . implode( ' AND ', $wheres )
. ' GROUP BY '.$groups
. ' ORDER BY '.$itemOrdering;
$db->setQuery( $query );
$items = $db->loadAssocList();
$tree = self::categoryTree($items);
$currentCatid = self::getActiveCategoryId();
self::$categoryF[$cis] = self::nestedToUl($tree, $currentCatid);
}
return self::$categoryF[$cis];
}
public static function getCategoryTreeArray($ordering = 1, $display =
'', $hide = '', $type = array(0,1), $lang =
'', $limitCount = -1) {
$cis = str_replace(',', '', 'o'.$ordering
.'d'. $display .'h'. $hide . 'l'. $lang .
'c'.$limitCount);
if( empty(self::$categoryA[$cis])) {
/*phocacart import('phocacart.ordering.ordering');*/
$itemOrdering = PhocacartOrdering::getOrderingText($ordering,1);
$db = JFactory::getDBO();
$wheres = array();
$user = PhocacartUser::getUser();
$userLevels = implode (',',
$user->getAuthorisedViewLevels());
$userGroups = implode (',',
PhocacartGroup::getGroupsById($user->id, 1, 1));
$wheres[] = " c.access IN (".$userLevels.")";
$wheres[] = " (gc.group_id IN (".$userGroups.") OR
gc.group_id IS NULL)";
$wheres[] = " c.published = 1";
if ($lang != '' && $lang != '*') {
$wheres[] =
PhocacartUtilsSettings::getLangQuery('c.language', $lang);
}
if (!empty($type) && is_array($type)) {
$wheres[] = " c.type IN (".implode(',',
$type).")";
}
if ($display != '') {
$wheres[] = " c.id IN (".$display.")";
}
if ($hide != '') {
$wheres[] = " c.id NOT IN (".$hide.")";
}
if ((int)$limitCount > -1) {
$wheres[] = " c.count_products > ".(int)$limitCount;
}
$query = 'SELECT c.id, c.title, c.alias, c.parent_id, c.icon_class,
c.image, c.description, c.count_products'
. ' FROM #__phocacart_categories AS c'
. ' LEFT JOIN #__phocacart_item_groups AS gc ON c.id = gc.item_id
AND gc.type = 2'// type 2 is category
. ' WHERE ' . implode( ' AND ', $wheres )
. ' ORDER BY '.$itemOrdering;
$db->setQuery( $query );
$items = $db->loadAssocList();
self::$categoryA[$cis] = self::categoryTree($items);
}
return self::$categoryA[$cis];
}
public static function getActiveCategoryId() {
$app = JFactory::getApplication();
$option = $app->input->get( 'option', '',
'string' );
$view = $app->input->get( 'view', '',
'string' );
$catid = $app->input->get( 'catid', '',
'int' ); // ID in items view is category id
$id = $app->input->get( 'id', '',
'int' );
if ($option == 'com_phocacart' && ($view ==
'items' || $view == 'category')) {
if ((int)$id > 0) {
return $id;
}
}
if ($option == 'com_phocacart' && $view ==
'item') {
if ((int)$catid > 0) {
return $catid;
}
}
return 0;
}
public static function getActiveCategories($items, $ordering) {
$db = JFactory::getDbo();
$o = array();
$wheres = array();
$ordering = PhocacartOrdering::getOrderingText($ordering, 1);//c
if ($items != '') {
$wheres[] = 'c.id IN (' . $items . ')';
$q = 'SELECT DISTINCT c.title, CONCAT(c.id, \'-\',
c.alias) AS alias, \'c\' AS parameteralias,
\'category\' AS parametertitle FROM #__phocacart_categories AS
c'
. (!empty($wheres) ? ' WHERE ' . implode(' AND ',
$wheres) : '')
. ' GROUP BY c.alias, c.title'
. ' ORDER BY ' . $ordering;
$db->setQuery($q);
$o = $db->loadAssocList();
}
return $o;
}
public final function __clone() {
throw new Exception('Function Error: Cannot clone instance of
Singleton pattern', 500);
return false;
}
}
?>
PK�"�[�#o,,'libraries/phocacart/category/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�5�2727)libraries/phocacart/category/multiple.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartCategoryMultiple
{
public static function getCategories($productId, $select = 0) {
$db = JFactory::getDBO();
if ($select == 1) {
$query = 'SELECT c.category_id';
} else if ($select == 2) {
$query = 'SELECT a.id AS value, a.title AS text';
} else if ($select == 3) {
$query = 'SELECT a.id, a.title, a.alias';
} else {
$query = 'SELECT a.*';
}
$query .= ' FROM #__phocacart_categories AS a'
.' LEFT JOIN #__phocacart_product_categories AS c ON a.id =
c.category_id'
.' WHERE c.product_id = '.(int)$productId;
$db->setQuery($query);
if ($select == 1) {
$tags = $db->loadColumn();
} else {
$tags = $db->loadObjectList();
}
return $tags;
}
public static function getCategoriesByIds($cids) {
$db = JFactory::getDBO();
if ($cids != '') {//cids is string separated by comma
$query = 'SELECT c.category_id FROM
#__phocacart_categories AS a'
//.' LEFT JOIN #__phocacart AS f ON f.id =
r.item_id'
. ' LEFT JOIN #__phocacart_product_categories AS c ON
a.id = c.category_id'
. ' WHERE c.product_id IN (' . $cids .
')'
. ' ORDER BY a.id';
$db->setQuery($query);
$tags = $db->loadColumn();
$tags = array_unique($tags);
return $tags;
}
return array();
}
public static function getAllCategories($filter = 0, $type = array(0,1)) {
$db = JFactory::getDBO();
$user = PhocacartUser::getUser();
$userLevels = implode (',',
$user->getAuthorisedViewLevels());
$userGroups = implode (',',
PhocacartGroup::getGroupsById($user->id, 1, 1));
$wheres = array();
if ($filter == 1) {
// POS FILTER
$paramsC = PhocacartUtils::getComponentParameters();
$pos_categories = $paramsC->get( 'pos_categories',
array(-1) );
if (in_array(-1, $pos_categories)) {
// All categories selected
$whereCat = '';
} else if (in_array(0, $pos_categories)) {
// No category selected
return false;
} else {
// Only some selected
$wheres[] = ' c.id IN ('.implode(',',
$pos_categories).')';
}
}
$wheres[] = " c.access IN (".$userLevels.")";
$wheres[] = " (gc.group_id IN (".$userGroups.") OR
gc.group_id IS NULL)";
$wheres[] = " c.published = 1";
if (!empty($type) && is_array($type)) {
$wheres[] = " c.type IN (".implode(',',
$type).")";
}
$columns = 'c.id, c.title, c.alias, c.parent_id';
$groupsFull = $columns;
$groupsFast = 'c.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
$query = 'SELECT c.id, c.title, c.alias'
. ' FROM #__phocacart_categories AS c'
. ' LEFT JOIN #__phocacart_item_groups AS gc ON c.id = gc.item_id
AND gc.type = 2'// type 2 is category
. ' WHERE ' . implode( ' AND ', $wheres )
. ' GROUP BY '.$groups;
$db->setQuery($query);
$categories = $db->loadObjectList();
return $categories;
}
public static function deleteCategoriesFromProduct($categoryArray,
$productId) {
$db = JFactory::getDBO();
if (!empty($categoryArray)) {
foreach($categoryArray as $k => $v) {
$query = ' DELETE '
.' FROM #__phocacart_product_categories'
. ' WHERE product_id = '. (int)$productId
. ' AND category_id = '. (int)$v;
$db->setQuery($query);
$db->execute();
}
}
return true;
}
public static function storeCategories($storeArray, $productId,
$categoryOrdering = array()) {
if ((int)$productId > 0) {
$db = JFactory::getDBO();
/*$query = ' DELETE '
.' FROM #__phocacart_product_categories'
. ' WHERE product_id = '. (int)$productId;
$db->setQuery($query);
$db->execute();*/
// Select stored categories for this ID
$query = 'SELECT a.category_id'
.' FROM #__phocacart_product_categories AS a'
.' WHERE a.product_id = '.(int)$productId.' ORDER BY
a.product_id';
$db->setQuery($query);
$storedArray = $db->loadColumn();
// ----------------------------------------------------------
// Check if some category, or parent category is unpublished
$storeString = implode(',',
array_unique(array_map('intval', $storeArray)));
$q = ' WITH RECURSIVE cte (id, title, parent_id,
published) AS ('
.' SELECT id, title, parent_id, published FROM
#__phocacart_categories'
.' WHERE id IN ('.$storeString.')'
.' UNION ALL SELECT p.id, p.title, p.parent_id,
p.published'
.' FROM #__phocacart_categories AS p'
.' INNER JOIN cte ON p.id = cte.parent_id'
.' )'
.' SELECT * FROM cte WHERE published = 0;';
try {
$db->setQuery($q);
$unpublishedCats = $db->loadAssocList('id');//
with assoc list the categories will be unique
if (!empty($unpublishedCats)) {
$count = count($unpublishedCats);
if ($count > 1) {
$msg =
JText::_('COM_PHOCACART_BE_AWARE_FOLLOWING_SELECTED_CATEGORIES_OR_THEIR_PARENT_CATEGORIES_ARE_NOT_PUBLISHED')
. ': ';
} else {
$msg =
JText::_('COM_PHOCACART_BE_AWARE_FOLLOWING_SELECTED_CATEGORY_OR_ITS_PARENT_CATEGORY_IS_NOT_PUBLISHED').
': ';
}
$msg .= '<ul>';
foreach ($unpublishedCats as $k => $v) {
$msg .= '<li><b>' .
$v['title'] . '</b></li>';
}
$msg .= '</ul>';
JFactory::getApplication()->enqueueMessage($msg,
'warning');
}
} catch (RuntimeException $e) {
// No error, because this is just additional info
//JFactory::getApplication()->enqueueMessage('PROBABLY WITH
RECURSIVE IS NOT SUPPORTED', 'warning');
}
// ----------------------------------------------------------
$store = array_diff($storeArray,$storedArray);// we only store
categories which are not stored yet by this product id
$delete = array_diff($storedArray, $storeArray);// category is stored in
db but we removed it in administration so it is
// not more selected for this product and we need to remove
it
if (!empty($delete)) {
foreach($delete as $k => $v) {
$query = ' DELETE '
.' FROM #__phocacart_product_categories'
. ' WHERE product_id = '. (int)$productId
. ' AND category_id = '. (int)$v;
$db->setQuery($query);
$db->execute();
}
}
if (!empty($store)) {
$values = array();
$valuesString = '';
$store = array_unique($store);
foreach($store as $k => $v) {
$v = (int)$v;
if (isset($categoryOrdering[$v]) && $categoryOrdering[$v] >
0) {
// Import/Export function - we store the ordering
// if for example all product items are exported to empty database
// stay with stored ordering
$o = $categoryOrdering[$v];
} else {
// New row added
$o = self::getNextOrder((int)$productId, $v);
}
$values[] = ' ('.(int)$productId.', '.$v.',
'.(int)$o.')';
}
if (!empty($values)) {
$valuesString = implode(',', $values);
$query = ' INSERT INTO #__phocacart_product_categories
(product_id, category_id, ordering)'
.' VALUES '.(string)$valuesString;
$db->setQuery($query);
$db->execute();
}
}
}
}
public static function getNextOrder($pId, $cId) {
$db = JFactory::getDBO();
$where = 'category_id ='.(int)$cId;
$query = $db->getQuery(true)
->select('MAX(ordering)')
->from('#__phocacart_product_categories')
->where($where);
$db->setQuery($query);
$max = (int)$db->loadResult();
return ($max + 1);
}
public static function getCategoriesByProducts($productsA) {
$productsS = '';
$categories = '';
if (!empty($productsA)) {
$productsS = implode(',', $productsA);
$db = JFactory::getDBO();
$query = ' SELECT pc.product_id, c.id, c.alias, c.title FROM
#__phocacart_categories AS c'
.' LEFT JOIN #__phocacart_product_categories AS pc ON c.id =
pc.category_id'
.' WHERE pc.product_id IN ('.$productsS.')';
$db->setQuery($query);
$categories = $db->loadAssocList();
}
return $categories;
}
public static function getAllCategoriesByProduct($productId) {
$db = JFactory::getDBO();
// Select stored categories for this ID
$query = 'SELECT a.category_id'
.' FROM #__phocacart_product_categories AS a'
.' WHERE a.product_id = '.(int)$productId.' ORDER BY
a.product_id';
$db->setQuery($query);
$storedArray = $db->loadColumn();
return $storedArray;
}
/*
* index.php?option=com_phocacart&task=phocacartitem.removeduplicates
*
public static function removeDuplicates() {
$db = JFactory::getDBO();
$query = ' ALTER IGNORE TABLE '
.' #__phocacart_product_categories'
. ' ADD UNIQUE INDEX idx_category (product_id, category_id);';
$db->setQuery($query);
$db->execute();
return true;
} */
/*
* Try to find best category of the produt to build SEF
* (e.g. if we are in category 5 and product is included in category 5,
select this category)
* We can get it per sql with help of group_concat
*/
public static function setCurrentCategory($items) {
$app = JFactory::getApplication();
$catid = $app->input->get('catid', 0, 'int');
if (!empty($items) && (int)$catid > 0) {
foreach ($items as $k => $v) {
if ($v->categories != '') {
$c = explode(',', $v->categories);
if (!empty($c)) {
foreach($c as $k2 => $v2) {
$c2 = explode('|', $v2);
if (isset($c2[0]) && (int)$c2[0] == (int)$catid) {
$items[$k]->catid = $c2[0];
$items[$k]->catalias = '';
if (isset($c2[1])) {
$items[$k]->catalias = $c2[1];
}
$items[$k]->cattitle = '';
break;
}
}
}
}
}
}
return $items;
}
public static function getCategoryByProduct($id, $catid) {
$db = JFactory::getDBO();
$query =
' SELECT c.id AS catid, c.title AS cattitle, c.alias AS
catalias'
.' FROM #__phocacart_categories AS c'
.' LEFT JOIN #__phocacart_product_categories AS pc ON c.id =
pc.category_id'
.' WHERE pc.product_id = '.(int)$id.' AND c.id =
'.(int)$catid
.' ORDER BY c.id'
.' LIMIT 1';
$db->setQuery($query);
$categories = $db->loadAssoc();
return $categories;
}
public static function setBestMatchCategory(&$items, $categories,
$object = 0) {
if (!empty($items)) {
if ($object) {
foreach ($items as $k => &$v) {
if (isset($v->count_categories) &&
(int)$v->count_categories > 1) {
$catid = explode(',', $v->catid);
$id = (int)$v->id;
$catid = (int)$catid[0];
if (isset($categories[$id]['catid']) &&
isset($catid) && (int)$categories[$id]['catid'] ==
$catid){
continue;
}
// Try to find better category
if (isset($categories[$id]['catid']) &&
isset($id)){
$newItems = self::getCategoryByProduct($id,
$categories[$id]['catid']);
if (isset($newItems['catid']) &&
isset($newItems['cattitle']) &&
isset($newItems['catalias'])) {
$v->catid = $newItems['catid'];
$v->cattitle = $newItems['cattitle'];
$v->catalias = $newItems['catalias'];
}
}
}
}
} else {
foreach ($items as $k => &$v) {
if (isset($v['count_categories']) &&
(int)$v['count_categories'] > 1) {
$id = (int)$v['id'];
$catid = (int)$v['catid'];
if (isset($categories[$id]['catid']) &&
isset($catid) && (int)$categories[$id]['catid'] ==
$catid){
continue;
}
// Try to find better category
if (isset($categories[$id]['catid']) &&
isset($id)){
$newItems = self::getCategoryByProduct($id,
$categories[$id]['catid']);
if (isset($newItems['catid']) &&
isset($newItems['cattitle']) &&
isset($newItems['catalias'])) {
$v['catid'] = $newItems['catid'];
$v['cattitle'] = $newItems['cattitle'];
$v['catalias'] = $newItems['catalias'];
}
}
}
}
}
}
return $items;
}
public static function getCurrentCategoryId() {
$app = JFactory::getApplication();
$id = $app->input->get('id', 0, 'int');
$catid = $app->input->get('catid', 0, 'int');
$view = $app->input->get('view', '',
'string');
$option = $app->input->get('option', '',
'string');
if ($option == 'com_phocacart' && $view ==
'category') {
return $id;
} else if ($option == 'com_phocacart' && $view ==
'item') {
return $catid;
}
return 0;
}
public static function getCategoryChildrenString($id, $children =
'') {
$db = JFactory::getDBO();
$query = "SELECT id FROM #__phocacart_categories WHERE
parent_id = ".(int)$id;
$db->setQuery($query);
$categories = $db->loadColumn();
if (!empty($categories)) {
foreach ($categories as $k => $v) {
if ($children != '') {
$children .= ',';
}
$children .= $v;
$children = self::getCategoryChildrenString($v, $children);
}
}
return $children;
}
public static function getCategoryChildrenArray($id) {
$db = JFactory::getDBO();
$query = "SELECT id FROM #__phocacart_categories WHERE
parent_id = ".(int)$id;
$db->setQuery($query);
$categories = $db->loadColumn();
$children = array();
if (!empty($categories)) {
foreach ($categories as $k => $v) {
$children[$v] = self::getCategoryChildrenArray($v);
}
}
return $children;
}
}
PK�"�[���
'libraries/phocacart/compare/compare.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartCompare
{
protected $items = array();
public function __construct() {
$session = JFactory::getSession();
$app = JFactory::getApplication();
$this->items = $session->get('compare', array(),
'phocaCart');
}
public function addItem($id = 0, $catid = 0) {
if ($id > 0) {
$app = JFactory::getApplication();
$count = count($this->items);
if ($count > 2) {
$message =
JText::_('COM_PHOCACART_ONLY_THREE_PRODUCTS_CAN_BE_LISTED_IN_COMPARISON_LIST');
$app->enqueueMessage($message, 'error');
return false;
}
if(isset($this->items[$id]) && (int)$this->items[$id] >
0) {
$message =
JText::_('COM_PHOCACART_PRODUCT_INCLUDED_IN_COMPARISON_LIST');
$app->enqueueMessage($message, 'error');
return false;
} else {
$this->items[$id]['id'] = $id;
$this->items[$id]['catid'] = $catid;
$session = JFactory::getSession();
$session->set('compare', $this->items,
'phocaCart');
}
return true;
}
return false;
}
public function removeItem($id = 0) {
if ($id > 0) {
if(isset($this->items[$id]) && (int)$this->items[$id] >
0) {
unset($this->items[$id]);
$session = JFactory::getSession();
$session->set('compare', $this->items,
'phocaCart');
return true;
} else {
return false;
}
return false;
}
return false;
}
public function emptyCompare() {
$session = JFactory::getSession();
$session->set('compare', array(), 'phocaCart');
}
public function getItems() {
return $this->items;
}
public function getQueryList($items, $full = 0){
$user = PhocacartUser::getUser();
$userLevels = implode (',',
$user->getAuthorisedViewLevels());
$userGroups = implode (',',
PhocacartGroup::getGroupsById($user->id, 1, 1));
$itemsS = $this->getItemsIdString($items);
if ($itemsS == '') {
return false;
}
$wheres[] = 'a.id IN ('.(string)$itemsS.')';
$wheres[] = " c.access IN (".$userLevels.")";
$wheres[] = " a.access IN (".$userLevels.")";
$wheres[] = " (ga.group_id IN (".$userGroups.") OR
ga.group_id IS NULL)";
$wheres[] = " (gc.group_id IN (".$userGroups.") OR
gc.group_id IS NULL)";
$wheres[] = " c.published = 1";
$wheres[] = " a.published = 1";
$wheres[] = " c.type IN (0,1)";// compare only works in online
shop (0 - all, 1 - online shop, 2 - pos)
$where = ( count( $wheres ) ? ' WHERE '. implode( ' AND
', $wheres ) : '' );
if ($full == 1) {
$columns =
'a.id as id, a.title as title, a.alias as alias, a.description,
a.price, a.image, a.type,'
.' GROUP_CONCAT(DISTINCT c.id) as catid, GROUP_CONCAT(DISTINCT
c.alias) as catalias, GROUP_CONCAT(DISTINCT c.title) as cattitle,
COUNT(pc.category_id) AS count_categories,'
.' a.length, a.width, a.height, a.weight, a.volume, a.unit_amount,
a.unit_unit, a.price_original,'
.' a.stock, a.min_quantity, a.min_multiple_quantity,
a.stockstatus_a_id, a.stockstatus_n_id, a.availability,'
.' a.gift_types,'
.' m.title as manufacturer_title,'
.' t.id as taxid, t.tax_rate as taxrate, t.title as taxtitle,
t.calculation_type as taxcalculationtype,'
.' MIN(ppg.price) as group_price, MAX(pptg.points_received) as
group_points_received';
$groupsFull =
'a.id, a.title, a.alias, a.description, a.price, a.image,
a.type,'
.' a.length, a.width, a.height, a.weight, a.volume,'
.' a.stock, a.min_quantity, a.min_multiple_quantity,
a.stockstatus_a_id, a.stockstatus_n_id, a.availability,'
.' a.gift_types,'
.' m.title,'
.' ppg.price, pptg.points_received';
$groupsFast = 'a.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
$query =
' SELECT '.$columns
.' FROM #__phocacart_products AS a'
.' LEFT JOIN #__phocacart_product_categories AS pc ON pc.product_id
= a.id'
.' LEFT JOIN #__phocacart_categories AS c ON c.id =
pc.category_id'
.' LEFT JOIN #__phocacart_taxes AS t ON t.id = a.tax_id'
.' LEFT JOIN #__phocacart_manufacturers AS m ON a.manufacturer_id =
m.id'
.' LEFT JOIN #__phocacart_item_groups AS ga ON a.id = ga.item_id
AND ga.type = 3'// type 3 is product
.' LEFT JOIN #__phocacart_item_groups AS gc ON c.id = gc.item_id
AND gc.type = 2'// type 2 is category
// user is in more groups, select lowest price by best group
. ' LEFT JOIN #__phocacart_product_price_groups AS ppg ON a.id =
ppg.product_id AND ppg.group_id IN (SELECT group_id FROM
#__phocacart_item_groups WHERE item_id = a.id AND group_id IN
('.$userGroups.') AND type = 3)'
// user is in more groups, select highest points by best group
. ' LEFT JOIN #__phocacart_product_point_groups AS pptg ON a.id =
pptg.product_id AND pptg.group_id IN (SELECT group_id FROM
#__phocacart_item_groups WHERE item_id = a.id AND group_id IN
('.$userGroups.') AND type = 3)'
. $where
. ' GROUP BY '.$groups
. ' ORDER BY a.id';
} else {
$columns =
'a.id as id, a.title as title, a.alias as alias,'
.' GROUP_CONCAT(DISTINCT c.id) as catid, GROUP_CONCAT(DISTINCT
c.alias) as catalias, GROUP_CONCAT(DISTINCT c.title) as cattitle,
COUNT(pc.category_id) AS count_categories';
$groupsFull = 'a.id, a.title, a.alias';
$groupsFast = 'a.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
$query =
' SELECT '.$columns
.' FROM #__phocacart_products AS a'
.' LEFT JOIN #__phocacart_product_categories AS pc ON pc.product_id
= a.id'
.' LEFT JOIN #__phocacart_categories AS c ON c.id =
pc.category_id'
.' LEFT JOIN #__phocacart_item_groups AS ga ON a.id = ga.item_id
AND ga.type = 3'// type 3 is product
.' LEFT JOIN #__phocacart_item_groups AS gc ON c.id = gc.item_id
AND gc.type = 2'// type 2 is category
. $where
.' GROUP BY '.$groups
.' ORDER BY a.id';
}
return $query;
}
public function getItemsIdString($items) {
$itemsR = '';
if (!empty($items)) {
$itemsA = array();
foreach($items as $k => $v) {
if (isset($v['id']) && (int)$v['id'] >
0) {
$itemsA[] = $v['id'];
}
}
$itemsR = implode (',', $itemsA);
}
if ($itemsR == '') {
return false;
}
return $itemsR;
}
public function renderList() {
$db = JFactory::getDBO();
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$action = $uri->toString();
$app = JFactory::getApplication();
$s = PhocacartRenderStyle::getStyles();
$paramsC = PhocacartUtils::getComponentParameters();
$add_compare_method = $paramsC->get( 'add_compare_method', 0
);
$query = $this->getQueryList($this->items);
$d = array();
$d['s'] = $s;
if ($query) {
//echo nl2br(str_replace('#__', 'jos_', $query));
$db->setQuery($query);
$d['compare'] = $db->loadObjectList();
PhocacartCategoryMultiple::setBestMatchCategory($d['compare'],
$this->items, 1);// returned by reference
}
$d['actionbase64'] = base64_encode($action);
$d['linkcomparison'] =
JRoute::_(PhocacartRoute::getComparisonRoute());
$d['method'] = $add_compare_method;
$layoutC = new JLayoutFile('list_compare', null,
array('component' => 'com_phocacart'));
echo $layoutC->render($d);
}
public function getFullItems() {
$db = JFactory::getDBO();
$query = $this->getQueryList($this->items, 1);
$products = array();
if ($query) {
$db->setQuery($query);
$products = $db->loadAssocList();
PhocacartCategoryMultiple::setBestMatchCategory($products,
$this->items);// returned by reference
}
return $products;
}
public function getComapareCountItems() {
return count($this->items);
}
}
?>
PK�"�[�#o,,&libraries/phocacart/compare/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[>c&���#libraries/phocacart/count/count.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartCount
{
public static function setProductCount($cid, $type = '',
$skipMessage = 0) {
$db = JFactory::getDBO();
$app = JFactory::getApplication();
$successA = array();
$errorA = array();
if ($type == '') { return false;}
if (!empty($cid)) {
foreach ($cid as $k => $v) {
$date = JFactory::getDate();
$now = $date->toSql();
switch($type) {
case 'category':
$q = ' SELECT count(a.id)'
. ' FROM #__phocacart_products AS a'
. ' LEFT JOIN #__phocacart_product_categories
AS pc ON a.id = pc.product_id'
. ' WHERE a.published AND pc.category_id =
'.(int)$v;
$db->setQuery($q);
$items = $db->loadResult();
$q2 = 'UPDATE #__phocacart_categories SET
count_products = '.(int)$items.', count_date =
'.$db->quote($now) . ' WHERE id = '.(int)$v;
$db->setQuery($q2);
break;
case 'tag':
$q0 = 'SELECT type FROM #__phocacart_tags
WHERE id = '.(int)$v;// Apply only for tags, not for labels
$db->setQuery($q0);
$type0 = $db->loadResult();
if ($type0 == 0) {
$q = ' SELECT count(a.id)'
. ' FROM #__phocacart_products AS
a'
. ' LEFT JOIN
#__phocacart_tags_related AS tr ON a.id = tr.item_id'
. ' WHERE a.published AND tr.tag_id =
' . (int)$v;
$db->setQuery($q);
$items = $db->loadResult();
$q2 = 'UPDATE #__phocacart_tags SET
count_products = ' . (int)$items . ', count_date = ' .
$db->quote($now) . ' WHERE id = ' . (int)$v;
$db->setQuery($q2);
}
break;
case 'label':
$q0 = 'SELECT type FROM #__phocacart_tags
WHERE id = '.(int)$v;// Apply only for labels, not for tags
$db->setQuery($q0);
$type0 = $db->loadResult();
if ($type0 == 1) {
$q = ' SELECT count(a.id)'
. ' FROM #__phocacart_products AS
a'
. ' LEFT JOIN
#__phocacart_taglabels_related AS tr ON a.id = tr.item_id'
. ' WHERE a.published AND tr.tag_id =
' . (int)$v;
$db->setQuery($q);
$items = $db->loadResult();
$q2 = 'UPDATE #__phocacart_tags SET
count_products = ' . (int)$items . ', count_date = ' .
$db->quote($now) . ' WHERE id = ' . (int)$v;
$db->setQuery($q2);
}
break;
case 'manufacturer':
$q = ' SELECT count(a.id)'
. ' FROM #__phocacart_products AS a'
. ' WHERE a.published AND a.manufacturer_id =
'.(int)$v;
$db->setQuery($q);
$items = $db->loadResult();
$q2 = 'UPDATE #__phocacart_manufacturers SET
count_products = '.(int)$items.', count_date =
'.$db->quote($now) . ' WHERE id = '.(int)$v;
$db->setQuery($q2);
break;
case 'parameter':
$q = ' SELECT count(a.id)'
. ' FROM #__phocacart_products AS a'
. ' LEFT JOIN
#__phocacart_parameter_values_related AS pvr ON a.id = pvr.item_id'
. ' WHERE a.published AND
pvr.parameter_value_id = '.(int)$v;
$db->setQuery($q);
$items = $db->loadResult();
$q2 = 'UPDATE #__phocacart_parameter_values SET
count_products = '.(int)$items.', count_date =
'.$db->quote($now) . ' WHERE id = '.(int)$v;
$db->setQuery($q2);
break;
}
if (!$db->execute()) {
$errorA[] = $v;
} else {
$successA[] = $v;
}
}
}
if ($skipMessage == 1) {
return true;
}
if(!empty($errorA)) {
$errorS = implode(', ', $errorA);
$app->enqueueMessage(JText::_('COM_PHOCACART_PRODUCT_COUNT_NOT_SET_FOLLOWING_ITEMS')
. ': '.$errorS, 'error');
}
if (!empty($successA)){
$successS = implode(', ', $successA);
$app->enqueueMessage(JText::_(
'COM_PHOCACART_PRODUCT_COUNT_SUCCESSFULLY_SET_FOLLOWING_ITEMS' )
. ': '.$successS, 'success');
}
return true;
}
}
PK�"�[�#o,,$libraries/phocacart/count/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�%J$$'libraries/phocacart/country/country.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
jimport('joomla.application.component.model');
class PhocacartCountry
{
public static function getCountryById($countryId) {
$db =JFactory::getDBO();
$query = 'SELECT title FROM #__phocacart_countries WHERE id =
'.(int) $countryId. ' ORDER BY title LIMIT 1';
$db->setQuery($query);
$country = $db->loadColumn();
if(isset($country[0])) {
return (string)$country[0];
}
return '';
}
public static function options() {
$db = JFactory::getDBO();
$query = 'SELECT a.title AS text, a.id AS value'
. ' FROM #__phocacart_countries AS a'
. ' WHERE a.published = 1'
. ' ORDER BY a.ordering';
$db->setQuery( $query );
$items = $db->loadObjectList();
return $items;
}
public static function getCountries($id, $select = 0, $table =
'shipping') {
if ($table == 'shipping') {
$t = '#__phocacart_shipping_method_countries';
$c = 'shipping_id';
} else if ($table == 'payment') {
$t = '#__phocacart_payment_method_countries';
$c = 'payment_id';
} else if ($table == 'zone') {
$t = '#__phocacart_zone_countries';
$c = 'zone_id';
}
$db =JFactory::getDBO();
if ($select == 1) {
$query = 'SELECT c.country_id';
} else {
$query = 'SELECT a.*';
}
$query .= ' FROM #__phocacart_countries AS a'
.' LEFT JOIN '.$t.' AS c ON a.id = c.country_id'
.' WHERE c.'.$c.' = '.(int) $id
.' ORDER BY a.id';
$db->setQuery($query);
if ($select == 1) {
$countries = $db->loadColumn();
} else {
$countries = $db->loadObjectList();
}
return $countries;
}
/*
* used for shipping method rules
* used for payment method rules
*/
public static function storeCountries($countriesArray, $id, $table =
'shipping') {
if ($table == 'shipping') {
$t = '#__phocacart_shipping_method_countries';
$c = 'shipping_id';
} else if ($table == 'payment') {
$t = '#__phocacart_payment_method_countries';
$c = 'payment_id';
} else if ($table == 'zone') {
$t = '#__phocacart_zone_countries';
$c = 'zone_id';
}
if ((int)$id > 0) {
$db =JFactory::getDBO();
$query = ' DELETE '
.' FROM '.$t
. ' WHERE '.$c.' = '. (int)$id;
$db->setQuery($query);
$db->execute();
if (!empty($countriesArray)) {
$values = array();
$valuesString = '';
foreach($countriesArray as $k => $v) {
$values[] = ' ('.(int)$id.',
'.(int)$v[0].')';
}
if (!empty($values)) {
$valuesString = implode(',', $values);
$query = ' INSERT INTO '.$t.' ('.$c.',
country_id)'
.' VALUES '.(string)$valuesString;
$db->setQuery($query);
$db->execute();
}
}
}
}
public static function getAllCountriesSelectBox($name, $id, $activeArray,
$javascript = NULL, $order = 'id' ) {
$db =JFactory::getDBO();
$query = 'SELECT a.id AS value, a.title AS text'
.' FROM #__phocacart_countries AS a'
. ' ORDER BY '. $order;
$db->setQuery($query);
$countries = $db->loadObjectList();
$countriesO =
Joomla\CMS\HTML\HTMLHelper::_('select.genericlist', $countries,
$name, 'class="inputbox" size="4"
multiple="multiple"'. $javascript, 'value',
'text', $activeArray, $id);
return $countriesO;
}
public static function getCountryFlag($code = '', $frontend = 0,
$image = '', $width = '', $height = '') {
if ($image != '') {
$imageO = PhocacartImage::getImage($image, '', $width,
$height);
if ($imageO) {
return $imageO;
}
}
if ($code != '') {
//$link = '/media/mod_languages/images/'.
strip_tags(strtolower($code)). '.gif';
//$link = '/media/com_phocacart/images/flags/'.
strip_tags(strtolower($code)). '-22x14.png';
$link = '/media/com_phocacart/images/flags/'.
strip_tags(strtolower($code)). '.png';
$abs = JPATH_ROOT . $link;
if ($frontend == 1) {
$rel = JURI::base(true) . $link;
} else {
$rel = str_replace('/administrator', '',
JURI::base(true)) . $link;
}
if(JFile::exists($abs)) {
return '<img src="'.$rel.'"
alt="" />';
}
}
return '';
}
}
?>
PK�"�[�#o,,&libraries/phocacart/country/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�Ї�M�M%libraries/phocacart/coupon/coupon.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartCoupon
{
protected $coupon;
protected $type = array(0,1);// 0 all, 1 online shop, 2 pos (category
type, payment method type, shipping method type)
public function __construct() {}
public function setType($type = array(0,1)) {
$this->type = $type;
}
public function setCoupon($couponId = 0, $couponCode = '') {
$db = JFactory::getDBO();
$user = PhocacartUser::getUser();
$guest = PhocacartUserGuestuser::getGuestUser();
$pos = PhocacartPos::isPos();// In POS coupons can be set for not
selected user (when user is not selected)
$params = PhocacartUtils::getComponentParameters();
$enable_coupons = $params->get( 'enable_coupons', 2 );
$userLevels = implode (',',
$user->getAuthorisedViewLevels());
$userGroups = implode (',',
PhocacartGroup::getGroupsById($user->id, 1, 1));
$wheres = array();
if ((int)$couponId > 0) {
$wheres[] = 'c.id = '.(int)$couponId;
} else if ($couponCode != '') {
$wheres[] = 'c.code = '.$db->quote((string)$couponCode);
} else {
return false;
}
// ACCESS
$wheres[] = " c.access IN (".$userLevels.")";
$wheres[] = " (gc.group_id IN (".$userGroups.") OR
gc.group_id IS NULL)";
$wheres[] = ' c.published = 1';
// COUPON Type
if (!empty($this->type) && is_array($this->type)) {
$wheres[] = " c.type IN (" . implode(',',
$this->type) . ')';
}
$where = ( count( $wheres ) ? ' WHERE '. implode( ' AND
', $wheres ) : '' );
// MOVECOUPON
// 1) user logged in ... OK
// 2) guest checkout enabled in options and started by user ... OK
// 3) POS
// 4) $enable_coupons == 1 which means even not logged in user and not
started guest checkout user can add coupon
//
// USERS AND COUPONS
// 1) LOGGED IN USER
// 2) USER STARTED GUEST CHECKOUT
// 3) USER NOT LOGGED IN AND NOT STARTED GUEST CHECKOUT YET
(PRE-GUEST/PRE-LOGGED-IN)
if((isset($user->id) && $user->id > 0) || $guest || $pos
|| $enable_coupons == 1) {
$columns =
'c.id, c.code, c.title, c.valid_from, c.valid_to, c.discount,'
.' c.quantity_from, c.available_quantity,
c.available_quantity_user, c.total_amount,'
.' c.calculation_type, c.type, c.free_shipping, c.free_payment,
c.category_filter, c.product_filter,'
.' co.count AS count, cu.count AS countuser,'
.' GROUP_CONCAT(DISTINCT cp.product_id) AS product,' // line
of selected products
.' GROUP_CONCAT(DISTINCT cc.category_id) AS category'; // line
of selected categories
$groupsFull = 'c.id, c.code, c.title, c.valid_from, c.valid_to,
c.discount,'
.' c.quantity_from, c.available_quantity,
c.available_quantity_user, c.total_amount,c.category_filter,
c.product_filter,'
.' c.calculation_type, c.type, c.free_shipping, c.free_payment,
co.count, cu.count';
//.' co.count AS count, cu.count AS countuser';
$groupsFast = 'c.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
$query = 'SELECT '.$columns
.' FROM #__phocacart_coupons AS c'
.' LEFT JOIN #__phocacart_coupon_products AS cp ON cp.coupon_id =
c.id'
.' LEFT JOIN #__phocacart_coupon_categories AS cc ON cc.coupon_id =
c.id'
.' LEFT JOIN #__phocacart_coupon_count AS co ON co.coupon_id =
c.id' // limit count for all coupons
.' LEFT JOIN #__phocacart_coupon_count_user AS cu ON cu.coupon_id =
c.id AND cu.user_id = '.(int)$user->id // limit c for user
.' LEFT JOIN #__phocacart_item_groups AS gc ON c.id = gc.item_id
AND gc.type = 6'// type 6 is coupon
. $where
.' GROUP BY '.$groups;
$query .= ' ORDER BY c.id'
.' LIMIT 1';
PhocacartUtils::setConcatCharCount();
$db->setQuery($query);
$coupon = $db->loadAssoc();
if (!empty($coupon)) {
$this->coupon = $coupon;
return true;
} else {
$this->coupon = false;
PhocacartLog::add(4, 'Message - Coupon not valid (Access,
Published, Customer Group)', $couponId, 'Coupon code: '.
$couponCode);
return false;
}
} else {
PhocacartLog::add(4, 'Message - Coupon not valid (User not logged
in, No guest checkout, Coupons not enabled)', $couponId, 'Coupon
code: '. $couponCode);
return false;
}
}
public function getCoupon() {
return $this->coupon;
}
/*
* Coupon true does not mean it is valid
* COUPON TRUE = access, published, available quantity, quantity user
(basicCheck)
* COUPON VALID = COUPON TRUE + total amount, total quantity, product id,
category id checked (advancedCheck)
*/
public function checkCoupon($basicCheck = 0, $id = 0, $catid = 0,
$quantity = 0, $amount = 0, $subtotalAmount = 0) {
if (!empty($this->coupon)) {
$paramsC = PhocacartUtils::getComponentParameters();
// $discount_priority = $paramsC->get(
'discount_priority', 1 );
$discount_subtotal_amount = $paramsC->get(
'discount_subtotal_amount', 1 );
// -----------
// BASIC CHECK
// 1. ACCESS, EXISTS, PUBLISHED, CUSTOMER GROUP, TYPE
// Checked in SQL
// 2. VALID DATE FROM TO CHECK
if (isset($this->coupon['valid_from']) &&
isset($this->coupon['valid_to'])) {
$valid =
PhocacartDate::getActiveDate($this->coupon['valid_from'],
$this->coupon['valid_to']);
if ($valid != 1) {
PhocacartLog::add(4, 'Message - Coupon not valid (Valid From -
Valid To)', $this->coupon['id'], 'Coupon title:
'. $this->coupon['title']);
return false;
}
} else {
PhocacartLog::add(4, 'Message - Coupon not valid (Valid From -
Valid To) - Empty data', $this->coupon['id'],
'Coupon title: '. $this->coupon['title']);
return false;
}
// 3. AVAILABLE QUANTITY
if (isset($this->coupon['available_quantity'])) {
if ((int)$this->coupon['available_quantity'] == 0) {
// OK we don't check the quantity as zero means, no quantity
limit
} else if((int)$this->coupon['available_quantity'] > 0
&& (int)$this->coupon['count'] ==
(int)$this->coupon['available_quantity']
|| (int)$this->coupon['count'] >
(int)$this->coupon['available_quantity']) {
PhocacartLog::add(4, 'Message - Coupon not valid (Available
Quantity)', $this->coupon['id'], 'Coupon title:
'. $this->coupon['title']);
return false;
}
// OK
} else {
PhocacartLog::add(4, 'Message - Coupon not valid (Available
Quantity) - Empty data', $this->coupon['id'],
'Coupon title: '. $this->coupon['title']);
return false;
}
// 4. QUANTITY USER
if (isset($this->coupon['available_quantity_user'])) {
if ((int)$this->coupon['available_quantity_user'] == 0) {
// OK we don't check the quantity as zero means, no quantity
limit
} else if((int)$this->coupon['available_quantity_user']
> 0
&& (int)$this->coupon['countuser'] ==
(int)$this->coupon['available_quantity_user']
|| (int)$this->coupon['countuser'] >
(int)$this->coupon['available_quantity_user']) {
PhocacartLog::add(4, 'Message - Coupon not valid (Available
Quantity - User)', $this->coupon['id'], 'Coupon
title: '. $this->coupon['title']);
return false;
}
// OK
} else {
PhocacartLog::add(4, 'Message - Coupon not valid (Available
Quantity - User) - Empty data', $this->coupon['id'],
'Coupon title: '. $this->coupon['title']);
return false;
}
if ($basicCheck) {
return true;
}
// 5. VALID TOTAL AMOUNT
if (isset($this->coupon['total_amount'])) {
$currentAmount = $amount;
if ($discount_subtotal_amount == 2) {
$currentAmount = $subtotalAmount;
}
if ($this->coupon['total_amount'] == 0) {
// OK we don't check the total amount as zero means, no total
amount limit
} else if ($this->coupon['total_amount'] > 0 &&
$currentAmount < $this->coupon['total_amount']) {
PhocacartLog::add(4, 'Message - Coupon not valid (Total
Amount)', $this->coupon['id'], 'Coupon title:
'. $this->coupon['title']);
return false;
}
} else {
PhocacartLog::add(4, 'Message - Coupon not valid (Total Amount) -
Empty data', $this->coupon['id'], 'Coupon title:
'. $this->coupon['title']);
return false;
}
// 6. VALID QUANTITY
if (isset($this->coupon['quantity_from'])) {
if ((int)$this->coupon['quantity_from'] == 0) {
// OK we don't check the quantity as zero means, no quantity
limit
} else if((int)$this->coupon['quantity_from'] > 0
&& (int)$quantity <
(int)$this->coupon['quantity_from']) {
PhocacartLog::add(4, 'Message - Coupon not valid (Quantity
From)', $this->coupon['id'], 'Coupon title: '.
$this->coupon['title']);
return false;
}
} else {
PhocacartLog::add(4, 'Message - Coupon not valid (Quantity From) -
Empty data', $this->coupon['id'], 'Coupon title:
'. $this->coupon['title']);
return false;
}
// 7. VALID PRODUCT
if (!empty($this->coupon['product'])) {
$ids = explode(',', $this->coupon['product']);
if (empty($ids)) {
// OK we don't check the quantity as zero means, no quantity
limit
} else {
if ($this->coupon['product_filter'] == 0) {
// All except the selected
if (in_array($id, $ids)) {
PhocacartLog::add(4, 'Message - Coupon not valid (Valid
Product)', $this->coupon['id'], 'Coupon title:
'. $this->coupon['title']);
return false;
}
} else {
// All selected
if (!in_array($id, $ids)) {
PhocacartLog::add(4, 'Message - Coupon not valid (Valid
Product) - Empty data', $this->coupon['id'], 'Coupon
title: '. $this->coupon['title']);
return false;
}
}
}
}
// 8. VALID CATEGORY
if (!empty($this->coupon['category'])) {
$catids = explode(',',
$this->coupon['category']);
if (empty($catids)) {
// OK we don't check the quantity as zero means, no quantity
limit
} else {
if ($this->coupon['category_filter'] == 0) {
// All except the selected
if (in_array($catid, $catids)) {
PhocacartLog::add(4, 'Message - Coupon not valid (Valid
Category)', $this->coupon['id'], 'Coupon title:
'. $this->coupon['title']);
return false;
}
} else {
// All selected
if (!in_array($catid, $catids)) {
PhocacartLog::add(4, 'Message - Coupon not valid (Valid
Category) - Empty data', $this->coupon['id'],
'Coupon title: '. $this->coupon['title']);
return false;
}
}
}
}
// Seems like everything is Ok
$this->coupon['valid'] = 1;
return true;
}
return false;
}
/*
public function checkCouponAdvanced($id, $catid) {
if (!empty($this->coupon)) {
$ids = explode(',', $this->coupon['product']);
$catids = explode(',',
$this->coupon['category']);
// Products
if(!empty($ids)) {
if (in_array($id, $ids)) {
return true;
}
}
// Categories
if(!empty($catids)) {
if (in_array($catid, $catids)) {
return true;
}
}
// No condition regarding ids or catids was set, coupon is valid for
every item
if (empty($ids) && empty($catids)) {
return true;
}
if (isset($ids[0]) && $ids[0] == '' &&
isset($catids[0]) && $catids[0] == '') {
return true;
}
return false;
}
return false;
}
public function checkCouponTotal($amount, $totalAmount) {
if (!empty($this->coupon)) {
if ($amount > $totalAmount) {
return true;
}
return false;
}
return false;
}
*/
/*
* Static part
*/
public static function storeCouponProductsById($itemString, $couponId) {
if ((int)$couponId > 0) {
$db =JFactory::getDBO();
$query = ' DELETE '
.' FROM #__phocacart_coupon_products'
. ' WHERE coupon_id = '. (int)$couponId;
$db->setQuery($query);
$db->execute();
if (isset($itemString) && $itemString != '') {
$couponArray = explode(",", $itemString);
$values = array();
$valuesString = '';
foreach($couponArray as $k => $v) {
$values[] = ' ('.(int)$couponId.',
'.(int)$v.')';
}
if (!empty($values)) {
$valuesString = implode(',', $values);
$query = ' INSERT INTO #__phocacart_coupon_products (coupon_id,
product_id)'
.' VALUES '.(string)$valuesString;
$db->setQuery($query);
$db->execute();
}
}
}
}
public static function storeCouponCatsById($catArray, $couponId) {
if ((int)$couponId > 0) {
$db =JFactory::getDBO();
$query = ' DELETE '
.' FROM #__phocacart_coupon_categories'
. ' WHERE coupon_id = '. (int)$couponId;
$db->setQuery($query);
$db->execute();
if (isset($catArray) && !empty($catArray)) {
$valuesString = '';
foreach($catArray as $k => $v) {
$values[] = ' ('.(int)$couponId.',
'.(int)$v.')';
}
if (!empty($values)) {
$valuesString = implode(',', $values);
$query = ' INSERT INTO #__phocacart_coupon_categories (coupon_id,
category_id)'
.' VALUES '.(string)$valuesString;
$db->setQuery($query);
$db->execute();
}
}
}
}
public static function getCouponProductsById($couponId, $select = 0) {
$db =JFactory::getDBO();
if ($select == 1) {
$query = 'SELECT co.coupon_id';
} else {
$query = 'SELECT a.id as id, a.title as title, group_concat(c.title
SEPARATOR \' \') AS categories_title';
}
$query .= ' FROM #__phocacart_products AS a'
.' LEFT JOIN #__phocacart_coupon_products AS co ON a.id =
co.product_id'
//.' LEFT JOIN #__phocacart_categories AS c ON a.catid = c.id'
.' LEFT JOIN #__phocacart_product_categories AS pc ON pc.product_id
= a.id'
.' LEFT JOIN #__phocacart_categories AS c ON c.id =
pc.category_id'
.' WHERE co.coupon_id = '.(int) $couponId;
if ($select == 1) {
$query .= ' GROUP BY co.coupon_id';
} else {
$query .= ' GROUP BY co.coupon_id, a.id, a.title';
}
$db->setQuery($query);
if ($select == 1) {
$coupon = $db->loadColumn();
} else {
$coupon = $db->loadObjectList();
}
return $coupon;
}
public static function getCouponCatsById($couponId, $select = 0) {
$db =JFactory::getDBO();
if ($select == 1) {
$query = 'SELECT co.coupon_id';
} else {
$query = 'SELECT c.id as value, c.title as text';
}
$query .= ' FROM #__phocacart_categories AS c'
.' LEFT JOIN #__phocacart_coupon_categories AS co ON c.id =
co.category_id'
.' WHERE co.coupon_id = '.(int) $couponId;
$db->setQuery($query);
if ($select == 1) {
$coupon = $db->loadColumn();
} else {
$coupon = $db->loadObjectList();
}
return $coupon;
}
public static function getCouponTitleById($couponId) {
$db =JFactory::getDBO();
$query = 'SELECT c.title'
.' FROM #__phocacart_coupons AS c'
.' WHERE c.id = '.(int) $couponId
.' ORDER BY c.id'
.' LIMIT 1';
$db->setQuery($query);
$coupon = $db->loadObject();
return $coupon;
}
public static function getCouponInfoById($couponId) {
$db =JFactory::getDBO();
$query = 'SELECT c.id, c.title, c.code'
.' FROM #__phocacart_coupons AS c'
.' WHERE c.id = '.(int) $couponId
.' ORDER BY c.id'
.' LIMIT 1';
$db->setQuery($query);
$coupon = $db->loadObject();
return $coupon;
}
public static function storeCouponCount($couponId) {
$idExists = 0;
if ((int)$couponId > 0) {
$db =JFactory::getDBO();
$query = ' SELECT id FROM #__phocacart_coupon_count WHERE coupon_id
= '. (int)$couponId .' ORDER BY id LIMIT 1';
$db->setQuery($query);
$idExists = $db->loadResult();
if ((int)$idExists > 0) {
$query = 'UPDATE #__phocacart_coupon_count SET count = count + 1
WHERE id = '.(int)$idExists;
$db->setQuery($query);
$db->execute();
} else {
$valuesString = '('.(int)$couponId.', 1)';
$query = ' INSERT INTO #__phocacart_coupon_count (coupon_id,
count) VALUES '.(string)$valuesString;
$db->setQuery($query);
$db->execute();
}
return true;
}
return false;
}
public static function storeCouponCountUser($couponId, $userId) {
$idExists = 0;
if ((int)$couponId > 0 && (int)$userId > 0) {
$db =JFactory::getDBO();
$query = ' SELECT coupon_id, user_id FROM
#__phocacart_coupon_count_user WHERE coupon_id = '. (int)$couponId
.' AND user_id = '.(int)$userId.' ORDER BY coupon_id LIMIT
1';
$db->setQuery($query);
$idExists = $db->loadAssoc();
if (isset($idExists['coupon_id']) &&
isset($idExists['user_id']) &&
(int)$idExists['coupon_id'] > 0 &&
(int)$idExists['user_id'] > 0) {
$query = 'UPDATE #__phocacart_coupon_count_user SET count = count
+ 1 WHERE coupon_id = '.(int)$idExists['coupon_id'] . '
AND user_id = '.(int)$idExists['user_id'];
$db->setQuery($query);
$db->execute();
} else {
$valuesString = '('.(int)$couponId.',
'.(int)$userId.', 1)';
$query = ' INSERT INTO #__phocacart_coupon_count_user (coupon_id,
user_id, count) VALUES '.(string)$valuesString;
$db->setQuery($query);
$db->execute();
}
return true;
}
return false;
}
public static function generateCouponCode() {
$pC = PhocacartUtils::getComponentParameters();
$gift_code_length = $pC->get('gift_code_length',
8);
$gift_code_characters =
$pC->get('gift_code_characters',
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ');
$db =JFactory::getDBO();
// Limit attempts for generating coupon code - to protect before
infinite loop
for ($i = 0; $i < 7; $i++) {
$o = "";
for ($j = 0; $j < (int)$gift_code_length; $j++) {
$o .= $gift_code_characters[mt_rand(0,
strlen($gift_code_characters)-1)];
}
$query = ' SELECT code FROM #__phocacart_coupons WHERE
code = '.$db->quote((string)$o).' ORDER BY id LIMIT 1';
$db->setQuery($query);
$code = $db->loadResult();
// Generated code does not exist in database
if(empty($code)) {
return $o;
}
echo $o;
}
// After 5 attempts no success, return timestamp + random
$date = new DateTime();
$random = PhocacartUtils::getRandomString(mt_rand(6, 10));
return $date->getTimestamp() . strtoupper($random);
}
public static function getGiftsByOrderId($orderId) {
$db =JFactory::getDBO();
$query = 'SELECT c.id, c.title, c.code, c.discount, c.valid_from,
c.valid_to, c.type, c.published,'
.' c.gift_order_id, c.gift_product_id,
c.gift_order_product_id, c.coupon_type, c.gift_class_name,'
.' c.gift_title, c.gift_description, c.gift_image,
c.gift_recipient_name, c.gift_recipient_email, c.gift_sender_name,
c.gift_sender_message, c.gift_type'
.' FROM #__phocacart_coupons AS c'
.' WHERE c.gift_order_id = '.(int)$orderId
.' ORDER BY c.id';
$db->setQuery($query);
$gifts = $db->loadAssocList();
return $gifts;
}
public static function getGiftByCouponId($couponId) {
$db =JFactory::getDBO();
$query = 'SELECT c.id, c.title, c.code, c.discount, c.valid_from,
c.valid_to, c.type, c.published,'
.' c.gift_order_id, c.gift_product_id,
c.gift_order_product_id, c.coupon_type, c.gift_class_name,'
.' c.gift_title, c.gift_description, c.gift_image,
c.gift_recipient_name, c.gift_recipient_email, c.gift_sender_name,
c.gift_sender_message, c.gift_type'
.' FROM #__phocacart_coupons AS c'
.' WHERE c.id = '.(int)$couponId
.' ORDER BY c.id';
$db->setQuery($query);
$gift = $db->loadAssoc();
return $gift;
}
public static function activateAllGiftsByOrderId($orderId) {
$db = JFactory::getDBO();
$query = 'UPDATE #__phocacart_coupons SET'
.' published = 1'
.' WHERE gift_order_id = '.(int)$orderId;
$db->setQuery($query);
$db->execute();
return true;
}
}
PK�"�[�#o,,%libraries/phocacart/coupon/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�}��a
a )libraries/phocacart/currency/currency.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartCurrency
{
//private static $currency = false;
private static $defaultcurrency = false;
private static $defaultcurrencycode = false;
private static $defaultcurrencyarray = false;
private static $allcurrencies = false;
private static $currency = array();
private static $currencyvalid = array();
private function __construct(){}
/*public static function getCurrency() {
if(self::$currency === false){
$session = JFactory::getSession();
$currencyId = $session->get('currency', 0,
'phocaCart');
if ((int)$currencyId < 1) {
$currencyId = self::getDefaultCurrency();
}
$db = JFactory::getDBO();
$query = ' SELECT a.* FROM #__phocacart_currencies AS a'
.' WHERE a.id = '.(int)$currencyId;
$db->setQuery($query);
$c = $db->loadObject();
if (!empty($c)) {
self::$currency = $c;
} else {
self::$currency = false;
}
}
return self::$currency;
}*/
public static function getCurrency( $id = 0, $orderId = 0 ) {
// Order currency is never stored in session
// so we use id instead of key
$session = JFactory::getSession();
if( $id == 0 ) {
$id = $session->get('currency', 0,
'phocaCart');
// check only session currencies, not database - as they can be order
currencies
$isValid = self::isCurrencyValid($id);
if (!$isValid) {
$id = 0;
}
}
if ((int)$id < 1) {
$id = self::getDefaultCurrency();
$session->set('currency', (int)$id, 'phocaCart');
}
$id = (int)$id;
// Price can be different for each currency and order
// So there is a key which identifies default currency, other currency,
default currency in order, other currency in order
// one currency can have different exchange rates in order history, so
two orders can have same currency but different exchange rate
$key = base64_encode(serialize((int)$id . ':' .
(int)$orderId));
if( !array_key_exists( (string)$key, self::$currency ) ) {
$db = JFactory::getDBO();
$query = ' SELECT a.* FROM #__phocacart_currencies AS a'
.' WHERE a.id = '.(int)$id
.' ORDER BY a.id';
$db->setQuery($query);
$c = $db->loadObject();
if (!empty($c)) {
self::$currency[$key] = $c;
} else {
self::$currency[$key] = false;
}
}
return self::$currency[$key];
}
public static function isCurrencyValid($id) {
if ((int)$id > 0) {
if(!array_key_exists((int)$id, self::$currencyvalid)) {
$db = JFactory::getDBO();
$query = ' SELECT a.id FROM #__phocacart_currencies AS a'
.' WHERE a.id = '.(int)$id
.' AND a.published = 1'
.' ORDER BY a.id';
$db->setQuery($query);
$c = $db->loadResult();
if (isset($c) && (int)$c > 0) {
self::$currencyvalid[$id] = true;
} else {
self::$currencyvalid[$id] = false;
}
}
return self::$currencyvalid[$id];
}
return false;
}
public static function getDefaultCurrency() {
if(self::$defaultcurrency === false){
$db = JFactory::getDBO();
$query = ' SELECT a.id FROM #__phocacart_currencies AS a'
.' WHERE a.exchange_rate = 1'
.' ORDER BY a.id';
$db->setQuery($query);
$c = $db->loadObject();
if (!empty($c->id)) {
self::$defaultcurrency = (int)$c->id;
} else {
self::$defaultcurrency = false;
}
}
return self::$defaultcurrency;
}
/*
* XML Feed only
*/
public static function getDefaultCurrencyCode() {
if(self::$defaultcurrencycode === false){
$db = JFactory::getDBO();
$query = ' SELECT a.code FROM #__phocacart_currencies AS a'
.' WHERE a.exchange_rate = 1'
.' ORDER BY a.code';
$db->setQuery($query);
$c = $db->loadObject();
if (!empty($c->code)) {
self::$defaultcurrencycode = $c->code;
} else {
self::$defaultcurrencycode = false;
}
}
return self::$defaultcurrencycode;
}
/*
* Administration only - currency and currencies view
*/
public static function getDefaultCurrencyArray() {
if(self::$defaultcurrencyarray === false){
$db = JFactory::getDBO();
$query = ' SELECT a.id, a.title, a.code, a.exchange_rate FROM
#__phocacart_currencies AS a'
.' WHERE a.exchange_rate = 1'
.' ORDER BY a.code';
$db->setQuery($query);
$c = $db->loadAssoc();
if (!empty($c)) {
self::$defaultcurrencyarray = $c;
} else {
self::$defaultcurrencyarray = false;
}
}
return self::$defaultcurrencyarray;
}
public static function getAllCurrencies() {
if(self::$allcurrencies === false){
$db = JFactory::getDBO();
$query = ' SELECT a.id, a.id as value, CONCAT_WS(\'\',
a.title, \' (\', a.code, \')\') as text, a.title,
a.alias, a.code, a.image FROM #__phocacart_currencies AS a'
.' WHERE a.published = 1'
.' ORDER BY a.id';
$db->setQuery($query);
$c = $db->loadObjectList();
if (!empty($c)) {
self::$allcurrencies = $c;
} else {
self::$allcurrencies = false;
}
}
return self::$allcurrencies;
}
public static function setCurrentCurrency($currencyId) {
$session = JFactory::getSession();
$session->set('currency', (int)$currencyId,
'phocaCart');
}
public static function getCurrenciesSelectBox() {
$session = JFactory::getSession();
$active = $session->get('currency', 0,
'phocaCart');
if ((int)$active < 1) {
$active = self::getDefaultCurrency();
}
$currencies = self::getAllCurrencies();
$o = '';
if (!empty($currencies)) {
$o = Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$currencies, 'id', 'class="form-control chosen-select
ph-input-select-currencies"', 'value',
'text', $active);
}
return $o;
}
public static function getCurrenciesArray() {
$session = JFactory::getSession();
$active = $session->get('currency', 0,
'phocaCart');
if ((int)$active < 1) {
$active = self::getDefaultCurrency();
}
$currencies = self::getAllCurrencies();
if (!empty($currencies)) {
foreach($currencies as $k => $v) {
if ($v->value == $active) {
$v->active = 1;
} else {
$v->active = 0;
}
}
}
return $currencies;
}
public static function getCurrenciesListBox() {
$session = JFactory::getSession();
$active = $session->get('currency', 0,
'phocaCart');
if ((int)$active < 1) {
$active = self::getDefaultCurrency();
}
$currencies = self::getAllCurrencies();
$o = '';
if (!empty($currencies)) {
$o .= '<ul class="ph-input-list-currencies">';
foreach ($currencies as $k => $v) {
$class = '';
if ($v->value == $active) {
$class = 'class="active"';
}
$o .= '<li rel="'.$v->value.'"
'.$class.'>'.$v->text.'</li>';
}
$o .= '</ul>';
}
return $o;
}
public static function getCurrencyRelation($currentCurrency,
$defaultCurrency){
$o = '';
if (isset($currentCurrency['id']) &&
isset($defaultCurrency['id'])) {
if ($currentCurrency['id'] ==
$defaultCurrency['id']) {
return '';
}
if (isset($currentCurrency['exchange_rate']) &&
isset($defaultCurrency['exchange_rate'])) {
if ($currentCurrency['exchange_rate'] > 0) {
$o .= '<div>1 '.$defaultCurrency['code'] .
' = '.
PhocacartPrice::cleanPrice($currentCurrency['exchange_rate']).
' '. $currentCurrency['code'].'</div>';
}
if ($currentCurrency['exchange_rate'] > 0) {
$o .= '<div>1 '.$currentCurrency['code'] .
' = '. PhocacartPrice::cleanPrice(round((1 /
$currentCurrency['exchange_rate']), 8)) . ' '.
$defaultCurrency['code'].'</div>';
}
return $o;
}
}
return;
}
public static function getCurrentCurrencyRateIfNotDefault() {
$currency = self::getCurrency();
if (isset($currency->id) && (int)$currency->id > 0
&& isset($currency->exchange_rate) &&
$currency->exchange_rate != 1) {
return $currency->exchange_rate;
} else {
return 0;
}
}
public final function __clone() {
throw new Exception('Function Error: Cannot clone instance of
Singleton pattern', 500);
return false;
}
}
?>
PK�"�[�#o,,'libraries/phocacart/currency/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�)�
�
!libraries/phocacart/date/date.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartDate
{
public static function getActiveDate($from, $to, $returnText = 0) {
$db = JFactory::getDBO();
$nullDate = $db->getNullDate();
$now = JFactory::getDate();
$config = JFactory::getConfig();
$fromDate = JFactory::getDate($from);
$toDate = JFactory::getDate($to);
$tz = new DateTimeZone($config->get('offset'));
$fromDate->setTimezone($tz);
$toDate->setTimezone($tz);
$status = 0;
$text = '';
if ( $now->toUnix() <= $fromDate->toUnix() ) {
$status = 0;
$text = '<span class="label label-warning badge
badge-warning">'.JText::_('COM_PHOCACART_PENDING'
).'</span>';
} else if ( ( $now->toUnix() <= $toDate->toUnix() || $to ==
$nullDate ) ) {
$status = 1;
$text = '<span class="label label-success badge
badge-success">'.JText::_('COM_PHOCACART_ACTIVE'
).'</span>';
} else if ( $now->toUnix() > $toDate->toUnix() ) {
$status = 0;
$text = '<span class="label label-important label-danger
badge
badge-danger">'.JText::_('COM_PHOCACART_EXPIRED'
).'</span>';
}
if ($returnText == 1) {
return $text;
} else {
return $status;
}
return false;
}
public static function getDateDays($fromDate, $toDate) {
$fromDate = \DateTime::createFromFormat('Y-m-d', $fromDate);
$toDate = \DateTime::createFromFormat('Y-m-d', $toDate);
if ($fromDate == false || $toDate == false) {
return array();
}
return new \DatePeriod($fromDate, new \DateInterval('P1D'),
$toDate->modify('+1 day'));
}
public static function getCurrentDate($minusDays = 0) {
$user = JFactory::getUser();
$config = JFactory::getConfig();
$date = JFactory::getDate("NOW", 'UTC');
$date->setTimezone(new
DateTimeZone($user->getParam('timezone',
$config->get('offset'))));
$date = $date->format('Y-m-d', true, false);
if ((int)$minusDays > 0) {
$datePhp = new \DateTime($date);
$datePhp->sub(new
\DateInterval('P'.(int)$minusDays.'D'));
$date = $datePhp->format('Y-m-d');
}
return $date;
}
public static function splitDate($date = false) {
$o = array();
if (!$date) {
$date = date('Y-m-d H:i:s');
}
$splitDate = explode(' ', $date);
$dateDate = $splitDate[0];
$dateTime = '';
if (isset($splitDate[1])) {
$dateTime = $splitDate[1];
}
$splitDate2 = explode('-', $dateDate);
$o['year'] = $splitDate2[0];
$o['month'] = $splitDate2[1];
$o['day'] = $splitDate2[2];
if ($dateTime != '') {
$splitDate3 = explode(':', $dateTime);
$o['hour'] = $splitDate3[0];
$o['minute'] = $splitDate3[1];
$o['second'] = $splitDate3[2];
} else {
$o['hour'] = '00';
$o['minute'] = '00';
$o['second'] = '00';
}
return $o;
}
public static function activeDatabaseDate($date) {
switch($date) {
case '0000-00-00 00:00:00':
case '0000-00-00':
case '0':
case 0:
case '':
case false:
return false;
break;
default:
return true;
break;
}
}
}
?>
PK�"�[�#o,,#libraries/phocacart/date/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[9�w�4�4%libraries/phocacart/discount/cart.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartDiscountCart
{
private static $cart = array();
private function __construct(){}
/*
* ID ... id of cart
*/
public static function getCartDiscountsById($id = 0, $returnArray = 0) {
if( is_null( $id ) ) {
throw new Exception('Function Error: No id added', 500);
return false;
}
$id = (int)$id;
//- if( !array_key_exists( $id, self::$cart ) ) {
$db = JFactory::getDBO();
$user = PhocacartUser::getUser();
$userLevels = implode (',',
$user->getAuthorisedViewLevels());
$userGroups = implode (',',
PhocacartGroup::getGroupsById($user->id, 1, 1));
$wheres = array();
$wheres[] = "a.access IN (".$userLevels.")";
$wheres[] = " (ga.group_id IN (".$userGroups.") OR
ga.group_id IS NULL)";
$wheres[] = 'a.published = 1';
$where = ( count( $wheres ) ? ' WHERE '. implode( '
AND ', $wheres ) : '' );
$columns = 'a.id, a.title, a.alias, a.discount, a.access,
a.discount, a.total_amount, a.free_shipping, a.free_payment,
a.calculation_type, a.quantity_from, a.quantity_to, a.valid_from,
a.valid_to, a.category_filter, a.product_filter,'
.' GROUP_CONCAT(DISTINCT dp.product_id) AS product,' // line
of selected products
.' GROUP_CONCAT(DISTINCT dc.category_id) AS category'; // line
of selected categories
$groupsFull = 'a.id, a.title, a.alias, a.discount, a.access,
a.discount, a.total_amount, a.free_shipping, a.free_payment,
a.calculation_type, a.quantity_from, a.quantity_to, a.valid_from,
a.valid_to, a.category_filter, a.product_filter';
$groupsFast = 'a.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
$query = 'SELECT '.$columns
.' FROM #__phocacart_discounts AS a'
.' LEFT JOIN #__phocacart_discount_products AS dp ON
dp.discount_id = a.id'
.' LEFT JOIN #__phocacart_discount_categories AS dc ON
dc.discount_id = a.id'
.' LEFT JOIN #__phocacart_item_groups AS ga ON a.id = ga.item_id
AND ga.type = 5'// type 5 is discount
. $where
.' GROUP BY '.$groups;
$query .= ' ORDER BY a.id';
PhocacartUtils::setConcatCharCount();
$db->setQuery($query);
if ($returnArray) {
$discounts = $db->loadAssocList();
} else {
$discounts = $db->loadObjectList();
}
self::$cart[$id] = $discounts;
//- }
return self::$cart[$id];
}
/*
* id ... id of current checked product
* quantity ... total quantity of all products
* amount ... total amount based on all products (affected by sales,
discounts, etc.)
* subtotalAmount ... total amount based on all products (not affected by
sales, discounts, etc.)
*/
public static function getCartDiscount($id = 0, $catid = 0, $quantity = 0,
$amount = 0, $subtotalAmount = 0) {
//$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$discount_priority = $paramsC->get(
'discount_priority', 1 );
$discount_subtotal_amount = $paramsC->get(
'discount_subtotal_amount', 1 );
// Cart discount applies to all cart, so we don't need to load it
for each product
// 1 mean id of cart, not id of product
$discounts = self::getCartDiscountsById(1, 1);
if (!empty($discounts)) {
$bestKey = 0;// get the discount key which best meet the rules
$maxDiscount = 0;
foreach($discounts as $k => $v) {
// 1. ACCESS, PUBLISH CHECK, GROUP CHECK
// Checked in SQL
// 2. VALID DATE FROM TO CHECK
if (isset($v['valid_from']) &&
isset($v['valid_to'])) {
$valid = PhocacartDate::getActiveDate($v['valid_from'],
$v['valid_to']);
if ($valid != 1) {
unset($discounts[$k]);
continue;
}
} else {
unset($discounts[$k]);
continue;
}
// 3. VALID TOTAL AMOUNT
if (isset($v['total_amount'])) {
$currentAmount = $amount;
if ($discount_subtotal_amount == 2) {
$currentAmount = $subtotalAmount;
}
if ($v['total_amount'] == 0) {
// OK we don't check the total amount as zero means, no total
amount limit
} else if ($v['total_amount'] > 0 &&
$currentAmount < $v['total_amount']) {
unset($discounts[$k]);
continue;
}
} else {
unset($discounts[$k]);
continue;
}
// 4. VALID QUANTITY
if (isset($v['quantity_from'])) {
if ((int)$v['quantity_from'] == 0) {
// OK we don't check the quantity as zero means, no quantity
limit
} else if((int)$v['quantity_from'] > 0 &&
(int)$quantity < (int)$v['quantity_from']) {
unset($discounts[$k]);
continue;
}
} else {
unset($discounts[$k]);
continue;
}
// 5. VALID PRODUCT
if (!empty($v['product'])) {
$ids = explode(',', $v['product']);
if (empty($ids)) {
// OK we don't check the quantity as zero means, no product
limit
} else {
if ($v['product_filter'] == 0) {
// All except the selected
if (in_array($id, $ids)) {
unset($discounts[$k]);
continue;
}
} else {
// All selected
if (!in_array($id, $ids)) {
unset($discounts[$k]);
continue;
}
}
}
}
// 6. VALID CATEGORY
if (!empty($v['category'])) {
$catids = explode(',', $v['category']);
if (empty($catids)) {
// OK we don't check the quantity as zero means, no category
limit
} else {
if ($v['category_filter'] == 0) {
// All except the selected
if (in_array($catid, $catids)) {
unset($discounts[$k]);
continue;
}
} else {
// All selected
if (!in_array($catid, $catids)) {
unset($discounts[$k]);
continue;
}
}
}
}
//$ids = explode(',', $this->coupon['product']);
/*$catids = explode(',',
$this->coupon['category']);
// Products
if(!empty($ids)) {
if (in_array($id, $ids)) {
return true;
}
}
// Categories
if(!empty($catids)) {
if (in_array($catid, $catids)) {
return true;
}
}
// No condition regarding ids or catids was set, coupon is valid for
every item
if (empty($ids) && empty($catids)) {
return true;
}
if (isset($ids[0]) && $ids[0] == '' &&
isset($catids[0]) && $catids[0] == '') {
return true;
}*/
// 4. SELECT THE HIGHEST QUANTITY
// When more product discounts fullfill the rules, select only one
// Select the one with heighest quantity, e.g.:
// minimum quantity = 10 -> discount 5%
// minimum quantity = 20 -> discount 10%
// minimum quantity = 30 -> discount 20%
// If customer buys 50 items, we need to select 20% so both 5% and 10%
should be unset
// But if we have quantity_from == 0, this rule does not have quantity
rule, it is first used.
//4.1 if more discountes meet rule select the one with maxDiscount
//4.2.if quantity is 0 for all select the largest discount (BUT be
aware because of possible conflict)
if ($discount_priority == 2) {
if ((int)$v['quantity_from'] == 0) {
$maxDiscount = (int)$v['quantity_from'];
$bestKey = $k;
} else if (isset($v['quantity_from']) &&
(int)$v['quantity_from'] > $maxDiscount) {
$maxDiscount = (int)$v['quantity_from'];
$bestKey = $k;
}
} else {
if ((int)$v['discount'] == 0) {
$maxDiscount = (int)$v['discount'];
$bestKey = $k;
} else if (isset($v['discount']) &&
(int)$v['discount'] > $maxDiscount) {
$maxDiscount = (int)$v['discount'];
$bestKey = $k;
}
}
}
// POSSIBLE CONFLICT discount vs. quantity - solved by parameter
// POSSIBLE CONFLICT percentage vs. fixed amount
if (isset($discounts[$bestKey])) {
return $discounts[$bestKey];
} else {
return false;
}
} else {
return false;
}
}
/*
* Static part - administration
*/
public static function storeDiscountProductsById($itemString, $discountId)
{
if ((int)$discountId > 0) {
$db =JFactory::getDBO();
$query = ' DELETE '
.' FROM #__phocacart_discount_products'
. ' WHERE discount_id = '. (int)$discountId;
$db->setQuery($query);
$db->execute();
if (isset($itemString) && $itemString != '') {
$couponArray = explode(",", $itemString);
$values = array();
$valuesString = '';
foreach($couponArray as $k => $v) {
$values[] = ' ('.(int)$discountId.',
'.(int)$v.')';
}
if (!empty($values)) {
$valuesString = implode(',', $values);
$query = ' INSERT INTO #__phocacart_discount_products
(discount_id, product_id)'
.' VALUES '.(string)$valuesString;
$db->setQuery($query);
$db->execute();
}
}
}
}
public static function storeDiscountCatsById($catArray, $discountId) {
if ((int)$discountId > 0) {
$db =JFactory::getDBO();
$query = ' DELETE '
.' FROM #__phocacart_discount_categories'
. ' WHERE discount_id = '. (int)$discountId;
$db->setQuery($query);
$db->execute();
if (isset($catArray) && !empty($catArray)) {
$valuesString = '';
foreach($catArray as $k => $v) {
$values[] = ' ('.(int)$discountId.',
'.(int)$v.')';
}
if (!empty($values)) {
$valuesString = implode(',', $values);
$query = ' INSERT INTO #__phocacart_discount_categories
(discount_id, category_id)'
.' VALUES '.(string)$valuesString;
$db->setQuery($query);
$db->execute();
}
}
}
}
public static function getDiscountProductsById($discounId, $select = 0) {
$db =JFactory::getDBO();
if ($select == 1) {
$query = 'SELECT di.discount_id';
} else {
$query = 'SELECT a.id as id, a.title as title, group_concat(c.title
SEPARATOR \' \') AS categories_title';
}
$query .= ' FROM #__phocacart_products AS a'
.' LEFT JOIN #__phocacart_discount_products AS di ON a.id =
di.product_id'
//.' LEFT JOIN #__phocacart_categories AS c ON a.catid = c.id'
.' LEFT JOIN #__phocacart_product_categories AS pc ON pc.product_id
= a.id'
.' LEFT JOIN #__phocacart_categories AS c ON c.id =
pc.category_id'
.' WHERE di.discount_id = '.(int) $discounId;
if ($select == 1) {
$query .= ' GROUP BY di.discount_id';
} else {
$query .= ' GROUP BY di.discount_id, a.id, a.title';
}
$db->setQuery($query);
if ($select == 1) {
$coupon = $db->loadColumn();
} else {
$coupon = $db->loadObjectList();
}
return $coupon;
}
public static function getDiscountCatsById($discounId, $select = 0) {
$db =JFactory::getDBO();
if ($select == 1) {
$query = 'SELECT di.discount_id';
} else {
$query = 'SELECT c.id as value, c.title as text';
}
$query .= ' FROM #__phocacart_categories AS c'
.' LEFT JOIN #__phocacart_discount_categories AS di ON c.id =
di.category_id'
.' WHERE di.discount_id = '.(int) $discounId;
$db->setQuery($query);
if ($select == 1) {
$coupon = $db->loadColumn();
} else {
$coupon = $db->loadObjectList();
}
return $coupon;
}
/*
* Specific case: global cart discount will be displayed in category, item
or items view
* but under specific rules like: only percentage, no total amount, no
minimum quantity rule !!!
* Display the cart discount price in category, items or product view
*/
public static function getCartDiscountPriceForProduct($productId,
$categoryId, &$priceItems) {
$paramsC = PhocacartUtils::getComponentParameters();
$display_discount_cart_product_views = $paramsC->get(
'display_discount_cart_product_views', 0 );
if ($display_discount_cart_product_views == 0) {
return false;
}
// DISABLED FOR
// when calculation is fixed amount (we cannot divide the discount into
products which are not in checkout cart)
// when rule TOTAL AMOUNT is active (displaying products is not checkout
to check the total amount)
// when rule MINIMUM QUANTITY is active (displaying products is not
checkout to check the minimum quantity)
$discount = self::getCartDiscount($productId, $categoryId, 0, 0);
if (isset($discount['discount']) &&
isset($discount['calculation_type'])) {
$priceItems['bruttotxt'] = $discount['title'];
$priceItems['nettotxt'] = $discount['title'];
$quantity = 1;//Quantity for displaying the price in items,category
and product view is always 1
$total = array();// not used in product view
if ($discount['calculation_type'] == 0) {
// FIXED AMOUNT
// Fixed amount cannot be divided into product in views (category,
items, item)
// this is the opposite to checkout where we can divide fixed amount to
all products added to cart
$priceItems = array();
return false;
} else {
// PERCENTAGE
PhocacartCalculation::calculateDiscountPercentage($discount['discount'],
$quantity, $priceItems, $total);
}
PhocacartCalculation::correctItemsIfNull($priceItems);
PhocacartCalculation::formatItems($priceItems);
return true;
}
$priceItems = array();
return false;
}
public final function __clone() {
throw new Exception('Function Error: Cannot clone instance of
Singleton pattern', 500);
return false;
}
}
PK�"�[�#o,,'libraries/phocacart/discount/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�}�u�u(libraries/phocacart/discount/product.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartDiscountProduct
{
private static $product = array();
private function __construct() { }
/*
* ID ... id of product
*/
public static function getProductDiscountsById($id = 0, $returnArray =
0) {
if (is_null($id)) {
throw new Exception('Function Error: No id added',
500);
return false;
}
$id = (int)$id;
if (!array_key_exists($id, self::$product)) {
$db = JFactory::getDBO();
$user = PhocacartUser::getUser();
$userLevels = implode(',',
$user->getAuthorisedViewLevels());
$userGroups = implode(',',
PhocacartGroup::getGroupsById($user->id, 1, 1));
$wheres = array();
$wheres[] = "a.product_id = " . (int)$id;
$wheres[] = "a.access IN (" . $userLevels .
")";
$wheres[] = " (ga.group_id IN (" . $userGroups .
") OR ga.group_id IS NULL)";
$where = (count($wheres) ? ' WHERE ' . implode('
AND ', $wheres) : '');
$query = 'SELECT a.id, a.title, a.alias, a.discount,
a.access, a.calculation_type, a.quantity_from, a.valid_from,
a.valid_to'
. ' FROM #__phocacart_product_discounts AS a'
. ' LEFT JOIN #__phocacart_item_groups AS ga ON a.id =
ga.item_id AND ga.type = 4'// type 4 is product discount
. $where
. ' ORDER BY a.id';
$db->setQuery($query);
if ($returnArray) {
$discounts = $db->loadAssocList();
} else {
$discounts = $db->loadObjectList();
}
self::$product[$id] = $discounts;
}
return self::$product[$id];
}
/*
* $groupQuantitry - Group: Product A Option 1 and Product A Option 2
is ONE PRODUCT
* $productQuantity - Product: Product A Option 1 and Product A Option
2 are TWO PRODUCTS
*
* When we apply discount to one product based on quantity, we need to
differentiate
* if the quantity is based on one product variation - each product
variation is single product
* of if the quantity is based on whole product (group) product count
is sum of count of all product variations
*/
public static function getProductDiscount($id = 0, $groupQuantity = 0,
$productQuantity = 0, $params = array()) {
$app = JFactory::getApplication();
$paramsC =
PhocacartUtils::getComponentParameters();
$discount_product_variations_quantity =
$paramsC->get('discount_product_variations_quantity', 1);
$discount_priority =
$paramsC->get('discount_priority', 1);
// For some part to display the discount price we ignore quantity
rule
// e.g. because it will be explained in description
$ignore_quantity_rule = 0;
if (isset($params['ignore_quantity_rule']) &&
$params['ignore_quantity_rule'] == 1) {
$ignore_quantity_rule = 1;
}
if ($discount_product_variations_quantity == 0) {
$quantity = $productQuantity;
} else {
$quantity = $groupQuantity;
}
$discounts = self::getProductDiscountsById($id, 1);
if (!empty($discounts)) {
$bestKey = 0;// get the discount key which best meet the
rules
$maxDiscount = 0;
foreach ($discounts as $k => $v) {
// 1. ACCESS CHECK, GROUP CHECK
// Checked in SQL
// 2. VALID DATE FROM TO CHECK
if (isset($v['valid_from']) &&
isset($v['valid_to'])) {
$valid =
PhocacartDate::getActiveDate($v['valid_from'],
$v['valid_to']);
if ($valid != 1) {
unset($discounts[$k]);
continue;
}
} else {
unset($discounts[$k]);
continue;
}
// 3. VALID QUANTITY
if (isset($v['quantity_from'])) {
if ((int)$v['quantity_from'] == 0 ||
(int)$ignore_quantity_rule == 1) {
// OK we don't check the quantity as zero
means, no quantity limit
} else if ((int)$v['quantity_from'] > 0
&& (int)$quantity < (int)$v['quantity_from']) {
unset($discounts[$k]);
continue;
}
} else {
unset($discounts[$k]);
continue;
}
// 4. SELECT THE HIGHEST QUANTITY
// When more product discounts fullfill the rules, select
only one
// Select the one with heighest quantity, e.g.:
// minimum quantity = 10 -> discount 5%
// minimum quantity = 20 -> discount 10%
// minimum quantity = 30 -> discount 20%
// If customer buys 50 items, we need to select 20% so both
5% and 10% should be unset
// But if we have quantity_from == 0, this rule does not
have quantity rule, it is first used.
//4.1 if more discountes meet rule select the one with
maxDiscount
//4.2.if quantity is 0 for all select the largest discount
(BUT be aware because of possible conflict)
if ($discount_priority == 2) {
if ((int)$v['quantity_from'] == 0) {
$maxDiscount = (int)$v['quantity_from'];
$bestKey = $k;
} else if (isset($v['quantity_from'])
&& (int)$v['quantity_from'] > $maxDiscount) {
$maxDiscount = (int)$v['quantity_from'];
$bestKey = $k;
}
} else {
if ((int)$v['discount'] == 0) {
$maxDiscount = (int)$v['discount'];
$bestKey = $k;
} else if (isset($v['discount']) &&
(int)$v['discount'] > $maxDiscount) {
$maxDiscount = (int)$v['discount'];
$bestKey = $k;
}
}
}
// POSSIBLE CONFLICT discount vs. quantity - solved by
parameter
// POSSIBLE CONFLICT percentage vs. fixed amount
if (isset($discounts[$bestKey])) {
return $discounts[$bestKey];
} else {
return false;
}
} else {
return false;
}
}
/*
* Display the discount price in category, items or product view
*/
public static function getProductDiscountPrice($productId,
&$priceItems, $params = array()) {
$paramsC =
PhocacartUtils::getComponentParameters();
$display_discount_product_views =
$paramsC->get('display_discount_product_views', 0);
if (isset($params['ignore_view_rule']) &&
$params['ignore_view_rule'] == 1) {
// Different modules like countdown module
} else if ($display_discount_product_views == 0) {
return false;
}
$discount = self::getProductDiscount($productId, 1, 1, $params);
if (isset($discount['discount']) &&
isset($discount['calculation_type'])) {
$price = new PhocacartPrice();
$priceItems['bruttotxt'] =
$discount['title'];
$priceItems['nettotxt'] =
$discount['title'];
$quantity = 1; //Quantity for displaying
the price in items,category and product view is always 1
$total = array();// not used in product view
if ($discount['calculation_type'] == 0) {
// FIXED AMOUNT
if (isset($priceItems['netto']) &&
$priceItems['netto'] > 0) {
$r = $discount['discount'] * 100 /
$priceItems['netto'];
} else {
$r = 0;
}
// The function works with ratio, so we need to recalculate
fixed amount to ratio even in this case
// the amount will be not divided into more items like it
is in checkout
// so only because of compatibility to the function used in
checkout we use ratio instead of fixed amount
PhocacartCalculation::calculateDiscountFixedAmount($r,
$quantity, $priceItems, $total);
} else {
// PERCENTAGE
PhocacartCalculation::calculateDiscountPercentage($discount['discount'],
$quantity, $priceItems, $total);
}
PhocacartCalculation::correctItemsIfNull($priceItems);
PhocacartCalculation::formatItems($priceItems);
return true;
}
return false;
}
/* Module - get all products with discounts */
public static function getProductsDiscounts($params = array()) {
$db = JFactory::getDBO();
$user = PhocacartUser::getUser();
$userLevels = implode(',',
$user->getAuthorisedViewLevels());
$userGroups = implode(',',
PhocacartGroup::getGroupsById($user->id, 1, 1));
$wheres = array();
//$wheres[] = "a.product_id = " . (int)$id;
$wheres[] = " a.access IN (" . $userLevels .
")";// ACCESS Discount
$wheres[] = " p.access IN (" . $userLevels .
")";// ACCESS Product
$wheres[] = " c.access IN (" . $userLevels .
")";// ACCESS Category
$wheres[] = "p.published = 1";// PUBLISHED Product
$wheres[] = "c.published = 1";// PUBLISHED Category
$wheres[] = " (gp.group_id IN (" . $userGroups . ")
OR gp.group_id IS NULL)";
$wheres[] = " (gc.group_id IN (" . $userGroups . ")
OR gc.group_id IS NULL)";
$wheres[] = " (ga.group_id IN (" . $userGroups . ")
OR ga.group_id IS NULL)";// GROUP
// STOCK
if (isset($params['stock_check']) &&
$params['stock_check'] == 1) {
$wheres[] = " p.stock > 0";
}
// LIMIT
$limit = 1;
if (isset($params['limit'])) {
if((int)$params['limit'] == 0) {
return false;
} else if ((int)$params['limit'] > 0) {
$limit = (int)$params['limit'];
}
}
$currentDate = PhocacartDate::getCurrentDate();
$wheres[] = " ((a.valid_from <= '" .
$currentDate . "' AND a.valid_to >= '" .
$currentDate . "'))";
$where = (count($wheres) ? ' WHERE ' . implode(' AND
', $wheres) : '');
$query = 'SELECT a.id AS discount_id, a.product_id AS
discount_product_id, a.title AS discount_title, a.alias AS
discount_alias,'
. ' a.discount AS discount_discount, a.access AS
discount_access, a.calculation_type AS discount_calculation_type,'
. ' a.quantity_from AS discount_quantity_from,
a.valid_from AS discount_valid_from, a.valid_to AS discount_valid_to,'
. ' a.background_image, a.description AS
discount_description,'
. ' p.id, p.title, p.alias, p.description, p.image,
p.price, p.unit_amount,'
. ' p.unit_unit, p.stock, p.stockstatus_a_id,
p.stockstatus_n_id,'
. ' c.id AS category_id, c.title AS category_title,
c.alias AS category_alias,'
. ' t.id as tax_id, t.tax_rate AS tax_rate,
t.calculation_type AS tax_calculationtype, t.title AS tax_title,'
. ' MIN(ppg.price) as group_price'
. ' FROM #__phocacart_product_discounts AS a'
. ' LEFT JOIN #__phocacart_products AS p ON a.product_id =
p.id'
// . ' FROM #__phocacart_products AS p'
// . ' LEFT JOIN #__phocacart_product_discounts AS a ON
p.id = a.product_id'
. ' LEFT JOIN #__phocacart_product_categories AS pc ON
pc.product_id = p.id'
. ' LEFT JOIN #__phocacart_categories AS c ON c.id =
pc.category_id'
. ' LEFT JOIN #__phocacart_taxes AS t ON t.id =
p.tax_id'
. ' LEFT JOIN #__phocacart_item_groups AS ga ON a.id =
ga.item_id AND ga.type = 4'// type 4 is product discount
. ' LEFT JOIN #__phocacart_item_groups AS gp ON p.id =
gp.item_id AND gp.type = 3'// type 3 is product
. ' LEFT JOIN #__phocacart_item_groups AS gc ON c.id =
gc.item_id AND gc.type = 2'// type 2 is category
// user is in more groups, select lowest price by best group
. ' LEFT JOIN #__phocacart_product_price_groups AS ppg ON
p.id = ppg.product_id AND ppg.group_id IN (SELECT group_id FROM
#__phocacart_item_groups WHERE item_id = p.id AND group_id IN (' .
$userGroups . ') AND type = 3)'
// user is in more groups, select highest points by best group
//. ' LEFT JOIN #__phocacart_product_point_groups AS pptg
ON a.product_id = pptg.product_id AND pptg.group_id IN (SELECT group_id
FROM #__phocacart_item_groups WHERE item_id = a.product_id AND group_id IN
(' . $userGroups . ') AND type = 3)'
. $where
. ' GROUP BY a.id'
. ' ORDER BY a.id'
. ' LIMIT ' . (int)$limit;
$db->setQuery($query);
$items = $db->loadObjectList();
if (!empty($items) && isset($items[0]->discount_id)
&& (int)$items[0]->discount_id > 0) {
return $items;
}
return false;
}
/* Module - get all products with featured */
public static function getProductsFeatured($params = array()) {
$db = JFactory::getDBO();
$user = PhocacartUser::getUser();
$userLevels = implode(',',
$user->getAuthorisedViewLevels());
$userGroups = implode(',',
PhocacartGroup::getGroupsById($user->id, 1, 1));
$wheres = array();
//$wheres[] = "a.product_id = " . (int)$id;
// $wheres[] = " a.access IN (" . $userLevels .
")";// ACCESS Discount
$wheres[] = " p.access IN (" . $userLevels .
")";// ACCESS Product
$wheres[] = " c.access IN (" . $userLevels .
")";// ACCESS Category
$wheres[] = "p.published = 1";// PUBLISHED Product
$wheres[] = "c.published = 1";// PUBLISHED Category
$wheres[] = " (gp.group_id IN (" . $userGroups . ")
OR gp.group_id IS NULL)";
$wheres[] = " (gc.group_id IN (" . $userGroups . ")
OR gc.group_id IS NULL)";
// $wheres[] = " (ga.group_id IN (" . $userGroups .
") OR ga.group_id IS NULL)";// GROUP
// STOCK
if (isset($params['stock_check']) &&
$params['stock_check'] == 1) {
$wheres[] = " p.stock > 0";
}
// LIMIT
$limit = 1;
if (isset($params['limit'])) {
if((int)$params['limit'] == 0) {
return false;
} else if ((int)$params['limit'] > 0) {
$limit = (int)$params['limit'];
}
}
$wheres[] = " p.featured = 1";
$where = (count($wheres) ? ' WHERE ' . implode(' AND
', $wheres) : '');
$query = 'SELECT p.id, p.description, p.title, p.alias,
p.image, p.price, p.unit_amount,'
. ' p.unit_unit, p.stock, p.stockstatus_a_id,
p.stockstatus_n_id, p.featured_background_image AS background_image,'
. ' c.id AS category_id, c.title AS category_title,
c.alias AS category_alias,'
. ' t.id as tax_id, t.tax_rate AS tax_rate,
t.calculation_type AS tax_calculationtype, t.title AS tax_title,'
. ' MIN(ppg.price) as group_price'
. ' FROM #__phocacart_products AS p'
// . ' FROM #__phocacart_products AS p'
// . ' LEFT JOIN #__phocacart_product_discounts AS a ON
p.id = a.product_id'
. ' LEFT JOIN #__phocacart_product_categories AS pc ON
pc.product_id = p.id'
. ' LEFT JOIN #__phocacart_categories AS c ON c.id =
pc.category_id'
. ' LEFT JOIN #__phocacart_taxes AS t ON t.id =
p.tax_id'
//. ' LEFT JOIN #__phocacart_item_groups AS ga ON a.id =
ga.item_id AND ga.type = 4'// type 4 is product discount
. ' LEFT JOIN #__phocacart_item_groups AS gp ON p.id =
gp.item_id AND gp.type = 3'// type 3 is product
. ' LEFT JOIN #__phocacart_item_groups AS gc ON c.id =
gc.item_id AND gc.type = 2'// type 2 is category
// user is in more groups, select lowest price by best group
. ' LEFT JOIN #__phocacart_product_price_groups AS ppg ON
p.id = ppg.product_id AND ppg.group_id IN (SELECT group_id FROM
#__phocacart_item_groups WHERE item_id = p.id AND group_id IN (' .
$userGroups . ') AND type = 3)'
// user is in more groups, select highest points by best group
//. ' LEFT JOIN #__phocacart_product_point_groups AS pptg
ON a.product_id = pptg.product_id AND pptg.group_id IN (SELECT group_id
FROM #__phocacart_item_groups WHERE item_id = a.product_id AND group_id IN
(' . $userGroups . ') AND type = 3)'
. $where
. ' GROUP BY p.id'
. ' ORDER BY p.id'
. ' LIMIT ' . (int)$limit;
$db->setQuery($query);
$items = $db->loadObjectList();
if (!empty($items) && isset($items[0]->id) &&
(int)$items[0]->id > 0) {
return $items;
}
return false;
}
/*
* Administration
*/
public static function getDiscountsById($productId, $return = 0) {
$db = JFactory::getDBO();
$query = 'SELECT a.id, a.title, a.alias, a.discount, a.access,
a.discount, a.calculation_type, a.quantity_from, a.valid_from, a.valid_to,
a.description, a.background_image'
. ' FROM #__phocacart_product_discounts AS a'
. ' WHERE a.product_id = ' . (int)$productId
. ' ORDER BY a.ordering';
$db->setQuery($query);
if ($return == 0) {
return $db->loadObjectList();
} else if ($return == 1) {
return $db->loadAssocList();
} else {
$discounts = $db->loadAssocList();
$discountsSubform = array();
$i = 0;
if (!empty($discounts)) {
foreach ($discounts as $k => $v) {
$discountsSubform['discounts' .
$i]['id'] = (int)$v['id'];
$discountsSubform['discounts' .
$i]['title'] = (string)$v['title'];
$discountsSubform['discounts' .
$i]['alias'] = (string)$v['alias'];
$discountsSubform['discounts' .
$i]['access'] = (int)$v['access'];
$discountsSubform['discounts' .
$i]['discount'] = (string)$v['discount'];
$discountsSubform['discounts' .
$i]['calculation_type'] = (int)$v['calculation_type'];
$discountsSubform['discounts' .
$i]['quantity_from'] = (int)$v['quantity_from'];
//$discountsSubform['discounts' .
$i]['quantity_to'] = (int)$v['quantity_to'];
$discountsSubform['discounts' .
$i]['valid_from'] = $v['valid_from'];
$discountsSubform['discounts' .
$i]['valid_to'] = $v['valid_to'];
$discountsSubform['discounts' .
$i]['description'] = $v['description'];
$discountsSubform['discounts' .
$i]['background_image'] = $v['background_image'];
if ((int)$v['id'] > 0) {
$discountsSubform['discounts' .
$i]['groups'] =
PhocacartGroup::getGroupsById((int)$v['id'], 4, 1);
}
if (empty($discountsSubform['discounts' .
$i]['groups'])) {
$discountsSubform['discounts' .
$i]['groups'] = PhocacartGroup::getDefaultGroup(1);
}
$i++;
}
}
return $discountsSubform;
}
return false;
}
/* $new = 1 When we copy a product, we create new one and we need to
create new items for this product
*/
public static function storeDiscountsById($productId, $discsArray, $new
= 0) {
if ((int)$productId > 0) {
$db = JFactory::getDBO();
/*$query = ' DELETE '
.' FROM #__phocacart_product_discounts'
. ' WHERE product_id = '. (int)$productId;
$db->setQuery($query);
$db->execute();*/
$notDeleteDiscs = array();
if (!empty($discsArray)) {
$values = array();
$i = 1;
foreach ($discsArray as $k => $v) {
// Don't store empty discounts
/*if ($v['title'] == '') {
continue;
}*/
if (empty($v['alias'])) {
$v['alias'] = $v['title'];
}
$v['alias'] =
PhocacartUtils::getAliasName($v['alias']);
// correct simple xml
if (empty($v['title'])) {
$v['title'] = '';
}
if (empty($v['alias'])) {
$v['alias'] = '';
}
if (empty($v['access'])) {
$v['access'] = '';
}
if (empty($v['discount'])) {
$v['discount'] = '';
}
if (empty($v['calculation_type'])) {
$v['calculation_type'] = '';
}
if (empty($v['quantity_from'])) {
$v['quantity_from'] = '';
}
if (empty($v['quantity_to'])) {
$v['quantity_to'] = '';
}
if (empty($v['valid_from'])) {
$v['valid_from'] =
'0000-00-00';
}
if (empty($v['valid_to'])) {
$v['valid_to'] = '0000-00-00';
}
// Valid to - day including the last second
if ($v['valid_to'] == '0000-00-00'
|| $v['valid_to'] == '0000-00-00 00:00:00') {
} else {
$v['valid_to'] =
str_replace('00:00:00', '23:59:59',
JFactory::getDate($v['valid_to'])->toSql());
}
if (empty($v['groups'])) {
$v['groups'] = array();
}
if (empty($v['description'])) {
$v['description'] = '';
}
if (empty($v['background_image'])) {
$v['background_image'] = '';
}
if ($v['discount'] == '') {
continue;
}
$idExists = 0;
if ($new == 0) {
if (isset($v['id']) &&
$v['id'] > 0) {
// Does the row exist
$query = ' SELECT id '
. ' FROM
#__phocacart_product_discounts'
. ' WHERE id = ' .
(int)$v['id']
. ' ORDER BY id';
$db->setQuery($query);
$idExists = $db->loadResult();
}
}
if ((int)$idExists > 0) {
$v['discount'] =
PhocacartUtils::replaceCommaWithPoint($v['discount']);
$query = 'UPDATE
#__phocacart_product_discounts SET'
. ' product_id = ' . (int)$productId
. ','
. ' title = ' .
$db->quote($v['title']) . ','
. ' alias = ' .
$db->quote($v['alias']) . ','
. ' access = ' .
(int)$v['access'] . ','
. ' discount = ' .
$db->quote($v['discount']) . ','
. ' calculation_type = ' .
(int)$v['calculation_type'] . ','
. ' quantity_from = ' .
(int)$v['quantity_from'] . ','
. ' quantity_to = ' .
(int)$v['quantity_to'] . ','
. ' valid_from = ' .
$db->quote($v['valid_from']) . ','
. ' valid_to = ' .
$db->quote($v['valid_to']) . ','
. ' description = ' .
$db->quote($v['description']) . ','
. ' background_image = ' .
$db->quote($v['background_image']) . ','
. ' ordering = ' . (int)$i
. ' WHERE id = ' . (int)$idExists;
$db->setQuery($query);
$db->execute();
$i++;
$newIdD = $idExists;
} else {
$v['discount'] =
PhocacartUtils::replaceCommaWithPoint($v['discount']);
$values = '(' . (int)$productId . ',
' . $db->quote($v['title']) . ', ' .
$db->quote($v['alias']) . ', ' .
(int)$v['access'] . ', ' .
$db->quote($v['discount']) . ', ' .
(int)$v['calculation_type'] . ', ' .
(int)$v['quantity_from'] . ', ' .
(int)$v['quantity_to'] . ', ' .
$db->quote($v['valid_from']) . ', ' .
$db->quote($v['valid_to']) .', ' .
$db->quote($v['description']). ', ' .
$db->quote($v['background_image']) . ', ' . (int)$i
. ')';
$query = ' INSERT INTO
#__phocacart_product_discounts (product_id, title, alias, access, discount,
calculation_type, quantity_from, quantity_to, valid_from, valid_to,
description, background_image, ordering)'
. ' VALUES ' . $values;
$db->setQuery($query);
$db->execute();
$i++;
$newIdD = $db->insertid();
}
PhocacartGroup::storeGroupsById((int)$newIdD, 4,
$v['groups'], $productId);
$notDeleteDiscs[] = $newIdD;
}
}
// Remove all discounts except the active
if (!empty($notDeleteDiscs)) {
$notDeleteDiscsString = implode(',',
$notDeleteDiscs);
$query = ' DELETE '
. ' FROM #__phocacart_product_discounts'
. ' WHERE product_id = ' . (int)$productId
. ' AND id NOT IN (' . $notDeleteDiscsString
. ')';
$query2 = 'DELETE FROM #__phocacart_item_groups'
. ' WHERE item_id NOT IN ( ' .
$notDeleteDiscsString . ' )'
. ' AND product_id = ' . (int)$productId
. ' AND type = 4';
} else {
$query = ' DELETE '
. ' FROM #__phocacart_product_discounts'
. ' WHERE product_id = ' . (int)$productId;
$query2 = 'DELETE FROM #__phocacart_item_groups'
. ' WHERE product_id = ' . (int)$productId
. ' AND type = 4';
}
$db->setQuery($query);
$db->execute();
$db->setQuery($query2);
$db->execute();
}
}
/*
public static function storeDiscountsById($productId, $discsArray) {
if ((int)$productId > 0) {
$db =JFactory::getDBO();
$query = ' DELETE '
.' FROM #__phocacart_product_discounts'
. ' WHERE product_id = '. (int)$productId;
$db->setQuery($query);
$db->execute();
if (!empty($discsArray)) {
$values = array();
foreach($discsArray as $k => $v) {
// Don't store empty discounts
/*if ($v['title'] == '') {
continue;
}*//*
if(empty($v['alias'])) {
$v['alias'] = $v['title'];
}
$v['alias'] =
PhocacartUtils::getAliasName($v['alias']);
// correct simple xml
if (empty($v['title'])) {$v['title'] =
'';}
if (empty($v['alias'])) {$v['alias'] =
'';}
if (empty($v['access'])) {$v['access'] =
'';}
if (empty($v['discount'])) {$v['discount'] =
'';}
if (empty($v['calculation_type']))
{$v['calculation_type'] = '';}
if (empty($v['quantity_from']))
{$v['quantity_from'] = '';}
if (empty($v['quantity_to'])) {$v['quantity_to']
= '';}
if (empty($v['valid_from'])) {$v['valid_from']
= '';}
if (empty($v['valid_to'])) {$v['valid_to'] =
'';}
if ($v['discount'] == '') {
continue;
}
$values[] = '('.(int)$productId.',
'.$db->quote($v['title']).',
'.$db->quote($v['alias']).',
'.(int)$v['access'].',
'.$db->quote($v['discount']).',
'.(int)$v['calculation_type'].',
'.(int)$v['quantity_from'].',
'.(int)$v['quantity_to'].',
'.$db->quote($v['valid_from']).',
'.$db->quote($v['valid_to']).',
'.(int)$k.')';
}
if (!empty($values)) {
$valuesString = implode(',', $values);
$query = ' INSERT INTO #__phocacart_product_discounts
(product_id, title, alias, access, discount, calculation_type,
quantity_from, quantity_to, valid_from, valid_to, ordering)'
.' VALUES '.(string)$valuesString;
$db->setQuery($query);
$db->execute();
}
}
}
}
*/
public final function __clone() {
throw new Exception('Function Error: Cannot clone instance of
Singleton pattern', 500);
return false;
}
}
PK�"�[s9n��B�B)libraries/phocacart/download/download.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
/*
phocacart import('phocacart.file.file');
*/
class PhocacartDownload
{
public static function getDownloadFiles($userId, $tokenDownload =
'', $tokenOrder = '') {
$db = JFactory::getDBO();
$wheres = array();
if ((int)$userId < 1 && $tokenDownload != ''
&& $tokenOrder != '') {
$wheres[] = ' d.download_token =
'.$db->quote($tokenDownload);
$wheres[] = ' o.order_token = '.$db->quote($tokenOrder);
$leftJoin = '';
} else {
$wheres[] = ' u.id = '.(int)$userId;
$leftJoin = ' LEFT JOIN #__users AS u ON u.id = o.user_id';
}
$wheres[] = ' d.published = 1';
// In case of full group there can be problem with filtering additional
files
// so the loading can be divided into download files, additional download
files and attributed download files
$columns = 'd.id, d.order_id, d.product_id, d.attribute_id,
d.option_id, d.order_product_id, d.order_attribute_id, d.order_option_id,
d.title, d.alias, d.download_token, d.download_folder, d.download_file,
d.download_hits, d.download_days, d.ordering, d.date, d.published, d.type,
o.date AS order_date, o.order_number AS order_number';
$groupsFull = 'd.id, d.order_id, d.product_id, d.attribute_id,
d.option_id, d.order_product_id, d.order_attribute_id, d.order_option_id,
d.title, d.alias, d.download_token, d.download_folder, d.download_file,
d.download_hits, d.download_days, d.ordering, d.date, d.published, d.type,
o.date, o.order_number';
$groupsFast = 'd.order_id, d.download_file';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
$query = ' SELECT '.$columns
.' FROM #__phocacart_order_downloads AS d'
.' LEFT JOIN #__phocacart_orders AS o ON o.id = d.order_id'
. $leftJoin
.' WHERE ' . implode( ' AND ', $wheres )
.' GROUP BY '.$groups
.' ORDER BY d.date';
$db->setQuery($query);
$files = $db->loadObjectList();
return $files;
}
public static function getDownloadFile($id) {
$db = JFactory::getDBO();
$query = ' SELECT d.*, u.id as userid, o.order_token'
.' FROM #__phocacart_order_downloads AS d'
.' LEFT JOIN #__phocacart_orders AS o ON o.id = d.order_id'
.' LEFT JOIN #__users AS u ON u.id = o.user_id'
.' WHERE d.id = '.(int)$id .' AND d.published = 1'
.' ORDER BY d.id'
.' LIMIT 1';
$db->setQuery($query);
$file = $db->loadObject();
return $file;
}
public static function validUntil($date, $days) {
$db = JFactory::getDBO();
$nullDate = $db->getNullDate();
$now = JFactory::getDate();
$config = JFactory::getConfig();
$orderDate = JFactory::getDate($date);
$tz = new DateTimeZone($config->get('offset'));
$orderDate->setTimezone($tz);
$daysTime = $days * 24 * 60 * 60;
$expireDate = $orderDate->toUnix() + $daysTime;
if ($days == '0') {
// NO LIMIT
return false;
} else {
return JHtml::date($expireDate, JText::_('DATE_FORMAT_LC2'));
}
}
public static function isActive($date, $days) {
$o = '';
$db = JFactory::getDBO();
$nullDate = $db->getNullDate();
$now = JFactory::getDate();
$config = JFactory::getConfig();
$orderDate = JFactory::getDate($date);
$tz = new DateTimeZone($config->get('offset'));
$orderDate->setTimezone($tz);
$daysTime = $days * 24 * 60 * 60;
$expireDate = $orderDate->toUnix() + $daysTime;
if ( $now->toUnix() <= $expireDate ) {
return true;
} else {
return false;
}
return false;
}
public static function download($id) {
$file = self::getDownloadFile((int)$id);
$user = PhocacartUser::getUser();
$app = JFactory::getApplication();
$tokenDownload = $app->input->post->get('d',
'', 'string');
$tokenOrder = $app->input->post->get('o',
'', 'string');
$pC = PhocacartUtils::getComponentParameters();
$download_days = $pC->get( 'download_days', 0 );
$download_count = $pC->get( 'download_count', 0 );
$download_guest_access = $pC->get( 'download_guest_access',
0 );
if ($download_guest_access == 0) {
$token = '';
}
// CHECK USER AND TOKEN
if ((int)$user->id < 1 && ($tokenDownload == ''
|| $tokenOrder == '')) {
return false;
}
if (!isset($file->userid) && ($tokenDownload == ''
|| $tokenOrder == '')) {
return false;
}
if ($user->id != $file->userid && ($tokenDownload ==
'' || $tokenOrder == '')) {
return false;
}
if ((int)$user->id < 1 && ($tokenDownload == ''
|| $tokenOrder == '') && ($token !=
$file->download_token)) {
return false;
}
// CHECK COUNT
if($download_count > 0 && ((int)$download_count ==
(int)$file->download_hits || (int)$download_count <
(int)$file->download_hits)) {
return false;
}
// CHECK DAYS (download days from ordered file can override the download
days set in phoca cart parameters)
$downloadDays = (int)$download_days;
if (isset($file->download_days) &&
(int)$file->download_days > -1) {
$downloadDays = (int)$file->download_days;
}
if($downloadDays != 0 &&
!PhocacartDownload::isActive($file->date, $downloadDays)) {
return false;
}
// Clears file status cache
clearstatcache();
$pathFile = PhocacartPath::getPath('productfile');
$absOrRelFile = $pathFile['orig_abs_ds'] .
$file->download_file;
if (!JFile::exists($absOrRelFile)) {
return false;
}
$fileWithoutPath = basename($absOrRelFile);
$fileSize = filesize($absOrRelFile);
if (function_exists('finfo_open') &&
function_exists('finfo_open') &&
function_exists('finfo_open')) {
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$f = finfo_file($finfo, $absOrRelFile);
finfo_close($finfo);
$mimeType = $f;
} else if(function_exists('mime_content_type')) { // we have
mime magic
$mimeType = mime_content_type($absOrRelFile);
} else {
$mimeType = '';
}
// HIT Statistics
self::hit($id);
/*if ((int)$params->get('send_mail_download', 0) > 0) {
PhocacartMail::sendMail((int)$params->get('send_mail_download',
0), $fileWithoutPath, 1);
}*/
if ($fileSize == 0 ) {
die(JText::_('COM_PHOCACART_FILE_SIZE_EMPTY'));
exit;
}
// Clean the output buffer
ob_end_clean();
// test for protocol and set the appropriate headers
jimport( 'joomla.environment.uri' );
$_tmp_uri = JURI::getInstance( JURI::current() );
$_tmp_protocol = $_tmp_uri->getScheme();
if ($_tmp_protocol == "https") {
// SSL Support
header('Cache-Control: private, max-age=0, must-revalidate,
no-store');
} else {
header("Cache-Control: public, must-revalidate");
header('Cache-Control: pre-check=0, post-check=0, max-age=0');
header("Pragma: no-cache");
header("Expires: 0");
} /* end if protocol https */
header("Content-Description: File Transfer");
header("Expires: Sat, 30 Dec 1990 07:07:07 GMT");
header("Accept-Ranges: bytes");
// Modified by Rene
// HTTP Range - see RFC2616 for more informations
(http://www.ietf.org/rfc/rfc2616.txt)
$httpRange = 0;
$newFileSize = $fileSize - 1;
// Default values! Will be overridden if a valid range header field was
detected!
$resultLength = (string)$fileSize;
$resultRange = "0-".$newFileSize;
// We support requests for a single range only.
// So we check if we have a range field. If yes ensure that it is a valid
one.
// If it is not valid we ignore it and sending the whole file.
if(isset($_SERVER['HTTP_RANGE']) &&
preg_match('%^bytes=\d*\-\d*$%',
$_SERVER['HTTP_RANGE'])) {
// Let's take the right side
list($a, $httpRange) = explode('=',
$_SERVER['HTTP_RANGE']);
// and get the two values (as strings!)
$httpRange = explode('-', $httpRange);
// Check if we have values! If not we have nothing to do!
if(!empty($httpRange[0]) || !empty($httpRange[1])) {
// We need the new content length ...
$resultLength = $fileSize - $httpRange[0] - $httpRange[1];
// ... and we can add the 206 Status.
header("HTTP/1.1 206 Partial Content");
// Now we need the content-range, so we have to build it depending on
the given range!
// ex.: -500 -> the last 500 bytes
if(empty($httpRange[0]))
$resultRange = $resultLength.'-'.$newFileSize;
// ex.: 500- -> from 500 bytes to filesize
elseif(empty($httpRange[1]))
$resultRange = $httpRange[0].'-'.$newFileSize;
// ex.: 500-1000 -> from 500 to 1000 bytes
else
$resultRange = $httpRange[0] . '-' . $httpRange[1];
//header("Content-Range: bytes ".$httpRange . $newFileSize
.'/'. $fileSize);
}
}
header("Content-Length: ". $resultLength);
header("Content-Range: bytes " . $resultRange . '/' .
$fileSize);
header("Content-Type: " . (string)$mimeType);
header('Content-Disposition: attachment;
filename="'.$fileWithoutPath.'"');
header("Content-Transfer-Encoding: binary\n");
//@readfile($absOrRelFile);
// Try to deliver in chunks
@set_time_limit(0);
$fp = @fopen($absOrRelFile, 'rb');
if ($fp !== false) {
while (!feof($fp)) {
echo fread($fp, 8192);
}
fclose($fp);
} else {
@readfile($absOrRelFile);
}
flush();
exit;
}
protected static function hit($id) {
$db = JFactory::getDBO();
$query = $db->getQuery(true)
->update('#__phocacart_order_downloads')
->set($db->quoteName('download_hits') . ' = ('
. $db->quoteName('download_hits') . ' + 1)')
->where('id = ' . $db->quote((int)$id));
$db->setQuery($query);
$db->execute();
return true;
}
public static function setStatusByOrder($orderId, $status) {
$db = JFactory::getDBO();
$query = ' UPDATE #__phocacart_order_downloads'
.' SET published = '.(int)$status
.' WHERE order_id = '.(int)$orderId;
$db->setQuery($query);
$db->execute();
return true;
}
public static function downloadContent($content, $prefix = '',
$suffix = '') {
$pC = PhocacartUtils::getComponentParameters();
$import_export_type = $pC->get( 'import_export_type', 0 );
if ($import_export_type == 0) {
$mimeType = 'text/csv';
$name = "phocacartproductexport.csv";
} else {
$mimeType = 'application/xml';
$name = "phocacartproductexport.xml";
}
$content = $prefix . $content . $suffix;
// Clean the output buffer
ob_end_clean();
// test for protocol and set the appropriate headers
jimport( 'joomla.environment.uri' );
$_tmp_uri = JURI::getInstance( JURI::current() );
$_tmp_protocol = $_tmp_uri->getScheme();
if ($_tmp_protocol == "https") {
// SSL Support
header('Cache-Control: private, max-age=0, must-revalidate,
no-store');
} else {
header("Cache-Control: public, must-revalidate");
header('Cache-Control: pre-check=0, post-check=0, max-age=0');
header("Pragma: no-cache");
header("Expires: 0");
} /* end if protocol https */
header("Content-Description: File Transfer");
header("Expires: Sat, 30 Dec 1990 07:07:07 GMT");
header("Accept-Ranges: bytes");
header('Content-Encoding: UTF-8');
header("Content-Type: " . (string)$mimeType.';
charset=UTF-8');
header('Content-Disposition: attachment;
filename="'.($name).'"');
header("Content-Transfer-Encoding: binary\n");
echo "\xEF\xBB\xBF"; // UTF-8 BOM
echo $content;
flush();
return true;
//exit;
}
public static function getDownloadFilePublic($id) {
$db = JFactory::getDBO();
$query = ' SELECT a.public_download_file'
.' FROM #__phocacart_products AS a'
.' WHERE a.id = '.(int)$id
.' ORDER BY a.id'
.' LIMIT 1';
$db->setQuery($query);
$file = $db->loadObject();
return $file;
}
public static function downloadPublic($id) {
$file = self::getDownloadFilePublic((int)$id);
$app = JFactory::getApplication();
// Clears file status cache
clearstatcache();
$pathFile = PhocacartPath::getPath('publicfile');
$absOrRelFile = $pathFile['orig_abs_ds'] .
$file->public_download_file;
if (!JFile::exists($absOrRelFile)) {
return false;
}
$fileWithoutPath = basename($absOrRelFile);
$fileSize = filesize($absOrRelFile);
if (function_exists('finfo_open') &&
function_exists('finfo_open') &&
function_exists('finfo_open')) {
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$f = finfo_file($finfo, $absOrRelFile);
finfo_close($finfo);
$mimeType = $f;
} else if(function_exists('mime_content_type')) { // we have
mime magic
$mimeType = mime_content_type($absOrRelFile);
} else {
$mimeType = '';
}
if ($fileSize == 0 ) {
die(JText::_('COM_PHOCACART_FILE_SIZE_EMPTY'));
exit;
}
// Clean the output buffer
ob_end_clean();
// test for protocol and set the appropriate headers
jimport( 'joomla.environment.uri' );
$_tmp_uri = JURI::getInstance( JURI::current() );
$_tmp_protocol = $_tmp_uri->getScheme();
if ($_tmp_protocol == "https") {
// SSL Support
header('Cache-Control: private, max-age=0, must-revalidate,
no-store');
} else {
header("Cache-Control: public, must-revalidate");
header('Cache-Control: pre-check=0, post-check=0, max-age=0');
header("Pragma: no-cache");
header("Expires: 0");
} /* end if protocol https */
header("Content-Description: File Transfer");
header("Expires: Sat, 30 Dec 1990 07:07:07 GMT");
header("Accept-Ranges: bytes");
// Modified by Rene
// HTTP Range - see RFC2616 for more informations
(http://www.ietf.org/rfc/rfc2616.txt)
$httpRange = 0;
$newFileSize = $fileSize - 1;
// Default values! Will be overridden if a valid range header field was
detected!
$resultLength = (string)$fileSize;
$resultRange = "0-".$newFileSize;
// We support requests for a single range only.
// So we check if we have a range field. If yes ensure that it is a valid
one.
// If it is not valid we ignore it and sending the whole file.
if(isset($_SERVER['HTTP_RANGE']) &&
preg_match('%^bytes=\d*\-\d*$%',
$_SERVER['HTTP_RANGE'])) {
// Let's take the right side
list($a, $httpRange) = explode('=',
$_SERVER['HTTP_RANGE']);
// and get the two values (as strings!)
$httpRange = explode('-', $httpRange);
// Check if we have values! If not we have nothing to do!
if(!empty($httpRange[0]) || !empty($httpRange[1])) {
// We need the new content length ...
$resultLength = $fileSize - $httpRange[0] - $httpRange[1];
// ... and we can add the 206 Status.
header("HTTP/1.1 206 Partial Content");
// Now we need the content-range, so we have to build it depending on
the given range!
// ex.: -500 -> the last 500 bytes
if(empty($httpRange[0]))
$resultRange = $resultLength.'-'.$newFileSize;
// ex.: 500- -> from 500 bytes to filesize
elseif(empty($httpRange[1]))
$resultRange = $httpRange[0].'-'.$newFileSize;
// ex.: 500-1000 -> from 500 to 1000 bytes
else
$resultRange = $httpRange[0] . '-' . $httpRange[1];
//header("Content-Range: bytes ".$httpRange . $newFileSize
.'/'. $fileSize);
}
}
header("Content-Length: ". $resultLength);
header("Content-Range: bytes " . $resultRange . '/' .
$fileSize);
header("Content-Type: " . (string)$mimeType);
header('Content-Disposition: attachment;
filename="'.$fileWithoutPath.'"');
header("Content-Transfer-Encoding: binary\n");
//@readfile($absOrRelFile);
// Try to deliver in chunks
@set_time_limit(0);
$fp = @fopen($absOrRelFile, 'rb');
if ($fp !== false) {
while (!feof($fp)) {
echo fread($fp, 8192);
}
fclose($fp);
} else {
@readfile($absOrRelFile);
}
flush();
exit;
}
public static function getProductDownloadFolderByProducts($cid) {
// Admin information for deleting folders when products are deleted
$db = JFactory::getDBO();
if (count( $cid )) {
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$cids = implode( ',', $cid );
$query = ' SELECT download_folder FROM
#__phocacart_products WHERE id IN ( '.$cids.' ) ORDER BY
id';
$db->setQuery($query);
$folders = $db->loadColumn();
return $folders;
}
}
public static function getAttributeOptionDownloadFolderByProducts($cid)
{
// Admin information for deleting folders when products are deleted
$db = JFactory::getDBO();
if (count( $cid )) {
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$cids = implode( ',', $cid );
$query = ' SELECT av.download_folder FROM
#__phocacart_attribute_values AS av'
.' LEFT JOIN #__phocacart_attributes AS a ON a.id =
av.attribute_id'
.' LEFT JOIN #__phocacart_products AS p ON p.id =
a.product_id'
.' WHERE p.id IN ( '.$cids.' ) ORDER BY
p.id';
$db->setQuery($query);
$folders = $db->loadColumn();
return $folders;
}
}
}
PK�"�[�#o,,'libraries/phocacart/download/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[Ԋ����!libraries/phocacart/edit/edit.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
defined( '_JEXEC' ) or die( 'Restricted access' );
class PhocacartEdit
{
public static function store(&$options) {
$user = Factory::getUser();
$canCreate = $user->authorise('core.create',
'com_phocacart');
$canEdit = $user->authorise('core.edit',
'com_phocacart');
$paramsC = PhocacartUtils::getComponentParameters();
$admin_eip_title = $paramsC->get('admin_eip_title',
4);
if ($canCreate || $canEdit) {
} else {
$options['msg'] =
Text::_('COM_PHOCACART_NO_RIGHTS_EDIT_ITEMS');
return false;
}
$idA = explode(':',
$options['id']);//table:column:id
$tableDb = '';// No direct access to table - this is why
tables are listed here
$tableDbName = '';
$column = '';// No direct access to column - this is why
columns are listed here
$allowedTables = array(
'#__phocacart_products' => 'PhocaCartItem',
'#__phocacart_currencies' =>
'PhocacartCurrency',
'#__phocacart_taxes' => 'PhocacartTax',
'#__phocacart_coupons' => 'PhocacartCoupon',
'#__phocacart_discounts' => 'PhocacartDiscount',
'#__phocacart_payment_methods' =>
'PhocacartPayment',
'#__phocacart_shipping_methods' =>
'PhocacartShipping'
);
$allowedColumns = array(
'price', 'price_original', 'title',
'sku', 'hits', 'stock',
'exchange_rate', 'tax_rate', 'discount',
'cost',
'upc', 'ean', 'jan', 'isbn',
'mpn', 'serial_number', 'registration_key',
'external_id', 'external_key',
'external_link',
'external_text', 'external_link2',
'external_text2', 'min_quantity',
'min_multiple_quantity', 'unit_amount',
'unit_unit',
'length', 'width', 'height',
'weight', 'volume', 'points_needed',
'points_received', 'description',
'description_long', 'features',
'video', 'type_feed',
'type_category_feed', 'metakey',
'metadesc','metatitle'
);
// Alias can be edited
if ($admin_eip_title == 3 || $admin_eip_title == 4) {
$allowedColumns[] = 'alias';
}
$requiredColumns = array(
'title', 'alias'
);
/* This can be specified for different tables
* if ($tableDb == 'products') {
$requiredColumns = array(
'title', 'alias'
);
}*/
if (isset($idA[0])) {
$tableDbTest = '#__phocacart_'.
PhocacartText::filterValue($idA[0], 'alphanumeric2');
if (array_key_exists ($tableDbTest, $allowedTables)) {
$tableDb = $tableDbTest;
$tableDbName = $allowedTables[$tableDbTest];
}
}
if (isset($idA[1])) {
$columnTest = $idA[1];
if (in_array($columnTest, $allowedColumns)) {
$column = PhocacartText::filterValue($columnTest,
'alphanumeric2');
}
if (in_array($columnTest, $requiredColumns)) {
if ($options['value'] == '') {
$options['msg'] =
Text::_('COM_PHOCACART_VALUE_CANNOT_BE_EMPTY');
return false;
}
}
}
switch($column) {
case 'price':
case 'price_original':
case 'exchange_rate':
case 'tax_rate':
case 'discount':
case 'cost':
$options['value'] =
PhocacartUtils::replaceCommaWithPoint($options['value']);
$options['value'] = (float)$options['value'];
break;
case 'stock':
$options['value'] = (int)$options['value'];
break;
case 'title':
case 'alias':
$options['value'] = strip_tags($options['value']);
break;
}
if ($tableDb == '') {
$options['msg'] =
Text::_('COM_PHOCACART_TABLE_EMPTY_OR_NOT_ALLOWED');
return false;
}
if ($column == '') {
$options['msg'] =
Text::_('COM_PHOCACART_COLUMN_EMPTY_OR_NOT_ALLOWED');
return false;
}
if ($tableDbName != '' && $tableDb != ''
&& $column != '' && isset($idA[2]) &&
(int)$idA[2] > 0) {
$idRow = (int)$idA[2];
// TEST CHECKOUT
$user = JFactory::getUser();
// Get an instance of the row to checkout.
JTable::addIncludePath(JPATH_ADMINISTRATOR .
'/components/com_phocacart/tables');
$table = JTable::getInstance($tableDbName, 'Table');
if (!$table->load($idRow)) {
$options['msg'] = $table->getError();
//throw new RuntimeException($tableDb->getError());
return false;
}
// Check if this is the user having previously checked out the row.
if ($table->checked_out > 0 && $table->checked_out !=
$user->get('id')) {
$options['msg'] =
Text::_('JLIB_APPLICATION_ERROR_CHECKOUT_USER_MISMATCH');
//throw new
RuntimeException(JText::_('JLIB_APPLICATION_ERROR_CHECKOUT_USER_MISMATCH'));
return false;
}
// Attempt to check the row out.
if (!$table->checkout($user->get('id'), $idRow)) {
$options['msg'] = $table->getError();
//throw new RuntimeException($tableDb->getError());
return false;
}
// DATA
$data = array();
$db = JFactory::getDBO();
$data[$column] = $options['value'];
if ($column == 'title') {
// Update even alias it this is set in options
// Alias can be overwritten by title
if ($admin_eip_title == 2 || $admin_eip_title == 4) {
$options['valuecombined'] =
strip_tags(PhocacartUtils::getAliasName($options['value']));
if (isset($idA[0])) {
$options['idcombined'] = strip_tags($idA[0]) .
':alias:' . (int)$idRow;
}
$data['alias'] = $options['valuecombined'];
}
}
// After saving the item will be free
$data['checked_out'] = 0;
$data['checked_out_time'] = '0000-00-00 00:00:00';
if (!$table->bind($data)) {
$options['msg'] = $table->getError();
return false;
}
if (!$table->check()) {
$options['msg'] = $table->getError();
return false;
}
if (!$table->store()) {
$options['msg'] = $table->getError();
return false;
}
// Update product price history and product group price
if ($tableDbName == 'PhocaCartItem' && $column ==
'price') {
// Update price history
PhocacartPriceHistory::storePriceHistoryById((int)$idRow,
$data['price']);
// Update group price
PhocacartGroup::updateGroupProductPriceById((int)$idRow,
$data['price']);
}
/*
$db = JFactory::getDBO();
$q = 'UPDATE '.$tableDb.' SET
'.$db->quoteName($column).' =
'.$db->quote($options['value']).' WHERE id =
'.(int)$idRow;
$db->setQuery($q);
$db->execute();
if ($column == 'title') {
// Update even alias
$column = 'alias';
$options['valuecombined'] =
strip_tags(PhocacartUtils::getAliasName($options['value']));
if (isset($idA[0])) {
$options['idcombined'] =
strip_tags($idA[0]).':alias:' . (int)$idRow;
}
$q = 'UPDATE '.$tableDb.' SET
'.$db->quoteName($column).' =
'.$db->quote($options['valuecombined']).', WHERE id
= '.(int)$idRow;
$db->setQuery($q);
$db->execute();
}
*/
return true;
} else {
$options['msg'] =
Text::_('COM_PHOCACART_TABLE_OR_COLUMN_EMPTY');
}
return false;
}
}
?>
PK�"�[�f��Z6Z6#libraries/phocacart/email/email.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartEmailMail extends JMail{
public static function getInstance($id = 'Joomla', $exceptions =
true)
{
if (empty(self::$instances[$id]))
{
self::$instances[$id] = new PhocacartEmailMail($exceptions);
}
return self::$instances[$id];
}
// PHOCAEDIT
//public function sendMail($from, $fromName, $recipient, $subject, $body,
$mode = false, $cc = null, $bcc = null, $attachment = null,
// $replyTo = null, $replyToName = null)
public function sendMailA($from, $fromName, $recipient, $subject, $body,
$mode = false, $cc = null, $bcc = null, $attachment = null,
$attachmentString = '', $attachmentFileName = '',
$replyTo = null, $replyToName = null)
{
$this->setSubject($subject);
$this->setBody($body);
// Are we sending the email as HTML?
$this->isHtml($mode);
/*
* Do not send the message if adding any of the below items fails
*/
if ($this->addRecipient($recipient) === false)
{
return false;
}
if ($this->addCc($cc) === false)
{
return false;
}
if ($this->addBcc($bcc) === false)
{
return false;
}
// PHOCAEDIT
if ($attachmentString != '' && $attachmentFileName !=
'') {
if ($this->addStringAttachment($attachmentString,
$attachmentFileName) === false)
{
return false;
}
}
//public function addAttachment($path, $name = '', $encoding =
'base64', $type = 'application/octet-stream',
$disposition = 'attachment')
if ($this->addAttachment($attachment) === false)
{
return false;
}
// Take care of reply email addresses
if (is_array($replyTo))
{
$numReplyTo = count($replyTo);
for ($i = 0; $i < $numReplyTo; $i++)
{
if ($this->addReplyTo($replyTo[$i], $replyToName[$i]) === false)
{
return false;
}
}
}
elseif (isset($replyTo))
{
if ($this->addReplyTo($replyTo, $replyToName) === false)
{
return false;
}
}
// Add sender to replyTo only if no replyTo received
$autoReplyTo = (empty($this->ReplyTo)) ? true : false;
if ($this->setSender(array($from, $fromName, $autoReplyTo)) === false)
{
return false;
}
return $this->Send();
}
}
class PhocacartEmailFactory extends JFactory{
public static $mailer = null;
public static function getMailer()
{
if (!self::$mailer)
{
self::$mailer = self::createMailer();
}
$copy = clone self::$mailer;
return $copy;
}
protected static function createMailer()
{
$conf = self::getConfig();
$smtpauth = ($conf->get('smtpauth') == 0) ? null : 1;
$smtpuser = $conf->get('smtpuser');
$smtppass = $conf->get('smtppass');
$smtphost = $conf->get('smtphost');
$smtpsecure = $conf->get('smtpsecure');
$smtpport = $conf->get('smtpport');
$mailfrom = $conf->get('mailfrom');
$fromname = $conf->get('fromname');
$mailer = $conf->get('mailer');
// Create a JMail object
$mail = PhocacartEmailMail::getInstance();
// Clean the email address
$mailfrom = JMailHelper::cleanLine($mailfrom);
// Set default sender without Reply-to if the mailfrom is a valid address
if (JMailHelper::isEmailAddress($mailfrom))
{
// Wrap in try/catch to catch phpmailerExceptions if it is throwing them
try
{
// Check for a false return value if exception throwing is disabled
if ($mail->setFrom($mailfrom, JMailHelper::cleanLine($fromname),
false) === false)
{
PhocacartLog::add(2, 'Error sending email', 0, __METHOD__ .
'() could not set the sender data. Warning: ' . JLog::WARNING,
'Mail From: '.$mailfrom );
JLog::add(__METHOD__ . '() could not set the sender data.',
JLog::WARNING, 'mail');
}
}
catch (phpmailerException $e)
{
PhocacartLog::add(2, 'Error sending email', 0, __METHOD__ .
'() could not set the sender data. Warning: ' . JLog::WARNING,
'Mail From: '.$mailfrom );
JLog::add(__METHOD__ . '() could not set the sender data.',
JLog::WARNING, 'mail');
}
}
// Default mailer is to use PHP's mail function
switch ($mailer)
{
case 'smtp':
$mail->useSmtp($smtpauth, $smtphost, $smtpuser, $smtppass,
$smtpsecure, $smtpport);
break;
case 'sendmail':
$mail->isSendmail();
break;
default:
$mail->isMail();
break;
}
return $mail;
}
}
class PhocacartEmail
{
public static function sendEmail($from = '', $fromName =
'', $recipient = '', $subject = '', $body =
'', $mode = false, $cc = array(), $bcc = array(), $attachment =
null, $attachmentString = '', $attachmentFilename = '',
$replyTo = null, $replyToName = null) {
//public static function sendEmail($from = '', $fromName =
'', $recipient, $subject, $body, $mode = false, $cc = array(),
$bcc = array(), $attachment = null, $replyTo = null, $replyToName = null) {
$config = JFactory::getConfig();
if ($from == '') {
$from = $config->get('mailfrom');
}
if ($fromName == '') {
$fromName = $config->get('fromname');
}
if ($replyTo == '') {
$replyTo = $from;
}
if ($replyToName == '') {
$replyToName = $fromName;
}
if ($cc == '') {
$cc = array();
}
if ($bcc == '') {
$bcc = array();
}
// REMOVE DUPLICITY EMAIL ADDRESS: recepient vs. cc vs. bcc
$dR = array(0 => $recipient);
$dCc = is_array($cc) ? $cc : array(0 => $cc);
$dBcc = is_array($bcc) ? $bcc : array(0 => $bcc);
if (!empty($dCc)) {
foreach($dCc as $k => $v) {
if (in_array($v, $dR)) {
unset($dCc[$k]);
}
}
}
if (!empty($dBcc)) {
foreach($dBcc as $k => $v) {
if (in_array($v, $dR)) {
unset($dBcc[$k]);
} else if (in_array($v, $dCc)) {
unset($dBcc[$k]);
}
}
}
// Set back cleaned arrays
$cc = $dCc;
$bcc = $dBcc;
// Attachment
/*if (!empty($tmpl['attachment'])) {
$i = 0;
foreach ($tmpl['attachment'] as $key => $value) {
if(isset($data['attachment'][$i]) &&
$data['attachment'][$i]) {
if (JFile::exists($tmpl['attachment_full'][$i])) {
$attachmentArray[] = $tmpl['attachment_full'][$i];
} else {
$warning[] =
JText::_('COM_PHOCAEMAIL_ERROR_FILE_NOT_EXISTS').': '.
$tmpl['attachment_full'][$i];
}
}
$i++;
}
}*/
$subject = html_entity_decode($subject, ENT_QUOTES);
$body = html_entity_decode($body, ENT_QUOTES);
$mail = PhocacartEmailFactory::getMailer();
$body = $body . PhocacartUtilsInfo::getInfo($mode);
$sendMail = $mail->sendMailA($from, $fromName, $recipient, $subject,
$body, $mode, $cc, $bcc, $attachment, $attachmentString,
$attachmentFilename, $replyTo, $replyToName);
if (is_object($sendMail) && $sendMail->getMessage()) {
PhocacartLog::add(2, 'Error sending email', 0,
$sendMail->getMessage() . ', Mail From: '.$from );
return false;
} else if (!$sendMail) {
PhocacartLog::add(2, 'Error sending email', 0, 'No error
data set, Mail From: '.$from );
return false;
} else {
return true;
}
}
public static function sendQuestionMail ($data, $url, $tmpl) {
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$sitename = $app->get( 'sitename' );
$paramsC = PhocacartUtils::getComponentParameters();
$numCharEmail = $paramsC->get( 'max_char_question_email',
2000 );
$send_email_question = $paramsC->get(
'send_email_question', 0 );
$send_email_question_others = $paramsC->get(
'send_email_question_others', '' );
//get all selected users
$query = 'SELECT name, email, sendEmail' .
' FROM #__users' .
' WHERE id = '.(int)$send_email_question;
$db->setQuery( $query );
$rows = $db->loadObjectList();
$subject = $sitename .' - '.JText::_(
'COM_PHOCACART_NEW_QUESTION' );
if (isset($data['product']->title) &&
$data['product']->title != '') {
$subject .= ', '.JText::_('COM_PHOCACART_PRODUCT').
': '. $data['product']->title;
}
if (isset($data['category']->title) &&
$data['category']->title != '') {
$subject .= ', '.JText::_('COM_PHOCACART_CATEGORY').
': '. $data['category']->title;
}
if (isset($data['name']) && $data['name'] !=
'') {
$fromname = $data['name'];
} else {
$fromname = 'Unknown';
}
if (isset($data['email']) && $data['email']
!= '') {
$mailfrom = $data['email'];
} else {
$mailfrom = isset($rows[0]->email) ? $rows[0]->email :
'';
}
if (isset($data['message']) &&
$data['message'] != '') {
$message = $data['message'];
} else {
$message = JText::_('COM_PHOCACART_NO_MESSAGE');
}
$email = '';
if (isset($rows[0]->email)) {
$email = $rows[0]->email;
}
$message = str_replace("</p>", "\n", $message
);
$message = strip_tags($message);
$layoutE = new JLayoutFile('email_ask_question', null,
array('component' => 'com_phocacart'));
$d = array();
$d['fromname'] = $fromname;
$d['name'] = isset($data['name']) ?
$data['name'] : '';
$d['email'] = isset($data['email']) ?
$data['email'] : '';
$d['phone'] = isset($data['phone']) ?
$data['phone'] : '';
$d['subject'] = $subject;
$d['message'] = $message;
$d['numcharemail'] = $numCharEmail;
$d['url'] = $url;
$d['sitename'] = $sitename;
$body = $layoutE->render($d);
$subject = html_entity_decode($subject, ENT_QUOTES);
$body = html_entity_decode($body, ENT_QUOTES);
$notify = false;
// Send email to selected user
if ($mailfrom != '' && $send_email_question !=
'' && $email != '') {
$notify = PhocacartEmail::sendEmail($mailfrom, $fromname, $email,
$subject, $body, true, null, null, null, '', '',
$mailfrom, $fromname);
}
// Send email to others
$emailOthers = '';
$bcc = null;
if (isset($send_email_question_others) &&
$send_email_question_others != '') {
$bcc = explode(',', $send_email_question_others );
if (isset($bcc[0]) && JMailHelper::isEmailAddress($bcc[0])) {
$emailOthers = $bcc[0];
}
}
$notifyOthers = false;
if ($emailOthers != '' &&
JMailHelper::isEmailAddress($emailOthers)) {
$notifyOthers = PhocacartEmail::sendEmail($mailfrom, $fromname,
$emailOthers, $subject, $body, true, null, $bcc, null, '',
'', $mailfrom, $fromname);
}
if ($notify || $notifyOthers) {
return true;
}
return false;
}
public static function sendSubmitItemMail ($dataItem, $dataContact,
$dataParameter, $url, $tmpl) {
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$sitename = $app->get( 'sitename' );
$paramsC = PhocacartUtils::getComponentParameters();
$numCharEmail = $paramsC->get(
'max_char_submit_item_email', 2000 );
$send_email_submit_item = $paramsC->get(
'send_email_submit_item', 0 );
$send_email_submit_item_others = $paramsC->get(
'send_email_submit_item_others', '' );
//get all selected users
$query = 'SELECT name, email, sendEmail' .
' FROM #__users' .
' WHERE id = '.(int)$send_email_submit_item;
$db->setQuery( $query );
$rows = $db->loadObjectList();
$subject = $sitename .' - '.JText::_(
'COM_PHOCACART_NEW_ITEM_SUBMITTED' );
if (isset($dataContact['name']) &&
$dataContact['name'] != '') {
$fromname = $dataContact['name'];
} else {
$fromname = 'Unknown';
}
if (isset($dataContact['email']) &&
$dataContact['email'] != '') {
$mailfrom = $dataContact['email'];
} else {
$mailfrom = isset($rows[0]->email) ? $rows[0]->email :
'';
}
/*if (isset($dataItem['title']) &&
$dataItem['title'] != '') {
$message[] = $dataItem['title'];
} else {
$message[] = '';
}*/
/*if (isset($dataContact['title']) &&
$dataContact['title'] != '') {
$message .= $dataContact['title'];
} else {
$message .= '';
}*/
if (isset($dataContact['message']) &&
$dataContact['message'] != '') {
$message = $dataContact['message'];
} else {
$message = '';
}
$email = '';
if (isset($rows[0]->email)) {
$email = $rows[0]->email;
}
$message = str_replace("</p>", "\r\n", $message
);
$message = str_replace("<br>", "\r\n", $message
);
$message = strip_tags($message);
$layoutE = new JLayoutFile('email_submit_item', null,
array('component' => 'com_phocacart'));
$d = array();
$d['fromname'] = $fromname;
$d['name'] = isset($dataContact['name']) ?
$dataContact['name'] : '';
$d['email'] = isset($dataContact['email']) ?
$dataContact['email'] : '';
$d['phone'] = isset($dataContact['phone']) ?
$dataContact['phone'] : '';
$d['title'] = isset($dataItem['title']) ?
$dataItem['title'] : '';
$d['subject'] = $subject;
$d['message'] = $message;
$d['numcharemail'] = $numCharEmail;
$d['url'] = $url;
$d['sitename'] = $sitename;
$body = $layoutE->render($d);
$subject = html_entity_decode($subject, ENT_QUOTES);
$body = html_entity_decode($body, ENT_QUOTES);
$notify = false;
// Send email to selected user
if ($mailfrom != '' && $send_email_submit_item !=
'' && $email != '') {
$notify = PhocacartEmail::sendEmail($mailfrom, $fromname, $email,
$subject, $body, true, null, null, null, '', '',
$mailfrom, $fromname);
}
// Send email to others
$emailOthers = '';
$bcc = null;
if (isset($send_email_submit_item_others) &&
$send_email_submit_item_others != '') {
$bcc = explode(',', $send_email_submit_item_others );
if (isset($bcc[0]) && JMailHelper::isEmailAddress($bcc[0])) {
$emailOthers = $bcc[0];
}
}
$notifyOthers = false;
if ($emailOthers != '' &&
JMailHelper::isEmailAddress($emailOthers)) {
$notifyOthers = PhocacartEmail::sendEmail($mailfrom, $fromname,
$emailOthers, $subject, $body, true, null, $bcc, null, '',
'', $mailfrom, $fromname);
}
if ($notify || $notifyOthers) {
return true;
}
return false;
}
}
?>
PK�"�[�#o,,$libraries/phocacart/email/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[X�d��!libraries/phocacart/feed/feed.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartFeed
{
public static function getFeed($id) {
$db = JFactory::getDBO();
$q = ' SELECT a.id, a.title, a.item_params, a.feed_params,
a.feed_plugin, a.header, a.footer, a.root, a.item'
.' FROM #__phocacart_feeds AS a'
.' WHERE a.id = '.(int) $id
.' AND a.published = 1';
$db->setQuery($q);
$feed = $db->loadAssoc();
if (!empty($feed)) {
return $feed;
}
return false;
}
public static function getFeedPluginMethods($namePlugin = '',
$returnFormItem = 0) {
$plugin = array();
$plugin['name'] = $namePlugin;
$plugin['group'] = 'pcf';
$plugin['title'] = 'Phoca Cart Feed';
$plugin['selecttitle'] =
JText::_('COM_PHOCACART_SELECT_FEED_PLUGIN');
$plugin['returnform'] = $returnFormItem;
return PhocacartPlugin::getPluginMethods($plugin);
}
}
?>
PK�"�[�#o,,#libraries/phocacart/feed/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[���'libraries/phocacart/file/additional.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartFileAdditional
{
public static function getProductFilesByProductId($productId, $return = 0)
{
$db = JFactory::getDBO();
$query = 'SELECT a.id, a.download_file, a.download_token,
a.download_days';
$query .= ' FROM #__phocacart_product_files AS a'
.' WHERE a.product_id = '.(int) $productId
.' ORDER BY a.ordering';
$db->setQuery($query);
if ($return == 0) {
return $db->loadObjectList();
} else if ($return == 1) {
return $db->loadAssocList();
} else {
$files = $db->loadAssocList();
$filesSubform = array();
$i = 0;
if (!empty($files)) {
foreach($files as $k => $v) {
$filesSubform['additional_download_files'.$i]['id'] =
(string)$v['id'];
$filesSubform['additional_download_files'.$i]['download_file']
= (string)$v['download_file'];
$filesSubform['additional_download_files'.$i]['download_token']
= (string)$v['download_token'];
$filesSubform['additional_download_files'.$i]['download_days']
= (string)$v['download_days'];
$i++;
}
}
return $filesSubform;
}
return false;
}
public static function storeProductFilesByProductId($productId,
$fileArray, $new = 0) {
if ((int)$productId > 0) {
$db =JFactory::getDBO();
$notDeleteFiles = array();// Select all files which will be not
deleted
$i = 1;
if (!empty($fileArray)) {
foreach($fileArray as $k => $v) {
// correct simple xml
if (empty($v['download_token']))
{$v['download_token'] = '';}
if (empty($v['download_file']))
{$v['download_file'] = '';}
if (empty($v['download_days']))
{$v['download_days'] = -1;}
$idExists = 0;
if ($new == 0) {
if (isset($v['id']) && $v['id'] > 0) {
// Does the row exist
$query = ' SELECT id '
.' FROM #__phocacart_product_files'
.' WHERE id = '. (int)$v['id']
.' ORDER BY id';
$db->setQuery($query);
$idExists = $db->loadResult();
}
}
if ((int)$idExists > 0) {
$query = 'UPDATE #__phocacart_product_files SET'
.' product_id = '.(int)$productId.','
.' download_token =
'.$db->quote($v['download_token']).','
.' download_file =
'.$db->quote($v['download_file']).','
.' download_days =
'.(int)$v['download_days'].','
.' ordering = '.(int)$i
.' WHERE id = '.(int)$idExists;
$db->setQuery($query);
$db->execute();
$i++;
$newIdA = $idExists;
} else {
$valuesString = '('.(int)$productId.',
'.$db->quote($v['download_token']).',
'.$db->quote($v['download_file']).',
'.(int)$v['download_days'].', '.$i.')';
$query = ' INSERT INTO #__phocacart_product_files (product_id,
download_token, download_file, download_days, ordering)'
.' VALUES '.(string)$valuesString;
$db->setQuery($query);
$db->execute(); // insert is not done together but step by step
because of getting last insert id
$i++;
// ADD OPTIONS
$newIdA = $db->insertid();
}
$notDeleteFiles[] = $newIdA;
}
}
// Remove all files except the active
if (!empty($notDeleteFiles)) {
$notDeleteFilesString = implode(',', $notDeleteFiles);
$query = ' DELETE '
.' FROM #__phocacart_product_files'
.' WHERE product_id = '. (int)$productId
.' AND id NOT IN ('.$notDeleteFilesString.')';
} else {
$query = ' DELETE '
.' FROM #__phocacart_product_files'
.' WHERE product_id = '. (int)$productId;
}
$db->setQuery($query);
$db->execute();
}
}
}
PK�"�[���٠�
!libraries/phocacart/file/file.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.filesystem.folder' );
jimport( 'joomla.filesystem.file' );
class PhocacartFile
{
/*
* http://aidanlister.com/repos/v/function.size_readable.php
*/
public static function getFileSizeReadable ($size, $retstring = null,
$onlyMB = false) {
if ($onlyMB) {
$sizes = array('B', 'kB', 'MB');
} else {
$sizes = array('B', 'kB', 'MB',
'GB', 'TB', 'PB', 'EB',
'ZB', 'YB');
}
if ($retstring === null) { $retstring = '%01.2f %s'; }
$lastsizestring = end($sizes);
foreach ($sizes as $sizestring) {
if ($size < 1024) { break; }
if ($sizestring != $lastsizestring) { $size /= 1024; }
}
if ($sizestring == $sizes[0]) { $retstring = '%01d %s'; }
// Bytes aren't normally fractional
return sprintf($retstring, $size, $sizestring);
}
public static function getFileSize($manager, $filename, $readable = 1) {
$path = PhocacartPath::getPath($manager);
$fileNameAbs = JPath::clean($path['orig_abs'] . '/' .
$filename);
if ($readable == 1) {
return self::getFileSizeReadable(filesize($fileNameAbs));
} else {
return filesize($fileNameAbs);
}
}
public static function getFileTime($manager, $filename, $function, $format
= "d. M Y") {
$path = PhocaDownloadPath::getPath($manager);
$fileNameAbs = JPath::clean($path['orig_abs'] . '/' .
$filename);
if (JFile::exists($fileNameAbs)) {
switch($function) {
case 2:
$fileTime = filectime($fileNameAbs);
break;
case 3:
$fileTime = fileatime($fileNameAbs);
break;
case 1:
default:
$fileTime = filemtime($fileNameAbs);
break;
}
$fileTime = JHtml::Date($fileTime, $format);
} else {
$fileTime = '';
}
return $fileTime;
}
public static function getTitleFromFilenameWithExt (&$filename) {
$folder_array = explode('/', $filename);//Explode the filename
(folder and file name)
$count_array = count($folder_array);//Count this array
$last_array_value = $count_array - 1;//The last array value is (Count
array - 1)
return $folder_array[$last_array_value];
}
public static function getMimeType($extension, $params) {
$regex_one = '/({\s*)(.*?)(})/si';
$regex_all = '/{\s*.*?}/si';
$matches = array();
$count_matches =
preg_match_all($regex_all,$params,$matches,PREG_OFFSET_CAPTURE |
PREG_PATTERN_ORDER);
$returnMime = '';
for($i = 0; $i < $count_matches; $i++) {
$phocaDownload = $matches[0][$i][0];
preg_match($regex_one,$phocaDownload,$phocaDownloadParts);
$values_replace = array ("/^'/", "/'$/",
"/^'/", "/'$/", "/<br
\/>/");
$values = explode("=", $phocaDownloadParts[2], 2);
foreach ($values_replace as $key2 => $values2) {
$values = preg_replace($values2, '', $values);
}
// Return mime if extension call it
if ($extension == $values[0]) {
$returnMime = $values[1];
}
}
if ($returnMime != '') {
return $returnMime;
} else {
return "PhocaErrorNoMimeFound";
}
}
public static function getMimeTypeString($params) {
$regex_one = '/({\s*)(.*?)(})/si';
$regex_all = '/{\s*.*?}/si';
$matches = array();
$count_matches =
preg_match_all($regex_all,$params,$matches,PREG_OFFSET_CAPTURE |
PREG_PATTERN_ORDER);
$extString = '';
$mimeString = '';
for($i = 0; $i < $count_matches; $i++) {
$phocaDownload = $matches[0][$i][0];
preg_match($regex_one,$phocaDownload,$phocaDownloadParts);
$values_replace = array ("/^'/", "/'$/",
"/^'/", "/'$/", "/<br
\/>/");
$values = explode("=", $phocaDownloadParts[2], 2);
foreach ($values_replace as $key2 => $values2) {
$values = preg_replace($values2, '', $values);
}
// Create strings
$extString .= $values[0];
$mimeString .= $values[1];
$j = $i + 1;
if ($j < $count_matches) {
$extString .=',';
$mimeString .=',';
}
}
$string = array();
$string['mime'] = $mimeString;
$string['ext'] = $extString;
return $string;
}
public static function getTitleFromFilenameWithoutExt (&$filename) {
$folder_array = explode('/', $filename);//Explode the filename
(folder and file name)
$count_array = count($folder_array);//Count this array
$last_array_value = $count_array - 1;//The last array value is (Count
array - 1)
$string = false;
$string = preg_match( "/\./i", $folder_array[$last_array_value]
);
if ($string) {
return
PhocacartFile::removeExtension($folder_array[$last_array_value]);
} else {
return $folder_array[$last_array_value];
}
}
public static function getFolderFromTheFile($filename) {
$folder_array = explode('/', $filename);
$count_array = count($folder_array);//Count this array
$last_array_value = $count_array - 1;
return str_replace($folder_array[$last_array_value], '',
$filename);
}
public static function removeExtension($file_name) {
return substr($file_name, 0, strrpos( $file_name, '.' ));
}
public static function getExtension( $file_name ) {
return strtolower( substr( strrchr( $file_name, "." ), 1 ) );
}
public static function getFileOriginal($filename, $rel = 0, $manager =
'') {
$path = PhocacartPath::getPath($manager);
if ($rel == 1) {
return str_replace('//', '/',
$path['orig_rel_ds'] . $filename);
} else {
return JPath::clean($path['orig_abs_ds'] . $filename);
}
}
public static function createDownloadFolder($folder) {
$path = PhocacartPath::getPath('productfile');
if (!JFolder::exists($path['orig_abs_ds'] . $folder )) {
if (JFolder::create( $path['orig_abs_ds'] . $folder, 0755 ))
{
$data = "<html>\n<body
bgcolor=\"#FFFFFF\">\n</body>\n</html>";
JFile::write($path['orig_abs_ds'] .
$folder.'/index.html', $data);
return true;
} else {
return false;
}
}
return true;
}
public static function createUploadFolder($folder) {
$path = PhocacartPath::getPath('submititem');
if (!JFolder::exists($path['orig_abs_ds'] . $folder )) {
if (JFolder::create( $path['orig_abs_ds'] . $folder, 0755 ))
{
$data = "<html>\n<body
bgcolor=\"#FFFFFF\">\n</body>\n</html>";
JFile::write($path['orig_abs_ds'] .
$folder.'/index.html', $data);
return true;
} else {
return false;
}
}
return true;
}
public static function existsFileOriginal($filename, $manager) {
$fileOriginal = self::getFileOriginal($filename, 0, $manager);
if (JFile::exists($fileOriginal)) {
return true;
} else {
return false;
}
}
public static function deleteDownloadFolders($folders, $manager =
'productfile') {
if (!empty($folders)) {
foreach($folders as $k => $v) {
$path = PhocacartPath::getPath($manager);
if(JFolder::exists($path['orig_abs_ds'] . $v)) {
if(JFolder::delete($path['orig_abs_ds'] . $v)) {
if ($manager == 'attributefile') {
JFactory::getApplication()->enqueueMessage(JText::_('COM_PHOCACART_SUCCESS_ATTRIBUTE_OPTION_DOWNLOAD_FOLDER_DELETED').
': ' . $v, 'success');
} else {
JFactory::getApplication()->enqueueMessage(JText::_('COM_PHOCACART_SUCCESS_PRODUCT_DOWNLOAD_FOLDER_DELETED').
': ' . $v, 'success');
}
} else {
if ($manager == 'attributefile') {
JFactory::getApplication()->enqueueMessage(JText::_('COM_PHOCACART_ERROR_REMOVE_ATTRIBUTE_OPTION_DOWNLOAD_FOLDER').
': ' . $v, 'error');
} else {
JFactory::getApplication()->enqueueMessage(JText::_('COM_PHOCACART_ERROR_REMOVE_PRODUCT_DOWNLOAD_FOLDER').
': ' . $v, 'error');
}
}
}
}
}
}
public static function changeFileExtension($filename, $newExtension) {
$info = pathinfo($filename);
return $info['dirname'] .'/'.
$info['filename'] . '.' . $newExtension;
}
}
?>
PK�"�[�#o,,#libraries/phocacart/file/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�T��DGDG&libraries/phocacart/file/thumbnail.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.filesystem.folder' );
jimport( 'joomla.filesystem.file' );
/*
phocacart import('phocacart.path.path');
phocacart import('phocacart.file.file');
*/
class PhocacartFileThumbnail
{
/*
*Get thumbnailname
*/
public static function getThumbnailName($filename, $size, $manager) {
$path = PhocacartPath::getPath($manager);
$title = PhocacartFile::getTitleFromFilenameWithExt($filename);
$paramsC = PhocacartUtils::getComponentParameters();
$thumb_name_prefix = $paramsC->get('thumb_name_prefix',
'phoca_thumb');
$thumbName = new JObject();
switch ($size) {
case 'large':
$fileNameThumb = $thumb_name_prefix.'_l_'. $title;
$thumbName->abs = JPath::clean(str_replace($title,
'thumbs/' . $fileNameThumb, $path['orig_abs_ds'] .
$filename));
$thumbName->rel = str_replace ($title, 'thumbs/' .
$fileNameThumb, $path['orig_rel_ds'] . $filename);
break;
case 'medium':
$fileNameThumb = $thumb_name_prefix.'_m_'. $title;
$thumbName->abs = JPath::clean(str_replace($title,
'thumbs/' . $fileNameThumb, $path['orig_abs_ds'] .
$filename));
$thumbName->rel = str_replace ($title, 'thumbs/' .
$fileNameThumb, $path['orig_rel_ds'] . $filename);
break;
default:
case 'small':
$fileNameThumb = $thumb_name_prefix.'_s_'. $title;
$thumbName->abs = JPath::clean(str_replace($title,
'thumbs/' . $fileNameThumb, $path['orig_abs_ds'] .
$filename));
$thumbName->rel = str_replace ($title, 'thumbs/' .
$fileNameThumb, $path['orig_rel_ds'] . $filename);
break;
}
$thumbName->rel = str_replace('//', '/',
$thumbName->rel);
return $thumbName;
}
public static function deleteFileThumbnail ($filename, $small=0,
$medium=0, $large=0, $manager = '') {
if ($small == 1) {
$fileNameThumbS = PhocacartFileThumbnail::getThumbnailName ($filename,
'small', $manager);
if (JFile::exists($fileNameThumbS->abs)) {
JFile::delete($fileNameThumbS->abs);
}
//WEBP COPY
$webpCopyS = PhocacartFile::changeFileExtension($fileNameThumbS->abs,
'webp');
if (JFile::exists($webpCopyS)) {
JFile::delete($webpCopyS);
}
}
if ($medium == 1) {
$fileNameThumbM = PhocacartFileThumbnail::getThumbnailName ($filename,
'medium', $manager);
if (JFile::exists($fileNameThumbM->abs)) {
JFile::delete($fileNameThumbM->abs);
}
//WEBP COPY
$webpCopyM = PhocacartFile::changeFileExtension($fileNameThumbM->abs,
'webp');
if (JFile::exists($webpCopyM)) {
JFile::delete($webpCopyM);
}
}
if ($large == 1) {
$fileNameThumbL = PhocacartFileThumbnail::getThumbnailName ($filename,
'large', $manager);
if (JFile::exists($fileNameThumbL->abs)) {
JFile::delete($fileNameThumbL->abs);
}
//WEBP COPY
$webpCopyL = PhocacartFile::changeFileExtension($fileNameThumbL->abs,
'webp');
if (JFile::exists($webpCopyL)) {
JFile::delete($webpCopyL);
}
}
return true;
}
/*
* Main Thumbnail creating function
*
* file = abc.jpg
* fileNo = folder/abc.jpg
* if small, medium, large = 1, create small, medium, large thumbnail
*/
public static function getOrCreateThumbnail($fileNo, $refreshUrl, $small =
0, $medium = 0, $large = 0, $frontUpload = 0, $manager = '') {
/* if ($frontUpload) {
$returnFrontMessage = '';
}*/
$returnFrontMessage = '';
$onlyThumbnailInfo = 0;
if ($small == 0 && $medium == 0 && $large == 0) {
$onlyThumbnailInfo = 1;
}
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
//$additional_thumbnails = $paramsC->get(
'additional_thumbnails',0 );
$path = PhocacartPath::getPath($manager);
$origPathServer = str_replace('\\', '/',
$path['orig_abs_ds']);
$file['name'] =
PhocacartFile::getTitleFromFilenameWithExt($fileNo);
$file['name_no'] = ltrim($fileNo, '/');
$file['name_original_abs'] =
PhocacartFile::getFileOriginal($fileNo, 0, $manager);
$file['name_original_rel'] =
PhocacartFile::getFileOriginal($fileNo, 1, $manager);
$file['path_without_file_name_original']=
str_replace($file['name'], '',
$file['name_original_abs']);
$file['path_without_file_name_thumb'] =
str_replace($file['name'], '',
$file['name_original_abs'] . 'thumbs' .
'/');
//$file['path_without_name'] = str_replace('\\',
'/', JPath::clean($origPathServer));
//$file['path_with_name_relative_no'] =
str_replace($origPathServer, '',
$file['name_original']);
/*
$file['path_with_name_relative'] =
$path['orig_rel_ds'] . str_replace($origPathServer, '',
$file['name_original']);
$file['path_with_name_relative_no'] =
str_replace($origPathServer, '',
$file['name_original']);
$file['path_without_name'] = str_replace('\\',
'/', JPath::clean($origPath.'/'));
$file['path_without_name_relative'] =
$path['orig_rel_ds'] . str_replace($origPathServer, '',
$file['path_without_name']);
$file['path_without_name_relative_no'] =
str_replace($origPathServer, '',
$file['path_without_name']);
$file['path_without_name_thumbs'] =
$file['path_without_name'] .'thumbs';
$file['path_without_file_name_original'] =
str_replace($file['name'], '',
$file['name_original']);
$file['path_without_name_thumbs_no'] =
str_replace($file['name'], '',
$file['name_original'] .'thumbs');*/
$ext = strtolower(JFile::getExt($file['name']));
switch ($ext) {
case 'jpg':
case 'png':
case 'gif':
case 'jpeg':
case 'webp':
//Get File thumbnails name
$thumbNameS = PhocacartFileThumbnail::getThumbnailName ($fileNo,
'small', $manager);
$file['thumb_name_s_no_abs'] = $thumbNameS->abs;
$file['thumb_name_s_no_rel'] = $thumbNameS->rel;
$thumbNameM = PhocacartFileThumbnail::getThumbnailName ($fileNo,
'medium', $manager);
$file['thumb_name_m_no_abs'] = $thumbNameM->abs;
$file['thumb_name_m_no_rel'] = $thumbNameM->rel;
$thumbNameL = PhocacartFileThumbnail::getThumbnailName ($fileNo,
'large', $manager);
$file['thumb_name_l_no_abs'] = $thumbNameL->abs;
$file['thumb_name_l_no_rel'] = $thumbNameL->rel;
// Don't create thumbnails from watermarks...
$dontCreateThumb =
PhocacartFileThumbnail::dontCreateThumb($file['name']);
if ($dontCreateThumb == 1) {
$onlyThumbnailInfo = 1; // WE USE $onlyThumbnailInfo FOR NOT CREATE A
THUMBNAIL CLAUSE
}
// We want only information from the pictures OR
if ( $onlyThumbnailInfo == 0 ) {
$thumbInfo = $fileNo;
//Create thumbnail folder if not exists
$errorMsg = 'ErrorCreatingFolder';
$creatingFolder =
PhocacartFileThumbnail::createThumbnailFolder($file['path_without_file_name_original'],
$file['path_without_file_name_thumb'], $errorMsg );
switch ($errorMsg) {
case 'Success':
case 'DisabledThumbCreation':
break;
//case 'ErrorCreatingFolder':
// return
JText::_('COM_PHOCACART_ERROR_CREATING_THUMBS_FOLDER'); We can
test to create the folder directly with file
default:
$returnFrontMessage = $errorMsg;
break;
}
// Folder must exist
if (JFolder::exists($file['path_without_file_name_thumb']))
{
$errorMsgS = $errorMsgM = $errorMsgL = '';
//Small thumbnail
if ($small == 1) {
PhocacartFileThumbnail::createFileThumbnail($file['name_original_abs'],
$thumbNameS->abs, 'small', $frontUpload, $manager,
$errorMsgS);
} else {
$errorMsgS = 'ThumbnailExists';// in case we only need
medium or large, because of if clause bellow
}
//Medium thumbnail
if ($medium == 1) {
PhocacartFileThumbnail::createFileThumbnail($file['name_original_abs'],
$thumbNameM->abs, 'medium', $frontUpload, $manager,
$errorMsgM);
} else {
$errorMsgM = 'ThumbnailExists'; // in case we only need
small or large, because of if clause bellow
}
//Large thumbnail
if ($large == 1) {
PhocacartFileThumbnail::createFileThumbnail($file['name_original_abs'],
$thumbNameL->abs, 'large', $frontUpload, $manager,
$errorMsgL);
} else {
$errorMsgL = 'ThumbnailExists'; // in case we only need
small or medium, because of if clause bellow
}
// Error messages for all 3 thumbnails (if the message contains error
string, we got error
// Other strings can be:
// - ThumbnailExists - do not display error message nor success page
// - OnlyInformation - do not display error message nor success page
// - DisabledThumbCreation - do not display error message nor success
page
$creatingSError = $creatingMError = $creatingLError = false;
$creatingSError = preg_match("/Error/i", $errorMsgS);
$creatingMError = preg_match("/Error/i", $errorMsgM);
$creatingLError = preg_match("/Error/i", $errorMsgL);
// There is an error while creating thumbnail in m or in s or in l
if ($creatingSError || $creatingMError || $creatingLError) {
// if all or two errors appear, we only display the last error
message
// because the errors in this case is the same
if ($errorMsgS != '') {
$creatingError = $errorMsgS;
}
if ($errorMsgM != '') {
$creatingError = $errorMsgM;
}
if ($errorMsgL != '') {
$creatingError = $errorMsgL;
}
// because the errors in this case is the same
$returnFrontMessage =
JText::_('COM_PHOCACART_ERROR_CREATING_THUMBNAIL') . '
(' . $creatingError . ')';
} else if ($errorMsgS == '' && $errorMsgM ==
'' && $errorMsgL == '') {
$returnFrontMessage = 'Success';
} else if ($errorMsgS == '' && $errorMsgM ==
'' && $errorMsgL == 'ThumbnailExists') {
$returnFrontMessage = 'Success';
} else if ($errorMsgS == '' && $errorMsgM ==
'ThumbnailExists' && $errorMsgL ==
'ThumbnailExists') {
$returnFrontMessage = 'Success';
} else if ($errorMsgS == '' && $errorMsgM ==
'ThumbnailExists' && $errorMsgL == '') {
$returnFrontMessage = 'Success';
} else if ($errorMsgS == 'ThumbnailExists' &&
$errorMsgM == 'ThumbnailExists' && $errorMsgL ==
'') {
$returnFrontMessage = 'Success';
} else if ($errorMsgS == 'ThumbnailExists' &&
$errorMsgM == '' && $errorMsgL == '') {
$returnFrontMessage = 'Success';
} else if ($errorMsgS == 'ThumbnailExists' &&
$errorMsgM == '' && $errorMsgL ==
'ThumbnailExists') {
$returnFrontMessage = 'Success';
} else if ($errorMsgS == 'ThumbnailExists' &&
$errorMsgM == 'ThumbnailExists' && $errorMsgL ==
'ThumbnailExists') {
$returnFrontMessage = 'SuccessThumbnailExists';
}
if ($returnFrontMessage == 'Success') {
return '<span class="ph-result-txt
ph-success-txt">' .
JText::_('COM_PHOCACART_THUMBNAIL_CREATED').
'</span>';
} else if ($returnFrontMessage == 'SuccessThumbnailExists')
{
return '<span class="ph-result-txt
ph-success-txt">' .
JText::_('COM_PHOCACART_THUMBNAIL_EXISTS') .
'</span>';
} else {
return '<span class="ph-result-txt
ph-error-txt">' . $returnFrontMessage .
'</span>';
}
}
}
break;
}
return $file;
}
public static function dontCreateThumb ($filename) {
$dontCreateThumb = false;
$dontCreateThumbArray = array ('watermark-large.png',
'watermark-medium.png');
foreach ($dontCreateThumbArray as $key => $value) {
if (strtolower($filename) == strtolower($value)) {
return true;
}
}
return false;
}
public static function createThumbnailFolder($folderOriginal,
$folderThumbnail, &$errorMsg) {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$enable_thumb_creation = $paramsC->get(
'enable_thumb_creation', 1 );
$folder_permissions = $paramsC->get( 'folder_permissions',
0755 );
//$folder_permissions = octdec((int)$folder_permissions);
// disable or enable the thumbnail creation
if ($enable_thumb_creation == 1) {
if (JFolder::exists($folderOriginal)) {
if (strlen($folderThumbnail) > 0) {
$folderThumbnail = JPath::clean($folderThumbnail);
if (!JFolder::exists($folderThumbnail) &&
!JFile::exists($folderThumbnail)) {
switch((int)$folder_permissions) {
case 777:
JFolder::create($folderThumbnail, 0777 );
break;
case 705:
JFolder::create($folderThumbnail, 0705 );
break;
case 666:
JFolder::create($folderThumbnail, 0666 );
break;
case 644:
JFolder::create($folderThumbnail, 0644 );
break;
case 755:
Default:
JFolder::create($folderThumbnail, 0755 );
break;
}
//JFolder::create($folderThumbnail, $folder_permissions );
if (isset($folderThumbnail)) {
$data = "<html>\n<body
bgcolor=\"#FFFFFF\">\n</body>\n</html>";
JFile::write($folderThumbnail."/index.html", $data);
}
// folder was not created
if (!JFolder::exists($folderThumbnail)) {
$errorMsg = 'ErrorCreatingFolder';
return false;
}
}
}
}
$errorMsg = 'Success';
return true;
} else {
$errorMsg = 'DisabledThumbCreation';
return false; // User have disabled the thumbanil creation e.g. because
of error
}
}
public static function createFileThumbnail($fileOriginal, $fileThumbnail,
$size, $frontUpload=0, $manager = '', &$errorMsg =
'') {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$enable_thumb_creation = $paramsC->get(
'enable_thumb_creation', 1);
$watermarkParams['create'] = $paramsC->get(
'create_watermark', 0 );// Watermark
$watermarkParams['x'] = $paramsC->get(
'watermark_position_x', 'center' );
$watermarkParams['y'] = $paramsC->get(
'watermark_position_y', 'middle' );
$crop_thumbnail = $paramsC->get( 'crop_thumbnail', 5);//
Crop or not
$create_webp_copy = $paramsC->get( 'create_webp_copy',
0);
$crop = null;
switch ($size) {
case 'small':
if ($crop_thumbnail == 3 || $crop_thumbnail == 5 || $crop_thumbnail ==
6 || $crop_thumbnail == 7 ) {
$crop = 1;
}
break;
case 'medium':
if ($crop_thumbnail == 2 || $crop_thumbnail == 4 || $crop_thumbnail ==
5 || $crop_thumbnail == 7 ) {
$crop = 1;
}
break;
case 'large':
Default:
if ($crop_thumbnail == 1 || $crop_thumbnail == 4 || $crop_thumbnail ==
6 || $crop_thumbnail == 7 ) {
$crop = 1;
}
break;
}
// disable or enable the thumbnail creation
if ($enable_thumb_creation == 1) {
$fileResize = PhocacartFileThumbnail::getThumbnailResize($size);
if (JFile::exists($fileOriginal)) {
//file doesn't exist, create thumbnail
$doThumbnail = false;
if(!JFile::exists($fileThumbnail)) {
$doThumbnail = true;
}
// WEBP COPY
if($create_webp_copy &&
!JFile::exists(PhocacartFile::changeFileExtension($fileThumbnail,
'webp'))) {
$doThumbnail = true;
self::deleteFileThumbnail($fileOriginal, 1, 1, 1, $manager);
}
if ($doThumbnail) {
$errorMsg = 'Error4';
//Don't do thumbnail if the file is smaller (width, height) than
the possible thumbnail
list($width, $height) = GetImageSize($fileOriginal);
//larger
/*phocacart import('phocacart.image.imagemagic');*/
if ($width > $fileResize['width'] || $height >
$fileResize['height']) {
$imageMagic = PhocacartImageMagic::imageMagic($fileOriginal,
$fileThumbnail, $fileResize['width'] ,
$fileResize['height'], $crop, null, $watermarkParams,
$frontUpload, $manager, $errorMsg);
} else {
$imageMagic = PhocacartImageMagic::imageMagic($fileOriginal,
$fileThumbnail, $width , $height, $crop, null, $watermarkParams,
$frontUpload, $manager, $errorMsg);
}
if ($imageMagic) {
return true;
} else {
return false;// error Msg will be taken from imageMagic
}
} else {
$errorMsg = 'ThumbnailExists';//thumbnail exists
return false;
}
} else {
$errorMsg = 'ErrorFileOriginalNotExists';
return false;
}
$errorMsg = 'Error3';
return false;
} else {
$errorMsg = 'DisabledThumbCreation'; // User have disabled the
thumbanil creation e.g. because of error
return false;
}
}
public static function getThumbnailResize($size = 'all') {
// Get width and height from Default settings
$params = PhocacartUtils::getComponentParameters();
$large_image_width = $params->get( 'large_image_width', 640
);
$large_image_height = $params->get( 'large_image_height',
480 );
$medium_image_width = $params->get( 'medium_image_width',
300 );
$medium_image_height= $params->get( 'medium_image_height',
200 );
$small_image_width = $params->get( 'small_image_width', 180
);
$small_image_height = $params->get( 'small_image_height',
120 );
switch ($size) {
case 'large':
$fileResize['width'] = $large_image_width;
$fileResize['height'] = $large_image_height;
break;
case 'medium':
$fileResize['width'] = $medium_image_width;
$fileResize['height'] = $medium_image_height;
break;
case 'small':
$fileResize['width'] = $small_image_width;
$fileResize['height'] = $small_image_height;
break;
Default:
case 'all':
$fileResize['smallwidth'] = $small_width;
$fileResize['smallheight'] = $small_height;
$fileResize['mediumwidth'] = $medium_width;
$fileResize['mediumheight'] = $medium_height;
$fileResize['largewidth'] = $large_width;
$fileResize['largeheight'] = $large_height;
break;
}
return $fileResize;
}
}
?>
PK�"�[�\j�j�#libraries/phocacart/file/upload.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.filesystem.folder' );
jimport( 'joomla.filesystem.file' );
class PhocacartFileUpload
{
public static function realMultipleUpload($frontEnd = 0)
{
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$chunkMethod = $paramsC->get('multiple_upload_chunk',
0);
$uploadMethod =
$paramsC->get('multiple_upload_method', 4);
$overwriteExistingFiles =
$paramsC->get('overwrite_existing_files', 0);
$app->allowCache(false);
// Chunk Files
header('Content-type: text/plain; charset=UTF-8');
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y
H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache,
must-revalidate");
header("Cache-Control: post-check=0, pre-check=0",
false);
header("Pragma: no-cache");
// Invalid Token
JSession::checkToken('request') or
jexit(json_encode(array('jsonrpc' => '2.0',
'result' => 'error', 'code' => 100,
'message' =>
JText::_('COM_PHOCACART_ERROR') . ': ',
'details' =>
JTEXT::_('COM_PHOCACART_INVALID_TOKEN'))));
// Set FTP credentials, if given
$ftp = JClientHelper::setCredentialsFromRequest('ftp');
//$file = JFactory::getApplication()->input->get(
'file', '', 'files', 'array' );
$file =
JFactory::getApplication()->input->files->get('file',
null, 'raw');
$chunk =
JFactory::getApplication()->input->get('chunk', 0,
'', 'int');
$chunks =
JFactory::getApplication()->input->get('chunks', 0,
'', 'int');
$folder =
JFactory::getApplication()->input->get('folder',
'', '', 'path');
$manager =
JFactory::getApplication()->input->get('manager',
'file', '', 'string');
$path = PhocacartPath::getPath($manager);// we use viewback to get
right path
// Make the filename safe
if (isset($file['name'])) {
$file['name'] =
JFile::makeSafe($file['name']);
}
if (isset($folder) && $folder != '') {
$folder = $folder . '/';
}
$chunkEnabled = 0;
// Chunk only if is enabled and only if flash is enabled
if (($chunkMethod == 1 && $uploadMethod == 1) || ($frontEnd
== 0 && $chunkMethod == 0 && $uploadMethod == 1)) {
$chunkEnabled = 1;
}
if (isset($file['name'])) {
// - - - - - - - - - -
// Chunk Method
// - - - - - - - - - -
// $chunkMethod = 1, for frontend and backend
// $chunkMethod = 0, only for backend
if ($chunkEnabled == 1) {
// If chunk files are used, we need to upload parts to temp
directory
// and then we can run e.g. the condition to recognize if
the file already exists
// We must upload the parts to temp, in other case we get
everytime the info
// that the file exists (because the part has the same name
as the file)
// so after first part is uploaded, in fact the file
already exists
// Example: NOT USING CHUNK
// If we upload abc.jpg file to server and there is the
same file
// we compare it and can recognize, there is one,
don't upload it again.
// Example: USING CHUNK
// If we upload abc.jpg file to server and there is the
same file
// the part of current file will overwrite the same file
// and then (after all parts will be uploaded) we can make
the condition to compare the file
// and we recognize there is one - ok don't upload it
BUT the file will be damaged by
// parts uploaded by the new file - so this is why we are
using temp file in Chunk method
$stream = JFactory::getStream();// Chunk Files
$tempFolder = 'pcpluploadtmpfolder' .
'/';
$filepathImgFinal =
JPath::clean($path['orig_abs_ds'] . $folder .
strtolower($file['name']));
$filepathImgTemp =
JPath::clean($path['orig_abs_ds'] . $folder . $tempFolder .
strtolower($file['name']));
$filepathFolderFinal =
JPath::clean($path['orig_abs_ds'] . $folder);
$filepathFolderTemp =
JPath::clean($path['orig_abs_ds'] . $folder . $tempFolder);
$maxFileAge = 60 * 60; // Temp file age in seconds
$lastChunk = $chunk + 1;
$realSize = 0;
// Get the real size - if chunk is uploaded, it is only a
part size, so we must compute all size
// If there is last chunk we can computhe the whole size
if ($lastChunk == $chunks) {
if (JFile::exists($filepathImgTemp) &&
JFile::exists($file['tmp_name'])) {
$realSize = filesize($filepathImgTemp) +
filesize($file['tmp_name']);
}
}
// 5 minutes execution time
@set_time_limit(5 * 60);// usleep(5000);
// If the file already exists on the server:
// - don't copy the temp file to final
// - remove all parts in temp file
// Because some parts are uploaded before we can run the
condition
// to recognize if the file already exists.
// Files should be overwritten
if ($overwriteExistingFiles == 1) {
JFile::delete($filepathImgFinal);
}
if (JFile::exists($filepathImgFinal)) {
if ($lastChunk == $chunks) {
@JFolder::delete($filepathFolderTemp);
}
jexit(json_encode(array('jsonrpc' =>
'2.0', 'result' => 'error',
'code' => 108,
'message' =>
JText::_('COM_PHOCACART_ERROR') . ': ',
'details' =>
JTEXT::_('COM_PHOCACART_FILE_ALREADY_EXISTS'))));
}
if (!PhocacartFileUpload::canUpload($file, $errUploadMsg,
$manager, $frontEnd, $chunkEnabled, $realSize)) {
// If there is some error, remove the temp folder with
temp files
if ($lastChunk == $chunks) {
@JFolder::delete($filepathFolderTemp);
}
jexit(json_encode(array('jsonrpc' =>
'2.0', 'result' => 'error',
'code' => 104,
'message' =>
JText::_('COM_PHOCACART_ERROR') . ': ',
'details' =>
JTEXT::_($errUploadMsg))));
}
// Ok create temp folder and add chunks
if (!JFolder::exists($filepathFolderTemp)) {
@JFolder::create($filepathFolderTemp);
}
// Remove old temp files
if (JFolder::exists($filepathFolderTemp)) {
$dirFiles = JFolder::files($filepathFolderTemp);
if (!empty($dirFiles)) {
foreach ($dirFiles as $fileS) {
$filePathImgS = $filepathFolderTemp . $fileS;
// Remove temp files if they are older than the
max age
if (preg_match('/\\.tmp$/', $fileS)
&& (filemtime($filepathImgTemp) < time() - $maxFileAge)) {
@JFile::delete($filePathImgS);
}
}
}
} else {
jexit(json_encode(array('jsonrpc' =>
'2.0', 'result' => 'error',
'code' => 100,
'message' =>
JText::_('COM_PHOCACART_ERROR') . ': ',
'details' =>
JTEXT::_('COM_PHOCACART_ERROR_FOLDER_UPLOAD_NOT_EXISTS'))));
}
// Look for the content type header
if (isset($_SERVER["HTTP_CONTENT_TYPE"]))
$contentType =
$_SERVER["HTTP_CONTENT_TYPE"];
if (isset($_SERVER["CONTENT_TYPE"]))
$contentType = $_SERVER["CONTENT_TYPE"];
if (strpos($contentType, "multipart") !== false)
{
if (isset($file['tmp_name']) &&
is_uploaded_file($file['tmp_name'])) {
// Open temp file
$out = $stream->open($filepathImgTemp, $chunk ==
0 ? "wb" : "ab");
//$out = fopen($filepathImgTemp, $chunk == 0 ?
"wb" : "ab");
if ($out) {
// Read binary input stream and append it to
temp file
$in = fopen($file['tmp_name'],
"rb");
if ($in) {
while ($buff = fread($in, 4096)) {
$stream->write($buff);
//fwrite($out, $buff);
}
} else {
jexit(json_encode(array('jsonrpc'
=> '2.0', 'result' => 'error',
'code' => 101,
'message' =>
JText::_('COM_PHOCACART_ERROR') . ': ',
'details' =>
JTEXT::_('COM_PHOCACART_ERROR_OPEN_INPUT_STREAM'))));
}
$stream->close();
//fclose($out);
@JFile::delete($file['tmp_name']);
} else {
jexit(json_encode(array('jsonrpc'
=> '2.0', 'result' => 'error',
'code' => 102,
'message' =>
JText::_('COM_PHOCACART_ERROR') . ': ',
'details' =>
JTEXT::_('COM_PHOCACART_ERROR_OPEN_OUTPUT_STREAM'))));
}
} else {
jexit(json_encode(array('jsonrpc' =>
'2.0', 'result' => 'error',
'code' => 103,
'message' =>
JText::_('COM_PHOCACART_ERROR') . ': ',
'details' =>
JTEXT::_('COM_PHOCACART_ERROR_MOVE_UPLOADED_FILE'))));
}
} else {
// Open temp file
$out = $stream->open($filepathImgTemp, $chunk == 0 ?
"wb" : "ab");
//$out = JFile::read($filepathImg);
if ($out) {
// Read binary input stream and append it to temp
file
$in = fopen("php://input",
"rb");
if ($in) {
while ($buff = fread($in, 4096)) {
$stream->write($buff);
}
} else {
jexit(json_encode(array('jsonrpc'
=> '2.0', 'result' => 'error',
'code' => 101,
'message' =>
JText::_('COM_PHOCACART_ERROR') . ': ',
'details' =>
JTEXT::_('COM_PHOCACART_ERROR_OPEN_INPUT_STREAM'))));
}
$stream->close();
//fclose($out);
} else {
jexit(json_encode(array('jsonrpc' =>
'2.0', 'result' => 'error',
'code' => 102,
'message' =>
JText::_('COM_PHOCACART_ERROR') . ': ',
'details' =>
JTEXT::_('COM_PHOCACART_ERROR_OPEN_OUTPUT_STREAM'))));
}
}
// Rename the Temp File to Final File
if ($lastChunk == $chunks) {
/*if(($imginfo = getimagesize($filepathImgTemp)) ===
FALSE) {
JFolder::delete($filepathFolderTemp);
jexit(json_encode(array( 'jsonrpc' =>
'2.0', 'result' => 'error',
'code' => 110,
'message' =>
JText::_('COM_PHOCACART_ERROR').': ',
'details' =>
JTEXT::_('COM_PHOCACART_WARNING_INVALIDIMG'))));
}*/
// Files should be overwritten
if ($overwriteExistingFiles == 1) {
JFile::delete($filepathImgFinal);
}
if (!JFile::move($filepathImgTemp, $filepathImgFinal))
{
JFolder::delete($filepathFolderTemp);
jexit(json_encode(array('jsonrpc' =>
'2.0', 'result' => 'error',
'code' => 109,
'message' =>
JText::_('COM_PHOCACART_ERROR') . ': ',
'details' =>
JTEXT::_('COM_PHOCACART_ERROR_UNABLE_TO_MOVE_FILE') .
'<br />'
.
JText::_('COM_PHOCACART_CHECK_PERMISSIONS_OWNERSHIP'))));
}
JFolder::delete($filepathFolderTemp);
}
if ((int)$frontEnd > 0) {
return $file['name'];
}
jexit(json_encode(array('jsonrpc' =>
'2.0', 'result' => 'OK', 'code'
=> 200,
'message' =>
JText::_('COM_PHOCACART_SUCCESS') . ': ',
'details' =>
JTEXT::_('COM_PHOCACART_FILES_UPLOADED'))));
} else {
// No Chunk Method
$filepathImgFinal =
JPath::clean($path['orig_abs_ds'] . $folder .
strtolower($file['name']));
$filepathFolderFinal =
JPath::clean($path['orig_abs_ds'] . $folder);
if (!PhocacartFileUpload::canUpload($file, $errUploadMsg,
$manager, $frontEnd, $chunkMethod, 0)) {
jexit(json_encode(array('jsonrpc' =>
'2.0', 'result' => 'error',
'code' => 104,
'message' =>
JText::_('COM_PHOCACART_ERROR') . ': ',
'details' =>
JTEXT::_($errUploadMsg))));
}
if (JFile::exists($filepathImgFinal) &&
$overwriteExistingFiles == 0) {
jexit(json_encode(array('jsonrpc' =>
'2.0', 'result' => 'error',
'code' => 108,
'message' =>
JText::_('COM_PHOCACART_ERROR') . ': ',
'details' =>
JTEXT::_('COM_PHOCACART_FILE_ALREADY_EXISTS'))));
}
if (!JFile::upload($file['tmp_name'],
$filepathImgFinal, false, true)) {
PhocacartLog::add(2, 'Error uploading file - JFile
upload Ajax', 0, 'File: ' . $file['name'] .
', File Path: ' . $filepathImgFinal);
jexit(json_encode(array('jsonrpc' =>
'2.0', 'result' => 'error',
'code' => 109,
'message' =>
JText::_('COM_PHOCACART_ERROR') . ': ',
'details' =>
JTEXT::_('COM_PHOCACART_ERROR_UNABLE_TO_UPLOAD_FILE') .
'<br />'
.
JText::_('COM_PHOCACART_CHECK_PERMISSIONS_OWNERSHIP'))));
}
if ((int)$frontEnd > 0) {
return $file['name'];
}
jexit(json_encode(array('jsonrpc' =>
'2.0', 'result' => 'OK', 'code'
=> 200,
'message' =>
JText::_('COM_PHOCACART_SUCCESS') . ': ',
'details' =>
JTEXT::_('COM_PHOCACART_IMAGES_UPLOADED'))));
}
} else {
// No isset $file['name']
PhocacartLog::add(2, 'Error uploading file - Filename does
not exist', 0, 'File: File does not exist - Multiple Upload
');
jexit(json_encode(array('jsonrpc' =>
'2.0', 'result' => 'error',
'code' => 104,
'message' =>
JText::_('COM_PHOCACART_ERROR') . ': ',
'details' =>
JTEXT::_('COM_PHOCACART_ERROR_UNABLE_TO_UPLOAD_FILE'))));
}
}
public static function realSingleUpload($frontEnd = 0)
{
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
// $chunkMethod = $paramsC->get(
'multiple_upload_chunk', 0 );
// $uploadMethod = $paramsC->get(
'multiple_upload_method', 1 );
$overwriteExistingFiles =
$paramsC->get('overwrite_existing_files', 0);
JSession::checkToken('request') or jexit('ERROR:
' . JTEXT::_('COM_PHOCACART_INVALID_TOKEN'));
$app->allowCache(false);
$file =
JFactory::getApplication()->input->files->get('Filedata',
null, 'raw');
//$file = J R equest::getVar( 'Filedata',
'', 'files', 'array' );
$folder =
JFactory::getApplication()->input->get('folder',
'', '', 'path');
$format =
JFactory::getApplication()->input->get('format',
'html', '', 'cmd');
$return =
JFactory::getApplication()->input->get('return-url', null,
'post', 'base64');//includes field
$viewBack =
JFactory::getApplication()->input->get('viewback',
'', '', '');
$manager =
JFactory::getApplication()->input->get('manager',
'file', '', 'string');
$tab =
JFactory::getApplication()->input->get('tab', '',
'', 'string');
$field =
JFactory::getApplication()->input->get('field');
$errUploadMsg = '';
$folderUrl = $folder;
$tabUrl = '';
$component =
JFactory::getApplication()->input->get('option',
'', '', 'string');
$path = PhocacartPath::getPath($manager);// we use viewback to get
right path
// In case no return value will be sent (should not happen)
if ($component != '' && $frontEnd == 0) {
$componentUrl = 'index.php?option=' . $component;
} else {
$componentUrl = 'index.php';
}
if ($tab != '') {
$tabUrl = '&tab=' . (string)$tab;
}
$ftp = JClientHelper::setCredentialsFromRequest('ftp');
// Make the filename safe
if (isset($file['name'])) {
$file['name'] =
JFile::makeSafe($file['name']);
}
if (isset($folder) && $folder != '') {
$folder = $folder . '/';
}
// All HTTP header will be overwritten with js message
if (isset($file['name'])) {
$filepath = JPath::clean($path['orig_abs_ds'] .
$folder . strtolower($file['name']));
if (!PhocacartFileUpload::canUpload($file, $errUploadMsg,
$manager, $frontEnd)) {
if ($errUploadMsg ==
'COM_PHOCACART_WARNFILETOOLARGE') {
$errUploadMsg = JText::_($errUploadMsg) . '
(' . PhocacartFile::getFileSizeReadable($file['size']) .
')';
} /* else if ($errUploadMsg ==
'COM_PHOCACART_WARNING_FILE_TOOLARGE_RESOLUTION') {
$imgSize =
phocacartImage::getImageSize($file['tmp_name']);
$errUploadMsg = JText::_($errUploadMsg) . '
('.(int)$imgSize[0].' x '.(int)$imgSize[1].'
px)';
} */ else {
$errUploadMsg = JText::_($errUploadMsg);
}
if ($return) {
$app->enqueueMessage($errUploadMsg,
'error');
$app->redirect(base64_decode($return) .
'&manager=' . (string)$manager . '&folder=' .
$folderUrl);
exit;
} else {
$app->enqueueMessage($errUploadMsg,
'error');
$app->redirect($componentUrl);
exit;
}
}
if (JFile::exists($filepath) && $overwriteExistingFiles
== 0) {
if ($return) {
$app->enqueueMessage(JText::_('COM_PHOCACART_FILE_ALREADY_EXISTS'),
'error');
$app->redirect(base64_decode($return) .
'&manager=' . (string)$manager . '&folder=' .
$folderUrl);
exit;
} else {
$app->enqueueMessage(JText::_('COM_PHOCACART_FILE_ALREADY_EXISTS'),
'error');
$app->redirect($componentUrl);
exit;
}
}
if (!JFile::upload($file['tmp_name'], $filepath,
false, true)) {
PhocacartLog::add(2, 'Error uploading file - JFile
upload', 0, 'File: ' . $file['name'] . ',
File Path: ' . $filepath);
if ($return) {
$app->enqueueMessage(JText::_('COM_PHOCACART_ERROR_UNABLE_TO_UPLOAD_FILE'),
'error');
$app->redirect(base64_decode($return) .
'&manager=' . (string)$manager . '&folder=' .
$folderUrl);
exit;
} else {
$app->enqueueMessage(JText::_('COM_PHOCACART_ERROR_UNABLE_TO_UPLOAD_FILE'),
'error');
$app->redirect($componentUrl);
exit;
}
} else {
if ((int)$frontEnd > 0) {
return $file['name'];
}
if ($return) {
$app->enqueueMessage(JText::_('COM_PHOCACART_SUCCESS_FILE_UPLOADED'));
$app->redirect(base64_decode($return) .
'&manager=' . (string)$manager . '&folder=' .
$folderUrl);
exit;
} else {
$app->enqueueMessage(JText::_('COM_PHOCACART_SUCCESS_FILE_UPLOADED'));
$app->redirect($componentUrl);
exit;
}
}
} else {
PhocacartLog::add(2, 'Error uploading file - Filename does
not exist', 0, 'File: File does not exist (Single
Upload)');
$msg =
JText::_('COM_PHOCACART_ERROR_UNABLE_TO_UPLOAD_FILE');
if ($return) {
$app->enqueueMessage($msg);
$app->redirect(base64_decode($return) .
'&manager=' . (string)$manager . '&folder=' .
$folderUrl);
exit;
} else {
if ($viewBack != '') {
$group =
PhocacartUtilsSettings::getManagerGroup($manager);
$link =
'index.php?option=com_phocacart&view=phocacartmanager&manager='
. (string)$manager
. str_replace('&',
'&', $group['c']) . '&' . $tabUrl .
'&folder=' . $folder . '&field=' . $field;
$app->enqueueMessage($msg);
$app->redirect($link);
} else {
$app->enqueueMessage($msg, 'error');
$app->redirect('index.php?option=com_phocacart');
}
}
}
}
public static function canUpload($file, &$err, $manager =
'', $frontEnd = 0, $chunkEnabled = 0, $realSize = 0)
{
$paramsC = PhocacartUtils::getComponentParameters();
if ($frontEnd == 1) {
$aft =
$paramsC->get('allowed_file_types_upload_frontend',
'{gif=image/gif}{jpeg=image/jpeg}{jpg=image/jpeg}{png=image/png}{webp=image/webp}');
//$dft = $paramsC->get(
'disallowed_file_types_upload', '' );
$allowedMimeType = PhocacartFile::getMimeTypeString($aft);
//$disallowedMimeType =
PhocacartFile::getMimeTypeString($dft);
$ignoreUploadCh = 0;
$ignoreUploadCheck =
$paramsC->get('ignore_file_types_check', 0);
if ($ignoreUploadCheck == 1 || $ignoreUploadCheck == 4) {
$ignoreUploadCh = 1;
}
} else {
$aft =
$paramsC->get('allowed_file_types_upload_backend',
'{gif=image/gif}{jpeg=image/jpeg}{jpg=image/jpeg}{png=image/png}{webp=image/webp}{tar=application/x-tar}{tgz=application/x-tar}{zip=application/x-zip}{rar=application/x-rar-compressed}{tar=application/tar}{tgz=application/tar}{zip=application/zip}{rar=application/rar-compressed}{pdf=application/pdf}{txt=text/plain}{xml=text/xml}{doc=application/msword}{xls=application/vnd.ms-excel}{ppt=application/powerpoint}{odt=application/vnd.oasis.opendocument.text}{ods=application/vnd.oasis.opendocument.spreadsheet}{odp=application/vnd.oasis.opendocument.presentation}{docx=application/vnd.openxmlformats-officedocument.wordprocessingml.document}{xlsx=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet}{pptx=application/vnd.openxmlformats-officedocument.presentationml.presentation}{mp3=audio/mpeg}{mp4=video/mp4}');
//$dft = $paramsC->get(
'disallowed_file_types_download', '' );
$allowedMimeType = PhocacartFile::getMimeTypeString($aft);
//$disallowedMimeType =
PhocacartFile::getMimeTypeString($dft);
$ignoreUploadCh = 0;
$ignoreUploadCheck =
$paramsC->get('ignore_file_types_check', 0);
if ($ignoreUploadCheck == 1 || $ignoreUploadCheck == 5) {
$ignoreUploadCh = 1;
}
}
$paramsL = array();
$group = PhocacartUtilsSettings::getManagerGroup($manager);
$paramsL['upload_extensions'] =
$allowedMimeType['ext'];
$paramsL['image_extensions'] =
'gif,jpg,png,jpeg,webp';
$paramsL['upload_mime'] =
$allowedMimeType['mime'];
//$paramsL['upload_mime_illegal'] ='application/x-shockwave-flash,application/msword,application/excel,application/pdf,application/powerpoint,text/plain,application/x-zip,text/html';
//$paramsL['upload_ext_illegal'] =
$disallowedMimeType['ext'];
// The file doesn't exist
if (empty($file['name'])) {
$err = 'COM_PHOCACART_WARNING_INPUT_FILE_UPLOAD';
return false;
}
// Not safe file
jimport('joomla.filesystem.file');
if ($file['name'] !==
JFile::makesafe($file['name'])) {
$err = 'COM_PHOCACART_WARNFILENAME';
return false;
}
$format = strtolower(JFile::getExt($file['name']));
if ($ignoreUploadCh == 1) {
} else {
$allowable = explode(',',
$paramsL['upload_extensions']);
$allowableImage = explode(',',
$paramsL['image_extensions']);
/*$notAllowable = explode( ',',
$paramsL['upload_ext_illegal']);
if(in_array($format, $notAllowable)) {
$err = 'COM_PHOCACART_WARNFILETYPE_DISALLOWED';
return false;
}*/
//if (!in_array($format, $allowable)) {
// Check file extensions able to upload
if ($format == '' || $format == false ||
(!in_array($format, $allowable))) {
$err = 'COM_PHOCACART_WARNFILETYPE_NOT_ALLOWED';
return false;
}
// Some views can only upload images, so additional check to
allowed file mime types
if ($group['i'] == 1) {
if (!in_array($format, $allowableImage)) {
$err =
'COM_PHOCACART_WARNFILETYPE_NOT_ALLOWED';
return false;
}
}
}
// Max size of image
// If chunk method is used, we need to get computed size
if ((int)$frontEnd > 0) {
$maxSize =
$paramsC->get('upload_maxsize_frontend', 3145728);
} else {
$maxSize = $paramsC->get('upload_maxsize',
3145728);
}
if ($chunkEnabled == 1) {
if ((int)$maxSize > 0 && (int)$realSize >
(int)$maxSize) {
$err = 'COM_PHOCACART_WARNFILETOOLARGE';
return false;
}
} else {
if ((int)$maxSize > 0 &&
(int)$file['size'] > (int)$maxSize) {
$err = 'COM_PHOCACART_WARNFILETOOLARGE';
return false;
}
}
// User (only in ucp) - Check the size of all files by users
/*if ($frontEnd == 2) {
$user = PhocacartUser::getUser();
$maxUserUploadSize = (int)$paramsC->get(
'user_files_max_size', 20971520 );
$maxUserUploadCount = (int)$paramsC->get(
'user_files_max_count', 5 );
$allFile = PhocacartUser:: getUserFileInfo($file,
$user->id);
if ($chunkEnabled == 1) {
$fileSize = $realSize;
} else {
$fileSize = $file['size'];
}
if ((int)$maxUserUploadSize > 0 && (int)
$allFile['size'] > $maxUserUploadSize) {
$err =
JText::_('COM_PHOCACART_WARNUSERFILESTOOLARGE');
return false;
}
if ((int) $allFile['count'] > $maxUserUploadCount)
{
$err =
JText::_('COM_PHOCACART_WARNUSERFILESTOOMUCH');
return false;
}
}*/
// Image check
$imginfo = null;
$images = explode(',',
$paramsL['image_extensions']);
if (in_array($format, $images)) { // if its an image run it through
getimagesize
if ($group['i'] == 1) {
if ($chunkEnabled != 1) {
if (($imginfo =
getimagesize($file['tmp_name'])) === FALSE) {
$err = 'COM_PHOCACART_WARNINVALIDIMG';
if (isset($imginfo[0]) && $imginfo[0] !=
'') {
$err = $imginfo[0];
}
return false;
}
}
}
} else if (!in_array($format, $images)) { // if its not an
image...and we're not ignoring it
$allowed_mime = explode(',',
$paramsL['upload_mime']);
//$illegal_mime = explode(',',
$paramsL['upload_mime_illegal']);
if (function_exists('finfo_open')) {// We have
fileinfo
$finfo = finfo_open(FILEINFO_MIME);
$type = finfo_file($finfo, $file['tmp_name'],
FILEINFO_MIME_TYPE );
if (strlen($type) && !in_array($type,
$allowed_mime) /* && in_array($type, $illegal_mime)*/) {
$err = 'COM_PHOCACART_WARNINVALIDMIME';
return false;
}
finfo_close($finfo);
} else if (function_exists('mime_content_type')) { //
we have mime magic
$type = mime_content_type($file['tmp_name']);
if (strlen($type) && !in_array($type,
$allowed_mime) /*&& in_array($type, $illegal_mime)*/) {
$err = 'COM_PHOCACART_WARNINVALIDMIME';
return false;
}
}
}
// XSS Check
$xss_check = JFile::read($file['tmp_name'], false, 256);
$html_tags = PhocacartUtilsSettings::getHTMLTagsUpload();
foreach ($html_tags as $tag) { // A tag is '<tagname
', so we need to add < and a space or '<tagname>'
if (stristr($xss_check, '<' . $tag . '
') || stristr($xss_check, '<' . $tag . '>'))
{
$err = 'COM_PHOCACART_WARNIEXSS';
return false;
}
}
return true;
}
public static function renderFTPaccess()
{
$ftpOutput = '<fieldset title="' .
JText::_('COM_PHOCACART_FTP_LOGIN_LABEL') .
'">'
. '<legend>' .
JText::_('COM_PHOCACART_FTP_LOGIN_LABEL') .
'</legend>'
. JText::_('COM_PHOCACART_FTP_LOGIN_DESC')
. '<table class="adminform
nospace">'
. '<tr>'
. '<td width="120"><label
for="username">' . JText::_('JGLOBAL_USERNAME')
. ':</label></td>'
. '<td><input type="text"
id="username" name="username"
class="input_box" size="70" value=""
/></td>'
. '</tr>'
. '<tr>'
. '<td width="120"><label
for="password">' . JText::_('JGLOBAL_PASSWORD')
. ':</label></td>'
. '<td><input type="password"
id="password" name="password"
class="input_box" size="70" value=""
/></td>'
. '</tr></table></fieldset>';
return $ftpOutput;
}
public static function renderCreateFolder($sessName, $sessId,
$currentFolder, $viewBack, $attribs = '')
{
if ($attribs != '') {
$attribs = '&' . $attribs;
}
$folderOutput = '<form action="' . JURI::base()
.
'index.php?option=com_phocacart&task=phocacartupload.createfolder&'
. $sessName . '=' . $sessId . '&'
. JSession::getFormToken() . '=1&viewback=' .
$viewBack . '&'
. 'folder=' .
PhocacartText::filterValue($currentFolder, 'folderpath') .
$attribs . '" name="folderForm"
id="folderForm" method="post"
class="form-inline" >' . "\n"
. '<h4>' .
JText::_('COM_PHOCACART_FOLDER') . '</h4>' .
"\n"
. '<div class="path">'
. '<input class="inputbox"
type="text" id="foldername" name="foldername"
/>'
. '<input class="update-folder"
type="hidden" name="folderbase"
id="folderbase" value="' .
PhocacartText::filterValue($currentFolder, 'folderpath') .
'" />'
. ' <button type="submit" class="btn
btn-success">' .
JText::_('COM_PHOCACART_CREATE_FOLDER') .
'</button>'
. '</div>' . "\n"
. Joomla\CMS\HTML\HTMLHelper::_('form.token')
. '</form>';
return $folderOutput;
}
public static function submitItemUpload($files, $data, &$fileData,
$type = 'image')
{
$pC =
PhocacartUtils::getComponentParameters();
$submit_item_upload_image_maxsize =
$pC->get('submit_item_upload_image_maxsize', 512000);
$submit_item_upload_image_count =
$pC->get('submit_item_upload_image_count', 1);
$app = JFactory::getApplication();
$path = PhocacartPath::getPath('submititem');
$folder = $data['upload_folder'];
if (!empty($files)) {
$i = 1;
foreach ($files as $k => $v) {
if (isset($v['name'])) {
$errUploadMsg = '';
if (!PhocacartFileUpload::canUpload( $v, $errUploadMsg,
'submitimage', 1 )) {
if ($errUploadMsg ==
'COM_PHOCACART_WARNFILETOOLARGE') {
$errUploadMsg = JText::_($errUploadMsg) .
'
('.PhocacartFile::getFileSizeReadable($v['size']).')';
} /* else if ($errUploadMsg ==
'COM_PHOCACART_WARNING_FILE_TOOLARGE_RESOLUTION') {
$imgSize =
phocacartImage::getImageSize($file['tmp_name']);
$errUploadMsg = JText::_($errUploadMsg) .
' ('.(int)$imgSize[0].' x '.(int)$imgSize[1].'
px)';
} */ else {
$errUploadMsg = JText::_($errUploadMsg);
if ($errUploadMsg != '') {
if (isset($v['name']) && $v['name'] !=
'') {
$errUploadMsg = $errUploadMsg . '
('.$v['name'].')';
}
}
}
$app->enqueueMessage($errUploadMsg, 'error');
return false;
}
// Specific check for specific form field types
if ((int)$submit_item_upload_image_maxsize > 0
&& (int)$v['size'] >
(int)$submit_item_upload_image_maxsize ) {
$app->enqueueMessage(JText::_('COM_PHOCACART_WARNFILETOOLARGE'),
'error');
return false;
}
if ($i > (int)$submit_item_upload_image_count ) {
// Don't allow to upload any other file and
return the current data
return true;
}
$i++;
$ext =
PhocacartFile::getExtension($v['name']);
$fileNameToken =
PhocacartUtils::getToken('folder');
$fileNameTokenExt = $fileNameToken .
'.'.$ext;
$folderPath =
JPath::clean($path['orig_abs_ds'] . $folder);
$filePath =
JPath::clean($path['orig_abs_ds'] . $folder . '/'.
$fileNameTokenExt);
PhocacartFile::createUploadFolder('');//
Create Main Upload Folder if not exists
PhocacartFile::createUploadFolder($folder);
if (JFile::exists($filePath)) {
$app->enqueueMessage(
JText::_('COM_PHOCACART_FILE_ALREADY_EXISTS'),
'error');
return false;
}
if (!JFile::upload($v['tmp_name'], $filePath, false, true))
{
PhocacartLog::add(2, 'Error uploading file - JFile upload
(Submit Item)', 0, 'File:
'.strip_tags(htmlspecialchars($v['name'])).', File
Path: '.$filePath );
$app->enqueueMessage(
JText::_('COM_PHOCACART_ERROR_UNABLE_TO_UPLOAD_FILE'),
'error');
return false;
} else {
//$app->enqueueMessage(JText::_('COM_PHOCACART_SUCCESS_FILE_UPLOADED'));
$fileData[$fileNameToken] =
array();
$fileData[$fileNameToken]['id']
= $fileNameToken;
$fileData[$fileNameToken]['name']
= $v['name'];
$fileData[$fileNameToken]['size']
= $v['size'];
$fileData[$fileNameToken]['nametoken']
= $fileNameTokenExt;
$fileData[$fileNameToken]['fullpath']
= $filePath;
// Success File added go further with foreach and
next files
}
} else {
PhocacartLog::add(2, 'Error uploading file - Filename does not
exist (Submit Item)', 0, 'File: File does not exist (Submit
Item)' );
$msg =
JText::_('COM_PHOCACART_ERROR_UNABLE_TO_UPLOAD_FILE');
$app->enqueueMessage($msg);
return false;
}
}
}
return true;
}
}
?>
PK�"�[�&z%+%++libraries/phocacart/file/uploadmultiple.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class PhocacartFileUploadmultiple
{
public $method = 1;
public $url = '';
public $reload = '';
public $maxFileSize = '';
public $chunkSize = '';
public $imageHeight = '';
public $imageWidth = '';
public $imageQuality= '';
public $frontEnd = 0;
public function __construct() {}
static public function renderMultipleUploadLibraries() {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$chunkMethod = $paramsC->get( 'multiple_upload_chunk', 0
);
$uploadMethod = $paramsC->get( 'multiple_upload_method', 4
);
Joomla\CMS\HTML\HTMLHelper::_('behavior.framework', true);//
Load it here to be sure, it is loaded before jquery
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework', false);//
Load it here because of own nonConflict method (nonconflict is set below)
$document = JFactory::getDocument();
/*if ($uploadMethod == 2) {
//$document->addScript(JURI::root(true).'/media/com_phocacart/js/plupload/gears_init.js');
}
if ($uploadMethod == 5) {
//$document->addScript(JURI::root(true).'/media/com_phocacart/js/plupload/plupload.browserplus.js');
}*/
$document->addScript(JURI::root(true).'/media/com_phocacart/js/plupload/plupload.js');
/*if ($uploadMethod == 2) {
$document->addScript(JURI::root(true).'/media/com_phocacart/js/plupload/plupload.gears.js');
}
if ($uploadMethod == 3) {
$document->addScript(JURI::root(true).'/media/com_phocacart/js/plupload/plupload.silverlight.js');
}
if ($uploadMethod == 1) {
$document->addScript(JURI::root(true).'/media/com_phocacart/js/plupload/plupload.flash.js');
}
if ($uploadMethod == 5) {
$document->addScript(JURI::root(true).'/media/com_phocacart/js/plupload/plupload.browserplus.js');
}
if ($uploadMethod == 6) {
$document->addScript(JURI::root(true).'/media/com_phocacart/js/plupload/plupload.html4.js');
}*/
if ($uploadMethod == 4) {
$document->addScript(JURI::root(true).'/media/com_phocacart/js/plupload/plupload.html5.js');
}
$document->addScript(JURI::root(true).'/media/com_phocacart/js/plupload/jquery.plupload.queue/jquery.plupload.queue.js');
JHtml::stylesheet(
'media/com_phocacart/js/plupload/jquery.plupload.queue/css/jquery.plupload.queue.css'
);
}
static public function getMultipleUploadSizeFormat($size) {
$readableSize = PhocacartFile::getFileSizeReadable($size, '%01.0f
%s', 1);
$readableSize = str_replace(' ', '',
$readableSize);
$readableSize = strtolower($readableSize);
return $readableSize;
}
public function renderMultipleUploadJS($frontEnd = 0, $chunkMethod = 0) {
$document = JFactory::getDocument();
switch ($this->method) {
/* case 2:
$name = 'gears_uploader';
$runtime = 'gears';
break;
case 3:
$name = 'silverlight_uploader';
$runtime = 'silverlight';
break;*/
case 4:
default:
$name = 'html5_uploader';
$runtime = 'html5';
break;
/* case 5:
$name = 'browserplus_uploader';
$runtime = 'browserplus';
break;
case 6:
$name = 'html4_uploader';
$runtime = 'html4';
break;
case 1:
default:
$name = 'flash_uploader';
$runtime = 'flash';
break;*/
}
$chunkEnabled = 0;
// Chunk only if is enabled and only if flash is enabled
if (($chunkMethod == 1 && $this->method == 1) ||
($this->frontEnd == 0 && $chunkMethod == 0 &&
$this->method == 1)) {
$chunkEnabled = 1;
}
$this->url = PhocacartText::filterValue($this->url,
'text');
$this->reload = PhocacartText::filterValue($this->reload,
'text');
$this->url = str_replace('&', '&',
$this->url);
$this->reload = str_replace('&', '&',
$this->reload);
$js = 'var pgJQ = jQuery.noConflict();';
$js .='pgJQ(function() {'."\n";
$js.=''."\n";
$js.=' plupload.addI18n({'."\n";
$js.=' \'Select files\' :
\''.addslashes(JText::_('COM_PHOCACART_SELECT_FILES')).'\','."\n";
$js.=' \'Add files to the upload queue and click the start
button.\' :
\''.addslashes(JText::_('COM_PHOCACART_ADD_FILES_TO_UPLOAD_QUEUE_AND_CLICK_START_BUTTON')).'\','."\n";
$js.=' \'Filename\' :
\''.addslashes(JText::_('COM_PHOCACART_FILENAME')).'\','."\n";
$js.=' \'Status\' :
\''.addslashes(JText::_('COM_PHOCACART_STATUS')).'\','."\n";
$js.=' \'Size\' :
\''.addslashes(JText::_('COM_PHOCACART_SIZE')).'\','."\n";
$js.=' \'Add files\' :
\''.addslashes(JText::_('COM_PHOCACART_ADD_FILES')).'\','."\n";
$js.=' \'Add Files\' :
\''.addslashes(JText::_('COM_PHOCACART_ADD_FILES')).'\','."\n";
$js.=' \'Start
upload\':\''.addslashes(JText::_('COM_PHOCACART_START_UPLOAD')).'\','."\n";
$js.=' \'Start
Upload\':\''.addslashes(JText::_('COM_PHOCACART_START_UPLOAD')).'\','."\n";
$js.=' \'Stop upload\' :
\''.addslashes(JText::_('COM_PHOCACART_STOP_CURRENT_UPLOAD')).'\','."\n";
$js.=' \'Stop Upload\' :
\''.addslashes(JText::_('COM_PHOCACART_STOP_CURRENT_UPLOAD')).'\','."\n";
$js.=' \'Stop current upload\' :
\''.addslashes(JText::_('COM_PHOCACART_STOP_CURRENT_UPLOAD')).'\','."\n";
$js.=' \'Start uploading queue\' :
\''.addslashes(JText::_('COM_PHOCACART_START_UPLOADING_QUEUE')).'\','."\n";
$js.=' \'Drag files here.\' :
\''.addslashes(JText::_('COM_PHOCACART_DRAG_FILES_HERE')).'\''."\n";
$js.=' });';
$js.=''."\n";
$js.=' pgJQ("#'.$name.'").pluploadQueue({'."\n";
$js.=' runtimes :
\''.$runtime.'\','."\n";
$js.=' url :
\''.$this->url.'\','."\n";
if ($this->maxFileSize != '0b') {
$js.=' max_file_size :
\''.PhocacartText::filterValue($this->maxFileSize,
'alphanumeric3').'\','."\n";
}
if ($chunkEnabled == 1) {
$js.=' chunk_size : \'1mb\','."\n";
}
$js.=' preinit: attachCallbacks,'."\n";
$js.=' unique_names : false,'."\n";
$js.=' multipart: true,'."\n";
$js.=' filters : ['."\n";
//$js.=' {title :
"'.JText::_('com_phocacart_IMAGE_FILES').'",
extensions : "jpg,gif,png,webp"}'."\n";
//$js.=' {title : "Zip files", extensions :
"zip"}'."\n";
$js.=' ],'."\n";
$js.=''."\n";
/*if ($this->method != 6) {
if ((int)$this->imageWidth > 0 || (int)$this->imageWidth >
0) {
$js.=' resize : {width : '.$this->imageWidth.',
height : '.$this->imageHeight.', quality :
'.$this->imageQuality.'},'."\n";
$js.=''."\n";
}
}*/
/* if ($this->method == 1) {
$js.=' flash_swf_url :
\''.JURI::root(true).'/media/com_phocacart/js/plupload/plupload.flash.swf\''."\n";
} else if ($this->method == 3) {
$js.=' silverlight_xap_url :
\''.JURI::root(true).'/media/com_phocacart/js/plupload/plupload.silverlight.xap\''."\n";
}*/
$js.=' });'."\n";
$js.=''."\n";
$js.='function attachCallbacks(Uploader) {'."\n";
$js.=' Uploader.bind(\'FileUploaded\', function(Up, File,
Response) {'."\n";
$js.=' var obj = eval(\'(\' + Response.response +
\')\');'."\n";
//if ($this->method == 4 || $this->method == 6) {
//if ($this->method == 6) {
// $js.=' var queueFiles = Uploader.total.failed +
Uploader.total.uploaded;'."\n";
// $js.=' var uploaded0 =
Uploader.total.uploaded;'."\n";
//} else {
$js.=' var queueFiles = Uploader.total.failed +
Uploader.total.uploaded + 1;'."\n";
$js.=' var uploaded0 = Uploader.total.uploaded +
1;'."\n";
//}
$js.=''."\n";
$js.=' if ((typeof(obj.result) != \'undefined\')
&& obj.result == \'error\') {'."\n";
$js.=' '."\n";
//if ($this->method == 6) {
//$js.=' var uploaded0 =
Uploader.total.uploaded;'."\n";
//} else {
//$js.=' var uploaded0 = Uploader.total.uploaded +
1;'."\n";
//}
$js.=' Up.trigger("Error", {message : obj.message, code
: obj.code, details : obj.details, file: File});'."\n";
$js.=' if( queueFiles == Uploader.files.length)
{'."\n";
//if ($this->method == 6) {
// $js.=' var uploaded0 =
Uploader.total.uploaded;'."\n";
//} else {
$js.=' var uploaded0 =
Uploader.total.uploaded;'."\n";
//}
$js.=' window.location =
\''.$this->reload.'\' +
\'&muuploaded=\' + uploaded0 + \'&mufailed=\' +
Uploader.total.failed;'."\n";
//$js.=' ale rt(\'Error\' +
obj.message)'."\n";
$js.=' }'."\n";
$js.=' return false; '."\n";
$js.=''."\n";
$js.=' } else {'."\n";
$js.=' if( queueFiles == Uploader.files.length)
{'."\n";
//$js.=' var uploaded = Uploader.total.uploaded +
1;'."\n";
//if ($this->method == 6) {
// $js.=' var uploaded =
Uploader.total.uploaded;'."\n";
//} else {
$js.=' var uploaded = Uploader.total.uploaded +
1;'."\n";
//}
$js.=' window.location =
\''.$this->reload.'\' +
\'&muuploaded=\' + uploaded + \'&mufailed=\' +
Uploader.total.failed;'."\n";
//$js.=' ale rt(\'OK\' +
obj.message)'."\n";
$js.=' }'."\n";
$js.=' }'."\n";
$js.=' });'."\n";
$js.=' '."\n";
$js.=' Uploader.bind(\'Error\', function(Up, ErrorObj)
{'."\n";
$js.=''."\n";
// $js.=' if (ErrorObj.code == 100) { '."\n";
// $js.=' if (typeof ErrorObj.file.id !==
\'undefined\') {';
$js.=' pgJQ(\'#\' +
ErrorObj.file.id).append(\'<div class="alert
alert-error">\'+ ErrorObj.message + ErrorObj.details
+\'</div>\');'."\n";
// $js.=' }'."\n";
$js.=' }); '."\n";
$js.='}';
$js.='});'."\n";// End $(function()
$document->addScriptDeclaration($js);
}
public function getMultipleUploadHTML($width = '', $height =
'330', $mootools = 1) {
switch ($this->method) {
/*case 2:
$name = 'gears_uploader';
$msg = JText::_('COM_PHOCACART_NOT_INSTALLED_GEARS');
break;
case 3:
$name = 'silverlight_uploader';
$msg = JText::_('COM_PHOCACART_NOT_INSTALLED_SILVERLIGHT');
break;*/
case 4:
default:
$name = 'html5_uploader';
$msg = JText::_('COM_PHOCACART_NOT_SUPPORTED_HTML5');
break;
/* case 5:
$name = 'browserplus_uploader';
$msg = JText::_('COM_PHOCACART_NOT_INSTALLED_BROWSERPLUS');
break;
case 6:
$name = 'html4_uploader';
$msg = JText::_('COM_PHOCACART_NOT_SUPPORTED_HTML4');
break;
case 1:
default:
$name = 'flash_uploader';
$msg = JText::_('COM_PHOCACART_NOT_INSTALLED_FLASH');
break;*/
}
$style = '';
if ($width != '') {
$style .= 'width: '.(int)$width.'px;';
}
if ($height != '') {
$style .= 'height: '.(int)$height.'px;';
}
return '<div id="'.$name.'"
style="'.$style.'">'.$msg.'</div>';
}
}
?>
PK�"�[f���BB)libraries/phocacart/file/uploadsingle.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class PhocacartFileUploadsingle
{
public $tab = '';
public $returnUrl = '';
public function __construct() {}
public function getSingleUploadHTML( $frontEnd = 0) {
if ($frontEnd == 1) {
$html = '<input type="hidden"
name="controller" value="category" />'
.'<input type="hidden" name="tab"
value="'.$this->tab.'" />';
} else {
$html = '<input type="file"
id="sfile-upload" name="Filedata" />'
//.'<input type="submit"
id="sfile-upload-submit"
value="'.JText::_('COM_PHOCADOWNLOAD_START_UPLOAD').'"/>'
.'<button class="btn btn-primary"
id="upload-submit"><i class="icon-upload
icon-white"></i>
'.JText::_('COM_PHOCACART_START_UPLOAD').'</button>'
.'<input type="hidden" name="return-url"
value="'. base64_encode($this->returnUrl).'"
/>'
.'<input type="hidden" name="tab"
value="'.$this->tab.'" />';
}
return $html;
}
}
?>PK�"�[���n�}�}%libraries/phocacart/filter/filter.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartFilter
{
//public $taglist = false;
public $tag = false;
public $label = false;
public $parameter = false;
public $manufacturer = false;
public $price = false;
public $attributes = false;
public $specifications = false;
public $category = false;
public $enable_color_filter = false;
public $enable_image_filter = false;
public $image_style_image_filter = false;
public $ordering_tag = 1;
public $ordering_label = 1;
public $ordering_parameter = 1;
public $ordering_manufacturer = 1;
public $ordering_attribute = 1;
public $ordering_specification = 1;
public $ordering_category = 1;
public $manufacturer_title = '';
public $filter_language = 0;
public $open_filter_panel = 1;
public $force_category = 0;
public $limit_attributes_category = 0;
public $limit_tags_category = 0;
public $limit_labels_category = 0;
public $limit_parameters_category = 0;
public $limit_price_category = 0;
public $limit_manufacturers_category = 0;
public $limit_specifications_category = 0;
public $limit_category_count = -1;
public $display_category_count = 0;
public $limit_tag_count = -1;
public $display_tag_count = 0;
public $limit_parameter_count = -1;
public $display_parameter_count = 0;
public $limit_manufacturer_count = -1;
public $display_manufacturer_count = 0;
public $check_available_products = 1;
public $ajax = 0;
public function __construct() {}
public function getActiveFilterValues() {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$manufacturer_alias =
$paramsC->get('manufacturer_alias', 'manufacturer');
$manufacturer_alias = $manufacturer_alias != '' ?
trim(PhocacartText::filterValue($manufacturer_alias,
'alphanumeric')) : 'manufacturer';
$parameters = PhocacartParameter::getAllParameters();
$option = $app->input->get('option',
'', 'string');
$view = $app->input->get('view',
'', 'string');
$id = 0;
if ($option == 'com_phocacart' && ($view ==
'item')) {
$id = $app->input->get('catid',
'', 'int'); // Category ID (Active Category)
} else if ($option == 'com_phocacart' && ($view
== 'items' && $view == 'category')) {
$id = $app->input->get('id',
'', 'int'); // Category ID (Active Category)
}
$c = $app->input->get('c',
'', 'string'); // Category More (All Categories)
$tags = $app->input->get('tag',
'', 'string');
$labels = $app->input->get('label',
'', 'string');
$manufacturers = $app->input->get($manufacturer_alias,
'', 'string');
$price_from = $app->input->get('price_from',
'', 'float');
$price_to = $app->input->get('price_to',
'', 'float');
$a = $app->input->get('a',
'', 'array'); // Attributes
$s = $app->input->get('s',
'', 'array'); // Specifications
// CATEGORY id
$cIdIN = '';
//- $cIdIK = '';
if ($id > 0) {
$cIdIN = (int)$id;
//- $cIdIK = (int)$cIdIN > 0 ? ':cid:' . $cIdIN :
'';
}
// CATEGORY
$cIN = '';
//- $cIK = '';
if ($c != '') {
$cA = explode(',', $c);
$cAN = array_unique(array_map('intval', $cA));
$cIN = implode(',', $cAN);
//- $cIK = (int)$cIN > 0 ? ':c:' . $cIN :
'';
}
// TAGS
$tIN = '';
//- $tIK = '';
if ($tags != '') {
$tA = explode(',', $tags);
$tAN = array_unique(array_map('intval', $tA));
$tIN = implode(',', $tAN);
//- $tIK = (int)$tIN > 0 ? ':t:' . $tIN :
'';
}
// LABELS
$lIN = '';
//- $lIK = '';
if ($labels != '') {
$lA = explode(',', $labels);
$lAN = array_unique(array_map('intval', $lA));
$lIN = implode(',', $lAN);
//- $lIK = (int)$lIN > 0 ? ':l:' . $lIN :
'';
}
// MANUFACTURERS
$mIN = '';
//- $mIK = '';
if ($manufacturers != '') {
$mA = explode(',', $manufacturers);
$mAN = array_unique(array_map('intval', $mA));
$mIN = implode(',', $mAN);
//- $mIK = (int)$mIN > 0 ? ':m:' . $mIN :
'';
}
// PRICE
$pfIN = $pfIK = '';
if ($price_from !== '') {
$pfIN = $price_from;
//- $pfIK = $pfIN > 0 ? ':pf:' . $pfIN :
'';
}
$ptIN = $ptIK = '';
if ($price_to !== '') {
$ptIN = $price_to;
//- $ptIK = $ptIN > 0 ? ':pt:' . $ptIN :
'';
}
// PARAMETERS
$pA = array();
//- $pIK = '';
if (!empty($parameters)) {
foreach ($parameters as $k => $v) {
$alias = trim(PhocacartText::filterValue($v->alias,
'alphanumeric'));
$parameter = $app->input->get($alias, '',
'string');
if ($parameter != '') {
$pIN = implode(',',
array_unique(array_map('intval', explode(',',
$parameter))));
if ((int)$pIN > 0) {
//- $pIK .= ':' . $alias . ':'
. $pIN;
$pA[$alias] = $pIN;
}
}
}
}
// ATTRIBUTES
$aA = array();
//- $aIK = '';
if (!empty($a)) {
foreach ($a as $k => $v) {
$alias = strip_tags($k);
$parameter = strip_tags($v);
$alias = trim(PhocacartText::filterValue($alias,
'alphanumeric'));
if ($parameter != '') {
$aINA = explode(',', $parameter);
$aINA = array_map(function ($item) { return
PhocacartText::filterValue($item, 'alphanumeric'); }, $aINA);
$aINA = array_unique($aINA);
$aIN = implode(',', $aINA);
if ($aIN != '') {
//- $aIK .= ':' . $alias . ':'
. $aIN;
$aA[$alias] = "'" .
implode("','", $aINA) . "'";
}
}
}
}
// SPECIFICATIONS
$sA = array();
//- $sIK = '';
if (!empty($s)) {
foreach ($s as $k => $v) {
$alias = strip_tags($k);
$parameter = strip_tags($v);
$alias = trim(PhocacartText::filterValue($alias,
'alphanumeric'));
if ($parameter != '') {
$sINA = explode(',', $parameter);
$sINA = array_map(function ($item) { return
PhocacartText::filterValue($item, 'alphanumeric'); }, $sINA);
$sINA = array_unique($sINA);
$sIN = implode(',', $sINA);
if ($sIN != '') {
//- $sIK .= ':' . $alias . ':'
. $sIN;
$sA[$alias] = "'" .
implode("','", $sINA) . "'";
}
}
}
}
//- $key = 'k' . $cIdIK . $cIK . $tIK . $lIK . $mIK .
$pfIK . $ptIK . $pIK . $aIK . $sIK;
//- $key = base64_encode(serialize($key));
// Get all items
$f = array();
if ($cIN != '') {
$f['c'] =
PhocacartCategory::getActiveCategories($cIN, $this->ordering_category);
} else if ((int)$cIdIN > 0) {
$f['c'] =
PhocacartCategory::getActiveCategories((int)$cIdIN,
$this->ordering_category);
}
$f['t'] = PhocacartTag::getActiveTags($tIN,
$this->ordering_tag);
$f['l'] = PhocacartTag::getActiveLabels($lIN,
$this->ordering_label);
$f['m'] =
PhocacartManufacturer::getActiveManufacturers($mIN,
$this->ordering_manufacturer, $manufacturer_alias );
$f['price'] = array();
$f['price']['from'] = '';
$f['price']['to'] = '';
if ($pfIN !== '') {
$f['price']['from'] = $pfIN;}
if ($ptIN !== '') { $f['price']['to']
= $ptIN;}
$f['p'] =
PhocacartParameter::getActiveParameterValues($pA,
$this->ordering_parameter);
$f['a'] =
PhocacartAttribute::getActiveAttributeValues($aA,
$this->ordering_attribute);
$f['s'] =
PhocacartSpecification::getActiveSpecificationValues($aA,
$this->ordering_specification);
return $f;
}
public function renderList()
{
$document = JFactory::getDocument();
$p = array();
$pC = PhocacartUtils::getComponentParameters();
$p['manufacturer_alias'] =
$pC->get('manufacturer_alias', 'manufacturer');
$p['manufacturer_alias'] =
$p['manufacturer_alias'] != '' ?
trim(PhocacartText::filterValue($p['manufacturer_alias'],
'alphanumeric')) : 'manufacturer';
$p['display_products_all_subcategories'] =
$pC->get('display_products_all_subcategories', 0);
// $db = JFactory::getDBO();
$o = array();
if ($this->ajax == 0) {
$o[] = '<div id="phFilterBox"
role="tablist">';// AJAX ID
}
$s = PhocacartRenderStyle::getStyles();
//$app = JFactory::getApplication();
$layout = new JLayoutFile('form_filter_checkbox', null,
array('component' => 'com_phocacart')); //foreach
with items in layout
$layout2 = new JLayoutFile('form_filter_text', null,
array('component' => 'com_phocacart'));// foreach
with items in this class
$layout3 = new
JLayoutFile('form_filter_checkbox_categories', null,
array('component' => 'com_phocacart'));// foreach
with items in this class
$layout4 = new JLayoutFile('form_filter_color', null,
array('component' => 'com_phocacart'));// foreach
with items in layout
$layout5 = new JLayoutFile('form_filter_image', null,
array('component' => 'com_phocacart'));// foreach
with items in layout
$language = '';
if ($this->filter_language == 1) {
$lang = JFactory::getLanguage();
$language = $lang->getTag();
}
$pathProductImage =
PhocacartPath::getPath('productimage');
// =FILTER=
$data = array();
$data['s'] = $s;
$data['getparams'] = array();
// - SPECIFIC CASE - CATEGORY -
// When we are in category view the identificator for category is
ID
// When we are in item view the identificator for category is CATID
// When we are in items view (search, filter) the identificator for
category is c=1-category
// So when we are in category or item view and someone will filter
products we can even set the category (form ID or CATID to c=1-category)
for items view
// Parameter for this is "force_category"
// We even can limit filter items like attributes only for specific
category
// Parameter for this is "limit_attributes_category"
(attributes)
$category = PhocacartRoute::getIdForItemsRoute();// Used for
parameter: Filter Category: Yes (Active Category) (int)$this->category
== 1
$forceCategory = array();
$forceCategory['id'] = 0;
$forceCategory['idalias'] = '';
if ($this->force_category == 1) {
$forceCategory = $category;
}
//-CATEGORY- ACTIVE CATEGORY (CATEGORY VIEW)
$data = array();
$data['s'] = $s;
$data['param'] = 'id';
$data['title'] =
JText::_('COM_PHOCACART_CATEGORY');
//$category = PhocacartRoute::getIdForItemsRoute();
$data['getparams'][] = $category['idalias'];
$data['nrinalias'] = 1;
$data['formtype'] = 'category';
$data['uniquevalue'] = 1;
$data['params']['open_filter_panel'] =
$this->open_filter_panel;
if ((int)$this->category == 1 &&
(int)$category['id'] > 0) {
/* phocacart import('phocacart.category.category');*/
$data['items'][] =
PhocacartCategory::getCategoryById($category['id']);
if (!empty($data['items'])) {
$o[] = $layout->render($data);
}
}
// -CATEGORY MORE- (ALL CATEGORIES, ITEMS VIEW)
$data = array();
$data['s'] = $s;
$data['param'] = 'c';
$data['title'] =
JText::_('COM_PHOCACART_CATEGORY');
$data['getparams'] =
$this->getArrayParamValues($data['param'],
'string');
$data['nrinalias'] = 1;
$data['formtype'] = 'checked';
$data['uniquevalue'] = 0;
$data['params']['display_category_count'] =
$this->display_category_count;
$data['forcecategory']['idalias'] =
$forceCategory['idalias'];// This input form field can force
category when filtering from category/item view to items view
// OPEN OR CLOSE PANEL
// $data['params']['open_filter_panel'] =
$this->open_filter_panel;
if ((int)$this->category == 2) {
$data['active'] = 0;
// if we are in category view and want to force active category
when clicking on filter
// so we want to move the category id from CATEGORY VIEW to
ITEMS VIEW
// and we should mark the category active in category list =
$forceActive
$data['items'] =
PhocacartCategory::getCategoryTreeArray($this->ordering_category,
'', '', array(0, 1), $language,
$this->limit_category_count);
$data['output'] =
PhocacartCategory::nestedToCheckBox($data['items'], $data, 0,
$data['active'], $forceCategory['id']);
if ($this->open_filter_panel == 0) {
$data['collapse_class'] =
$s['c']['panel-collapse.collapse'];
$data['triangle_class'] =
$s['i']['triangle-right'];
} else if ($this->open_filter_panel == 2 &&
$data['active'] == 1) {
$data['collapse_class'] =
$s['c']['panel-collapse.collapse.in'];// closed as
default and wait if there is some active item to open it
$data['triangle_class'] =
$s['i']['triangle-bottom'];
} else if ($this->open_filter_panel == 2 &&
$data['active'] == 0) {
$data['collapse_class'] =
$s['c']['panel-collapse.collapse'];
$data['triangle_class'] =
$s['i']['triangle-right'];
} else {
$data['collapse_class'] =
$s['c']['panel-collapse.collapse.in'];
$data['triangle_class'] =
$s['i']['triangle-bottom'];
}
if (!empty($data['items'])) {
$o[] = $layout3->render($data);
}
}
// LIMIT ... TO CATEGORY - Display items only from products of the
current category
$activeProducts = array();
$activeCategory = array();
$activeProductsAttributes = array();
$activeProductsTags = array();
$activeProductsLabels = array();
$activeProductsParameters = array();
$activeProductsPrice = array();
$activeProductsManufacturers = array();
$activeProductsSpecifications = array();
if ($this->limit_attributes_category == 1 ||
$this->limit_tags_category == 1 || $this->limit_labels_category == 1
|| $this->limit_parameters_category == 1
|| $this->limit_price_category == 1 ||
$this->limit_manufacturers_category == 1 ||
$this->limit_specifications_category == 1) {
if ((int)$category['id'] > 0) {
$activeCategory[] = (int)$category['id'];
// Display not only products from category but even from
its subcategories in parent category
if ($p['display_products_all_subcategories'] ==
1) {
$categoryChildrenId =
PhocacartCategoryMultiple::getCategoryChildrenString((int)$category['id'],
(string)$category['id']);
if ($categoryChildrenId !== '') {
$activeCategoryChildren = explode(',',
$categoryChildrenId);
foreach ($activeCategoryChildren as $k => $v) {
$activeCategory[] = (int)$v;
}
}
}
}
if (!empty($data['getparams'])) {
foreach ($data['getparams'] as $k => $v) {
if ((int)$v > 0) {
$activeCategory[] = (int)$v;
}
}
}
$activeCategory = array_unique($activeCategory);
$activeProducts = PhocacartProduct::getProducts(0, 0, 1, 0,
true, false, false, 0, $activeCategory, 0, array(0, 1), 'a.id',
'column');
if ($this->limit_attributes_category == 1) {
$activeProductsAttributes = $activeProducts;
}
if ($this->limit_tags_category == 1) {
$activeProductsTags = $activeProducts;
}
if ($this->limit_labels_category == 1) {
$activeProductsLabels = $activeProducts;
}
if ($this->limit_parameters_category == 1) {
$activeProductsParameters = $activeProducts;
}
if ($this->limit_price_category == 1) {
$activeProductsPrice = $activeProducts;
}
if ($this->limit_manufacturers_category == 1) {
$activeProductsManufacturers = $activeProducts;
}
if ($this->limit_specifications_category == 1) {
$activeProductsSpecifications = $activeProducts;
}
}
// -PRICE- AVAILABLE PRODUCTS ONLY - Yes as default
$data = array();
$data['s'] = $s;
$data['param'] = 'price_from';
$data['param2'] = 'price_to';
$data['id'] = 'phPriceFromTo';
$data['title'] =
JText::_('COM_PHOCACART_PRICE');
$data['title1'] =
JText::_('COM_PHOCACART_PRICE_FROM');
$data['title2'] =
JText::_('COM_PHOCACART_PRICE_TO');
$data['titleset'] =
JText::_('COM_PHOCACART_SET_PRICE');
$data['titleclear'] =
JText::_('COM_PHOCACART_CLEAR_PRICE');
$data['getparams'] =
$this->getArrayParamValues($data['param'],
'string');// string because of setting '' when no value
set
$data['getparams2'] =
$this->getArrayParamValues($data['param2'],
'string');
$data['formtype'] = 'text';
$data['uniquevalue'] = 1;
$data['filterprice'] = $this->price;
$data['forcecategory']['idalias'] =
$forceCategory['idalias'];// This input form field can force
category when filtering from category/item view to items view
// OPEN OR CLOSE PANEL
// $data['params']['open_filter_panel'] =
$this->open_filter_panel;
if ($this->open_filter_panel == 0) {
$data['collapse_class'] =
$s['c']['panel-collapse.collapse'];
$data['triangle_class'] =
$s['i']['triangle-right'];
} else if ($this->open_filter_panel == 2 &&
($data['getparams'][0] != '' ||
$data['getparams2'][0] != '')) {
$data['collapse_class'] =
$s['c']['panel-collapse.collapse.in'];// closed as
default and wait if there is some active item to open it
$data['triangle_class'] =
$s['i']['triangle-bottom'];
} else if ($this->open_filter_panel == 2 &&
($data['getparams'][0] == '' ||
$data['getparams2'][0] == '')) {
$data['collapse_class'] =
$s['c']['panel-collapse.collapse'];
$data['triangle_class'] =
$s['i']['triangle-right'];
} else {
$data['collapse_class'] =
$s['c']['panel-collapse.collapse.in'];
$data['triangle_class'] =
$s['i']['triangle-bottom'];
}
if ($this->price > 0) {
$o[] = $layout2->render($data);
}
// RENDER PRICE FROM TO INPUT RANGE
if ($this->price == 2 || $this->price == 3) {
$media = PhocacartRenderMedia::getInstance('main');
$media->loadUiSlider();
$price_from =
$this->getArrayParamValues('price_from', 'string');
$price_to = $this->getArrayParamValues('price_to',
'string');
$min = PhocacartProduct::getProductPrice(2,
$this->check_available_products, $language, $activeProductsPrice);// min
price
$max = PhocacartProduct::getProductPrice(1,
$this->check_available_products, $language, $activeProductsPrice);// max
price
if (!$min) {
$min = 0;
}
if (!$max) {
$max = 0;
}
if ($price_to[0] == '') {
$price_to[0] = $max;
}
if ($price_from[0] == '') {
$price_from[0] = $min;
}
// PhocacartRenderJs::renderFilterRange($min, $max,
$price_from[0], $price_to[0]);
$oParams = array();
$oParams['filterPriceMin'] = (float)$min;
$oParams['filterPriceMax'] = (float)$max;
$oParams['filterPriceFrom'] = (float)$price_from[0];
$oParams['filterPriceTo'] = (float)$price_to[0];
$oLang = array();
$oLang['COM_PHOCACART_PRICE'] =
JText::_('COM_PHOCACART_PRICE');
$document->addScriptOptions('phParamsPC',
$oParams);
$document->addScriptOptions('phLangPC', $oLang);
}
// -MANUFACTURER- AVAILABLE PRODUCTS ONLY - Yes
$data = array();
$data['s'] = $s;
$data['param'] = $p['manufacturer_alias'];
$data['title'] = $this->manufacturer_title !=
'' ? JText::_($this->manufacturer_title) :
JText::_('COM_PHOCACART_MANUFACTURERS');
$data['getparams'] =
$this->getArrayParamValues($data['param'],
'string');
$data['nrinalias'] = 1;
$data['formtype'] = 'checked';
$data['uniquevalue'] = 0;
$data['params']['open_filter_panel'] =
$this->open_filter_panel;
$data['params']['display_count'] =
$this->display_manufacturer_count;
$data['forcecategory']['idalias'] =
$forceCategory['idalias'];// This input form field can force
category when filtering from category/item view to items view
if ($this->manufacturer) {
/*phocacart
import('phocacart.manufacturer.manufacturer');*/
$data['items'] =
PhocacartManufacturer::getAllManufacturers($this->ordering_manufacturer,
$this->check_available_products, $language,
$activeProductsManufacturers, $this->limit_manufacturer_count);
}
if (!empty($data['items'])) {
$o[] = $layout->render($data);
}
// -TAG-
$data = array();
$data['s'] = $s;
$data['param'] = 'tag';
$data['title'] =
JText::_('COM_PHOCACART_TAGS');
$data['getparams'] =
$this->getArrayParamValues($data['param'],
'string');
$data['nrinalias'] = 1;
$data['formtype'] = 'checked';
$data['uniquevalue'] = 0;
$data['params']['open_filter_panel'] =
$this->open_filter_panel;
$data['params']['display_count'] =
$this->display_tag_count;
$data['forcecategory']['idalias'] =
$forceCategory['idalias'];// This input form field can force
category when filtering from category/item view to items view
if ($this->tag) {
/*phocacart import('phocacart.tag.tag');*/
$data['items'] =
PhocacartTag::getAllTags($this->ordering_tag,
$this->check_available_products, 0, $language, $activeProductsTags,
$this->limit_tag_count);
}
if (!empty($data['items'])) {
$o[] = $layout->render($data);
}
// -LABEL-
$data = array();
$data['s'] = $s;
$data['param'] = 'label';
$data['title'] =
JText::_('COM_PHOCACART_LABELS');
$data['getparams'] =
$this->getArrayParamValues($data['param'],
'string');
$data['nrinalias'] = 1;
$data['formtype'] = 'checked';
$data['uniquevalue'] = 0;
$data['params']['open_filter_panel'] =
$this->open_filter_panel;
$data['params']['display_count'] =
$this->display_tag_count;
$data['forcecategory']['idalias'] =
$forceCategory['idalias'];// This input form field can force
category when filtering from category/item view to items view
if ($this->label) {
/*phocacart import('phocacart.tag.tag');*/
$data['items'] =
PhocacartTag::getAllTags($this->ordering_label,
$this->check_available_products, 1, $language, $activeProductsLabels,
$this->limit_tag_count);
}
if (!empty($data['items'])) {
$o[] = $layout->render($data);
}
// -ATTRIBUTES- AVAILABLE PRODUCTS ONLY - Yes
if ($this->attributes) {
/*phocacart
import('phocacart.attribute.attribute');*/
$attributes =
PhocacartAttribute::getAllAttributesAndOptions($this->ordering_attribute,
$this->check_available_products, $language, $activeProductsAttributes);
if (!empty($attributes)) {
foreach ($attributes as $k => $v) {
$data = array();
$data['s'] = $s;
$data['param'] = 'a[' .
$v['alias'] . ']';
$data['title'] = $v['title'];
$data['items'] = $v['options'];
$data['getparams'] =
$this->getArrayParamValues($data['param'], 'array');
$data['uniquevalue'] = 0;
$data['pathitem'] = $pathProductImage;
$data['params']['open_filter_panel'] =
$this->open_filter_panel;
$data['forcecategory']['idalias'] =
$forceCategory['idalias'];// This input form field can force
category when filtering from category/item view to items view
if (!empty($data['items'])) {
if ($this->enable_color_filter &&
isset($v['type']) && ($v['type'] == 2 ||
$v['type'] == 5)) {
// Color
$data['formtype'] = 'text';
$o[] = $layout4->render($data);
} else if ($this->enable_image_filter &&
isset($v['type']) && ($v['type'] == 3 ||
$v['type'] == 6)) {
// Image
$data['formtype'] = 'text';
$data['style'] =
strip_tags($this->image_style_image_filter);
$o[] = $layout5->render($data);
} else {
// Select
$data['formtype'] =
'checked';
$o[] = $layout->render($data);
}
}
}
}
}
// -SPECIFICATIONS- AVAILABLE PRODUCTS ONLY - Yes
if ($this->specifications) {
/*phocacart
import('phocacart.specification.specification');*/
$specifications =
PhocacartSpecification::getAllSpecificationsAndValues($this->ordering_specification,
$this->check_available_products, $language,
$activeProductsSpecifications);
if (!empty($specifications)) {
foreach ($specifications as $k => $v) {
$data = array();
$data['s'] = $s;
$data['param'] = 's[' .
$v['alias'] . ']';
$data['title'] = $v['title'];
$data['items'] = $v['value'];
$data['getparams'] =
$this->getArrayParamValues($data['param'], 'array');
$data['formtype'] = 'checked';
$data['uniquevalue'] = 0;
$data['pathitem'] = $pathProductImage;
$data['params']['open_filter_panel'] =
$this->open_filter_panel;
$data['forcecategory']['idalias'] =
$forceCategory['idalias'];// This input form field can force
category when filtering from category/item view to items view
if (!empty($data['items'])) {
if ($this->enable_color_filter_spec) {
// Color
$data['formtype'] = 'text';
$o[] = $layout4->render($data);
} else if ($this->enable_image_filter_spec) {
// Image
$data['formtype'] = 'text';
$data['style'] =
strip_tags($this->image_style_image_filter_spec);
$o[] = $layout5->render($data);
} else {
// Select
$data['formtype'] =
'checked';
$o[] = $layout->render($data);
}
}
}
}
}
// -PARAMETERS-
$parameters = PhocacartParameter::getAllParameters();
if (!empty($parameters)) {
foreach ($parameters as $k => $v) {
$data = array();
$data['s'] = $s;
$data['param'] =
trim(PhocacartText::filterValue($v->alias, 'alphanumeric'));
$data['title'] = $v->title;
$data['titleheader'] = $v->title_header;
$data['getparams'] =
$this->getArrayParamValues($data['param'],
'string');
$data['nrinalias'] = 1;
$data['formtype'] = 'checked';
$data['uniquevalue'] = 0;
$data['params']['open_filter_panel'] =
$this->open_filter_panel;
$data['params']['display_count'] =
$this->display_parameter_count;
$data['forcecategory']['idalias'] =
$forceCategory['idalias'];// This input form field can force
category when filtering from category/item view to items view
if ($this->parameter) {
$limitCount = $this->limit_parameter_count;
if (isset($v->limit_count) &&
(int)$v->limit_count > -1) {
$limitCount = (int)$v->limit_count;
}
$data['items'] =
PhocacartParameter::getAllParameterValues((int)$v->id,
$this->ordering_parameter, $this->check_available_products,
$language, $activeProductsParameters, $limitCount);
}
if (!empty($data['items'])) {
$o[] = $layout->render($data);
}
}
}
if ($this->ajax == 0) {
$o[] = '</div>';// End phFilterBox
}
$o2 = implode("\n", $o);
return $o2;
}
public function getArrayParamValues($param, $type = '')
{
// Make array from GET parameter values which are stored in string
separated by comma
$app = JFactory::getApplication();
if ($type == 'int') {
$paramString = $app->input->get($param, 0, $type);
} else if ($type == 'array') {
$paramE = explode('[', $param);
if (isset($paramE[0]) && isset($paramE[1])) {
$paramE[1] = str_replace(']', '',
$paramE[1]);
$paramStringE = $app->input->get($param[0], array(),
$type);
if (isset($paramStringE[$paramE[1]])) {
$paramString = $paramStringE[$paramE[1]];
} else {
$paramString = '';
}
}
} else {
$paramString = $app->input->get($param, '',
$type);
}
$a = explode(',', $paramString);
$inA = array();
if (!empty($a)) {
if ($type == 'int') {
foreach ($a as $k => $v) {
$inA[] = (int)$v;
}
} else {
foreach ($a as $k => $v) {
$inA[] = $v;
}
}
}
return $inA;
}
}
?>
PK�"�[�#o,,%libraries/phocacart/filter/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�#o,,#libraries/phocacart/form/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[���<QQ"libraries/phocacart/form/items.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartFormItems
{
public function __construct() {}
public function getFormItems($billing = 1, $shipping = 1, $account = 0) {
$db = JFactory::getDBO();
$user = PhocacartUser::getUser();
$userLevels = implode (',',
$user->getAuthorisedViewLevels());
$userGroups = implode (',',
PhocacartGroup::getGroupsById($user->id, 1, 1));
$wheres = array();
if ((int)$billing == 1) {
$wheres[] = '(a.display_billing = 1 OR a.display_shipping =
1)';
//$wheres[] = 'a.display_shipping = 1';// they are loaded
together (shipping and billing loaded togehter)
// if billing is disabled and shipping enabled we still need
to load the billing too
}
if ((int)$shipping == 1) {
$wheres[] = '(a.display_shipping = 1 OR a.display_billing =
1)';
//$wheres[] = 'a.display_billing = 1';// they are loaded
together
}
if ((int)$account == 1) {
$wheres[] = 'a.display_account = 1';
}
$wheres[] = 'a.published = 1';
// ACCESS
$wheres[] = " a.access IN (".$userLevels.")";
$wheres[] = " (ga.group_id IN (".$userGroups.") OR
ga.group_id IS NULL)";
$where = ( count( $wheres ) ? ' WHERE '. implode( ' AND
', $wheres ) : '' );
$query = 'SELECT a.id, a.title, a.label, a.description, a.type,
a.predefined_values, a.predefined_values_first_option, a.default, a.class,
a.read_only, a.required, a.pattern, a.maxlength,'
.' a.display_billing, a.display_shipping, a.display_account,
a.validate, a.unique, a.published, a.access'
.' FROM #__phocacart_form_fields AS a'
.' LEFT JOIN #__phocacart_item_groups AS ga ON a.id = ga.item_id
AND ga.type = 9'// type 9 is formfield
. $where
.' ORDER BY a.ordering';
$db->setQuery($query);
$fields = $db->loadObjectList();
return $fields;
}
/*
* Check if we ask some form field in billing or shipping address
* E.g. if vendor completely skip adding shipping address and user sends
no shipping address
* this does not mean that user didn't added data but vendor just
didn't asked for them.
*/
public static function isFormFieldActive($type = 'billing') {
$db = JFactory::getDBO();
$wheres = array();
switch($type) {
case 'account':
$wheres[] = " a.display_display_account = 1";
break;
case 'shipping':
$wheres[] = " a.display_shipping = 1";
break;
case 'billing':
default:
$wheres[] = " a.display_billing = 1";
break;
}
$where = ( count( $wheres ) ? ' WHERE '. implode( ' AND
', $wheres ) : '' );
$query = 'SELECT a.id'
.' FROM #__phocacart_form_fields AS a'
. $where
.' ORDER BY a.id'
.' LIMIT 1';
$db->setQuery($query);
$row = $db->loadResult();
if ((int)$row > 0) {
return true;
}
return false;
}
public static function getColumnType($type) {
$t = '';
if ($type != '') {
$tA = explode(":", $type);
if (isset($tA[0]) && isset($tA[1]) && $tA[1] !=
'') {
$pos = strpos($tA[1], 'varchar');
if ($pos === 0) {
$t = $tA[1] . ' NOT NULL DEFAULT \'\'';
}
$pos1 = strpos($tA[1], 'int');
if ($pos1 === 0) {
$t = $tA[1] . ' NOT NULL DEFAULT \'0\'';
}
$pos2 = strpos($tA[1], 'text');
if ($pos2 === 0) {
$t = $tA[1];
}
$pos3 = strpos($tA[1], 'datetime');
if ($pos3 === 0) {
$t = $tA[1] . ' NOT NULL DEFAULT \'0000-00-00
00:00:00\'';
}
}
}
return $t;
}
}
PK�"�[��011!libraries/phocacart/form/user.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartFormUser
{
private static $form = false;
private function __construct(){}
public static function getFormXml($billingSuffix = '',
$shippingSuffix = '_phs', $billing = 1, $shipping = 1, $account =
0, $guest = 0) {
if(self::$form === false){
$app = JFactory::getApplication();
$o = array();
$oFb = array();
$oFs = array();
$o[] = '<form>';
$o[] = '<fieldset name="user"
addrulepath="/components/com_phocacart/models/rules"
addfieldpath="/components/com_phocacart/models/fields"
label="COM_PHOCACART_FORM_LABEL">';
$fields = new PhocacartFormItems();
$f = $fields->getFormItems($billing, $shipping, $account);
// Specific fields not managed in administration but added to form,
// so we can work with it in checkout view html (default_address)
$specFields = array('ba_sa', 'newsletter',
'id');
$c = count($f);
foreach ($specFields as $k => $v) {
$f[$c] = new StdClass();
$f[$c]->title = $v;
$f[$c]->display_billing = 0;
$f[$c]->display_shipping = 0;
$f[$c]->display_account = 0;
$f[$c]->type = 'hidden';
$f[$c]->label = $v;
$f[$c]->required = 0;
$f[$c]->pattern = '';
$f[$c]->maxlength = '';
$c++;
}
if (!empty($f)) {
foreach($f as $k => $v) {
$fB = $fS = array();// Billing and Shipping
$class = '';
if($v->title != '' && $v->type != ''
&& $v->label != '') {
$fB[] = '<field
name="'.htmlspecialchars($v->title).$billingSuffix.'"';
$fS[] = '<field
name="'.htmlspecialchars($v->title).$shippingSuffix.'"';
$tA = explode(":", $v->type);
$type = 'text';
if (isset($tA[0]) && $tA[0] != '') {
$type = $tA[0];
}
if(isset($v->validate) && $v->validate ==
'email') {
$type = 'email';
}
// --- PREDEFINED VALUES (limited feature, see documentation)
$predefinedValues = '';
if(isset($v->predefined_values) &&
$v->predefined_values != '') {
$predefinedValues = array_map('trim',
explode(',', $v->predefined_values));
$predefinedValues = array_filter($predefinedValues,
'strlen');
}
if (!empty($predefinedValues)) {
$type= "list";
}
$fB[] = $fS[] = '
type="'.htmlspecialchars($type).'"'
. '
label="'.htmlspecialchars($v->label).'"';
if (isset($v->description) && $v->description !=
'') {
$fB[] = $fS[] = '
description="'.htmlspecialchars($v->description).'"';
}
if (isset($v->class) && $v->class != '') {
$class .= ' '.htmlspecialchars($v->class);
}
if (isset($v->default) && $v->default != '')
{
$fB[] = $fS[] = '
default="'.htmlspecialchars($v->default).'"';
}
// 0 not read only
// 1 read only
// 2 read only for registered users but not read only for guests
if (isset($v->read_only)) {
//if ($app->isClient('administrator')) {
// in admin allow to change the readonly input forms
//} else {
if ($v->read_only == 1) {
// Read only everwhere
$fB[] = $fS[] = ' readonly="true"';
$class .= ' readonly';
} else if ($v->read_only == 3) {
// Read only everwhere except administration
if ($app->isClient('administrator')) {
} else {
$fB[] = $fS[] = ' readonly="true"';
$class .= ' readonly';
}
} else if ($v->read_only == 2 && $guest == 0) {
// Read only for NO guests only
$fB[] = $fS[] = ' readonly="true"';
$class .= ' readonly';
} else if ($v->read_only == 4 && $guest == 0) {
// Read only for NO guests only everwhere except administration
if ($app->isClient('administrator')) {
} else {
$fB[] = $fS[] = ' readonly="true"';
$class .= ' readonly';
}
}
//}
}
// No required in admin
if (!$app->isClient('administrator')) {
if (isset($v->required) && $v->required == 1) {
$fB[] = $fS[] = ' required="true"';
}
}
// Pattern
if (isset($v->pattern) && $v->pattern != '')
{
$fB[] = $fS[] = '
pattern="'.$v->pattern.'"';
}
if (isset($v->maxlength) && (int)$v->maxlength > 0)
{
$fB[] = $fS[] = '
maxlength="'.(int)$v->maxlength.'"';
}
if (isset($v->unique) && $v->unique == 1) {
$fB[] = $fS[] = ' unique="true"';
}
if (isset($v->validate) && $v->validate !=
'') {
$fB[] = $fS[] = '
validate="'.htmlspecialchars($v->validate).'"';
$class .= ' validate-'.htmlspecialchars($v->validate);
}
$fB[] = '
class="'.htmlspecialchars($class).'"';
// Billing and Shipping is the same - javascript function
$class .= ' phShippingFormFields';
if (isset($v->required) && $v->required == 1) {
$class .= ' phShippingFormFieldsRequired';
}
$fS[] = '
class="'.htmlspecialchars($class).'"';
// --- PREDEFINED VALUES (limited feature, see documentation)
// Selectbox is displayed instead of standard types when predefined
values are defined
if (!empty($predefinedValues)) {
$fB[] = $fS[] = ' >';
if (isset($v->predefined_values_first_option) &&
$v->predefined_values_first_option != '') {
$fB[] = $fS[] = '<option value="">' .
JText::_(htmlspecialchars($v->predefined_values_first_option)).
'</option>';
}
foreach ($predefinedValues as $k => $v) {
$defaultSelected = '';
if (isset($v->default) && $v->default !=
'') {
$defaultSelected = 'selected="selected"';
}
$fB[] = $fS[] = '<option
value="'.htmlspecialchars($v).'"
'.$defaultSelected.'>'.htmlspecialchars($v).'</option>';
}
$fB[] = $fS[] = '</field>';
} else {
$fB[] = $fS[] = ' />';
}
$o[] = implode( "", $fB ) . implode( "", $fS );
} else {
continue;
}
}
}
$o[] = '</fieldset>';
$o[] = '</form>';
$fields = array();
$fields['xml'] = implode( "", $o );
$fields['array'] = $f;
self::$form = $fields;
}
return self::$form;
}
public final function __clone() {
throw new Exception('Function Error: Cannot clone instance of
Singleton pattern', 500);
return false;
}
}
?>
PK�"�[�;�H?H?#libraries/phocacart/group/group.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
/* TYPES
* 1 ... user ... #__phocacart_user_groups
* 2 ... category ... #__phocacart_category_groups
* 3 ... product ... #__phocacart_product_groups
* 4 ... productdiscount ... #__phocacart_product_discount_groups
* 5 ... discount ... #__phocacart_discount_groups
* 6 ... coupon ... #__phocacart_coupon_groups
* 7 ... shipping ... #__phocacart_shipping_method_groups
* 8 ... payment ... #__phocacart_payment_method_groups
* 9 ... formfield ... #__phocacart_form_fields_groups
*
* #__phocacart_item_groups replace all these tables
*/
/* Example:
* To get some group price for customer:
* - user must be assigned to the group: 1 user - user id
* - product must be assigned to the group: 3 product - product id
* - category must be assigned to the group: 2 category - category id
*/
class PhocacartGroup
{
private static $group = array();
public static function getAllGroupsSelectBox($name, $id, $activeArray,
$javascript = NULL, $order = 'id', $attributes =
'class="inputbox" size="4"
multiple="multiple"' ) {
$db = JFactory::getDBO();
$query = 'SELECT a.id AS value, a.title AS text'
.' FROM #__phocacart_groups AS a'
. ' ORDER BY '. $order;
$db->setQuery($query);
$groups = $db->loadObjectList();
foreach($groups as $k => $v) {
$groups[$k]->text = JText::_($v->text);
}
$groupsO = Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$groups, $name, $attributes . ' '. $javascript,
'value', 'text', $activeArray, $id);
return $groupsO;
}
/*
* id ... user id
* type ... see header comment in this class
*
*/
public static function getGroupsById($id, $type , $returnArray = 0,
$productId = 0) {
$key = base64_encode(serialize((int)$id . ':' . (int)$type .
(int)$returnArray . ':' . (int)$productId ));
if( !array_key_exists( (string)$key, self::$group )) {
if ((int)$id > 0) {
$db = JFactory::getDBO();
$query = 'SELECT a.id, a.title, a.alias, a.type, a.published,
a.display_price, a.display_addtocart, a.display_attributes'
.' FROM #__phocacart_groups AS a'
.' LEFT JOIN #__phocacart_item_groups AS g ON g.group_id =
a.id'
.' WHERE g.item_id = '.(int) $id
.' AND g.type = '.(int)$type;
if ($productId > 0) {
$query .= ' AND g.product_id = '.(int)$productId;
}
$query .= ' ORDER BY a.id';
$db->setQuery($query);
if ($returnArray == 1) {
$items = $db->loadColumn();
if (empty($items)) {
$items = array(0 => 1);// Default is default for all
}
} else if ($returnArray == 2) {
$items = $db->loadAssocList();
if (empty($items)) {
$items[0]['id'] = 1;
$items[0]['title'] =
'COM_PHOCACART_DEFAULT';
$items[0]['alias'] =
'com-phocacart-default';
$items[0]['type'] = 1;
$items[0]['display_price'] = 1;
$items[0]['display_addtocart'] = 1;
$items[0]['display_attributes'] = 1;
$items[0]['published'] = 1;
}
} else {
$items = $db->loadObjectList();
if (empty($items)) {
$items[0]->id = 1;
$items[0]->title = 'COM_PHOCACART_DEFAULT';
$items[0]->alias = 'com-phocacart-default';
$items[0]->type = 1;
$items[0]->display_price = 1;
$items[0]->display_addtocart = 1;
$items[0]->display_attributes = 1;
$items[0]->published = 1;
}
}
self::$group[$key] = $items;
} else {
self::$group[$key] = array(0 => 1);
}
}
if (!empty(self::$group[$key])) {
return self::$group[$key];
} else {
return array(0 => 1);
}
}
public static function getDefaultGroup($select = 0) {
$db = JFactory::getDBO();
if ($select == 1) {
$query = 'SELECT a.id';
} else {
$query = 'SELECT a.id, a.title, a.alias, a.type';
}
$query .= ' FROM #__phocacart_groups AS a'
.' WHERE a.id = 1 AND a.type = 1'
.' ORDER BY a.id';
$db->setQuery($query);
if ($select == 1) {
$attributes = $db->loadColumn();
} /*else if ($returnArray == 2) {
$attributes = $db->loadAssocList();
}*/ else {
$attributes = $db->loadObjectList();
}
return $attributes;
}
/*
* Product ID is only used by product discounts - to successfully clean
the table we need info about
* in which product the product discount is used
*/
public static function storeGroupsById($id, $type, $groups, $productId =
0) {
if ((int)$id > 0) {
$db =JFactory::getDBO();
$query = ' DELETE '
.' FROM #__phocacart_item_groups'
. ' WHERE item_id = '. (int)$id;
if ($productId > 0) {
$query .= ' AND product_id = '.(int)$productId;
}
$query .= ' AND type = '.(int)$type;
$db->setQuery($query);
$db->execute();
if (!empty($groups)) {
$values = array();
$activeGroups = array();
foreach($groups as $k => $v) {
$values[] = ' ('.(int)$id.', '.(int)$v.',
'.(int)$productId.', '.(int)$type.')';
$activeGroups[] = (int)$v;
}
if (!empty($values)) {
$valuesString = implode(',', $values);
$query = ' INSERT INTO #__phocacart_item_groups (item_id,
group_id, product_id, type)'
.' VALUES '.(string)$valuesString;
$db->setQuery($query);
$db->execute();
}
// Product groups have two tables assinged
// phocacart_product_price_groups
// phocacart_product_point_groups
if (!empty($activeGroups) && $type == 3) {
$activeGroupsS = implode(',', $activeGroups);
$q1 = 'DELETE FROM #__phocacart_product_price_groups'
. ' WHERE product_id = '.(int)$id
. ' AND group_id NOT IN ( '.$activeGroupsS.' )';
$db->setQuery( $q1 );
$db->execute();
$q1 = 'DELETE FROM #__phocacart_product_point_groups'
. ' WHERE product_id = '.(int)$id
. ' AND group_id NOT IN ( '.$activeGroupsS.' )';
$db->setQuery( $q1 );
$db->execute();
}
}
}
}
public static function getGroupRules() {
$db = JFactory::getDBO();
$query = 'SELECT a.id, a.type, a.minimum_sum'
.' FROM #__phocacart_groups AS a'
//.' WHERE a.published = 1'
//.' WHERE a.type <> 1'
.' ORDER BY a.id';
$db->setQuery($query);
$groups = $db->loadAssocList();
return $groups;
}
public static function changeUserGroupByRule($userId) {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$user_group_change_rule =
$paramsC->get('user_group_change_rule', 0);
if ($user_group_change_rule == 0) {
// User Group Change is not enabled
return true;
}
if ($userId > 0) {
$total = PhocacartUser::getUserOrderSum($userId);
$groups = self::getGroupRules();
$rulesActive = 0;
if (!empty($groups)) {
foreach($groups as $k => $v) {
if ($v['minimum_sum'] > 0) {
$rulesActive = 1;
}
}
}
if ($rulesActive == 0) {
// Seems like user group change rules are all empty
return true;
}
$groupsNew = array();
$groupsNewDefault = array();
$t = 0;
if (!empty($groups)) {
foreach($groups as $k => $v) {
if ($user_group_change_rule == 2) {
if ($v['type'] == 1) {
$groupsNewDefault[$k] = $v['id']; // Default is always
included
} else if ($v['minimum_sum'] < $total ||
$v['minimum_sum'] == $total) {
$groupsNew[$k] = $v['id'];
}
} else {
// SELECT ONLY ONE GROUP including default
if ($v['type'] == 1) {
$groupsNewDefault[$k] = $v['id']; // Default is always
included
} else if ($v['minimum_sum'] < $total ||
$v['minimum_sum'] == $total) {
if ($total > $t) {
$groupsNew[0] = $v['id'];
$t = $total;
}
}
}
}
}
$groupsAll = array_merge($groupsNew, $groupsNewDefault);
if (!empty($groupsAll)) {
self::storeGroupsById((int)$userId, 1, $groupsAll);
}
return true;
}
return false;
}
// Group prices and points
public static function getProductPriceGroupsById($productId) {
$db = JFactory::getDBO();
$query = 'SELECT a.id, a.product_id, a.group_id, a.price'
.' FROM #__phocacart_product_price_groups AS a'
.' WHERE a.product_id = '.(int) $productId
.' ORDER BY a.id';
$db->setQuery($query);
$items = $db->loadAssocList();
$itemsNew = array();
if (!empty($items)) {
foreach ($items as $k => $v) {
$newK = $v['group_id'];
$itemsNew[$newK] = $v;
}
}
return $itemsNew;
}
public static function getProductPointGroupsById($productId) {
$db = JFactory::getDBO();
$query = 'SELECT a.id, a.product_id, a.group_id,
a.points_received'
.' FROM #__phocacart_product_point_groups AS a'
.' WHERE a.product_id = '.(int) $productId
.' ORDER BY a.id';
$db->setQuery($query);
$items = $db->loadAssocList();
$itemsNew = array();
if (!empty($items)) {
foreach ($items as $k => $v) {
$newK = $v['group_id'];
$itemsNew[$newK] = $v;
}
}
return $itemsNew;
}
public static function storeProductPriceGroupsById($data, $productId) {
if (!empty($data)) {
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$notDeleteItems = array();
foreach($data as $k => $v) {
if (!isset($v['price']) || (isset($v['price'])
&& $v['price'] == '')) {
// Price is not 0, price is empty
// We can set price to zero so we need to differentiate between zero
and not set
continue;
}
//$row = JTable::getInstance('PhocacartProductPriceGroup',
'Table', array());
$idExists = 0;
if(isset($v['product_id']) &&
$v['product_id'] != '' &&
isset($v['group_id']) && $v['group_id'] !=
'') {
$query = ' SELECT id'
.' FROM #__phocacart_product_price_groups'
.' WHERE product_id = '. (int)$v['product_id']
.' AND group_id = '. (int)$v['group_id']
.' ORDER BY id';
$db->setQuery($query);
$idExists = $db->loadResult();
}
if ((int)$idExists > 0) {
$query = 'UPDATE #__phocacart_product_price_groups SET'
.' product_id =
'.(int)$v['product_id'].','
.' group_id = '. (int)$v['group_id'].','
.' price = '.$db->quote($v['price'])
.' WHERE id = '.(int)$idExists;
$db->setQuery($query);
$db->execute();
$newIdD = $idExists;
} else {
if (isset($v['id']) && (int)$v['id'] >
0) {
// IMPORT
$values = '('.(int)$v['id'].',
'.(int)$v['product_id'].',
'.(int)$v['group_id'].',
'.$db->quote($v['price']).')';
$query = ' INSERT INTO #__phocacart_product_price_groups (id,
product_id, group_id, price) VALUES '.$values;
$db->setQuery($query);
$db->execute();
$newIdD = (int)$v['id'];
} else {
// NEW ITEM
$values = '('.(int)$v['product_id'].',
'.(int)$v['group_id'].',
'.$db->quote($v['price']).')';
$query = ' INSERT INTO #__phocacart_product_price_groups
(product_id, group_id, price) VALUES '.$values;
$db->setQuery($query);
$db->execute();
$newIdD = $db->insertid();
}
}
if (isset($newIdD) && (int)$newIdD > 0) {
$notDeleteItems[] = (int)$newIdD;
}
}
if (!empty($notDeleteItems)) {
$notDeleteItemsString = implode(',', $notDeleteItems);
$query = ' DELETE '
.' FROM #__phocacart_product_price_groups'
.' WHERE product_id = '. (int)$productId
.' AND id NOT IN ('.$notDeleteItemsString.')';
} else {
$query = ' DELETE '
.' FROM #__phocacart_product_price_groups'
.' WHERE product_id = '. (int)$productId;
}
$db->setQuery($query);
$db->execute();
}
return true;
}
public static function storeProductPointGroupsById($data, $productId) {
if (!empty($data)) {
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$notDeleteItems = array();
foreach($data as $k => $v) {
if (!isset($v['points_received']) ||
(isset($v['points_received']) &&
$v['points_received'] == '')) {
// points_received is not 0, points_received is empty
// We can set points_received to zero so we need to differentiate
between zero and not set
continue;
}
//$row = JTable::getInstance('PhocacartProductPointGroup',
'Table', array());
$idExists = 0;
if(isset($v['product_id']) &&
$v['product_id'] != '' &&
isset($v['group_id']) && $v['group_id'] !=
'') {
$query = ' SELECT id'
.' FROM #__phocacart_product_point_groups'
.' WHERE product_id = '. (int)$v['product_id']
.' AND group_id = '. (int)$v['group_id']
.' ORDER BY id';
$db->setQuery($query);
$idExists = $db->loadResult();
}
if ((int)$idExists > 0) {
$query = 'UPDATE #__phocacart_product_point_groups SET'
.' product_id =
'.(int)$v['product_id'].','
.' group_id = '. (int)$v['group_id'].','
.' points_received =
'.$db->quote($v['points_received'])
.' WHERE id = '.(int)$idExists;
$db->setQuery($query);
$db->execute();
$newIdD = $idExists;
} else {
if (isset($v['id']) && (int)$v['id'] >
0) {
// IMPORT
$values = '('.(int)$v['id'].',
'.(int)$v['product_id'].',
'.(int)$v['group_id'].',
'.$db->quote($v['points_received']).')';
$query = ' INSERT INTO #__phocacart_product_point_groups (id,
product_id, group_id, points_received) VALUES '.$values;
$db->setQuery($query);
$db->execute();
$newIdD = (int)$v['id'];
} else {
// NEW ITEM
$values = '('.(int)$v['product_id'].',
'.(int)$v['group_id'].',
'.$db->quote($v['points_received']).')';
$query = ' INSERT INTO #__phocacart_product_point_groups
(product_id, group_id, points_received) VALUES '.$values;
$db->setQuery($query);
$db->execute();
$newIdD = $db->insertid();
}
}
if (isset($newIdD) && (int)$newIdD > 0) {
$notDeleteItems[] = (int)$newIdD;
}
}
if (!empty($notDeleteItems)) {
$notDeleteItemsString = implode(',', $notDeleteItems);
$query = ' DELETE '
.' FROM #__phocacart_product_point_groups'
.' WHERE product_id = '. (int)$productId
.' AND id NOT IN ('.$notDeleteItemsString.')';
} else {
$query = ' DELETE '
.' FROM #__phocacart_product_point_groups'
.' WHERE product_id = '. (int)$productId;
}
$db->setQuery($query);
$db->execute();
}
return true;
}
/* We store price for default group - because we need to compare group
prices in one sql query
* When customer is assigned to more groups select the lowest price -
lowest group for this customer
* Example: group A = 500, group B = 400 - customer is assigned to both
groups so he gets the lowest price for group B
* When we store the product, we need to update the default price in
phocacart_product_price_groups table
* because it cannot be manually set, it is set automatically by price of
product
* it is universal function but as default: group = 1 which is default
group
*/
public static function updateGroupProductPriceById($productId, $price,
$groupId = 1) {
$db = JFactory::getDBO();
$query = 'UPDATE #__phocacart_product_price_groups SET'
.' price = '.$db->quote($price)
.' WHERE product_id = '.(int)$productId
.' AND group_id = '.(int)$groupId;
$db->setQuery($query);
$db->execute();
}
public static function updateGroupProductRewardPointsById($productId,
$pointsReceived, $groupId = 1) {
$db = JFactory::getDBO();
$query = 'UPDATE #__phocacart_product_point_groups SET'
.' points_received = '.(int)$pointsReceived
.' WHERE product_id = '.(int)$productId
.' AND group_id = '.(int)$groupId;
$db->setQuery($query);
$db->execute();
}
public final function __clone() {
throw new Exception('Function Error: Cannot clone instance of
Singleton pattern', 500);
return false;
}
}
?>
PK�"�[�#o,,$libraries/phocacart/group/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�An���"libraries/phocacart/html/batch.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
defined('JPATH_PLATFORM') or die();
abstract class PhocacartHtmlBatch
{
public static function item($published, $category = 0)
{
// Create the copy/move options.
$options = array(
Joomla\CMS\HTML\HTMLHelper::_('select.option', 'c',
JText::_('JLIB_HTML_BATCH_COPY')),
Joomla\CMS\HTML\HTMLHelper::_('select.option', 'm',
JText::_('JLIB_HTML_BATCH_MOVE'))
);
$db = JFactory::getDBO();
//build the list of categories
$query = 'SELECT a.title AS text, a.id AS value, a.parent_id as
parentid'
. ' FROM #__phocacart_categories AS a'
// TO DO. ' WHERE a.published = '.(int)$published
. ' ORDER BY a.ordering';
$db->setQuery( $query );
$data = $db->loadObjectList();
$tree = array();
$text = '';
$catId= -1;
$tree = PhocacartCategory::CategoryTreeOption($data, $tree, 0, $text,
$catId);
if ($category == 1) {
array_unshift($tree,
Joomla\CMS\HTML\HTMLHelper::_('select.option', 0,
JText::_('JLIB_HTML_ADD_TO_ROOT'), 'value',
'text'));
}
// Create the batch selector to change select the category by which to
move or copy.
$lines = array(
'<label id="batch-choose-action-lbl"
for="batch-choose-action">',
JText::_('JLIB_HTML_BATCH_MENU_LABEL'),
'</label>',
'<fieldset id="batch-choose-action"
class="combo">',
'<select name="batch[category_id]"
class="inputbox" id="batch-category-id">',
'<option
value="">'.JText::_('JSELECT').'</option>',
/*Joomla\CMS\HTML\HTMLHelper::_('select.options', Joomla\CMS\HTML\HTMLHelper::_('category.options',
$extension, array('published' => (int) $published))),*/
Joomla\CMS\HTML\HTMLHelper::_('select.options', $tree ),
'</select>',
Joomla\CMS\HTML\HTMLHelper::_( 'select.radiolist', $options,
'batch[move_copy]', '', 'value',
'text', 'm'),
'</fieldset>'
);
return implode("\n", $lines);
}
}
?>
PK�"�[�]���%libraries/phocacart/html/featured.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die;
abstract class PhocacartHtmlFeatured
{
public static function featured($value = 0, $i = 0, $canChange = true)
{
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tooltip');
// Array of image, task, title, action
$states = array(
0 =>
array('unfeatured', 'phocacartitems.featured', 'COM_PHOCACART_UNFEATURED_PRODUCT', 'COM_PHOCACART_TOGGLE_TO_FEATURE'),
1 =>
array('featured', 'phocacartitems.unfeatured', 'COM_PHOCACART_FEATURED_PRODUCT', 'COM_PHOCACART_TOGGLE_TO_UNFEATURE'),
);
$state = \Joomla\Utilities\ArrayHelper::getValue($states, (int) $value,
$states[1]);
$icon = $state[0];
if ($canChange)
{
$html = '<a href="#" onclick="return
listItemTask(\'cb' . $i . '\',\'' . $state[1]
. '\')" class="btn btn-micro hasTooltip' . ($value
== 1 ? ' active' : '') . '"
title="' . JHtml::tooltipText($state[3]) . '"><i
class="icon-'
. $icon . '"></i></a>';
}
else
{
$html = '<a class="btn btn-micro hasTooltip disabled'
. ($value == 1 ? ' active' : '') . '"
title="' . JHtml::tooltipText($state[2]) . '"><i
class="icon-'
. $icon . '"></i></a>';
}
return $html;
}
}
PK�"�[�͚cc!libraries/phocacart/html/grid.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
if (! class_exists('JHtmlGrid')) {
require_once( JPATH_SITE.'/libraries/joomla/html/html/grid.php'
);
}
//jimport('joomla.html.html.jgrid');
class PhocacartHtmlGrid extends JHtmlJGrid
{
}
PK�"�[wtW�#libraries/phocacart/html/index.htmlnu�[���<html><body></body></html>PK�"�[R�����"libraries/phocacart/html/jgrid.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
/*
jimport('joomla.html.grid');
jimport('joomla.html.html.grid');
jimport('joomla.html.html.jgrid');
*/
if (! class_exists('JHtmlJGrid')) {
require_once( JPATH_SITE.'/libraries/joomla/html/html/jgrid.php'
);
}
class PhocacartHtmlJgrid extends JHtmlJGrid
{
public static function displayBilling($value, $i, $prefix = '',
$enabled = true, $checkbox='cb')
{
if (is_array($prefix)) {
$options = $prefix;
$enabled = array_key_exists('enabled', $options) ?
$options['enabled'] : $enabled;
$checkbox = array_key_exists('checkbox', $options) ?
$options['checkbox'] : $checkbox;
$prefix = array_key_exists('prefix', $options) ?
$options['prefix'] : '';
}
$states = array(
1 =>
array('hidebilling', 'COM_PHOCACART_DISPLAYED', 'COM_PHOCACART_HIDE', 'COM_PHOCACART_DISPLAYED', false, 'publish', 'publish'),
0 =>
array('displaybilling', 'COM_PHOCACART_HIDDEN', 'COM_PHOCACART_DISPLAY', 'COM_PHOCACART_HIDDEN', false, 'unpublish', 'unpublish')
);
return self::state($states, $value, $i, $prefix, $enabled, true,
$checkbox);
}
public static function displayShipping($value, $i, $prefix = '',
$enabled = true, $checkbox='cb')
{
if (is_array($prefix)) {
$options = $prefix;
$enabled = array_key_exists('enabled', $options) ?
$options['enabled'] : $enabled;
$checkbox = array_key_exists('checkbox', $options) ?
$options['checkbox'] : $checkbox;
$prefix = array_key_exists('prefix', $options) ?
$options['prefix'] : '';
}
$states = array(
1 =>
array('hideshipping', 'COM_PHOCACART_DISPLAYED', 'COM_PHOCACART_HIDE', 'COM_PHOCACART_DISPLAYED', false, 'publish', 'publish'),
0 =>
array('displayshipping', 'COM_PHOCACART_HIDDEN', 'COM_PHOCACART_DISPLAY', 'COM_PHOCACART_HIDDEN', false, 'unpublish', 'unpublish')
);
return self::state($states, $value, $i, $prefix, $enabled, true,
$checkbox);
}
public static function displayAccount($value, $i, $prefix = '',
$enabled = true, $checkbox='cb')
{
if (is_array($prefix)) {
$options = $prefix;
$enabled = array_key_exists('enabled', $options) ?
$options['enabled'] : $enabled;
$checkbox = array_key_exists('checkbox', $options) ?
$options['checkbox'] : $checkbox;
$prefix = array_key_exists('prefix', $options) ?
$options['prefix'] : '';
}
$states = array(
1 =>
array('hideaccount', 'COM_PHOCACART_DISPLAYED', 'COM_PHOCACART_HIDE', 'COM_PHOCACART_DISPLAYED', false, 'publish', 'publish'),
0 =>
array('displayaccount', 'COM_PHOCACART_HIDDEN', 'COM_PHOCACART_DISPLAY', 'COM_PHOCACART_HIDDEN', false, 'unpublish', 'unpublish')
);
return self::state($states, $value, $i, $prefix, $enabled, true,
$checkbox);
}
public static function displayRequired($value, $i, $prefix = '',
$enabled = true, $checkbox='cb')
{
if (is_array($prefix)) {
$options = $prefix;
$enabled = array_key_exists('enabled', $options) ?
$options['enabled'] : $enabled;
$checkbox = array_key_exists('checkbox', $options) ?
$options['checkbox'] : $checkbox;
$prefix = array_key_exists('prefix', $options) ?
$options['prefix'] : '';
}
$states = array(
1 =>
array('disablerequired', 'COM_PHOCACART_REQUIRED', 'COM_PHOCACART_MAKE_FIELD_NOT_REQUIRED', 'COM_PHOCACART_REQUIRED', false, 'publish', 'publish'),
0 =>
array('enablerequired', 'COM_PHOCACART_NOT_REQUIRED', 'COM_PHOCACART_MAKE_FIELD_REQUIRED', 'COM_PHOCACART_NOT_REQUIRED', false, 'unpublish', 'unpublish')
);
return self::state($states, $value, $i, $prefix, $enabled, true,
$checkbox);
}
public static function approve($value, $i, $prefix = '',
$enabled = true, $checkbox = 'cb', $publish_up = null,
$publish_down = null)
{
if (is_array($prefix))
{
$options = $prefix;
$enabled = array_key_exists('enabled', $options) ?
$options['enabled'] : $enabled;
$checkbox = array_key_exists('checkbox', $options) ?
$options['checkbox'] : $checkbox;
$prefix = array_key_exists('prefix', $options) ?
$options['prefix'] : '';
}
$states = array(
1 => array('unpublish', 'COM_PHOCACART_APPROVED',
'COM_PHOCACART_DISAPPROVE_ITEM',
'COM_PHOCACART_APPROVED', true, 'publish',
'publish'),
0 => array('publish',
'COM_PHOCACART_NOT_APPROVED',
'COM_PHOCACART_APPROVE_ITEM',
'COM_PHOCACART_NOT_APPROVED', true, 'unpublish',
'unpublish'),
);
return static::state($states, $value, $i, $prefix, $enabled, true,
$checkbox);
}
}
?>PK�"�[F��<``libraries/phocacart/id/id.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartId
{
/* Change ID (EAN, SKU, ...) based on Advanced Stock Management */
public function getIdItemsChangedByAttributes(&$item, $attributes,
$ajax = 0) {
// $paramsC = PhocacartUtils::getComponentParameters();
// $fullAttributes = array();// Array of integers only
$thinAttributes = array();// Array of full objects (full options
object)
if ($ajax == 1) {
// $fullAttributes =
PhocacartAttribute::getAttributeFullValues($attributes);
$thinAttributes = $attributes;
} else {
// $fullAttributes = $attributes;
$thinAttributes =
PhocacartAttribute::getAttributesSelectedOnly($attributes);
}
// Stock Calculation
// 0 ... Main Product
// 1 ... Product Variations
// 2 ... Advanced Stock Management
// 3 ... Advanced Stock and Price Management
if ($item->stock_calculation == 2 ||
$item->stock_calculation == 3) {
// Advanced Stock Management
$k = PhocacartProduct::getProductKey((int)$item->id,
$thinAttributes);
$dataASM = PhocacartAttribute::getCombinationsDataByKey($k);
if (isset($dataASM['sku']) &&
$dataASM['sku'] != '') {
$item->sku = $dataASM['sku'];
}
if (isset($dataASM['ean']) &&
$dataASM['ean'] != '') {
$item->ean = $dataASM['ean'];
}
}
}
}
PK�"�[�#o,,!libraries/phocacart/id/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�
t�(libraries/phocacart/image/additional.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartImageAdditional
{
public static function getImagesByProductId($productId, $return = 0) {
$db = JFactory::getDBO();
$query = 'SELECT a.id, a.image';
$query .= ' FROM #__phocacart_product_images AS a'
.' WHERE a.product_id = '.(int) $productId
.' ORDER BY a.ordering';
$db->setQuery($query);
if ($return == 0) {
return $db->loadObjectList();
} else if ($return == 1) {
return $db->loadAssocList();
} else {
$images = $db->loadAssocList();
$imagesSubform = array();
$i = 0;
if (!empty($images)) {
foreach($images as $k => $v) {
$imagesSubform['additional_images'.$i]['id'] =
(string)$v['id'];
$imagesSubform['additional_images'.$i]['image']
= (string)$v['image'];
$i++;
}
}
return $imagesSubform;
}
return false;
}
public static function storeImagesByProductId($productId, $imageArray,
$new = 0) {
if ((int)$productId > 0) {
$db =JFactory::getDBO();
$notDeleteImages = array();// Select all images which will be not
deleted
$i = 1;
if (!empty($imageArray)) {
foreach($imageArray as $k => $v) {
// correct simple xml
if (empty($v['image'])) {$v['image'] =
'';}
$idExists = 0;
if ($new == 0) {
if (isset($v['id']) && $v['id'] > 0) {
// Does the row exist
$query = ' SELECT id '
.' FROM #__phocacart_product_images'
. ' WHERE id = '. (int)$v['id']
.' ORDER BY id';
$db->setQuery($query);
$idExists = $db->loadResult();
}
}
if ((int)$idExists > 0) {
$query = 'UPDATE #__phocacart_product_images SET'
.' product_id = '.(int)$productId.','
.' image =
'.$db->quote($v['image']).','
.' ordering = '.(int)$i
.' WHERE id = '.(int)$idExists;
$db->setQuery($query);
$db->execute();
$i++;
$newIdA = $idExists;
} else {
// Test Thumbnails (Create if not exists)
$thumb =
PhocacartFileThumbnail::getOrCreateThumbnail($v['image'],
'', 1, 1, 1, 0, 'productimage');
$valuesString = '('.(int)$productId.',
'.$db->quote($v['image']).',
'.$i.')';
$query = ' INSERT INTO #__phocacart_product_images (product_id,
image, ordering)'
.' VALUES '.(string)$valuesString;
$db->setQuery($query);
$db->execute(); // insert is not done together but step by step
because of getting last insert id
$i++;
// ADD OPTIONS
$newIdA = $db->insertid();
}
$notDeleteImages[] = $newIdA;
}
}
// Remove all images except the active
if (!empty($notDeleteImages)) {
$notDeleteImagesString = implode(',', $notDeleteImages);
$query = ' DELETE '
.' FROM #__phocacart_product_images'
.' WHERE product_id = '. (int)$productId
.' AND id NOT IN ('.$notDeleteImagesString.')';
} else {
$query = ' DELETE '
.' FROM #__phocacart_product_images'
.' WHERE product_id = '. (int)$productId;
}
$db->setQuery($query);
$db->execute();
}
}
}
PK�"�[hf�Y.>.>#libraries/phocacart/image/image.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined('_JEXEC') or die('Restricted access');
class PhocacartImage
{
public static function getThumbnailName($path, $filename, $size) {
$paramsC = PhocacartUtils::getComponentParameters();
$thumb_name_prefix =
$paramsC->get('thumb_name_prefix', 'phoca_thumb');
$thumbName = new StdClass();
if ($filename == '') {
$thumbName->abs = false;
$thumbName->rel = false;
$thumbName->rel_webp = false;
return $thumbName;
}
$title = self::getTitleFromFile($filename, 1);
switch ($size) {
case 'large':
$fileNameThumb = $thumb_name_prefix . '_l_'
. $title;
$thumbName->abs = JPath::clean(str_replace($title,
'thumbs/' . $fileNameThumb, $path['orig_abs_ds'] .
$filename));
$thumbName->rel = str_replace($title,
'thumbs/' . $fileNameThumb, $path['orig_rel_ds'] .
$filename);
$thumbName->rel_webp =
PhocacartFile::changeFileExtension($thumbName->rel, 'webp');
break;
case 'medium':
$fileNameThumb = $thumb_name_prefix . '_m_'
. $title;
$thumbName->abs = JPath::clean(str_replace($title,
'thumbs/' . $fileNameThumb, $path['orig_abs_ds'] .
$filename));
$thumbName->rel = str_replace($title,
'thumbs/' . $fileNameThumb, $path['orig_rel_ds'] .
$filename);
$thumbName->rel_webp =
PhocacartFile::changeFileExtension($thumbName->rel, 'webp');
break;
default:
case 'small':
$fileNameThumb = $thumb_name_prefix . '_s_'
. $title;
$thumbName->abs = JPath::clean(str_replace($title,
'thumbs/' . $fileNameThumb, $path['orig_abs_ds'] .
$filename));
$thumbName->rel = str_replace($title,
'thumbs/' . $fileNameThumb, $path['orig_rel_ds'] .
$filename);
$thumbName->rel_webp =
PhocacartFile::changeFileExtension($thumbName->rel, 'webp');
break;
}
return $thumbName;
}
public static function getTitleFromFile(&$filename, $displayExt =
0, $isThumbnail = 0) {
$paramsC = PhocacartUtils::getComponentParameters();
$thumb_name_prefix =
$paramsC->get('thumb_name_prefix', 'phoca_thumb');
$filename = str_replace('//', '/', $filename);
//$filename = str_replace(DS, '/', $filename);
$folderArray = explode('/', $filename);
$countFolderArray = count($folderArray);
$lastArrayValue = $countFolderArray - 1;
$title = new stdClass();
$title->with_extension = $folderArray[$lastArrayValue];
$title->without_extension =
self::removeExtension($folderArray[$lastArrayValue]);
if ($displayExt == 1) {
$titleO = $title->with_extension;
} else if ($displayExt == 0) {
$titleO = $title->without_extension;
} else {
$titleO = $title;
}
if ($isThumbnail) {
$titleO = str_replace(array($thumb_name_prefix .
'_l_', $thumb_name_prefix . '_m_', $thumb_name_prefix .
'_s_'), '', $titleO);
}
return $titleO;
}
public static function removeExtension($filename) {
return substr($filename, 0, strrpos($filename, '.'));
}
public static function getJpegQuality($jpegQuality) {
if ((int)$jpegQuality < 0) {
$jpegQuality = 0;
}
if ((int)$jpegQuality > 100) {
$jpegQuality = 100;
}
return $jpegQuality;
}
public static function getAdditionalImages($itemId) {
$db = JFactory::getDBO();
$query = 'SELECT i.image FROM #__phocacart_product_images AS
i'
. ' LEFT JOIN #__phocacart_products AS p ON p.id =
i.product_id'
. ' WHERE p.id = ' . (int)$itemId
. ' ORDER BY i.image';
$db->setQuery($query);
$images = $db->loadObjectList();
return $images;
}
public static function getImage($image, $path = '', $width =
'', $height = '') {
if (JFile::exists(JPATH_ROOT . '/' . $image)) {
$style = ' style="';
if ($width != '') {
$style .= 'width: ' . $width . ';';
}
if ($height != '') {
$style .= 'height: ' . $height . ';';
}
$style .= '" ';
if ($path != '') {
$path = $path . '/';
}
return '<img src="' . JURI::root(true) .
'/' . $path . $image . '"' . $style .
'alt=""/>';
} else {
return false;
}
}
/*
* Attribute was selected by vendor in administration - it is default
attribute
* Displayed in category or item view when the page is loaded, the
default attribute image is displayed
*/
public static function getImageChangedByAttributes($attributes,
$imageSize) {
$paramsC =
PhocacartUtils::getComponentParameters();
$display_attribute_image =
$paramsC->get('display_attribute_image', 1);
if ($display_attribute_image == 0) {
return '';
}
$image = '';
if (!empty($attributes)) {
foreach ($attributes as $k => $v) {
if (!empty($v->options)) {
foreach ($v->options as $k2 => $v2) {
// Is the options set as default
if (isset($v2->default_value) &&
$v2->default_value == 1) {
switch ($imageSize) {
case 'small':
if (isset($v2->image_small)
&& $v2->image_small != '') {
$image = $v2->image_small;
break 2;
}
break;
case 'medium':
// !!!!
// In options when we select image, it
has 3 thumbnails
// so $v2->image has three
thumbnails, we ask for image and then we transform to thumbnail we need
/*case 'medium':
if (isset($v2->image_medium)
&& $v2->image_medium != '') {
$image = $v2->image_medium;
break 2;
}
break;*/
case 'large':
default:
if (isset($v2->image) &&
$v2->image != '') {
$image = $v2->image;
break 3;
}
break;
}
}
}
}
}
}
return $image;
}
/*
* Attribute was selected by customer and product added to cart
(displayed in checkout)
* Displayed in checkout or cart view when the page is loaded, the
selected attribute by customer is displayed
*/
public static function getImageChangedBySelectedAttribute($attributes,
$imageSize) {
$paramsC =
PhocacartUtils::getComponentParameters();
$display_attribute_image_checkout =
$paramsC->get('display_attribute_image_checkout', 1);
if ($display_attribute_image_checkout == 0) {
return '';
}
$image = '';
if (!empty($attributes)) {
foreach ($attributes as $k => $v) {
if (!empty($v)) {
foreach ($v as $k2 => $v2) {
switch ($imageSize) {
case 'small':
if (isset($v2['oimagesmall'])
&& $v2['oimagesmall'] != '') {
$image = $v2['oimagesmall'];
break 2;
}
break;
case 'medium':
case 'large':
default:
if (isset($v2['oimage'])
&& $v2['oimage'] != '') {
$image = $v2['oimage'];
break 3;
}
break;
}
}
}
}
}
return $image;
}
/* Change Image based on Advanced Stock Management */
public static function getImageItemsChangedByAttributes(&$item,
$attributes, $params, $ajax = 0) {
// $paramsC =
PhocacartUtils::getComponentParameters();
// $fullAttributes = array();// Array of integers only
$thinAttributes = array();// Array of full objects (full options
object)
if ($ajax == 1) {
// $fullAttributes =
PhocacartAttribute::getAttributeFullValues($attributes);
$thinAttributes = $attributes;
} else {
// $fullAttributes = $attributes;
$thinAttributes =
PhocacartAttribute::getAttributesSelectedOnly($attributes);
}
// Stock Calculation
// 0 ... Main Product
// 1 ... Product Variations
// 2 ... Advanced Stock Management
// 3 ... Advanced Stock and Price Management
if ($item->stock_calculation == 2 || $item->stock_calculation
== 3) {
// Advanced Stock Management
$k = PhocacartProduct::getProductKey((int)$item->id,
$thinAttributes);
$dataASM = PhocacartAttribute::getCombinationsDataByKey($k);
$pathItem = PhocacartPath::getPath('productimage');
if (isset($params['typeview']) &&
($params['typeview'] == 'Category' ||
$params['typeview'] == 'Items')) {
$imageSize = 'medium';
} else {
$imageSize = 'large';// Item, Quickview
}
if (isset($dataASM['image']) &&
$dataASM['image'] != '') {
$image = PhocacartImage::getThumbnailName($pathItem,
$dataASM['image'], $imageSize);
$item->image = JURI::base(true) . '/' .
$image->rel;
} else {
// No image found - back to product image
$image = PhocacartImage::getThumbnailName($pathItem,
$item->image, $imageSize);
$item->image = JURI::base(true) . '/' .
$image->rel;
}
} else {
//Nothing will be set by JS function
$item->image = '';
}
}
// posible feature request
/*
*
* Get ID key by attributes (when vender set default value of attribute
in administration)
* $thinAttributes =
PhocacartAttribute::getAttributesSelectedOnly($this->t['attr_options']);
* $idkey = PhocacartProduct::getProductKey($x->id,
$thinAttributes);
* When customer add the product with selected attributes to cart, the
idkey is known
*
public static function
getImageChangedBySelectedAttributeAdvancedStockManagement($idKey,
$imageSize) {
// Ask jos_phocacart_product_stock table for image by product
idKey
}
*/
// Image
// 1. Display default image
// 2. Store the information about default image into data-default-image
because when we change images by selecting attributes
// and at the end we deselect all the attributes, we should get back
to default image
// 3. If there is some attribute option selected as default, display
the image of this attribute options so the image will be
// loaded at start
// But when we load an attribute image at start and user deselect
attributes we need to go back to default image (we didn't load
// it in image src tag but we loaded it in data-default-image
attribute
//
// Image2 is the image which is changed when hovering over image box
public static function getImageDisplay($image, $imageAdditional,
$pathItem, $switchImage, $width, $height, $imageSize, $layoutType,
$attributesOptions, $attributesOptionsType = 1) {
$imageA = array();
if ($imageSize != '') {
$imageA['size'] = $imageSize;
} else {
$imageA['size'] = $layoutType == 'gridlist'
? 'large' : 'medium';
}
$imageA['image'] =
PhocacartImage::getThumbnailName($pathItem, $image,
$imageA['size']);
$imageA['default'] = $imageA['image'];
if ($attributesOptionsType == 1) {
// Default attributes - set by vendor in administration
(default value of attributes)
$imageAttributes =
PhocaCartImage::getImageChangedByAttributes($attributesOptions,
'large');
} else {
// Selected attributes - selected by customer in e-shop -
displayed e.g. in cart or checkout
// the size is always large:
// Attribute Image Large (normal image with small/medium/large
thumbnails)
// Attribute Image Small (small icon used e.g. for module or as
click button)
$imageAttributes =
PhocaCartImage::getImageChangedBySelectedAttribute($attributesOptions,
'large');
}
if ($imageAttributes != '') {
$imageA['image'] =
PhocacartImage::getThumbnailName($pathItem, $imageAttributes,
$imageA['size']);
}
$imageA['second'] = false;
$imageA['phil'] = 'phIL-not-active';
if ($switchImage == 1 && $imageAdditional != '')
{
$iAI = explode(',', $imageAdditional);
if (isset($iAI[0]) && $iAI[0] != '') {
$imageA['second'] =
PhocacartImage::getThumbnailName($pathItem, $iAI[0],
$imageA['size']);
if (isset($imageA['second']->rel) &&
$imageA['second']->rel != '') {
$imageA['phil'] = 'phIL';
}
}
}
$imageA['style'] = '';
if (isset($width) && $width != '' &&
isset($height) && $height != '') {
$imageA['style'] = 'style="width:' .
$width . ';height:' . $height . '"';
}
if (!empty($imageA['image'])) {
$imageA['image']->original = $image;
}
return $imageA;
}
public static function getAltTitle($title, $imageName) {
$paramsC = PhocacartUtils::getComponentParameters();
$alt_value = $paramsC->get('alt_value', 1);
switch ($alt_value) {
case 0:
return '';
break;
case 2:
return self::getTitleFromFile($imageName, 0, 0);
break;
case 1:
default:
return strip_tags(htmlspecialchars($title));
break;
}
return '';
}
}
?>
PK�"�[�#o,,$libraries/phocacart/image/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[(�Y��H�H#libraries/phocacart/image/magic.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.filesystem.folder' );
jimport( 'joomla.filesystem.file' );
class PhocacartImageMagic
{
/**
* need GD library (first PHP line WIN: dl("php_gd.dll"); UNIX:
dl("gd.so");
* www.boutell.com/gd/
* interval.cz/clanky/php-skript-pro-generovani-galerie-obrazku-2/
* cz.php.net/imagecopyresampled
* www.linuxsoft.cz/sw_detail.php?id_item=871
* www.webtip.cz/art/wt_tech_php/liquid_ir.html
* php.vrana.cz/zmensovani-obrazku.php
* diskuse.jakpsatweb.cz/
*
* @param string $fileIn Vstupni soubor (mel by existovat)
* @param string $fileOut Vystupni soubor, null ho jenom zobrazi (taky kdyz
nema pravo se zapsat :)
* @param int $width Vysledna sirka (maximalni)
* @param int $height Vysledna vyska (maximalni)
* @param bool $crop Orez (true, obrazek bude presne tak velky), jinak
jenom Resample (udane maximalni rozmery)
* @param int $typeOut IMAGETYPE_type vystupniho obrazku
* @return bool Chyba kdyz vrati false
*/
public static function imageMagic($fileIn, $fileOut = null, $width = null,
$height = null, $crop = null, $typeOut = null, $watermarkParams = array(),
$frontUpload = 0, $manager = '', &$errorMsg = '')
{
$params = PhocacartUtils::getComponentParameters();
$jfile_thumbs = $params->get( 'jfile_thumbs', 1 );
$jpeg_quality = $params->get( 'jpeg_quality', 100 );
$jpeg_quality = PhocacartImage::getJpegQuality($jpeg_quality);
$create_webp_copy = $params->get( 'create_webp_copy', 0);
$thumb_name_prefix = $params->get('thumb_name_prefix',
'phoca_thumb');
$fileWatermark = '';
/* // While front upload we don't display the process page
if ($frontUpload == 0) {
$stopText = PhocacartRenderProcess::displayStopThumbnailsCreating();
echo $stopText;
}*/
// Memory - - - - - - - -
$memory = 8;
$memoryLimitChanged = 0;
$memory = (int)ini_get( 'memory_limit' );
if ($memory == 0) {
$memory = 8;
}
// - - - - - - - - - - -
if ($fileIn !== '' && JFile::exists($fileIn)) {
// array of width, height, IMAGETYPE, "height=x width=x"
(string)
list($w, $h, $type) = GetImageSize($fileIn);
if ($w > 0 && $h > 0) {// we got the info from
GetImageSize
// size of the image
if ($width == null || $width == 0) { // no width added
$width = $w;
}
else if ($height == null || $height == 0) { // no height, adding the
same as width
$height = $width;
}
if ($height == null || $height == 0) { // no height, no width
$height = $h;
}
// miniaturizing
if (!$crop) { // new size - nw, nh (new width/height)
$scale = (($width / $w) < ($height / $h)) ? ($width / $w)
: ($height / $h); // smaller rate
$src = array(0,0, $w, $h);
$dst = array(0,0, floor($w*$scale), floor($h*$scale));
}
else { // will be cropped
$scale = (($width / $w) > ($height / $h)) ? ($width / $w)
: ($height / $h); // greater rate
$newW = $width/$scale; // check the size of in file
$newH = $height/$scale;
// which side is larger (rounding error)
if (($w - $newW) > ($h - $newH)) {
$src = array(floor(($w - $newW)/2), 0, floor($newW),
$h);
}
else {
$src = array(0, floor(($h - $newH)/2), $w,
floor($newH));
}
$dst = array(0,0, floor($width), floor($height));
}
// Watermark - - - - - - - - - - -
if (!empty($watermarkParams) &&
($watermarkParams['create'] == 1 ||
$watermarkParams['create'] == 2)) {
$thumbnailSmall = false;
$thumbnailMedium = false;
$thumbnailLarge = false;
$thumbnailMedium =
preg_match("/".$thumb_name_prefix."_m_/i", $fileOut);
$thumbnailLarge =
preg_match("/".$thumb_name_prefix."_l_/i", $fileOut);
$path = PhocacartPath::getPath($manager);
$fileName = PhocacartFile::getTitleFromFile($fileIn, 1);
// Which Watermark will be used
// If watermark is in current directory use it else use Default
$fileWatermarkMedium = str_replace($fileName,
'watermark-medium.png', $fileIn);
$fileWatermarkLarge = str_replace($fileName,
'watermark-large.png', $fileIn);
clearstatcache();
// Which Watermark will be used
if ($thumbnailMedium) {
if (JFile::exists($fileWatermarkMedium)) {
$fileWatermark = $fileWatermarkMedium;
} else {
if ($watermarkParams['create'] == 2) {
$fileWatermark =
$path['orig_abs_ds'].'watermark-medium.png';
} else {
$fileWatermark = '';
}
}
} else if ($thumbnailLarge) {
if (JFile::exists($fileWatermarkLarge)) {
$fileWatermark = $fileWatermarkLarge;
} else {
if ($watermarkParams['create'] == 2) {
$fileWatermark =
$path['orig_abs_ds'].'watermark-large.png';
} else {
$fileWatermark = '';
}
}
} else {
$fileWatermark = '';
}
if (!JFile::exists($fileWatermark)) {
$fileWatermark = '';
}
if ($fileWatermark != '') {
list($wW, $hW, $typeW) = GetImageSize($fileWatermark);
switch ($watermarkParams['x']) {
case 'left':
$locationX = 0;
break;
case 'right':
$locationX = $dst[2] - $wW;
break;
case 'center':
Default:
$locationX = ($dst[2] / 2) - ($wW / 2);
break;
}
switch ($watermarkParams['y']) {
case 'top':
$locationY = 0;
break;
case 'bottom':
$locationY = $dst[3] - $hW;
break;
case 'middle':
Default:
$locationY = ($dst[3] / 2) - ($hW / 2);
break;
}
}
} else {
$fileWatermark = '';
}
}
if ($memory < 50) {
ini_set('memory_limit', '50M');
$memoryLimitChanged = 1;
}
// Resampling
// in file
// Watemark
if ($fileWatermark != '') {
if (!function_exists('ImageCreateFromPNG')) {
$errorMsg = 'ErrorNoPNGFunction';
return false;
}
$waterImage1=ImageCreateFromPNG($fileWatermark);
}
// End Watermark - - - - - - - - - - - - - - - - - -
switch($type) {
case IMAGETYPE_JPEG:
if (!function_exists('ImageCreateFromJPEG')) {
$errorMsg = 'ErrorNoJPGFunction';
return false;
}
try {
$image1 = ImageCreateFromJPEG($fileIn);
} catch(\Exception $exception) {
$errorMsg = 'ErrorJPGFunction';
return false;
}
break;
case IMAGETYPE_PNG :
if (!function_exists('ImageCreateFromPNG')) {
$errorMsg = 'ErrorNoPNGFunction';
return false;
}
try {
$image1 = ImageCreateFromPNG($fileIn);
} catch(\Exception $exception) {
$errorMsg = 'ErrorPNGFunction';
return false;
}
break;
case IMAGETYPE_GIF :
if (!function_exists('ImageCreateFromGIF')) {
$errorMsg = 'ErrorNoGIFFunction';
return false;
}
try {
$image1 = ImageCreateFromGIF($fileIn);
} catch(\Exception $exception) {
$errorMsg = 'ErrorGIFFunction';
return false;
}
break;
case IMAGETYPE_WEBP:
if (!function_exists('ImageCreateFromWEBP'))
{
$errorMsg = 'ErrorNoWEBPFunction';
return false;
}
//$image1 = ImageCreateFromGIF($fileIn);
try {
$image1 = ImageCreateFromWEBP($fileIn);
} catch(\Exception $exception) {
$errorMsg = 'ErrorWEBPFunction';
return false;
}
break;
case IMAGETYPE_WBMP:
if (!function_exists('ImageCreateFromWBMP')) {
$errorMsg = 'ErrorNoWBMPFunction';
return false;
}
try{
$image1 = ImageCreateFromWBMP($fileIn);
} catch(\Exception $exception) {
$errorMsg = 'ErrorWBMPFunction';
return false;
}
break;
default:
$errorMsg = 'ErrorNotSupportedImage';
return false;
break;
}
if ($image1) {
$image2 = @ImageCreateTruecolor($dst[2], $dst[3]);
if (!$image2) {
$errorMsg = 'ErrorNoImageCreateTruecolor';
return false;
}
switch($type) {
case IMAGETYPE_PNG:
case IMAGETYPE_WEBP:
// Possible FR FR1
$correctWhite = 0;
if ($correctWhite == 1) {
// It can happen that GD makes the white background with very wrong
quality
// - white color will be dirty (this happens on JPG or not
transparent PNG)
// So we cannot use JPG or not transparent PNG
// And when we use transparent PNG, it can have bad quality of
borders - gritty
// So we will use transparent PNG as source but we want to do not
transparent
// PNG as destination. Normally in such case the PNG has black
background
// so we need to add white retangle as background - such white
background will
// be nice without dirty effects
$white = imagecolorallocate($image2, 255, 255, 255);
imagefilledrectangle($image2, 0, 0, $dst[2],$dst[3], $white);
} else {
//imagealphablending($image1, false);
@imagealphablending($image2, false);
//imagesavealpha($image1, true);
@imagesavealpha($image2, true);
}
break;
}
ImageCopyResampled($image2, $image1, $dst[0],$dst[1], $src[0],$src[1],
$dst[2],$dst[3], $src[2],$src[3]);
// Watermark - - - - - -
if ($fileWatermark != '') {
ImageCopy($image2, $waterImage1, $locationX, $locationY, 0, 0, $wW,
$hW);
}
// End Watermark - - - -
// Display the Image - not used
if ($fileOut == null) {
header("Content-type: ".
image_type_to_mime_type($typeOut));
}
// Create the file
if ($typeOut == null) { // no bitmap
$typeOut = ($type == IMAGETYPE_WBMP) ? IMAGETYPE_PNG :
$type;
}
switch($typeOut) {
case IMAGETYPE_JPEG:
if (!function_exists('ImageJPEG')) {
$errorMsg = 'ErrorNoJPGFunction';
return false;
}
if ($jfile_thumbs == 1) {
ob_start();
if (!@ImageJPEG($image2, NULL, $jpeg_quality)) {
ob_end_clean();
$errorMsg = 'ErrorWriteFile';
return false;
}
$imgJPEGToWrite = ob_get_contents();
ob_end_clean();
if(!JFile::write( $fileOut, $imgJPEGToWrite)) {
$errorMsg = 'ErrorWriteFile';
return false;
}
} else {
if (!@ImageJPEG($image2, $fileOut, $jpeg_quality)) {
$errorMsg = 'ErrorWriteFile';
return false;
}
}
// WEBP COPY
if($create_webp_copy == 1) {
if (!self::doWebpCopy($image1, $dst, $src, $fileOut, $jfile_thumbs,
$errorMsg)) {
return false;
}
}
// Possible FR FR2 - adding copyright of IPTC to thumbnails
/*
$fileIn ... original image
$fileOut ... destination image (e.g. thumbnail)
$copyright = array();
$info = array();
$data = '';
$size = getimagesize($fileIn, $info);
if(isset($info['APP13'])){
$iptc = iptcparse($info['APP13']);
if(isset($iptc['2#116'][0]) &&
$iptc['2#116'][0] != ''){
$iptcEmbed = array('2#116' =>
$iptc['2#116'][0]);
foreach($iptcEmbed as $tag => $string) {
$tag = substr($tag, 2);
// iptc_make_tag function can be found here, see below:
// https://www.php.net/manual/en/function.iptcembed.php (example
1)
$data .= iptc_make_tag(2, $tag, $string);
}
$content = iptcembed($data, $fileOut);
// User Joomla! methods to write files
$fw = fopen($fileOut, 'w');
fwrite($fw, $content);
fclose($fw);
}
}
function iptc_make_tag($rec, $data, $value) {
$length = strlen($value);
$retval = chr(0x1C) . chr($rec) . chr($data);
if($length < 0x8000)
{
$retval .= chr($length >> 8) . chr($length & 0xFF);
}
else
{
$retval .= chr(0x80) .
chr(0x04) .
chr(($length >> 24) & 0xFF) .
chr(($length >> 16) & 0xFF) .
chr(($length >> 8) & 0xFF) .
chr($length & 0xFF);
}
return $retval . $value;
}
*/
break;
case IMAGETYPE_PNG :
if (!function_exists('ImagePNG')) {
$errorMsg = 'ErrorNoPNGFunction';
return false;
}
if ($jfile_thumbs == 1) {
ob_start();
if (!@ImagePNG($image2, NULL )) {
ob_end_clean();
$errorMsg = 'ErrorWriteFile';
return false;
}
$imgPNGToWrite = ob_get_contents();
ob_end_clean();
if(!JFile::write( $fileOut, $imgPNGToWrite)) {
$errorMsg = 'ErrorWriteFile';
return false;
}
} else {
if (!@ImagePNG($image2, $fileOut)) {
$errorMsg = 'ErrorWriteFile';
return false;
}
}
// WEBP COPY
if($create_webp_copy == 1) {
if (!self::doWebpCopy($image1, $dst, $src, $fileOut, $jfile_thumbs,
$errorMsg)) {
return false;
}
}
break;
case IMAGETYPE_GIF :
if (!function_exists('ImageGIF')) {
$errorMsg = 'ErrorNoGIFFunction';
return false;
}
if ($jfile_thumbs == 1) {
ob_start();
if (!@ImageGIF($image2, NULL)) {
ob_end_clean();
$errorMsg = 'ErrorWriteFile';
return false;
}
$imgGIFToWrite = ob_get_contents();
ob_end_clean();
if(!JFile::write( $fileOut, $imgGIFToWrite)) {
$errorMsg = 'ErrorWriteFile';
return false;
}
} else {
if (!@ImageGIF($image2, $fileOut)) {
$errorMsg = 'ErrorWriteFile';
return false;
}
}
// WEBP COPY
if($create_webp_copy == 1) {
if (!self::doWebpCopy($image1, $dst, $src, $fileOut, $jfile_thumbs,
$errorMsg)) {
return false;
}
}
break;
case IMAGETYPE_WEBP :
if (!function_exists('ImageWEBP')) {
$errorMsg = 'ErrorNoWEBPFunction';
return false;
}
if ($jfile_thumbs == 1) {
ob_start();
if (!@imagewebp($image2, NULL)) {
ob_end_clean();
$errorMsg = 'ErrorWriteFile';
return false;
}
$imgWEBPToWrite = ob_get_contents();
ob_end_clean();
if(!JFile::write( $fileOut, $imgWEBPToWrite))
{
$errorMsg = 'ErrorWriteFile';
return false;
}
} else {
if (!@imagewebp($image2, $fileOut)) {
$errorMsg = 'ErrorWriteFile';
return false;
}
}
break;
default:
$errorMsg = 'ErrorNotSupportedImage';
return false;
break;
}
// free memory
ImageDestroy($image1);
ImageDestroy($image2);
if (isset($waterImage1)) {
ImageDestroy($waterImage1);
}
if ($memoryLimitChanged == 1) {
$memoryString = $memory . 'M';
ini_set('memory_limit', $memoryString);
}
$errorMsg = ''; // Success
return true;
} else {
$errorMsg = 'Error1';
return false;
}
if ($memoryLimitChanged == 1) {
$memoryString = $memory . 'M';
ini_set('memory_limit', $memoryString);
}
}
$errorMsg = 'Error2';
return false;
}
public static function doWebpCopy($image1, $dst, $src, $fileOut,
$jfile_thumbs, &$errorMsg) {
$image2 = @ImageCreateTruecolor($dst[2], $dst[3]);
if (!$image2) {
$errorMsg = 'ErrorNoImageCreateTruecolor';
return false;
}
//imagealphablending($image1, false);
@imagealphablending($image2, false);
//imagesavealpha($image1, true);
@imagesavealpha($image2, true);
ImageCopyResampled($image2, $image1, $dst[0],$dst[1], $src[0],$src[1],
$dst[2],$dst[3], $src[2],$src[3]);
if (!function_exists('ImageWEBP')) {
$errorMsg = 'ErrorNoWEBPFunction';
return false;
}
$fileOut = PhocacartFile::changeFileExtension($fileOut,
'webp');
if ($jfile_thumbs == 1) {
ob_start();
if (!@imagewebp($image2, NULL)) {
ob_end_clean();
$errorMsg = 'ErrorWriteFile';
return false;
}
$imgWEBPToWrite = ob_get_contents();
ob_end_clean();
if(!JFile::write( $fileOut, $imgWEBPToWrite)) {
$errorMsg = 'ErrorWriteFile';
return false;
}
} else {
if (!@imagewebp($image2, $fileOut)) {
$errorMsg = 'ErrorWriteFile';
return false;
}
}
return true;
}
}
?>
PK�"�[�#o,,libraries/phocacart/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�#o,,'libraries/phocacart/language/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�4��)libraries/phocacart/language/language.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class PhocacartLanguage
{
private $primeLangTag = '';
private $primeLangPaths = array();
/**
* Set new language and return the default so it can be set back
* @param $lang
*/
public function __construct(){
$language = JFactory::getLanguage();
$this->primeLangTag = $language->getTag();
$this->primeLangPaths = $language->getPaths();
}
public function setLanguage($lang) {
$app = JFactory::getApplication();
$language = JFactory::getLanguage();
if ($lang != '' && $lang != '*') {
$newLang = JLanguage::getInstance($lang);
JFactory::$language = $newLang;
$app->loadLanguage($newLang);
if (!empty($this->primeLangPaths)) {
foreach($this->primeLangPaths as $k => $v) {
$newLang->load($k);
}
}
}
}
public function setLanguageBack() {
$app = JFactory::getApplication();
$language = JFactory::getLanguage();
$newLang = JLanguage::getInstance($this->primeLangTag);
JFactory::$language = $newLang;
$app->loadLanguage($newLang);
if (!empty($this->primeLangPaths)) {
foreach($this->primeLangPaths as $k => $v) {
$newLang->load($k);
}
}
}
public function getDefaultLanguage($type = 1) {
$params = JComponentHelper::getParams('com_languages');
if ($type == 1) {
return $params->get('site');
} else {
return $params->get('administrator');
}
}
/* Static Part */
/* $titleSuffix = array(
0 => array('title', 'separator',
'starttag', 'endtag));
*/
public static function renderTitle($title = '', $titleLang =
'', $titleSuffix = array(), $type = 'order') {
$paramsC = PhocacartUtils::getComponentParameters();
$order_language_variables = $paramsC->get(
'order_language_variables', 0 );
// No language variables (no translation) for items in order (total
items like shipping or payment titles)
if ($type == 'order' && $order_language_variables
== 0) {
return $title;;
}
$o = '';
if ($titleLang != '') {
$o .= JText::_($titleLang);
if (!empty($titleSuffix)) {
foreach ($titleSuffix as $k => $v) {
$title = isset($v[0]) && $v[0] !=
'' ? $v[0] : '';
$separator = isset($v[1]) && $v[1] !=
'' ? $v[1] : '';
$startTag = isset($v[2]) && $v[2] !=
'' ? $v[2] : '';
$endTag = isset($v[3]) && $v[3] !=
'' ? $v[3] : '';
if ($startTag . JText::_($title) . $endTag !=
'') {
$o .= $separator . $startTag . JText::_($title) .
$endTag;
}
}
}
} else {
// No title raw, render standard title (such includes suffix)
$o = $title;
}
return $o;
}
}
?>
PK�"�[�#o,,"libraries/phocacart/log/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[���libraries/phocacart/log/log.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class PhocacartLog
{
/* type - type : e.g warning, error, etc.
* 1 ... all
* 2 ... error
* 3 ... warnings
* 4 ... notices
* typeid - for example order id, category id, product id
*
* Example:
* PhocacartLog::add(1, 'Message', $productId, 'IP: '.
$data['ip'].', User ID: '.$user->id . ', User
Name: '.$user->username);
*/
public static function add( $type = 0, $title = '', $typeid = 0,
$description = '') {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$enable_logging = $paramsC->get( 'enable_logging', 0 );// 0
disable, 1 all, 2 error only
if ($enable_logging == 0) {
return false;
}
if ($enable_logging == 2 && $type != 2) {
return false;
}
// Additional User information
$descSuffix = '';
if ($app->isClient('site')){
$user = PhocacartUser::getUser();
$guest = PhocacartUserGuestuser::getGuestUser();
if ($guest){
$descSuffix .= ', User: Guest Checkout';
} else if ($user->username != ''){
$descSuffix .= ', User: '.$user->username;
} else {
$descSuffix .= ', User: Anonymous'; // Not logged in user, no
guest checkout started
}
}
$description .= $descSuffix;
if ((int)$type > 0 && $title != '' ) {
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$user = PhocacartUser::getUser();
$db = JFactory::getDBO();
$ip = $_SERVER["REMOTE_ADDR"];
$incoming_page = htmlspecialchars($uri->toString());
$userid = 0;
if (isset($user->id) && (int)$user->id > 0) {
$userid = $user->id;
}
// Ordering
$ordering = 0;
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_logs');
$max = $db->loadResult();
$ordering = $max+1;
$query = ' INSERT INTO #__phocacart_logs ('
.$db->quoteName('user_id').', '
.$db->quoteName('type_id').', '
.$db->quoteName('type').', '
.$db->quoteName('title').', '
.$db->quoteName('ip').', '
.$db->quoteName('incoming_page').', '
.$db->quoteName('description').', '
.$db->quoteName('published').', '
.$db->quoteName('ordering').', '
.$db->quoteName('date').' )'
. ' VALUES ('
.$db->quote((int)$userid).', '
.$db->quote((int)$typeid).', '
.$db->quote((int)$type).', '
.$db->quote($title).', '
.$db->quote($ip).', '
.$db->quote($incoming_page).', '
.$db->quote($description).', '
.$db->quote('1').', '
.$db->quote((int)$ordering).', '
.$db->quote(gmdate('Y-m-d H:i:s')).' )';
$db->setQuery($query);
$db->execute();
return true;
}
return false;
}
}
?>
PK�"�[�#o,,+libraries/phocacart/manufacturer/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[G'5��1libraries/phocacart/manufacturer/manufacturer.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartManufacturer
{
public static function getAllManufacturers($ordering = 1,
$onlyAvailableProducts = 0, $lang = '', $filterProducts =
array(), $limitCount = -1) {
$db = JFactory::getDBO();
$orderingText = PhocacartOrdering::getOrderingText($ordering, 4);
$wheres = array();
$lefts = array();
$columns = 'm.id, m.title, m.image, m.alias, m.description,
m.count_products';
/*$groupsFull = $columns;
$groupsFast = 'm.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;*/
$wheres[] = ' m.published = 1';
if ($lang != '' && $lang != '*') {
$wheres[] =
PhocacartUtilsSettings::getLangQuery('m.language', $lang);
}
if ($onlyAvailableProducts == 1) {
if ($lang != '' && $lang != '*') {
$wheres[] =
PhocacartUtilsSettings::getLangQuery('p.language', $lang);
}
$lefts[] = ' #__phocacart_products AS p ON m.id =
p.manufacturer_id';
$rules = PhocacartProduct::getOnlyAvailableProductRules();
$wheres = array_merge($wheres, $rules['wheres']);
$lefts = array_merge($lefts, $rules['lefts']);
} else {
if ($lang != '' && $lang != '*') {
$wheres[] =
PhocacartUtilsSettings::getLangQuery('p.language', $lang);
$lefts[] = ' #__phocacart_products AS p ON m.id =
p.manufacturer_id';
}
}
if (!empty($filterProducts)) {
$productIds = implode (',', $filterProducts);
$wheres[] = 'p.id IN ('.$productIds.')';
}
if ((int)$limitCount > -1) {
$wheres[] = " m.count_products > ".(int)$limitCount;
}
$q = ' SELECT DISTINCT '.$columns
.' FROM #__phocacart_manufacturers AS m'
. (!empty($lefts) ? ' LEFT JOIN ' . implode( ' LEFT JOIN
', $lefts ) : '')
. (!empty($wheres) ? ' WHERE ' . implode( ' AND ',
$wheres ) : '')
//.' GROUP BY '.$groups
.' ORDER BY '.$orderingText;
$db->setQuery($q);
$items = $db->loadObjectList();
return $items;
}
public static function getManufacturers($itemId, $select = 0) {
$db = JFactory::getDBO();
if ($select == 1) {
$query = 'SELECT a.id';
} else if ($select == 2){
$query = 'SELECT a.id, a.alias ';
} else {
$query = 'SELECT a.id, a.title, a.alias, a.type,
a.display_format';
}
$query .= ' FROM #__phocacart_manufacturers AS a'
.' LEFT JOIN #__phocacart_products AS p ON a.id =
p.manufacturer_id'
.' WHERE p.id = '.(int) $itemId
.' ORDER BY a.id';
$db->setQuery($query);
if ($select == 1) {
$tags = $db->loadColumn();
} else {
$tags = $db->loadObjectList();
}
return $tags;
}
public static function getManufacturersByIds($cids) {
$db = JFactory::getDBO();
if ($cids != '') {//cids is string separated by comma
$query = 'SELECT a.id FROM #__phocacart_manufacturers AS
a'
. ' LEFT JOIN #__phocacart_products AS p ON a.id =
p.manufacturer_id'
. ' WHERE p.id IN (' . $cids . ')'
. ' ORDER BY a.id';
$db->setQuery($query);
$tags = $db->loadColumn();
$tags = array_unique($tags);
return $tags;
}
return array();
}
public static function getManufacturerRendered($id, $title, $alias,
$manufacturerAlias, $type = 1, $catId = 0, $catAlias = '') {
if ($type == 1 && (int)$id > 0 && $title !=
'') {
$link = PhocacartRoute::getItemsRoute();
$link = $link . PhocacartRoute::getItemsRouteSuffix($manufacturerAlias,
$id, $alias);
return '<a href="'.JRoute::_($link).'"
>'.$title.'</a>';
} else {
return $title;
}
}
public static function getActiveManufacturers($items, $ordering,
$manufacturerAlias = 'manufacturer') {
$db = JFactory::getDbo();
$o = array();
$wheres = array();
$ordering = PhocacartOrdering::getOrderingText($ordering, 4);//m
if ($items != '') {
$wheres[] = 'm.id IN (' . $items . ')';
$q = 'SELECT DISTINCT m.title, CONCAT(m.id,
\'-\', m.alias) AS alias,
'.$db->quote($manufacturerAlias).' AS parameteralias,
'.$db->quote(ucfirst($manufacturerAlias)).' AS parametertitle
FROM #__phocacart_manufacturers AS m'
. (!empty($wheres) ? ' WHERE ' . implode('
AND ', $wheres) : '')
. ' GROUP BY m.alias, m.title'
. ' ORDER BY ' . $ordering;
$db->setQuery($q);
$o = $db->loadAssocList();
}
return $o;
}
}
?>
PK�"�[�#o,,)libraries/phocacart/newsletter/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[i���-libraries/phocacart/newsletter/newsletter.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartNewsletter {
public static function storeSubscriber($name, $email, $privacy) {
// PHOCA EMAIL COMPONENT NEEDED
$comPhocaemail =
PhocacartUtilsExtension::getExtensionInfo('com_phocaemail');
if($comPhocaemail) {
$lang = JFactory::getLanguage();
$lang->load('com_phocaemail');
if (JFile::exists(JPATH_ADMINISTRATOR .
'/components/com_phocaemail/helpers/phocaemail.php')) {
require_once(JPATH_ADMINISTRATOR .
'/components/com_phocaemail/helpers/phocaemail.php');
}
if (JFile::exists(JPATH_ADMINISTRATOR .
'/components/com_phocaemail/helpers/phocaemailutils.php')) {
require_once(JPATH_ADMINISTRATOR .
'/components/com_phocaemail/helpers/phocaemailutils.php');
}
if (JFile::exists(JPATH_ADMINISTRATOR .
'/components/com_phocaemail/helpers/phocaemailsendnewsletteremail.php'))
{
require_once(JPATH_ADMINISTRATOR .
'/components/com_phocaemail/helpers/phocaemailsendnewsletteremail.php');
}
if (JFile::exists(JPATH_ADMINISTRATOR .
'/components/com_phocaemail/tables/phocaemailsubscriber.php')) {
require_once(JPATH_ADMINISTRATOR .
'/components/com_phocaemail/tables/phocaemailsubscriber.php');
}
JTable::addIncludePath(JPATH_ADMINISTRATOR .
'/components/com_phocaemail/tables');
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$pE = JComponentHelper::getParams('com_phocaemail');
$pC = PhocacartUtils::getComponentParameters();
$newsletter_enable = $pC->get('newsletter_enable',
0);
$newsletter_activate =
$pC->get('newsletter_activate', 0);
$newsletter_mailinglist =
$pC->get('newsletter_mailinglist', array());
if ($newsletter_enable == 0) {
return false;
}
$data = array();
$data['name'] = $name;
$data['email'] = $email;
$data['privacy'] = (int)$privacy;
$data['date'] = gmdate('Y-m-d H:i:s');
$data['date_register'] = gmdate('Y-m-d
H:i:s');
$data['token'] = PhocaEmailHelper::getToken();
$data['active'] = 0;
if ($newsletter_activate == 1){
$data['active'] = 1;
$data['date_active'] = gmdate('Y-m-d
H:i:s');
}
$data['published'] = 1;
$data['hits'] = 0;
$data['type'] = 2;// Phoca Cart
// Test - if there is active user, inactive user with many
requests,
$query = 'SELECT a.id, a.active, a.hits'
. ' FROM #__phocaemail_subscribers AS a'
. ' WHERE a.email =
'.$db->quote($data['email'])
. ' LIMIT 1';
$db->setQuery( $query );
$userSub = $db->loadObject();
// X) ACTIVE USER
if (isset($userSub->active) && $userSub->active
== 1) {
return false;//COM_PHOCAEMAIL_YOUR_SUBSCRIPTION_IS_ACTIVE
}
// X) UPDATE HITS - ATTEMPTS
if (isset($userSub->hits) && (int)$userSub->hits
> 0) {
$userSub->hits++;// This attempts must be counted
$data['hits'] = (int)$userSub->hits;
} else {
$data['hits'] = 1;
}
// X) NOT ACTIVE BUT STORED IN DATABASE
$allowedHits = (int)$pE->get('count_subscription',
5);
if (isset($userSub->hits) && (int)$userSub->hits
> (int)$allowedHits) {
return
false;//COM_PHOCAEMAIL_YOUR_SUBSCRIPTION_IS_BLOCKED_PLEASE_CONTACT_ADMINISTRATOR
}
// X) USER EXISTS BUT IS INACTIVE AND ALLOWED TO SUBSCRIBE
if (isset($userSub->active) &&
(int)$userSub->active != 1 && isset($userSub->id) &&
(int)$userSub->id > 0) {
$data['id'] = (int)$userSub->id;
}
// X) SEEMS LIKE USER IS NOT IN DATABASE, ADD IT - user id will
be automatically created
// ... ok
// X) IF REGISTERED USER - ASSIGN AN ACCOUNT TO HIM/HER
$query = 'SELECT u.id'
. ' FROM #__users AS u'
. ' WHERE u.email =
'.$db->quote($data['email'])
. ' LIMIT 1';
$db->setQuery( $query );
$registeredUser = $db->loadObject();
if (isset($registeredUser->id) &&
$registeredUser->id > 0) {
$data['userid'] = (int)$registeredUser->id;
}
$row = JTable::getInstance('phocaemailsubscriber',
'Table', array());
if (!$row->bind($data)) {
$db->setError($db->getErrorMsg());
return false;
}
if (!$row->check()) {
$db->setError($db->getErrorMsg());
return false;
}
if (!$row->store()) {
$db->setError($db->getErrorMsg());
return false;
}
if (!empty($newsletter_mailinglist) && (int)$row->id
> 0) {
PhocaEmailSendNewsletterEmail::storeLists((int)$row->id,
$newsletter_mailinglist, '#__phocaemail_subscriber_lists',
'id_subscriber');
}
if ($newsletter_activate == 2){
// Send activation email
$send = PhocaEmailSendNewsletterEmail::sendNewsLetterEmail($name,
$email, 'activate');
if ($send) {
} else {
}
}
return true;
}
}
public static function updateNewsletterInfoByUser($userId, $newsletter =
0) {
$db = JFactory::getDBO();
$query = ' UPDATE #__phocacart_users'
.' SET newsletter = '.(int)$newsletter
.' WHERE user_id = '.(int)$userId;
$db->setQuery($query);
$db->execute();
return true;
}
}
PK�"�[�ɢ`/`/)libraries/phocacart/order/calculation.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartOrderCalculation
{
protected $items = array();
protected $total = array();
protected $taxes = array();
protected $currencies = array();
protected $type = array(0,1);// e-shop, POS, ...
public function __construct() {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
// Affect only calculation in POS cart
// Not receipts, invoices
// Display or hide brutto prices in POS cart
//$this->posbruttocalculation = PhocacartPos::isPos() ?
$paramsC->get( 'pos_brutto_calculation', 1 ) : 0;
}
public function getItems() {
return $this->items;
}
public function getTotal() {
return $this->total;
}
public function getCurrencies() {
return $this->currencies;
}
public function calculateOrderItems($items) {
$itemsIdA = array();// array of all items IDs - only IDs - ALL ASKED
ORDERS
$itemsIdS = '';// string of all items IDs used in SQL query IN
$itemsId = array();// all items sorted by ID - the ID is the key of the
array
$itemsTotal = array();// ALL TOTAL ROWS OF EACH ASKED ORDER ITEMS
$price = new PhocacartPrice();
//$price->getPriceFormat($v['amount'],0,1);
if (!empty($items)) {
foreach($items as $k => $v) {
$id = (int)$v->id;
$itemsIdA[] = $id;
$itemsId[$id] = $v;
$currencyId = $v->currency_id;
if ($currencyId > 0 && !isset($currency[$currencyId])) {
$this->currencies[$currencyId] = $v->currency_code;
}
}
if (!empty($itemsIdA)) {
$itemsIdS = implode(',', $itemsIdA);
}
if ($itemsIdS != '') {
$itemsTotal = PhocacartOrder::getItemsTotal($itemsIdS);
$itemsTRC = PhocacartOrder::getItemsTaxRecapitulation($itemsIdS);
}
$this->items = $itemsId;
/* $itemsTotalSorted = array();
if (!empty($itemsTotal)) {
foreach($itemsTotal as $k => $v) {
$id = $v['id'];
$orderId = $v['order_id'];
$itemsTotalSorted[$orderId][$id] = $v;
}
}*/
if (!empty($itemsTotal)) {
// Define defaults so we can add (+)
foreach($this->currencies as $k => $v) {
$this->total[$k]['brutto'] = 0;
$this->total[$k]['netto'] = 0;
$this->total[$k]['rounding'] = 0;
$this->total[$k]['discount'] = 0;
// no tax here as there are different rates for tax
}
foreach($itemsTotal as $k => $v) {
$id = $v['order_id'];
$itemId = $v['item_id']; //for example, there can be
different types of VAT: 5% 10% 20%
$itemKey = PhocacartTax::getTaxKey($v['item_id'],
$v['item_id_c'], $v['item_id_r']);// but different type
ov VATs can be extended through country and region TAXES
$currencyId = $this->items[$id]->currency_id;
$r = $this->items[$id]->currency_exchange_rate;
switch($v['type']) {
case 'brutto':
$brutto = isset($v['amount_currency']) &&
$v['amount_currency'] > 0 ? $v['amount_currency'] :
$v['amount'] * $r;
if (isset($this->items[$id]->brutto)) {
$this->items[$id]->brutto += $price->roundPrice($brutto);
} else {
$this->items[$id]->brutto = $price->roundPrice($brutto);
}
$this->total[$currencyId]['brutto'] +=
$price->roundPrice($brutto);
break;
case 'sbrutto':
case 'pbrutto':
case 'dbrutto':
break;
case 'snetto':
case 'pnetto':
case 'netto':
$netto = $v['amount']*$r;
if (isset($this->items[$id]->netto)) {
$this->items[$id]->netto += $price->roundPrice($netto);
} else {
$this->items[$id]->netto = $price->roundPrice($netto);
}
$this->total[$currencyId]['netto'] +=
$price->roundPrice($netto);
break;
case 'rounding':
$rounding = isset($v['amount_currency']) &&
$v['amount_currency'] > 0 ? $v['amount_currency'] :
$v['amount']*$r;
if (isset($this->items[$id]->rounding)) {
$this->items[$id]->rounding +=
$price->roundPrice($rounding);
} else {
$this->items[$id]->rounding =
$price->roundPrice($rounding);
}
$this->total[$currencyId]['rounding'] +=
$price->roundPrice($rounding);
break;
case 'stax':
case 'ptax':
case 'tax':
$tax = $v['amount']*$r;
if (isset($this->items[$id]->tax[$itemKey])) {
$this->items[$id]->tax[$itemKey] +=
$price->roundPrice($tax);
} else {
$this->items[$id]->tax[$itemKey] =
$price->roundPrice($tax);
}
if (isset($this->items[$id]->taxsum)) {
$this->items[$id]->taxsum += $price->roundPrice($tax);//
sum of all taxes in one order
} else {
$this->items[$id]->taxsum = $price->roundPrice($tax);//
sum of all taxes in one order
}
if (isset($this->total[$currencyId]['tax'][$itemKey]))
{
$this->total[$currencyId]['tax'][$itemKey] +=
$price->roundPrice($tax);
} else {
$this->total[$currencyId]['tax'][$itemKey] =
$price->roundPrice($tax);
}
break;
case 'dnetto':
$dNetto = $v['amount']*$r;
if (isset($this->items[$id]->discount)) {
$this->items[$id]->discount +=
$price->roundPrice($dNetto);
} else {
$this->items[$id]->discount = $price->roundPrice($dNetto);
}
$this->total[$currencyId]['discount'] +=
$price->roundPrice($dNetto);
break;
}
}
}
if (!empty($itemsTRC)) {
// Define defaults so we can add (+)
foreach($this->currencies as $k => $v) {
$this->total[$k]['trcnetto'] = 0;
$this->total[$k]['trcrounding'] = 0;
$this->total[$k]['trcbrutto'] = 0;
// no tax here as there are different rates for tax
}
foreach($itemsTRC as $k => $v) {
$id = $v['order_id'];
$itemId = $v['item_id']; //for example, there can be
different types of VAT: 5% 10% 20%
$itemKey = PhocacartTax::getTaxKey($v['item_id'],
$v['item_id_c'], $v['item_id_r']);// but different type
ov VATs can be extended through country and region TAXES
$currencyId = $this->items[$id]->currency_id;
$r = $this->items[$id]->currency_exchange_rate;
switch($v['type']) {
case 'tax':
$netto = $v['amount_netto']*$r;
$tax = $v['amount_tax']*$r;
//$brutto = $v['amount_brutto']*$r;
// $brutto = isset($v['amount_brutto_currency'])
&& $v['amount_brutto_currency'] > 0 ?
$v['amount_brutto_currency'] : $v['amount_brutto'] *
$r;
if (isset($this->items[$id]->trctax[$itemKey])) {
$this->items[$id]->trctax[$itemKey] +=
$price->roundPrice($tax);
} else {
$this->items[$id]->trctax[$itemKey] =
$price->roundPrice($tax);
}
if (isset($this->items[$id]->trctaxsum)) {
$this->items[$id]->trctaxsum +=
$price->roundPrice($tax);// sum of all taxes in one order
} else {
$this->items[$id]->trctaxsum = $price->roundPrice($tax);//
sum of all taxes in one order
}
if
(isset($this->total[$currencyId]['trctax'][$itemKey])) {
$this->total[$currencyId]['trctax'][$itemKey] +=
$price->roundPrice($tax);
} else {
$this->total[$currencyId]['trctax'][$itemKey] =
$price->roundPrice($tax);
}
if (isset($this->items[$id]->trcnetto)) {
$this->items[$id]->trcnetto += $price->roundPrice($netto);
} else {
$this->items[$id]->trcnetto = $price->roundPrice($netto);
}
if (isset($this->total[$currencyId]['trcnetto'])) {
$this->total[$currencyId]['trcnetto'] +=
$price->roundPrice($netto);
} else {
$this->total[$currencyId]['trcnetto'] =
$price->roundPrice($netto);
}
break;
case 'brutto':
$brutto = isset($v['amount_brutto_currency']) &&
$v['amount_brutto_currency'] > 0 ?
$v['amount_brutto_currency'] : $v['amount_brutto'] *
$r;
if (isset($this->items[$id]->trcbrutto)) {
$this->items[$id]->trcbrutto +=
$price->roundPrice($brutto);
} else {
$this->items[$id]->trcbrutto =
$price->roundPrice($brutto);
}
if (isset($this->total[$currencyId]['trcbrutto'])) {
$this->total[$currencyId]['trcbrutto'] +=
$price->roundPrice($brutto);
} else {
$this->total[$currencyId]['trcbrutto'] =
$price->roundPrice($brutto);
}
break;
case 'trcrounding':
$rounding = isset($v['amount_brutto_currency'])
&& $v['amount_brutto_currency'] > 0 ?
$v['amount_brutto_currency'] : $v['amount_brutto'] *
$r;
if (isset($this->items[$id]->trcrounding)) {
$this->items[$id]->trcrounding +=
$price->roundPrice($rounding);
} else {
$this->items[$id]->trcrounding =
$price->roundPrice($rounding);
}
if (isset($this->total[$currencyId]['trcrounding'])) {
$this->total[$currencyId]['trcrounding'] +=
$price->roundPrice($rounding);
} else {
$this->total[$currencyId]['trcrounding'] =
$price->roundPrice($rounding);
}
break;
/*case 'brutto':
$brutto = isset($v['amount_brutto_currency']) &&
$v['amount_brutto_currency'] > 0 ?
$v['amount_brutto_currency'] : $v['amount_brutto'] *
$r;
if (isset($this->items[$id]->trcbrutto)) {
$this->items[$id]->trcbrutto += $brutto;
} else {
$this->items[$id]->trcbrutto = $brutto;
}
$this->total[$currencyId]['trcbrutto'] += $brutto;
break;
case 'netto':
$netto = $v['amount_netto']*$r;
if (isset($this->items[$id]->trcnetto)) {
$this->items[$id]->trcnetto += $netto;
} else {
$this->items[$id]->trcnetto = $netto;
}
$this->total[$currencyId]['trcnetto'] += $netto;
break;
case 'rounding':
$rounding = isset($v['amount_brutto_currency']) &&
$v['amount_brutto_currency'] > 0 ?
$v['amount_brutto_currency'] : $v['amount_brutto'] *
$r;
if (isset($this->items[$id]->trcrounding)) {
$this->items[$id]->trcrounding += $rounding;
} else {
$this->items[$id]->trcrounding = $rounding;
}
$this->total[$currencyId]['trcrounding'] += $rounding;
break;
case 'tax':
$tax = $v['amount_tax']*$r;
if (isset($this->items[$id]->trctax[$itemKey])) {
$this->items[$id]->trctax[$itemKey] += $tax;
} else {
$this->items[$id]->trctax[$itemKey] = $tax;
}
if (isset($this->items[$id]->trctaxsum)) {
$this->items[$id]->trctaxsum += $tax;// sum of all taxes in
one order
} else {
$this->items[$id]->trctaxsum = $tax;// sum of all taxes in
one order
}
if
(isset($this->total[$currencyId]['trctax'][$itemKey])) {
$this->total[$currencyId]['trctax'][$itemKey] += $tax;
} else {
$this->total[$currencyId]['trctax'][$itemKey] = $tax;
}
break;
/* case 'dnetto':
$dNetto = $v['amount']*$r;
if (isset($this->items[$id]->discount)) {
$this->items[$id]->discount += $dNetto;
} else {
$this->items[$id]->discount = $dNetto;
}
$this->total[$currencyId]['discount'] += $dNetto;
break;*/
}
}
}
return true;
}
}
}
?>PK�"�[�#o,,$libraries/phocacart/order/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[f7��#libraries/phocacart/order/order.phpnu�[���<?php
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\OrderingField;
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
JTable::addIncludePath(JPATH_ADMINISTRATOR .
'/components/com_phocacart/tables');
class PhocacartOrder
{
public $downloadable_product;
public $action_after_order;
public $message_after_order;
public $data_after_order;
protected $type = array(0, 1);// 0 all, 1 online shop, 2 pos (category
type, payment method type, shipping method type)
public function __construct() {
$this->downloadable_product = 0;
// if there will be at least one downloadable file in order, we
will mark it to display
// right thank you message
$this->action_after_order = 1;
// which action will be done after order - end, procceed to payment, ...
$this->message_after_order = array();// custom message array
made by plugin
$this->data_after_order = array();
}
public function setType($type = array(0, 1)) {
$this->type = $type;
}
public function saveOrderMain($data) {
$msgSuffix = '<span id="ph-msg-ns"
class="ph-hidden"></span>';
$pC = PhocacartUtils::getComponentParameters();
$min_order_amount = $pC->get('min_order_amount',
0);
$stock_checkout = $pC->get('stock_checkout', 0);
$stock_checking = $pC->get('stock_checking', 0);
$unit_weight = $pC->get('unit_weight',
'');
$unit_volume = $pC->get('unit_volume',
'');
$order_language = $pC->get('order_language', 0);
$skip_shipping_method =
$pC->get('skip_shipping_method', 0);
$skip_payment_method =
$pC->get('skip_payment_method', 0);
// LANGUAGES
$lang = JFactory::getLanguage();
$userLang = $lang->getTag();// Get language user uses in
frontend
$pLang = new PhocacartLanguage();
$defaultLang = $pLang->getDefaultLanguage(0);// Get default
language of frontend
if ($order_language == 0) {
// If the order should be stored in default language force it
and and the end change it back so user get right message
$pLang->setLanguage($defaultLang);
}
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$action = $uri->toString();
$app = JFactory::getApplication();
$user = PhocacartUser::getUser();
$guest = PhocacartUserGuestuser::getGuestUser();
$cart = new PhocacartCartRendercheckout();
$cart->setInstance(3);//order
$cart->setType($this->type);
$cart->setFullItems();
$fullItems = $cart->getFullItems();
$currency = PhocacartCurrency::getCurrency();
if (empty($fullItems[0])) {
if ($order_language == 0) {
$pLang->setLanguageBack($defaultLang);
}
$msg =
JText::_('COM_PHOCACART_SHOPPING_CART_IS_EMPTY');
$app->enqueueMessage($msg, 'error');
return false;
}
$shippingId = $cart->getShippingId();
$cart->addShippingCosts($shippingId);
$shippingC = $cart->getShippingCosts();
$payment = $cart->getPaymentMethod();
$cart->addPaymentCosts($payment['id']);// validity of
payment will be checked
$paymentC = $cart->getPaymentCosts();
$couponCart = $cart->getCoupon();
$coupon = false;
if (isset($couponCart['id']) &&
$couponCart['id'] > 0) {
$couponO = new PhocacartCoupon();
$couponO->setType($this->type);
$couponO->setCoupon((int)$couponCart['id']);
$coupon = $couponO->getCoupon();
}
if (!$coupon) {
$coupon = $couponCart;
}
$cart->roundTotalAmount();
$total = $cart->getTotal();
// --------------------
// TERMS AND CONDITIONS, PRIVACY
// --------------------
// checked in controller
// --------------------
// CHECK COUPON
// --------------------
if (isset($coupon['id']) &&
(int)$coupon['id'] > 0 && $cart->getCouponValid()
== false) {
$msg =
JText::_('COM_PHOCACART_COUPON_INVALID_EXPIRED_REACHED_USAGE_LIMIT')
. $msgSuffix;
$app->enqueueMessage($msg, 'error');
PhocacartPayment::removePayment(0, 1);
return false;
}
// --------------------
// CHECK OPENING TIMES
// --------------------
// Possible parameter: display message on info page:
PhocacartTime::checkOpeningTimes(), Hide message on info page:
PhocacartTime::checkOpeningTimes(0)
if (PhocacartTime::checkOpeningTimes() == false) {
// Message set in checkOpeningTimes() method
return false;
}
// --------------------
// CHECK GUEST USER
// --------------------
if ((!isset($user->id) || (isset($user->id) &&
$user->id < 1)) && $guest == false &&
!PhocacartPos::isPos()) {
if ($order_language == 0) {
$pLang->setLanguageBack($defaultLang);
}
$msg =
JText::_('COM_PHOCACART_GUEST_CHECKOUT_DISABLED') . $msgSuffix;
$app->enqueueMessage($msg, 'error');
return false;
}
// --------------------
// CHECK CAPTCHA
// --------------------
$pos = PhocacartPos::isPosView();
$enable_captcha_checkout =
PhocacartCaptcha::enableCaptchaCheckout();
if ($enable_captcha_checkout && !$pos) {
if (!PhocacartCaptchaRecaptcha::isValid()) {
if ($order_language == 0) {
$pLang->setLanguageBack($defaultLang);
}
$msg = JText::_('COM_PHOCACART_WRONG_CAPTCHA') .
$msgSuffix;
$app->enqueueMessage($msg, 'error');
return false;
// What happens when the CAPTCHA was entered incorrectly
//$info = array();
//$info['field'] = 'question_captcha';
}
}
// --------------------
// CHECK MINIMUM ORDER AMOUNT
// --------------------
if ($min_order_amount > 0 &&
$total[0]['brutto'] < $min_order_amount) {
$price = new PhocacartPrice();
$price->setCurrency($currency->id);
$priceFb =
$price->getPriceFormat($total[0]['brutto']);
$priceFm = $price->getPriceFormat($min_order_amount);
if ($order_language == 0) {
$pLang->setLanguageBack($defaultLang);
}
$msg =
JText::_('COM_PHOCACART_MINIMUM_ORDER_AMOUNT_NOT_MET_UPDATE_CART_BEFORE_ORDERING');
$msg .= '<br />';
$msg .=
JText::_('COM_PHOCACART_MINIMUM_ORDER_AMOUNT_IS') . ':
' . $priceFm;
$msg .= '<br />';
$msg .=
JText::_('COM_PHOCACART_YOUR_ORDER_AMOUNT_IS') . ': ' .
$priceFb . $msgSuffix;
$app->enqueueMessage($msg, 'error');
return false;
}
// --------------------
// CHECK STOCK VALIDITY
// --------------------
$stockValid = $cart->getStockValid();
if ($stock_checking == 1 && $stock_checkout == 1 &&
$stockValid == 0) {
if ($order_language == 0) {
$pLang->setLanguageBack($defaultLang);
}
$msg =
JText::_('COM_PHOCACART_PRODUCTS_NOT_AVAILABLE_IN_QUANTITY_OR_NOT_IN_STOCK_UPDATE_QUANTITY_BEFORE_ORDERING')
. $msgSuffix;
$app->enqueueMessage($msg, 'error');
return false;
}
// --------------------
// CHECK MIN QUANTITY
// --------------------
$minQuantityValid = $cart->getMinimumQuantityValid();
if ($minQuantityValid == 0) {
if ($order_language == 0) {
$pLang->setLanguageBack($defaultLang);
}
$msg =
JText::_('COM_PHOCACART_MINIMUM_ORDER_QUANTITY_OF_ONE_OR_MORE_PRODUCTS_NOT_MET_UPDATE_QUANTITY_BEFORE_ORDERING')
. $msgSuffix;
$app->enqueueMessage($msg, 'error');
return false;
}
// --------------------
// CHECK MIN MULTIPLE QUANTITY
// --------------------
$minMultipleQuantityValid =
$cart->getMinimumMultipleQuantityValid();
if ($minMultipleQuantityValid == 0) {
if ($order_language == 0) {
$pLang->setLanguageBack($defaultLang);
}
$msg =
JText::_('COM_PHOCACART_MINIMUM_MULTIPLE_ORDER_QUANTITY_OF_ONE_OR_MORE_PRODUCTS_NOT_MET_UPDATE_QUANTITY_BEFORE_ORDERING')
. $msgSuffix;
$app->enqueueMessage($msg, 'error');
return false;
}
// --------------------
// CHECK IF PRODUCT OR ATTRIBUTES EXIST
// --------------------
$productsRemoved = $cart->getProductsRemoved();
if (!empty($productsRemoved)) {
if ($order_language == 0) {
$pLang->setLanguageBack($defaultLang);
}
// Message is set by cart class
//$msg = JText::_('') . $msgSuffix;
//$app->enqueueMessage($msg, 'error');
return false;
}
$db = JFactory::getDBO();
//JTable::addIncludePath(JPATH_ADMINISTRATOR .
'/components/com_phocacart/tables');
// ORDER
$d = array();
if ($guest) {
$d['user_id'] = 0;
} else {
$d['user_id'] = (int)$user->id;
}
// SET STATUS
// STATUS IS SET DIRECTLY
// 1) here in order class - when ordering done
$d['status_id']
// 2) in phocacartorder.php model (administration - changing order)
// 3) in phocacarteditstatus.php model (administration - changing
status)
// 4) or in e.g. payment methods through
PhocacartOrderStatus::changeStatusInOrderTable method
$statusId = $pC->get('default_order_status', 1);//
Ordered (Pending) as default
// Free Download
// 1) All products are digital
// 2) Order is zero price
if (isset($total[0]['countdigitalproducts']) &&
isset($total[0]['countallproducts'])
&& (int)$total[0]['countdigitalproducts'] ==
$total[0]['countallproducts']
&& $total[0]['brutto'] == 0 &&
$total[0]['netto'] == 0) {
$statusId =
$pC->get('default_order_status_free_download', 1);// Ordered
(Pending) as default
}
//$dispatcher = J EventDispatcher::getInstance();
$plugin = JPluginHelper::importPlugin('pcp',
htmlspecialchars(strip_tags($payment['method'])));
if ($plugin) {
$eventData = array();
$eventData['pluginname'] =
htmlspecialchars(strip_tags($payment['method']));
\JFactory::getApplication()->triggerEvent('PCPbeforeSaveOrder',
array(&$statusId, (int)$payment['id'], $eventData));
$d['status_id'] = (int)$statusId;// e.g. by POS Cash
we get automatically the status as completed
} else {
$d['status_id'] = $statusId;// no plugin or no event
found
}
$d['type'] =
PhocacartType::getTypeByTypeArray($this->type);
// Data order
$d['comment'] = isset($data['phcomment']) ?
$data['phcomment'] : '';
$d['privacy'] = isset($data['privacy']) ?
(int)$data['privacy'] : '';
$d['terms'] =
isset($data['phcheckouttac']) ?
(int)$data['phcheckouttac'] : '';
$d['newsletter'] = isset($data['newsletter']) ?
(int)$data['newsletter'] : 0;
// Data POS
$d['amount_pay'] =
isset($data['amount_pay']) ? $data['amount_pay'] : 0;
$d['amount_tendered'] =
isset($data['amount_tendered']) ?
$data['amount_tendered'] : 0;
$d['amount_change'] =
isset($data['amount_change']) ? $data['amount_change']
: 0;
$d['published'] = 1;
$d['shipping_id'] = (int)$shippingId;
$shippingParams = array();
if ((int)$shippingId > 0 &&
isset($shippingC['method']) &&
$shippingC['method'] != '') {
$shippingParams['method']=
htmlspecialchars(strip_tags($shippingC['method']));
}
$d['params_shipping'] =
json_encode($shippingParams);
$d['payment_id'] =
(int)$payment['id'];
$paymentParams = array();
if ((int)$payment['id'] > 0 &&
isset($payment['method']) && $payment['method']
!= '') {
$paymentParams['method'] =
htmlspecialchars(strip_tags($payment['method']));
}
$d['params_payment'] =
json_encode($paymentParams);
$d['coupon_id'] =
(int)$coupon['id'];
$d['currency_id'] = (int)$currency->id;
$d['currency_code'] = $currency->code;
$d['currency_exchange_rate'] =
$currency->exchange_rate;
$d['ip'] =
(!empty($_SERVER['REMOTE_ADDR'])) ?
(string)$_SERVER['REMOTE_ADDR'] : '';
$user_agent =
(!empty($_SERVER['HTTP_USER_AGENT'])) ?
(string)$_SERVER['HTTP_USER_AGENT'] : '';
$d['user_agent'] = substr($user_agent, 0,
200);
$d['order_token'] =
PhocacartUtils::getToken();
$d['tax_calculation'] =
$pC->get('tax_calculation', 0);
$d['unit_weight'] = $unit_weight;
$d['unit_volume'] = $unit_volume;
$d['discount_id'] =
$cart->getCartDiscountId();
$d['vendor_id'] = $cart->getVendorId();
$d['ticket_id'] = $cart->getTicketId();
$d['unit_id'] = $cart->getUnitId();
$d['section_id'] = $cart->getSectionId();
$d['loyalty_card_number'] =
$cart->getLoyaltyCartNumber();
$d['user_lang'] = $userLang;
$d['default_lang'] = $defaultLang;
// --------------------
// CHECK PAYMENT AND SHIPPING - TEST IF THE ORDER HAS RIGHT
SHIPPING AND PAYMENT METHOD
// --------------------
$shippingClass = new PhocacartShipping();
$shippingClass->setType($this->type);
$paymentClass = new PhocacartPayment();
$paymentClass->setType($this->type);
if ($guest) {
$address = PhocacartUserGuestuser::getUserAddressGuest();
} else {
$address = PhocacartUser::getUserAddress($user->id);
}
$dataAddress = array();
$dataAddress['bcountry'] = isset($address[0]->country)
&& (int)$address[0]->country > 0 ?
(int)$address[0]->country : 0;
$dataAddress['bregion'] = isset($address[0]->region)
&& (int)$address[0]->region > 0 ? (int)$address[0]->region
: 0;
$dataAddress['scountry'] = isset($address[1]->country)
&& (int)$address[1]->country > 0 ?
(int)$address[1]->country : 0;
$dataAddress['sregion'] = isset($address[1]->region)
&& (int)$address[1]->region > 0 ? (int)$address[1]->region
: 0;
$country = $shippingClass->getUserCountryShipping($dataAddress);
$region = $shippingClass->getUserRegionShipping($dataAddress);
$zip = $shippingClass->getUserZipShipping($dataAddress);
// Check Shipping method
if ($shippingId > 0) {
// 1) User selected some method
// - check if this method even exists
// - and check if the selected method meets every criteria
and rules to be selected
//$shippingMethods =
$shippingClass->checkAndGetShippingMethod($shippingId); CANNOT BE USED
BECAUSE OF DIFFERENT VARIABLES IN ORDER
$shippingMethods =
$shippingClass->getPossibleShippingMethods($total[0]['netto'],
$total[0]['brutto'], $total[0]['quantity'], $country,
$region, $zip, $total[0]['weight'],
$total[0]['length'], $total[0]['width'],
$total[0]['height'], $shippingId, 0);
} else {
// 2) No shipping method selected
$shippingMethods = false;
}
$sOCh = array();// Shipping Options Checkout
// PRODUCTTYPE - Digital products are even gift vouchers
$sOCh['all_digital_products'] =
isset($total[0]['countdigitalproducts']) &&
isset($total[0]['countallproducts']) &&
(int)$total[0]['countdigitalproducts'] ==
$total[0]['countallproducts'] ? 1 : 0;
$shippingNotUsed =
PhocacartShipping::isShippingNotUsed($sOCh);// REVERSE
$shippingNotFoundAllowProceed = false;
if (empty($shippingMethods) && $skip_shipping_method == 3)
{
// In case no shipping method will be found for customer even
all rules were applied - allow proceeding order without selecting shipping
method
// THIS CASE CAN BE VENDOR ERROR (wrong setting of shipping
methods) OR PURPOSE - be aware when using $skip_shipping_method = 3
// Cooperates with
components/com_phocacart/views/checkout/view.html.php 230
// Find all possible shipping methods (without shipping method
selected) to see if there is really no rule to display any method
$shippingtMethodsAllPossible =
$shippingClass->getPossibleShippingMethods($total[0]['netto'],
$total[0]['brutto'], $total[0]['quantity'], $country,
$region, $zip, $total[0]['weight'],
$total[0]['length'], $total[0]['width'],
$total[0]['height'], 0, 0);
if (empty($shippingtMethodsAllPossible)) {
$shippingNotFoundAllowProceed = true;
}
}
if (!empty($shippingMethods)) {
// IS OK - some shipping method was selected
} else if (empty($shippingMethods) &&
PhocacartPos::isPos()) {
// IS OK - shipping method was not selected but we are in POS
} else if (empty($shippingMethods) && $shippingNotUsed) {
// IS OK - shipping method was not selected but there is none
for selecting (shipping methods intentionally not used in shop)
// a) no shipping method is used
// b) or e.g. all items in cart are downloadable
products and in Phoca Cart options is set that in such case shipping need
not to be selected
$shippingId = 0;// Needed for payment method check
} else if ($shippingNotFoundAllowProceed) {
// IS OK
$shippingId = 0;
} else {
if ($order_language == 0) {
$pLang->setLanguageBack($defaultLang);
}
$msg =
JText::_('COM_PHOCACART_PLEASE_SELECT_RIGHT_SHIPPING_METHOD');
$app->enqueueMessage($msg, 'error');
return false;
}
$country = $paymentClass->getUserCountryPayment($dataAddress);
$region = $paymentClass->getUserRegionPayment($dataAddress);
// Check Payment method
if ($payment['id'] > 0) {
// 1) User selected some method
// - check if this method even exists
// - and check if the selected method meets every criteria
and rules to be selected
//$paymentMethods =
$paymentClass->checkAndGetPaymentMethod($payment['id']);
CANNOT BE USED BECAUSE OF DIFFERENT VARIABLES IN ORDER
$paymentMethods =
$paymentClass->getPossiblePaymentMethods($total[0]['netto'],
$total[0]['brutto'], $country, $region, $shippingId,
$payment['id'], 0);
} else {
// 2) No payment method selected
$paymentMethods = false;
}
$pOCh = array();// Payment Options Checkout
$pOCh['order_amount_zero'] =
$total[0]['brutto'] == 0 && $total[0]['netto']
== 0 ? 1 : 0;
$paymentNotUsed =
PhocacartPayment::isPaymentNotUsed($pOCh);// REVERSE
$paymentNotFoundAllowProceed = false;
if (empty($paymentMethods) && $skip_payment_method == 3) {
// In case no payment method will be found for customer even
all rules were applied - allow proceed order without payment
// THIS CASE CAN BE VENDOR ERROR (wrong setting of shipping
methods) OR PURPOSE - be aware when using $skip_shipping_method = 3
// Cooperates with
components/com_phocacart/views/checkout/view.html.php 270
// Find all possible payments methods (without payment method
selected) to see if there is really no rule to display any method
$paymentMethodsAllPossible =
$paymentClass->getPossiblePaymentMethods($total[0]['netto'],
$total[0]['brutto'], $country, $region, $shippingId, 0, 0);
if (empty($paymentMethodsAllPossible)) {
$paymentNotFoundAllowProceed = true;
}
}
if (!empty($paymentMethods)) {
// IS OK
} else if (empty($paymentMethods) && PhocacartPos::isPos())
{
// IS OK
} else if (empty($paymentMethods) && $paymentNotUsed) {
// IS OK
$paymentId = 0;
} else if ($paymentNotFoundAllowProceed) {
// IS OK
$paymentId = 0;
} else {
if ($order_language == 0) {
$pLang->setLanguageBack($defaultLang);
}
$msg =
JText::_('COM_PHOCACART_PLEASE_SELECT_RIGHT_PAYMENT_METHOD');
$app->enqueueMessage($msg, 'error');
return false;
}
$row = JTable::getInstance('PhocacartOrder',
'Table', array());
if (!$row->bind($d)) {
//throw new Exception($db->getErrorMsg());
if ($order_language == 0) {
$pLang->setLanguageBack($defaultLang);
}
$msg = JText::_($db->getErrorMsg()) . $msgSuffix;
$app->enqueueMessage($msg, 'error');
return false;
}
$row->date = gmdate('Y-m-d H:i:s');
$row->modified = $row->date;
if (!$row->check()) {
//throw new Exception($row->getError());
if ($order_language == 0) {
$pLang->setLanguageBack($defaultLang);
}
$msg = JText::_($row->getErrorMsg()) . $msgSuffix;
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->store()) {
//throw new Exception($row->getError());
if ($order_language == 0) {
$pLang->setLanguageBack($defaultLang);
}
$msg = JText::_($row->getErrorMsg()) . $msgSuffix;
$app->enqueueMessage($msg, 'error');
return false;
}
// GET ID OF ORDER
if ((int)$row->id > 0) {
// Set Order Billing
$orderBillingData = $this->saveOrderBilling($row->id,
$row->date, $d['status_id']);
// ADDRESS;
//$address = PhocacartUser::getUserAddress($user->id); - set
above
// Type 0 is Billing Address
if (isset($address[0]->type) && $address[0]->type
== 0) {
$this->cleanTable('phocacart_order_users',
$row->id);
$this->saveOrderUsers($address[0], $row->id);
} else if (isset($address[1]->type) &&
$address[1]->type == 0) {
$this->cleanTable('phocacart_order_users',
$row->id);
$this->saveOrderUsers($address[1], $row->id);
}
// Type 1 is Shipping Address
if (isset($address[1]->type) && $address[1]->type
== 1) {
$this->saveOrderUsers($address[1], $row->id);
} else if (isset($address[0]->type) &&
$address[0]->type == 1) {
$this->saveOrderUsers($address[0], $row->id);
}
//PRODUCT
if (!empty($fullItems[1])) {
$this->cleanTable('phocacart_order_products',
$row->id);
$this->cleanTable('phocacart_order_attributes', $row->id);
foreach ($fullItems[1] as $k => $v) {
// While saving:
// Check if attributes which are required were filled
// Check if products can be accessed (include their
categories)
$orderProductId = $this->saveOrderProducts($v,
$row->id);
/*
$v['id'] = product_id
$row->id = order_id
$orderProductId = order_product_id
*/
if ($orderProductId > 0) {
// PRODUCT DISCOUNTS - we are here because we need
Product ID and Order Product ID - both are different ids
$this->saveOrderProductDiscounts($orderProductId, $v['id'],
$row->id, $k, $fullItems);
}
if ($orderProductId > 0) {
// DOWNLOAD - we are here because we need Product
ID and Order Product ID - both are different ids
if (!isset($v['attributes'])) {
$v['attributes'] = false;
}
$this->saveOrderDownloads($orderProductId,
$v['id'], $v['catid'], $row->id);
}
if ($orderProductId > 0) {
// DOWNLOAD - we are here because we need Product
ID and Order Product ID - both are different ids
if (!isset($v['attributes'])) {
$v['attributes'] = false;
}
// User can buy gift coupons
// When user buys one the same coupon (quantity
> 1) we need to create more coupons from one "product"
if (isset($v['quantity'])) {
for ($i = 1; $i <=
(int)$v['quantity']; $i++) {
$this->saveOrderGiftCoupons($orderProductId, $v, $row->id, $k,
$fullItems);
}
}
}
if ($orderProductId > 0) {
// UPDATE the number of sales of one product - to
save sql queries in frontend
$this->updateNumberOfSalesOfProduct($orderProductId, $v['id'],
$row->id);
}
if (!$orderProductId) {
// DELETE NEWLY CREATED ORDER WHEN FAIL (not
accessible product, required option)
$this->deleteOrder($row->id);
$this->cleanTable('phocacart_order_products', $row->id);
$this->cleanTable('phocacart_order_attributes', $row->id);
$this->cleanTable('phocacart_order_users', $row->id);
$this->cleanTable('phocacart_order_product_discounts',
$row->id);
$this->cleanTable('phocacart_order_discounts', $row->id);
$this->cleanTable('phocacart_order_coupons', $row->id);
$msg =
JText::_('COM_PHOCACART_ORDER_NOT_EXECUTED_PRODUCT_NOT_ACCESSIBLE_OR_REQUIRED_ATTRIBUTE_OPTION_NOT_SELECTED');
$app->enqueueMessage($msg, 'error');
return false;
}
}
}
// DISCOUNTS
$this->cleanTable('phocacart_order_discounts',
$row->id);
if ($total[2]['dnetto'] > 0) {
$this->saveOrderDiscounts(JText::_('COM_PHOCACART_PRODUCT_DISCOUNT'),
$total[2], $row->id);
}
if ($total[3]['dnetto'] > 0) {
$this->saveOrderDiscounts(JText::_('COM_PHOCACART_CART_DISCOUNT'),
$total[3], $row->id);
}
// COUPONS
if (!empty($coupon)) {
$this->cleanTable('phocacart_order_coupons',
$row->id);
$this->saveOrderCoupons($coupon, $total[4],
$row->id);
PhocacartCoupon::storeCouponCount((int)$coupon['id']);
PhocacartCoupon::storeCouponCountUser((int)$coupon['id'],
$d['user_id']);
}
// REWARD
$this->cleanTable('phocacart_reward_points',
$row->id);
// REWARD DISCOUNT - user used the points to buy items
if ($user->id > 0 &&
isset($total[0]['rewardproductusedtotal']) &&
(int)$total[0]['rewardproductusedtotal'] > 0) {
$rewardProductTotal =
-(int)$total[0]['rewardproductusedtotal'];
$this->saveRewardPoints($user->id,
$rewardProductTotal, $orderBillingData, 0, -1);
}
// REWARD POINTS + user get the points when buying items
if ($user->id > 0 &&
isset($total[0]['points_received']) &&
(int)$total[0]['points_received'] > 0) {
$this->saveRewardPoints($user->id,
(int)$total[0]['points_received'], $orderBillingData, 0, 1);
}
// HISTORY AND ORDER STATUS
$this->cleanTable('phocacart_order_history',
$row->id);
$notify = 0;
$status =
PhocacartOrderStatus::getStatus($d['status_id']);
if (isset($status['email_customer'])) {
$notify = $status['email_customer'];
}
// If vendor makes and order in POS e.g. then store his/her as
the one who made the change
$userReal = JFactory::getUser();
$this->saveOrderHistory($d['status_id'], $notify,
$userReal->id, $row->id);
// BE AWARE***********
// $d is newly defined so use d2
// *******************
// TOTAL
if (!empty($total[0])) {
$this->cleanTable('phocacart_order_total',
$row->id);
$ordering = 1;
$d2 = array();
$d2['order_id'] = $row->id;
$d2['amount_currency'] = 0;
$d2['title_lang'] = '';
$d2['title_lang_suffix'] = '';
$d2['title_lang_suffix2'] = '';
if (isset($total[1]['netto'])) {
$d2['title'] =
JText::_('COM_PHOCACART_SUBTOTAL');
$d2['title_lang'] =
'COM_PHOCACART_SUBTOTAL';
$d2['title_lang_suffix'] = '';
$d2['title_lang_suffix2'] = '';
$d2['type'] =
'netto';
$d2['amount'] =
$total[1]['netto'];
$d2['ordering'] = $ordering;
$d2['published'] = 1;
$d2['item_id'] =
$d2['item_id_c'] = $d2['item_id_r'] = 0;
$this->saveOrderTotal($d2);
$ordering++;
}
// Reward Discount
if (isset($total[5]['dnetto'])) {
$d2['title'] =
JText::_('COM_PHOCACART_REWARD_DISCOUNT') .
$total[5]['rewardproducttxtsuffix'];
$d2['title_lang'] =
'COM_PHOCACART_REWARD_DISCOUNT';
$d2['title_lang_suffix'] = '';
$d2['title_lang_suffix2'] =
$total[5]['rewardproducttxtsuffix'];
$d2['type'] =
'dnetto';
$d2['amount'] = '-' .
$total[5]['dnetto'];
$d2['ordering'] = $ordering;
$d2['published'] = 1;
$d2['item_id'] =
$d2['item_id_c'] = $d2['item_id_r'] = 0;
$this->saveOrderTotal($d2);
$ordering++;
}
if (isset($total[5]['dbrutto'])) {
$d2['title'] =
JText::_('COM_PHOCACART_REWARD_DISCOUNT') .
$total[5]['rewardproducttxtsuffix'];
$d2['title_lang'] =
'COM_PHOCACART_REWARD_DISCOUNT';
$d2['title_lang_suffix'] = '';
$d2['title_lang_suffix2'] =
$total[5]['rewardproducttxtsuffix'];
$d2['type'] =
'dbrutto';
$d2['amount'] = '-' .
$total[5]['dbrutto'];
$d2['ordering'] = $ordering;
$d2['published'] = 0;
$d2['item_id'] =
$d2['item_id_c'] = $d2['item_id_r'] = 0;
$this->saveOrderTotal($d2);
$ordering++;
}
// Product Discount
if (isset($total[2]['dnetto'])) {
$d2['title'] =
JText::_('COM_PHOCACART_PRODUCT_DISCOUNT');
$d2['title_lang'] =
'COM_PHOCACART_PRODUCT_DISCOUNT';
$d2['title_lang_suffix'] = '';
$d2['title_lang_suffix2'] = '';
$d2['type'] =
'dnetto';
$d2['amount'] = '-' .
$total[2]['dnetto'];
$d2['ordering'] = $ordering;
$d2['published'] = 1;
$d2['item_id'] =
$d2['item_id_c'] = $d2['item_id_r'] = 0;
$this->saveOrderTotal($d2);
$ordering++;
}
if (isset($total[2]['dbrutto'])) {
$d2['title'] =
JText::_('COM_PHOCACART_PRODUCT_DISCOUNT');
$d2['title_lang'] =
'COM_PHOCACART_PRODUCT_DISCOUNT';
$d2['title_lang_suffix'] = '';
$d2['title_lang_suffix2'] = '';
$d2['type'] =
'dbrutto';
$d2['amount'] = '-' .
$total[2]['dbrutto'];
$d2['ordering'] = $ordering;
$d2['published'] = 0;
$d2['item_id'] =
$d2['item_id_c'] = $d2['item_id_r'] = 0;
$this->saveOrderTotal($d2);
$ordering++;
}
/*if (!empty($total[2]['tax'])) {
foreach($total[2]['tax'] as $k => $v) {
if ($v['tax'] > 0) {
$d2['title'] = $v['title'];
$d2['type'] = 'dtax';
$d2['amount'] = $v['tax'];
$d2['ordering'] = $ordering;
$this->saveOrderTotal($d2);
$ordering++;
}
}
}*/
// Cart Discount
if (isset($total[3]['dnetto'])) {
$d2['title'] =
JText::_('COM_PHOCACART_CART_DISCOUNT') .
$total[3]['discountcarttxtsuffix'];
$d2['title_lang'] =
'COM_PHOCACART_CART_DISCOUNT';
$d2['title_lang_suffix'] = '';
$d2['title_lang_suffix2'] =
$total[3]['discountcarttxtsuffix'];
$d2['type'] =
'dnetto';
$d2['amount'] = '-' .
$total[3]['dnetto'];
$d2['ordering'] = $ordering;
$d2['published'] = 1;
$d2['item_id'] =
$d2['item_id_c'] = $d2['item_id_r'] = 0;
$this->saveOrderTotal($d2);
$ordering++;
}
if (isset($total[3]['dbrutto'])) {
$d2['title'] =
JText::_('COM_PHOCACART_CART_DISCOUNT') .
$total[3]['discountcarttxtsuffix'];
$d2['title_lang'] =
'COM_PHOCACART_CART_DISCOUNT';
$d2['title_lang_suffix'] = '';
$d2['title_lang_suffix2'] =
$total[3]['discountcarttxtsuffix'];
$d2['type'] =
'dbrutto';
$d2['amount'] = '-' .
$total[3]['dbrutto'];
$d2['ordering'] = $ordering;
$d2['published'] = 0;
$d2['item_id'] =
$d2['item_id_c'] = $d2['item_id_r'] = 0;
$this->saveOrderTotal($d2);
$ordering++;
}
/*if (!empty($total[3]['tax'])) {
foreach($total[3]['tax'] as $k => $v) {
if ($v['tax'] > 0) {
$d2['title'] = $v['title'];
$d2['type'] = 'dtax';
$d2['amount'] = $v['tax'];
$d2['ordering'] = $ordering;
$this->saveOrderTotal($d2);
$ordering++;
}
}
}*/
// Coupon Discount
if (isset($total[4]['dnetto'])) {
$d2['title'] =
JText::_('COM_PHOCACART_COUPON');
$d2['title_lang'] =
'COM_PHOCACART_COUPON';
$d2['title_lang_suffix'] = '';
$d2['title_lang_suffix2'] = '';
if (isset($coupon['title']) &&
$coupon['title'] != '') {
$d2['title'] =
$coupon['title'] . $total[4]['couponcarttxtsuffix'];
$d2['title_lang'] =
$coupon['title'];
$d2['title_lang_suffix'] = '';
$d2['title_lang_suffix2'] =
$total[4]['couponcarttxtsuffix'];
}
$d2['type'] = 'dnetto';
$d2['amount'] = '-' .
$total[4]['dnetto'];
$d2['ordering'] = $ordering;
$d2['published'] = 1;
$d2['item_id'] = $d2['item_id_c']
= $d2['item_id_r'] = 0;
$this->saveOrderTotal($d2);
$ordering++;
}
if (isset($total[4]['dbrutto'])) {
$d2['title'] =
JText::_('COM_PHOCACART_COUPON');
$d2['title_lang'] =
'COM_PHOCACART_COUPON';
$d2['title_lang_suffix'] = '';
$d2['title_lang_suffix2'] = '';
if (isset($coupon['title']) &&
$coupon['title'] != '') {
$d2['title'] =
$coupon['title'] . $total[4]['couponcarttxtsuffix'];
$d2['title_lang'] =
$coupon['title'];
$d2['title_lang_suffix2'] =
$total[4]['couponcarttxtsuffix'];
}
$d2['type'] = 'dbrutto';
$d2['amount'] = '-' .
$total[4]['dbrutto'];
$d2['ordering'] = $ordering;
$d2['published'] = 0;
$d2['item_id'] = $d2['item_id_c']
= $d2['item_id_r'] = 0;
$this->saveOrderTotal($d2);
$ordering++;
}
/*if (!empty($total[4]['tax'])) {
foreach($total[4]['tax'] as $k => $v) {
if ($v['tax'] > 0) {
$d2['title'] = $v['title'];
$d2['type'] = 'dtax';
$d2['amount'] = $v['tax'];
$d2['ordering'] = $ordering;
$this->saveOrderTotal($d2);
$ordering++;
}
}
}*/
if (!empty($total[0]['tax'])) {
foreach ($total[0]['tax'] as $k => $v) {
if ($v['tax'] > 0) {
$d2['title'] =
$v['title'];
$d2['title_lang'] =
$v['title'];
$d2['title_lang_suffix'] =
'';
$d2['title_lang_suffix2'] =
'';
$d2['type'] =
'tax';
$d2['amount'] =
$v['tax'];
$d2['ordering'] =
$ordering;
$d2['published'] = 1;
//$d2['item_id'] = (int)$k;//
ID (Type) of VAT (10% or 20%)
$taxKeyA =
PhocacartTax::getTaxIdsFromKey($k);
$d2['item_id'] =
(int)$taxKeyA['id'];
$d2['item_id_c'] =
(int)$taxKeyA['countryid'];
$d2['item_id_r'] =
(int)$taxKeyA['regionid'];
$this->saveOrderTotal($d2);
$ordering++;
}
}
}
$d2['published'] = 1;
// Shipping
if (!empty($shippingC)) {
if (isset($shippingC['nettotxt']) &&
isset($shippingC['netto'])) {
$d2['title'] =
$shippingC['title'] . ' - ' .
$shippingC['nettotxt'];
$d2['title_lang'] =
$shippingC['title'];
$d2['title_lang_suffix'] =
$shippingC['netto_title_lang'];
$d2['title_lang_suffix2'] = '';
$d2['type'] =
'snetto';
$d2['amount'] =
$shippingC['netto'];
$d2['ordering'] = $ordering;
$d2['item_id'] =
$d2['item_id_c'] = $d2['item_id_r'] = 0;
$this->saveOrderTotal($d2);
$ordering++;
}
if (isset($shippingC['taxtxt']) &&
isset($shippingC['tax']) && $shippingC['tax']
> 0) {
$d2['title'] =
$shippingC['title'] . ' - ' .
$shippingC['taxtxt'];
$d2['title_lang'] =
isset($shippingC['title']) &&
$shippingC['title'] != '' ?
$shippingC['title'] : $shippingC['tax_title_lang'];
$d2['title_lang_suffix'] =
$shippingC['tax_title_suffix'];
$d2['title_lang_suffix2'] = '('
. $shippingC['tax_title_suffix2'] . ')';
$d2['type'] =
'stax';
//$d2['item_id'] =
(int)$shippingC['taxid'];
$taxKeyA =
PhocacartTax::getTaxIdsFromKey($shippingC['taxkey']);
$d2['item_id'] =
(int)$taxKeyA['id'];
$d2['item_id_c'] =
(int)$taxKeyA['countryid'];
$d2['item_id_r'] =
(int)$taxKeyA['regionid'];
$d2['amount'] =
$shippingC['tax'];
$d2['ordering'] = $ordering;
$this->saveOrderTotal($d2);
$ordering++;
}
if (isset($shippingC['bruttotxt']) &&
isset($shippingC['brutto'])) {
$d2['title'] =
$shippingC['title'] . ' - ' .
$shippingC['bruttotxt'];
$d2['title_lang'] =
$shippingC['title'];
$d2['title_lang_suffix'] =
$shippingC['brutto_title_lang'];
$d2['title_lang_suffix2'] = '';
$d2['type'] =
'sbrutto';
$d2['amount'] =
$shippingC['brutto'];
$d2['ordering'] = $ordering;
$d2['item_id'] =
$d2['item_id_c'] = $d2['item_id_r'] = 0;
$this->saveOrderTotal($d2);
$ordering++;
}
}
// Payment
if (!empty($paymentC)) {
if (isset($paymentC['nettotxt']) &&
isset($paymentC['netto'])) {
$d2['title'] =
$paymentC['title'] . ' - ' .
$paymentC['nettotxt'];
$d2['title_lang'] =
$paymentC['title'];
$d2['title_lang_suffix'] =
$paymentC['netto_title_lang'];
$d2['title_lang_suffix2'] = '';
$d2['type'] =
'pnetto';
$d2['amount'] =
$paymentC['netto'];
$d2['ordering'] = $ordering;
$d2['item_id'] =
$d2['item_id_c'] = $d2['item_id_r'] = 0;
$this->saveOrderTotal($d2);
$ordering++;
}
if (isset($paymentC['taxtxt']) &&
isset($paymentC['tax']) && $paymentC['tax']) {
$d2['title'] =
$paymentC['title'] . ' - ' .
$paymentC['taxtxt'];
$d2['title_lang'] =
isset($paymentC['title']) && $paymentC['title']
!= '' ? $paymentC['title'] :
$paymentC['tax_title_lang'];
$d2['title_lang_suffix'] =
$paymentC['tax_title_suffix'];
$d2['title_lang_suffix2'] = '('
. $paymentC['tax_title_suffix2'] . ')';
$d2['type'] =
'ptax';
//$d2['item_id'] =
(int)$paymentC['taxid'];
$taxKeyA =
PhocacartTax::getTaxIdsFromKey($paymentC['taxkey']);
$d2['item_id'] =
(int)$taxKeyA['id'];
$d2['item_id_c'] =
(int)$taxKeyA['countryid'];
$d2['item_id_r'] =
(int)$taxKeyA['regionid'];
$d2['amount'] =
$paymentC['tax'];
$d2['ordering'] = $ordering;
$this->saveOrderTotal($d2);
$ordering++;
}
if (isset($paymentC['bruttotxt']) &&
isset($paymentC['brutto'])) {
$d2['title'] =
$paymentC['title'] . ' - ' .
$paymentC['bruttotxt'];
$d2['title_lang'] =
$paymentC['title'];
$d2['title_lang_suffix'] =
$paymentC['brutto_title_lang'];
$d2['title_lang_suffix2'] = '';
$d2['type'] =
'pbrutto';
$d2['amount'] =
$paymentC['brutto'];
$d2['ordering'] = $ordering;
$d2['item_id'] =
$d2['item_id_c'] = $d2['item_id_r'] = 0;
$this->saveOrderTotal($d2);
$ordering++;
}
}
// Rounding
if (isset($total[0]['rounding'])) {
$d2['title'] =
JText::_('COM_PHOCACART_ROUNDING');
$d2['title_lang'] =
'COM_PHOCACART_ROUNDING';
$d2['title_lang_suffix'] = '';
$d2['title_lang_suffix2'] = '';
$d2['type'] =
'rounding';
$d2['amount'] =
$total[0]['rounding'];
$d2['amount_currency'] =
$total[0]['rounding_currency'];
$d2['ordering'] = $ordering;
$d2['item_id'] =
$d2['item_id_c'] = $d2['item_id_r'] = 0;
$this->saveOrderTotal($d2);
$ordering++;
}
// Brutto
if (isset($total[0]['brutto'])) {
$d2['title'] =
JText::_('COM_PHOCACART_TOTAL');
$d2['title_lang'] =
'COM_PHOCACART_TOTAL';
$d2['title_lang_suffix'] = '';
$d2['title_lang_suffix2'] = '';
$d2['type'] =
'brutto';
$d2['amount'] =
$total[0]['brutto'];
$d2['amount_currency'] =
$total[0]['brutto_currency'];
$d2['ordering'] = $ordering;
$d2['item_id'] =
$d2['item_id_c'] = $d2['item_id_r'] = 0;
$this->saveOrderTotal($d2);
$ordering++;
}
// TAX RECAPITULATION
if (isset($total[0]['taxrecapitulation'])) {
$this->cleanTable('phocacart_order_tax_recapitulation',
$row->id);
$orderingTC = 1;
$d3 = array();
$d3['order_id'] = $row->id;
if
(!empty($total[0]['taxrecapitulation']['items'])) {
foreach
($total[0]['taxrecapitulation']['items'] as $kTc =>
$vTc) {
//$d3['item_id'] = (int)$kTc;
$taxKeyA =
PhocacartTax::getTaxIdsFromKey($kTc);
$d3['item_id'] =
(int)$taxKeyA['id'];
$d3['item_id_c'] =
(int)$taxKeyA['countryid'];
$d3['item_id_r'] =
(int)$taxKeyA['regionid'];
$d3['title'] =
$vTc['title'];
$d3['title_lang'] =
$vTc['title_lang'];
$d3['title_lang_suffix'] =
'';
$d3['title_lang_suffix2'] =
$vTc['title_lang_suffix2'];
$d3['type'] =
'tax';
$d3['amount_netto'] =
$vTc['netto'];
$d3['amount_tax'] =
$vTc['tax'];
$d3['amount_brutto'] =
$vTc['brutto'];
$d3['amount_brutto_currency'] =
$vTc['brutto_currency'];
$d3['ordering'] =
$orderingTC;
$this->saveOrderTaxRecapitulation($d3);
$orderingTC++;
}
}
// Clean d3 for next rows
$d3['item_id'] = 0;
$d3['item_id_c'] = 0;
$d3['item_id_r'] = 0;
$d3['amount_netto'] = 0;
$d3['amount_tax'] = 0;
$d3['amount_brutto'] = 0;
$d3['amount_brutto_currency'] = 0;
$d3['title'] =
JText::_('COM_PHOCACART_ROUNDING');
$d3['title_lang'] =
'COM_PHOCACART_ROUNDING';
$d3['title_lang_suffix'] = '';
$d3['title_lang_suffix2'] = '';
$d3['type'] =
'rounding';// Complete Rounding
$d3['amount_brutto'] =
$total[0]['rounding'];
$d3['amount_brutto_currency'] =
$total[0]['rounding_currency'];
$d3['ordering'] = $orderingTC;
$this->saveOrderTaxRecapitulation($d3);
$orderingTC++;
$d3['title'] =
JText::_('COM_PHOCACART_ROUNDING') . ' (' .
JText::_('COM_PHOCACART_INCL_TAX_RECAPITULATION_ROUNDING') .
')';
$d3['title_lang'] =
'COM_PHOCACART_ROUNDING';
$d3['title_lang_suffix'] =
'COM_PHOCACART_INCL_TAX_RECAPITULATION_ROUNDING';
$d3['title_lang_suffix2'] = '';
$d3['type'] =
'trcrounding';// Only Tax Recapitulation Rounding - tax
recapitulation rounding is a part of whole rounding
$d3['amount_brutto'] =
$total[0]['taxrecapitulation']['rounding'];
$d3['amount_brutto_currency'] =
$total[0]['taxrecapitulation']['rounding_currency'];
$d3['ordering'] = $orderingTC;
$this->saveOrderTaxRecapitulation($d3);
$orderingTC++;
$d3['title'] =
JText::_('COM_PHOCACART_TOTAL');
$d3['title_lang'] =
'COM_PHOCACART_TOTAL';
$d3['title_lang_suffix'] = '';
$d3['title_lang_suffix2'] = '';
$d3['type'] =
'brutto';
$d3['amount_netto'] =
$total[0]['taxrecapitulation']['netto_incl_sp'];
$d3['amount_tax'] =
$total[0]['taxrecapitulation']['tax'];
//$d3['amount_brutto'] =
$total[0]['taxrecapitulation']['brutto'];
$d3['amount_brutto'] =
$total[0]['taxrecapitulation']['brutto_incl_rounding'];
//$d3['amount_brutto_currency'] =
$total[0]['taxrecapitulation']['brutto_currency'];
$d3['amount_brutto_currency'] =
$total[0]['taxrecapitulation']['brutto_currency_incl_rounding'];
$d3['ordering'] = $orderingTC;
$this->saveOrderTaxRecapitulation($d3);
$orderingTC++;
}
}
// EVENT Shipping
if ((int)$shippingId > 0 &&
isset($shippingC['method']) &&
$shippingC['method'] != '') {
JPluginHelper::importPlugin('pcs',
htmlspecialchars(strip_tags($shippingC['method'])));
$eventData = array();
$eventData['pluginname'] =
htmlspecialchars(strip_tags($shippingC['method']));
$eventData['id'] = (int)$row->id;
Factory::getApplication()->triggerEvent('PCSafterSaveOrder',
array('com_phocacart.library.order', $eventData));
}
// CHANGE STATUS
// STOCK MOVEMENT (including a) Main Product, b) Product
Variations method)
// Change Status is not setting the status, it is about do
getting info about status for sending emails, checking stock,
if ($guest) {
// Don't check the user (status.php, render.php)
PhocacartOrderStatus::changeStatus($row->id,
$d['status_id'], $d['order_token']);// Notify user,
notify others, emails send - will be decided in function
} else {
PhocacartOrderStatus::changeStatus($row->id,
$d['status_id']);// Notify user, notify others, emails send -
will be decided in function
}
// Proceed or not proceed to payment gateway - depends on
payment method
// By every new order - clean the proceed payment session
$session = JFactory::getSession();
$session->set('proceedpayment', array(),
'phocaCart');
$response =
PhocacartPayment::proceedToPaymentGateway($payment);
$proceed = $response['proceed'];
$this->message_after_order = $response['message'];
if ($proceed) {
$proceedPayment['orderid'] = $row->id;
$session->set('proceedpayment',
$proceedPayment, 'phocaCart');
if ($this->downloadable_product == 1) {
$this->action_after_order = 4; // PAYMENT/DOWNLOAD
} else {
$this->action_after_order = 3;// PAYMENT/NO DOWNLOAD
}
} else {
if ($this->downloadable_product == 1) {
$this->action_after_order = 2; // ORDER/DOWNLOAD
} else {
$this->action_after_order = 1;// ORDER/NO DOWNLOAD
}
}
$this->data_after_order['order_id'] =
(int)$row->id;
$this->data_after_order['order_token'] =
$row->order_token;
$this->data_after_order['user_id'] =
(int)$row->user_id;
$this->data_after_order['shipping_id'] =
(int)$row->shipping_id;
$this->data_after_order['payment_id'] =
(int)$row->payment_id;
$this->data_after_order['shipping_method'] =
'';
$shippingMethod = json_decode($row->params_shipping);
if (isset($shippingMethod->method)) {
$this->data_after_order['shipping_method'] =
$shippingMethod->method;
}
$this->data_after_order['payment_method'] =
'';
$paymentMethod = json_decode($row->params_payment);
if (isset($paymentMethod->method)) {
$this->data_after_order['payment_method'] =
$paymentMethod->method;
}
//return true;
if ($order_language == 0) {
$pLang->setLanguageBack($defaultLang);
}
// UPDATE NEWSLETTER INFO
if ((int)$d['newsletter'] > 0 &&
(int)$user->id > 0) {
$name = '';
$email = '';
$privacy = (int)$d['privacy'] == 1 ? 1 : 0;
if (isset($user->name)) {
$name = $user->name;
// Guest Users (find some name in billing or shipping
address)
} else if (isset($address[0]->name_first) &&
isset($address[0]->name_last)) {
$name = $address[0]->name_first . ' ' .
$address[0]->name_last;
} else if (isset($address[1]->name_first) &&
isset($address[1]->name_last)) {
$name = $address[1]->name_first . ' ' .
$address[1]->name_last;
} else if (isset($address[0]->name_last)) {
$name = $address[0]->name_last;
} else if (isset($address[1]->name_last)) {
$name = $address[1]->name_last;
} else if (isset($address[0]->name_first)) {
$name = $address[0]->name_first;
} else if (isset($address[1]->name_first)) {
$name = $address[1]->name_first;
} else if (isset($address[0]->name)) {
$name = $address[0]->name;
} else if (isset($address[1]->name)) {
$name = $address[1]->name;
}
if (isset($user->email)) {
$email = $user->email;
// Guest Users
} else if (isset($address[0]->email)) {
$email = $address[0]->email;
} else if (isset($address[1]->email)) {
$email = $address[1]->email;
}
PhocacartNewsletter::updateNewsletterInfoByUser((int)$user->id, 1);//
Internal Phoca Cart Table
if ($name != '' && $email !=
'') {
PhocacartNewsletter::storeSubscriber($name, $email,
$privacy);// External Phoca Email Table
}
}
return $row->id;
} else {
return false;
}
return false;
}
public function saveOrderBilling($id, $date, $statusId) {
// Delivery note has the same number like order
// Receipt is not used when displaying in frontend
return self::storeOrderReceiptInvoiceId($id, $date, $statusId,
array('O', 'I', 'R'));
}
public function saveOrderUsers($d, $orderId) {
$app = JFactory::getApplication();
$db = JFactory::getDbo();
$d = (array)$d;
if (!isset($d['id'])) {
$d['id'] = 0;// Guest Checkout
$d['user_id'] = 0;
}
$d['order_id'] = (int)$orderId;
$d['user_address_id'] = (int)$d['id'];
$d['user_token'] = PhocacartUtils::getToken();
$userGroups =
PhocacartGroup::getGroupsById((int)$d['user_id'], 1, 1);
$d['user_groups'] = serialize($userGroups);
unset($d['id']);// we do new autoincrement
$row = JTable::getInstance('PhocacartOrderUsers',
'Table', array());
if (!$row->bind($d)) {
//throw new Exception($db->getErrorMsg());
$msg = JText::_($db->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->check()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->store()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
return true;
}
public function saveOrderProducts($d, $orderId) {
$app = JFactory::getApplication();
$db = JFactory::getDbo();
$row = JTable::getInstance('PhocacartOrderProducts',
'Table', array());
$checkP =
PhocacartProduct::checkIfAccessPossible($d['id'],
$d['catid'], $this->type);
if (!$checkP) {
$app->enqueueMessage(JText::_('COM_PHOCACART_PRODUCT_NOT_ACCESSIBLE').
' - ' . JText::_('COM_PHOCACART_PRODUCT') . ':
' . $d['title'], 'error');
return false;
}
// Possible feature - remove this additional check based on mostly
design parameters
// 1) canDisplayAddtocartAdvanced - Product on demand product
cannot be ordered
// canDisplayAddtocart (is a part of 1) - Display add to cart
disabled or only for specific access level or only for specific group
(checked previously in checkIfAccessPossible)
// 2) canDisplayAddtocartPrice - Product with zero price cannot be
added to cart (can be set in options)
// 3) canDisplayAddtocartStock - Product witz zero stock cannot be
added to cart (can be set in options)
$itemP = PhocacartProduct::getProduct((int)$d['id'],
$d['catid']);
$d['attributes'] = !empty($d['attributes']) ?
$d['attributes'] : array();
if (!empty($itemP)) {
$price = new PhocacartPrice();
$priceP = $price->getPriceItems($itemP->price,
$itemP->taxid, $itemP->taxrate, $itemP->taxcalculationtype,
$itemP->taxtitle, 0, '', 1, 1, $itemP->group_price);
$aA = $d['attributes'];// Sanitanized yet
//PhocacartAttribute::sanitizeAttributeArray($d['attributes']);
$price->getPriceItemsChangedByAttributes($priceP, $aA,
$price, $itemP, 1);
$price->correctMinusPrice($priceP);
$priceA = isset($priceP['brutto']) ?
$priceP['brutto'] : 0;
// Stock (don't display add to cart when stock is zero)
$stockStatus = array();
$stock =
PhocacartStock::getStockItemsChangedByAttributes($stockStatus, $aA, $itemP,
2);
$rights = new PhocacartAccessRights();
$can_display_addtocart =
$rights->canDisplayAddtocartAdvanced($itemP);
$can_display_addtocart_price =
$rights->canDisplayAddtocartPrice($itemP, $priceA);
$can_display_addtocart_stock =
$rights->canDisplayAddtocartStock($itemP, $stock);
if (!$can_display_addtocart) {
$app->enqueueMessage(JText::_('COM_PHOCACART_PRODUCT_NOT_ACCESSIBLE').
' - ' . JText::_('COM_PHOCACART_PRODUCT') . ':
' . $d['title'], 'error');
return false;
}
if (!$can_display_addtocart_price) {
$app->enqueueMessage(JText::_('COM_PHOCACART_PRICE_IS_ZERO') .
' - ' . JText::_('COM_PHOCACART_PRODUCT') . ':
' . $d['title'], 'error');
return false;
}
if (!$can_display_addtocart_stock) {
$app->enqueueMessage(JText::_('COM_PHOCACART_STOCK_IS_EMPTY').
' - ' . JText::_('COM_PHOCACART_PRODUCT') . ':
' . $d['title'], 'error');
return false;
}
}
// Additional info
$d['default_price'] = $d['default_price'];
$d['default_tax_rate'] = $d['taxrate'];
$taxKeyA =
PhocacartTax::getTaxIdsFromKey($d['taxkey']);
$d['default_tax_id'] =
(int)$taxKeyA['id'];
$d['default_tax_id_c'] =
(int)$taxKeyA['countryid'];
$d['default_tax_id_r'] =
(int)$taxKeyA['regionid'];
$d['default_tax_calculation_rate'] =
$d['taxcalctype'];
$d['default_points_received'] =
$d['default_points_received'];
//$d['status_id'] = 1;// pending
$d['published'] = 1;
$d['order_id'] = (int)$orderId;
$d['product_id'] = (int)$d['id'];
$d['category_id'] = (int)$d['catid'];
$d['product_id_key'] = $d['idkey'];
$d['stock_calculation'] =
$d['stockcalculation'];
unset($d['id']);// we do new autoincrement
$d['tax'] = $d['tax'] /
$d['quantity'];// in database we store the items per item
//$d['dtax'] =
$d['dtax']/$d['quantity'];// in database we store the
items per item
// STOCK HANDLING
// will be set in order status
administrator\components\com_phocacart\libraries\phocacart\order\status.php
//$stock =
PhocacartStock::handleStockProduct($d['product_id'],
$d['status_id'], $d['quantity'] );
if (!$row->bind($d)) {
//throw new Exception($db->getErrorMsg());
$msg = JText::_($db->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->check()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->store()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
//if ((int)$row->id > 0 &&
!empty($d['attributes'])) {
if ((int)$row->id > 0) {
//$this->cleanTable('phocacart_order_attributes',
$orderId); NOT HERE, we are in foreach
if (empty($d['attributes'])) {
$d['attributes'] = array();
}
$checkedA =
PhocacartAttribute::checkRequiredAttributes((int)$d['product_id'],
$d['attributes']);
if (!$checkedA) {
return false;
}
foreach ($d['attributes'] as $k => $v) {
if (!empty($v)) {
foreach ($v as $k2 => $v2) {
$row2 =
JTable::getInstance('PhocacartOrderAttributes',
'Table', array());
$d2 = array();
$d2['order_id'] = (int)$orderId;
$d2['product_id'] =
(int)$d['product_id'];
$d2['order_product_id'] =
(int)$row->id;
$d2['attribute_id'] =
(int)$v2['aid'];
$d2['option_id'] =
(int)$v2['oid'];
$d2['attribute_title'] =
$v2['atitle'];
$d2['type'] =
$v2['atype'];
$d2['option_title'] =
$v2['otitle'];
$d2['option_value'] =
$v2['ovalue'];
// $d2['option_download_file'] =
$v2['odownloadfile'];
// Will be set order status
//
administrator\components\com_phocacart\libraries\phocacart\order\status.php
// $stockA =
PhocacartStock::handleStockAttributeOption($d2['option_id'],
$d['status_id'], $d['quantity'] );
if (!$row2->bind($d2)) {
//throw new Exception($db->getErrorMsg());
$msg = JText::_($db->getErrorMsg());
$app->enqueueMessage($msg,
'error');
return false;
}
if (!$row2->check()) {
//throw new Exception($row2->getError());
$msg = JText::_($row2->getErrorMsg());
$app->enqueueMessage($msg,
'error');
return false;
}
if (!$row2->store()) {
//throw new Exception($row2->getError());
$msg = JText::_($row2->getErrorMsg());
$app->enqueueMessage($msg,
'error');
return false;
}
}
}
}
}
/*} else if ((int)$row->id > 0){
// Empty attributes - check if product include some required
attribute
$checkA = PhocacartAttribute::checkIfExists
AndRequired($d['product_id']);
if (!$checkedA) {
return false;
}
}*/
return $row->id;
}
public function saveOrderCoupons($coupon, $totalC, $orderId) {
$app = JFactory::getApplication();
$db = JFactory::getDbo();
$d = array();
$d['order_id'] = (int)$orderId;
$d['coupon_id'] = (int)$coupon['id'];
$d['title'] = $coupon['title'];
if (isset($coupon['code'])) {
$d['code'] = $coupon['code'];
}
$d['amount'] = $totalC['dnetto'];// get the
value from total
$d['netto'] = $totalC['dnetto'];
$d['brutto'] = $totalC['dbrutto'];
$row = JTable::getInstance('PhocacartOrderCoupons',
'Table', array());
if (!$row->bind($d)) {
//throw new Exception($db->getErrorMsg());
$msg = JText::_($db->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->check()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->store()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
return true;
}
public function saveOrderDiscounts($discountTitle, $totalD, $orderId,
$type = 0) {
$app = JFactory::getApplication();
$db = JFactory::getDbo();
$d = array();
$d['order_id'] = (int)$orderId;
//$d['discount_id'] = (int)$discount['id'];
$d['title'] = $discountTitle;
$d['amount'] = $totalD['dnetto'];// get the
value from total
$d['netto'] = $totalD['dnetto'];
$d['brutto'] = $totalD['dbrutto'];
$row =
JTable::getInstance('PhocacartOrderDiscounts', 'Table',
array());
if (!$row->bind($d)) {
//throw new Exception($db->getErrorMsg());
$msg = JText::_($db->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->check()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->store()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
return true;
}
public function saveOrderTotal($d) {
$app = JFactory::getApplication();
$db = JFactory::getDbo();
$row = JTable::getInstance('PhocacartOrderTotal',
'Table', array());
//$d['published'] = 1;
if (!$row->bind($d)) {
//throw new Exception($db->getErrorMsg());
$msg = JText::_($db->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->check()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->store()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
return true;
}
public function saveOrderTaxRecapitulation($d) {
$app = JFactory::getApplication();
$db = JFactory::getDbo();
$row =
JTable::getInstance('PhocacartOrderTaxRecapitulation',
'Table', array());
//$d['published'] = 1;
if (!$row->bind($d)) {
//throw new Exception($db->getErrorMsg());
$msg = JText::_($db->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->check()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->store()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
return true;
}
public function saveOrderHistory($statusId, $notify, $userId, $orderId)
{
$app = JFactory::getApplication();
$db = JFactory::getDbo();
$row = JTable::getInstance('PhocacartOrderHistory',
'Table', array());
$d = array();
$d['order_status_id'] = (int)$statusId;
$d['notify'] = (int)$notify;
$d['user_id'] = (int)$userId;
$d['order_id'] = (int)$orderId;
$d['date'] = gmdate('Y-m-d H:i:s');;
if (!$row->bind($d)) {
//throw new Exception($db->getErrorMsg());
$msg = JText::_($db->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->check()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->store()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
return true;
}
public function saveOrderDownloads($orderProductId, $productId, $catId,
$orderId) {
$app = JFactory::getApplication();
$db = JFactory::getDbo();
$pC =
PhocacartUtils::getComponentParameters();
$download_product_attribute_options =
$pC->get('download_product_attribute_options', 0);
$isDownloadableProduct = 0;
$forceOnlyDownloadFileAttribute = 0;
$row = JTable::getInstance('PhocacartOrderDownloads',
'Table', array());
//$productItem = new PhocacartProduct();
$product = PhocacartProduct::getProduct((int)$productId,
(int)$catId, $this->type);
// Additional download files
$additionalDownloadFiles =
PhocacartFileAdditional::getProductFilesByProductId((int)$productId, 1);
// Attribute Option Download Files
$attributeDownloadFiles =
PhocacartAttribute::getAttributeOptionDownloadFilesByOrder($orderId,
$productId, $orderProductId);
// 1) download_file for ordered product
// 2) download_file for ordered attribute option of each product
$d = array();
$d['order_id'] = (int)$orderId;
$d['product_id'] = (int)$productId;
$d['order_product_id'] = (int)$orderProductId;
$d['title'] = $product->title;
$d['download_hits'] = 0;
$d['download_days'] = $product->download_days;
$d['published'] = 0;
$d['date'] = gmdate('Y-m-d H:i:s');
$d['ordering'] = 0;
// If Product includes attribute option download file, this means
there can be two different products:
// a) produt without any attribute selected
// b) product with attribute selected
// So if set in options and there is a download file for attribute
option - the main product download file will be skipped
if ($download_product_attribute_options == 1 &&
!empty($attributeDownloadFiles)) {
foreach ($attributeDownloadFiles as $k => $v) {
if (isset($v['download_file']) &&
$v['download_file'] != ''
&& isset($v['download_folder'])
&& $v['download_folder'] != ''
&& isset($v['download_token'])
&& isset($v['attribute_id'])
&& $v['attribute_id'] > 0
&& isset($v['option_id']) &&
$v['option_id'] > 0
&& isset($v['order_option_id'])
&& $v['order_option_id'] > 0) {
// !!! Both conditions are OK
// 1) we don't want provide a download file for
main product in case that the product including attribute option is ordered
(PARAMETER SET)
// 2) and yes there is selected attribute option
including download file ordered (CUSTOMER ORDERED PRODUCT WITH ATTRIBUTE
OPTION)
$forceOnlyDownloadFileAttribute = 1;
}
}
}
// 1)
if ($forceOnlyDownloadFileAttribute == 0 &&
isset($product->download_file) && $product->download_file !=
'') {
$d['download_token'] = $product->download_token;
$d['download_folder'] = $product->download_folder;
$d['download_file'] = $product->download_file;
$d['type'] = 1;
$db = JFactory::getDbo();
//$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_order_downloads WHERE catid = '.(int)$orderId);
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_order_downloads');
$max = $db->loadResult();
$d['ordering'] = $max + 1;
if (!$row->bind($d)) {
//throw new Exception($db->getErrorMsg());
$msg = JText::_($db->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->check()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->store()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
$isDownloadableProduct = 1;
}
// 2)
if ($forceOnlyDownloadFileAttribute == 0 &&
!empty($additionalDownloadFiles)) {
$d['ordering'] = $d['ordering'] + 1;
$d['download_token'] = '';
$d['download_folder'] = $product->download_folder;
$d['download_file'] = '';
$d['download_days'] = -1;
$d['type'] = 2;
foreach ($additionalDownloadFiles as $k => $v) {
if (isset($v['download_file']) &&
$v['download_file'] != ''
&& isset($d['download_folder'])
&& $d['download_folder'] != ''
&& isset($v['download_token'])
&& isset($v['download_days'])) {
$d['download_token'] =
$v['download_token'];
$d['download_file'] =
$v['download_file'];
$d['download_days'] =
$v['download_days'];
$d['title'] = $product->title;
$row =
JTable::getInstance('PhocacartOrderDownloads', 'Table',
array());
if (!$row->bind($d)) {
//throw new Exception($db->getErrorMsg());
$msg = JText::_($db->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->check()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->store()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
$isDownloadableProduct = 1;
$d['ordering'] =
$d['ordering'] + 1;
}
}
}
// 3)
if (!empty($attributeDownloadFiles)) {
$d['ordering'] = $d['ordering'] + 1;
$d['type'] = 3;
foreach ($attributeDownloadFiles as $k => $v) {
if (isset($v['download_file']) &&
$v['download_file'] != ''
&& isset($v['download_folder'])
&& $v['download_folder'] != ''
&& isset($v['download_token'])
&& isset($v['attribute_id'])
&& $v['attribute_id'] > 0
&& isset($v['option_id']) &&
$v['option_id'] > 0
&& isset($v['order_option_id'])
&& $v['order_option_id'] > 0) {
$d['download_file'] =
$v['download_file'];
$d['download_folder'] =
$v['download_folder'];
$d['download_token'] =
$v['download_token'];
$d['attribute_id'] =
$v['attribute_id'];
$d['option_id'] =
$v['option_id'];
$d['order_option_id'] =
$v['order_option_id'];
$d['title'] = $product->title .
' (' . $v['attribute_title'] . ': ' .
$v['option_title'] . ')';
$row =
JTable::getInstance('PhocacartOrderDownloads', 'Table',
array());
if (!$row->bind($d)) {
//throw new Exception($db->getErrorMsg());
$msg = JText::_($db->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->check()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->store()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
$isDownloadableProduct = 1;
$d['ordering'] =
$d['ordering'] + 1;
}
}
}
$this->downloadable_product = $isDownloadableProduct;
return true;
}
public function saveOrderGiftCoupons($orderProductId, $v, $orderId, $k,
$fullItems) {
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$d = array();
if (!isset($v['type'])) {
return false;
}
if ($v['type'] != 4) {
// Product type != Gift Voucher
return false;
}
if (isset($v['brutto']) && $v['brutto']
> 0) {
$d['discount'] = $v['brutto'];
} else {
return false;
}
$d['calculation_type'] = 0; // Fixed amount
$d['type'] = 0; // Coupon type (COMMON,
ONLINE SHOP, POS)
$d['coupon_type'] = 2; // Coupon type (DEFAULT
COUPON | GIFT VOUCHER)
$d['gift_type'] = -1; // Possible gift
voucher type (BIRTHDAY, PRESENT, FESTIVE ...)
$d['gift_order_id'] = (int)$orderId;
$d['gift_product_id'] = (int)$v['id'];
$d['gift_order_product_id'] = (int)$orderProductId;
$d['gift_recipient_name'] = '';
$d['gift_recipient_email'] = '';
$d['gift_sender_name'] = '';
$d['gift_sender_message'] = '';
$d['available_quantity'] = 1;
$d['published'] = 0;// will be published by
order status
$d['access'] = 1;
$d['title'] =
JText::_('COM_PHOCACART_GIFT_VOUCHER');
$d['alias'] =
PhocacartUtils::getAliasName($d['title']);
$d['code'] =
PhocacartCoupon::generateCouponCode();
$product = PhocacartProduct::getProduct((int)$v['id'],
(int)$v['catid'], $this->type);
if (!empty($v['attributes'])) {
// Attributes
foreach ($v['attributes'] as $k2 => $v2) {
if (!empty($v2)) {
// Options
foreach ($v2 as $k3 => $v3) {
// Check if attribute is type GIFT
if (!isset($v3['atype']) ||
(isset($v3['atype']) && $v3['atype'] != 20)) {
// if not continue with another attribute (not
option)
continue 2;
}
if(isset($v3['otype'])) {
switch($v3['otype']) {
case 20:
$d['gift_recipient_name'] =
urldecode($v3['ovalue']);
break;
case 21:
$d['gift_recipient_email'] =
'';
$v3['ovalue'] =
urldecode($v3['ovalue']);
if(JMailHelper::isEmailAddress($v3['ovalue'])){
$d['gift_recipient_email'] = $v3['ovalue'];
}
break;
case 22:
$d['gift_sender_name'] =
urldecode($v3['ovalue']);
break;
case 23:
$d['gift_sender_message'] =
urldecode($v3['ovalue']);
break;
case 24:
$d['gift_type'] =
urldecode($v3['ovalue']);
break;
}
}
}
}
}
}
if (!empty($product->gift_types)) {
$registry = new JRegistry;
$registry->loadString($product->gift_types);
$giftTypes = $registry->toArray();
if(isset($d['gift_type'])) {
$giftType = 'gift_types' .
(int)$d['gift_type'];
if (isset($giftTypes[$giftType])) {
$giftTypeA = $giftTypes[$giftType];
if (isset($giftTypeA['title'])) {
$d['gift_title'] =
$giftTypeA['title'];
}
if (isset($giftTypeA['description'])) {
$d['gift_description'] =
$giftTypeA['description'];
}
if (isset($giftTypeA['image'])) {
$d['gift_image'] =
$giftTypeA['image'];
}
if (isset($giftTypeA['expiration_date'])) {
$d['valid_to'] =
$giftTypeA['expiration_date'];
}
if (isset($giftTypeA['class_name'])) {
$d['gift_class_name'] =
$giftTypeA['class_name'];
}
if (isset($giftTypeA['title']) &&
$giftTypeA['title'] != '') {
$d['title'] = $d['title'] .
' - ' . $giftTypeA['title'];
}
}
}
}
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_coupons');
$max = $db->loadResult();
$d['ordering'] = $max + 1;
$row = JTable::getInstance('PhocacartCoupon',
'Table', array());
if (!$row->bind($d)) {
//throw new Exception($db->getErrorMsg());
$msg = JText::_($db->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->check()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->store()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
return true;
}
public function saveOrderProductDiscounts($orderProductId, $productId,
$orderId, $k, $fullItems) {
$db = JFactory::getDBO();
// REWARD DIVIDED INTO PRODUCTS
if (isset($fullItems[5][$k]['rewardproduct']) &&
$fullItems[5][$k]['rewardproduct'] == 1) {
//$row =
JTable::getInstance('PhocacartOrderProductDiscounts',
'Table', array());
$query = ' DELETE FROM
#__phocacart_order_product_discounts WHERE order_id = ' .
(int)$orderId . ' AND order_product_id = ' . (int)$orderProductId
. ' AND product_id = ' . (int)$productId . ' AND type =
5';
$db->setQuery($query);
$db->execute();
$amount = $fullItems[5][$k]['netto'];
$netto = $fullItems[5][$k]['netto'];
$brutto = $fullItems[5][$k]['brutto'];
$tax = $fullItems[5][$k]['tax'];
$final = $fullItems[5][$k]['final'];
$quantity = $fullItems[5][$k]['quantity'];
$catid = $fullItems[5][$k]['catid'];
$query = ' INSERT INTO
#__phocacart_order_product_discounts (order_id, product_id,
order_product_id, discount_id, product_id_key, category_id, type, title,
amount, netto, brutto, tax, final, quantity, published)'
. ' VALUES (' . (int)$orderId . ', ' .
(int)$productId . ', ' . (int)$orderProductId . ', ' .
0 . ', ' . $db->quote($k) . ', ' . (int)$catid .
', 5, ' .
$db->quote($fullItems[5][$k]['rewardproducttitle']) . ',
' . $amount . ', ' . $netto . ', ' . $brutto .
', ' . $tax . ', ' . $final . ', ' .
(int)$quantity . ', 0)';
$db->setQuery($query);
$db->execute();
}
// DISCOUNT PRODUCTS
if (isset($fullItems[2][$k]['discountproduct'])
&& $fullItems[2][$k]['discountproduct'] == 1) {
//$row =
JTable::getInstance('PhocacartOrderProductDiscounts',
'Table', array());
$query = ' DELETE FROM
#__phocacart_order_product_discounts WHERE order_id = ' .
(int)$orderId . ' AND order_product_id = ' . (int)$orderProductId
. ' AND product_id = ' . (int)$productId . ' AND type =
2';
$db->setQuery($query);
$db->execute();
$amount = $fullItems[2][$k]['netto'];
$netto = $fullItems[2][$k]['netto'];
$brutto = $fullItems[2][$k]['brutto'];
$tax = $fullItems[2][$k]['tax'];
$final = $fullItems[2][$k]['final'];
$quantity = $fullItems[2][$k]['quantity'];
$catid = $fullItems[3][$k]['catid'];
$query = ' INSERT INTO
#__phocacart_order_product_discounts (order_id, product_id,
order_product_id, product_id_key, category_id, type, title, amount, netto,
brutto, tax, final, quantity, published)'
. ' VALUES (' . (int)$orderId . ', ' .
(int)$productId . ', ' . (int)$orderProductId . ', ' .
$db->quote($k) . ', ' . (int)$catid . ', 2, ' .
$db->quote($fullItems[2][$k]['discountproducttitle']) .
', ' . $amount . ', ' . $netto . ', ' .
$brutto . ', ' . $tax . ', ' . $final . ', '
. (int)$quantity . ', 0)';
$db->setQuery($query);
$db->execute();
}
// DISCOUNT CART DIVEDED INTO PRODUCTS
if (isset($fullItems[3][$k]['discountcart']) &&
$fullItems[3][$k]['discountcart'] == 1) {
//$row =
JTable::getInstance('PhocacartOrderProductDiscounts',
'Table', array());
$query = ' DELETE FROM
#__phocacart_order_product_discounts WHERE order_id = ' .
(int)$orderId . ' AND order_product_id = ' . (int)$orderProductId
. ' AND product_id = ' . (int)$productId . ' AND type =
3';
$db->setQuery($query);
$db->execute();
$amount = $fullItems[3][$k]['netto'];
$netto = $fullItems[3][$k]['netto'];
$brutto = $fullItems[3][$k]['brutto'];
$tax = $fullItems[3][$k]['tax'];
$final = $fullItems[3][$k]['final'];
$quantity = $fullItems[3][$k]['quantity'];
$catid = $fullItems[3][$k]['catid'];
$query = ' INSERT INTO
#__phocacart_order_product_discounts (order_id, product_id,
order_product_id, discount_id, product_id_key, category_id, type, title,
amount, netto, brutto, tax, final, quantity, published)'
. ' VALUES (' . (int)$orderId . ', ' .
(int)$productId . ', ' . (int)$orderProductId . ', ' .
(int)$fullItems[3][$k]['discountcartid'] . ', ' .
$db->quote($k) . ', ' . (int)$catid . ', 3, ' .
$db->quote($fullItems[3][$k]['discountcarttitle']) . ',
' . $amount . ', ' . $netto . ', ' . $brutto .
', ' . $tax . ', ' . $final . ', ' .
(int)$quantity . ', 0)';
$db->setQuery($query);
$db->execute();
}
// COUPON DIVIDED INTO PRODUCTS
if (isset($fullItems[4][$k]['couponcart']) &&
$fullItems[4][$k]['couponcart'] == 1) {
//$row =
JTable::getInstance('PhocacartOrderProductDiscounts',
'Table', array());
$query = ' DELETE FROM
#__phocacart_order_product_discounts WHERE order_id = ' .
(int)$orderId . ' AND order_product_id = ' . (int)$orderProductId
. ' AND product_id = ' . (int)$productId . ' AND type =
4';
$db->setQuery($query);
$db->execute();
$amount = $fullItems[4][$k]['netto'];
$netto = $fullItems[4][$k]['netto'];
$brutto = $fullItems[4][$k]['brutto'];
$tax = $fullItems[4][$k]['tax'];
$final = $fullItems[4][$k]['final'];
$quantity = $fullItems[4][$k]['quantity'];
$catid = $fullItems[4][$k]['catid'];
$query = ' INSERT INTO
#__phocacart_order_product_discounts (order_id, product_id,
order_product_id, discount_id, product_id_key, category_id, type, title,
amount, netto, brutto, tax, final, quantity, published)'
. ' VALUES (' . (int)$orderId . ', ' .
(int)$productId . ', ' . (int)$orderProductId . ', ' .
(int)$fullItems[4][$k]['couponcartid'] . ', ' .
$db->quote($k) . ', ' . (int)$catid . ', 4, ' .
$db->quote($fullItems[4][$k]['couponcarttitle']) . ',
' . $amount . ', ' . $netto . ', ' . $brutto .
', ' . $tax . ', ' . $final . ', ' .
(int)$quantity . ', 0)';
$db->setQuery($query);
$db->execute();
}
return true;
}
public function saveRewardPoints($userId, $points, $orderBillingData,
$published = 0, $type = 0) {
$app = JFactory::getApplication();
$db = JFactory::getDbo();
$row = JTable::getInstance('PhocacartRewardPoint',
'Table', array());
$d = array();
$d['date'] =
$orderBillingData['date'];//gmdate('Y-m-d H:i:s');
$d['published'] = (int)$published;
$d['points'] = (int)$points;
$d['user_id'] = (int)$userId;
$d['order_id'] = (int)$orderBillingData['id'];
$d['title'] =
JText::_('COM_PHOCACART_ORDER_NUMBER') . ' ' .
self::getOrderNumber($d['order_id'], $d['date'],
$orderBillingData['order_number']) . ' (' .
$d['date'] . ')';
$d['type'] = (int)$type;
if (!$row->bind($d)) {
//throw new Exception($db->getErrorMsg());
$msg = JText::_($db->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->check()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->store()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
return true;
}
public function updateNumberOfSalesOfProduct($orderProductId,
$productId, $orderId) {
// We store the number of sales of one product directly to product
table
// because of saving SQL queries in frontend, to not run sql query
for each product
$db = JFactory::getDBO();
$query = ' SELECT SUM(quantity) FROM
#__phocacart_order_products'
. ' WHERE product_id = ' . (int)$productId
. ' LIMIT 0,1';
$db->setQuery($query);
$sum = $db->loadColumn();
if (isset($sum[0])) {
$query = ' UPDATE #__phocacart_products'
. ' SET sales = ' . (int)$sum[0]
. ' WHERE id = ' . (int)$productId;
$db->setQuery($query);
$db->execute();
}
return true;
}
public function isThereSomeDownloadableFile() {
return $this->downloadable_product;
}
public function getActionAfterOrder() {
return $this->action_after_order;
}
public function getMessageAfterOrder() {
return $this->message_after_order;
}
public function getDataAfterOrder() {
return $this->data_after_order;
}
private function cleanTable($table, $orderId) {
if ($table != '') {
$db = JFactory::getDBO();
$query = ' DELETE FROM #__' . $table . ' WHERE
order_id = ' . (int)$orderId;
$db->setQuery($query);
$db->execute();
return true;
}
return false;
}
private function deleteOrder($orderId) {
//if ($table != '') {
$db = JFactory::getDBO();
$query = ' DELETE FROM #__phocacart_orders WHERE id = ' .
(int)$orderId;
$db->setQuery($query);
$db->execute();
return true;
//}
return false;
}
/* Static part */
public static function getOrderStatus($statusId) {
$db = JFactory::getDBO();
$query = ' SELECT a.title FROM #__phocacart_order_statuses
WHERE id = ' . (int)$statusId . ' ORDER BY a.title';
$db->setQuery($query);
$status = $db->loadAssoc();
}
public static function getOrderDate($orderId) {
$db = JFactory::getDBO();
$query = ' SELECT date FROM #__phocacart_orders WHERE id =
' . (int)$orderId . ' LIMIT 1';
$db->setQuery($query);
$date = $db->loadResult();
return $date;
}
public static function getOrderBillingData($orderId) {
$db = JFactory::getDBO();
$query = ' SELECT id, date, order_number, receipt_number,
invoice_number, invoice_prn, invoice_date, invoice_due_date'
. ' FROM #__phocacart_orders WHERE id = ' .
(int)$orderId . ' LIMIT 1';
$db->setQuery($query);
$orderBillingData = $db->loadAssoc();
return $orderBillingData;
}
public static function getOrderCustomerData($orderId) {
$db = JFactory::getDBO();
$query = ' SELECT *'
. ' FROM #__phocacart_order_users WHERE order_id = '
. (int)$orderId . ' ORDER BY type ASC LIMIT 2';
$db->setQuery($query);
$data = $db->loadAssocList();
return $data;
}
/**
* @param string $type order | receipt | invoice
* @param $orderId
* @param mixed $date
* @return int|mixed
*
* Defines which numbers will be used, if set by auto increment or by
year or by month
* Example: auto increment can be 1250 but it is new year so based on
year the number will be 1 (even autoincrement will be 1251)
* Number can start each month/year at 1 because of accounting ... be
aware the numbers need to include prefixes
*/
public static function getNumberId($type = 'order', $orderId
= 0, $date = false) {
$paramsC = PhocacartUtils::getComponentParameters();
switch ($type) {
case 'invoice':
$creating_numbers =
$paramsC->get('invoice_creating_numbers', 'A');
$column = 'invoice_number_id';
break;
case 'receipt':
$creating_numbers =
$paramsC->get('receipt_creating_numbers', 'A');
$column = 'receipt_number_id';
break;
case 'queue':
$creating_numbers =
$paramsC->get('queue_creating_numbers', 'A');
$column = 'queue_number_id';
break;
case 'order':
default:
$creating_numbers =
$paramsC->get('order_creating_numbers', 'A');
$column = 'order_number_id';
break;
}
switch ($creating_numbers) {
case 'Y':
// Yearly based
$date = !$date ? self::getOrderDate($orderId) : $date;
$time = strtotime($date);
$year = date("Y", $time);
$db = JFactory::getDBO();
$query = ' SELECT MAX(' . $column . ') FROM
#__phocacart_orders WHERE YEAR(date) = ' . (int)$year . ' ORDER
BY date LIMIT 1';
$db->setQuery($query);
$id = $db->loadResult();
if (!$id || $id == 0) {
return 1;
} else {
$id++;
return $id;
}
break;
case 'M':
// Montly based
$date = !$date ? self::getOrderDate($orderId) : $date;
$time = strtotime($date);
$year = date("Y", $time);
$month = date("m", $time);
$db = JFactory::getDBO();
$query = ' SELECT MAX(' . $column . ') FROM
#__phocacart_orders WHERE YEAR(date) = ' . (int)$year . ' AND
MONTH(date) = ' . (int)$month . ' ORDER BY date LIMIT 1';
$db->setQuery($query);
$id = $db->loadResult();
if (!$id || $id == 0) {
return 1;
} else {
$id++;
return $id;
}
break;
case 'D':
// Daily based
$date = !$date ? self::getOrderDate($orderId) : $date;
$time = strtotime($date);
$year = date("Y", $time);
$month = date("m", $time);
$day = date("d", $time);
$db = JFactory::getDBO();
$query = ' SELECT MAX(' . $column . ') FROM
#__phocacart_orders WHERE YEAR(date) = ' . (int)$year . ' AND
MONTH(date) = ' . (int)$month . ' AND DAY(date) = ' .
(int)$day . ' ORDER BY date LIMIT 1';
$db->setQuery($query);
$id = $db->loadResult();
if (!$id || $id == 0) {
return 1;
} else {
$id++;
return $id;
}
break;
case 'A':
default:
// OrderId stay autoincrement
return $orderId;
break;
}
}
public static function getOrderNumber($orderId, $date = false,
$orderNumber = false, $orderNumberId = false) {
if ($orderNumber) {
return $orderNumber;// the number is stored in database yet
}
$paramsC = PhocacartUtils::getComponentParameters();
$order_number_format =
$paramsC->get('order_number_format',
'{prefix}{year}{orderid}{suffix}');
$order_number_prefix =
$paramsC->get('order_number_prefix', '');
$order_number_suffix =
$paramsC->get('order_number_suffix', '');
$order_id_length_order =
$paramsC->get('order_id_length_order', '10');
$date = !$date ? self::getOrderDate($orderId) : $date;
$dateO = PhocacartDate::splitDate($date);
$id = $orderId;
if ($orderNumberId && $orderNumberId > 0) {
$id = $orderNumberId;// not autoincrement but specific ID based
on year or month see parameter: invoice_creating_numbers
}
$id = str_pad($id, $order_id_length_order, '0',
STR_PAD_LEFT);
$o = str_replace('{orderid}', $id, $order_number_format);
$o = str_replace('{prefix}', $order_number_prefix, $o);
$o = str_replace('{suffix}', $order_number_suffix, $o);
$o = str_replace('{year}', $dateO['year'], $o);
$o = str_replace('{month}', $dateO['month'],
$o);
$o = str_replace('{day}', $dateO['day'], $o);
return $o;
}
/**
* @param $orderId
* @param bool $date
* @param bool $invoiceNumber ... is human readable number
* @param bool $invoiceNumberId ... is number id which must not be the
same like autoincrement because of montly or yearly created numbers, see
parameter: invoice_creating_numbers
* @return bool|mixed
*/
public static function getInvoiceNumber($orderId, $date = false,
$invoiceNumber = false, $invoiceNumberId = false) {
if ($invoiceNumber) {
return $invoiceNumber;// the number is stored in database yet
}
$paramsC =
PhocacartUtils::getComponentParameters();
$invoice_number_format =
$paramsC->get('invoice_number_format',
'{prefix}{year}{orderid}{suffix}');
$invoice_number_prefix =
$paramsC->get('invoice_number_prefix', '');
$invoice_number_suffix =
$paramsC->get('invoice_number_suffix', '');
$order_id_length_invoice =
$paramsC->get('order_id_length_invoice', '10');
$date = !$date ? self::getOrderDate($orderId) : $date;
$dateO = PhocacartDate::splitDate($date);
$id = $orderId;
if ($invoiceNumberId && $invoiceNumberId > 0) {
$id = $invoiceNumberId;// not autoincrement but specific ID
based on year or month see parameter: invoice_creating_numbers
} else {
return '';
}
$id = str_pad($id, $order_id_length_invoice, '0',
STR_PAD_LEFT);
$o = str_replace('{orderid}', $id,
$invoice_number_format);
$o = str_replace('{prefix}', $invoice_number_prefix, $o);
$o = str_replace('{suffix}', $invoice_number_suffix, $o);
$o = str_replace('{year}', $dateO['year'], $o);
$o = str_replace('{month}', $dateO['month'],
$o);
$o = str_replace('{day}', $dateO['day'], $o);
return $o;
/* $order_date = $orderDate != '' ? $orderDate :
self::getOrderDate($orderId);
$invoice_prefix = $invoicePrefix != '' ?
$invoicePrefix : $paramsC->get('invoice_prefix',
'');
$invoice_number_format = $invoiceNumberFormat != '' ?
$invoiceNumberFormat : $paramsC->get( 'invoice_number_format',
'');
$invoice_number_chars = $invoiceNumberChars != '' ?
$invoiceNumberChars : $paramsC->get( 'invoice_number_chars',
12);
$order_date = date("Ymd", strtotime($order_date));
$iN = $invoice_number_format;
$iN = str_replace('{prefix}', $invoice_prefix, $iN);
$iN = str_replace('{orderdate}', $order_date, $iN);
$pos = strpos($iN, '{orderid}');
if ($pos === false) {
$l1 = strlen($iN);
$l2 = 0;
//$l = $invoice_number_chars - $l1 - $l2;
$l = $l1;
if ($l < 0) {$l = 0;}
$iN = str_pad($iN, $invoice_number_chars, '0',
STR_PAD_RIGHT);
} else {
$l1 = strlen(str_replace('{orderid}',
'', $iN));
//$l2 = strlen($orderId);
$l = $invoice_number_chars - $l1;
if ($l < 0) {$l = 0;}
$orderId = str_pad($orderId, $l, '0',
STR_PAD_LEFT);
$iN = str_replace('{orderid}', $orderId, $iN);
}
return $iN;*/
}
public static function getReceiptNumber($orderId, $date = false,
$receiptNumber = false, $receiptNumberId = false) {
if ($receiptNumber) {
return $receiptNumber;// the number is stored in database yet
}
$paramsC =
PhocacartUtils::getComponentParameters();
$receipt_number_format =
$paramsC->get('receipt_number_format',
'{prefix}{year}{orderid}{suffix}');
$receipt_number_prefix =
$paramsC->get('receipt_number_prefix', '');
$receipt_number_suffix =
$paramsC->get('receipt_number_suffix', '');
$order_id_length_receipt =
$paramsC->get('order_id_length_receipt', '10');
$date = !$date ? self::getOrderDate($orderId) : $date;
$dateO = PhocacartDate::splitDate($date);
$id = $orderId;
if ($receiptNumberId && $receiptNumberId > 0) {
$id = $receiptNumberId;// not autoincrement but specific ID
based on year or month see parameter: invoice_creating_numbers
}
$id = str_pad($id, $order_id_length_receipt, '0',
STR_PAD_LEFT);
$o = str_replace('{orderid}', $id,
$receipt_number_format);
$o = str_replace('{prefix}', $receipt_number_prefix, $o);
$o = str_replace('{suffix}', $receipt_number_suffix, $o);
$o = str_replace('{year}', $dateO['year'], $o);
$o = str_replace('{month}', $dateO['month'],
$o);
$o = str_replace('{day}', $dateO['day'], $o);
return $o;
}
public static function getPaymentReferenceNumber($orderId, $date =
false, $prmNumber = false, $idNumberA = array()) {
if ($prmNumber) {
return $prmNumber;// the number is stored in database yet
}
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$prn_number_format =
$paramsC->get('prn_number_format',
'{prefix}{year}{orderid}{suffix}');
$prn_number_prefix =
$paramsC->get('prn_number_prefix', '');
$prn_number_suffix =
$paramsC->get('prn_number_suffix', '');
$order_id_length_prn =
$paramsC->get('order_id_length_prn', '10');
$prn_number_id_basis =
$paramsC->get('prn_number_id_basis', 'A');
$date = !$date ? self::getOrderDate($orderId) : $date;
$dateO = PhocacartDate::splitDate($date);
$id = $orderId;
if (!empty($idNumberA)) {
switch ($prn_number_id_basis) {
case 'O':
if (isset($idNumberA['order']) &&
$idNumberA['order'] > 0) {
$id = (int)$idNumberA['order'];
} else {
// PRN can stay empty, e.g. in case
// - it is created from invoice number
// - but invoice was not created yet - waiting for
changed status
return '';
}
break;
case 'I':
if (isset($idNumberA['invoice']) &&
$idNumberA['invoice'] > 0) {
$id = (int)$idNumberA['invoice'];
} else {
return '';
}
break;
case 'R':
if (isset($idNumberA['receipt']) &&
$idNumberA['receipt'] > 0) {
$id = (int)$idNumberA['receipt'];
} else {
return '';
}
break;
case 'A':
default:
// Do nothing, ID is autoincrement - $orderId
break;
}
}
$id = str_pad($id, $order_id_length_prn, '0',
STR_PAD_LEFT);
$o = str_replace('{orderid}', $id, $prn_number_format);
$o = str_replace('{prefix}', $prn_number_prefix, $o);
$o = str_replace('{suffix}', $prn_number_suffix, $o);
$o = str_replace('{year}', $dateO['year'], $o);
$o = str_replace('{month}', $dateO['month'],
$o);
$o = str_replace('{day}', $dateO['day'], $o);
return $o;
}
public static function getQueueNumber($orderId, $date = false,
$queueNumber = false, $queueNumberId = false) {
if ($queueNumber) {
return $queueNumber;// the number is stored in database yet
}
$paramsC = PhocacartUtils::getComponentParameters();
$queue_number_format = '{prefix}{queueid}{suffix}';
$queue_number_prefix =
$paramsC->get('queue_number_prefix', '');
$queue_number_suffix =
$paramsC->get('queue_number_suffix', '');
$queue_number_length =
$paramsC->get('queue_number_length', '5');
$date = !$date ? self::getOrderDate($orderId) : $date;
$dateO = PhocacartDate::splitDate($date);
$id = $orderId;
if ($queueNumberId && $queueNumberId > 0) {
$id = $queueNumberId;// not autoincrement but specific ID based
on year or month or day see parameter: queue_creating_numbers
}
$id = str_pad($id, $queue_number_length, '0',
STR_PAD_LEFT);
$o = str_replace('{queueid}', $id, $queue_number_format);
$o = str_replace('{prefix}', $queue_number_prefix, $o);
$o = str_replace('{suffix}', $queue_number_suffix, $o);
//$o = str_replace('{year}', $dateO['year'],
$o);
//$o = str_replace('{month}', $dateO['month'],
$o);
//$o = str_replace('{day}', $dateO['day'], $o);
return $o;
}
public static function getInvoiceDueDate($orderId, $date = false,
$dueDate = false, $formatOutput = '') {
if ($dueDate) {
if ($formatOutput != '') {
return JHtml::date($dueDate, $formatOutput);
}
return $dueDate;// the due date is stored in database yet
}
$paramsC = PhocacartUtils::getComponentParameters();
$invoice_due_date_days =
$paramsC->get('invoice_due_date_days', 5);
$date = !$date ? self::getOrderDate($orderId) : $date;
$dateTime = new DateTime($date);
$dateTime->add(new DateInterval('P' .
(int)$invoice_due_date_days . 'D'));
//return $dateTime->format('Y-m-d h:m:s');
// default format output: 'DATE_FORMAT_LC4'
if ($formatOutput != '') {
return JHtml::date($dateTime->format('Y-m-d
h:m:s'), $formatOutput);
} else {
return $dateTime->format('Y-m-d h:m:s');
}
}
public static function getInvoiceDate($orderId, $date = false,
$formatOutput = '') {
$date = !$date ? self::getOrderDate($orderId) : $date;
$dateTime = new DateTime($date);
if ($formatOutput != '') {
return JHtml::date($dateTime->format('Y-m-d
h:m:s'), $formatOutput);
} else {
return $dateTime->format('Y-m-d h:m:s');
}
}
/**
*
* @param string $oIdS - order IDs separated by comma
* @return array
*
* Get all total items by selected order Ids
* e.g. Order 1 -> total 1 (netto), total 2 (vat), total 3(brutton),
etc.
*/
public static function getItemsTotal($oIdS = '') {
$db = JFactory::getDBO();
$wheres = array();
if ($oIdS != '') {
$wheres[] = 'a.order_id IN (' . $oIdS .
')';
}
$query = 'SELECT a.id, a.order_id, a.item_id, a.item_id_c,
a.item_id_r, a.title, a.title_lang, a.title_lang_suffix,
a.title_lang_suffix, a.type, a.amount, a.amount_currency'
. ' FROM #__phocacart_order_total AS a';
if (!empty($wheres)) {
$query .= ' WHERE ' . implode(' AND ',
$wheres);
}
$db->setQuery($query);
$items = $db->loadAssocList();
return $items;
}
public static function getItemsTaxRecapitulation($oIdS = '')
{
$db = JFactory::getDBO();
$wheres = array();
if ($oIdS != '') {
$wheres[] = 'a.order_id IN (' . $oIdS .
')';
}
$query = 'SELECT a.id, a.order_id, a.item_id, a.item_id_c,
a.item_id_r, a.title, a.type, a.amount_netto, a.amount_tax,
a.amount_brutto, a.amount_brutto_currency'
. ' FROM #__phocacart_order_tax_recapitulation AS a';
if (!empty($wheres)) {
$query .= ' WHERE ' . implode(' AND ',
$wheres);
}
$db->setQuery($query);
$items = $db->loadAssocList();
return $items;
}
/*
* This method is used when storing order but even when chaning status
* Because invoice number can be set by status. E.g. invoice number
will be set only when status is set to "completed"
* When storing order and the status is pending, invoice number will be
not set
* This only applies to when invoice number is created based on month
or year basis
* Invoice number can be then created by chaning status - model
phocacarteditstatus, model phocacartorder, or payment methods which call:
PhocacartOrderStatus::changeStatusInOrderTable()
*
*/
public static function storeOrderReceiptInvoiceId($id, $date,
$statusId, $docs = array()) {
$app = JFactory::getApplication();
$db = JFactory::getDbo();
$d = array();
$d['id'] = $id;
// if we create the data by order status changes, we don't use
new date but the one which exists in order yet
// so when using this function from order statuses, the date is
false to get the right date here
$date = !$date ? self::getOrderDate($id) : $date;
$d['date'] = $date;
// Don't change the date of order but change date for oder,
receipt or delivery note number
$dateNow = JFactory::getDate()->toSql();
// Will we create an invoice?
$paramsC =
PhocacartUtils::getComponentParameters();
$invoice_creating_numbers =
$paramsC->get('invoice_creating_numbers', 'A');
$invoice_creating_status_based =
$paramsC->get('invoice_creating_status_based', 0);
// Invoice is created by year or month basis - we can create
invoice id by status
if ($invoice_creating_numbers == 'Y' ||
$invoice_creating_numbers == 'M') {
// It is enabled in parameters that invoice is made by status
if ((int)$invoice_creating_status_based > 0) {
// Check the status
if ((int)$statusId > 0 &&
(int)$invoice_creating_status_based == (int)$statusId) {
// we can create invoice
} else {
// don't create the invoice because it should be
only created when
// specific status is set but it is not set yet
if (($key = array_search('I', $docs)) !==
false) {
unset($docs[$key]);
}
}
}
}
if (!in_array('O', $docs) &&
!in_array('R', $docs) && !in_array('I', $docs))
{
// This can happen when we changed the status and we need to
check if invoice
// should be created. By chaning status we are only asking to
create invoice
// number. But in case the order status does not fit the status
set in options
// invoice will be not created. And because we didn't ask
for receipt number
// and order number, nothing will be changed.
return false;
}
$orderNumberId = 0;
$receiptNumberId = 0;
$invoiceNumberId = 0;
$queueNumberId = 0;
// Which numbers will be active, set by auto increment or by year
or by month
// Example: auto increment can be 1250 but it is new year so based
on year the number will be 1 (even autoincrement will be 1251)
if (in_array('O', $docs)) {
// Order Number
$d['date'] = $date;
$d['order_number_id'] =
PhocaCartOrder::getNumberId('order', $id, $dateNow);
// Human readable numbers inclusive all prefixes, suffixes,
etc.
$d['order_number'] =
PhocacartOrder::getOrderNumber($id, $dateNow, false,
$d['order_number_id']);
$orderNumberId = $d['order_number_id'];
// Queue Number
$d['queue_number_id'] =
PhocaCartOrder::getNumberId('queue', $id, $dateNow);
$d['queue_number'] =
PhocacartOrder::getQueueNumber($id, $dateNow, false,
$d['queue_number_id']);
$queueNumberId = $d['queue_number_id'];
}
if (in_array('R', $docs)) {
$d['date'] = $date;
$d['receipt_number_id'] =
PhocaCartOrder::getNumberId('receipt', $id, $dateNow);
$d['receipt_number'] =
PhocacartOrder::getReceiptNumber($id, $dateNow, false,
$d['receipt_number_id']);
$receiptNumberId = $d['receipt_number_id'];
}
// If there are data yet, don't overwrite them
// Order and Receipt are not changed by status, so this can be
checked before invoice
// and PRN
$query = ' SELECT date, invoice_number_id, invoice_number,
invoice_prn, invoice_date, invoice_due_date, invoice_time_of_supply FROM
#__phocacart_orders WHERE id = ' . (int)$id . ' ORDER BY id LIMIT
1';
$db->setQuery($query);
$orderData = $db->loadAssoc();
if (in_array('I', $docs)) {
if (!isset($orderData['date']) ||
(isset($orderData['date']) &&
!PhocacartDate::activeDatabaseDate($orderData['date']))) {
$d['date'] = $date;
}
if ((!isset($orderData['invoice_number_id']) ||
(isset($orderData['invoice_number_id']) &&
(int)$orderData['invoice_number_id'] == 0))
&& (!isset($orderData['invoice_number'])
|| (isset($orderData['invoice_number']) &&
$orderData['invoice_number'] == ''))) {
$d['invoice_number_id'] =
PhocaCartOrder::getNumberId('invoice', $id, $dateNow);
$invoiceNumberId =
$d['invoice_number_id'];
$d['invoice_number'] =
PhocacartOrder::getInvoiceNumber($id, $dateNow, false,
$d['invoice_number_id']);
}
if (!isset($orderData['invoice_date']) ||
(isset($orderData['invoice_date']) &&
!PhocacartDate::activeDatabaseDate($orderData['invoice_date'])))
{
$d['invoice_date'] = $dateNow;
}
if (!isset($orderData['invoice_due_date']) ||
(isset($orderData['invoice_due_date']) &&
!PhocacartDate::activeDatabaseDate($orderData['invoice_due_date'])))
{
$d['invoice_due_date'] =
PhocacartOrder::getInvoiceDueDate($id, $dateNow);
}
if (!isset($orderData['invoice_time_of_supply']) ||
(isset($orderData['invoice_time_of_supply']) &&
!PhocacartDate::activeDatabaseDate($orderData['invoice_time_of_supply'])))
{
$d['invoice_time_of_supply'] = $dateNow;
}
}
// Create Payment Reference Number based on different numbers -
parameter is used in getPaymentReferenceNumber function
// So it even be created if there is no invoice number
// Don't create it if it is created yet. E.g. status wants to
create invoice
// but PRN was created previously by order or receipt ID
if (!isset($orderData['invoice_prn']) ||
(isset($orderData['invoice_prn']) &&
$orderData['invoice_prn'] == '')) {
$idNumberA = array(
'order' => $orderNumberId,
'receipt' => $receiptNumberId,
'invoice' => $invoiceNumberId
);
$prn = PhocacartOrder::getPaymentReferenceNumber($id,
$dateNow, false, $idNumberA);
if ($prn != '') {
// PRN is not included in database and it exits
$d['invoice_prn'] = $prn;
}
}
// Store the items
// This method can be called by storing order or by chaning
statuses, so
// add only the variables which really should be added and
don't
// overwrite existing variables with empty values
// This is why dome $d array keys are not defined
// E.g. if this method is called by chaning status, order and
receipt keys are inactive
$row = JTable::getInstance('PhocacartOrder',
'Table', array());
if (!$row->bind($d)) {
//throw new Exception($db->getErrorMsg());
$msg = JText::_($db->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->check()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!$row->store()) {
//throw new Exception($row->getError());
$msg = JText::_($row->getErrorMsg());
$app->enqueueMessage($msg, 'error');
return false;
}
if (!isset($d['order_number_id'])) {
$d['order_number_id'] = 0;
}
if (!isset($d['receipt_number_id'])) {
$d['receipt_number_id'] = 0;
}
if (!isset($d['invoice_number_id'])) {
$d['invoice_number_id'] = 0;
}
if (!isset($d['queue_number_id'])) {
$d['queue_number_id'] = 0;
}
if (!isset($d['order_number'])) {
$d['order_number'] = '';
}
if (!isset($d['receipt_number'])) {
$d['receipt_number'] = '';
}
if (!isset($d['invoice_number'])) {
$d['invoice_number'] = '';
}
if (!isset($d['queue_number'])) {
$d['queue_number'] = '';
}
return $d;
}
}
PK�"�[�S����$libraries/phocacart/order/render.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartOrderRender
{
public function __construct() {}
public function render($id, $type = 1, $format = 'html', $token
= '', $pos = 0) {
$paramsC = PhocacartUtils::getComponentParameters();
$pdf_invoice_qr_code = $paramsC->get(
'pdf_invoice_qr_code', '' );
// If frontend user orders: user login needed or token
// If frontend POS: vendor login needed
// isPosView - we are directly in POS view
// $pos - we are not in POS view but we ask order view from pos view
if (($pos && !PhocacartPos::isPosEnabled()) &&
PhocacartPos::isPosView() && !PhocacartPos::isPosEnabled()) {
die (JText::_('COM_PHOCACART_POS_IS_DISABLED'));
}
if ($id < 1) {
return JText::_('COM_PHOCACART_ERROR_NO_ORDER_FOUND');
}
$d = array();
$d['params'] = PhocacartUtils::getComponentParameters();
$d['type'] = $type;
$d['format'] = $format;
$layout = new \Joomla\CMS\Layout\FileLayout('order', null,
array('client' => 0));
$defaultTemplate = PhocacartUtils::getDefaultTemplate();
if ($defaultTemplate != '') {
$layout->addIncludePath(JPATH_SITE .
'/templates/'.$defaultTemplate.'/html/layouts/com_phocacart');
}
JHtml::stylesheet('media/com_phocacart/css/main.css' );
$app = JFactory::getApplication();
$order = new PhocacartOrderView();
$d['common'] = $order->getItemCommon($id);
$d['price'] = new PhocacartPrice();
$d['price']->setCurrency($d['common']->currency_id);
// Access rights actions ignored in administration
if (!$app->isClient('administrator')){
if ($pos || PhocacartPos::isPosView()) {
$user = $vendor = $ticket = $unit = $section = array();
$dUser = PhocacartUser::defineUser($user, $vendor, $ticket, $unit,
$section, 1);
if ((int)$vendor->id < 1) {
PhocacartLog::add(2, 'Render Order - ERROR', (int)$id,
JText::_('COM_PHOCACART_ERROR_NO_ORDER_FOUND') . 'Vendor not
found (1)');
die (JText::_('COM_PHOCACART_ERROR_NO_ORDER_FOUND'));
}
if (!isset($d['common']->vendor_id)) {
PhocacartLog::add(2, 'Render Order - ERROR', (int)$id,
JText::_('COM_PHOCACART_ERROR_NO_ORDER_FOUND') . 'Vendor not
found (2)');
die (JText::_('COM_PHOCACART_ERROR_NO_ORDER_FOUND'));
}
if ($vendor->id != $d['common']->vendor_id) {
PhocacartLog::add(2, 'Render Order - ERROR', (int)$id,
JText::_('COM_PHOCACART_ERROR_NO_ORDER_FOUND') . 'Vendor
doesn\'t match');
die (JText::_('COM_PHOCACART_ERROR_NO_ORDER_FOUND'));
}
} else {
$user = PhocacartUser::getUser();
// Frontend displaying rules
// Frontend, view = orders view or view = order view
// Order status can prevent from displaying some documents (can be set
for each order status, parameter: orders_view_diplay
// So this rules only applies to frontend orders or order view (and of
course then all other rules are applied too, like user or token
$app = JFactory::getApplication();
$view = $app->input->get('view', '',
'string');
$option = $app->input->get('option', '',
'string');
$displayInOrderView = true;
if ($option == 'com_phocacart' && ($view ==
'orders' || $view == 'order')) {
$displayDocument =
json_decode($d['common']->ordersviewdisplay, true);
if (!in_array($type, $displayDocument)) {
$displayInOrderView = false;
}
}
// We are in orders/order view and order status cannot display current
document
if ($displayInOrderView == false) {
PhocacartLog::add(2, 'Render Order - ERROR', (int)$id,
JText::_('COM_PHOCACART_ERROR_NO_ORDER_FOUND') . 'Order
status does not allow this document to be displayed in Order/Orders
View');
die (JText::_('COM_PHOCACART_ERROR_NO_ORDER_FOUND'));
}
if ((int)$user->id < 1 && $token == '') {
PhocacartLog::add(2, 'Render Order - ERROR', (int)$id,
JText::_('COM_PHOCACART_ERROR_NO_ORDER_FOUND') . 'User not
found (1)');
// Add some debug here including debug_print_backtrace(); too see the
flow which comes to this error - if from status or from view
die (JText::_('COM_PHOCACART_ERROR_NO_ORDER_FOUND'));
}
if (!isset($d['common']->user_id) && $token ==
'') {
PhocacartLog::add(2, 'Render Order - ERROR', (int)$id,
JText::_('COM_PHOCACART_ERROR_NO_ORDER_FOUND') . 'User not
found (2)');
die (JText::_('COM_PHOCACART_ERROR_NO_ORDER_FOUND'));
}
if ($user->id != $d['common']->user_id &&
$token == '') {
PhocacartLog::add(2, 'Render Order - ERROR', (int)$id,
JText::_('COM_PHOCACART_ERROR_NO_ORDER_FOUND') . 'User
doesn\'t match');
die (JText::_('COM_PHOCACART_ERROR_NO_ORDER_FOUND'));
}
if ((int)$user->id < 1 && $token != ''
&& ($token != $d['common']->order_token)) {
PhocacartLog::add(2, 'Render Order - ERROR', (int)$id,
JText::_('COM_PHOCACART_ERROR_NO_ORDER_FOUND') . 'Token
doesn\'t match');
die (JText::_('COM_PHOCACART_ERROR_NO_ORDER_FOUND'));
}
}
}
$d['bas'] = $order->getItemBaS($id, 1);
$d['products'] = $order->getItemProducts($id);
$d['discounts'] = $order->getItemProductDiscounts($id, 0);
$d['total'] = $order->getItemTotal($id, 1);
$d['taxrecapitulation'] =
$order->getItemTaxRecapitulation($id);
// Prepare variables for possible replace in different text parts, e.g.:
// - QR code on invoice
// - TOP, BOTTOM, MIDDLE Description
// user per function:
PhocacartText::completeText($pdf_invoice_qr_code,
$d['preparereplace'], 1);
$d['preparereplace'] =
PhocacartText::prepareReplaceText($order, $id, $d['common'],
$d['bas']);
// QR CODE IN PDF
$d['qrcode'] = '';
if ($type == 2 && $format == 'pdf') {
$d['qrcode'] =
PhocacartText::completeText($pdf_invoice_qr_code,
$d['preparereplace'], 1);
/*if (isset($d['bas']['b'])) {
$d['qrcode'] =
PhocacartText::completeTextFormFields($d['qrcode'],
$d['bas']['b'], 1);
}
if (isset($d['bas']['s'])) {
$d['qrcode'] =
PhocacartText::completeTextFormFields($d['qrcode'],
$d['bas']['s'], 2);
}*/
if (!isset($d['bas']['b'])) {
$d['bas']['b'] = array();
}
if (!isset($d['bas']['s'])) {
$d['bas']['s'] = array();
}
if (isset($d['bas']['s'])) {
$d['qrcode'] =
PhocacartText::completeTextFormFields($d['qrcode'],
$d['bas']['b'], $d['bas']['s']);
}
}
//if ($type == 4 && $format == 'raw') {
// POS RECEIPT IS MANAGED BY SPECIFIC RULES
// array instead of output will be returned
//return $layout->render($d);
//} else {
return $layout->render($d);
//}
}
}
?>
PK�"�[�b���$libraries/phocacart/order/status.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
/*
phocacart import('phocacart.path.route');
*/
class PhocacartOrderStatus
{
private static $status = array();
private function __construct(){}
public static function getStatus( $id = 0) {
if( !array_key_exists( $id, self::$status ) ) {
$db = JFactory::getDBO();
$query = ' SELECT a.title, a.stock_movements, a.change_user_group,
a.change_points_needed, a.change_points_received,'
.' a.email_customer, a.email_others, a.email_subject,
a.email_subject_others, a.email_text, a.email_footer,'
.' a.email_text_others, a.email_send, a.email_send_format,
a.email_attachments, a.orders_view_display, a.download,'
.' a.activate_gift, a.email_gift, a.email_subject_gift_sender,
a.email_text_gift_sender, a.email_subject_gift_recipient,
a.email_text_gift_recipient, a.email_gift_format'
.' FROM #__phocacart_order_statuses AS a'
.' WHERE a.id = '.(int)$id
.' ORDER BY a.id';
$db->setQuery($query);
$s = $db->loadObject();
if (!empty($s) && isset($s->title) && $s->title !=
'') {
self::$status[$id]['title'] = JText::_($s->title);
self::$status[$id]['id'] = (int)$id;
self::$status[$id]['stock_movements'] =
$s->stock_movements;
self::$status[$id]['change_user_group'] =
$s->change_user_group;
self::$status[$id]['change_points_needed'] =
$s->change_points_needed;
self::$status[$id]['change_points_received'] =
$s->change_points_received;
self::$status[$id]['email_customer'] =
$s->email_customer;
self::$status[$id]['email_others'] = $s->email_others;
self::$status[$id]['email_subject'] =
$s->email_subject;
self::$status[$id]['email_subject_others'] =
$s->email_subject_others;
self::$status[$id]['email_text'] = $s->email_text;
self::$status[$id]['email_footer'] = $s->email_footer;
self::$status[$id]['email_text_others'] =
$s->email_text_others;
self::$status[$id]['email_send'] = $s->email_send;
self::$status[$id]['email_send_format'] =
$s->email_send_format;
self::$status[$id]['email_attachments'] =
$s->email_attachments;
self::$status[$id]['activate_gift'] =
$s->activate_gift;
self::$status[$id]['email_gift'] = $s->email_gift;
self::$status[$id]['email_subject_gift_sender'] =
$s->email_subject_gift_sender;
self::$status[$id]['email_text_gift_sender'] =
$s->email_text_gift_sender;
self::$status[$id]['email_subject_gift_recipient'] =
$s->email_subject_gift_recipient;
self::$status[$id]['email_text_gift_recipient'] =
$s->email_text_gift_recipient;
self::$status[$id]['email_gift_format'] =
$s->email_gift_format;
self::$status[$id]['orders_view_display'] =
$s->orders_view_display;
self::$status[$id]['download'] = $s->download;
$query = 'SELECT a.title AS text, a.id AS value'
. ' FROM #__phocacart_order_statuses AS a'
. ' WHERE a.published = 1'
. ' ORDER BY a.ordering';
$db->setQuery( $query );
$data = $db->loadObjectList();
if (!empty($data)) {
foreach ($data as $k => $v) {
$v->text = JText::_($v->text);
}
}
self::$status[$id]['data'] = $data;
} else {
self::$status[$id] = false;
}
}
return self::$status[$id];
}
public final function __clone() {
throw new Exception('Function Error: Cannot clone instance of
Singleton pattern', 500);
return false;
}
/*
* $orderToken ... token of order when there is no user - means that the
method will not check the user in such case
* 1) guest checkout - token is active, user will be not checked when user
calls this script (e.g. when ordering)
* 2) or payment method server contacts server - token is active, user
will be not checked (user is not the one who calls the script but payment
method)
*
* User will be not checked when:
* 1) status is changed in administration (vendor in admin is the the
shopper user)
* 2) guest user makes the order (there is nothing to check)
* 3) payment method contact server to change status (payment method does
not identify as user - $user = JFactory::getUser())
*
* $notifyUser 0 ... no 1 ... yes 99 ... defined in order status settings
* $notifyOthers 0 ... no 1 ... yes 99 ... defined in order status
settings
* $emailSend 0 ... no 1 ... order, 2 ... invoice, 3 ... delivery_note,
99 ... defined in order status settings
* $emailSend 0 ... html 1 ... pdf, 2 ... both, 99 ... defined in order
status settings
* $stockMovements = ... no + ... plus - ... minus 99 ... defined in
order status settings
* $emailSendGift 0 ... no 1 ... Buyer 2 ... Recipient 3 ... Both
*/
public static function changeStatus( $orderId, $statusId, $orderToken =
'', $notifyUser = 99, $notifyOthers = 99, $emailSend = 99,
$stockMovements = '99', $changeUserGroup = '99',
$changePointsNeeded = '99', $changePointsReceived =
'99', $emailSendFormat = '99') {
// ORDER INFO
$pos = PhocacartPos::isPos();
$order = new PhocacartOrderView();
$common = $order->getItemCommon($orderId);
$orderNumber= PhocacartOrder::getOrderNumber($orderId, $common->date,
$common->order_number);
$bas = $order->getItemBaS($orderId, 1);
//$totalBrutto= $order->getItemTotal($orderId, 0, 'brutto');
$status = self::getStatus($statusId);
$config = JFactory::getConfig();
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
//$invoice_prefix = $paramsC->get('invoice_prefix',
'');
$email_send_format = isset($status['email_send_format']) ?
$status['email_send_format'] : 0;
// FIND THE RIGHT VALUES FOR VARIBALES - different if we are in frontend
or backend
$notifyUserV = false;
$notifyOthersV = false;
$emailSendV = false;
//$emailSendGiftV = false;
$stockMovementsV= '';
// 1) NOTIFY USER
if ($notifyUser == 0) {
$notifyUserV = false;
} else if ($notifyUser == 1) {
$notifyUserV = true;
} else if ($notifyUser == 99) {
if (isset($status['email_customer']) &&
(int)$status['email_customer'] > 0) {
if ((int)$status['email_customer'] == 1) {
$notifyUserV = true;
} else if ((int)$status['email_customer'] == 2 &&
!$pos) {
$notifyUserV = true;// Don't send email from POS if the send
email parameter is set to: Yes (excluding POS)
}
}
}
// 2) NOTIFY OTHERS
if ($notifyOthers == 0) {
$notifyOthersV = false;
} else if ($notifyOthers == 1 ) {
$notifyOthersV = true;
} else if ($notifyOthers == 99) {
if (isset($status['email_others']) &&
$status['email_others'] != '') {
$notifyOthersV = true;
}
}
// 3) EMAIL SEND
if ($emailSend == 0) {
$emailSendV = 0;
} else if ($emailSend == 1) {
$emailSendV = 1;
} else if ($emailSend == 2) {
$emailSendV = 2;
} else if ($emailSend == 3) {
$emailSendV = 3;
} else if ($emailSend == 99) {
if (isset($status['email_send']) &&
$status['email_send'] == 0) {
$emailSendV = 0;
} else if (isset($status['email_send']) &&
$status['email_send'] == 1) {
$emailSendV = 1;
} else if (isset($status['email_send']) &&
$status['email_send'] == 2) {
$emailSendV = 2;
} else if (isset($status['email_send']) &&
$status['email_send'] == 3) {
$emailSendV = 3;
}
}
// 3) EMAIL SEND
if ($emailSendFormat == 0) {
$emailSendFormatV = 0;
} else if ($emailSendFormat == 1) {
$emailSendFormatV = 1;
} else if ($emailSendFormat == 2) {
$emailSendFormatV = 2;
} else if ($emailSendFormat == 99) {
if (isset($status['email_send_format']) &&
$status['email_send_format'] == 0) {
$emailSendFormatV = 0;
} else if (isset($status['email_send_format']) &&
$status['email_send_format'] == 1) {
$emailSendFormatV = 1;
} else if (isset($status['email_send_format']) &&
$status['email_send_format'] == 2) {
$emailSendFormatV = 2;
}
}
// 4) STOCK MOVEMENTS
if ($stockMovements == '0') {
$stockMovementsV = '';
} else if ($stockMovements == '+') {
$stockMovementsV = '+';
} else if ($stockMovements == '-') {
$stockMovementsV = '-';
} else if ($stockMovements == '99') {
if (isset($status['stock_movements']) &&
$status['stock_movements'] == '=') {
$stockMovementsV = '';
} else if (isset($status['stock_movements']) &&
$status['stock_movements'] == '+') {
$stockMovementsV = '+';
} else if (isset($status['stock_movements']) &&
$status['stock_movements'] == '-') {
$stockMovementsV = '-';
}
}
// 5) User Group Change
if ($changeUserGroup == 0) {
$changeUserGroupV = 0;
} else if ($changeUserGroup == 1) {
$changeUserGroupV = 1;
} else if ($changeUserGroup == '99') {
if (isset($status['change_user_group']) &&
$status['change_user_group'] == 0) {
$changeUserGroupV = 0;
} else if (isset($status['change_user_group']) &&
$status['change_user_group'] == 1) {
$changeUserGroupV = 1;
}
}
// 6) Reward Points Needed
if ($changePointsNeeded == 0) {
$changePointsNeededV = 0;
} else if ($changePointsNeeded == 1) {
$changePointsNeededV = 1;
} else if ($changePointsNeeded == 2) {
$changePointsNeededV = 2;
} else if ($changePointsNeeded == '99') {
if (isset($status['change_points_needed']) &&
$status['change_points_needed'] == 0) {
$changePointsNeededV = 0;
} else if (isset($status['change_points_needed']) &&
$status['change_points_needed'] == 1) {
$changePointsNeededV = 1;
} else if (isset($status['change_points_needed']) &&
$status['change_points_needed'] == 2) {
$changePointsNeededV = 2;
}
}
// 7) Reward Points Received
if ($changePointsReceived == 0) {
$changePointsReceivedV = 0;
} else if ($changePointsReceived == 1) {
$changePointsReceivedV = 1;
} else if ($changePointsReceived == 2) {
$changePointsReceivedV = 2;
} else if ($changePointsReceived == '99') {
if (isset($status['change_points_received']) &&
$status['change_points_received'] == 0) {
$changePointsReceivedV = 0;
} else if (isset($status['change_points_received']) &&
$status['change_points_received'] == 1) {
$changePointsReceivedV = 1;
} else if (isset($status['change_points_received']) &&
$status['change_points_received'] == 2) {
$changePointsReceivedV = 2;
}
}
/* Email send gift voucher works together with email send gift voucher
body or subject
and it is possible that such objects will not exist in other statuses,
so don't set gift voucher
manually when there is no certainty, emails are ready.
// 8) Email Send Gift
if ($emailSendGift == 0) {
$emailSendGiftV = 0;
} else if ($emailSendGift == 1) {
$emailSendGiftV = 1;
} else if ($emailSendGift == 2) {
$emailSendGiftV = 2;
} else if ($emailSendGift == 3) {
$emailSendGiftV = 3;
} else if ($emailSendGift == 99) {
if (isset($status['email_gift']) &&
$status['email_gift'] == 0) {
$emailSendGiftV = 0;
} else if (isset($status['email_gift']) &&
$status['email_gift'] == 1) {
$emailSendGiftV = 1;
} else if (isset($status['email_gift']) &&
$status['email_gift'] == 2) {
$emailSendGiftV = 2;
} else if (isset($status['email_gift']) &&
$status['email_gift'] == 3) {
$emailSendGiftV = 3;
}
}
// 9) Email Send Gift Format
if ($emailSendGiftFormat == 0) {
$emailSendGiftFormatV = 0;
} else if ($emailSendGiftFormat == 1) {
$emailSendGiftFormatV = 1;
} else if ($emailSendGiftFormat == 2) {
$emailSendGiftFormatV = 2;
} else if ($emailSendGiftFormat == 3) {
$emailSendGiftFormatV = 3;
} else if ($emailSendGiftFormat == 99) {
if (isset($status['email_gift']) &&
$status['email_gift'] == 0) {
$emailSendGiftFormatV = 0;
} else if (isset($status['email_gift']) &&
$status['email_gift'] == 1) {
$emailSendGiftFormatV = 1;
} else if (isset($status['email_gift']) &&
$status['email_gift'] == 2) {
$emailSendGiftFormatV = 2;
} else if (isset($status['email_gift']) &&
$status['email_gift'] == 3) {
$emailSendGiftFormatV = 3;
}
}
*/
// EMAIL
$recipient = '';// Customer/Buyer
$recipientOthers = '';// others
$buyerEmail = '';// Customer/Buyer who should get GIFT
VOUCHER per new email
$recipientsEmails = array();// Recipients who should get GIFT VOUCHER
per new email (in case byer buys gift voucher and send it directly to
recipient)
$bcc = '';
$subject = '';
$body = '';
if ($notifyUserV) {
$canSend = self::canSendEmail($orderToken, $common);
// Payment method returns status
if ($canSend == 0) {
PhocacartLog::add(2, 'Order Status - Notify - ERROR',
(int)$orderId, JText::_('COM_PHOCACART_NO_USER_ORDER_FOUND'));
// Don't die here because even if we cannot send email to customer
we can send email to others
// $recipient == '' so no email will be sent to recipient
//die (JText::_('COM_PHOCACART_NO_USER_ORDER_FOUND'));
} else {
$recipient = self::getRecipient($bas);
}
}
if ($notifyOthersV) {
if (isset($status['email_others']) &&
$status['email_others'] != '') {
$bcc = explode(',', $status['email_others'] );
//if ($recipient == '') {
if (isset($bcc[0]) && JMailHelper::isEmailAddress($bcc[0])) {
$recipientOthers = $bcc[0];
}
//}
}
}
// STOCK MOVEMENTS
if ($stockMovementsV == '+' || $stockMovementsV ==
'-') {
//Phocacart
$orderV = new PhocacartOrderView();
$products = $orderV->getItemProducts($orderId);
$a = array();
if (!empty($products)) {
foreach ($products as $k => $v) {
// See:
https://www.phoca.cz/documents/116-phoca-cart-component/932-stock-handling
or
// https://www.phoca.cz/documents/116-phoca-cart-component/932-stock-handling
if ((int)$v->stock_calculation == 1) {
// =====================
// b) Product Variations
// In case of b) Product Variations - main product is one of many
product variations
if (!empty($v->attributes)) {
foreach($v->attributes as $k2 => $v2) {
if ((int)$v2->option_id > 0 &&
(int)$v2->productquantity > 0) {
// Status ID will be ignored as we know the Stock Movement /
Quantity set by product not attribute
PhocacartStock::handleStockAttributeOption((int)$v2->option_id,
$statusId, (int)$v2->productquantity, $stockMovementsV);
}
}
} else {
if ((int)$v->product_id > 0 && (int)$v->quantity
> 0) {
// Status ID will be ignored as we know the Stock Movement
PhocacartStock::handleStockProduct((int)$v->product_id,
$statusId, (int)$v->quantity, $stockMovementsV);
}
}
} else if ((int)$v->stock_calculation == 2 ||
(int)$v->stock_calculation == 3) {
// ============================
// c) Advanced Stock Management
if ((int)$v->product_id_key > 0 && (int)$v->quantity
> 0) {
// Status ID will be ignored as we know the Stock Movement
PhocacartStock::handleStockProductKey($v->product_id_key,
$statusId, (int)$v->quantity, $stockMovementsV);
}
} else {
// ===============
// a) Main Product
if ((int)$v->product_id > 0 && (int)$v->quantity
> 0) {
// Status ID will be ignored as we know the Stock Movement
PhocacartStock::handleStockProduct((int)$v->product_id,
$statusId, (int)$v->quantity, $stockMovementsV);
}
if (!empty($v->attributes)) {
foreach($v->attributes as $k2 => $v2) {
if ((int)$v2->option_id > 0 &&
(int)$v2->productquantity > 0) {
// Status ID will be ignored as we know the Stock Movement /
Quantity set by product not attribute
PhocacartStock::handleStockAttributeOption((int)$v2->option_id,
$statusId, (int)$v2->productquantity, $stockMovementsV);
}
}
}
}
}
}
}
// Change user group by changing of status
if (($changeUserGroupV == 0 || $changeUserGroupV == 1) &&
(int)$common->user_id > 0) {
PhocacartGroup::changeUserGroupByRule($common->user_id);
}
// POINTS NEEDED
if ($changePointsNeededV == 1 || $changePointsNeededV == 2) {
$published = $changePointsNeededV == 1 ? 1 : 0;
$db = JFactory::getDBO();
$q = ' SELECT id '
.' FROM #__phocacart_reward_points'
.' WHERE order_id = '. (int)$orderId
.' AND type = -1'
.' ORDER BY id';
$db->setQuery($q);
$idExists = $db->loadResult();
if ((int)$idExists > 0) {
$query = 'UPDATE #__phocacart_reward_points SET'
.' published = '.(int)$published
.' WHERE id = '.(int)$idExists;
$db->setQuery($query);
$db->execute();
}
}
// POINTS RECEIVED
if ($changePointsReceivedV == 1 || $changePointsReceivedV == 2) {
$published = $changePointsReceivedV == 1 ? 1 : 0;
$db = JFactory::getDBO();
$q = ' SELECT id '
.' FROM #__phocacart_reward_points'
.' WHERE order_id = '. (int)$orderId
.' AND type = 1'
.' ORDER BY id';
$db->setQuery($q);
$idExists = $db->loadResult();
if ((int)$idExists > 0) {
$query = 'UPDATE #__phocacart_reward_points SET'
.' published = '.(int)$published
.' WHERE id = '.(int)$idExists;
$db->setQuery($query);
$db->execute();
}
}
// DOWNLOAD
if (isset($status['download'])) {
PhocacartDownload::setStatusByOrder((int)$orderId,
(int)$status['download']);
}
// PDF Feature
$pdfV = self::handlePDFExtensions($orderId);
$attachmentContent = '';
$attachmentName = '';
// ------------------------
// BUILD EMAIL for customer or others
// ------------------------
// Set language of order for the customer
$pLang = new PhocacartLanguage();
if (($recipient != '' &&
JMailHelper::isEmailAddress($recipient)) || ($recipientOthers !=
'' && JMailHelper::isEmailAddress($recipientOthers))) {
$sitename = $config->get('sitename');
//if ($status['email_text'] != '') {
// EMAIL CUSTOMER
$emptyBody = 0;
if ($status['email_text'] == '') {
$emptyBody = 1;
}
$body = $status['email_text'];
// EMAIL OTHERS
$emptyBodyOthers = 0;
if ($status['email_text_others'] == '') {
$emptyBodyOthers = 1;
}
$bodyOthers = $status['email_text_others'];
// REPLACE
$r = PhocacartText::prepareReplaceText($order, $orderId, $common, $bas);
$r['email'] = $recipient;// Overwrites the $r
$r['email_others'] = $recipientOthers;
$r['name_others'] = '';
// EMAIL CUSTOMER
if ($status['email_subject'] != '') {
$emailSubject =
PhocacartText::completeText($status['email_subject'], $r, 1);
$subject = $emailSubject;// .' ' .
JText::_('COM_PHOCACART_ORDER_NR'). ':
'.$r['ordernumber'];
} else if ($status['title'] != '') {
$subject = $sitename . ' - ' . $status['title'] .
' ' . JText::_('COM_PHOCACART_ORDER_NR') . ':
' . $r['ordernumber'];
}
// EMAIL OTHERS
if ($status['email_subject_others'] != '') {
$emailSubjectO =
PhocacartText::completeText($status['email_subject_others'], $r,
2);
$subjectOthers = $emailSubjectO;// .' ' .
JText::_('COM_PHOCACART_ORDER_NR'). ':
'.$r['ordernumber'];
} else if ($status['title'] != '') {
$subjectOthers = $sitename . ' - ' .
$status['title'] . ' ' .
JText::_('COM_PHOCACART_ORDER_NR') . ': ' .
$r['ordernumber'];
}
if (!isset($bas['b'])) {
$bas['b'] = array();
}
if (!isset($bas['s'])) {
$bas['s'] = array();
}
// COMPLETE BODY
$body = PhocacartText::completeText($body, $r, 1);
$bodyOthers = PhocacartText::completeText($bodyOthers, $r, 2);
//$body = PhocacartText::completeTextFormFields($body,
$bas['b'], 1);
//$bodyOthers = PhocacartText::completeTextFormFields($bodyOthers,
$bas['b'], 1);
//$body = PhocacartText::completeTextFormFields($body,
$bas['s'], 2);
//$bodyOthers = PhocacartText::completeTextFormFields($bodyOthers,
$bas['s'], 2);
$body = PhocacartText::completeTextFormFields($body,
$bas['b'], $bas['s']);
$bodyOthers = PhocacartText::completeTextFormFields($bodyOthers,
$bas['b'], $bas['s']);
// All - users or others get the documents in user language - to save
the memory when creating e.g. PDF documents. Even it is better that others
see
// which language version the customer got
$pLang->setLanguage($common->user_lang);
switch ($emailSendV) {
case 1:
$orderRender = new PhocacartOrderRender();
if ($emailSendFormatV == 0 || $emailSendFormatV == 2) {
$body .= "<br><br>";
$body .= $orderRender->render($orderId, 1, 'mail',
$orderToken);
$bodyOthers .= "<br><br>";
$bodyOthers .= $orderRender->render($orderId, 1, 'mail',
$orderToken);
}
if ($pdfV['pdf'] == 1 && ($emailSendFormatV == 1 ||
$emailSendFormatV == 2)) {
$staticData = array();
//$orderNumber = PhocacartOrder::getOrderNumber($orderId,
$common->date);
$orderNumber = PhocacartOrder::getOrderNumber($orderId,
$common->date, $common->order_number);
$staticData['option'] = 'com_phocacart';
$staticData['title'] =
JText::_('COM_PHOCACART_ORDER_NR') . ': ' .
$orderNumber;
$staticData['file'] = '';// Must be empty to
not save the pdf to server
$staticData['filename'] =
strip_tags(JText::_('COM_PHOCACART_ORDER') . '_' .
$orderNumber) . '.pdf';
$staticData['subject'] = '';
$staticData['keywords'] = '';
$staticData['output'] = $orderRender->render($orderId,
1, 'pdf', $orderToken);
$staticData['pdf_destination'] = 'S';
$attachmentContent = PhocaPDFRender::renderPDF('',
$staticData);
$attachmentName = $staticData['filename'];
}
break;
case 2:
$orderRender = new PhocacartOrderRender();
$invoiceNumber = PhocacartOrder::getInvoiceNumber($orderId,
$common->date, $common->invoice_number);
// If invoice is not created yet, it cannot be sent
if ($invoiceNumber == '') {
PhocacartLog::add(3, 'Status changed - sending email: The
invoice should have been attached to the email, but it doesn not exist yet.
Check order status settings and billing settings.', $orderId,
'Order ID: ' . $orderId . ', Status ID: ' . $statusId);
} else {
if ($emailSendFormatV == 0 || $emailSendFormatV == 2) {
$body .= "<br><br>";
$body .= $orderRender->render($orderId, 2, 'mail',
$orderToken);
$bodyOthers .= "<br><br>";
$bodyOthers .= $orderRender->render($orderId, 2,
'mail', $orderToken);
}
if ($pdfV['pdf'] == 1 && ($emailSendFormatV == 1 ||
$emailSendFormatV == 2)) {
$staticData = array();
$staticData['option'] = 'com_phocacart';
$staticData['title'] =
JText::_('COM_PHOCACART_INVOICE_NR') . ': ' .
$invoiceNumber;
$staticData['file'] = '';// Must be empty to
not save the pdf to server
$staticData['filename'] =
strip_tags(JText::_('COM_PHOCACART_INVOICE') . '_' .
$invoiceNumber) . '.pdf';
$staticData['subject'] = '';
$staticData['keywords'] = '';
$staticData['output'] =
$orderRender->render($orderId, 2, 'pdf', $orderToken);
$staticData['pdf_destination'] = 'S';
$attachmentContent = PhocaPDFRender::renderPDF('',
$staticData);
$attachmentName = $staticData['filename'];
}
}
break;
case 3:
$orderRender = new PhocacartOrderRender();
if ($emailSendFormatV == 0 || $emailSendFormatV == 2) {
$body .= "<br><br>";
$body .= $orderRender->render($orderId, 3, 'mail',
$orderToken);
$bodyOthers .= "<br><br>";
$bodyOthers .= $orderRender->render($orderId, 3, 'mail',
$orderToken);
}
if ($pdfV['pdf'] == 1 && ($emailSendFormatV == 1 ||
$emailSendFormatV == 2)) {
$staticData = array();
//$orderNumber = PhocacartOrder::getOrderNumber($orderId);
$orderNumber = PhocacartOrder::getOrderNumber($orderId,
$common->date, $common->order_number);
$staticData['option'] = 'com_phocacart';
$staticData['title'] =
JText::_('COM_PHOCACART_ORDER_NR') . ': ' .
$orderNumber;
$staticData['file'] = '';// Must be empty to
not save the pdf to server
$staticData['filename'] =
strip_tags(JText::_('COM_PHOCACART_ORDER') . '_' .
$orderNumber) . '.pdf';
$staticData['subject'] = '';
$staticData['keywords'] = '';
$staticData['output'] = $orderRender->render($orderId,
3, 'pdf', $orderToken);
$staticData['pdf_destination'] = 'S';
$attachmentContent = PhocaPDFRender::renderPDF('',
$staticData);
$attachmentName = $staticData['filename'];
}
break;
}
// Email Footer
$body .= '<br><br>' .
PhocacartText::completeText($status['email_footer'], $r, 1);
$pLang->setLanguageBack();
// CUSTOMER
self::handleLangPlugin($pLang, $common, $subject);
self::handleLangPlugin($pLang, $common, $body);
// OTHERS
self::handleLangPluginOthers($subjectOthers);
self::handleLangPluginOthers($bodyOthers);
//}
// if $emptyBody is empty (1) then it means, that there is not custom
text
// so we can paste the order status message
// it does not mean, the body is empty, it can be filled with invoice,
order or delivery note
// so this means:
// body (empty) + invoice/receipt/delivery note --> add status
message
// body (custom text) + invoice/receipt/delivery --> don't add
status message
// body (empty) --> add status message
// body (custom text) --> don't add status message
/*if ($body == '') {
$body = JText::_('COM_PHOCACART_ORDER_NR'). ':
'.$orderNumber .' - '.
JText::_('COM_PHOCACART_ORDER_STATUS_CHANGED_TO') . ':
'.$status['title'];
}*/
$notify = 0;
// ---------
// CUSTOMERS
if ($recipient != '' &&
JMailHelper::isEmailAddress($recipient)) {
if ($emptyBody == 1) {
$body = JText::_('COM_PHOCACART_ORDER_NR') . ': '
. $orderNumber . ' - ' .
JText::_('COM_PHOCACART_ORDER_STATUS_CHANGED_TO') . ':
' . $status['title'] . '<br>' . $body;
}
// Notify
// 1 ... sent
// 0 ... not sent
// -1 ... not sent (error)
// Additional attachments
$attachment = null;
if (isset($status['email_attachments']) &&
!empty($status['email_attachments'])) {
$attachmentA = json_decode($status['email_attachments'],
true);
if (!empty($attachmentA)) {
$attachment = array();
$pathAttachment = PhocacartPath::getPath('attachmentfile');
foreach ($attachmentA as $k => $v) {
if (isset($v['file_attachment']) &&
$v['file_attachment'] != '') {
$pathAttachmentFile = $pathAttachment['orig_abs_ds'] .
$v['file_attachment'];
if (Joomla\CMS\Filesystem\File::exists($pathAttachmentFile)) {
$attachment[] = $pathAttachmentFile;
}
}
}
}
}
$notify = PhocacartEmail::sendEmail('', '',
$recipient, $subject, $body, true, null, null, $attachment,
$attachmentContent, $attachmentName);
}
// ------
// OTHERS
if ($recipientOthers != '' &&
JMailHelper::isEmailAddress($recipientOthers)) {
if ($emptyBodyOthers == 1) {
$bodyOthers = JText::_('COM_PHOCACART_ORDER_NR') . ':
' . $orderNumber . ' - ' .
JText::_('COM_PHOCACART_ORDER_STATUS_CHANGED_TO') . ':
' . $status['title'] . '<br>' . $bodyOthers;
}
$attachment = null;
$notifyOthers = PhocacartEmail::sendEmail('', '',
$recipientOthers, $subjectOthers, $bodyOthers, true, null, $bcc,
$attachment, $attachmentContent, $attachmentName);
}
}
// ------------------------
// BUILD EMAIL for GIFT buyer and GIFT recipients
// ------------------------
$layoutG = new JLayoutFile('gift_voucher', null,
array('component' => 'com_phocacart',
'client' => 0));
$bodyRecipient = array();// body for all recipients - each recipient
has own body
$attachmentRecipient = array();// attachment for all recipients - each
recipient has own attachment (for example PDF with generaded coupons)
$buyerBody = ''; // buyer of gift coupons has another body
$attachmentBuyer = ''; // buyer of gift coupons gets all
coupons - not like recipients - recipients only get own coupons
// Set language of order for the customer
$pLang = new PhocacartLanguage();
$price = new PhocacartPrice();
$gifts = array();
$activateGifts = array();
if ((int)$status['email_gift'] > 0 ||
(isset($status['activate_gift']) &&
$status['activate_gift'] == 1)) {
// Get all Gifts stored for this order
if (isset($common->id) && (int)$common->id > 0) {
$gifts = PhocacartCoupon::getGiftsByOrderId($common->id);
// Do we have activate the gift coupons?
if ($status['activate_gift'] == 1) {
PhocaCartCoupon::activateAllGiftsByOrderId($common->id);
}
foreach($gifts as $k => $v) {
// 2) Do we have some recipients?
// One order can include more gifts
// And one order can include more recipients - e.g. two gifts for
different users will be bought in one order
if (($status['email_gift'] == 2 ||
$status['email_gift'] == 3) &&
isset($v['gift_recipient_email']) &&
JMailHelper::isEmailAddress($v['gift_recipient_email'])){
$recipientUnique = $v['gift_recipient_email'];
$recipientsEmails[$recipientUnique] = $recipientUnique;
}
}
}
}
// Can we send the email to buyer email
if (!empty($gifts) && ($status['email_gift'] == 1 ||
$status['email_gift'] == 3)) {
$canSend = self::canSendEmail($orderToken, $common);
// Payment method returns status
if ($canSend == 0) {
PhocacartLog::add(2, 'Order Status - Notify - ERROR',
(int)$orderId, JText::_('COM_PHOCACART_NO_USER_ORDER_FOUND') .
' ' . JText::_('COM_PHOCACART_GIFT_VOUCHER') );
} else {
$buyerEmail = self::getRecipient($bas);
if (!JMailHelper::isEmailAddress($buyerEmail)) {
$buyerEmail = '';
}
}
}
$giftVoucherText = JText::_('COM_PHOCACART_GIFT_VOUCHER');
// Build email or paste gift vouchers - do them when at least one should
get the email with gift voucher
if (!empty($gifts) && ($buyerEmail != ''||
!empty($recipientsEmails))) {
// Part for buyer only
if ($buyerEmail != '') {
$sitename = $config->get('sitename');
$buyerEmptyBody = 0;
if ($status['email_text_gift_sender'] == '') {
$buyerEmptyBody = 1;
}
$buyerBody = $status['email_text_gift_sender'];
$r = PhocacartText::prepareReplaceText($order, $orderId,
$common, $bas);
$r['email'] = $buyerEmail;// Overwrites the $r
if (count($gifts) > 1) {
$giftVoucherText = JText::_('COM_PHOCACART_GIFT_VOUCHERS');
}
if ($status['email_subject_gift_sender'] != '') {
$buyerSubject =
PhocacartText::completeText($status['email_subject_gift_sender'],
$r, 1);
} else if ($status['title'] != '') {
$buyerSubject = $sitename . ' - ' .
$status['title'] . ' ' .
JText::_('COM_PHOCACART_ORDER_NR') . ': ' .
$r['ordernumber'] . ' - ' . $giftVoucherText;
}
if (!isset($bas['b'])) {
$bas['b'] = array();
}
if (!isset($bas['s'])) {
$bas['s'] = array();
}
$buyerBody = PhocacartText::completeText($buyerBody, $r, 1);
$buyerBody = PhocacartText::completeTextFormFields($buyerBody,
$bas['b'], $bas['s']);
// All - users or others get the documents in user language - to save
the memory when creating e.g. PDF documents. Even it is better that others
see
// which language version the customer got
$pLang->setLanguage($common->user_lang);
}
// Prepare PDF
if ($pdfV['pdf'] == 1 &&
($status['email_gift_format'] == 1 ||
$status['email_gift_format'] == 2)) {
$staticData = array();
//$orderNumber = PhocacartOrder::getOrderNumber($orderId,
$common->date);
$orderNumber = PhocacartOrder::getOrderNumber($orderId,
$common->date, $common->order_number);
$staticData['option'] = 'com_phocacart';
$staticData['title'] =
JText::_('COM_PHOCACART_ORDER_NR') . ': ' .
$orderNumber . ' - ' . $giftVoucherText;
$staticData['file'] = '';// Must be empty to
not save the pdf to server
$staticData['filename'] = strip_tags($giftVoucherText .
'_' . $orderNumber) . '.pdf';
$staticData['subject'] = '';
$staticData['keywords'] = '';
$staticData['output'] = '';
// Initialize PDF for buyer which gets all the coupons
// we need to initilaize PDF here because we need tcpdf classed in
template output
$pdf = new stdClass();
$content = new stdClass();
$document = new stdClass();
PhocaPDFRender::initializePDF($pdf, $content, $document, $staticData);
}
// Start to prepare gift vouchers (HTML or PDF) based on recipients
foreach ($gifts as $k => $v) {
$recipientUnique = $v['gift_recipient_email'];
// Gift voucher rendered to mail: create body for buyer but even for
all gift voucher recipients
if ($status['email_gift_format'] == 0 ||
$status['email_gift_format'] == 2) {
$d = $v;
$d['typeview'] = 'Order';
$d['product_id'] = $v['gift_product_id'];
$d['discount'] =
$price->getPriceFormat($v['discount']);
$d['valid_from'] = JHtml::date($v['valid_from'],
JText::_('DATE_FORMAT_LC3'));
$d['valid_to'] = JHtml::date($v['valid_to'],
JText::_('DATE_FORMAT_LC3'));
$d['format'] = 'mail';
$layputOutput = $layoutG->render($d);
// Render each coupon to buyer body
$buyerBody .= $layputOutput;;
$buyerBody .= '<div> </div>';
// Render each coupon to each recipient body
if (!isset($bodyRecipient[$recipientUnique])) {
$bodyRecipient[$recipientUnique] = array();//
Each recipient will have own body
$bodyRecipient[$recipientUnique]['body_initialized'] =
true;
$bodyRecipient[$recipientUnique]['data'] = $v;
$bodyRecipient[$recipientUnique]['output'] =
'';
}
if
(isset($bodyRecipient[$recipientUnique]['body_initialized'])
&& $bodyRecipient[$recipientUnique]['body_initialized'])
{
$bodyRecipient[$recipientUnique]['output'] .=
$layputOutput;
$bodyRecipient[$recipientUnique]['output'] .=
'<div> </div>';
}
} else {
// We don't send the voucher in email body but e.g. only as PDF
so we still need to initiate mail body for recipient
if (!isset($bodyRecipient[$recipientUnique])) {
$bodyRecipient[$recipientUnique] = array();//
Each recipient will have own body
$bodyRecipient[$recipientUnique]['body_initialized'] =
true;
$bodyRecipient[$recipientUnique]['data'] = $v;
$bodyRecipient[$recipientUnique]['output'] =
'';
}
}
if ($pdfV['pdf'] == 1 &&
($status['email_gift_format'] == 1 ||
$status['email_gift_format'] == 2)) {
$d = $v;
$d['typeview'] = 'Order';
$d['product_id'] = $v['gift_product_id'];
$d['discount'] =
$price->getPriceFormat($v['discount']);
$d['valid_from'] = JHtml::date($v['valid_from'],
JText::_('DATE_FORMAT_LC3'));
$d['valid_to'] = JHtml::date($v['valid_to'],
JText::_('DATE_FORMAT_LC3'));
$d['format'] = 'pdf';
// Render each coupon to buyer PDF
$d['pdf_instance'] = $pdf;// we need tcpdf instance in
output to use different tcpdf functions
$attachmentBuyer .= $layoutG->render($d);
// Because of token in tcpdf, each recipient needs own tcpdf instance
// Initialize PDF for each recipient
// we need to initilaize PDF here because we need tcpdf classed in
template output
if
(!isset($attachmentRecipient[$recipientUnique]['pdf_initialized']))
{
$attachmentRecipient[$recipientUnique] = array();
$attachmentRecipient[$recipientUnique]['pdf_initialized'] =
true;
$attachmentRecipient[$recipientUnique]['pdf'] =
new stdClass();
$attachmentRecipient[$recipientUnique]['content'] =
new stdClass();
$attachmentRecipient[$recipientUnique]['document'] =
new stdClass();
$attachmentRecipient[$recipientUnique]['count'] =
0;
$attachmentRecipient[$recipientUnique]['output'] =
'';
PhocaPDFRender::initializePDF($attachmentRecipient[$recipientUnique]['pdf'],
$attachmentRecipient[$recipientUnique]['content'],
$attachmentRecipient[$recipientUnique]['document'], $staticData);
}
if
(isset($attachmentRecipient[$recipientUnique]['pdf_initialized'])
&&
$attachmentRecipient[$recipientUnique]['pdf_initialized']) {
$d['pdf_instance'] =
$attachmentRecipient[$recipientUnique]['pdf'];// we need tcpdf
instance in output to use different tcpdf functions
$attachmentRecipient[$recipientUnique]['output'] .=
$layoutG->render($d);
$attachmentRecipient[$recipientUnique]['count']++;
}
}
}
// Send mail to buyer
if ($buyerEmail != '' && $attachmentBuyer !=
'') {
$staticData['pdf_destination'] = 'S';
$staticData['output'] = $attachmentBuyer;
$buyerAttachmentContent =
PhocaPDFRender::renderInitializedPDF($pdf, $content, $document,
$staticData);
$buyerAttachmentName = $staticData['filename'];
$pLang->setLanguageBack();
// CUSTOMER
self::handleLangPlugin($pLang, $common, $buyerSubject);
self::handleLangPlugin($pLang, $common, $buyerBody);
if ($buyerEmptyBody == 1) {
$buyerBody = JText::_('COM_PHOCACART_ORDER_NR') . ':
' . $orderNumber . ' - ' . $giftVoucherText .
'<br>' . $buyerBody;
}
$attachment = null;
$notifyGift = PhocacartEmail::sendEmail('', '',
$buyerEmail, $buyerSubject, $buyerBody, true, null, null, $attachment,
$buyerAttachmentContent, $buyerAttachmentName);
if ($notifyGift) {
} else {
PhocacartLog::add(2, 'Order Status - Notify - ERROR - Gift
voucher not sent', (int)$orderId, 'Email with gift voucher not
sent to buyer (' . $buyerEmail . ')');
}
}
// Send mail to all recipients
if (!empty($recipientsEmails)) {
foreach ($recipientsEmails as $k => $v) {
if (isset($bodyRecipient[$k]['output']) /*&&
$bodyRecipient[$k]['output'] != '' - body (built by
voucher) can be empty if we set the voucher in PDF only*/) {
$sitename = $config->get('sitename');
$recipientEmptyBody = 0;
if ($status['email_text_gift_recipient'] == '') {
$recipientEmptyBody = 1;
}
$recipientBody = $status['email_text_gift_recipient'];
$r =
PhocacartText::prepareReplaceText($order, $orderId, $common, $bas);
$r['email_gift_recipient'] = $v;// Overwrites the $r
$r['name_gift_recipient'] =
isset($bodyRecipient[$k]['data']['gift_recipient_name'])
? $bodyRecipient[$k]['data']['gift_recipient_name'] :
'';
$r['name_gift_sender'] =
isset($bodyRecipient[$k]['data']['gift_sender_name']) ?
$bodyRecipient[$k]['data']['gift_sender_name'] :
'';
$r['valid_to_gift'] =
isset($bodyRecipient[$k]['data']['valid_to']) ?
JHtml::date($bodyRecipient[$k]['data']['valid_to'],
JText::_('DATE_FORMAT_LC1')) : '';
if (isset($attachmentRecipient[$k]['count']) &&
(int)$attachmentRecipient[$k]['count'] > 1) {
$giftVoucherText =
JText::_('COM_PHOCACART_GIFT_VOUCHERS');
}
if ($status['email_subject_gift_recipient'] !=
'') {
$recipientSubject =
PhocacartText::completeText($status['email_subject_gift_recipient'],
$r, 3);
} else if ($status['title'] != '') {
$recipientSubject = $sitename . ' - ' .
$status['title'] . ' ' .
JText::_('COM_PHOCACART_ORDER_NR') . ': ' .
$r['ordernumber'] . ' - ' . $giftVoucherText;
}
if (!isset($bas['b'])) {
$bas['b'] = array();
}
if (!isset($bas['s'])) {
$bas['s'] = array();
}
if (isset($bodyRecipient[$k]['output']) /*&&
$bodyRecipient[$k]['output'] != ''*/) {
$recipeintBody = $recipientBody .
$bodyRecipient[$k]['output'];
$recipientBody = PhocacartText::completeText($recipientBody, $r, 3);
$recipientBody =
PhocacartText::completeTextFormFields($recipientBody, $bas['b'],
$bas['s']);
}
$recipientAttachmentContent = '';
$recipientAttachmentName = '';
if (isset($attachmentRecipient[$k]['output']) &&
$attachmentRecipient[$k]['output'] != '' &&
isset($attachmentRecipient[$k]['pdf']) &&
$attachmentRecipient[$k]['content'] &&
$attachmentRecipient[$k]['document']) {
// Initialize new PDF for each recipient
$pdf = new stdClass();
$content = new stdClass();
$document = new stdClass();
$statidData['output'] = '';
PhocaPDFRender::initializePDF($pdf, $content, $document,
$staticData);
$staticData['pdf_destination'] = 'S';
$staticData['output'] =
$attachmentRecipient[$k]['output'];
$recipientAttachmentContent =
PhocaPDFRender::renderInitializedPDF($attachmentRecipient[$k]['pdf'],
$attachmentRecipient[$k]['content'],
$attachmentRecipient[$k]['document'], $staticData);
$recipientAttachmentName = $staticData['filename'];
}
$pLang->setLanguageBack();
// CUSTOMER
self::handleLangPlugin($pLang, $common, $recipientSubject);
self::handleLangPlugin($pLang, $common, $recipientBody);
if ($recipientEmptyBody == 1) {
$recipientBody = JText::_('COM_PHOCACART_ORDER_NR') .
': ' . $orderNumber . ' - ' . $giftVoucherText .
'<br>' . $recipientBody;
}
$attachment = null;
$notifyGift = PhocacartEmail::sendEmail('', '',
$v, $recipientSubject, $recipientBody, true, null, null, $attachment,
$recipientAttachmentContent, $recipientAttachmentName);
if ($notifyGift) {
} else {
PhocacartLog::add(2, 'Order Status - Notify - ERROR - Gift
voucher not sent', (int)$orderId, 'Email with gift voucher not
sent to recipient (' . $v . ')');
}
}
}
}
}
// --------------------------------
// BACK TO MAIN NOTIFY FUNCTION
// --------------------------------
if (($recipient != '' &&
JMailHelper::isEmailAddress($recipient)) || ($recipientOthers !=
'' && JMailHelper::isEmailAddress($recipientOthers))) {
// Notify is based only on customer email
if ($recipient != '' &&
JMailHelper::isEmailAddress($recipient)) {
if ($notify) {
if ($app->isClient('administrator')){
$app->enqueueMessage(JText::_('COM_PHOCACART_EMAIL_IF_NO_ERROR_EMAIL_SENT'));
}
return $notify;// 1
} else {
return -1;
}
}
}
return false;// 0
}
/* Usually
* - order is saved - the status id in order table is set while saving
order (libraries/order/order.php)
* - status is changed in administration - the status id in order table is
set while changing status (models/phocacarteditstatus.php)
* - BUT e.g. if payment method returns status, the status in order needs
to be changed - by this function
*
* method changeStatus - in fact check all possible conditions and cares
about notify (send email)
* method changeStatusInOrderTable - changes the status directly in order
table
*
* Mostly changeStatus is called when the status is changed in order table
(saving order, changing status)
* but sometimes e.g. when Payment method set the response, we need to
change the status with help of this function
* in order table as in fact when making payment response nothing happen
to order table - only status is changed
* Payment method runs both scripts: changeStatus - to send notify emails,
set stock, etc. and changeStatusInOrderTable to check the status in table
*/
public static function changeStatusInOrderTable($orderId, $statusId) {
$db = JFactory::getDBO();
$query = ' UPDATE #__phocacart_orders SET status_id =
'.(int)$statusId
.' WHERE id = '.(int)$orderId;
$db->setQuery($query);
$db->execute();
// Set invoice data in case status can set invoice ID
PhocacartOrder::storeOrderReceiptInvoiceId((int)$orderId, false,
(int)$statusId, array('I'));
return true;
}
public static function setHistory($id, $statusId, $notify, $comment) {
$db = JFactory::getDBO();
//$user = PhocacartUser::getUser();
$user = JFactory::getUser();// Logged in user, does not matter if
customer|vendor|admin
$userId = 0;
if (isset($user->id) && (int)$user->id > 0) {
$userId = (int)$user->id;
}
$date = JFactory::getDate()->toSql();
$valuesString = '('.(int)$id.',
'.(int)$statusId.', '.(int)$notify.',
'.$db->quote($comment).', '.$db->quote($date).',
'.(int)$userId.')';
$query = ' INSERT INTO #__phocacart_order_history (order_id,
order_status_id, notify, comment, date, user_id)'
.' VALUES '.(string)$valuesString;
$db->setQuery($query);
$db->execute();
return true;
}
public static function getEmailSendSelectBox($value) {
// see:
administrator/components/com_phocacart/models/forms/phocacartstatus.xml
$data = array(
0 => JText::_('COM_PHOCACART_NOTHING'),
1 => JText::_('COM_PHOCACART_ORDER'),
2 => JText::_('COM_PHOCACART_INVOICE'),
3 => JText::_('COM_PHOCACART_DELIVERY_NOTE')
);
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$data, 'jform[email_send]',
'class="inputbox"', 'value',
'text', $value, $data[$value] );
}
/*
public static function getEmailSendGiftSelectBox($value) {
// see:
administrator/components/com_phocacart/models/forms/phocacartstatus.xml
$data = array(
0 => JText::_('COM_PHOCACART_NO_ONE'),
1 => JText::_('COM_PHOCACART_YES_BUYER'),
2 => JText::_('COM_PHOCACART_YES_RECIPIENT'),
3 => JText::_('COM_PHOCACART_YES_BUYER_AND_RECIPIENT')
);
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$data, 'jform[email_gift]',
'class="inputbox"', 'value',
'text', $value, $data[$value] );
}
*/
public static function getEmailSendFormatSelectBox($value) {
// see:
administrator/components/com_phocacart/models/forms/phocacartstatus.xml
$data = array(
0 => JText::_('COM_PHOCACART_HTML'),
1 => JText::_('COM_PHOCACART_PDF'),
2 => JText::_('COM_PHOCACART_BOTH')
);
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$data, 'jform[email_send_format]',
'class="inputbox"', 'value',
'text', $value, $data[$value] );
}
public static function getStockMovementsSelectBox($value) {
// see:
administrator/components/com_phocacart/models/forms/phocacartstatus.xml
$data = array(
'=' => JText::_('COM_PHOCACART_ITEMS_UNCHANGED'),
'+' => JText::_('COM_PHOCACART_ITEMS_ADDED'),
'-' => JText::_('COM_PHOCACART_ITEMS_SUBTRACTED')
);
if ($value == 0 || $value == '') {
$value = '=';
}
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$data, 'jform[stock_movements]',
'class="inputbox"', 'value',
'text', $value, $data[$value] );
}
public static function getChangeUserGroupSelectBox($value) {
// see:
administrator/components/com_phocacart/models/forms/phocacartstatus.xml
$data = array(
'0' =>
JText::_('COM_PHOCACART_USER_GROUP_UNCHANGED'),
'1' =>
JText::_('COM_PHOCACART_USER_GROUP_CHANGED')
);
if ($value == '') {
$value = 0;
}
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$data, 'jform[change_user_group]',
'class="inputbox"', 'value',
'text', $value, $data[$value] );
}
public static function getChangeChangePointsNeededSelectBox($value) {
// see:
administrator/components/com_phocacart/models/forms/phocacartstatus.xml
$data = array(
'0' =>
JText::_('COM_PHOCACART_REWARD_POINTS_UNCHANGED'),
'1' =>
JText::_('COM_PHOCACART_REWARD_POINTS_CHANGED_CHANGE_APPROVED'),
'2' =>
JText::_('COM_PHOCACART_REWARD_POINTS_CHANGED_CHANGE_NOT_APPROVED')
);
if ($value == '') {
$value = 0;
}
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$data, 'jform[change_points_needed]',
'class="inputbox"', 'value',
'text', $value, $data[$value] );
}
public static function getChangePointsReceivedSelectBox($value) {
// see:
administrator/components/com_phocacart/models/forms/phocacartstatus.xml
$data = array(
'0' =>
JText::_('COM_PHOCACART_REWARD_POINTS_UNCHANGED'),
'1' =>
JText::_('COM_PHOCACART_REWARD_POINTS_CHANGED_CHANGE_APPROVED'),
'2' =>
JText::_('COM_PHOCACART_REWARD_POINTS_CHANGED_CHANGE_NOT_APPROVED')
);
if ($value == '') {
$value = 0;
}
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$data, 'jform[change_points_received]',
'class="inputbox"', 'value',
'text', $value, $data[$value] );
}
public static function getOrderStatuses() {
$db = JFactory::getDBO();
$query = 'SELECT a.title AS text, a.id AS value'
. ' FROM #__phocacart_order_statuses AS a'
. ' WHERE a.published = 1'
. ' ORDER BY a.ordering';
$db->setQuery( $query );
$data = $db->loadObjectList();
if (!empty($data)) {
foreach ($data as $k => $v) {
$v->text = JText::_($v->text);
}
}
return $data;
}
public static function canSendEmail($orderToken, $common) {
$app = JFactory::getApplication();
if (!$app->isClient('administrator')) {
// Frontend
// Check if we can send email to customer
$canSend = 0;
$user = PhocacartUser::getUser();
$guest = PhocacartUserGuestuser::getGuestUser();
// $orderToken is set in case we will not check the user:
// - in case of guest users
// - in case of payment method server contacts the server to change the
status
if ($orderToken != '' && $orderToken ==
$common->order_token && $guest) {
$canSend = 1;// User is guest - not logged in user run this script
//PhocacartLog::add(4, 'CHECK', (int)$orderId, 'Guest
User');
} else if ($orderToken != '' && $orderToken ==
$common->order_token) {
$canSend = 1;// Payment method server returned status which will change
order status - payment method runs this script
//PhocacartLog::add(4, 'CHECK', (int)$orderId, 'Payment
method');
} else if ($user->id == $common->user_id) {
$canSend = 1;// User is the customer who made the order
//PhocacartLog::add(4, 'CHECK', (int)$orderId,
'Registered User');
}
} else {
// Backend
$canSend = 1;
}
return $canSend;
}
public static function getRecipient($bas) {
if (isset($bas['b']['email_contact']) &&
$bas['b']['email_contact'] != '' &&
JMailHelper::isEmailAddress($bas['b']['email_contact']))
{
$recipient = $bas['b']['email_contact'];
} else if (isset($bas['b']['email']) &&
$bas['b']['email'] != '' &&
JMailHelper::isEmailAddress($bas['b']['email'])) {
$recipient = $bas['b']['email'];
} else if (isset($bas['s']['email_contact'])
&& $bas['s']['email_contact'] != ''
&&
JMailHelper::isEmailAddress($bas['s']['email_contact']))
{
$recipient = $bas['s']['email_contact'];
} else if (isset($bas['s']['email']) &&
$bas['s']['email'] != '' &&
JMailHelper::isEmailAddress($bas['s']['email'])) {
$recipient = $bas['s']['email'];
}
return $recipient;
}
public static function handlePDFExtensions($orderId) {
$pdfV = array();
$pdfV['plugin-pdf'] =
PhocacartUtilsExtension::getExtensionInfo('phocacart',
'plugin', 'phocapdf');
$pdfV['component-pdf'] =
PhocacartUtilsExtension::getExtensionInfo('com_phocapdf');
$pdfV['pdf'] = 0;
if ($pdfV['plugin-pdf'] == 1 &&
$pdfV['component-pdf'] == 1) {
if (JFile::exists(JPATH_ADMINISTRATOR .
'/components/com_phocapdf/helpers/phocapdfrender.php')) {
require_once(JPATH_ADMINISTRATOR .
'/components/com_phocapdf/helpers/phocapdfrender.php');
} else {
PhocacartLog::add(2, 'Order Status - Notify - ERROR (PDF
Class)', (int)$orderId, 'Render PDF file could not be found in
system');
throw new Exception('Error - Phoca PDF Helper - Render PDF file
could not be found in system', 500);
return false;
}
$pdfV['pdf'] = 1;
}
return $pdfV;
}
public static function handleLangPlugin($pLang, $common, &$object) {
JPluginHelper::importPlugin('system');
JPluginHelper::importPlugin('plgSystemMultilanguagesck');
// CUSTOMER
if (isset($common->user_lang) && $common->user_lang !=
'' && $common->user_lang != '*') {
$pLang->setLanguage($common->user_lang);
\JFactory::getApplication()->triggerEvent('onChangeText',
array(&$object));
// Set language back to default
$pLang->setLanguageBack();
} else {
JFactory::getApplication()->triggerEvent('onChangeText',
array(&$object));
}
}
public static function handleLangPluginOthers(&$object) {
JPluginHelper::importPlugin( 'system' );
JPluginHelper::importPlugin('plgSystemMultilanguagesck');
JFactory::getApplication()->triggerEvent('onChangeText',
array(&$object));
}
}
?>
PK�"�[&��B�5�5"libraries/phocacart/order/view.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartOrderView
{
public function __construct() {}
public function getItemBaS($orderId, $returnArray = 0) {
/*$db = JFactory::getDBO();
$config['dbo'] = $db;
JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR .
'/tables');
$table = JTable::getInstance('PhocacartOrderUsers',
'Table', $config);
$tableS = JTable::getInstance('PhocacartOrderUsers',
'Table', $config);*/
// Billing and Shipping
$userItems = $this->getItemUser($orderId);
// Billing
/*if(isset($orderId) && (int)$orderId > 0) {
$return = $table->load(array('order_id' =>
(int)$orderId, 'type' => 0));
if ($return === false && $table->getError()) {
throw new Exception($table->getErrorMsg());
return false;
}
}
// Shipping
if(isset($orderId) && (int)$orderId > 0) {
$returnS = $tableS->load(array('order_id' =>
(int)$orderId, 'type' => 1));
if ($returnS === false && $tableS->getError()) {
throw new Exception($tableS->getErrorMsg());
return false;
}
}*/
// Convert to the JObject before adding other data.
$properties = array();
if (isset($userItems[0]['type']) &&
$userItems[0]['type'] == 0) {
$properties['b'] = $userItems[0];
}
if (isset($userItems[1]['type']) &&
$userItems[1]['type'] == 1) {
$properties['s'] = $userItems[1];
}
/*$properties['b'] = $table->getProperties(1);
$properties['s'] = $tableS->getProperties(1);
*/
/*if ($returnArray == 1) {
$region =
$this->getRegion($properties['b']['country'],
$properties['b']['region'] );
$properties['b']['countrytitle'] =
$region['countrytitle'];
$properties['b']['regiontitle'] =
$region['regiontitle'];
$region =
$this->getRegion($properties['s']['country'],
$properties['s']['region'] );
$properties['s']['countrytitle'] =
$region['countrytitle'];
$properties['s']['regiontitle'] =
$region['regiontitle'];
return $properties;
}*/
if ($returnArray == 1) {
return $properties;
}
//$itemS = \Joomla\Utilities\ArrayHelper::toObject($propertiesS,
'JObject');
//$item = \Joomla\Utilities\ArrayHelper::toObject($properties,
'JObject');
$item = new JObject();//stdClass();
if(!empty($properties['b']) && is_object($item)) {
foreach($properties['b'] as $k => $v) {
$newName = $k . '_phb';
$item->$newName = $v;
}
}
//Add shipping data to billing and do both data package
if(!empty($properties['s']) && is_object($item)) {
foreach($properties['s'] as $k => $v) {
$newName = $k . '_phs';
$item->$newName = $v;
}
}
return $item;
}
/*public function getRegion($countryId, $regionId) {
$db = JFactory::getDBO();
$query = 'SELECT u.id, c.title AS countrytitle, r.title AS
regiontitle'
.' FROM #__phocacart_order_users AS u'
.' LEFT JOIN #__phocacart_countries AS c ON c.id = u.country'
.' LEFT JOIN #__phocacart_regions AS r ON r.id = u.region'
.' WHERE u.country = '.(int)$countryId. ' AND
u.region = '.(int)$regionId;
$db->setQuery($query);
$region = $db->loadAssoc();
return $region;
}*/
public function getItemUser($orderId) {
$db = JFactory::getDBO();
$query = 'SELECT u.*,'
.' c.title AS countrytitle, r.title AS regiontitle, c.code2 AS
countrycode'
.' FROM #__phocacart_order_users AS u'
.' LEFT JOIN #__phocacart_countries AS c ON c.id = u.country'
.' LEFT JOIN #__phocacart_regions AS r ON r.id = u.region'
.' WHERE u.order_id = '.(int)$orderId. ' AND (u.type
= 1 OR u.type = 0)'
.' ORDER BY u.id'
.' LIMIT 0,2';
$db->setQuery($query);
$userList = $db->loadAssocList();
return $userList;
}
public function getItemCommon($orderId) {
$db = JFactory::getDBO();
$query = 'SELECT o.*,'
.' u.id AS user_id, o.vendor_id AS vendor_id, u.name AS user_name,
u.username AS user_username, p.title AS paymenttitle,'
.' s.title AS shippingtitle, s.tracking_link as
shippingtrackinglink, s.tracking_description as
shippingtrackingdescription,'
.' c.title AS coupontitle, cu.title AS currencytitle, d.title AS
discounttitle, os.orders_view_display as ordersviewdisplay,'
.' uv.username as vendor_username, uv.name as vendor_name,'
.' sc.title as section_name, un.title as unit_name'
.' FROM #__phocacart_orders AS o'
.' LEFT JOIN #__users AS u ON u.id = o.user_id'
.' LEFT JOIN #__users AS uv ON uv.id = o.user_id'
.' LEFT JOIN #__phocacart_order_statuses AS os ON os.id =
o.status_id'
.' LEFT JOIN #__phocacart_payment_methods AS p ON p.id =
o.payment_id'
.' LEFT JOIN #__phocacart_shipping_methods AS s ON s.id =
o.shipping_id'
.' LEFT JOIN #__phocacart_coupons AS c ON c.id = o.coupon_id'
.' LEFT JOIN #__phocacart_discounts AS d ON d.id =
o.discount_id'
.' LEFT JOIN #__phocacart_currencies AS cu ON cu.id =
o.currency_id'
.' LEFT JOIN #__phocacart_sections AS sc ON sc.id =
o.section_id'
.' LEFT JOIN #__phocacart_units AS un ON un.id = o.unit_id'
.' WHERE o.id = '.(int)$orderId
.' ORDER BY o.id';
$db->setQuery($query);
$order = $db->loadObject();
return $order;
}
public function getItemProducts($orderId) {
$db = JFactory::getDBO();
//$query = 'SELECT DISTINCT p.*, pd.download_token,
pd.download_file, pd.download_folder, pd.published as download_published,
pd.type as download_type'
// .' FROM #__phocacart_orders AS o'
$query = 'SELECT DISTINCT p.*'
.' FROM #__phocacart_orders AS o'
.' LEFT JOIN #__phocacart_order_products AS p ON o.id =
p.order_id'
.' LEFT JOIN #__phocacart_products AS pr ON pr.id =
p.product_id'
// .' LEFT JOIN #__phocacart_order_downloads AS pd ON
pd.order_product_id = p.id'
.' WHERE o.id = '.(int)$orderId
.' ORDER BY p.id';
$db->setQuery($query);
$items = $db->loadObjectList();
// BE AWARE
// Product ID ... is an ID of product
// OrderProduct ID ... is an ID of ordered product
// There is one product ID but more ordered variants of one product
// PRODUCT 1 (Product ID = 1) can have different Attributes when ordered
// PRODUCT 1 with attribute 1 (OrderProduct ID = 1)
// PRODUCT 2 with attribute 2 (OrderProduct ID = 2)
// If you order one product but you will select it with different
attributes, you are ordering in fact more products
// derivated frome the one
if (!empty($items)) {
foreach ($items as $k => $v) {
$attributes = $this->getItemAttributes($orderId, $v->id);
if (!empty($attributes)) {
$v->attributes = array();
foreach($attributes as $k2 => $v2) {
if (isset($v2->id) && $v2->id > 0) {
$v->attributes[$k2] = $v2;
}
}
}
$downloads = $this->getItemDownloads($orderId, $v->id);
if (!empty($downloads)) {
$v->downloads = array();
foreach($downloads as $k2 => $v2) {
if (isset($v2->id) && $v2->id > 0) {
$v->downloads[$k2] = $v2;
}
}
}
}
}
return $items;
}
public function getItemDownloads($orderId, $orderProductId) {
$db = JFactory::getDBO();
// BE AWARE
// productid is ID of Product Ordered not of product
// productquantity is QUANTITY of Product Ordered not of product
// select all files except attributes as these are selected in attributes
$query = 'SELECT DISTINCT p.id AS productid,'
.' pd.id, pd.download_token, pd.download_file, pd.download_folder,
pd.published, pd.type'
.' FROM #__phocacart_order_products AS p'
.' LEFT JOIN #__phocacart_order_downloads AS pd ON p.id =
pd.order_product_id AND (pd.type = 0 OR pd.type = 1 or pd.type = 2)'
.' WHERE p.id = '.(int)$orderProductId . ' AND
p.order_id = '.(int)$orderId
.' ORDER BY p.id';
$db->setQuery($query);
$items = $db->loadObjectList();
return $items;
}
public function getItemAttributes($orderId, $orderProductId) {
$db = JFactory::getDBO();
// BE AWARE
// productid is ID of Product Ordered not of product
// productquantity is QUANTITY of Product Ordered not of product
//
// Product Ordered ID is different to product because one product can
have more Product Ordered IDs
// Product 1 with attribute A ... is Product Ordered 1
// Porduct 1 with attribute B ... is Product Ordered 2
// Product 2 with attribute A ... is Product Ordered 3
// (Product 1 is divided to two ordered products)
$query = 'SELECT DISTINCT p.id AS productid, p.quantity as
productquantity,'
.' a.id, a.attribute_id, a.attribute_title, a.option_id,
a.option_title, a.option_value, a.type, od.download_folder,
od.download_file, od.download_token, od.published AS
download_published'
.' FROM #__phocacart_order_products AS p'
.' LEFT JOIN #__phocacart_order_attributes AS a ON p.id =
a.order_product_id'
.' LEFT JOIN #__phocacart_order_downloads AS od ON p.id =
od.order_product_id AND a.option_id = od.option_id'
.' WHERE p.id = '.(int)$orderProductId . ' AND
p.order_id = '.(int)$orderId
.' ORDER BY p.id';
$db->setQuery($query);
$items = $db->loadObjectList();
return $items;
}
public function getItemProductDiscounts($orderId, $onlyPublished = 0) {
$db = JFactory::getDBO();
$q = 'SELECT d.*'
.' FROM #__phocacart_orders AS o'
.' LEFT JOIN #__phocacart_order_product_discounts AS d ON o.id =
d.order_id'
.' WHERE o.id = '.(int)$orderId;
if ($onlyPublished == 1) {
$q.= ' AND d.published = 1';
}
$q.= ' ORDER BY d.id';
$db->setQuery($q);
$items = $db->loadObjectList();
$itemsByKey = array();
if (!empty($items)) {
$oPD = array();
$iS = 4;// specific ordering - start from 3 because 0 - 2 is taken for
reward points, product discounts, cart discounts, coupon
foreach($items as $k => $v) {
// SPECIFIC CASE - BACKWARD COMPATIBILITY
// Ordering 5 (reward points) -> 2 (product discount) -> 3 (cart
discount) -> 4 (coupon)
if ($v->type == 5) {
$kS = 0;
} else if ($v->type == 2) {
$kS = 1;
} else if ($v->type == 3) {
$kS = 2;
} else if ($v->type == 4) {
$kS = 3;
} else {
$kS = $iS;
}
$itemsByKey[$v->product_id_key][$kS] = $v;
$iS++;
}
if (!empty($itemsByKey)) {
foreach($itemsByKey as $k => $v) {
ksort($itemsByKey[$k]);
}
}
}
return $itemsByKey;
//return $items;
}
public function getItemTotal($orderId, $onlyPublished = 0, $type =
'') {
$db = JFactory::getDBO();
$q = ' SELECT t.*'
.' FROM #__phocacart_orders AS o'
.' LEFT JOIN #__phocacart_order_total AS t ON o.id =
t.order_id'
.' WHERE o.id = '.(int)$orderId;
if ($onlyPublished == 1) {
$q.= ' AND t.published = 1';
}
if ($type != '') {
$q.= ' AND t.type = '.$db->quote($type);
}
$q.= ' ORDER BY t.ordering';
$db->setQuery($q);
$items = $db->loadObjectList();
return $items;
}
public function getItemTaxRecapitulation($orderId, $type = '') {
$db = JFactory::getDBO();
$q = ' SELECT t.*, o.currency_id AS currency_id,
o.currency_exchange_rate AS currency_exchange_rate'
.' FROM #__phocacart_orders AS o'
.' LEFT JOIN #__phocacart_order_tax_recapitulation AS t ON o.id =
t.order_id'
.' WHERE o.id = '.(int)$orderId;
if ($type != '') {
$q.= ' AND t.type = '.$db->quote($type);
}
$q.= ' ORDER BY t.ordering';
$db->setQuery($q);
$items = $db->loadObjectList();
return $items;
}
// Tracking
public static function getTrackingLink($common) {
$trackingLink = '';
if (isset($common->tracking_link_custom) &&
$common->tracking_link_custom != '') {
$trackingLink = '<a
href="'.$common->tracking_link_custom.'">'.$common->tracking_link_custom.'</a>';
} else if (isset($common->shippingtrackinglink) &&
$common->shippingtrackinglink != '' &&
isset($common->tracking_number) && $common->tracking_number
!= '') {
$trackingLink = '<a
href="'.$common->shippingtrackinglink .
$common->tracking_number.'">'.$common->shippingtrackinglink
. $common->tracking_number.'</a>';
}
return $trackingLink;
}
public static function getTrackingNumber($common) {
$trackingNumber = '';
if (isset($common->tracking_number) &&
$common->tracking_number != '') {
$trackingNumber = $common->tracking_number;
}
return $trackingNumber;
}
public static function getTrackingDescription($common) {
$trackingDescription = '';
if (isset($common->tracking_description_custom) &&
$common->tracking_description_custom != '') {
$trackingDescription = $common->tracking_description_custom;
} else if (isset($common->shippingtrackingdescription) &&
$common->shippingtrackingdescription != '') {
$trackingDescription = $common->shippingtrackingdescription;
}
return $trackingDescription;
}
public static function getShippingTitle($common) {
$shippingTitle = '';
if (isset($common->shippingtitle) && $common->shippingtitle
!= '') {
$shippingTitle = $common->shippingtitle;
}
return $shippingTitle;
}
public static function getPaymentTitle($common) {
$paymentTitle = '';
if (isset($common->paymenttitle) && $common->paymenttitle
!= '') {
$paymentTitle = $common->paymenttitle;
}
return $paymentTitle;
}
public static function getDateShipped($common) {
$dateShipped = '';
if (isset($common->tracking_date_shipped) &&
$common->tracking_date_shipped != '' &&
$common->tracking_date_shipped != '0000-00-00 00:00:00') {
$date = PhocacartUtils::date($common->tracking_date_shipped);
$dateShipped = $date;
}
return $dateShipped;
}
}
?>
PK�"�[�#o,,'libraries/phocacart/ordering/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[R��88)libraries/phocacart/ordering/ordering.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class PhocacartOrdering
{
public static function getOrderingText ($ordering, $type = 0) {
switch ($type) {
case 1:// CATEGORY
switch ((int)$ordering) {
case 2: $orderingOutput = 'c.ordering DESC';break;
case 3: $orderingOutput = 'c.title ASC'; break;
case 4:$orderingOutput = 'c.title DESC';break;
case 5:$orderingOutput = 'c.date ASC';break;
case 6:$orderingOutput = 'c.date DESC';break;
case 7:$orderingOutput = 'c.count_products ASC';break;
case 8:$orderingOutput = 'c.count_products DESC';break;
case 99:$orderingOutput = 'RAND()';break;
case 1: default: $orderingOutput = 'c.ordering ASC'; break;
}
break;
case 2:// ORDERS
switch ((int)$ordering) {
case 2:$orderingOutput = 'o.ordering DESC';break;
case 3:$orderingOutput = 'o.title ASC';break;
case 4:$orderingOutput = 'o.title DESC';break;
case 5:$orderingOutput = 'o.price ASC';break;
case 6:$orderingOutput = 'o.price DESC';break;
case 7:$orderingOutput = 'o.date ASC';break;
case 8:$orderingOutput = 'o.date DESC';break;
case 1:default:$orderingOutput = 'o.ordering ASC';break;
}
break;
case 3:// TAGS
switch ((int)$ordering) {
case 2:$orderingOutput = 't.ordering DESC';break;
case 3:$orderingOutput = 't.title ASC';break;
case 4:$orderingOutput = 't.title DESC';break;
case 5:$orderingOutput = 't.id ASC';break;
case 6:$orderingOutput = 't.id DESC';break;
case 7:$orderingOutput = 't.count_products ASC';break;
case 8:$orderingOutput = 't.count_products DESC';break;
case 99:$orderingOutput = 'RAND()';break;
case 1:default:$orderingOutput = 't.ordering ASC';break;
}
break;
case 4:// MANUFACTURERS
switch ((int)$ordering) {
case 2:$orderingOutput = 'm.ordering DESC';break;
case 3:$orderingOutput = 'm.title ASC';break;
case 4:$orderingOutput = 'm.title DESC';break;
case 5:$orderingOutput = 'm.id ASC';break;
case 6:$orderingOutput = 'm.id DESC';break;
case 7:$orderingOutput = 'm.count_products ASC';break;
case 8:$orderingOutput = 'm.count_products DESC';break;
case 99:$orderingOutput = 'RAND()';break;
case 1:default:$orderingOutput = 'm.ordering ASC';break;
}
break;
case 5:// ATTRIBUTES
switch ((int)$ordering) {
case 2:$orderingOutput = 'at.id DESC';break;
case 3:$orderingOutput = 'at.title ASC, v.title ASC';break;
case 4:$orderingOutput = 'at.title DESC, v.title
DESC';break;
case 5:$orderingOutput = 'v.id ASC';break;
case 6:$orderingOutput = 'v.id DESC';break;
case 7:$orderingOutput = 'at.ordering, v.ordering
ASC';break;
case 8:$orderingOutput = 'at.ordering, v.ordering
DESC';break;
case 1:default:$orderingOutput = 'at.id ASC';break;
}
break;
case 6:// SPECIFICATION
switch ((int)$ordering) {
case 2:$orderingOutput = 's.id DESC';break;
case 3:$orderingOutput = 's.title ASC, s.value ASC';break;
case 4:$orderingOutput = 's.title DESC, s.value
DESC';break;
case 1:default:$orderingOutput = 's.id ASC';break;
}
break;
case 7:// CUSTOMERS (POS)
switch ((int)$ordering) {
case 2:$orderingOutput = 'a.name DESC';break;
case 1:default:$orderingOutput = 'a.name ASC';break;
}
break;
case 8:// UNITS (POS)
switch ((int)$ordering) {
case 2:$orderingOutput = 'a.title DESC';break;
case 1:default:$orderingOutput = 'a.title ASC';break;
}
break;
case 9:// SHIPPING METHODS (POS)
switch ((int)$ordering) {
case 2:$orderingOutput = 'a.title DESC';break;
case 99:$orderingOutput = 'RAND()';break;
case 1:default:$orderingOutput = 'a.title ASC';break;
}
break;
case 10:// PAYMENT METHODS (POS)
switch ((int)$ordering) {
case 2:$orderingOutput = 'a.title DESC';break;
case 99:$orderingOutput = 'RAND()';break;
case 1:default:$orderingOutput = 'a.title ASC';break;
}
break;
case 11:// PAYMENT METHODS (POS)
switch ((int)$ordering) {
case 3:$orderingOutput = 'a.id ASC';break;
case 3:$orderingOutput = 'a.id DESC';break;
case 1:$orderingOutput = 'a.date ASC';break;
case 99:$orderingOutput = 'RAND()';break;
case 2:default:$orderingOutput = 'a.date DESC';break;
}
break;
case 12:// PARAMETERS
switch ((int)$ordering) {
case 2:$orderingOutput = 'pp.ordering DESC';break;
case 3:$orderingOutput = 'pp.title ASC';break;
case 4:$orderingOutput = 'pp.title DESC';break;
case 5:$orderingOutput = 'pp.id ASC';break;
case 6:$orderingOutput = 'pp.id DESC';break;
case 99:$orderingOutput = 'RAND()';break;
case 1:default:$orderingOutput = 'pp.ordering ASC';break;
}
break;
case 13:// PARAMETER VALUES
switch ((int)$ordering) {
case 2:$orderingOutput = 'pv.ordering DESC';break;
case 3:$orderingOutput = 'pv.title ASC';break;
case 4:$orderingOutput = 'pv.title DESC';break;
case 5:$orderingOutput = 'pv.id ASC';break;
case 6:$orderingOutput = 'pv.id DESC';break;
case 7:$orderingOutput = 'pv.count_products ASC';break;
case 8:$orderingOutput = 'pv.count_products DESC';break;
case 99:$orderingOutput = 'RAND()';break;
case 1:default:$orderingOutput = 'pv.ordering ASC';break;
}
break;
default://PRODUCTS
switch ((int)$ordering) {
case 2:$orderingOutput = 'pc.ordering DESC';break;
case 3:$orderingOutput = 'a.title ASC';break;
case 4:$orderingOutput = 'a.title DESC';break;
case 5:$orderingOutput = 'a.price ASC';break;
case 6:$orderingOutput = 'a.price DESC';break;
case 7:$orderingOutput = 'a.date ASC';break;
case 8:$orderingOutput = 'a.date DESC';break;
case 21:$orderingOutput = 'a.date_update ASC';break;
case 22:$orderingOutput = 'a.date_update DESC';break;
case 9:$orderingOutput = 'rating ASC';break;
case 10:$orderingOutput = 'rating DESC';break;
case 11:$orderingOutput = 'a.id ASC';break;
case 12:$orderingOutput = 'a.id DESC';break;
case 13:$orderingOutput = 'a.sales ASC';break;
case 14:$orderingOutput = 'a.sales DESC';break;
case 15:$orderingOutput = 'a.hits ASC';break;
case 16:$orderingOutput = 'a.hits DESC';break;
case 17:$orderingOutput = 'ah.hits ASC';break;
case 18:$orderingOutput = 'ah.hits DESC';break;
case 19:$orderingOutput = 'a.sku ASC';break;
case 20:$orderingOutput = 'a.sku DESC';break;
case 99:$orderingOutput = 'RAND()';break;
case 1:default:$orderingOutput = 'pc.ordering ASC';break;
}
break;
}
return $orderingOutput;
}
public static function renderOrderingFront( $selected, $type = 0) {
switch($type) {
case 1:
$typeOrdering = self::getOrderingCategoryArray();
$ordering = 'catordering';
break;
// POS Customers
case 7:
$typeOrdering = self::getOrderingUserArray();
$ordering = 'itemordering';// we use one view for
items,customers,shipping,payment, ...
break;
// POS Units
/* case 8:
$typeOrdering = self::getOrderingUserArray();
$ordering = 'itemordering';// we use one view for
items,customers,shipping,payment, ...
break; */
// POS Shipping methods
case 9:
$typeOrdering = self::getOrderingShippingMethodArray();
$ordering = 'itemordering';// we use one view for
items,customers,shipping,payment, ...
break;
// POS Payment methods
case 10:
$typeOrdering = self::getOrderingPaymentMethodArray();
$ordering = 'itemordering';// we use one view for
items,customers,shipping,payment, ...
break;
// POS Orders
case 11:
$typeOrdering = self::getOrderingOrdersArray();
$ordering = 'itemordering';// we use one view for
items,customers,shipping,payment, ...
break;
default:
$typeOrdering = self::getOrderingItemArray(1);
$ordering = 'itemordering';
break;
}
$html = Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$typeOrdering, $ordering, 'class="inputbox"
size="1" onchange="phEventChangeFormPagination(this.form,
this)"', 'value', 'text', $selected,
$ordering);
return $html;
}
public static function getOrderingItemArray($frontend = 0) {
$paramsC = PhocacartUtils::getComponentParameters();
if ($frontend == 1) {
$ordering_asc_desc_arrows =
$paramsC->get('ordering_asc_desc_arrows', 0);
$item_ordering_values =
$paramsC->get('item_ordering_values',
'1,2,3,4,5,6,7,8,21,22,9,10,19,20');
} else {
$ordering_asc_desc_arrows = 0;
$item_ordering_values = '1,2,3,4,5,6,7,8,21,22,9,10,19,20';
}
if ($ordering_asc_desc_arrows == 1) {
$itemOrdering = array(
1 => JText::_('COM_PHOCACART_ORDERING') . "
" . "⇧",
2 => JText::_('COM_PHOCACART_ORDERING') . "
" . "⇩",
3 => JText::_('COM_PHOCACART_TITLE'). "
" . "⇧",
4 => JText::_('COM_PHOCACART_TITLE'). "
" . "⇩",
5 => JText::_('COM_PHOCACART_PRICE'). "
" . "⇧",
6 => JText::_('COM_PHOCACART_PRICE'). "
" . "⇩",
7 => JText::_('COM_PHOCACART_DATE_ADDED'). "
" . "⇧",
8 => JText::_('COM_PHOCACART_DATE_ADDED'). "
" . "⇩",
21 => JText::_('COM_PHOCACART_DATE_UPDATED'). "
" . "⇧",
22 => JText::_('COM_PHOCACART_DATE_UPDATED'). "
" . "⇩",
9 => JText::_('COM_PHOCACART_RATING'). "
" . "⇧",
10 => JText::_('COM_PHOCACART_RATING'). "
" . "⇩",
19 => JText::_('COM_PHOCACART_SKU'). "
" . "⇧",
20 => JText::_('COM_PHOCACART_SKU'). "
" . "⇩",
13 => JText::_('COM_PHOCACART_MOST_POPULAR'). "
" . "⇧",
14 => JText::_('COM_PHOCACART_MOST_POPULAR'). "
" . "⇩",
15 => JText::_('COM_PHOCACART_MOST_VIEWED'). "
" . "⇧",
16 => JText::_('COM_PHOCACART_MOST_VIEWED'). "
" . "⇩"
);
} else {
$itemOrdering = array(
1 => JText::_('COM_PHOCACART_ORDERING_ASC'),
2 => JText::_('COM_PHOCACART_ORDERING_DESC'),
3 => JText::_('COM_PHOCACART_TITLE_ASC'),
4 => JText::_('COM_PHOCACART_TITLE_DESC'),
5 => JText::_('COM_PHOCACART_PRICE_ASC'),
6 => JText::_('COM_PHOCACART_PRICE_DESC'),
7 => JText::_('COM_PHOCACART_DATE_ADDED_ASC'),
8 => JText::_('COM_PHOCACART_DATE_ADDED_DESC'),
21 => JText::_('COM_PHOCACART_DATE_UPDATED_ASC'),
22 => JText::_('COM_PHOCACART_DATE_UPDATED_DESC'),
9 => JText::_('COM_PHOCACART_RATING_ASC'),
10 => JText::_('COM_PHOCACART_RATING_DESC'),
19 => JText::_('COM_PHOCACART_SKU_ASC'),
20 => JText::_('COM_PHOCACART_SKU_DESC'),
13 => JText::_('COM_PHOCACART_MOST_POPULAR_ASC'),
14 => JText::_('COM_PHOCACART_MOST_POPULAR_DESC'),
15 => JText::_('COM_PHOCACART_MOST_VIEWED_ASC'),
16 => JText::_('COM_PHOCACART_MOST_VIEWED_DESC')
);
}
$itemOrderingValuesA = explode(',', $item_ordering_values);
//$itemOrdering = array_intersect_key($itemOrdering,
$itemOrderingValues);
$validItemOrdering = array();
foreach ($itemOrderingValuesA as $k => $v) {
if (isset($itemOrdering[$v])) {
$validItemOrdering[$v] = $itemOrdering[$v];
}
}
return $validItemOrdering;
}
public static function getOrderingUserArray() {
$itemOrdering = array(
1 => JText::_('COM_PHOCACART_NAME_ASC'),
2 => JText::_('COM_PHOCACART_NAME_DESC'));
return $itemOrdering;
}
public static function getOrderingShippingMethodArray() {
$itemOrdering = array(
1 => JText::_('COM_PHOCACART_TITLE_ASC'),
2 => JText::_('COM_PHOCACART_TITLE_DESC'));
return $itemOrdering;
}
public static function getOrderingPaymentMethodArray() {
$itemOrdering = array(
1 => JText::_('COM_PHOCACART_TITLE_ASC'),
2 => JText::_('COM_PHOCACART_TITLE_DESC'));
return $itemOrdering;
}
public static function getOrderingOrdersArray() {
$itemOrdering = array(
1 => JText::_('COM_PHOCACART_DATE_ASC'),
2 => JText::_('COM_PHOCACART_DATE_DESC'),
3 => JText::_('COM_PHOCACART_ID_ASC'),
4 => JText::_('COM_PHOCACART_ID_DESC'));
return $itemOrdering;
}
/*public static function getOrderingCategoryArray() {
$itemOrdering = array(
1 => JText::_('COM_PHOCACART_ORDERING_ASC'),
2 => JText::_('COM_PHOCACART_ORDERING_DESC'),
3 => JText::_('COM_PHOCACART_TITLE_ASC'),
4 => JText::_('COM_PHOCACART_TITLE_DESC'),
5 => JText::_('COM_PHOCACART_DATE_ASC'),
6 => JText::_('COM_PHOCACART_DATE_DESC'),
//7 => JText::_('COM_PHOCACART_ID_ASC'),
//8 => JText::_('COM_PHOCACART_ID_DESC'),
11 => JText::_('COM_PHOCACART_COUNT_ASC'),
12 => JText::_('COM_PHOCACART_COUNT_DESC'),
13 => JText::_('COM_PHOCACART_AVERAGE_ASC'),
14 => JText::_('COM_PHOCACART_AVERAGE_DESC'),
15 => JText::_('COM_PHOCACART_HITS_ASC'),
16 => JText::_('COM_PHOCACART_HITS_DESC'));
return $itemOrdering;
}*/
public static function getOrderingCombination($orderingItem = 0,
$orderingCat = 0) {
$itemOrdering = '';
$catOrdering = '';
$ordering = '';
if ($orderingItem > 0) {
$itemOrdering = PhocacartOrdering::getOrderingText($orderingItem,0);
}
if ($orderingCat > 0) {
$catOrdering = PhocacartOrdering::getOrderingText($orderingCat,1);
}
if ($catOrdering != '' && $itemOrdering ==
'') {
$ordering = $catOrdering;
}
if ($catOrdering == '' && $itemOrdering !=
'') {
$ordering = $itemOrdering;
}
if ($catOrdering != '' && $itemOrdering !=
'') {
$ordering = $catOrdering . ', '.$itemOrdering;
}
return $ordering;
}
}
?>
PK�"�[�#o,,)libraries/phocacart/pagination/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�]��-libraries/phocacart/pagination/pagination.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.html.pagination');
class PhocacartPagination extends JPagination
{
function getLimitBox() {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$pos = PhocacartPos::isPos();
if ($pos == 1) {
$pagination = $paramsC->get( 'pos_pagination',
'6,12,24,36,48,60' );
} else {
$pagination = $paramsC->get( 'item_pagination',
'5,10,15,20,50' );
}
$paginationArray = explode( ',', $pagination );
// Initialize variables
$limits = array ();
foreach ($paginationArray as $paginationValue) {
$limits[] = Joomla\CMS\HTML\HTMLHelper::_('select.option',
$paginationValue);
}
$limits[] = Joomla\CMS\HTML\HTMLHelper::_('select.option',
'0', JText::_('COM_PHOCACART_ALL'));
$selected = $this->viewall ? 0 : $this->limit;
// Build the select list
if ($app->isClient('administrator')) {
$html = Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$limits, 'limit', 'class="inputbox"
size="1" onchange="submitform();"',
'value', 'text', $selected);
} else {
$html = Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$limits, 'limit', 'class="inputbox"
size="1" onchange="phEventChangeFormPagination(this.form,
this)"', 'value', 'text', $selected);
}
return $html;
}
//public static function getMaximumLimit(int $limit) : int {
public static function getMaximumLimit($limit) {
$paramsC = PhocacartUtils::getComponentParameters();
$pos = PhocacartPos::isPos();
if ($pos == 1) {
$item_pagination_limit = 0;
$pagination = $paramsC->get( 'pos_pagination',
'6,12,24,36,48,60' );
} else {
$item_pagination_limit = $paramsC->get(
'item_pagination_limit', 0);
$pagination = $paramsC->get( 'item_pagination',
'5,10,15,20,50' );
}
$l = $limit;
if ((int)$item_pagination_limit == 1) {
$paginationArray = explode( ',', $pagination );
$maxPagination = max($paginationArray);
if ((int)$limit == 0 && (int)$maxPagination > 0) {
// Pagination limit not set in frontend (all) but maximum pagination
limit set
$l = (int)$maxPagination;
} else if ((int)$limit > 0 && (int)$maxPagination > 0
&& $limit > (int)$maxPagination) {
// Pagination limit is set in frontend (e.g. 20) but maximum pagination
limit is smaller (e.g. 10)
$l = (int)$maxPagination;
} /*else {
// Maximum pagination limit not set, so used the standard one - set in
frontend by visitor
$l = $limit;
}*/
}
return $l;
}
}
?>
PK�"�[�#o,,(libraries/phocacart/parameter/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�wQ/Q/+libraries/phocacart/parameter/parameter.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartParameter
{
private static $parameter = array();
/*
* PARAMETERS (group for each parameter values)
*/
public static function getAllParametersSelectBox($name, $id, $active,
$attr = 'class="inputbox"', $order = 'id',
$selectText = 0 ) {
$db = JFactory::getDBO();
$query = 'SELECT a.id AS value, a.title AS text'
.' FROM #__phocacart_parameters AS a'
//.' WHERE a.type ='.(int)$type
.' ORDER BY '. $order;
$db->setQuery($query);
$parameters = $db->loadObjectList();
if (!empty($parameters) && $selectText == 1) {
array_unshift($parameters,
Joomla\CMS\HTML\HTMLHelper::_('select.option', '',
'- ' . JText::_('COM_PHOCACART_SELECT_PARAMETER') .
' -', 'value', 'text'));
}
$paramsO = Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$parameters, $name, $attr, 'value', 'text', $active,
$id);
return $paramsO;
}
public static function getAllParameters($key = 'id', $ordering =
1, $lang = '') {
$keyP = base64_encode(serialize($key) . ':' .
serialize((int)$ordering . ':' . $lang ));
if( !array_key_exists( (string)$keyP, self::$parameter )) {
$db = JFactory::getDBO();
$orderingText = PhocacartOrdering::getOrderingText($ordering, 12);
$wheres = array();
$lefts = array();
$columns = 'pp.id, pp.title, pp.title_header, pp.image, pp.alias,
pp.description, pp.limit_count, pp.link_type';
/*$groupsFull = $columns;
$groupsFast = 'm.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;*/
$wheres[] = ' pp.published = 1';
if ($lang != '' && $lang != '*') {
$wheres[] =
PhocacartUtilsSettings::getLangQuery('pp.language', $lang);
}
$q = ' SELECT DISTINCT ' . $columns
. ' FROM #__phocacart_parameters AS pp'
. (!empty($lefts) ? ' LEFT JOIN ' . implode(' LEFT JOIN
', $lefts) : '')
. (!empty($wheres) ? ' WHERE ' . implode(' AND ',
$wheres) : '')
//.' GROUP BY '.$groups
. ' ORDER BY ' . $orderingText;
$db->setQuery($q);
try {
$items = $db->loadObjectList($key);
} catch (Exception $e) {
JFactory::getApplication()->enqueueMessage(JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED',
$e->getCode(), $e->getMessage()), 'error');
return;
}
/*
try {
$items = $db->loadObjectList();
} catch (RuntimeException $e) {
throw new Exception($e->getMessage(), 500, $e);
return false;
}*/
self::$parameter[$keyP] = $items;
}
return self::$parameter[$keyP];
}
/*
* PARAMETER VALUES (stored in products) Field PhocacartParameterValues
*/
public static function getParameterValues($itemId, $parameterId, $select =
0) {
$db = JFactory::getDBO();
if ($select == 1) {
$query = 'SELECT r.parameter_value_id';
} else if ($select == 2){
$query = 'SELECT a.id, a.alias ';
} else {
$query = 'SELECT a.id, a.title, a.alias, a.type,
a.display_format';
}
$query .= ' FROM #__phocacart_parameter_values AS a'
//.' LEFT JOIN #__phocacart AS f ON f.id = r.item_id'
.' LEFT JOIN #__phocacart_parameter_values_related AS r ON a.id =
r.parameter_value_id'
.' LEFT JOIN #__phocacart_parameters AS p ON a.parameter_id =
p.id'
.' WHERE r.item_id = '.(int) $itemId
.' AND p.id = '.(int) $parameterId
.' ORDER BY a.id';
$db->setQuery($query);
if ($select == 1) {
$params = $db->loadColumn();
} else {
$params = $db->loadObjectList();
}
return $params;
}
/*
* PARAMETER VALUES (stored in submitted items) Field
PhocacartParameterValuesSumbitItems
*/
public static function getParameterValuesSubmitItems($itemId,
$parameterId, $select = 0) {
$db = JFactory::getDBO();
$query = 'SELECT a.items_parameter';
$query .= ' FROM #__phocacart_submit_items AS a'
.' WHERE a.id = '.(int) $itemId
.' ORDER BY a.id';
$db->setQuery($query);
$items = $db->loadResult();
if (!empty($items)) {
$itemsA = json_decode($items, true);
if (isset($itemsA[$parameterId])){
return $itemsA[$parameterId];
}
}
return array();
}
/*
* We don't need to care about parameter_id here as
parameter_value_id is unique indepentend to its parameter group
*/
public static function getParameterValuesByIds($cids) {
$db = JFactory::getDBO();
if ($cids != '') {//cids is string separated by comma
$query = 'SELECT pvr.parameter_value_id FROM
#__phocacart_parameter_values AS a'
//.' LEFT JOIN #__phocacart AS f ON f.id =
r.item_id'
. ' LEFT JOIN #__phocacart_parameter_values_related AS
pvr ON a.id = pvr.parameter_value_id'
. ' AND pvr.item_id IN (' . $cids . ')'
. ' ORDER BY a.id';
$db->setQuery($query);
$tags = $db->loadColumn();
$tags = array_unique($tags);
return $tags;
}
return array();
}
/*
* PARAMETER VALUES (stored in products) Field PhocacartParameterValues
*/
public static function getAllParameterValuesSelectBox($name, $id,
$parameterId, $activeArray, $attributes = '', $order =
'a.id') {
$db = JFactory::getDBO();
$query = 'SELECT a.id AS value, a.title AS text'
.' FROM #__phocacart_parameter_values AS a'
.' LEFT JOIN #__phocacart_parameters AS p ON a.parameter_id =
p.id'
.' WHERE p.id = '.(int) $parameterId
.' ORDER BY '. $order;
$db->setQuery($query);
$parameters = $db->loadObjectList();
$parametersO =
Joomla\CMS\HTML\HTMLHelper::_('select.genericlist', $parameters,
$name, $attributes, 'value', 'text', $activeArray,
$id);
return $parametersO;
}
public static function storeParameterValues($parameterValuesArray,
$itemId, $parameterId) {
if ((int)$itemId > 0 && (int)$parameterId > 0) {
$db = JFactory::getDBO();
$query = ' DELETE '
.' FROM #__phocacart_parameter_values_related'
.' WHERE item_id = '. (int)$itemId
.' AND parameter_id = '.(int)$parameterId;
$db->setQuery($query);
$db->execute();
if (!empty($parameterValuesArray)) {
$values = array();
$valuesString = '';
foreach($parameterValuesArray as $k => $v) {
$values[] = ' ('.(int)$itemId.', '.(int)$v.',
'.(int)$parameterId.')';
}
if (!empty($values)) {
$valuesString = implode(',', $values);
$query = ' INSERT INTO #__phocacart_parameter_values_related
(item_id, parameter_value_id, parameter_id)'
.' VALUES '.(string)$valuesString;
$db->setQuery($query);
$db->execute();
}
}
}
}
public static function getAllParameterValues($parameterId, $ordering = 1,
$onlyAvailableProducts = 0, $lang = '', $filterProducts = array()
, $limitCount = -1) {
/* $db = JFactory::getDBO();
$orderingText = PhocacartOrdering::getOrderingText($ordering, 12);
$query = 'SELECT t.id, t.title, t.alias FROM #__phocacart_tags AS t
WHERE t.published = 1 ORDER BY '.$orderingText;
$db->setQuery($query);
$tags = $db->loadObjectList();
return $tags;*/
$wheres = array();
$lefts = array();
$related = '#__phocacart_parameter_values_related';
$db = JFactory::getDBO();
$orderingText = PhocacartOrdering::getOrderingText($ordering, 13);
$columns = 'pv.id, pv.title, pv.alias, pv.count_products';
/*$groupsFull = $columns;
$groupsFast = 'm.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;*/
$wheres[] = ' pp.published = 1';// Parameter (parameter group)
$wheres[] = ' pv.published = 1';// Parameter Value
if ($onlyAvailableProducts == 1) {
if ($lang != '' && $lang != '*') {
$wheres[] =
PhocacartUtilsSettings::getLangQuery('p.language', $lang);
}
$lefts[] = ' #__phocacart_parameter_values_related AS pr ON
pr.parameter_value_id = pv.id';
$lefts[] = ' #__phocacart_products AS p ON pr.item_id = p.id';
$rules = PhocacartProduct::getOnlyAvailableProductRules();
$wheres = array_merge($wheres, $rules['wheres']);
$lefts = array_merge($lefts, $rules['lefts']);
} else {
if ($lang != '' && $lang != '*') {
$wheres[] =
PhocacartUtilsSettings::getLangQuery('pv.language', $lang);
$lefts[] = ' #__phocacart_parameter_values_related AS pr ON
pr.parameter_value_id = pv.id';
$lefts[] = ' #__phocacart_products AS p ON pr.item_id =
p.id';
}
}
if (!empty($filterProducts)) {
$productIds = implode (',', $filterProducts);
$wheres[] = 'p.id IN ('.$productIds.')';
}
if ($limitCount > -1) {
$wheres[] = 'pv.count_products > '.(int)$limitCount;
}
$lefts[] = ' #__phocacart_parameters AS pp ON pv.parameter_id =
pp.id';
$wheres[] = 'pp.id = '.(int)$parameterId;
$q = ' SELECT DISTINCT '.$columns
.' FROM #__phocacart_parameter_values AS pv'
. (!empty($lefts) ? ' LEFT JOIN ' . implode( ' LEFT JOIN
', $lefts ) : '')
. (!empty($wheres) ? ' WHERE ' . implode( ' AND ',
$wheres ) : '')
//.' GROUP BY '.$groups
.' ORDER BY '.$orderingText;
$db->setQuery($q);
$items = $db->loadObjectList();
return $items;
}
public static function options($type = 0) {
$db = JFactory::getDBO();
//build the list of categories
$query = 'SELECT a.title AS text, a.id AS value'
. ' FROM #__phocacart_parameters AS a'
. ' WHERE a.published = 1'
. ' ORDER BY a.ordering';
$db->setQuery( $query );
$items = $db->loadObjectList();
return $items;
}
public static function getActiveParameterValues($items, $ordering) {
$db = JFactory::getDbo();
$o = array();
$wheres = array();
$ordering = PhocacartOrdering::getOrderingText($ordering, 13);//pv
if (!empty($items)) {
foreach ($items as $k => $v) {
$wheres[] = '( pp.alias = ' . $db->quote($k) .
' AND pv.id IN (' . $v . ') )';
}
if (!empty($wheres)) {
// FULL GROUP BY GROUP_CONCAT(DISTINCT o.title) AS title
$q = 'SELECT DISTINCT CONCAT(pv.id, \'-\',
pv.alias) AS alias, pv.title, pp.alias AS parameteralias, pp.title AS
parametertitle FROM #__phocacart_parameter_values AS pv'
. ' LEFT JOIN #__phocacart_parameters AS pp ON
pp.id = pv.parameter_id'
. (!empty($wheres) ? ' WHERE ' .
implode(' OR ', $wheres) : '')
. ' GROUP BY pp.alias, pv.alias, pv.title'
. ' ORDER BY ' . $ordering;
$db->setQuery($q);
$o = $db->loadAssocList();
}
}
return $o;
}
public static function getParametersRendered($itemId, $type = 0,
$separator = '') {
if ($type == 0) {
return false;
}
$o = array();
$parameters = self::getAllParameters();
$s = PhocacartRenderStyle::getStyles();
if (!empty($parameters)) {
foreach ($parameters as $k => $v) {
if((int)$v->id) {
$parameterValues = self::getParameterValues($itemId, (int)$v->id);
if (!empty($parameterValues)) {
$o[] = '<h3>'.$v->title.'</h3>';
$o2 = array();
foreach ($parameterValues as $k2 => $v2) {
$title = '';
if ($v->link_type == 1) {
if ($v2->id > 0 && $v->alias != ''
&& $v2->alias != '') {
$title = '<a
href="'.JRoute::_(PhocacartRoute::getItemsRoute('',
'', PhocacartText::filterValue($v->alias,
'alphanumeric'), PhocacartText::filterValue((int)$v2->id .
'-' . $v2->alias,
'text'))).'">'.$v2->title.'</a>';
}
} else {
$title = $v2->title;
}
$o2[$k] = '<span
class="'.$s['c']['label.label-info']
.'">'.$title.'</span>';
}
$o[] = implode($separator, $o2);
$o[] = '<div class="ph-cb"></div>';
}
}
}
}
return implode('', $o);
}
}
?>
PK�"�[�#o,,#libraries/phocacart/path/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��yE��!libraries/phocacart/path/path.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class PhocacartPath
{
public static function getPath( $manager = '') {
$group = PhocacartUtilsSettings::getManagerGroup($manager);
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
// Folder where to stored files for download
$productImagePath = $paramsC->get( 'product_image_path',
'images/phocacartproducts' );
$categoryImagePath = $paramsC->get( 'category_image_path',
'images/phocacartcategories' );
$downloadFolder = $paramsC->get( 'download_folder',
'phocacartdownload' );
$downloadFolderPublic = $paramsC->get(
'public_download_folder', 'phocacartdownloadpublic' );
$attachmentFolder = $paramsC->get( 'attachment_folder',
'phocacartattachment' );
$uploadFolder = $paramsC->get( 'upload_folder',
'phocacartupload' );// frontend upload
// Absolute path which can be outside public_html - if this will be set,
download folder will be ignored
$absolutePath = $paramsC->get( 'absolute_path',
'' );
$absolutePathUpload = $paramsC->get( 'absolute_path_upload',
'' );
// Path of preview and play
//$downloadFolderPap = JPath::clean($downloadFolderPap);
//$path['orig_abs_pap'] = JPATH_ROOT . '/' .
$downloadFolderPap;
//$path['orig_abs_pap_ds'] = $path['orig_abs_pap'] .
'/' ;
$path['media_abs_front_ds'] = JPATH_ROOT .
'/media/com_phocacart/images/' ;
if ($group['f'] == 8) {
$attachmentFolder = JPath::clean($attachmentFolder);
$path['orig_abs'] = JPATH_ROOT . '/' .
$attachmentFolder;
$path['orig_abs_ds'] = JPATH_ROOT . '/' .
$attachmentFolder . '/';
$attachmentFolderRel = JPath::clean($attachmentFolder);
$path['orig_rel'] = '../' .
$attachmentFolderRel;
$path['orig_rel_ds'] = '../' .
$attachmentFolderRel .'/';
$path['orig_rel_path'] = Juri::root() .
$attachmentFolderRel;
$path['orig_rel_path_ds'] = Juri::root() .
$attachmentFolderRel .'/';
} else if ($group['f'] == 6) {
$downloadFolderPublic = JPath::clean($downloadFolderPublic);
$path['orig_abs'] = JPATH_ROOT . '/' .
$downloadFolderPublic;
$path['orig_abs_ds'] = JPATH_ROOT . '/' .
$downloadFolderPublic . '/';
$downloadFolderPublicRel = JPath::clean($downloadFolderPublic);
$path['orig_rel'] = '../' .
$downloadFolderPublicRel;
$path['orig_rel_ds'] = '../' .
$downloadFolderPublicRel .'/';
$path['orig_rel_path'] = Juri::root() .
$downloadFolderPublicRel;
$path['orig_rel_path_ds'] = Juri::root() .
$downloadFolderPublicRel .'/';
} else if ($group['f'] == 4) {
// Images Categories
$path['orig_abs'] = JPATH_ROOT . '/' .
$categoryImagePath ;
$path['orig_abs_ds'] = $path['orig_abs']
.'/' ;
$path['orig_rel'] = $categoryImagePath ;
$path['orig_rel_ds'] = $path['orig_rel'] .
'/' ;
} else if ($group['f'] == 5) {
// Images Products
$path['orig_abs'] = JPATH_ROOT . '/' .
$productImagePath ;
$path['orig_abs_ds'] = $path['orig_abs'] .
'/';
$path['orig_rel'] = $productImagePath ;
$path['orig_rel_ds'] = $path['orig_rel'] .
'/' ;
} else if ($group['f'] == 7) {
// Standard Path - Upload
if ($absolutePathUpload != '') {
$uploadFolder = JPath::clean($absolutePathUpload);
$path['orig_abs'] = $uploadFolder;
$path['orig_abs_ds'] =
JPath::clean($path['orig_abs'] . '/');
$path['orig_rel'] = '';
$path['orig_rel_ds'] = '';
} else {
$uploadFolder = JPath::clean($uploadFolder);
$path['orig_abs'] = JPATH_ROOT . '/' .
$uploadFolder;
$path['orig_abs_ds'] = JPATH_ROOT . '/' .
$uploadFolder . '/';
$uploadFolderRel = JPath::clean($uploadFolder);
$path['orig_rel_ds'] = '../' .
$uploadFolderRel;
$path['orig_rel_ds'] = '../' . $uploadFolderRel
.'/';
$path['orig_rel_path'] = Juri::root() . $uploadFolderRel;
$path['orig_rel_path_ds'] = Juri::root() . $uploadFolderRel
.'/';
}
} else if ($group['f'] == 3) {
// Standard Path - Download
if ($absolutePath != '') {
$downloadFolder = JPath::clean($absolutePath);
$path['orig_abs'] = $downloadFolder;
$path['orig_abs_ds'] =
JPath::clean($path['orig_abs'] . '/');
$path['orig_rel'] = '';
$path['orig_rel_ds'] = '';
} else {
$downloadFolder = JPath::clean($downloadFolder);
$path['orig_abs'] = JPATH_ROOT . '/' .
$downloadFolder;
$path['orig_abs_ds'] = JPATH_ROOT . '/' .
$downloadFolder . '/';
$downloadFolderRel = JPath::clean($downloadFolder);
$path['orig_rel_ds'] = '../' .
$downloadFolderRel;
$path['orig_rel_ds'] = '../' .
$downloadFolderRel .'/';
$path['orig_rel_path'] = Juri::root() .
$downloadFolderRel;
$path['orig_rel_path_ds'] = Juri::root() .
$downloadFolderRel .'/';
}
} else {
$path['orig_abs'] = JPATH_ROOT . '/tmp';
$path['orig_abs_ds'] = JPATH_ROOT . '/tmp/';
$path['orig_rel'] = '';
$path['orig_rel_ds'] = '';
}
return $path;
}
public static function getPathMedia() {
// TO DO - create a singleton
$option = 'com_phocacart';
$instance = new StdClass();
$baseFront = JURI::root(true);
$instance->media_css_abs = JPATH_ROOT . '/' .
'media'. '/' . $option . '/' .
'css' . '/';
$instance->media_img_abs = JPATH_ROOT . '/' .
'media'. '/' . $option . '/' .
'images' . '/';
$instance->media_js_abs = JPATH_ROOT . '/' .
'media'. '/' . $option . '/' .
'js' . '/';
$instance->media_css_rel = 'media/'. $option
.'/css/';
$instance->media_img_rel = 'media/'. $option
.'/images/';
$instance->media_js_rel = 'components/'. $option
.'/assets/';
$instance->media_css_rel_full = $baseFront . '/' .
$instance->media_css_rel;
$instance->media_img_rel_full = $baseFront . '/' .
$instance->media_img_rel;
$instance->media_js_rel_full = $baseFront . '/' .
$instance->media_js_rel;
return $instance;
}
public static function getRightPathLink($link) {
$app = JApplicationCms::getInstance('site');
$router = $app->getRouter();
$uri = $router->build($link);
$uriS = $uri->toString();
$pos = strpos($uriS, 'administrator');
if ($pos === false) {
$uriL = str_replace(JURI::root(true), '', $uriS);
$uriL = ltrim($uriL, '/');
$formatLink = JURI::root(false). $uriL;
//$formatLink = $uriS;
} else {
$formatLink = JURI::root(false).
str_replace(JURI::root(true).'/administrator/', '',
$uri->toString());
}
return $formatLink;
}
}
?>
PK�"�[�#o,,&libraries/phocacart/payment/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[xs�{�S�S'libraries/phocacart/payment/payment.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\Utilities\ArrayHelper;
defined('_JEXEC') or die();
/*
* Payment Method - is the method stored in Phoca Cart
* Method - is the method of payment - e.g. Paypal, Cash On Delivery, ...
*
* EXAMPLE:
* Payment Method: Cash to 100eur -> Method: Cash On Delivery
* Payment Method: Cash over 100eur -> Method: Cash On Delivery
* Payment Method: Paypal to 100eur -> Method: Paypal Standard
* Payment Method: Paypal over 100eur -> Method: Paypal Standard
*
*/
/**
* Class PhocacartPayment
*/
class PhocacartPayment
{
protected $type = array(0,1);// 0 all, 1 online shop, 2 pos (category
type, payment method type, shipping method type)
public function __construct() {
}
public function setType($type = array(0,1)) {
$this->type = $type;
}
/*
* Be aware:
* if id > 0 ... it can test if the payment method exists (order)
* if id = 0 ... it lists all possible payment methods meeting the
criteria (checkout)
* Always test for the id before using this function
*/
public function getPossiblePaymentMethods($amountNetto, $amountBrutto,
$country, $region, $shipping, $id = 0, $selected = 0) {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$payment_amount_rule = $paramsC->get( 'payment_amount_rule',
0 );
$user = PhocacartUser::getUser();
$userLevels = implode (',',
$user->getAuthorisedViewLevels());
$userGroups = implode (',',
PhocacartGroup::getGroupsById($user->id, 1, 1));
$db = JFactory::getDBO();
$wheres = array();
// ACCESS
$wheres[] = " p.published = 1";
$wheres[] = " p.access IN (".$userLevels.")";
$wheres[] = " (ga.group_id IN (".$userGroups.") OR
ga.group_id IS NULL)";
if (!empty($this->type) && is_array($this->type)) {
$wheres[] = " p.type IN (" . implode(',',
$this->type) . ')';
}
if ((int)$id > 0) {
$wheres[] = 'p.id = '.(int)$id;
$limit = ' LIMIT 1';
//$group = '';
} else {
$limit = '';
}
$columns = 'p.id, p.tax_id, p.cost, p.cost_additional,
p.calculation_type, p.title, p.image, p.access, p.description,
p.method,'
.' p.active_amount, p.active_zone, p.active_country,
p.active_region, p.active_shipping,'
.' p.lowest_amount, p.highest_amount, p.default,'
.' t.id as taxid, t.title as taxtitle, t.tax_rate as taxrate,
t.calculation_type as taxcalculationtype,'
.' GROUP_CONCAT(DISTINCT r.region_id) AS region,'
.' GROUP_CONCAT(DISTINCT c.country_id) AS country,'
.' GROUP_CONCAT(DISTINCT z.zone_id) AS zone,'
.' GROUP_CONCAT(DISTINCT s.shipping_id) AS shipping';
$groupsFull = 'p.id, p.tax_id, p.cost, p.cost_additional,
p.calculation_type, p.title, p.image, p.access, p.description,
p.method,'
.' p.active_amount, p.active_zone, p.active_country,
p.active_region, p.active_shipping,'
.' p.lowest_amount, p.highest_amount, p.default,'
.' t.id, t.title, t.tax_rate, t.calculation_type';
$groupsFast = 'p.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
$where = ( count( $wheres ) ? ' WHERE '. implode( ' AND
', $wheres ) : '' );
/*$query = ' SELECT p.id, p.title, p.image'
.' FROM #__phocacart_payment_methods AS p'
.' WHERE p.published = 1'
.' ORDER BY p.ordering';
$db->setQuery($query);*/
$query = ' SELECT '.$columns
.' FROM #__phocacart_payment_methods AS p'
.' LEFT JOIN #__phocacart_payment_method_regions AS r ON
r.payment_id = p.id'
.' LEFT JOIN #__phocacart_payment_method_countries AS c ON
c.payment_id = p.id'
.' LEFT JOIN #__phocacart_payment_method_zones AS z ON
z.payment_id = p.id'
.' LEFT JOIN #__phocacart_payment_method_shipping AS s ON
s.payment_id = p.id'
.' LEFT JOIN #__phocacart_taxes AS t ON t.id = p.tax_id'
.' LEFT JOIN #__phocacart_item_groups AS ga ON p.id = ga.item_id
AND ga.type = 8'// type 8 is payment
. $where
. ' GROUP BY '.$groups
. ' ORDER BY p.ordering'
. $limit;
PhocacartUtils::setConcatCharCount();
$db->setQuery($query);
$payments = $db->loadObjectList();
if (!empty($payments) && !isset($payments[0]->id) ||
(isset($payments[0]->id) && (int)$payments[0]->id < 1)) {
return false;
}
$i = 0;
if (!empty($payments)) {
foreach($payments as $k => $v) {
$v->active = 0;
$v->selected = 0;
$a = 0;
$z = 0;
$c = 0;
$r = 0;
$s = 0;
// Amount Rule
if ($v->active_amount == 1) {
if ($payment_amount_rule == 0 || $payment_amount_rule == 2) {
// No tax, brutto
if ($amountBrutto >= $v->lowest_amount && $amountBrutto
<= $v->highest_amount) {
$a = 1;
}
} else if ($payment_amount_rule == 2) {
// Netto
if ($amountNetto >= $v->lowest_amount && $amountNetto
<= $v->highest_amount) {
$a = 1;
}
}
} else {
$a = 1;
}
// Zone Rule
if ($v->active_zone == 1) {
if (isset($v->zone) && $v->zone != '') {
$zones = explode(',', $v->zone);
if (PhocacartZone::isCountryOrRegionIncluded($zones, (int)$country,
(int)$region)) {
$z = 1;
}
}
} else {
$z = 1;
}
// Country Rule
if ($v->active_country == 1) {
if (isset($v->country) && $v->country != '') {
$countries = explode(',', $v->country);
if (in_array((int)$country, $countries)) {
$c = 1;
}
}
} else {
$c = 1;
}
// Region Rule
if ($v->active_region == 1) {
if (isset($v->region) && $v->region != '') {
$regions = explode(',', $v->region);
if (in_array((int)$region, $regions)) {
$r = 1;
}
}
} else {
$r = 1;
}
// Shipping Rule
if ($v->active_shipping == 1) {
if (isset($v->shipping) && $v->shipping != '')
{
$shippings = explode(',', $v->shipping);
if (in_array((int)$shipping, $shippings)) {
$s = 1;
}
}
} else {
$s = 1;
}
// No rule was set for shipping, it will be displayed at all events
if ($v->active_amount == 0 && $v->active_country == 0
&& $v->active_region == 0 && $v->active_shipping ==
0) {
$v->active = 1;
}
// if some of the rules is not valid, all the payment is NOT valid
if ($a == 0 || $z == 0 || $c == 0 || $r == 0 || $s == 0) {
$v->active = 0;
} else {
$v->active = 1;
}
if ($v->active == 0) {
if (isset($payments[$i])) {
unset($payments[$i]);
}
} else {
// Payment is active but payment method plugin can deactivate it
$pluginPayment = PluginHelper::importPlugin('pcp');
if ($pluginPayment) {
PluginHelper::importPlugin('pcp',
htmlspecialchars(strip_tags($v->method)));
$eventData = array();
$active = true;
$eventData['pluginname'] =
htmlspecialchars(strip_tags($v->method));
Factory::getApplication()->triggerEvent('PCPbeforeShowPossiblePaymentMethod',
array(&$active, $v, $eventData));
if ($active == false) {
if (isset($payments[$i])) {
unset($payments[$i]);
}
}
}
}
// Try to set default for frontend form
// If user selected some payment, such will be set as default
// If not then the default will be set
if ((int)$selected > 0) {
if ((int)$v->id == (int)$selected) {
$v->selected = 1;
}
} else {
$v->selected = $v->default;
}
$i++;
}
}
return $payments;
}
/* public function checkAndGetPaymentMethodInsideCart($id, $total,
$shippingId) {
if ((int)$id > 0 && !empty($total)) {
return $this->checkAndGetPaymentMethods($id, 0, $total, $shippingId);
}
return false;
}*/
/**
* Check current payment method
* Payment method must be selected
* @param number $id
* @return boolean|array
*/
public function checkAndGetPaymentMethod($id = 0, $total = array(),
$shippingId = 0) {
if ($id > 0) {
return $this->checkAndGetPaymentMethods($id, 0, $total, $shippingId);
}
return false;
}
/**
* Check current payment method or all methods they meet criteria to be
selected
* @param number $selectedPaymentId
* @param number $selected
* @return boolean|array
*/
public function checkAndGetPaymentMethods($selectedPaymentId = 0,
$selected = 0, $total = array(), $shippingId = 0) {
if (empty($total)) {
$cart = new PhocacartCartRendercheckout();
$cart->setType($this->type);
$cart->setFullItems();
$total = $cart->getTotal();
$totalFinal = $total[0];
$currentShippingId = $cart->getShippingId();
//$currentPaymentId = $cart->getPaymentId();
} else {
$totalFinal = $total;
$currentShippingId = $shippingId;
}
$user = PhocacartUser::getUser();
$data = PhocacartUser::getUserData((int)$user->id);
$fields = PhocacartFormUser::getFormXml('',
'_phs', 1,1,0);
$dataAddress = array();
if (!empty($data)) {
$dataAddress = PhocacartUser::getAddressDataOutput($data,
$fields['array'], $user);
} else {
// Is this guest user
$guest = PhocacartUserGuestuser::getGuestUser();
if ($guest) {
$data = PhocacartUserGuestuser::getUserAddressGuest();
$dataAddress = PhocacartUser::getAddressDataOutput($data,
$fields['array'], $user, 1);
}
}
/*$country = 0;
if(isset($dataAddress['bcountry']) &&
(int)$dataAddress['bcountry']) {
$country = (int)$dataAddress['bcountry'];
}
$region = 0;
if(isset($dataAddress['bregion']) &&
(int)$dataAddress['bregion']) {
$region = (int)$dataAddress['bregion'];
}*/
$country = $this->getUserCountryPayment($dataAddress);
$region = $this->getUserRegionPayment($dataAddress);
$paymentMethods =
$this->getPossiblePaymentMethods($totalFinal['netto'],
$totalFinal['brutto'], $country, $region, $currentShippingId,
$selectedPaymentId, $selected);
if (!empty($paymentMethods)) {
return $paymentMethods;
}
return false;
}
public static function getUserCountryPayment($dataAddress) {
$pC = PhocacartUtils::getComponentParameters();
$payment_country_rule =
$pC->get('payment_country_rule', 1);
$country = 0;
switch($payment_country_rule) {
case 2:
if(isset($dataAddress['scountry']) &&
(int)$dataAddress['scountry']) {
$country = (int)$dataAddress['scountry'];
}
break;
case 3:
if(isset($dataAddress['bcountry']) &&
(int)$dataAddress['bcountry']) {
$country = (int)$dataAddress['bcountry'];
} else if(isset($dataAddress['scountry']) &&
(int)$dataAddress['scountry']) {
$country = (int)$dataAddress['scountry'];
}
break;
case 4:
if(isset($dataAddress['scountry']) &&
(int)$dataAddress['scountry']) {
$country = (int)$dataAddress['scountry'];
} else if(isset($dataAddress['bcountry']) &&
(int)$dataAddress['bcountry']) {
$country = (int)$dataAddress['bcountry'];
}
break;
case 1:
default:
if(isset($dataAddress['bcountry']) &&
(int)$dataAddress['bcountry']) {
$country = (int)$dataAddress['bcountry'];
}
break;
}
return $country;
}
public static function getUserRegionPayment($dataAddress) {
$pC = PhocacartUtils::getComponentParameters();
$payment_region_rule = $pC->get('payment_region_rule',
1);
$region = 0;
switch($payment_region_rule) {
case 2:
if(isset($dataAddress['sregion']) &&
(int)$dataAddress['sregion']) {
$region = (int)$dataAddress['sregion'];
}
break;
case 3:
if(isset($dataAddress['bregion']) &&
(int)$dataAddress['bregion']) {
$region = (int)$dataAddress['bregion'];
} else if(isset($dataAddress['sregion']) &&
(int)$dataAddress['sregion']) {
$region = (int)$dataAddress['sregion'];
}
break;
case 4:
if(isset($dataAddress['sregion']) &&
(int)$dataAddress['sregion']) {
$region = (int)$dataAddress['sregion'];
} else if(isset($dataAddress['bregion']) &&
(int)$dataAddress['bregion']) {
$region = (int)$dataAddress['bregion'];
}
break;
case 1:
default:
if(isset($dataAddress['bcountry']) &&
(int)$dataAddress['bcountry']) {
$region = (int)$dataAddress['bcountry'];
}
break;
}
return $region;
}
public function getPaymentMethod($paymentId) {
//$paramsC = PhocacartUtils::getComponentParameters();
//$shipping_amount_rule = $paramsC->get(
'shipping_amount_rule', 0 );
$db = JFactory::getDBO();
/*$query = ' SELECT p.id, p.title, p.image,'
.' FROM #__phocacart_payment_methods AS s'
.' WHERE p.id = '.(int)$paymentId
.' LIMIT 1';
$db->setQuery($query);*/
$query = ' SELECT p.id, p.tax_id, p.cost, p.cost_additional,
p.calculation_type, p.title, p.image, p.method, p.params, p.description,
'
.' t.id as taxid, t.title as taxtitle, t.tax_rate as taxrate,
t.calculation_type as taxcalculationtype'
.' FROM #__phocacart_payment_methods AS p'
.' LEFT JOIN #__phocacart_taxes AS t ON t.id = p.tax_id'
.' WHERE p.id = '.(int)$paymentId
.' ORDER BY p.id'
.' LIMIT 1';
$db->setQuery($query);
$payment = $db->loadObject();
if (isset($payment->params)) {
$registry = new JRegistry;
//$registry->loadString($payment->params);
if (isset($payment->params)) {
$registry->loadString($payment->params);
}
$payment->params = $registry;
//$payment->paramsArray = $registry->toArray();
}
return $payment;
}
/**
* Store payment id inside checkout - if enabled in parameters and there
is only one valid payment, it can be directly stored
* But then the cart needs to be reloaded to store the costs of the
payment and make ready for payment (payment gets info about payment because
of rules)
* @param $paymentId
* @param $userId
*/
public function storePaymentRegistered($paymentId, $userId)
{
$row = JTable::getInstance('PhocacartCart', 'Table');
if ((int)$userId > 0) {
if (!$row->load(array('user_id' => (int)$userId,
'vendor_id' => 0, 'ticket_id' => 0,
'unit_id' => 0, 'section_id' => 0))) {
return false;// there must be some info in cart yet
}
}
if (!empty($row->cart)) {
$data['payment'] = (int)$paymentId;
$data['user_id'] = (int)$userId;
$data['payment'] = (int)$paymentId;
//$data['coupon'] = // Not set when automatically adding;
//$data['reward'] = // Not set when automatically adding;
if (!$row->bind($data)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
$row->date = gmdate('Y-m-d H:i:s');
if (!$row->check()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
if (!$row->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
return (int)$paymentId;
}
return false;
}
/*
* Important function - when e.g. user changes the address or change the
items in cart, the payment method
* needs to be removed or revised, because user can get payment advantage
when he orders 10 items but after changing
* cart to e.g. one item, payment cannot stay the same, the same happens
with countries and region
*/
public static function removePayment($type = 0, $removeCoupon = 1) {
if ($type == 0 || $type == 1) {
$session = JFactory::getSession();
$session->set('guestpayment', false,
'phocaCart');
if ($removeCoupon == 1) {
$session->set('guestcoupon', false,
'phocaCart');
}
$session->set('guestloyaltycardnumber', false,
'phocaCart');
}
if ($type == 0) {
$db = JFactory::getDBO();
$user = $vendor = $ticket = $unit = $section = array();
$dUser = PhocacartUser::defineUser($user, $vendor, $ticket, $unit,
$section);
$set = array();
$pos_payment_force = 0;
if (PhocacartPos::isPos()) {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$pos_payment_force = $paramsC->get( 'pos_payment_force', 0
);
if ((int)$pos_payment_force > 0) {
$pos_payment_force =
PhocacartPayment::isPaymentMethodActive($pos_payment_force) === true ?
(int)$pos_payment_force : 0;
}
if ($removeCoupon == 1 && $pos_payment_force == 0) {
$set[] = 'coupon = 0';
}
} else {
if ($removeCoupon == 1) {
$set[] = 'coupon = 0';
}
}
$set[] = 'payment = '.(int)$pos_payment_force;
$sets = implode(', ', $set);
$query = 'UPDATE #__phocacart_cart_multiple SET '.$sets
.' WHERE user_id = '.(int)$user->id
.' AND vendor_id = '.(int)$vendor->id
.' AND ticket_id = '.(int)$ticket->id
.' AND unit_id = '.(int)$unit->id
.' AND section_id = '.(int)$section->id;
$db->setQuery($query);
$db->execute();
}
return true;
}
/* Checkout - is there even some payment NOT is used reverse - used only
in online shop type
* This function is different to getPossiblePaymentMethods()
*
* getPossiblePaymentMethods() - all methods they fit the criterias (e.g.
amount rule, contry rule, etc.)
* isPaymentNotUsed() - all existing methods in shop which are published
*
* * IF NO PAYMENT METHOD EXIST - it is ignored when 1)
skip_payment_method parameter is enabled 2) all products are digital and
skip_payment_method is enabled
*
* */
public static function isPaymentNotUsed($options = array()) {
$paramsC = PhocacartUtils::getComponentParameters();
$skip_payment_method = $paramsC->get( 'skip_payment_method',
0 );
// 1) TEST IF ANY PAYMENT METHOD EXISTS
$db =JFactory::getDBO();
$query = 'SELECT a.id'
.' FROM #__phocacart_payment_methods AS a'
.' WHERE a.published = 1'
.' AND a.type IN (0,1)'
.' ORDER BY id LIMIT 1';
$db->setQuery($query);
$methods = $db->loadObjectList();
if (empty($methods) && $skip_payment_method == 2) {
return true;
}
// 2) TEST IF PAYMENT METHOD IS NOT DISABLED FOR CART WITH EMPTY PRICE
(CART SUM = 0)
if (isset($options['order_amount_zero']) &&
$options['order_amount_zero'] == 1 &&
$skip_payment_method == 1) {
return true;
}
return false;
}
/*
* Get all PCP Plugins
*/
public static function getPaymentPluginMethods($namePlugin = '')
{
$plugin = array();
$plugin['name'] = $namePlugin;
$plugin['group'] = 'pcp';
$plugin['title'] = 'Phoca Cart Payment';
$plugin['selecttitle'] =
JText::_('COM_PHOCACART_SELECT_PAYMENT_METHOD');
$plugin['returnform'] = 1;
return PhocacartPlugin::getPluginMethods($plugin);
}
public static function proceedToPaymentGateway($payment) {
$proceed = 0;
$message = array();
if (isset($payment['method'])) {
//$dispatcher = J EventDispatcher::getInstance();
JPluginHelper::importPlugin('pcp',
htmlspecialchars(strip_tags($payment['method'])));
$eventData = array();
$eventData['pluginname'] =
htmlspecialchars(strip_tags($payment['method']));
\JFactory::getApplication()->triggerEvent('PCPbeforeProceedToPayment',
array(&$proceed, &$message, $eventData));
}
// Response is not a part of event parameter because of backward
compatibility
$response['proceed'] = $proceed;
$response['message'] = $message;
return $response;
}
/*
* Used in POS - we can define forced payment method in Global
Configuration
* But if user unpublish this method, we need to test it
*/
public static function isPaymentMethodActive($id) {
$db =JFactory::getDBO();
$query = 'SELECT a.id'
.' FROM #__phocacart_payment_methods AS a'
.' WHERE a.published = 1'
.' AND a.type IN (0,2)'// IT IS A POS (0 common, 2 POS)
.' AND a.id = '.(int)$id
.' ORDER BY id LIMIT 1';
$db->setQuery($query);
$method = $db->loadResult();
if ((int)$method > 0) {
return true;
}
return false;
}
public static function getInfoDescriptionById($id) {
if ((int)$id > 0) {
$db =JFactory::getDBO();
$query = 'SELECT a.description_info'
.' FROM #__phocacart_payment_methods AS a'
.' WHERE a.published = 1'
.' AND a.type IN (0,2)'// IT IS A POS (0 common, 2 POS)
.' AND a.id = '.(int)$id
.' ORDER BY id LIMIT 1';
$db->setQuery($query);
return $db->loadResult();
}
}
/**
* @param $methodName
* @param int $return 1 ... Association list, 2 ... Object list, 3 ... ID
(be aware when setting 3, only first ID will be returned even more methods
with the same method name can exist)
* @param bool $onlyPublished
* @return mixed
*/
protected function getPaymentMethodIdByMethodName($methodName, $return =
3, $onlyPublished = false) {
$db = JFactory::getDBO();
$query = ' SELECT p.id'
.' FROM #__phocacart_payment_methods AS p'
.' WHERE p.method = '.$db->quote($methodName);
if ($onlyPublished) {
$query .= ' AND p.published = 1';
}
$query .= ' ORDER BY p.id';
if ($return == 3) {
$query .= ' LIMIT 1';
}
$db->setQuery($query);
if ($return == 1) {
return $db->loadAssocList();
} else if ($return == 2) {
return $db->loadObjectList();
} else if ($return == 3) {
$result = (array) $db->loadObject();
return $result["id"];
}
return false;
}
}
?>
PK�"�[�#o,,"libraries/phocacart/pdf/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[���>libraries/phocacart/pdf/pdf.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class PhocacartPdf
{
public static function replacePdfVariables($text) {
}
public static function skipStartAndLastTag($text, $tag = 'p') {
$pattern =
"=^<".$tag.">(.*)</".$tag.">$=i";
preg_match($pattern, $text, $matches);
if (isset($matches[1])) {
return $matches[1];
}
return $text;
}
}
?>PK�"�[�#o,,%libraries/phocacart/plugin/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�
X�� � %libraries/phocacart/plugin/plugin.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartPlugin
{
public static function getPluginMethods($plugin) {
$p = array();
if (!isset($plugin['name'])) {$p[0] = false;return $p;}
if (!isset($plugin['group'])) {$p[0] = false;return $p;}
if (!isset($plugin['title'])) {$plugin['title'] =
'';}
if (!isset($plugin['selectitle']))
{$plugin['selectitle'] =
JText::_('COM_PHOCACART_SELECT_PLUGIN');}
if (!isset($plugin['returnform']))
{$plugin['returnform'] = 1;}
$db = JFactory::getDBO();
$lang = JFactory::getLanguage();
$client = JApplicationHelper::getClientInfo(0);
$query = 'SELECT a.extension_id , a.name, a.element, a.folder'
.' FROM #__extensions AS a'
.' WHERE a.type = '.$db->quote('plugin')
.' AND a.enabled = 1'
.' AND a.folder = ' .
$db->quote($plugin['group']);
if ($plugin['name'] != '') {
$query .= 'AND a.element = '.
$db->quote($plugin['name']);
}
$query .= ' ORDER BY a.ordering';
$db->setQuery($query);
$plugins = $db->loadObjectList();
if ($plugin['name'] == '') {
$i = 0;
$p[0]['text'] = '- '
.$plugin['selecttitle'].' -';
$p[0]['value'] = '';
} else {
$i = -1;
}
if (!empty($plugins)) {
foreach($plugins as $k => $v) {
// Load the core and/or local language file(s).
$folder = $plugin['group'];
$element = $v->element;
$lang->load('plg_'.$folder.'_'.$element,
JPATH_ADMINISTRATOR, null, false, false)
|| $lang->load('plg_'.$folder.'_'.$element,
$client->path.'/plugins/'.$folder.'/'.$element,
null, false, false)
|| $lang->load('plg_'.$folder.'_'.$element,
JPATH_ADMINISTRATOR, $lang->getDefault(), false, false)
|| $lang->load('plg_'.$folder.'_'.$element,
$client->path.'/plugins/'.$folder.'/'.$element,
$lang->getDefault(), false, false);
$i++;
$name = JText::_(strtoupper($v->name) );
$name = str_replace('Plugin', '', $name);
$name = str_replace($plugin['title'] . ' -',
'', $name);
$p[$i]['text'] = JText::_($name);
$p[$i]['value'] = $v->element;
}
}
if ($plugin['returnform'] == 0) {
return $plugins;
}
if ($plugin['name'] != '' && !empty($p[0])) {
return $p[0];
}
return $p;
}
}
?>
PK�"�[�#o,,"libraries/phocacart/pos/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�h��#�#libraries/phocacart/pos/pos.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class PhocacartPos
{
public static function updateUserCart($vendorId, $ticketId, $unitId = 0,
$sectionId = 0, $userId = 0, $loyaltyCardNumber = '') {
// User ID, section ID and unit ID can be null (deselect user)
if ((int)$vendorId > 0 && (int)$ticketId > 0) {
$db = JFactory::getDBO();
$date = JFactory::getDate();
$now = $date->toSql();
/*$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$pos_payment_force = $paramsC->get( 'pos_payment_force', 0
);
$pos_shipping_force = $paramsC->get( 'pos_shipping_force',
0 );*/
$query = 'UPDATE #__phocacart_cart_multiple'
.' SET user_id = '.(int)$userId.','
.' date = '.$db->quote($now).','
.' loyalty_card_number = '.$db->quote($loyaltyCardNumber)
.' WHERE vendor_id = '.(int)$vendorId
.' AND ticket_id = '.(int)$ticketId
.' AND unit_id = '.(int)$unitId
.' AND section_id = '.(int)$sectionId;
$db->setQuery($query);
$db->execute();
return true;
}
return false;
}
public static function getUserIdByVendorAndTicket($vendorId, $ticketId,
$unitId, $sectionId) {
if ((int)$vendorId > 0 && (int)$ticketId > 0) {
$db = JFactory::getDBO();
$query = ' SELECT user_id FROM #__phocacart_cart_multiple'
.' WHERE vendor_id = '.(int)$vendorId
.' AND ticket_id = '.(int)$ticketId
.' AND unit_id = '.(int)$unitId
.' AND section_id = '.(int)$sectionId
.' ORDER BY user_id LIMIT 1';
$db->setQuery($query);
$result = $db->loadResult();
if ((int)$result > 0) {
return (int)$result;
}
return 0;
}
return 0;
}
public static function getCardByVendorAndTicket($vendorId, $ticketId,
$unitId, $sectionId, $userId = 0) {
if ((int)$vendorId > 0 && (int)$ticketId > 0) {
$db = JFactory::getDBO();
$query = ' SELECT loyalty_card_number FROM
#__phocacart_cart_multiple'
.' WHERE vendor_id = '.(int)$vendorId
.' AND ticket_id = '.(int)$ticketId
.' AND unit_id = '.(int)$unitId
.' AND section_id = '.(int)$sectionId
.' AND user_id = '.(int)$userId
.' ORDER BY loyalty_card_number LIMIT 1';
$db->setQuery($query);
$result = $db->loadResult();
if ($result != '') {
return $result;
}
return '';
}
return '';
}
public static function isPosView() {
$isView = PhocacartUtils::isView('pos');
$isController = PhocacartUtils::isController('pos');
if ($isView || $isController) {
return true;
}
return false;
}
public static function isPos($forcePos = 0) {
// We check if we are located in POS view or POS controller
$isView = PhocacartUtils::isView('pos');
$isTypeView = PhocacartUtils::isTypeView('Pos');
$isController = PhocacartUtils::isController('pos');
if (!PhocacartPos::isPosEnabled()){
if ($isView || $isTypeView || $isController) {
// Return the error info only in case of POS view or controller
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('COM_PHOCACART_POS_IS_DISABLED'),
'error');
}
return false;
}
if ($forcePos) {
// We are not located in POS view but we ask some view
// where we need POS rules (for example - in POS we are ask Order view
// to display invoices)
return true;
} else {
if ($isView || $isTypeView || $isController) {
return true;
}
return false;
}
return false;
}
public static function isPosEnabled() {
$pC = PhocacartUtils::getComponentParameters();
$pos_enabled = $pC->get( 'pos_enabled', 0 );
if($pos_enabled){
return true;
}
return false;
}
/*
public static function getUserByVendorAndTicket($vendorId, $ticketId) {
if ((int)$vendorId > 0 && (int)$ticketId > 0) {
$db = JFactory::getDBO();
$query = ' SELECT a.user_id, u.id, u.name, u.user_name, u.email
FROM #__phocacart_cart_multiple AS a'
.' LEFT JOIN #__users AS u ON a_user_id = u.id'
.' WHERE a.vendor_id = '.(int)$vendorId
.' AND a.ticket_id = '.(int)$ticketId
.' ORDER BY a.user_id LIMIT 1';
$db->setQuery($query);
$result = $db->loadObject();
return $result;
}
return false;
}*/
public static function renderPosPage() {
$document = JFactory::getDocument();
$pC = PhocacartUtils::getComponentParameters();
/*
* Page
* +---------------------------------+
* | top |
* +---------------------------------+
* | main |
* | +---------------+-------------+ |
* | |filter | cart | |
* | |---------------| | |
* | |categories | | |
* | |---------------+-------------| |
* | |content | input | |
* | +---------------+-------------+ |
* |---------------------------------|
* | bottom |
* +---------------------------------+
*
* content: products, customers, shipping, payment, ...
*/
$s = array();
$s[0]['top'] = $pC->get( 'pos_layout_top', 8
);//8
$s[0]['bottom'] = $pC->get( 'pos_layout_bottom',
6 );//6
$s[0]['mainfilter'] = $pC->get(
'pos_layout_mainfilter', 80 );//8 // MUST BE SMALLER THAN main -
(top + bottom)
$s[0]['maincategories'] = $pC->get(
'pos_layout_maincategories', 4 );//6 // MUST BE SMALLER THAN main
- (top + bottom + main filter)
$s[0]['maincart'] = $pC->get(
'pos_layout_maincart', 50 );//50 // MUST BE SMALLER THAN main -
(top + bottom)
// Virtual Keyboard e.g.
$vK = $pC->get( 'pos_layout_media_maxheight',
'24rem' );//'24rem';
$s[1]['top'] = $pC->get(
'pos_layout_top_maxheight', 16 );//16;//8
$s[1]['bottom'] = $pC->get(
'pos_layout_bottom_maxheight', 1 );//1;//6
$s[1]['mainfilter'] = $pC->get(
'pos_layout_mainfilter_maxheight', 16 );//16;//8
$s[1]['maincategories'] = $pC->get(
'pos_layout_maincategories_maxheight', 13 );//13;//6
$s[1]['maincart'] = $pC->get(
'pos_layout_maincart_maxheight', 70 );//70;//50
$o = array();
foreach ($s as $k => $v) {
$s[$k]['main'] = 100 - $s[$k]['top'] -
$s[$k]['bottom'];
$s[$k]['maincolleft'] = $s[$k]['main'];
$s[$k]['maincolright'] = $s[$k]['main'];
$s[$k]['mainpage'] = $s[$k]['main'];
$s[$k]['maincontent'] = $s[$k]['main'] -
$s[$k]['mainfilter'] - $s[$k]['maincategories'];
$s[$k]['maininput'] = $s[$k]['main'] -
$s[$k]['maincart'];
if ($k == 1) {
$o[] = '@media (max-height: '.$vK.') {';
}
$o[] = '.ph-pos-wrap-top
{height:'.(int)$s[$k]['top'].'vh}';
$o[] = '.ph-pos-wrap-main
{height:'.(int)$s[$k]['main'].'vh}';
$o[] = '.ph-pos-wrap-bottom
{height:'.(int)$s[$k]['bottom'].'vh}';
$o[] = '.ph-pos-main-column-left
{height:'.(int)$s[$k]['maincolleft'].'vh}';
$o[] = '.ph-pos-main-column-right
{height:'.(int)$s[$k]['maincolleft'].'vh}';
$o[] = '.ph-pos-main-filter
{height:'.(int)$s[$k]['mainfilter'].'vh}';
$o[] = '.ph-pos-main-categories
{height:'.(int)$s[$k]['maincategories'].'vh}';
$o[] = '.ph-pos-main-content
{height:'.(int)$s[$k]['maincontent'].'vh}';
$o[] = '.ph-pos-main-cart
{height:'.(int)$s[$k]['maincart'].'vh}';
$o[] = '.ph-pos-main-input
{height:'.(int)$s[$k]['maininput'].'vh}';
$o[] = '.ph-pos-main-page
{height:'.(int)$s[$k]['mainpage'].'vh}';
if ($k == 1) {
$o[] = '}';
}
}
$document->addCustomTag('<style
type="text/css">'.implode("\n",
$o).'</style>');
}
public static function getPreferredSku() {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$pos_preffered_sku = $paramsC->get( 'pos_preferred_sku',
'sku' );
$a = array();
$a['name'] = $pos_preffered_sku;
switch ($pos_preffered_sku) {
case 'upc': $a['title'] =
JText::_('COM_PHOCACART_FIELD_UPC_LABEL'); break;
case 'ean': $a['title'] =
JText::_('COM_PHOCACART_FIELD_EAN_LABEL'); break;
case 'jan': $a['title'] =
JText::_('COM_PHOCACART_FIELD_JAN_LABEL'); break;
case 'isbn': $a['title'] =
JText::_('COM_PHOCACART_FIELD_ISBN_LABEL'); break;
case 'mpn': $a['title'] =
JText::_('COM_PHOCACART_FIELD_MPN_LABEL'); break;
case 'serial_number': $a['title'] =
JText::_('COM_PHOCACART_FIELD_SERIAL_NUMBER_LABEL'); break;
case 'registration_key':$a['title'] =
JText::_('COM_PHOCACART_FIELD_REGISTRATION_KEY_LABEL'); break;
default: case 'sku': $a['title'] =
JText::_('COM_PHOCACART_FIELD_SKU_LABEL'); break;
}
return $a;
}
}
?>
PK�"�[��+f//!libraries/phocacart/pos/print.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
require JPATH_ADMINISTRATOR .
'/components/com_phocacart/libraries/autoloadEscpos.php';
use Mike42\Escpos\Printer;
use Mike42\Escpos\EscposImage;
use Joomla\String\StringHelper;
class PhocacartPosPrint
{
public $lineLength;
public $lineLengthDoubleSize;
public $lineSeparator;
private $printer;
private $connector = null;
public function __construct($directPrint = 0) {
$pC = PhocacartUtils::getComponentParameters();
$this->lineLength = $pC->get(
'pos_print_line_length', 42 );
$this->lineLengthDoubleSize = $pC->get(
'pos_print_line_length_double', 21 );
$this->lineSeparator = $pC->get( 'pos_print_line_sep',
'-' );
// $this->lineEnd = $pC->get( 'pos_print_line_end',
"\n" );
$this->lineEnd = "\n";
if (StringHelper::strlen($this->lineSeparator) > 1) {
$this->lineSeparator = substr($this->lineSeparator, 0, 1);
}
if ($directPrint) {
$pos_print_connector = $pC->get( 'pos_print_connector', 1
);
$pos_print_connector_file = $pC->get(
'pos_print_connector_file', '' );
$pos_print_connector_dest = $pC->get(
'pos_print_connector_dest', '' );
$pos_print_connector_ip = $pC->get(
'pos_print_connector_ip', '' );
$pos_print_connector_port = $pC->get(
'pos_print_connector_port', "9100" );
$pos_print_connector_timeout = $pC->get(
'pos_print_connector_timeout', 0 );
switch($pos_print_connector) {
case "2":
if ($pos_print_connector_ip != '') {
$this->connector = new
Mike42\Escpos\PrintConnectors\NetworkPrintConnector($pos_print_connector_ip,
$pos_print_connector_port, $pos_print_connector_timeout);
} else {
//throw new Exception('Printer Settings Error: No IP set',
500);
PhocacartLog::add(2, 'Printer Settings Error: No IP set');
return false;
}
break;
case "3":
if ($pos_print_connector_dest != '') {
$this->connector = new
Mike42\Escpos\PrintConnectors\WindowsPrintConnector($pos_print_connector_dest);
} else {
//throw new Exception('Printer Settings Error: No Destination
set', 500);
PhocacartLog::add(2, 'Printer Settings Error: No Destination
set');
return false;
}
break;
case "4":
if ($pos_print_connector_dest != '') {
$this->connector = new
Mike42\Escpos\PrintConnectors\CupsPrintConnector($pos_print_connector_dest);
} else {
//throw new Exception('Printer Settings Error: No Destination
set', 500);
PhocacartLog::add(2, 'Printer Settings Error: No Destination
set');
return false;
}
break;
case 1:
default:
if ($pos_print_connector_file != '') {
$this->connector = new
Mike42\Escpos\PrintConnectors\FilePrintConnector($pos_print_connector_file);
} else {
//throw new Exception('Printer Settings Error: No File
set', 500);
PhocacartLog::add(2, 'Printer Settings Error: No File
set');
return false;
}
break;
}
}
}
public function printSeparator($sep = '', $class = '')
{
if ($sep == '') {
$sep = $this->lineSeparator;
}
$lineEnd = $this->lineEnd;
if ($sep == '_') {
$lineEnd = $this->lineEnd . $this->lineEnd;
}
$startTag = '<div>';
$endTag = '</div>';
if ($class != '') {
$startTag = '<div
class="'.$class.'">';
}
if ($class == 'pDoubleSize') {
return $startTag . str_repeat($sep, $this->lineLengthDoubleSize)
.$endTag . $lineEnd;
} else {
return $startTag . str_repeat($sep, $this->lineLength) .$endTag.
$lineEnd;
}
}
public function printLineColumns($items, $ignoreLength = 0, $class =
'') {
$startTag = '<div>';
$endTag = '</div>';
if ($class != '') {
$startTag = '<div
class="'.$class.'">';
}
$item = array();
$item['output'] = array();
$item['outputcolumn1'] = '';
$item['outputcolumn2'] = '';
$item['length'] = array();
$item['lengthcolumn1'] = 0;
$item['lengthcolumn2'] = 0;
$item['lengthsum'] = 0;
$item['count'] = count($items);
$item['lastitem'] = $item['count'] - 1;
if (!empty($items)) {
foreach($items as $k => $v) {
$item['output'][$k] = $v;
$item['length'][$k] = StringHelper::strlen($v);
$item['lengthsum'] += StringHelper::strlen($v);
// Divide all items into two columns (left and rights
// First left column are all items except the last one
// Second right column is only last item
// If there is only one item (first = last) - don't set it as
last
if ($k == $item['lastitem'] && $k > 0){
$item['outputcolumn2'] = $item['outputcolumn2']
!= '' ? $item['outputcolumn2'] . ' ' . $v :
$v;
$item['lengthcolumn2'] =
StringHelper::strlen($item['outputcolumn2']);
} else {
$item['outputcolumn1'] = $item['outputcolumn1']
!= '' ? $item['outputcolumn1'] . ' ' . $v :
$v;
$item['lengthcolumn1'] =
StringHelper::strlen($item['outputcolumn1']);
}
}
}
if ($ignoreLength == 1){
return $startTag . trim(implode (' ',
$item['output'])) . $endTag . $this->lineEnd;
}
if ($class == 'pDoubleSize') {
$sizeRow = $this->lineLengthDoubleSize;
} else {
$sizeRow = $this->lineLength;
}
$o = '';
$spaces = 0;
$newLengthSum = (int)$item['lengthcolumn1'] +
(int)$item['lengthcolumn2'];
// We need to count each column because the became larger through join of
spaces
if ($newLengthSum < (int)$sizeRow || $newLengthSum == (int)$sizeRow)
{
// OK - we can add all items to one row
$spaces = (int)$sizeRow - $newLengthSum;
$length = (int)$item['lengthcolumn1'] + $spaces;
//$item['outputcolumn1'] = str_replace('€',
'E', $item['outputcolumn1']);
//$item['outputcolumn2'] = str_replace('€',
'E', $item['outputcolumn2']);
$o .= $startTag .
StringHelper::str_pad($item['outputcolumn1'], $length, '
', STR_PAD_RIGHT) . $item['outputcolumn2'] . $endTag .
$this->lineEnd;
} else {
$o .= $startTag . $item['outputcolumn1'] . $endTag .
$this->lineEnd;
// Possible TO DO - divide first column into blocks by items
$o .= $startTag . $item['outputcolumn2'] . $endTag .
$this->lineEnd;
}
return $o;
}
public function printLine($items, $class = '') {
$o = '';
$startTag = '<div>';
$endTag = '</div>';
if ($class != '') {
$startTag = '<div
class="'.$class.'">';
}
if (!empty($items)) {
foreach($items as $k => $v) {
$o .= $startTag . $v . $endTag . $this->lineEnd;
}
}
return $o;
}
public function printImage($img = '') {
$o = '';
if ($img != '') {
$o .= '<img src="'.JURI::root(false).
''.$img.'" data-src="'.$img.'"
/>'. $this->lineEnd;
}
return $o;
}
public function printFeed($number = 0) {
$o = '';
if ((int)$number > 0) {
$o .= '<div class="pFeed"
data-value="'.(int)$number.'"></div>'.
$this->lineEnd;
}
return $o;
}
public function printOrder($o) {
$oA = explode($this->lineEnd, $o);
if (!empty($oA)) {
try{
if ($this->connector instanceof
Mike42\Escpos\PrintConnectors\PrintConnector) {
$printer = new Printer($this->connector);
$doc = new DOMDocument();
foreach ($oA as $k => $v) {
if (strpos($v, '<div') === 0) {
$doc->loadHTML($this->cleanOutput($v));
$xpath = new DOMXPath($doc);
$class = $xpath->evaluate("string(//div/@class)");
switch($class) {
case 'pDoubleSize':
$printer->selectPrintMode(Printer::MODE_DOUBLE_HEIGHT |
Printer::MODE_DOUBLE_WIDTH);
$printer->setEmphasis(true);
$printer->text(strip_tags($v) . $this->lineEnd);
$printer->setEmphasis(false);
$printer->selectPrintMode();
break;
case 'pDoubleSizeCenter':
$printer->selectPrintMode(Printer::MODE_DOUBLE_HEIGHT |
Printer::MODE_DOUBLE_WIDTH);
$printer->setJustification(Printer::JUSTIFY_CENTER);
$printer->text(strip_tags($v) . $this->lineEnd);
$printer->setJustification();
$printer->selectPrintMode();
break;
case 'pCenter':
$printer->setJustification(Printer::JUSTIFY_CENTER);
$printer->text(strip_tags($v) . $this->lineEnd);
$printer->setJustification();
break;
case 'pLeft':
$printer->setJustification(Printer::JUSTIFY_LEFT);
$printer->text(strip_tags($v) . $this->lineEnd);
$printer->setJustification();
break;
case 'pRight':
$printer->setJustification(Printer::JUSTIFY_RIGHT);
$printer->text(strip_tags($v) . $this->lineEnd);
$printer->setJustification();
break;
case 'pUnderline':
$printer->selectPrintMode(Printer::UNDERLINE_SINGLE);
$printer->text(strip_tags($v) . $this->lineEnd);
$printer->selectPrintMode();
break;
case 'pFeed':
$protectionLimit = 20;
$number =
$xpath->evaluate("string(//div/@data-value)");
if ((int)$number > 0 && (int)$number <
$protectionLimit) {
$printer->feed((int)$number);
}
break;
default:
$printer->text(strip_tags($v) . $this->lineEnd);
break;
}
} else if (strpos($v, '<img') === 0) {
$doc->loadHTML($this->cleanOutput($v));
$xpath = new DOMXPath($doc);
$src = $xpath->evaluate("string(//img/@data-src)");
$srcAbs = JPATH_ROOT . '/' . $src;
if (JFile::exists($srcAbs)) {
$printer->setJustification(Printer::JUSTIFY_CENTER);
$image = EscposImage::load($srcAbs, false);
$printer->bitImage($image);
$printer->setJustification();
}
} else {
$printer->text(strip_tags($v) . $this->lineEnd);
}
}
$printer -> feed(2);
$printer -> cut();
$printer -> close();
} else {
PhocacartLog::add(2, 'Server Printer Not Set - see POS Print
Settings');
ob_get_clean();
}
} catch ( Exception $e ) {
PhocacartLog::add(2, 'Server Printer Error:
'.$e->getMessage());
ob_get_clean();
}
}
//- $connector = new
Mike42\Escpos\PrintConnectors\WindowsPrintConnector("COM1");
//- $printer = new Printer($connector);
//$printer -> setEmphasis(false);
//- $printer -> text($o);
//$printer -> selectPrintMode(Printer::MODE_FONT_B);
/*$printer -> setJustification(Printer::JUSTIFY_LEFT);
$printer -> setEmphasis(true);
$printer -> text($o);
$printer -> setEmphasis(false);
$printer -> text($o);
$printer -> setUnderline(true);
$printer -> text($o);
$printer -> setUnderline(false);
$printer -> selectPrintMode(Printer::MODE_DOUBLE_HEIGHT |
Printer::MODE_DOUBLE_WIDTH);
$printer -> text($o);
$printer -> selectPrintMode();// Reset
/*$printer -> selectPrintMode(Printer::MODE_EMPHASIZED);
$printer -> text($o);
$printer -> selectPrintMode(Printer::MODE_DOUBLE_HEIGHT);
$printer -> text($o);
$printer -> selectPrintMode(Printer::MODE_DOUBLE_WIDTH);
$printer -> text($o);
$printer -> selectPrintMode(Printer::MODE_UNDERLINE);
$printer -> text($o);*/
//- $printer -> setJustification();// Reset
//- $printer -> selectPrintMode();// Reset
//- $printer -> feed(5);
//- $printer -> cut();
//$printer -> pulse();
//- $printer -> close();
}
public function cleanOutput($text) {
$text = str_replace('&', '&', $text);
return $text;
}
}
?>
PK�"�[��{%%'libraries/phocacart/price/bulkprice.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
use Joomla\Utilities\ArrayHelper;
defined('_JEXEC') or die();
class PhocacartPriceBulkprice
{
public static function getItem($id) {
$db = JFactory::getDBO();
$query = 'SELECT a.* FROM #__phocacart_bulk_prices AS a WHERE a.id =
'.(int)$id .' LIMIT 1';
$db->setQuery( $query );
$item = $db->loadObject();
if (isset($item->id) && (int)$item->id > 0 &&
isset($item->params) && $item->params != '') {
$registry = new JRegistry;
$registry->loadString($item->params);
$item->params = $registry;
$categories = $item->params->get('catid_multiple',
array());
if (!empty($categories)) {
$categoriesString = implode(',', $categories);
$query = 'SELECT a.id, a.title FROM #__phocacart_categories AS
a WHERE a.id IN ('.$categoriesString.')';
$db->setQuery( $query );
$item->categories = $db->loadObjectList();
$item->categories_string = $categoriesString;
}
$wheres = array();
if (!empty($categories)) {
$wheres[] = ' c.id IN ('.$categoriesString.')';
$lefts = array();
$lefts[] = ' #__phocacart_product_categories AS pc ON
pc.product_id = p.id';
$lefts[] = ' #__phocacart_categories AS c ON c.id =
pc.category_id';
}
// RUN - we get info about how many products can be affected (from
products table)
$query = 'SELECT COUNT(p.id) FROM #__phocacart_products AS
p'
. (!empty($lefts) ? ' LEFT JOIN ' . implode(' LEFT JOIN
', $lefts) : '')
. (!empty($wheres) ? ' WHERE ' . implode(' AND
', $wheres) : '');
$db->setQuery($query);
$count = $db->loadResult();
$item->productcount = $count;
// REVERT - we get info how many products were changes and can be
reverted (from price history table)
}
return $item;
}
public static function setNewPrice($productId, $price, $params) {
$newPrice = $price;
$amount = $params->get('amount',
'');
$operator = $params->get('operator',
'-');
$calculation_type =
$params->get('calculation_type', 1);
$calculation_rounding =
$params->get('calculation_rounding', 2);// Bulk Price options
- no, 0, 1, 2 digits
$pC = PhocacartUtils::getComponentParameters();
$rounding_calculation =
$pC->get('rounding_calculation', 1);// Global Phoca Cart
options - round half up, round half down
if ($calculation_type == 0) {
// FIXED AMOUNT
if ($calculation_type == '+') {
$newPrice = $price + $amount;
} else {
$newPrice = $price - $amount;
}
} else {
// PERCENTAGE
if ($calculation_type == '+') {
$newPrice = $price + ($price * $amount / 100);
} else {
$newPrice = $price - ($price * $amount / 100);
}
}
if ($calculation_rounding > -1) {
$bruttoCurrency = round($newPrice, (int)$calculation_rounding,
$rounding_calculation);
}
if ($newPrice != $price) {
// Set new price
$db = JFactory::getDBO();
$query = 'UPDATE #__phocacart_products SET price = '
. $db->quote($newPrice) . ' WHERE id = ' . (int)$productId;
$db->setQuery($query);
$db->execute();
// Set price history
}
return $newPrice;
}
public static function setNewOriginalPrice($productId, $price_original,
$price, $params) {
$db = JFactory::getDBO();
$original_price_change_run =
$params->get('original_price_change_run', 0);
if ($original_price_change_run == 0) {
// No change
return $price_original;
} else if ($original_price_change_run == 1) {
// Current price becomes new original price
$query = 'UPDATE #__phocacart_products SET price_original =
'.$db->quote($price).' WHERE id = '.(int)$productId;
$db->setQuery($query);
$db->execute();
return $price;
} else if ($original_price_change_run == 2) {
// Original price will be emptied
$query = 'UPDATE #__phocacart_products SET price_original
= \'0\' WHERE id = '.(int)$productId;
$db->setQuery($query);
$db->execute();
return '';
}
return $price_original;
}
public static function setRevertPrice($productId, $bulkId, $price,
$params) {
$newPrice = $price;
$db = JFactory::getDBO();
$wheres = array();
$wheres[] = ' p.product_id = '.(int)$productId;
$wheres[] = ' p.bulk_id = '.(int)$bulkId;
$wheres[] = ' p.type = 2';
$q = 'SELECT p.current_price';
$q .= ' FROM #__phocacart_product_price_history AS p';
$q .= ' WHERE ' . implode(' AND ', $wheres);
$q .= ' ORDER BY p.id';
$q .= ' LIMIT 1';
$db->setQuery($q);
$newPrice = $db->loadResult();
if ($newPrice != $price) {
// Set new price
$query = 'UPDATE #__phocacart_products SET price = '
. $db->quote($newPrice) . ' WHERE id = ' . (int)$productId;
$db->setQuery($query);
$db->execute();
}
return $newPrice;
}
public static function setRevertOriginalPrice($productId, $bulkId,
$priceOriginal, $params) {
$newPrice = $priceOriginal;
$db = JFactory::getDBO();
$wheres = array();
$wheres[] = ' p.product_id = '.(int)$productId;
$wheres[] = ' p.bulk_id = '.(int)$bulkId;
$wheres[] = ' p.type = 2';
$q = 'SELECT p.current_price_original';
$q .= ' FROM #__phocacart_product_price_history AS p';
$q .= ' WHERE ' . implode(' AND ', $wheres);
$q .= ' ORDER BY p.id';
$q .= ' LIMIT 1';
$db->setQuery($q);
$newPrice = $db->loadResult();
if ($newPrice != $priceOriginal) {
// Set new price
$query = 'UPDATE #__phocacart_products SET price_original
= ' . $db->quote($newPrice) . ' WHERE id = ' .
(int)$productId;
$db->setQuery($query);
$db->execute();
}
return $newPrice;
}
public static function setStatus($id, $status) {
$db = JFactory::getDBO();
$query = 'UPDATE #__phocacart_bulk_prices SET status =
'.(int)$status.' WHERE id = '.(int)$id;
$db->setQuery($query);
$db->execute();
}
public static function removePriceHistoryItem($id) {
$db = JFactory::getDBO();
$query = ' DELETE '
.' FROM #__phocacart_product_price_history'
.' WHERE bulk_id = '. (int)$id
.' AND type = 2';
$db->setQuery($query);
$db->execute();
}
public static function removePriceHistoryItems($cid) {
$db = JFactory::getDBO();
ArrayHelper::toInteger($cid);
$cids = implode( ',', $cid );
$query = ' DELETE '
.' FROM #__phocacart_product_price_history'
.' WHERE bulk_id IN ( '. $cids.' )'
.' AND type = 2';
$db->setQuery($query);
$db->execute();
}
}
PK�"�[�|o#o#%libraries/phocacart/price/history.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartPriceHistory
{
public static function storePriceHistoryById($productId, $price, $type =
0) {
$date = JFactory::getDate();
$dateNow = $date->toSql();
$db = JFactory::getDBO();
$query = 'SELECT a.id, a.price, a.date'
.' FROM #__phocacart_product_price_history AS a'
.' WHERE a.product_id = '.(int) $productId
.' AND a.type IN (0,1)' // All except the bulk
price history
.' AND a.date = (SELECT MAX(date) FROM
#__phocacart_product_price_history WHERE product_id =
'.(int)$productId.' AND type IN (0,1))'
.' ORDER BY a.id';
$db->setQuery($query);
$history = $db->loadAssoc();
$price = PhocacartUtils::replaceCommaWithPoint($price);
if (isset($history['price']) &&
$history['price'] == $price) {
// Do nothing
} else if (isset($history['date']) &&
isset($history['id'])) {
$dateDb2 = Joomla\CMS\HTML\HTMLHelper::_('date',
$history['date'], 'Y-m-d');
$dateNow2 = Joomla\CMS\HTML\HTMLHelper::_('date', $dateNow ,
'Y-m-d');
if ($dateDb2 == $dateNow2) {
$query = ' UPDATE #__phocacart_product_price_history SET price =
'.$db->quote($price) . ', type = '.(int)$type
.' WHERE id = '.(int)$history['id'];
$db->setQuery($query);
$db->execute();
} else {
$query = ' INSERT INTO #__phocacart_product_price_history
(product_id, date, price, type)'
.' VALUES ('.(int)$productId.', NOW(),
'.$db->quote($price).', '.(int)$type.');';
$db->setQuery($query);
$db->execute();
}
} else if (empty($history)) {
$query = ' INSERT INTO #__phocacart_product_price_history
(product_id, date, price, type)'
.' VALUES ('.(int)$productId.', NOW(),
'.$db->quote($price).', '.(int)$type.');';
$db->setQuery($query);
$db->execute();
}
return true;
}
/*
* Difference to automatic way of adding history prices:
* custom - the same price can be used for more dates - we don't ask
for latest date
* automatic - when the same price then is is not written to database - we
ask for latest date so we can compare and detect
* that the latest price is the same and in such case we
don't add it to the database
*/
public static function storePriceHistoryCustomById($data, $productId,
$type = 0) {
$db = JFactory::getDBO();
$notDeleteIds = array();
if (!empty($data)) {
$i = 1;
foreach ($data as $k => $v) {
if (isset($v['date']) && isset($v['price'])
&& (float)$v['price'] > 0) {
$date = JFactory::getDate($v['date']);
$dateDb = $date->toSql();
$query = 'SELECT a.id'
.' FROM #__phocacart_product_price_history AS a'
.' WHERE a.product_id = '.(int) $productId
.' AND a.type IN (0,1)' // All except the
bulk price history
.' AND DATE_FORMAT(a.date, \'%Y-%m-%d\') =
DATE_FORMAT('.$db->quote($dateDb).',
\'%Y-%m-%d\')'
.' ORDER BY a.id';
$db->setQuery($query);
$history = $db->loadAssocList();
// Remove duplicates
if (!empty($history)) {
foreach($history as $k2 => $v2) {
if ((int)$k2 > 0 && (int)$v2['id'] > 0) {
$query = ' DELETE '
.' FROM #__phocacart_product_price_history'
.' WHERE product_id = '. (int)$productId
.' AND id = '.(int)$v2['id']
.' AND type IN (0,1)';
$db->setQuery($query);
$db->execute();
}
}
}
if (isset($history[0]['id']) &&
(int)$history[0]['id']) {
$query = ' UPDATE #__phocacart_product_price_history SET price =
'.$db->quote($v['price']) . ', type =
'.(int)$type. ', ordering = '.$i
.' WHERE id = '.(int)$history[0]['id'];
$db->setQuery($query);
$db->execute();
$i++;
$notDeleteIds[] = (int)$history[0]['id'];
} else {
$query = ' INSERT INTO #__phocacart_product_price_history
(product_id, date, price, type, ordering)'
.' VALUES ('.(int)$productId.',
'.$db->quote($dateDb).',
'.$db->quote($v['price']).',
'.(int)$v['type'].', '.$i.');';
$db->setQuery($query);
$db->execute();
$i++;
$newIdA = $db->insertid();
$notDeleteIds[] = (int)$newIdA;
}
}
}
// Remove all ids except the active
if (!empty($notDeleteIds)) {
$notDeleteIdsString = implode(',', $notDeleteIds);
$query = ' DELETE '
.' FROM #__phocacart_product_price_history'
.' WHERE product_id = '. (int)$productId
.' AND id NOT IN ('.$notDeleteIdsString.')'
.' AND type IN (0,1)';
} else {
$query = ' DELETE '
.' FROM #__phocacart_product_price_history'
.' WHERE product_id = '. (int)$productId
.' AND type IN (0,1)';
}
$db->setQuery($query);
$db->execute();
return true;
} else {
$query = ' DELETE '
.' FROM #__phocacart_product_price_history'
.' WHERE product_id = '. (int)$productId
.' AND type IN (0,1)';
$db->setQuery($query);
$db->execute();
return true;
}
return false;
}
public static function storePriceHistoryBulkPriceById($productId, $price,
$priceOriginal, $bulkId, $currentPrice, $currentPriceOriginal, $type) {
$db = JFactory::getDBO();
$date = JFactory::getDate();
$dateNow = $date->toSql();
$query = ' INSERT INTO #__phocacart_product_price_history
(product_id, date, price, price_original, bulk_id, current_price,
current_price_original, type)'
.' VALUES ('.(int)$productId.', NOW(),
'.$db->quote($price).',
'.$db->quote($priceOriginal).', '.(int)$bulkId.',
'.$db->quote($currentPrice).',
'.$db->quote($currentPriceOriginal).',
'.(int)$type.');';
$db->setQuery($query);
$db->execute();
return true;
}
public static function getPriceHistoryById($productId, $limit = 10, $admin
= 0) {
$date = JFactory::getDate();
$dateNow = $date->toSql();
$db = JFactory::getDBO();
$query = 'SELECT a.id, a.product_id, a.price, a.date'
.' FROM #__phocacart_product_price_history AS a'
.' WHERE a.product_id = '.(int) $productId
.' AND a.type IN (0,1)' // All except the bulk
price history
.' ORDER BY a.date DESC';// set latest e.g. 10 items
if ((int)$limit > 0 ) {
$query .= ' LIMIT '.(int)$limit;
}
$db->setQuery($query);
$history = $db->loadAssocList();
if ($admin == 1) {
return $history;
}
// We need to get the outcome from latest to history so we get the e.g.
latest 10 items
// but for displaying we need to start from start
$history = array_reverse($history);
$query = 'SELECT a.price'
.' FROM #__phocacart_products AS a'
.' WHERE a.id = '.(int) $productId
.' ORDER BY a.id';
$db->setQuery($query);
$todayDb = $db->loadAssoc();
$today = array();
if (isset($todayDb['price']) &&
$todayDb['price'] > 0) {
$today[0]['id'] = 0;
$today[0]['date'] = $dateNow;
$today[0]['price'] = $todayDb['price'];
}
// Join today with price history
$c = count($history);
$c--;
if (isset($history[$c]['date'])) {
$dateDb2 = Joomla\CMS\HTML\HTMLHelper::_('date',
$history[$c]['date'], 'Y-m-d');
$dateNow2 = Joomla\CMS\HTML\HTMLHelper::_('date', $dateNow ,
'Y-m-d');
// Date in price history is the same like today's price, so take
today's price
if ($dateDb2 == $dateNow2 && isset($history[$c])) {
unset($history[$c]);
}
}
if (!empty($history) && !empty($today)) {
$new = array_merge($history, $today);
} else if (empty($history) && !empty($today)) {
$new = $today;
} else if (!empty($history) && empty($today)) {
$new = $history;
} else {
$new = array();
}
// correct the count of items in case the current date was added to the
prict history list
$c2 = count($new);
if ($c2 > $limit && isset($new[0])) {
unset($new[0]);
}
return $new;
}
public static function getPriceHistoryChartById($productId) {
$data = array();
$dataX = $dataY = array();
$history = self::getPriceHistoryById($productId);
if (!empty($history)) {
foreach($history as $k => $v) {
$dataY[] = '\'' . $v['price'] .
'\'';
$dataX[] = '\'' .
Joomla\CMS\HTML\HTMLHelper::_('date', $v['date'] ,
JText::_('DATE_FORMAT_LC3')) .'\'';
}
}
$data['x'] = '';
if (!empty($dataX)) {
$data['x'] = implode(',', $dataX);
}
$data['y'] = '';
if (!empty($dataY)) {
$data['y'] = implode(',', $dataY);
}
if (!empty($data['x']) && !empty($data['y']))
{
$s = new PhocacartStatistics();
$s->renderChartJsLine2('phChartAreaLine',
$data['y'], JText::_('COM_PHOCACART_PRICE'),
$data['x']);
$s->setFunction('phChartAreaLine', 'Line');
$s->renderFunctions();
return true;
}
return false;
}
}
PK�"�[�#o,,$libraries/phocacart/price/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��!�ƱƱ#libraries/phocacart/price/price.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartPrice
{
protected $price_decimals = 2;
protected $price_dec_symbol = '.';
protected $price_thousands_sep = '';
protected $price_format = 0;
protected $price_currency_symbol = '';
protected $price_currency_title = '';
protected $price_prefix = '';
protected $price_suffix = '';
protected $exchange_rate = 1;
private static $currency = array();
public function __construct() {
$this->setCurrency();// allways set default, if needed set
specific currency when you call setCurrencyMethod
}
public function getPriceCurrencyTitle() {
return $this->price_currency_title;
}
/* Possible Output change for different parts
E.g. setting specific price decimals in cart
*/
public function setPriceDecimals($decimals) {
$this->price_decimals = (int)$decimals;
}
public function setPriceDecSymbol($symbol) {
$this->price_dec_symbol = $symbol;
}
public function setPriceThousandsSep($separator) {
$this->price_thousands_sep = $separator;
}
public function setPriceFormat($format) {
$this->price_format = (int)$format;
}
public function setPricePrefix($prefix) {
$this->price_prefix = $prefix;
}
public function setPriceSuffix($suffix) {
$this->price_suffix = $suffix;
}
public function setCurrency($id = 0, $orderId = 0) {
// Price can be different for each currency and order
// So there is a key which identifies default currency, other
currency, default currency in order, other currency in order
// one currency can have different exchange rates in order history,
so two orders can have same currency but different exchange rate
$key = base64_encode(serialize((int)$id . ':' .
(int)$orderId));
if (!array_key_exists((string)$key, self::$currency)) {
$app = JFactory::getApplication();
$paramsC =
PhocacartUtils::getComponentParameters();
$exchange_rate_order =
$paramsC->get('exchange_rate_order', 0);
$currencyOrder = false;
if ((int)$orderId > 0) {
$currencyOrder = self::getCurrencyAndRateByOrder($orderId);
}
// 1) change the currency ID by order
if (isset($currencyOrder->currency_id)) {
$id = $currencyOrder->currency_id;
$key = base64_encode(serialize((int)$id . ':' .
(int)$orderId));
}
if ((int)$id > 0) {
self::$currency[$key] =
PhocacartCurrency::getCurrency((int)$id, (int)$orderId);
} else {
self::$currency[$key] = PhocacartCurrency::getCurrency(0,
(int)$orderId);
}
// 1) change the currency exchange rate by order
if (isset($currencyOrder->currency_exchange_rate) &&
$exchange_rate_order == 0) {
self::$currency[$key]->exchange_rate =
$currencyOrder->currency_exchange_rate;
}
}
if (!empty(self::$currency[$key])) {
$this->price_decimals =
self::$currency[$key]->price_decimals;
$this->price_dec_symbol =
self::$currency[$key]->price_dec_symbol;
$this->price_thousands_sep =
self::$currency[$key]->price_thousands_sep;
$this->price_format =
self::$currency[$key]->price_format;
$this->price_currency_symbol =
self::$currency[$key]->price_currency_symbol;
$this->price_currency_title =
self::$currency[$key]->title;
$this->price_prefix =
self::$currency[$key]->price_prefix;
$this->price_suffix =
self::$currency[$key]->price_suffix;
$this->exchange_rate =
self::$currency[$key]->exchange_rate;
$this->currency_id = self::$currency[$key]->id;
}
}
/*
* 1) the price can be negative - for example rounding
* 2) or we can force the negative - e.g. for discount
*/
public function getPriceFormat($price, $negative = 0,
$skipCurrencyConverting = 0, $forceCurrency = 0, $skipPrefix = 0,
$skipSuffix = 0) {
$currentCurrency = $this->currency_id;
if ((int)$forceCurrency > 0) {
$this->setCurrency((int)$forceCurrency);
}
if ($price < 0) {
$negative = 1;
}
// If negative is forced by parameter but the price is 0 in real -
skip the negative sign
if ($price == 0) {
$negative = 0;
}
if ($price == '') {
$price = 0;
}
if ($skipCurrencyConverting == 0) {
$price *= $this->exchange_rate;
}
// Round after exchange rate
$price = $this->roundPrice($price);
if ($negative) {
$price = abs($price);
}
$price = number_format((double)$price, $this->price_decimals,
$this->price_dec_symbol, $this->price_thousands_sep);
switch ($this->price_format) {
case 1:
$price = $price . $this->price_currency_symbol;
break;
case 2:
$price = $this->price_currency_symbol . $price;
break;
case 3:
$price = $this->price_currency_symbol . ' ' .
$price;
break;
case 0:
default:
$price = $price . ' ' .
$this->price_currency_symbol;
break;
}
$o = '';
if ($negative) {
$o = '- ' . $this->price_prefix . $price .
$this->price_suffix;
} else {
$o = $this->price_prefix . $price . $this->price_suffix;
}
if ((int)$forceCurrency > 0) {
$this->setCurrency((int)$currentCurrency);
}
return $o;
}
public function setPrefix($prefix) {
$this->price_prefix = $prefix;
}
public function setSuffix($suffix) {
$this->price_suffix = $suffix;
}
public function getTaxFormat($tax, $taxCalculationType, $format = 1) {
if ($format == 0) { // IS USED FOR PERCENTAGE IN VAT TITLE ... e.g.
VAT(10%)
if ($taxCalculationType == 2) { // FIX
$tax = $tax + 0;
} else { // Percentage
$tax = ($tax + 0) . '%';
}
} else { // IS USED FOR PERCENTAGE in CALCUTATION: ... VAT(10%)
--> 10,00 %
if ($taxCalculationType == 2) { // FIX
$tax = number_format((double)$tax,
$this->price_decimals, $this->price_dec_symbol,
$this->price_thousands_sep);
} else { // Percentage
$tax = number_format((double)$tax,
$this->price_decimals, $this->price_dec_symbol,
$this->price_thousands_sep) . ' %';
}
}
return $tax;
}
/*
* param format - format the price or not (add currency symbol, price
decimals thousands separator, ...)
*/
public function getPriceItems($price, $taxId, $tax,
$taxCalculationType, $taxTitle = '', $baseAmount = 0, $baseUnit =
'', $zeroPrice = 0, $round = 1, $groupPrice = null) {
// We need to round because if not
// BRUTTO 0.15 ... 0.15
// TAX 0.025 ... 0.03
// NETTO 0.125 ... 0.13
// BRUTTO IS WRONG 0.15 ... 0.16
// If user is assigned to some group, the lowest price was selected
from groups for all groups he is assigned
if ($groupPrice !== null) {
$price = $groupPrice;
}
if ($round == 1) {
$price = $this->roundPrice($price);
}
// Change TAX based on country or region
$taxChangedA = PhocacartTax::changeTaxBasedOnRule($taxId, $tax,
$taxCalculationType, $taxTitle);
$tax =
$this->roundPrice($taxChangedA['taxrate']);
$taxTitle = $taxChangedA['taxtitle'];
$taxTitle = JText::_($taxTitle);
$priceO = array();
$app = JFactory::getApplication();
//$paramsC = PhocacartUtils::getComponentParameters();
$paramsC = PhocacartUtils::getComponentParameters();
$tax_calculation = $paramsC->get('tax_calculation',
0);
$display_unit_price =
$paramsC->get('display_unit_price', 1);
//$zero_price_text = $paramsC->get(
'zero_price_text', '' );
//$zero_price_label = $paramsC->get(
'zero_price_label', '' );
$priceO['taxtxt'] = $taxTitle;
$priceO['taxcalc'] = $tax_calculation; // Set in
Options: Brutto, Netto, None
$priceO['taxcalctype'] = $taxCalculationType;// Set in
Tax edit: Percentate, Fixed Amount
$priceO['zero'] = 0;
$priceO['taxcountryid'] =
$taxChangedA['taxcountryid'];
$priceO['taxregionid'] =
$taxChangedA['taxregionid'];
$priceO['taxkey'] = PhocacartTax::getTaxKey($taxId,
$taxChangedA['taxcountryid'],
$taxChangedA['taxregionid']);
// NO TAX
if ($tax_calculation == 0) {
$priceO['netto'] = $price;
$priceO['tax'] = 0;
$priceO['brutto'] = $price;
$priceO['bruttotxt'] =
JText::_('COM_PHOCACART_PRICE');
$priceO['nettotxt'] =
JText::_('COM_PHOCACART_PRICE');
// EXCLUSIVE TAX
} else if ($tax_calculation == 1) {
$priceO['netto'] = $price;
if ($taxCalculationType == 2) { // FIX
$priceO['tax'] = $tax;
$priceO['brutto'] = $priceO['netto'] +
$tax;
$priceO['taxtxt'] = $taxTitle . ' (' .
$this->getPriceFormat($tax) . ')';
} else { // Percentage
$priceO['tax'] = $priceO['netto'] *
($tax / 100);
if ($round == 1) {
$priceO['tax'] =
$this->roundPrice($priceO['tax']);
}
$priceO['brutto'] = $priceO['netto'] +
$priceO['tax'];
$priceO['taxtxt'] = $taxTitle . ' (' .
$this->getTaxFormat($tax, $taxCalculationType, 0) . ')';
}
$priceO['bruttotxt'] =
JText::_('COM_PHOCACART_PRICE_INCL_TAX');
$priceO['nettotxt'] =
JText::_('COM_PHOCACART_PRICE_EXCL_TAX');
// INCLUSIVE TAX
} else if ($tax_calculation == 2) {
$priceO['brutto'] = $price;
if ($taxCalculationType == 2) { // FIX
$priceO['tax'] = $tax;
$priceO['netto'] = $priceO['brutto'] -
$tax;
$priceO['taxtxt'] = $taxTitle . ' (' .
$this->getPriceFormat($tax) . ')';
} else { // Percentage
$priceO['tax'] = $priceO['brutto'] -
($priceO['brutto'] / (($tax / 100) + 1));
if ($round == 1) {
$priceO['tax'] =
$this->roundPrice($priceO['tax']);
}
$priceO['netto'] = $priceO['brutto'] -
$priceO['tax'];
//$priceO['netto'] = $priceO['brutto']
* 100 / ($tax + 100);
//$priceO['tax'] = $priceO['brutto'] -
$priceO['netto'];
//$coefficient = $tax / ($tax + 100);
//$priceO['tax'] = $priceO['brutto'] *
$coefficient; // POSIBLE TO DO - round e.g. to 4
//$priceO['netto'] = $priceO['brutto']
- $priceO['tax'];
$priceO['taxtxt'] = $taxTitle . ' (' .
$this->getTaxFormat($tax, $taxCalculationType, 0) . ')';
}
$priceO['bruttotxt'] =
JText::_('COM_PHOCACART_PRICE_INCL_TAX');
$priceO['nettotxt'] =
JText::_('COM_PHOCACART_PRICE_EXCL_TAX');
}
if ($priceO['netto'] == $priceO['brutto']) {
//$priceO['netto'] = false;
$priceO['bruttotxt'] =
JText::_('COM_PHOCACART_PRICE');
$priceO['nettotxt'] =
JText::_('COM_PHOCACART_PRICE');
}
//if ($tax_calculation > 0) {
if ($priceO['netto']) {
$priceO['nettoformat'] =
$this->getPriceFormat($priceO['netto']);
}
if ($priceO['tax']) {
$priceO['taxformat'] =
$this->getPriceFormat($priceO['tax']);
}
//}
$priceO['bruttoformat'] =
$this->getPriceFormat($priceO['brutto']);
// Unit price
$priceO['base'] = '';
$priceO['baseformat'] = '';
if ($baseAmount > 0 && (int)$display_unit_price > 0)
{
$priceO['base'] = $priceO['brutto'] /
$baseAmount;
if ($round == 1) {
$priceO['base'] =
$this->roundPrice($priceO['base']);
}
$priceO['baseformat'] =
$this->getPriceFormat($priceO['base']) . '/' .
$baseUnit;
}
// MOVED TO TEMPLATE BECAUSE CAN BE INFLUENCED BY ATTRIBUTES
// Must be different in comparison to payment and shipping method
because product price can be changed by attributes
/*
if ($price == 0 && $zeroPrice == 1) {
if ($zero_price_text != '') {
$priceO['zeronettoformat'] =
$priceO['bruttoformat'] = $priceO['taxformat'] =
JText::_($zero_price_text);
}
if ($zero_price_label == '0') {
$priceO['nettotxt'] =
$priceO['bruttotxt'] = $priceO['taxtxt'] =
'';
} else if ($zero_price_label != '') {
$priceO['nettotxt'] =
$priceO['bruttotxt'] = $priceO['taxtxt'] =
JText::_($zero_price_label);
}
}*/
if ($priceO['brutto'] == 0 &&
$priceO['netto'] == 0) {
$priceO['zero'] = 1;// Zero for basic price but this
can be changed by attribute price
}
if ($round == 1) {
$priceO['netto'] =
$this->roundPrice($priceO['netto']);
$priceO['brutto'] =
$this->roundPrice($priceO['brutto']);
$priceO['tax'] =
$this->roundPrice($priceO['tax']);
}
return $priceO;
}
public function getPriceItem($price, $groupPrice = null, $format = 1) {
if ($groupPrice !== null) {
$price = $groupPrice;
}
if ($format == 1) {
$price = $this->getPriceFormat($price);
}
return $price;
}
/*
* $type ... price, shipping, payment
* ROUNDING - TAX EXCLUSIVE - ROUND UP
* ROUNDING - TAX INCLUSIVE - ROUND DOWN
*/
public function roundPrice($price, $type = 'price') {
$app = JFactory::getApplication();
//$paramsC = PhocacartUtils::getComponentParameters();
$paramsC = PhocacartUtils::getComponentParameters();
$rounding_calculation =
$paramsC->get('rounding_calculation', 1);
/*$tax_calculation = $paramsC->get(
'tax_calculation', 0 );
$tax_calculation_shipping = $paramsC->get(
'tax_calculation_shipping', 0 );
$tax_calculation_payment = $paramsC->get(
'tax_calculation_payment', 0 );
switch($type) {
case 'shipping':
// if tax_calculation_shipping == inclusive then
rown down else round up
$rounding = $tax_calculation_shipping == 2 ? 2 : 1;
break;
case 'payment':
$rounding = $tax_calculation_payment == 2 ? 2 : 1;
break;
case 'price':
default:
$rounding = $tax_calculation == 2 ? 2 : 1;
break;
}*/
$rounding = $rounding_calculation; // 1 ... up, 2 ... down
$priceR = round($price, $this->price_decimals, $rounding);
return $priceR;
}
public function getPriceItemsShipping($price, $priceAdditional,
$calculationType, $total, $taxId, $tax, $taxCalculationType, $taxTitle =
'', $freeShipping = 0, $round = 1, $langPrefix =
'SHIPPING_') {
// PERCENTAGE PRICE OF SHIPPING
// CALCULATED FROM TOTAL - PAYMENT - SHIPPING (TOTAL BEFORE
SHIPPING AND PAYMENT PRICE)
// $total[brutto] can be changed e.g. to netto, etc.
$priceO = array();
$priceO['costinfo'] = '';
$priceO['costinfoprice'] = '';
$priceO['costinfopriceadditional'] = '';
if ($calculationType == 1 &&
isset($total['brutto'])) {
$priceO['costinfo'] = $this->roundPrice($price) .
' %';
$price = $total['brutto'] * $price /
100;
$priceO['costinfoprice'] = $price;
} else {
$priceO['costinfoprice'] = $price;
}
if ($priceAdditional > 0) {
$price = $price + $priceAdditional;
$priceO['costinfo'] .= ' + ' .
$this->getPriceFormat($priceAdditional);
$priceO['costinfopriceadditional'] =
$priceAdditional;
}
$priceO['costinfo'] = $priceO['costinfo'] !=
'' ? '(' . $priceO['costinfo'] .
')' : '';
//$priceO['costinfo'] = $priceO['costinfo'] !=
'' ? '' . $priceO['costinfo'] . ''
: '';
if ($round == 1) {
$price = $this->roundPrice($price, 'shipping');
}
// Change TAX based on country or region
$taxChangedA = PhocacartTax::changeTaxBasedOnRule($taxId, $tax,
$taxCalculationType, $taxTitle);
$tax =
$this->roundPrice($taxChangedA['taxrate'],
'shipping');
$taxTitle = $taxChangedA['taxtitle'];
//$taxTitle = JText::_($taxTitle);
// Define - the function always return all variables so we
don't need to check them
$priceO['nettoformat'] = '';
$priceO['taxformat'] = '';
$priceO['bruttoformat'] = '';
$priceO['bruttotxt'] = '';
$priceO['netto'] = 0;
$priceO['tax'] = 0;
$priceO['taxid'] = 0;
$priceO['brutto'] = 0;
$priceO['nettotxt'] =
JText::_('COM_PHOCACART_' . $langPrefix .
'PRICE_EXCL_TAX');
$priceO['taxtxt'] = '';
$priceO['bruttotxt'] =
JText::_('COM_PHOCACART_' . $langPrefix .
'PRICE_INCL_TAX');
$priceO['nettotxtraw'] = 'COM_PHOCACART_' .
$langPrefix . 'PRICE_EXCL_TAX';
$priceO['taxtxtraw'] = '';
$priceO['bruttotxtraw'] = 'COM_PHOCACART_' .
$langPrefix . 'PRICE_INCL_TAX';
$priceO['zero'] = 0;
$priceO['freeshipping'] = 0;
$priceO['taxtype'] = $taxCalculationType;
$priceO['taxrate'] = $tax;
$priceO['netto_title_lang'] = 'COM_PHOCACART_'
. $langPrefix . 'PRICE_EXCL_TAX';
$priceO['netto_title'] =
JText::_($priceO['netto_title_lang']);
$priceO['brutto_title_lang'] = 'COM_PHOCACART_'
. $langPrefix . 'PRICE_INCL_TAX';
$priceO['brutto_title'] =
JText::_($priceO['brutto_title_lang']);
//$app = JFactory::getApplication();
//$paramsC = PhocacartUtils::getComponentParameters();
$paramsC =
PhocacartUtils::getComponentParameters();
$tax_calculation_shipping =
$paramsC->get('tax_calculation_shipping', 0);
// E.G. if coupon set the shipping costs to null - free shipping
if ($freeShipping == 1) {
$priceO['netto'] = 0;
$priceO['nettotxt'] =
JText::_('COM_PHOCACART_FREE_SHIPPING');
$priceO['tax'] = 0;
$priceO['taxid'] = 0;
$priceO['taxkey'] = '';
$priceO['brutto'] = 0;
$priceO['bruttotxt'] =
JText::_('COM_PHOCACART_FREE_SHIPPING');
$priceO['bruttoformat'] =
$this->getPriceFormat($priceO['brutto']);
$priceO['freeshipping'] = 1;
$priceO['zero'] = 1;
//$priceO['title'] =
JText::_('COM_PHOCACART_FREE_SHIPPING');
$priceO['description'] = '';
$priceO['costinfo'] = '';
$priceO['title_lang'] =
'COM_PHOCACART_FREE_SHIPPING';
$priceO['title'] =
JText::_($priceO['title_lang']);
$priceO['netto_title_lang'] =
'COM_PHOCACART_FREE_SHIPPING';
$priceO['netto_title'] =
JText::_($priceO['netto_title_lang']);
$priceO['brutto_title_lang'] =
'COM_PHOCACART_FREE_SHIPPING';
$priceO['brutto_title'] =
JText::_($priceO['brutto_title_lang']);
return $priceO;
}
$priceO['taxtxt'] = JText::_($taxTitle);
$priceO['tax_title_lang'] = $taxTitle;
$priceO['tax_title'] = JText::_($taxTitle);
$priceO['tax_title_suffix'] = '';
$priceO['tax_title_suffix2'] = '';
// NO TAX
if ($tax_calculation_shipping == 0) {
$priceO['netto'] = $price;
$priceO['tax'] = 0;
$priceO['taxid'] = 0;
$priceO['taxkey'] = '';
$priceO['brutto'] = $price;
// EXCLUSIVE TAX
} else if ($tax_calculation_shipping == 1) {
$priceO['netto'] = $price;
if ($taxCalculationType == 2) { // FIX
$priceO['tax'] = $tax;
$priceO['brutto'] = $priceO['netto'] +
$tax;
$priceO['taxtxt'] =
JText::_('COM_PHOCACART_' . $langPrefix . 'PRICE') .
' ' . JText::_($taxTitle) . ' (' .
$this->getPriceFormat($tax) . ')';
$priceO['tax_title_lang'] =
'COM_PHOCACART_' . $langPrefix . 'PRICE';
$priceO['tax_title'] =
JText::_($priceO['tax_title_lang']);
$priceO['tax_title_suffix'] = $taxTitle;
$priceO['tax_title_suffix2'] =
$this->getPriceFormat($tax);
} else { // Percentage
$priceO['tax'] = $priceO['netto'] *
($tax / 100);
if ($round == 1) {
$priceO['tax'] =
$this->roundPrice($priceO['tax'], 'shipping');
}
$priceO['brutto'] = $priceO['netto'] +
$priceO['tax'];
$priceO['taxtxt'] =
JText::_('COM_PHOCACART_' . $langPrefix . 'PRICE') .
' ' . JText::_($taxTitle) . ' (' .
$this->getTaxFormat($tax, $taxCalculationType, 0) . ')';
$priceO['tax_title_lang'] =
'COM_PHOCACART_' . $langPrefix . 'PRICE';
$priceO['tax_title'] =
JText::_($priceO['tax_title_lang']);
$priceO['tax_title_suffix'] = $taxTitle;
$priceO['tax_title_suffix2'] =
$this->getTaxFormat($tax, $taxCalculationType, 0);
}
$priceO['bruttotxt'] =
JText::_('COM_PHOCACART_' . $langPrefix .
'PRICE_INCL_TAX');
$priceO['nettotxt'] =
JText::_('COM_PHOCACART_' . $langPrefix .
'PRICE_EXCL_TAX');
$priceO['taxid'] = $taxId;
$priceO['taxkey'] = PhocacartTax::getTaxKey($taxId,
$taxChangedA['taxcountryid'],
$taxChangedA['taxregionid']);
$priceO['netto_title_lang'] =
'COM_PHOCACART_' . $langPrefix . 'PRICE_EXCL_TAX';
$priceO['netto_title'] =
JText::_($priceO['netto_title_lang']);
$priceO['brutto_title_lang'] =
'COM_PHOCACART_' . $langPrefix . 'PRICE_INCL_TAX';
$priceO['brutto_title'] =
JText::_($priceO['brutto_title_lang']);
// INCLUSIVE TAX
} else if ($tax_calculation_shipping == 2) {
$priceO['brutto'] = $price;
if ($taxCalculationType == 2) { // FIX
$priceO['tax'] = $tax;
$priceO['netto'] = $priceO['brutto'] -
$tax;
$priceO['taxtxt'] =
JText::_('COM_PHOCACART_' . $langPrefix . 'PRICE') .
' ' . JText::_($taxTitle) . ' (' .
$this->getPriceFormat($tax) . ')';
$priceO['tax_title_lang'] =
'COM_PHOCACART_' . $langPrefix . 'PRICE';
$priceO['tax_title'] =
JText::_($priceO['tax_title_lang']);
$priceO['tax_title_suffix'] = $taxTitle;
$priceO['tax_title_suffix2'] =
$this->getPriceFormat($tax);
} else { // Percentage
$priceO['tax'] = $priceO['brutto'] -
($priceO['brutto'] / (($tax / 100) + 1));
if ($round == 1) {
$priceO['tax'] =
$this->roundPrice($priceO['tax'], 'shipping');
}
$priceO['netto'] = $priceO['brutto'] -
$priceO['tax'];
$priceO['taxtxt'] =
JText::_('COM_PHOCACART_' . $langPrefix . 'PRICE') .
' ' . JText::_($taxTitle) . ' (' .
$this->getTaxFormat($tax, $taxCalculationType, 0) . ')';
$priceO['tax_title_lang'] =
'COM_PHOCACART_' . $langPrefix . 'PRICE';
$priceO['tax_title'] =
JText::_($priceO['tax_title_lang']);
$priceO['tax_title_suffix'] = $taxTitle;
$priceO['tax_title_suffix2'] =
$this->getTaxFormat($tax, $taxCalculationType, 0);
}
$priceO['bruttotxt'] =
JText::_('COM_PHOCACART_' . $langPrefix .
'PRICE_INCL_TAX');
$priceO['nettotxt'] =
JText::_('COM_PHOCACART_' . $langPrefix .
'PRICE_EXCL_TAX');
$priceO['taxid'] = $taxId;
$priceO['taxkey'] = PhocacartTax::getTaxKey($taxId,
$taxChangedA['taxcountryid'],
$taxChangedA['taxregionid']);
$priceO['netto_title_lang'] =
'COM_PHOCACART_' . $langPrefix . 'PRICE_EXCL_TAX';
$priceO['netto_title'] =
JText::_($priceO['netto_title_lang']);
$priceO['brutto_title_lang'] =
'COM_PHOCACART_' . $langPrefix . 'PRICE_INCL_TAX';
$priceO['brutto_title'] =
JText::_($priceO['brutto_title_lang']);
}
if ($priceO['netto'] == $priceO['brutto']) {
$priceO['netto'] = false;
$priceO['bruttotxt'] =
JText::_('COM_PHOCACART_' . $langPrefix . 'PRICE');
$priceO['nettotxt'] =
JText::_('COM_PHOCACART_' . $langPrefix . 'PRICE');
$priceO['netto_title_lang'] =
'COM_PHOCACART_' . $langPrefix . 'PRICE';
$priceO['netto_title'] =
JText::_($priceO['netto_title_lang']);
$priceO['brutto_title_lang'] =
'COM_PHOCACART_' . $langPrefix . 'PRICE';
$priceO['brutto_title'] =
JText::_($priceO['brutto_title_lang']);
}
//if ($tax_calculation_shipping > 0) {
if ($priceO['netto']) {
$priceO['nettoformat'] =
$this->getPriceFormat($priceO['netto']);
}
if ($priceO['tax']) {
$priceO['taxformat'] =
$this->getPriceFormat($priceO['tax']);
}
//}
$priceO['bruttoformat'] =
$this->getPriceFormat($priceO['brutto']);
if ($priceO['brutto'] == 0 &&
$priceO['netto'] == 0) {
$priceO['zero'] = 1;
}
/*
$priceI['nettoformat'] =
isset($priceI['nettoformat']) ? $priceI['nettoformat']
: '';
$priceI['taxformat'] =
isset($priceI['taxformat']) ? $priceI['taxformat'] :
'';
$priceI['bruttoformat'] =
isset($priceI['bruttoformat']) ?
$priceI['bruttoformat'] : '';
$priceI['bruttotxt'] =
isset($priceI['bruttotxt']) ? $priceI['bruttotxt'] :
'';
$priceI['taxtxt'] = isset($priceI['taxtxt']) ?
$priceI['taxtxt'] : '';
$priceI['bruttotxt'] =
isset($priceI['bruttotxt']) ? $priceI['bruttotxt'] :
'';
$priceI['netto'] = isset($priceI['netto']) ?
$priceI['netto'] : 0;
$priceI['brutto'] = isset($priceI['brutto']) ?
$priceI['brutto'] : 0;*/
if ($round == 1) {
$priceO['netto'] =
$this->roundPrice($priceO['netto']);
$priceO['brutto'] =
$this->roundPrice($priceO['brutto']);
$priceO['tax'] =
$this->roundPrice($priceO['tax']);
}
return $priceO;
}
public function getPriceItemsPayment($price, $priceAdditional,
$calculationType, $total, $taxId, $tax, $taxCalculationType, $taxTitle =
'', $freePayment = 0, $round = 1, $langPrefix =
'PAYMENT_') {
// PERCENTAGE PRICE OF PAYMENT
// CALCULATED FROM TOTAL - PAYMENT (TOTAL BEFORE PAYMENT PRICE)
// $total[brutto] can be changed e.g. to netto, etc.
$priceO = array();
$priceO['costinfo'] = '';
$priceO['costinfoprice'] = '';
$priceO['costinfopriceadditional'] = '';
if ($calculationType == 1 &&
isset($total['brutto'])) {
$priceO['costinfo'] = $this->roundPrice($price) .
' %';
$price = $total['brutto'] * $price /
100;
$priceO['costinfoprice'] = $price;
} else {
$priceO['costinfoprice'] = $price;
}
if ($priceAdditional > 0) {
$price = $price + $priceAdditional;
$priceO['costinfo'] .= ' + ' .
$this->getPriceFormat($priceAdditional);
$priceO['costinfopriceadditional'] =
$priceAdditional;
}
$priceO['costinfo'] = $priceO['costinfo'] !=
'' ? '(' . $priceO['costinfo'] .
')' : '';
//$priceO['costinfo'] = $priceO['costinfo'] !=
'' ? '' . $priceO['costinfo'] . ''
: '';
if ($round == 1) {
$price = $this->roundPrice($price, 'payment');
}
// Change TAX based on country or region
$taxChangedA = PhocacartTax::changeTaxBasedOnRule($taxId, $tax,
$taxCalculationType, $taxTitle);
$tax =
$this->roundPrice($taxChangedA['taxrate'],
'payment');
$taxTitle = $taxChangedA['taxtitle'];
//$taxTitle = JText::_($taxTitle);
//$app = JFactory::getApplication();
//$paramsC = PhocacartUtils::getComponentParameters();
$paramsC =
PhocacartUtils::getComponentParameters();
$tax_calculation_payment =
$paramsC->get('tax_calculation_payment', 0);
// Define - the function always return all variables so we
don't need to check them
$priceO['nettoformat'] = '';
$priceO['taxformat'] = '';
$priceO['bruttoformat'] = '';
$priceO['bruttotxt'] = '';
$priceO['netto'] = 0;
$priceO['tax'] = 0;
$priceO['taxid'] = 0;
$priceO['taxkey'] = '';
$priceO['brutto'] = 0;
$priceO['nettotxt'] =
JText::_('COM_PHOCACART_' . $langPrefix .
'PRICE_EXCL_TAX');
$priceO['taxtxt'] = '';
$priceO['bruttotxt'] =
JText::_('COM_PHOCACART_' . $langPrefix .
'PRICE_INCL_TAX');
$priceO['zero'] = 0;
$priceO['freepayment'] = 0;
$priceO['taxtype'] = $taxCalculationType;
$priceO['taxrate'] = $tax;
$priceO['netto_title_lang'] = 'COM_PHOCACART_'
. $langPrefix . 'PRICE_EXCL_TAX';
$priceO['netto_title'] =
JText::_($priceO['netto_title_lang']);
$priceO['brutto_title_lang'] = 'COM_PHOCACART_'
. $langPrefix . 'PRICE_INCL_TAX';
$priceO['brutto_title'] =
JText::_($priceO['brutto_title_lang']);
// E.G. if coupon set the shipping costs to null - free shipping
if ($freePayment == 1) {
$priceO['netto'] = 0;
$priceO['nettotxt'] =
JText::_('COM_PHOCACART_FREE_PAYMENT');
$priceO['tax'] = 0;
$priceO['taxid'] = 0;
$priceO['taxkey'] = '';
$priceO['brutto'] = 0;
$priceO['bruttotxt'] =
JText::_('COM_PHOCACART_FREE_PAYMENT');
$priceO['bruttoformat'] =
$this->getPriceFormat($priceO['brutto']);
$priceO['freepayment'] = 1;
$priceO['zero'] = 1;
$priceO['description'] = '';
$priceO['costinfo'] = '';
$priceO['title_lang'] =
'COM_PHOCACART_FREE_PAYMENT';
$priceO['title'] =
JText::_($priceO['title_lang']);
$priceO['netto_title_lang'] =
'COM_PHOCACART_FREE_PAYMENT';
$priceO['netto_title'] =
JText::_($priceO['netto_title_lang']);
$priceO['brutto_title_lang'] =
'COM_PHOCACART_FREE_PAYMENT';
$priceO['brutto_title'] =
JText::_($priceO['brutto_title_lang']);
return $priceO;
}
$priceO['taxtxt'] = JText::_($taxTitle);
$priceO['tax_title_lang'] = $taxTitle;
$priceO['tax_title'] = JText::_($taxTitle);
$priceO['tax_title_suffix'] = '';
$priceO['tax_title_suffix2'] = '';
// NO TAX
if ($tax_calculation_payment == 0) {
$priceO['netto'] = $price;
$priceO['tax'] = 0;
$priceO['taxid'] = 0;
$priceO['taxkey'] = '';
$priceO['brutto'] = $price;
// EXCLUSIVE TAX
} else if ($tax_calculation_payment == 1) {
$priceO['netto'] = $price;
if ($taxCalculationType == 2) { // FIX
$priceO['tax'] = $tax;
$priceO['brutto'] = $priceO['netto'] +
$tax;
$priceO['taxtxt'] =
JText::_('COM_PHOCACART_' . $langPrefix . 'PRICE') .
' ' . JText::_($taxTitle) . ' (' .
$this->getPriceFormat($tax) . ')';
$priceO['tax_title_lang'] =
'COM_PHOCACART_' . $langPrefix . 'PRICE';
$priceO['tax_title'] =
JText::_($priceO['tax_title_lang']);
$priceO['tax_title_suffix'] = $taxTitle;
$priceO['tax_title_suffix2'] =
$this->getPriceFormat($tax);
} else { // Percentage
$priceO['tax'] = $priceO['netto'] *
($tax / 100);
if ($round == 1) {
$priceO['tax'] =
$this->roundPrice($priceO['tax'], 'payment');
}
$priceO['brutto'] = $priceO['netto'] +
$priceO['tax'];
$priceO['taxtxt'] =
JText::_('COM_PHOCACART_' . $langPrefix . 'PRICE') .
' ' . JText::_($taxTitle) . ' (' .
$this->getTaxFormat($tax, $taxCalculationType, 0) . ')';
$priceO['tax_title_lang'] =
'COM_PHOCACART_' . $langPrefix . 'PRICE';
$priceO['tax_title'] =
JText::_($priceO['tax_title_lang']);
$priceO['tax_title_suffix'] = $taxTitle;
$priceO['tax_title_suffix2'] =
$this->getTaxFormat($tax, $taxCalculationType, 0);
}
$priceO['bruttotxt'] =
JText::_('COM_PHOCACART_' . $langPrefix .
'PRICE_INCL_TAX');
$priceO['nettotxt'] =
JText::_('COM_PHOCACART_' . $langPrefix .
'PRICE_EXCL_TAX');
$priceO['taxid'] = $taxId;
$priceO['taxkey'] =
PhocacartTax::getTaxKey($taxId, $taxChangedA['taxcountryid'],
$taxChangedA['taxregionid']);
$priceO['netto_title_lang'] =
'COM_PHOCACART_' . $langPrefix . 'PRICE_EXCL_TAX';
$priceO['netto_title'] =
JText::_($priceO['netto_title_lang']);
$priceO['brutto_title_lang'] =
'COM_PHOCACART_' . $langPrefix . 'PRICE_INCL_TAX';
$priceO['brutto_title'] =
JText::_($priceO['brutto_title_lang']);
// INCLUSIVE TAX
} else if ($tax_calculation_payment == 2) {
$priceO['brutto'] = $price;
if ($taxCalculationType == 2) { // FIX
$priceO['tax'] = $tax;
$priceO['netto'] = $priceO['brutto'] -
$tax;
$priceO['taxtxt'] =
JText::_('COM_PHOCACART_' . $langPrefix . 'PRICE') .
' ' . JText::_($taxTitle) . ' (' .
$this->getPriceFormat($tax) . ')';
$priceO['tax_title_lang'] =
'COM_PHOCACART_' . $langPrefix . 'PRICE';
$priceO['tax_title'] =
JText::_($priceO['tax_title_lang']);
$priceO['tax_title_suffix'] = $taxTitle;
$priceO['tax_title_suffix2'] =
$this->getPriceFormat($tax);
} else { // Percentage
$priceO['tax'] = $priceO['brutto'] -
($priceO['brutto'] / (($tax / 100) + 1));
if ($round == 1) {
$priceO['tax'] =
$this->roundPrice($priceO['tax'], 'payment');
}
$priceO['netto'] = $priceO['brutto'] -
$priceO['tax'];
$priceO['taxtxt'] =
JText::_('COM_PHOCACART_' . $langPrefix . 'PRICE') .
' ' . JText::_($taxTitle) . ' (' .
$this->getTaxFormat($tax, $taxCalculationType, 0) . ')';
$priceO['tax_title_lang'] =
'COM_PHOCACART_' . $langPrefix . 'PRICE';
$priceO['tax_title'] =
JText::_($priceO['tax_title_lang']);
$priceO['tax_title_suffix'] = $taxTitle;
$priceO['tax_title_suffix2'] =
$this->getTaxFormat($tax, $taxCalculationType, 0);
}
$priceO['bruttotxt'] =
JText::_('COM_PHOCACART_' . $langPrefix .
'PRICE_INCL_TAX');
$priceO['nettotxt'] =
JText::_('COM_PHOCACART_' . $langPrefix .
'PRICE_EXCL_TAX');
$priceO['taxid'] = $taxId;
$priceO['taxkey'] =
PhocacartTax::getTaxKey($taxId, $taxChangedA['taxcountryid'],
$taxChangedA['taxregionid']);
$priceO['netto_title_lang'] =
'COM_PHOCACART_' . $langPrefix . 'PRICE_EXCL_TAX';
$priceO['netto_title'] =
JText::_($priceO['netto_title_lang']);
$priceO['brutto_title_lang'] =
'COM_PHOCACART_' . $langPrefix . 'PRICE_INCL_TAX';
$priceO['brutto_title'] =
JText::_($priceO['brutto_title_lang']);
}
if ($priceO['netto'] == $priceO['brutto']) {
$priceO['netto'] = false;
$priceO['bruttotxt'] =
JText::_('COM_PHOCACART_' . $langPrefix . 'PRICE');
$priceO['nettotxt'] =
JText::_('COM_PHOCACART_' . $langPrefix . 'PRICE');
$priceO['netto_title_lang'] =
'COM_PHOCACART_' . $langPrefix . 'PRICE';
$priceO['netto_title'] =
JText::_($priceO['netto_title_lang']);
$priceO['brutto_title_lang'] =
'COM_PHOCACART_' . $langPrefix . 'PRICE';
$priceO['brutto_title'] =
JText::_($priceO['brutto_title_lang']);
}
//if ($tax_calculation_payment > 0) {
if ($priceO['netto']) {
$priceO['nettoformat'] =
$this->getPriceFormat($priceO['netto']);
}
if ($priceO['tax']) {
$priceO['taxformat'] =
$this->getPriceFormat($priceO['tax']);
}
//}
$priceO['bruttoformat'] =
$this->getPriceFormat($priceO['brutto']);
if ($priceO['brutto'] == 0 &&
$priceO['netto'] == 0) {
$priceO['zero'] = 1;
}
if ($round == 1) {
$priceO['netto'] =
$this->roundPrice($priceO['netto']);
$priceO['brutto'] =
$this->roundPrice($priceO['brutto']);
$priceO['tax'] =
$this->roundPrice($priceO['tax']);
}
return $priceO;
}
// STATIC PART
/*
* Used for example by orders - we don't want to have current
exchange rate
* but rate which was actual in date of order
*/
public static function getCurrencyAndRateByOrder($orderId = 0) {
if ((int)$orderId > 0) {
$db = JFactory::getDBO();
$query = ' SELECT a.currency_id, a.currency_exchange_rate
FROM #__phocacart_orders AS a'
. ' WHERE a.id = ' . (int)$orderId
. ' ORDER BY a.id';
$db->setQuery($query);
$currencyOrder = $db->loadObject();
if (!empty($currencyOrder)) {
return $currencyOrder;
}
return false;
}
}
public function correctMinusPrice(&$price) {
if (isset($price['brutto']) &&
$price['brutto'] < 0) {
$price['brutto'] = 0;
$price['bruttoformat'] = $this->getPriceFormat(0);
}
if (isset($price['netto']) &&
$price['netto'] < 0) {
$price['netto'] = 0;
$price['nettoformat'] = $this->getPriceFormat(0);
}
if (isset($price['tax']) &&
$price['tax'] < 0) {
$price['tax'] = 0;
$price['taxformat'] = $this->getPriceFormat(0);
}
return true;
}
public function getPriceItemsChangedByAttributes(&$priceP,
$attributes, $price, &$item, $ajax = 0) {
$paramsC = PhocacartUtils::getComponentParameters();
$display_unit_price =
$paramsC->get('display_unit_price', 1);
$fullAttributes = array();// Array of integers only
$thinAttributes = array();// Array of full objects (full options
object)
if ($ajax == 1) {
$fullAttributes =
PhocacartAttribute::getAttributeFullValues($attributes);
$thinAttributes = $attributes;
} else {
$fullAttributes = $attributes;
$thinAttributes =
PhocacartAttribute::getAttributesSelectedOnly($attributes);
}
// Stock Calculation
// 0 ... Main Product
// 1 ... Product Variations
// 2 ... Advanced Stock Management
// 3 ... Advanced Stock and Price Management
if ($item->stock_calculation == 0 || $item->stock_calculation
== 1) { // Price changes even when stock calculation = main product
if (!empty($fullAttributes)) {
foreach ($fullAttributes as $k => $v) {
if (!empty($v->options)) {
foreach ($v->options as $k2 => $v2) {
// Options:
// a) STANDARD LOAD - we search for default
values only to count them
// b) AJAX LOAD - we search for selected values
only (in this case attribute array only includes selected)
// so if standard load - at start - we count
only default values but when ajax reloads - e.g. some
// options were selected/deselected - we get
only array with selected value so we count them all
// EXAMPLE
// Product A has option 1 and it is set as
default at standard load - se we count only default_value
// But when user add some new option, e.g.
option 2 - we get this array (option1, option2) per ajax
// and we count all the items in this array
// STANDARD LOAD happens at rendering the page
(including default values)
// AJAX LOAD happens when user select or
deselect attributes of options and ajax will be called
// See:
administrator\components\com_phocacart\libraries\phocacart\stock\stock.php
// function getStockItemsChangedByAttributes -
similar behaviour
if ($ajax == 1 || ($ajax == 0 &&
isset($v2->default_value) && $v2->default_value == 1)) {
if (isset($v2->title) &&
isset($v2->amount) && isset($v2->operator)) {
$priceA =
$price->getPriceItems($v2->amount, $item->taxid,
$item->taxrate, $item->taxcalculationtype, $item->taxtitle);
if ($v2->operator == '-')
{
$priceP['netto'] -=
$priceA['netto'];
$priceP['brutto'] -=
$priceA['brutto'];
$priceP['tax'] -=
$priceA['tax'];
//$this->correctMinusPrice($priceP);
} else if ($v2->operator ==
'+') {
$priceP['netto'] +=
$priceA['netto'];
$priceP['brutto'] +=
$priceA['brutto'];
$priceP['tax'] +=
$priceA['tax'];
}
}
}
}
}
}
}
} else if ($item->stock_calculation == 3) {
// Advanced Stock Management
$k = PhocacartProduct::getProductKey((int)$item->id,
$thinAttributes);
$dataASM = PhocacartAttribute::getCombinationsDataByKey($k);
if (isset($dataASM['price']) &&
$dataASM['price'] > 0) {
$priceP =
$price->getPriceItems($dataASM['price'], $item->taxid,
$item->taxrate, $item->taxcalculationtype, $item->taxtitle);
}
}
// Standard Price - changed - we need to update it but only in case
the price is not zero
$priceP['nettoformat'] =
$price->getPriceFormat($priceP['netto']);
$priceP['bruttoformat'] =
$price->getPriceFormat($priceP['brutto']);
$priceP['taxformat'] =
$price->getPriceFormat($priceP['tax']);
// Unit price
$priceP['base'] = '';
$priceP['baseformat'] = '';
if (isset($item->unit_amount) && $item->unit_amount
> 0 && isset($item->unit_unit) &&
(int)$display_unit_price > 0) {
$priceP['base'] = $priceP['brutto'] /
$item->unit_amount;
$priceP['baseformat'] =
$price->getPriceFormat($priceP['base']) . '/' .
$item->unit_unit;
}
}
/* E.g. for payment methods, we need raw price converted by exchange
rate
*/
public static function convertPriceDefaultToCurrentCurrency($price,
$rate = 1) {
$price *= $rate;
return $price;
}
public static function convertPriceCurrentToDefaultCurrency($price,
$rate = 1) {
$price /= $rate;
return $price;
}
public static function cleanPrice($price) {
$price = (float)$price;
return $price + 0;
}
}
PK�"�[�#o,,&libraries/phocacart/product/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[_Qe7�7�'libraries/phocacart/product/product.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\PluginHelper;
defined('_JEXEC') or die();
class PhocacartProduct
{
private static $productAccess = array();
private static $productAttributes = array();
public function __construct() { }
public static function getProduct($productId, $prioritizeCatid = 0,
$type = array(0, 1))
{
$db = JFactory::getDBO();
$app = JFactory::getApplication();
$wheres = array();
$params = PhocacartUtils::getComponentParameters();
$user = PhocacartUser::getUser();
$userLevels = implode(',',
$user->getAuthorisedViewLevels());
$userGroups = implode(',',
PhocacartGroup::getGroupsById($user->id, 1, 1));
$skip = array();
//$skip['access'] =
$params->get('sql_product_skip_access', 0);
$skip['group'] =
$params->get('sql_product_skip_group', 0);
//$skip['attributes'] =
$params->get('sql_product_skip_attributes', 0);
//$skip['category_type'] =
$params->get('sql_product_skip_category_type', 0);
$skip['tax'] =
$params->get('sql_product_skip_tax', 0);
// Access is check by checkIfAccessPossible
//$wheres[] = " a.access IN
(".$userLevels.")";
//$wheres[] = " c.access IN
(".$userLevels.")";
//$wheres[] = " (ga.group_id IN (".$userGroups.") OR
ga.group_id IS NULL)";
//$wheres[] = " (gc.group_id IN (".$userGroups.") OR
gc.group_id IS NULL)";
//$wheres[] = " a.published = 1";
//$wheres[] = " c.published = 1";
//- $wheres[] = ' c.id = '.(int)$catid;
//- $typeS = implode(',', $type);
//- if (!$skip['category_type']) {
//- $wheres[] = " c.type IN (".$typeS.")";//
type: common, onlineshop, pos
//- }
$wheres[] = ' i.id = ' . (int)$productId;
// Views Plugin can load additional columns
$additionalColumns = array();
$pluginLayout = PluginHelper::importPlugin('pcv');
if ($pluginLayout) {
$pluginOptions = array();
$eventData = array();
Factory::getApplication()->triggerEvent('PCVonProductBeforeLoadColumns',
array('com_phocacart.product', &$pluginOptions, $eventData));
if (isset($pluginOptions['columns']) &&
$pluginOptions['columns'] != '') {
if (!empty($pluginOptions['columns'])) {
foreach ($pluginOptions['columns'] as $k => $v) {
$additionalColumns[] = PhocacartText::filterValue($v,
'alphanumeric3');
}
}
}
}
$baseColumns = array('i.id', 'i.title',
'i.alias', 'i.description', 'i.features',
'i.metatitle', 'i.metadesc', 'i.metakey',
'i.metadata', 'i.type', 'i.image',
'i.weight', 'i.height', 'i.width',
'i.length', 'i.min_multiple_quantity',
'i.min_quantity_calculation', 'i.volume',
'i.description', 'i.description_long',
'i.price', 'i.price_original',
'i.stockstatus_a_id', 'i.stockstatus_n_id',
'i.stock_calculation', 'i.min_quantity',
'i.min_multiple_quantity', 'i.stock',
'i.sales', 'i.featured', 'i.external_id',
'i.unit_amount', 'i.unit_unit', 'i.video',
'i.external_link', 'i.external_text',
'i.external_link2', 'i.external_text2',
'i.public_download_file', 'i.public_download_text',
'i.public_play_file', 'i.public_play_text',
'i.sku', 'i.upc', 'i.ean', 'i.jan',
'i.isbn', 'i.mpn', 'i.serial_number',
'i.points_needed', 'i.points_received',
'i.download_file', 'i.download_token',
'i.download_folder', 'i.download_days',
'i.date', 'i.date_update', 'i.delivery_date',
'i.gift_types');
$col = array_merge($baseColumns, $additionalColumns);
$col = array_unique($col);
$columns = implode(',', $col) . ',pc.ordering, c.id
AS catid, c.title AS cattitle, c.alias AS catalias, m.id as manufacturerid,
m.title as manufacturertitle, m.alias as manufactureralias,';
if (!$skip['tax']) {
$columns .= ' t.id as taxid, t.tax_rate as taxrate,
t.calculation_type as taxcalculationtype, t.title as taxtitle,';
} else {
$columns .= ' NULL as taxid, NULL as taxrate, NULL as
taxcalculationtype, NULL as taxtitle,';
}
if (!$skip['group']) {
$columns .= ' MIN(ppg.price) as group_price,
MAX(pptg.points_received) as group_points_received';
} else {
$columns .= ' NULL as group_price, NULL as
group_points_received';
}
$query = ' SELECT ' . $columns
. ' FROM #__phocacart_products AS i'
. ' LEFT JOIN #__phocacart_product_categories AS pc ON
pc.product_id = i.id'
. ' LEFT JOIN #__phocacart_categories AS c ON c.id =
pc.category_id'
. ' LEFT JOIN #__phocacart_manufacturers AS m ON m.id =
i.manufacturer_id';
if (!$skip['tax']) {
$query .= ' LEFT JOIN #__phocacart_taxes AS t ON t.id =
i.tax_id';
}
if (!$skip['group']) {
$query .= ' LEFT JOIN #__phocacart_item_groups AS ga ON
i.id = ga.item_id AND ga.type = 3';// type 3 is product
$query .= ' LEFT JOIN #__phocacart_item_groups AS gc ON
c.id = gc.item_id AND gc.type = 2';// type 2 is category
// user is in more groups, select lowest price by best group
$query .= ' LEFT JOIN #__phocacart_product_price_groups AS
ppg ON i.id = ppg.product_id AND ppg.group_id IN (SELECT group_id FROM
#__phocacart_item_groups WHERE item_id = i.id AND group_id IN (' .
$userGroups . ') AND type = 3)';
// user is in more groups, select highest points by best group
$query .= ' LEFT JOIN #__phocacart_product_point_groups AS
pptg ON i.id = pptg.product_id AND pptg.group_id IN (SELECT group_id FROM
#__phocacart_item_groups WHERE item_id = i.id AND group_id IN (' .
$userGroups . ') AND type = 3)';
}
$groupsFull = implode(',', $col) .',pc.ordering,
c.id, c.title, c.alias, m.id, m.title, m.alias';
if (!$skip['tax']) {
$groupsFull .= ', t.id, t.tax_rate, t.calculation_type,
t.title';
}
$groupsFast = 'i.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
$query .= ' WHERE ' . implode(' AND ', $wheres)
. ' GROUP BY ' . $groups
. ' ORDER BY i.id'
. ' LIMIT 1';
$db->setQuery($query);
$product = $db->loadObject();
// When we add the product, we can use the catid from where we are
located
// if we are in category A, then we try to add this product with
category A
// BUT the product can be displayed in cart e.g. 3x so only the
last added catid
// is used for creating the SEF URL
// Using catid is only about SEF URL
if ((int)$prioritizeCatid > 0) {
if (isset($product->catid) &&
(int)$product->catid == (int)$prioritizeCatid) {
//$product->catid is $product->catid
} else {
// Recheck the category id of product
$checkCategory = false;
if (isset($product->id)) {
$checkCategory =
PhocacartProduct::checkIfAccessPossible((int)$product->id,
(int)$prioritizeCatid, $type);
}
if ($checkCategory) {
$product->catid = (int)$prioritizeCatid;
}
}
}
// Change TAX based on country or region
if (!empty($product)) {
$taxChangedA =
PhocacartTax::changeTaxBasedOnRule($product->taxid,
$product->taxrate, $product->taxcalculationtype,
$product->taxtitle);
$product->taxrate = $taxChangedA['taxrate'];
$product->taxtitle = $taxChangedA['taxtitle'];
$product->taxcountryid =
$taxChangedA['taxcountryid'];
$product->taxregionid =
$taxChangedA['taxregionid'];
}
return $product;
}
/*
* Check if user has access to this product
* when adding to cart
* when ordering
* NOT USED when displaying, as no products are displayed which cannnot
be accessed
* So this is security feature in case of forgery - server side
checking
* STRICT RULES ARE VALID - if the product is included in
*/
public static function checkIfAccessPossible($id, $catid, $type =
array(0, 1))
{
$typeS = base64_encode(serialize(ksort($type)));
if (!isset(self::$productAccess[$id][$catid][$typeS])) {
if ((int)$id > 0) {
$db = JFactory::getDBO();
$wheres = array();
$user = PhocacartUser::getUser();
$userLevels = implode(',',
$user->getAuthorisedViewLevels());
$userGroups = implode(',',
PhocacartGroup::getGroupsById($user->id, 1, 1));
$wheres[] = " a.access IN (" . $userLevels .
")";
$wheres[] = " c.access IN (" . $userLevels .
")";
$wheres[] = " (ga.group_id IN (" . $userGroups .
") OR ga.group_id IS NULL)";
$wheres[] = " (gc.group_id IN (" . $userGroups .
") OR gc.group_id IS NULL)";
$wheres[] = " a.published = 1";
$wheres[] = " c.published = 1";
$wheres[] = ' a.id = ' . (int)$id;
$wheres[] = ' c.id = ' . (int)$catid;
//$wheres[] = ' c.type IN
('.implode(',', $type).')';
if (!empty($type) && is_array($type)) {
$wheres[] = ' c.type IN (' .
implode(',', $type) . ')';// Category Type (Shop/POS)
}
//$wheres[] = ' c.id = '.(int)$catid;
// PRODUCTTYPE
// 0 ... physical product, 1 ... digital product, 2 ...
physical and digital product, 3 ... price on demand product
$wheres[] = ' a.type != 3';// price on demand
product cannot be ordered and cannot be added to cart
$query = ' SELECT a.id'
. ' FROM #__phocacart_products AS a'
. ' LEFT JOIN #__phocacart_product_categories AS
pc ON pc.product_id = a.id'
. ' LEFT JOIN #__phocacart_categories AS c ON c.id
= pc.category_id'
//.' LEFT JOIN #__phocacart_categories AS c ON
a.catid = c.id'
. ' LEFT JOIN #__phocacart_item_groups AS ga ON
a.id = ga.item_id AND ga.type = 3'// type 3 is product
. ' LEFT JOIN #__phocacart_item_groups AS gc ON
c.id = gc.item_id AND gc.type = 2'// type 2 is category
. ' WHERE ' . implode(' AND ',
$wheres)
. ' ORDER BY a.id'
. ' LIMIT 1';
$db->setQuery($query);
$product = $db->loadObject();
if (isset($product->id) && (int)$product->id
> 0) {
//return true;
self::$productAccess[$id][$catid][$typeS] = true;
} else {
//$app = JFactory::getApplication();
//$app->enqueueMessage(JText::_('COM_PHOCACART_PRODUCT_ATTRIBUTE_REQUIRED'),
'error');
//return false;// seems like attribute is required but
not selected
self::$productAccess[$id][$catid][$typeS] = false;
}
} else {
self::$productAccess[$id][$catid][$typeS] = false;
}
}
return self::$productAccess[$id][$catid][$typeS];
}
public static function checkIfProductAttributesOptionsExist($id,
$idKey, $catid, $type = array(0, 1), $attribs = array())
{
$typeS = base64_encode(serialize(ksort($type)));
if (!isset(self::$productAttributes[$idKey][$catid][$typeS])) {
if (!empty($attribs)) {
$productAttribs =
PhocacartAttribute::getAttributesAndOptions($id);
foreach ($attribs as $k => $v) {
if (isset($productAttribs[$k])) {
foreach ($v as $k2 => $v2) {
if
(isset($productAttribs[$k]->options[$k2])) {
} else {
self::$productAttributes[$idKey][$catid][$typeS] = false;
break 2;
}
}
self::$productAttributes[$idKey][$catid][$typeS] =
true;
} else {
self::$productAttributes[$idKey][$catid][$typeS] =
false;
break;
}
}
} else {
self::$productAttributes[$idKey][$catid][$typeS] = true;
}
/*if ((int)$id > 0) {
$db = JFactory::getDBO();
$wheres = array();
$user = PhocacartUser::getUser();
$userLevels = implode (',',
$user->getAuthorisedViewLevels());
$userGroups = implode (',',
PhocacartGroup::getGroupsById($user->id, 1, 1));
$wheres[] = " a.access IN
(".$userLevels.")";
$wheres[] = " c.access IN
(".$userLevels.")";
$wheres[] = " (ga.group_id IN
(".$userGroups.") OR ga.group_id IS NULL)";
$wheres[] = " (gc.group_id IN
(".$userGroups.") OR gc.group_id IS NULL)";
$wheres[] = " a.published = 1";
$wheres[] = " c.published = 1";
$wheres[] = ' a.id = '.(int)$id;
$wheres[] = ' c.id = '.(int)$catid;
//$wheres[] = ' c.type IN
('.implode(',', $type).')';
if (!empty($type) && is_array($type)) {
$wheres[] = ' c.type IN
('.implode(',', $type).')';
}
//$wheres[] = ' c.id = '.(int)$catid;
$query = ' SELECT a.id'
.' FROM #__phocacart_products AS a'
.' LEFT JOIN #__phocacart_product_categories AS pc ON
pc.product_id = a.id'
.' LEFT JOIN #__phocacart_categories AS c ON c.id =
pc.category_id'
//.' LEFT JOIN #__phocacart_categories AS c ON a.catid
= c.id'
. ' LEFT JOIN #__phocacart_item_groups AS ga ON a.id =
ga.item_id AND ga.type = 3'// type 3 is product
. ' LEFT JOIN #__phocacart_item_groups AS gc ON c.id =
gc.item_id AND gc.type = 2'// type 2 is category
.' WHERE ' . implode( ' AND ', $wheres
)
.' ORDER BY a.id'
.' LIMIT 1';
$db->setQuery($query);
$product = $db->loadObject();
if (isset($product->id) && (int)$product->id
> 0) {
//return true;
self::$productAttributes[$id][$catid][$typeS] = true;
} else {
//$app = JFactory::getApplication();
//$app->enqueueMessage(JText::_('COM_PHOCACART_PRODUCT_ATTRIBUTE_REQUIRED'),
'error');
//return false;// seems like attribute is required but
not selected
self::$productAttributes[$id][$catid][$typeS] = false;
}
} else {
self::$productAttributes[$id][$catid][$typeS] = false;
}*/
}
return self::$productAttributes[$idKey][$catid][$typeS];
}
public static function getProductIdBySku($sku, $typeSku =
'sku', $type = array(0, 1))
{
$db = JFactory::getDBO();
$sku = $db->quote($sku);
$typeSkuS = $db->quoteName('a.' . $typeSku);
$typeSkuSA = $db->quoteName('ps.' . $typeSku);
$wheres = array(); // standard product
$wheresA = array();// advanced stock management product (EAN, SKU)
$user = PhocacartUser::getUser();
$userLevels = implode(',',
$user->getAuthorisedViewLevels());
$userGroups = implode(',',
PhocacartGroup::getGroupsById($user->id, 1, 1));
$wheres[] = " a.access IN (" . $userLevels .
")";
$wheres[] = " c.access IN (" . $userLevels .
")";
$wheres[] = " (ga.group_id IN (" . $userGroups . ")
OR ga.group_id IS NULL)";
$wheres[] = " (gc.group_id IN (" . $userGroups . ")
OR gc.group_id IS NULL)";
$wheres[] = " a.published = 1";
$wheres[] = " c.published = 1";
//$wheres[] = ' c.type IN ('.implode(',',
$type).')';
if (!empty($type) && is_array($type)) {
$wheres[] = ' c.type IN (' . implode(',',
$type) . ')';
}
$wheresA = $wheres;
$wheres[] = ' ' . $typeSkuS . ' = ' . $sku;
$wheresA[] = ' ' . $typeSkuSA . ' = ' . $sku;
$query = ' SELECT a.id, c.id as catid'
. ' FROM #__phocacart_products AS a'
. ' LEFT JOIN #__phocacart_product_categories AS pc ON
pc.product_id = a.id'
. ' LEFT JOIN #__phocacart_categories AS c ON c.id =
pc.category_id'
. ' LEFT JOIN #__phocacart_item_groups AS ga ON a.id =
ga.item_id AND ga.type = 3'// type 3 is product
. ' LEFT JOIN #__phocacart_item_groups AS gc ON c.id =
gc.item_id AND gc.type = 2'// type 2 is category
. ' WHERE ' . implode(' AND ', $wheres)
. ' ORDER BY a.id';
//.' LIMIT 1';
$db->setQuery($query);
$products = $db->loadObjectlist();
// We didn' find SKU or EAN in standard products
// Then try to find it in Advanced Stock Management (only SKU and
EAN are active)
// POS
if (empty($products) && ($typeSku == 'sku' ||
$typeSku == 'ean')) {
// Try to find SKU or EAN in Advanced stock management
$query = ' SELECT a.id, c.id AS catid, ps.attributes AS
attributes'
. ' FROM #__phocacart_products AS a'
. ' LEFT JOIN #__phocacart_product_categories AS pc ON
pc.product_id = a.id'
. ' LEFT JOIN #__phocacart_categories AS c ON c.id =
pc.category_id'
. ' LEFT JOIN #__phocacart_product_stock AS ps ON a.id =
ps.product_id'
. ' LEFT JOIN #__phocacart_item_groups AS ga ON a.id =
ga.item_id AND ga.type = 3'// type 3 is product
. ' LEFT JOIN #__phocacart_item_groups AS gc ON c.id =
gc.item_id AND gc.type = 2'// type 2 is category
. ' WHERE ' . implode(' AND ', $wheresA)
. ' ORDER BY a.id';
//.' LIMIT 1';
$db->setQuery($query);
$products = $db->loadObjectlist();
}
if (!empty($products)) {
foreach ($products as $k => $v) {
if (isset($v->id) && (int)$v->id > 0
&& isset($v->catid) && (int)$v->catid > 0) {
$access =
PhocacartProduct::checkIfAccessPossible((int)$v->id, (int)$v->catid,
$type);
if ($access) {
// if found some return the first possible -
accessible
// because of different rights, groups, etc., we
need to know catid
$product = array();
$product['id'] = (int)$v->id;
$product['catid'] = (int)$v->catid;
if (isset($v->attributes) &&
$v->attributes != '') {
$product['attributes'] =
unserialize($v->attributes);
}
return $product;
}
}
}
}
return false;
}
public static function getProductIdByOrder($orderId)
{
$db = JFactory::getDBO();
$query = ' SELECT a.id'
. ' FROM #__phocacart_products AS a'
. ' LEFT JOIN #__phocacart_order_products AS o ON
o.product_id = a.id'
. ' WHERE o.id = ' . (int)$orderId
. ' ORDER BY a.id'
. ' LIMIT 1';
$db->setQuery($query);
$product = $db->loadObject();
return $product;
}
/*
* We don't need catid, we get all categories for this product
listed from group_concat
*/
public static function getProductByProductId($id)
{
if ($id < 1) {
return false;
}
$db = JFactory::getDBO();
$query = ' SELECT a.id, a.title,'
. ' group_concat(CONCAT_WS(":", c.id, c.title)
SEPARATOR \',\') AS categories,'
. ' group_concat(c.title SEPARATOR \' \') AS
categories_title,'
. ' group_concat(c.id SEPARATOR \',\') AS
categories_id'
. ' FROM #__phocacart_products AS a'
. ' LEFT JOIN #__phocacart_product_categories AS pc ON
pc.product_id = a.id'
. ' LEFT JOIN #__phocacart_categories AS c ON c.id =
pc.category_id'
. ' WHERE a.id = ' . (int)$id
. ' GROUP BY a.id, a.title'
. ' ORDER BY a.id'
. ' LIMIT 1';
$db->setQuery($query);
$product = $db->loadObject();
return $product;
}
// No access rights, publish, stock, etc. Not group contacts, but * -
we really need it
public static function getProductsFull($limitOffset = 0, $limitCount =
1, $orderingItem = 1)
{
/*phocacart import('phocacart.ordering.ordering');*/
$ordering =
PhocacartOrdering::getOrderingCombination($orderingItem);
$db = JFactory::getDBO();
$wheres = array();
$where = (count($wheres) ? ' WHERE ' . implode(' AND
', $wheres) : '');
$q = ' SELECT a.*';
// No Images, Categories, Attributes, Specifications here
$q .= ', CONCAT_WS(":", t.id, t.alias) AS tax';
$q .= ', CONCAT_WS(":", m.id, m.alias) AS
manufacturer';
$q .= ' FROM #__phocacart_products AS a'
. ' LEFT JOIN #__phocacart_taxes AS t ON t.id =
a.tax_id'
. ' LEFT JOIN #__phocacart_manufacturers AS m ON m.id =
a.manufacturer_id'
. $where;
if ($ordering != '') {
$q .= ' ORDER BY ' . $ordering;
}
if ((int)$limitCount > 0) {
$q .= ' LIMIT ' . (int)$limitOffset . ', '
. (int)$limitCount;
}
$db->setQuery($q);
$products = $db->loadAssocList();
return $products;
}
/*
* checkPublished = true - select only published products
* checkPublished = false - select all (published|unpublished) products
* PUBLISHED MEANS, THEY ARE REALLY PUBLISHED - they are published as
products and their category is published too.
*
* checkStock - check Stock or not ( > 0 )
* checkPrice - check if the product has price or not ( > 0 )
*/
public static function getProducts($limitOffset = 0, $limitCount = 1,
$orderingItem = 1, $orderingCat = 0, $checkPublished = false, $checkStock =
false, $checkPrice = false, $categoriesList = 0, $categoryIds = array(),
$featuredOnly = 0, $type = array(0, 1), $queryColumns = '',
$return = '', $filterLang = false )
{
/*phocacart import('phocacart.ordering.ordering');*/
$ordering =
PhocacartOrdering::getOrderingCombination($orderingItem, $orderingCat);
$db = JFactory::getDBO();
$wheres = array();
$user = PhocacartUser::getUser();
$userLevels = implode(',',
$user->getAuthorisedViewLevels());
$userGroups = implode(',',
PhocacartGroup::getGroupsById($user->id, 1, 1));
$wheres[] = " a.access IN (" . $userLevels .
")";
$wheres[] = " c.access IN (" . $userLevels .
")";
$wheres[] = " (ga.group_id IN (" . $userGroups . ")
OR ga.group_id IS NULL)";
$wheres[] = " (gc.group_id IN (" . $userGroups . ")
OR gc.group_id IS NULL)";
if ($checkPublished) {
$wheres[] = " a.published = 1";
$wheres[] = " c.published = 1";
}
if (!empty($type) && is_array($type)) {
$wheres[] = 'c.type IN (' . implode(',',
$type) . ')';
}
if ($checkStock) {
$wheres[] = " a.stock > 0";
}
if ($checkPrice) {
$wheres[] = " a.price > 0";
}
if (!empty($categoryIds)) {
$catIdsS = implode(',', $categoryIds);
$wheres[] = 'pc.category_id IN (' . $catIdsS .
')';
}
if ($featuredOnly) {
$wheres[] = 'a.featured = 1';
}
// Additional Hits
if ($orderingItem == 17 || $orderingItem == 18) {
$wheres[] = 'ah.product_id = a.id';
$wheres[] = 'ah.user_id = ' . (int)$user->id;
$wheres[] = 'ah.user_id > 0';
}
// Filter langauge
if ($filterLang) {
$lang = Factory::getLanguage()->getTag();
$wheres[] =
PhocacartUtilsSettings::getLangQuery('a.language', $lang);
$wheres[] =
PhocacartUtilsSettings::getLangQuery('c.language', $lang);
}
// Views Plugin can load additional columns
$additionalColumns = array();
$pluginLayout = PluginHelper::importPlugin('pcv');
if ($pluginLayout) {
$pluginOptions = array();
$eventData = array();
Factory::getApplication()->triggerEvent('PCVonProductsBeforeLoadColumns',
array('com_phocacart.products', &$pluginOptions,
$eventData));
if (isset($pluginOptions['columns']) &&
$pluginOptions['columns'] != '') {
if (!empty($pluginOptions['columns'])) {
foreach ($pluginOptions['columns'] as $k => $v) {
$additionalColumns[] = PhocacartText::filterValue($v,
'alphanumeric3');
}
}
}
}
$baseColumns = array('a.id', 'a.title',
'a.image', 'a.video', 'a.alias',
'a.description', 'a.description_long',
'a.sku', 'a.ean', 'a.stockstatus_a_id',
'a.stockstatus_n_id', 'a.min_quantity',
'a.min_multiple_quantity', 'a.stock',
'a.unit_amount', 'a.unit_unit', 'a.price',
'a.price_original', 'a.date', 'a.sales',
'a.featured', 'a.external_id', 'a.condition',
'a.points_received', 'a.points_needed',
'a.delivery_date', 'a.type', 'a.type_feed',
'a.type_category_feed', 'a.params_feed',
'a.gift_types');
$col = array_merge($baseColumns, $additionalColumns);
$col = array_unique($col);
/*
* type_feed - specific type of products used in XML feed (for
example by Google products: g:product_type)
* type_category_feed - specific type of product category used in
XML feed (for example by Google products: g:google_product_category)
* - overrides category type_feed (type feed in
category table)
* type - digital (downloadable) product or physical product
*/
if ($queryColumns != '') {
$columns = $queryColumns;
$groupsFull = $queryColumns;
$groupsFast = 'a.id';
} else {
$columns = implode(',', $col) . ', c.id AS
catid, c.title AS cattitle, c.alias AS catalias, c.title_feed AS
cattitlefeed, c.type_feed AS cattypefeed, MIN(ppg.price) as group_price,
MAX(pptg.points_received) as group_points_received, t.id as taxid,
t.tax_rate AS taxrate, t.calculation_type AS taxcalculationtype, t.title AS
taxtitle, m.title AS manufacturertitle,'
. ' AVG(r.rating) AS rating,'
. ' at.required AS attribute_required';
$groupsFull = implode(',', $col) . ', c.id,
c.title, c.alias, c.title_feed, c.type_feed, ppg.price,
pptg.points_received, t.id, t.tax_rate, t.calculation_type, t.title,
m.title, r.rating, at.required';
$groupsFast = 'a.id';
}
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
$q = ' SELECT ' . $columns;
if ($categoriesList == 1) {
$q .= ', GROUP_CONCAT(c.id) AS categories';
} else if ($categoriesList == 2) {
$q .= ', GROUP_CONCAT(c.title SEPARATOR "|") AS
categories';
} else if ($categoriesList == 3) {
$q .= ', GROUP_CONCAT(c.id, ":", c.alias
SEPARATOR "|") AS categories';
} else if ($categoriesList == 4) {
$q .= ', GROUP_CONCAT(c.id, ":", c.title
SEPARATOR "|") AS categories';
} else if ($categoriesList == 5) {
// add to 2 type_category_feed - used in XML FEED
$q .= ', GROUP_CONCAT(c.title SEPARATOR "|") AS
categories';
$q .= ', GROUP_CONCAT(c.type_feed SEPARATOR "|")
AS feedcategories';
}
// Possible DISTINCT
//$q .= ', GROUP_CONCAT(DISTINCT c.id, ":", c.title
SEPARATOR "|") AS categories';
$q .= ' FROM #__phocacart_products AS a'
. ' LEFT JOIN #__phocacart_product_categories AS pc ON
pc.product_id = a.id'
. ' LEFT JOIN #__phocacart_categories AS c ON c.id =
pc.category_id'
. ' LEFT JOIN #__phocacart_taxes AS t ON t.id =
a.tax_id'
. ' LEFT JOIN #__phocacart_reviews AS r ON a.id =
r.product_id AND r.id > 0'
. ' LEFT JOIN #__phocacart_manufacturers AS m ON m.id =
a.manufacturer_id'
. ' LEFT JOIN #__phocacart_attributes AS at ON a.id =
at.product_id AND at.id > 0 AND at.required = 1'
. ' LEFT JOIN #__phocacart_item_groups AS ga ON a.id =
ga.item_id AND ga.type = 3'// type 3 is product
. ' LEFT JOIN #__phocacart_item_groups AS gc ON c.id =
gc.item_id AND gc.type = 2'// type 2 is category
// user is in more groups, select lowest price by best group
. ' LEFT JOIN #__phocacart_product_price_groups AS ppg ON
a.id = ppg.product_id AND ppg.group_id IN (SELECT group_id FROM
#__phocacart_item_groups WHERE item_id = a.id AND group_id IN (' .
$userGroups . ') AND type = 3)'
// user is in more groups, select highest points by best group
. ' LEFT JOIN #__phocacart_product_point_groups AS pptg ON
a.id = pptg.product_id AND pptg.group_id IN (SELECT group_id FROM
#__phocacart_item_groups WHERE item_id = a.id AND group_id IN (' .
$userGroups . ') AND type = 3)';
// Additional Hits
if ($orderingItem == 17 || $orderingItem == 18) {
$q .= ' LEFT JOIN #__phocacart_hits AS ah ON a.id =
ah.product_id';
}
$q .= ' WHERE ' . implode(' AND ', $wheres)
. ' GROUP BY ' . $groups;
if ($ordering != '') {
$q .= ' ORDER BY ' . $ordering;
}
if ((int)$limitCount > 0) {
$q .= ' LIMIT ' . (int)$limitOffset . ', '
. (int)$limitCount;
}
$db->setQuery($q);
if ($return == 'column') {
$products = $db->loadColumn();
} else {
$products = $db->loadObjectList();
}
return $products;
}
/*
* Obsolete
*/
public static function getCategoryByProductId($id)
{
$db = JFactory::getDBO();
$query = 'SELECT a.catid'
. ' FROM #__phocacart_products AS a'
. ' WHERE a.id = ' . (int)$id
. ' ORDER BY a.id'
. ' LIMIT 1';
$db->setQuery($query);
$category = $db->loadRow();
if (isset($category[0]) && $category[0] > 0) {
return $category[0];
}
return 0;
}
public static function getCategoriesByProductId($id)
{
$db = JFactory::getDBO();
$q = 'SELECT pc.category_id, c.alias, pc.ordering'
. ' FROM #__phocacart_product_categories AS pc'
. ' LEFT JOIN #__phocacart_categories AS c ON c.id =
pc.category_id'
. ' WHERE pc.product_id = ' . (int)$id
. ' ORDER BY pc.ordering';
$db->setQuery($q);
$categories = $db->loadAssocList();
return $categories;
}
public static function getImagesByProductId($id)
{
$db = JFactory::getDBO();
$q = 'SELECT pi.image'
. ' FROM #__phocacart_product_images AS pi'
. ' WHERE pi.product_id = ' . (int)$id
. ' ORDER BY pi.id';
$db->setQuery($q);
$images = $db->loadAssocList();
return $images;
}
public static function getImageByProductId($id)
{
$db = JFactory::getDBO();
$q = 'SELECT p.image'
. ' FROM #__phocacart_products AS p'
. ' WHERE p.id = ' . (int)$id
. ' ORDER BY p.id'
. ' LIMIT 1';
$db->setQuery($q);
$image = $db->loadResult();
return $image;
}
public static function getMostViewedProducts($limit = 5,
$checkPublished = false, $checkAccess = false, $count = false, $type =
array(0, 1))
{
$db = JFactory::getDBO();
$wheres = array();
if ($checkAccess) {
$user = PhocacartUser::getUser();
$userLevels = implode(',',
$user->getAuthorisedViewLevels());
$userGroups = implode(',',
PhocacartGroup::getGroupsById($user->id, 1, 1));
$wheres[] = " a.access IN (" . $userLevels .
")";
$wheres[] = " c.access IN (" . $userLevels .
")";
$wheres[] = " (ga.group_id IN (" . $userGroups .
") OR ga.group_id IS NULL)";
$wheres[] = " (gc.group_id IN (" . $userGroups .
") OR gc.group_id IS NULL)";
}
if ($checkPublished) {
$wheres[] = " a.published = 1";
}
if (!empty($type) && is_array($type)) {
$wheres[] = 'c.type IN (' . implode(',',
$type) . ')';
}
$wheres[] = " a.hits > 0";
$where = (count($wheres) ? ' WHERE ' . implode(' AND
', $wheres) : '');
if ($count) {
$q = 'SELECT SUM(a.hits)'
. ' FROM #__phocacart_products AS a'
. ' LEFT JOIN #__phocacart_product_categories AS pc ON
pc.product_id = a.id'
. ' LEFT JOIN #__phocacart_categories AS c ON c.id =
pc.category_id';
if ($checkAccess) {
$q .= ' LEFT JOIN #__phocacart_item_groups AS ga ON
a.id = ga.item_id AND ga.type = 3'// type 3 is product
. ' LEFT JOIN #__phocacart_item_groups AS gc ON
c.id = gc.item_id AND gc.type = 2';// type 2 is category
}
$q .= $where;
if ((int)$limit > 0) {
$q .= ' LIMIT ' . (int)$limit;
}
$db->setQuery($q);
$products = $db->loadResult();
} else {
$q = 'SELECT a.id, a.title, a.alias, SUM(a.hits) AS hits,
GROUP_CONCAT(DISTINCT c.id) as catid, GROUP_CONCAT(DISTINCT c.alias) as
catalias, GROUP_CONCAT(DISTINCT c.title) as cattitle'
. ' FROM #__phocacart_products AS a'
. ' LEFT JOIN #__phocacart_product_categories AS pc ON
pc.product_id = a.id'
. ' LEFT JOIN #__phocacart_categories AS c ON c.id =
pc.category_id';
if ($checkAccess) {
$q .= ' LEFT JOIN #__phocacart_item_groups AS ga ON
a.id = ga.item_id AND ga.type = 3'// type 3 is product
. ' LEFT JOIN #__phocacart_item_groups AS gc ON
c.id = gc.item_id AND gc.type = 2';// type 2 is category
}
$q .= $where
. ' GROUP BY a.id, a.title, a.alias, a.hits'
. ' ORDER BY a.hits DESC';
if ((int)$limit > 0) {
$q .= ' LIMIT ' . (int)$limit;
}
$db->setQuery($q);
$products = $db->loadObjectList();
}
return $products;
}
public static function getBestSellingProducts($limit = 5, $dateFrom =
'', $dateTo = '', $count = false)
{
$db = JFactory::getDBO();
$wheres = array();
$wheres[] = " o.id > 0";
if ($dateTo != '' && $dateFrom != '') {
$dateFrom = $db->Quote($dateFrom);
$dateTo = $db->Quote($dateTo);
$wheres[] = ' DATE(od.date) >= ' . $dateFrom .
' AND DATE(od.date) <= ' . $dateTo;
}
$where = (count($wheres) ? ' WHERE ' . implode(' AND
', $wheres) : '');
if ($count) {
$q = ' SELECT COUNT(o.id)'
. ' FROM #__phocacart_order_products AS o'
. ' LEFT JOIN #__phocacart_products AS a ON a.id =
o.product_id';
if ($dateTo != '' && $dateFrom !=
'') {
$q .= ' LEFT JOIN #__phocacart_orders AS od ON od.id =
o.order_id';
}
$q .= $where;
if ((int)$limit > 0) {
$q .= ' LIMIT ' . (int)$limit;
}
$db->setQuery($q);
$products = $db->loadResult();
} else {
$q = ' SELECT o.product_id AS id, o.title, o.alias, COUNT(
o.id ) AS count_products'
. ' FROM #__phocacart_order_products AS o';
//. ' LEFT JOIN #__phocacart_products AS a ON a.id =
o.product_id';
if ($dateTo != '' && $dateFrom !=
'') {
$q .= ' LEFT JOIN #__phocacart_orders AS od ON od.id =
o.order_id';
}
$q .= $where
. ' GROUP BY o.product_id, o.title, o.alias'
. ' ORDER BY count_products DESC';
if ((int)$limit > 0) {
$q .= ' LIMIT ' . (int)$limit;
}
$db->setQuery($q);
$products = $db->loadObjectList();
}
/* For now we don't need SEF url, if SEF url is needed, we
need to get category alias and category id
* This cannot be done in sql as then because of table
jos_phocacart_product_categories will count count duplicities
*/
/*
$productsA = array();
if (!empty($products)) {
foreach ($products as $k => $v) {
if (isset($v->id)) {
$productsA[] = (int)$v->id;
}
}
}
$productsS = '';
if (!empty($productsA)) {
$productsS = implode(',', $productsA);
}
$categories = array();
if ($productsS != '') {
$query = 'SELECT pc.product_id AS id, c.id AS catid,
c.title AS cattitle, c.alias AS catalias'
. ' FROM #__phocacart_categories AS c'
. ' LEFT JOIN #__phocacart_product_categories AS pc ON
pc.category_id = c.id'
. ' LEFT JOIN #__phocacart_products AS p ON p.id =
pc.product_id'
. ' WHERE pc.product_id IN
('.$productsS.')'
. ' GROUP BY pc.product_id';
$db->setQuery( $query );
$categories = $db->loadObjectList();
}
if (!empty($categories) && !empty($products)) {
foreach($products as $k => &$v) {
foreach($categories as $k2 => $v2) {
if (isset($v->id) && isset($v2->id)
&& (int)$v->id > 0 && (int)$v->id ==
(int)$v2->id) {
$v->catid = $v2->catid;
$v->catalias = $v2->catalias;
$v->cattitle = $v2->cattitle;
}
}
}
}*/
return $products;
}
/* Used for Export Import
* Set in layout so users can select columns
*/
/*
public static function getProductColumns() {
$a = array();
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$export_attributes = $paramsC->get(
'export_attributes', 1 );
$export_specifications = $paramsC->get(
'export_specifications', 1 );
$export_downloads = $paramsC->get(
'export_downloads', 0 );
//$a[] = array('catid',
'COM_PHOCACART_FIELD__LABEL');
// Categories, Images, Attributes, Specifications
$a[] = array('id', 'JGLOBAL_FIELD_ID_LABEL');
$a[] = array('title',
'COM_PHOCACART_FIELD_TITLE_LABEL');
$a[] = array('alias',
'COM_PHOCACART_FIELD_ALIAS_LABEL');
$a[] = array('sku',
'COM_PHOCACART_FIELD_SKU_LABEL');
$a[] = array('ean',
'COM_PHOCACART_FIELD_EAN_LABEL');
$a[] = array('price',
'COM_PHOCACART_FIELD_PRICE_LABEL');
$a[] = array('price_original',
'COM_PHOCACART_FIELD_ORIGINAL_PRICE_LABEL');
// TAX***
//$a[] = array('tax_id',
'COM_PHOCACART_FIELD_TAX_LABEL');
$a[] = array('tax',
'COM_PHOCACART_FIELD_TAX_LABEL');
// CATEGORIES (not exist in query)
$a[] = array('categories',
'COM_PHOCACART_CATEGORIES');
// MANUFACTURER***
//$a[] = array('manufacturer_id',
'COM_PHOCACART_FIELD_MANUFACTURER_LABEL');
$a[] = array('manufacturer',
'COM_PHOCACART_FIELD_MANUFACTURER_LABEL');
$a[] = array('upc',
'COM_PHOCACART_FIELD_UPC_LABEL');
$a[] = array('jan',
'COM_PHOCACART_FIELD_JAN_LABEL');
$a[] = array('isbn',
'COM_PHOCACART_FIELD_ISBN_LABEL');
$a[] = array('mpn',
'COM_PHOCACART_FIELD_MPN_LABEL');
$a[] = array('serial_number',
'COM_PHOCACART_FIELD_SERIAL_NUMBER_LABEL');
$a[] = array('registration_key',
'COM_PHOCACART_FIELD_REGISTRATION_KEY_LABEL');
$a[] = array('external_id',
'COM_PHOCACART_FIELD_EXTERNAL_PRODUCT_ID_LABEL');
$a[] = array('external_key',
'COM_PHOCACART_FIELD_EXTERNAL_PRODUCT_KEY_LABEL');
$a[] = array('external_link',
'COM_PHOCACART_FIELD_EXTERNAL_LINK_LABEL');
$a[] = array('external_text',
'COM_PHOCACART_FIELD_EXTERNAL_TEXT_LABEL');
$a[] = array('access', 'JFIELD_ACCESS_LABEL');
$a[] = array('featured',
'COM_PHOCACART_FIELD_FEATURED_LABEL');
$a[] = array('video',
'COM_PHOCACART_FIELD_VIDEO_URL_LABEL');
$a[] = array('public_download_file',
'COM_PHOCACART_FIELD_PUBLIC_DOWNLOAD_FILE_LABEL');
$a[] = array('description',
'COM_PHOCACART_FIELD_DESCRIPTION_LABEL');
$a[] = array('description_long',
'COM_PHOCACART_FIELD_DESCRIPTION_LONG_LABEL');
$a[] = array('image',
'COM_PHOCACART_FIELD_IMAGE_LABEL');
// IMAGES (not exist in query)
$a[] = array('images',
'COM_PHOCACART_ADDITIONAL_IMAGES');
if ($export_attributes == 1) {
// ATTRIBUTES (not exist in query)
$a[] = array('attributes',
'COM_PHOCACART_ATTRIBUTES');
}
if ($export_specifications == 1) {
// SPECIFICATIONS (not exist in query)
$a[] = array('specifications',
'COM_PHOCACART_SPECIFICATIONS');
}
// RELATED_PRODUCTS (not exist in query)
$a[] = array('related',
'COM_PHOCACART_RELATED_PRODUCTS');
$a[] = array('stock',
'COM_PHOCACART_FIELD_IN_STOCK_LABEL');
$a[] = array('stockstatus_a_id',
'COM_PHOCACART_FIELD_STOCK_STATUS_A_LABEL');
$a[] = array('stockstatus_n_id',
'COM_PHOCACART_FIELD_STOCK_STATUS_B_LABEL');
$a[] = array('min_quantity',
'COM_PHOCACART_FIELD_MIN_ORDER_QUANTITY_LABEL');
$a[] = array('min_multiple_quantity',
'COM_PHOCACART_FIELD_MIN_MULTIPLE_ORDER_QUANTITY_LABEL');
//$a[] = array('availability',
'COM_PHOCACART_FIELD_AVAILABILITY_LABEL');
if ($export_downloads == 1) {
$a[] = array('download_token',
'COM_PHOCACART_FIELD_DOWNLOAD_TOKEN_LABEL');
$a[] = array('download_folder',
'COM_PHOCACART_FIELD_DOWNLOAD_FOLDER_LABEL');
$a[] = array('download_file',
'COM_PHOCACART_FIELD_DOWNLOAD_FILE_LABEL');
$a[] = array('download_hits',
'COM_PHOCACART_FIELD_DOWNLOAD_HITS_LABEL');
}
$a[] = array('length',
'COM_PHOCACART_FIELD_LENGTH_LABEL');
$a[] = array('width',
'COM_PHOCACART_FIELD_WIDTH_LABEL');
$a[] = array('height',
'COM_PHOCACART_FIELD_HEIGHT_LABEL');
//$a[] = array('unit_size',
'COM_PHOCACART_FIELD_UNIT_SIZE_LABEL');
$a[] = array('weight',
'COM_PHOCACART_FIELD_WEIGHT_LABEL');
//$a[] = array('unit_weight',
'COM_PHOCACART_FIELD_UNIT_WEIGHT_LABEL');
$a[] = array('volume',
'COM_PHOCACART_FIELD_VOLUME_LABEL');
//$a[] = array('unit_volume',
'COM_PHOCACART_FIELD__LABEL');
$a[] = array('unit_amount',
'COM_PHOCACART_FIELD_UNIT_AMOUNT_LABEL');
$a[] = array('unit_unit',
'COM_PHOCACART_FIELD_UNIT_UNIT_LABEL');
$a[] = array('published',
'COM_PHOCACART_FIELD_PUBLISHED_LABEL');
$a[] = array('language',
'JFIELD_LANGUAGE_LABEL');
$a[] = array('date',
'COM_PHOCACART_FIELD_DATE_LABEL');
// TAGS (not exist in query)
$a[] = array('tags', 'COM_PHOCACART_TAGS');
$a[] = array('metakey',
'JFIELD_META_KEYWORDS_LABEL');
$a[] = array('metadesc',
'JFIELD_META_DESCRIPTION_LABEL');
//$a[] = array('ordering',
'COM_PHOCACART_FIELD_ORDERING_LABEL');
//$a[] = array('allow_upload',
'COM_PHOCACART_FIELD_ALLOW_UPLOAD_LABEL');
//$a[] = array('custom_text',
'COM_PHOCACART_FIELD_CUSTOM_TEXT_LABEL');
//$a[] = array('checked_out',
'COM_PHOCACART_FIELD__LABEL');
//$a[] = array('checked_out_time',
'COM_PHOCACART_FIELD__LABEL');
//$a[] = array('hits',
'COM_PHOCACART_FIELD_HITS_LABEL');
//$a[] = array('sales',
'COM_PHOCACART_FIELD__LABEL');
//$a[] = array('params',
'COM_PHOCACART_FIELD__LABEL');
//$a[] = array('metadata',
'COM_PHOCACART_FIELD__LABEL');
return $a;
} */
public static function featured($pks, $value = 0)
{
// Sanitize the ids.
$pks = (array)$pks;
\Joomla\Utilities\ArrayHelper::toInteger($pks);
$app = JFactory::getApplication();
if (empty($pks)) {
$app->enqueueMessage(JText::_('COM_PHOCACART_NO_ITEM_SELECTED'),
'message');
return false;
}
//$table = $this->getTable('PhocacartFeatured',
'Table');
$table = JTable::getInstance('PhocacartFeatured',
'Table', array());
try {
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->update($db->quoteName('#__phocacart_products'))
->set('featured = ' . (int)$value)
->where('id IN (' . implode(',',
$pks) . ')');
$db->setQuery($query);
$db->execute();
if ((int)$value == 0) {
// Adjust the mapping table.
// Clear the existing features settings.
$query = $db->getQuery(true)
->delete($db->quoteName('#__phocacart_product_featured'))
->where('product_id IN (' .
implode(',', $pks) . ')');
$db->setQuery($query);
$db->execute();
} else {
// first, we find out which of our new featured articles
are already featured.
$query = $db->getQuery(true)
->select('f.product_id')
->from('#__phocacart_product_featured AS
f')
->where('product_id IN (' .
implode(',', $pks) . ')');
//echo $query;
$db->setQuery($query);
$old_featured = $db->loadColumn();
// we diff the arrays to get a list of the articles that
are newly featured
$new_featured = array_diff($pks, $old_featured);
// Featuring.
$tuples = array();
foreach ($new_featured as $pk) {
$tuples[] = $pk . ', 0';
}
if (count($tuples)) {
$db = JFactory::getDbo();
$columns = array('product_id',
'ordering');
$query = $db->getQuery(true)
->insert($db->quoteName('#__phocacart_product_featured'))
->columns($db->quoteName($columns))
->values($tuples);
$db->setQuery($query);
$db->execute();
}
}
} catch (Exception $e) {
$app->enqueueMessage($e->getMessage(),
'message');
return false;
}
$table->reorder();
//$this->cleanCache();
return true;
}
public static function storeProduct($data, $importColumn = 1)
{
// Store
$table = JTable::getInstance('PhocaCartItem',
'Table', array());
$newInsertOldId = 0;
if ($importColumn == 2) {
// SKU
if (isset($data['sku']) &&
$data['sku'] != '') {
$found = $table->load(array('sku' =>
$data['sku']));
// Such id is found, but we store by SKU - we need to unset
it to get new created by autoincrement
if ($found) {
$data['id'] = $table->id;
} else {
// New row
//unset($data['id']); store the same ID for
importing product if possible
// unfortunately this is not possible per standard way
// We didn't find the row by SKU, but we have the
ID, so we try to update by ID
// If we don't find the ID (so no SKU, no ID),
insert new row
// We try to add current ID (it does not exist), not
new autoincrement
$found2 = $table->load((int)$data['id']);
if (!$found2) {
$newInsertOldId = 1;
}
}
}
} else {
// ID
if (isset($data['id']) &&
(int)$data['id'] > 0) {
$found = $table->load((int)$data['id']);
// Such id not found, we need to unset it to get new
created by autoincrement
if (!$found) {
// New row
//unset($data['id']); store the same ID for
importing product if possible
// unfortunately this is not possible per standard way
$newInsertOldId = 1;
}
}
}
if (!$table->bind($data)) {
throw new Exception($table->getError());
return false;
}
if (intval($table->date) == 0) {
$table->date = JFactory::getDate()->toSql();
}
if (!$table->check()) {
throw new Exception($table->getError());
return false;
}
if ($newInsertOldId == 1) {
// The imported ID does not exist, we need to add new row, but
we try to use the same ID
// even the ID is autoincrement (this is why we use non
standard method) because
// standard method cannot add IDs into autoincrement
$db = JFactory::getDBO();
if (!$db->insertObject('#__phocacart_products',
$table, 'id')) {
throw new Exception($table->getError());
return false;
}
} else {
if (!$table->store()) {
throw new Exception($table->getError());
return false;
}
}
// Test Thumbnails (Create if not exists)
if ($table->image != '') {
$thumb =
PhocacartFileThumbnail::getOrCreateThumbnail($table->image,
'', 1, 1, 1, 0, 'productimage');
}
if ((int)$table->id > 0) {
if (!isset($data['catid_multiple'])) {
$data['catid_multiple'] = array();
}
if (!isset($data['catid_multiple_ordering'])) {
$data['catid_multiple_ordering'] = array();
}
PhocacartCategoryMultiple::storeCategories($data['catid_multiple'],
(int)$table->id, $data['catid_multiple_ordering']);
if (isset($data['featured'])) {
PhocacartProduct::featured((int)$table->id,
$data['featured']);
}
$dataRelated = '';
if (!isset($data['related'])) {
$dataRelated = '';
} else {
$dataRelated = $data['related'];
if (is_array($data['related']) &&
isset($data['related'][0])) {
$dataRelated = $data['related'][0];
}
}
$advancedStockOptions = '';
if (!isset($data['advanced_stock_options'])) {
$advancedStockOptions = '';
} else {
$advancedStockOptions =
$data['advanced_stock_options'];
if (is_array($data['advanced_stock_options'])
&& isset($data['advanced_stock_options'][0])) {
$advancedStockOptions =
$data['advanced_stock_options'][0];
}
}
$additionalDownloadFiles = '';
if (!isset($data['additional_download_files'])) {
$additionalDownloadFiles = '';
} else {
$additionalDownloadFiles =
$data['additional_download_files'];
}
PhocacartRelated::storeRelatedItemsById($dataRelated,
(int)$table->id);
PhocacartImageAdditional::storeImagesByProductId((int)$table->id,
$data['images']);
PhocacartAttribute::storeAttributesById((int)$table->id,
$data['attributes']);
PhocacartAttribute::storeCombinationsById((int)$table->id,
$advancedStockOptions);
PhocacartSpecification::storeSpecificationsById((int)$table->id,
$data['specifications']);
PhocacartDiscountProduct::storeDiscountsById((int)$table->id,
$data['discounts']);
PhocacartFileAdditional::storeProductFilesByProductId((int)$table->id,
$additionalDownloadFiles);
PhocacartTag::storeTags($data['tags'],
(int)$table->id);
PhocacartTag::storeTagLabels($data['taglabels'],
(int)$table->id);
// PARAMETERS
$parameters = PhocacartParameter::getAllParameters();
if (!empty($parameters)) {
foreach ($parameters as $kP => $vP) {
if (isset($vP->id) && (int)$vP->id >
0) {
$idP = (int)$vP->id;
if
(!empty($data['items_parameter'][$idP])) {
PhocacartParameter::storeParameterValues($data['items_parameter'][$idP],
(int)$table->id, $idP);
} else {
PhocacartParameter::storeParameterValues(array(), (int)$table->id,
$idP);
}
}
}
}
PhocacartGroup::storeProductPriceGroupsById($data['price_groups'],
(int)$table->id);
PhocacartGroup::storeProductPointGroupsById($data['point_groups'],
(int)$table->id);
PhocacartGroup::storeGroupsById((int)$table->id, 3,
$data['groups']);
PhocacartPriceHistory::storePriceHistoryCustomById($data['price_histories'],
(int)$table->id);
PhocacartGroup::updateGroupProductPriceById((int)$table->id,
$data['price']);
PhocacartGroup::updateGroupProductRewardPointsById((int)$table->id,
$data['points_received']);
return $table->id;
}
return false;
}
public static function getProductKey($id, $attributes = array(),
$encode = 1)
{
$key = (int)$id . ':';
if (!empty($attributes)) {
// Sort attributes (because of right key generation)
ksort($attributes);
// Remove empty values, so items with empty values (add to cart
item view) is the same
// like item without any values (add to cart category view)
foreach ($attributes as $k => $v) {
// Transform all attribute values to array (when they get
string instead of array from html)
if (!is_array($v)) {
$attributes[$k] = array((int)$v => (int)$v);
}
// Unset when string is empty or zero
if ($v == 0 || $v == '') {
unset($attributes[$k]);
}
// Unset when we have transformed it to array but it is
empty
if (empty($v)) {
unset($attributes[$k]);
}
if (!empty($v) && is_array($v)) {
$attributeType =
PhocacartAttribute::getAttributeType((int)$k);
foreach ($v as $k2 => $v2) {
//$attributes[$k][$k2] = (int)$v2;
$optionType = 0;
// Ask for optionType but only by GIFT attribute
(20) ATTRIBUTETYPE
if ($attributeType == 20) {
$optionType =
PhocacartAttribute::getOptionType((int)$k2);
}
$attributes[$k][$k2] =
PhocaCartAttribute::setAttributeValue((int)$attributeType, $v2, false,
false, $optionType);
// TEXT or GIFT attributes
if ($attributes[$k][$k2] == '') {
unset($attributes[$k][$k2]);
}
}
if (empty($attributes[$k])) {
unset($attributes[$k]);// if all values removed
from attribute, remove the attribute completely
}
}
}
// Sort options (because of right key generation)
foreach ($attributes as $k3 => $v3) {
if (is_array($v3)) {
ksort($attributes[$k3]);
}
}
if (!empty($attributes)) {
if ($encode == 0) {
return serialize($attributes);
}
$key .= base64_encode(serialize($attributes));
}
}
$key .= ':';
return $key;
/*$key = 'ID:'.(int)$id .'{';
if (!empty($attributes)) {
ksort($attributes);
// Remove empty values, so items with empty values (add to cart
item view) is the same
// like item without any values (add to cart category view)
foreach($attributes as $k => $v) {
if ($v == 0 || $v == '') {
unset($attributes[$k]);
}
}
foreach($attributes as $k => $v) {
if (is_array($v)){
asort($attributes[$k]);
}
}
foreach($attributes as $k => $v) {
$key .= 'AID:'.(int)$k . '[';
if (is_array($v)){
foreach($v as $k2 => $v2) {
$key .= 'OID:('.(int)$v2 . ')';
}
} else {
$key .= 'OID:('.(int)$v.')';
}
$key .= ']';
}
if (!empty($attributes)) {
$k .= base64_encode(serialize($attributes));
}*/
/*}
$key .= '}';
return $key;*/
}
public static function getProductPrice($type = 1,
$onlyAvailableProducts = 0, $lang = '', $filterProducts =
array())
{
switch ($type) {
case 2:
$select = 'MIN(p.price)';
break;
case 1:
default:
$select = 'MAX(p.price)';
break;
}
$db = JFactory::getDBO();
$wheres = array();
$lefts = array();
$wheres[] = ' p.published = 1';
if ($lang != '' && $lang != '*') {
$wheres[] = " p.language = " . $db->quote($lang);
}
if ($onlyAvailableProducts == 1) {
$rules = PhocacartProduct::getOnlyAvailableProductRules();
$wheres = array_merge($wheres, $rules['wheres']);
$lefts = array_merge($lefts, $rules['lefts']);
}
$group = PhocacartUtilsSettings::isFullGroupBy() ? ' GROUP BY
p.published' : '';
if (!empty($filterProducts)) {
$productIds = implode(',', $filterProducts);
$wheres[] = 'p.id IN (' . $productIds .
')';
}
$q = ' SELECT ' . $select
. ' FROM #__phocacart_products AS p'
. (!empty($lefts) ? ' LEFT JOIN ' . implode('
LEFT JOIN ', $lefts) : '')
. (!empty($wheres) ? ' WHERE ' . implode(' AND
', $wheres) : '')
. $group
. ' ORDER BY p.id'
. ' LIMIT 1';
/* // Don't care about access rights to make the query faster
$q = 'SELECT '.$select
. ' FROM #__phocacart_products AS p'
. ' WHERE p.published = 1'
. ' ORDER BY p.id'
. ' LIMIT 1';*/
$db->setQuery($q);
$price = $db->loadResult();
return $price;
}
public static function getProductCodes($id)
{
$db = JFactory::getDBO();
$wheres = array();
$wheres[] = ' a.id = ' . (int)$id;
$query = ' SELECT a.sku, a.upc, a.ean, a.jan, a.isbn, a.mpn,
a.serial_number'
. ' FROM #__phocacart_products AS a'
. ' WHERE ' . implode(' AND ', $wheres)
. ' ORDER BY a.id'
. ' LIMIT 1';
$db->setQuery($query);
$productCodes = $db->loadAssoc();
return $productCodes;
}
public static function getOnlyAvailableProductRules()
{
$user = PhocacartUser::getUser();
$userLevels = implode(',',
$user->getAuthorisedViewLevels());
$userGroups = implode(',',
PhocacartGroup::getGroupsById($user->id, 1, 1));
$type = PhocacartUtilsSettings::getShopType();
$wheres = array();
$wheres[] = " p.access IN (" . $userLevels .
")";
$wheres[] = " c.access IN (" . $userLevels .
")";
$wheres[] = " (ga.group_id IN (" . $userGroups . ")
OR ga.group_id IS NULL)";
$wheres[] = " (gc.group_id IN (" . $userGroups . ")
OR gc.group_id IS NULL)";
$wheres[] = " p.published = 1";
$wheres[] = " c.published = 1";
if (!empty($type) && is_array($type)) {
$wheres[] = ' c.type IN (' . implode(',',
$type) . ')';
}
$lefts = array();
$lefts[] = ' #__phocacart_product_categories AS pc ON
pc.product_id = p.id';
$lefts[] = ' #__phocacart_categories AS c ON c.id =
pc.category_id';
$lefts[] = ' #__phocacart_item_groups AS ga ON p.id =
ga.item_id AND ga.type = 3';// type 3 is product
$lefts[] = ' #__phocacart_item_groups AS gc ON c.id =
gc.item_id AND gc.type = 2';// type 2 is category
$rules = array();
$rules['wheres'] = $wheres;
$rules['lefts'] = $lefts;
return $rules;
}
public static function getProductsByCategories($cidA, $limitOffset = 0,
$limitCount = 0, $orderingItem = 1) {
if (!empty($cidA)) {
$cidS = implode(',', $cidA);
$ordering =
PhocacartOrdering::getOrderingCombination($orderingItem);
$db = JFactory::getDBO();
$wheres = array();
$wheres[] = 'c.id IN ('.$cidS.')';
$where = (count($wheres) ? ' WHERE ' . implode('
AND ', $wheres) : '');
$q = ' SELECT a.*, c.id as category_id, c.title as
category_title, t.id as taxid, t.tax_rate as taxrate, t.calculation_type as
taxcalculationtype, t.title as taxtitle';
// No Images, Categories, Attributes, Specifications here
$q .= ', CONCAT_WS(":", t.id, t.alias) AS
tax';
$q .= ', CONCAT_WS(":", m.id, m.alias) AS
manufacturer';
$q .= ' FROM #__phocacart_products AS a'
. ' LEFT JOIN #__phocacart_product_categories AS pc ON
pc.product_id = a.id'
. ' LEFT JOIN #__phocacart_categories AS c ON c.id =
pc.category_id'
. ' LEFT JOIN #__phocacart_taxes AS t ON t.id =
a.tax_id'
. ' LEFT JOIN #__phocacart_manufacturers AS m ON m.id
= a.manufacturer_id'
. $where;
if ($ordering != '') {
$q .= ' ORDER BY c.ordering, ' . $ordering;
}
if ((int)$limitCount > 0) {
$q .= ' LIMIT ' . (int)$limitOffset . ',
' . (int)$limitCount;
}
$db->setQuery($q);
$products = $db->loadAssocList();
return $products;
}
}
public static function getProductCount()
{
$db = JFactory::getDBO();
$query = 'SELECT COUNT(*) FROM #__phocacart_products';
$db->setQuery($query);
$count = $db->loadResult();
return $count;
}
}
PK�"�[�#o,,%libraries/phocacart/region/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[=ec���%libraries/phocacart/region/region.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartRegion
{
public static function getRegionById($regionId) {
$db =JFactory::getDBO();
$query = 'SELECT title FROM #__phocacart_regions WHERE id =
'.(int) $regionId. ' ORDER BY title LIMIT 1';
$db->setQuery($query);
$region = $db->loadColumn();
if(isset($region[0])) {
return (string)$region[0];
}
return '';
}
public static function getRegionsByCountry($countryId) {
$db =JFactory::getDBO();
$query = 'SELECT a.id, a.title FROM #__phocacart_regions AS a'
.' WHERE a.country_Id = '.(int) $countryId
.' ORDER BY a.id';
$db->setQuery($query);
$regions = $db->loadObjectList();
return $regions;
}
public static function getRegions($id, $select = 0, $table =
'shipping') {
if ($table == 'shipping') {
$t = '#__phocacart_shipping_method_regions';
$c = 'shipping_id';
} else if ($table == 'payment') {
$t = '#__phocacart_payment_method_regions';
$c = 'payment_id';
} else if ($table == 'zone') {
$t = '#__phocacart_zone_regions';
$c = 'zone_id';
}
$db =JFactory::getDBO();
if ($select == 1) {
$query = 'SELECT r.region_id';
} else {
$query = 'SELECT a.*';
}
$query .= ' FROM #__phocacart_regions AS a'
.' LEFT JOIN '.$t.' AS r ON a.id = r.region_id'
.' WHERE r.'.$c.' = '.(int) $id;
$db->setQuery($query);
if ($select == 1) {
$items = $db->loadColumn();
} else {
$items = $db->loadObjectList();
}
return $items;
}
public static function storeRegions($regionsArray, $id, $table =
'shipping') {
if ($table == 'shipping') {
$t = '#__phocacart_shipping_method_regions';
$c = 'shipping_id';
} else if ($table == 'payment') {
$t = '#__phocacart_payment_method_regions';
$c = 'payment_id';
} else if ($table == 'zone') {
$t = '#__phocacart_zone_regions';
$c = 'zone_id';
}
if ((int)$id > 0) {
$db =JFactory::getDBO();
$query = ' DELETE '
.' FROM '.$t
. ' WHERE '.$c.' = '. (int)$id;
$db->setQuery($query);
$db->execute();
if (!empty($regionsArray)) {
$values = array();
$valuesString = '';
foreach($regionsArray as $k => $v) {
$values[] = ' ('.(int)$id.',
'.(int)$v[0].')';
}
if (!empty($values)) {
$valuesString = implode(',', $values);
$query = ' INSERT INTO '.$t.' ('.$c.',
region_id)'
.' VALUES '.(string)$valuesString;
$db->setQuery($query);
$db->execute();
}
}
}
}
public static function getAllRegionsSelectBox($name, $id, $activeArray,
$javascript = NULL, $order = 'id' ) {
$db =JFactory::getDBO();
/*$query = 'SELECT a.id AS value, a.title AS text'
.' FROM #__phocacart_countries AS a'
. ' ORDER BY '. $order;
$query = 'SELECT a.id AS value, a.title AS text, a.country_id as
countrid'
.' FROM #__phocacart_regions AS a'
. ' ORDER BY '. $order;*/
$query = 'SELECT a.id AS value, a.title AS text, a.country_id as
cid, c.title as countrytext'
.' FROM #__phocacart_regions AS a'
.' LEFT JOIN #__phocacart_countries AS c ON c.id =
a.country_id'
.' ORDER BY c.id, a.'. $order;
$db->setQuery($query);
$regions = $db->loadObjectList();
//$regionsO =
Joomla\CMS\HTML\HTMLHelper::_('select.genericlist', $regions,
$name, 'class="inputbox" size="4"
multiple="multiple"'. $javascript, 'value',
'text', $activeArray, $id);
// Try to do 1 SQL Query and 1 Foreach
$prev = 0;// the id of previous item
$usedFirst = 0;// first time opened the optgroup, so we can close it next
time when cid is differnt to prev
$open = 0;// if we reach the end of foreach, we discover if the tag is
open, if yet, close it.
$countRegions = count($regions);
$regionsO = '';
$regionsO .= '<select id="'.$id.'"
name="'.$name.'" class="inputbox"
size="4" multiple="multiple">';
$i = 0;
foreach($regions as $k => $v) {
$selected = '';
if (in_array((int)$v->value, $activeArray)) {
$selected = 'selected="selected"';
}
// Groups
if ((int)$v->cid > 0 && $v->cid != $prev) {
if ($usedFirst == 1) {
$regionsO .= '</optgroup>';
$open = 0;
}
$regionsO .= '<optgroup
label="'.$v->countrytext.'">';
$prev = (int)$v->cid;// we prepare previous version
$usedFirst = 1;// we have used the optgroup first time
$open = 1;
}
$regionsO .= '<option
value="'.(int)$v->value.'"
'.$selected.'>'.$v->text.'</option>';
$i++;
if ((int)$v->cid > 0 && $i == $countRegions &&
$open == 1) {
$regionsO .= '</optgroup>';
}
}
$regionsO .= '</select>';
return $regionsO;
}
/*
public static function displayRegions($shippingId, $popupLink = 0) {
$o = '';
$db = JFactory::getDBO();
$params = PhocacartUtils::getComponentParameters() ;
$query = 'SELECT a.id, a.title, a.link_ext, a.link_cat'
.' FROM #__phocacart_regions AS a'
.' LEFT JOIN #__phocacart_shipping_method_regions AS r ON
r.region_id = a.id'
.' WHERE r.shipping_id = '.(int)$shippingId;
$db->setQuery($query);
$imgObject = $db->loadObjectList();
if (!$db->query()) {
echo PhocacartUtilsException::renderErrorInfo($db->getErrorMsg());
return false;
}
/*
if ($popupLink == 1) {
$tl = 0;
} else {
$tl = $params->get( 'tags_links', 0 );
}*/
/*
$targetO = '';
if ($popupLink == 1) {
$targetO = 'target="_parent"';
}
$tl = $params->get( 'regions_links', 0 );
foreach ($imgObject as $k => $v) {
$o .= '<span>';
if ($tl == 0) {
$o .= $v->title;
} else if ($tl == 1) {
if ($v->link_ext != '') {
$o .= '<a href="'.$v->link_ext.'"
'.$targetO.'>'.$v->title.'</a>';
} else {
$o .= $v->title;
}
} else if ($tl == 2) {
if ($v->link_cat != '') {
$query = 'SELECT a.id, a.alias'
.' FROM #__phocacart_categories AS a'
.' WHERE a.id = '.(int)$v->link_cat;
$db->setQuery($query, 0, 1);
$category = $db->loadObject();
if (!$db->query()) {
echo PhocacartUtilsException::renderErrorInfo($db->getErrorMsg());
return false;
}
if (isset($category->id) && isset($category->alias)) {
$link = PhocacartRoute::getCategoryRoute($category->id,
$category->alias);
$o .= '<a href="'.$link.'"
'.$targetO.'>'.$v->title.'</a>';
} else {
$o .= $v->title;
}
} else {
$o .= $v->title;
}
} else if ($tl == 3) {
$link = PhocacartRoute::getCategoryRouteByTag($v->id);
$o .= '<a href="'.$link.'"
'.$targetO.'>'.$v->title.'</a>';
}
$o .= '</span> ';
}
return $o;
}*/
}
?>
PK�"�[�#o,,&libraries/phocacart/related/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[?ߘ7��'libraries/phocacart/related/related.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartRelated
{
public static function storeRelatedItemsById($relatedString, $productId) {
if ((int)$productId > 0) {
$db =JFactory::getDBO();
$query = ' DELETE '
.' FROM #__phocacart_product_related'
. ' WHERE product_a = '. (int)$productId;
$db->setQuery($query);
$db->execute();
if (isset($relatedString) && $relatedString != '') {
$relatedArray = explode(",", $relatedString);
$values = array();
$valuesString = '';
foreach($relatedArray as $k => $v) {
$values[] = ' ('.(int)$productId.',
'.(int)$v.')';
}
if (!empty($values)) {
$valuesString = implode(',', $values);
$query = ' INSERT INTO #__phocacart_product_related (product_a,
product_b)'
.' VALUES '.(string)$valuesString;
$db->setQuery($query);
$db->execute();
}
}
}
}
/*
* Try to find the best menu link so we search for category which we are
located
* if we find the category, we use this, if not we use another if
accessible, etc.
*/
public static function getRelatedItemsById($productId, $select = 0,
$frontend = 0)
{
$db = JFactory::getDBO();
$wheres = array();
$wheres[] = 't.product_a = ' . (int)$productId;
$catid = 0;
$params = PhocacartUtils::getComponentParameters();
// FRONTEND
$skip = array();
$skip['access'] =
$params->get('sql_product_skip_access', 0);
$skip['group'] =
$params->get('sql_product_skip_group', 0);
//$skip['attributes'] =
$params->get('sql_product_skip_attributes', 0);
$skip['category_type'] =
$params->get('sql_product_skip_category_type', 0);
//$skip['tax'] =
$params->get('sql_product_skip_tax', 0);
if ($frontend) {
$user = PhocacartUser::getUser();
$userLevels = implode(',',
$user->getAuthorisedViewLevels());
$userGroups = implode(',',
PhocacartGroup::getGroupsById($user->id, 1, 1));
if (!$skip['category_type']) {
$wheres[] = " c.type IN (0,1)";// Related are
displayed only in online shop (0 - all, 1 - online shop, 2 - pos)
}
if (!$skip['access']) {
$wheres[] = " c.access IN (" . $userLevels .
")";
$wheres[] = " a.access IN (" . $userLevels .
")";
}
if (!$skip['group']) {
$wheres[] = " (ga.group_id IN (" . $userGroups .
") OR ga.group_id IS NULL)";
$wheres[] = " (gc.group_id IN (" . $userGroups .
") OR gc.group_id IS NULL)";
}
$wheres[] = " c.published = 1";
$wheres[] = " a.published = 1";
$catid = PhocacartCategoryMultiple::getCurrentCategoryId();
}
if ($select == 1) {
$query = ' SELECT t.product_b';
} else if ($select == 2) {
$query = ' SELECT a.id, a.alias';
} else {
// FULL GROUP BY ISSUE
//$query = ' SELECT a.id as id, a.title as title, a.image
as image, a.alias as alias,'
// .' c.id as catid, c.alias as catalias, c.title as
cattitle';
$query = ' SELECT DISTINCT a.id as id, a.title as title,
a.image as image, a.alias as alias, a.description,
a.description_long,'
. ' SUBSTRING_INDEX(GROUP_CONCAT(c.id ORDER BY
c.parent_id), \',\', 1) as catid,'
. ' SUBSTRING_INDEX(GROUP_CONCAT(c.title ORDER BY
c.parent_id), \',\', 1) as cattitle,'
. ' SUBSTRING_INDEX(GROUP_CONCAT(c.alias ORDER BY
c.parent_id), \',\', 1) as catalias';
/*.' (SELECT c.id FROM jos_phocacart_product_categories AS
pc'
.' LEFT JOIN jos_phocacart_categories AS c ON c.id =
pc.category_id WHERE a.id = pc.product_id LIMIT 1) AS catid, '
.' (SELECT c.title FROM jos_phocacart_product_categories
AS pc'
.' LEFT JOIN jos_phocacart_categories AS c ON c.id =
pc.category_id WHERE a.id = pc.product_id LIMIT 1) AS cattitle, '
.' (SELECT c.alias FROM jos_phocacart_product_categories
AS pc'
.' LEFT JOIN jos_phocacart_categories AS c ON c.id =
pc.category_id WHERE a.id = pc.product_id LIMIT 1) AS catalias';*/
}
if ((int)$catid > 0) {
$query .= ', ';
$query .= ' GROUP_CONCAT(c2.id) AS catid2,
GROUP_CONCAT(c2.alias) AS catalias2, GROUP_CONCAT(c2.title) AS
cattitle2';
}
if (!$frontend) {
$query .= ', ';
$query .= ' GROUP_CONCAT(c.title SEPARATOR " ")
AS categories_title';
}
$query .= ' FROM #__phocacart_products AS a'
. ' LEFT JOIN #__phocacart_product_related AS t ON a.id =
t.product_b'
//.' LEFT JOIN #__phocacart_categories AS c ON a.catid =
c.id'
. ' LEFT JOIN #__phocacart_product_categories AS pc ON
pc.product_id = a.id'
. ' LEFT JOIN #__phocacart_categories AS c ON c.id =
pc.category_id';
if ((int)$catid > 0) {
$query .= ' LEFT JOIN #__phocacart_categories AS c2 ON
c2.id = pc.category_id and pc.category_id = ' . (int)$catid;
}
if ($frontend && !$skip['group']) {
$query .= ' LEFT JOIN #__phocacart_item_groups AS ga ON
a.id = ga.item_id AND ga.type = 3'// type 3 is product
. ' LEFT JOIN #__phocacart_item_groups AS gc ON
c.id = gc.item_id AND gc.type = 2';// type 2 is category
}
$query .= ' WHERE ' . implode( ' AND ', $wheres
);
if ($select == 1) {
$query .= ' GROUP BY a.id, t.product_b';
} else if ($select == 2) {
$query .= ' GROUP BY a.id, a.alias';
}else {
// FULL GROUP BY ISSUE
//$query .= ' GROUP BY a.id, a.title, a.image, a.alias, c.id,
c.alias, c.title';
$query .= ' GROUP BY a.id, a.title, a.alias, a.image,
a.description, a.description_long';
}
$db->setQuery($query);
if ($select == 1) {
$related = $db->loadColumn();
} else {
$related = $db->loadObjectList();
}
return $related;
}
public static function correctProductId($productIdChange) {
$db = JFactory::getDBO();
if (!empty($productIdChange)) {
foreach($productIdChange as $new => $old) {
if ($new == $old) {
continue;
}
$q = 'UPDATE #__phocacart_product_related SET product_b =
'.(int)$new.' WHERE product_b = '.(int)$old;
$db->setQuery($q);
$db->execute();
}
}
return true;
}
}
PK�"�[�M*���$libraries/phocacart/render/admin.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartRenderAdmin
{
/*public static function quickIconButton( $link, $image, $text, $imgUrl )
{
return '<div class="thumbnails ph-icon"
style="text-align: center">'
.'<a class="thumbnail ph-icon-inside"
style="text-align: center"
href="'.$link.'">'
.Joomla\CMS\HTML\HTMLHelper::_('image', $imgUrl . $image, $text
)
.'<br />'.$text.'</a></div>'.
"\n";
}
*/
public static function quickIconButton( $link, $text = '', $icon
= '', $color = '') {
$s = PhocacartRenderStyle::getStyles();
$o = '';
$o .= '<div class="thumbnails ph-icon">';
/*$o .= ' <div class="ph-icon-inside-box"><a
class="thumbnail ph-icon-inside"
href="'.$link.'"><span style="color:
'.$color.';opacity: 0.6;" class="glyphicon
glyphicon-'.$icon.'
ph-icon-cp-large"></span></a></div>';
$o .= ' <div class="ph-text-inside-box"><a
class="ph-text-inside"
href="'.$link.'"><span
class="ph-icon-cp-title">'.$text.'</span></a></div>';
*/
$o .= ' <div class="ph-icon-inside-box"><a
class=" icon thumbnail ph-icon-inside"
href="'.$link.'" style="background-color:
'.$color.'20;"><i style="color:
'.$color.';" class="'.$icon.'
ph-icon-cp-large"></i></a></div>';
$o .= ' <div class="ph-text-inside-box"><a
class="ph-text-inside"
href="'.$link.'"><span
class="ph-icon-cp-title">'.$text.'</span></a></div>';
$o .= '</div>';
return $o;
}
public static function getLinks() {
$app = JFactory::getApplication();
$option = $app->input->get('option');
$oT = strtoupper($option);
$links = array();
switch ($option) {
case 'com_phocacart':
$links[] = array('Phoca Cart site',
'https://www.phoca.cz/phocacart');
$links[] = array('Phoca Cart documentation site',
'https://www.phoca.cz/documentation/category/116-phoca-cart-component');
$links[] = array('Phoca Cart download site',
'https://www.phoca.cz/download/category/100-phoca-cart-component');
$links[] = array('Phoca Cart extensions',
'https://www.phoca.cz/phocacart-extensions');
break;
}
$links[] = array('Phoca News',
'https://www.phoca.cz/news');
$links[] = array('Phoca Forum',
'https://www.phoca.cz/forum');
$components = array();
$components[] = array('Phoca Gallery','phocagallery',
'pg');
$components[] = array('Phoca
Guestbook','phocaguestbook', 'pgb');
$components[] = array('Phoca
Download','phocadownload', 'pd');
$components[] = array('Phoca
Documentation','phocadocumentation', 'pdc');
$components[] = array('Phoca Favicon','phocafavicon',
'pfv');
$components[] = array('Phoca SEF','phocasef',
'psef');
$components[] = array('Phoca PDF','phocapdf',
'ppdf');
$components[] = array('Phoca Restaurant
Menu','phocamenu', 'prm');
$components[] = array('Phoca Maps','phocamaps',
'pm');
$components[] = array('Phoca Font','phocafont',
'pf');
$components[] = array('Phoca Email','phocaemail',
'pe');
$components[] = array('Phoca Install','phocainstall',
'pi');
$components[] = array('Phoca
Template','phocatemplate', 'pt');
$components[] = array('Phoca
Panorama','phocapanorama', 'pp');
$components[] = array('Phoca
Commander','phocacommander', 'pcm');
$components[] = array('Phoca Photo','phocaphoto',
'ph');
$components[] = array('Phoca Cart','phocacart',
'pc');
$banners = array();
$banners[] = array('Phoca Restaurant
Menu','phocamenu', 'prm');
$banners[] = array('Phoca Cart','phocacart',
'pc');
$o = '';
$o .= '<p> </p>';
$o .= '<h4
style="margin-bottom:5px;">'.JText::_($oT.'_USEFUL_LINKS').
'</h4>';
$o .= '<ul>';
foreach ($links as $k => $v) {
$o .= '<li><a style="text-decoration:underline"
href="'.$v[1].'"
target="_blank">'.$v[0].'</a></li>';
}
$o .= '</ul>';
$o .= '<div>';
$o .= '<p> </p>';
$o .= '<h4
style="margin-bottom:5px;">'.JText::_($oT.'_USEFUL_TIPS').
'</h4>';
$m = mt_rand(0, 10);
if ((int)$m > 0) {
$o .= '<div>';
$num = range(0,(count($components) - 1 ));
shuffle($num);
for ($i = 0; $i<3; $i++) {
$numO = $num[$i];
$o .= '<div style="float:left;width:33%;margin:0
auto;">';
$o .= '<div><a
style="text-decoration:underline;"
href="https://www.phoca.cz/'.$components[$numO][1].'"
target="_blank">'.Joomla\CMS\HTML\HTMLHelper::_('image',
'media/'.$option.'/images/administrator/icon-box-'.$components[$numO][2].'.png',
''). '</a></div>';
$o .= '<div
style="margin-top:-10px;"><small><a
style="text-decoration:underline;"
href="https://www.phoca.cz/'.$components[$numO][1].'"
target="_blank">'.$components[$numO][0].'</a></small></div>';
$o .= '</div>';
}
$o .= '<div style="clear:both"></div>';
$o .= '</div>';
} else {
$num = range(0,(count($banners) - 1 ));
shuffle($num);
$numO = $num[0];
$o .= '<div><a
href="https://www.phoca.cz/'.$banners[$numO][1].'"
target="_blank">'.Joomla\CMS\HTML\HTMLHelper::_('image',
'media/'.$option.'/images/administrator/b-'.$banners[$numO][2].'.png',
''). '</a></div>';
}
$o .= '<p> </p>';
//$o .= '<h4
style="margin-bottom:5px;">'.JText::_($oT.'_PLEASE_READ').
'</h4>';
//$o .= '<div><a
style="text-decoration:underline"
href="https://www.phoca.cz/phoca-needs-your-help/"
target="_blank">'.JText::_($oT.'_PHOCA_NEEDS_YOUR_HELP').
'</a></div>';
$o .= '</div>';
return $o;
}
}
PK�"�[.I)��w�w+libraries/phocacart/render/admincolumns.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
class PhocacartRenderAdmincolumns
{
public $view = '';
public $option = '';
public $tmpl = '';
public $r = false;
public $compatible = false;
/*
* The Flow
*
* view.html.php
* -> get all columns set by options
*
* HEADER (default.php) RENDER COLUMN HEADER
*
* -> renderHeader() -> all columns iterate in foreach
* -> header() -> column will be transformed to function
* -> e.g. skuHeader() -> all column data will be defined here,
possible change for each view
* -> renderHeaderColumn() -> rendering of column HTML header
*
* BODY (default.php) RENDER COLUMN BODY
*
* -> foreach -> all columns iterate in default.php
* -> item -> column will be transformed to function
* -> e.g. sku -> commonColumn -> sku function calls
commonColumn (e.g. title renders HTML immediately) - possible change for
each view
* -> commonColumn() -> rendering of column HTML body
*
* SORTFIELDS (view.html.php) RENDER SORT FIELDS
*
* -> renderSortFields() -> all columns iterate in foreach
* -> header() -> column will be transformed to function
* -> e.g. skuHeader -> all column data will be defined here,
possible change for each view - RETURNS DATA!!!, does not render column
header
*/
public function __construct() {
$app = JFactory::getApplication();
$version = new \Joomla\CMS\Version();
$this->compatible =
$version->isCompatible('4.0.0-alpha');
$this->view = $app->input->get('view');
$this->option = $app->input->get('option');
$this->tmpl = $app->input->get('tmpl');
$this->r = new PhocacartRenderAdminviews();
}
public function renderHeader($items, &$options) {
$o = array();
if (!empty($items)) {
foreach ($items as $k => $v) {
$v = PhocacartText::parseDbColumnParameter($v);
$o[] = $this->header($v, $options);
}
}
return implode("\n", $o);
}
public function getSortFields($items, &$options) {
$o = array();
if (!empty($items)) {
foreach ($items as $k => $v) {
$v = PhocacartText::parseDbColumnParameter($v);
$data = $this->header($v, $options);
if (isset($data['column']) &&
$data['column'] != '') {
$id = $data['column'];
$o[$id] = Text::_($data['title']);
}
}
}
return $o;
}
public function renderHeaderColumn($data, &$options) {
if ($options['type'] == 'data') {
return $data;
}
$options['count']++;
$o = array();
if (isset($data['tool']) &&
$data['tool'] != '' &&
isset($data['column']) && $data['column'] !=
'') {
$o[] = '<th class="' .
$data['class'] . '">' .
HTMLHelper::_($data['tool'], $data['title'],
$data['column'], $options['listdirn'],
$options['listorder']) . '</th>';
} else {
$o[] = '<th class="' .
$data['class'] . '">' .
Text::_($data['title']) . '</th>';
}
return implode("\n", $o);
}
public function header($function, &$options) {
if ($function == '') {
return false;
}
$function = strtolower($function) . 'Header';
if (!is_callable(array($this, $function))) {
throw new \InvalidArgumentException('Function ' .
$function . ' not supported', 500);
}
return call_user_func_array(array($this, $function),
array(&$options));
}
public function item($function, $item, &$options) {
if ($function == '') {
return false;
}
$function = strtolower($function) . '';
if (!is_callable(array($this, $function))) {
throw new \InvalidArgumentException('Function ' .
$function . ' not supported', 500);
}
return call_user_func_array(array($this, $function), array($item,
&$options));
}
/* COLUMN HEADER */
public function skuHeader(&$options) {
$data = array('class' => 'ph-sku',
'title' => 'COM_PHOCACART_FIELD_SKU_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.sku');
return $this->renderHeaderColumn($data, $options);
}
public function titleHeader(&$options) {
$data = array('class' => 'ph-title',
'title' => 'COM_PHOCACART_FIELD_TITLE_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.title');
return $this->renderHeaderColumn($data, $options);
}
public function imageHeader(&$options) {
$data = array('class' => 'ph-image',
'title' => 'COM_PHOCACART_FIELD_IMAGE_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.image');
return $this->renderHeaderColumn($data, $options);
}
public function publishedHeader(&$options) {
$data = array('class' => 'ph-published',
'title' => 'COM_PHOCACART_FIELD_PUBLISHED_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.published');
return $this->renderHeaderColumn($data, $options);
}
public function categoryHeader(&$options) {
$data = array('class' =>
'ph-parentcattitle', 'title' =>
'COM_PHOCACART_FIELD_CATEGORY_LABEL');
return $this->renderHeaderColumn($data, $options);
}
public function categoriesHeader(&$options) {
$data = array('class' =>
'ph-parentcattitle', 'title' =>
'COM_PHOCACART_FIELD_CATEGORY_LABEL');
return $this->renderHeaderColumn($data, $options);
}
public function priceHeader(&$options) {
$data = array('class' => 'ph-price',
'title' => 'COM_PHOCACART_FIELD_PRICE_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.price');
return $this->renderHeaderColumn($data, $options);
}
public function price_originalHeader(&$options) {
$data = array('class' =>
'ph-price_original', 'title' =>
'COM_PHOCACART_FIELD_ORIGINAL_PRICE_LABEL', 'tool'
=> 'searchtools.sort', 'column' =>
'a.price_original');
return $this->renderHeaderColumn($data, $options);
}
public function stockHeader(&$options) {
$data = array('class' => 'ph-stock',
'title' => 'COM_PHOCACART_FIELD_IN_STOCK_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.stock');
return $this->renderHeaderColumn($data, $options);
}
public function access_levelHeader(&$options) {
$data = array('class' => 'ph-access',
'title' => 'JFIELD_ACCESS_LABEL');
return $this->renderHeaderColumn($data, $options);
}
public function associationHeader(&$options) {
$data = array('class' => 'ph-association',
'title' =>
'COM_PHOCACART_FIELD_ASSOCIATION_LABEL'/*, 'tool' =>
'searchtools.sort', 'column' =>
'association'*/);
if (isset($options['association']) &&
$options['association']) {
return $this->renderHeaderColumn($data, $options);
}
}
public function languageHeader(&$options) {
$data = array('class' => 'ph-language',
'title' => 'JGRID_HEADING_LANGUAGE',
'tool' => 'searchtools.sort', 'column'
=> 'a.language');
return $this->renderHeaderColumn($data, $options);
}
public function hitsHeader(&$options) {
$data = array('class' => 'ph-hits',
'title' => 'COM_PHOCACART_FIELD_HITS_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.hits');
return $this->renderHeaderColumn($data, $options);
}
public function descriptionHeader(&$options) {
$data = array('class' => 'ph-description',
'title' => 'COM_PHOCACART_FIELD_DESCRIPTION_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.description');
return $this->renderHeaderColumn($data, $options);
}
public function phoca_actionHeader(&$options) {
$data = array('class' => 'ph-edit',
'title' => 'COM_PHOCACART_ACTION_LABEL');
return $this->renderHeaderColumn($data, $options);
}
public function idHeader(&$options) {
$data = array('class' => 'ph-id',
'title' => 'JGLOBAL_FIELD_ID_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.id');
return $this->renderHeaderColumn($data, $options);
}
public function upcHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' => 'COM_PHOCACART_FIELD_UPC_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.upc');
return $this->renderHeaderColumn($data, $options);
}
public function eanHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' => 'COM_PHOCACART_FIELD_EAN_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.ean');
return $this->renderHeaderColumn($data, $options);
}
public function janHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' => 'COM_PHOCACART_FIELD_JAN_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.jan');
return $this->renderHeaderColumn($data, $options);
}
public function isbnHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' => 'COM_PHOCACART_FIELD_ISBN_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.isbn');
return $this->renderHeaderColumn($data, $options);
}
public function mpnHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' => 'COM_PHOCACART_FIELD_MPN_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.mpn');
return $this->renderHeaderColumn($data, $options);
}
public function serial_numberHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' =>
'COM_PHOCACART_FIELD_SERIAL_NUMBER_LABEL', 'tool' =>
'searchtools.sort', 'column' =>
'a.serial_number');
return $this->renderHeaderColumn($data, $options);
}
public function registration_keyHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' =>
'COM_PHOCACART_FIELD_REGISTRATION_KEY_LABEL', 'tool'
=> 'searchtools.sort', 'column' =>
'a.registration_key');
return $this->renderHeaderColumn($data, $options);
}
public function external_idHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' =>
'COM_PHOCACART_FIELD_EXTERNAL_PRODUCT_ID_LABEL', 'tool'
=> 'searchtools.sort', 'column' =>
'a.external_id');
return $this->renderHeaderColumn($data, $options);
}
public function external_keyHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' =>
'COM_PHOCACART_FIELD_EXTERNAL_PRODUCT_KEY_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.external_key');
return $this->renderHeaderColumn($data, $options);
}
public function external_linkHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' =>
'COM_PHOCACART_FIELD_EXTERNAL_LINK_LABEL', 'tool' =>
'searchtools.sort', 'column' =>
'a.external_link');
return $this->renderHeaderColumn($data, $options);
}
public function external_textHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' =>
'COM_PHOCACART_FIELD_EXTERNAL_TEXT_LABEL', 'tool' =>
'searchtools.sort', 'column' =>
'a.external_text');
return $this->renderHeaderColumn($data, $options);
}
public function external_link2Header(&$options) {
$data = array('class' => 'ph-upc',
'title' =>
'COM_PHOCACART_FIELD_EXTERNAL_LINK_2_LABEL', 'tool'
=> 'searchtools.sort', 'column' =>
'a.external_link2');
return $this->renderHeaderColumn($data, $options);
}
public function external_text2Header(&$options) {
$data = array('class' => 'ph-upc',
'title' =>
'COM_PHOCACART_FIELD_EXTERNAL_TEXT_2_LABEL', 'tool'
=> 'searchtools.sort', 'column' =>
'a.external_text2');
return $this->renderHeaderColumn($data, $options);
}
public function min_quantityHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' =>
'COM_PHOCACART_FIELD_MIN_ORDER_QUANTITY_LABEL', 'tool'
=> 'searchtools.sort', 'column' =>
'a.min_quantity');
return $this->renderHeaderColumn($data, $options);
}
public function min_multiple_quantityHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' =>
'COM_PHOCACART_FIELD_MIN_MULTIPLE_ORDER_QUANTITY_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.min_multiple_quantity');
return $this->renderHeaderColumn($data, $options);
}
public function unit_amountHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' => 'COM_PHOCACART_FIELD_UNIT_AMOUNT_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.unit_amount');
return $this->renderHeaderColumn($data, $options);
}
public function unit_unitHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' => 'COM_PHOCACART_FIELD_UNIT_UNIT_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.unit_unit');
return $this->renderHeaderColumn($data, $options);
}
public function lengthHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' => 'COM_PHOCACART_FIELD_LENGTH_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.length');
return $this->renderHeaderColumn($data, $options);
}
public function widthHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' => 'COM_PHOCACART_FIELD_WIDTH_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.width');
return $this->renderHeaderColumn($data, $options);
}
public function heightHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' => 'COM_PHOCACART_FIELD_HEIGHT_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.height');
return $this->renderHeaderColumn($data, $options);
}
public function weightHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' => 'COM_PHOCACART_FIELD_WEIGHT_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.weight');
return $this->renderHeaderColumn($data, $options);
}
public function volumeHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' => 'COM_PHOCACART_FIELD_VOLUME_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.volume');
return $this->renderHeaderColumn($data, $options);
}
public function points_neededHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' =>
'COM_PHOCACART_FIELD_POINTS_NEEDED_LABEL', 'tool' =>
'searchtools.sort', 'column' =>
'a.points_needed');
return $this->renderHeaderColumn($data, $options);
}
public function points_receivedHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' =>
'COM_PHOCACART_FIELD_POINTS_RECEIVED_LABEL', 'tool'
=> 'searchtools.sort', 'column' =>
'a.points_received');
return $this->renderHeaderColumn($data, $options);
}
public function metatitleHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' => 'COM_PHOCACART_FIELD_META_TITLE_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.metatitle');
return $this->renderHeaderColumn($data, $options);
}
public function description_longHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' =>
'COM_PHOCACART_FIELD_DESCRIPTION_LONG_LABEL', 'tool'
=> 'searchtools.sort', 'column' =>
'a.description_long');
return $this->renderHeaderColumn($data, $options);
}
public function featuresHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' => 'COM_PHOCACART_FIELD_FEATURES_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.features');
return $this->renderHeaderColumn($data, $options);
}
public function videoHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' => 'COM_PHOCACART_FIELD_VIDEO_URL_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.video');
return $this->renderHeaderColumn($data, $options);
}
public function type_feedHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' =>
'COM_PHOCACART_FIELD_PRODUCT_TYPE_FEED_LABEL', 'tool'
=> 'searchtools.sort', 'column' =>
'a.type_feed');
return $this->renderHeaderColumn($data, $options);
}
public function type_category_feedHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' =>
'COM_PHOCACART_FIELD_PRODUCT_CATEGORY_TYPE_FEED_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.type_category_feed');
return $this->renderHeaderColumn($data, $options);
}
public function metakeyHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' => 'JFIELD_META_KEYWORDS_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.metakey');
return $this->renderHeaderColumn($data, $options);
}
public function metadescHeader(&$options) {
$data = array('class' => 'ph-upc',
'title' => 'JFIELD_META_DESCRIPTION_LABEL',
'tool' => 'searchtools.sort', 'column'
=> 'a.metadesc');
return $this->renderHeaderColumn($data, $options);
}
/* COLUMN BODY */
public function commonColumn($item, $options) {
if ($item['params']['edit'] &&
($item['cancreate'] || $item['canedit'])) {
return $this->r->td('<span
class="ph-editinplace-text ph-eip-' .
$item['editclass'] . ' ph-eip-' .
$item['name'] . '" id="' .
$item['idtoken'] . '">' .
PhocacartText::filterValue($item['value'],
$item['editfilter']) . '</span>',
'small');
} else {
return $this->r->td('<span class="ph-'
. $item['name'] . '">' .
PhocacartText::filterValue($item['value'],
$item['editfilter']) . '</span>',
'small');
}
}
public function sku($item, &$options) { return
$this->commonColumn($item, $options); }
public function upc($item, &$options) { return
$this->commonColumn($item, $options); }
public function ean($item, &$options) { return
$this->commonColumn($item, $options); }
public function jan($item, &$options) { return
$this->commonColumn($item, $options); }
public function isbn($item, &$options) { return
$this->commonColumn($item, $options); }
public function mpn($item, &$options) { return
$this->commonColumn($item, $options); }
public function serial_number($item, &$options) { return
$this->commonColumn($item, $options); }
public function registration_key($item, &$options) { return
$this->commonColumn($item, $options); }
public function external_id($item, &$options) { return
$this->commonColumn($item, $options); }
public function external_key($item, &$options) { return
$this->commonColumn($item, $options); }
public function external_link($item, &$options) { return
$this->commonColumn($item, $options); }
public function external_text($item, &$options) { return
$this->commonColumn($item, $options); }
public function external_link2($item, &$options) { return
$this->commonColumn($item, $options); }
public function external_text2($item, &$options) { return
$this->commonColumn($item, $options); }
public function min_quantity($item, &$options) { return
$this->commonColumn($item, $options); }
public function min_multiple_quantity($item, &$options) { return
$this->commonColumn($item, $options); }
public function unit_amount($item, &$options) { return
$this->commonColumn($item, $options); }
public function unit_unit($item, &$options) { return
$this->commonColumn($item, $options); }
public function length($item, &$options) { $item['value']
= PhocacartPrice::cleanPrice($item['value']); return
$this->commonColumn($item, $options); }
public function width($item, &$options) { $item['value']
= PhocacartPrice::cleanPrice($item['value']); return
$this->commonColumn($item, $options); }
public function height($item, &$options) { $item['value']
= PhocacartPrice::cleanPrice($item['value']); return
$this->commonColumn($item, $options); }
public function weight($item, &$options) { $item['value']
= PhocacartPrice::cleanPrice($item['value']); return
$this->commonColumn($item, $options); }
public function volume($item, &$options) { $item['value']
= PhocacartPrice::cleanPrice($item['value']); return
$this->commonColumn($item, $options); }
public function points_needed($item, &$options) { return
$this->commonColumn($item, $options); }
public function points_received($item, &$options) { return
$this->commonColumn($item, $options); }
public function metatitle($item, &$options) { return
$this->commonColumn($item, $options); }
public function description_long($item, &$options) {
// textarea in description instead of text like e.g. by title, sku,
price
$item['editclass'] = 'autogrow';
$item['editfilter'] = 'html';
return $this->commonColumn($item, $options);
}
public function features($item, &$options) {
// textarea in features instead of text like e.g. by title, sku,
price
$item['editclass'] = 'autogrow';
$item['editfilter'] = 'html';
return $this->commonColumn($item, $options);
}
public function video($item, &$options) {
// textarea in features instead of text like e.g. by title, sku,
price
$item['editclass'] = 'autogrow';
$item['editfilter'] = 'html';
return $this->commonColumn($item, $options);
}
public function type_feed($item, &$options) {
// textarea in features instead of text like e.g. by title, sku,
price
$item['editclass'] = 'autogrow';
$item['editfilter'] = 'html';
return $this->commonColumn($item, $options);
}
public function type_category_feed($item, &$options) {
// textarea in features instead of text like e.g. by title, sku,
price
$item['editclass'] = 'autogrow';
$item['editfilter'] = 'html';
return $this->commonColumn($item, $options);
}
public function metakey($item, &$options) {
// textarea in features instead of text like e.g. by title, sku,
price
$item['editclass'] = 'autogrow';
$item['editfilter'] = 'html';
return $this->commonColumn($item, $options);
}
public function metadesc($item, &$options) {
// textarea in features instead of text like e.g. by title, sku,
price
$item['editclass'] = 'autogrow';
$item['editfilter'] = 'html';
return $this->commonColumn($item, $options);
}
public function price($item, &$options) {
$item['value'] =
PhocacartPrice::cleanPrice($item['value']);
return $this->commonColumn($item, $options);
}
public function price_original($item, &$options) {
$item['value'] =
PhocacartPrice::cleanPrice($item['value']);
return $this->commonColumn($item, $options);
}
public function stock($item, &$options) {
$item['value'] =
PhocacartPrice::cleanPrice($item['value']);
return $this->commonColumn($item, $options);
}
public function access_level($item, &$options) {
$item['params']['edit'] = false;
return $this->commonColumn($item, $options);
}
public function hits($item, &$options) {
return $this->commonColumn($item, $options);
}
public function id($item, &$options) {
//$item['params']['edit'] = false;
return $this->commonColumn($item, $options);
}
public function description($item, &$options) {
// textarea in description instead of text like e.g. by title, sku,
price
$item['editclass'] = 'autogrow';
$item['editfilter'] = 'html';
return $this->commonColumn($item, $options);
}
public function image($item, &$options) {
$thumbnail =
PhocacartFileThumbnail::getThumbnailName(PhocacartText::filterValue($item['value'],
'text'), 'small', 'productimage');
$img = '';
if (JFile::exists($thumbnail->abs)) {
$img = '<img src="' . JURI::root() .
$thumbnail->rel . '?imagesid=' . md5(uniqid(time())) .
'" />';
}
//if ($item['params']['edit'] == 2) {
// $o[] = '<span class="ph-editinplace-text
ph-eip-' . $item['editclass'] . ' ph-eip-' .
$item['name'] . '"
id="'.$item['idtoken'].'">' .
PhocacartText::filterValue($item['value'], 'text') .
'</span>';
// } else {
return $this->r->td('<span class="ph-' .
$item['name'] . '">' . $img .
'</span>', 'small ph-items-image-box');
// }
}
/*
* $item['params']['edit'] ... defined by user in
Phoca Cart options: to display title: "title", to display
editable title: "title=E"
* $item['canedit'] ... defined by Joomla! permissions
system
*/
public function title($item, &$options) {
$paramsC = PhocacartUtils::getComponentParameters();
$admin_eip_title = $paramsC->get('admin_eip_title',
4);
$o = array();
if ($item['checked_out']) {
$o[] = HTMLHelper::_('jgrid.checkedout',
$item['i'], $item['editor'],
$item['checked_out_time'], $options['tasks'] .
'.', $item['cancheckin']);
}
if ($item['params']['edit'] &&
($item['cancreate'] || $item['canedit'])) {
$o[] = '<span class="ph-editinplace-text
ph-eip-' . $item['editclass'] . ' ph-eip-' .
$item['name'] . ' phIdTitle' .
(int)$item['id'] . '" id="' .
$item['idtoken'] . '">' .
PhocacartText::filterValue($item['value'], 'text') .
'</span>';
if ($admin_eip_title == 3 || $admin_eip_title == 4) {
$o[] = '<span class="ph-editinplace-text
ph-eip-' . $item['editclass'] . ' ph-eip-' .
$item['namealias'] . '" id="' .
$item['idtokencombined'] . '">' .
PhocacartText::filterValue($item['valuealias'], 'text')
. '</span>';
}
} else if (!$item['params']['edit'] &&
($item['cancreate'] || $item['canedit'])) {
if (isset($item['linkeditbox']) &&
$item['linkeditbox'] != '') {
$o[] = $item['linkeditbox'];
} else {
$o[] = '<a href="' .
JRoute::_($item['linkedit']) . '"><span
id="phIdTitle' . (int)$item['id'] . '"
class="ph-' . $item['name'] . ' phIdTitle' .
(int)$item['id'] . '">' .
PhocacartText::filterValue($item['value'], 'text') .
'</span></a>';
}
$o[] = '<br /><span
class="smallsub">(<span>' .
Text::_('COM_PHOCACART_FIELD_ALIAS_LABEL') .
':</span>' .
PhocacartText::filterValue($item['valuealias'], 'text')
. ')</span>';
} else {
// Class phIdTitle needed for displaying Copy Attributes
Titles
$o[] = '<span id="phIdTitle' .
(int)$item['id'] . '" class="ph-' .
$item['name'] . ' phIdTitle' .
(int)$item['id'] . '">' .
PhocacartText::filterValue($item['value'], 'text') .
'</span>';
$o[] = '<br /><span
class="smallsub">(<span>' .
Text::_('COM_PHOCACART_FIELD_FIELD_ALIAS_LABEL') .
':</span>' .
PhocacartText::filterValue($item['valuealias'], 'text')
. ')</span>';
}
return $this->r->td(implode("\n", $o),
'small');
}
public function published($item, &$options) {
return $this->r->td('<div
class="btn-group">' .
HTMLHelper::_('jgrid.published', $item['value'],
$item['i'], $options['tasks'] . '.',
$item['canchange']) .
PhocacartHtmlFeatured::featured($item['valuefeatured'],
$item['i'], $item['canchange']) .
'</div>', "small");
}
public function categories($item, &$options) {
$o = array();
$id = $item['id'];
if (isset($item['value'][$id])) {
foreach ($item['value'][$id] as $k => $v) {
if ($item['caneditcategory'] &&
isset($item['linkeditcategory']) &&
$item['linkeditcategory'] != '') {
$linkCat =
JRoute::_($item['linkeditcategory'] . '&id=' .
(int)$v['id']);
$o[] = '<a href="' .
JRoute::_($linkCat) . '">' .
PhocacartText::filterValue($v['title'], 'text') .
'</a>';
} else {
$o[] =
PhocacartText::filterValue($v['title'], 'text');
}
}
}
return $this->r->td(implode("\n", $o),
'small');
}
public function association($item, &$options) {
if (!isset($options['association']) ||
(isset($options['association']) &&
!$options['association'])) {
return '';
} else if ($item['value']) {
return
$this->r->td(HTMLHelper::_('phocacartitem.association',
$item['id']));
} else {
return $this->r->td('');
}
}
public function language($item, &$options) {
return
$this->r->td(LayoutHelper::render('joomla.content.language',
$item['value']));
}
public function phoca_action($item, &$options) {
if ($item['cancreate'] || $item['canedit']) {
if (isset($item['linkeditbox']) &&
$item['linkeditbox'] != '') {
return $this->r->td($item['linkeditbox'],
'small');
} else {
return $this->r->td('<a href="' .
JRoute::_($item['linkedit']) . '"><span
id="phIdTitle' . $item['id'] . '"
class="ph-icon-task ph-cp-item"><i class="duotone
icon-apply"></i></span></a>',
'small');
}
}
}
}
/* Supported columns - Products
sku
image
title
published
categories
price
price_original
stock
access_level
language
association
hits
id
upc
ean
jan
isbn
mpn
serial_number
registration_key
external_id
external_key
external_link
external_text
external_link2
external_text2
min_quantity
min_multiple_quantity
unit_amount
unit_unit
length
width
height
weight
volume
points_needed
points_received
metatitle
description
description_long
features
video
type_feed
type_category_feed
metakey
metadesc
phoca_action
*/
?>
PK�"�[��^PP&libraries/phocacart/render/adminjs.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined('_JEXEC') or die();
final class PhocacartRenderAdminjs
{
private function __construct(){}
/* For example creating thumbnail message - administration */
public static function renderAjaxTopHtml($text = '') {
$o = '<div id="ph-ajaxtop">';
if ($text != '') {
$o .= '<div id="ph-ajaxtop-message"><div
class="ph-loader-top"></div> '.
strip_tags(addslashes($text)) . '</div>';
}
$o .= '</div>';
return $o;
}
// =======
// AJAX
// =======
/*public static function phEventCreateImageThumbnail($url, $msg, $manager
= 'product', $value = 'imageCreateThumbs') {
$path = PhocacartPath::getPath($manager);
$pathImage = Juri::root() . $path['orig_rel_ds'];
$s = array();
$s[] = ' ';
$s[] = '/* Event Create Thumbnails *//* ';
$s[] = 'jQuery(document).ready(function() {';
$s[] = ' jQuery(document).on("change",
\'.'.$value.'\', function() {';
$s[] = ' var data = {};';
$s[] = ' data[\'filename\'] =
encodeURIComponent(jQuery(this).val());';
$s[] = ' data[\'manager\'] =
\''.$manager.'\';';
// Change Preview Image
$s[] = ' var image = "";';
$s[] = ' if (jQuery(this).val().trim() != "")
{';
$s[] = ' var image =
\''.strip_tags(addslashes($pathImage)).'\' +
jQuery(this).val();';
$s[] = ' }';
$s[] = ' var id = jQuery(this).attr(\'id\');';
$s[] = ' phChangePreviewImage(id, image);';
$s[] = ' phDoRequest(\''.$url.'\', data,
\''.strip_tags(addslashes($msg)).'\');';
$s[] = ' })';
$s[] = '})';
$s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}
/**
* Add value from popup window (file manager mostly) to the list of items
- e.g. select image - then thumbnails will be recreated
*/
/*
public static function phAddValueImage($url, $msg, $manager =
'productimage') {
$path = PhocacartPath::getPath($manager);
$pathImage = Juri::root() . $path['orig_rel_ds'];
$s = array();
$s[] = ' ';
$s[] = '/* Function phAddValueImage *//* ';
$s[] = 'function phAddValueImage(id, title, request) {';
$s[] = ' document.getElementById(id).value = title;';
//$s[] = ' SqueezeBox.close();';// close
$s[] = '
jQuery(\'.modal\').modal(\'hide\');';
$s[] = ' if (request == 1) {'; // do request - do thumbnails
$s[] = ' var data = {};';
$s[] = ' data[\'filename\'] =
encodeURIComponent(title);';
$s[] = ' data[\'manager\'] =
\''.$manager.'\';';
// Change Preview Image
$s[] = ' var image = "";';
$s[] = ' if (title.trim() != "") {';
$s[] = ' image =
\''.strip_tags(addslashes($pathImage)).'\' +
title;';
$s[] = ' }';
$s[] = ' phChangePreviewImage(id, image);';
$s[] = ' phDoRequest(\''.$url.'\', data,
\''.strip_tags(addslashes($msg)).'\' );';
$s[] = ' }';
$s[] = '}';
$s[] = ' ';
//jQuery('.modal').on('hidden', function () {
// // Do something after close
//});
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}
*/
/*public static function phAddValueFile() {
//$path = PhocacartPath::getPath($manager);
//$pathImage = Juri::root() . $path['orig_rel_ds'];
$s = array();
$s[] = ' ';
$s[] = '/* Function phAddValueFile /* ';
$s[] = 'function phAddValueFile(id, title) {';
$s[] = ' document.getElementById(id).value = title;';
$s[] = '
jQuery(\'.modal\').modal(\'hide\');';
$s[] = '}';
$s[] = ' ';
//jQuery('.modal').on('hidden', function () {
// // Do something after close
//});
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}*/
public static function renderOverlayOnSubmit($id) {
$document = JFactory::getDocument();
$s[] = 'jQuery(document).ready(function(){';
$s[] = '
jQuery(\'#'.$id.'\').on(\'submit\',
function(){';
$s[] = self::renderOverlay();
$s[] = ' })';
$s[] = '})';
$document->addScriptDeclaration(implode("\n", $s));
}
public static function renderOverlay(){
$s = array();
$s[] = ' var phOverlay = jQuery(\'<div
id="phOverlay"><div id="phLoaderFull">
</div></div>\');';
$s[] = ' phOverlay.appendTo(document.body);';
$s[] =
' jQuery("#phOverlay").fadeIn().css("display","block");';
return implode("\n", $s);
}
public static function renderImportExportItems($url, $messageBox, $formId,
$count, $successMessage, $reload = 0) {
$document = JFactory::getDocument();
$s = array();
$s[] = 'function phUpdateProgress(percentage){';
$s[] = ' if(percentage > 100) {percentage = 100;}';
$s[] = '
jQuery(\'#phProgressBar\').css(\'width\',
percentage+\'%\');';
$s[] = '
jQuery(\'#phProgressBar\').html(percentage+\'%\');';
$s[] = '}';
$s[] = ' ';
$s[] = 'function phImportAllItems(e) {';
$s[] = ' e.stopPropagation();';
$s[] = ' e.preventDefault();';
$s[] = ' var phMaxItems = e.data.a1;';// see the last but one
row of this s
$s[] = ' var phLastPage = phMaxItems;';
$s[] = ' var phItemCount = 1;';
$s[] = ' var phMessageBoxId =
\'#'.$messageBox.'\';';
$s[] = ' var formId =
\'#'.$formId.'\';';
$s[] = ' function phGetNextItem() {';
$s[] = ' phCurrentItemCount = phItemCount;';
$s[] = ' if (phItemCount <= phMaxItems) {';
$s[] = ' jQuery.ajax({';
$s[] = ' url: \''.$url.'\' +
\'&p=\' + phItemCount + \'&lp=\' +
phLastPage,';
$s[] = ' method: \'GET\',';
$s[] = ' async: true,';
$s[] = ' success: function(data) {';
$s[] = ' if (data.status == 1) {';
$s[] = ' ++phItemCount;';
$s[] = '
phUpdateProgress(Math.round((phItemCount/phMaxItems)*100));';
$s[] = ' if (phMaxItems > phCurrentItemCount)
{';
$s[] = ' phGetNextItem();';
$s[] = ' }';
$s[] = ' }';
$s[] = ' ';
$s[] = ' if (phMaxItems == phCurrentItemCount)
{';
$s[] = '
jQuery(".circle").addClass("circle-active");';
$s[] = '
jQuery(phMessageBoxId).html(\'<div class="alert
alert-success"><button class="close"
type="button"
data-dismiss="alert">×</button>'.$successMessage.'</div>\');';
if ($reload == 1) {
// TO DO enable
$s[] = ' window.setTimeout(function ()
{document.location.reload();}, 1000);';
$s[] = self::renderOverlay();
}
$s[] = ' }';
$s[] = ' }';// end success
$s[] = ' });';// end ajax
$s[] = ' }';
$s[] = ' }';
$s[] = ' phGetNextItem();';
$s[] = '}';
$s[] = ' ';
$s[] = 'jQuery(document).ready(function(){';
$s[] =
' jQuery(\'#'.$formId.'\').on(\'submit\',{a1:
'.(int)$count.'}, phImportAllItems);';
$s[] = '})';
$document->addScriptDeclaration(implode("\n", $s));
}
/*
* Is used for:
* - skip wizard in wizard view - modal window must be closed
* - start wizard in control panel - modal windows stays unchanged
*/
public static function renderAjaxDoRequestWizardController($url, $id,
$closeModal = true) {
$s = array();
$s[] = 'function phDoRequestWizardController(url) {';
$s[] = ' var dataPost = {};';
$s[] = ' phRequestActive = jQuery.ajax({';
$s[] = ' url: url,';
$s[] = ' type:\'POST\',';
$s[] = ' data:dataPost,';
$s[] = ' dataType:\'JSON\',';
$s[] = ' success:function(data){';
$s[] = ' if ( data.status == 1 ){';
$s[] = ' phRequestActive = null;';
$s[] = ' } else {';
$s[] = ' phRequestActive = null;';
$s[] = ' }';
$s[] = ' }';
$s[] = ' });';
// This function is a part of iframe in modal window
// We can close whole modal window through global function defined in
// modalWindowDynamic in
administrator\components\com_phocacart\libraries\phocacart\render\renderadminview.php
if ($closeModal == true) {
$s[] = ' window.parent.phCloseModal();';
}
$s[] = '}';
$s[] = 'jQuery(document).ready(function() {';
$s[] = '
jQuery("#'.$id.'").on("click", function(e)
{';
$s[] = '
phDoRequestWizardController("'.$url.'");';
$s[] = ' })';
$s[] = '})';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}
/* When the modal window will be focused, check again the statuses of all
the items
*/
public static function renderAjaxDoRequestWizardAfterChange($url, $value =
'phClickBtn') {
$s = array();
$s[] = 'jQuery(document).ready(function() {';
$s[] = '
phDoRequestWizard(\''.$url.'\');';
$s[] = ' jQuery(window).on("blur focus", function(e)
{';
$s[] = ' var prevType =
jQuery(this).data("prevType");';
$s[] = ' ';
$s[] = ' if (prevType != e.type) {';
$s[] = ' switch (e.type) {';
$s[] = ' case "blur":';
$s[] = ' break;';
$s[] = ' case "focus":';
$s[] = '
phDoRequestWizard(\''.$url.'\');';
$s[] = ' break;';
$s[] = ' }';
$s[] = ' }';
$s[] = ' ';
$s[] = ' jQuery(this).data("prevType", e.type);';
$s[] = ' })';
$s[] = '})';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}
/* Ask for the changes, if something changes - e.g. category is created
* return this to inform and update status in wizard modal window
*/
public static function renderAjaxDoRequestWizard() {
$s = PhocacartRenderStyle::getStyles();
$js = array();
$js[] = ' function phDoRequestWizard(url) {';
$js[] = ' var s = [];';
$js[] = ' s["phTrue"] = \'<div
class="ph-true"><span class="glyphicon glyphicon-ok
icon-ok"></span>
'.JText::_('COM_PHOCACART_CREATED').'</div>\';';
$js[] = ' s["phTrueAdd"] = \'<div
class="ph-true"><span class="glyphicon glyphicon-ok
icon-ok"></span>
'.JText::_('COM_PHOCACART_ADDED').'</div>\';';
$js[] = ' s["phTrueEdit"] = \'<div
class="ph-true"><span class="glyphicon glyphicon-ok
icon-ok"></span>
'.JText::_('COM_PHOCACART_EDITED').'</div>\';';
$js[] = ' s["phTrueAll"] = 1';
$js[] = ' s["phFalse"] = \'<div
class="ph-false"><span class="glyphicon
glyphicon-remove icon-remove"></span>
'.JText::_('COM_PHOCACART_NOT_CREATED_YET').'</div>\';';
$js[] = ' s["phFalseAdd"] = \'<div
class="ph-false"><span class="glyphicon
glyphicon-remove icon-remove"></span>
'.JText::_('COM_PHOCACART_NOT_ADDED_YET').'</div>\';';
$js[] = ' s["phFalseEdit"] = \'<div
class="ph-false"><span class="glyphicon
glyphicon-remove icon-remove"></span>
'.JText::_('COM_PHOCACART_NOT_EDITED_YET').'</div>\';';
$js[] = ' phDoRequestWizardParent(url, s);';
$js[] = '}';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$js));
}
// ========
// ROWS
// ========
/*public static function renderJsManageRowImage($i, $newRow) {
// We have only two modal box - 1. for image, 2. for additinal images
(all)
// So we need to get info, which additional images we have clicked
// For example, if there are 3 additional images and we click on second,
in modal box, we need to get this value to set right value
// phRowImage variable is a part of iframe url (the iframe url is build
dynamically)
//
administrator\components\com_phocacart\models\fields\phocaselectfilenameimage.php
// $link =
'index.php?option=com_phocacart&view=phocacartmanager'.$group['c'].$managerOutput.'&field='.$this->id
. '\'+ (phRowImage) +\'';
// Here
//
administrator\components\com_phocacart\views\phocacartmanager\tmpl\default_file.php
// we get is as $this->field
// Here
//
administrator\components\com_phocacart\libraries\phocacart\render\renderadminview.php
// in function additionalImagesRow we call this function
//$s[] = 'var phRowImage = 0;';
//$s[] = 'function setPhRowImageId(rowImgId) {';
//$s[] = ' phRowImage = rowImgId;';
//$s[] = '}';
$s = array();
$s[] = 'var phRowCountImage = '.$i.';';
$s[] = ' function phAddRowImage() {';
$s[] = ' var phNewRow = \'<div></div>'.
$newRow .'\';';
$s[] = ' phAddRowImageParent(phNewRow);';
$s[] = ' }';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}*/
/*public static function renderJsManageRowAttribute($i, $newRow) {
$url =
'index.php?option=com_phocacart&view=phocacartattributea&format=json&tmpl=component&'.
JSession::getFormToken().'=1';
$s = array();
$s[] = ' var phRowCountAttribute = '.$i.';';
$s[] = ' function phAddRowAttribute() {';
$s[] = ' var phRowOptionAttributeId =
phRowCountAttribute;';// We need this Id for Options (added per
$newRow)
$s[] = ' var phNewRow = \'<div></div>'.
$newRow .'\';';// (to add option in right attribute box)
$s[] = ' phAddRowAttributeParent(phNewRow);';
$s[] = ' }';
$s[] = ' ';
$s[] = ' function phRemoveRowAttribute(id) {';
$s[] = '
if(confirm(\''.JText::_('COM_PHOCACART_WARNING_REMOVING_ATTRIBUTE_DELETES_DOWNLOAD_FOLDER_DOWNLOAD_FILE').'\')){';
$s[] = ' phRemoveRowAttributeParent(id, \''. $url
.'\');';
$s[] = ' }';
$s[] = ' }';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}*/
/*public static function renderJsManageRowOption($j, $newRow, $newHeader)
{
$url =
'index.php?option=com_phocacart&view=phocacartattributea&format=json&tmpl=component&'.
JSession::getFormToken().'=1';
$s = array();
$s[] = ' var phRowCountOption = '.$j.';';
$s[] = ' function phAddRowOption(attrid) {';
$s[] = ' var phNewRow = \'<div></div>'.
$newRow .'\';';
$s[] = ' var phNewHeader = \'<div></div>'.
$newHeader .'\';';
$s[] = ' phAddRowOptionParent(phNewRow, phNewHeader, attrid,
\''. $url .'\');';
$s[] = ' }';
$s[] = ' ';
$s[] = ' function phRemoveRowOption(id, attrid) {';
$s[] = '
if(confirm(\''.JText::_('COM_PHOCACART_WARNING_REMOVING_ATTRIBUTE_OPTION_DELETES_DOWNLOAD_FOLDER_DOWNLOAD_FILE').'\')){';
$s[] = ' phRemoveRowOptionParent(id, attrid, \''.
$url .'\');';
$s[] = ' }';
$s[] = ' }';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
// #phrowboxoptionjs - header created by javascript
// #phrowboxoption - header created by php/mysql
}*/
/*public static function renderJsManageRowSpecification($i, $newRow,
$newHeader) {
$s = array();
$s[] = ' var phRowCountSpecification = '.$i.';';
$s[] = ' function phAddRowSpecification() {';
$s[] = ' var phNewRow = \'<div></div>'.
$newRow .'\';';// (to add option in right attribute box)
$s[] = ' var phNewHeader = \'<div></div>'.
$newHeader .'\';';
$s[] = ' phAddRowSpecificationParent(phNewRow,
phNewHeader);';
$s[] = '}';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
// #phrowboxspecification - header created by javascript
// #phrowboxspecificationheader - header created by php/mysql
}*/
/*
public static function renderJsManageRowDiscount($i, $newRow, $newHeader)
{
$compatible = PhocacartUtils::isJCompatible('3.7') ?
'1' : '0';
$s = array();
$s[] = ' var phRowCountDiscount = '.$i.';';
$s[] = ' function phAddRowDiscount() {';
$s[] = ' var phNewRow = \'<div></div>'.
$newRow .'\';';// (to add option in right attribute box)
$s[] = ' var phNewHeader = \'<div></div>'.
$newHeader .'\';';
$s[] = ' phAddRowDiscountParent(phNewRow, phNewHeader, '.
$compatible . ');';
$s[] = ' }';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
// #phrowboxspecification - header created by javascript
// #phrowboxspecificationheader - header created by php/mysql
}*/
/*public static function renderJsManageRowPriceHistory($i, $newRow) {
$compatible = PhocacartUtils::isJCompatible('3.7') ?
'1' : '0';
$s = array();
$s[] = ' var phRowCountPricehistory = '.$i.';';
$s[] = ' function phAddRowPricehistory() {';
$s[] = ' var phNewRow = \'<div></div>'.
$newRow .'\';';// (to add option in right attribute box)
$s[] = ' phAddRowPricehistoryParent(phNewRow, '. $compatible
. ');';
$s[] = '}';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
// #phrowboxspecification - header created by javascript
// #phrowboxspecificationheader - header created by php/mysql
}*/
public final function __clone() {
throw new Exception('Function Error: Cannot clone instance of
Singleton pattern', 500);
return false;
}
public static function renderHtmlAfterChange($changeElement,
$targetElement) {
$s = array();
$s[] = 'jQuery(document).ready(function() {';
$s[] = '
jQuery("'.$changeElement.'").on("change",
function(e) {';
$s[] = '
jQuery("'.$targetElement.'").show();';
$s[] = ' })';
$s[] = '})';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}
/* Really not nice way to move the system messages from bootstrap2
(Joomla) to bootstrap3 (Phoca)
* Don't add it phocacart.js as it should be run only in some views,
not everywhere
*/
public static function moveSystemMessageFromJoomlaToPhoca() {
$s = array();
//$s[] =
'document.getElementById("system-message-container").style.display
= "none";';
$s[] = 'jQuery(document).ready(function() {';
//$s[] = '
jQuery("#system-message-container").removeClass("j-toggle-main");';
$s[] = '
jQuery("#system-message-container").css("display",
"none");';
$s[] = ' var phSystemMsg =
jQuery("#system-message-container").html();';
$s[] = '
jQuery("#ph-system-message-container").html(phSystemMsg);';
$s[] = '});';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}
/*
public static function renderJsAppendValueToUrl() {
$s = array();
$s[] = 'jQuery(document).ready(function() {';
$s[] = ' var phDownloadFolder =
jQuery(\'#jform_download_folder\').val();';
$s[] = ' var stringToSend = "&folder=" +
phDownloadFolder + "&downloadfolder=" +
phDownloadFolder;';
$s[] = ' var newUri =
jQuery(\'.modal_jform_download_file\').attr(\'href\') +
stringToSend;';
$s[] = '
jQuery(\'.modal_jform_download_file\').attr("href",
newUri);';
$s[] = '})';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}
public static function renderAjaxDoRequest($text) {
$s = array();
$s[] = ' ';
$s[] = '/* Function phDoRequest *//*';
$s[] = 'function phDoRequest(url, manager, value) {';
$s[] = ' var phAjaxTop = \'<div
id="ph-ajaxtop-message"><div
class="ph-loader-top"></div> \' + \''.
strip_tags(addslashes($text)).'\' +
\'</div>\';';
$s[] = ' jQuery("#ph-ajaxtop").html(phAjaxTop);';
$s[] = ' jQuery("#ph-ajaxtop").show();';
$s[] = ' var dataPost = {};';
$s[] = ' dataPost[\'filename\'] =
encodeURIComponent(value);';
$s[] = ' dataPost[\'manager\'] = manager;';
$s[] = ' phRequestActive = jQuery.ajax({';
$s[] = ' url: url,';
$s[] = ' type:\'POST\',';
$s[] = ' data:dataPost,';
$s[] = ' dataType:\'JSON\',';
$s[] = ' success:function(data){';
$s[] = ' if ( data.status == 1 ){';
$s[] = '
jQuery("#ph-ajaxtop-message").html(data.message);';
$s[] = ' phRequestActive = null;';
$s[] = ' setTimeout(function(){';
$s[] = ' jQuery("#ph-ajaxtop").hide(600);';
$s[] = '
jQuery(".ph-result-txt").remove();';
$s[] = ' }, 2500);';
$s[] = ' } else {';
$s[] = '
jQuery("#ph-ajaxtop-message").html(data.error);';
$s[] = ' phRequestActive = null;';
$s[] = ' setTimeout(function(){';
$s[] = ' jQuery("#ph-ajaxtop").hide(600);';
$s[] = '
jQuery(".ph-result-txt").remove();';
$s[] = ' }, 3500);';
$s[] = ' }';
$s[] = ' }';
$s[] = ' });';
$s[] = '}';
$s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}
*/
}
?>
PK�"�[��z�)libraries/phocacart/render/adminmedia.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
use Joomla\CMS\HTML\HTMLHelper;
class PhocacartRenderAdminmedia
{
protected $document = false;
public $compatible = false;
public $view = '';
public function __construct() {
$app = JFactory::getApplication();
$version = new \Joomla\CMS\Version();
$this->compatible =
$version->isCompatible('4.0.0-alpha');
$this->document = JFactory::getDocument();
$this->view = $app->input->get('view');
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework');
HTMLHelper::_('script',
'media/com_phocacart/js/administrator/phocacart.js',
array('version' => 'auto'));
// FORM
// Lang starting with "PHOCA_" - general phoca string used e.g.
in general JS libraries
$this->document->addScriptOptions('phLang', array(
'COM_PHOCACART_CLOSE' =>
JText::_('COM_PHOCACART_CLOSE'),
'COM_PHOCACART_ERROR_TITLE_NOT_SET' =>
JText::_('COM_PHOCACART_ERROR_TITLE_NOT_SET'),
'PHOCA_CLICK_TO_EDIT' =>
JText::_('COM_PHOCACART_CLICK_TO_EDIT'),
'PHOCA_CANCEL' =>
JText::_('COM_PHOCACART_CANCEL'),
'PHOCA_SUBMIT' =>
JText::_('COM_PHOCACART_SUBMIT'),
'PHOCA_PLEASE_RELOAD_PAGE_TO_SEE_UPDATED_INFORMATION' =>
JText::_('COM_PHOCACART_PLEASE_RELOAD_PAGE_TO_SEE_UPDATED_INFORMATION')
));
$this->document->addScriptOptions('phVars',
array('token' => JSession::getFormToken(),
'urleditinplace' =>
JURI::base(true).'/index.php?option=com_phocacart&task=phocacarteditinplace.editinplacetext&format=json&'.
JSession::getFormToken().'=1'));
//$this->document->getDocument()->addScriptOptions('phParams',
array());
HTMLHelper::_('script',
'media/com_phocacart/js/administrator/phocacartform.js',
array('version' => 'auto'));
//HTMLHelper::_('stylesheet',
'media/com_phocacart/bootstrap/css/bootstrap.glyphicons.min.css',
array('version' => 'auto'));
HTMLHelper::_('stylesheet',
'media/com_phocacart/bootstrap/css/bootstrap-grid.min.css',
array('version' => 'auto'));
HTMLHelper::_('stylesheet',
'media/com_phocacart/css/administrator/phocacart.css',
array('version' => 'auto'));
HTMLHelper::_('stylesheet',
'media/com_phocacart/css/administrator/phocacarttheme.css',
array('version' => 'auto'));
HTMLHelper::_('stylesheet',
'media/com_phocacart/css/administrator/phocacartcustom.css',
array('version' => 'auto'));
HTMLHelper::_('stylesheet',
'media/com_phocacart/bootstrap/css/bootstrap.glyphicons-icons-only.min.css',
array('version' => 'auto'));
// CP View - load everywhere because of menu
//if ($this->view == null) {
HTMLHelper::_('stylesheet',
'media/com_phocacart/duotone/joomla-fonts.css',
array('version' => 'auto'));
//}
if ($this->compatible) {
HTMLHelper::_('stylesheet',
'media/com_phocacart/css/administrator/4.css',
array('version' => 'auto'));
} else {
HTMLHelper::_('stylesheet',
'media/com_phocacart/css/administrator/3.css',
array('version' => 'auto'));
}
if(PhocacartUtils::isJCompatible('3.7')) {
HTMLHelper::_('stylesheet',
'media/com_phocacart/css/administrator/37.css',
array('version' => 'auto'));
}
$lang = JFactory::getLanguage();
if ($lang->isRtl()){
HTMLHelper::_('stylesheet',
'media/com_phocacart/css/administrator/rtl.css',
array('version' => 'auto'));
}
// EDIT IN PLACE
$urlText =
JURI::base(true).'/index.php?option=com_phocacart&task=phocacarteditinplace.editinplacetext&format=json&'.
JSession::getFormToken().'=1';
HTMLHelper::_('script',
'media/com_phocacart/js/jeditable/jquery.jeditable.min.js',
array('version' => 'auto'));
HTMLHelper::_('script',
'media/com_phocacart/js/jeditable/jquery.jeditable.autogrow.min.js',
array('version' => 'auto'));
HTMLHelper::_('script',
'media/com_phocacart/js/jeditable/jquery.autogrowtextarea.js',
array('version' => 'auto'));
HTMLHelper::_('script',
'media/com_phocacart/js/jeditable/jquery.phocajeditable.js',
array('version' => 'auto'));
HTMLHelper::_('script',
'media/com_phocacart/js/jeditable/jquery.jeditable.masked.min.js',
array('version' => 'auto'));
HTMLHelper::_('script',
'media/com_phocacart/js/jeditable/jquery.maskedinput.min.js',
array('version' => 'auto'));
HTMLHelper::_('stylesheet',
'media/com_phocacart/js/jeditable/phocajeditable.css',
array('version' => 'auto'));
/*
$s = array();
$s[] = ' ';
$s[] = 'jQuery(document).ready(function() {';
$s[] = '
jQuery(".ph-editinplace-text").editable("'.$urlText.'",
{';
$s[] = ' tooltip :
"'.JText::_('COM_PHOCACART_CLICK_TO_EDIT').'",';
//submit : \'OK\',
$s[] = ' select : true,';
$s[] = ' type : jQuery(this).hasClass("autogrow") ?
"text" : "textarea",';
$s[] = ' cancel :
"'.JText::_('COM_PHOCACART_CANCEL').'",';
$s[] = ' submit :
"'.JText::_('COM_PHOCACART_SUBMIT').'",';
$s[] = ' cssclass :
\'ph-edit-in-place-class\',';
$s[] = ' cancelcssclass : \'btn btn-danger\',';
$s[] = ' submitcssclass : \'btn btn-success\',';
//DEBUG
//$s[] = ' onblur : function() { ... },';
$s[] = ' onblur : function() { ... },';
$s[] = ' intercept : function(jsondata) {';
$s[] = ' json = JSON.parse(jsondata);';
$s[] = ' if (json.status == 0){';
$s[] = ' jQuery("#ph-ajaxtop").html(phGetMsg(\'
\', 1));';
$s[] = ' jQuery("#ph-ajaxtop").show();';
$s[] = '
jQuery("#ph-ajaxtop-message").html(phGetMsg(json.error,
0));';
$s[] = ' phCloseMsgBoxError();';
$s[] = ' this.reset();';
$s[] = ' } else {';
$s[] = ' if (json.idcombined &&
json.resultcombined) {';
$s[] = ' var combinedElement = "#" +
phEscapeColon(json.idcombined);';
$s[] = '
jQuery(combinedElement).html(json.resultcombined);';
$s[] = ' phChangeBackground(combinedElement, 700,
"#D4E9E6");';
$s[] = ' }';
$s[] = ' var currentElement = "#" +
phEscapeColon(jQuery(this).attr("id"))';
$s[] = ' phChangeBackground(currentElement, 700,
"#D4E9E6" );';
$s[] = ' return json.result;';
$s[] = ' }';
$s[] = ' },';
$s[] = ' placeholder: "",';
// Possible information for parts on the site which will be not changed
by chaning the value (for example currency view - currency rate)
$s[] = ' callback: function() {';
$s[] = ' var chEIP = ".phChangeEditInPlace" +
jQuery(this).attr("data-id");';
$s[] = '
jQuery(chEIP).html("'.JText::_('COM_PHOCACART_PLEASE_RELOAD_PAGE_TO_SEE_UPDATED_INFORMATION').'")';
$s[] = ' },';
$s[] = ' })';
$s[] = '})';
$s[] = ' ';
$this->document->addScriptDeclaration(implode("\n",
$s));*/
}
public function loadOptions($load = 0) {
if ($load == 1) {
HTMLHelper::_('stylesheet',
'media/com_phocacart/css/administrator/phocacartoptions.css',
array('version' => 'auto'));
}
}
}
?>
PK�"�[i����(libraries/phocacart/render/adminview.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
use Phoca\Render\Adminview;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
class PhocacartRenderAdminview extends Adminview
{
public $view = '';
public $viewtype = 2;
public $option = '';
public $optionLang = '';
public $compatible = false;
public $sidebar = true;
protected $document = false;
public function __construct(){
parent::__construct();
}
public function startCp($id = '', $class = '') {
$idO = '';
if ($id != '') {
$idO = ' id="'.$id.'"';
}
$classO = ' class="row"';
if ($class != '') {
$classO = ' class="row '.$class.'"';
}
$o = array();
if ($this->compatible) {
if ($this->sidebar) {
} else {
$o[] = '<div'. $idO . $classO .'>';
$o[] = '<div id="j-sidebar-container"
class="col-md-2">'.JHtmlSidebar::render().'</div>';
$o[] = '<div id="j-main-container"
class="col-md-10">';
}
} else {
$o[] = '<div'. $idO . $classO .'>';
//$o[] = '<div id="j-sidebar-container"
class="span2">' . JHtmlSidebar::render() .
'</div>'."\n";
$o[] = '<div class="col-xs-12 col-sm-2 col-md-2
ph-admin-box-menu">'.
JHtmlSidebar::render().'</div>';
//$o[] = '<div id="j-main-container"
class="span10">'."\n";
$o[] = '<div id="j-main-container"
class="col-xs-12 col-sm-10 col-md-10 ph-admin-box-content
ph-admin-manage">'. "\n";
$o[] = '<div
id="ph-system-message-container"></div>'.
"\n";// specific container for moving messages from joomla to
phoca
PhocacartRenderAdminjs::moveSystemMessageFromJoomlaToPhoca();
}
return implode("\n", $o);
}
public function endCp() {
$o = array();
if ($this->compatible) {
if ($this->sidebar) {
} else {
$o[] = '</div></div>';
}
} else {
$o[] = '</div></div>';
}
return implode("\n", $o);
}
public function itemCalc($id, $name, $value, $form = 'pform',
$size = 1, $class = '') {
switch ($size){
case 3: $class = 'input-xxlarge'. ' ' . $class;
break;
case 2: $class = 'input-xlarge'. ' ' . $class;
break;
case 0: $class = 'input-mini'. ' ' . $class;
break;
default: $class= 'input-small'. ' ' . $class;
break;
}
$o = '';
$o .= '<input type="text"
name="'.$form.'['.(int)$id.']['.htmlspecialchars($name,
ENT_QUOTES, 'UTF-8').']"
id="'.$form.'_'.(int)$id.'_'.htmlspecialchars($name,
ENT_QUOTES, 'UTF-8').'"
value="'.htmlspecialchars($value, ENT_QUOTES,
'UTF-8').'" class="'.htmlspecialchars($class,
ENT_QUOTES, 'UTF-8').'" />';
return $o;
}
public function itemCalcCheckbox($id, $name, $value, $form =
'pform' ) {
$checked = '';
if ($value == 1) {
$checked = 'checked="checked"';
}
$o = '';
$o .= '<input type="checkbox"
name="'.$form.'['.(int)$id.']['.htmlspecialchars($name,
ENT_QUOTES, 'UTF-8').']"
id="'.$form.'_'.(int)$id.'_'.htmlspecialchars($name,
ENT_QUOTES, 'UTF-8').'" '.$checked.'
/>';
return $o;
}
/*
* Common function for Image, Attribute, Option
*/
public function addRowButton($text, $type = 'image') {
$o = '<div
id="phrowbox'.$type.'"></div>';
$o .= '<div style="clear:both;"></div>';
$o .= '<div class="ph-add-row"><a class="btn
btn-success btn-mini" href="#"
onclick="phAddRow'.ucfirst($type).'(); return
false;"><i class="icon-plus"></i>
'.$text.'</a></div>';
return $o;
}
/*
public function additionalImagesRow($id, $url, $value = '', $js
= 0) {
// Will be displayed inside Javascript
$o = '<div class="ph-row-image'.$id.'
ph-row-image" id="phrowimage'.$id.'" >'
.'<div class="ph-add-item">'
.'<div class="input-append">'
.'<input class="imageCreateThumbs"
id="jform_image'.$id.'"
name="pformimg['.$id.'][image]"
value="'.htmlspecialchars($value, ENT_QUOTES,
'UTF-8').'" class="inputbox"
size="40" type="text">'
.'<a class="modal_jform_image btn"
title="'.JText::_('COM_PHOCACART_FORM_SELECT_IMAGE').'"
href="'.$url.$id.'"';
if ($js == 1) {
$o .= ' rel="{handler: \\\'iframe\\\', size: {x:
780, y: 560}}">';
} else {
$o .= ' rel="{handler: \'iframe\', size: {x: 780, y:
560}}">';
}
$o .=
JText::_('COM_PHOCACART_FORM_SELECT_IMAGE').'</a>'
.'</div>'
.'<input type="hidden"
name="pformimg['.$id.'][imageid]"
id="jform_imageid'.$id.'"
value="'.$id.'" />'
.'</div>'
.'<div class="ph-remove-row"><a class="btn
btn-danger btn-mini" href="#"
onclick="phRemoveRowImage('.$id.'); return
false;"><i class="icon-minus"></i>
'.JText::_('COM_PHOCACART_REMOVE_IMAGE').'</a></div>'
.'<div class="ph-cb"></div>'
. '</div>';
return $o;
}*/
public function additionalImagesRow($id, $url, $value = '', $js
= 0, $w = 700, $h = 400) {
$idA = 'phFileImageNameModalAT'; //phFileImageNameModal -
standard image, phFileImageNameModalAT - additional images
$textButton = 'COM_PHOCACART_FORM_SELECT_IMAGE';
// Will be displayed inside Javascript
$o = '<div class="ph-row-image'.$id.'
ph-row-image" id="phrowimage'.$id.'" >'
.'<div class="ph-add-item">';
$o .= '<span class="input-prepend
input-append">';
// Preview image - when changing the image dynamically the preview must
be changed too
$path = PhocacartPath::getPath('productimage'); // we use it
only in image, could be changed in future - extended to others view like
category, etc.
if ($value && file_exists($path['orig_abs_ds'] .
$value)) {
$src = JUri::root() . $path['orig_rel_ds'] . $value;
} else {
$src = '';
}
$imgPreview = $src != '' ? '<img
src="'.$src.'" alt="" />' :
'<span class="glyphicon glyphicon-ban-circle
ban-circle"></span>';
$o .= '<span class="btn btn-primary btn-prepend
ph-tooltip">'
. '<span class="icon-eye
icon-white"></span>'
. '<span class="ph-tooltiptext"
id=phTooltipImagePreview_jform_image'.$id.'>'.$imgPreview.'</span>'
. '</span>';
$o .='<input class="imageCreateThumbs inputbox"
id="jform_image'.$id.'"
name="pformimg['.$id.'][image]"
value="'.htmlspecialchars($value, ENT_QUOTES,
'UTF-8').'" size="40"
type="text">';
//$o .= '<a class="modal_jform_image btn"
title="'.JText::_('COM_PHOCACART_FORM_SELECT_IMAGE').'"
href="'.$url.$id.'"';
//$o .= '<a href="#'.$idA.'"
onclick="setPhRowImageId('.$id.')"
role="button" class="btn btn-primary phbtnaddimages"
data-toggle="modal" title="' . JText::_($textButton) .
'">'
$o .= ' <a href="#'.$idA.'"
role="button" class="btn btn-primary
'.$idA.'ModalButton" data-toggle="modal"
title="' . JText::_($textButton) . '"
data-src="'.$url.$id.'"
data-height="'.$h.'"
data-width="'.$w.'">'
. '<span class="icon-list icon-white"></span>
'
. JText::_($textButton) . '</a></span>';
// Javascript rendered by modal windows $this->modalWindowDynamic()
but in edit file to produce html code on right place
$o .= '<input type="hidden"
name="pformimg['.$id.'][imageid]"
id="jform_imageid'.$id.'"
value="'.$id.'" />'
.'</div>'
.'<div class="ph-remove-row"><a class="btn
btn-danger" href="#"
onclick="phRemoveRowImage('.$id.'); return
false;"><i class="icon-minus"></i>
'.JText::_('COM_PHOCACART_REMOVE_IMAGE').'</a></div>'
.'<div class="ph-cb"></div>'
. '</div>';
return $o;
}
public function additionalAttributesRow($id, $idDb, $title, $alias,
$required, $type, $js = 0) {
$requiredArray = PhocacartAttribute::getRequiredArray();
$typeArray = PhocacartAttribute::getTypeArray();
$o = '';
// Will be displayed inside Javascript
$o .= '<div id="phAttributeBox'.$id.'"
class="ph-attribute-box" >';
if ($id == 0) {
// Add Header
$o .= '<div class="ph-row">'."\n"
. '<div class="col-xs-12 col-sm-2 col-md-2">'.
JText::_('COM_PHOCACART_TITLE') . '</div>'
. '<div class="col-xs-12 col-sm-2 col-md-2">'.
JText::_('COM_PHOCACART_ALIAS') . '</div>'
. '<div class="col-xs-12 col-sm-1 col-md-1">'.
JText::_('COM_PHOCACART_REQUIRED') . '</div>'
. '<div class="col-xs-12 col-sm-2 col-md-2">'.
JText::_('COM_PHOCACART_TYPE') . '</div>'
. '<div class="col-xs-12 col-sm-5
col-md-5"> </div>'
.'</div><div
class="ph-cb"></div>'."\n";
}
$o .= '<div class="ph-row-attribute'.$id.'
ph-row-attribute" id="phrowattribute'.$id.'"
>'
.'<div class="col-xs-12 col-sm-2 col-md-2">'
.'<input id="jform_attrid'.$id.'"
name="pformattr['.$id.'][id]"
value="'.(int)$idDb.'"
type="hidden">'
.'<input id="jform_attrtitle'.$id.'"
name="pformattr['.$id.'][title]"
value="'.htmlspecialchars($title, ENT_QUOTES,
'UTF-8').'" class="inputbox input-small"
size="40" type="text">'
.'</div>'
.'<div class="col-xs-12 col-sm-2 col-md-2">'
.'<input id="jform_attralias'.$id.'"
name="pformattr['.$id.'][alias]"
value="'.htmlspecialchars($alias, ENT_QUOTES,
'UTF-8').'" class="inputbox input-small"
size="20" type="text">'
.'</div>'
.'<div class="col-xs-12 col-sm-1 col-md-1">'
. Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$requiredArray, 'pformattr['.$id.'][required]',
'class="input-mini"', 'value',
'text', htmlspecialchars($required, ENT_QUOTES,
'UTF-8'), 'jform_attrrequired'.$id)
.'</div>'
.'<div class="col-xs-12 col-sm-2 col-md-2">'
. Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$typeArray, 'pformattr['.$id.'][type]',
'class="input"', 'value', 'text',
htmlspecialchars($type, ENT_QUOTES, 'UTF-8'),
'jform_attrtype'.$id)
.'<input type="hidden"
name="pformattr['.$id.'][attrid]"
id="jform_attrid'.$id.'"
value="'.$id.'" />'
.'</div>'
.'<div class="col-xs-12 col-sm-5
col-md-5"></div>'
.'<div class="ph-float-icon"><a class="btn
btn-transparent" href="#"
onclick="phRemoveRowAttribute('.$id.'); return false;"
title="'.htmlspecialchars(JText::_('COM_PHOCACART_REMOVE_ATTRIBUTE'),
ENT_QUOTES, 'UTF-8').'"><i
class="icon-cancel
ph-icon-remove"></i>'.''.'</a></div>'
.'<div class="ph-cb ph-pad-b"></div>'
. '</div>';
if ($js == 1) {
$o .= $this->addNewOptionButton($id, $js);
}
return $o;
}
/*
* 1 CALL IT BY JAVASCRIPT - we can add button and we can close the
additionalAttributesRow box (JS -> BUTTON -> CLOSE)
* 2 CALL IT BY PHP - we cannot add button and we cannot close the
additionalAttributesRow box
* because we need to list options loaded by database,
after they are loaded
* we call this function specially to add button and to
close (inside javascript is it not called specially
* but by additionalAttributesRow function)
* (PHP -> OPTIONS -> BUTTON(ADDED SPECIAL) ->
CLOSE (ADDED SPECIAL))
* BE AWARE js must be checked 2x - 1) it decides from
where the code is loaded, 2) it changeds the output
*/
public function addNewOptionButton($id, $js) {
$o = '';
if ($js == 1) {
$id = '\' + phRowOptionAttributeId + \'';// if no
javascript, get real id, if javascript, get js variable
}
$o .= '<div
id="phrowboxoptionjs'.$id.'"></div>';
$o .= '<div style="clear:both;"></div>';
$o .= '<div class="ph-add-row"><a class="btn
btn-primary btn-mini" href="#"
onclick="phAddRowOption('.$id.'); return
false;"><i class="icon-plus"></i>
'.JText::_('COM_PHOCACART_ADD_OPTION').'</a></div>';
$o .= '</div>';// !!! END OF additionalAttributesRow BOX
return $o;
}
public function additionalOptionsRow($id, $attrId, $idDb, $title, $alias,
$operator, $amount, $stock, $operatorWeight, $weight, $image,
$image_medium, $image_small, $download_folder, $download_file,
$download_token, $color, $defaultValue, $url, $url2, $url3, $urlO4, $w =
700, $h = 400) {
$operatorArray = PhocacartAttribute::getOperatorArray();
$o = '';
// Will be displayed inside Javascript
$o .= '<div class="ph-option-box row-fluid"
id="phOptionBox'.$attrId.$id.'">';
$o .= '<div class="ph-row-option'.$attrId.$id.'
ph-row-option-attrid'.$attrId.'"
id="phrowoption'.$attrId.$id.'" >'
.'<div class="col-xs-12 col-sm-2 col-md-2">'
.'<input id="jform_optionid'.$attrId.$id.'"
name="pformattr['.$attrId.'][options]['.$id.'][id]"
value="'.(int)$idDb.'"
type="hidden">'
.'<input
id="jform_optiontitle'.$attrId.$id.'"
name="pformattr['.$attrId.'][options]['.$id.'][title]"
value="'.htmlspecialchars($title, ENT_QUOTES,
'UTF-8').'" class="inputbox input-small"
size="40" type="text" autofocus>'
.'</div>'
.'<div class="col-xs-12 col-sm-1 col-md-1">'
.'<input
id="jform_optionalias'.$attrId.$id.'"
name="pformattr['.$attrId.'][options]['.$id.'][alias]"
value="'.htmlspecialchars($alias, ENT_QUOTES,
'UTF-8').'" class="inputbox input-mini"
size="30" type="text">'
.'</div>'
// Amount - Value
.'<div class="col-xs-12 col-sm-1 col-md-1">'
. Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$operatorArray,
'pformattr['.$attrId.'][options]['.$id.'][operator]',
'class="input-mini"', 'value',
'text', htmlspecialchars($operator, ENT_QUOTES,
'UTF-8'), 'jform_optionoperator'.$attrId. $id)
.'</div>'
.'<div class="col-xs-12 col-sm-1 col-md-1">'
.'<input
id="jform_optionamount'.$attrId.$id.'"
name="pformattr['.$attrId.'][options]['.$id.'][amount]"
value="'.htmlspecialchars($amount, ENT_QUOTES,
'UTF-8').'" class="inputbox input-mini"
size="30" type="text">'
.'</div>'
// Stock
.'<div class="col-xs-12 col-sm-1 col-md-1">'
.'<input
id="jform_optionstock'.$attrId.$id.'"
name="pformattr['.$attrId.'][options]['.$id.'][stock]"
value="'.htmlspecialchars($stock, ENT_QUOTES,
'UTF-8').'" class="inputbox input-mini"
size="30" type="text">'
//.'<input type="hidden"
name="pformattr['.$attrId.'][options]['.$id.'][id]"
id="jform_optionid'.$attrId.$id.'"
value="'.$id.'" />'
.'</div>'
// Weight
.'<div class="col-xs-12 col-sm-1 col-md-1">'
. Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$operatorArray,
'pformattr['.$attrId.'][options]['.$id.'][operator_weight]',
'class="input-mini"', 'value',
'text', htmlspecialchars($operatorWeight, ENT_QUOTES,
'UTF-8'), 'jform_optionoperatorweight'.$attrId. $id)
.'</div>'
.'<div class="col-xs-12 col-sm-1 col-md-1">'
.'<input
id="jform_optionweight'.$attrId.$id.'"
name="pformattr['.$attrId.'][options]['.$id.'][weight]"
value="'.htmlspecialchars($weight, ENT_QUOTES,
'UTF-8').'" class="inputbox input-mini"
size="40" type="text">'
.'</div>';
// Images
// -----
$o .= '<div class="col-xs-12 col-sm-2
col-md-2">';
/*if (is_numeric($attrId) && is_numeric($id)) {
Joomla\CMS\HTML\HTMLHelper::_('behavior.modal',
'a.modal_jform_optionimage'.$attrId.$id);
} else {
// Don't render anything for items which will be added by
javascript
// it is set in javascript addnewrow function
//
administrator\components\com_phocacart\libraries\phocacart\render\renderjs.php
line cca 171
}*/
// IMAGE LARGE
$group =
PhocacartUtilsSettings::getManagerGroup('productimage');
$managerOutput = '&manager=productimage';
$textButton =
'COM_PHOCACART_FORM_SELECT_'.strtoupper($group['t']);
$textButton2 = 'COM_PHOCACART_LARGE';
//$link =
'index.php?option=com_phocacart&view=phocacartmanager'.$group['c'].$managerOutput.'&field=jform_optionimage'.$attrId.$id;
$attr = '';
$idA = 'phFileImageNameModalO';
$html = array();
$html[] = '<span class="input-append">';
$html[] = '<input class="imageCreateThumbs ph-w40
input-mini" type="text"
id="jform_optionimage'.$attrId.$id.'"
name="pformattr['.$attrId.'][options]['.$id.'][image]"
value="'. htmlspecialchars($image, ENT_QUOTES,
'UTF-8').'"' .' '.$attr.'
/>';
/*$html[] = '<a
class="modal_jform_optionimage'.$attrId.$id.' btn"
title="'.JText::_($textButton).'"'
.' href="'.$link.'"'
.' rel="{handler: "iframe", size: {x: 780,
y: 560}}">'
. JText::_($textButton).'</a>';
$html[] = '<a href="#'.$idA.'"
onclick="setPhRowImgOptionId('.$attrId.','.$id.')"
role="button" class="btn btn-primary
phbtnaddimagesoptions" data-toggle="modal"
title="' . JText::_($textButton) . '">'
. '<span class="icon-list icon-white"></span>
'
. JText::_($textButton) . '</a>';*/
$html[] = ' <a href="#'.$idA.'"
role="button" class="btn btn-primary
'.$idA.'ModalButton" data-toggle="modal"
title="' . JText::_($textButton) . '"
data-src="'.$url . $attrId. $id.'"
data-height="'.$h.'"
data-width="'.$w.'">'
. '<span class="icon-list
icon-white"></span>'
. JText::_($textButton2). '</a></span>';
$html[] = '</span>'. "\n";
$o .= implode("\n", $html);
$o .= '<div class="ph-br-small"></div>';
// IMAGE MEDIUM
// -----------
$attr = '';
$idA = 'phFileImageNameModalO';
$textButton2 = 'COM_PHOCACART_MEDIUM';
$html = array();
/* $html[] = '<span class="input-append">';
$html[] = '<input class="imageCreateThumbs ph-w40
input-mini" type="text"
id="jform_optionimage_medium'.$attrId.$id.'"
name="pformattr['.$attrId.'][options]['.$id.'][image_medium]"
value="'. htmlspecialchars($image_medium, ENT_QUOTES,
'UTF-8').'"' .' '.$attr.'
/>';
$html[] = ' <a href="#'.$idA.'"
role="button" class="btn btn-primary
'.$idA.'ModalButton" data-toggle="modal"
title="' . JText::_($textButton) . '"
data-src="'.$url2 . $attrId. $id.'"
data-height="'.$h.'"
data-width="'.$w.'">'
. '<span class="icon-list
icon-white"></span>'
. JText::_($textButton2). '</a></span>';
$html[] = '</span>'. "\n";
*/
// We use only small image for icon and large image which have thumbnails
(small, medium, large), so we don't need medium
$html[] = '<input type="hidden"
id="jform_optionimage_medium'.$attrId.$id.'"
name="pformattr['.$attrId.'][options]['.$id.'][image_medium]"
value=""' .' '.$attr.' />';
$o .= implode("\n", $html);
/*
$o .= '<div class="ph-br-small"></div>';
*/
// IMAGE SMALL
// -----------
$attr = '';
$idA = 'phFileImageNameModalO';
$textButton2 = 'COM_PHOCACART_SMALL';
$html = array();
$html[] = '<span class="input-append">';
$html[] = '<input class="imageCreateThumbs ph-w40
input-mini" type="text"
id="jform_optionimage_small'.$attrId.$id.'"
name="pformattr['.$attrId.'][options]['.$id.'][image_small]"
value="'. htmlspecialchars($image_small, ENT_QUOTES,
'UTF-8').'"' .' '.$attr.'
/>';
$html[] = ' <a href="#'.$idA.'"
role="button" class="btn btn-primary
'.$idA.'ModalButton" data-toggle="modal"
title="' . JText::_($textButton) . '"
data-src="'.$url3 . $attrId. $id.'"
data-height="'.$h.'"
data-width="'.$w.'">'
. '<span class="icon-list
icon-white"></span>'
. JText::_($textButton2). '</a></span>';
$html[] = '</span>'. "\n";
$o .= implode("\n", $html);
$o .= '</div>';
// COLOR
// -----
$o .= '<div class="col-xs-12 col-sm-1
col-md-1">';
$format = 'hex';
$keywords = '';
$validate = ' data-validate="hex"';
$class = '';
$control = '';
$readonly = '';
$autocomplete = true;
$lang = JFactory::getLanguage();
$position = '';
$disabled = '';
$required = '';
$onchange = '';
$autofocus = 'autofocus';
if (in_array($format, array('rgb', 'rgba'))
&& $validate != 'color') {
$alpha = ($format == 'rgba') ? true : false;
$placeholder = $alpha ? 'rgba(0, 0, 0, 0.5)' : 'rgb(0, 0,
0)';
} else {
$placeholder = '#rrggbb';
}
$inputclass = ($keywords && ! in_array($format,
array('rgb', 'rgba'))) ? ' keywords' : '
' . $format;
$class = ' class="' . trim('minicolors '
. $class) . ($validate == 'color' ? '' : $inputclass) .
'"';
$control = $control ? ' data-control="' . $control .
'"' : '';
$format = $format ? ' data-format="' . $format .
'"' : '';
$keywords = $keywords ? ' data-keywords="' . $keywords
. '"' : '';
$readonly = $readonly ? ' readonly' : '';
$hint = ' placeholder="' . $placeholder .
'"';
$autocomplete = ! $autocomplete ? '
autocomplete="off"' : '';
$direction = $lang->isRTL() ? ' dir="ltr"
style="text-align:right"' : '';
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework');
Joomla\CMS\HTML\HTMLHelper::_('script',
'system/html5fallback.js', false, true);
Joomla\CMS\HTML\HTMLHelper::_('behavior.colorpicker');
/*$jQ =
"jQuery('INPUT[type=minicolors]').on('change',
function() {
var hex = jQuery(this).val(),
opacity = jQuery(this).attr('data-opacity');
jQuery('BODY').css('backgroundColor', hex);
});";
JFactory::getDocument()->addScriptDeclaration($jQ);*/
$html = array();
$html[] = '<input type="text"
id="jform_optioncolor'.$attrId.$id.'"
name="pformattr['.$attrId.'][options]['.$id.'][color]"'
. ' value="'. htmlspecialchars($color, ENT_COMPAT,
'UTF-8') . '"'
. $hint . $class . $position . $control
. $readonly . $disabled . $required . $onchange . $autocomplete .
$autofocus
. $format . $keywords . $direction . $validate . '/>';
$o .= implode("\n", $html);
$o .= '</div>';
//$o .= '<div class="col-xs-12 col-sm-1
col-md-1"></div>';
// ****
// Design issue - reverse ordering because of float right, we just
don't have enough bootstrap spans
// ****
$o .= '<div class="ph-float-icon"><a
class="btn btn-transparent" href="#"
onclick="phRemoveRowOption('.$id.','.$attrId.');
return false;"
title="'.htmlspecialchars(JText::_('COM_PHOCACART_REMOVE_OPTION'),
ENT_QUOTES, 'UTF-8').'"><i
class="icon-cancel
ph-icon-remove"></i>'.''.'</a></div>';
// DEFAULT VALUE
// -------------
$checkedDV = '';
if ($defaultValue == 1) {
$checkedDV = 'checked="checked"';
}
$o .= '<div class="col-xs-12 col-sm-1
col-md-1">'
.'<div class="ph-radio-top"><input
id="jform_optiondefault_value'.$attrId.$id.'"
name="pformattr['.$attrId.'][options]['.$id.'][default_value]"
class="inputbox input-mini" size="10"
type="checkbox" '.$checkedDV.'></div>'
.'</div>';
$o .= '<div class="ph-cb"></div>';
// Second Row
// DOWNLOAD FILE
// -----------
$group =
PhocacartUtilsSettings::getManagerGroup('attributefile');
$managerOutput = '&manager=productfile';
$textButton =
'COM_PHOCACART_FORM_SELECT_'.strtoupper($group['t']);
$textButton2 = 'COM_PHOCACART_FILE';
//$link =
'index.php?option=com_phocacart&view=phocacartmanager'.$group['c'].$managerOutput.'&field=jform_optionimage'.$attrId.$id;
$attr = '';
$idA = 'phFileDownloadNameModalO';
$html = array();
$html[] = '<span class="input-append">';
$html[] = '<input class="imageCreateThumbs ph-w40
input-medium" type="text"
id="jform_optiondownload_file'.$attrId.$id.'"
name="pformattr['.$attrId.'][options]['.$id.'][download_file]"
value="'. htmlspecialchars($download_file, ENT_QUOTES,
'UTF-8').'"' .' '.$attr.'
/>';
$html[] = ' <a href="#'.$idA.'"
role="button" class="btn btn-primary
'.$idA.'ModalButton" data-toggle="modal"
title="' . JText::_($textButton) . '"
data-src="'.$urlO4 . $attrId. $id.'"
data-height="'.$h.'"
data-width="'.$w.'"
data-id-folder="jform_optiondownload_folder'.$attrId.$id.'">'
. '<span class="icon-list
icon-white"></span>'
. JText::_($textButton2). '</a></span>';
$html[] = '</span>'. "\n";
$o .= '<div class="col-xs-12 col-sm-4
col-md-4"><div
class="ph-product-attribute-download-title">'.JText::_('COM_PHOCACART_FIELD_DOWNLOAD_FOLDER_LABEL').
'</div></div>';
$o .= '<div class="col-xs-12 col-sm-4
col-md-4"><div
class="ph-product-attribute-download-title">'.JText::_('COM_PHOCACART_FIELD_DOWNLOAD_FILE_LABEL').
'</div></div>';
$o .= '<div class="col-xs-12 col-sm-4
col-md-4"><div
class="ph-product-attribute-download-title">'.JText::_('COM_PHOCACART_FIELD_DOWNLOAD_TOKEN_LABEL').
'</div></div>';
$o .= '<div class="ph-cb"></div>';
// Folder
$o .= '<div class="col-xs-12 col-sm-4
col-md-4">';
$o .= '<input
id="jform_optiondownload_folder'.$attrId.$id.'"
name="pformattr['.$attrId.'][options]['.$id.'][download_folder]"
value="'.htmlspecialchars($download_folder, ENT_QUOTES,
'UTF-8').'" class="inputbox input-medium"
size="40" type="text" readonly="readonly"
data-attribute-id="'.$attrId.'" >';
$o .= '</div>';
// File
$o .= '<div class="col-xs-12 col-sm-4
col-md-4">';
$o .= implode("\n", $html);
$o .= '</div>';
// Token
$o .= '<div class="col-xs-12 col-sm-4
col-md-4">';
$o .= '<input
id="jform_optiondownload_token'.$attrId.$id.'"
name="pformattr['.$attrId.'][options]['.$id.'][download_token]"
value="'.htmlspecialchars($download_token, ENT_QUOTES,
'UTF-8').'" class="inputbox input-medium"
size="40" type="text">';
$o .= '</div>';
$o .= '</div>'; // end row
$o .= '</div>';// end box
return $o;
}
public function headerOption($id = 0) {
$o = '';
// we have two phrowboxoptions - phrowboxoption - loaded with php/mysql,
phrowboxoptionjs - added by javascript
$o .= '<div
id="phrowboxoption'.$id.'">';
$o .=
'<h4>'.JText::_('COM_PHOCACART_OPTIONS').'</h4>';
$o .= '<div class="ph-row">'."\n"
. '<div class="col-xs-12 col-sm-2 col-md-2">'.
JText::_('COM_PHOCACART_TITLE') . '</div>'
. '<div class="col-xs-12 col-sm-1 col-md-1">'.
JText::_('COM_PHOCACART_ALIAS') . '</div>'
. '<div class="col-xs-12 col-sm-1
col-md-1"> </div>'
. '<div class="col-xs-12 col-sm-1 col-md-1">'.
JText::_('COM_PHOCACART_VALUE') . '</div>'
. '<div class="col-xs-12 col-sm-1 col-md-1">'.
JText::_('COM_PHOCACART_IN_STOCK') . '</div>'
. '<div class="col-xs-12 col-sm-1
col-md-1"> </div>'
. '<div class="col-xs-12 col-sm-1 col-md-1">'.
JText::_('COM_PHOCACART_WEIGHT') . '</div>'
. '<div class="col-xs-12 col-sm-2 col-md-2">'.
JText::_('COM_PHOCACART_IMAGES') . '</div>'
. '<div class="col-xs-12 col-sm-1 col-md-1">'.
JText::_('COM_PHOCACART_COLOR') . '</div>'
// Not enough columns
. '<div class="col-xs-12 col-sm-1 col-md-1">'.
JText::_('COM_PHOCACART_DEFAULT') . '</div>'
//. '<div class="col-xs-12 col-sm-1
col-md-1"> </div>'
.'</div><div
class="ph-cb"></div>'."\n";
$o .= '</div>';
return $o;
}
/*
public function additionalSpecificationsRow($id, $idDb, $title, $alias,
$value, $alias_value, $group, $image, $image_medium, $image_small, $color,
$js = 0, $url, $url2, $url3, $w = 700, $h = 400) {
$groupArray = PhocacartSpecification::getGroupArray();
$o = '';
// Will be displayed inside Javascript
$o .= '<div class="ph-specification-box"
id="phSpecificationBox'.$id.'">';
if ($id == 0) {
// Add Header
/*$o .= '<div class="ph-row">'."\n"
. '<div class="col-xs-12 col-sm-2 col-md-2">'.
JText::_('COM_PHOCACART_TITLE') . '</div>'
. '<div class="col-xs-12 col-sm-2 col-md-2">'.
JText::_('COM_PHOCACART_ALIAS') . '</div>'
. '<div class="col-xs-12 col-sm-1 col-md-1">'.
JText::_('COM_PHOCACART_REQUIRED') . '</div>'
. '<div class="col-xs-12 col-sm-2 col-md-2">'.
JText::_('COM_PHOCACART_TYPE') . '</div>'
. '<div class="col-xs-12 col-sm-5
col-md-5"> </div>'
.'</div><div
class="ph-cb"></div>'."\n";*//*
$o .= $this->headerSpecification();
}
$o .= '<div class="ph-row-specification'.$id.'
ph-row-specification"
id="phrowspecification'.$id.'" >'
.'<div class="col-xs-12 col-sm-3 col-md-3">'
.'<input id="jform_specid'.$id.'"
name="pformspec['.$id.'][id]"
value="'.(int)$idDb.'"
type="hidden">'
.'<input id="jform_spectitle'.$id.'"
name="pformspec['.$id.'][title]"
value="'.htmlspecialchars($title, ENT_QUOTES,
'UTF-8').'" class="inputbox"
size="40" type="text">'
.'</div>'
.'<div class="col-xs-12 col-sm-3 col-md-3">'
.'<textarea id="jform_specvalue'.$id.'"
name="pformspec['.$id.'][value]"
class="inputbox" rows="3" cols="10"
type="textarea">'.htmlspecialchars($value, ENT_QUOTES,
'UTF-8').'</textarea>'
.'</div>'
.'<div class="col-xs-12 col-sm-2 col-md-2">'
. Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$groupArray, 'pformspec['.$id.'][group_id]',
'class="input"', 'value', 'text',
(int)$group, 'jform_specgroup'.$id)
.'</div>'
.'<div class="col-xs-12 col-sm-4
col-md-4"></div>'
.'<div class="ph-float-icon"><a class="btn
btn-transparent" href="#"
onclick="phRemoveRowSpecification('.$id.'); return
false;"
title="'.htmlspecialchars(JText::_('COM_PHOCACART_REMOVE_PARAMETER'),
ENT_QUOTES, 'UTF-8').'"><i
class="icon-cancel
ph-icon-remove"></i>'.''.'</a></div>'
.'<div class="ph-cb ph-pad-b"></div>'
// ALIASES
.'<div class="ph-row-specification">'
.'<div class="col-xs-12 col-sm-3 col-md-3">'
. JText::_('COM_PHOCACART_ALIAS_PARAMETER') . '<br
/><input id="jform_specalias'.$id.'"
name="pformspec['.$id.'][alias]"
value="'.htmlspecialchars($alias, ENT_QUOTES,
'UTF-8').'" class="inputbox"
size="40" type="text">'
.'</div>'
.'<div class="col-xs-12 col-sm-3 col-md-3">'
. JText::_('COM_PHOCACART_ALIAS_VALUE') . '<br
/><input id="jform_specalias_value'.$id.'"
name="pformspec['.$id.'][alias_value]"
value="'.htmlspecialchars($alias_value, ENT_QUOTES,
'UTF-8').'" class="inputbox"
size="40" type="text">'
.'</div>'
.'<div class="col-xs-12 col-sm-2 col-md-2">
</div>'
.'<div class="col-xs-12 col-sm-4 col-md-4">
</div>'
.'<div class="ph-cb ph-pad-b"></div>'
.'</div>';
// COLOR AND SMALL IMAGE
$o .= '<div class="ph-row-specification">';
// IMAGE SMALL
// -----------
$o .= '<div class="col-xs-12 col-sm-3
col-md-3">';
$group =
PhocacartUtilsSettings::getManagerGroup('productimage');
$managerOutput = '&manager=productimage';
$textButton =
'COM_PHOCACART_FORM_SELECT_'.strtoupper($group['t']);
$attr = '';
$idA = 'phFileImageNameModalS';
$textButton2 = 'COM_PHOCACART_SMALL';
$html = array();
$html[] = JText::_('COM_PHOCACART_IMAGES') . '<br
/>';
$html[] = '<span class="input-append">';
$html[] = '<input class="imageCreateThumbs ph-w40
input-mini" type="text"
id="jform_specimage_small'.$id.'"
name="pformspec['.$id.'][image_small]"
value="'.htmlspecialchars($image_small, ENT_QUOTES,
'UTF-8').'"' .' '.$attr.'
/>';
$html[] = ' <a href="#'.$idA.'"
role="button" class="btn btn-primary
'.$idA.'ModalButton" data-toggle="modal"
title="' . JText::_($textButton) . '"
data-src="'.$url3 . $id.'"
data-height="'.$h.'"
data-width="'.$w.'">'
. '<span class="icon-list
icon-white"></span>'
. JText::_($textButton2). '</a></span>';
// $html[] = '</span>'. "\n";
$o .= implode("\n", $html);
$o .= '</div>';
// COLOR
// -----
$o .= '<div class="col-xs-12 col-sm-3
col-md-3">';
$format = 'hex';
$keywords = '';
$validate = ' data-validate="hex"';
$class = '';
$control = '';
$readonly = '';
$autocomplete = true;
$lang = JFactory::getLanguage();
$position = '';
$disabled = '';
$required = '';
$onchange = '';
//$autofocus = 'autofocus';
$autofocus = '';
if (in_array($format, array('rgb', 'rgba'))
&& $validate != 'color') {
$alpha = ($format == 'rgba') ? true : false;
$placeholder = $alpha ? 'rgba(0, 0, 0, 0.5)' : 'rgb(0, 0,
0)';
} else {
$placeholder = '#rrggbb';
}
$inputclass = ($keywords && ! in_array($format,
array('rgb', 'rgba'))) ? ' keywords' : '
' . $format;
$class = ' class="' . trim('minicolors '
. $class) . ($validate == 'color' ? '' : $inputclass) .
'"';
$control = $control ? ' data-control="' . $control .
'"' : '';
$format = $format ? ' data-format="' . $format .
'"' : '';
$keywords = $keywords ? ' data-keywords="' . $keywords
. '"' : '';
$readonly = $readonly ? ' readonly' : '';
$hint = ' placeholder="' . $placeholder .
'"';
$autocomplete = ! $autocomplete ? '
autocomplete="off"' : '';
$direction = $lang->isRTL() ? ' dir="ltr"
style="text-align:right"' : '';
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework');
Joomla\CMS\HTML\HTMLHelper::_('script',
'system/html5fallback.js', false, true);
Joomla\CMS\HTML\HTMLHelper::_('behavior.colorpicker');
/*$jQ =
"jQuery('INPUT[type=minicolors]').on('change',
function() {
var hex = jQuery(this).val(),
opacity = jQuery(this).attr('data-opacity');
jQuery('BODY').css('backgroundColor', hex);
});";
JFactory::getDocument()->addScriptDeclaration($jQ);*//*
$html = array();
$html[] = JText::_('COM_PHOCACART_COLOR') . '<br
/>';
$html[] = '<input type="text"
id="jform_speccolor'.$id.'"
name="pformspec['.$id.'][color]"
value="'.htmlspecialchars($color, ENT_QUOTES,
'UTF-8').'" '
. $hint . $class . $position . $control
. $readonly . $disabled . $required . $onchange . $autocomplete .
$autofocus
. $format . $keywords . $direction . $validate . '/>';
$o .= implode("\n", $html);
$o .= '</div>';
$o .= '<div class="col-xs-12 col-sm-2 col-md-2">
</div>';
$o .= '<div class="col-xs-12 col-sm-4 col-md-4">
</div>';
$o .= '<div class="ph-cb
ph-pad-b"></div>';
$o .= '</div>';// END Colors and images
$o .= '</div>'
. '</div>';
return $o;
}*/
public function headerSpecification() {
//$o = '<div class="ph-row"
id="phrowboxspecificationheader">'."\n"
$o = '<div class="row-fluid
ph-row">'."\n"
. '<div class="col-xs-12 col-sm-3 col-md-3">'.
JText::_('COM_PHOCACART_PARAMETER') . '</div>'
. '<div class="col-xs-12 col-sm-3 col-md-3">'.
JText::_('COM_PHOCACART_VALUE') . '</div>'
. '<div class="col-xs-12 col-sm-2 col-md-2">'.
JText::_('COM_PHOCACART_GROUP') . '</div>'
. '<div class="col-xs-12 col-sm-4
col-md-4"> </div>'
.'</div><div
class="ph-cb"></div>'."\n";
return $o;
}
public static function getCalendarAttributes($js = 0, $initialize = 0) {
// Calendar
// Initialized only for php, not javascript
// we have inintialized calender in publishing options so there is no
need to render it
// when no item loaded from php, when only javascript rows will be added
if ($initialize == 1) {
$tag = JFactory::getLanguage()->getTag();
$calendar = JFactory::getLanguage()->getCalendar();
$direction = strtolower(JFactory::getDocument()->getDirection());
// Get the appropriate file for the current language date helper
$helperPath =
'system/fields/calendar-locales/date/gregorian/date-helper.min.js';
if (!empty($calendar) && is_dir(JPATH_ROOT .
'/media/system/js/fields/calendar-locales/date/' .
strtolower($calendar)))
{
$helperPath = 'system/fields/calendar-locales/date/' .
strtolower($calendar) . '/date-helper.min.js';
}
// Get the appropriate locale file for the current language
$localesPath = 'system/fields/calendar-locales/en.js';
if (is_file(JPATH_ROOT .
'/media/system/js/fields/calendar-locales/' . strtolower($tag) .
'.js'))
{
$localesPath = 'system/fields/calendar-locales/' .
strtolower($tag) . '.js';
}
elseif (is_file(JPATH_ROOT .
'/media/system/js/fields/calendar-locales/' .
strtolower(substr($tag, 0, -3)) . '.js'))
{
$localesPath = 'system/fields/calendar-locales/' .
strtolower(substr($tag, 0, -3)) . '.js';
}
JFactory::getDocument()->addScript(JURI::root(true).'/',$helperPath);
JFactory::getDocument()->addScript(JURI::root(true).'/',$localesPath);
}
if ($js == 0) {
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework');
Joomla\CMS\HTML\HTMLHelper::_('script',
'system/html5fallback.js', false, true);
}
$attributes['size'] = 30;
$attributes['maxlength'] = 30;
$attributes['class'] = "input-mini";
return $attributes;
}
public function additionalDiscountsRow($id, $idDb, $title, $alias,
$access, $group, $discount, $calculation_type, $quantity_from,
$quantity_to, $valid_from, $valid_to, $js = 0) {
// Calendar
$attributes = self::getCalendarAttributes($js);
$valid_from = self::getCalendarDate($valid_from);
$valid_to = self::getCalendarDate($valid_to);
$calcTypeArray =
PhocacartUtilsSettings::getDiscountCalculationTypeArray();
if ($calculation_type == '') {
//Set percentage as default for new rows
$calculation_type = 1;
}
$o = '';
if ($id == 0 && $js == 0) {
// Add Header
$o .= $this->headerDiscount();
}
// Will be displayed inside Javascript
$o .= '<div class="ph-discount-box"
id="phDiscountBox'.$id.'">';
$o .= '<div class="ph-row-discount'.$id.'
ph-row-discount" id="phrowdiscount'.$id.'"
>'
.'<div class="col-xs-12 col-sm-1 col-md-1">'
.'<input id="jform_discid'.$id.'"
name="pformdisc['.$id.'][id]"
value="'.(int)$idDb.'"
type="hidden">'
.'<input id="jform_disctitle'.$id.'"
name="pformdisc['.$id.'][title]"
value="'.htmlspecialchars($title, ENT_QUOTES,
'UTF-8').'" class="inputbox input-mini"
type="text">'
.'</div>'
.'<div class="col-xs-12 col-sm-1 col-md-1">'
.'<input id="jform_discalias'.$id.'"
name="pformdisc['.$id.'][alias]"
value="'.htmlspecialchars($alias, ENT_QUOTES,
'UTF-8').'" class="inputbox input-mini"
type="text">'
.'</div>'
.'<div class="col-xs-12 col-sm-1 col-md-1">'
. Joomla\CMS\HTML\HTMLHelper::_('access.level',
'pformdisc['.$id.'][access]', (int)$access,
'class="input input-small"', array(),
'jform_discaccess'.$id)
.'</div>'
.'<div class="col-xs-12 col-sm-1 col-md-1">'
.
PhocacartGroup::getAllGroupsSelectBox('pformdisc['.$id.'][groups][]',
'jform_discaccess'.$id, $group, NULL, 'id',
'class="input input-small" size="4"
multiple="multiple"' )
.'</div>'
.'<div class="col-xs-12 col-sm-1 col-md-1">'
.'<input id="jform_discdiscount'.$id.'"
name="pformdisc['.$id.'][discount]"
value="'.htmlspecialchars($discount, ENT_QUOTES,
'UTF-8').'" class="inputbox input-mini"
type="text">'
.'</div>'
.'<div class="col-xs-12 col-sm-1 col-md-1">'
. Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$calcTypeArray, 'pformdisc['.$id.'][calculation_type]',
'class="input input-small"', 'value',
'text', (int)$calculation_type,
'jform_disccalculation_type'.$id)
.'</div>'
.'<div class="col-xs-12 col-sm-1 col-md-1">'
.'<input id="jform_discquantity_from'.$id.'"
name="pformdisc['.$id.'][quantity_from]"
value="'.htmlspecialchars($quantity_from, ENT_QUOTES,
'UTF-8').'" class="inputbox input-mini"
type="text">'
.'</div>';
/*
.'<div class="col-xs-12 col-sm-1 col-md-1">'
.'<input id="jform_discquantity_to'.$id.'"
name="pformdisc['.$id.'][quantity_to]"
value="'.htmlspecialchars($quantity_to).'"
class="inputbox input-mini" type="text">'
.'</div>';*/
$o .= '<div class="col-xs-12 col-sm-2
col-md-2">';
if ($js == 1) {
if (PhocacartUtils::isJCompatible('3.7')) {
$o .= Joomla\CMS\HTML\HTMLHelper::_('calendar', $valid_from,
'pformdisc['.$id.'][valid_from]',
'jform_discvalid_from'.$id, '%Y-%m-%d', $attributes);
} else {
// Calender is initialized and cannot access DOM then so we need to
render it manually in javascript
// and then initialize the calendar in phAddRowDiscount function
$o .= '<div class="input-append">'
. '<input title=""
name="pformdisc['.$id.'][valid_from]"
id="jform_discvalid_from'.$id.'"
value="'.htmlspecialchars($quantity_from, ENT_QUOTES,
'UTF-8').'" size="30"
maxlength="30" class="input-mini hasTooltip"
type="text">'
. '<button type="button" class="btn"
id="jform_discvalid_from'.$id.'_img"><span
class="icon-calendar"></span></button>'
.'</div>';
$o .= '\<script\>Calendar.setup({'
. ' inputField:
"jform_discvalid_from'.$id.'",'
. ' ifFormat: "%Y-%m-%d",'
. ' button:
"jform_discvalid_from'.$id.'_img",'
. ' align: "Tl",'
. ' singleClick: true,'
. ' firstDay: 0'
. ' })\<\/script\>';
}
} else {
$o .= Joomla\CMS\HTML\HTMLHelper::_('calendar', $valid_from,
'pformdisc['.$id.'][valid_from]',
'jform_discvalid_from'.$id, '%Y-%m-%d', $attributes);
}
$o .= '</div>';
$o .= '<div class="col-xs-12 col-sm-2
col-md-2">';
if ($js == 1) {
if (PhocacartUtils::isJCompatible('3.7')) {
$o .= Joomla\CMS\HTML\HTMLHelper::_('calendar', $valid_to,
'pformdisc['.$id.'][valid_to]',
'jform_discvalid_to'.$id, '%Y-%m-%d', $attributes);
} else {
$o .= '<div class="input-append">'
. '<input title=""
name="pformdisc['.$id.'][valid_to]"
id="jform_discvalid_to'.$id.'"
value="'.htmlspecialchars($quantity_from, ENT_QUOTES,
'UTF-8').'" size="30"
maxlength="30" class="input-mini hasTooltip"
type="text">'
. '<button type="button" class="btn"
id="jform_discvalid_to'.$id.'_img"><span
class="icon-calendar"></span></button>'
.'</div>';
$o .= '\<script\>Calendar.setup({'
. ' inputField:
"jform_discvalid_to'.$id.'",'
. ' ifFormat: "%Y-%m-%d",'
. ' button:
"jform_discvalid_to'.$id.'_img",'
. ' align: "Tl",'
. ' singleClick: true,'
. ' firstDay: 0'
. ' })\<\/script\>';
}
} else {
$o .= Joomla\CMS\HTML\HTMLHelper::_('calendar', $valid_to,
'pformdisc['.$id.'][valid_to]',
'jform_discvalid_to'.$id, '%Y-%m-%d', $attributes);
}
$o .= '</div>';
$o .= '<div class="col-xs-12 col-sm-1
col-md-1"></div>'
.'<div class="ph-float-icon"><a class="btn
btn-transparent" href="#"
onclick="phRemoveRowDiscount('.$id.'); return false;"
title="'.htmlspecialchars(JText::_('COM_PHOCACART_REMOVE_DISCOUNT'),
ENT_QUOTES, 'UTF-8').'"><i
class="icon-cancel
ph-icon-remove"></i>'.''.'</a></div>'
.'<div class="ph-cb ph-pad-b"></div>'
. '</div>'
. '</div>';
return $o;
}
public function headerDiscount() {
//$o = '<div class="ph-row"
id="phrowboxspecificationheader">'."\n"
$o = '<div class="row-fluid
ph-row">'."\n"
. '<div class="col-xs-12 col-sm-1 col-md-1">'.
JText::_('COM_PHOCACART_TITLE') . '</div>'
. '<div class="col-xs-12 col-sm-1 col-md-1">'.
JText::_('COM_PHOCACART_ALIAS') . '</div>'
. '<div class="col-xs-12 col-sm-1 col-md-1">'.
JText::_('COM_PHOCACART_ACCESS') . '</div>'
. '<div class="col-xs-12 col-sm-1 col-md-1">'.
JText::_('COM_PHOCACART_GROUP') . '</div>'
. '<div class="col-xs-12 col-sm-1 col-md-1">'.
JText::_('COM_PHOCACART_DISCOUNT') . '</div>'
. '<div class="col-xs-12 col-sm-1 col-md-1">'.
JText::_('COM_PHOCACART_CALCULATION_TYPE') .
'</div>';
/*. '<div class="col-xs-12 col-sm-1
col-md-1">'. JText::_('COM_PHOCACART_QUANTITY_FROM')
. '</div>'
. '<div class="col-xs-12 col-sm-1 col-md-1">'.
JText::_('COM_PHOCACART_QUANTITY_TO') .
'</div>'*/
$o .= '<div class="col-xs-12 col-sm-1
col-md-1">'.
JText::_('COM_PHOCACART_MINIMUM_QUANTITY') .
'</div>'
. '<div class="col-xs-12 col-sm-2 col-md-2">'.
JText::_('COM_PHOCACART_VALID_FROM') . '</div>'
. '<div class="col-xs-12 col-sm-2 col-md-2">'.
JText::_('COM_PHOCACART_VALID_TO') . '</div>'
. '<div class="col-xs-12 col-sm-1
col-md-1"> </div>'
.'</div><div
class="ph-cb"></div>'."\n";
return $o;
}
public function additionalPricehistoryRow($id, $idDb, $price, $date,
$productId, $js = 0) {
// Calendar
$date = self::getCalendarDate($date);
$attributes = self::getCalendarAttributes($js);
$attributes['class'] = "input";
$o = '';
// Will be displayed inside Javascript
$o .= '<div class="ph-pricehistory-box"
id="phPricehistoryBox'.$id.'">';
$o .= '<div class="ph-row-pricehistory'.$id.'
ph-row-pricehistory" id="phrowpricehistory'.$id.'"
>';
$o .= '<div class="col-xs-12 col-sm-3
col-md-3">';
$o .= Joomla\CMS\HTML\HTMLHelper::_('calendar', $date,
'jform['.$id.'][date]', 'jform_date'.$id,
'%Y-%m-%d', $attributes);
$o .= '</div>';
// Set value from database
$priceN = '';
if (isset($price)) {
$priceN = $price;
if ($priceN > 0 || $priceN == 0) {
$priceN = PhocacartPrice::cleanPrice($priceN);
}
}
$o .= '<div class="col-xs-12 col-sm-2
col-md-2">';
$o .= '<input type="text" class="input-small"
name="jform['.$id.'][price]"
value="'.$priceN.'" />';
$o .= '<input type="hidden"
name="jform['.$id.'][product_id]"
value="'.$productId.'" />';
$o .= '</div>';
$o .= '<div class="col-xs-12 col-sm-1
col-md-1">'
.'<div class="ph-float-icon-l"><a class="btn
btn-transparent" href="#"
onclick="phRemoveRowPricehistory('.$id.'); return
false;"
title="'.htmlspecialchars(JText::_('COM_PHOCACART_REMOVE_PRICE'),
ENT_QUOTES, 'UTF-8').'"><i
class="icon-cancel
ph-icon-remove"></i>'.''.'</a></div>'
.'<div class="ph-cb ph-pad-b"></div>';
$o .= '</div>';
$o .= '<div class="col-xs-12 col-sm-6
col-md-6">';
$o .= '</div>';
$o .= '</div>';
$o .= '</div>';
$o .= '<div
class="ph-cb"></div>'."\n";
return $o;
}
public function modalWindow($id, $link, $textButton) {
// Add javascript for additional images
// Specific case for additional images
// In case we have more than one "select image form input" and
the additional form inputs are made by javascript
// we need to differentiate between them - the field id for each form
input
// phRowImage is a variable set when clicking select button for
additional images
//$link =
'index.php?option=com_phocacart&view=phocacartmanager'.$group['c'].$managerOutput.'&field='.$this->id
. '\'+ (phRowImage) +\'';
$html = array();
$html[] = Joomla\CMS\HTML\HTMLHelper::_(
'bootstrap.renderModal',
$id,
array(
'url' => $link,
'title' => JText::_($textButton),
'width' => '700px',
'height' => '400px',
'modalWidth' => '80',
'bodyHeight' => '70',
'footer' => '<button type="button"
class="btn" data-dismiss="modal"
aria-hidden="true">'
. JText::_('COM_PHOCACART_CLOSE') .
'</button>'
)
);
return implode("\n", $html);
}
public function modalWindowDynamic($id, $textButton, $w = 700, $h = 400,
$reload = false, $autoOpen = 0, $iframeLink = '', $iframeClass =
'', $customFooter = '', $pageClass = '') {
$s = array();
if ($customFooter != '') {
$footer = $customFooter;
} else {
$footer = '<button type="button" class="btn"
data-dismiss="modal" aria-hidden="true">' .
JText::_('COM_PHOCACART_CLOSE') . '</button>';
}
// Global Close
//if ($autoOpen == 1) {
$s[] = 'window.phCloseModal = function(){';
$s[] = '
jQuery("#'.$id.'").modal(\'hide\');';
$s[] = '}';
$s[] = ' ';
//}
$s[] = 'jQuery(document).ready(function() {';
if ($autoOpen == 1) {
$s[] = '
jQuery("#'.$id.'").modal("show");';
$s[] = '
jQuery("#'.$id.'").on("shown", function()
{';
} else {
$s[] = ' jQuery(document.body).on(\'click\',
\'.'.$id.'ModalButton\' ,function(e) {';
$s[] = ' var src =
jQuery(this).attr(\'data-src\');';
// Specific case for downloadable files - they need to include token
folder like product has (product and attribute download files are stored in
one folder)
if ($id == 'phFileDownloadNameModalO') {
// Get value from each row not from main
$s[] = ' var idFolder = \'#\' +
jQuery(this).attr(\'data-id-folder\');';
$s[] = ' var phDownloadFolder =
jQuery(idFolder).val();';
$s[] = ' src = src + "&folder=" +
phDownloadFolder + "&downloadfolder=" +
phDownloadFolder;';
}
}
if ($iframeLink != '') {
$s[] = ' var src =
"'.$iframeLink.'";';
$s[] = ' jQuery("iframe").load(function(){';
// Add specific class to body because of making the background
transparent (body in iframe)
$s[] = '
jQuery(this).contents().find("body").addClass("ph-body-iframe");';
// Get information about current page in start wizard and set white
background to all pages larger than 1
// Only first page (page = 0) is different, it has background set in
phocacart.css
if ($pageClass != '') {
$s[] = ' var phPage
=jQuery(this).contents().find(".'.$pageClass.'").data("page");';
$s[] = ' if (phPage > 0) {';
$s[] = ' jQuery("#'.$id.'
.modal-body").css("background",
"#ffffff");';
$s[] = ' }';
}
if ($iframeClass != '') {
// Add specific class to body in iframe - to stylize it easily
$s[] = '
jQuery(this).contents().find("body").addClass("'.strip_tags(htmlspecialchars($iframeClass,
ENT_QUOTES, 'UTF-8')).'");';
}
$s[] = ' });';
}
//$s[] = ' var height =
jQuery(this).attr(\'data-height\') || '.$w.';';
$s[] = ' var height = jQuery(window).height() - 200;';
$s[] = ' var width =
jQuery(this).attr(\'data-width\') || '.$h.';';
$s[] = ' height = height + \'px\';';
$s[] = ' width = width + \'px\';';
$s[] = ' jQuery("#'.$id.'
iframe").attr({\'src\':src, \'height\': height,
\'width\': width});';
//$s[] = ' var maxHeight = jQuery(this).height();';
//$s[] = ' var maxHeightString = \'max-height:\' +
maxHeight + \'px\';';
//$s[] = ' jQuery("#'.$id.'
iframe").attr({\'src\':src, \'height\':
\''.$h.'px\', \'width\': \'auto\',
\'style\' : maxHeightString});';
$s[] = ' });';
if ($reload) {
$s[] =
' jQuery("#'.$id.'").on("hidden",
function () {';
$s[] = ' var phOverlay = jQuery(\'<div
id="phOverlay"><div id="phLoaderFull">
</div></div>\');';
$s[] = ' phOverlay.appendTo(document.body);';
$s[] = '
jQuery("#phOverlay").fadeIn().css("display","block");';
$s[] = ' setTimeout(function(){';
$s[] = ' window.parent.location.reload();';
$s[] = ' },10);';
$s[] = ' });';
}
$s[] = '})';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
$html = array();
$html[] = Joomla\CMS\HTML\HTMLHelper::_(
'bootstrap.renderModal',
$id,
array(
//'url' => $link,
'title' => JText::_($textButton),
'width' => $w.'px',
'height' => $h.'px',
'modalWidth' => '80',
'bodyHeight' => '70',
'footer' => $footer
),
'<iframe frameborder="0"></iframe>'
);
return implode("\n", $html);
/* Row
$o .= ' <a href="#'.$idA.'"
role="button" class="btn btn-primary
'.$idA.'ModalButton" data-toggle="modal"
title="' . JText::_($textButton) . '"
data-src="'.$url.$id.'"
data-height="'.$h.'"
data-width="'.$w.'">'
. '<span class="icon-list icon-white"></span>
'
. JText::_($textButton) . '</a></span>';
*/
}
public static function renderWizardButton($type = 'enable',
$idMd = '', $url = '', $w = '', $h =
'') {
$s = PhocacartRenderStyle::getStyles();
$paramsC = PhocacartUtils::getComponentParameters();
$enable_wizard = $paramsC->get( 'enable_wizard', 1 );
// We have two evens when clicking on start wizard button
// Only applies to start wizard not on back wizard as this is not ajaxed
- so controller will switch on the info
$id = 'phStardWizdard'; // wizard will be enabled in system -
in options, so other parts of website know it
$class = 'btn btn-small btn-warning
'.$idMd.'ModalButton';// modal window with wizard will be
popuped
if ($type == 'back' && $enable_wizard > 0) {
// BACK TO WIZARD (can be called everywhere)
$bar = JToolbar::getInstance( 'toolbar' );
$dhtml = '<button
onclick="Joomla.submitbutton(\'phocacartwizard.backtowizard\');"
class="btn btn-small btn-warning">
<span id="ph-icon-wizard" class="icon-dummy
'.$s['i']['edit'].'
ph-icon-wizard"></span>'.JText::_('COM_PHOCACART_BACK_TO_WIZARD').'</button>';
$bar->appendButton('Custom', $dhtml, 'wizard');
} else if ($type == 'start') {
// START WIZARD (can be called only in control panel) - to start in
ohter place, back to wizard format needs to be copied
// this button is starded by javascript in function modalWindowDynamic
libraries\phocacart\render\adminview.php
$bar = JToolbar::getInstance( 'toolbar' );
$dhtml = '<button id="'.$id.'"
class="'.$class.'"
data-target="#'.$idMd.'" data-toggle="modal"
data-src="'.$url.'"
data-width="'.$w.'"
data-heigth="'.$h.'">
<span id="ph-icon-wizard" class="icon-dummy
'.$s['i']['edit'].'
ph-icon-wizard"></span>'.JText::_('COM_PHOCACART_START_WIZARD').'</button>';
$bar->appendButton('Custom', $dhtml, 'wizard');
// We have displayed the modal with wizard
// but we need to enable it in system so if we go from wizad to each
task, it is enabled
$urlAjaxEnableWizard =
'index.php?option=com_phocacart&task=phocacartwizard.enablewizard&format=json&'.
JSession::getFormToken().'=1';
PhocacartRenderAdminjs::renderAjaxDoRequestWizardController($urlAjaxEnableWizard,
$id, false);
}
}
}
?>
PK�"�[w��Sz7z7)libraries/phocacart/render/adminviews.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined('_JEXEC') or die('Restricted access');
use Phoca\Render\Adminviews;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
class PhocacartRenderAdminviews extends Adminviews
{
public $view = '';
public $viewtype = 1;
public $option = '';
public $optionLang = '';
public $tmpl = '';
public $compatible = false;
public $sidebar = true;
public function __construct() {
switch($this->view) {
case 'phocacartcart':
$this->viewtype = 2;// Edit
break;
default:
$this->viewtype = 1;// Lists
break;
}
parent::__construct();
}
public function startMainContainer($id = 'phAdminView',
$class = 'ph-admin-box') {
$idO = '';
if ($id != '') {
$idO = ' id="' . $id . '"';
}
$classO = ' class="row"';
if ($class != '') {
$classO = ' class="row ' . $class .
'"';
}
$o = array();
if ($this->compatible) {
if ($this->sidebar) {
} else {
$o[] = '<div' . $idO . $classO .
'>';
$o[] = '<div id="j-sidebar-container"
class="col-md-2">' . JHtmlSidebar::render() .
'</div>';
$o[] = '<div id="j-main-container"
class="col-md-10">';
}
} else {
$o[] = '<div' . $idO . $classO .
'>';
//$o[] = '<div id="j-sidebar-container"
class="span2">' . JHtmlSidebar::render() .
'</div>'."\n";
$o[] = '<div class="col-xs-12 col-sm-2 col-md-2
ph-admin-box-menu">' . JHtmlSidebar::render() .
'</div>';
//$o[] = '<div id="j-main-container"
class="span10">'."\n";
$o[] = '<div id="j-main-container"
class="col-xs-12 col-sm-10 col-md-10 ph-admin-box-content
ph-admin-manage">' . "\n";
$o[] = '<div
id="ph-system-message-container"></div>' .
"\n";// specific container for moving messages from joomla to
phoca
$this->moveSystemMessageFromJoomlaToPhoca();
}
return implode("\n", $o);
}
public function endMainContainer() {
$o = array();
$o[] = '</div>';
$o[] = '</div>';
return implode("\n", $o);
}
public function startMainContainerNoSubmenu() {
//return '<div id="j-main-container"
class="col-xs-12 col-sm-10 col-md-10">'. "\n";
$o = '<div id="j-main-container"
class="col-xs-12 col-sm-12 col-md-12 ph-admin-box-content
ph-admin-manage">' . "\n";
$o .= '<div
id="ph-system-message-container"></div>' .
"\n";// specific container for moving messages from joomla to
phoca
$this->moveSystemMessageFromJoomlaToPhoca();
return $o;
}
/*
public function selectFilterPublished($txtSp, $state) {
return '<div class="btn-group ph-pull-right
ph-select-status">' . "\n"
. '<select name="filter_published"
class="inputbox"
onchange="this.form.submit()">' . "\n"
. '<option value="">' .
JText::_($txtSp) . '</option>'
. HTMLHelper::_('select.options',
HTMLHelper::_('jgrid.publishedOptions',
array('archived' => 0, 'trash' => 0)),
'value', 'text', $state, true)
. '</select></div>' . "\n";
}
public function selectFilterType($txtSp, $type, $typeList) {
return '<div class="btn-group
ph-pull-right">' . "\n"
. '<select name="filter_type"
class="inputbox"
onchange="this.form.submit()">' . "\n"
. '<option value="">' .
JText::_($txtSp) . '</option>'
. HTMLHelper::_('select.options', $typeList,
'value', 'text', $type, true)
. '</select></div>' . "\n";
}
public function selectFilterLanguage($txtLng, $state) {
return '<div class="btn-group
ph-pull-right">' . "\n"
. '<select name="filter_language"
class="inputbox"
onchange="this.form.submit()">' . "\n"
. '<option value="">' .
JText::_($txtLng) . '</option>'
. HTMLHelper::_('select.options',
HTMLHelper::_('contentlanguage.existing', true, true),
'value', 'text', $state)
. '</select></div>' . "\n";
}
public function selectFilterCategory($categoryList, $txtLng, $state) {
$o = '<div class="btn-group ph-pull-right
">' . "\n"
. '<select name="filter_category_id"
class="inputbox"
onchange="this.form.submit()">' . "\n";
if ($txtLng != '') {
$o .= '<option value="">' .
JText::_($txtLng) . '</option>';
}
$o .= HTMLHelper::_('select.options', $categoryList,
'value', 'text', $state)
. '</select></div>' . "\n";
return $o;
}
public function selectFilterParameter($parameterList, $txtLng, $state)
{
$o = '<div class="btn-group ph-pull-right
">' . "\n"
. '<select name="filter_parameter_id"
class="inputbox"
onchange="this.form.submit()">' . "\n";
if ($txtLng != '') {
$o .= '<option value="">' .
JText::_($txtLng) . '</option>';
}
$o .= HTMLHelper::_('select.options', $parameterList,
'value', 'text', $state)
. '</select></div>' . "\n";
return $o;
}
public function selectFilterLevels($txtLng, $state) {
$levelList = array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5
=> 5);
return
'<div class="btn-group
ph-pull-right">' . "\n"
. '<select name="filter_level"
class="inputbox"
onchange="this.form.submit()">' . "\n"
. '<option value="">' .
JText::_($txtLng) . '</option>'
. HTMLHelper::_('select.options', $levelList,
'value', 'text', $state)
. '</select></div>' . "\n";
}
public function selectFilterCountry($countryList, $txtLng, $state) {
return '<div class="btn-group ph-pull-right
">' . "\n"
. '<select name="filter_country_id"
class="inputbox"
onchange="this.form.submit()">' . "\n"
. '<option value="">' .
JText::_($txtLng) . '</option>'
. HTMLHelper::_('select.options', $countryList,
'value', 'text', $state)
. '</select></div>' . "\n";
}
public function selectFilterSection($sectionList, $txtLng, $state) {
return '<div class="btn-group ph-pull-right
">' . "\n"
. '<select name="filter_section_id"
class="inputbox"
onchange="this.form.submit()">' . "\n"
. '<option value="">' .
JText::_($txtLng) . '</option>'
. HTMLHelper::_('select.options', $sectionList,
'value', 'text', $state)
. '</select></div>' . "\n";
}
public function startFilterBar($id = 0) {
if ((int)$id > 0) {
return '<div id="filter-bar' . $id .
'" class="btn-toolbar ph-btn-toolbar-' . $id .
'">' . "\n";
} else {
return '<div id="filter-bar' . $id .
'" class="btn-toolbar">' . "\n";
}
}
public function endFilterBar() {
return '</div>' . "\n" . '<div
class="clearfix"> </div>' . "\n";
}
public function inputFilterSearch($txtSl, $txtSd, $state) {
return '<div class="filter-search btn-group
ph-pull-left">' . "\n"
. '<label for="filter_search"
class="element-invisible">' . JText::_($txtSl) .
'</label>' . "\n"
. '<input type="text"
name="filter_search" placeholder="' . JText::_($txtSd)
. '" id="filter_search"'
. ' value="' . $state . '"
title="' . JText::_($txtSd) . '" />' .
"\n"
. '</div>' . "\n";
}
public function inputFilterUser($txtSl, $txtSd, $state, $userName) {
$o = '<div class="filter-user btn-group
ph-pull-left">' . "\n";
$d = array();
$d['readonly'] = 0;
$d['required'] = 0;
$d['userName'] = $userName;
$d['name'] = 'filter_user';
$d['value'] = (int)$state;
$d['id'] = (int)$state;
$d['class'] = '';
$d['size'] = '';
$d['onchange'] = '';
$layoutU = new JLayoutFile('joomla.form.field.user',
null);
$o .= $layoutU->render($d);
$o .= '</div>' . "\n";
return $o;
}
public function inputFilterSearchClear($txtFs, $txtFc, $clearClass =
array()) {
$clearString = '';
if (!empty($clearClass)) {
foreach ($clearClass as $k => $v) {
//$clearString .=
'document.getElementsByName(\''.$v.'\').value=\'\';';
$clearString .= 'jQuery(\'.' . $v .
'\').val(\'\');';
}
}
return '<div class="btn-group ph-pull-left
">' . "\n"
. '<button class="btn tip hasTooltip"
type="submit" title="' . JText::_($txtFs) .
'"><i
class="icon-search"></i></button>' .
"\n"
. '<button class="btn tip hasTooltip"
type="button" id="phOnClickClear"
onclick="document.getElementById(\'filter_search\').value=\'\';
' . $clearString . 'this.form.submit();"'
. ' title="' . JText::_($txtFc) .
'"><i
class="icon-remove"></i></button>' .
"\n"
. '</div>' . "\n";
}
public function inputFilterSearchLimit($txtSl, $paginationLimitBox) {
return '<div class="btn-group ph-pull-right
">' . "\n"
. '<label for="limit"
class="element-invisible">' . JText::_($txtSl) .
'</label>' . "\n"
. $paginationLimitBox . "\n" .
'</div>' . "\n";
}
public function selectFilterDirection($txtOd, $txtOasc, $txtOdesc,
$listDirn) {
$ascDir = $descDir = '';
if ($listDirn == 'asc') {
$ascDir = 'selected="selected"';
}
if ($listDirn == 'desc') {
$descDir = 'selected="selected"';
}
return '<div class="btn-group ph-pull-right
">' . "\n"
. '<label for="directionTable"
class="element-invisible">' .
JText::_('JFIELD_ORDERING_DESC') . '</label>' .
"\n"
. '<select name="directionTable"
id="directionTable" class="input-medium"
onchange="Joomla.orderTable()">' . "\n"
. '<option value="">' .
JText::_('JFIELD_ORDERING_DESC') . '</option>' .
"\n"
. '<option value="asc" ' . $ascDir .
'>' . JText::_('JGLOBAL_ORDER_ASCENDING') .
'</option>' . "\n"
. '<option value="desc" ' . $descDir .
'>' . JText::_('JGLOBAL_ORDER_DESCENDING') .
'</option>' . "\n"
. '</select>' . "\n"
. '</div>' . "\n";
}
public function selectFilterSortBy($txtSb, $sortFields, $listOrder) {
return '<div class="btn-group
ph-pull-right">' . "\n"
. '<label for="sortTable"
class="element-invisible">' . JText::_($txtSb) .
'</label>' . "\n"
. '<select name="sortTable"
id="sortTable" class="input-medium"
onchange="Joomla.orderTable()">' . "\n"
. '<option value="">' .
JText::_($txtSb) . '</option>' . "\n"
. HTMLHelper::_('select.options', $sortFields,
'value', 'text', $listOrder) . "\n"
. '</select>' . "\n"
. '</div>' . "\n";
}
public function thOrdering($txtHo, $listDirn, $listOrder, $prefix =
'a', $empty = false) {
if ($empty) {
return '<th class="nowrap center
ph-ordering"></th>' . "\n";
}
return '<th class="nowrap center
ph-ordering">' . "\n"
. HTMLHelper::_('searchtools.sort', '<i
class="icon-menu-2"></i>', strip_tags($prefix) .
'.ordering', $listDirn, $listOrder, null, 'asc',
$txtHo) . "\n"
. '</th>';
}
public function formInputs($listOrder, $listDirn, $originalOrders) {
return '<input type="hidden"
name="task" value="" />' . "\n"
. '<input type="hidden"
name="boxchecked" value="0" />' .
"\n"
. '<input type="hidden"
name="filter_order" value="' . $listOrder .
'" />' . "\n"
. '<input type="hidden"
name="filter_order_Dir" value="' . $listDirn .
'" />' . "\n"
. HTMLHelper::_('form.token') . "\n"
. '<input type="hidden"
name="original_order_values" value="' .
implode(',', $originalOrders) . '" />' .
"\n";
}
// Phoca Cart
public function tdImageCart($filename, $size, $manager, $class =
'') {
$thumbnail = PhocacartFileThumbnail::getThumbnailName($filename,
$size, $manager);
if ($class != '') {
$o = '<td class="' . $class .
'">';
} else {
$o = '<td>';
}
if (JFile::exists($thumbnail->abs)) {
//$o .= HTMLHelper::_( 'image', $thumbnail->rel .
'?imagesid='.md5(uniqid(time())), '');
$o .= '<img src="' . JURI::root() .
$thumbnail->rel . '?imagesid=' . md5(uniqid(time())) .
'" />';
}
$o .= '</td>';
return $o;
}
public function headerItems($items, &$options) {
$o = array();
if (!empty($items)) {
foreach ($items as $k => $v) {
if (!isset($v['if']) || (isset($v['if']) &&
$v['if'])) {
$class = PhocacartText::filterValue($v['class'],
'alphanumeric2');
$tool = isset($v['tool']) && $v['tool']
!= '' ? PhocacartText::filterValue($v['tool'],
'alphanumeric5') : '';
$title = Text::_($v['title']);
$column = isset($v['column']) &&
$v['column'] != '' ?
PhocacartText::filterValue($v['column'],
'alphanumeric5') : '';
if ($tool != '') {
$o[] = '<th class="'.$class.'">'
. HTMLHelper::_($tool, $title, $column, $options['listdirn'],
$options['listorder']) . '</th>';
} else {
$o[] = '<th class="'.$class.'">'
. Text::_($title) . '</th>';
}
$options['count']++;
}
}
}
return implode("\n", $o);
}
*/
}
?>
PK�"�[�j�e�e$libraries/phocacart/render/front.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartRenderFront
{
public static function renderNewIcon($date, $size = 1)
{
$app = JFactory::getApplication();
$params = $app->getParams();
$new = $params->get('display_new', 0);
$o = '';
if ($new == 0) {
$o .= '';
} else {
$dateAdded = strtotime($date, time());
$dateToday = time();
$dateExists = $dateToday - $dateAdded;
$dateNew = (int)$new * 24 * 60 * 60;
if ($dateExists < $dateNew) {
$o .= '<div class="ph-corner-icon-wrapper
ph-corner-icon' . $size . '-wrapper"><div
class="ph-corner-icon ph-corner-icon' . $size . '
ph-corner-icon-new">' .
JText::_('COM_PHOCACART_LABEL_TXT_NEW') .
'</div></div>';
}
}
return $o;
}
public static function renderHotIcon($sales, $size = 1)
{
$app = JFactory::getApplication();
$params = $app->getParams();
$hot = $params->get('display_hot', 0);
$o = '';
if ($hot == 0) {
$o .= '';
} else {
if ($sales > $hot || $sales == $hot) {
$o .= '<div class="ph-corner-icon-wrapper
ph-corner-icon' . $size . '-wrapper"><div
class="ph-corner-icon ph-corner-icon' . $size . '
ph-corner-icon-hot">' .
JText::_('COM_PHOCACART_HOT') .
'</div></div>';
}
}
return $o;
}
public static function renderFeaturedIcon($featured, $size = 1)
{
$app = JFactory::getApplication();
$params = $app->getParams();
$feat = $params->get('display_featured',
'');
$o = '';
if ($featured == 0 || $feat == '') {
$o .= '';
} else {
$o .= '<div class="ph-corner-icon-wrapper
ph-corner-icon' . $size . '-wrapper"><div
class="ph-corner-icon ph-corner-icon' . $size . '
ph-corner-icon-featured">' . JText::_($feat) .
'</div></div>';
}
return $o;
}
public static function prepareDocument($document, $params, $category =
false, $item = false, $header = '')
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$menu = $menus->getActive();
$pathway = $app->getPathway();
$title = null;
$metakey = $params->get('cart_metakey', '');
$metadesc = $params->get('cart_metadesc',
'');
$nameInTitle = 1;// TO DO possible parameter Category or Title name
$viewCurrent = $app->input->get('view');
$viewLink = '';
if (isset($menu->query['view'])) {
$viewLink = $menu->query['view'];
}
$type = '';
$name = array();
if (!empty($item) && isset($item->title)) {
$name = $item;
$type = 'item';
} else if (!empty($category) && isset($category->title))
{
$name = $category;
$type = 'category';
}
if ($menu) {
$params->def('page_heading',
$params->get('page_title', $menu->title));
} else {
$params->def('page_heading',
JText::_('JGLOBAL_ARTICLES'));
}
$title = $params->get('page_title', '');
if (isset($name->title) && $name->title !=
'') {
/*if ($title != '') {
$title = $title .' - ' . $name->title;
} else {
$title = $name->title;
}*/
$title = $name->title;
}
if ($viewLink != $viewCurrent && $header != '') {
$title = $header;
} else if (empty($title)) {
$title =
htmlspecialchars_decode($app->get('sitename'));
} else if ($app->get('sitename_pagetitles', 0) == 1) {
$titleInclSiteName = JText::sprintf('JPAGETITLE',
htmlspecialchars_decode($app->get('sitename')), $title);
if ($nameInTitle == 1 && isset($name->title)
&& $name->title != '' && $title !=
$name->title) {
$title = $titleInclSiteName . ' - ' .
$name->title;
} else {
$title = $titleInclSiteName;
}
} else if ($app->get('sitename_pagetitles', 0) == 2) {
if ($nameInTitle == 1 && isset($name->title)
&& $name->title != '') {
if ($title != $name->title) {
$title = $title . ' - ' . $name->title;
}
}
$title = JText::sprintf('JPAGETITLE', $title,
htmlspecialchars_decode($app->get('sitename')));
}
if ($type == 'category' &&
isset($category->metatitle) && $category->metatitle !=
'') {
$title = $category->metatitle;
}
if ($type == 'item' && isset($item->metatitle)
&& $item->metatitle != '') {
$title = $item->metatitle;
}
$document->setTitle($title);
/* if (isset($item->image) && $item->image !=
'') {
$pathItem = PhocacartPath::getPath('productimage');
$thumbnail = PhocacartImage::getThumbnailName($pathItem,
$item->image, 'large');
if (isset($thumbnail->rel)) {
$document->setMetadata('og:image',
JURI::base(true) . '/' .$thumbnail->rel);
}
} else if (isset($category->image) &&
$category->image != '') {
$pathItem = PhocacartPath::getPath('categoryimage');
$document->setMetadata('og:image',
JURI::base(true) . $pathItem['orig_rel_ds']
.$category->image);
}*/
if (isset($item->metadesc) && $item->metadesc !=
'') {
$document->setMetadata('description',
$item->metadesc);
} else if (isset($item->description) &&
strip_tags($item->description) != '') {
$description = str_replace( '<', '
<', $item->description);
$description = strip_tags($description);
$description = preg_replace("/\s\s+/", " ",
$description);
$description = htmlspecialchars(trim($description), ENT_QUOTES
| ENT_SUBSTITUTE, 'UTF-8');
$document->setMetadata('description',
$description);
} else if (isset($item->description_long) &&
strip_tags($item->description_long) != '') {
$description = str_replace( '<', '
<', $item->description_long);
$description = strip_tags($description);
$description = preg_replace("/\s\s+/", " ",
$description);
$description = PhocacartText::truncateText($description, 156,
' ...');// 160 - (" ...")
$description = htmlspecialchars(trim($description), ENT_QUOTES
| ENT_SUBSTITUTE, 'UTF-8');
$document->setMetadata('description',
$description);
} else if (isset($category->metadesc) &&
$category->metadesc != '') {
$document->setMetadata('description',
$category->metadesc);
} else if (isset($category->description) &&
strip_tags($category->description) != '') {
$description = str_replace( '<', '
<', $category->description);
$description = strip_tags($description);
$description = preg_replace("/\s\s+/", " ",
$description);
$description = htmlspecialchars(trim($description), ENT_QUOTES
| ENT_SUBSTITUTE, 'UTF-8');
$document->setMetadata('description',
$description);
} else if ($metadesc != '') {
$document->setDescription($metadesc);
} else if ($params->get('menu-meta_description',
'')) {
$document->setDescription($params->get('menu-meta_description',
''));
}
if (isset($item->metakey) && $item->metakey !=
'') {
$document->setMetadata('keywords',
$item->metakey);
} else if (isset($category->metakey) &&
$category->metakey != '') {
$document->setMetadata('keywords',
$category->metakey);
} else if ($metakey != '') {
$document->setMetadata('keywords', $metakey);
} else if ($params->get('menu-meta_keywords',
'')) {
$document->setMetadata('keywords',
$params->get('menu-meta_keywords', ''));
}
if ($app->get('MetaTitle') == '1' &&
$params->get('menupage_title', '')) {
$document->setMetaData('title',
$params->get('page_title', ''));
}
if (isset($category->metadata)) {
$registry = new JRegistry;
$registry->loadString($category->metadata);
$category->metadata = $registry->toArray();
}
if (isset($item->metadata)) {
$registry = new JRegistry;
$registry->loadString($item->metadata);
$category->metadata = $registry->toArray();
}
if ($type == 'category' &&
isset($category->metadata['robots']) &&
$category->metadata['robots'] != '') {
$document->setMetadata('robots',
$category->metadata['robots']);
}
if ($type == 'item' &&
isset($item->metadata['robots']) &&
$item->metadata['robots'] != '') {
$document->setMetadata('robots',
$item->metadata['robots']);
}
if ($params->get('robots')) {
$document->setMetadata('robots',
$params->get('robots'));
}
// Breadcrumbs TO DO (Add the whole tree)
if ($type == 'category') {
$path = PhocacartCategory::getPath(array(),
(int)$category->id, (int)$category->parent_id, $category->title,
$category->alias);
//$curpath = $pathway->getPathwayNames();
$pathWayIdA = $pathway->getPathway();
$pIdA = array();
if (!empty($pathWayIdA)) {
foreach ($pathWayIdA as $k => $v) {
if (isset($v->link)) {
$parts = parse_url($v->link);
if (isset($parts['query'])) {
parse_str($parts['query'], $query);
if (isset($query['id'])) {
$pIdA[] = (int)$query['id'];
}
}
}
}
}
if (!empty($path)) {
$path = array_reverse($path);
foreach ($path as $k => $v) {
if (!in_array((int)$v['id'], $pIdA)) {
// Don't duplicate breadcrumbs
$pathway->addItem($v['title'],
JRoute::_(PhocacartRoute::getCategoryRoute($v['id'],
$v['alias'])));
//$pathway->addItem($v['title'],
PhocacartRoute::getCategoryRoute($v['id'],
$v['alias']));
}
}
}
/*if (isset($category->parentid)) {
if ($category->parentid == 0) {
// $pathway->addItem(
JText::_('COM_PHOCACART_CATEGORIES'),
JRoute::_(PhocacartRoute::getCategoriesRoute()));
} else if ($category->parentid > 0) {
$curpath = $pathway->getPathwayNames();
$countCurPath = count($curpath)-1;
if(!isset($curpath[$countCurPath]) ||
($category->parenttitle != $curpath[$countCurPath])){
$pathway->addItem($category->parenttitle,
JRoute::_(PhocacartRoute::getCategoryRoute($category->parentid,
$category->parentalias)));
}
}
}*/
/*if (isset($category->title) &&
!empty($category->title)) {
$curpath = $pathway->getPathwayNames();
if( (!empty($curpath) && $category->title !=
$curpath[count($curpath)-1]) || empty($curpath)){
$pathway->addItem($category->title);
}
}*/
} else if ($type == 'item' || $type ==
'question') {
$path = PhocacartCategory::getPath(array(),
(int)$category->id, (int)$category->parent_id, $category->title,
$category->alias);
$pathWayIdA = $pathway->getPathway();
$pIdA = array();
if (!empty($pathWayIdA)) {
foreach ($pathWayIdA as $k => $v) {
if (isset($v->link)) {
$parts = parse_url($v->link);
if (isset($parts['query'])) {
parse_str($parts['query'], $query);
if (isset($query['id'])) {
$pIdA[] = (int)$query['id'];
}
}
}
}
}
if (!empty($path)) {
$path = array_reverse($path);
foreach ($path as $k => $v) {
if (!in_array((int)$v['id'], $pIdA)) {
// Don't duplicate breadcrumbs
$pathway->addItem($v['title'],
JRoute::_(PhocacartRoute::getCategoryRoute($v['id'],
$v['alias'])));
//$pathway->addItem($v['title'],
PhocacartRoute::getCategoryRoute($v['id'],
$v['alias']));
}
}
}
/*$curpath = $pathway->getPathwayNames();
if (!empty($path)) {
$path = array_reverse($path);
foreach ($path as $k => $v) {
$pathway->addItem($v['title'],
JRoute::_(PhocacartRoute::getCategoryRoute($v['id'],
$v['alias'])));
}
}*/
/* if (isset($category->id) &&
isset($category->title) && isset($category->alias)) {
if ($category->id > 0) {
$pathway->addItem($category->title,
JRoute::_(PhocacartRoute::getCategoryRoute($category->id,
$category->alias)));
}
}*/
if (isset($item->title) && !empty($item->title))
{
$pathway->addItem($item->title);
}
} else {
if ($viewCurrent == $viewLink) {
// Don't add anything to pathway as we display the
title from menu link
// for example - comparision view has an menu link, use
menu link title
} else {
// we are e.g. in comparison view but we use a menu link
from categories
// so we need to add comparison header if exists
if ($header != '') {
$pathway->addItem($header);
}
}
}
}
public static function renderHeader($headers = array(), $tag =
'', $imageMeta = '')
{
$app = JFactory::getApplication();
//$menus = $app->getMenu();
//$menu = $menus->getActive();
$p = $app->getParams();
$showPageHeading = $p->get('show_page_heading');
$pageHeading = $p->get('page_heading');
$displayHeader = $p->get('display_header_type',
'h1');
$hideHeader = $p->get('hide_header_view',
array());
if ($displayHeader == '-1') {
return '';
}
$view = $app->input->get('view', '',
'string');
if (!empty($hideHeader) && $view != '') {
if (in_array($view, $hideHeader)) {
return '';
}
}
if ($tag == '') {
$tag = $displayHeader;
}
$h = array();
if ($showPageHeading && $pageHeading != '') {
$h[] = htmlspecialchars($pageHeading);
}
if (!empty($headers)) {
foreach ($headers as $k => $v) {
if ($v != '') {
$h[] = htmlspecialchars($v);
break; // in array there are stored OR items (if empty
try next, if not empty use this and do not try next)
// PAGE HEADING AND NEXT ITEM OR NEXT NEXT ITEM
}
}
}
$imgMetaAttr = '';
if ($imageMeta != '') {
$imgMetaAttr =
'data-image-meta="'.$imageMeta.'"';
}
if (!empty($h)) {
return '<' . strip_tags($tag) . '
class="ph-header" '.$imgMetaAttr.'>' .
implode(" - ", $h) . '</' . strip_tags($tag) .
'>';
} else if ($imgMetaAttr != '') {
return '<div style="display:none;"
'.$imgMetaAttr.'></div>';// use hidden tag for open
graph info
}
return false;
}
/*
* if the message type is "order" then display this error
message only in case there is no other message
*/
public static function renderMessageQueue($msg = '', $type =
'')
{
$app = JFactory::getApplication();
$m = $app->getMessageQueue();
$mO = '';
if (!empty($m)) {
$mO .= '<ul id="system-messages">';
if ($msg != '' && $type != 'order')
{
$mO .= '<li class=" ">' . $msg .
'</li>';
}
foreach ($m as $k => $v) {
// ' alert alert-'.$v['type']
$mO .= '<li class="' .
$v['type'] . '">' . $v['message'] .
'</li>';
}
$mO .= '</ul>';
} else {
$mO .= '<ul id="system-messages">';
$mO .= '<li class="ph-msg-error">' .
$msg . '</li>';
$mO .= '</ul>';
}
return $mO;
}
public static function displayLink($title = '', $url =
'', $target = "_blank")
{
$o = '';
if ($url != '' &&
PhocacartUtils::isURLAddress($url) && $title != '') {
$targetO = $target != '' ? 'target="'
. $target . '"' : '';
$o = '<a href="' . $url . '" '
. $targetO . '>' . $title . '</a>';
} else if ($title != '') {
$o = $title;
}
return $o;
}
public static function displayVideo($url, $view = 0, $ywidth = 0,
$yheight = 0)
{
$o = '';
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$width = $paramsC->get('video_width', 0);
$height = $paramsC->get('video_height', 0);
if ($url != '' &&
PhocacartUtils::isURLAddress($url)) {
$ssl = strpos($url, 'https');
$yLink = 'http://www.youtube.com/v/';
if ($ssl != false) {
$yLink = 'https://www.youtube.com/v/';
}
$shortUrl = 'http://youtu.be/';
$shortUrl2 = 'https://youtu.be/';
$pos = strpos($url, $shortUrl);
$pos2 = strpos($url, $shortUrl2);
if ($pos !== false) {
$code = str_replace($shortUrl, '', $url);
} else if ($pos2 !== false) {
$code = str_replace($shortUrl2, '', $url);
} else {
$codeArray = explode('=', $url);
$code = str_replace($codeArray[0] . '=',
'', $url);
}
if ((int)$ywidth > 0) {
$width = (int)$ywidth;
}
if ((int)$yheight > 0) {
$height = (int)$yheight;
}
$attr = '';
if ((int)$width > 0) {
$attr .= ' width="' . (int)$width .
'"';
}
if ((int)$height > 0) {
$attr .= ' height="' . (int)$height .
'"';
}
$o .= '<div
class="ph-video-container">';
$o .= '<iframe ' . $attr . '
src="https://www.youtube.com/embed/' . $code .
'"></iframe>';
$o .= '</div>';
/*$o .= '<object
height="'.(int)$height.'"
width="'.(int)$width.'"
data="http://www.youtube.com/v/'.$code.'"
type="application/x-shockwave-flash">'
.'<param name="movie"
value="http://www.youtube.com/v/'.$code.'" />'
.'<param name="allowFullScreen"
value="true" />'
.'<param name="allowscriptaccess"
value="always" />'
.'<embed src="'.$yLink.$code.'"
type="application/x-shockwave-flash"
allowscriptaccess="always" allowfullscreen="true"
height="'.(int)$height.'"
width="'.(int)$width.'" /></object>';*/
}
return $o;
}
public static function getLayoutType($layoutType)
{
if ($layoutType == 'list') {
return 'list';
} else if ($layoutType == 'gridlist') {
return 'gridlist';
} else {
// Else is important, don't show any other types
return 'grid';
}
}
public static function setActiveLayoutType($layoutType)
{
$activeLT[0] = $activeLT[1] = $activeLT[2] = '';
switch ($layoutType) {
case 'grid':
$activeLT[0] = 'active';
break;
case 'gridlist':
$activeLT[1] = 'active';
break;
case 'list':
$activeLT[2] = 'active';
break;
}
return $activeLT;
}
public static function getColumnClass($column)
{
return 12 / $column;//1,2,3,4,6,12
}
public static function getLabel($date, $sales, $featured)
{
$label = array();
$new = $hot = $feat = '';
$c = 1;
$label['new'] = self::renderNewIcon($date, $c);
if ($label['new'] != '') {
$c++;
}
$label['hot'] = self::renderHotIcon($sales, $c);
if ($label['hot'] != '') {
$c++;
}
$label['feat'] = self::renderFeaturedIcon($featured, $c);
$label['cssthumbnail'] = '';
$label['cssthumbnail2'] = 'img-thumbnail';
if ($c > 1) {
$label['cssthumbnail'] = 'b-thumbnail';
$label['cssthumbnail2'] = '';
}
return $label;
}
public static function getLinkedTitle($link, $item, $route =
'item')
{
if ($link == 1) {
if ($route == 'item') {
return '<a href="' .
JRoute::_(PhocacartRoute::getItemRoute($item->id, $item->catid,
$item->alias, $item->catalias)) . '">' .
$item->title . '</a>';
} else if ($route == 'category') {
return '<a href="' .
JRoute::_(PhocacartRoute::getCategoryRoute($item->id, $item->alias))
. '">' . $item->title . '</a>';
}
} else {
return $item->title;
}
return '';
}
public static function renderProductHeader($link, $v, $route =
'item', $tag = '', $additionalClass = '')
{
$app = JFactory::getApplication();
$p = $app->getParams();
$displayHeader = $p->get('display_product_header',
'h3');
if ($displayHeader == '-1') {
return '';
}
if ($tag == '') {
$tag = $displayHeader;
}
$header = PhocacartRenderFront::getLinkedTitle($link, $v, $route);
return '<' . strip_tags($tag) . '
class="ph-product-header ' . strip_tags($additionalClass) .
'">' . $header . '</' . strip_tags($tag) .
'>';
}
public static function renderCategoryHeader($link, $v, $route =
'category', $tag = '', $additionalClass = '')
{
$app = JFactory::getApplication();
$p = $app->getParams();
$displayHeader = $p->get('display_category_header',
'h3');
if ($displayHeader == '-1') {
return '';
}
if ($tag == '') {
$tag = $displayHeader;
}
$header = PhocacartRenderFront::getLinkedTitle($link, $v, $route);
return '<' . strip_tags($tag) . '
class="ph-category-header ' . strip_tags($additionalClass) .
'">' . $header . '</' . strip_tags($tag) .
'>';
}
public static function renderArticle($id, $format = 'html',
$default = '', $changeLang = 0)
{
$o = '';
if ((int)$id > 0) {
$db = JFactory::getDBO();
$query = 'SELECT a.introtext, a.fulltext FROM #__content
AS a WHERE id = ' . (int)$id;
$db->setQuery((string)$query);
$a = $db->loadObject();
$o = $a->introtext . $a->fulltext;
// Disable emailclock for PDF | MAIL
if ($format == 'pdf' || $format == 'mail')
{
$o = '{emailcloak=off}' . $o;
}
$o = Joomla\CMS\HTML\HTMLHelper::_('content.prepare',
$o);
if ($changeLang == 1) {
JPluginHelper::importPlugin('system');
JPluginHelper::importPlugin('plgSystemMultilanguagesck');
\JFactory::getApplication()->triggerEvent('onChangeText',
array(&$o));
}
if ($format == 'pdf' || $format == 'text')
{
// Remove Javascript for PDF
$o =
preg_replace('/<script\b[^>]*>(.*?)<\/script>/is',
"", $o);
// Remove mailto - problematic for TCPDF
$o =
preg_replace("~<a\s+href=[\'|\"]mailto:(.*?)[\'|\"].*?>.*?</a>~",
"$1", $o);
}
if ($format == 'text') {
$o = PhocacartText::filterValue($o, 'text');
}
}
// If no text is set by article and there is default value
if ($o == '' && $default != '') {
return $default;
}
return $o;
}
public static function getConfirmOrderText($orderValue = 0)
{
$cFT = JText::_('COM_PHOCACART_CONFIRM_ORDER');
$app = JFactory::getApplication();
$p = $app->getParams();
$confirm_order_text = $p->get('cofirm_order_text',
'');
$confirm_order_text_zero =
$p->get('cofirm_order_text_zero', '');
if ($confirm_order_text != '' && $orderValue >
0) {
$cFT = JText::_($confirm_order_text);
}
if ($confirm_order_text_zero != '' && $orderValue
== 0) {
$cFT = JText::_($confirm_order_text_zero);
}
return $cFT;
}
public static function completeClass($items = array())
{
if (!empty($items)) {
return implode(' ', $items);
}
return '';
}
}
PK�"�[�t;d��#libraries/phocacart/render/icon.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
/*
*
* DEPRECATED CLASS - WILL BE REMOVED in Joomla! 4
* @deprecated use $s = PhocacartRenderStyle::getStyles(); -->
$s['i']['icon-name'] instead
*/
class PhocacartRenderIcon
{
private static $iconType = '';
private static $i = 0;
/*
* @deprecated
*/
private function __construct(){}
/*
* @deprecated
*/
public static function getClassAdmin($name = '') {
if ($name != ''){
return 'glyphicon glyphicon-'.$name;
}
return '';
}
/*
* @deprecated
*/
public static function getIconType() {
if( self::$iconType == '' ) {
$pC = PhocacartUtils::getComponentParameters();
$pos = PhocacartPos::isPos();
if ($pos) {
self::$iconType = 'bs';
} else {
self::$iconType = $pC->get( 'icon_type',
'bs' );
}
}
return self::$iconType;
}
/*
* @deprecated
*/
public static function getClass( $name = '') {
self::$i++;
if( self::$iconType == '' ) {
$pC = PhocacartUtils::getComponentParameters();
$pos = PhocacartPos::isPos();
if ($pos) {
self::$iconType = 'bs';
} else {
self::$iconType = $pC->get( 'icon_type',
'bs' );
}
}
switch (self::$iconType) {
case 'fa':
$iconP = 'fa fa-';
$iconS = ' fa-fw';
$iconA = array(
'view-category' => 'search',
'view-product' => 'search',
'back-category' => 'arrow-left',
'ok' => 'check',
'not-ok' => 'remove',
'remove' => 'remove',
'clear' => 'remove',
'edit' => 'edit',
'plus' => 'plus',
'minus' => 'minus',
'chevron-up' => 'chevron-up',
'chevron-down' => 'chevron-down',
'shopping-cart' => 'shopping-bag',
'question-sign' => 'question-circle',
'info-sign' => 'info-circle',
'compare' => 'clone',
'ext-link' => 'share',
'int-link' => 'share-alt',
'download' => 'download',
'quick-view' => 'eye',
'wish-list' => 'heart',
'ban' => 'ban',
'refresh' => 'refresh',
'trash' => 'trash',
'triangle-bottom' => 'caret-down',
'triangle-right' => 'caret-right',
'save' => 'save',
'user' => 'user',
'grid' => 'th-large',
'gridlist' => 'th-list',
'list' => 'align-justify',
'next' => 'arrow-right',
'prev' => 'arrow-left',
'submit' => 'ok',
'invoice' => 'list-alt fa-file-invoice-dollar',
'del-note' => 'barcode fa-file-invoice',
'order' => 'search fa-file-alt',
'receipt' => 'th-list fa-receipt',
'print' => 'print',
'barcode' => 'barcode',
'search' => 'search',
'payment-method' => 'credit-card',
'shipping-method' => 'barcode',
'log-out' => 'sign-out-alt',
'calendar' => 'calendar'
);
break;
case 'bs':
default:
$iconP = 'glyphicon glyphicon-';
$iconS = '';
$iconA = array(
'view-category' => 'search',
'view-product' => 'search',
'back-category' => 'arrow-left',
'ok' => 'ok',
'not-ok' => 'remove',
'remove' => 'remove',
'clear' => 'remove',
'edit' => 'edit',
'plus' => 'plus',
'minus' => 'minus',
'chevron-up' => 'chevron-up',
'chevron-down' => 'chevron-down',
'shopping-cart' => 'shopping-cart',
'question-sign' => 'question-sign',
'info-sign' => 'info-sign',
'compare' => 'stats',
'ext-link' => 'share',
'int-link' => 'share-alt',
'download' => 'download',
'quick-view' => 'eye-open',
'wish-list' => 'heart',
'ban' => 'ban-circle',
'refresh' => 'refresh',
'trash' => 'trash',
'triangle-bottom' => 'triangle-bottom',
'triangle-right' => 'triangle-right',
'save' => 'floppy-disk',
'user' => 'user',
'grid' => 'th-large',
'gridlist' => 'th-list',
'list' => 'align-justify',
'next' => 'arrow-right',
'prev' => 'arrow-left',
'submit' => 'ok',
'invoice' => 'list-alt',
'del-note' => 'barcode',
'order' => 'search',
'receipt' => 'th-list',
'print' => 'print',
'barcode' => 'barcode',
'search' => 'search',
'payment-method' => 'credit-card',
'shipping-method' => 'barcode',
'log-out' => 'arrow-left',
'calendar' => 'calendar'
);
break;
}
if (isset($iconA[$name]) && $iconA[$name] != '') {
return $iconP . $iconA[$name] . $iconS;
} else {
return $iconP . htmlspecialchars(strip_tags($name)) . $iconS;
}
}
/*
* @deprecated
*/
public final function __clone() {
throw new Exception('Function Error: Cannot clone instance of
Singleton pattern', 500);
return false;
}
}
?>
PK�"�[�#o,,%libraries/phocacart/render/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[C���!libraries/phocacart/render/js.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined('_JEXEC') or die();
final class PhocacartRenderJs
{
private function __construct() { }
public static function renderAjaxAddToCart() {
$paramsC = PhocacartUtils::getComponentParameters();
$add_cart_method = $paramsC->get('add_cart_method',
0);
// We need to refresh checkout site when AJAX used for removing or
adding products to cart
$task = 'checkout.add';
$class = '.phItemCartBox';
$cView = PhocacartUtils::isView('checkout') ? 1 : 0;
// POS
$isPOS = false;
if (PhocacartUtils::isView('pos')) {
$task = 'pos.add';
$add_cart_method = 1;// POS has always 1 (ajax and no popup)
$cView = 0;
$class = '.phPosCartBox';
$isPOS = true;
}
if ($add_cart_method == 0) {
return false;
}
if ($add_cart_method > 0) {
$urlAjax = JURI::base(true) .
'/index.php?option=com_phocacart&task=' . $task .
'&format=json&' . JSession::getFormToken() .
'=1&checkoutview=' . (int)$cView;
$s = array();
$s[] = 'function phDoSubmitFormAddToCart(sFormData)
{';
$s[] = ' var phUrl = "' . $urlAjax .
'";';
$s[] = ' var phOptions = [];';
$s[] = ' phOptions["view"] = ' .
(int)$cView . ';';
$s[] = ' phOptions["method"] = ' .
(int)$add_cart_method . ';';
$s[] = ' phOptions["task"] =
"add";';
$s[] = ' phOptions["type"] =
"cart";';
$s[] = ' phOptions["class"] = "' .
$class . '";';
$s[] = $isPOS === true ? ' phOptions["pos"] =
1;' : ' phOptions["pos"] = 0;';
$s[] = ' phDoRequestMethods(phUrl, sFormData,
phOptions);';
$s[] = '}';
$s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
/*$s[] = ' phRequest = jQuery.ajax({';
$s[] = ' type: "POST",';
$s[] = ' url: phUrl,';
$s[] = ' async: "false",';
$s[] = ' cache: "false",';
$s[] = ' data: sFormData,';
$s[] = ' dataType:"JSON",';
$s[] = ' success: function(data){';
$s[] = ' if (data.status == 1){';
$s[] = '
jQuery("'.$class.'").html(data.item);';
$s[] = '
jQuery("'.$class.'Count").html(data.count);';
$s[] = '
jQuery("'.$class.'Total").html(data.total); ';
// POS update message box (clean) and input box (when product
added or changed - shipping and payment method must be cleaned)
if (PhocacartUtils::isView('pos')) {
$s[] = ' var phUrlPos =
phAddSuffixToUrl(window.location.href, \'format=raw\');';
$s[] = ' var phDataInput =
phPosCurrentData("main.input");';
$s[] = ' phDoSubmitFormUpdateInputBox(phDataInput,
phUrlPos);';// refresh input box
$s[] =
' jQuery(".ph-pos-message-box").html(data.message);';//
clear message box
$s[] = ' phPosManagePage();';
}
if ($add_cart_method == 2) {
$s[] = '
jQuery("body").append(jQuery("#phContainer"));';
$s[] = '
jQuery("#phContainer").html(data.popup);';
$s[] = '
jQuery("#phAddToCartPopup").modal();';
}
if ($add_cart_method == 1) {
// If no popup is displayed we can relaod the page when we
are in comparison page
// If popup, this will be done when clicking continue or
comparison list
$s[] = ' if (phCheckoutView == 1) {';
$s[] = ' setTimeout(function()
{location.reload();}, 0001);';
$s[] = ' }';
}
$s[] = ' } else if (data.status == 0){';
if ($add_cart_method != 2) {
$s[] = '
jQuery(".phItemCartBox").html(data.error);';
}
if ($add_cart_method == 2) {
$s[] = '
jQuery("body").append(jQuery("#phContainer"));';
$s[] = '
jQuery("#phContainer").html(data.popup);';
$s[] = '
jQuery("#phAddToCartPopup").modal();';
}
if ($add_cart_method == 1) {
// If no popup is displayed we can relaod the page when we
are in comparison page
// If popup, this will be done when clicking continue or
comparison list
$s[] = ' if (phCheckoutView == 1) {';
$s[] = ' setTimeout(function()
{location.reload();}, 0001);';
$s[] = ' }';
}
// POS update message box (clean) and input box (when product
added or changed - shipping and payment method must be cleaned)
if (PhocacartUtils::isView('pos')) {
//$s[] = ' var phUrlPos =
phAddSuffixToUrl(window.location.href, \'format=raw\');';
//$s[] = ' var phDataInput =
phPosCurrentData("main.input");';
//$s[] = ' phDoSubmitFormUpdateInputBox(phDataInput,
phUrlPos);';// refresh input box
$s[] =
' jQuery(".ph-pos-message-box").html(data.error);';//
clear message box
$s[] = ' phPosManagePage();';
}
$s[] = ' } else {';
//$s[] = ' // Don\'t change the price box';
$s[] = ' }';
$s[] = ' },';
//$s[] = ' error: function(data){}';
$s[] = ' })';
$s[] = ' return false;';
$s[] = '}';
$s[] = ' ';
// :: EVENT (CLICK) Category/Items View (icon/button -
ajax/standard)
//$s[] = 'function phEventClickFormAddToCart(phFormId)
{';
//$s[] = ' var phForm = \'#\' +
phFormId;';
//$s[] = ' var sForm =
jQuery(this).closest("form");';// Find in which form the
right button was clicked
//$s[] = ' var sFormData =
jQuery(phForm).serialize();';
//$s[] = ' phDoSubmitFormAddToCart(sFormData);';
//$s[] = '}';
// Set it onclick as it is used in even not ajax submitting
//$s[] = 'function phEventClickFormAddToCart(phFormId)
{';
//$s[] = ' var phForm = \'#\' +
phFormId;';
//$s[] = '
jQuery(\'phFormId\').find(\':submit\').click();"';
//$s[] = ' return false;';
//$s[] = '}';
$s[] = ' ';
// :: EVENT (SUBMIT) Item View
$s[] = 'jQuery(document).ready(function(){';
//$s[] =
' jQuery(".phItemCartBoxForm").on(\'submit\',
function (e) {';// Not working when form is added by ajax
$s[] = ' jQuery(document).on("submit",
"form.phItemCartBoxForm", function (e) {';// Works with
forms added by ajax
$s[] = ' e.preventDefault();';
$s[] = ' var sFormData =
jQuery(this).serialize();';
$s[] = ' phDoSubmitFormAddToCart(sFormData);';
$s[] = ' })';
$s[] = '})';
$s[] = ' ';*/
}
}
public static function renderAjaxUpdateCart() {
$paramsC = PhocacartUtils::getComponentParameters();
$add_cart_method = $paramsC->get('add_cart_method',
0);
// We need to refresh checkout site when AJAX used for removing or
adding products to cart
$task = 'checkout.update';
$class = '.phCheckoutCartBox';
$cView = PhocacartUtils::isView('checkout') ? 1 : 0;
// POS
$isPOS = false;
if (PhocacartUtils::isView('pos')) {
$task = 'pos.update';
$add_cart_method = 1;// POS has always 1 (ajax and no popup)
$cView = 0;
$class = '.phPosCartBox';
$isPOS = true;
}
$urlAjax = JURI::base(true) .
'/index.php?option=com_phocacart&task=' . $task .
'&format=json&' . JSession::getFormToken() .
'=1&checkoutview=' . (int)$cView;
$s = array();
$s[] = 'function phDoSubmitFormUpdateCart(sFormData) {';
$s[] = ' var phUrl = "' . $urlAjax .
'";';
$s[] = ' var phOptions = [];';
$s[] = ' phOptions["view"] = ' . (int)$cView .
';';
$s[] = ' phOptions["method"] = ' .
(int)$add_cart_method . ';';
$s[] = ' phOptions["task"] =
"update";';
$s[] = ' phOptions["type"] =
"cart";';
$s[] = ' phOptions["class"] = "' . $class
. '";';
$s[] = $isPOS === true ? ' phOptions["pos"] =
1;' : ' phOptions["pos"] = 0;';
$s[] = ' phDoRequestMethods(phUrl, sFormData,
phOptions);';
$s[] = '}';
$s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
/*
$s[] = ' phRequest = jQuery.ajax({';
$s[] = ' type: "POST",';
$s[] = ' url: phUrl,';
$s[] = ' async: "false",';
$s[] = ' cache: "false",';
$s[] = ' data: sFormData,';
$s[] = ' dataType:"JSON",';
$s[] = ' success: function(data){';
$s[] = ' if (data.status == 1){';
$s[] = '
jQuery("'.$class.'").html(data.item);';
$s[] = '
jQuery("'.$class.'Count").html(data.count);';
$s[] = '
jQuery("'.$class.'Total").html(data.total); ';
// POS update message box (clean) and input box (when
product added or changed - shipping and payment method must be cleaned)
if (PhocacartUtils::isView('pos')) {
$s[] = ' var phUrlPos =
phAddSuffixToUrl(window.location.href, \'format=raw\');';
$s[] = ' var phDataInput =
phPosCurrentData("main.input");';
$s[] =
' phDoSubmitFormUpdateInputBox(phDataInput, phUrlPos);';//
refresh input box
$s[] =
' jQuery(".ph-pos-message-box").html(data.message);';//
clear message box
$s[] = ' phPosManagePage();';
}
// If no popup is displayed we can relaod the page when we
are in comparison page
// If popup, this will be done when clicking continue or
comparison list
//$s[] = ' if (phCheckoutView == 1)
{';
//$s[] = ' setTimeout(function()
{location.reload();}, 0001);';
//$s[] = ' }';
$s[] = ' } else if (data.status == 0){';
// If no popup is displayed we can relaod the page when we
are in comparison page
// If popup, this will be done when clicking continue or
comparison list
//$s[] = ' if (phCheckoutView == 1)
{';
//$s[] = ' setTimeout(function()
{location.reload();}, 0001);';
//$s[] = ' }';
$s[] = '
jQuery("body").append(jQuery("#phContainer"));';
$s[] = '
jQuery("#phContainer").html(data.popup);';
$s[] = '
jQuery("#phAddToCartPopup").modal();';
$s[] = ' } else {';
//$s[] = ' // Don\'t change the price
box';
$s[] = ' }';
$s[] = ' },';
//$s[] = ' error: function(data){}';
$s[] = ' })';
$s[] = ' return false;';
$s[] = '}';
$s[] = ' ';
// ::EVENT (CLICK) Change Layout Type Clicking on Grid,
Gridlist, List
$s[] = 'jQuery(document).ready(function(){';
$s[] = ' jQuery(document).on("click",
"form.phItemCartUpdateBoxForm button", function (e) {';
$s[] = ' e.preventDefault();';
$s[] = ' var sForm =
jQuery(this).closest("form");';// Find in which form the
right button was clicked
$s[] = ' var phAction= jQuery(this).val()';
$s[] = ' var sFormData = sForm.serialize() +
"&action=" + phAction;';
$s[] = '
phDoSubmitFormUpdateCart(sFormData);';
$s[] = ' })';
$s[] = '})';
$s[] = ' ';*/
//$s[] = '}';
}
public static function renderAjaxAddToCompare() {
$paramsC = PhocacartUtils::getComponentParameters();
$add_compare_method =
$paramsC->get('add_compare_method', 0);
// We need to refresh comparison site when AJAX used for removing
or adding products to comparison list
$app = JFactory::getApplication();
$view = $app->input->get('view', '');
$option = $app->input->get('option',
'');
$cView = $option == 'com_phocacart' && $view ==
'comparison' ? 1 : 0;
if ($add_compare_method == 0) {
return false;
}
if ($add_compare_method > 0) {
$urlAjax = JURI::base(true) .
'/index.php?option=com_phocacart&task=comparison.add&format=json&'
. JSession::getFormToken() . '=1&comparisonview=' .
(int)$cView;
$s = array();
$s[] = 'function phItemCompareBoxFormAjax(phItemId)
{';
$s[] = ' var phUrl = "' . $urlAjax .
'";';
$s[] = ' var phItem = \'#\' + phItemId;';
$s[] = ' var phOptions = [];';
$s[] = ' phOptions["view"] = ' .
(int)$cView . ';';
$s[] = ' phOptions["method"] = ' .
(int)$add_compare_method . ';';
$s[] = ' phOptions["task"] =
"add";';
$s[] = ' phOptions["type"] =
"compare";';
$s[] = ' var phData = jQuery(phItem).serialize();';
$s[] = ' phDoRequestMethods(phUrl, phData,
phOptions);';
$s[] = '}';
$s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
/*$s[] = ' ';
$s[] = ' phRequest = jQuery.ajax({';
$s[] = ' type: "POST",';
$s[] = ' url: phUrl,';
$s[] = ' async: "false",';
$s[] = ' cache: "false",';
$s[] = ' data: phData,';
$s[] = ' dataType:"JSON",';
$s[] = ' success: function(data){';
$s[] = ' if (data.status == 1){';
$s[] =
' jQuery(".phItemCompareBox").html(data.item);';
$s[] =
' jQuery(".phItemCompareBoxCount").html(data.count);';
if ($add_compare_method == 2) {
$s[] = '
jQuery("body").append(jQuery("#phContainer"));';
$s[] = '
jQuery("#phContainer").html(data.popup);';
$s[] = '
jQuery("#phAddToComparePopup").modal();';
}
if ($add_compare_method == 1) {
// If no popup is displayed we can relaod the page when we
are in comparison page
// If popup, this will be done when clicking continue or
comparison list
$s[] = ' if (phComparisonView == 1) {';
$s[] = self::renderOverlay();
$s[] = ' setTimeout(function()
{location.reload();}, 0001);';
$s[] = ' }';
}
$s[] = ' } else {';
//$s[] = ' // Don\'t change the price box';
$s[] = ' }';
$s[] = ' }';
$s[] = ' })';
//$s[] = ' e.preventDefault();';
//$s[] = ' return false;';*/
}
}
public static function renderAjaxRemoveFromCompare() {
$paramsC = PhocacartUtils::getComponentParameters();
$add_compare_method =
$paramsC->get('add_compare_method', 0);
// We need to refresh comparison site when AJAX used for removing
or adding products to comparison list
$app = JFactory::getApplication();
$view = $app->input->get('view', '');
$option = $app->input->get('option',
'');
$cView = $option == 'com_phocacart' && $view ==
'comparison' ? 1 : 0;
if ($add_compare_method == 0) {
return false;
}
if ($add_compare_method > 0) {
$urlAjax = JURI::base(true) .
'/index.php?option=com_phocacart&task=comparison.remove&format=json&'
. JSession::getFormToken() . '=1&comparisonview=' .
(int)$cView;
$s = array();
$s[] = ' ';
$s[] = 'function phItemRemoveCompareFormAjax(phItemId)
{';
$s[] = ' var phUrl = "' . $urlAjax .
'";';
$s[] = ' var phItem = \'#\' + phItemId;';
$s[] = ' var phOptions = [];';
$s[] = ' phOptions["view"] = ' .
(int)$cView . ';';
$s[] = ' phOptions["method"] = ' .
(int)$add_compare_method . ';';
$s[] = ' phOptions["task"] =
"remove";';
$s[] = ' phOptions["type"] =
"compare";';
$s[] = ' var phData = jQuery(phItem).serialize();';
$s[] = ' phDoRequestMethods(phUrl, phData,
phOptions);';
$s[] = '}';
$s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
/*$s[] = ' ';
$s[] = ' phRequest = jQuery.ajax({';
$s[] = ' type: "POST",';
$s[] = ' url: phUrl,';
$s[] = ' async: "false",';
$s[] = ' cache: "false",';
$s[] = ' data: phData,';
$s[] = ' dataType:"JSON",';
$s[] = ' success: function(data){';
$s[] = ' if (data.status == 1){';
$s[] =
' jQuery(".phItemCompareBox").html(data.item);';
$s[] =
' jQuery(".phItemCompareBoxCount").html(data.count);';
if ($add_compare_method == 2) {
// Display the popup
$s[] = '
jQuery("#phContainerModuleCompare").html(data.popup);';
$s[] = '
jQuery("#phRemoveFromComparePopup").modal();';
}
if ($add_compare_method == 1) {
// If no popup is displayed we can relaod the page when we
are in comparison page
// If popup, this will be done when clicking continue or
comparison list
$s[] = ' if (phComparisonView == 1) {';
$s[] = self::renderOverlay();
$s[] = ' setTimeout(function()
{location.reload();}, 0001);';
$s[] = ' }';
}
$s[] = ' } else {';
//$s[] = ' // Don\'t change the price box';
$s[] = ' }';
$s[] = ' }';
$s[] = ' })';
//$s[] = ' e.preventDefault();';
//$s[] = ' return false;';*/
}
}
public static function renderAjaxAddToWishList() {
$paramsC = PhocacartUtils::getComponentParameters();
$add_wishlist_method =
$paramsC->get('add_wishlist_method', 0);
// We need to refresh wishlist site when AJAX used for removing or
adding products to wishlist list
$app = JFactory::getApplication();
$view = $app->input->get('view', '');
$option = $app->input->get('option',
'');
$wView = $option == 'com_phocacart' && $view ==
'wishlist' ? 1 : 0;
if ($add_wishlist_method == 0) {
return false;
}
if ($add_wishlist_method > 0) {
$urlAjax = JURI::base(true) .
'/index.php?option=com_phocacart&task=wishlist.add&format=json&'
. JSession::getFormToken() . '=1&wishlistview=' .
(int)$wView;
$s = array();
$s[] = 'function phItemWishListBoxFormAjax(phItemId)
{';
$s[] = ' var phUrl = "' . $urlAjax .
'";';
$s[] = ' var phItem = \'#\' + phItemId;';
$s[] = ' var phOptions = [];';
$s[] = ' phOptions["view"] = ' .
(int)$wView . ';';
$s[] = ' phOptions["method"] = ' .
(int)$add_wishlist_method . ';';
$s[] = ' phOptions["task"] =
"add";';
$s[] = ' phOptions["type"] =
"wishlist";';
$s[] = ' var phData = jQuery(phItem).serialize();';
$s[] = ' phDoRequestMethods(phUrl, phData,
phOptions);';
$s[] = '}';
$s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
/*$s[] = ' ';
$s[] = ' phRequest = jQuery.ajax({';
$s[] = ' type: "POST",';
$s[] = ' url: phUrl,';
$s[] = ' async: "false",';
$s[] = ' cache: "false",';
$s[] = ' data: phData,';
$s[] = ' dataType:"JSON",';
$s[] = ' success: function(data){';
$s[] = ' if (data.status == 1){';
$s[] =
' jQuery(".phItemWishListBox").html(data.item);';
$s[] =
' jQuery(".phItemWishListBoxCount").html(data.count);';
if ($add_wishlist_method == 2) {
$s[] = '
jQuery("body").append(jQuery("#phContainer"));';
$s[] = '
jQuery("#phContainer").html(data.popup);';
$s[] = '
jQuery("#phAddToWishListPopup").modal();';
}
if ($add_wishlist_method == 1) {
// If no popup is displayed we can relaod the page when we
are in wishlist page
// If popup, this will be done when clicking continue or
wishlist list
$s[] = ' if (phWishListView == 1) {';
$s[] = self::renderOverlay();
$s[] = ' setTimeout(function()
{location.reload();}, 0001);';
$s[] = ' }';
}
$s[] = ' } else {';
//$s[] = ' // Don\'t change the price box';
$s[] = ' }';
$s[] = ' }';
$s[] = ' })';
//$s[] = ' e.preventDefault();';
//$s[] = ' return false;';*/
}
}
public static function renderAjaxRemoveFromWishList() {
$paramsC = PhocacartUtils::getComponentParameters();
$add_wishlist_method =
$paramsC->get('add_wishlist_method', 0);
// We need to refresh wishlist site when AJAX used for removing or
adding products to wishlist list
$app = JFactory::getApplication();
$view = $app->input->get('view', '');
$option = $app->input->get('option',
'');
$wView = $option == 'com_phocacart' && $view ==
'wishlist' ? 1 : 0;
if ($add_wishlist_method == 0) {
return false;
}
if ($add_wishlist_method > 0) {
$urlAjax = JURI::base(true) .
'/index.php?option=com_phocacart&task=wishlist.remove&format=json&'
. JSession::getFormToken() . '=1&wishlistview=' .
(int)$wView;
$s = array();
$s[] = ' ';
$s[] = 'function phItemRemoveWishListFormAjax(phItemId)
{';
$s[] = ' var phUrl = "' . $urlAjax .
'";';
$s[] = ' var phItem = \'#\' + phItemId;';
$s[] = ' var phOptions = [];';
$s[] = ' phOptions["view"] = ' .
(int)$wView . ';';
$s[] = ' phOptions["method"] = ' .
(int)$add_wishlist_method . ';';
$s[] = ' phOptions["task"] =
"remove";';
$s[] = ' phOptions["type"] =
"wishlist";';
$s[] = ' var phData = jQuery(phItem).serialize();';
$s[] = ' phDoRequestMethods(phUrl, phData,
phOptions);';
$s[] = '}';
$s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
/*
$s[] = ' phRequest = jQuery.ajax({';
$s[] = ' type: "POST",';
$s[] = ' url: phUrl,';
$s[] = ' async: "false",';
$s[] = ' cache: "false",';
$s[] = ' data: phData,';
$s[] = ' dataType:"JSON",';
$s[] = ' success: function(data){';
$s[] = ' if (data.status == 1){';
$s[] =
' jQuery(".phItemWishListBox").html(data.item);';
$s[] =
' jQuery(".phItemWishListBoxCount").html(data.count);';
if ($add_wishlist_method == 2) {
// Display the popup
$s[] = '
jQuery("#phContainerModuleWishList").html(data.popup);';
$s[] = '
jQuery("#phRemoveFromWishListPopup").modal();';
}
if ($add_wishlist_method == 1) {
// If no popup is displayed we can relaod the
page when we are in wishlist page
// If popup, this will be done when clicking
continue or wishlist list
$s[] = ' if (phWishListView == 1)
{';
$s[] = self::renderOverlay();
$s[] = ' setTimeout(function()
{location.reload();}, 0001);';
$s[] = ' }';
}
$s[] = ' } else {';
//$s[] = ' // Don\'t change the price
box';
$s[] = ' }';
$s[] = ' }';
$s[] = ' })';
//$s[] = ' e.preventDefault();';
//$s[] = ' return false;';*/
}
}
public static function renderAjaxQuickViewBox($options = array()) {
$style = PhocacartRenderStyle::getStyles();
$paramsC = PhocacartUtils::getComponentParameters();
$dynamic_change_price =
$paramsC->get('dynamic_change_price', 1);
$load_chosen = $paramsC->get('load_chosen', 1);
$quantity_input_spinner =
$paramsC->get('quantity_input_spinner', 0);
// needed because of phChangeAttributeType() - is included
//$document = JFactory::getDocument();
//$document->addScript(JURI::root(true) .
'/media/com_phocacart/js/phoca/jquery.phocaattribute.min.js');
$media = PhocacartRenderMedia::getInstance('main');
$media->loadPhocaAttribute(1);
// We need to refresh comparison site when AJAX used for removing
or adding products to comparison list
$urlAjax = JURI::base(true) .
'/index.php?option=com_phocacart&view=item&format=json&tmpl=component&'
. JSession::getFormToken() . '=1';
$s = array();
$s[] = 'function phItemQuickViewBoxFormAjax(phItemId)
{';
$s[] = ' var phUrl = "' . $urlAjax .
'";';
$s[] = ' var phItem = \'#\' + phItemId;';
$s[] = ' var phOptions = [];';
$s[] = ' phOptions["view"] = "";';
$s[] = ' phOptions["method"] =
"";';
$s[] = ' phOptions["task"] = "";';
$s[] = ' phOptions["type"] =
"quickview";';
$s[] = ' phOptions["load_chosen"] = ' .
(int)$load_chosen . ';';
$s[] = ' phOptions["quantity_input_spinner"] =
' . (int)$quantity_input_spinner . ';';
if ((int)$quantity_input_spinner == 2) {
$s[] = ' phOptions["icon_spinner_verticalup"] =
\'<span class="' .
$style['i']['chevron-up'] .
'"></span>\';';
$s[] = ' phOptions["icon_spinner_verticaldown"]
= \'<span class="' .
$style['i']['chevron-down'] .
'"></span>\';';
} else {
$s[] = ' phOptions["icon_spinner_verticalup"] =
\'<span class="' .
$style['i']['plus'] .
'"></span>\';';
$s[] = ' phOptions["icon_spinner_verticaldown"]
= \'<span class="' .
$style['i']['minus'] .
'"></span>\';';
}
$s[] = ' var phData = jQuery(phItem).serialize();';
$s[] = ' phDoRequestMethods(phUrl, phData, phOptions);';
$s[] = '}';
$s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
/*$s[] = ' phRequest = jQuery.ajax({';
$s[] = ' type: "POST",';
$s[] = ' url: phUrl,';
$s[] = ' async: "false",';
$s[] = ' cache: "false",';
$s[] = ' data: phData,';
$s[] = ' dataType:"JSON",';
$s[] = ' success: function(data){';
$s[] = ' if (data.status == 1){';
//$s[] =
' jQuery("#phItemCompareBox").html(data.item);';
//$s[] = '
jQuery("#phQuickViewPopupBody").html(data.popup);';
added in ajax
//- $s[] = '
jQuery("#phContainer").html(data.popup); ';
$s[] = '
jQuery(".phjItemQuick.phjProductAttribute").remove();
';// Clear attributes from dom when ajax reload
$s[] = '
jQuery("body").append(jQuery("#phContainer"));';
$s[] = '
jQuery("#phContainer").html(data.popup); ';
//- $s[] = '
jQuery("#phQuickViewPopup").modal();';
$s[] = '
jQuery("body").append(jQuery("#phQuickViewPopup"));';
$s[] = '
jQuery("#phQuickViewPopup").modal();';
if ($load_chosen > 0) {
// TO DO
// Chosen cannot be dynamically recreated in case
// we want to add support for mobiles and have support for html
required forms (browser checks for html required forms)
// Now choosen is disables on mobile devices so when we reload
choosen for standard devices
// we lost the select boxes on mobiles
//$s[] = '
jQuery(\'select\').chosen({disable_search_threshold :
10,allow_single_deselect : true});';//Reload Chosen
// This seems to work
//$s[] = '
jQuery(\'select\').chosen({disable_search_threshold :
10,allow_single_deselect : true});';
$s[] = '
jQuery(\'select\').chosen(\'destroy\').chosen({disable_search_threshold
: 10,allow_single_deselect : true});';
}
if ($dynamic_change_price == 1) {
//$s[] = ' phAjaxChangePrice();';
}
$s[] =
'phChangeAttributeType(\'ItemQuick\');';// Recreate the
select attribute (color, image) after AJAX
$s[] = ' '. $options['touchspin'];// Touch
spin for input
$s[] = ' } else {';
//$s[] = ' // Don\'t change the price box';
$s[] = ' }';
$s[] = ' }';
$s[] = ' })';
//$s[] = ' e.preventDefault();';
//$s[] = ' return false;';*/
//$s[] = '}';
//$s[] = '})';
//$s[] = ' ';
}
/*
* Change Price, Stock, ID (EAN, SKU, ...)
* select box (standard, image, color)
* check box
*/
/* public static function renderAjaxChangeProductDataByOptions($id = 0,
$typeView = '', $class = '') {
$paramsC = PhocacartUtils::getComponentParameters();
$dynamic_change_price =
$paramsC->get('dynamic_change_price', 0);
$dynamic_change_stock =
$paramsC->get('dynamic_change_stock', 0);
$dynamic_change_id =
$paramsC->get('dynamic_change_id', 0);
$theme = $paramsC->get('theme',
'bs3');
if ($dynamic_change_price == 0 && $dynamic_change_stock ==
0 && $dynamic_change_id == 0) {
return false;
}
$urlAjax = JURI::base(true) .
'/index.php?option=com_phocacart&task=checkout.changedatabox&format=json&'
. JSession::getFormToken() . '=1';
$s = array();
$s[] = 'function phAjaxChangeData' . $typeView .
'(phProductId, phDataA1, phDataA2){';
$s[] = ' var phUrl = "' . $urlAjax .
'";';
$s[] = ' var phOptions = [];';
$s[] = ' phOptions["id"] = phProductId;';
$s[] = ' phOptions["id_item_price"] =
"#phItemPriceBox' . $typeView . '" +
phProductId;';
$s[] = ' phOptions["id_item_stock"] =
"#phItemStockBox' . $typeView . '" +
phProductId;';
$s[] = ' phOptions["id_item_id"] =
"#phItemIdBox' . $typeView . '" + phProductId;';
$s[] = ' phOptions["product_add_to_cart_item"] =
".phProductAddToCart' . $typeView . '" +
phProductId;';// display or hide add to cart button
$s[] = ' phOptions["product_add_to_cart_item_icon"]
= ".phProductAddToCartIcon' . $typeView . '" +
phProductId;';// display or hide add to cart icon
$s[] = ' phOptions["view"] = ' . (int)$typeView
. ';';
$s[] = ' phOptions["method_price"] = ' .
(int)$dynamic_change_price . ';';
$s[] = ' phOptions["method_stock"] = ' .
(int)$dynamic_change_stock . ';';
$s[] = ' phOptions["method_id"] = ' .
(int)$dynamic_change_id . ';';
$s[] = ' phOptions["task"] =
"change";';
$s[] = ' phOptions["type"] =
"changedata";';
$s[] = ' phOptions["class"] = "' . $class
. '";';
$s[] = ' var phData = \'id=\'+
phOptions["id"] +\'&\'+ phDataA1
+\'&\'+ phDataA2 +\'&\'+\'class=\'+
phOptions["class"] +\'&\'+\'typeview=\'+
phOptions["view"];';
$s[] = ' phDoRequestMethods(phUrl, phData, phOptions);';
$s[] = '}';
$s[] = ' ';
$s[] = 'jQuery(document).ready(function(){ ';
/* $s[] = ' var phSelectboxA =
"select.phj' . $typeView .
'.phjProductAttribute";';
$s[] = ' var phSelectboxASelected = phSelectboxA +
":selected";';
$s[] = ' jQuery(document).on(\'change\',
phSelectboxA, function(e){ ';// Select Box
//$s[] = ' jQuery(this).off("change");';
$s[] = ' var phTypeView =
jQuery(this).data(\'type-view\');';
$s[] = ' var phProductId =
jQuery(this).data(\'product-id\');';
$s[] = ' var phProductGroup = \'.phjAddToCartV' .
$typeView . 'P\' + phProductId;';
$s[] = ' var phDataA1 =
jQuery(phProductGroup).find(\'select\').serialize();';// All
Selects
$s[] = ' var phDataA2 =
jQuery(phProductGroup).find(\':checkbox\').serialize();';//
All Checkboxes
$s[] = ' phAjaxChangeData' . $typeView .
'(phProductId, phDataA1, phDataA2);';// If REQUIRED, don't
allow to untick image or color "select box" - see
jquery.phocaattribute.js
$s[] = ' })';*/
// Checkbox
// Unfortunately, we cannot run event:
// 1. CHANGE - because of Bootstrap toogle button, this will run 3x
ajax (checkbox is hidden and changes when clicking on button)
// 2. CLICK directly on checkbox as if Bootstrap toogle button is
use, clicked will be icon not the checkbox
// So we run click on div box over the checkbox which works and
don't run ajax 3x
//$s[] = ' jQuery(document).on(\'change\',
\'.ph-checkbox-attribute.phj'.$typeView.'.phjProductAttribute
:checkbox\', function(){';
//$s[] = ' jQuery(document).on(\'click\',
\'#phItemPriceBoxForm
.ph-checkbox-attribute.ph-item-input-set-attributes\',
function(){';
/* $s[] = ' var phCheckboxA =
".ph-checkbox-attribute.phj' . $typeView .
'.phjProductAttribute"';
// $s[] = ' var phCheckboxAInputChecked = phCheckboxA +
" input:checked"';
$s[] = ' jQuery(document).on(\'click\', phCheckboxA,
function(e){';
$s[] = ' if (e.target.tagName.toUpperCase() ===
"LABEL") { return;}';// Prevent from twice running
if ($theme == 'bs4') {
$s[] = ' if (e.target.tagName.toUpperCase() ===
"SPAN" || e.target.tagName.toUpperCase() === "IMG") {
return;}';// Prevent from twice running
}
$s[] = ' var phProductId =
jQuery(this).data(\'product-id\');';
$s[] = ' var phTypeView =
jQuery(this).data(\'type-view\');';
$s[] = ' var phProductGroup = \'.phjAddToCartV' .
$typeView . 'P\' + phProductId;';
$s[] = ' var phDataA1 =
jQuery(phProductGroup).find(\'select\').serialize();';// All
Selects
$s[] = ' var phDataA2 =
jQuery(phProductGroup).find(\':checkbox\').serialize();';//
All Checkboxes
// If REQUIRED, don't allow to untick all checkboxes
$s[] = ' var phRequired =
jQuery(this).data("required");';
$s[] = ' var phCheckboxAInputChecked = "#" +
jQuery(this).attr("id") + " input:checked"';
$s[] = ' var phACheckedLength =
jQuery(phCheckboxAInputChecked).length;';
$s[] = ' if (phACheckedLength == 0) {';
$s[] = ' var phThisLabel =
jQuery(e.target).parent();';// Bootstrap checkboxes - colors, images
$s[] = '
phThisLabel.addClass("active");';// Bootstrap checkboxes -
colors, images
$s[] = ' e.preventDefault();';
$s[] = ' return false;';
$s[] = ' }';
$s[] = ' phAjaxChangeData' . $typeView .
'(phProductId, phDataA1, phDataA2);';
$s[] = ' })';*/
// Change the price on time view when site is initialized
// Because some parameters can be selected as default
// Automatically start only in item view, not in category or
another view
/*if ($option == 'com_phocacart' && $view ==
'item') {
//$s[] = ' var phProductId =
jQuery(\'.phjItemAttribute\').data(\'product-id\')';
$s[] = ' var phDataA1 =
jQuery("select.phjItemAttribute").serialize();';
$s[] = ' var phDataA2 =
jQuery(".ph-checkbox-attribute.phjItemAttribute
:checkbox").serialize();';
$s[] = ' var phpDataA = phDataA1 +\'&\'+
phDataA2;';
$s[] =
' phAjaxChangePrice'.$typeView.'('.(int)$id.');';
}*/
/*
$s[] = '})';
$s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}*/
/*
* Change Price
* select box (standard, image, color)
* check box
*//*
public static function renderAjaxChangeProductPriceByOptions($id = 0,
$typeView = '', $class = '') {
$paramsC = PhocacartUtils::getComponentParameters();
$dynamic_change_price =
$paramsC->get('dynamic_change_price', 0);
$theme = $paramsC->get('theme',
'bs3');
if ($dynamic_change_price == 0) {
return false;
}
$urlAjax = JURI::base(true) .
'/index.php?option=com_phocacart&task=checkout.changepricebox&format=json&'
. JSession::getFormToken() . '=1';
$s = array();
$s[] = 'function phAjaxChangePrice' . $typeView .
'(phProductId, phDataA1, phDataA2){';
$s[] = ' var phUrl = "' . $urlAjax .
'";';
$s[] = ' var phOptions = [];';
$s[] = ' phOptions["id"] = phProductId;';
$s[] = ' phOptions["id_item"] =
"#phItemPriceBox' . $typeView . '" +
phProductId;';
$s[] = ' phOptions["view"] = ' . (int)$typeView
. ';';
$s[] = ' phOptions["method"] = ' .
(int)$dynamic_change_price . ';';
$s[] = ' phOptions["task"] =
"change";';
$s[] = ' phOptions["type"] =
"changeprice";';
$s[] = ' phOptions["class"] = "' . $class
. '";';
$s[] = ' var phData = \'id=\'+
phOptions["id"] +\'&\'+ phDataA1
+\'&\'+ phDataA2 +\'&\'+\'class=\'+
phOptions["class"] +\'&\'+\'typeview=\'+
phOptions["view"];';
$s[] = ' phDoRequestMethods(phUrl, phData, phOptions);';
$s[] = '}';
$s[] = ' ';
/* $s[] = ' jQuery.ajax({';
$s[] = ' type: "POST",';
$s[] = ' url: phUrl,';
$s[] = ' async: "false",';
$s[] = ' cache: "false",';
$s[] = ' data: phData,';
$s[] = ' dataType:"JSON",';
$s[] = ' success: function(data){';
$s[] = ' if (data.status == 1){';
$s[] = ' jQuery(phIdItem).html(data.item);';
$s[] = ' } else {';// Don't change the price
box, don't render any error message
$s[] = ' }';
$s[] = ' }';
$s[] = ' })';
$s[] = '}';
$s[] = ' ';*//*
$s[] = 'jQuery(document).ready(function(){ ';
$s[] = ' var phSelectboxA =
"select.phj' . $typeView .
'.phjProductAttribute";';
$s[] = ' var phSelectboxASelected = phSelectboxA +
":selected";';
$s[] = ' jQuery(document).on(\'change\',
phSelectboxA, function(e){ ';// Select Box
//$s[] = ' jQuery(this).off("change");';
$s[] = ' var phProductId =
jQuery(this).data(\'product-id\');';
$s[] = ' var phProductGroup = \'.phjAddToCartV' .
$typeView . 'P\' + phProductId;';
$s[] = ' var phDataA1 =
jQuery(phProductGroup).find(\'select\').serialize();';// All
Selects
$s[] = ' var phDataA2 =
jQuery(phProductGroup).find(\':checkbox\').serialize();';//
All Checkboxes
$s[] = ' phAjaxChangePrice' . $typeView .
'(phProductId, phDataA1, phDataA2);';// If REQUIRED, don't
allow to untick image or color "select box" - see
jquery.phocaattribute.js
$s[] = ' })';
// Checkbox
// Unfortunately, we cannot run event:
// 1. CHANGE - because of Bootstrap toogle button, this will run 3x
ajax (checkbox is hidden and changes when clicking on button)
// 2. CLICK directly on checkbox as if Bootstrap toogle button is
use, clicked will be icon not the checkbox
// So we run click on div box over the checkbox which works and
don't run ajax 3x
//$s[] = ' jQuery(document).on(\'change\',
\'.ph-checkbox-attribute.phj'.$typeView.'.phjProductAttribute
:checkbox\', function(){';
//$s[] = ' jQuery(document).on(\'click\',
\'#phItemPriceBoxForm
.ph-checkbox-attribute.ph-item-input-set-attributes\',
function(){';
$s[] = ' var phCheckboxA =
".ph-checkbox-attribute.phj' . $typeView .
'.phjProductAttribute"';
// $s[] = ' var phCheckboxAInputChecked = phCheckboxA +
" input:checked"';
$s[] = ' jQuery(document).on(\'click\', phCheckboxA,
function(e){';
$s[] = ' if (e.target.tagName.toUpperCase() ===
"LABEL") { return;}';// Prevent from twice running
if ($theme == 'bs4') {
$s[] = ' if (e.target.tagName.toUpperCase() ===
"SPAN" || e.target.tagName.toUpperCase() === "IMG") {
return;}';// Prevent from twice running
}
$s[] = ' var phProductId =
jQuery(this).data(\'product-id\');';
$s[] = ' var phProductGroup = \'.phjAddToCartV' .
$typeView . 'P\' + phProductId;';
$s[] = ' var phDataA1 =
jQuery(phProductGroup).find(\'select\').serialize();';// All
Selects
$s[] = ' var phDataA2 =
jQuery(phProductGroup).find(\':checkbox\').serialize();';//
All Checkboxes
// If REQUIRED, don't allow to untick all checkboxes
$s[] = ' var phRequired =
jQuery(this).data("required");';
$s[] = ' var phCheckboxAInputChecked = "#" +
jQuery(this).attr("id") + " input:checked"';
$s[] = ' var phACheckedLength =
jQuery(phCheckboxAInputChecked).length;';
$s[] = ' if (phACheckedLength == 0) {';
$s[] = ' var phThisLabel =
jQuery(e.target).parent();';// Bootstrap checkboxes - colors, images
$s[] = '
phThisLabel.addClass("active");';// Bootstrap checkboxes -
colors, images
$s[] = ' e.preventDefault();';
$s[] = ' return false;';
$s[] = ' }';
$s[] = ' phAjaxChangePrice' . $typeView .
'(phProductId, phDataA1, phDataA2);';
$s[] = ' })';
// Change the price on time view when site is initialized
// Because some parameters can be selected as default
// Automatically start only in item view, not in category or
another view
/*if ($option == 'com_phocacart' && $view ==
'item') {
//$s[] = ' var phProductId =
jQuery(\'.phjItemAttribute\').data(\'product-id\')';
$s[] = ' var phDataA1 =
jQuery("select.phjItemAttribute").serialize();';
$s[] = ' var phDataA2 =
jQuery(".ph-checkbox-attribute.phjItemAttribute
:checkbox").serialize();';
$s[] = ' var phpDataA = phDataA1 +\'&\'+
phDataA2;';
$s[] =
' phAjaxChangePrice'.$typeView.'('.(int)$id.');';
}*//*
$s[] = '})';
$s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}*/
/*
* Change ID (SKU, EAN, ...)
* select box (standard, image, color)
* check box
*//*
public static function renderAjaxChangeProductIdByOptions($id = 0,
$typeView = '', $class = '') {
$paramsC = PhocacartUtils::getComponentParameters();
$dynamic_change_id =
$paramsC->get('dynamic_change_id', 0);
$theme = $paramsC->get('theme',
'bs3');
if ($dynamic_change_id == 0) {
return false;
}
$urlAjax = JURI::base(true) .
'/index.php?option=com_phocacart&task=checkout.changeidbox&format=json&'
. JSession::getFormToken() . '=1';
$s = array();
$s[] = 'function phAjaxChangeId' . $typeView .
'(phProductId, phDataA1, phDataA2){';
$s[] = ' var phUrl = "' . $urlAjax .
'";';
$s[] = ' var phOptions = [];';
$s[] = ' phOptions["id"] = phProductId;';
$s[] = ' phOptions["id_item"] =
"#phItemIdBox' . $typeView . '" + phProductId;';
$s[] = ' phOptions["view"] = ' . (int)$typeView
. ';';
$s[] = ' phOptions["method"] = ' .
(int)$dynamic_change_id . ';';
$s[] = ' phOptions["task"] =
"change";';
$s[] = ' phOptions["type"] =
"changeid";';
$s[] = ' phOptions["class"] = "' . $class
. '";';
$s[] = ' var phData = \'id=\'+
phOptions["id"] +\'&\'+ phDataA1
+\'&\'+ phDataA2 +\'&\'+\'class=\'+
phOptions["class"] +\'&\'+\'typeview=\'+
phOptions["view"];';
$s[] = ' phDoRequestMethods(phUrl, phData, phOptions);';
$s[] = '}';
$s[] = ' ';
$s[] = 'jQuery(document).ready(function(){ ';
$s[] = ' var phSelectboxA =
"select.phj' . $typeView .
'.phjProductAttribute";';
$s[] = ' var phSelectboxASelected = phSelectboxA +
":selected";';
$s[] = ' jQuery(document).on(\'change\',
phSelectboxA, function(e){ ';// Select Box
//$s[] = ' jQuery(this).off("change");';
$s[] = ' var phProductId =
jQuery(this).data(\'product-id\');';
$s[] = ' var phProductGroup = \'.phjAddToCartV' .
$typeView . 'P\' + phProductId;';
$s[] = ' var phDataA1 =
jQuery(phProductGroup).find(\'select\').serialize();';// All
Selects
$s[] = ' var phDataA2 =
jQuery(phProductGroup).find(\':checkbox\').serialize();';//
All Checkboxes
$s[] = ' phAjaxChangeId' . $typeView .
'(phProductId, phDataA1, phDataA2);';// If REQUIRED, don't
allow to untick image or color "select box" - see
jquery.phocaattribute.js
$s[] = ' })';
// Checkbox
// Unfortunately, we cannot run event:
// 1. CHANGE - because of Bootstrap toogle button, this will run 3x
ajax (checkbox is hidden and changes when clicking on button)
// 2. CLICK directly on checkbox as if Bootstrap toogle button is
use, clicked will be icon not the checkbox
// So we run click on div box over the checkbox which works and
don't run ajax 3x
//$s[] = ' jQuery(document).on(\'change\',
\'.ph-checkbox-attribute.phj'.$typeView.'.phjProductAttribute
:checkbox\', function(){';
//$s[] = ' jQuery(document).on(\'click\',
\'#phItemPriceBoxForm
.ph-checkbox-attribute.ph-item-input-set-attributes\',
function(){';
$s[] = ' var phCheckboxA =
".ph-checkbox-attribute.phj' . $typeView .
'.phjProductAttribute"';
// $s[] = ' var phCheckboxAInputChecked = phCheckboxA +
" input:checked"';
$s[] = ' jQuery(document).on(\'click\', phCheckboxA,
function(e){';
$s[] = ' if (e.target.tagName.toUpperCase() ===
"LABEL") { return;}';// Prevent from twice running
if ($theme == 'bs4') {
$s[] = ' if (e.target.tagName.toUpperCase() ===
"SPAN" || e.target.tagName.toUpperCase() === "IMG") {
return;}';// Prevent from twice running
}
$s[] = ' var phProductId =
jQuery(this).data(\'product-id\');';
$s[] = ' var phProductGroup = \'.phjAddToCartV' .
$typeView . 'P\' + phProductId;';
$s[] = ' var phDataA1 =
jQuery(phProductGroup).find(\'select\').serialize();';// All
Selects
$s[] = ' var phDataA2 =
jQuery(phProductGroup).find(\':checkbox\').serialize();';//
All Checkboxes
// If REQUIRED, don't allow to untick all checkboxes
$s[] = ' var phRequired =
jQuery(this).data("required");';
$s[] = ' var phCheckboxAInputChecked = "#" +
jQuery(this).attr("id") + " input:checked"';
$s[] = ' var phACheckedLength =
jQuery(phCheckboxAInputChecked).length;';
$s[] = ' if (phACheckedLength == 0) {';
$s[] = ' var phThisLabel =
jQuery(e.target).parent();';// Bootstrap checkboxes - colors, images
$s[] = '
phThisLabel.addClass("active");';// Bootstrap checkboxes -
colors, images
$s[] = ' e.preventDefault();';
$s[] = ' return false;';
$s[] = ' }';
$s[] = ' phAjaxChangeId' . $typeView .
'(phProductId, phDataA1, phDataA2);';
$s[] = ' })';
// Change the price on time view when site is initialized
// Because some parameters can be selected as default
// Automatically start only in item view, not in category or
another view
/*if ($option == 'com_phocacart' && $view ==
'item') {
//$s[] = ' var phProductId =
jQuery(\'.phjItemAttribute\').data(\'product-id\')';
$s[] = ' var phDataA1 =
jQuery("select.phjItemAttribute").serialize();';
$s[] = ' var phDataA2 =
jQuery(".ph-checkbox-attribute.phjItemAttribute
:checkbox").serialize();';
$s[] = ' var phpDataA = phDataA1 +\'&\'+
phDataA2;';
$s[] =
' phAjaxChangePrice'.$typeView.'('.(int)$id.');';
}*//*
$s[] = '})';
$s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}*/
/*
* Change Stock
* select box (standard, image, color)
* check box
*//*
public static function renderAjaxChangeProductStockByOptions($id = 0,
$typeView = '', $class = '') {
$paramsC =
PhocacartUtils::getComponentParameters();
$dynamic_change_stock =
$paramsC->get('dynamic_change_stock', 0);
$hide_add_to_cart_stock =
$paramsC->get('hide_add_to_cart_stock', 0);
$theme = $paramsC->get('theme',
'bs3');
if ($dynamic_change_stock == 0) {
return false;
}
$urlAjax = JURI::base(true) .
'/index.php?option=com_phocacart&task=checkout.changestockbox&format=json&'
. JSession::getFormToken() . '=1';
/* $s[] = ' ';
$s[] = '/* Function phAjaxChangeStock *//* ';
$s[] = 'function phAjaxChangeStock' . $typeView .
'(phProductId, phDataA1, phDataA2){';
$s[] = ' var phUrl = "' . $urlAjax .
'";';
$s[] = ' var phId = phProductId;' . "\n";
$s[] = ' var phIdItem = "#phItemStockBox' .
$typeView . '" + phProductId;';
$s[] = ' var phProductAddToCart =
".phProductAddToCart' . $typeView . '" +
phProductId;';// display or hide add to cart button
$s[] = ' var phProductAddToCartIcon =
".phProductAddToCartIcon' . $typeView . '" +
phProductId;';// display or hide add to cart icon
$s[] = ' var phClass = "' . $class .
'";';
$s[] = ' var phTypeView = "' . $typeView .
'";';
$s[] = ' var phData =
\'id=\'+phId+\'&\'+phDataA1+\'&\'+phDataA2+\'&\'+\'class=\'+phClass+\'&\'+\'typeview=\'+phTypeView;';
*//*
$s = array();
$s[] = 'function phAjaxChangeStock' . $typeView .
'(phProductId, phDataA1, phDataA2){';
$s[] = ' var phUrl = "' . $urlAjax .
'";';
$s[] = ' var phOptions = [];';
$s[] = ' phOptions["id"] = phProductId;';
$s[] = ' phOptions["id_item"] =
"#phItemStockBox' . $typeView . '" +
phProductId;';
$s[] = ' phOptions["product_add_to_cart_item"] =
".phProductAddToCart' . $typeView . '" +
phProductId;';// display or hide add to cart button
$s[] = ' phOptions["product_add_to_cart_item_icon"]
= ".phProductAddToCartIcon' . $typeView . '" +
phProductId;';// display or hide add to cart icon
$s[] = ' phOptions["view"] = ' . (int)$typeView
. ';';
$s[] = ' phOptions["method"] = ' .
(int)$hide_add_to_cart_stock . ';';
$s[] = ' phOptions["task"] =
"change";';
$s[] = ' phOptions["type"] =
"changestock";';
$s[] = ' phOptions["class"] = "' . $class
. '";';
$s[] = ' var phData = \'id=\'+
phOptions["id"] +\'&\'+ phDataA1
+\'&\'+ phDataA2 +\'&\'+\'class=\'+
phOptions["class"] +\'&\'+\'typeview=\'+
phOptions["view"];';
$s[] = ' phDoRequestMethods(phUrl, phData, phOptions);';
$s[] = '}';
$s[] = ' ';
/*
$s[] = ' jQuery.ajax({';
$s[] = ' type: "POST",';
$s[] = ' url: phUrl,';
$s[] = ' async: "false",';
$s[] = ' cache: "false",';
$s[] = ' data: phData,';
$s[] = ' dataType:"JSON",';
$s[] = ' success: function(data){';
$s[] = ' if (data.status == 1){';
if ($hide_add_to_cart_stock == 1) {
$s[] = ' if (data.stock < 1) {';
//$s[] = ' jQuery(phProductAddToCart).hide();';
$s[] =
' jQuery(phProductAddToCart).css(\'visibility\',
\'hidden\');';
$s[] =
' jQuery(phProductAddToCartIcon).css(\'display\',
\'none\');';
$s[] = ' } else {';
//$s[] = ' jQuery(phProductAddToCart).show();';
$s[] =
' jQuery(phProductAddToCart).css(\'visibility\',
\'visible\');';
$s[] =
' jQuery(phProductAddToCartIcon).css(\'display\',
\'block\');';
$s[] = ' }';
}
$s[] = ' jQuery(phIdItem).html(data.item);';
$s[] = ' } else {';// Don't change the price
box, don't render any error message
$s[] = ' }';
$s[] = ' }';
$s[] = ' })';
$s[] = '}';
$s[] = ' ';
*//*
$s[] = 'jQuery(document).ready(function(){';
$s[] = ' jQuery(document).on(\'change\',
\'select.phj' . $typeView . '.phjProductAttribute\',
function(){';// select box
//$s[] = ' jQuery(this).off("change");';
$s[] = ' var phProductId =
jQuery(this).data(\'product-id\');';
$s[] = ' var phProductGroup = \'.phjAddToCartV' .
$typeView . 'P\' + phProductId;';
$s[] = ' var phDataA1 =
jQuery(phProductGroup).find(\'select\').serialize();';// All
Selects
$s[] = ' var phDataA2 =
jQuery(phProductGroup).find(\':checkbox\').serialize();';//
All Checkboxes
$s[] = ' phAjaxChangeStock' . $typeView .
'(phProductId, phDataA1, phDataA2);';// If REQUIRED, don't
allow to untick image or color "select box" - see
jquery.phocaattribute.js
$s[] = ' })';
$s[] = ' var phCheckboxA =
".ph-checkbox-attribute.phj' . $typeView .
'.phjProductAttribute"';
//$s[] = ' var phCheckboxAInputChecked = phCheckboxA +
" input:checked"';
$s[] = ' jQuery(document).on(\'click\', phCheckboxA,
function(e){';// check box
$s[] = ' if (e.target.tagName.toUpperCase() ===
"LABEL") { return;}';// Prevent from twice running
if ($theme == 'bs4') {
$s[] = ' if (e.target.tagName.toUpperCase() ===
"SPAN" || e.target.tagName.toUpperCase() === "IMG") {
return;}';// Prevent from twice running
}
$s[] = ' var phProductId =
jQuery(this).data(\'product-id\');';
$s[] = ' var phProductGroup = \'.phjAddToCartV' .
$typeView . 'P\' + phProductId;';
$s[] = ' var phDataA1 =
jQuery(phProductGroup).find(\'select\').serialize();';// All
Selects
$s[] = ' var phDataA2 =
jQuery(phProductGroup).find(\':checkbox\').serialize();';//
All Checkboxes
// If REQUIRED, don't allow to untick all checkboxes
$s[] = ' var phRequired =
jQuery(this).data("required");';
$s[] = ' var phCheckboxAInputChecked = "#" +
jQuery(this).attr("id") + " input:checked"';
$s[] = ' var phACheckedLength =
jQuery(phCheckboxAInputChecked).length;';
$s[] = ' if (phACheckedLength == 0) {';
$s[] = ' var phThisLabel =
jQuery(e.target).parent();';// Bootstrap checkboxes - colors, images
$s[] = '
phThisLabel.addClass("active");';// Bootstrap checkboxes -
colors, images
$s[] = ' e.preventDefault();';
$s[] = ' return false;';
$s[] = ' }';
$s[] = ' phAjaxChangeStock' . $typeView .
'(phProductId, phDataA1, phDataA2);';
$s[] = ' })';
$s[] = '})';
$s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}*/
/*
* JS equivalent to PhocacartPrice::getPriceFormat();
*/
public static function getPriceFormatJavascript($price_decimals,
$price_dec_symbol, $price_thousands_sep, $price_currency_symbol,
$price_prefix, $price_suffix, $price_format) {
//JFactory::getDocument()->addScript(JURI::root(true).'/media/com_phocacart/js/number_format.js');
$s = array();
$s[] = 'function phGetPriceFormat($price) {';
$s[] = ' var $negative = 0;';
$s[] = ' if ($price < 0) {';
$s[] = ' $negative = 1;';
$s[] = ' }';
$s[] = ' if ($negative == 1 ) {';
$s[] = ' $price = Math.abs($price);';
$s[] = ' }';
$s[] = ' $price = phNumberFormat($price, "' .
$price_decimals . '", "' . $price_dec_symbol .
'", "' . $price_thousands_sep . '");';
switch ($price_format) {
case 1: $s[] = ' $price = $price +
"' . $price_currency_symbol . '";'; break;
case 2: $s[] = ' $price = "' .
$price_currency_symbol . '" + $price;'; break;
case 3: $s[] = ' $price = "' .
$price_currency_symbol . '" + " " + $price;';
break;
case 0: default: $s[] = ' $price = $price + "
" + "' . $price_currency_symbol . '";';
break;
}
$s[] = ' if ($negative == 1) {';
$s[] = ' return "- " + "' .
addslashes($price_prefix) . '" + $price + "' .
addslashes($price_suffix) . '";';
$s[] = ' } else {';
$s[] = ' return "' . addslashes($price_prefix) .
'" + $price + "' . addslashes($price_suffix) .
'";';
$s[] = ' }';
$s[] = '}';
$s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}
/*
* Two features in one function
* 1) return required parts
* If the attribute is required, return different required parts
(attribute - html5, class - jquery, span - heading)
* 2) Initialize JQuery Check for required fields working with HTML 5
* Checkboxes cannot be checked by HTML 5, so we need help of jQuery
which manage for example:
* There are 3 checkboxes - one selected, two not (It is OK but not
for HTML5)
*/
public static function renderRequiredParts($id, $required) {
// If the attribute is required
$req['attribute'] = '';// Attribute -
required field HTML 5
$req['span'] = '';// Span - displayed *
next to title
$req['class'] = '';// Class - Checkboxes
cannot be checked per HTML 5, jquery used
PhocacartRenderJs::renderCheckBoxRequired()
$req['required'] = 0;// data-required attribute
if ($required) {
$req['attribute'] = ' required=""
aria-required="true"';
$req['span'] = ' <span
class="ph-req">*</span>';
$req['class'] = ' checkbox-group-' .
(int)$id . ' checkbox-group required';
$req['required'] = 1;
}
return $req;
}
public static function renderJsScrollTo($scrollTo = '',
$animation = 0) {
$s[] = 'jQuery(function() {';
$s[] = ' if (jQuery("#ph-msg-ns").length >
0){';
$s[] = ' jQuery(document).scrollTop(
jQuery("#system-message").offset().top );';
//$s[] = '
jQuery(\'html,body\').animate({scrollTop:
jQuery("#system-message").offset().top}, 1500 );';
if ($scrollTo != '') {
$s[] = ' } else {';
if ($animation == 1) {
$s[] = '
jQuery(\'html,body\').animate({scrollTop: jQuery("#' .
$scrollTo . '").offset().top}, 1500 );';
} else if ($animation == 2) {
$s[] = '
jQuery(\'html,body\').animate({scrollTop: jQuery("#' .
$scrollTo . '").offset().top}, 1000 );';
} else {
$s[] = ' jQuery(document).scrollTop(
jQuery("#' . $scrollTo . '").offset().top );';
}
}
$s[] = ' }';
$s[] = '});';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}
/**
* Shipping tracking code - add automatically tracking number to
tracking link in edit of order - to see the link (while typing the id)
* @param string $idSource
* @param string $classDestination
*/
public static function renderJsAddTrackingCode($idSource,
$classDestination) {
$s = array();
$s[] = 'jQuery(document).ready(function() {';
$s[] = ' var destGlobal = jQuery( \'.' .
$classDestination . '\').text();';
$s[] = ' var sourceGlobal = jQuery(\'#' .
$idSource . '\').val();';
$s[] = ' var textGlobal = destGlobal + sourceGlobal';
$s[] = ' jQuery( \'.' . $classDestination .
'\').html(textGlobal);';
$s[] = ' jQuery(\'#' . $idSource .
'\').on("input", function() {';
$s[] = ' var source = jQuery(this).val();';
$s[] = ' var text = destGlobal + source;';
$s[] = ' jQuery( \'.' . $classDestination .
'\').html(text);';
$s[] = ' })';
$s[] = '})';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}
/*
public static function renderDetectVirtualKeyboard() {
$s = array();
$s[] = 'jQuery(document).ready(function(){';
$s[] = ' var phDefaultSize = jQuery(window).width() +
jQuery(window).height()';
$s[] = ' jQuery(window).resize(function(){';
$s[] = ' if(jQuery(window).width() +
jQuery(window).height() != phDefaultSize){';
$s[] = ' ';
$s[] = '
jQuery(".ph-pos-wrap-main").css("position","fixed");';
$s[] = ' } else {';
$s[] = ' ';
$s[] = '
jQuery(".ph-pos-wrap-main").css("position","relative");';
$s[] = ' }';
$s[] = ' });';
$s[] = '});';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}
*/
public static function renderAjaxAskAQuestion($options = array()) {
$paramsC = PhocacartUtils::getComponentParameters();
$item_askquestion = $paramsC->get('item_askquestion',
0);
$popup_askquestion =
$paramsC->get('popup_askquestion', 0);
if ($item_askquestion > 0 && $popup_askquestion == 2) {
$s[] = ' jQuery(document).ready(function(){';
$s[] = ' jQuery(document).on("click",
"a.phModalContainerButton", function (e) {';
$s[] = ' var src =
jQuery(this).attr("data-src");';
$s[] = ' var height =
"100%";';//jQuery(this).attr("data-height") ||
300;// Does not work and it is solved by CSS
$s[] = ' var width =
"100%";';//jQuery(this).attr("data-width") ||
400;
$s[] = ' var id = "#" +
jQuery(this).attr("data-id");';
$s[] = ' var idIframe = id + "
iframe";';
// Loaded dynamically to not have previous src in iframe, see:
components/com_phocacart/layouts/popup_container_iframe.php
$s[] = ' var idBody = id + "
.modal-body";';
$s[] = ' jQuery(idBody).html(\'<iframe
frameborder="0"></iframe>\');';
// end iframe could be a past of layout file
$s[] = ' jQuery(idIframe).attr({"src":src,
"height": height, "width": width});';
$s[] = ' jQuery(id).modal();';
$s[] = ' });';
$s[] = ' });';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}
}
public final function __clone()
{
throw new Exception('Function Error: Cannot clone instance of
Singleton pattern', 500);
return false;
}
}
?>
PK�"�[����(y(y$libraries/phocacart/render/media.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
use Joomla\CMS\HTML\HTMLHelper;
class PhocacartRenderMedia
{
public $jquery = 0;
protected $document = false;
protected $p = array();
protected $t = array();
protected $format = '';
protected $view = '';
protected $load = true;
protected $scriptAtribute = array();
protected $scriptAtributeInline = array();
protected $name = '';
protected static $instances = array();
public function __construct($name = 'main') {
$this->name = $name;
$app = JFactory::getApplication();
//$params = $app->getParams();// We call media from modules too
$params =
PhocacartUtils::getComponentParameters();
$this->p['load_bootstrap'] =
$params->get('load_bootstrap', 1);
$this->p['load_chosen'] =
$params->get('load_chosen', 1);
$this->p['load_main_css'] =
$params->get('load_main_css', 1);
$this->p['load_spec_css'] =
$params->get('load_spec_css', '');
$this->p['load_rtl_css'] =
$params->get('load_rtl_css', 0);
$this->p['equal_height'] =
$params->get('equal_height', 1);
$this->p['display_compare'] =
$params->get('display_compare', 0);
$this->p['display_wishlist'] =
$params->get('display_wishlist', 0);
$this->p['display_quickview'] =
$params->get('display_quickview', 0);
$this->p['display_addtocart_icon'] =
$params->get('display_addtocart_icon', 0);
$this->p['fade_in_action_icons'] =
$params->get('fade_in_action_icons', 0);
$this->p['dynamic_change_image'] =
$params->get('dynamic_change_image', 0);
$this->p['dynamic_change_price'] =
$params->get('dynamic_change_price', 0);
$this->p['dynamic_change_stock'] =
$params->get('dynamic_change_stock', 0);
$this->p['dynamic_change_id'] =
$params->get('dynamic_change_id', 0);
$this->p['dynamic_change_url_attributes'] =
$params->get('dynamic_change_url_attributes', 0);
$this->p['quantity_input_spinner'] =
$params->get('quantity_input_spinner', 0);
$this->p['icon_type'] =
$params->get('icon_type', 'bs');
$this->p['ajax_pagination_category'] =
$params->get('ajax_pagination_category', 0);
$this->p['ajax_searching_filtering_items'] =
$params->get('ajax_searching_filtering_items', 0);
$this->p['theme'] = $params->get('theme',
'bs3');
$this->p['pos_focus_input_fields'] =
$params->get('pos_focus_input_fields', 0);
$this->p['pos_filter_category'] =
$params->get('pos_filter_category', 1);// reload equal height
$this->p['lazy_load_category_items'] =
$params->get('lazy_load_category_items', 0);
$this->p['lazy_load_categories'] =
$params->get('lazy_load_categories', 0);
$this->p['pos_server_print'] =
$params->get('pos_server_print', 0);
$this->p['load_min_js'] =
$params->get('load_min_js', 1);
$this->t['min'] =
$this->p['load_min_js'] == 0 ? '' :
'.min';
$this->format = $app->input->get('format',
'', 'string');
$this->view = $app->input->get('view',
'', 'string');
$this->document = JFactory::getDocument();
if ($this->format == 'raw' || $this->format ==
'json') {
$this->load == false;
}
$this->scriptAtribute = array('defer' =>
true, 'async' => true);
$this->scriptAtributeInline = array();
$this->document = JFactory::getDocument();
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$action = $uri->toString();
// =================
// Render Page
// =================
$oVars = array();
$oLang = array();
$oParams = array();
$oLang = array('COM_PHOCACART_CLOSE' =>
JText::_('COM_PHOCACART_CLOSE'),
'COM_PHOCACART_ERROR_TITLE_NOT_SET' =>
JText::_('COM_PHOCACART_ERROR_TITLE_NOT_SET'));
$oVars['renderPageUrl'] = $action;
$oVars['token'] = JSession::getFormToken();
$oVars['basePath'] = JURI::base(true);
if ($this->view == 'category' || $this->view ==
'items' || $this->view == 'pos') {
if ($this->view == 'pos') {
$oVars['renderPageOutput'] =
'phPosContentBox';
} else {
$oVars['renderPageOutput'] =
'phItemsBox';
}
}
$oVars['isPOS'] =
(int)PhocacartUtils::isView('pos');
$oParams['loadChosen'] =
(int)$this->p['load_chosen'];
$oParams['ajaxPaginationCategory'] =
(int)$this->p['ajax_pagination_category'];
$oParams['ajaxSearchingFilteringItems'] =
(int)$this->p['ajax_searching_filtering_items'];
$oParams['theme'] =
$this->p['theme'];
if($oVars['isPOS']) {
$oParams['theme'] = 'bs3';//
media\com_phocacart\js\phoca\jquery.phocaattribute.js line 319
}
$oVars['view'] = $this->view;
// Change Attribute data
$oVars['urlCheckoutChangeData'] = JURI::base(true) .
'/index.php?option=com_phocacart&task=checkout.changedatabox&format=json&'
. JSession::getFormToken() . '=1';
/*
* typeview
* if($oVars['isPOS']) {
// We need to identify POS in AJAX URL Request (when using
common controller like checkout, checkout controller is used in POS too)
// For example: displaying group price depends on logged in
user
// Logged in user in online shop is logged in user
// Logged in user in POS is vendor, not logged in user so in
POS displaying the group price is different
// Displaying interactive price does not have any effect on
real price in checkout
$oVars['urlCheckoutChangeData'] = JURI::base(true) .
'/index.php?option=com_phocacart&task=checkout.changedatabox&format=json&'
. JSession::getFormToken() . '=1';
}*/
$oParams['dynamicChangePrice'] =
(int)$this->p['dynamic_change_price'];
$oParams['dynamicChangeStock'] =
(int)$this->p['dynamic_change_stock'];
$oParams['dynamicChangeId'] =
(int)$this->p['dynamic_change_id'];
$oParams['dynamicChangeImage'] =
(int)$this->p['dynamic_change_image'];
$oParams['dynamicChangeUrlAttributes'] =
(int)$this->p['dynamic_change_url_attributes'];
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework', false);
//$this->document->addScript(JURI::root(true).'/media/com_phocacart/js/phoca/phocacart'.$this->t['min'].'.js');
//$this->document->addScript(JURI::root(true).'/media/com_phocacart/js/phoca/phocarequest'.$this->t['min'].'.js');
//$this->document->addScript(JURI::root(true).'/media/com_phocacart/js/filter/jquery.ba-bbq.min.js');
HTMLHelper::_('script',
'media/com_phocacart/js/phoca/phocacart' .
$this->t['min'] . '.js', array('version'
=> 'auto'), $this->scriptAtributeInline);
HTMLHelper::_('script',
'media/com_phocacart/js/phoca/phocarequest' .
$this->t['min'] . '.js', array('version'
=> 'auto'), $this->scriptAtributeInline);
HTMLHelper::_('script',
'media/com_phocacart/js/filter/jquery.ba-bbq.min.js',
array('version' => 'auto'),
$this->scriptAtributeInline);
// phocacartfilter.js can work without loaded
jquery-ui.slder.min.js - it tests if the function exist - no error
// if set in phoca cart filter moduler - the slider range can be
displayed in filter module
// in such case the following libraries are loaded:
// $this->document->addScript(JURI::root(true) .
'/media/com_phocacart/js/ui/jquery-ui.slider.min.js');
//
JHTML::stylesheet('media/com_phocacart/js/ui/jquery-ui.slider.min.css');
// if there will be problem when loading the libraries, possible
solution is to get module parameters here
// and load before phocafilter.js library
/*
$module =
JModuleHelper::getModule('mod_phocacart_filter');
$paramsM = new JRegistry($module->params);
$filter_price = $paramsM->get( 'filter_price', 1 );
if ($filter_price == 2 || $filter_price == 3) {
$this->document->addScript(JURI::root(true) .
'/media/com_phocacart/js/ui/jquery-ui.slider.min.js');
JHTML::stylesheet('media/com_phocacart/js/ui/jquery-ui.slider.min.css');
}
*/
// Are filter and search modules enabled - needed because of
phocacart.js
$modPhocaCartFilter =
JModuleHelper::getModule('mod_phocacart_filter');
// Get info if modules are enabled and installed
$modPhocaCartSearch =
JModuleHelper::getModule('mod_phocacart_search');
$oVars['mod_phocacart_filter'] = 1;
if (!$modPhocaCartFilter || (isset($modPhocaCartFilter->id)
&& (int)$modPhocaCartFilter->id < 1)) {
$oVars['mod_phocacart_filter'] = 0;
}
$oVars['mod_phocacart_search'] = 1;
if (!$modPhocaCartSearch || (isset($modPhocaCartSearch->id)
&& (int)$modPhocaCartSearch->id < 1)) {
$oVars['mod_phocacart_search'] = 0;
}
$currency = PhocacartCurrency::getCurrency();
PhocacartRenderJs::getPriceFormatJavascript($currency->price_decimals,
$currency->price_dec_symbol, $currency->price_thousands_sep,
$currency->price_currency_symbol, $currency->price_prefix,
$currency->price_suffix, $currency->price_format);
//
$this->document->addScript(JURI::root(true).'/media/com_phocacart/js/phoca/phocafilter'.$this->t['min'].'.js');
HTMLHelper::_('script',
'media/com_phocacart/js/phoca/phocafilter' .
$this->t['min'] . '.js', array('version'
=> 'auto'), $this->scriptAtributeInline);
if ($this->view == 'pos') {
$oLang['COM_PHOCACART_WARNING_BOOTSTRAP_JS_LOADED_MORE_THAN_ONCE']
=
JText::_('COM_PHOCACART_WARNING_BOOTSTRAP_JS_LOADED_MORE_THAN_ONCE');
$oLang['COM_PHOCACART_OK'] =
JText::_('COM_PHOCACART_OK');
$oLang['COM_PHOCACART_CANCEL'] =
JText::_('COM_PHOCACART_CANCEL');
$oParams['posFocusInputFields'] =
(int)$this->p['pos_focus_input_fields'];
$oParams['posFilterCategory'] =
(int)$this->p['pos_filter_category'];
$oParams['posServerPrint'] =
(int)$this->p['pos_server_print'];
$oVars['urlOrder'] =
JRoute::_('index.php?option=com_phocacart&view=order&tmpl=component&format=raw');
//$this->document->addScript(JURI::root(true).'/media/com_phocacart/js/base64/base64'.$this->t['min'].'.js');
//$this->document->addScript(JURI::root(true).'/media/com_phocacart/js/phoca/phocapos'.$this->t['min'].'.js');
HTMLHelper::_('script',
'media/com_phocacart/js/base64/base64' .
$this->t['min'] . '.js', array('version'
=> 'auto'), $this->scriptAtribute);
HTMLHelper::_('script',
'media/com_phocacart/js/phoca/phocapos' .
$this->t['min'] . '.js', array('version'
=> 'auto'), $this->scriptAtributeInline);
}
$this->document->addScriptOptions('phLangPC',
$oLang);
$this->document->addScriptOptions('phVarsPC',
$oVars);
$this->document->addScriptOptions('phParamsPC',
$oParams);
// Bootstrap 3 Modal transition
if ($this->p['theme'] == 'bs3') {
//JHtml::stylesheet(
'media/com_phocacart/bootstrap/css/bs_modal_transition.css');
HTMLHelper::_('stylesheet',
'media/com_phocacart/bootstrap/css/bs_modal_transition.css',
array('version' => 'auto'));
}
}
/**
* Returns the global PhocacartRenderMedia object, only creating it if
it doesn't already exist.
* @param string $name The name of the media
* @return PhocacartRenderMedia The PhocacartRenderMedia object
* @since 3.5
*/
public static function getInstance($name = 'main') {
if (empty(self::$instances[$name])) {
self::$instances[$name] = new PhocacartRenderMedia($name);
}
return self::$instances[$name];
}
public function loadBase() {
if ($this->load) {
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework',
false);
if ($this->p['load_main_css'] == 1) {
//JHtml::stylesheet('media/com_phocacart/css/main.css');
HTMLHelper::_('stylesheet',
'media/com_phocacart/css/main.css', array('version'
=> 'auto'));
}
$this->loadBootstrap();
if (PhocacartUtils::isView('pos')) {
//JHtml::stylesheet('media/com_phocacart/css/pos.css');
HTMLHelper::_('stylesheet',
'media/com_phocacart/css/pos.css', array('version'
=> 'auto'));
}
}
}
public function loadSpec() {
// should be loaded as last because they overwrite base
if ($this->p['load_spec_css'] != '') {
//JHtml::stylesheet('media/com_phocacart/css/spec/'.htmlspecialchars(strip_tags($this->p['load_spec_css'])).'.css');
HTMLHelper::_('stylesheet',
'media/com_phocacart/css/spec/' .
htmlspecialchars(strip_tags($this->p['load_spec_css'])) .
'.css', array('version' => 'auto'));
}
if ($this->p['load_rtl_css'] == 1) {
//JHtml::stylesheet('media/com_phocacart/css/spec/rtl.css');
HTMLHelper::_('stylesheet',
'media/com_phocacart/css/spec/rtl.css', array('version'
=> 'auto'));
}
}
public function returnLazyLoad() {
$s = array();
$s[] = '<script>';
$s[] = ' window.lazyLoadOptions = { ';
$s[] = ' elements_selector: ".ph-lazyload",';
$s[] = ' load_delay: 0,';
$s[] = ' };';
$s[] = '
window.addEventListener(\'LazyLoad::Initialized\', function
(event) {';
$s[] = ' window.phLazyLoadInstance =
event.detail.instance;';
$s[] = ' }, false);';
$s[] = '</script>';
$s[] = '<script async src="' . JURI::root(true) .
'/media/com_phocacart/js/lazyload/lazyload.min.js"></script>';
if ($this->p['lazy_load_category_items'] == 1
&& ($this->view == 'category' || $this->view ==
'items') && $this->load) {
return implode("\n", $s);
} else if ($this->p['lazy_load_categories'] == 1
&& $this->view == 'categories') {
return implode("\n", $s);
}
return '';
}
public function loadProductHover() {
if ($this->p['fade_in_action_icons'] == 1 &&
$this->load) {
if ($this->p['display_compare'] == 0 &&
$this->p['display_wishlist'] == 0 &&
$this->p['display_quickview'] == 0 &&
$this->p['display_addtocart_icon'] == 0) {
return false;
}
//JHtml::stylesheet('media/com_phocacart/css/main-product-hover.css');
HTMLHelper::_('stylesheet',
'media/com_phocacart/css/main-product-hover.css',
array('version' => 'auto'));
}
}
public function loadPhocaMoveImage($load = 0) {
if ($load == 1 && $this->load) {
//JHtml::stylesheet('media/com_phocacart/css/main-product-image-move.css'
);
HTMLHelper::_('stylesheet',
'media/com_phocacart/css/main-product-image-move.css',
array('version' => 'auto'));
}
}
public function loadBootstrap() {
if ($this->p['load_bootstrap'] == 1 &&
$this->load) {
//JHtml::stylesheet('media/com_phocacart/bootstrap/css/bootstrap.min.css'
);
//$this->document->addScript(JURI::root(true).'/media/com_phocacart/bootstrap/js/bootstrap.min.js');
HTMLHelper::_('stylesheet',
'media/com_phocacart/bootstrap/css/bootstrap.min.css',
array('version' => 'auto'));
HTMLHelper::_('script',
'media/com_phocacart/bootstrap/js/bootstrap.min.js',
array('version' => 'auto'),
$this->scriptAtribute);
} else if ($this->p['load_bootstrap'] == 2 &&
$this->load) {
//JHtml::stylesheet('media/com_phocacart/bootstrap/css/bootstrap4.min.css'
);
//$this->document->addScript(JURI::root(true).'/media/com_phocacart/bootstrap/js/bootstrap4.min.js');
HTMLHelper::_('stylesheet',
'media/com_phocacart/bootstrap/css/bootstrap4.min.css',
array('version' => 'auto'));
HTMLHelper::_('script',
'media/com_phocacart/bootstrap/js/bootstrap4.min.js',
array('version' => 'auto'),
$this->scriptAtribute);
}
}
public function loadWindowPopup() {
if ($this->load) {
//$this->document->addScript(JURI::root(true) .
'/media/com_phocacart/js/phoca/jquery.phocawindowpopup'.$this->t['min'].'.js');
HTMLHelper::_('script',
'media/com_phocacart/js/phoca/jquery.phocawindowpopup' .
$this->t['min'] . '.js', array('version'
=> 'auto'), $this->scriptAtribute);
}
}
public function loadChosen() {
if ($this->load) {
if ($this->p['load_chosen'] == 2) {
//$this->document->addScript(JURI::root(true) .
'/media/com_phocacart/bootstrap/js/bootstrap.min.js');
HTMLHelper::_('script',
'media/com_phocacart/bootstrap/js/bootstrap.min.js',
array('version' => 'auto'));
}
if ($this->p['load_chosen'] == 1 ||
$this->p['load_chosen'] == 2) {
//$this->document->addScript(JURI::root(true) .
'/media/com_phocacart/js/chosen/chosen.jquery.min.js');
//$this->document->addScript(JURI::root(true) .
'/media/com_phocacart/js/chosen/chosen.required.js');
HTMLHelper::_('script',
'media/com_phocacart/js/chosen/chosen.jquery.min.js',
array('version' => 'auto'),
$this->scriptAtributeInline);
HTMLHelper::_('script',
'media/com_phocacart/js/chosen/chosen.required.js',
array('version' => 'auto'),
$this->scriptAtributeInline);
$js = "\n" .
'jQuery(document).ready(function(){' . "\n";
$js .= '
jQuery(".chosen-select").chosen({disable_search_threshold:
10});' . "\n"; // Set chosen, created hidden will be
required
// When select box is required, display the error message
(when value not selected)
// But on mobiles, this hide standard select boxes
// we need to have condition, if really chosen is applied:
// https://github.com/harvesthq/chosen/issues/1582
//$js .= '
jQuery(".chosen-select").attr(\'style\',\'display:visible;
position:absolute; clip:rect(0,0,0,0)\');'."\n";
$js .= '});' . "\n";
$this->document->addScriptDeclaration($js);
//JHtml::stylesheet('media/com_phocacart/js/chosen/chosen.css');
//JHtml::stylesheet('media/com_phocacart/js/chosen/chosen-bootstrap.css');
HTMLHelper::_('stylesheet',
'media/com_phocacart/js/chosen/chosen.css',
array('version' => 'auto'));
HTMLHelper::_('stylesheet',
'media/com_phocacart/js/chosen/chosen-bootstrap.css',
array('version' => 'auto'));
}
}
}
public function loadFileInput() {
if ($this->load) {
//$this->document->addScript(JURI::root(true) .
'/media/com_phocacart/js/tower/tower-file-input.min.js');
//JHtml::stylesheet('media/com_phocacart/js/tower/tower-file-input.min.css');
HTMLHelper::_('stylesheet',
'media/com_phocacart/js/tower/tower-file-input.min.css',
array('version' => 'auto'));
HTMLHelper::_('script',
'media/com_phocacart/js/tower/tower-file-input.min.js',
array('version' => 'auto'),
$this->scriptAtribute);
}
}
public function loadTouchSpin($name, $icons, $load = true) {
$jsS = "\n" .
'jQuery(document).ready(function(){' . "\n";
$js = ' jQuery("input[name=\'' . $name .
'\']:visible").TouchSpin({';
$js .= ' verticalbuttons: true,';
if ($this->p['quantity_input_spinner'] == 2) {
$js .= ' verticalup: \'<span class="'
. $icons['chevron-up'] .
'"></span>\',';
$js .= ' verticaldown: \'<span
class="' . $icons['chevron-down'] .
'"></span>\',';
} else {
$js .= ' verticalup: \'<span class="'
. $icons['plus'] . '"></span>\',';
$js .= ' verticaldown: \'<span
class="' . $icons['minus'] .
'"></span>\',';
}
//$js .= ' verticalupclass:
"'.PhocacartRenderIcon::getClass('chevron-up').'",';
//$js .= ' verticaldownclass:
"'.PhocacartRenderIcon::getClass('chevron-down').'"';
$js .= ' })';
$jsE = '});' . "\n";
if ($this->p['quantity_input_spinner'] > 0
&& $load && $this->load) {
//$this->document->addScript(JURI::root(true).'/media/com_phocacart/js/touchspin/jquery.bootstrap-touchspin'.$this->t['min'].'.js');
//JHtml::stylesheet(
'media/com_phocacart/js/touchspin/jquery.bootstrap-touchspin.css'
);
HTMLHelper::_('stylesheet',
'media/com_phocacart/js/touchspin/jquery.bootstrap-touchspin.css',
array('version' => 'auto'));
HTMLHelper::_('script',
'media/com_phocacart/js/touchspin/jquery.bootstrap-touchspin' .
$this->t['min'] . '.js', array('version'
=> 'auto'), $this->scriptAtributeInline);
$this->document->addScriptDeclaration($jsS . $js . $jsE);
}
//return $js;
}
public function loadSwiper() {
if ($this->load) {
//JHtml::stylesheet('media/com_phocacart/js/swiper/swiper.min.css');
//$this->document->addScript(JURI::root(true) .
'/media/com_phocacart/js/swiper/swiper.min.js');
HTMLHelper::_('jquery.framework', false);
HTMLHelper::_('stylesheet',
'media/com_phocacart/js/swiper/swiper.min.css',
array('version' => 'auto'));
HTMLHelper::_('script',
'media/com_phocacart/js/swiper/swiper.min.js',
array('version' => 'auto'),
$this->scriptAtributeInline);
}
}
public function loadAnimateCss() {
if ($this->load) {
HTMLHelper::_('stylesheet',
'media/com_phocacart/css/animate/animate.min.css',
array('version' => 'auto'));
}
}
/*
public function loadEqualHeights() {
if ($this->p['equal_height'] == 1) {
return 'row-flex';
} else {
return '';
}
/*if ($load == 1) {
//$app = JFactory::getApplication();
//$paramsC = PhocacartUtils::getComponentParameters();
//$equal_height_method = $paramsC->get(
'equal_height_method', 1 );
$equal_height_method = 0;// FLEXBOX USED
if ($equal_height_method == 1) {
$this->document->addScript(JURI::root(true).'/media/com_phocacart/js/jquery.equal.heights.js');
//$this->document->addScript(JURI::root(true).'/media/com_phocacart/js/jquery.equalminheights.min.js');
$this->document->addScriptDeclaration(
'jQuery(window).load(function(){
jQuery(\'.ph-thumbnail-c\').equalHeights();
});');
} else if ($equal_height_method == 2) {
$this->document->addScript(JURI::root(true).'/media/com_phocacart/js/jquery.matchheight.min.js');
$this->document->addScriptDeclaration(
'jQuery(window).load(function(){
jQuery(\'.ph-thumbnail-c\').matchHeight();
});');
} else if ($equal_height_method == 3) {
$this->document->addScript(JURI::root(true).'/media/com_phocacart/js/jquery.matchheight.min.js');
$this->document->addScriptDeclaration(
'jQuery(window).load(function(){
jQuery(\'.ph-thumbnail-c.grid\').matchHeight({
byRow: false,
property: \'height\',
target: null,
remove: false
});
});');
}
// not ph-thumbnail but only ph-thumbnail-c (in component
area so module will not influence it)
}
}*/
public function loadPhocaSwapImage() {
if ($this->p['dynamic_change_image'] == 1 &&
$this->load) {
//$this->document->addScript(JURI::root(true).'/media/com_phocacart/js/phoca/jquery.phocaswapimage'.$this->t['min'].'.js');
HTMLHelper::_('script',
'media/com_phocacart/js/phoca/jquery.phocaswapimage' .
$this->t['min'] . '.js', array('version'
=> 'auto'), $this->scriptAtribute);
}
}
public function loadPhocaAttribute($load = 0) {
if ($load == 1 && $this->load) {
//$this->document->addScript(JURI::root(true).'/media/com_phocacart/js/phoca/jquery.phocaattribute'.$this->t['min'].'.js');
HTMLHelper::_('script',
'media/com_phocacart/js/base64/base64' .
$this->t['min'] . '.js', array('version'
=> 'auto'), $this->scriptAtributeInline);
HTMLHelper::_('script',
'media/com_phocacart/js/phoca/jquery.phocaattribute' .
$this->t['min'] . '.js', array('version'
=> 'auto'), $this->scriptAtributeInline);
}
}
public function loadPhocaAttributeRequired($load = 0) {
if ($load == 1 && $this->load) {
//$this->document->addScript(JURI::root(true).'/media/com_phocacart/js/phoca/jquery.phocaattributerequired'.$this->t['min'].'.js');
HTMLHelper::_('script',
'media/com_phocacart/js/phoca/jquery.phocaattributerequired' .
$this->t['min'] . '.js', array('version'
=> 'auto'), $this->scriptAtribute);
}
}
public function loadRating() {
if ($this->load) {
//JHtml::stylesheet('media/com_phocacart/js/barrating/css/rating.css');
//JHtml::stylesheet('media/com_phocacart/js/barrating/themes/css-stars.css');
//$this->document->addScript(JURI::root(true) .
'/media/com_phocacart/js/barrating/jquery.barrating'.$this->t['min'].'.js');
HTMLHelper::_('stylesheet',
'media/com_phocacart/js/barrating/themes/css-stars.css',
array('version' => 'auto'));
HTMLHelper::_('script',
'media/com_phocacart/js/barrating/jquery.barrating' .
$this->t['min'] . '.js', array('version'
=> 'auto'), $this->scriptAtributeInline);
$js = "\n" .
'jQuery(document).ready(function(){' . "\n";
$js .= ' jQuery(\'#phitemrating\').barrating({
showSelectedRating:false, theme: \'css-stars\' });' .
"\n";
$js .= '});' . "\n";
$this->document->addScriptDeclaration($js);
}
}
public function loadUiSlider() {
if ($this->load) {
//$document->addScript(JURI::root(true) .
'/media/com_phocacart/js/ui/jquery-ui.slider.min.js');
//JHTML::stylesheet('media/com_phocacart/js/ui/jquery-ui.slider.min.css');
HTMLHelper::_('stylesheet',
'media/com_phocacart/js/ui/jquery-ui.slider.min.css',
array('version' => 'auto'));
HTMLHelper::_('script',
'media/com_phocacart/js/ui/jquery-ui.slider.min.js',
array('version' => 'auto'),
$this->scriptAtributeInline);
// Can be set in case of problem with Joomla! core bootstrap
which loads tooltip js
// libraries/cms/html/bootstrap.php cca line 500 - loaded e.g.
per pagination
//HTMLHelper::_('script',
'media/com_phocacart/js/ui/jquery-ui.slider.tooltip.min.js',
array('version' => 'auto'),
$this->scriptAtribute);
}
}
public function loadJsTree() {
if ($this->load) {
//JHTML::stylesheet('media/com_phocacart/js/jstree/themes/proton/style.min.css');
//$document->addScript(JURI::root(true).'/media/com_phocacart/js/jstree/jstree.min.js');
HTMLHelper::_('stylesheet',
'media/com_phocacart/js/jstree/themes/proton/style.min.css',
array('version' => 'auto'));
HTMLHelper::_('script',
'media/com_phocacart/js/jstree/jstree.min.js',
array('version' => 'auto'),
$this->scriptAtributeInline);
}
}
public function renderMagnific() {
HTMLHelper::_('stylesheet',
'media/com_phocacart/js/magnific/magnific-popup.css',
array('version' => 'auto'));
HTMLHelper::_('script',
'media/com_phocacart/js/magnific/jquery.magnific-popup.min.js',
array('version' => 'auto'),
$this->scriptAtributeInline);
$s = array();
$s[] = 'jQuery(document).ready(function() {';
$s[] =
' jQuery(\'#phImageBox\').magnificPopup({';
$s[] = ' tLoading: \'' .
JText::_('COM_PHOCACART_LOADING') . '\',';
$s[] = ' tClose: \'' .
JText::_('COM_PHOCACART_CLOSE') . '\',';
$s[] = ' delegate: \'a.magnific\',';
$s[] = ' type: \'image\',';
$s[] = ' mainClass: \'mfp-img-mobile\',';
$s[] = ' zoom: {';
$s[] = ' enabled: true,';
$s[] = ' duration: 300,';
$s[] = ' easing: \'ease-in-out\'';
$s[] = ' },';
$s[] = ' gallery: {';
$s[] = ' enabled: true,';
$s[] = ' navigateByImgClick: true,';
$s[] = ' tPrev: \'' .
JText::_('COM_PHOCACART_PREVIOUS') . '\',';
$s[] = ' tNext: \'' .
JText::_('COM_PHOCACART_NEXT') . '\',';
$s[] = ' tCounter: \'' .
JText::_('COM_PHOCACART_MAGNIFIC_CURR_OF_TOTAL') .
'\'';
$s[] = ' },';
$s[] = ' image: {';
$s[] = ' titleSrc: function(item) {';
$s[] = ' return item.el.attr(\'title\');';
$s[] = ' },';
$s[] = ' tError: \'' .
JText::_('COM_PHOCACART_IMAGE_NOT_LOADED') . '\'';
$s[] = ' }';
$s[] = ' });';
$s[] = '});';
$this->document->addScriptDeclaration(implode("\n",
$s));
}
public function renderPrettyPhoto() {
HTMLHelper::_('stylesheet',
'media/com_phocacart/js/prettyphoto/css/prettyPhoto.css',
array('version' => 'auto'));
HTMLHelper::_('script',
'media/com_phocacart/js/prettyphoto/js/jquery.prettyPhoto.js',
array('version' => 'auto'),
$this->scriptAtributeInline);
$s[] = 'jQuery(document).ready(function(){';
$s[] =
' jQuery("a[rel^=\'prettyPhoto\']").prettyPhoto({';
$s[] = ' social_tools: 0';
$s[] = ' });';
$s[] = '})';
$this->document->addScriptDeclaration(implode("\n",
$s));
}
public function renderChartJs() {
HTMLHelper::_('script',
'media/com_phocacart/js/chartjs/Chart.min.js',
array('version' => 'auto'),
$this->scriptAtribute);
}
}
?>
PK�"�[��$Ym7m7$libraries/phocacart/render/style.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class PhocacartRenderStyle
{
private static $styles = array();
private function __construct(){}
/*
* Not all classes are loaded this way, only the classes which can
change for different libraries like bootstrap3, bootstrap4, etc.
*/
public static function getStyles() {
if(empty(self::$styles)) {
$app = JFactory::getApplication();
$pC = PhocacartUtils::getComponentParameters();
$pos = PhocacartPos::isPos();
$admin = $app->isClient('administrator');
if ($pos || $admin) {
$theme = 'bs3';
$icons = 'bs';// only icons are now active for
admin
} else {
$theme = $pC->get( 'theme',
'bs3' );
$icons = $pC->get( 'icon_type',
'bs' );
}
self::$styles = self::loadStyles($theme, $icons);
}
return self::$styles;
}
public static function loadStyles($theme, $icons) {
$s = array();
// ===============
// CLASS - Default
// ===============
$s['c']['class-type'] = 'bs3';
$s['c']['row'] = 'row';
$s['c']['row-item'] =
'row-item';
$s['c']['row.row-flex'] = 'row
row-flex';
$s['c']['col.xs12.sm1.md1'] = 'col-xs-12
col-sm-1 col-md-1';
$s['c']['col.xs12.sm2.md2'] = 'col-xs-12
col-sm-2 col-md-2';
$s['c']['col.xs12.sm3.md3'] = 'col-xs-12
col-sm-3 col-md-3';
$s['c']['col.xs12.sm4.md4'] = 'col-xs-12
col-sm-4 col-md-4';
$s['c']['col.xs12.sm5.md5'] = 'col-xs-12
col-sm-5 col-md-5';
$s['c']['col.xs12.sm6.md6'] = 'col-xs-12
col-sm-6 col-md-6';
$s['c']['col.xs12.sm7.md7'] = 'col-xs-12
col-sm-7 col-md-7';
$s['c']['col.xs12.sm8.md8'] = 'col-xs-12
col-sm-8 col-md-8';
$s['c']['col.xs12.sm9.md9'] = 'col-xs-12
col-sm-9 col-md-9';
$s['c']['col.xs12.sm10.md10'] = 'col-xs-12
col-sm-10 col-md-10';
$s['c']['col.xs12.sm12.md12'] = 'col-xs-12
col-sm-12 col-md-12';
$s['c']['col.xs2.sm2.md2'] = 'col-xs-2
col-sm-2 col-md-2';
$s['c']['col.xs6.sm6.md6'] = 'col-xs-6
col-sm-6 col-md-6';
$s['c']['col.xs10.sm10.md10'] = 'col-xs-10
col-sm-10 col-md-10';
$s['c']['col.xs0.sm0.md0'] = 'col-xs-0
col-sm-0 col-md-0';
$s['c']['col.xs3.sm3.md3'] = 'col-xs-3
col-sm-3 col-md-3';
$s['c']['col.xs4.sm4.md4'] = 'col-xs-4
col-sm-4 col-md-4';
$s['c']['col.xs8.sm8.md8'] = 'col-xs-8
col-sm-8 col-md-8';
$s['c']['col.xs0.sm6.md6'] = 'col-xs-0
col-sm-6 col-md-6';
$s['c']['col.xs8.sm4.md4'] = 'col-xs-8
col-sm-4 col-md-4';
$s['c']['col.xs4.sm2.md2'] = 'col-xs-4
col-sm-2 col-md-2';
$s['c']['btn-group'] =
'btn-group';
$s['c']['btn'] = 'btn';
$s['c']['btn.btn-primary'] = 'btn
btn-primary';
$s['c']['btn.btn-secondary'] = 'btn
btn-secondary';
$s['c']['btn.btn-success'] = 'btn
btn-success';
$s['c']['btn.btn-default'] = 'btn
btn-default';
$s['c']['btn.btn-danger'] = 'btn
btn-danger';
$s['c']['btn.btn-info'] = 'btn
btn-info';
$s['c']['btn.btn-default.btn-sm'] = 'btn
btn-default btn-sm';
$s['c']['btn.btn-primary.btn-sm'] = 'btn
btn-primary btn-sm';
$s['c']['btn.btn-success.btn-sm'] = 'btn
btn-success btn-sm';
$s['c']['btn.btn-danger.btn-sm'] = 'btn btn-danger
btn-sm';
$s['c']['btn.btn-warning.btn-sm'] = 'btn
btn-warning btn-sm';
//$s['c']['btn.btn-success.btn-xs'] = 'btn
btn-success btn-xs';
//$s['c']['btn.btn-danger.btn-xs'] = 'btn
btn-danger btn-xs';
$s['c']['btn.btn-success.btn-lg'] = 'btn
btn-success btn-lg';
$s['c']['pull-left'] =
'ph-pull-left';
$s['c']['pull-right'] =
'ph-pull-right';
$s['c']['caption'] = 'caption';
$s['c']['thumbnail'] = 'thumbnail';
$s['c']['img-responsive'] =
'img-responsive';
$s['c']['grid'] = 'grid';
$s['c']['cat_item_grid'] =
'jf_ph_cat_item_grid';
$s['c']['cat_item_btns'] =
'jf_ph_cat_item_btns_wrap';
$s['c']['cat_list'] = 'jf_ph_cat_list';
$s['c']['item_review_form'] =
'jf_ph_cart_item_review';
$s['c']['tabnav'] = 'nav
nav-tabs';
$s['c']['nav-item'] =
'nav-item';
$s['c']['nav-link'] =
'nav-link';
$s['c']['tabcontent'] =
'tab-content';
$s['c']['tabpane'] = 'tab-pane
fade';
$s['c']['tabactive'] = 'active
in';
$s['c']['tabactvietab'] = 'active
in';
$s['c']['panel.panel-default'] = 'panel
panel-default';
$s['c']['panel-heading'] =
'panel-heading';
$s['c']['panel-title'] =
'panel-title';
$s['c']['panel-body'] =
'panel-body';
$s['c']['panel-collapse.collapse'] =
'panel-collapse collapse';
$s['c']['panel-collapse.collapse.in'] =
'panel-collapse collapse in';
$s['c']['label.label-success'] = 'label
label-success badge badge-success';
$s['c']['label.label-danger'] = 'label
label-important label-danger badge badge-danger';
$s['c']['label.label-info'] = 'label
label-info badge badge-info';
$s['c']['modal.zoom'] = 'modal
zoom';
$s['c']['modal-dialog'] =
'modal-dialog';
$s['c']['modal-content'] =
'modal-content';
$s['c']['modal-header'] =
'modal-header';
$s['c']['modal-body'] =
'modal-body';
$s['c']['modal-footer'] =
'modal-footer';
$s['c']['modal-lg'] =
'modal-lg';
$s['c']['controls'] =
'controls';
$s['c']['control-label'] =
'control-label';
$s['c']['control-group'] =
'control-group';
$s['c']['control-group.form_inline']=
'control-group form-inline';
$s['c']['form-group'] =
'form-group';
$s['c']['form-control'] =
'form-control';
$s['c']['form-inline'] =
'form-inline';
$s['c']['form-horizontal'] =
'form-horizontal';
$s['c']['form-horizontal.form-validate'] =
'form-horizontal form-validate';
$s['c']['form-check'] =
'form-check';
$s['c']['form-check-input'] =
'form-check-input';
$s['c']['form-check-label'] =
'form-check-label';
$s['c']['checkbox'] =
'checkbox';
$s['c']['inputbox'] =
'inputbox';
$s['c']['inputbox.form-control'] = 'inputbox
form-control';
$s['c']['hastooltip'] =
'hasTooltipPc';// 'hasTooltip' can create JS problems
on site (mixing different libraries)
switch($theme) {
case 'bs4':
$s['c']['col.xs12.sm3.md3'] =
'col-sm-12 col-md-3 col-lg-3 col-xl-3';
$s['c']['col.xs12.sm4.md4'] =
'col-sm-12 col-md-4 col-lg-4 col-xl-4';
$s['c']['class-type'] =
'bs4';
$s['c']['modal.zoom'] =
'modal';
$s['c']['btn.btn-default'] =
'btn btn-primary';
$s['c']['btn.btn-default.btn-sm'] =
'btn btn-primary btn-sm';
$s['c']['tabactive'] =
'active show';
$s['c']['tabactvietab'] =
'';
$s['c']['panel-collapse.collapse.in'] =
'panel-collapse collapse show';
$s['c']['label.label-success'] =
'badge badge-success';
$s['c']['label.label-danger'] =
'badge badge-danger';
$s['c']['label.label-info'] =
'badge badge-info';
break;
case 'bootstrap3':
default:
// Default
break;
}
// ===============
// ICONS - Default
// ===============
$pf = 'glyphicon glyphicon-';
$sf = '';
// Icon type name
$s['i']['icon-type'] = 'bs';
$s['i']['view-category'] =
$pf.'search'.$sf;
$s['i']['view-product'] =
$pf.'search'.$sf;
$s['i']['back-category'] =
$pf.'arrow-left'.$sf;
$s['i']['ok'] = $pf.'ok'.$sf;
$s['i']['not-ok'] =
$pf.'remove'.$sf;
$s['i']['remove'] =
$pf.'remove'.$sf;
$s['i']['clear'] =
$pf.'remove'.$sf;
$s['i']['remove-circle'] =
$pf.'remove-sign'.$sf;
$s['i']['edit'] =
$pf.'edit'.$sf;
$s['i']['plus'] =
$pf.'plus'.$sf;
$s['i']['minus'] =
$pf.'minus'.$sf;
$s['i']['chevron-up'] =
$pf.'chevron-up'.$sf;
$s['i']['chevron-down'] =
$pf.'chevron-down'.$sf;
$s['i']['shopping-cart'] =
$pf.'shopping-cart'.$sf;
$s['i']['question-sign'] =
$pf.'question-sign'.$sf;
$s['i']['info-sign'] =
$pf.'info-sign'.$sf;
$s['i']['compare'] =
$pf.'stats'.$sf;
$s['i']['ext-link'] =
$pf.'share'.$sf;
$s['i']['int-link'] =
$pf.'share-alt'.$sf;
$s['i']['download'] =
$pf.'download'.$sf;
$s['i']['download-alt'] =
$pf.'download-alt'.$sf;
$s['i']['quick-view'] =
$pf.'eye-open'.$sf;
$s['i']['wish-list'] =
$pf.'heart'.$sf;
$s['i']['ban'] =
$pf.'ban-circle'.$sf;
$s['i']['refresh'] =
$pf.'refresh'.$sf;
$s['i']['trash'] =
$pf.'trash'.$sf;
$s['i']['triangle-bottom'] =
$pf.'triangle-bottom'.$sf;
$s['i']['triangle-right'] =
$pf.'triangle-right'.$sf;
$s['i']['save'] =
$pf.'floppy-disk'.$sf;
$s['i']['user'] =
$pf.'user'.$sf;
$s['i']['grid'] =
$pf.'th-large'.$sf;
$s['i']['gridlist'] =
$pf.'th-list'.$sf;
$s['i']['list'] =
$pf.'align-justify'.$sf;
$s['i']['next'] =
$pf.'arrow-right'.$sf;
$s['i']['prev'] =
$pf.'arrow-left'.$sf;
$s['i']['submit'] = $pf.'ok'.$sf;
$s['i']['list-alt'] =
$pf.'list-alt'.$sf;
$s['i']['invoice'] =
$pf.'list-alt'.$sf;
$s['i']['del-note'] =
$pf.'barcode'.$sf;
$s['i']['order'] =
$pf.'search'.$sf;
$s['i']['receipt'] =
$pf.'th-list'.$sf;
$s['i']['print'] =
$pf.'print'.$sf;
$s['i']['barcode'] =
$pf.'barcode'.$sf;
$s['i']['search'] =
$pf.'search'.$sf;
$s['i']['payment-method'] =
$pf.'credit-card'.$sf;
$s['i']['shipping-method'] =
$pf.'barcode'.$sf;
$s['i']['log-out'] =
$pf.'arrow-left'.$sf;
$s['i']['calendar'] =
$pf.'calendar'.$sf;
$s['i']['globe'] =
$pf.'globe'.$sf;
$s['i']['upload'] =
$pf.'upload'.$sf;
switch($icons) {
case 'fa':
case 'fa5':
$pf = 'fa fa-';
$sf = ' fa-fw';
// Icon type name
$s['i']['icon-type'] = 'fa';
$s['i']['view-category'] =
$pf.'search'.$sf;
$s['i']['view-product'] =
$pf.'search'.$sf;
$s['i']['back-category'] =
$pf.'arrow-left'.$sf;
$s['i']['ok'] =
$pf.'check'.$sf;
$s['i']['not-ok'] =
$pf.'remove'.$sf;
$s['i']['remove'] =
$pf.'remove'.$sf;
$s['i']['clear'] =
$pf.'remove'.$sf;
$s['i']['remove-circle'] =
$pf.'times-circle'.$sf;
$s['i']['edit'] =
$pf.'edit'.$sf;
$s['i']['plus'] =
$pf.'plus'.$sf;
$s['i']['minus'] =
$pf.'minus'.$sf;
$s['i']['chevron-up'] =
$pf.'chevron-up'.$sf;
$s['i']['chevron-down'] =
$pf.'chevron-down'.$sf;
$s['i']['shopping-cart'] =
$pf.'shopping-bag'.$sf;
$s['i']['question-sign'] =
$pf.'question-circle'.$sf;
$s['i']['info-sign'] =
$pf.'info-circle'.$sf;
$s['i']['compare'] =
$pf.'clone'.$sf;
$s['i']['ext-link'] =
$pf.'share'.$sf;
$s['i']['int-link'] =
$pf.'share-alt'.$sf;
$s['i']['download'] =
$pf.'download'.$sf;
$s['i']['quick-view'] = $pf.'eye'.$sf;
$s['i']['wish-list'] =
$pf.'heart'.$sf;
$s['i']['ban'] = $pf.'ban'.$sf;
$s['i']['refresh'] =
$pf.'refresh'.$sf;
$s['i']['trash'] =
$pf.'trash'.$sf;
$s['i']['triangle-bottom'] =
$pf.'caret-down'.$sf;
$s['i']['triangle-right'] =
$pf.'caret-right'.$sf;
$s['i']['save'] =
$pf.'save'.$sf;
$s['i']['user'] =
$pf.'user'.$sf;
$s['i']['grid'] =
$pf.'th-large'.$sf;
$s['i']['gridlist'] =
$pf.'th-list'.$sf;
$s['i']['list'] =
$pf.'align-justify'.$sf;
$s['i']['next'] =
$pf.'arrow-right'.$sf;
$s['i']['prev'] =
$pf.'arrow-left'.$sf;
$s['i']['submit'] =
$pf.'check'.$sf;
$s['i']['list-alt'] =
$pf.'list-alt'.$sf;
$s['i']['invoice'] = $pf.'list-alt
fa-file-invoice-dollar'.$sf;
$s['i']['del-note'] = $pf.'barcode
fa-file-invoice'.$sf;
$s['i']['order'] = $pf.'search
fa-file-alt'.$sf;
$s['i']['receipt'] = $pf.'th-list
fa-receipt'.$sf;
$s['i']['print'] =
$pf.'print'.$sf;
$s['i']['barcode'] =
$pf.'barcode'.$sf;
$s['i']['search'] =
$pf.'search'.$sf;
$s['i']['payment-method'] =
$pf.'credit-card'.$sf;
$s['i']['shipping-method'] =
$pf.'barcode'.$sf;
$s['i']['log-out'] =
$pf.'sign-out-alt'.$sf;
$s['i']['calendar'] =
$pf.'calendar'.$sf;
$s['i']['globe'] =
$pf.'globe'.$sf;
$s['i']['upload'] =
$pf.'upload'.$sf;
if ($icons == 'fa5') {
$s['i']['icon-type'] = 'fa fa5';
$s['i']['refresh'] =
$pf.'redo'.$sf;
$s['i']['remove'] =
$pf.'times'.$sf;
$s['i']['clear'] =
$pf.'times'.$sf;
}
break;
case 'bs3':
case 'bs4':
default:
// Default
break;
}
return $s;
}
public final function __clone() {
throw new Exception('Function Error: Cannot clone instance of
Singleton pattern', 500);
return false;
}
}
?>
PK�"�[�#o,,%libraries/phocacart/review/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�G���%libraries/phocacart/review/review.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartReview
{
public static function getReviewsByProduct($productId) {
$db = JFactory::getDBO();
if ((int)$productId > 0) {
$columns = 'a.id, a.product_id, a.user_id, a.name, a.rating,
a.review, a.date, a.published';
$groupsFull = $columns;
$groupsFast = 'a.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
$query = 'SELECT '.$columns
.' FROM #__phocacart_reviews AS a'
.' WHERE a.product_id = '.(int) $productId
.' AND a.published = 1'
.' GROUP BY '.$groups;
$db->setQuery($query);
$reviews = $db->loadObjectList();
return $reviews;
}
return false;
}
public static function addReview( &$error, $approveReview, $productId,
$userId, $userName, $rating, $review) {
if ((int)$productId > 0 && (int)$userId > 0 &&
$userName != '' && (int)$rating > 0 && $review
!= '') {
$db = JFactory::getDBO();
$published = 0;
if ($approveReview == 0) {
$published = 1;
}
// Check if user added some review to the product
$query = 'SELECT a.id FROM #__phocacart_reviews AS a'
.' WHERE a.product_id = '.(int) $productId
.' AND a.user_id = '.(int)$userId
.' ORDER BY a.id';
$db->setQuery($query);
$reviewed = $db->loadColumn();
if (!empty($reviewed)) {
$error = 1;
return false;
}
$date = JFactory::getDate()->toSql();
$query = ' INSERT INTO #__phocacart_reviews (product_id, user_id,
name, rating, review, published, date)'
.' VALUES ('
.(int)$productId.', '
.(int)$userId.', '
.$db->quote(strip_tags($userName)).', '
.(int)$rating.', '
.$db->quote(strip_tags($review)).', '
.(int)$published.', '
.$db->quote($date)
.')';
$db->setQuery($query);
$db->execute();
return true;
} else {
$error = 2;
return false;
}
}
}
PK�"�[�#o,,%libraries/phocacart/reward/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��%libraries/phocacart/reward/reward.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
/*
* $reward['points_needed'] or $reward['needed'] ...
how many points are needed to buy the product
* $reward['points_received'] or $reward['received']
... how many points do customer get when he/she buy the product
* $reward['wantstouse'] ... how many points wants the
customer use when buying items
* $reward['used'] ... how many points were really used
* $reward['usertotal'] ... how many points user have in
his/her account
* $reward['usedtotal'] ... how many points user used
(and it was allowed) when ordering items
*/
defined('_JEXEC') or die();
class PhocacartReward
{
protected $reward;
protected $total;
public function __construct() {
$this->total = array();
}
public function getTotalPointsByUserId($userId) {
if ($userId > 0) {
if (empty($this->total[$userId])) {
$db = JFactory::getDBO();
$query = 'SELECT SUM(a.points) FROM #__phocacart_reward_points AS
a'
.' WHERE a.user_id = '.(int) $userId
.' AND a.published = 1'
.' GROUP BY a.user_id'
.' ORDER BY a.id';
$db->setQuery($query);
$total = $db->loadResult();
if (!$total) {
$total = 0;
}
$this->total[$userId] = (int)$total;
}
return $this->total[$userId];
}
return 0;
}
public function checkReward($points, $msgOn = 0) {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$enable_rewards = $paramsC->get( 'enable_rewards', 1 );
$rewards = array();
$rewards['usertotal'] = 0;
$rewards['wantstouse'] = (int)$points;
$rewards['used'] = false;
// 1. ENABLE REWARDS
if ($enable_rewards == 0) {
if ($msgOn == 1) {
$app->enqueueMessage(JText::_('COM_PHOCACART_REWARD_POINTS_DISABLED'),
'error');
}
return false;
}
// 2. USER
$user = PhocacartUser::getUser();
if ($user->id > 0) {
$rewards['usertotal'] =
$this->getTotalPointsByUserId($user->id);
} else {
if ($msgOn == 1) {
$app->enqueueMessage(JText::_('COM_PHOCACART_USER_NOT_FOUND'),
'error');
}
return false;
}
// 3. TOTAL
if ($rewards['usertotal'] == $rewards['wantstouse'])
{
$rewards['used'] = $rewards['wantstouse'];
} else if ($rewards['usertotal'] >
$rewards['wantstouse']) {
$rewards['used'] = $rewards['wantstouse'];
} else if ($rewards['usertotal'] <
$rewards['wantstouse']) {
$rewards['used'] = $rewards['usertotal'];
}
return $rewards['used'];
}
public function calculatedRewardDiscountProduct(&$rewards) {
$rewards['percentage'] = 0;
$rewards['usedproduct'] = 0;
if ($rewards['needed'] == $rewards['used']) {
$rewards['usedproduct'] = $rewards['used'];
$rewards['percentage'] = 100;
$rewards['used'] = 0; // Rest
} else if ($rewards['needed'] > $rewards['used'])
{
$rewards['usedproduct'] = $rewards['used'];
$rewards['percentage'] = 100 *
$rewards['usedproduct'] / $rewards['needed'];
$rewards['used'] = $rewards['used'] -
$rewards['usedproduct'];// Rest
} else if ($rewards['used'] > $rewards['needed'])
{
$rewards['usedproduct'] = $rewards['needed'];
$rewards['percentage'] = 100;
$rewards['used'] = $rewards['used'] -
$rewards['needed']; // Rest
}
$rewards['usedtotal'] += $rewards['usedproduct'];
}
public static function getPoints($points, $type = 'received',
$groupPoints = null) {
$pointsO = null;
//$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$enable_rewards = $paramsC->get( 'enable_rewards', 1 );
if ($enable_rewards == 0) {
return $pointsO;
}
if ($type == 'needed') {
if ($points > 0) {
$pointsO = $points;
}
} else if ($type == 'received') {
if ($points > 0) {
$pointsO = $points;
}
if ($groupPoints > 0) {
$pointsO = $groupPoints;
}
}
return $pointsO;
}
// STATIC PART
public static function getTotalPointsByUserIdExceptCurrentOrder($userId,
$orderId) {
if ((int)$userId > 0 && (int)$orderId > 0) {
$db = JFactory::getDBO();
$query = 'SELECT SUM(a.points) FROM #__phocacart_reward_points AS
a'
.' WHERE a.user_id = '.(int)$userId
.' AND a.order_id <> '.(int)$orderId
.' AND a.published = 1'
.' GROUP BY a.order_id'
.' ORDER BY a.id';
$db->setQuery($query);
$total = $db->loadResult();
if (!$total) {
$total = 0;
}
return (int)$total;
}
return 0;
}
public static function getTotalPointsByOrderId($orderId) {
if ((int)$orderId > 0) {
$db = JFactory::getDBO();
$query = 'SELECT SUM(a.points) FROM #__phocacart_reward_points AS
a'
.' WHERE a.order_id = '.(int)$orderId
// .' AND a.published = 1' Get all points (+/-) even they are
not authorized yet (add info to customer how much point he can get)
.' GROUP BY a.order_id'
.' ORDER BY a.id';
$db->setQuery($query);
$total = $db->loadResult();
if (!$total) {
$total = 0;
}
return (int)$total;
}
return 0;
}
public static function getRewardPointsByOrderId($orderId) {
if ((int)$orderId > 0) {
$db = JFactory::getDBO();
$query = 'SELECT a.title, a.points, a.order_id, a.type,
a.published FROM #__phocacart_reward_points AS a'
.' WHERE a.order_id = '.(int)$orderId
.' ORDER BY a.id';
$db->setQuery($query);
$points = $db->loadObjectList();
if (!empty($points)) {
return $points;
}
}
return false;
}
}
PK�"�[��ys@N@N#libraries/phocacart/route/route.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die;
jimport('joomla.application.component.helper');
class PhocacartRoute
{
public static function getCategoriesRoute($lang = array()) {
$app = JFactory::getApplication();
$menu = $app->getMenu();
$active = $menu->getActive();
$option = $app->input->get( 'option', '',
'string' );
$view = $app->input->get( 'view', '',
'string' );
$activeId = 0;
if (isset($active->id)){
$activeId = $active->id;
}
$itemId = 0;
if ((int)$activeId > 0 &&$option == 'com_phocacart'
&& $view == 'category') {
// 2) if there are two menu links, try to select the one active
$itemId = $activeId;
}
$needles = array(
'categories' => ''
);
//Create the link
$link = 'index.php?option=com_phocacart&view=categories';
if($item = PhocacartRoute::_findItem($needles, 1, $lang)) {
if(isset($item->query['layout'])) {
$link .= '&layout='.$item->query['layout'];
}
// $item->id should be a "categories view" and it should
have preference to category view
// so first we check item->id then itemId
if (isset($item->id) && ((int)$item->id > 0)) {
$link .= '&Itemid='.$item->id;
} else if ((int)$itemId > 0) {
$link .= '&Itemid='.(int)$itemId;
}
};
return $link;
}
public static function getCategoryRoute($catid, $catidAlias =
'', $lang = array()) {
$pC = PhocacartUtils::getComponentParameters();
$skip_category_view = $pC->get('skip_category_view',
0);
if ($skip_category_view == 1) {
return self::getItemsRoute('', '',
'c', (int)$catid .'-'.$catidAlias) ;
}
$app = JFactory::getApplication();
$menu = $app->getMenu();
$active = $menu->getActive();
$option = $app->input->get( 'option', '',
'string' );
$view = $app->input->get( 'view', '',
'string' );
$activeId = 0;
if (isset($active->id)){
$activeId = $active->id;
}
if ((int)$activeId > 0 && $option == 'com_phocacart'
&& $view == 'category') {
$needles = array(
'category' => (int)$catid,
'categories' => (int)$activeId
);
} else {
$needles = array(
'category' => (int)$catid,
'categories' => ''
);
}
if ($catidAlias != '') {
$catid = $catid . ':' . $catidAlias;
}
$link =
'index.php?option=com_phocacart&view=category&id='.$catid;
return self::_buildLink($link, $needles, $lang);
}
public static function getCategoryRouteByTag($tagId) {
$app = JFactory::getApplication();
$menu = $app->getMenu();
$active = $menu->getActive();
$option = $app->input->get( 'option', '',
'string' );
$activeId = 0;
if (isset($active->id)){
$activeId = $active->id;
}
if ((int)$activeId > 0 && $option ==
'com_phocacart') {
$needles = array(
'category' => '',
'categories' => (int)$activeId
);
} else {
$needles = array(
'category' => '',
'categories' => ''
);
}
$db = JFactory::getDBO();
$query = 'SELECT a.id, a.title, a.link_ext, a.link_cat'
.' FROM #__phocacart_tags AS a'
.' WHERE a.id = '.(int)$tagId
.' ORDER BY a.id';
$db->setQuery($query, 0, 1);
$tag = $db->loadObject();
if (isset($tag->id)) {
$link =
'index.php?option=com_phocacart&view=category&id=tag&tagid='.(int)$tag->id;
} else {
$link =
'index.php?option=com_phocacart&view=category&id=tag&tagid=0';
}
return self::_buildLink($link, $needles);
}
/* Items route can be without id or with id, if id, then it is a category
id
*/
public static function getItemsRoute($catid = '', $catidAlias =
'', $parameter = '', $value = '') {
$app = JFactory::getApplication();
$menu = $app->getMenu();
$active = $menu->getActive();
$option = $app->input->get( 'option', '',
'string' );
$view = $app->input->get( 'view', '',
'string' );
$activeId = 0;
if (isset($active->id)){
$activeId = $active->id;
}
if ((int)$activeId > 0 && $option ==
'com_phocacart') {
if (isset($catid) && (int)$catid > 0) {
$needles = array(
'items' => (int) $catid,
'category' => (int) $catid,
'categories' => (int)$activeId
);
} else {
$needles = array(
'items' => '',
'category' => '',
'categories' => ''
);
}
} else {
if (isset($catid) && (int)$catid > 0) {
$needles = array(
'items' => (int) $catid,
'category' => (int) $catid,
'categories' => ''
);
} else {
$needles = array(
'items' => '',
'category' => '',
'categories' => ''
);
}
}
if ($catidAlias != '') {
$catid = $catid . ':' . $catidAlias;
}
if ($catid != '') {
$link =
'index.php?option=com_phocacart&view=items&id='.$catid;
} else if ($parameter != '' && $value != '')
{
$link =
'index.php?option=com_phocacart&view=items&'.htmlspecialchars($parameter).'='.htmlspecialchars($value);
} else {
$link = 'index.php?option=com_phocacart&view=items';
}
return self::_buildLink($link, $needles);
}
public static function getItemRoute($id, $catid = 0, $idAlias =
'', $catidAlias = '', $lang = array(), $forceView = 0)
{
$app = JFactory::getApplication();
$menu = $app->getMenu();
$active = $menu->getActive();
$option = $app->input->get( 'option', '',
'string' );
$view = $app->input->get( 'view', '',
'string' );
if ($forceView == 1) {
$view = 'item';// We link the view from administration - to
preview the product
}
/*$catidCurrent = $app->input->get( 'id', 0,
'int' );
if ($catidCurrent > 0) {
$catid = $catidCurrent;
}*/
$activeId = 0;
if (isset($active->id)){
$activeId = $active->id;
}
if ((int)$activeId > 0 && $option == 'com_phocacart'
&& $view == 'item') {
$needles = array(
'item' => (int) $id,
'category' => (int) $catid,
'categories' => (int)$activeId,
'items' => (int)$catid
);
} else {
$needles = array(
'item' => (int) $id,
'category' => (int) $catid,
'categories' => '',
'items' => ''
);
}
if ($idAlias != '') {
$id = (int)$id . ':' . $idAlias;
}
if ($catidAlias != '') {
$catid = (int)$catid . ':' . $catidAlias;
}
$link = 'index.php?option=com_phocacart&view=item&id='.
$id.'&catid='.$catid;
return self::_buildLink($link, $needles, $lang);
//return self::_buildLink($link, $needles). '#'.$idAlias;
}
public static function getCheckoutRoute($id = 0, $catid = 0) {
$needles = array(
'checkout' => '',
'item' => (int) $id,
'category' => (int) $catid,
'categories' => '',
'items' => ''
);
$link = 'index.php?option=com_phocacart&view=checkout';
return self::_buildLink($link, $needles);
}
public static function getPosRoute($ticketId = 1, $unitId = 0, $sectionId
= 0, $page = '', $id = 0, $catid = 0) {
$needles = array(
'pos' => '',
'item' => (int) $id,
'category' => (int) $catid,
'categories' => '',
'items' => ''
);
$link = 'index.php?option=com_phocacart&view=pos';
if ($page != '') {
$suffix = '';
if ((int)$id > 0) {
switch ($page) {
case 'section':
default:
$suffix = '§ionid='.(int)$id;
break;
}
}
$link = $link . '&page='.htmlspecialchars($page). $suffix;
} else if ($ticketId > 0) {
$link = $link . '&ticketid='.(int)$ticketId
.'&unitid='.(int)$unitId .
'§ionid='.(int)$sectionId;
}
return self::_buildLink($link, $needles);
}
public static function getAccountRoute($id = 0, $catid = 0) {
$needles = array(
'account' => '',
'item' => (int) $id,
'category' => (int) $catid,
'categories' => '',
'items' => ''
);
$link = 'index.php?option=com_phocacart&view=account';
return self::_buildLink($link, $needles);
}
public static function getComparisonRoute($id = 0, $catid = 0) {
$needles = array(
'comparison' => '',
'item' => (int) $id,
'category' => (int) $catid,
'categories' => '',
'items' => ''
);
$link = 'index.php?option=com_phocacart&view=comparison';
return self::_buildLink($link, $needles);
}
public static function getWishListRoute($id = 0, $catid = 0) {
$needles = array(
'wishlist' => '',
'item' => (int) $id,
'category' => (int) $catid,
'categories' => '',
'items' => ''
);
$link = 'index.php?option=com_phocacart&view=wishlist';
return self::_buildLink($link, $needles);
}
public static function getPaymentRoute($id = 0, $catid = 0) {
$needles = array(
//'payment' => '',
'item' => (int) $id,
'category' => (int) $catid,
'categories' => '',
'items' => ''
);
$link = 'index.php?option=com_phocacart&view=payment';
return self::_buildLink($link, $needles);
}
public static function getDownloadRoute($id = 0, $catid = 0) {
$needles = array(
'download' => '',
'item' => (int) $id,
'category' => (int) $catid,
'categories' => '',
'items' => ''
);
$link = 'index.php?option=com_phocacart&view=download';
return self::_buildLink($link, $needles);
}
public static function getOrdersRoute($id = 0, $catid = 0) {
$needles = array(
'orders' => '',
'item' => (int) $id,
'category' => (int) $catid,
'categories' => '',
'items' => ''
);
$link = 'index.php?option=com_phocacart&view=orders';
return self::_buildLink($link, $needles);
}
public static function getTermsRoute($id = 0, $catid = 0, $suffix =
'') {
$needles = array(
'terms' => '',
'item' => (int) $id,
'category' => (int) $catid,
'categories' => '',
'items' => ''
);
$link = 'index.php?option=com_phocacart&view=terms';
if ($suffix != '') {
$link .= '&'.$suffix;
}
return self::_buildLink($link, $needles);
}
public static function getInfoRoute($id = 0, $catid = 0) {
$needles = array(
//'info' => '',
'item' => (int) $id,
'category' => (int) $catid,
'categories' => '',
'items' => ''
);
$link = 'index.php?option=com_phocacart&view=info';
return self::_buildLink($link, $needles);
}
public static function getFeedRoute($id = 0, $idAlias = '',
$noSEF = 0) {
$needles = array(
'feed' => (int) $id,
'categories' => '',
'items' => ''
);
if ($idAlias != '') {
$id = $id . ':' . $idAlias;
}
$link =
'index.php?option=com_phocacart&view=feed&format=xml&id='.
$id;
if ($noSEF == 1) {
return $link;
}
$xml = self::_buildLink($link, $needles);
return $xml;
}
public static function getQuestionRoute($id = 0, $catid = 0, $idAlias =
'', $catidAlias = '', $suffix = '') {
$app = JFactory::getApplication();
$menu = $app->getMenu();
$active = $menu->getActive();
$option = $app->input->get( 'option', '',
'string' );
$view = $app->input->get( 'view', '',
'string' );
$activeId = 0;
if (isset($active->id)){
$activeId = $active->id;
}
if ((int)$activeId > 0 && $option == 'com_phocacart'
&& $view == 'question') {
$needles = array(
'question' => '',
'item' => (int) $id,
'category' => (int) $catid,
'categories' => (int)$activeId,
'items' => (int)$catid
);
} else {
$needles = array(
'question' => '',
'item' => (int) $id,
'category' => (int) $catid,
'categories' => '',
'items' => ''
);
}
if ($idAlias != '') {
$id = (int)$id . ':' . $idAlias;
}
if ($catidAlias != '') {
$catid = (int)$catid . ':' . $catidAlias;
}
$link = 'index.php?option=com_phocacart&view=question';
if ($id != 0) {
$link .= '&id='. $id;
}
if ($catid != 0) {
$link .= '&catid='. $catid;
}
if ($suffix != '') {
$link .= '&'.$suffix;
}
return self::_buildLink($link, $needles);
}
protected static function _buildLink($link, $needles, $lang = array()) {
if($item = self::_findItem($needles, 0, $lang)) {
if(isset($item->query['layout'])) {
$link .= '&layout='.$item->query['layout'];
}
if (isset($item->id) && ((int)$item->id > 0)) {
$link .= '&Itemid='.$item->id;
}
}
return $link;
}
protected static function _findItem($needles, $notCheckId = 0, $lang =
array())
{
$app = JFactory::getApplication();
$menus = $app->getMenu('site', array());
//$items = $menus->getItems('component',
'com_phocacart');
$component = JComponentHelper::getComponent('com_phocacart');
$attributes = array('component_id');
$values = array($component->id);
// Find menu items of current language
$items = $menus->getItems($attributes, $values);
// Multilanguage feature - find only items of selected language (e.g.
when language module displays flags of different language - each language
can have own menu item)
if (!empty($lang)) {
$attributes[] = 'language';
$values[] = $lang;
// If multilanguage feature enabled and specific lang set then set menu
item of such language
$itemsLang = $menus->getItems($attributes, $values);
// If no language items try to find items of current lang and if not
found set the current Itemid
if ($itemsLang) {
$items = $itemsLang;
}
}
if(!$items) {
return $app->input->get('Itemid', 0, '',
'int');
//return null;
}
$match = null;
foreach($needles as $needle => $id)
{
if ($notCheckId == 0) {
foreach($items as $item) {
if ((@$item->query['view'] == $needle) &&
(@$item->query['id'] == $id)) {
$match = $item;
break;
}
}
} else {
foreach($items as $item) {
if (@$item->query['view'] == $needle) {
$match = $item;
break;
}
}
}
if(isset($match)) {
break;
}
}
if (!$match) {
// Nothing found, try to set back "categories menu link" so
e.g. menu links in module to some category
// gets no ID from another category which do have a menu link
// Category A have menu link
// Category B gets its link becasue view = categories is assigned with
active id, which is not categories active id
foreach($items as $item) {
// Nothing found, gets some categories view, better than some category
view from another category
if (@$item->query['view'] == 'categories') {
$match = $item;
break;
}
}
}
return $match;
}
public static function getItemsRouteSuffix($type, $id, $alias) {
$o =
'&'.$type.'='.(int)$id.'-'.urlencode($alias);
return $o;
}
/* ==================
* Handle ITEMS View - used for FILTERING AND SEARCHING
* 1) If we filter then we go to items view - because of javascript we
need to know if we are now in items view or not
* because we filter in module so we can be in every possible view
*
* 2) So the javascript for filtering needs to know the items view
*
* 3) Items view can be without ID (category ID) or with ID (category ID)
* If we are in category view or items view we can filter including
CATEGORY ID
*
* 4) GetAliasFromId it tool function only to get separated alias and id
from SEF url
*/
public static function isItemsView() {
$app = JFactory::getApplication();
$option = $app->input->get( 'option', '',
'string' );
$view = $app->input->get( 'view', '',
'string' );
if ($option == 'com_phocacart' && $view ==
'items') {
return true;
}
return false;
}
public static function getJsItemsRoute($activeCategory = 0) {
$a = PhocacartRoute::getIdForItemsRoute();
// Three cases
if ($activeCategory == 0) {
// 1) We don't want to include category in filter, e.g.
mod_phocacart_filter does not
// allow to include category filtering (deselecting category)
// so don't include category
$urlItemsView = JRoute::_(PhocacartRoute::getItemsRoute());
} else {
// 2) We want to include category filter and user stays on page where
category is active
// Then he/she will be re-directed to items view but it will include
category filtering
//
// 3) But if user stays on site where there is no active category, he
gets ID = 0 (id of category)
// so no filtering of category will be done - it is active but user
didn't stay on category active page
$urlItemsView =
JRoute::_(PhocacartRoute::getItemsRoute($a['id'],
$a['alias']));
}
$urlItemsView = str_replace('&', '&',
$urlItemsView);
// Cause URL problems
//$urlItemsView = str_replace(JURI::root(true), '',
$urlItemsView);
//$urlItemsView = ltrim($urlItemsView, '/');
return $urlItemsView;
}
public static function getJsItemsRouteWithoutParams() {
$urlItemsView = JRoute::_(PhocacartRoute::getItemsRoute());
$urlItemsView = str_replace('&', '&',
$urlItemsView);
// Cause URL problems
//$urlItemsView = str_replace(JURI::root(true), '',
$urlItemsView);
//$urlItemsView = ltrim($urlItemsView, '/');
return $urlItemsView;
}
/*
* If we are in category route or items route and we add ID, this means a
category ID
* So we need to paste this ID to the URL of items route
*/
public static function getIdForItemsRoute() {
$app = JFactory::getApplication();
$option = $app->input->get( 'option', '',
'string' );
$view = $app->input->get( 'view', '',
'string' );
$a['id'] = '';
$a['alias'] = '';
$a['idalias'] = '';
if ($option == 'com_phocacart' && ($view ==
'category' || $view == 'items')) {
$a['id'] = $app->input->get( 'id',
'', 'int' );
$category = PhocacartCategory::getCategoryById($a['id']);
$a['idalias'] = $app->input->get( 'id',
'', 'string' );
$a['alias'] = self::getAliasFromId($a['idalias']);
$a['idalias'] = str_replace(':', '-',
$a['idalias']);
if (isset($category->alias)) {
$a['idalias'] = $a['id'] .'-'.
$category->alias;
$a['alias'] = $category->alias;
}
} else if ($option == 'com_phocacart' && ($view ==
'item')) {
$a['id'] = $app->input->get( 'catid',
'', 'int' );
$category = PhocacartCategory::getCategoryById($a['id']);
$a['idalias'] = $app->input->get( 'catid',
'', 'string' );
$a['alias'] = self::getAliasFromId($a['idalias']);
$a['idalias'] = str_replace(':', '-',
$a['idalias']);
if (isset($category->alias)) {
$a['idalias'] = $a['id'] .'-'.
$category->alias;
$a['alias'] = $category->alias;
}
}
return $a;
}
/*
* Return only alias from ID url: 25:category-alias (25-category-alias)
==> "category-alias" (ID: 25, ALIAS: category-alias)
*/
public static function getAliasFromId($idAndAlias) {
$alias = '';
if ($idAndAlias != '') {
$aliasA = explode(':', $idAndAlias);
if (isset($aliasA[1]) && $aliasA[1] != '') {
$alias = $aliasA[1];
}
}
return $alias;
}
public static function isFilterActive() {
$app = JFactory::getApplication();
$option = $app->input->get( 'option', '',
'string' );
$view = $app->input->get( 'view', '',
'string' );
if ($option == 'com_phocacart' && ($view ==
'items')) {
$id = $app->input->get( 'id', '',
'int' ); // ID in items view is category id
if ((int)$id > 0) {
return true; // some filter is active
}
}
$p = PhocacartUtilsSettings::getListFilterParams();
if (!empty($p)) {
foreach($p as $k => $v) {
$value = $app->input->get( $v, '', 'string'
);
if ($value != '') {
return true; // some filter is active
}
}
}
return false;
}
public static function getFullUrl($url) {
$url = JRoute::_($url);
$frontendUrl = str_replace(JURI::root(true).'/administrator/',
'',$url);
$frontendUrl = str_replace(JURI::root(true), '',
$frontendUrl);
$frontendUrl = str_replace('\\', '/', $frontendUrl);
//$frontendUrl = JURI::root(false). str_replace('//',
'/', $frontendUrl);
$frontendUrl = preg_replace('/([^:])(\/{2,})/',
'$1/', JURI::root(false). $frontendUrl);
return $frontendUrl;
}
/*
public static function getCompleteAlias($id, $alias = '') {
$aliasC = '';
if ($alias != '') {
$aliasC = (int)$id '-'.htmlspecialchars($alias);
}
return $aliasC;
} */
}
?>
PK�"�[�#o,,%libraries/phocacart/search/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�.+�B.B.%libraries/phocacart/search/search.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartSearch
{
public $ajax = 1;
public $search_options = 0;
public $hide_buttons = 0;
public $display_inner_icon = 0;
public $placeholder_text = '';
public $display_active_parameters = 0;
public function __construct() {}
public function renderSearch($options = array()) {
$o = array();
$app = JFactory::getApplication();
$s = PhocacartRenderStyle::getStyles();
$layout = new JLayoutFile('form_search', null,
array('component' => 'com_phocacart'));
$layoutAP = new
JLayoutFile('form_search_active_parameters', null,
array('component' => 'com_phocacart'));
// SEARCH FORM
$data = array();
$data['s'] = $s;
$data['id'] = 'phSearchBox';// AJAX ID
$data['param'] = 'search';
$data['getparams'] =
PhocacartText::filterValue($app->input->get('search',
'', 'string'), 'text');
$data['title'] =
JText::_('COM_PHOCACART_SEARCH');
//$category = PhocacartRoute::getIdForItemsRoute();
//$data['getparams'][] = $category['idalias'];
$data['activefilter'] = PhocacartRoute::isFilterActive();
//$data['searchoptions'] = $searchOptions;
$data['search_options'] = $this->search_options;
$data['hide_buttons'] = $this->hide_buttons;
$data['display_inner_icon'] = $this->display_inner_icon;
$data['placeholder_text'] = $this->placeholder_text;
$filter = new PhocacartFilter;
$f = $filter->getActiveFilterValues();
$dataAP = array();
$dataAP['s'] = $s;
$dataAP['f'] = $f;
$dataAP['id'] = 'phSearchActiveTags';
if ($this->ajax == 0) {
$o[] = '<div class="' .
$data['s']['c']['row'] .
'">';
$o[] = '<div class="' .
$data['s']['c']['col.xs12.sm12.md12'] .
'">';
$o[] = '<div id="' . $data['id'] .
'">';
$o[] = $layout->render($data);
}
if ($this->display_active_parameters) {
if ($this->ajax == 0) {
$o[] = '<div id="' .
$dataAP['id'] . '">';
}
$o[] = $layoutAP->render($dataAP);// only this is displayed
by ajax but if display_active_parameters is enabled
if ($this->ajax == 0) {
$o[] = '</div>';
}
}
if ($this->ajax == 0) {
$o[] = '</div>';
$o[] = '</div>';
$o[] = '</div>';
}
$o2 = implode("\n", $o);
return $o2;
}
/* Static part */
/*
* params ... search option parameters
*/
public static function getSqlParts($type, $search, $param, $params =
array(), $prefix = '') {
$in = '';
$where = '';
$left = '';
$db = JFactory::getDBO();
switch($type) {
case 'int':
$w = $param;
//$w = str_replace('%2C', ',', $w);
$a = explode(',', $w);
$inA = array();
if (!empty($a)) {
foreach($a as $k => $v) {
$inA[] = (int)$v;
}
}
$inA = array_unique($inA);
$in = implode(',', $inA);
break;
case 'string':
$in = $param;
break;
case 'array':
$w = $param;
$inA = array();
if (!empty($w)) {
foreach ($w as $k => $v) {
$s = '';
//$v = str_replace('%2C', ',', $v);
$a = explode(',', $v);
if ($k != '' && $v != '' &&
!empty($a)) {
$a = array_unique($a);
if ($search == 'a') {
// Attributes
$inA[] = '(at2.alias = '.$db->quote($k). ' AND
v2.alias IN ('. '\'' .
implode('\',\'', $a). '\''
.'))';
} else if ($search == 's') {
// Specifications
$inA[] = '(s2.alias = '.$db->quote($k). ' AND
s2.alias_value IN ('. '\'' .
implode('\',\'', $a). '\''
.'))';
}
}
}
}
$in = $inA;
break;
default:
break;
}
if ($in != '') {
switch ($search) {
case 'tag':
$where = ' tr.tag_id IN (' . $in .
')';
$left = ' LEFT JOIN #__phocacart_tags_related AS
tr ON a.id = tr.item_id';
break;
case 'label':
$where = ' lr.tag_id IN (' . $in .
')';
$left = ' LEFT JOIN #__phocacart_taglabels_related
AS lr ON a.id = lr.item_id';
break;
// Custom parameters
case 'parameter':
$where = '
pr'.(int)$prefix.'.parameter_value_id IN (' . $in .
')';
$left = ' LEFT JOIN
#__phocacart_parameter_values_related AS pr'.(int)$prefix.' ON
a.id = pr'.(int)$prefix.'.item_id';
break;
case 'manufacturer':
$where = ' m.id IN (' . $in . ')';
//$left = ' LEFT JOIN #__phocacart_manufacturers
AS m ON m.id = a.manufacturer_id'; is asked as default
break;
case 'price_from':
case 'price_to':
$currency = PhocacartCurrency::getCurrency();
$price =
PhocacartPrice::convertPriceCurrentToDefaultCurrency($in,
$currency->exchange_rate);
if ($search == 'price_from') {
$where = ' a.price >= ' .
$db->quote($price);
} else {
$where = ' a.price <= ' .
$db->quote($price);
};
break;
case 'id': // Category
$where = ' c.id IN (' . $in . ')';
$left = '';//' LEFT JOIN
#__phocacart_categories AS c ON c.id = a.catid';// Category always
included
break;
case 'c': // Category (c)
$where = ' c.id IN (' . $in . ')';
$left = '';//' LEFT JOIN
#__phocacart_categories AS c ON c.id = a.catid';// Category always
included
break;
case 'a': // Attributes
$where = '';
if (!empty($in)) {
$c = count($in);
$where = ' a.id IN (SELECT at2.product_id FROM
#__phocacart_attributes AS at2'
. ' LEFT JOIN
#__phocacart_attribute_values AS v2 ON v2.attribute_id = at2.id'
. ' WHERE ' . implode(' OR
', $in)
. ' GROUP BY at2.product_id'
//.' HAVING COUNT(distinct at2.alias)
>= '.(int)$c.')';// problematic on some servers
. ' HAVING COUNT(at2.alias) >= ' .
(int)$c
. ')';
}
$left = '';
break;
case 's': // Specifications
$where = '';
if (!empty($in)) {
$c = count($in);
$where = ' a.id IN (SELECT s2.product_id FROM
#__phocacart_specifications AS s2'
. ' WHERE ' . implode(' OR
', $in)
. ' GROUP BY s2.product_id'
//.' HAVING COUNT(distinct s2.alias) >=
'.(int)$c.')';// problematic on some servers
. ' HAVING COUNT(s2.alias) >= ' .
(int)$c
. ')';
}
$left = '';
break;
case 'search': // Search
$phrase = 'any';
if (isset($params['search_matching_option']))
{
$phrase =
$params['search_matching_option'];
}
$where = '';
switch ($phrase) {
case 'exact':
$text = $db->quote('%' .
$db->escape($in, true) . '%', false);
$wheresSub = array();
$wheresSub[] = 'a.title LIKE ' .
$text;
$wheresSub[] = 'a.alias LIKE ' .
$text;
$wheresSub[] = 'a.metakey LIKE ' .
$text;
$wheresSub[] = 'a.metadesc LIKE ' .
$text;
$wheresSub[] = 'a.description LIKE '
. $text;
$wheresSub[] = 'a.sku LIKE ' . $text;
$wheresSub[] = 'a.ean LIKE ' . $text;
// Search EAN, SKU in product attributes
(advanced stock management) ... can be different for POS or Online Shop
if
(isset($params['sql_search_skip_id_specific_type']) &&
$params['sql_search_skip_id_specific_type'] == 0) {
$wheresSub[] = 'ps.sku LIKE ' .
$text;
$wheresSub[] = 'ps.ean LIKE ' .
$text;
}
if (isset($params['search_deep'])
&& $params['search_deep'] == 1) {
$wheresSub[] = 'a.description_long LIKE
' . $text;
$wheresSub[] = 'a.features LIKE ' .
$text;
}
$where = '(' . implode(') OR
(', $wheresSub) . ')';
$left = '';
break;
case 'all':
case 'any':
default:
$words = explode(' ', $in);
$wheres = array();
foreach ($words as $word) {
if (!$word = trim($word)) {
continue;
}
$word = $db->quote('%' .
$db->escape($word, true) . '%', false);
$wheresSub = array();
$wheresSub[] = 'a.title LIKE ' .
$word;
$wheresSub[] = 'a.alias LIKE ' .
$word;
$wheresSub[] = 'a.metakey LIKE '
. $word;
$wheresSub[] = 'a.metadesc LIKE '
. $word;
$wheresSub[] = 'a.description LIKE
' . $word;
$wheresSub[] = 'a.sku LIKE ' .
$word;
$wheresSub[] = 'a.ean LIKE ' .
$word;
if
(isset($params['sql_search_skip_id_specific_type']) &&
$params['sql_search_skip_id_specific_type'] == 0) {
$wheresSub[] = 'ps.sku LIKE '
. $word;
$wheresSub[] = 'ps.ean LIKE '
. $word;
}
if (isset($params['search_deep'])
&& $params['search_deep'] == 1) {
$wheresSub[] = 'a.description_long
LIKE ' . $word;
$wheresSub[] = 'a.features LIKE
' . $word;
}
$wheres[] = implode(' OR ',
$wheresSub);
}
$where = '(' . implode(($phrase ==
'all' ? ') AND (' : ') OR ('), $wheres) .
')';
$left = '';
break;
}
break;
default:
break;
}
}
$a = array();
$a['where'] = $where;
$a['left'] = $left;
return $a;
}
}
PK�"�[�#o,,&libraries/phocacart/section/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��]Z��'libraries/phocacart/section/section.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartSection
{
public static function renderTitleAndBackButton($sectionId, $unitId) {
$s = PhocacartRenderStyle::getStyles();
$section = PhocacartSection::getSectionById($sectionId);
$unit = PhocacartUnit::getUnitById($unitId);
$o = '<div class="ph-link-sections">';
if (isset($section->title) && $section->title !=
'' && isset($unit->title) && $unit->title
!= '') {
// Section including unit
$unitSectionTitle = $section->title . '
('.$unit->title.')';
$linkSection = JRoute::_(PhocacartRoute::getPosRoute(1, 0, 0,
'section', $sectionId));
$o .= '<div
class="'.$s['c']['btn-group'].'"
role="group">';
$o .= '<a href="'.$linkSection.'"
class="'.$s['c']['btn.btn-primary'].'
active">';
$o .= '<span
class="'.$s['i']['back-category'].'
icon-white"
aria-hidden="true"></span></a>';
$o .= '<a href="'.$linkSection.'"
class="'.$s['c']['btn.btn-primary'].'
active">'.$unitSectionTitle.'</a>';
$o .= '</div>';
} else if (isset($section->title) && $section->title !=
'') {
// One section without unit
$unitSectionTitle = $section->title;
$linkSection = JRoute::_(PhocacartRoute::getPosRoute(1, 0, 0,
'section', $sectionId));
$o .= '<div
class="'.$s['c']['btn-group'].'"
role="group">';
$o .= '<a href="'.$linkSection.'"
class="'.$s['c']['btn.btn-primary'].'
active">';
$o .= '<span
class="'.$s['i']['back-category'].'
icon-white"
aria-hidden="true"></span></a>';
$o .= '<a href="'.$linkSection.'"
class="'.$s['c']['btn.btn-primary'].'
active">'.$unitSectionTitle.'</a>';
$o .= '</div>';
} else {
$sections = PhocacartSection::getSections();
$linkSections = JRoute::_(PhocacartRoute::getPosRoute(1, 0, 0,
'section'));
if (!empty($sections)) {
foreach($sections as $k => $v) {
$linkSection = JRoute::_(PhocacartRoute::getPosRoute(1, 0, 0,
'section', (int)$v->id));
$o .= '<div
class="'.$s['c']['btn-group'].'"
role="group">';
$o .= '<a href="'.$linkSection.'"
class="'.$s['c']['btn.btn-primary'].'
active">';
$o .= '<span
class="'.$s['i']['back-category'].'
icon-white"
aria-hidden="true"></span></a>';
$o .= '<a href="'.$linkSection.'"
class="'.$s['c']['btn.btn-primary'].'
active">'.JText::_('COM_PHOCACART_SECTIONS').'</a>';
$o .= '</div>';
break;
}
} else {
$o .= '<div> </div>';
}
}
$o .= '</div>';
return $o;
}
public static function renderNavigation($sectionId) {
// $ticketId is active ticket
$sections = self::getSections();
$s = PhocacartRenderStyle::getStyles();
$o = '<ul
class="'.$s['c']['tabnav'].'">';
if (!empty($sections)) {
foreach($sections as $k => $v) {
$active = '';
if ((int)$v->id == (int)$sectionId) {
$active = 'active';
}
$link = JRoute::_(PhocacartRoute::getPosRoute(1,0,0,
'section', (int)$v->id));
$o .= '<li
class="'.$s['c']['nav-item'].'
'.$active.'">';
$o .= '<a
class="'.$s['c']['nav-link'].'
'.$active.'" href="'.$link.'">
'.$v->title.' </a>';
$o .= '</li>';
}
} else {
$link = JRoute::_(PhocacartRoute::getPosRoute(1, 0, 0,
'section'));
$o .= '<li
class="'.$s['c']['nav-item'].'
active">';
$o .= '<a
class="'.$s['c']['nav-link'].'
active"
href="'.$link.'">'.JText::_('COM_PHOCACART_DEFAULT_SECTION').'</a>';
$o .= '</li>';
}
$o .= '</ul>';
return $o;
}
public static function getSections($limit = 0) {
$db = JFactory::getDBO();
$query = ' SELECT a.id, a.title FROM #__phocacart_sections AS
a'
.' WHERE a.published = 1'
.' ORDER BY a.ordering';
if ((int)$limit > 0) {
$query .= ' LIMIT '.(int)$limit;
}
$db->setQuery($query);
$sections = $db->loadObjectList();
return $sections;
}
public static function existsSection($sectionId) {
$db = JFactory::getDBO();
$query = ' SELECT id FROM #__phocacart_sections'
.' WHERE id = '.(int)$sectionId
.' AND published = 1';
$db->setQuery($query);
$result = $db->loadResult();
if (isset($result) && (int)$result > 0) {
return $result;
}
return false;
}
public static function getSectionById($sectionId) {
$db = JFactory::getDBO();
$query = ' SELECT id, title FROM #__phocacart_sections'
.' WHERE id = '.(int)$sectionId
.' AND published = 1';
$db->setQuery($query);
$result = $db->loadObject();
return $result;
}
public static function options() {
$db = JFactory::getDBO();
$query = 'SELECT a.title AS text, a.id AS value'
. ' FROM #__phocacart_sections AS a'
. ' WHERE a.published = 1'
. ' ORDER BY a.ordering';
$db->setQuery( $query );
$items = $db->loadObjectList();
return $items;
}
}
PK�"�[�#o,,'libraries/phocacart/security/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�jF��)libraries/phocacart/security/security.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartSecurity
{
public function __construct() {}
public static function checkIpAddress($ipAddr, $ipBan) {
$spam = false;
$ip_ban = trim( $ipBan );
$ip_ban_array = explode( ',', $ip_ban );
if (is_array($ip_ban_array)) {
foreach ($ip_ban_array as $valueIp) {
if ($valueIp != '' && strstr($ipAddr, trim($valueIp))
&& strpos($ipAddr, trim($valueIp))==0) {
$spam = true;
break;
}
}
}
return $spam;
}
public static function setHiddenFieldPos($name, $email, $phone, $message)
{
$form = array();
if ((int)$name > 0) {
$form[] = 1;
}
if ((int)$email > 0) {
$form[] = 2;
}
if ((int)$phone > 0) {
$form[] = 3;
}
if ((int)$message > 0) {
$form[] = 4;
}
$value = mt_rand(0,count($form) - 1);
return $form[$value];
}
}PK�"�[�#o,,'libraries/phocacart/shipping/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��8{_{_)libraries/phocacart/shipping/shipping.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\Utilities\ArrayHelper;
defined('_JEXEC') or die();
class PhocacartShipping
{
protected $type = array(0,1);// 0 all, 1 online shop, 2 pos (category
type, payment method type, shipping method type)
public function __construct() {
}
public function setType($type = array(0,1)) {
$this->type = $type;
}
/*
* Be aware:
* if id > 0 ... it test the selected shipping method and return it if
OK
* if id = 0 ... it tests all shipping methods they meet the criteria and
return all to list them (e.g. in checkout)
* Always test for the id before using this function
*/
public function getPossibleShippingMethods($amountNetto, $amountBrutto,
$quantity, $country, $region, $zip, $weight, $length, $width, $height, $id
= 0, $selected = 0) {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$shipping_amount_rule = $paramsC->get(
'shipping_amount_rule', 0 );
$user = PhocacartUser::getUser();
$userLevels = implode (',',
$user->getAuthorisedViewLevels());
$userGroups = implode (',',
PhocacartGroup::getGroupsById($user->id, 1, 1));
$db = JFactory::getDBO();
$wheres = array();
// ACCESS
$wheres[] = " s.published = 1";
$wheres[] = " s.access IN (".$userLevels.")";
$wheres[] = " (ga.group_id IN (".$userGroups.") OR
ga.group_id IS NULL)";
if (!empty($this->type) && is_array($this->type)) {
// if type is empty, then all types are asked
$wheres[] = " s.type IN (" . implode(',',
$this->type) . ')';
}
if ((int)$id > 0) {
$wheres[] = 's.id = '.(int)$id;
$limit = ' LIMIT 1';
//$group = '';
} else {
$limit = '';
}
$columns = 's.id, s.tax_id, s.cost, s.cost_additional,
s.calculation_type, s.title, s.description, s.image, s.access, s.method,
s.zip,'
.' s.active_amount, s.active_quantity, s.active_zone,
s.active_country, s.active_region, s.active_zip,'
.' s.active_weight, s.active_size,'
.' s.lowest_amount, s.highest_amount, s.minimal_quantity,
s.maximal_quantity, s.lowest_weight,'
.' s.highest_weight, s.default,'
.' s.minimal_length, s.minimal_width, s.minimal_height,
s.maximal_length, s.maximal_width, s.maximal_height,'
.' t.id as taxid, t.title as taxtitle, t.tax_rate as taxrate,
t.calculation_type as taxcalculationtype,'
.' GROUP_CONCAT(DISTINCT r.region_id) AS region,'
.' GROUP_CONCAT(DISTINCT c.country_id) AS country,'
.' GROUP_CONCAT(DISTINCT z.zone_id) AS zone';
$groupsFull = 's.id, s.tax_id, s.cost, s.cost_additional,
s.calculation_type, s.title, s.description, s.image, s.access, s.method,
s.zip,'
.' s.active_amount, s.active_quantity, s.active_zone,
s.active_country, s.active_region, s.active_zip,'
.' s.active_weight, s.active_size,'
.' s.lowest_amount, s.highest_amount, s.minimal_quantity,
s.maximal_quantity, s.lowest_weight,'
.' s.minimal_length, s.minimal_width, s.minimal_height,
s.maximal_length, s.maximal_width, s.maximal_height,'
.' s.highest_weight, s.default,'
.' t.id, t.title, t.tax_rate, t.calculation_type';
$groupsFast = 's.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
$where = ( count( $wheres ) ? ' WHERE '. implode( ' AND
', $wheres ) : '' );
$query = ' SELECT '.$columns
.' FROM #__phocacart_shipping_methods AS s'
.' LEFT JOIN #__phocacart_shipping_method_regions AS r ON
r.shipping_id = s.id'
.' LEFT JOIN #__phocacart_shipping_method_countries AS c ON
c.shipping_id = s.id'
.' LEFT JOIN #__phocacart_shipping_method_zones AS z ON
z.shipping_id = s.id'
.' LEFT JOIN #__phocacart_taxes AS t ON t.id = s.tax_id'
.' LEFT JOIN #__phocacart_item_groups AS ga ON s.id = ga.item_id
AND ga.type = 7'// type 8 is payment
. $where
. ' GROUP BY '.$groups
. ' ORDER BY s.ordering'
. $limit;
PhocacartUtils::setConcatCharCount();
$db->setQuery($query);
$shippings = $db->loadObjectList();
/*if (empty($shippings)) {
return false;
}*/
if (!empty($shippings) && !isset($shippings[0]->id) ||
(isset($shippings[0]->id) && (int)$shippings[0]->id < 1))
{
return false;
}
$i = 0;
if (!empty($shippings)) {
foreach($shippings as $k => $v) {
$v->active = 0;
$v->selected = 0;
$a = 0;
$q = 0;
$z = 0;
$c = 0;
$r = 0;
$zi = 0;
$w = 0;
$s = 0;
// Amount Rule
if($v->active_amount == 1) {
if ($shipping_amount_rule == 0 || $shipping_amount_rule == 2) {
// No tax, brutto
if ($amountBrutto >= $v->lowest_amount && $amountBrutto
<= $v->highest_amount) {
$a = 1;
}
} else if ($shipping_amount_rule == 1) {
// Netto
if ($amountNetto >= $v->lowest_amount && $amountNetto
<= $v->highest_amount) {
$a = 1;
}
}
} else {
$a = 1;
}
// Quantity Rule
if($v->active_quantity == 1) {
if ($quantity >= $v->minimal_quantity && $quantity <=
$v->maximal_quantity) {
$q = 1;
}
} else {
$q = 1;
}
// Zone Rule
if($v->active_zone == 1) {
if (isset($v->zone) && $v->zone != '') {
$zones = explode(',', $v->zone);
if (PhocacartZone::isCountryOrRegionIncluded($zones, (int)$country,
(int)$region)) {
$z = 1;
}
}
} else {
$z = 1;
}
// Country Rule
if($v->active_country == 1) {
if (isset($v->country) && $v->country != '') {
$countries = explode(',', $v->country);
if (in_array((int)$country, $countries)) {
$c = 1;
}
}
} else {
$c = 1;
}
// Region Rule
if($v->active_region == 1) {
if (isset($v->region) && $v->region != '') {
$regions = explode(',', $v->region);
if (in_array((int)$region, $regions)) {
$r = 1;
}
}
} else {
$r = 1;
}
// ZIP Rule
if($v->active_zip == 1) {
if (isset($v->zip) && $v->zip != '') {
$zips = array_map('trim', explode(',',
$v->zip));
if (in_array((int)$zip, $zips)) {
$zi = 1;
}
}
} else {
$zi = 1;
}
// Weight Rule
if($v->active_weight == 1) {
if (($weight >= $v->lowest_weight || $weight ==
$v->lowest_weight)
&& ($weight <= $v->highest_weight || $weight ==
$v->highest_weight)) {
$w = 1;
}
} else {
$w = 1;
}
// Size Rule
if($v->active_size == 1) {
$sP = 0;
if (($length >= $v->minimal_length || $length ==
$v->minimal_length)
&& ($length <= $v->maximal_length || $length ==
$v->maximal_length)) {
$sP++;
}
if (($width >= $v->minimal_width || $width ==
$v->minimal_width)
&& ($width <= $v->maximal_width || $width ==
$v->maximal_width)) {
$sP++;
}
if (($height >= $v->minimal_height || $height ==
$v->minimal_height)
&& ($height <= $v->maximal_height || $height ==
$v->maximal_height)) {
$sP++;
}
if ($sP == 3) {
$s = 1;
}
} else {
$s = 1;
}
// No rule was set for shipping, it will be displayed at all events
if($v->active_amount == 0 && $v->active_quantity == 0
&& $v->active_country == 0 && $v->active_region == 0
&& $v->active_zip == 0 && $v->active_weight == 0) {
$v->active = 1;
}
// if some of the rules is not valid, all the payment is NOT valid
if ($a == 0 || $q == 0 || $z == 0 || $c == 0 || $r == 0 || $zi == 0 ||
$w == 0 || $s == 0) {
$v->active = 0;
} else {
$v->active = 1;
}
if ($v->active == 0) {
if (isset($shippings[$i])) {
unset($shippings[$i]);
}
} else {
// Shipping is active but shipping method plugin can deactivate it
$pluginShipping = PluginHelper::importPlugin('pcs');
if ($pluginShipping) {
PluginHelper::importPlugin('pcs',
htmlspecialchars(strip_tags($v->method)));
$eventData = array();
$active = true;
$eventData['pluginname'] =
htmlspecialchars(strip_tags($v->method));
Factory::getApplication()->triggerEvent('PCSbeforeShowPossibleShippingMethod',
array(&$active, $v, $eventData));
if ($active == false) {
if (isset($shippings[$i])) {
unset($shippings[$i]);
}
}
}
}
// Try to set default for frontend form
// If user selected some shipping, such will be set as default
// If not then the default will be set
if ((int)$selected > 0) {
if ((int)$v->id == (int)$selected) {
$v->selected = 1;
}
} else {
$v->selected = $v->default;
}
$i++;
}
}
return $shippings;
}
/*public function checkAndGetShippingMethodInsideCart($id, $total) {
if ((int)$id > 0 && !empty($total)) {
return $this->checkAndGetShippingMethods($id, 0, $total);
}
return false;
}*/
/**
* Check current shipping method
* Shipping method must be selected
* @param number $id
* @return boolean|array
*/
public function checkAndGetShippingMethod($id = 0, $total = array()) {
if ((int)$id > 0) {
return $this->checkAndGetShippingMethods($id, 0, $total);
}
return false;
}
/**
* Check current shipping method or all methods they meet criteria to be
selected
* @param number $selectedShippingId
* @param number $selected
* @return boolean|array
*/
public function checkAndGetShippingMethods($selectedShippingId = 0,
$selected = 0, $total = array()) {
if (empty($total)) {
$cart = new PhocacartCartRendercheckout();
$cart->setType($this->type);
$cart->setFullItems();
$total = $cart->getTotal();
$totalFinal = $total[0];
//$currentShippingId = $cart->getShippingId();
} else {
$totalFinal = $total;
}
$user = PhocacartUser::getUser();
$data = PhocacartUser::getUserData((int)$user->id);
$fields = PhocacartFormUser::getFormXml('',
'_phs', 1,1,0);
$dataAddress = array();
if (!empty($data)) {
$dataAddress = PhocacartUser::getAddressDataOutput($data,
$fields['array'], $user);
} else {
// Is this guest user
$guest = PhocacartUserGuestuser::getGuestUser();
if ($guest) {
$data = PhocacartUserGuestuser::getUserAddressGuest();
$dataAddress = PhocacartUser::getAddressDataOutput($data,
$fields['array'], $user, 1);
}
}
$country = $this->getUserCountryShipping($dataAddress);
$region = $this->getUserRegionShipping($dataAddress);
$zip = $this->getUserZipShipping($dataAddress);
/*$country = 0;
if(isset($dataAddress['bcountry']) &&
(int)$dataAddress['bcountry']) {
$country = (int)$dataAddress['bcountry'];
}
$region = 0;
if(isset($dataAddress['bregion']) &&
(int)$dataAddress['bregion']) {
$region = (int)$dataAddress['bregion'];
}*/
$shippingMethods =
$this->getPossibleShippingMethods($totalFinal['netto'],
$totalFinal['brutto'], $totalFinal['quantity'],
$country, $region, $zip, $totalFinal['weight'],
$totalFinal['length'], $totalFinal['width'],
$totalFinal['height'], $selectedShippingId, $selected);
if (!empty($shippingMethods)) {
return $shippingMethods;
}
return false;
}
public static function getUserCountryShipping($dataAddress) {
$pC = PhocacartUtils::getComponentParameters();
$shipping_country_rule =
$pC->get('shipping_country_rule', 1);
$country = 0;
switch($shipping_country_rule) {
case 2:
if(isset($dataAddress['scountry']) &&
(int)$dataAddress['scountry']) {
$country = (int)$dataAddress['scountry'];
}
break;
case 3:
if(isset($dataAddress['bcountry']) &&
(int)$dataAddress['bcountry']) {
$country = (int)$dataAddress['bcountry'];
} else if(isset($dataAddress['scountry']) &&
(int)$dataAddress['scountry']) {
$country = (int)$dataAddress['scountry'];
}
break;
case 4:
if(isset($dataAddress['scountry']) &&
(int)$dataAddress['scountry']) {
$country = (int)$dataAddress['scountry'];
} else if(isset($dataAddress['bcountry']) &&
(int)$dataAddress['bcountry']) {
$country = (int)$dataAddress['bcountry'];
}
break;
case 1:
default:
if(isset($dataAddress['bcountry']) &&
(int)$dataAddress['bcountry']) {
$country = (int)$dataAddress['bcountry'];
}
break;
}
return $country;
}
public static function getUserRegionShipping($dataAddress) {
$pC = PhocacartUtils::getComponentParameters();
$shipping_region_rule =
$pC->get('shipping_region_rule', 1);
$region = 0;
switch($shipping_region_rule) {
case 2:
if(isset($dataAddress['sregion']) &&
(int)$dataAddress['sregion']) {
$region = (int)$dataAddress['sregion'];
}
break;
case 3:
if(isset($dataAddress['bregion']) &&
(int)$dataAddress['bregion']) {
$region = (int)$dataAddress['bregion'];
} else if(isset($dataAddress['sregion']) &&
(int)$dataAddress['sregion']) {
$region = (int)$dataAddress['sregion'];
}
break;
case 4:
if(isset($dataAddress['sregion']) &&
(int)$dataAddress['sregion']) {
$region = (int)$dataAddress['sregion'];
} else if(isset($dataAddress['bregion']) &&
(int)$dataAddress['bregion']) {
$region = (int)$dataAddress['bregion'];
}
break;
case 1:
default:
if(isset($dataAddress['bregion']) &&
(int)$dataAddress['bregion']) {
$region = (int)$dataAddress['bregion'];
}
break;
}
return $region;
}
public static function getUserZipShipping($dataAddress) {
$pC = PhocacartUtils::getComponentParameters();
$shipping_zip_rule = $pC->get('shipping_zip_rule', 1);
$zip = 0;
switch($shipping_zip_rule) {
case 2:
if(isset($dataAddress['szip']) &&
$dataAddress['szip']) {
$zip = $dataAddress['szip'];
}
break;
case 3:
if(isset($dataAddress['bzip']) &&
$dataAddress['bzip']) {
$zip = $dataAddress['bzip'];
} else if(isset($dataAddress['szip']) &&
$dataAddress['szip']) {
$zip = $dataAddress['szip'];
}
break;
case 4:
if(isset($dataAddress['szip']) &&
$dataAddress['szip']) {
$zip = $dataAddress['szip'];
} else if(isset($dataAddress['bzip']) &&
$dataAddress['bzip']) {
$zip = $dataAddress['bzip'];
}
break;
case 1:
default:
if(isset($dataAddress['bzip']) &&
$dataAddress['bzip']) {
$zip = $dataAddress['bzip'];
}
break;
}
return $zip;
}
public function getShippingMethod($shippingId) {
//$app = JFactory::getApplication();
//$paramsC = PhocacartUtils::getComponentParameters();
//$shipping_amount_rule = $paramsC->get(
'shipping_amount_rule', 0 );
$db = JFactory::getDBO();
$query = ' SELECT s.id, s.tax_id, s.cost, s.cost_additional,
s.calculation_type, s.title, s.method, s.params, s.description,
s.image,'
.' t.id as taxid, t.title as taxtitle, t.tax_rate as taxrate,
t.calculation_type as taxcalculationtype'
.' FROM #__phocacart_shipping_methods AS s'
.' LEFT JOIN #__phocacart_taxes AS t ON t.id = s.tax_id'
.' WHERE s.id = '.(int)$shippingId
.' ORDER BY s.id'
.' LIMIT 1';
$db->setQuery($query);
$shipping = $db->loadObject();
if (isset($shipping->params)) {
$registry = new JRegistry;
//$registry->loadString($shipping->params);
if (isset($shipping->params)) {
$registry->loadString($shipping->params);
}
$shipping->params = $registry;
}
return $shipping;
}
/* Used as payment rule */
public static function getShippingMethods($paymentId, $select = 0, $table
= 'payment') {
if ($table == 'payment') {
$t = '#__phocacart_payment_method_shipping';
$c = 'payment_id';
}
$db =JFactory::getDBO();
if ($select == 1) {
$query = 'SELECT p.shipping_id';
} else {
$query = 'SELECT a.*';
}
$query .= ' FROM #__phocacart_shipping_methods AS a'
.' LEFT JOIN '.$t.' AS p ON a.id = p.shipping_id'
.' WHERE p.'.$c.' = '.(int) $paymentId;
$db->setQuery($query);
if ($select == 1) {
$items = $db->loadColumn();
} else {
$items = $db->loadObjectList();
}
return $items;
}
/**
* Store shipping id inside checkout - if enabled in parameters and there
is only one valid shipping, it can be directly stored
* But then the cart needs to be reloaded to store the costs of the
shipping and make ready for payment (payment gets info about shipping
because of rules)
* @param $shippingId
* @param $userId
*/
public function storeShippingRegistered($shippingId, $userId)
{
$row = JTable::getInstance('PhocacartCart', 'Table');
if ((int)$userId > 0) {
if (!$row->load(array('user_id' => (int)$userId,
'vendor_id' => 0, 'ticket_id' => 0,
'unit_id' => 0, 'section_id' => 0))) {
return false;// there must be some info in cart yet
}
}
if (!empty($row->cart)) {
$data['shipping'] = (int)$shippingId;
$data['user_id'] = (int)$userId;
if (!$row->bind($data)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
$row->date = gmdate('Y-m-d H:i:s');
if (!$row->check()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
if (!$row->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
return (int)$shippingId;
}
return false;
}
/* Used as payment rule too
* Used in administration (this is why $type = array();
*/
public static function getAllShippingMethodsSelectBox($name, $id,
$activeArray, $javascript = NULL, $order = 'id', $type = array()
) {
$db =JFactory::getDBO();
$query = 'SELECT a.id AS value, a.title AS text'
.' FROM #__phocacart_shipping_methods AS a';
$query .= !empty($type) && is_array($type) ? ' WHERE a.type
IN ('. implode(',', $type). ')' : '';
$query .= ' ORDER BY a.'. $order;
$db->setQuery($query);
$methods = $db->loadObjectList();
$methodsO = Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$methods, $name, 'class="inputbox" size="4"
multiple="multiple"'. $javascript, 'value',
'text', $activeArray, $id);
return $methodsO;
}
/* used as payment rule*/
public static function storeShippingMethods($shippingsArray, $id, $table =
'payment') {
if ($table == 'payment') {
$t = '#__phocacart_payment_method_shipping';
$c = 'payment_id';
}
if ((int)$id > 0) {
$db =JFactory::getDBO();
$query = ' DELETE '
.' FROM '.$t
. ' WHERE '.$c.' = '. (int)$id;
$db->setQuery($query);
$db->execute();
if (!empty($shippingsArray)) {
$values = array();
$valuesString = '';
foreach($shippingsArray as $k => $v) {
$values[] = ' ('.(int)$id.',
'.(int)$v[0].')';
}
if (!empty($values)) {
$valuesString = implode(',', $values);
$query = ' INSERT INTO '.$t.' ('.$c.',
shipping_id)'
.' VALUES '.(string)$valuesString;
$db->setQuery($query);
$db->execute();
}
}
}
}
/*
* Important function - when e.g. user changes the address or change the
items in cart, the shipping method
* needs to be removed, because user can get shipping advantage when he
orders 10 items but after changing
* cart to e.g. one item, shipping cannot stay the same, the same happens
with countries and region
*/
public static function removeShipping($type = 0) {
if ($type == 0 || $type == 1) {
$session = JFactory::getSession();
$session->set('guestshipping', false,
'phocaCart');
}
if ($type == 0) {
$db = JFactory::getDBO();
$user = array();
$vendor = array();
$ticket = array();
$unit = array();
$section = array();
$dUser = PhocacartUser::defineUser($user, $vendor, $ticket, $unit,
$section);
$pos_shipping_force = 0;
if (PhocacartPos::isPos()) {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$pos_shipping_force = $paramsC->get('pos_shipping_force',
0);
if ((int)$pos_shipping_force > 0) {
$pos_shipping_force =
PhocacartShipping::isShippingMethodActive($pos_shipping_force) === true ?
(int)$pos_shipping_force : 0;
}
}
$query = 'UPDATE #__phocacart_cart_multiple SET shipping = ' .
(int)$pos_shipping_force
. ' WHERE user_id = ' . (int)$user->id
. ' AND vendor_id = ' . (int)$vendor->id
. ' AND ticket_id = ' . (int)$ticket->id
. ' AND unit_id = ' . (int)$unit->id
. ' AND section_id = ' . (int)$section->id;
$db->setQuery($query);
$db->execute();
}
return true;
}
/* Checkout - is there even some shipping NOT is used reverse
* This function is different to getPossibleShippingMethods()
*
* getPossibleShippingMethods - all methods they fit the criterias (e.g.
amount rule, contry rule, etc.)
* isShippingNotUsed() - all existing methods in shop which are published
*
* IF NO SHIPPPING METHOD EXIST - it is ignored when 1)
skip_shipping_method parameter is enabled 2) all products are digital and
skip_shipping_method is enabled
*
* */
public static function isShippingNotUsed($options = array()) {
$paramsC = PhocacartUtils::getComponentParameters();
$skip_shipping_method = $paramsC->get(
'skip_shipping_method', 0 );
// 1) TEST IF ANY SHIPPING METHOD EXISTS
$db =JFactory::getDBO();
$query = 'SELECT a.id'
.' FROM #__phocacart_shipping_methods AS a'
.' WHERE a.published = 1'
.' AND a.type IN (0, 1)'
.' ORDER BY id LIMIT 1';
$db->setQuery($query);
$methods = $db->loadObjectList();
if (empty($methods) && $skip_shipping_method == 2) {
return true;
}
// 2) TEST IF SHIPPING METHOD IS NOT DISABLED FOR ALL DOWNLOADABLE
PRODUCTS
// PRODUCTTYPE tested
if (isset($options['all_digital_products']) &&
$options['all_digital_products'] == 1 &&
$skip_shipping_method == 1) {
return true;
}
return false;
}
/*
* Get all PCS Plugins
*/
public static function getShippingPluginMethods($namePlugin =
'') {
$plugin = array();
$plugin['name'] = $namePlugin;
$plugin['group'] = 'pcs';
$plugin['title'] = 'Phoca Cart Shipping';
$plugin['selecttitle'] =
JText::_('COM_PHOCACART_SELECT_SHIPPING_METHOD');
$plugin['returnform'] = 1;
return PhocacartPlugin::getPluginMethods($plugin);
}
/*
* Used in POS - we can define forced shipping method in Global
Configuration
* But if user unpublish this method, we need to test it
*/
public static function isShippingMethodActive($id) {
$db =JFactory::getDBO();
$query = 'SELECT a.id'
.' FROM #__phocacart_shipping_methods AS a'
.' WHERE a.published = 1'
.' AND a.type IN (0,2)'// IT IS A POS (0 common, 2 POS)
.' AND a.id = '.(int)$id
.' ORDER BY id LIMIT 1';
$db->setQuery($query);
$method = $db->loadResult();
if ((int)$method > 0) {
return true;
}
return false;
}
public static function getInfoDescriptionById($id) {
if ((int)$id > 0) {
$db =JFactory::getDBO();
$query = 'SELECT a.description_info'
.' FROM #__phocacart_shipping_methods AS a'
.' WHERE a.published = 1'
.' AND a.type IN (0,2)'// IT IS A POS (0 common, 2 POS)
.' AND a.id = '.(int)$id
.' ORDER BY id LIMIT 1';
$db->setQuery($query);
return $db->loadResult();
}
}
/**
* @param $methodName
* @param int $return 1 ... Association list, 2 ... Object list, 3 ... ID
(be aware when setting 3, only first ID will be returned even more methods
with the same method name can exist)
* @param bool $onlyPublished
* @return mixed
*/
protected function getShippingMethodIdByMethodName($methodName, $return =
3, $onlyPublished = false) {
$db = JFactory::getDBO();
$query = ' SELECT s.id'
.' FROM #__phocacart_shipping_methods AS s'
.' WHERE s.method = '.$db->quote($methodName);
if ($onlyPublished) {
$query .= ' AND s.published = 1';
}
$query .= ' ORDER BY s.id';
if ($return == 3) {
$query .= ' LIMIT 1';
}
$db->setQuery($query);
if ($return == 1) {
return $db->loadAssocList();
} else if ($return == 2) {
return $db->loadObjectList();
} else if ($return == 3) {
$result = (array) $db->loadObject();
return $result["id"];
}
return false;
}
}
?>
PK�"�[z��;��!libraries/phocacart/size/size.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartSize
{
public $p;
public function __construct() {
$this->p = PhocacartUtils::getComponentParameters();
}
public function getSizeFormat($value, $type = 'size') {
$suffix = '';
if ($value > 0) {
switch($type) {
case 'weight':
$suffix = $this->p->get('unit_weight');
break;
case 'volume':
$suffix = $this->p->get('unit_volume');
break;
case 'size':
default:
$suffix = $this->p->get('unit_size');
break;
}
return $this->roundSize($value). ' '.$suffix;
}
return false;
}
public function roundSize($value) {
// Possible parameter
//$paramsC = PhocacartUtils::getComponentParameters();
$rounding_size = 2;//$paramsC->get(
'rounding_size', 2 );
return round($value, $rounding_size, 2);
}
}
PK�"�[�#o,,,libraries/phocacart/specification/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�;f��1�13libraries/phocacart/specification/specification.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartSpecification
{
public static function getSpecificationsById($productId, $return = 0) {
$db = JFactory::getDBO();
$query = 'SELECT a.id, a.title, a.alias, a.value, a.alias_value,
a.group_id, a.image, a.image_medium, a.image_small, a.color'
.' FROM #__phocacart_specifications AS a'
.' WHERE a.product_id = '.(int) $productId
.' ORDER BY a.ordering';
$db->setQuery($query);
if ($return == 0) {
return $db->loadObjectList();
} else if ($return == 1) {
return $db->loadAssocList();
} else {
$specifications = $db->loadAssocList();
$specificationsSubform = array();
$i = 0;
if (!empty($specifications)) {
foreach($specifications as $k => $v) {
$specificationsSubform['specifications'.$i]['id'] =
(int)$v['id'];
$specificationsSubform['specifications'.$i]['title'] =
(string)$v['title'];
$specificationsSubform['specifications'.$i]['alias'] =
(string)$v['alias'];
$specificationsSubform['specifications'.$i]['value'] =
(string)$v['value'];
$specificationsSubform['specifications'.$i]['alias_value']
= (string)$v['alias_value'];
$specificationsSubform['specifications'.$i]['group_id']
= (int)$v['group_id'];
$specificationsSubform['specifications'.$i]['image'] =
(string)$v['image'];
$specificationsSubform['specifications'.$i]['image_medium']
= (string)$v['image_medium'];
$specificationsSubform['specifications'.$i]['image_small']
= (string)$v['image_small'];
$specificationsSubform['specifications'.$i]['color'] =
(string)$v['color'];
$i++;
}
}
return $specifications;
}
return false;
}
public static function getGroupArray() {
$db = JFactory::getDBO();
$query = 'SELECT id, title'
.' FROM #__phocacart_specification_groups'
.' ORDER by ordering';
$db->setQuery($query);
$groups = $db->loadObjectList();
$groupsA = array();
if (!empty($groups)) {
foreach($groups as $k => $v) {
$groupsA[$v->id] = $v->title;
}
}
return $groupsA;
}
public static function storeSpecificationsById($productId, $specsArray,
$new = 0) {
if ((int)$productId > 0) {
$db =JFactory::getDBO();
$notDeleteSpecs = array();
if (!empty($specsArray)) {
$values = array();
$i = 1;
foreach($specsArray as $k => $v) {
// Don't store empty specification
if ($v['title'] == '') {
continue;
}
if(empty($v['alias'])) {
$v['alias'] = $v['title'];
}
$v['alias'] =
PhocacartUtils::getAliasName($v['alias']);
if(empty($v['alias_value'])) {
$v['alias_value'] = $v['value'];
}
// When no value, then no alias
if ($v['alias_value'] != '') {
$v['alias_value'] =
PhocacartUtils::getAliasName($v['alias_value']);
}
if(empty($v['group_id'])) {
$v['group_id'] = 0;
}
// correct simple xml
if (empty($v['title'])) {$v['title'] =
'';}
if (empty($v['alias'])) {$v['alias'] =
'';}
if (empty($v['value'])) {$v['value'] =
'';}
if (empty($v['alias_value'])) {$v['alias_value']
= '';}
if (empty($v['group_id'])) {$v['group_id'] =
'';}
if (empty($v['image']))
{$v['image'] = '';}
if (empty($v['image_medium']))
{$v['image_medium'] = '';}
if (empty($v['image_small']))
{$v['image_small'] = '';}
if (empty($v['color']))
{$v['color'] = '';}
$idExists = 0;
if ($new == 0) {
if (isset($v['id']) && $v['id'] > 0) {
// Does the row exist
$query = ' SELECT id '
.' FROM #__phocacart_specifications'
. ' WHERE id = '. (int)$v['id']
.' ORDER BY id';
$db->setQuery($query);
$idExists = $db->loadResult();
}
}
if ((int)$idExists > 0) {
$query = 'UPDATE #__phocacart_specifications SET'
.' product_id = '.(int)$productId.','
.' title =
'.$db->quote($v['title']).','
.' alias =
'.$db->quote($v['alias']).','
.' value =
'.$db->quote($v['value']).','
.' alias_value =
'.$db->quote($v['alias_value']).','
.' group_id = '.(int)$v['group_id'].','
.' image =
'.$db->quote($v['image']).','
.' image_medium =
'.$db->quote($v['image_medium']).','
.' image_small =
'.$db->quote($v['image_small']).','
.' color =
'.$db->quote($v['color']).','
.' ordering = '.$i
.' WHERE id = '.(int)$idExists;
$db->setQuery($query);
$db->execute();
$i++;
$newIdS = $idExists;
} else {
$values = '('.(int)$productId.',
'.$db->quote($v['title']).',
'.$db->quote($v['alias']).',
'.$db->quote($v['value']).',
'.$db->quote($v['alias_value']).',
'.(int)$v['group_id'].',
'.$db->quote($v['image']).',
'.$db->quote($v['image_medium']).',
'.$db->quote($v['image_small']).',
'.$db->quote($v['color']).',
'.$i.')';
$query = ' INSERT INTO #__phocacart_specifications (product_id,
title, alias, value, alias_value, group_id, image, image_medium,
image_small, color, ordering)'
.' VALUES '.$values;
$db->setQuery($query);
$db->execute();
$i++;
$newIdS = $db->insertid();
}
$notDeleteSpecs[] = $newIdS;
}
}
// Remove all specifications except the active
if (!empty($notDeleteSpecs)) {
$notDeleteSpecsString = implode(',', $notDeleteSpecs);
$query = ' DELETE '
.' FROM #__phocacart_specifications'
.' WHERE product_id = '. (int)$productId
.' AND id NOT IN ('.$notDeleteSpecsString.')';
} else {
$query = ' DELETE '
.' FROM #__phocacart_specifications'
.' WHERE product_id = '. (int)$productId;
}
$db->setQuery($query);
$db->execute();
}
}
/*
public static function storeSpecificationsById($productId, $specsArray) {
if ((int)$productId > 0) {
$db =JFactory::getDBO();
$query = ' DELETE '
.' FROM #__phocacart_specifications'
. ' WHERE product_id = '. (int)$productId;
$db->setQuery($query);
$db->execute();
if (!empty($specsArray)) {
$values = array();
foreach($specsArray as $k => $v) {
// Don't store empty specification
if ($v['title'] == '') {
continue;
}
if(empty($v['alias'])) {
$v['alias'] = $v['title'];
}
$v['alias'] =
PhocacartUtils::getAliasName($v['alias']);
if(empty($v['alias_value'])) {
$v['alias_value'] = $v['value'];
}
// When no value, then no alias
if ($v['alias_value'] != '') {
$v['alias_value'] =
PhocacartUtils::getAliasName($v['alias_value']);
}
if(empty($v['group_id'])) {
$v['group_id'] = 0;
}
// correct simple xml
if (empty($v['title'])) {$v['title'] =
'';}
if (empty($v['alias'])) {$v['alias'] =
'';}
if (empty($v['value'])) {$v['value'] =
'';}
if (empty($v['alias_value'])) {$v['alias_value']
= '';}
if (empty($v['group_id'])) {$v['group_id'] =
'';}
$values[] = '('.(int)$productId.',
'.$db->quote($v['title']).',
'.$db->quote($v['alias']).',
'.$db->quote($v['value']).',
'.$db->quote($v['alias_value']).',
'.(int)$v['group_id'].')';
}
if (!empty($values)) {
$valuesString = implode(',', $values);
$query = ' INSERT INTO #__phocacart_specifications (product_id,
title, alias, value, alias_value, group_id)'
.' VALUES '.(string)$valuesString;
$db->setQuery($query);
$db->execute();
}
}
}
}
*/
public static function getSpecificationGroupsAndSpecifications($productId)
{
$db = JFactory::getDBO();
$query = 'SELECT s.id, s.title, s.alias, s.value, s.alias_value,
s.image, s.image_medium, s.image_small, s.color, g.id as groupid, g.title
as grouptitle'
.' FROM #__phocacart_specifications AS s'
.' LEFT JOIN #__phocacart_specification_groups AS g ON g.id =
s.group_id'
.' WHERE s.product_id = '.(int)$productId
.' ORDER by g.ordering';
$db->setQuery($query);
$specs = $db->loadObjectList();
$specsA = array();
if (!empty($specs)){
foreach ($specs as $k => $v) {
$specsA[$v->groupid][0] = $v->grouptitle;
$specsA[$v->groupid][$v->id]['title'] = $v->title;
$specsA[$v->groupid][$v->id]['value'] = $v->value;
}
}
return $specsA;
}
public static function getAllSpecificationsAndValues($ordering = 1,
$onlyAvailableProducts = 0, $lang = '', $filterProducts =
array()) {
$db = JFactory::getDBO();
$orderingText = PhocacartOrdering::getOrderingText($ordering, 6);
$columns = 's.id, s.title, s.alias, s.value, s.alias_value,
s.image, s.image_medium, s.image_small, s.color';
$groupsFull = $columns;
$groupsFast = 's.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
$wheres = array();
$lefts = array();
$wheres[] = ' sg.published = 1';
$lefts[] = ' #__phocacart_specification_groups AS sg ON s.group_id
= sg.id';
if ($onlyAvailableProducts == 1) {
if ($lang != '' && $lang != '*') {
$wheres[] =
PhocacartUtilsSettings::getLangQuery('p.language', $lang);
}
$lefts[] = ' #__phocacart_products AS p ON s.product_id =
p.id';
$rules = PhocacartProduct::getOnlyAvailableProductRules();
$wheres = array_merge($wheres, $rules['wheres']);
$lefts = array_merge($lefts, $rules['lefts']);
} else {
if ($lang != '' && $lang != '*') {
$wheres[] =
PhocacartUtilsSettings::getLangQuery('p.language', $lang);
}
$lefts[] = ' #__phocacart_products AS p ON s.product_id =
p.id';
}
if (!empty($filterProducts)) {
$productIds = implode (',', $filterProducts);
$wheres[] = 'p.id IN ('.$productIds.')';
}
$query = 'SELECT '.$columns
.' FROM #__phocacart_specifications AS s'
. (!empty($lefts) ? ' LEFT JOIN ' . implode( ' LEFT JOIN
', $lefts ) : '')
. (!empty($wheres) ? ' WHERE ' . implode( ' AND ',
$wheres ) : '')
.' GROUP BY '.$groups
.' ORDER BY '.$orderingText;
$db->setQuery($query);
$specifications = $db->loadObjectList();
$a = array();
if (!empty($specifications)) {
foreach($specifications as $k => $v) {
if (isset($v->title) && $v->title != ''
&& isset($v->id) && $v->id != '' &&
isset($v->alias) && $v->alias != '') {
$a[$v->alias]['title'] = $v->title;
$a[$v->alias]['id'] = $v->id;
$a[$v->alias]['alias'] = $v->alias;
if (isset($v->value) && $v->value != ''
&& isset($v->alias_value) && $v->alias_value !=
'') {
$a[$v->alias]['value'][$v->alias_value] = new
stdClass();
$a[$v->alias]['value'][$v->alias_value]->title =
$v->value;
$a[$v->alias]['value'][$v->alias_value]->id =
$v->id;
$a[$v->alias]['value'][$v->alias_value]->alias =
$v->alias_value;
$a[$v->alias]['value'][$v->alias_value]->image =
$v->image;
$a[$v->alias]['value'][$v->alias_value]->image_medium =
$v->image_medium;
$a[$v->alias]['value'][$v->alias_value]->image_small =
$v->image_small;
$a[$v->alias]['value'][$v->alias_value]->color =
$v->color;
} else {
$a[$v->alias]['value'] = array();
}
}
}
}
return $a;
}
public static function getActiveSpecificationValues($items, $ordering)
{
$db = JFactory::getDbo();
$o = array();
$wheres = array();
$ordering = PhocacartOrdering::getOrderingText($ordering, 6);//s
if (!empty($items)) {
foreach ($items as $k => $v) {
$wheres[] = '( p.alias = ' . $db->quote($k) .
' AND s.alias IN (' . $v . ') )';
}
if (!empty($wheres)) {
// FULL GROUP BY GROUP_CONCAT(DISTINCT o.title) AS title
$q = 'SELECT DISTINCT s.title, s.alias,
CONCAT(\'a[\', p.alias, \']\') AS parameteralias,
p.title AS parametertitle FROM #__phocacart_specifications AS s'
. ' LEFT JOIN #__phocacart_specification_groups AS
p ON p.id = s.group_id'
. (!empty($wheres) ? ' WHERE ' .
implode(' OR ', $wheres) : '')
. ' GROUP BY p.alias, s.alias, s.title'
. ' ORDER BY ' . $ordering;
$db->setQuery($q);
$o = $db->loadAssocList();
}
}
return $o;
}
}
?>
PK�"�[wI���'libraries/phocacart/statistics/hits.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
final class PhocacartStatisticsHits
{
public function __construct() {
}
public static function productHit($productId = 0) {
if ($productId == 0) {
return false;
}
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$additional_hits = $paramsC->get( 'additional_hits', array()
);
// 1 ... product view
if (!in_array(1, $additional_hits)) {
return false;
}
$user = PhocacartUser::getUser();
$db = JFactory::getDbo();
$ip = PhocacartUtils::getIp();
$date = JFactory::getDate();
$item = array();
$q = 'SELECT a.id, a.hits'
.' FROM #__phocacart_hits AS a';
if (isset($user->id) && (int)$user->id > 0) {
$q .= ' WHERE a.product_id = '.(int) $productId . ' AND
a.user_id = '.(int)$user->id;
} else if (isset($ip) && $ip != '') {
$q .= ' WHERE a.product_id = '.(int) $productId . ' AND
a.ip = '.$db->quote($ip);
}
$q .=' ORDER BY a.id'
.' LIMIT 1';
$db->setQuery($q);
$item = $db->loadAssoc();
$q = '';
if (empty($item)){
if (isset($user->id) && (int)$user->id > 0) {
$q = 'INSERT INTO #__phocacart_hits (product_id, user_id, ip,
hits, type, date) VALUES ('.(int)$productId.',
'.(int)$user->id.', '.$db->quote($ip).', 1, 1,
'.$db->quote($date).')';
} else if (isset($ip) && $ip != '') {
$q = 'INSERT INTO #__phocacart_hits (product_id, ip, hits, type,
date) VALUES ('.(int)$productId.',
'.$db->quote($ip).', 1, 1,
'.$db->quote($date).')';
}
$db->setQuery($q);
$db->execute();
return true;
} else if (isset($item['id']) &&
(int)$item['id'] > 0) {
$hits = (int)$item['hits'] + 1;
if (isset($user->id) && (int)$user->id > 0) {
$q = 'UPDATE #__phocacart_hits SET hits =
'.(int)$hits.', date = '.$db->quote($date)
.' WHERE product_id = '.(int)$productId
.' AND user_id = '.(int)$user->id;
$db->setQuery($q);
$db->execute();
return true;
} else if (isset($ip) && $ip != '') {
$q = 'UPDATE #__phocacart_hits SET hits =
'.(int)$hits.', date = '.$db->quote($date)
.' WHERE product_id = '.(int)$productId
.' AND ip = '.$db->quote($ip);
$db->setQuery($q);
$db->execute();
return true;
}
}
return false;
}
public static function searchHit($search = '') {
if ($search == '') {
return false;
}
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$additional_hits = $paramsC->get( 'additional_hits', array()
);
// 2 ... search term
if (!in_array(2, $additional_hits)) {
return false;
}
$user = PhocacartUser::getUser();
$db = JFactory::getDbo();
$ip = PhocacartUtils::getIp();
$date = JFactory::getDate();
$item = array();
$q = 'SELECT a.id, a.hits'
.' FROM #__phocacart_hits AS a';
if (isset($user->id) && (int)$user->id > 0) {
$q .= ' WHERE a.item =
'.$db->quote($db->escape($search)) . ' AND a.user_id =
'.(int)$user->id;
} else if (isset($ip) && $ip != '') {
$q .= ' WHERE a.item =
'.$db->quote($db->escape($search)) . ' AND a.ip =
'.$db->quote($ip);
}
$q .=' ORDER BY a.id'
.' LIMIT 1';
$db->setQuery($q);
$item = $db->loadAssoc();
$q = '';
if (empty($item)){
if (isset($user->id) && (int)$user->id > 0) {
$q = 'INSERT INTO #__phocacart_hits (item, user_id, ip, hits,
type, date) VALUES ('.$db->quote($db->escape($search)).',
'.(int)$user->id.', '.$db->quote($ip).', 1, 2,
'.$db->quote($date).')';
} else if (isset($ip) && $ip != '') {
$q = 'INSERT INTO #__phocacart_hits (item, ip, hits, type, date)
VALUES ('.$db->quote($db->escape($search)).',
'.$db->quote($ip).', 1, 2,
'.$db->quote($date).')';
}
$db->setQuery($q);
$db->execute();
return true;
} else if (isset($item['id']) &&
(int)$item['id'] > 0) {
$hits = (int)$item['hits'] + 1;
if (isset($user->id) && (int)$user->id > 0) {
$q = 'UPDATE #__phocacart_hits SET hits =
'.(int)$hits.', date = '.$db->quote($date)
.' WHERE item = '.$db->quote($db->escape($search))
.' AND user_id = '.(int)$user->id;
$db->setQuery($q);
$db->execute();
return true;
} else if (isset($ip) && $ip != '') {
$q = 'UPDATE #__phocacart_hits SET hits =
'.(int)$hits.', date = '.$db->quote($date)
.' WHERE item = '.$db->quote($db->escape($search))
.' AND ip = '.$db->quote($ip);
$db->setQuery($q);
$db->execute();
return true;
}
}
return false;
}
}
?>PK�"�[�#o,,)libraries/phocacart/statistics/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�m:m:-libraries/phocacart/statistics/statistics.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined('_JEXEC') or die();
use Joomla\CMS\HTML\HTMLHelper;
final class PhocacartStatistics
{
protected $fn = array();
public function __construct() {
$app = JFactory::getApplication();
if ($app->isClient('administrator')) {
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework', false);
HTMLHelper::_('script',
'media/com_phocacart/js/chartjs/Chart.min.js',
array('version' => 'auto'), array('defer'
=> true));
} else {
$media = PhocacartRenderMedia::getInstance('main');
$media->renderChartJs();
}
}
public function renderChartJsLine($id, $dataA, $dataALabel, $dataB,
$dataBLabel, $dataX) {
/*$bC = 'rgba(79,152,195,1)';
$baC = 'rgba(79,152,195,0.5)';
$pbC = 'rgba(79,152,195,1)';
$pbaC = 'rgba(255,255,255,1)';
$bC2 = 'rgba(210,214,222,1)';
$baC2 = 'rgba(210,214,222,0.5)';
$pbC2 = 'rgba(210,214,222,1)';
$pbaC2 = 'rgba(255,255,255,1)';*/
$bC = 'rgba(247,99,151,1)';
$baC = 'rgba(247,99,151,0.5)';
$pbC = 'rgba(247,99,151,0.8)';
$pbaC = 'rgba(255,255,255,1)';
$bC2 = 'rgba(255, 170, 0,1)';
$baC2 = 'rgba(255, 170, 0,0.5)';
$pbC2 = 'rgba(255, 170, 0,0.8)';
$pbaC2 = 'rgba(255,255,255,1)';
$o = "
var config".$id." = {
type: 'line',
data: {
datasets: [{
data: [".$dataA."],
yAxisID: 'y-axis-2',
pointRadius : 4,
borderColor : '".$bC."',
backgroundColor : '".$baC."',
pointBorderColor : '".$pbC."',
pointBackgroundColor :'".$pbaC."',
pointBorderWidth : 1,
radius: 4,
pointHoverRadius: 5,
label: '".htmlspecialchars($dataALabel)."',
/*fillColor: '#fff',
strokeColor: '#fff',
pointColor: '#fff',
pointStrokeColor: '#fff',
pointHighlightFill: '#000',
pointHighlightStroke: '#fff'*/
}, {
data: [".$dataB."],
yAxisID: 'y-axis-1',
borderColor : '".$bC2."',
backgroundColor : '".$baC2."',
pointBorderColor : '".$pbC2."',
pointBackgroundColor :'".$pbaC2."',
pointBorderWidth : 1,
radius: 4,
pointHoverRadius: 5,
label: '".htmlspecialchars($dataBLabel)."',
}],
labels: [".htmlspecialchars($dataX)."
],
},
scaleIntegersOnly: true,
options: {
responsive: true,
hoverMode: 'label',
stacked: false,
legend: { labels: { fontColor: 'rgba(255,255,255,0.8)' } },
scales: {
xAxes: [{
display: true,
gridLines: {
drawOnChartArea: true,
offsetGridLines: false,
show: true,
color: 'rgba(255,255,255,0.2)',
zeroLineColor: 'rgba(255,255,255,0.2)',
lineWidth: 1,
/*drawOnChartArea: true,
drawTicks: true,
zeroLineWidth: 10,
zeroLineColor: '#fff300'*/
},
ticks: {fontColor: 'rgba(255,255,255,0.9)'}
}],
yAxes: [{
type: 'linear',
display: true,
position: 'left',
id: 'y-axis-1',
gridLines: {
drawOnChartArea: true,
color: 'rgba(255,255,255,0.2)',
zeroLineColor: 'rgba(255,255,255,0.2)',
lineWidth: 1,
},
label: 'text',
ticks: {
fontColor: 'rgba(255,255,255,0.9)',
callback: function(value) {
if (value % 1 === 0) {
return Math.floor(value);
} else {
return '';
}
}
}
}, {
type: 'linear',
display: true,
position: 'right',
id: 'y-axis-2',
gridLines: {
drawOnChartArea: false,
color: 'rgba(255,255,255,0.2)',
zeroLineColor: 'rgba(255,255,255,0.2)',
},
label: 'text',
ticks: {
fontColor: 'rgba(255,255,255,0.9)',
callback: function(value) {
if (value % 1 === 0) {
return Math.floor(value);
} else {
return '';
}
}
}
}],
},
}
};";
JFactory::getDocument()->addScriptDeclaration($o);
}
public function renderChartJsLine2($id, $dataA, $dataALabel, $dataX) {
$bC = 'rgba(52,140,212,1)';
$baC = 'rgba(52,140,212,0.3)';
$pbC = 'rgba(255,255,255,1)';
$pbaC = 'rgba(52,140,212,1)';
$o = "
var config".$id." = {
type: 'line',
data: {
datasets: [{
data: [".$dataA."],
yAxisID: 'y-axis-2',
pointRadius : 4,
borderColor : '".$bC."',
backgroundColor : '".$baC."',
pointBorderColor : '".$pbC."',
pointBackgroundColor :'".$pbaC."',
pointBorderWidth : 1,
radius: 4,
pointHoverRadius: 5,
label: '".htmlspecialchars($dataALabel)."',
/*fillColor: '#fff',
strokeColor: '#fff',
pointColor: '#fff',
pointStrokeColor: '#fff',
pointHighlightFill: '#000',
pointHighlightStroke: '#fff'*/
}],
labels: [".htmlspecialchars($dataX)."
],
},
scaleIntegersOnly: true,
options: {
responsive: true,
hoverMode: 'label',
stacked: false,
legend: { labels: { fontColor: '#000000' } },
scales: {
xAxes: [{
display: true,
gridLines: {
drawOnChartArea: true,
offsetGridLines: false,
show: true,
color: '#ffffff',
zeroLineColor: '#ffffff',
lineWidth: 1,
/*drawOnChartArea: true,
drawTicks: true,
zeroLineWidth: 10,
zeroLineColor: '#fff300'*/
},
ticks: {fontColor: '#000000'}
}],
yAxes: [{
type: 'linear',
display: false,
position: 'left',
id: 'y-axis-1',
gridLines: {
drawOnChartArea: true,
color: '#ffffff',
zeroLineColor: '#ffffff',
lineWidth: 1,
},
label: 'text',
ticks: {
fontColor: '#000000',
callback: function(value) {
if (value % 1 === 0) {
return Math.floor(value);
} else {
return '';
}
}
}
}, {
type: 'linear',
display: true,
position: 'right',
id: 'y-axis-2',
gridLines: {
drawOnChartArea: false,
color: '#ffffff',
zeroLineColor: '#ffffff',
},
label: 'text',
ticks: {
fontColor: '#000000',
callback: function(value) {
if (value % 1 === 0) {
return Math.floor(value);
} else {
return '';
}
}
}
}],
},
}
};";
JFactory::getDocument()->addScriptDeclaration($o);
}
public function renderChartJsPie($id, $data) {
$colors = array('#FFCC33', '#FF6633',
'#FF3366', '#FF33CC', '#CC33FF');
$dS = $lS = $bS = '';
if (!empty($data)) {
foreach($data as $k => $v) {
$d[$k] = '\''. addslashes($v['items']).
'\'';
$l[$k] = '\''. addslashes($v['title']).
'\'';
$c = $k%5;
$b[$k] = '\''. addslashes($colors[$k]).
'\'';
}
$dS = implode(',', $d);
$lS = implode(',', $l);
$bS = implode(',', $b);
}
$o = "
var config".$id." = {
type: 'pie',
data: {
datasets: [{
data: [".htmlspecialchars($dS)."],
backgroundColor : [".htmlspecialchars($bS)."],
}],
labels: [".htmlspecialchars($lS, ENT_NOQUOTES,
'UTF-8')."]
},
options: {
responsive: true,
}
};";
JFactory::getDocument()->addScriptDeclaration($o);
}
public function setFunction($id, $type) {
$this->fn[$id]['id'] = $id;
$this->fn[$id]['type'] = $type;
$this->fn[$id]['area'] = $id;
}
public function renderFunctions() {
$s = array();
$s[] = 'window.onload = function() {';
if (!empty($this->fn)) {
foreach($this->fn as $k => $v) {
$s[] = 'var ctx'.$v['id'].' =
document.getElementById(\''.$v['area'].'\').getContext(\'2d\');';
$s[] = 'window.'.$v['type'].' = new
Chart(ctx'.$v['id'].',
config'.$v['id'].');';
}
}
$s[] = '};';
JFactory::getDocument()->addScriptDeclaration(implode( "\n",
$s ));
}
public function getDataChart($numberOfDate = '', $dateFrom =
'', $dateTo = '') {
$db = JFactory::getDbo();
$q = $db->getQuery(true);
//- $q->select('a.id, DATE(a.date) AS date_only,
COUNT(DATE(a.date)) AS count_orders');
$q->select('DATE(a.date) AS date_only, COUNT(DATE(a.date)) AS
count_orders');
$q->from('`#__phocacart_orders` AS a');
$q->select('SUM(t.amount) AS order_amount');
$q->join('LEFT', '#__phocacart_order_total AS t ON
a.id=t.order_id');
$q->where('t.type = \'brutto\'' );
// Filter by order status
$whereOrderStatus = '';
if (!PhocacartStatistics::setWhereByOrderStatus($whereOrderStatus)) {
return false;
}
if ($whereOrderStatus != '') {
$q->where( $whereOrderStatus );
}
if ($numberOfDate == '') {
$numberOfDate = 6; //7 days
}
if ($dateFrom == '') {
$dateFrom = PhocacartDate::getCurrentDate($numberOfDate);
}
if ($dateTo == '') {
$dateTo = PhocacartDate::getCurrentDate();
}
$dateDays = PhocacartDate::getDateDays($dateFrom, $dateTo);
if ($dateTo != '' && $dateFrom != '') {
$dateFrom = $db->Quote($dateFrom);
$dateTo = $db->Quote($dateTo);
$q->where('DATE(a.date) >= '.$dateFrom.' AND
DATE(a.date) <= '.$dateTo );
}
//- $q->group('DATE(a.date), a.id');
$q->group('DATE(a.date)');
$q->order($db->escape('a.date ASC'));
//echo nl2br(str_replace('#__', 'jos_',
$q->__toString()));
$db->setQuery($q);
$items = $db->loadObjectList();
$amount = array();
$orders = array();
if (!empty($items) && !empty($dateDays)) {
foreach($dateDays as $date) {
$amount[ $date->format('Y-m-d') ] = 0;
$orders[ $date->format('Y-m-d') ] = 0;
}
foreach($items as $k => $v) {
if (isset($amount[$v->date_only])) {
//- $amount[$v->date_only] += $v->order_amount;
$amount[$v->date_only] = $v->order_amount;
}
if (isset($orders[$v->date_only])) {
//- $orders[$v->date_only] += $v->count_orders;
$orders[$v->date_only] = $v->count_orders;
}
}
}
$dataAmount = '';
$dataOrders = '';
$dataTicks = '';
$i = 1;
foreach ($amount as $k => $v) {
if ($dataAmount != '') {
$dataAmount .= ', ';
}
$dataAmount .= (int)$v;
$i++;
}
$i = 1;
foreach ($orders as $k => $v) {
if ($dataOrders != '') {
$dataOrders .= ', ';
}
if ($dataTicks != '') {
$dataTicks .= ', ';
}
$dataOrders .= (int)$v;
$dataTicks .= '\''.$k.'\'';
$i++;
}
$rData = array();
$rData['amount'] = $dataAmount;
$rData['orders'] = $dataOrders;
$rData['ticks'] = $dataTicks;
return $rData;
}
public function getNumberOfOrders($numberOfDate = -1, $dateFrom =
'', $dateTo = '') {
if ($numberOfDate == -1) {
$numberOfDate = 7;
}
if ($dateFrom == '') {
$dateFrom = PhocacartDate::getCurrentDate($numberOfDate);
}
if ($dateTo == '') {
$dateTo = PhocacartDate::getCurrentDate();
}
$db = JFactory::getDbo();
$q = 'SELECT COUNT(a.id) FROM #__phocacart_orders AS a WHERE
a.published = 1';
$q .= ' AND DATE(a.date) >=
'.$db->quote($dateFrom).' AND DATE(a.date) <=
'.$db->quote($dateTo);
$whereOrderStatus = '';
if (!PhocacartStatistics::setWhereByOrderStatus($whereOrderStatus)) {
return 0;
}
if ($whereOrderStatus != '') {
$q .= 'AND '.$whereOrderStatus;
}
$db->setQuery($q);
$count = $db->loadRow();
if (isset($count[0]) && (int)$count[0] != 0) {
return PhocacartStatistics::abreviateNumbers($count[0]);
}
return 0;
}
public function getNumberOfUsers($numberOfDate = -1, $dateFrom =
'', $dateTo = '') {
if ($numberOfDate == -1) {
$numberOfDate = 7;
}
if ($dateFrom == '') {
$dateFrom = PhocacartDate::getCurrentDate($numberOfDate);
}
if ($dateTo == '') {
$dateTo = PhocacartDate::getCurrentDate();
}
$db = JFactory::getDbo();
$q = 'SELECT COUNT(DISTINCT(a.user_id)) FROM #__phocacart_orders AS
a WHERE a.published = 1';
$q .= ' AND DATE(a.date) >=
'.$db->quote($dateFrom).' AND DATE(a.date) <=
'.$db->quote($dateTo);
$whereOrderStatus = '';
if (!PhocacartStatistics::setWhereByOrderStatus($whereOrderStatus)) {
return 0;
}
if ($whereOrderStatus != '') {
$q .= 'AND '.$whereOrderStatus;
}
$db->setQuery($q);
$count = $db->loadRow();
if (isset($count[0]) && (int)$count[0] != 0) {
return PhocacartStatistics::abreviateNumbers($count[0]);
}
return 0;
}
public function getAmountOfOrders($numberOfDate = -1, $dateFrom =
'', $dateTo = '') {
if ($numberOfDate == -1) {
$numberOfDate = 7;
}
if ($dateFrom == '') {
$dateFrom = PhocacartDate::getCurrentDate($numberOfDate);
}
if ($dateTo == '') {
$dateTo = PhocacartDate::getCurrentDate();
}
$db = JFactory::getDbo();
$q = ' SELECT SUM(t.amount) FROM #__phocacart_orders AS a';
$q .= ' LEFT JOIN #__phocacart_order_total AS t ON a.id =
t.order_id';
$q .= ' WHERE a.published = 1';
$q .= ' AND t.type = '.$db->quote('brutto');
$q .= ' AND DATE(a.date) >=
'.$db->quote($dateFrom).' AND DATE(a.date) <=
'.$db->quote($dateTo);
$whereOrderStatus = '';
if (!PhocacartStatistics::setWhereByOrderStatus($whereOrderStatus)) {
return 0;
}
if ($whereOrderStatus != '') {
$q .= 'AND '.$whereOrderStatus;
}
$db->setQuery($q);
$count = $db->loadRow();
if (isset($count[0]) && (int)$count[0] != 0) {
return $this->abreviateNumbers($count[0]);
}
return 0;
}
/*
* http://stackoverflow.com/questions/13049851/php-number-abbreviator
*/
public function abreviateNumbers($value) {
$abbreviations = array(12 => 'T', 9 => 'B', 6
=> 'M', 3 => 'K', 0 => '');
foreach($abbreviations as $exponent => $abbreviation) {
if($value >= pow(10, $exponent)) {
//return round(floatval($value / pow(10, $exponent))).$abbreviation;
return round(floatval($value / pow(10, $exponent)),1).$abbreviation;
}
}
}
/*
* changes the $whereStatus variable
* return true or false, if false, this will influence whole sql query
which will be completely ignored
*/
public static function setWhereByOrderStatus(&$whereStatus) {
$paramsC = PhocacartUtils::getComponentParameters();
$statistics_order_status = $paramsC->get(
'statistics_order_status', array(-1) );
if (in_array(-1, $statistics_order_status)) {
// All order statuses are set in statistics, where clause not needed
return true;
} else if (in_array(0, $statistics_order_status)) {
// No status selected, no statistics, where clause not needed
return false;
} else {
// Only some statuses selected, so where clause changed
$whereStatus = 'a.status_id IN ('.implode(',',
$statistics_order_status).')';
return true;
}
return false;
}
}
?>
PK�"�[�#o,,$libraries/phocacart/stock/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�f�}A}A#libraries/phocacart/stock/stock.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartStock
{
public static function getStockStatusData($stockStatusId, $available = 1)
{
$db = JFactory::getDBO();
if ($available == 1) {
$statusMethod = 'p.stockstatus_a_id';// Status when product is
in stock A(P > 0), or stock is not checked
} else {
$statusMethod = 'p.stockstatus_n_id';// Status when product is
not in stock N(P = 0)
}
$columns = 's.id, s.title, s.title_feed, s.image';
$groupsFull = $columns;
$groupsFast = 's.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
$query = 'SELECT s.id, s.title, s.title_feed, s.image, s.link,
s.link_target'
.' FROM #__phocacart_stock_statuses AS s'
.' LEFT JOIN #__phocacart_products AS p ON s.id =
'.$statusMethod
.' WHERE s.id = '.(int) $stockStatusId
.' GROUP BY '.$groups
.' ORDER BY s.id';
$db->setQuery($query);
$data = $db->loadObjectList();
return $data;
}
public static function getStockStatus($stockCount, $minQuantity,
$minMultipleQuantity, $stockStatusIdA, $stockStatusIdN) {
// A > 0 OR Not checking
// N = 0
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$stock_checking = $paramsC->get( 'stock_checking', 0
);
$display_stock_status = $paramsC->get(
'display_stock_status', 1 );
$stock_checkout = $paramsC->get( 'stock_checkout', 0
);
$stock_status_display_count = $paramsC->get(
'stock_status_display_count', 0 );
$stock = array();
/*
if($stockStatusIdN > 0) {
$dataB = self::getStockStatusData($stockStatusId);
}*/
$stock['stock_count'] = false;
$stock['stock_status'] = false;
$stock['status_image'] = false;
$stock['status_link'] = false;
$stock['status_link_target'] = false;
$stock['status_display_count'] =
(int)$stock_status_display_count;
$stock['stock_status_feed'] = false; // Additional status text
for feeds only - it is managed by $stock['stock_status']
// we differentiate between views: Category, Items, Item view but this
happens in view - not here
// so in views we decide if we will ask this function
// Example we select that stock status will be not displayed in category
(items) view but only in item view $display_stock_status = 1
// in category(items) view we have the condition so we never ask this
function from this view, this is why we don't need to
// handle different values for $display_stock_status
// $display_stock_status = 1 ... item view
// $display_stock_status = 2 ... category (items) view
// $display_stock_status = 3 ... item and category (items) view
// $display_stock_status = 3 ... item and category (items) view
if ($display_stock_status > 0) {
if ($stock_checking == 1) {
if ((int)$stockCount > 0) {
// 1 There is product in stock, display status - if set
if($stockStatusIdA > 0) {
$data = self::getStockStatusData($stockStatusIdA, 1);
if (!empty($data) && $data[0]->title != '') {
$stock['stock_status'] = JText::_($data[0]->title);
$stock['stock_status_feed'] =
JText::_($data[0]->title_feed);
}
if (!empty($data) && $data[0]->image != '') {
$stock['status_image'] = $data[0]->image;
}
if (!empty($data) && $data[0]->link !=
'') {
$stock['status_link'] =
$data[0]->link;
}
if (!empty($data) &&
$data[0]->link_target != '') {
$stock['status_link_target'] =
$data[0]->link_target;
}
}
$stock['stock_count'] = $stockCount;
} else {
// 2 There is no product in stock, display status - if set
if($stockStatusIdN > 0) {
$data = self::getStockStatusData($stockStatusIdN, 0);
if (!empty($data) && $data[0]->title != '') {
$stock['stock_status'] = JText::_($data[0]->title);
$stock['stock_status_feed'] =
JText::_($data[0]->title_feed);
}
if (!empty($data) && $data[0]->image != '') {
$stock['status_image'] = $data[0]->image;
}
if (!empty($data) && $data[0]->link !=
'') {
$stock['status_link'] =
$data[0]->link;
}
if (!empty($data) &&
$data[0]->link_target != '') {
$stock['status_link_target'] =
$data[0]->link_target;
}
}
$stock['stock_count'] = 0;
}
} else {
// 3 No stock checking we don't care about count of products but
we want to display status
if($stockStatusIdA > 0) {
$data = self::getStockStatusData($stockStatusIdA, 1);
if (!empty($data) && $data[0]->title != '') {
$stock['stock_status'] = JText::_($data[0]->title);
$stock['stock_status_feed'] =
JText::_($data[0]->title_feed);
}
if (!empty($data) && $data[0]->image != '') {
$stock['status_image'] = $data[0]->image;
}
if (!empty($data) && $data[0]->link !=
'') {
$stock['status_link'] =
$data[0]->link;
}
if (!empty($data) && $data[0]->link_target
!= '') {
$stock['status_link_target'] =
$data[0]->link_target;
}
}
// Stock count is set to false
}
}
$stock['min_quantity'] = false;
if ($minQuantity > 0) {
$stock['min_quantity'] = $minQuantity;
}
$stock['min_multiple_quantity'] = false;
if ($minMultipleQuantity > 0) {
$stock['min_multiple_quantity'] = $minMultipleQuantity;
}
return $stock;
}
public static function getStockStatusOutput($stockStatus) {
$o = '';
$s = PhocacartRenderStyle::getStyles();
// LINK
if ($stockStatus['status_link'] != '') {
$o .= '<a
href="'.$stockStatus['status_link'].'"';
if ($stockStatus['status_link_target'] !=
'') {
$o .= '
target="'.$stockStatus['status_link_target'].'"';
}
$o .= ' >';
}
if ($stockStatus['stock_status'] &&
$stockStatus['stock_count'] !== false &&
$stockStatus['status_display_count'] == 1) {
$o .= $stockStatus['stock_status'] . '
('.$stockStatus['stock_count'].')';
} else if (!$stockStatus['stock_status'] &&
$stockStatus['stock_count'] !== false) {
$o .= $stockStatus['stock_count'];
} else if ($stockStatus['stock_status'] /* &&
$stockStatus['status_display_count'] == 0*/) {
$o .= $stockStatus['stock_status'];
}
if ($stockStatus['status_image']) {
$o .= '<img
src="'.JURI::base(true).'/'.$stockStatus['status_image'].'"
alt=""
class="'.$s['c']['img-responsive'].'
ph-image" />';
}
// LINK
if ($stockStatus['status_link'] != '') {
$o .= '</a>';
}
return $o;
}
/* Handling of stock */
public static function handleStockProduct($productId, $orderStatusId,
$quantity, $stockMovement = '') {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$negative_stocks = $paramsC->get( 'negative_stocks', 1 );
// We know the stock movement, ignore the status
if ($stockMovement == '+' || $stockMovement == '-') {
$status = array();
$status['stock_movements'] = $stockMovement;
} else {
$status = PhocacartOrderStatus::getStatus((int)$orderStatusId);
}
if (isset($status['stock_movements']) &&
$status['stock_movements'] == '+') {
$db = JFactory::getDBO();
$query = 'UPDATE #__phocacart_products SET stock = stock +
'.(int)$quantity.' WHERE id = '.(int)$productId;
$db->setQuery($query);
$db->execute();
} else if (isset($status['stock_movements']) &&
$status['stock_movements'] == '-') {
$db = JFactory::getDBO();
if ($negative_stocks == 0) {
// we cannot have negative values in stock
$query = 'UPDATE #__phocacart_products SET stock = GREATEST(0,
stock - '.(int)$quantity.') WHERE id = '.(int)$productId;
} else {
$query = 'UPDATE #__phocacart_products SET stock = stock -
'.(int)$quantity.' WHERE id = '.(int)$productId;
}
$db->setQuery($query);
$db->execute();
}
return true;
}
public static function handleStockAttributeOption($optionId,
$orderStatusId, $quantity, $stockMovement = '') {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$negative_stocks = $paramsC->get( 'negative_stocks', 1 );
// We know the stock movement, ignore the status
if ($stockMovement == '+' || $stockMovement == '-') {
$status = array();
$status['stock_movements'] = $stockMovement;
} else {
$status = PhocacartOrderStatus::getStatus((int)$orderStatusId);
}
if (isset($status['stock_movements']) &&
$status['stock_movements'] == '+') {
$db = JFactory::getDBO();
$query = 'UPDATE #__phocacart_attribute_values SET stock = stock +
'.(int)$quantity.' WHERE id = '.(int)$optionId;
$db->setQuery($query);
$db->execute();
} else if (isset($status['stock_movements']) &&
$status['stock_movements'] == '-') {
$db = JFactory::getDBO();
if ($negative_stocks == 0) {
// we cannot have negative values in stock
$query = 'UPDATE #__phocacart_attribute_values SET stock =
GREATEST(0, stock - '.(int)$quantity.') WHERE id =
'.(int)$optionId;
} else {
$query = 'UPDATE #__phocacart_attribute_values SET stock = stock -
'.(int)$quantity.' WHERE id = '.(int)$optionId;
}
$db->setQuery($query);
$db->execute();
}
return true;
}
public static function handleStockProductKey($productKey, $orderStatusId,
$quantity, $stockMovement = '') {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$negative_stocks = $paramsC->get( 'negative_stocks', 1 );
// We know the stock movement, ignore the status
if ($stockMovement == '+' || $stockMovement == '-') {
$status = array();
$status['stock_movements'] = $stockMovement;
} else {
$status = PhocacartOrderStatus::getStatus((int)$orderStatusId);
}
if (isset($status['stock_movements']) &&
$status['stock_movements'] == '+') {
$db = JFactory::getDBO();
$query = 'UPDATE #__phocacart_product_stock SET stock = stock +
'.(int)$quantity.' WHERE product_key =
'.$db->quote($productKey);
$db->setQuery($query);
$db->execute();
} else if (isset($status['stock_movements']) &&
$status['stock_movements'] == '-') {
$db = JFactory::getDBO();
if ($negative_stocks == 0) {
// we cannot have negative values in stock
$query = 'UPDATE #__phocacart_product_stock SET stock =
GREATEST(0, stock - '.(int)$quantity.') WHERE product_key =
'.$db->quote($productKey);
} else {
$query = 'UPDATE #__phocacart_product_stock SET stock = stock -
'.(int)$quantity.' WHERE product_key =
'.$db->quote($productKey);
}
$db->setQuery($query);
$db->execute();
}
return true;
}
/*
* $selectedAttributes ... ajax, checkout, checkout json - attributes are
not all attributes assigned to product but only the one selected by e.g.
select box
* (including the option that no attribute was selected - in this case the
main product is even a variant)
*/
public static function getStockItemsChangedByAttributes(&$stockStatus,
$attributes, $item, $selectedAttributes = 0) {
//$paramsC = PhocacartUtils::getComponentParameters();
//$display_unit_price = $paramsC->get( 'display_unit_price',
1 );
$stock = 0;// main stock count - rendered output of stock item (by
product, attribute or mix of attributes ASM)
$stockProduct = isset($item->stock) ? $item->stock : 0;// stock
stored by product
$stockAttribute = 0;// stock stored by each attribute
$fullAttributes = array();// Array of full objects (full options object)
$thinAttributes = array();// Array of integers only
if ($selectedAttributes == 2) {
// Final order, we get the attributes in different format as by
adding them to cart
// it is final order, we order the items so we don't check
e.g. if default values or not - the values are selected yet
$fullAttributes =
PhocacartAttribute::getAttributeFullValues($attributes);
$thinAttributes =
PhocacartAttribute::getAttributesSanitizeOptionArray($attributes);//select
only default v a to create product key
} else if ($selectedAttributes == 1) {
$fullAttributes =
PhocacartAttribute::getAttributeFullValues($attributes);
$thinAttributes = $attributes;//select only default value attributes
(selected options) to create product key
} else {
$fullAttributes = $attributes;
$thinAttributes =
PhocacartAttribute::getAttributesSelectedOnly($attributes);//select only
default v a to create product key
}
// Stock Calculation
// 0 ... Main Product
// 1 ... Product Variations
// 2 ... Advanced Stock Management
// 3 ... Advanced Stock And Price Management ( 2 + price)
if ($item->stock_calculation == 1) {
// Product Variations - Be aware can be wrong count of stock when mixing
attributes - works only one attribute
$i = 0;
if (!empty($fullAttributes)) {
// Is some attribute with its option active (selected). If not, then
the main product variant should be set
$productAttributeSelected = 0;
foreach ($fullAttributes as $k => $v) {
$attributeSelected = 0;
$stockAttribute = 0;
if (!empty($v->options)) {
$i++;
foreach($v->options as $k2 => $v2) {
// Is the options set as default
// See:
administrator\components\com_phocacart\libraries\phocacart\price\price.php
// function getPriceItemsChangedByAttributes - similar behaviour
if ($selectedAttributes == 1 || $selectedAttributes == 2 ||
($selectedAttributes == 0 && isset($v2->default_value)
&& $v2->default_value == 1)) {
$attributeSelected = 1;
$productAttributeSelected = 1;
if (isset($v2->stock) && $v2->stock > 0) {
$stockAttribute += (int)$v2->stock;
}
}
}
}
if ($attributeSelected == 1) {
$stock += $stockAttribute;
} else {
// we iterate over attributes not products
// so this is the variant for main product
// IF there is more than one parameter, this will
be always wrong here because
// 1) first attribute not selected, second
selected: should we add only second or second plus main product stock?
// Product stock 100
// Product attribute A stock 50
// Product attribute B stock 50
// first attribute not selected = 0, second
selected = 50 (we skip to add the main product 100)
// 2) first not selected, second not selected: ok
we add only the main product stock
// both have 0 but we select main product which is
100
// if we should add main product then:
// $stock += $stockProduct;
}
}
if ($productAttributeSelected == 0) {
// We have attributes and their options
// but no one set as default or selected
$stock += $stockProduct;
}
} else {
if ($selectedAttributes == 1) {
// If there are no attributes, the main product is the
varaint itself
$stock+= $item->stock;
}
}
if ($i > 1 && $selectedAttributes != 1) {
PhocacartLog::add(3, 'Warning', $item->id,
JText::_('COM_PHOCACART_INAPPROPRIATE_METHOD_STOCK_CALCULATION_PRODUCT_VARIATIONS')
. ' ' . JText::_('COM_PHOCACART_PRODUCT'). ':
' . $item->title );
}
} else if ($item->stock_calculation == 2 ||
$item->stock_calculation == 3) {
// Advanced Stock Management
$k = PhocacartProduct::getProductKey((int)$item->id,
$thinAttributes);
$stock = PhocacartAttribute::getCombinationsStockByKey($k);
} else {
// Main Product
$stock = $item->stock;
}
// Get all stock status information: count, status, image, ...
$stockStatus = PhocacartStock::getStockStatus((int)$stock,
(int)$item->min_quantity, (int)$item->min_multiple_quantity,
(int)$item->stockstatus_a_id, (int)$item->stockstatus_n_id);
return $stock;
}
}
PK�"�[�#o,,%libraries/phocacart/submit/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[^�\��%libraries/phocacart/submit/submit.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartSubmit {
public static function isAllowedToSubmit() {
$paramsC =
JComponentHelper::getParams('com_phocacart') ;
$submit_item_registered_only = $paramsC->get(
'submit_item_registered_only', 1 );
$user = PhocacartUser::getUser();
$allowed = false;
if ($submit_item_registered_only == 0) {
$allowed = true;
} else if ($submit_item_registered_only == 1 && (int)$user->id
> 0) {
$allowed = true;
}
return $allowed;
}
/* Product item form fields:
title,
alias,
sku,
upc,
ean,
jan,
isbn,
mpn,
serial_number,
registration_key,
external_id,
external_key,
external_link,
external_text,
external_link2,
external_text2,
price,
price_original,
tax_id,
catid_multiple,
manufacturer_id,
description,
description_long,
features,
image,
video,
type,
unit_amount,
unit_unit,
length,
width,
height,
weight,
volume,
condition,
type_feed,
type_category_feed,
delivery_date,
metatitle,
metakey,
metadesc,
date,
date_update,
tags,
taglabels
Contact item form fields:
name*, email, phone, message
*/
}
PK�"�[�#o,,"libraries/phocacart/tag/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[RJ#�6�6libraries/phocacart/tag/tag.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartTag
{
/**
* Standard Tags - are displayed at the bottom
* @param int $itemId
* @param number $select
* @return mixed|void|mixed[]
*/
public static function getTags($itemId, $select = 0) {
$db = JFactory::getDBO();
if ($select == 1) {
$query = 'SELECT r.tag_id';
} else if ($select == 2){
$query = 'SELECT a.id, a.alias ';
} else {
$query = 'SELECT a.id, a.title, a.alias, a.type, a.display_format,
a.link_ext, a.link_cat, a.icon_class';
}
$query .= ' FROM #__phocacart_tags AS a'
//.' LEFT JOIN #__phocacart AS f ON f.id = r.item_id'
.' LEFT JOIN #__phocacart_tags_related AS r ON a.id =
r.tag_id'
.' WHERE a.type = 0'
.' AND r.item_id = '.(int) $itemId
.' ORDER BY a.id';
$db->setQuery($query);
if ($select == 1) {
$tags = $db->loadColumn();
} else {
$tags = $db->loadObjectList();
}
return $tags;
}
/*
* TAGS (stored in submitted items) Field JFormFieldPhocaTagsSubmitItems
*/
public static function getTagsSubmitItems($itemId) {
$db = JFactory::getDBO();
$query = 'SELECT a.items_item';
$query .= ' FROM #__phocacart_submit_items AS a'
.' WHERE a.id = '.(int) $itemId
.' ORDER BY a.id';
$db->setQuery($query);
$items = $db->loadResult();
if (!empty($items)) {
$itemsA = json_decode($items, true);
if (isset($itemsA['tags'])){
return $itemsA['tags'];
}
}
return array();
}
public static function getTagsByIds($cids) {
$db = JFactory::getDBO();
if ($cids != '') {//cids is string separated by comma
$query = 'SELECT r.tag_id FROM #__phocacart_tags AS
a'
//.' LEFT JOIN #__phocacart AS f ON f.id =
r.item_id'
. ' LEFT JOIN #__phocacart_tags_related AS r ON a.id =
r.tag_id'
. ' WHERE a.type = 0'
. ' AND r.item_id IN (' . $cids . ')'
. ' ORDER BY a.id';
$db->setQuery($query);
$tags = $db->loadColumn();
$tags = array_unique($tags);
return $tags;
}
return array();
}
/**
* Labels - are displayed at the top
* @param int $itemId
* @param number $select
* @return mixed|void|mixed[]
*/
public static function getTagLabels($itemId, $select = 0) {
$db = JFactory::getDBO();
if ($select == 1) {
$query = 'SELECT r.tag_id';
} else if ($select == 2){
$query = 'SELECT a.id, a.alias ';
} else {
$query = 'SELECT a.id, a.title, a.alias, a.type, a.display_format,
a.link_ext, a.link_cat, a.icon_class';
}
$query .= ' FROM #__phocacart_tags AS a'
//.' LEFT JOIN #__phocacart AS f ON f.id = r.item_id'
.' LEFT JOIN #__phocacart_taglabels_related AS r ON a.id =
r.tag_id'
.' WHERE a.type = 1'
.' AND r.item_id = '.(int) $itemId
.' ORDER BY a.id';
$db->setQuery($query);
if ($select == 1) {
$tags = $db->loadColumn();
} else {
$tags = $db->loadObjectList();
}
return $tags;
}
/*
* TAGLABELS (stored in submitted items) Field
JFormFieldPhocaTaglabelsSubmitItems
*/
public static function getTagLabelsSubmitItems($itemId) {
$db = JFactory::getDBO();
$query = 'SELECT a.items_item';
$query .= ' FROM #__phocacart_submit_items AS a'
.' WHERE a.id = '.(int) $itemId
.' ORDER BY a.id';
$db->setQuery($query);
$items = $db->loadResult();
if (!empty($items)) {
$itemsA = json_decode($items, true);
if (isset($itemsA['taglabels'])){
return $itemsA['taglabels'];
}
}
return array();
}
public static function getTagsLabelsByIds($cids) {
$db = JFactory::getDBO();
if ($cids != '') {//cids is string separated by comma
$query = 'SELECT r.tag_id FROM #__phocacart_tags AS
a'
//.' LEFT JOIN #__phocacart AS f ON f.id =
r.item_id'
. ' LEFT JOIN #__phocacart_taglabels_related AS r ON
a.id = r.tag_id'
. ' WHERE a.type = 1'
. ' AND r.item_id IN (' . $cids . ')'
. ' ORDER BY a.id';
$db->setQuery($query);
$tags = $db->loadColumn();
$tags = array_unique($tags);
return $tags;
}
return array();
}
/**
* @param int $ordering
* @param int $onlyAvailableProducts
* @param int $type 0 ... tag, 1 ... label
* @param string $lang
* @return mixed
*/
public static function getAllTags($ordering = 1, $onlyAvailableProducts =
0, $type = 0, $lang = '', $filterProducts = array(), $limitCount
= -1) {
/* $db = JFactory::getDBO();
$orderingText = PhocacartOrdering::getOrderingText($ordering, 3);
$query = 'SELECT t.id, t.title, t.alias FROM #__phocacart_tags AS t
WHERE t.published = 1 ORDER BY '.$orderingText;
$db->setQuery($query);
$tags = $db->loadObjectList();
return $tags;*/
$wheres = array();
$lefts = array();
switch($type) {
case 1:
$wheres[] = ' t.type = 1';
$related = '#__phocacart_taglabels_related';
break;
case 0:
default:
$wheres[] = ' t.type = 0';
$related = '#__phocacart_tags_related';
break;
}
$db = JFactory::getDBO();
$orderingText = PhocacartOrdering::getOrderingText($ordering, 3);
$columns = 't.id, t.title, t.alias, t.type, t.count_products';
/*$groupsFull = $columns;
$groupsFast = 'm.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;*/
$wheres[] = ' t.published = 1';
if ($onlyAvailableProducts == 1) {
if ($lang != '' && $lang != '*') {
$wheres[] =
PhocacartUtilsSettings::getLangQuery('p.language', $lang);
}
$lefts[] = ' '.$related.' AS tr ON tr.tag_id =
t.id';
$lefts[] = ' #__phocacart_products AS p ON tr.item_id = p.id';
$rules = PhocacartProduct::getOnlyAvailableProductRules();
$wheres = array_merge($wheres, $rules['wheres']);
$lefts = array_merge($lefts, $rules['lefts']);
} else {
if ($lang != '' && $lang != '*') {
$wheres[] =
PhocacartUtilsSettings::getLangQuery('p.language', $lang);
$lefts[] = ' '.$related.' AS tr ON tr.tag_id =
t.id';
$lefts[] = ' #__phocacart_products AS p ON tr.item_id =
p.id';
}
}
if (!empty($filterProducts)) {
$productIds = implode (',', $filterProducts);
$wheres[] = 'p.id IN ('.$productIds.')';
}
if ((int)$limitCount > -1) {
$wheres[] = " t.count_products > ".(int)$limitCount;
}
$q = ' SELECT DISTINCT '.$columns
.' FROM #__phocacart_tags AS t'
. (!empty($lefts) ? ' LEFT JOIN ' . implode( ' LEFT JOIN
', $lefts ) : '')
. (!empty($wheres) ? ' WHERE ' . implode( ' AND ',
$wheres ) : '')
//.' GROUP BY '.$groups
.' ORDER BY '.$orderingText;
$db->setQuery($q);
$items = $db->loadObjectList();
return $items;
}
public static function storeTags($tagsArray, $itemId) {
if ((int)$itemId > 0) {
$db = JFactory::getDBO();
$query = ' DELETE '
.' FROM #__phocacart_tags_related'
. ' WHERE item_id = '. (int)$itemId;
$db->setQuery($query);
$db->execute();
if (!empty($tagsArray)) {
$values = array();
$valuesString = '';
foreach($tagsArray as $k => $v) {
$values[] = ' ('.(int)$itemId.',
'.(int)$v.')';
}
if (!empty($values)) {
$valuesString = implode(',', $values);
$query = ' INSERT INTO #__phocacart_tags_related (item_id,
tag_id)'
.' VALUES '.(string)$valuesString;
$db->setQuery($query);
$db->execute();
}
}
}
}
public static function storeTagLabels($tagsArray, $itemId) {
if ((int)$itemId > 0) {
$db = JFactory::getDBO();
$query = ' DELETE '
.' FROM #__phocacart_taglabels_related'
. ' WHERE item_id = '. (int)$itemId;
$db->setQuery($query);
$db->execute();
if (!empty($tagsArray)) {
$values = array();
$valuesString = '';
foreach($tagsArray as $k => $v) {
$values[] = ' ('.(int)$itemId.',
'.(int)$v.')';
}
if (!empty($values)) {
$valuesString = implode(',', $values);
$query = ' INSERT INTO #__phocacart_taglabels_related (item_id,
tag_id)'
.' VALUES '.(string)$valuesString;
$db->setQuery($query);
$db->execute();
}
}
}
}
public static function getAllTagsSelectBox($name, $id, $activeArray,
$javascript = NULL, $order = 'id', $type = 0, $attributes =
'') {
$db = JFactory::getDBO();
$query = 'SELECT a.id AS value, a.title AS text'
.' FROM #__phocacart_tags AS a'
.' WHERE a.type ='.(int)$type
.' ORDER BY '. $order;
$db->setQuery($query);
$tags = $db->loadObjectList();
$tagsO = Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$tags, $name, $attributes, 'value', 'text',
$activeArray, $id);
return $tagsO;
}
/**
*
* @param int $itemId
* @param number $type 0 ... nothing, 1 ... tags only, 2 ... labels only,
3 ... tags and labels
* @return string
*/
public static function getTagsRendered($itemId, $type = 0, $separator =
'') {
if ($type == 1) {
// Only tags
$tags = self::getTags($itemId);
} else if ($type == 2) {
// Only labels
$tags = self::getTagLabels($itemId);
} else if ($type == 3) {
// Tags and Labels together (they can be displayed as labels in
category/items view)
$t = self::getTags($itemId);
$l = self::getTagLabels($itemId);
$tags = array_merge($t, $l);
} else {
return '';
}
$db = JFactory::getDBO();
$p = PhocacartUtils::getComponentParameters();
$s = PhocacartRenderStyle::getStyles();
$tl = $p->get( 'tags_links', 0 );
$o = array();
$i = 0;
if (!empty($tags)) {
foreach($tags as $k => $v) {
if ($type == 2 || $type == 3) {
$o[$i] = '<div
class="ph-corner-icon-wrapper"><div
class="ph-corner-icon
ph-corner-icon-'.htmlspecialchars(strip_tags($v->alias)).'">';
} else {
$o[$i] = '<span
class="'.$s['c']['label.label-info']
.'">';
}
$dO = htmlspecialchars(strip_tags($v->title));
if ($v->display_format == 2) {
if ($v->icon_class != '') {
$dO = '<span
class="'.htmlspecialchars(strip_tags($v->icon_class)).'"></span>';
} else {
$dO = $v->title;
}
} else if ($v->display_format == 3) {
if ($v->icon_class != '') {
$dO = '<span
class="'.htmlspecialchars(strip_tags($v->icon_class)).'"></span>';
}
$dO .= $v->title;
}
if ($tl == 0) {
$o[$i] .= $dO;
} else if ($tl == 1) {
if ($v->link_ext != '') {
$o[$i] .= '<a
href="'.$v->link_ext.'">'.$dO.'</a>';
} else {
$o[$i] .= $dO;
}
} else if ($tl == 2) {
if ($v->link_cat != '') {
$query = 'SELECT a.id, a.alias'
.' FROM #__phocacart_categories AS a'
.' WHERE a.id = '.(int)$v->link_cat;
$db->setQuery($query, 0, 1);
$category = $db->loadObject();
if (isset($category->id) && isset($category->alias)) {
$link = PhocacartRoute::getCategoryRoute($category->id,
$category->alias);
$o[$i] .= '<a
href="'.$link.'">'.$dO.'</a>';
} else {
$o[$i] .= $dO;
}
} else {
$o[$i] .= $dO;
}
} else if ($tl == 3) {
$link = PhocacartRoute::getItemsRoute();
if ($type == 2 || $type == 3) {
$link = $link .
PhocacartRoute::getItemsRouteSuffix('label', $v->id,
$v->alias);
} else {
$link = $link .
PhocacartRoute::getItemsRouteSuffix('tag', $v->id,
$v->alias);
}
$o[$i] .= '<a
href="'.JRoute::_($link).'">'.$dO.'</a>';
}
if ($type == 2 || $type == 3) {
$o[$i] .= '</div></div>';
} else {
$o[$i] .= '</span>';
}
$i++;
}
}
return implode($separator, $o);
}
public static function getTagType($type = 0) {
switch ($type) {
case 1:
return JText::_('COM_PHOCACART_TAG_LABEL');
break;
default:
return JText::_('COM_PHOCACART_TAG');
break;
}
}
public static function getActiveTags($items, $ordering) {
$db = JFactory::getDbo();
$o = array();
$wheres = array();
$ordering = PhocacartOrdering::getOrderingText($ordering, 3);//t
if ($items != '') {
$wheres[] = 't.id IN (' . $items . ')';
$wheres[] = 't.type = 0';
$q = 'SELECT DISTINCT t.title, CONCAT(t.id,
\'-\', t.alias) AS alias, \'tag\' AS parameteralias,
\'tag\' AS parametertitle FROM #__phocacart_tags AS t'
. (!empty($wheres) ? ' WHERE ' . implode('
AND ', $wheres) : '')
. ' GROUP BY t.alias, t.title'
. ' ORDER BY ' . $ordering;
$db->setQuery($q);
$o = $db->loadAssocList();
}
return $o;
}
public static function getActiveLabels($items, $ordering) {
$db = JFactory::getDbo();
$o = array();
$wheres = array();
$ordering = PhocacartOrdering::getOrderingText($ordering, 3);//t
if ($items != '') {
$wheres[] = 't.id IN (' . $items . ')';
$wheres[] = 't.type = 1';
$q = 'SELECT DISTINCT t.title, CONCAT(t.id,
\'-\', t.alias) AS alias, \'tag\' AS parameteralias,
\'tag\' AS parametertitle FROM #__phocacart_tags AS t'
. (!empty($wheres) ? ' WHERE ' . implode('
AND ', $wheres) : '')
. ' GROUP BY t.alias, t.title'
. ' ORDER BY ' . $ordering;
$db->setQuery($q);
$o = $db->loadAssocList();
}
return $o;
}
}
PK�"�[�#o,,"libraries/phocacart/tax/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[?��e**libraries/phocacart/tax/tax.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartTax
{
public static function getAllTaxes() {
$db = JFactory::getDBO();
$q = 'SELECT t.id, t.title, t.tax_rate'
. ' FROM #__phocacart_taxes as t'
//. ' LEFT JOIN #__phocacart_tax_countries AS tc ON tc.tax_id =
t.id AND tc.country_id = '.(int)$countryId
//. ' WHERE tc.country_id = '.(int)$id
. ' ORDER BY t.ordering ASC';
$db->setQuery($q) ;
$items = $db->loadAssocList('id');
return $items;
}
public static function getAllTaxesIncludingCountryRegion() {
// Tax key = IDTAX:IDCOUNTRYTAX:IDREGIONTAX
$db = JFactory::getDBO();
$q = 'SELECT CONCAT_WS(\':\', t.id, 0, 0) as tkey, t.id,
t.title, t.tax_rate, t.calculation_type FROM #__phocacart_taxes AS t ORDER
BY t.ordering ASC';
$db->setQuery($q) ;
$itemsT = $db->loadAssocList('tkey');
$q = 'SELECT CONCAT_WS(\':\', tc.tax_id, tc.id, 0) as
tkey, tc.id, tc.title, tc.tax_id, tc.tax_rate, t.calculation_type FROM
#__phocacart_tax_countries AS tc'
.' LEFT JOIN #__phocacart_taxes AS t ON t.id = tc.tax_id'
.' ORDER BY t.ordering ASC';
$db->setQuery($q) ;
$itemsC = $db->loadAssocList('tkey');
$q = 'SELECT CONCAT_WS(\':\', tr.tax_id, 0, tr.id) as
tkey, tr.id, tr.title, tr.tax_id, tr.tax_rate, t.calculation_type FROM
#__phocacart_tax_regions AS tr'
.' LEFT JOIN #__phocacart_taxes AS t ON t.id = tr.tax_id'
.' ORDER BY t.ordering ASC';
$db->setQuery($q) ;
$itemsR = $db->loadAssocList('tkey');
$items = array_merge($itemsT, $itemsC, $itemsR);
return $items;
}
// All taxes by country
public static function getTaxesByCountry($countryId) {
if ((int)$countryId > 0) {
$db = JFactory::getDBO();
$q = 'SELECT t.id, t.title, t.ordering, t.tax_rate, tc.id as
tcr_id, tc.title as tcr_title, tc.alias as tcr_alias, tc.tax_rate as
tcr_tax_rate'
. ' FROM #__phocacart_taxes as t'
. ' LEFT JOIN #__phocacart_tax_countries AS tc ON tc.tax_id = t.id
AND tc.country_id = '.(int)$countryId
//. ' WHERE tc.country_id = '.(int)$id
//. ' WHERE tc.tax_rate > -1'
. ' ORDER BY t.ordering ASC';
$db->setQuery($q) ;
$items = $db->loadObjectList();
return $items;
}
}
// All taxes by region
public static function getTaxesByRegion($regionId) {
if ((int)$regionId > 0) {
$db = JFactory::getDBO();
$q = 'SELECT t.id, t.title, t.ordering, t.tax_rate, tr.id as
tcr_id, tr.title as tcr_title, tr.alias as tcr_alias, tr.tax_rate as
tcr_tax_rate'
. ' FROM #__phocacart_taxes as t'
. ' LEFT JOIN #__phocacart_tax_regions AS tr ON tr.tax_id = t.id
AND tr.region_id = '.(int)$regionId
//. ' WHERE tc.country_id = '.(int)$id
//. ' WHERE tr.tax_rate > -1'
. ' ORDER BY t.ordering ASC';
$db->setQuery($q) ;
$items = $db->loadObjectList();
return $items;
}
}
// Selected tax by country
public static function getTaxByCountry($taxId) {
$countryId = (int)self::getUserCountryId();
$taxChangedA = array();
$taxChangedA['taxrate'] = '';// the rate can be 0
and zero is OK
$taxChangedA['taxtitle'] = '';
$taxChangedA['taxcountryid']= 0;
$taxChangedA['taxregionid']= 0;
if ((int)$taxId > 0 && $countryId > 0) {
$db = JFactory::getDBO();
$q = 'SELECT tc.id, tc.title, tc.tax_rate'
. ' FROM #__phocacart_tax_countries as tc'
. ' WHERE tc.country_id = '.(int)$countryId
. ' AND tc.tax_id = '.(int)$taxId
. ' AND tc.tax_rate > -1'
. ' LIMIT 1';
$db->setQuery($q) ;
$taxO = $db->loadObject();
if (isset($taxO->tax_rate) && $taxO->tax_rate !=
'') {
$taxChangedA['taxrate'] = $taxO->tax_rate;
}
if (isset($taxO->title) && $taxO->title != '') {
$taxChangedA['taxtitle'] = $taxO->title;
}
if (isset($taxO->id) && $taxO->id != '') {
$taxChangedA['taxcountryid'] = $taxO->id;
}
// CONDITIONS:
// $taxChangedA['taxrate'] > 0 ... not used - the rate can
be 0
// $taxChangedA['taxtitle'] ... not used - the title can be
empty
// if ($taxChangedA['taxrate'] > 0 &&
$taxChangedA['taxtitle'] != '') { // the rate can be 0
//
if ($taxChangedA['taxrate'] != '') {
return $taxChangedA;// if 0, it is valid
}
}
return false;
}
// Selected tax by country
public static function getTaxByRegion($taxId) {
$regionId = (int)self::getUserRegionId();
$taxChangedA = array();
$taxChangedA['taxrate'] = '';// the rate can be 0
and zero is OK
$taxChangedA['taxtitle'] = '';
$taxChangedA['taxcountryid']= 0;
$taxChangedA['taxregionid']= 0;
// tax rate -1 means that the tax is not used but it exists yet (will be
not completely removed because of the used ID in system
// for example if the country tax is specific and has ID 10 and it will
be deleted - then it still exists but with -1 as tax rate
// when such tax will be newly recreated it gets the same ID as it has
previously - which will unique tax rates for country in history
// even if the tax rate changes it uniques the tax type for each
country/region
if ((int)$taxId > 0 && $regionId > 0) {
$db = JFactory::getDBO();
$q = 'SELECT tr.id, tr.title, tr.tax_rate'
. ' FROM #__phocacart_tax_regions as tr'
. ' WHERE tr.region_id = '.(int)$regionId
. ' AND tr.tax_id = '.(int)$taxId
. ' AND tr.tax_rate > -1'
. ' LIMIT 1';
$db->setQuery($q) ;
$taxO = $db->loadObject();
if (isset($taxO->tax_rate) && $taxO->tax_rate !=
'') {
$taxChangedA['taxrate'] = $taxO->tax_rate;
}
if (isset($taxO->title) && $taxO->title != '') {
$taxChangedA['taxtitle'] = $taxO->title;
}
if (isset($taxO->id) && $taxO->id != '') {
$taxChangedA['taxregionid'] = $taxO->id;
}
// CONDITIONS:
// $taxChangedA['taxrate'] > 0 ... not used - the rate can
be 0
// $taxChangedA['taxtitle'] ... not used - the title can be
empty
// if ($taxChangedA['taxrate'] > 0 &&
$taxChangedA['taxtitle'] != '') { // the rate can be 0
//
if ($taxChangedA['taxrate'] != '') {
return $taxChangedA;// if 0, it is valid
}
}
return false;
}
public static function changeTaxBasedOnRule($taxId, $tax,
$taxCalculationType, $taxTitle) {
$taxChangedA = array();
$taxChangedA['taxrate'] = $tax;
$taxChangedA['taxtitle'] = $taxTitle;
$taxChangedA['taxcountryid'] = 0;
$taxChangedA['taxregionid'] = 0;
//$app = JFactory::getApplication();
//$paramsC = PhocacartUtils::getComponentParameters();
$paramsC = PhocacartUtils::getComponentParameters();
$dynamic_tax_rate = $paramsC->get( 'dynamic_tax_rate', 0
);
$dynamic_tax_rate_priority = $paramsC->get(
'dynamic_tax_rate_priority', 1 );// country prioritized
if ($dynamic_tax_rate == 0) {
return $taxChangedA;
}
if ($dynamic_tax_rate_priority == 1) {
// Country prioritized
$taxChangedA = self::getTaxByCountry($taxId);
//Not found - try to find region
if (!$taxChangedA) {
$taxChangedA = self::getTaxByRegion($taxId);
}
// If country or region based tax does not have title, set the default
one
if ($taxChangedA && $taxChangedA['taxtitle'] ==
'') {$taxChangedA['taxtitle'] = $taxTitle;}
} else {
// Region prioritized
$taxChangedA = self::getTaxByRegion($taxId);
//Not found - try to find country
if (!$taxChangedA) {
$taxChangedA = self::getTaxByCountry($taxId);
}
// If country or region based tax does not have title, set the default
one
if ($taxChangedA && $taxChangedA['taxtitle'] ==
'') {$taxChangedA['taxtitle'] = $taxTitle;}
}
// Nothing found - back to default:
if (!$taxChangedA) {
$taxChangedA['taxrate'] = $tax;
$taxChangedA['taxtitle'] = $taxTitle;
$taxChangedA['taxcountryid'] = 0;
$taxChangedA['taxregionid'] = 0;
}
return $taxChangedA;
}
public static function getUserCountryId() {
// 1. We get information about country stored by user
// 2. Possible improvement get country by IP (but possible problem)
$user = PhocacartUser::getUser();
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$dynamic_tax_rate = $paramsC->get( 'dynamic_tax_rate', 0 );
$type = 0;
if ($dynamic_tax_rate == 1) {
$type = 0;// BILLING
} else if ($dynamic_tax_rate == 2) {
$type = 1;// SHIPPING
}
if (isset($user->id) && (int)$user->id > 0 &&
(int)$dynamic_tax_rate > 0) {
$db = JFactory::getDBO();
$q = 'SELECT country'
. ' FROM #__phocacart_users'
. ' WHERE user_id = '.(int)$user->id
. ' AND type = '.(int)$type
. ' LIMIT 1';
$db->setQuery($q) ;
$countryId = $db->loadResult();
if ((int)$countryId > 0) {
return $countryId;
}
}
return 0;
}
public static function getUserRegionId() {
// 1. We get information about country stored by user
// 2. Possible improvement get country by IP (but possible problem)
$user = PhocacartUser::getUser();
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$dynamic_tax_rate = $paramsC->get( 'dynamic_tax_rate', 0 );
$type = 0;
if ($dynamic_tax_rate == 1) {
$type = 0;// BILLING
} else if ($dynamic_tax_rate == 2) {
$type = 1;// SHIPPING
}
if (isset($user->id) && (int)$user->id > 0 &&
(int)$dynamic_tax_rate > 0) {
$db = JFactory::getDBO();
$q = 'SELECT region'
. ' FROM #__phocacart_users'
. ' WHERE user_id = '.(int)$user->id
. ' AND type = '.(int)$type
. ' LIMIT 1';
$db->setQuery($q) ;
$regionId = $db->loadResult();
if ((int)$regionId > 0) {
return $regionId;
}
}
return 0;
}
/**
* In case that the tax is overriden by country or region we need to
identify it, this is why we don't use tax id as key but whole key: tax
id:country tax id:region tax id
* @param unknown $id
* @param number $countryId
* @param number $regionId
* @return string
*/
public static function getTaxKey($id, $countryId = 0, $regionId = 0) {
$key = (int)$id . ':';
$key .= (int)$countryId. ':';
$key .= (int)$regionId;
return $key;
}
public static function getTaxIdsFromKey($taxKey) {
$tax = array();
$tax['id'] = 0;
$tax['countryid'] = 0;
$tax['regionid'] = 0;
if ($taxKey != '') {
$taxKeyA = explode(':', $taxKey);
if (isset($taxKeyA[0])) { $tax['id'] = (int)$taxKeyA[0];}
if (isset($taxKeyA[1])) { $tax['countryid'] =
(int)$taxKeyA[1];}
if (isset($taxKeyA[2])) { $tax['regionid'] =
(int)$taxKeyA[2];}
}
return $tax;
}
}
PK�"�[�#o,,#libraries/phocacart/text/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[����[�[!libraries/phocacart/text/text.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
use Joomla\CMS\Language\Text;
use Joomla\String\StringHelper;
use Joomla\CMS\Language\Language;
class PhocacartText {
/*
* type ... 1 customers - email sent to customer - set in email or in
different text parts of e.g. invoice
* type ... 2 others - email sent to all others
*
*/
public static function completeText($body, $replace, $type = 1) {
$body = isset($replace['name']) ?
str_replace('{name}', $replace['name'], $body) : $body;
if ($type == 3) {
$body = isset($replace['email_gift_recipient']) ?
str_replace('{emailgiftrecipient}',
$replace['email_gift_recipient'], $body) : $body;
$body = isset($replace['name_gift_recipient']) ?
str_replace('{namegiftrecipient}',
$replace['name_gift_recipient'], $body) : $body;
$body = isset($replace['name_gift_sender']) ?
str_replace('{namegiftbuyer}',
$replace['name_gift_sender'], $body) : $body;
$body = isset($replace['valid_to_gift']) ?
str_replace('{giftvalidto}', $replace['valid_to_gift'],
$body) : $body;
} else if ($type == 2) {
$body = isset($replace['email_others']) ?
str_replace('{emailothers}', $replace['email_others'],
$body) : $body;
} else if ($type == 1){
$body = isset($replace['email']) ?
str_replace('{email}', $replace['email'], $body) :
$body;
}
$body = isset($replace['downloadlink']) ?
str_replace('{downloadlink}', $replace['downloadlink'],
$body) : $body;
$body = isset($replace['orderlink']) ?
str_replace('{orderlink}', $replace['orderlink'],
$body) : $body;
$body = isset($replace['orderlinktoken']) ?
str_replace('{orderlinktoken}',
$replace['orderlinktoken'], $body) : $body;
$body = isset($replace['ordertoken']) ?
str_replace('{ordertoken}', $replace['ordertoken'],
$body) : $body;
$body = isset($replace['trackinglink']) ?
str_replace('{trackinglink}', $replace['trackinglink'],
$body) : $body;
$body = isset($replace['trackingnumber']) ?
str_replace('{trackingnumber}',
$replace['trackingnumber'], $body) : $body;
$body = isset($replace['trackingdescription']) ?
str_replace('{trackingdescription}',
$replace['trackingdescription'], $body) : $body;
$body = isset($replace['shippingtitle']) ?
str_replace('{shippingtitle}',
$replace['shippingtitle'], $body) : $body;
$body = isset($replace['paymenttitle']) ?
str_replace('{paymenttitle}', $replace['paymenttitle'],
$body) : $body;
$body = isset($replace['dateshipped']) ?
str_replace('{dateshipped}', $replace['dateshipped'],
$body) : $body;
$body = isset($replace['customercomment']) ?
str_replace('{customercomment}',
$replace['customercomment'], $body) : $body;
$body = isset($replace['websitename']) ?
str_replace('{websitename}', $replace['websitename'],
$body) : $body;
$body = isset($replace['websiteurl']) ?
str_replace('{websiteurl}', $replace['websiteurl'],
$body) : $body;
$body = isset($replace['orderid']) ?
str_replace('{orderid}', $replace['orderid'],
$body) : $body;
$body = isset($replace['ordernumber']) ?
str_replace('{ordernumber}', $replace['ordernumber'],
$body) : $body;
$body = isset($replace['invoicenumber']) ?
str_replace('{invoicenumber}',
$replace['invoicenumber'], $body) : $body;
$body = isset($replace['receiptnumber']) ?
str_replace('{receiptnumber}',
$replace['receiptnumber'], $body) : $body;
$body = isset($replace['queuenumber']) ?
str_replace('{queuenumber}', $replace['queuenumber'],
$body) : $body;
$body = isset($replace['paymentreferencenumber']) ?
str_replace('{paymentreferencenumber}',
$replace['paymentreferencenumber'], $body): $body;
$body = isset($replace['invoiceduedate']) ?
str_replace('{invoiceduedate}',
$replace['invoiceduedate'], $body) : $body;
$body = isset($replace['invoicedate']) ?
str_replace('{invoicedate}', $replace['invoicedate'],
$body) : $body;
$body = isset($replace['invoicetimeofsupply']) ?
str_replace('{invoicetimeofsupply}',
$replace['invoicetimeofsupply'], $body) : $body;
$body = isset($replace['invoicedueyear']) ?
str_replace('{invoicedueyear}',
$replace['invoicedueyear'], $body) : $body;
$body = isset($replace['invoiceduemonth']) ?
str_replace('{invoiceduemonth}',
$replace['invoiceduemonth'], $body) : $body;
$body = isset($replace['invoicedueday']) ?
str_replace('{invoicedueday}',
$replace['invoicedueday'], $body) : $body;
$body = isset($replace['invoiceyear']) ?
str_replace('{invoiceyear}', $replace['invoiceyear'],
$body) : $body;
$body = isset($replace['invoicemonth']) ?
str_replace('{invoicemonth}', $replace['invoicemonth'],
$body) : $body;
$body = isset($replace['invoiceday']) ?
str_replace('{invoiceday}', $replace['invoiceday'],
$body) : $body;
$body = isset($replace['orderdate']) ?
str_replace('{orderdate}', $replace['orderdate'],
$body) : $body;
$body = isset($replace['totaltopay']) ?
str_replace('{totaltopay}', $replace['totaltopay'],
$body) : $body;
$body = isset($replace['orderyear']) ?
str_replace('{orderyear}', $replace['orderyear'],
$body) : $body;
$body = isset($replace['ordermonth']) ?
str_replace('{ordermonth}', $replace['ordermonth'],
$body) : $body;
$body = isset($replace['orderday']) ?
str_replace('{orderday}', $replace['orderday'],
$body) : $body;
$body = isset($replace['ordernumbertxt']) ?
str_replace('{ordernumbertxt}',
$replace['ordernumbertxt'], $body) : $body;
$body = isset($replace['bankaccountnumber']) ?
str_replace('{bankaccountnumber}',
$replace['bankaccountnumber'], $body) : $body;
$body = isset($replace['iban']) ?
str_replace('{iban}', $replace['iban'],
$body) : $body;
$body = isset($replace['bicswift']) ?
str_replace('{bicswift}', $replace['bicswift'],
$body) : $body;
$body = isset($replace['totaltopaynoformat']) ?
str_replace('{totaltopaynoformat}',
$replace['totaltopaynoformat'], $body) : $body;
$body = isset($replace['currencycode']) ?
str_replace('{currencycode}', $replace['currencycode'],
$body) : $body;
$body = isset($replace['openingtimesinfo']) ?
str_replace('{openingtimesinfo}',
$replace['openingtimesinfo'], $body) : $body;
$body = isset($replace['vendorname']) ?
str_replace('{vendorname}', $replace['vendorname'],
$body) : $body;
$body = isset($replace['vendorusername']) ?
str_replace('{vendorusername}',
$replace['vendorusername'], $body) : $body;
return $body;
}
//public static function completeTextFormFields($body, $bas, $type = 1) {
public static function completeTextFormFields($body, $basB, $basS) {
$bas = array_merge($basB, $basS);
/*if ($type == 1) {
$prefix = 'b_';
} else {
$prefix = 's_';
}
$commonprefix = 'bs_';
*/
// Common prefix means that if you set:
// {b_name} ... billing name will be displayed
// {s_name} ... shipping name will be displayed
// {bs_name} ... first displaying billing name and if it is not
available then display shipping name
// {sb_name} ... first displaying shipping name and if it is not
available then display billing name
if (!empty($bas)) {
if (isset($basB['id'])) {unset($basB['id']);}
if (isset($basB['order_id']))
{unset($basB['order_id']);}
if (isset($basB['user_address_id']))
{unset($basB['user_address_id']);}
if (isset($basB['user_token']))
{unset($basB['user_token']);}
if (isset($basB['user_groups']))
{unset($basB['user_groups']);}
if (isset($basB['ba_sa'])) {unset($basB['ba_sa']);}
if (isset($basB['type'])) {unset($basB['type']);}
if (isset($basS['id'])) {unset($basS['id']);}
if (isset($basS['order_id']))
{unset($basS['order_id']);}
if (isset($basS['user_address_id']))
{unset($basS['user_address_id']);}
if (isset($basS['user_token']))
{unset($basS['user_token']);}
if (isset($basS['user_groups']))
{unset($basS['user_groups']);}
if (isset($basS['ba_sa'])) {unset($basS['ba_sa']);}
if (isset($basS['type'])) {unset($basS['type']);}
foreach($bas as $k => $v) {
if (isset($basB[$k]) && $basB[$k] != '')
{
$body = str_replace('{b_' . $k .
'}', $basB[$k], $body);
$body = str_replace('{bs_' . $k .
'}', $basB[$k], $body);
} else if (isset($basS[$k]) && $basS[$k] !=
'') {
// bs_item: the value is not in billing, try to find it
in shipping
$body = str_replace('{bs_' . $k .
'}', $basS[$k], $body);
}
if (isset($basS[$k]) && $basS[$k] != '')
{
$body = str_replace('{s_' . $k .
'}', $basS[$k], $body);
$body = str_replace('{sb_' . $k .
'}', $basS[$k], $body);
} else if (isset($basB[$k]) && $basB[$k] !=
'') {
// sb_item: the value is not in shipping, try to find
it in billing
$body = str_replace('{sb_' . $k .
'}', $basB[$k], $body);
}
// Nothing found - remove from text
$body = str_replace('{b_' . $k . '}',
'', $body);
$body = str_replace('{bs_' . $k . '}',
'', $body);
$body = str_replace('{s_' . $k . '}',
'', $body);
$body = str_replace('{sb_' . $k . '}',
'', $body);
/*if ($v != '') {
// Replace the values
$body =
str_replace('{'.$prefix.$k.'}', $v, $body);
// Replace common values
$body =
str_replace('{'.$commonprefix.$k.'}', $v, $body);
} else {
// Hide the empty variable (in case the value is empty,
don't display variable name)
$body =
str_replace('{'.$prefix.$k.'}', '', $body);
if ($type != 1) {
// Don't remove this common variable in
billing cycle because we wait if it will be not transformed in shipping
cycle
// And if it is not in billing even not in shipping
then remove it.
$body =
str_replace('{'.$commonprefix.$k.'}', '',
$body);
}
}*/
}
}
return $body;
}
public static function prepareReplaceText($order, $orderId, $common,
$bas){
$pC = PhocacartUtils::getComponentParameters();
$config = JFactory::getConfig();
$price = new PhocacartPrice();
$price->setCurrency($common->currency_code, $orderId);
$totalBrutto = $order->getItemTotal($orderId, 0, 'brutto');
$download_guest_access = $pC->get('download_guest_access',
0);
$r = array();
$r['ordertoken'] = '';
if ($common->user_id > 0) {
// Standard User get standard download page and order page
$r['orderlink'] =
PhocacartPath::getRightPathLink(PhocacartRoute::getOrdersRoute());
$r['downloadlink'] =
PhocacartPath::getRightPathLink(PhocacartRoute::getDownloadRoute());
// Possible variables in email
if (isset($common->order_token) && $common->order_token !=
'') {
$r['orderlinktoken'] =
PhocacartPath::getRightPathLink(PhocacartRoute::getOrdersRoute() .
'&o='.$common->order_token);
$r['ordertoken'] = $common->order_token;
}
} else {
// Guests
if (isset($common->order_token) && $common->order_token !=
'') {
$r['orderlinktoken'] =
PhocacartPath::getRightPathLink(PhocacartRoute::getOrdersRoute() .
'&o='.$common->order_token);
$r['ordertoken'] = $common->order_token;
$r['orderlink'] = $r['orderlinktoken'];
}
$products = $order->getItemProducts($orderId);
$downloadO = '';
if(!empty($products) && isset($common->order_token)
&& $common->order_token != '' &&
$download_guest_access > 0) {
$downloadO =
'<p> </p><h4>'.JText::_('COM_PHOCACART_DOWNLOAD_LINKS').'</h4>';
foreach ($products as $k => $v) {
if (!empty($v->downloads)) {
$downloadO .=
'<div><strong>'.$v->title.'</strong></div>';
foreach ($v->downloads as $k2 => $v2) {
// Main Product Download File
if (isset($v2->published) &&
$v2->published == 1 && isset($v2->download_file) &&
$v2->download_file != '' &&
isset($v2->download_folder) && $v2->download_folder !=
'' && isset($v2->download_token) &&
$v2->download_token != '') {
$title =
str_replace($v2->download_folder, '', $v2->download_file);
$title = str_replace('/',
'', $title);
$downloadLink =
PhocacartPath::getRightPathLink(PhocacartRoute::getDownloadRoute() .
'&o='.$common->order_token.'&d='.$v2->download_token);
$downloadO .=
'<div>'.Text::_('COM_PHOCACART_DOWNLOAD').':
<a
href="'.$downloadLink.'">'.$title.'</a></div>';
$downloadO .=
'<div><small>'.Text::_('COM_PHOCACART_DOWNLOAD_LINK').':
<a
href="'.$downloadLink.'">'.$downloadLink.'</a></small><hr></div>';
}
}
}
// Product Attribute Option Download File
if (!empty($v->attributes)) {
foreach ($v->attributes as $k2 => $v2) {
if (isset($v2->download_published)
&& $v2->download_published == 1 &&
isset($v2->download_file) && $v2->download_file !=
'' && isset($v2->download_folder) &&
$v2->download_folder != '') {
$title =
str_replace($v2->download_folder, '', $v2->download_file);
$title = str_replace('/',
'', $title);
$downloadO .=
'<div><strong>'.$v->title.'('.$v2->attribute_title.':
'.$v2->option_title.')</strong></div>';
$downloadLink =
PhocacartPath::getRightPathLink(PhocacartRoute::getDownloadRoute() .
'&o='.$common->order_token.'&d='.$v2->download_token);
$downloadO .=
'<div>'.Text::_('COM_PHOCACART_DOWNLOAD').':
<a
href="'.$downloadLink.'">'.$title.'</a></div>';
$downloadO .=
'<div><small>'.Text::_('COM_PHOCACART_DOWNLOAD_LINK').':
<a
href="'.$downloadLink.'">'.$downloadLink.'</a></small><hr></div>';
}
}
}
}
$downloadO .= '<p> </p>';
}
$r['downloadlink'] = $downloadO;
}
// --- name and email as additional info here, all other user information
can be accessed through: PhocacartText::completeTextFormFields ...
b_name_first, b_name_middle
$r['name'] = '';
if (isset($bas['b']['name_first']) &&
isset($bas['b']['name_last'])) {
$r['name'] =
PhocacartUser::buildName($bas['b']['name_first'],
$bas['b']['name_last']);
}
$r['email'] = '';
if (isset($bas['b']['email'])) {
$r['email'] = $bas['b']['email'];
}
if ($r['email'] == '' &&
isset($bas['s']['email'])) {
$r['email'] = $bas['s']['email'];
}
// ---
$r['trackingnumber'] =
PhocacartOrderView::getTrackingNumber($common);
$r['trackinglink'] =
PhocacartOrderView::getTrackingLink($common);
$r['trackingdescription'] =
PhocacartOrderView::getTrackingDescription($common);
$r['shippingtitle'] =
PhocacartOrderView::getShippingTitle($common);
$r['dateshipped'] =
PhocacartOrderView::getDateShipped($common);
$r['customercomment'] = $common->comment;
$r['currencycode'] = $common->currency_code;
$r['websitename'] = $config->get( 'sitename' );
$r['websiteurl'] = JURI::root();
$r['orderid'] = $orderId;
$r['ordernumber'] = PhocacartOrder::getOrderNumber($orderId,
$common->date, $common->order_number);
$r['invoicenumber'] =
PhocacartOrder::getInvoiceNumber($orderId, $common->date,
$common->invoice_number);
$r['receiptnumber'] =
PhocacartOrder::getReceiptNumber($orderId, $common->date,
$common->receipt_number);
$r['queuenumber'] = PhocacartOrder::getQueueNumber($orderId,
$common->date, $common->queue_number);
$r['paymentreferencenumber']=
PhocacartOrder::getPaymentReferenceNumber($orderId, $common->date,
$common->invoice_prn);
$r['invoiceduedate'] =
PhocacartOrder::getInvoiceDueDate($orderId, $common->date,
$common->invoice_due_date, 'Y-m-d');
//$r['invoiceduedateyear'] =
PhocacartOrder::getInvoiceDueDate($orderId, $common->date,
$common->invoice_due_date, 'Y');
//$r['invoiceduedatemonth'] =
PhocacartOrder::getInvoiceDueDate($orderId, $common->date,
$common->invoice_due_date, 'm');
//$r['invoiceduedateday'] =
PhocacartOrder::getInvoiceDueDate($orderId, $common->date,
$common->invoice_due_date, 'd');
$dateIdd =
PhocacartDate::splitDate($r['invoiceduedate']);
$r['invoicedueyear'] = $dateIdd['year'];
$r['invoiceduemonth'] = $dateIdd['month'];
$r['invoicedueday'] = $dateIdd['day'];
$r['invoicedate'] = PhocacartOrder::getInvoiceDate($orderId,
$common->invoice_date, 'Y-m-d');
$dateId = PhocacartDate::splitDate($r['invoicedate']);
$r['invoiceyear'] = $dateId['year'];
$r['invoicemonth'] = $dateId['month'];
$r['invoiceday'] = $dateId['day'];
$r['invoicetimeofsupply'] =
PhocacartOrder::getInvoiceDate($orderId,
$common->invoice_time_of_supply, 'Y-m-d');
$totalToPay = isset($totalBrutto[0]->amount) ?
$totalBrutto[0]->amount : 0;
$r['totaltopaynoformat'] = number_format($totalToPay, 2,
'.', '');
$r['totaltopay'] = $price->getPriceFormat($totalToPay, 0,
1);
$r['paymenttitle'] =
PhocacartOrderView::getPaymentTitle($common);
$dateO = PhocacartDate::splitDate($common->date);
$r['orderdate'] = $common->date;
$r['orderyear'] = $dateO['year'];
$r['ordermonth'] = $dateO['month'];
$r['orderday'] = $dateO['day'];
$r['ordernumbertxt'] =
JText::_('COM_PHOCACART_ORDER_NR');
$r['bankaccountnumber'] = $pC->get(
'bank_account_number', '' );
$r['iban'] = $pC->get( 'iban', '' );
$r['bicswift'] = $pC->get( 'bic_swift',
'' );
$r['openingtimesinfo'] =
PhocacartTime::getOpeningTimesMessage();
$r['vendorname'] = '';
$r['venderusername'] = '';
if ((int)$common->vendor_id > 0) {
$vendor =
JFactory::getUser((int)$common->vendor_id);
$r['vendorname'] = $vendor->name;
$r['venderusername'] = $vendor->username;
}
return $r;
}
/**
* @param $string
* @param string $type
html|url|number|number2|alphanumeric|alphanumeric2|alphanumeric3|folder|file|folderpath|filepath|text
* @return string|string[]|null
*/
public static function filterValue($string, $type = 'html') {
switch ($type) {
case 'url':
return rawurlencode($string);
break;
case 'number':
return preg_replace( '/[^.0-9]/', '',
$string );
break;
case 'number2':
//return preg_replace( '/[^0-9\.,+-]/',
'', $string );
return preg_replace( '/[^0-9\.,-]/',
'', $string );
break;
case 'alphanumeric':
return preg_replace("/[^a-zA-Z0-9]+/",
'', $string);
break;
case 'alphanumeric2':
return preg_replace("/[^\\w-]/", '',
$string);// Alphanumeric plus _ -
break;
case 'alphanumeric3':
return preg_replace("/[^\\w.-]/", '',
$string);// Alphanumeric plus _ . -
break;
case 'alphanumeric4':
return preg_replace("/[^\\w.,-]/", '',
$string);// Alphanumeric plus _ . , -
break;
case 'alphanumeric5':
return preg_replace("/[^\\w.,]/", '',
$string);// Alphanumeric plus _ . ,
break;
case 'folder':
case 'file':
$string =
preg_replace('/[\"\*\/\\\:\<\>\?\'\|]+/',
'', $string);
return htmlspecialchars($string, ENT_QUOTES |
ENT_SUBSTITUTE, 'UTF-8');
break;
case 'folderpath':
case 'filepath':
$string =
preg_replace('/[\"\*\:\<\>\?\'\|]+/',
'', $string);
return htmlspecialchars($string, ENT_QUOTES |
ENT_SUBSTITUTE, 'UTF-8');
break;
case 'text':
return trim(htmlspecialchars(strip_tags($string),
ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'));
break;
case 'html':
default:
return htmlspecialchars($string, ENT_QUOTES |
ENT_SUBSTITUTE, 'UTF-8');
break;
}
}
public static function stringURLSafe($string, $language = '')
{
// Remove any '-' from the string since they will be used as
concatenaters
$str = str_replace('-', ' ', $string);
// Transliterate on the language requested (fallback to current language
if not specified)
$lang = $language == '' || $language == '*' ?
\JFactory::getLanguage() : Language::getInstance($language);
$str = $lang->transliterate($str);
// Trim white spaces at beginning and end of alias and make lowercase
$str = trim(StringHelper::strtolower($str));
// Remove any duplicate whitespace, and ensure all characters are
alphanumeric
$str = preg_replace('/(\s|[^A-Za-z0-9\-_])+/', '-',
$str);
// Trim dashes at beginning and end of alias
$str = trim($str, '-');
return $str;
}
/*
* Be aware, tag without any attribute will be removed, used e.g. when
editor adds first p tag (without attributes)
*/
public static function removeFirstTag($string, $tag = 'p') {
// First
$needle = '<'.$tag.'>';
$pos = strpos($string, $needle);
if ($pos !== false) {
$string = substr_replace($string, '', $pos,
strlen($needle));
}
// Last
$needle = '</'.$tag.'>';
$pos = strrpos($string, $needle);
if ($pos !== false) {
$string = substr_replace($string, '', $pos,
strlen($needle));
}
return $string;
}
public static function truncateText($text, $limit, $suffix =
'') {
$length = StringHelper::strlen($text);
if ((int)$length < (int)$limit) {
return $text;
}
$textOnlySpaces = preg_replace('/\s+/', ' ',
$text);
$textTruncated = StringHelper::substr($textOnlySpaces, 0,
StringHelper::strpos($textOnlySpaces, " ", $limit));
$textOutput = trim(StringHelper::substr($textTruncated, 0,
StringHelper::strrpos($textTruncated, " ")));
return $textOutput . $suffix;
}
public static function parseDbColumnParameter($string, &$params =
array()) {
$stringA = explode('=', $string);
if (isset($stringA[1])) {
$pos = strpos($stringA[1], 'E');
if ($pos !== false) { $params['edit'] = true;}
}
if (isset($stringA[0])) {
return PhocacartText::filterValue($stringA[0],
'alphanumeric2');
}
return false;
}
}
PK�"�[�#o,,%libraries/phocacart/ticket/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[&���%libraries/phocacart/ticket/ticket.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartTicket
{
public static function getTicket($vendorId) {
$ticket = array();
$app = JFactory::getApplication();
$ticketId = $app->input->get( 'ticketid', 1,
'int' );// if not set, always set it to 1, ticekt 1 is default
$unitId = $app->input->get( 'unitid', 0, 'int'
);// if not set, always set it to 1, ticekt 1 is default
$sectionId = $app->input->get( 'sectionid', 0,
'int' );// if not set, always set it to 1, ticekt 1 is default
$existsSection = PhocacartSection::existsSection($sectionId);
$existsUnit = PhocacartUnit::existsUnit($unitId, $sectionId);
// SECTION IS DEFINED by administrator
// UNIT IS DEFINED by administrator
// TICKET CAN BE CREATED by vendor
// Check if the section even exists, if not set to first you will find
if (!$existsSection) {
$sections = PhocacartSection::getSections(1);
if (!empty($sections)) {
foreach($sections as $k => $v) {
$sectionId = (int)$v->id;
}
} else {
$sectionId = 0;
}
}
// Check if the unit even exists, if not set to default 1
if (!$existsUnit) {
$units = PhocacartUnit::getUnits($sectionId, 1);
if (!empty($units)) {
foreach($units as $k => $v) {
$unitId = (int)$v->id;
}
} else {
$unitId = 0;
}
}
// Check complet ticket
$existsTicket = self::existsTicket($vendorId, $ticketId, $unitId,
$sectionId);
if ($existsTicket) {
// Asked ticket exists ... OK
$ticket['ticketid'] = $ticketId;
$ticket['unitid'] = $unitId;
$ticket['sectionid'] = $sectionId;
return $ticket;
} else {
// Asked ticket does not exists ... find another
$firstTicket = self::getFirstVendorTicket($vendorId, $unitId,
$sectionId);
if ($firstTicket) {
// Some ticket found ... OK
$ticket['ticketid'] = $firstTicket;
$ticket['unitid'] = $unitId;
$ticket['sectionid'] = $sectionId;
return $ticket;
} else {
// No ticket found ... set the default
// if there is no ticket id for this vendor return the base - ticket =
1
$ticket['ticketid'] = 1;
$ticket['unitid'] = $unitId;
$ticket['sectionid'] = $sectionId;
PhocacartTicket::addNewVendorTicket($vendorId, 1, $unitId, $sectionId);
return $ticket;
}
}
$ticket['ticketid'] = 1;
$ticket['unitid'] = $unitId;
$ticket['sectionid'] = $sectionId;
}
public static function existsTicket($vendorId, $ticketId, $unitId,
$sectionId) {
$db = JFactory::getDBO();
$query = ' SELECT ticket_id FROM #__phocacart_cart_multiple'
.' WHERE vendor_id = '.(int)$vendorId
.' AND ticket_id = '.(int)$ticketId
.' AND unit_id = '.(int)$unitId
.' AND section_id = '.(int)$sectionId;
$db->setQuery($query);
$result = $db->loadResult();
if (isset($result) && (int)$result > 0) {
return $result;
}
return false;
}
public static function getVendorTickets($vendorId, $unitId, $sectionId) {
$db = JFactory::getDBO();
$query = ' SELECT user_id, vendor_id, ticket_id, unit_id, section_id
FROM #__phocacart_cart_multiple'
.' WHERE vendor_id = '.(int)$vendorId
.' AND unit_id = '.(int)$unitId
.' AND section_id = '.(int)$sectionId
.' ORDER BY ticket_id ASC';
$db->setQuery($query);
$result = $db->loadObjectList();
return $result;
}
public static function getLastVendorTicket($vendorId, $unitId, $sectionId)
{
$db = JFactory::getDBO();
$query = ' SELECT ticket_id FROM #__phocacart_cart_multiple'
.' WHERE vendor_id = '.(int)$vendorId
.' AND unit_id = '.(int)$unitId
.' AND section_id = '.(int)$sectionId
.' ORDER BY ticket_id DESC';
$db->setQuery($query);
$result = $db->loadResult();
return (int)$result;
}
public static function getFirstVendorTicket($vendorId, $unitId,
$sectionId) {
$db = JFactory::getDBO();
$query = ' SELECT ticket_id FROM #__phocacart_cart_multiple'
.' WHERE vendor_id = '.(int)$vendorId
.' AND unit_id = '.(int)$unitId
.' AND section_id = '.(int)$sectionId
.' ORDER BY ticket_id ASC';
$db->setQuery($query);
$result = $db->loadResult();
return (int)$result;
}
public static function addNewVendorTicket($vendorId, $ticketId, $unitId,
$sectionId) {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$pos_payment_force = $paramsC->get( 'pos_payment_force', 0
);
$pos_shipping_force = $paramsC->get( 'pos_shipping_force', 0
);
if ((int)$pos_payment_force > 0) {
$pos_payment_force =
PhocacartPayment::isPaymentMethodActive($pos_payment_force) === true ?
(int)$pos_payment_force : 0;
}
if ((int)$pos_shipping_force > 0) {
$pos_shipping_force =
PhocacartShipping::isShippingMethodActive($pos_shipping_force) === true ?
(int)$pos_shipping_force : 0;
}
$date = JFactory::getDate();
$now = $date->toSql();
$db = JFactory::getDBO();
$query = 'INSERT INTO #__phocacart_cart_multiple (user_id,
vendor_id, ticket_id, unit_id, section_id, shipping, payment, cart,
date)'
.' VALUES (0, '.(int)$vendorId.',
'.(int)$ticketId.', '.(int)$unitId.',
'.(int)$sectionId.', '.(int)$pos_shipping_force.',
'.(int)$pos_payment_force.', \'\',
'.$db->quote($now).');';
$db->setQuery($query);
$db->execute();
return true;
}
public static function removeVendorTicket($vendorId, $ticketId, $unitId,
$sectionId) {
$db = JFactory::getDBO();
$query = ' DELETE FROM #__phocacart_cart_multiple'
.' WHERE vendor_id = '.(int)$vendorId
.' AND ticket_id = '.(int)$ticketId
.' AND unit_id = '.(int)$unitId
.' AND section_id = '.(int)$sectionId;
$db->setQuery($query);
$db->execute();
return true;
}
public static function renderNavigation($vendorId, $ticketId, $unitId,
$sectionId) {
// $ticketId is active ticket
$tickets = self::getVendorTickets($vendorId, $unitId, $sectionId);
$o = '<ul class="nav nav-tabs">';
if (!empty($tickets)) {
foreach($tickets as $k => $v) {
$active = '';
if ((int)$v->ticket_id == (int)$ticketId) {
$active = 'active';
}
$link = JRoute::_(PhocacartRoute::getPosRoute((int)$v->ticket_id,
(int)$v->unit_id, (int)$v->section_id));
$o .= '<li class="nav-item
'.$active.'">';
$o .= '<a class="nav-link '.$active.'"
href="'.$link.'">
'.(int)$v->ticket_id.' </a>';
$o .= '</li>';
}
} else {
$link = JRoute::_(PhocacartRoute::getPosRoute());
$o .= '<li class="nav-item active">';
$o .= '<a class="nav-link active"
href="'.$link.'"> 1 </a>';
$o .= '</li>';
}
$o .= '</ul>';
return $o;
}
/*
$link1 = JRoute::_(PhocacartRoute::getPosRoute(1));
$link2 = JRoute::_(PhocacartRoute::getPosRoute(2));
$link3 = JRoute::_(PhocacartRoute::getPosRoute(3));
?>
<ul class="nav nav-tabs">
<li class="nav-item active">
<a class="nav-link active" href="<?php echo $link1
?>">1</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo $link2
?>">2</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo $link3
?>">3</a>
</li>
</ul>*/
}
PK�"�[�#o,,#libraries/phocacart/time/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[?�mm!libraries/phocacart/time/time.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartTime
{
public static function getTimeType($type = 1, $format = 0) {
$t = '';
$c = '';
switch ($type) {
case 2:
$t = JText::_('COM_PHOCACART_CLOSING_HOURS');
$c = "label label-important label-danger badge badge-danger";
break;
case 3:
$t = JText::_('COM_PHOCACART_CLOSING_DAYS');
$c = "label label-important label-danger badge badge-danger";
break;
case 1:
default:
$t = JText::_('COM_PHOCACART_OPENING_HOURS');
$c = "label label-important label-success";
break;
}
if ($t != '' && $format == 1) {
return '<span
class="'.$c.'">'.$t.'</span>';
}
return $t;
}
public static function getDayOrDate($day, $date) {
$a = array();
$a['date'] = '';
$a['day'] = '';
$dateFormat = '0000-00-00 00:00:00';
if ($date != '' && $date != $dateFormat && $day
== '') {
$datePhp = new \DateTime($date);
$a['date'] = $datePhp->format('Y-m-d');
$a['day'] = '';
} else if ($date != '' && $date != $dateFormat
&& $day != '') {
//$dateTime = \DateTime::createFromFormat('Y-m-d H:i:s',
$date);
$datePhp = new \DateTime($date);
$a['date'] = $datePhp->format('Y-m-d');
$a['day'] = '';
} else if ($day != '' && ($date == '' ||
$date == $dateFormat)) {
$dateClass = new \Joomla\CMS\Date\Date();
$a['date'] = '';
$a['day'] = $dateClass->dayToString($day);
}
return $a;
}
public static function getTime($hour, $minute, $type = 0) {
if ($type == 3) {
return '';// Closing days don't have any time calculation
}
$time = '';
if ($hour > -1) {
$time .= str_pad($hour, 2, '0', STR_PAD_LEFT) . ':';
if ($minute > -1) {
$time = $time . str_pad($minute, 2, '0', STR_PAD_LEFT);// .
':00';
} else {
$time = $time . '00';//. '00:00';
}
}
return $time;
}
/**
* Test Opening Hours, Closing Hours, Closing Days
*
* PRIORITY to test:
* (3) CLOSING DAYS ->
* (2) CLOSING HOURS ->
* (1) OPENING HOURS
*
* PRIORITY (DAY or DATE):
* (1) DATE ->
* (2) DAY
* (if date and day are set, there must be a priority, what should be
compared as first - the date
* @return boolean
*/
public static function checkOpeningTimes($renderMessage = 1) {
// Possible feature
// calculate next open time
// we are next open at:
$paramsC = PhocacartUtils::getComponentParameters();
$checking_opening_times = $paramsC->get(
'checking_opening_times', 0 );
$store_closed_checkout_message = $paramsC->get(
'store_closed_checkout_message', 0 );
$orderAllowed = false;// As default ==> 2 Order not possible when
closed
if ($checking_opening_times == 0) {
return true;
} else if ($checking_opening_times == 1) {
$orderAllowed = true;
}
$msg =
PhocacartRenderFront::renderArticle((int)$store_closed_checkout_message,
'html',
JText::_('COM_PHOCACART_SHOP_IS_NOT_CURRENTLY_OPEN'));
$msgType = 'error';
$app = JFactory::getApplication();
$config = JFactory::getConfig();
$date = JFactory::getDate("NOW", 'UTC');
$date->setTimezone(new
DateTimeZone($config->get('offset')));
$currentDay = $date->format('w', true, false);
$currentTime = $date->format('H:i', true, false);
$currentDate = $date->format('Y-m-d', true, false);
$db = JFactory::getDbo();
$q = ' SELECT a.id, a.title, a.type, a.day, a.date, a.hour_from,
a.minute_from, a.hour_to, a.minute_to FROM #__phocacart_opening_times AS
a';
$q .= ' WHERE a.published = 1';
$q .= ' AND (DATE(a.date) =
'.$db->quote($currentDate).' OR a.day =
'.(int)$currentDay. ')';
$q .= ' ORDER BY a.type DESC'; // Priority: Closing Days (3)
-> Closing Hours (2) -> Opening Hours (1)
$db->setQuery($q);
$days = $db->loadAssocList();
if (!empty($days)) {
foreach($days as $k => $v) {
// 1. Test CLOSING DAYS (3)
if ($v['type'] == 3 && $v['date'] !=
'' && $v['date'] != '0000-00-00
00:00:00' && strtotime($currentDate) ==
strtotime($v['date'])) {
if ($renderMessage) {$app->enqueueMessage($msg, $msgType);}
return $orderAllowed;
} else if ($v['type'] == 3 && $v['day']
> -1 && (int)$currentDay == (int)$v['day']) {
if ($renderMessage) {$app->enqueueMessage($msg,
$msgType);}
return $orderAllowed;
}
$timeFrom = PhocacartTime::getTime($v['hour_from'],
$v['minute_from']);
$timeTo = PhocacartTime::getTime($v['hour_to'],
$v['minute_to']);
// 2. Test CLOSING HOURS (2)
if ($v['type'] == 2 && $v['date'] !=
'' && $v['date'] != '0000-00-00
00:00:00') {
if ($currentTime >= $timeFrom && $currentTime <=
$timeTo) {
if ($renderMessage) {$app->enqueueMessage($msg,
$msgType);}
return $orderAllowed;
}
} else if ($v['type'] == 2 && $v['day']
> -1) {
if ($currentTime >= $timeFrom && $currentTime <=
$timeTo) {
if ($renderMessage) {$app->enqueueMessage($msg,
$msgType);}
return $orderAllowed;
}
}
// 3. Test OPENING HOURS (1)
if ($v['type'] == 1 && $v['date'] !=
'' && $v['date'] != '0000-00-00
00:00:00') {
if ($currentTime >= $timeFrom && $currentTime <=
$timeTo) {
// continue to check other times
} else {
if ($renderMessage) {$app->enqueueMessage($msg,
$msgType);}
return $orderAllowed;
}
} else if ($v['type'] == 1 && $v['day']
> -1) {
if ($currentTime >= $timeFrom && $currentTime <=
$timeTo) {
// continue to check other times
} else {
if ($renderMessage) {$app->enqueueMessage($msg,
$msgType);}
return $orderAllowed;
}
}
}
}
return true;
}
public static function getOpeningTimesMessage() {
$paramsC = PhocacartUtils::getComponentParameters();
$checking_opening_times = $paramsC->get(
'checking_opening_times', 0 );
$store_closed_checkout_message = $paramsC->get(
'store_closed_checkout_message', 0 );
$orderAllowed = false;// As default ==> 2 Order not possible
when closed
if ($checking_opening_times == 0) {
return '';
} else if ($checking_opening_times == 1) {
$orderAllowed = true;
}
if ($orderAllowed) {
return
PhocacartRenderFront::renderArticle((int)$store_closed_checkout_message,
'html',
JText::_('COM_PHOCACART_SHOP_IS_NOT_CURRENTLY_OPEN'));
}
}
}
PK�"�[�#o,,#libraries/phocacart/type/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�_��nn!libraries/phocacart/type/type.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartType
{
/*
* Transform type array to int
* 0 ... common
* 1 ... online shop
* 2 ... pos
*
* example: array(0,2) means - all common categories/payment
methods/shipping methods plus only POS categories
* example: array(0,1) means - all common categories/payment
methods/shipping methods plus only Online Shop categories
*/
public static function getTypeByTypeArray($type = array(0,1)) {
return (int)$type[1];
}
}
?>PK�"�[�#o,,#libraries/phocacart/unit/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[hM!���!libraries/phocacart/unit/unit.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartUnit
{
public static function existsUnit($unitId, $sectionId) {
$db = JFactory::getDBO();
$query = ' SELECT id FROM #__phocacart_units'
.' WHERE id = '.(int)$unitId
.' AND section_id = '.(int)$sectionId
.' AND published = 1';
$db->setQuery($query);
$result = $db->loadResult();
if (isset($result) && (int)$result > 0) {
return $result;
}
return false;
}
public static function getUnits($sectionId, $limit = 0) {
$db = JFactory::getDBO();
$query = ' SELECT a.id, a.title FROM #__phocacart_units AS a'
.' WHERE a.published = 1'
.' AND a.section_id ='.(int)$sectionId
.' ORDER BY a.ordering';
if ((int)$limit > 0) {
$query .= ' LIMIT '.(int)$limit;
}
$db->setQuery($query);
$units = $db->loadObjectList();
return $units;
}
public static function getUnitById($unitId) {
$db = JFactory::getDBO();
$query = ' SELECT id, title FROM #__phocacart_units'
.' WHERE id = '.(int)$unitId
.' AND published = 1';
$db->setQuery($query);
$result = $db->loadObject();
return $result;
}
}PK�"�[y����&libraries/phocacart/user/guestuser.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartUserGuestuser
{
public static function getGuestUser() {
$app = JFactory::getApplication();
$p = PhocacartUtils::getComponentParameters();
$guestCheckout = $p->get( 'guest_checkout', 0 );
$session = JFactory::getSession();
$user = PhocacartUser::getUser();
if ($app->getName() == 'administrator') {
return false;
}
if ((int)$user->id > 0 || $guestCheckout == 0) {
self::cancelGuestUser();
return false;
} else {
return $session->get('guest', false,
'phocaCart');
}
}
public static function setGuestUser($guest = false) {
$p = PhocacartUtils::getComponentParameters();
$guestCheckout = $p->get( 'guest_checkout', 0 );
$session = JFactory::getSession();
if ($guest && $guestCheckout == 1) {
$session->set('guest', true, 'phocaCart');
} else {
self::cancelGuestUser();
}
return true;
}
public static function storeAddress($data) {
$session = JFactory::getSession();
if (!empty($data)) {
$session->set('guestaddress', $data,
'phocaCart');
return true;
}
return false;
}
public static function getAddress() {
$session = JFactory::getSession();
$address = $session->get('guestaddress', false,
'phocaCart');
return $address;
}
public static function storeShipping($shippingId) {
$session = JFactory::getSession();
if ((int)$shippingId > 0) {
$session->set('guestshipping', $shippingId,
'phocaCart');
return true;
}
return false;
}
public static function getShipping() {
$session = JFactory::getSession();
$shipping = $session->get('guestshipping', false,
'phocaCart');
return $shipping;
}
public static function storePayment($paymentId) {
$session = JFactory::getSession();
if ((int)$paymentId > 0) {
$session->set('guestpayment', $paymentId,
'phocaCart');
return true;
}
return false;
}
public static function getPayment() {
$session = JFactory::getSession();
$payment = $session->get('guestpayment', false,
'phocaCart');
return $payment;
}
public static function storeLoyaltyCardNumber($number) {
$session = JFactory::getSession();
if ($number != '') {
$session->set('guestloyaltycardnumber', $number,
'phocaCart');
return true;
}
return false;
}
public static function getLoyaltyCardNumber() {
$session = JFactory::getSession();
$loyaltyCardNumber = $session->get('guestloyaltycardnumber',
false, 'phocaCart');
return $loyaltyCardNumber;
}
public static function storeCoupon($couponId) {
$session = JFactory::getSession();
if ((int)$couponId > 0) {
$session->set('guestcoupon', $couponId,
'phocaCart');
return true;
} else {
$session->set('guestcoupon', false, 'phocaCart');
return true;
}
return false;
}
public static function getCoupon() {
$session = JFactory::getSession();
$couponId = $session->get('guestcoupon', false,
'phocaCart');
return $couponId;
}
public static function getUserAddressGuest() {
$session = JFactory::getSession();
$address = $session->get('guestaddress', false,
'phocaCart');
$data = array();
$data = PhocacartUser::convertAddressTwo($address, 0);
return $data;
}
public static function cancelGuestUser() {
$session = JFactory::getSession();
$session->set('guest', false, 'phocaCart');
$session->set('guestaddress', false, 'phocaCart');
$session->set('guestshipping', false,
'phocaCart');
$session->set('guestpayment', false, 'phocaCart');
//$session->set('guestcoupon', false,
'phocaCart');// COUPONMOVE - it is possible to use coupon even
user is still not logged in or user still didn't enable guest checkout
$session->set('guestloyaltycardnumber', false,
'phocaCart');
}
}
?>
PK�"�[�#o,,#libraries/phocacart/user/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[&���T�T!libraries/phocacart/user/user.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartUser
{
/*protected $guest = array();
protected $user = array();
protected $vendor = array();
protected $ticket = array();
protected $pos = false;*/
/*public function __construct($pos) {
$this->user = JFactory::getUser();
$this->pos = $pos;
}*/
public static function getUser($id = 0) {
$app = JFactory::getApplication();
$pUser = $vendor = $ticket = $unit = $section = array();
$isVendor = false;
if ((int)$id > 0) {
$jUser = JFactory::getUser($id);
return $jUser;
} else {
if (PhocacartPos::isPos()) {
$isVendor = self::defineUser($pUser, $vendor, $ticket, $unit,
$section);
if ($isVendor) {
// Current Joomla! User is Vendor (in POS)
// Check if this vendor has selected some customer
// If yes: switch the selected user as current Joomla! user
// for example to check access rights: Vendor selected User A
// so we must check the rights of User A and not of Vendor
if (!empty($pUser)) {
// ======= LOGGED JOOMLA! USER IS VENDOR - CUSTOMER SELECTED
return $pUser;
} else {
// ======= LOGGED JOOMLA! USER IS VENDOR - NO CUSTOMER SELECTED
return false;// Joomla! User is vendor and he/she didn't select
any customer
}
} else {
// ======= LOGGED JOOMLA! USER IS NOT VENDOR - BUT IN POS WE NEED
VENDOR
return false;
}
} else if ($app->getName() == 'administrator') {
// ======= LOGGED JOOMLA! USER IS ADMINISTRATOR
// We want to get information about user's cart in administration
$userid = $app->input->get('userid', 0,
'int');
//$vendorid = $app->input->get('vendorid', 0,
'int');
//$ticketid = $app->input->get('ticketid', 0,
'int');
//$unitid = $app->input->get('unitid', 0,
'int');
//$sectionid = $app->input->get('sectionid', 0,
'int');
// Test if we ask POS user
//$userIdPos = PhocacartPos::getUserIdByVendorAndTicket($vendorid,
$ticketid, $unitid, $sectionid);
if ((int)$userid > 0) {
// ======= LOGGED JOOMLA! USER IS ADMINISTRATOR - CUSTOMER FOUND
return JFactory::getUser($userid);
} else {
// ======= LOGGED JOOMLA! USER IS ADMINISTRATOR - NO CUSTOMER FOUND
return JFactory::getUser(0);// Joomla! User is administrator and there
is no information about user
}
} else {
// ======= LOGGED JOOMLA! USER IS CUSTOMER
// No POS, return standard Joomla! User
$jUser = JFactory::getUser();
return $jUser;
}
}
// ======= NO LOGGED JOOMLA! USER
return false;
}
public static function defineUser(&$user, &$vendor, &$ticket,
&$unit, &$section, $forcePos = 0) {
$pos = PhocacartPos::isPos($forcePos);
$user = JFactory::getUser();
$vendor = array();
$vendor = new stdClass();
$vendor->id = 0;
$ticket = array();
$ticket = new stdClass();
$ticket->id = 0;
$unit = array();
$unit = new stdClass();
$unit->id = 0;
$section = array();
$section = new stdClass();
$section->id = 0;
if ($pos == 1) {
// Is logged in user a vendor?
if (!empty($user) && (int)$user->id > 0) {
$vendor = clone $user;
$isVendor = PhocacartVendor::isVendor($vendor);
if ($isVendor) {
//unset($user); cannot unset $user as we lost it for reference
$user = array();
$user = new stdClass();
$ticketA = PhocacartTicket::getTicket($vendor->id);
$ticket->id = $ticketA['ticketid'];
$unit->id = $ticketA['unitid'];
$section->id = $ticketA['sectionid'];
$userId = PhocacartPos::getUserIdByVendorAndTicket($vendor->id,
$ticket->id, $unit->id, $section->id);
$user = JFactory::getUser($userId);
return true;
} else {
$vendor = array();
$vendor = new stdClass();
$vendor->id = 0;
return false;
}
return false;
}
return false;
}
return false;
}
public static function getUserIdByCard($card) {
$db = JFactory::getDBO();
$query = ' SELECT a.user_id FROM #__phocacart_users AS a'
.' WHERE a.loyalty_card_number = '.$db->quote($card)
.' AND a.type = 0'
.' LIMIT 1';
$db->setQuery($query);
$id = $db->loadResult();
return $id;
}
public static function getAddressDataForm($form, $fields, $user,
$billingSuffix = '', $shippingSuffix = '_phs',
$guestUser = 0) {
$o['b'] = '';// Output Billing
$o['s'] = '';// Output Shipping
$o['bsch'] = '';// B S Checked? Is the billing
address the same like shipping address
$o['filled'] = 1; // Is every form input filled out
$app = JFactory::getApplication();
$s = PhocacartRenderStyle::getStyles();
$baSa = $form->getValue('ba_sa');
// Setting "Delivery and billing addresses are the same" -
enable or disabled
// This can be set for new users who didn't set the address yet and
for gest only. Not for users how added the address as they made the choice
which is saved and cannot be changed
$pC = PhocacartUtils::getComponentParameters();
$delivery_billing_same_enabled =
$pC->get('delivery_billing_same_enabled', 0);
// 1) GUEST USER (no preference stored)
if ($guestUser > 0 && !PhocacartUserGuestuser::getAddress()
&& ($delivery_billing_same_enabled == 2 ||
$delivery_billing_same_enabled == 3)) {
$o['bsch'] = 'checked="checked"';
}
// 1) NEW LOGGED IN USER (no preference stored)
$userIdAddress = $form->getValue('id');
if (!(int)$userIdAddress > 0 && !$guestUser &&
($delivery_billing_same_enabled == 1 || $delivery_billing_same_enabled ==
3)){
$o['bsch'] = 'checked="checked"';
}
// 3) STANDARD USER WHO ADDED ADDRESS AND PREFERENCES WERE SAVED - now
this is only stored preference of the user
if ($baSa == 1) {
$o['bsch'] = 'checked="checked"';
}
// This feature is completely disabled
if ($delivery_billing_same_enabled == -1) {
$o['bsch'] = '';
}
if (!empty($fields)) {
foreach($fields as $k => $v) {
if ($v->display_billing == 1 ||
($app->isClient('administrator') && $v->title ==
'id')){
$value = $form->getValue($v->title);// If form input is required
but it is empty, this is wrong
if ($v->required == 1 && $value == '') {
$o['filled'] = 0;
}
if ($v->title == 'email' && $guestUser == 0) {
$form->setValue($v->title, null, $user->email );
}
if (!$app->isClient('administrator')) {
$o['b'] .= '<div
class="'.$s['c']['row'].'
'.$s['c']['form-group'].'">';
$o['b'] .= '<div
class="'.$s['c']['col.xs12.sm5.md5'].'
'.$s['c']['control-label'].'">'.$form->getLabel($v->title
. $billingSuffix).'</div>';
$o['b'] .= '<div
class="'.$s['c']['col.xs12.sm7.md7'].'">'.$form->getInput($v->title
. $billingSuffix).'</div>';
$o['b'] .= '</div>' . "\n";
} else {
// Admin uses obsolete bootstrap
$o['b'] .= '<div
class="control-group">';
$o['b'] .= '<div
class="control-label"><label>'.$form->getLabel($v->title
. $billingSuffix).'</label></div>';
$o['b'] .= '<div
class="controls">'.$form->getInput($v->title .
$billingSuffix).'</div>';
$o['b'] .= '</div>' . "\n";
}
}
if ($v->display_shipping == 1 ||
($app->isClient('administrator') && $v->title ==
'id')) {
$value = $form->getValue($v->title); // Form input value
is required but it is empty
if ($v->required == 1 && $value == '' &&
$baSa == 0) { // and we have set that the shipping address
$o['filled'] = 0; // is other than billing
}
if ($v->title == 'email' && $guestUser == 0) {
$form->setValue($v->title, null, $user->email );
}
if (!$app->isClient('administrator')) {
$o['s'] .= '<div
class="'.$s['c']['row'].'
'.$s['c']['form-group'].'">';
$o['s'] .= '<div
class="'.$s['c']['col.xs12.sm5.md5'].'
'.$s['c']['control-label'].'">'.$form->getLabel($v->title
. $shippingSuffix).'</div>';
$o['s'] .= '<div
class="'.$s['c']['col.xs12.sm7.md7'].'">'.$form->getInput($v->title
. $shippingSuffix).'</div>';
$o['s'] .= '</div>' . "\n";
} else {
// Admin uses obsolete bootstrap
$o['s'] .= '<div
class="control-group">';
$o['s'] .= '<div
class="control-label"><label>'.$form->getLabel($v->title
. $shippingSuffix).'</label></div>';
$o['s'] .= '<div
class="controls">'.$form->getInput($v->title .
$shippingSuffix).'</div>';
$o['s'] .= '</div>' . "\n";
}
}
}
}
return $o;
}
public static function getAddressDataOutput($data, $fields, $user,
$guestUser = 0) {
$s = PhocacartRenderStyle::getStyles();
$o['b'] = '';// Output Billing
$o['s'] = '';// Output Shipping
$o['bsch'] = '';// B S Checked? Is the billing
address the same like shipping address
$o['filled']= 1; // Is every form input filled out
$bNameO = '';// join first, middle, last name and degree
$sNameO = '';// join first, middle, last name and degree
$o['bregion'] = '';// Return for shipping method
(save database query)
$o['bcountry'] = '';// Return for shipping method
(save database query)
$o['bzip'] = '';// Return for shipping method (save
database query)
$o['sregion'] = '';// Return for shipping method
(save database query)
$o['scountry'] = '';// Return for shipping method
(save database query)
$o['szip'] = '';// Return for shipping method (save
database query)
// ba_sa = 0: billing and shipping addresses are NOT the same
// ba_sa = 1: billing and shipping addresses are same (don't check
shipping fields)
if (empty($data[0])) {
// BILLING
// no billing return false
// No shipping data so test if we want any shipping data at all
$fI = new PhocacartFormItems();
$active = $fI->isFormFieldActive('billing');
if ($active) {
// there is active some form field, so vendor asks for some field but
nothing was filled in
$o['filled'] = 0;
return $o;
}
} else if (!empty($data[0])
&& isset($data[0]->ba_sa) && $data[0]->ba_sa ==
0
&& isset($data[0]->type) && $data[0]->type == 0
&& empty($data[1])){
// SHIPPING
// In words - we have billing data, so we check if billing data are the
same like shipping (ba_sa = 1)
// If not then we check if we have shipping data, if not return false
// And check if array 0 is really billing - array 0 (first array) cannot
be shpping as we order it by type ASC in db query
// type = 0 ... billing, type = 1 ... shipping
// No shipping data so test if we want any shipping data at all
$fI = new PhocacartFormItems();
$active = $fI->isFormFieldActive('shipping');
if ($active) {
// there is active some form field, so vendor asks for some field but
nothing was filled in
$o['filled'] = 0;
return $o;
}
}
// Billing the same like shipping
if (isset($data[0]->ba_sa) && $data[0]->ba_sa == 1){
$o['bsch'] = 1;
}
if (!empty($fields)) {
foreach($fields as $k => $v) {
if ($v->display_billing == 1){
$field = (string)$v->title;
if (isset($data[0]->$field)) {
$value = $data[0]->$field;
if ($v->required == 1 && $value == '') {
$o['filled'] = 0;
return $o;//Don't check and list any other, form it not
complete
}
if ($v->title == 'email' && $guestUser == 0) {
$value = $user->email;
}
if ($v->title == 'name_first' || $v->title ==
'name_middle' || $v->title == 'name_last' ||
$v->title == 'name_degree' ) {
$bNameO .= $value . ' ';
} else if ($v->title == 'country') {
$o['bcountry'] = (int)$value;// Return region and country
$countryTitle =
isset($data[0]->countrytitle) ? $data[0]->countrytitle :
PhocacartCountry::getCountryById((int)$value);
$o['b'] .= '<div
class="'.$s['c']['col.xs12.sm12.md12'].'">'.$countryTitle.'</div>';
} else if ($v->title == 'region') {
$o['bregion'] = (int)$value;// Return region and country
$regionTitle = isset($data[0]->regiontitle)
? $data[0]->regiontitle : PhocacartRegion::getRegionById((int)$value);
$o['b'] .= '<div
class="'.$s['c']['col.xs12.sm12.md12'].'">'.$regionTitle.'</div>';
} else if ($v->title == 'zip') {
$o['bzip'] = $value;// Return region and country or zip
$o['s'] .= '<div
class="'.$s['c']['col.xs12.sm12.md12'].'">'.$value.'</div>';
} else {
$o['b'] .= '<div
class="'.$s['c']['col.xs12.sm12.md12'].'">'.$value.'</div>';
}
}
}
if ($v->display_shipping == 1) {
$field = (string)$v->title;
if (isset($data[1]->$field)) {
$value = $data[1]->$field;
if ($v->required == 1 && $value == '' &&
$data[0]->ba_sa == 0 && $data[1]->ba_sa == 0) {
$o['filled'] = 0;
return $o;//Don't check and list any other, form it not
complete
}
if ($v->title == 'email' && $guestUser == 0) {
$value = $user->email;
}
if ($v->title == 'name_first' || $v->title ==
'name_middle' || $v->title == 'name_last' ||
$v->title == 'name_degree' ) {
$sNameO .= $value . ' ';
} else if ($v->title == 'country') {
$o['scountry'] = (int)$value;// Return region and country
$countryTitle =
isset($data[1]->countrytitle) ? $data[1]->countrytitle :
PhocacartCountry::getCountryById((int)$value);
$o['s'] .= '<div
class="'.$s['c']['col.xs12.sm12.md12'].'">'.$countryTitle.'</div>';
} else if ($v->title == 'region') {
$o['sregion'] = (int)$value;// Return region and country
$regionTitle = isset($data[1]->regiontitle)
? $data[1]->regiontitle : PhocacartRegion::getRegionById((int)$value);
$o['s'] .= '<div
class="'.$s['c']['col.xs12.sm12.md12'].'">'.$regionTitle.'</div>';
} else if ($v->title == 'zip') {
$o['szip'] = $value;// Return region and country or zip
$o['s'] .= '<div
class="'.$s['c']['col.xs12.sm12.md12'].'">'.$value.'</div>';
} else {
$o['s'] .= '<div
class="'.$s['c']['col.xs12.sm12.md12'].'">'.$value.'</div>';
}
}
}
}
if ($bNameO != '' && $o['b'] !=
'') {
$o['b'] = '<div
class="'.$s['c']['col.xs12.sm12.md12'].'">'.$bNameO.'</div>'
. $o['b'];
}
if ($sNameO != '' && $o['s'] !=
'') {
$o['s'] = '<div
class="'.$s['c']['col.xs12.sm12.md12'].'">'.$sNameO.'</div>'
. $o['s'];
}
}
return $o;
}
public static function getUserAddress($userId) {
$db = JFactory::getDBO();
$query = ' (SELECT * FROM #__phocacart_users AS a'
.' WHERE a.user_id = '.(int) $userId
.' AND a.type = 0'
.' LIMIT 1)'
.' UNION ALL'
.' (SELECT * FROM #__phocacart_users AS a'
.' WHERE a.user_id = '.(int) $userId
.' AND a.type = 1'
.' LIMIT 1)';
$db->setQuery($query);
$address = $db->loadObjectList();
return $address;
}
public static function convertAddressTwo($data, $array = 1) {
$dataNew = array();
if ($array == 1) {
$dataNew[0] = array();// billing
$dataNew[1] = array();// shipping
$dataNew[2] = array();// shipping including postfix _phs
} else {
$dataNew[0]= new StdClass();
$dataNew[1]= new StdClass();
$dataNew[2]= new StdClass();
}
if (!empty($data)) {
foreach($data as $k => $v) {
$pos = strpos($k, '_phs');
if ($pos === false) {
if ($array == 1) {
$dataNew[0][$k] = $v;
} else {
$dataNew[0]->$k = $v;
}
} else {
$kx = str_replace('_phs', '', $k);
if ($array == 1) {
$dataNew[1][$kx] = $v;
$dataNew[2][$k] = $v;
} else {
$dataNew[1]->$kx = $v;
$dataNew[2]->k = $v;
}
}
}
}
if (!empty($dataNew[1])) {
// Set right type for shipping address
if ($array == 1) {
$dataNew[1]['type'] = 1;
$dataNew[2]['type'] = 1;
} else {
$dataNew[1]->type = 1;
$dataNew[2]->type = 1;
}
}
return $dataNew;
}
public static function getUserInfo() {
$u = array();
$user = PhocacartUser::getUser();
$u['username'] = '';
$u['id'] = 0;
$u['ip'] = '';
if (isset($user->id)) {
$u['id'] = $user->id;
}
if (isset($user->username)) {
$u['username'] = $user->username;
}
$u['ip'] = PhocacartUtils::getIp();
return $u;
}
public static function getUserOrderSum($userId) {
$total = 0;
if ($userId > 0) {
$db = JFactory::getDBO();
$query = 'SELECT SUM(a.amount) FROM #__phocacart_order_total AS
a'
.' LEFT JOIN #__phocacart_orders AS o ON a.order_id = o.id'
.' WHERE o.user_id = '.(int) $userId
.' AND a.type = '.$db->quote('brutto');
$db->setQuery($query);
$total = $db->loadResult();
if (!$total) {
$total = 0;
}
}
return $total;
}
public static function getUserData($userId = 0) {
$db = JFactory::getDBO();
if ((int)$userId == 0) {
$user = PhocacartUser::getUser();
$userId = (int)$user->id;
}
if ((int)$userId > 0) {
$query = 'SELECT u.*, r.title as regiontitle, c.title as
countrytitle FROM #__phocacart_users AS u'
.' LEFT JOIN #__phocacart_countries AS c ON c.id =
u.country'
.' LEFT JOIN #__phocacart_regions AS r ON r.id = u.region'
.' WHERE u.user_id = '.(int)$userId
.' ORDER BY u.type ASC';
$db->setQuery($query);
$data = $db->loadObjectList();
return $data;
}
return false;
}
public static function buildName($nameFirst, $nameLast, $nameMiddle =
'', $nameDegreePrefix = '', $nameDegreePostfix =
'') {
$name = '';
if ($nameDegreePrefix != '') {
$name = $nameDegreePrefix;
}
if ($nameFirst != '') {
if ($name != '') {
$name = $name . ' '. $nameFirst;
} else {
$name = $nameFirst;
}
}
if ($nameMiddle != '') {
if ($name != '') {
$name = $name . ' '. $nameMiddle;
} else {
$name = $nameMiddle;
}
}
if ($nameLast != '') {
if ($name != '') {
$name = $name . ' '. $nameLast;
} else {
$name = $nameLast;
}
}
if ($nameDegreePostfix != '') {
if ($name != '') {
$name = $name . ' '. $nameDegreePostfix;
} else {
$name = $nameDegreePostfix;
}
}
return $name;
}
/*
$billing = '';// form
$shipping = '';// form - edit the billing and shipping
$billingO = '';// output
$shippingO = '';// output - display billing and shipping
$billNameO = '';
$shipNameO = '';// complete the name on one row
// Is the billing address the same like shipping address
$bASaChecked = '';
$baSa = $this->form->getValue('ba_sa');
if ($baSa == 1) {
$bASaChecked = 'checked="checked"';
}
// Is every form input value filled out? - if yes, don't display the
form, if no display it.
$filledOk = 1;
if (!empty($this->fields)) {
foreach($this->fields as $k => $v) {
if ($v->display_billing == 1){
// Form input field is required but it is empty, wrong
$value = $this->form->getValue($v->title);
if ($v->required == 1 && $value == '') {
$filledOk = 0;
}
// Form
$billing .= '<div
class="form-group">'."\n"
. '<div class="col-sm-5
control-label">'.$this->form->getLabel($v->title).
'</div>';
if ($v->title == 'email') {
$this->form->setValue($v->title, null, $this->u->email
);
}
$billing.= '<div class="col-sm-7">' .
$this->form->getInput($v->title) . '</div>'
.'</div>' . "\n";
// Output
if ($filledOk == 1 && $this->t['editaddress'] ==
0) {
//$billingO .= '<div
class="col-sm-5">'.JText::_($v->title).'</div>';
if ($v->title == 'name_first' || $v->title ==
'name_middle' || $v->title == 'name_last' ||
$v->title == 'name_degree' ) {
$billNameO .= $value . ' ';
} else if ($v->title == 'country') {
$billingO .= '<div
class="col-sm-12">'.PhocacartCountry::getCountryById((int)$value).'</div>';
} else if ($v->title == 'region') {
$billingO .= '<div
class="col-sm-12">'.PhocacartRegion::getRegionById((int)$value).'</div>';
} else {
$billingO .= '<div
class="col-sm-12">'.$value.'</div>';
}
}
}
if ($v->display_shipping == 1) {
// Form input value is required but it is empty and we have set that
the shipping address is other than billing
$value = $this->form->getValue($v->title);
if ($v->required == 1 && $value == '' &&
$baSa == 0) {
$filledOk = 0;
}
// Form
$shipping .= '<div
class="form-group">'."\n"
. '<div class="col-sm-5 control-label">'.
$this->form->getLabel($v->title . '_phs') .
'</div>';
if ($v->title == 'email') {
$this->form->setValue($v->title, null, $this->u->email
);
}
$shipping .= '<div class="col-sm-7">' .
$this->form->getInput($v->title. '_phs') .
'</div>'
.'</div>' . "\n";
// Output
if ($filledOk == 1 && $this->t['editaddress'] ==
0) {
//$shippingO .= '<div
class="col-sm-5">'.JText::_($v->title).'</div>';
if ($v->title == 'name_first' || $v->title ==
'name_middle' || $v->title == 'name_last' ||
$v->title == 'name_degree' ) {
$shipNameO .= $value . ' ';
} else if ($v->title == 'country') {
$shippingO .= '<div
class="col-sm-12">'.PhocacartCountry::getCountryById((int)$value).'</div>';
} else if ($v->title == 'region') {
$shippingO .= '<div
class="col-sm-12">'.PhocacartRegion::getRegionById((int)$value).'</div>';
} else {
$shippingO .= '<div
class="col-sm-12">'.$value.'</div>';
}
}
}
}
}
$billNameO = '<div
class="col-sm-12">'.$billNameO.'</div>';
$shipNameO = '<div
class="col-sm-12">'.$shipNameO.'</div>';
*/
}
?>
PK�"�[�B�Tgg.libraries/phocacart/utils/admindescription.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
use Joomla\String\StringHelper;
class PhocacartUtilsAdmindescription
{
public $display_admin_description;
public function __construct() {
$pC = PhocacartUtils::getComponentParameters();
$this->display_admin_description = $pC->get(
'display_admin_description', 35 );
}
public function isActive() {
if ((int)$this->display_admin_description > 0) {
return true;
}
return false;
}
public function getAdminDescription($description) {
$description = strip_tags($description);
if (StringHelper::strlen($description) <
$this->display_admin_description || StringHelper::strlen($description)
== $this->display_admin_description) {
return $description;
} else {
return StringHelper::substr($description, 0,
$this->display_admin_description) . ' ...';
}
}
}
?>
PK�"�[)��3��)libraries/phocacart/utils/batchhelper.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class PhocacartUtilsBatchhelper
{
public static function storeProductItems($idSource, $idDest, $batchParams,
$params = array()) {
if ($idSource > 0 && $idDest > 0) {
// Related products
$aR = PhocacartRelated::getRelatedItemsById($idSource, 1);
$aRS = '';
if ($aR != '') {
$aRS = implode(',', $aR);
}
PhocacartRelated::storeRelatedItemsById($aRS, (int)$idDest );
// Additional Images
$iA = PhocacartImageAdditional::getImagesByProductId($idSource, 2);
PhocacartImageAdditional::storeImagesByProductId((int)$idDest, $iA, 1);
// Attributes
$aA = PhocacartAttribute::getAttributesById($idSource, 1);
if (!empty($aA)) {
foreach ($aA as $k => $v) {
if (isset($v['id']) && $v['id'] > 0) {
$oA = PhocacartAttribute::getOptionsById((int)$v['id'],
1);
if (!empty($oA)) {
$aA[$k]['options'] = $oA;
}
}
}
}
$copy = 1;// When copying attributes or batch products we do a
copy of attributes (copy = 1) but in this case without copying download
files on the server
if
(isset($batchParams['copy_attributes_download_files']) &&
$batchParams['copy_attributes_download_files'] == 1) {
$copy = 2;// The same like 1 but in this case we even copy
the download files on the server, see:
PhocacartAttribute::storeAttributesById() for more info
}
PhocacartAttribute::storeAttributesById((int)$idDest, $aA, 1, $copy);
// Additional download files
if (isset($batchParams['copy_download_files']) &&
$batchParams['copy_download_files'] == 1) {
$fA = PhocacartFileAdditional::getProductFilesByProductId($idSource,
2);
$fANew = array();
if(!empty($fA)) {
foreach($fA as $k => $v) {
if (isset($v['download_file']) &&
$v['download_file'] != '') {
$fANew[]['download_file'] =
str_replace($params['olddownloadfolder'],
$params['newdownloadfolder'], $v['download_file']);
}
}
}
PhocacartFileAdditional::storeProductFilesByProductId((int)$idDest,
$fANew, 1);
}
// Specifications
$sA = PhocacartSpecification::getSpecificationsById($idSource, 1);
PhocacartSpecification::storeSpecificationsById((int)$idDest, $sA, 1);
// Discounts
$dA = PhocacartDiscountProduct::getDiscountsById($idSource, 1);
PhocacartDiscountProduct::storeDiscountsById((int)$idDest, $dA, 1);
// Advanced Stock Options
$aSOA = PhocacartAttribute::getCombinationsStockById($idSource, 1);//
NOT POSSIBLE TO COPY
// We need to create new attributes including new product key, etc.
$product = array();
$product['product'] =
PhocacartProduct::getProduct((int)$idDest);
$product['attr_options'] =
PhocacartAttribute::getAttributesAndOptions((int)$idDest);
$product['combinations'] = array();
$product['combinations_stock'] = array();
if (!empty($product['product'])) {
//PhocacartAttribute::storeCombinationsById((int)$idDest,
$product['attr_options'], 1);
PhocacartAttribute::getCombinations(
$product['product']->id,
$product['product']->title,
$product['attr_options'], $product['combinations']);
$aSOANew = array();
if (!empty($product['combinations'])) {
$i = 0;
foreach($product['combinations'] as $k => $v) {
$attributes =
PhocacartProduct::getProductKey($v['product_id'],
$v['attributes'], 0);
$aSOANew[$i]['product_id'] =
(int)$v['product_id'];
$aSOANew[$i]['product_key'] = $v['product_key'];
$aSOANew[$i]['stock'] = 0;// Stock cannot be copied as the
attributes are completely new and product key is different
$aSOANew[$i]['attributes'] = $attributes;
$i++;
}
PhocacartAttribute::storeCombinationsById((int)$idDest, $aSOANew, 1);
}
}
// Customer groups
$cA = PhocacartGroup::getGroupsById($idSource, 3, 1);
PhocacartGroup::storeGroupsById((int)$idDest, 3, $cA);
// Tags
$tA = PhocacartTag::getTags($idSource, 1);
if (!isset($tA)) {
$tA = array();
}
PhocacartTag::storeTags($tA, (int)$idDest);
// Tag Labels
$tLA = PhocacartTag::getTagLabels($idSource, 1);
if (!isset($tLA)) {
$tLA = array();
}
PhocacartTag::storeTagLabels($tLA, (int)$idDest);
// Parameters
$parameters = PhocacartParameter::getAllParameters();
if (!empty($parameters)) {
foreach ($parameters as $kP => $vP) {
if (isset($vP->id) && (int)$vP->id > 0) {
$idP = (int)$vP->id;
$pA = PhocacartParameter::getParameterValues($idSource, $idP, 1);
if (!isset($pA)) {
$pA = array();
}
PhocacartParameter::storeParameterValues($pA, (int)$idDest, $idP);
}
}
}
}
return true;
}
public static function storeCategoryItems($idSource, $idDest) {
if ($idSource > 0 && $idDest > 0) {
// Customer groups
$cA = PhocacartGroup::getGroupsById($idSource, 2, 1);
PhocacartGroup::storeGroupsById((int)$idDest, 2, $cA);
}
return true;
}
}
?>
PK�"�[�g
��'libraries/phocacart/utils/exception.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class PhocacartUtilsException
{
public static function renderErrorInfo ($msg, $jText = false){
if ($jText) {
return '<div class="alert
alert-error">'.JText::_($msg).'</div>';
} else {
return '<div class="alert
alert-error">'.$msg.'</div>';
}
}
}
?>PK�"�[d�sp��'libraries/phocacart/utils/extension.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class PhocacartUtilsExtension
{
private static $extension = array();
private static $extensionLoad = array();
private function __construct(){}
/**
* Get information about extension.
*
* @param string Extension element (com_cpanel, com_admin, ...)
* @param string Extension type (component, plugin, module, ...)
* @param string Folder type (content, editors, search, ...)
*
* @return int ( 0 ... extension not installed
* 1 ... extension installed and enabled
* 2 ... extension installed but not enabled )
*/
public static function getExtensionInfo( $element = null, $type =
'component', $folder = '' ) {
$elementFolder = $element . $folder;
if( is_null( $element ) ) {
throw new Exception('Function Error: No element added', 500);
return false;
}
if( !array_key_exists( $elementFolder, self::$extension ) ) {
$db = JFactory::getDbo();
$query = $db->getQuery(true);
if ($type == 'component'){
$query->select('extension_id AS id, element AS
"option", params, enabled');
} else {
$query->select('extension_id AS "id", element AS
"element", params, enabled');
}
$query->from('#__extensions');
$query->where('`type` = '.$db->quote($type));
if ($folder != '') {
$query->where('`folder` = '.$db->quote($folder));
}
$query->where('`element` = '.$db->quote($element));
$db->setQuery($query);
$cache =
JFactory::getCache('_system','callback');
$extensionData = $cache->get(array($db, 'loadObject'),
null, $element, false);
if (isset($extensionData->enabled) &&
$extensionData->enabled == 1) {
self::$extension[$elementFolder] = 1;
} else if(isset($extensionData->enabled) &&
$extensionData->enabled == 0) {
self::$extension[$elementFolder] = 2;
} else {
self::$extension[$elementFolder] = 0;
}
}
return self::$extension[$elementFolder];
}
public static function getExtensionLoadInfo( &$extension, $element =
null, $type = 'component', $folder = '', $version =
'') {
$elementFolder = $element . $folder;
if( is_null( $element ) ) {
return false;
}
if( !array_key_exists( $elementFolder, self::$extensionLoad ) ) {
$table = JTable::getInstance('Extension',
'JTable');
$key['type'] = $type;
$key['element'] = $element;
if ($type == 'plugin') {
$key['folder'] = $folder;
}
if ($table->load($key)){
$extension['installed'] = true;
$extension['enabled'] = (bool) $table->enabled;
$manifest = json_decode($table->manifest_cache);
if (version_compare($extension['version'],
@$manifest->version, 'gt')){
$extension['versioncurrent'] = $manifest->version;
}
}
self::$extensionLoad[$elementFolder] = $extension;
}
return self::$extensionLoad[$elementFolder];
}
public static function getExtensionsObtainTypeButton($type, $download,
$extension) {
$s = PhocacartRenderStyle::getStyles();
$o = '';
// BUTTON
$link = '';
$icon = '';
$text = '';
$class = '';
$target = '';
// TEXT
$iconTxt = '';
$classTxt = '';
$textTxt = '';
if (($type == 0 || $type == 4) &&
$extension['installed'] == false) {
$link = $download;
$icon = 'shopping-cart';
$class = 'btn-buy';
$text = JText::_('COM_PHOCACART_BUY_NOW');
$target = 'target="_blank"';
} else {
if ($extension['installed']) {
if ($extension['enabled']) {
if ($extension['versioncurrent']) {
if ($type == 0) {
// 0 - Paid but update - installed but updated paid version found
$link = $download;
$icon = 'shopping-cart';
$class = 'btn-buy';
$text = JText::_('COM_PHOCACART_REQUEST') . '
('.$extension['version'].')';
$target = 'target="_blank"';
$iconTxt = 'ok';
$classTxt = 'ph-success-txt';
$textTxt = JText::_('COM_PHOCACART_INSTALLED');
} else if ($type == 4) {
// 0 - Paid but update - installed but updated paid version found
$link = $download;
$icon = 'shopping-cart';
$class = 'btn-buy';
$text = JText::_('COM_PHOCACART_REQUEST') . '
('.$extension['version'].')';
$target = 'target="_blank"';
$iconTxt = 'ok';
$classTxt = 'ph-success-txt';
$textTxt = JText::_('COM_PHOCACART_INSTALLED');
} else if ($type == 1) {
// Direct Install
$link =
JRoute::_('index.php?option=com_phocacart&task=phocacartextension.install&link='
. base64_encode($download) . '&' . JSession::getFormToken() .
'=1', false);//SEC
$icon = 'refresh';
$class = 'btn-success';
$text = JText::_('COM_PHOCACART_UPDATE') . '
('.$extension['version'].')';
$target = '';
$iconTxt = 'ok';
$classTxt = 'ph-success-txt';
$textTxt = JText::_('COM_PHOCACART_INSTALLED');
} else {
// 2 - Download, 3 Download/Register
$link = $download;
$icon = 'download';
$class = 'btn-primary';
$text = JText::_('COM_PHOCACART_DOWNLOAD') . '
('.$extension['version'].')';
$target = 'target="_blank"';
$iconTxt = 'ok';
$classTxt = 'ph-success-txt';
$textTxt = JText::_('COM_PHOCACART_INSTALLED');
}
} else {
// Installed - version OK
$iconTxt = 'ok';
$classTxt = 'ph-success-txt';
$textTxt = JText::_('COM_PHOCACART_INSTALLED');
}
} else {
$iconTxt = 'remove';
$classTxt = 'ph-disabled-txt';
$textTxt = JText::_('COM_PHOCACART_DISABLED');
}
} else {
if ($type == 1) {
// Direct Install
$link =
JRoute::_('index.php?option=com_phocacart&task=phocacartextension.install&link='
. base64_encode($download) . '&' . JSession::getFormToken() .
'=1', false);
$icon = 'download-alt';
$class = 'btn-success';
$text = JText::_('COM_PHOCACART_INSTALL');
$target = '';
} else {
// 2 - Download, 3 Download/Register
$link = $download;
$icon = 'download';
$class = 'btn-primary';
$text = JText::_('COM_PHOCACART_DOWNLOAD');
$target = 'target="_blank"';
}
}
}
$o .= '<div class="ph-center
ph-extension-button">';
if ($textTxt != '' && $classTxt != ''
&& $iconTxt != '') {
$o .= '<div
class="'.$classTxt.'"><span
class="'.$s['i'][$iconTxt].'"></span>
'.$textTxt.'</div>';
}
if ($link != '' && $icon != '' &&
$text != '') {
$o .= '<a href="'.$link.'"
'.$target.' class="btn btn-small
'.$class.'">';
$o .= '<span
class="'.$s['i'][$icon].'"></span>
';
$o .= $text . '</a>';
}
$o .= '</div>';
return $o;
}
public final function __clone() {
throw new Exception('Function Error: Cannot clone instance of
Singleton pattern', 500);
return false;
}
}
?>
PK�"�[�#o,,$libraries/phocacart/utils/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��%%"libraries/phocacart/utils/info.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class PhocacartUtilsInfo
{
public static function getInfo($mode = 1) {
JPluginHelper::importPlugin('phocatools');
$results =
\JFactory::getApplication()->triggerEvent('PhocatoolsOnDisplayInfo',
array('NjI5NTcyNzcxMTc='));
if (isset($results[0]) && $results[0] === true) {
return '';
}
if ($mode === 0) {
return "\n\n" . 'Powered by Phoca Cart' .
"\n" . 'https://www.phoca.cz/phocacart';
} else if ($mode === 2) {
return '<div>Powered by <a
href="https://www.phoca.cz/phocacart"><img
src="'.JURI::root(true).'/media/com_phocacart/images/phoca-cart.png"
alt="Phoca Cart"
style="height:1.2em;width:auto;margin-bottom: 3px;"
/></a> & <a
href="https://www.phoca.cz/phocacart"><img
src="'.JURI::root(true).'/media/com_phocacart/images/phoca-pos.png"
alt="Phoca POS"
style="height:1.2em;width:auto;margin-bottom: 3px;"
/></a></div>';
} else {
return '<div
style="text-align:right;display:block">Powered by <a
href="https://www.phoca.cz/phocacart">Phoca
Cart</a></div>';
}
}
}
?>
PK�"�[҂5���%libraries/phocacart/utils/options.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class PhocacartUtilsOptions
{
private static $options = array();
private function __construct(){}
/*
* Load Phoca Cart Options only once per site
* Options can be different when they are called in administration or in
site, or on com_phocacart site or not com_phocacart site
* Component = PC (Phoca Cart)
* Client = A (Administrator) | S (Site)
* Option = com_phocacart
*
* Possible values:
* PCAcom_phocacart - Phoca Cart component, Administrator,
option=com_phocacart
* PCScom_phocacart - Phoca Cart component, Site, option=com_phocacart
* PCScom_content - Phoca Cart component, Site, option=com_content (we
need options for Phoca Cart module displayed on com_content page)
* (there can be some exceptions like if we call router where the option
is not known yet)
*
* PhocaCartUtils::getComponentParameters ->
PhocaCartUtilsOptions::getOptions (singleton)
*
*/
public static function getOptions($component, $client, $option) {
$elementOption = $component . $client . $option;
if( is_null( $elementOption ) ) {
throw new Exception('Function Error: No element added', 500);
return false;
}
if( !array_key_exists( $elementOption, self::$options ) ) {
$app = JFactory::getApplication();
if ($client == 'A') {
self::$options[$elementOption] =
JComponentHelper::getParams('com_phocacart');
} else {
if ($option == 'com_phocacart') {
self::$options[$elementOption] = $app->getParams();
} else {
self::$options[$elementOption] =
JComponentHelper::getParams('com_phocacart');
}
}
}
return self::$options[$elementOption];
}
public final function __clone() {
throw new Exception('Function Error: Cannot clone instance of
Singleton pattern', 500);
return false;
}
}
?>
PK�"�[��H9H9&libraries/phocacart/utils/settings.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
//=========
//TYPES
//=========
//---------
//LOG (#__phocacart_logs)
// 1 ... payment
//---------
//---------
// RESPONSES (Info view)
// components\com_phocacart\views\info\tmpl\default.php
// components\com_phocacart\controllers\response.php
// 1 ... ORDER/NO DOWNLOAD
// 2 ... ORDER/ DOWNLOAD
// 3 ... PAYMENT / NO DOWNLOAD
// 4 ... PAYMENT / DOWNLOAD
// 5 ... PAYMENT CANCELED
// STOCK
// stock_checking - set if stock is checked or not
// stock_checkout - if stock is checked (stock_checking = 1), set if user
can order product which is not on stock
// 1 ... stock checkout enabled - cannot order, 0...
stock checkout disabled - can order
// stockvalid - when we make checkout, it can happen that some of the
product is not on stock, so we store this info to variable stockvalid
// - e.g. we check the stock, product A is on stock, product B
not and user ordered both - stockvalid = 0
class PhocacartUtilsSettings
{
public static function getManagerGroup($manager) {
$group = array();
switch ($manager) {
// Pathe needs to be set too
case 'categoryimage':
$group['f'] = 4;//File
$group['i'] = 1;//Image
$group['t'] = 'image';//Text
$group['c'] = '&tmpl=component';
break;
case 'productimage':
$group['f'] = 5;//File
$group['i'] = 1;//Image
$group['t'] = 'image';//Text
$group['c'] = '&tmpl=component';
break;
case 'submititem':
$group['f'] = 7;//File
$group['i'] = 1;//Image
$group['t'] = 'image';//Text
$group['c'] = '&tmpl=component';
break;
case 'productfile':
$group['f'] = 3;//File
$group['i'] = 0;//Image
$group['t'] = 'file';//Text
$group['c'] = '&tmpl=component';
break;
case 'attributefile':
$group['f'] = 3;//File
$group['i'] = 0;//Image
$group['t'] = 'file';//Text
$group['c'] = '&tmpl=component';
break;
case 'publicfile':
$group['f'] = 6;//File
$group['i'] = 0;//Image
$group['t'] = 'file';//Text
$group['c'] = '&tmpl=component';
break;
case 'attachmentfile':
$group['f'] = 8;//File
$group['i'] = 0;//Image
$group['t'] = 'file';//Text
$group['c'] = '&tmpl=component';
break;
default:
$group['f'] = 0;//File
$group['i'] = 0;//Image
$group['t'] = 'file';//Text
$group['c'] = '&tmpl=component';
break;
}
return $group;
}
public static function getListFilterParams($includeId = 0) {
$pC = PhocacartUtils::getComponentParameters();
$manufacturer_alias = $pC->get( 'manufacturer_alias',
'manufacturer');
$manufacturer_alias = $manufacturer_alias != '' ?
trim(PhocacartText::filterValue($manufacturer_alias,
'alphanumeric')) : 'manufacturer';
$p[] = 'price_from';
$p[] = 'price_to';
$p[] = 'tag';
$p[] = 'label';
$p[] = $manufacturer_alias;
$p[] = 'a';
$p[] = 's';
$parameters = PhocacartParameter::getAllParameters();
if (!empty($parameters)) {
foreach ($parameters as $k => $v) {
$p[] = trim(PhocacartText::filterValue($v->alias,
'alphanumeric'));
}
}
if ($includeId > 0) {
$p[] = 'id';
}
return $p;
}
/*
public static function getUnit($unit = 0, $type = 'size' ) {
switch($type) {
case 'volume':
$a = array(
1 => array('COM_PHOCACART_MILLILITER', 'ml'),
2 => array('COM_PHOCACART_CENTILITER', 'cl'),
3 => array('COM_PHOCACART_LITER', 'l'),
4 => array('COM_PHOCACART_PINT', 'pt'),
5 => array('COM_PHOCACART_QUART', 'qt'),
6 => array('COM_PHOCACART_GALLON', 'gal'),
7 => array('COM_PHOCACART_OUNCE', 'fl oz')
);
break;
case 'weight':
$a = array(
1 => array('COM_PHOCACART_GRAM', 'g'),
2 => array('COM_PHOCACART_KILOGRAM', 'kg'),
3 => array('COM_PHOCACART_POUND', 'lb'),
4 => array('COM_PHOCACART_OUNCE', 'oz')
);
break;
case 'size':
default:
$a = array(
1 => array('COM_PHOCACART_MILLIMETER', 'mm'),
2 => array('COM_PHOCACART_CENTIMETER', 'cm'),
3 => array('COM_PHOCACART_METER', 'm'),
4 => array('COM_PHOCACART_INCH', 'in'),
5 => array('COM_PHOCACART_FOOT', 'ft')
);
break;
}
if ($unit == 0) {
return $a;
} else {
if (isset($a[$unit])) {
return $a[$unit];
} else {
return '';
}
}
}*/
public static function getTaxCalculationType($type) {
switch($type) {
case 1:
return JText::_('COM_PHOCACART_PERCENTAGE');
break;
case 0:
default:
return JText::_('COM_PHOCACART_FIXED_AMOUNT');
break;
}
}
public static function getDiscountCalculationTypeArray() {
$calcTypeArray = array();
$calcTypeArray[0] = JText::_('COM_PHOCACART_FIXED_AMOUNT');
$calcTypeArray[1] = JText::_('COM_PHOCACART_PERCENTAGE');
return $calcTypeArray;
}
public static function getExtenstionsArray() {
$a = array();
$a['components'] =
JText::_('COM_PHOCACART_COMPONENTS');
$a['modules'] = JText::_('COM_PHOCACART_MODULES');
$a['plugins'] = JText::_('COM_PHOCACART_PLUGINS');
$a['templates'] =
JText::_('COM_PHOCACART_TEMPLATES');
$a['languages'] =
JText::_('COM_PHOCACART_LANGUAGES');
return $a;
}
public static function getExtenstionsJSONLinks($type) {
$dir =
'https://raw.githubusercontent.com/PhocaCz/PhocaCart/master/extensions/';
$a = array();
$a['components'] = 'components/components.json';
$a['modules'] = 'modules/modules.json';
$a['plugins'] = 'plugins/plugins.json';
$a['templates'] = 'templates/templates.json';
$a['languages'] = 'languages/languages.json';
$a['news'] = 'news/news.json';
if (isset($a[$type])) {
return $dir . $a[$type];
}
return false;
}
public static function getExtensionsJSONObtainTypeText($type) {
switch($type){
case 0:
return JText::_('COM_PHOCACART_PAID');// Paid
break;
case 1:
return JText::_('COM_PHOCACART_FREE');// Free Install
break;
case 2:
return JText::_('COM_PHOCACART_FREE');// Free Download
break;
case 3:
return JText::_('COM_PHOCACART_FREE_REGISTER');// Free
Download but register
break;
case 4:
return JText::_('COM_PHOCACART_PAID_SUBSCRIPTION');// Paid -
Subscription
break;
default:
return '';
break;
}
}
public static function getAdditionalHitsType($type) {
switch($type) {
case 2:
return JText::_('COM_PHOCACART_SEARCH_TERM');
break;
case 1:
default:
return JText::_('COM_PHOCACART_PRODUCT_VIEW');
break;
}
}
public static function getDefaultAllowedMimeTypesDownload() {
return
'{hqx=application/mac-binhex40}{cpt=application/mac-compactpro}{csv=text/x-comma-separated-values}{bin=application/macbinary}{dms=application/octet-stream}{lha=application/octet-stream}{lzh=application/octet-stream}{exe=application/octet-stream}{class=application/octet-stream}{psd=application/x-photoshop}{so=application/octet-stream}{sea=application/octet-stream}{dll=application/octet-stream}{oda=application/oda}{pdf=application/pdf}{ai=application/postscript}{eps=application/postscript}{ps=application/postscript}{smi=application/smil}{smil=application/smil}{mif=application/vnd.mif}{xls=application/vnd.ms-excel}{ppt=application/powerpoint}{wbxml=application/wbxml}{wmlc=application/wmlc}{dcr=application/x-director}{dir=application/x-director}{dxr=application/x-director}{dvi=application/x-dvi}{gtar=application/x-gtar}{gz=application/x-gzip}{php=application/x-httpd-php}{php4=application/x-httpd-php}{php3=application/x-httpd-php}{phtml=application/x-httpd-php}{phps=application/x-httpd-php-source}{js=application/x-javascript}{swf=application/x-shockwave-flash}{sit=application/x-stuffit}{tar=application/x-tar}{tgz=application/x-tar}{xhtml=application/xhtml+xml}{xht=application/xhtml+xml}{zip=application/x-zip}{mid=audio/midi}{midi=audio/midi}{mpga=audio/mpeg}{mp2=audio/mpeg}{mp3=audio/mpeg}{aif=audio/x-aiff}{aiff=audio/x-aiff}{aifc=audio/x-aiff}{ram=audio/x-pn-realaudio}{rm=audio/x-pn-realaudio}{rpm=audio/x-pn-realaudio-plugin}{ra=audio/x-realaudio}{rv=video/vnd.rn-realvideo}{wav=audio/x-wav}{bmp=image/bmp}{gif=image/gif}{jpeg=image/jpeg}{jpg=image/jpeg}{jpe=image/jpeg}{png=image/png}{tiff=image/tiff}{tif=image/tiff}{css=text/css}{html=text/html}{htm=text/html}{shtml=text/html}{txt=text/plain}{text=text/plain}{log=text/plain}{rtx=text/richtext}{rtf=text/rtf}{xml=text/xml}{xsl=text/xml}{mpeg=video/mpeg}{mpg=video/mpeg}{mpe=video/mpeg}{qt=video/quicktime}{mov=video/quicktime}{avi=video/x-msvideo}{flv=video/x-flv}{movie=video/x-sgi-movie}{doc=application/msword}{xl=application/excel}{eml=message/rfc822}{pptx=application/vnd.openxmlformats-officedocument.presentationml.presentation}{xlsx=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet}{docx=application/vnd.openxmlformats-officedocument.wordprocessingml.document}{rar=application/x-rar-compressed}{odb=application/vnd.oasis.opendocument.database}{odc=application/vnd.oasis.opendocument.chart}{odf=application/vnd.oasis.opendocument.formula}{odg=application/vnd.oasis.opendocument.graphics}{odi=application/vnd.oasis.opendocument.image}{odm=application/vnd.oasis.opendocument.text-master}{odp=application/vnd.oasis.opendocument.presentation}{ods=application/vnd.oasis.opendocument.spreadsheet}{odt=application/vnd.oasis.opendocument.text}{sxc=application/vnd.sun.xml.calc}{sxd=application/vnd.sun.xml.draw}{sxg=application/vnd.sun.xml.writer.global}{sxi=application/vnd.sun.xml.impress}{sxm=application/vnd.sun.xml.math}{sxw=application/vnd.sun.xml.writer}';
}
public static function getDefaultAllowedMimeTypesUpload() {
return
'{pdf=application/pdf}{ppt=application/powerpoint}{gz=application/x-gzip}{tar=application/x-tar}{tgz=application/x-tar}{zip=application/x-zip}{bmp=image/bmp}{gif=image/gif}{jpeg=image/jpeg}{jpg=image/jpeg}{jpe=image/jpeg}{png=image/png}{tiff=image/tiff}{tif=image/tiff}{txt=text/plain}{mpeg=video/mpeg}{mpg=video/mpeg}{mpe=video/mpeg}{qt=video/quicktime}{mov=video/quicktime}{avi=video/x-msvideo}{flv=video/x-flv}{doc=application/msword}';
}
public static function getHTMLTagsUpload() {
return
array('abbr','acronym','address','applet','area','audioscope','base','basefont','bdo','bgsound','big','blackface','blink','blockquote','body','bq','br','button','caption','center','cite','code','col','colgroup','comment','custom','dd','del','dfn','dir','div','dl','dt','em','embed','fieldset','fn','font','form','frame','frameset','h1','h2','h3','h4','h5','h6','head','hr','html','iframe','ilayer','img','input','ins','isindex','keygen','kbd','label','layer','legend','li','limittext','link','listing','map','marquee','menu','meta','multicol','nobr','noembed','noframes','noscript','nosmartquotes','object','ol','optgroup','option','param','plaintext','pre','rt','ruby','s','samp','script','select','server','shadow','sidebar','small','spacer','span','strike','strong','style','sub','sup','table','tbody','td','textarea','tfoot','th','thead','title','tr','tt','ul','var','wbr','xml','xmp','!DOCTYPE',
'!--');
}
public static function getHTMLTagsExternalSource() {
return array('a', 'b', 'blockquote',
'br', 'caption', 'center', 'cite',
'code', 'dd', 'div', 'dl',
'dt', 'em', 'h1', 'h2',
'h3', 'h4', 'h5', 'h6',
'hr', 'img', 'li', 'ol',
'p', 'pre', 'small', 'span',
'strike', 'strong', 'sub', 'sup',
'table', 'td', 'th', 'tr',
'ul');
}
public static function isFullGroupBy() {
$pC = PhocacartUtils::getComponentParameters();
$sql_only_full_group_by = $pC->get(
'sql_only_full_group_by', 0 );
return (bool)$sql_only_full_group_by;
}
public static function getShopType() {
$type = array();
$type[0] = 0;// common
if (PhocacartPos::isPos()) {
// POS
$type[1] = 2;
} else {
// ONLINE SHOP
$type[1] = 1;
}
return $type;
}
public static function getShopTypes() {
return array(
0 => JText::_('COM_PHOCACART_ALL'),
1 => JText::_('COM_PHOCACART_ONLINE_SHOP'),
2 => JText::_('COM_PHOCACART_POS')
);
}
public static function getLangQuery($column, $lang) {
$db = JFactory::getDbo();
// Possible settings
//$pC = PhocacartUtils::getComponentParameters();
//$filter_lang_type = $pC->get( 'filter_lang_type', 2 );
//$type1 = ' ' . $db->quoteName($column) . ' =
'.$db->quote($lang);
$type2 = ' ' . $db->quoteName($column) . ' IN
('.$db->quote($lang).','.$db->quote('*').')';
/*if ($filter_lang_type == 1) {
return $type1;
} else {
return $type2;
}*/
return $type2;
}
public static function getProductConditionValues($condition) {
switch((int)$condition) {
case 1: return 'refurbished'; break;
case 2: return 'used'; break;
case 0: default: return 'new'; break;
}
}
public static function getOrderStatusClass($status) {
$status = str_replace('COM_PHOCACART_STATUS_', '',
$status);
switch ($status) {
case 'CANCELED':
$class = 'label label-warning badge badge-warning
ph-order-status-canceled';
break;
case 'COMPLETED':
$class = 'label label-success badge badge-success
ph-order-status-completed';
break;
case 'CONFIRMED':
$class = 'label label-success badge badge-success
ph-order-status-confirmed';
break;
case 'PENDING':
$class = 'label label-info badge badge-info
label-primary ph-order-status-pending';
break;
case 'REFUNDED':
$class = 'label label-important label-danger badge
badge-danger ph-order-status-refunded';
break;
case 'SHIPPED':
$class = 'label label-info badge badge-info
ph-order-status-shipped';
break;
default:
$class = 'label label-default
ph-order-status-default';
break;
}
return $class;
}
}
?>
PK�"�[�� 9 9#libraries/phocacart/utils/utils.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class PhocacartUtils
{
public static function setVars( $task = '') {
$a = array();
$app = JFactory::getApplication();
$a['o'] =
htmlspecialchars(strip_tags($app->input->get('option')));
$a['c'] = str_replace('com_', '',
$a['o']);
$a['n'] = 'Phoca' .
str_replace('com_phoca', '', $a['o']);
$a['l'] = strtoupper($a['o']);
$a['i'] =
'media/'.$a['o'].'/images/administrator/';
$a['ja'] =
'media/'.$a['o'].'/js/administrator/';
$a['jf'] =
'media/'.$a['o'].'/js/';
$a['s'] =
'media/'.$a['o'].'/css/administrator/'.$a['c'].'.css';
$a['css'] =
'media/'.$a['o'].'/css/';
$a['bootstrap'] =
'media/'.$a['o'].'/bootstrap/';
$a['task'] = $a['c'] .
htmlspecialchars(strip_tags($task));
$a['tasks'] = $a['task']. 's';
switch ($task) {
case 'tax':
case 'stockstatus':
case 'status':
$a['tasks'] = $a['task']. 'es';
break;
case 'category':
case 'currency':
case 'country':
$tStr = substr($a['task'],0,-1);
$a['tasks'] = $tStr. 'ies';
break;
}
return $a;
}
public static function getPhocaVersion($component =
'com_phocacart') {
$component = 'com_phocacart';
$folder = JPATH_ADMINISTRATOR
.'/components'.'/'.$component;
if (JFolder::exists($folder)) {
$xmlFilesInDir = JFolder::files($folder, '.xml$');
} else {
$folder = JPATH_SITE .
'/components'.'/'.$component;
if (JFolder::exists($folder)) {
$xmlFilesInDir = JFolder::files($folder, '.xml$');
} else {
$xmlFilesInDir = null;
}
}
$xml_items = array();
if (count($xmlFilesInDir))
{
foreach ($xmlFilesInDir as $xmlfile)
{
if ($data =
\JInstaller::parseXMLInstallFile($folder.'/'.$xmlfile)) {
foreach($data as $key => $value) {
$xml_items[$key] = $value;
}
}
}
}
if (isset($xml_items['version']) &&
$xml_items['version'] != '' ) {
return $xml_items['version'];
} else {
return '';
}
}
public static function getAliasName($alias) {
if (JFactory::getConfig()->get('unicodeslugs') == 1) {
$alias= JFilterOutput::stringURLUnicodeSlug($alias);
} else {
$alias = JFilterOutput::stringURLSafe($alias);
}
if (trim(str_replace('-', '', $alias)) ==
'') {
$alias = JFactory::getDate()->format("Y-m-d-H-i-s");
}
return $alias;
}
public static function setMessage($new = '', $current =
'') {
$message = $current;
if($new != '') {
if ($current != '') {
$message .= '<br />';
}
$message .= $new;
}
return $message;
}
public static function getInfo($mode = 1) {
if ($mode == 0) {
return "\n\n" . 'Powered by Phoca Cart' .
"\n" . 'https://www.phoca.cz/phocacart';
} else {
return '<div
style="text-align:right;color:#ccc;display:block">Powered by
<a href="https://www.phoca.cz/phocacart">Phoca
Cart</a></div>';
}
}
public static function getToken($type = 'token') {
$app = JFactory::getApplication();
$secret = $app->get('secret');
$secretPartA= substr($secret, mt_rand(4,15), mt_rand(0,10));
$secretPartB= substr($secret, mt_rand(4,15), mt_rand(0,10));
$saltArray = array('a', '0', 'c',
'1', 'e', '2', 'h', '3',
'i', '4', 'k', '5', 'm',
'6', 'o', '7', 'q', '8',
'r', '0', 'u', '1', 'w',
'2', 'y');
$randA = mt_rand(0,9999);
$randB = mt_rand(0, $randA);
$randC = mt_rand(0, $randB);
$randD = mt_rand(0,24);
$randD2 = mt_rand(0,24);
$salt = md5('string '. $secretPartA . date('s').
$randA . str_replace($randC, $randD, date('r')). $secretPartB .
'end string');
$salt = str_replace($saltArray[$randD], $saltArray[$randD2], $salt);
if ($type > 100) {
$salt = md5($salt);
}
// use password_hash since php 5.5.0
$salt = crypt($salt, $salt);
$rT = $randC + $randA;
if ($rT < 1) {$rT = 1;}
$time = (int)time() * $randB / $rT;
$token = hash('sha256', $salt . $time . time());
if ($type == 'folder') {
return substr($token, $randD, 16);
} else {
return $token;
}
}
public static function isURLAddress($url) {
return
preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i',
$url);
}
public static function round($value, $precision = 2) {
return round($value, $precision);
}
public static function getRandomString($length = '') {
$code = md5(uniqid(rand(), true));
if ($length != '' && (int)$length > 0) {
$length = $length - 1;
return chr(rand(97,122)) . substr($code, 0, $length);
} else {
return chr(rand(97,122)) . $code;
}
}
public static function wordDelete($string,$length,$end) {
if (strlen($string) < $length || strlen($string) == $length) {
return $string;
} else {
return substr($string, 0, $length) . $end;
}
}
public static function wordDeleteWhole($string,$length,$end =
'...') {
if (strlen($string) < $length || strlen($string) == $length) {
return $string;
} else {
preg_match('/(.{' . $length . '}.*?)\b/', $string,
$matches);
return rtrim($matches[1]) . $end;
}
}
public static function strTrimAll($input) {
$output = '';
$input = trim($input);
for($i=0;$i<strlen($input);$i++) {
if(substr($input, $i, 1) != " ") {
$output .= trim(substr($input, $i, 1));
} else {
$output .= " ";
}
}
return $output;
}
public static function convertEncoding($string) {
$pC = PhocacartUtils::getComponentParameters();
$import_encoding_method = $pC->get(
'import_encoding_method', '' );
$import_encoding = $pC->get( 'import_encoding',
'' );
$returnString = '';
if ($import_encoding != '') {
if ($import_encoding_method == 1) { //'iconv'
$returnString = iconv( $import_encoding, "UTF-8", $string );
} else if ($import_encoding_method == 2)
{//'mb_convert_encoding'
$returnString = mb_convert_encoding($string, "UTF-8",
$import_encoding);
} else {
$returnString = $string;
}
} else {
$returnString = $string;
}
return self::removeUtf8Bom($returnString);
}
public static function removeUtf8Bom($text) {
$bom = pack('H*','EFBBBF');
$text = preg_replace("/^$bom/", '', $text);
return $text;
}
public static function getIp() {
$ip = false;
if(isset($_SERVER['REMOTE_ADDR']) &&
$_SERVER['REMOTE_ADDR'] != getenv('SERVER_ADDR')) {
$ip = $_SERVER['REMOTE_ADDR'];
} else {
$ip = getenv('HTTP_X_FORWARDED_FOR');
}
if (!$ip) {
$ip = $_SERVER['REMOTE_ADDR'];
}
return $ip;
}
public static function StripHiddenChars($str) {
$chars = array("\r\n", "\n", "\r",
"\t", "\0", "\x0B", "\xEF",
"\xBB", "\xBF");
$str = str_replace($chars," ",$str);
return preg_replace('/\s+/',' ',$str);
}
public static function setOptionParameter($parameter, $value =
'') {
$component = 'com_phocacart';
$paramsC = JComponentHelper::getParams($component) ;
$paramsC->set($parameter, $value);
$data['params'] = $paramsC->toArray();
$table = JTable::getInstance('extension');
$idCom = $table->find( array('element' => $component
));
$table->load($idCom);
if (!$table->bind($data)) {
throw new Exception($table->getError());
return false;
}
// pre-save checks
if (!$table->check()) {
throw new Exception($table->getError());
return false;
}
// save the changes
if (!$table->store()) {
throw new Exception($table->getError());
return false;
}
return true;
}
public static function setWizard($status) {
self::setOptionParameter('enable_wizard', $status);
}
public static function doesExist($type) {
switch ($type) {
case 'category':
$q = 'SELECT id FROM #__phocacart_categories ORDER BY id LIMIT
1';
break;
case 'tax':
$q = 'SELECT id FROM #__phocacart_taxes ORDER BY id LIMIT
1';
break;
case 'product':
$q = 'SELECT id FROM #__phocacart_products ORDER BY id LIMIT
1';
break;
case 'shipping':
$q = 'SELECT id FROM #__phocacart_shipping_methods ORDER BY id
LIMIT 1';
break;
case 'payment':
$q = 'SELECT id FROM #__phocacart_payment_methods ORDER BY id
LIMIT 1';
break;
case 'country':
$q = 'SELECT id FROM #__phocacart_countries ORDER BY id LIMIT
1';
break;
case 'region':
$q = 'SELECT id FROM #__phocacart_regions ORDER BY id LIMIT
1';
break;
case 'menu':
$q = 'SELECT id FROM #__menu WHERE client_id = 0 AND link LIKE
\'index.php?option=com_phocacart%\' ORDER BY id LIMIT 1';
break;
case 'module':
$q = 'SELECT id FROM #__modules WHERE module LIKE
\'mod_phocacart%\' ORDER BY id LIMIT 1';
break;
case 'option':
default:
$q = 'SELECT params FROM #__extensions WHERE type =
\'component\' AND element = \'com_phocacart\' ORDER BY
params LIMIT 1';
break;
}
$db = JFactory::getDBO();
$db->setQuery($q);
$item = $db->loadResult();
if ($type == 'option') {
$item = str_replace('{}', '', $item);
if (isset($item) && $item != '') {
return 1;
}
} else {
if (isset($item) && (int)$item > 0) {
return 1;
}
}
return 0;
}
// $version - minimum version it must have
public static function isJCompatible($version) {
$currentVersion = new JVersion();
if($currentVersion->isCompatible($version)) {
return true;
}
return false;
}
public static function setConcatCharCount($count = 16384) {
$db = JFactory::getDBO();
$db->setQuery("SET @@group_concat_max_len = ".(int)$count);
$db->execute();
}
public static function issetMessage() {
$app = JFactory::getApplication();
$message = $app->getMessageQueue();
if (!empty($message)) {
return true;
}
return false;
}
public static function date($date, $format = '') {
if ($format == '') {
$format = JText::_('DATE_FORMAT_LC2');
}
/*$user = PhocacartUser::getUser();
$config = JFactory::getConfig();
$dateF = JFactory::getDate($date, 'UTC');
$dateF->setTimezone(new
DateTimeZone($user->getParam('timezone',
$config->get('offset'))));
$dateN = $dateF->format('Y-m-d h:i:s', true, false);
//$dateN = JHtml::date($v->date,
JText::_('DATE_FORMAT_LC2'));*/
$dateN = Joomla\CMS\HTML\HTMLHelper::_('date', $date,
$format);
return $dateN;
}
public static function getComponentParameters() {
$app = JFactory::getApplication();
$option = $app->input->get('option');
$client = $app->isClient('administrator') ? 'A' :
'S';
return PhocacartUtilsOptions::getOptions('PC', $client,
$option);
}
public static function replaceCommaWithPoint($item) {
$paramsC = PhocacartUtils::getComponentParameters();
$comma_point = $paramsC->get( 'comma_point', 0 );
$item = PhocacartUtils::getDecimalFromString($item);
if ($comma_point == 1) {
return str_replace(',', '.', $item);
} else {
return $item;
}
}
public static function getIntFromString($string) {
if (empty($string)) {
return 0;
}
$int = '';//$int = 0
$parts = explode(':', $string);
if (isset($parts[0])) {
$int = (int)$parts[0];
}
return $int;
}
public static function getDateFromString($string) {
if (empty($string)) {
return '0000-00-00';
}
return $string;
}
public static function getDecimalFromString($string) {
if (empty($string)) {
return '0.0';
}
return $string;
}
public static function getStringFromItem($item) {
if (empty($item)) {
return '';
}
return $item;
}
public static function getDefaultTemplate() {
$db = JFactory::getDBO();
$q = 'SELECT template FROM #__template_styles WHERE client_id = 0
AND home = 1;';
$db->setQuery($q);
$item = $db->loadResult();
return $item;
}
public static function cleanExternalHtml($html) {
$allowedTags = PhocacartUtilsSettings::getHTMLTagsExternalSource();
$allowedTagsString = '<' . implode('><',
$allowedTags). '>';
$html = strip_tags($html, $allowedTagsString);
return $html;
}
public static function curl_get_contents($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
public static function addSeparator($string, $separator = ' - ')
{
$o = '';
if ($string != '') {
$o = $separator . $string;
}
return $o;
}
public static function isView($viewToCheck = '') {
if ($viewToCheck != '') {
$app = JFactory::getApplication();
$view = $app->input->get('view', '');
$option = $app->input->get('option', '');
if ($option == 'com_phocacart' && $view ==
$viewToCheck) {
return true;
}
}
return false;
}
public static function isTypeView($viewToCheck = '') {
if ($viewToCheck != '') {
$app = JFactory::getApplication();
$view = $app->input->get('typeview', '');
$option = $app->input->get('option', '');
if ($option == 'com_phocacart' && $view ==
$viewToCheck) {
return true;
}
}
return false;
}
public static function isController($controllerToCheck = '') {
if ($controllerToCheck != '') {
$app = JFactory::getApplication();
//$task = $app->input->get('task','',
'raw');
$controller = $app->input->get('controller',
'');// Set in POS controllers
$option = $app->input->get('option', '');
//$taskA = explode('.', $task);
//if ($option == 'com_phocacart' && isset($taskA[0])
&& $taskA[0] == $controllerToCheck) {
if ($option == 'com_phocacart' && $controller ==
$controllerToCheck) {
return true;
}
}
return false;
}
public static function validateDate($date) {
$format = 'Y-m-d H:i:s';
$dateTime = DateTime::createFromFormat($format, $date);
if ($dateTime instanceof DateTime &&
$dateTime->format('Y-m-d H:i:s') == $date) {
return $dateTime->getTimestamp();
}
return false;
}
}
?>
PK�"�[�#o,,%libraries/phocacart/vendor/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[\/�jj%libraries/phocacart/vendor/vendor.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartVendor
{
public static function isVendor(&$vendor) {
if (!empty($vendor) && isset($vendor->id) &&
(int)$vendor->id > 0) {
$db = JFactory::getDBO();
$query = ' SELECT a.id, a.title, a.image FROM #__phocacart_vendors
AS a'
.' WHERE a.user_id = '.(int)$vendor->id
.' AND a.published = 1'
.' ORDER BY a.ordering';
$db->setQuery($query);
$vendorO = $db->loadObject();
if (isset($vendorO->id) && (int)$vendorO->id > 0) {
if (isset($vendorO->image) && $vendorO->image !=
'') {
$vendor->image = $vendorO->image;// Add image info to vendor
object
}
return true;// current user is vendor
}
return false;
}
return false;
}
}PK�"�[�#o,,'libraries/phocacart/wishlist/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[a�I�7/7/)libraries/phocacart/wishlist/wishlist.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
class PhocacartWishlist
{
protected $items = array();
protected $user = array();
public function __construct() {
$session = JFactory::getSession();
$this->user = PhocacartUser::getUser();
$app = JFactory::getApplication();
if((int)$this->user->id > 0) {
// DATABASE - logged in user - Singleton because of not load data from
database every time wishlist instance is loaded
// 1. Not found in DATABASE - maybe user logged in now, so:
// 2. We try to find the data in SESSION, if they are still in SESSION -
load them to our wishlist class and then
// 3. Store them to DATABASE as all loged in users have wishlist in
database and:
// 4. Remove them from SESSION as they are stored in DATABASE
$wLDb = $this->getWishListItemdDb();// user logged in - try to get
wishlist from db
$this->items = $wLDb;
if(empty($this->items)) {
$this->items = $session->get('wishlist', array(),
'phocaCart');
if(!empty($this->items)) {
$this->updateWishListItems();
$session->set('wishlist', array(),
'phocaCart');
}
}
} else {
$this->items = $session->get('wishlist', array(),
'phocaCart');
}
}
public function getWishListItemdDb() {
if ($this->user->id > 0) {
$db = JFactory::getDBO();
$query = 'SELECT a.product_id, a.category_id, a.user_id'
.' FROM #__phocacart_wishlists AS a'
.' WHERE a.user_id = '.(int)$this->user->id
.' ORDER BY a.id';
$db->setQuery($query);
$items = $db->loadAssocList();
$itemsSorted = array();
if (!empty($items)) {
foreach($items as $k => $v) {
$itemsSorted[$v['product_id']]['product_id'] =
$v['product_id'];
$itemsSorted[$v['product_id']]['category_id'] =
$v['category_id'];
$itemsSorted[$v['product_id']]['user_id'] =
$v['user_id'];
}
if (!empty($itemsSorted)) {
return $itemsSorted;
}
return false;
}
}
return false;
}
public function updateWishListItems() {
if ($this->user->id > 0) {
$db = JFactory::getDBO();
//$items = se rialize($this->items);
$date = JFactory::getDate();
$now = $date->toSql();
if (!empty($this->items)) {
$q = '';
// Unfortunately we need to run SQL query more times in foreach as
// ON DUPLICATE KEY UPDATE can work with one SQL uqery INSERT INTO ...
VALUES (a,b,c), (a2,b2,c2)
// but it does not work with multiple columns product_id x category_id
x user_id in combination
foreach($this->items as $k => $v) {
if (isset($v['product_id']) &&
isset($v['category_id']) &&
(int)$v['product_id'] > 0 &&
(int)$v['category_id'] > 0) {
$q = ' INSERT INTO #__phocacart_wishlists (product_id,
category_id, user_id, date)';
$q .= ' VALUES ('.(int)$v['product_id'].',
'.(int)$v['category_id'].',
'.(int)$this->user->id.',
'.$db->quote($now).')';;
$q .= ' ON DUPLICATE KEY UPDATE product_id =
VALUES(product_id), category_id = VALUES(category_id), user_id =
VALUES(user_id), date = VALUES(date);';
}
}
if ($q != '') {
$db->setQuery($q);
$db->execute();
}
return true;
}
return false;
} else {
$session = JFactory::getSession();
$session->set('wishlist', $this->items,
'phocaCart');
}
return false;
}
public function addItem($id = 0, $catid = 0) {
if ($id > 0) {
$app = JFactory::getApplication();
$paramsC = PhocacartUtils::getComponentParameters();
$maxWishListItems = $paramsC->get( 'max_wishlist_items', 20
);
$count = count($this->items);
if ($count > (int)$maxWishListItems || $count ==
(int)$maxWishListItems) {
$message =
JText::_('COM_PHOCACART_COUNT_OF_PRODUCTS_IN_WISH_LIST_IS_LIMITED');
$app->enqueueMessage($message, 'error');
return false;
}
if(isset($this->items[$id]) && (int)$this->items[$id] >
0) {
$message =
JText::_('COM_PHOCACART_PRODUCT_INCLUDED_IN_WISH_LIST');
$app->enqueueMessage($message, 'error');
return false;
} else {
$this->items[$id]['product_id'] = $id;
$this->items[$id]['category_id'] = $catid;
if ($this->user->id > 0) {
$this->items[$id]['user_id'] = $this->user->id;
}
$this->updateWishListItems();
return true;
}
}
return false;
}
public function removeItem($id = 0) {
if ($id > 0) {
if(isset($this->items[$id]) && (int)$this->items[$id] >
0) {
if ($this->user->id > 0) {
if (isset($this->items[$id]['product_id']) &&
isset($this->items[$id]['category_id'])) {
$db = JFactory::getDBO();
$query = ' DELETE '
.' FROM #__phocacart_wishlists'
.' WHERE product_id =
'.(int)$this->items[$id]['product_id']
.' AND category_id =
'.(int)$this->items[$id]['category_id']
.' AND user_id = '.(int)$this->user->id;
unset($this->items[$id]);// Because of ajax
$db->setQuery($query);
$db->execute();
return true;
} else {
return false;
}
} else {
unset($this->items[$id]);
$session = JFactory::getSession();
$session->set('wishlist', $this->items,
'phocaCart');
return true;
}
} else {
return false;
}
return false;
}
return false;
}
public function emptyWishList() {
$session = JFactory::getSession();
$session->set('wishlist', array(), 'phocaCart');
}
public function getItems() {
return $this->items;
}
public function getQueryList($items, $full = 0){
$user = PhocacartUser::getUser();
$userLevels = implode (',',
$user->getAuthorisedViewLevels());
$userGroups = implode (',',
PhocacartGroup::getGroupsById($user->id, 1, 1));
$itemsS = $this->getItemsIdString($items);
if ($itemsS == '') {
return false;
}
$wheres[] = 'a.id IN ('.(string)$itemsS.')';
$wheres[] = " c.access IN (".$userLevels.")";
$wheres[] = " c.type IN (0,1)";// type: common, onlineshop, pos
- not used outside online shop
$wheres[] = " a.access IN (".$userLevels.")";
$wheres[] = " (ga.group_id IN (".$userGroups.") OR
ga.group_id IS NULL)";
$wheres[] = " (gc.group_id IN (".$userGroups.") OR
gc.group_id IS NULL)";
$wheres[] = " c.published = 1";
$wheres[] = " a.published = 1";
$where = ( count( $wheres ) ? ' WHERE '. implode( ' AND
', $wheres ) : '' );
if ($full == 1) {
$columns = 'a.id as id, a.title as title, a.alias as alias,
a.description, a.price, a.image,'
.' GROUP_CONCAT(DISTINCT c.id) as catid, GROUP_CONCAT(DISTINCT
c.alias) as catalias, GROUP_CONCAT(DISTINCT c.title) as cattitle,
COUNT(pc.category_id) AS count_categories,'
//.' a.length, a.width, a.height, a.weight, a.volume,'
.' a.stock, a.min_quantity, a.min_multiple_quantity,
a.stockstatus_a_id, a.stockstatus_n_id, a.availability,'
//.' m.title as manufacturer_title'
.' MIN(ppg.price) as group_price, MAX(pptg.points_received) as
group_points_received';
$groupsFull = 'a.id, a.title, a.alias, a.description, a.price,
a.image,'
.' a.stock, a.min_quantity, a.min_multiple_quantity,
a.stockstatus_a_id, a.stockstatus_n_id, a.availability,'
.' ppg.price, pptg.points_received';
$groupsFast = 'a.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
$query =
' SELECT '.$columns
.' FROM #__phocacart_products AS a'
.' LEFT JOIN #__phocacart_product_categories AS pc ON pc.product_id
= a.id'
.' LEFT JOIN #__phocacart_categories AS c ON c.id =
pc.category_id'
//.' LEFT JOIN #__phocacart_manufacturers AS m ON a.manufacturer_id
= m.id'
. ' LEFT JOIN #__phocacart_item_groups AS ga ON a.id = ga.item_id
AND ga.type = 3'// type 3 is product
. ' LEFT JOIN #__phocacart_item_groups AS gc ON c.id = gc.item_id
AND gc.type = 2'// type 2 is category
// user is in more groups, select lowest price by best group
. ' LEFT JOIN #__phocacart_product_price_groups AS ppg ON a.id =
ppg.product_id AND ppg.group_id IN (SELECT group_id FROM
#__phocacart_item_groups WHERE item_id = a.id AND group_id IN
('.$userGroups.') AND type = 3)'
// user is in more groups, select highest points by best group
. ' LEFT JOIN #__phocacart_product_point_groups AS pptg ON a.id =
pptg.product_id AND pptg.group_id IN (SELECT group_id FROM
#__phocacart_item_groups WHERE item_id = a.id AND group_id IN
('.$userGroups.') AND type = 3)'
. $where
. ' GROUP BY '.$groups
. ' ORDER BY a.id';
} else {
$columns = 'a.id as id, a.title as title, a.alias as alias,'
.' GROUP_CONCAT(DISTINCT c.id) as catid, GROUP_CONCAT(DISTINCT
c.alias) as catalias, GROUP_CONCAT(DISTINCT c.title) as cattitle,
COUNT(pc.category_id) AS count_categories';
$groupsFull = 'a.id, a.title, a.alias';
$groupsFast = 'a.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
$query =
' SELECT '.$columns
.' FROM #__phocacart_products AS a'
.' LEFT JOIN #__phocacart_product_categories AS pc ON pc.product_id
= a.id'
.' LEFT JOIN #__phocacart_categories AS c ON c.id =
pc.category_id'
. ' LEFT JOIN #__phocacart_item_groups AS ga ON a.id = ga.item_id
AND ga.type = 3'// type 3 is product
. ' LEFT JOIN #__phocacart_item_groups AS gc ON c.id = gc.item_id
AND gc.type = 2'// type 2 is category
. $where
. ' GROUP BY '.$groups
. ' ORDER BY a.id';
}
return $query;
}
public function getItemsIdString($items) {
$itemsR = '';
if (!empty($items)) {
$itemsA = array();
foreach($items as $k => $v) {
if (isset($v['product_id']) &&
(int)$v['product_id'] > 0) {
$itemsA[] = $v['product_id'];
}
}
$itemsR = implode (',', $itemsA);
}
if ($itemsR == '') {
return false;
}
return $itemsR;
}
public function renderList() {
$db = JFactory::getDBO();
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$action = $uri->toString();
$app = JFactory::getApplication();
$s = PhocacartRenderStyle::getStyles();
$paramsC = PhocacartUtils::getComponentParameters();
$add_wishlist_method = $paramsC->get( 'add_wishlist_method',
0 );
$query = $this->getQueryList($this->items);
$d = array();
$d['s'] = $s;
if ($query) {
//echo nl2br(str_replace('#__', 'jos_', $query));
$db->setQuery($query);
$d['wishlist'] = $db->loadObjectList();
$tempItems = $this->correctItems();
PhocacartCategoryMultiple::setBestMatchCategory($d['wishlist'],
$tempItems, 1);// returned by reference
}
$d['actionbase64'] = base64_encode($action);
$d['linkwishlist'] =
JRoute::_(PhocacartRoute::getWishListRoute());
$d['method'] = $add_wishlist_method;
$layoutW = new JLayoutFile('list_wishlist', null,
array('component' => 'com_phocacart'));
echo $layoutW->render($d);
}
public function getFullItems() {
$db = JFactory::getDBO();
$query = $this->getQueryList($this->items, 1);
$products = array();
if ($query) {
$db->setQuery($query);
$products = $db->loadAssocList();
$tempItems = array();
if (!empty($this->items)) {
foreach($this->items as $k => $v) {
$tempItems[$k]['id'] = $v['product_id'];
$tempItems[$k]['catid'] = $v['category_id'];
}
}
$tempItems = $this->correctItems();
PhocacartCategoryMultiple::setBestMatchCategory($products,
$tempItems);// returned by reference
}
return $products;
}
// Correct $this->items array for finding the right category
public function correctItems() {
$tempItems = array();
if (!empty($this->items)) {
foreach($this->items as $k => $v) {
$tempItems[$k]['id'] = $v['product_id'];
$tempItems[$k]['catid'] = $v['category_id'];
}
}
return $tempItems;
}
public function getWishListCountItems() {
return count($this->items);
}
}
?>
PK�"�[�#o,,#libraries/phocacart/zone/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�@�b��!libraries/phocacart/zone/zone.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
jimport('joomla.application.component.model');
class PhocacartZone
{
public static function getZones($id, $select = 0, $table =
'shipping') {
if ($table == 'shipping') {
$t = '#__phocacart_shipping_method_zones';
$c = 'shipping_id';
} else if ($table == 'payment') {
$t = '#__phocacart_payment_method_zones';
$c = 'payment_id';
}
$db =JFactory::getDBO();
if ($select == 1) {
$query = 'SELECT c.zone_id';
} else {
$query = 'SELECT a.*';
}
$query .= ' FROM #__phocacart_zones AS a'
.' LEFT JOIN '.$t.' AS c ON a.id = c.zone_id'
.' WHERE c.'.$c.' = '.(int) $id
.' ORDER BY a.id';
$db->setQuery($query);
if ($select == 1) {
$zones = $db->loadColumn();
} else {
$zones = $db->loadObjectList();
}
return $zones;
}
public static function getAllZonesSelectBox($name, $id, $activeArray,
$javascript = NULL, $order = 'id' ) {
$db =JFactory::getDBO();
$query = 'SELECT a.id AS value, a.title AS text'
.' FROM #__phocacart_zones AS a'
. ' ORDER BY '. $order;
$db->setQuery($query);
$zones = $db->loadObjectList();
$zonesO = Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$zones, $name, 'class="inputbox" size="4"
multiple="multiple"'. $javascript, 'value',
'text', $activeArray, $id);
return $zonesO;
}
/*
* used for shipping method rules
* used for payment method rules
*/
public static function storeZones($zonesArray, $id, $table =
'shipping') {
if ($table == 'shipping') {
$t = '#__phocacart_shipping_method_zones';
$c = 'shipping_id';
} else if ($table == 'payment') {
$t = '#__phocacart_payment_method_zones';
$c = 'payment_id';
}
if ((int)$id > 0) {
$db =JFactory::getDBO();
$query = ' DELETE '
.' FROM '.$t
. ' WHERE '.$c.' = '. (int)$id;
$db->setQuery($query);
$db->execute();
if (!empty($zonesArray)) {
$values = array();
$valuesString = '';
foreach($zonesArray as $k => $v) {
$values[] = ' ('.(int)$id.',
'.(int)$v[0].')';
}
if (!empty($values)) {
$valuesString = implode(',',$values);
$query = ' INSERT INTO '.$t.' ('.$c.',
zone_id)'
.' VALUES '.(string)$valuesString;
$db->setQuery($query);
$db->execute();
}
}
}
}
public static function getCountries($id = 0) {
if ($id > 0) {
$db =JFactory::getDBO();
$q = ' SELECT a.country_id FROM #__phocacart_zone_countries AS
a'
.' WHERE a.zone_id = '.(int) $id
.' ORDER BY a.zone_id';
$db->setQuery($q);
$countries = $db->loadColumn();
return $countries;
}
return false;
}
public static function getRegions($id = 0) {
if ($id > 0) {
$db =JFactory::getDBO();
$q = ' SELECT a.region_id FROM #__phocacart_zone_regions AS a'
.' WHERE a.zone_id = '.(int) $id
.' ORDER BY a.zone_id';
$db->setQuery($q);
$regions = $db->loadColumn();
return $regions;
}
return false;
}
public static function isCountryOrRegionIncluded($zones, $country,
$region){
if (!empty($zones)) {
foreach($zones as $k => $v) {
// Get all countries from current zone - zones which are set as rules
in shipping rule
$countries = self::getCountries((int)$v);
// Is user's country included in country which is included in
selected Zone
if (in_array((int)$country, $countries)) {
return true;
}
// Get all regions from current zone - zones which are set as rules in
shipping rule
$regions = self::getRegions((int)$v);
// Is user's region included in region which is included in
selected Zone
if (in_array((int)$region, $regions)) {
return true;
}
}
/*
// POSSIBLE SOLUTION Countries and regions not in one foreach, first we
test countries than regions
foreach($zones as $k => $v) {
// Get all regions from current zone - zones which are set as rules in
shipping rule
$regions = self::getRegions((int)$v);
// Is user's region included in region which is included in
selected Zone
if (in_array((int)$region, $regions)) {
return true;
}
}*/
}
return false;
}
}
?>
PK�"�[�#o,,models/fields/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�#o,,models/fields/modal/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[d=E09(9()models/fields/modal/phocacartcategory.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('JPATH_BASE') or die;
use Joomla\CMS\Language\LanguageHelper;
class JFormFieldModal_Phocacartcategory extends JFormField
{
protected $type = 'Modal_Phocacartcategory';
protected function getInput()
{
$allowNew = ((string) $this->element['new'] ==
'true');
$allowEdit = ((string) $this->element['edit'] ==
'true');
$allowClear = ((string) $this->element['clear'] !=
'false');
$allowSelect = ((string) $this->element['select'] !=
'false');
$allowPropagate = ((string) $this->element['propagate'] ==
'true');
$languages = LanguageHelper::getContentLanguages(array(0, 1));
// Load language
JFactory::getLanguage()->load('com_phocacart',
JPATH_ADMINISTRATOR);
// The active category id field.
$value = (int) $this->value > 0 ? (int) $this->value :
'';
// Create the modal id.
$modalId = 'Phocacartcategory_' . $this->id;
// Add the modal field script to the document head.
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework');
Joomla\CMS\HTML\HTMLHelper::_('script',
'system/modal-fields.js', array('version' =>
'auto', 'relative' => true));
// Script to proxy the select modal function to the modal-fields.js file.
if ($allowSelect)
{
static $scriptSelect = null;
if (is_null($scriptSelect))
{
$scriptSelect = array();
}
if (!isset($scriptSelect[$this->id]))
{
JFactory::getDocument()->addScriptDeclaration("
function jSelectPhocacartcategory_" . $this->id . "(id,
title, object) {
window.processModalSelect('Phocacartcategory', '"
. $this->id . "', id, title, '', object);
}
");
JText::script('JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED');
$scriptSelect[$this->id] = true;
}
}
// Setup variables for display.
$linkCategories =
'index.php?option=com_phocacart&view=phocacartcategories&layout=modal&tmpl=component&'
. JSession::getFormToken() . '=1';
$linkCategory =
'index.php?option=com_phocacart&view=phocacartcategory&layout=modal&tmpl=component&'
. JSession::getFormToken() . '=1';
$modalTitle = JText::_('COM_PHOCACART_CHANGE_CATEGORY');
if (isset($this->element['language']))
{
$linkCategories .= '&forcedLanguage=' .
$this->element['language'];
$linkCategory .= '&forcedLanguage=' .
$this->element['language'];
$modalTitle .= ' — ' .
$this->element['label'];
}
$urlSelect = $linkCategories .
'&function=jSelectPhocacartcategory_' . $this->id;
$urlEdit = $linkCategory .
'&task=phocacartcategory.edit&id=\' +
document.getElementById("' . $this->id .
'_id").value + \'';
$urlNew = $linkCategory .
'&task=phocacartcategory.add';
if ($value)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('title'))
->from($db->quoteName('#__phocacart_categories'))
->where($db->quoteName('id') . ' = ' . (int)
$value);
$db->setQuery($query);
try
{
$title = $db->loadResult();
}
catch (RuntimeException $e)
{
throw new Exception($e->getMessage(), 500);
}
}
$title = empty($title) ?
JText::_('COM_PHOCACART_SELECT_A_CATEGORY') :
htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
// The current category display field.
$html = '<span class="input-append">';
$html .= '<input class="input-medium" id="' .
$this->id . '_name" type="text" value="' .
$title . '" disabled="disabled" size="35"
/>';
// Select category button
if ($allowSelect)
{
$html .= '<a'
. ' class="btn hasTooltip' . ($value ? '
hidden' : '') . '"'
. ' id="' . $this->id . '_select"'
. ' data-toggle="modal"'
. ' role="button"'
. ' href="#ModalSelect' . $modalId . '"'
. ' title="' .
JHtml::tooltipText('COM_PHOCACART_CHANGE_CATEGORY') .
'">'
. '<span class="icon-file"
aria-hidden="true"></span> ' .
JText::_('JSELECT')
. '</a>';
}
// New category button
if ($allowNew)
{
$html .= '<a'
. ' class="btn hasTooltip' . ($value ? '
hidden' : '') . '"'
. ' id="' . $this->id . '_new"'
. ' data-toggle="modal"'
. ' role="button"'
. ' href="#ModalNew' . $modalId . '"'
. ' title="' .
JHtml::tooltipText('COM_PHOCACART_NEW_CATEGORY') .
'">'
. '<span class="icon-new"
aria-hidden="true"></span> ' .
JText::_('JACTION_CREATE')
. '</a>';
}
// Edit category button
if ($allowEdit)
{
$html .= '<a'
. ' class="btn hasTooltip' . ($value ? '' :
' hidden') . '"'
. ' id="' . $this->id . '_edit"'
. ' data-toggle="modal"'
. ' role="button"'
. ' href="#ModalEdit' . $modalId . '"'
. ' title="' .
JHtml::tooltipText('COM_PHOCACART_EDIT_CATEGORY') .
'">'
. '<span class="icon-edit"
aria-hidden="true"></span> ' .
JText::_('JACTION_EDIT')
. '</a>';
}
// Clear category button
if ($allowClear)
{
$html .= '<a'
. ' class="btn' . ($value ? '' : '
hidden') . '"'
. ' id="' . $this->id . '_clear"'
. ' href="#"'
. ' onclick="window.processModalParent(\'' .
$this->id . '\'); return false;">'
. '<span class="icon-remove"
aria-hidden="true"></span>' .
JText::_('JCLEAR')
. '</a>';
}
// Propagate category button
if ($allowPropagate && count($languages) > 2)
{
// Strip off language tag at the end
$tagLength = (int) strlen($this->element['language']);
$callbackFunctionStem = substr("jSelectPhocacartcategory_" .
$this->id, 0, -$tagLength);
$html .= '<a'
. ' class="btn hasTooltip' . ($value ? '' :
' hidden') . '"'
. ' id="' . $this->id . '_propagate"'
. ' href="#"'
. ' title="' .
JHtml::tooltipText('JGLOBAL_ASSOCIATIONS_PROPAGATE_TIP') .
'"'
. ' onclick="Joomla.propagateAssociation(\'' .
$this->id . '\', \'' . $callbackFunctionStem .
'\');">'
. '<span class="icon-refresh"
aria-hidden="true"></span>' .
JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_BUTTON')
. '</a>';
}
$html .= '</span>';
// Select category modal
if ($allowSelect)
{
$html .= Joomla\CMS\HTML\HTMLHelper::_(
'bootstrap.renderModal',
'ModalSelect' . $modalId,
array(
'title' => $modalTitle,
'url' => $urlSelect,
'height' => '400px',
'width' => '800px',
'bodyHeight' => '70',
'modalWidth' => '80',
'footer' => '<a role="button"
class="btn" data-dismiss="modal"
aria-hidden="true">' .
JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</a>',
)
);
}
// New category modal
// phocacartcategory-form => adminForm
if ($allowNew)
{
$html .= Joomla\CMS\HTML\HTMLHelper::_(
'bootstrap.renderModal',
'ModalNew' . $modalId,
array(
'title' =>
JText::_('COM_PHOCACART_NEW_CATEGORY'),
'backdrop' => 'static',
'keyboard' => false,
'closeButton' => false,
'url' => $urlNew,
'height' => '400px',
'width' => '800px',
'bodyHeight' => '70',
'modalWidth' => '80',
'footer' => '<a role="button"
class="btn" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \''
. $this->id . '\', \'add\',
\'phocacartcategory\', \'cancel\',
\'adminForm\', \'jform_id\',
\'jform_title\'); return false;">'
. JText::_('JLIB_HTML_BEHAVIOR_CLOSE') .
'</a>'
. '<a role="button" class="btn
btn-primary" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \''
. $this->id . '\', \'add\',
\'phocacartcategory\', \'save\',
\'adminForm\', \'jform_id\',
\'jform_title\'); return false;">'
. JText::_('JSAVE') . '</a>'
. '<a role="button" class="btn
btn-success" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \''
. $this->id . '\', \'add\',
\'phocacartcategory\', \'apply\',
\'adminForm\', \'jform_id\',
\'jform_title\'); return false;">'
. JText::_('JAPPLY') . '</a>',
)
);
}
// Edit category modal.
// phocacartcategory-form => adminForm
if ($allowEdit)
{
$html .= Joomla\CMS\HTML\HTMLHelper::_(
'bootstrap.renderModal',
'ModalEdit' . $modalId,
array(
'title' =>
JText::_('COM_PHOCACART_EDIT_CATEGORY'),
'backdrop' => 'static',
'keyboard' => false,
'closeButton' => false,
'url' => $urlEdit,
'height' => '400px',
'width' => '800px',
'bodyHeight' => '70',
'modalWidth' => '80',
'footer' => '<a role="button"
class="btn" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \'' .
$this->id
. '\', \'edit\',
\'phocacartcategory\', \'cancel\',
\'adminForm\', \'jform_id\',
\'jform_title\'); return false;">'
. JText::_('JLIB_HTML_BEHAVIOR_CLOSE') .
'</a>'
. '<a role="button" class="btn
btn-primary" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \''
. $this->id . '\', \'edit\',
\'phocacartcategory\', \'save\',
\'adminForm\', \'jform_id\',
\'jform_title\'); return false;">'
. JText::_('JSAVE') . '</a>'
. '<a role="button" class="btn
btn-success" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \''
. $this->id . '\', \'edit\',
\'phocacartcategory\', \'apply\',
\'adminForm\', \'jform_id\',
\'jform_title\'); return false;">'
. JText::_('JAPPLY') . '</a>',
)
);
}
// Note: class='required' for client side validation.
$class = $this->required ? ' class="required
modal-value"' : '';
$html .= '<input type="hidden" id="' .
$this->id . '_id"' . $class . '
data-required="' . (int) $this->required . '"
name="' . $this->name
. '" data-text="' .
htmlspecialchars(JText::_('COM_PHOCACART_SELECT_A_CATEGORY',
true), ENT_COMPAT, 'UTF-8') . '" value="' .
$value . '" />';
return $html;
}
/**
* Method to get the field label markup.
*
* @return string The field label markup.
*
* @since 3.4
*/
protected function getLabel()
{
return str_replace($this->id, $this->id . '_id',
parent::getLabel());
}
}
PK�"�[��$��'�'%models/fields/modal/phocacartitem.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('JPATH_BASE') or die;
use Joomla\CMS\Language\LanguageHelper;
class JFormFieldModal_Phocacartitem extends JFormField
{
protected $type = 'Modal_Phocacartitem';
protected function getInput()
{
$allowNew = ((string) $this->element['new'] ==
'true');
$allowEdit = ((string) $this->element['edit'] ==
'true');
$allowClear = ((string) $this->element['clear'] !=
'false');
$allowSelect = ((string) $this->element['select'] !=
'false');
$allowPropagate = ((string) $this->element['propagate'] ==
'true');
$languages = LanguageHelper::getContentLanguages(array(0, 1));
// Load language
JFactory::getLanguage()->load('com_phocacart',
JPATH_ADMINISTRATOR);
// The active product id field.
$value = (int) $this->value > 0 ? (int) $this->value :
'';
// Create the modal id.
$modalId = 'Phocacartitem_' . $this->id;
// Add the modal field script to the document head.
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework');
Joomla\CMS\HTML\HTMLHelper::_('script',
'system/modal-fields.js', array('version' =>
'auto', 'relative' => true));
// Script to proxy the select modal function to the modal-fields.js file.
if ($allowSelect)
{
static $scriptSelect = null;
if (is_null($scriptSelect))
{
$scriptSelect = array();
}
if (!isset($scriptSelect[$this->id]))
{
JFactory::getDocument()->addScriptDeclaration("
function jSelectPhocacartitem_" . $this->id . "(id, title,
object) {
window.processModalSelect('Phocacartitem', '" .
$this->id . "', id, title, '', object);
}
");
JText::script('JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED');
$scriptSelect[$this->id] = true;
}
}
// Setup variables for display.
$linkProducts =
'index.php?option=com_phocacart&view=phocacartitems&layout=modal&tmpl=component&'
. JSession::getFormToken() . '=1';
$linkProduct =
'index.php?option=com_phocacart&view=phocacartitem&layout=modal&tmpl=component&'
. JSession::getFormToken() . '=1';
$modalTitle = JText::_('COM_PHOCACART_CHANGE_PRODUCT');
if (isset($this->element['language']))
{
$linkProducts .= '&forcedLanguage=' .
$this->element['language'];
$linkProduct .= '&forcedLanguage=' .
$this->element['language'];
$modalTitle .= ' — ' .
$this->element['label'];
}
$urlSelect = $linkProducts .
'&function=jSelectPhocacartitem_' . $this->id;
$urlEdit = $linkProduct .
'&task=phocacartitem.edit&id=\' +
document.getElementById("' . $this->id .
'_id").value + \'';
$urlNew = $linkProduct . '&task=phocacartitem.add';
if ($value)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('title'))
->from($db->quoteName('#__phocacart_products'))
->where($db->quoteName('id') . ' = ' . (int)
$value);
$db->setQuery($query);
try
{
$title = $db->loadResult();
}
catch (RuntimeException $e)
{
throw new Exception($e->getMessage(), 500);
}
}
$title = empty($title) ?
JText::_('COM_PHOCACART_SELECT_A_PRODUCT') :
htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
// The current product display field.
$html = '<span class="input-append">';
$html .= '<input class="input-medium" id="' .
$this->id . '_name" type="text" value="' .
$title . '" disabled="disabled" size="35"
/>';
// Select product button
if ($allowSelect)
{
$html .= '<a'
. ' class="btn hasTooltip' . ($value ? '
hidden' : '') . '"'
. ' id="' . $this->id . '_select"'
. ' data-toggle="modal"'
. ' role="button"'
. ' href="#ModalSelect' . $modalId . '"'
. ' title="' .
JHtml::tooltipText('COM_PHOCACART_CHANGE_PRODUCT') .
'">'
. '<span class="icon-file"
aria-hidden="true"></span> ' .
JText::_('JSELECT')
. '</a>';
}
// New product button
if ($allowNew)
{
$html .= '<a'
. ' class="btn hasTooltip' . ($value ? '
hidden' : '') . '"'
. ' id="' . $this->id . '_new"'
. ' data-toggle="modal"'
. ' role="button"'
. ' href="#ModalNew' . $modalId . '"'
. ' title="' .
JHtml::tooltipText('COM_PHOCACART_NEW_PRODUCT') .
'">'
. '<span class="icon-new"
aria-hidden="true"></span> ' .
JText::_('JACTION_CREATE')
. '</a>';
}
// Edit product button
if ($allowEdit)
{
$html .= '<a'
. ' class="btn hasTooltip' . ($value ? '' :
' hidden') . '"'
. ' id="' . $this->id . '_edit"'
. ' data-toggle="modal"'
. ' role="button"'
. ' href="#ModalEdit' . $modalId . '"'
. ' title="' .
JHtml::tooltipText('COM_PHOCACART_EDIT_PRODUCT') .
'">'
. '<span class="icon-edit"
aria-hidden="true"></span> ' .
JText::_('JACTION_EDIT')
. '</a>';
}
// Clear product button
if ($allowClear)
{
$html .= '<a'
. ' class="btn' . ($value ? '' : '
hidden') . '"'
. ' id="' . $this->id . '_clear"'
. ' href="#"'
. ' onclick="window.processModalParent(\'' .
$this->id . '\'); return false;">'
. '<span class="icon-remove"
aria-hidden="true"></span>' .
JText::_('JCLEAR')
. '</a>';
}
// Propagate product button
if ($allowPropagate && count($languages) > 2)
{
// Strip off language tag at the end
$tagLength = (int) strlen($this->element['language']);
$callbackFunctionStem = substr("jSelectPhocacartitem_" .
$this->id, 0, -$tagLength);
$html .= '<a'
. ' class="btn hasTooltip' . ($value ? '' :
' hidden') . '"'
. ' id="' . $this->id . '_propagate"'
. ' href="#"'
. ' title="' .
JHtml::tooltipText('JGLOBAL_ASSOCIATIONS_PROPAGATE_TIP') .
'"'
. ' onclick="Joomla.propagateAssociation(\'' .
$this->id . '\', \'' . $callbackFunctionStem .
'\');">'
. '<span class="icon-refresh"
aria-hidden="true"></span>' .
JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_BUTTON')
. '</a>';
}
$html .= '</span>';
// Select product modal
if ($allowSelect)
{
$html .= Joomla\CMS\HTML\HTMLHelper::_(
'bootstrap.renderModal',
'ModalSelect' . $modalId,
array(
'title' => $modalTitle,
'url' => $urlSelect,
'height' => '400px',
'width' => '800px',
'bodyHeight' => '70',
'modalWidth' => '80',
'footer' => '<a role="button"
class="btn" data-dismiss="modal"
aria-hidden="true">' .
JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</a>',
)
);
}
// New product modal
// phocacartitem-form => adminForm
if ($allowNew)
{
$html .= Joomla\CMS\HTML\HTMLHelper::_(
'bootstrap.renderModal',
'ModalNew' . $modalId,
array(
'title' =>
JText::_('COM_PHOCACART_NEW_PRODUCT'),
'backdrop' => 'static',
'keyboard' => false,
'closeButton' => false,
'url' => $urlNew,
'height' => '400px',
'width' => '800px',
'bodyHeight' => '70',
'modalWidth' => '80',
'footer' => '<a role="button"
class="btn" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \''
. $this->id . '\', \'add\',
\'phocacartitem\', \'cancel\', \'adminForm\',
\'jform_id\', \'jform_title\'); return
false;">'
. JText::_('JLIB_HTML_BEHAVIOR_CLOSE') .
'</a>'
. '<a role="button" class="btn
btn-primary" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \''
. $this->id . '\', \'add\',
\'phocacartitem\', \'save\', \'adminForm\',
\'jform_id\', \'jform_title\'); return
false;">'
. JText::_('JSAVE') . '</a>'
. '<a role="button" class="btn
btn-success" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \''
. $this->id . '\', \'add\',
\'phocacartitem\', \'apply\', \'adminForm\',
\'jform_id\', \'jform_title\'); return
false;">'
. JText::_('JAPPLY') . '</a>',
)
);
}
// Edit product modal.
// phocacartitem-form => adminForm
if ($allowEdit)
{
$html .= Joomla\CMS\HTML\HTMLHelper::_(
'bootstrap.renderModal',
'ModalEdit' . $modalId,
array(
'title' =>
JText::_('COM_PHOCACART_EDIT_PRODUCT'),
'backdrop' => 'static',
'keyboard' => false,
'closeButton' => false,
'url' => $urlEdit,
'height' => '400px',
'width' => '800px',
'bodyHeight' => '70',
'modalWidth' => '80',
'footer' => '<a role="button"
class="btn" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \'' .
$this->id
. '\', \'edit\', \'phocacartitem\',
\'cancel\', \'adminForm\', \'jform_id\',
\'jform_title\'); return false;">'
. JText::_('JLIB_HTML_BEHAVIOR_CLOSE') .
'</a>'
. '<a role="button" class="btn
btn-primary" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \''
. $this->id . '\', \'edit\',
\'phocacartitem\', \'save\', \'adminForm\',
\'jform_id\', \'jform_title\'); return
false;">'
. JText::_('JSAVE') . '</a>'
. '<a role="button" class="btn
btn-success" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \''
. $this->id . '\', \'edit\',
\'phocacartitem\', \'apply\', \'adminForm\',
\'jform_id\', \'jform_title\'); return
false;">'
. JText::_('JAPPLY') . '</a>',
)
);
}
// Note: class='required' for client side validation.
$class = $this->required ? ' class="required
modal-value"' : '';
$html .= '<input type="hidden" id="' .
$this->id . '_id"' . $class . '
data-required="' . (int) $this->required . '"
name="' . $this->name
. '" data-text="' .
htmlspecialchars(JText::_('COM_PHOCACART_SELECT_A_PRODUCT',
true), ENT_COMPAT, 'UTF-8') . '" value="' .
$value . '" />';
return $html;
}
/**
* Method to get the field label markup.
*
* @return string The field label markup.
*
* @since 3.4
*/
protected function getLabel()
{
return str_replace($this->id, $this->id . '_id',
parent::getLabel());
}
}
PK�"�[!{)!models/fields/phocaattributes.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
class JFormFieldPhocaAttributes extends JFormField
{
protected $type = 'PhocaAttributes';
protected function getInput() {
$id = (int) $this->form->getValue('id');
$activeAttributes = array();
if ((int)$id > 0) {
$activeAttributes = PhocacartAttribute::getAttributesById($id, 1);
}
return
PhocacartAttribute::getAllAttributesSelectBox($this->name.'[]',
$this->id, $activeAttributes, NULL,'id' );
}
}
?>PK�"�[���+II#models/fields/phocacartcategory.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
if (! class_exists('PhocacartCategory')) {
require_once(
JPATH_ADMINISTRATOR.'/components/com_phocacart/libraries/phocacart/category/category.php');
}
if (! class_exists('PhocacartCategoryMultiple')) {
require_once(
JPATH_ADMINISTRATOR.'/components/com_phocacart/libraries/phocacart/category/multiple.php');
}
$lang = JFactory::getLanguage();
$lang->load('com_phocacart');
class JFormFieldPhocacartCategory extends JFormField
{
protected $type = 'PhocacartCategory';
protected function getInput() {
$db = JFactory::getDBO();
//$javascript = '';
$required = ((string) $this->element['required'] ==
'true') ? TRUE : FALSE;
$multiple = ((string) $this->element['multiple'] ==
'true') ? TRUE : FALSE;
$class = ((string) $this->element['class'] !=
'') ?
'class="'.$this->element['class'].'"'
: 'class="inputbox"';
$typeMethod = $this->element['typemethod'];
$categoryType = $this->element['categorytype'];// 0 all, 1
... online shop, 2 ... pos
$attr = '';
$attr .= $class . ' ';
if ($multiple) {
$attr .= 'size="4" multiple="multiple"
';
}
if ($required) {
$attr .= 'required aria-required="true" ';
}
$attr .= $this->element['onchange'] ? '
onchange="'.(string)
$this->element['onchange'].'" ' : '
';
//$attr .= $javascript . ' ';
// Multiple load more values
$activeCats = array();
$id = 0;
// Active cats can be selected in administration item view
// but this function is even called in module so ignore this part for
module administration
if ($multiple && $this->form->getName() ==
'com_phocacart.phocacartitem') {
$id = (int) $this->form->getValue('id');// Product ID
if ((int)$id > 0) {
$activeCats = PhocacartCategoryMultiple::getCategories($id, 1);
}
}
// Filter language
//$whereLang = '';
$wheres = array();
if (!empty($this->element['language'])) {
if (strpos($this->element['language'],
',') !== false)
{
$language = implode(',',
$db->quote(explode(',',
$this->element['language'])));
}
else
{
$language =
$db->quote($this->element['language']);
}
$wheres[] = '
'.$db->quoteName('a.language') . ' IN (' .
$language . ')';
}
//build the list of categories
$query = 'SELECT a.title AS text, a.id AS value, a.parent_id as
parentid'
. ' FROM #__phocacart_categories AS a';
// don't lose information about category when it will be
unpublished - you should still be able to edit product with such category
in administration
//. ' WHERE a.published = 1';
switch($categoryType) {
case 1:
$wheres[] = ' a.type IN (0,1)';
break;
case 2:
$wheres[] = ' a.type IN (0,2)';
break;
case 0:
default:
break;
}
$query .= ( count( $wheres ) ? ' WHERE '. implode( ' AND
', $wheres ) : '' );
$query .= ' ORDER BY a.ordering';
$db->setQuery( $query );
$data = $db->loadObjectList();
// TO DO - check for other views than category edit
$view = JFactory::getApplication()->input->get( 'view'
);
$catId = -1;
if ($view == 'phocacartcategory') {
$id = $this->form->getValue('id'); // id of current
category
if ((int)$id > 0) {
$catId = $id;
}
}
$tree = array();
$text = '';
$tree = PhocacartCategory::CategoryTreeOption($data, $tree, 0, $text,
$catId);
if ($multiple) {
if ($typeMethod == 'allnone') {
array_unshift($tree,
Joomla\CMS\HTML\HTMLHelper::_('select.option', '0',
JText::_('COM_PHOCACART_NONE'), 'value',
'text'));
array_unshift($tree,
Joomla\CMS\HTML\HTMLHelper::_('select.option', '-1',
JText::_('COM_PHOCACART_ALL'), 'value',
'text'));
}
} else {
array_unshift($tree,
Joomla\CMS\HTML\HTMLHelper::_('select.option', '',
'- '.JText::_('COM_PHOCACART_SELECT_CATEGORY').'
-', 'value', 'text'));
}
if (!empty($activeCats)) {
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$tree, $this->name, $attr, 'value', 'text',
$activeCats, $this->id );
} else {
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$tree, $this->name, $attr, 'value', 'text',
$this->value, $this->id );
}
}
}
?>
PK�"�[�K]muu$models/fields/phocacartcountries.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
class JFormFieldPhocaCartCountries extends JFormField
{
protected $type = 'PhocaCartCountries';
protected function getInput() {
$id = (int) $this->form->getValue('id');
if (isset($this->element['table'])) {
switch (strtolower($this->element['table'])) {
case "payment":
$table = 'payment';
break;
case "zone":
$table = 'zone';
break;
case "shipping":
default:
$table = 'shipping';
break;
}
} else {
$table = 'shipping';
}
$activeCountries = array();
if ((int)$id > 0) {
$activeCountries = PhocacartCountry::getCountries($id, 1, $table);
}
return
PhocacartCountry::getAllCountriesSelectBox($this->name.'[]',
$this->id, $activeCountries, NULL,'id' );
}
}
?>PK�"�[�mm"models/fields/phocacartcountry.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
class JFormFieldPhocacartCountry extends JFormField
{
protected $type = 'PhocacartCountry';
protected function getInput() {
$db = JFactory::getDBO();
$attr = '';
$attr .= $this->element['size'] ? '
size="'.(int)
$this->element['size'].'"' : '';
$attr .= $this->element['maxlength'] ? '
maxlength="'.(int)
$this->element['maxlength'].'"' :
'';
$attr .= $this->element['class'] ? '
class="'.(string)
$this->element['class'].'"' : '';
$attr .= ((string) $this->element['readonly'] ==
'true') ? ' readonly="readonly"' :
'';
$attr .= ((string) $this->element['disabled'] ==
'true') ? ' disabled="disabled"' :
'';
$attr .= $this->element['onchange'] ? '
onchange="'.(string)
$this->element['onchange'].'" ' : '
';
$multiple = ((string) $this->element['multiple'] ==
'true') ? TRUE : FALSE;
$manager = $this->element['manager'] ?
$this->element['manager'] : '';
//build the list of categories
$query = 'SELECT a.title AS text, a.id AS value'
. ' FROM #__phocacart_countries AS a'
. ' WHERE a.published = 1'
. ' ORDER BY a.ordering';
$db->setQuery( $query );
$data = $db->loadObjectList();
$required = ((string) $this->element['required'] ==
'true') ? TRUE : FALSE;
array_unshift($data,
Joomla\CMS\HTML\HTMLHelper::_('select.option', '',
'- '.JText::_('COM_PHOCACART_SELECT_COUNTRY').'
-', 'value', 'text'));
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$data, $this->name, $attr, 'value', 'text',
$this->value, $this->id );
}
}
?>
PK�"�[N%��%models/fields/phocacartextensions.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
class JFormFieldPhocacartExtensions extends JFormField
{
protected $type = 'PhocacartExtensions';
protected function getInput() {
$attr = '';
$attr .= $this->element['size'] ? '
size="' . (int)$this->element['size'] .
'"' : '';
$attr .= $this->element['maxlength'] ? '
maxlength="' . (int)$this->element['maxlength'] .
'"' : '';
$attr .= $this->element['class'] ? '
class="' . (string)$this->element['class'] .
'"' : '';
$attr .= ((string)$this->element['readonly'] ==
'true') ? ' readonly="readonly"' :
'';
$attr .= ((string)$this->element['disabled'] ==
'true') ? ' disabled="disabled"' :
'';
$attr .= $this->element['onchange'] ? '
onchange="' . (string)$this->element['onchange'] .
'" ' : ' ';
// Default value is set in XML filter_phocacartextensions.xml
$extensions = PhocacartUtilsSettings::getExtenstionsArray();
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$extensions, $this->name, $attr , 'value', 'text',
$this->value, $this->id );
}
}
?>
PK�"�[��77models/fields/phocacartfeed.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
class JFormFieldPhocacartFeed extends JFormField
{
protected $type = 'PhocacartFeed';
protected function getInput() {
$db = JFactory::getDBO();
//build the list of categories
$query = 'SELECT a.title AS text, a.id AS value'
. ' FROM #__phocacart_feeds AS a'
. ' WHERE a.published = 1'
. ' ORDER BY a.ordering';
$db->setQuery( $query );
$data = $db->loadObjectList();
// $view = JFactory::getApplication()->input->get( 'view'
);
//$required = ((string) $this->element['required'] ==
'true') ? TRUE : FALSE;
$attr = '';
$attr .= $this->required ? ' required
aria-required="true"' : '';
$attr .= ' class="inputbox"';
array_unshift($data,
Joomla\CMS\HTML\HTMLHelper::_('select.option', '',
'- '.JText::_('COM_PHOCACART_SELECT_XML_FEED').'
-', 'value', 'text'));
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$data, $this->name, trim($attr), 'value', 'text',
$this->value, $this->id );
}
}
?>
PK�"�[Uy�bb!models/fields/phocacartgroups.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
class JFormFieldPhocacartGroups extends JFormField
{
protected $type = 'PhocacartGroups';
protected function getInput() {
$tableType = (string)$this->element['table'];
switch($tableType) {
case 1:
// User table by user_id not by id
$id = (int) $this->form->getValue('user_id');
break;
default:
$id = (int) $this->form->getValue('id');
break;
}
$activeGroups = array();
if ((int)$id > 0) {
$activeGroups = PhocacartGroup::getGroupsById($id, $tableType, 1);
}
if (empty($activeGroups)) {
$activeGroups = PhocacartGroup::getDefaultGroup(1);
}
return
PhocacartGroup::getAllGroupsSelectBox($this->name.'[]',
$this->id, $activeGroups, NULL, 'id' );
}
}
?>PK�"�[ł���'models/fields/phocacartlayoutplugin.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\HTML\HTMLHelper;
defined('_JEXEC') or die();
JLoader::registerPrefix('Phocacart', JPATH_ADMINISTRATOR .
'/components/com_phocacart/libraries/phocacart');
class JFormFieldPhocaCartLayoutPlugin extends JFormField
{
protected $type = 'PhocaCartLayoutPlugin';
protected function getInput() {
$typeview = $this->element['typeview'] ?
(string)$this->element['typeview'] : '';
$plugin = array();
$plugin['name'] = '';
$plugin['group'] = 'pcl';
$plugin['title'] = 'Phoca Cart Layout';
$plugin['selecttitle'] =
JText::_('COM_PHOCACART_SELECT_LAYOUT_PLUGIN');
$plugin['returnform'] = 1;
$plugins = PhocacartPlugin::getPluginMethods($plugin);
$pluginsA = array();
$i = 0;
if (!empty($plugins)) {
foreach ($plugins as $k => $v) {
if (isset($v['value']) && $v['value'] ==
'' && $i == 0) {
// Filter to "Select Option" Text
$pluginsA[] = $v;
} else if (isset($v['value'])) {
// Filter to typeview plugins only (e.g. items)
$pluginPart = explode('_', $v['value']);
if (isset($pluginPart[0]) && $pluginPart[0] == $typeview) {
$pluginsA[] = $v;
}
}
$i++;
}
}
return HTMLHelper::_('select.genericlist', $pluginsA,
$this->name, 'class="inputbox"', 'value',
'text', $this->value, $this->id );
}
}
?>
PK�"�[��� � &models/fields/phocacartmailinglist.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
class JFormFieldPhocaCartMailingList extends JFormField
{
protected $type = 'PhocaCartMailingList';
protected function getInput()
{
// Initialize variables.
$html = array();
// Initialize some field attributes.
$attr = '';
$attr .= $this->element['size'] ? '
size="' . (int)$this->element['size'] .
'"' : '';
$attr .= $this->element['maxlength'] ? '
maxlength="' . (int)$this->element['maxlength'] .
'"' : '';
$attr .= $this->element['class'] ? '
class="' . (string)$this->element['class'] .
'"' : '';
$attr .= ((string)$this->element['readonly'] ==
'true') ? ' readonly="readonly"' :
'';
$attr .= ((string)$this->element['disabled'] ==
'true') ? ' disabled="disabled"' :
'';
$attr .= $this->element['onchange'] ? '
onchange="' . (string)$this->element['onchange'] .
'" ' : ' ';
$multiple = ((string)$this->element['multiple'] ==
'true') ? TRUE : FALSE;
$manager = $this->element['manager'] ?
(string)$this->element['manager'] : '';
$value = $this->value;
// PHOCA EMAIL COMPONENT NEEDED
$comPhocaemail =
PhocacartUtilsExtension::getExtensionInfo('com_phocaemail');
if ($comPhocaemail) {
$order = 'ordering ASC';
$db = JFactory::getDBO();
$query = 'SELECT a.id AS value, a.title AS text'
. ' FROM #__phocaemail_lists AS a'
. ' WHERE a.published = 1'
. ' ORDER BY ' . $order;
$db->setQuery($query);
$lists = $db->loadObjectList();
if ($multiple) {
$name = $this->name;
$attr .= ' multiple="multiple"';
} else {
$name = $this->name;
}
} else {
$lists = array();
$name = $this->name;
}
$html =
Joomla\CMS\HTML\HTMLHelper::_('select.genericlist', $lists,
$name, $attr, 'value', 'text', $value,
'id');
return $html;
}
}
?>
PK�"�[��v�GG#models/fields/phocacartordering.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('JPATH_BASE') or die();
jimport('joomla.html.html');
jimport('joomla.form.formfield');
class JFormFieldPhocacartOrdering extends JFormField
{
protected $type = 'PhocacartOrdering';
protected function getInput() {
// Initialize variables.
$html = array();
$attr = '';
// Get some field values from the form.
$id = (int) $this->form->getValue('id');
if ($this->element['table']) {
switch (strtolower($this->element['table'])) {
case "payment":
$whereLabel = '';
$whereValue = '';
$table = '#__phocacart_payment_methods';
break;
case "status":
$whereLabel = '';
$whereValue = '';
$table = '#__phocacart_order_statuses';
break;
case "stockstatus":
$whereLabel = '';
$whereValue = '';
$table = '#__phocacart_stock_statuses';
break;
case "country":
$whereLabel = '';
$whereValue = '';
$table = '#__phocacart_countries';
break;
case "region":
$whereLabel = '';
$whereValue = '';
$table = '#__phocacart_regions';
break;
case "currency":
$whereLabel = '';
$whereValue = '';
$table = '#__phocacart_currencies';
break;
case "tag":
case "label":
$whereLabel = '';
$whereValue = '';
$table = '#__phocacart_tags';
break;
case "manufacturer":
$whereLabel = '';
$whereValue = '';
$table = '#__phocacart_manufacturers';
break;
case "shipping":
$whereLabel = '';
$whereValue = '';
$table = '#__phocacart_shipping_methods';
break;
case "attribute":
default:
$whereLabel = '';
$whereValue = '';
$table = '#__phocacart_attributes';
break;
case "formfield":
$whereLabel = '';
$whereValue = '';
$table = '#__phocacart_form_fields';
break;
case "user":
$whereLabel = '';
$whereValue = '';
$table = '#__phocacart_users';
break;
case "order":
$whereLabel = '';
$whereValue = '';
$table = '#__phocacart_orders';
break;
case "review":
$whereLabel = '';
$whereValue = '';
$table = '#__phocacart_reviews';
break;
case "question":
$whereLabel = '';
$whereValue = '';
$table = '#__phocacart_questions';
break;
case "submititem":
$whereLabel = '';
$whereValue = '';
$table = '#__phocacart_submit_items';
break;
case "wishlist":
$whereLabel = '';
$whereValue = '';
$table = '#__phocacart_wishlists';
break;
case "category":
$whereLabel = '';
$whereValue = '';
$table = '#__phocacart_categories';
break;
}
} else {
$whereLabel = 'catid';
$whereValue = (int) $this->form->getValue('catid');
$table = '#__phocacart';
}
// Initialize some field attributes.
$attr .= $this->element['class'] ? '
class="'.(string)
$this->element['class'].'"' : '';
$attr .= ((string) $this->element['disabled'] ==
'true') ? ' disabled="disabled"' :
'';
$attr .= $this->element['size'] ? '
size="'.(int)
$this->element['size'].'"' : '';
// Initialize JavaScript field attributes.
$attr .= $this->element['onchange'] ? '
onchange="'.(string)
$this->element['onchange'].'"' : '';
// Build the query for the ordering list.
$query = 'SELECT ordering AS value, title AS text' .
' FROM ' . $table;
if ($whereLabel != '') {
$query .= ' WHERE '.$whereLabel.' = ' . (int)
$whereValue;
}
$query .= ' ORDER BY ordering';
// Create a read-only list (no name) with a hidden input to store the
value.
if ((string) $this->element['readonly'] == 'true')
{
$html[] = Joomla\CMS\HTML\HTMLHelper::_('list.ordering',
'', $query, trim($attr), $this->value, $id ? 0 : 1);
$html[] = '<input type="hidden"
name="'.$this->name.'"
value="'.$this->value.'"/>';
}
// Create a regular list.
else {
$html[] = Joomla\CMS\HTML\HTMLHelper::_('list.ordering',
$this->name, $query, trim($attr), $this->value, $id ? 0 : 1);
}
return implode($html);
}
}
PK�"�[�9�8�
�
&models/fields/phocacartorderstatus.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
JLoader::registerPrefix('Phocacart', JPATH_ADMINISTRATOR .
'/components/com_phocacart/libraries/phocacart');
class JFormFieldPhocacartOrderstatus extends JFormField
{
protected $type = 'PhocacartOrderstatus';
protected function getInput() {
$javascript = '';
$required = ((string) $this->element['required'] ==
'true') ? TRUE : FALSE;
$multiple = ((string) $this->element['multiple'] ==
'true') ? TRUE : FALSE;
$type = isset($this->element['typemethod']) ?
(int)$this->element['typemethod'] : 0;
$attr = '';
$attr .= 'class="inputbox" ';
if ($multiple) {
$attr .= 'size="4" multiple="multiple"
';
}
if ($required) {
$attr .= 'required aria-required="true" ';
}
$attr .= $this->onchange ? ' onchange="' .
$this->onchange . '"' : '';
$attr .= $javascript . ' ';
if ($multiple) {
$db = JFactory::getDBO();
$query = 'SELECT a.title AS text, a.id AS value'
. ' FROM #__phocacart_order_statuses AS a'
. ' WHERE a.published = 1'
. ' ORDER BY a.ordering';
$db->setQuery( $query );
$data = $db->loadObjectList();
if (!empty($data)) {
foreach ($data as $k => $v) {
$data[$k]->text = JText::_($v->text);
}
}
array_unshift($data,
Joomla\CMS\HTML\HTMLHelper::_('select.option', '0',
JText::_('COM_PHOCACART_NONE'), 'value',
'text'));
array_unshift($data,
Joomla\CMS\HTML\HTMLHelper::_('select.option', '-1',
JText::_('COM_PHOCACART_ALL'), 'value',
'text'));
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$data, $this->name, $attr, 'value', 'text',
$this->value, $this->id );
} else {
$id = (int) $this->form->getValue('status_id');
if ($id < 1) {
$id = 1;// set default "pending"
}
$status = PhocacartOrderStatus::getStatus($id);
if ($type == 1) {
array_unshift($status['data'],
Joomla\CMS\HTML\HTMLHelper::_('select.option', 0,
JText::_('COM_PHOCACART_NO'), 'value',
'text'));
} else if ($type == 2) {
array_unshift($status['data'],
Joomla\CMS\HTML\HTMLHelper::_('select.option', '',
' - ' .
JText::_('COM_PHOCACART_OPTION_SELECT_ORDER_STATUS') . ' -
', 'value', 'text'));
}
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$status['data'], $this->name, $attr , 'value',
'text', $this->value, $this->id );
}
}
}
?>
PK�"�[�����$models/fields/phocacartparameter.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
if (!class_exists('PhocacartParameter')) {
require_once(JPATH_ADMINISTRATOR .
'/components/com_phocacart/libraries/phocacart/parameter/parameter.php');
}
$lang = JFactory::getLanguage();
$lang->load('com_phocacart');
class JFormFieldPhocacartParameter extends JFormField
{
protected $type = 'PhocacartParameter';
protected function getInput() {
//$activeId = (int) $this->form->getValue('id');
$attr = '';
$attr .= $this->element['size'] ? '
size="' . (int)$this->element['size'] .
'"' : '';
$attr .= $this->element['maxlength'] ? '
maxlength="' . (int)$this->element['maxlength'] .
'"' : '';
$attr .= $this->element['class'] ? '
class="' . (string)$this->element['class'] .
'"' : '';
$attr .= ((string)$this->element['readonly'] ==
'true') ? ' readonly="readonly"' :
'';
$attr .= ((string)$this->element['disabled'] ==
'true') ? ' disabled="disabled"' :
'';
$attr .= $this->element['onchange'] ? '
onchange="' . (string)$this->element['onchange'] .
'" ' : ' ';
$selectText = $this->element['typemethod'] &&
$this->element['typemethod'] == 1 ? 1 : 0;
return
PhocacartParameter::getAllParametersSelectBox($this->name, $this->id,
$this->value /*$activeId*/, $attr, 'id', $selectText);
}
}
?>
PK�"�[mU*models/fields/phocacartparametervalues.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
if (! class_exists('PhocacartParameter')) {
require_once(
JPATH_ADMINISTRATOR.'/components/com_phocacart/libraries/phocacart/parameter/parameter.php');
}
$lang = JFactory::getLanguage();
$lang->load('com_phocacart');
defined('_JEXEC') or die();
class JFormFieldPhocaCartParameterValues extends JFormField
{
protected $type = 'PhocaCartParameterValues';
protected function getInput() {
$id = (int) $this->form->getValue('id');
$parameterId = (int)$this->element['parameterid'];
$attr = $this->element['class'] ? '
class="'.(string)
$this->element['class'].'"' : '
class="inputbox"';
$attr .= $this->element['size'] ? '
size="'.(int)
$this->element['size'].'"' : '';
$attr .= ((string) $this->element['required'] ==
'true') ? ' required aria-required="true"' :
'';
$attr .= ((string) $this->element['multiple'] ==
'true') ? ' multiple="multiple"' :
'';
$activeParameters = array();
if ((int)$id > 0) {
$activeParameters = PhocacartParameter::getParameterValues($id,
$parameterId, 1);
}
return PhocacartParameter::getAllParameterValuesSelectBox($this->name,
$this->id, $parameterId, $activeParameters, $attr, 'a.id');
}
}
?>
PK�"�[lo��(models/fields/phocacartpaymentmethod.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
class JFormFieldPhocaCartPaymentMethod extends JFormField
{
protected $type = 'PhocacartPaymentMethod';
protected function getInput() {
$id = (int) $this->form->getValue('id');
$type = (int) $this->element['typemethod'];
$required = $this->element['required'];
$attr = 'class="inputbox"';
if ($required) {
$attr .= ' required aria-required="true" ';
}
switch ($type) {
case 2:
$typeIn = 'a.type IN (0,2)';
break;
case 1:
$typeIn = 'a.type IN (0,1)';
break;
default:
$typeIn = 'a.type IN (0)';
break;
}
$db =JFactory::getDBO();
$query = 'SELECT a.id AS value, a.title AS text'
.' FROM #__phocacart_payment_methods AS a'
.' WHERE '.$typeIn
.' AND published = 1'
.' ORDER BY a.id';
$db->setQuery($query);
$methods = $db->loadObjectList();
array_unshift($methods,
Joomla\CMS\HTML\HTMLHelper::_('select.option', '',
'-
'.JText::_('COM_PHOCACART_SELECT_PAYMENT_METHOD').'
-', 'value', 'text'));
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$methods, $this->name, $attr, 'value', 'text',
$this->value, $this->id );
}
}
?>
PK�"�[1%�cc"models/fields/phocacartregions.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
class JFormFieldPhocacartRegions extends JFormField
{
protected $type = 'PhocacartRegions';
protected function getInput() {
$id = (int) $this->form->getValue('id');
if (isset($this->element['table'])) {
switch (strtolower($this->element['table'])) {
case "payment":
$table = 'payment';
break;
case "zone":
$table = 'zone';
break;
case "shipping":
default:
$table = 'shipping';
break;
}
} else {
$table = 'shipping';
}
$activeRegions = array();
if ((int)$id > 0) {
$activeRegions = PhocacartRegion::getRegions($id, 1, $table);
}
return
PhocacartRegion::getAllRegionsSelectBox($this->name.'[]',
$this->id, $activeRegions, NULL,'id' );
}
}
?>PK�"�[�Kq�PP"models/fields/phocacartsection.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
class JFormFieldPhocacartSection extends JFormField
{
protected $type = 'PhocacartSection';
protected function getInput() {
$attr = '';
$attr .= $this->element['size'] ? '
size="' . (int)$this->element['size'] .
'"' : '';
$attr .= $this->element['maxlength'] ? '
maxlength="' . (int)$this->element['maxlength'] .
'"' : '';
$attr .= $this->element['class'] ? '
class="' . (string)$this->element['class'] .
'"' : '';
$attr .= ((string)$this->element['readonly'] ==
'true') ? ' readonly="readonly"' :
'';
$attr .= ((string)$this->element['disabled'] ==
'true') ? ' disabled="disabled"' :
'';
$attr .= $this->element['onchange'] ? '
onchange="' . (string)$this->element['onchange'] .
'" ' : ' ';
$required = ((string) $this->element['required'] ==
'true') ? TRUE : FALSE;
$db = JFactory::getDBO();
//build the list of categories
$query = 'SELECT a.title AS text, a.id AS value'
. ' FROM #__phocacart_sections AS a'
. ' WHERE a.published = 1'
. ' ORDER BY a.ordering';
$db->setQuery( $query );
$data = $db->loadObjectList();
if ($required) {
$attr .= ' required aria-required="true" ';
}
array_unshift($data,
Joomla\CMS\HTML\HTMLHelper::_('select.option', '',
'- '.JText::_('COM_PHOCACART_SELECT_SECTION').'
-', 'value', 'text'));
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$data, $this->name, $attr, 'value', 'text',
$this->value, $this->id );
}
}
?>
PK�"�[c)N/@@#models/fields/phocacartshipping.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
class JFormFieldPhocacartShipping extends JFormField
{
protected $type = 'PhocacartShipping';
protected function getInput() {
$id = (int) $this->form->getValue('id');
if (isset($this->element['table'])) {
switch (strtolower($this->element['table'])) {
case "payment":
$table = 'payment';
break;
case "shipping":
default:
$table = 'shipping';
break;
}
} else {
$table = 'shipping';
}
$activeMethods = array();
if ((int)$id > 0) {
$activeMethods = PhocacartShipping::getShippingMethods($id, 1, $table);
}
return
PhocacartShipping::getAllShippingMethodsSelectBox($this->name.'[]',
$this->id, $activeMethods, NULL,'id' );
}
}
?>PK�"�['�^�)models/fields/phocacartshippingmethod.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
class JFormFieldPhocaCartShippingMethod extends JFormField
{
protected $type = 'PhocacartShippingMethod';
protected function getInput() {
$id = (int) $this->form->getValue('id');
$type = (int)$this->element['typemethod'];
$required = $this->element['required'];
$attr = 'class="inputbox"';
if ($required) {
$attr .= ' required aria-required="true" ';
}
switch ($type) {
case 2:
$typeIn = 'a.type IN (0,2)';
break;
case 1:
$typeIn = 'a.type IN (0,1)';
break;
default:
$typeIn = 'a.type IN (0)';
break;
}
$db =JFactory::getDBO();
$query = 'SELECT a.id AS value, a.title AS text'
.' FROM #__phocacart_shipping_methods AS a'
.' WHERE '.$typeIn
.' AND published = 1'
.' ORDER BY a.id';
$db->setQuery($query);
$methods = $db->loadObjectList();
array_unshift($methods,
Joomla\CMS\HTML\HTMLHelper::_('select.option', '',
'-
'.JText::_('COM_PHOCACART_SELECT_SHIPPING_METHOD').'
-', 'value', 'text'));
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$methods, $this->name, $attr, 'value', 'text',
$this->value, $this->id );
}
}
?>
PK�"�[�T$NN.models/fields/phocacartspecificationgroups.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
class JFormFieldPhocacartSpecificationGroups extends JFormField
{
protected $type = 'PhocacartSpecificationGroups';
protected function getInput() {
$required = ((string) $this->element['required'] ==
'true') ? TRUE : FALSE;
$multiple = ((string) $this->element['multiple'] ==
'true') ? TRUE : FALSE;
$class = ((string) $this->element['class'] !=
'') ?
'class="'.$this->element['class'].'"'
: 'class="inputbox"';
//$id = (int) $this->form->getValue('id');
$attr = '';
$attr .= $class . ' ';
if ($multiple) {
$attr .= 'size="4" multiple="multiple"
';
}
if ($required) {
$attr .= 'required aria-required="true" ';
}
$attr .= $this->element['onchange'] ? '
onchange="'.(string)
$this->element['onchange'].'" ' : '
';
$activeAttributes = array();
//if ((int)$id > 0) {
$activeAttributes = PhocacartSpecification::getGroupArray();
//}
if (!$multiple) {
array_unshift($activeAttributes,
Joomla\CMS\HTML\HTMLHelper::_('select.option', '',
'- ' . JText::_('COM_PHOCACART_SELECT_GROUP') . '
-', 'value', 'text'));
}
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$activeAttributes, $this->name, $attr, 'value',
'text', $this->value, $this->id );
}
}
?>
PK�"�[pA���
models/fields/phocacarttoken.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
class JFormFieldPhocaCartToken extends JFormField
{
protected $type = 'PhocaCartToken';
protected function getInput() {
// Initialize variables.
$html = array();
// Initialize some field attributes.
$size = $this->element['size'] ? '
size="'.(int)
$this->element['size'].'"' : '';
$maxLength = $this->element['maxlength'] ? '
maxlength="'.(int)
$this->element['maxlength'].'"' :
'';
$class = $this->element['class'] ? '
class="'.(string)
$this->element['class'].'"' : '';
$readonly = ((string) $this->element['readonly'] ==
'true') ? ' readonly="readonly"' :
'';
$disabled = ((string) $this->element['disabled'] ==
'true') ? ' disabled="disabled"' :
'';
$manager = $this->element['manager'] ?
$this->element['manager'] : '';
$token = PhocacartUtils::getToken($manager);
if ($this->value == '') {
$this->value = htmlspecialchars((string)$token);
}
// Initialize JavaScript field attributes.
$onchange = (string) $this->element['onchange'];
$onchangeOutput = ' onChange="'.(string)
$this->element['onchange'].'"';
$html[] = '<div class="input-append">';
$html[] = '<input type="text"
id="'.$this->id.'"
name="'.$this->name.'" value="'.
$this->value.'"' .
'
'.$class.$size.$disabled.$readonly.$onchangeOutput.$maxLength.'
/>';
/*$html[] = '<a class="btn"
title="'.JText::_('COM_PHOCADOWNLOAD_SET_TOKEN').'"'
.' href="javascript:void(0);"'
.'
onclick="javascript:document.getElementById(\''.$this->id.'_id\').value
= \''.$token.'\';return true;">'
.
JText::_('COM_PHOCADOWNLOAD_SET_TOKEN').'</a>';*/
$html[] = '</div>'. "\n";
return implode("\n", $html);
}
}
?>PK�"�[2�|UU(models/fields/phocacartxmlfeedplugin.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
class JFormFieldPhocaCartXmlFeedPlugin extends JFormField
{
protected $type = 'PhocaCartXmlFeedPlugin';
protected function getInput() {
//$document = JFactory::getDocument();
//$id = $this->form->getValue('id');
//$method = $this->form->getValue('method');
$plugins = PhocacartFeed::getFeedPluginMethods('', 1);
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$plugins, $this->name, 'class="inputbox"',
'value', 'text', $this->value, $this->id );
}
}
?>
PK�"�[��
models/fields/phocacartzones.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
class JFormFieldPhocacartZones extends JFormField
{
protected $type = 'PhocacartZones';
protected function getInput() {
$id = (int) $this->form->getValue('id');
if (isset($this->element['table'])) {
switch (strtolower($this->element['table'])) {
case "payment":
$table = 'payment';
break;
case "shipping":
default:
$table = 'shipping';
break;
}
} else {
$table = 'shipping';
}
$activeZones = array();
if ((int)$id > 0) {
$activeZones = PhocacartZone::getZones($id, 1, $table);
}
return PhocacartZone::getAllZonesSelectBox($this->name.'[]',
$this->id, $activeZones, NULL,'id' );
}
}
?>PK�"�[����
models/fields/phocacolortext.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('JPATH_BASE') or die();
jimport('joomla.form.formfield');
class JFormFieldPhocaColorText extends JFormField
{
public $type = 'PhocaColorText';
protected function getInput() {
$html = array();
//$managerOutput = $this->element['manager'] ?
'&manager='.(string)$this->element['manager']
: '';
//$group = PhocacartUtilsSettings::getManagerGroup((string)
$this->element['manager']);
$textButton = 'COM_PHOCACART_FORM_SELECT_COLOR';
$document = JFactory::getDocument();
JHTML::stylesheet( 'media/com_phocacart/js/jcp/picker.css' );
$document->addScript(JURI::root(true).'/media/com_phocacart/js/jcp/picker.js');
$onchange = (string) $this->element['onchange'];
$size = ($v = $this->element['size']) ? '
size="' . $v . '"' : '';
$class = ($v = $this->element['class']) ? '
class="' . $v . ' phColorText"' :
'class="text_area phColorText"';
$required = ($v = $this->element['required']) ? '
required="required"' : '';
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework');
$idA = 'phColorText';
$idAC = $idA.'PickerName'. $this->id;
$html[] = '<span class="input-append"><input
type="text" ' . $required . ' id="' .
$this->id . '" name="' . $this->name .
'"'
. ' value="' . $this->value . '"' .
$size . $class . ' style="background-color:
'.$this->value.'" />';
// data-id does not work by dynamically added form fields so we need to
get the id which is stored in input before the button
$html[] = ' <a href="#'.$idAC.'"
role="button" class="btn btn-primary
'.$idA.'PickerButton">'
. '<span class="icon-list icon-white"></span>
'
. JText::_($textButton) . '</a></span>';
return implode("\n", $html);
}
}
?>
PK�"�[��0..%models/fields/phocacouponcategory.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
if (! class_exists('PhocacartCategory')) {
require_once(
JPATH_ADMINISTRATOR.'/components/com_phocacart/libraries/phocacart/category/category.php');
}
class JFormFieldPhocaCouponCategory extends JFormField
{
protected $type = 'PhocaCouponCategory';
protected function getInput() {
$db = JFactory::getDBO();
//build the list of categories
$query = 'SELECT a.title AS text, a.id AS value, a.parent_id as
parentid'
. ' FROM #__phocacart_categories AS a'
. ' WHERE a.published = 1'
. ' ORDER BY a.ordering';
$db->setQuery( $query );
$data = $db->loadObjectList();
$id = $this->form->getValue('id');
$catId = -1;
$required = ((string) $this->element['required'] ==
'true') ? TRUE : FALSE;
$javascript = '';
$tree = array();
$text = '';
$tree = PhocacartCategory::CategoryTreeOption($data, $tree, 0, $text,
$catId);
$relatedOption = array();
if ((int)$id > 0) {
$relatedOption = PhocacartCoupon::getCouponCatsById((int)$id);
}
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$tree, $this->name, 'class="inputbox" size="4"
multiple="multiple"'. $javascript, 'value',
'text', $relatedOption, $id);
}
}
?>
PK�"�[lLL$models/fields/phocacouponproduct.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('JPATH_BASE') or die();
jimport('joomla.form.formfield');
class JFormFieldPhocaCouponProduct extends JFormField
{
public $type = 'PhocaCouponProduct';
protected function getInput() {
$html = array();
$url =
'index.php?option=com_phocacart&view=phocacartitema&format=json&tmpl=component&'.
JSession::getFormToken().'=1';
$attr = $this->element['class'] ? '
class="'.(string) $this->element['class'].'
typeahead"' : ' class="typeahead"';
$attr .= $this->element['size'] ? '
size="'.(int)
$this->element['size'].'"' : '';
$onchange = (string) $this->element['onchange'];
$id = $this->form->getValue('id');
$value = '';
if ((int)$id > 0) {
$relatedOption = PhocacartCoupon::getCouponProductsById((int)$id);
if(!empty($relatedOption)) {
$i = 0;
foreach($relatedOption as $k => $v) {
if ($i > 0) {
$value .= ',';
}
$value .= (int)$v->id . ':'. $v->title .'
('.$v->categories_title.')';
$i++;
}
}
}
$document = JFactory::getDocument();
JHtml::stylesheet('media/com_phocacart/js/administrator/select2/select2.css'
);
$document->addScript(JURI::root(true).'/media/com_phocacart/js/administrator/select2/select2.js');
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework', false);
$s = array();
$s[] = 'jQuery(document).ready(function() {';
$s[] = ' ';
$s[] = '(function (jQuery) {';
$s[] = ' "use strict";';
$s[] = ' jQuery.extend(jQuery.fn.select2.defaults, {';
$s[] = ' formatNoMatches: function () { return
"'.JText::_('COM_PHOCACART_NO_MATCHES_FOUND').'";
},';
$s[] = ' formatInputTooShort: function (input, min) { var n = min -
input.length; return
"'.JText::_('COM_PHOCACART_PLEASE_ENTER').' "
+ n + "
'.JText::_('COM_PHOCACART_S_MORE_CHARACTER').'" +
(n == 1? "" : "s"); },';
$s[] = ' formatInputTooLong: function (input, max) { var n =
input.length - max; return
"'.JText::_('COM_PHOCACART_PLEASE_DELETE').'
" + n + "
'.JText::_('COM_PHOCACART_S_CHARACTER').'" + (n ==
1? "" : "s"); },';
$s[] = ' formatSelectionTooBig: function (limit) { return
"'.JText::_('COM_PHOCACART_YOU_CAN_ONLY_SELECT').'
" + limit + "
'.JText::_('COM_PHOCACART_S_ITEM').'" + (limit ==
1 ? "" : "s"); },';
$s[] = ' formatLoadMore: function (pageNumber) { return
"'.JText::_('COM_PHOCACART_LOADING_MORE_RESULTS').'...";
},';
$s[] = ' formatSearching: function () { return
"'.JText::_('COM_PHOCACART_SEARCHING').'...";
}';
$s[] = ' });';
$s[] = '})(jQuery);';
$s[] = ' ';
$s[] = ' function phSearchItemsMultiple(element, url) {';
$s[] = ' jQuery(element).select2({';
$s[] = ' placeholder: "",';
$s[] = ' minimumInputLength: 1,';
$s[] = ' multiple: true,';
$s[] = ' ajax: {';
$s[] = ' url: url,';
$s[] = ' dataType: \'json\',';
$s[] = ' data: function(term, page) {';
$s[] = ' return {';
$s[] = ' q: term,';
$s[] = ' page_limit: 10,';
$s[] = ' item_id: '.(int)$id.',';
$s[] = ' }';
$s[] = ' },';
$s[] = ' results: function(data, page) {';
$s[] = ' if ( data.status == 0 ){';
$s[] = ' return { results: data.error }';
$s[] = ' } else {';
$s[] = ' return { results: data.items }';
$s[] = ' }';
$s[] = ' }';
$s[] = ' },';
$s[] = ' formatResult: formatResult,';
$s[] = ' formatSelection: formatSelection,';
$s[] = ' initSelection: function(element, callback) {';
$s[] = ' var data = [];';
$s[] = '
jQuery(element.val().split(",")).each(function(i) {';
$s[] = ' var item = this.split(\':\');';
$s[] = ' data.push({';
$s[] = ' id: item[0],';
$s[] = ' title: item[1]';
$s[] = ' });';
$s[] = ' });';
$s[] = ' jQuery(element).val(\'\');';
$s[] = ' callback(data);';
$s[] = ' }';
$s[] = ' });';
$s[] = ' };';
$s[] = ' ';
$s[] = ' function formatResult(item) {';
$s[] = ' if (item.image !== undefined) {';
$s[] = ' return \'<div><img
src="'.JURI::root().'\' + item.image + \'"
/> \' + item.title + \'</div>\';';
$s[] = ' } else {';
$s[] = ' return \'<div>\' + item.title +
\'</div>\';';
$s[] = ' }';
$s[] = ' };';
$s[] = ' ';
$s[] = ' function formatSelection(data) {';
$s[] = ' return data.title;';
$s[] = ' };';
$s[] = ' ';
$s[] = '
phSearchItemsMultiple("#'.$this->id.'",
"'.$url.'");';
//$s[] = ' ';
//$s[] = ' jQuery(\'#save\').click(function() {';
//$s[] = ' console
log(jQuery(\'#jform_related\').val());';
//$s[] = ' });';
$s[] = '});';
$document->addScriptDeclaration(implode("\n", $s));
$html[] = '<div>';
$html[] = '<input type="hidden" style="width:
400px;" id="'.$this->id.'"
name="'.$this->name.'" value="'.
$value.'"' .' '.$attr.' />';
$html[] = '</div>'. "\n";
return implode("\n", $html);
}
}
?>
PK�"�[*���::'models/fields/phocadiscountcategory.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
if (! class_exists('PhocacartCategory')) {
require_once(
JPATH_ADMINISTRATOR.'/components/com_phocacart/libraries/phocacart/category/category.php');
}
class JFormFieldPhocaDiscountCategory extends JFormField
{
protected $type = 'PhocaDiscountCategory';
protected function getInput() {
$db = JFactory::getDBO();
//build the list of categories
$query = 'SELECT a.title AS text, a.id AS value, a.parent_id as
parentid'
. ' FROM #__phocacart_categories AS a'
. ' WHERE a.published = 1'
. ' ORDER BY a.ordering';
$db->setQuery( $query );
$data = $db->loadObjectList();
$id = $this->form->getValue('id');
$catId = -1;
$required = ((string) $this->element['required'] ==
'true') ? TRUE : FALSE;
$javascript = '';
$tree = array();
$text = '';
$tree = PhocacartCategory::CategoryTreeOption($data, $tree, 0, $text,
$catId);
$relatedOption = array();
if ((int)$id > 0) {
$relatedOption = PhocacartDiscountCart::getDiscountCatsById((int)$id);
}
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$tree, $this->name, 'class="inputbox" size="4"
multiple="multiple"'. $javascript, 'value',
'text', $relatedOption, $id);
}
}
?>
PK�"�[���XX&models/fields/phocadiscountproduct.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('JPATH_BASE') or die();
jimport('joomla.form.formfield');
class JFormFieldPhocaDiscountProduct extends JFormField
{
public $type = 'PhocaDiscountProduct';
protected function getInput() {
$html = array();
$url =
'index.php?option=com_phocacart&view=phocacartitema&format=json&tmpl=component&'.
JSession::getFormToken().'=1';
$attr = $this->element['class'] ? '
class="'.(string) $this->element['class'].'
typeahead"' : ' class="typeahead"';
$attr .= $this->element['size'] ? '
size="'.(int)
$this->element['size'].'"' : '';
$onchange = (string) $this->element['onchange'];
$id = $this->form->getValue('id');
$value = '';
if ((int)$id > 0) {
$relatedOption =
PhocacartDiscountCart::getDiscountProductsById((int)$id);
if(!empty($relatedOption)) {
$i = 0;
foreach($relatedOption as $k => $v) {
if ($i > 0) {
$value .= ',';
}
$value .= (int)$v->id . ':'. $v->title .'
('.$v->categories_title.')';
$i++;
}
}
}
$document = JFactory::getDocument();
JHtml::stylesheet('media/com_phocacart/js/administrator/select2/select2.css'
);
$document->addScript(JURI::root(true).'/media/com_phocacart/js/administrator/select2/select2.js');
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework', false);
$s = array();
$s[] = 'jQuery(document).ready(function() {';
$s[] = ' ';
$s[] = '(function (jQuery) {';
$s[] = ' "use strict";';
$s[] = ' jQuery.extend(jQuery.fn.select2.defaults, {';
$s[] = ' formatNoMatches: function () { return
"'.JText::_('COM_PHOCACART_NO_MATCHES_FOUND').'";
},';
$s[] = ' formatInputTooShort: function (input, min) { var n = min -
input.length; return
"'.JText::_('COM_PHOCACART_PLEASE_ENTER').' "
+ n + "
'.JText::_('COM_PHOCACART_S_MORE_CHARACTER').'" +
(n == 1? "" : "s"); },';
$s[] = ' formatInputTooLong: function (input, max) { var n =
input.length - max; return
"'.JText::_('COM_PHOCACART_PLEASE_DELETE').'
" + n + "
'.JText::_('COM_PHOCACART_S_CHARACTER').'" + (n ==
1? "" : "s"); },';
$s[] = ' formatSelectionTooBig: function (limit) { return
"'.JText::_('COM_PHOCACART_YOU_CAN_ONLY_SELECT').'
" + limit + "
'.JText::_('COM_PHOCACART_S_ITEM').'" + (limit ==
1 ? "" : "s"); },';
$s[] = ' formatLoadMore: function (pageNumber) { return
"'.JText::_('COM_PHOCACART_LOADING_MORE_RESULTS').'...";
},';
$s[] = ' formatSearching: function () { return
"'.JText::_('COM_PHOCACART_SEARCHING').'...";
}';
$s[] = ' });';
$s[] = '})(jQuery);';
$s[] = ' ';
$s[] = ' function phSearchItemsMultiple(element, url) {';
$s[] = ' jQuery(element).select2({';
$s[] = ' placeholder: "",';
$s[] = ' minimumInputLength: 1,';
$s[] = ' multiple: true,';
$s[] = ' ajax: {';
$s[] = ' url: url,';
$s[] = ' dataType: \'json\',';
$s[] = ' data: function(term, page) {';
$s[] = ' return {';
$s[] = ' q: term,';
$s[] = ' page_limit: 10,';
$s[] = ' item_id: '.(int)$id.',';
$s[] = ' }';
$s[] = ' },';
$s[] = ' results: function(data, page) {';
$s[] = ' if ( data.status == 0 ){';
$s[] = ' return { results: data.error }';
$s[] = ' } else {';
$s[] = ' return { results: data.items }';
$s[] = ' }';
$s[] = ' }';
$s[] = ' },';
$s[] = ' formatResult: formatResult,';
$s[] = ' formatSelection: formatSelection,';
$s[] = ' initSelection: function(element, callback) {';
$s[] = ' var data = [];';
$s[] = '
jQuery(element.val().split(",")).each(function(i) {';
$s[] = ' var item = this.split(\':\');';
$s[] = ' data.push({';
$s[] = ' id: item[0],';
$s[] = ' title: item[1]';
$s[] = ' });';
$s[] = ' });';
$s[] = ' jQuery(element).val(\'\');';
$s[] = ' callback(data);';
$s[] = ' }';
$s[] = ' });';
$s[] = ' };';
$s[] = ' ';
$s[] = ' function formatResult(item) {';
$s[] = ' if (item.image !== undefined) {';
$s[] = ' return \'<div><img
src="'.JURI::root().'\' + item.image + \'"
/> \' + item.title + \'</div>\';';
$s[] = ' } else {';
$s[] = ' return \'<div>\' + item.title +
\'</div>\';';
$s[] = ' }';
$s[] = ' };';
$s[] = ' ';
$s[] = ' function formatSelection(data) {';
$s[] = ' return data.title;';
$s[] = ' };';
$s[] = ' ';
$s[] = '
phSearchItemsMultiple("#'.$this->id.'",
"'.$url.'");';
//$s[] = ' ';
//$s[] = ' jQuery(\'#save\').click(function() {';
//$s[] = ' console
log(jQuery(\'#jform_related\').val());';
//$s[] = ' });';
$s[] = '});';
$document->addScriptDeclaration(implode("\n", $s));
$html[] = '<div>';
$html[] = '<input type="hidden" style="width:
400px;" id="'.$this->id.'"
name="'.$this->name.'" value="'.
$value.'"' .' '.$attr.' />';
$html[] = '</div>'. "\n";
return implode("\n", $html);
}
}
?>
PK�"�[\�����models/fields/phocahead.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('JPATH_BASE') or die;
jimport('joomla.html.html');
jimport('joomla.form.formfield');
class JFormFieldPhocaHead extends JFormField
{
protected $type = 'PhocaHead';
protected function getLabel() { return '';}
protected function getInput() {
$tc = 'phocacart';
$ts = 'media/com_'.$tc.'/css/administrator/';
$ti = 'media/com_'.$tc.'/images/administrator/';
JHtml::stylesheet( $ts.'/'.$tc.'options.css' );
//echo '<div
style="clear:both;"></div>';
$phocaImage = ( (string)$this->element['phocaimage'] ?
$this->element['phocaimage'] : '' );
$image = '';
if ($phocaImage != ''){
$image = Joomla\CMS\HTML\HTMLHelper::_('image', $ti .
$phocaImage, '' );
}
if ($this->element['default']) {
if ($image != '') {
return '<div class="tab-header
ph-options-head">'
.'<div>'. $image.' <strong>'.
JText::_($this->element['default']) .
'</strong></div>'
.'</div>';
} else {
return '<div class="tab-header
ph-options-head">'
.'<strong>'.
JText::_($this->element['default']) .
'</strong>'
.'</div>';
}
} else {
return parent::getLabel();
}
//echo '<div
style="clear:both;"></div>';
}
}
?>
PK�"�[X���!models/fields/phocaheadexpert.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('JPATH_BASE') or die;
jimport('joomla.html.html');
jimport('joomla.form.formfield');
class JFormFieldPhocaHeadExpert extends JFormField
{
protected $type = 'PhocaHeadExpert';
protected function getLabel() { return '';}
protected function getInput() {
$tc = 'phocacart';
$ts = 'media/com_'.$tc.'/css/administrator/';
$ti = 'media/com_'.$tc.'/images/administrator/';
JHtml::stylesheet( $ts.'/'.$tc.'options.css' );
echo '<div style="clear:both;"></div>';
$phocaImage = ( (string)$this->element['phocaimage'] ?
$this->element['phocaimage'] : '' );
$image = '';
if ($phocaImage != ''){
$image = Joomla\CMS\HTML\HTMLHelper::_('image', $ti .
$phocaImage, '' );
}
if ($this->element['default']) {
if ($image != '') {
return '<div class="tab-header
ph-options-head-expert">'
.'<div>'. $image.' <strong>'.
JText::_($this->element['default']) .
'</strong></div>'
.'</div>';
} else {
return '<div class="tab-header
ph-options-head-expert">'
.'<strong>'.
JText::_($this->element['default']) .
'</strong>'
.'</div>';
}
} else {
return parent::getLabel();
}
echo '<div style="clear:both;"></div>';
}
}
?>
PK�"�[��&/
#models/fields/phocamanufacturer.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
class JFormFieldPhocaManufacturer extends JFormField
{
protected $type = 'PhocaManufacturer';
protected function getInput() {
$class = ((string) $this->element['class'] != '')
?
'class="'.$this->element['class'].'"'
: 'class="inputbox"';
$attr = '';
$attr .= $class . ' ';
$attr .= $this->element['onchange'] ? '
onchange="'.(string)
$this->element['onchange'].'" ' : '
';
$db = JFactory::getDBO();
$query = 'SELECT a.title AS text, a.id AS value'
. ' FROM #__phocacart_manufacturers AS a'
. ' WHERE a.published = 1'
. ' ORDER BY a.ordering';
$db->setQuery( $query );
$data = $db->loadObjectList();
array_unshift($data,
Joomla\CMS\HTML\HTMLHelper::_('select.option', '',
'-
'.JText::_('COM_PHOCACART_SELECT_MANUFACTURER').'
-', 'value', 'text'));
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$data, $this->name, $attr, 'value', 'text',
$this->value, $this->id );
}
}
?>
PK�"�[˟�G��#models/fields/phocapluginmethod.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
class JFormFieldPhocaPluginMethod extends JFormField
{
protected $type = 'PhocaPluginMethod';
protected function getInput() {
$document = JFactory::getDocument();
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework', false);
$plugintype = 1;
if (isset($this->element['plugintype']) &&
$this->element['plugintype'] > 0) {
$plugintype = $this->element['plugintype'];// 1 Payment, 2
Shipping
}
if ($plugintype == 2) {
$text =
JText::_('COM_PHOCACART_LOADING_SHIPPING_METHOD_OPTIONS_PLEASE_WAIT');
$url =
'index.php?option=com_phocacart&view=phocacartparama&type='.(int)$plugintype.'&format=json&tmpl=component&'.
JSession::getFormToken().'=1';
} else {
$text =
JText::_('COM_PHOCACART_LOADING_PAYMENT_METHOD_OPTIONS_PLEASE_WAIT');
$url =
'index.php?option=com_phocacart&view=phocacartparama&type='.(int)$plugintype.'&format=json&tmpl=component&'.
JSession::getFormToken().'=1';
}
$id = $this->form->getValue('id');
$method = $this->form->getValue('method');
$s = array();
$s[] = 'function phLoadParams(value) {';
$s[] = ' var url = \''.$url.'\'';
$s[] = ' var phAjax = \'<div
class="ph-ajax-message"><div
class="ph-loader"></div>\' + \''.
htmlspecialchars($text).'\' + \'</div>\';';
$s[] = '
jQuery("#ph-extended-params-msg").html(phAjax);';
$s[] = '
jQuery("#ph-extended-params-msg").show();';
$s[] = ' jQuery("#ph-extended-params").show();';
$s[] = ' var dataPost = {};';
$s[] = ' dataPost[\'method\'] =
encodeURIComponent(value);';
$s[] = ' dataPost[\'id\'] =
encodeURIComponent('.(int)$id.');';
$s[] = ' phRequestActive = jQuery.ajax({';
$s[] = ' url: url,';
$s[] = ' type:\'POST\',';
$s[] = ' data:dataPost,';
$s[] = ' dataType:\'JSON\',';
$s[] = ' success:function(data){';
$s[] = ' if ( data.status == 1 ){';
$s[] = '
jQuery("#ph-extended-params").html(data.message);';
$s[] = '
jQuery("#ph-extended-params-msg").hide();';
$s[] = '
jQuery(\'select\').chosen({disable_search_threshold :
10,allow_single_deselect : true});';//Reload Chosen Adm
//$s[] =
' jQuery(\'.hasTooltip\').tooltip({"html":
true,"container": "body"});';//Reload Tooltip
$s[] =
' jQuery(".hasPopover").popover({"html":
true,"trigger": "hover focus","container":
"body"});';
$s[] = ' var sandbox =
jQuery("#phform_params_sandbox").val();';
$s[] = ' if (sandbox == 1) {';
$s[] = ' jQuery("#ph-sandbox-msg").show();';
$s[] = ' }';
$s[] =
' jQuery("#phform_params_sandbox").on("change",
function() {';
$s[] = ' if (this.value == 1) {';
$s[] = ' jQuery("#ph-sandbox-msg").show();';
$s[] = ' } else {';
$s[] = ' jQuery("#ph-sandbox-msg").hide();';
$s[] = ' }';
$s[] = ' });';
$s[] = ' } else {';
$s[] = '
jQuery("#ph-extended-params-msg").html(data.error);';
$s[] = ' }';
$s[] = ' }';
$s[] = ' });';
$s[] = '}';
$s[] = ' ';
//$s[] = 'jQuery(document).ready(function() {';
//$s[] = 'jQuery("select").on("change",
function() {});';
//$s[] = '})';
$s[] = ' ';
if ((int)$this->form->getValue('id') > 0 &&
$this->form->getValue('method') != '') {
$s[] = ' ';
$s[] = 'jQuery(document).ready(function() {';
$s[] = '
phLoadParams(\''.$this->form->getValue('method').'\');';
$s[] = '})';
$s[] = ' ';
}
$document->addScriptDeclaration(implode("\n", $s));
if ($plugintype == 2) {
$methods = PhocacartShipping::getShippingPluginMethods();
} else {
$methods = PhocacartPayment::getPaymentPluginMethods();
}
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$methods, $this->name, 'class="inputbox"
onchange="phLoadParams(this.value);"', 'value',
'text', $this->value, $this->id );
}
}
?>
PK�"�[W�a4MM!models/fields/phocarawcontent.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('JPATH_BASE') or die;
jimport('joomla.html.html');
jimport('joomla.form.formfield');
class JFormFieldPhocaRawcontent extends JFormField
{
protected $type = 'PhocaRawcontent';
protected function getInput() {
return $this->value;
}
}
?>
PK�"�[+l�
OO%models/fields/phocaselectfilename.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('JPATH_BASE') or die();
jimport('joomla.form.formfield');
class JFormFieldPhocaSelectFilename extends JFormField
{
public $type = 'PhocaSelectFileName';
protected function getInput() {
$html = array();
$managerOutput = $this->element['manager'] ?
'&manager='.(string)$this->element['manager']
: '';
$group = PhocacartUtilsSettings::getManagerGroup((string)
$this->element['manager']);
$textButton =
'COM_PHOCACART_FORM_SELECT_'.strtoupper($group['t']);
// Set variable {field-id} because of dynamically created items
// {field-id} will be replaced by dynamically created ID of input closest
to button which will fire the modal box
//$link =
'index.php?option=com_phocacart&view=phocacartmanager'.$group['c'].$managerOutput.'&field='.$this->id;
$link =
'index.php?option=com_phocacart&view=phocacartmanager'.$group['c'].$managerOutput.'&field={ph-field-id}';
$onchange = (string) $this->element['onchange'];
$size = ($v = $this->element['size']) ? '
size="' . $v . '"' : '';
$class = ($v = $this->element['class']) ? '
class="' . $v . '"' :
'class="text_area"';
$required = ($v = $this->element['required']) ? '
required="required"' : '';
if ((string)$this->element['manager'] ==
'publicfile') {
$idA = 'phPublicFile';
} else if ((string)$this->element['manager'] ==
'attachmentfile') {
$idA = 'phPublicFile'; //'phAttachmentFile' -
phPublciFile does not have specific javascript features, so it can be
shared for another groups
} else {
$idA = 'phProductFile';
}
$w = 700;
$h = 400;
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework');
// Each Group is defined by its $idA
// And can have event in phocacartform.js
// 1) phocacartform.js - loads click event to run modal window - NO NEED
TO DEFINE EVENT HERE
// 2) phocacartform.js - creates modal window, then loads the
iframe with url - NO NEED TO LOAD MODAL WINDOW AND TO BUILD IT HERE
// jQuery(document).on("click",
"a.phProductFileModalButton", function (e) {
$idAC = $idA.'ModalName'. $this->id;
$html[] = '<span class="input-append"><input
type="text" ' . $required . ' id="' .
$this->id . '" name="' . $this->name .
'"'
. ' value="' . $this->value . '"' .
$size . $class . ' />';
// data-id does not work by dynamically added form fields so we need to
get the id which is stored in input before the button
$html[] = ' <a href="#'.$idAC.'"
role="button" class="btn btn-primary
'.$idA.'ModalButton" data-toggle="modal"
title="' . JText::_($textButton) . '"
data-title="' . JText::_($textButton) . '"
data-id="' . $this->id . '"
data-src="'.$link.'" data-height='.$w.'
data-width='.$h.'">'
. '<span class="icon-list icon-white"></span>
'
. JText::_($textButton) . '</a></span>';
return implode("\n", $html);
}
}
?>
PK�"�[��x�*models/fields/phocaselectfilenameimage.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('JPATH_BASE') or die();
jimport('joomla.form.formfield');
class JFormFieldPhocaSelectFilenameImage extends JFormField
{
public $type = 'PhocaSelectFileNameImage';
protected function getInput() {
$html = array();
$manager = $this->element['manager'] ?
$this->element['manager'] : 'productimage';
$managerOutput = $this->element['manager'] ?
'&manager='.(string)
$this->element['manager'] : '';
$group = PhocacartUtilsSettings::getManagerGroup((string)
$this->element['manager']);
$textButton =
'COM_PHOCACART_FORM_SELECT_'.strtoupper($group['t']);
// Set variable {field-id} because of dynamically created items
// {field-id} will be replaced by dynamically created ID of input closest
to button which will fire the modal box
//$link =
'index.php?option=com_phocacart&view=phocacartmanager'.$group['c'].$managerOutput.'&field='.$this->id;
$link =
'index.php?option=com_phocacart&view=phocacartmanager'.$group['c'].$managerOutput.'&field={ph-field-id}';
$onchange = (string) $this->element['onchange'];
$size = ($v = $this->element['size']) ? '
size="' . $v . '"' : '';
$class = ($v = $this->element['class']) ? '
class="' . $v . '"' :
'class="text_area"';
$required = ($v = $this->element['required']) ? '
required="required"' : '';
$idA = 'phImageFile';
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework');
$path = PhocacartPath::getPath($manager);
if ($this->value &&
file_exists($path['orig_abs_ds'] . $this->value)) {
$src = JUri::root() . $path['orig_rel_ds'] .
$this->value;
} else {
$src = '';
}
$pathImage = Juri::root() . $path['orig_rel_ds'];
$url =
'index.php?option=com_phocacart&view=phocacartthumba&format=json&tmpl=component&'.
JSession::getFormToken().'=1';
$dataManager = '
data-manager="'.$manager.'"';
$dataPathImage = '
data-pathimage="'.strip_tags(addslashes($pathImage)).'"';
$dataRequestUrl = '
data-requesturl="'.$url.'"';
$dataRequestMsg = '
data-requestmsg="'.strip_tags(addslashes(JText::_('COM_PHOCACART_CHECKING_IMAGE_THUMBNAIL_PLEASE_WAIT'))).'"';
$w = 700;
$h = 400;
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework');
// 1) phocacartform.js - loads click event to run modal window - NO NEED
TO DEFINE EVENT HERE
// 2) phocacartform.js - creates modal window, then loads the
iframe with url - NO NEED TO LOAD MODAL WINDOW AND TO BUILD IT HERE
$idAC = $idA.'ModalName'. $this->id;
$imgPreview = $src != '' ? '<img
src="'.$src.'" alt="" />' :
'<span class="glyphicon glyphicon-ban-circle
ban-circle"></span>';
$html[] = '<div class="input-prepend
input-append">';
$html[] = '<span class="btn btn-primary btn-prepend
ph-tooltip">'
. '<span class="icon-eye
icon-white"></span>'
. '<span class="ph-tooltiptext
phTooltipImagePreview"
id=phTooltipImagePreview_'.$this->id.'>'.$imgPreview.'</span>'
. '</span>';
$html[] = '<input type="text" ' . $required .
' id="' . $this->id . '" name="' .
$this->name . '"'
. ' value="' . $this->value . '"' .
$size . $class . $dataManager . $dataPathImage . $dataRequestUrl .
$dataRequestMsg .' />';
// data-id does not work by dynamically added form fields so we need to
get the id which is stored in input before the button
$html[] = ' <a href="#'.$idAC.'"
role="button" class="btn btn-primary
'.$idA.'ModalButton" data-toggle="modal"
title="' . JText::_($textButton) . '"
data-title="' . JText::_($textButton) . '"
data-id="' . $this->id . '"
data-src="'.$link.'" data-height='.$w.'
data-width='.$h.'">'
. '<span class="icon-list icon-white"></span>
'
. JText::_($textButton) . '</a>';
$html[] = '</div>';
return implode("\n", $html);
}
}
?>
PK�"�[h(���!models/fields/phocaselectitem.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('JPATH_BASE') or die();
jimport('joomla.form.formfield');
if (! class_exists('PhocacartRelated')) {
require_once(
JPATH_ADMINISTRATOR.'/components/com_phocacart/libraries/phocacart/related/related.php');
}
if (! class_exists('PhocacartProduct')) {
require_once(
JPATH_ADMINISTRATOR.'/components/com_phocacart/libraries/phocacart/product/product.php');
}
if (! class_exists('PhocacartText')) {
require_once(
JPATH_ADMINISTRATOR.'/components/com_phocacart/libraries/phocacart/text/text.php');
}
class JFormFieldPhocaSelectItem extends JFormField
{
public $type = 'PhocaSelectItem';
public function getInput() {
$html = array();
$url =
'index.php?option=com_phocacart&view=phocacartitema&format=json&tmpl=component&'.
JSession::getFormToken().'=1';
// Possible problem with modal
//$attr = $this->element['class'] ? '
class="'.(string) $this->element['class'].'
typeahead"' : ' class="typeahead"';
$attr = $this->element['class'] ? '
class="'.(string) $this->element['class'].'
"' : ' class=""';
$attr .= $this->element['size'] ? '
size="'.(int)
$this->element['size'].'"' : '';
$attr .= $this->element['required'] ? ' required
aria-required="true"' : '';
$related = $this->element['related'] ? true : false;
//$attr .= $this->multiple ? ' multiple' : '';
// Be aware
// multiple = true -> name will be $this->name = jform[related][]
// multiple = false -> name will be $this->name = jform[related]
if ($this->multiple) {
$multiple = 'true';
} else {
$multiple = 'false';
}
$onchange = (string) $this->element['onchange'];
$value = '';
if ($related) {
// Related product - select related products by "parent"
product ID
$id = $this->form->getValue('id');
if ((int)$id > 0) {
$relatedOption = PhocacartRelated::getRelatedItemsById((int)$id);
if(!empty($relatedOption)) {
$i = 0;
//$value .= '[';
foreach($relatedOption as $k => $v) {
if ($i > 0) {
$value .= '[|]';
}
$title = PhocacartText::filterValue($v->title, 'text');
$titleCat = PhocacartText::filterValue($v->categories_title,
'text');
//$title = str_replace(',', '-', $title);
//$titleCat = str_replace(',', '-', $titleCat);
$value .= (int)$v->id . ':'.$title.'
('.$titleCat.')';
$i++;
}
//$value .= ']';
}
}
} else {
// Standard product - only select one product by ID
$product =
PhocacartProduct::getProductByProductId((int)$this->value);
if(isset($product->id)) {
$value .= (int)$product->id .
':'.PhocacartText::filterValue($product->title,
'text') .'
('.PhocacartText::filterValue($product->categories_title,
'text').')';
}
$id = (int)$this->value;
}
$document = JFactory::getDocument();
JHtml::stylesheet('media/com_phocacart/js/administrator/select2/select2.css'
);
$document->addScript(JURI::root(true).'/media/com_phocacart/js/administrator/select2/select2.js');
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework', false);
$s = array();
$s[] = 'jQuery(document).ready(function() {';
$s[] = ' ';
$s[] = '(function (jQuery) {';
$s[] = ' "use strict";';
$s[] = ' jQuery.extend(jQuery.fn.select2.defaults, {';
$s[] = ' formatNoMatches: function () { return
"'.JText::_('COM_PHOCACART_NO_MATCHES_FOUND').'";
},';
$s[] = ' formatInputTooShort: function (input, min) { var n = min -
input.length; return
"'.JText::_('COM_PHOCACART_PLEASE_ENTER').' "
+ n + "
'.JText::_('COM_PHOCACART_S_MORE_CHARACTER').'" +
(n == 1? "" : "s"); },';
$s[] = ' formatInputTooLong: function (input, max) { var n =
input.length - max; return
"'.JText::_('COM_PHOCACART_PLEASE_DELETE').'
" + n + "
'.JText::_('COM_PHOCACART_S_CHARACTER').'" + (n ==
1? "" : "s"); },';
$s[] = ' formatSelectionTooBig: function (limit) { return
"'.JText::_('COM_PHOCACART_YOU_CAN_ONLY_SELECT').'
" + limit + "
'.JText::_('COM_PHOCACART_S_ITEM').'" + (limit ==
1 ? "" : "s"); },';
$s[] = ' formatLoadMore: function (pageNumber) { return
"'.JText::_('COM_PHOCACART_LOADING_MORE_RESULTS').'...";
},';
$s[] = ' formatSearching: function () { return
"'.JText::_('COM_PHOCACART_SEARCHING').'...";
}';
$s[] = ' });';
$s[] = '})(jQuery);';
$s[] = ' ';
$s[] = ' function phSearchItemsMultiple(element, url) {';
$s[] = ' jQuery(element).select2({';
//$s[] = ' dropdownAutoWidth : true,';
//$s[] = ' width: "auto",';
$s[] = ' placeholder: "",';
$s[] = ' minimumInputLength: 1,';
$s[] = ' multiple: '.$multiple.',';
$s[] = ' ajax: {';
$s[] = ' url: url,';
$s[] = ' dataType: \'json\',';
$s[] = ' data: function(term, page) {';
$s[] = ' return {';
$s[] = ' q: term,';
$s[] = ' page_limit: 10,';
$s[] = ' item_id: '.(int)$id.',';
$s[] = ' }';
$s[] = ' },';
$s[] = ' results: function(data, page) {';
$s[] = ' if ( data.status == 0 ){';
$s[] = ' return { results: data.error }';
$s[] = ' } else {';
$s[] = ' return { results: data.items }';
$s[] = ' }';
$s[] = ' }';
$s[] = ' },';
$s[] = ' formatResult: formatResult,';
$s[] = ' formatSelection: formatSelection,';
$s[] = ' initSelection: function(element, callback) {';
$s[] = ' var data = [];';
$s[] = '
jQuery(element.val().split("[|]")).each(function(i) {';
$s[] = ' var item = this.split(\':\');';
$s[] = ' data.push({';
$s[] = ' id: item[0],';
$s[] = ' title: item[1]';
$s[] = ' });';
$s[] = ' });';
if ($multiple == 'false') {
$s[] = ' callback(data[0]);';// NOT MULTIPLE
} else {
$s[] = ' jQuery(element).val(\'\');';// Cannot be
set when single product because the input will be empty at start (now it is
including string but when saving, string will be changed to int)
$s[] = ' callback(data);';// MULTIPLE
}
$s[] = ' }';
$s[] = ' });';
$s[] = ' };';
$s[] = ' ';
$s[] = ' function formatResult(item) {';
$s[] = ' if (item.image !== undefined) {';
$s[] = ' return \'<div><img
src="'.JURI::root().'\' + item.image + \'"
/> \' + item.title + \'</div>\';';
$s[] = ' } else {';
$s[] = ' return \'<div>\' + item.title +
\'</div>\';';
$s[] = ' }';
$s[] = ' };';
$s[] = ' ';
$s[] = ' function formatSelection(data) {';
// Menu link - we need to select category in menu link too
// Options of categories will be loaded by ajax
$s[] = ' if(data.categories &&
jQuery("#jform_request_catid").length) {';
$s[] = ' jQuery("#jform_request_catid
option").remove();';
$s[] = '
jQuery(data.categories.split(",")).each(function(i) {';
$s[] = ' var itemC = this.split(\':\');';
$s[] = '
jQuery("#jform_request_catid").append(jQuery(\'<option>\',
{value: itemC[0], text: itemC[1]}));';
$s[] = ' });';
$s[] = '
jQuery("select").trigger("liszt:updated");';
$s[] = '
jQuery("select").trigger("chosen:updated");';
//$s[] = '
jQuery(".inputbox").chosen({disable_search_threshold :
10,allow_single_deselect : true});';
$s[] = ' }';
// End Menu link
$s[] = ' return data.title;';
$s[] = ' };';
$s[] = ' ';
$s[] = '
phSearchItemsMultiple("#'.$this->id.'",
"'.$url.'");';
//$s[] = ' ';
//$s[] = ' jQuery(\'#save\').click(function() {';
//$s[] = ' console
log(jQuery(\'#jform_related\').val());';
//$s[] = ' });';
$s[] = '});';
$document->addScriptDeclaration(implode("\n", $s));
$html[] = '<div>';
$html[] = '<input type="hidden" style="width:
400px;" id="'.$this->id.'"
name="'.$this->name.'" value="'.
$value.'"' .' '.$attr.' />';
$html[] = '</div>'. "\n";
return implode("\n", $html);
}
public function getInputWithoutFormData() {
$this->value = '';
$this->id = 'copy_attributes';
$this->name = 'copy_attributes';
$this->element['related'] = false;
$this->element['class'] = '';
$this->element['size'] = '';
$this->element['required'] = '';
$this->element['onchange'] = '';
return $this->getInput();
}
}
?>
PK�"�[v��W��)models/fields/phocaselectitemcategory.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('JPATH_BASE') or die();
jimport('joomla.form.formfield');
if (! class_exists('PhocacartRelated')) {
require_once(
JPATH_ADMINISTRATOR.'/components/com_phocacart/libraries/phocacart/related/related.php');
}
if (! class_exists('PhocacartProduct')) {
require_once(
JPATH_ADMINISTRATOR.'/components/com_phocacart/libraries/phocacart/product/product.php');
}
if (! class_exists('PhocacartCategoryMultiple')) {
require_once(
JPATH_ADMINISTRATOR.'/components/com_phocacart/libraries/phocacart/category/multiple.php');
}
class JFormFieldPhocaSelectItemCategory extends JFormField
{
public $type = 'PhocaSelectItemCategory';
public function getInput() {
// Runs with 'PhocaSelectItem' form field
$html = array();
//- $url =
'index.php?option=com_phocacart&view=phocacartitema&format=json&tmpl=component&'.
JSession::getFormToken().'=1';
// Possible problem with modal
//$attr = $this->element['class'] ? '
class="'.(string) $this->element['class'].'
typeahead"' : ' class="typeahead"';
$attr = $this->element['class'] ? '
class="'.(string) $this->element['class'].'
"' : ' class=""';
$attr .= $this->element['size'] ? '
size="'.(int)
$this->element['size'].'"' : '';
$attr .= $this->element['required'] ? ' required
aria-required="true"' : '';
$options = array();
$request = $this->form->getValue('request');
$productId = isset($request->id) ? $request->id : 0;
$options = PhocacartCategoryMultiple::getCategories($productId, 2);
$html[] = Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$options, $this->name, trim($attr), 'value', 'text',
$this->value, $this->id);
return implode("\n", $html);
}
}
?>
PK�"�[K���"models/fields/phocastockstatus.phpnu�[���<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
version 2 or later;
*/
defined('_JEXEC') or die();
class JFormFieldPhocaStockstatus extends JFormField
{
protected $type = 'PhocaStockstatus';
protected function getInput() {
$db = JFactory::getDBO();
$man = (string) $this->element['manager'];
$query = 'SELECT a.title AS text, a.id AS value'
. ' FROM #__phocacart_stock_statuses AS a'
. ' WHERE a.published = 1'
. ' ORDER BY a.ordering';
$db->setQuery( $query );
$data = $db->loadObjectList();
// DEFAULT VALUES
/* if ($man == 'a' && $this->value == 0) {
$this->value = 2; // set default value for products in stock
} else if ($man == 'n' && $this->value == 0) {
$this->value = 1;// set default value when there is no product in
stock
} */
if (!empty($data)) {
foreach($data as $k => $v) {
$v->text = JText::_($v->text);
}
}
array_unshift($data,
Joomla\CMS\HTML\HTMLHelper::_('select.option', '0',
'-
'.JText::_('COM_PHOCACART_SELECT_STOCK_STATUS').'
-', 'value', 'text'));
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$data, $this->name, 'class="inputbox"',
'value', 'text', $this->value, $this->id );
}
}
?>
PK�"�[
��EE models/fields/phocataglabels.phpnu�[���<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
version 2 or later;
*/
defined('_JEXEC') or die();
class JFormFieldPhocaTaglabels extends JFormField
{
protected $type = 'PhocaTaglabels';
protected function getInput() {
$id = (int) $this->form->getValue('id');
$javascript = '';
$required = $this->required;// accept dynamically added required
$multiple = ((string) $this->element['multiple'] ==
'true') ? TRUE : FALSE;
$class = ((string) $this->element['class'] !=
'') ?
'class="'.$this->element['class'].'"'
: 'class="inputbox"';
$attr = '';
$attr .= $class . ' ';
if ($multiple) {
$attr .= 'size="4" multiple="multiple"
';
}
if ($required) {
$attr .= 'required aria-required="true" ';
}
$attr .= $javascript . ' ';
$activeTags = array();
if ((int)$id > 0) {
$activeTags = PhocacartTag::getTagLabels($id, 1);
}
return PhocacartTag::getAllTagsSelectBox($this->name, $this->id,
$activeTags, NULL, 'id', 1, $attr );
}
}
?>
PK�"�["�tZ22models/fields/phocatags.phpnu�[���<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
version 2 or later;
*/
defined('_JEXEC') or die();
class JFormFieldPhocaTags extends JFormField
{
protected $type = 'PhocaTags';
protected function getInput() {
$id = (int) $this->form->getValue('id');
$javascript = '';
$required = $this->required;// accept dynamically added required
$multiple = ((string) $this->element['multiple'] ==
'true') ? TRUE : FALSE;
$class = ((string) $this->element['class'] !=
'') ?
'class="'.$this->element['class'].'"'
: 'class="inputbox"';
$attr = '';
$attr .= $class . ' ';
if ($multiple) {
$attr .= 'size="4" multiple="multiple"
';
}
if ($required) {
$attr .= 'required aria-required="true" ';
}
$attr .= $javascript . ' ';
$activeTags = array();
if ((int)$id > 0) {
$activeTags = PhocacartTag::getTags($id, 1);
}
return PhocacartTag::getAllTagsSelectBox($this->name, $this->id,
$activeTags, NULL, 'id', 0, $attr );
}
}
?>
PK�"�[n��β�models/fields/phocatax.phpnu�[���<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
version 2 or later;
*/
defined('_JEXEC') or die();
class JFormFieldPhocaTax extends JFormField
{
protected $type = 'PhocaTax';
protected function getInput() {
$db = JFactory::getDBO();
$query = 'SELECT a.title AS text, a.id AS value'
. ' FROM #__phocacart_taxes AS a'
. ' WHERE a.published = 1'
. ' ORDER BY a.ordering';
$db->setQuery( $query );
$data = $db->loadObjectList();
if (!empty($data)) {
foreach($data as $k => $v) {
$data[$k]->text = JText::_($v->text);
}
}
array_unshift($data,
Joomla\CMS\HTML\HTMLHelper::_('select.option', '',
'- '.JText::_('COM_PHOCACART_SELECT_TAX').'
-', 'value', 'text'));
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$data, $this->name, 'class="inputbox"',
'value', 'text', $this->value, $this->id );
}
}
?>
PK�"�[+��ggmodels/fields/phocaunit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
class JFormFieldPhocaUnit extends JFormField
{
protected $type = 'PhocaUnit';
protected function getInput() {
$units = array();
if ($this->element['table']) {
$units = PhocacartUtilsSettings::getUnit(0,
$this->element['table']);
}
$unitsA = array();
foreach ($units as $k => $v) {
$unitsA[$k] = JText::_($v[0]);
}
return Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$unitsA, $this->name, 'class="inputbox"',
'value', 'text', $this->value, $this->id );
}
}
?>
PK�"�[�����+models/forms/filter_phocacartbulkprices.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.status
ASC">COM_PHOCACART_STATUS_ASC</option>
<option value="a.status
DESC">COM_PHOCACART_STATUS_DESC</option>
<option value="a.date ASC">JDATE_ASC</option>
<option value="a.date DESC">JDATE_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[Zz'm +models/forms/filter_phocacartcategories.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<field name="level" type="integer"
label="JOPTION_FILTER_LEVEL"
description="JOPTION_FILTER_LEVEL_DESC" first="1"
last="10" step="1" languages="*"
onchange="this.form.submit();" >
<option
value="">JOPTION_SELECT_MAX_LEVELS</option>
</field>
<field name="language" type="contentlanguage"
label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();"> <option
value="">JOPTION_SELECT_LANGUAGE</option> <option
value="*">JALL</option>
</field>
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="pc.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="pc.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="parentcat_title
ASC">COM_PHOCACART_PARENT_CATEGORY_ASC</option>
<option value="parentcat_title
DESC">COM_PHOCACART_PARENT_CATEGORY_DESC</option>
<option value="a.count_products
ASC">COM_PHOCACART_PRODUCT_COUNT_ASC</option>
<option value="a.count_products
DESC">COM_PHOCACART_PRODUCT_COUNT_DESC</option>
<option value="association ASC"
requires="associations">JASSOCIATIONS_ASC</option>
<option value="association DESC"
requires="associations">JASSOCIATIONS_DESC</option>
<option value="a.language
ASC">JGRID_HEADING_LANGUAGE_ASC</option>
<option value="a.language
DESC">JGRID_HEADING_LANGUAGE_DESC</option>
<option value="a.hits
ASC">JGLOBAL_HITS_ASC</option>
<option value="a.hits
DESC">JGLOBAL_HITS_DESC</option>
<option value="a.date ASC">JDATE_ASC</option>
<option value="a.date DESC">JDATE_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[�z��*models/forms/filter_phocacartcountries.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.code2
ASC">COM_PHOCACART_CODE2_ASC</option>
<option value="a.code2
DESC">COM_PHOCACART_CODE2_DESC</option>
<option value="a.code3
ASC">COM_PHOCACART_CODE3_ASC</option>
<option value="a.code3
DESC">COM_PHOCACART_CODE3_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[X@�5�
�
(models/forms/filter_phocacartcoupons.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.code ASC"
>COM_PHOCACART_CODE_ASC</option>
<option value="a.code DESC"
>COM_PHOCACART_CODE_DESC</option>
<option value="a.discount ASC"
>COM_PHOCACART_DISCOUNT_FILTER_ASC</option>
<option value="a.discount DESC"
>COM_PHOCACART_DISCOUNT_FILTER_DESC</option>
<option value="a.valid_from ASC"
>COM_PHOCACART_VALID_FROM_ASC</option>
<option value="a.valid_from DESC"
>COM_PHOCACART_VALID_FROM_DESC</option>
<option value="a.valid_to ASC"
>COM_PHOCACART_VALID_TO_ASC</option>
<option value="a.valid_to DESC"
>COM_PHOCACART_VALID_TO_DESC</option>
<option value="a.coupon_type ASC"
>COM_PHOCACART_COUPON_TYPE_ASC</option>
<option value="a.coupon_type DESC"
>COM_PHOCACART_COUPON_TYPE_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[V]c� � +models/forms/filter_phocacartcurrencies.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.code
ASC">COM_PHOCACART_CODE_ASC</option>
<option value="a.code
DESC">COM_PHOCACART_CODE_DESC</option>
<option value="a.price_currency_symbol
ASC">COM_PHOCACART_CURRENCY_SYMBOL_ASC</option>
<option value="a.price_currency_symbol
DESC">COM_PHOCACART_CURRENCY_SYMBOL_DESC</option>
<option value="a.exchange_rate
ASC">COM_PHOCACART_EXCHANGE_RATE_ASC</option>
<option value="a.exchange_rate
DESC">COM_PHOCACART_EXCHANGE_RATE_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[Ftu� � *models/forms/filter_phocacartdiscounts.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.discount ASC"
>COM_PHOCACART_DISCOUNT_FILTER_ASC</option>
<option value="a.discount DESC"
>COM_PHOCACART_DISCOUNT_FILTER_DESC</option>
<option value="a.valid_from ASC"
>COM_PHOCACART_VALID_FROM_ASC</option>
<option value="a.valid_from DESC"
>COM_PHOCACART_VALID_FROM_DESC</option>
<option value="a.valid_to ASC"
>COM_PHOCACART_VALID_TO_ASC</option>
<option value="a.valid_to DESC"
>COM_PHOCACART_VALID_TO_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[ q+��
�
*models/forms/filter_phocacartdownloads.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="u.name
ASC">COM_PHOCACART_USER_ASC</option>
<option value="u.name
DESC">COM_PHOCACART_USER_DESC</option>
<option value="a.order_id ASC"
>COM_PHOCACART_ORDER_NUMBER_FILTER_ASC</option>
<option value="a.order_id DESC"
>COM_PHOCACART_ORDER_NUMBER_FILTER_DESC</option>
<option value="a.date ASC"
>COM_PHOCACART_DATE_ASC</option>
<option value="a.date DESC"
>COM_PHOCACART_DATE_DESC</option>
<option value="a.download_hits ASC"
>COM_PHOCACART_DOWNLOAD_HITS_ASC</option>
<option value="a.download_hits DESC"
>COM_PHOCACART_DOWNLOAD_HITS_DESC</option>
<option value="a.download_file ASC"
>COM_PHOCACART_FILENAME_ASC</option>
<option value="a.download_file DESC"
>COM_PHOCACART_FILENAME_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[qWJ��+models/forms/filter_phocacartextensions.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="category_id"
type="phocacartextensions"
label="COM_PHOCACART_EXTENSIONS_LABEL"
description="COM_PHOCACART_EXTENSIONS_DESC"
onchange="this.form.submit();" default="modules" />
<input type="hidden" name="form_submited"
value="1"/>
</fields>
</fieldset>
</form>
PK�"�[�%��&models/forms/filter_phocacartfeeds.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[��0T+models/forms/filter_phocacartformfields.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">COM_PHOCACART_NAME_ASC</option>
<option value="a.title
DESC">COM_PHOCACART_NAME_DESC</option>
<option value="a.label ASC"
>COM_PHOCACART_LABEL_ASC</option>
<option value="a.label DESC"
>COM_PHOCACART_LABEL_DESC</option>
<option value="a.type ASC"
>COM_PHOCACART_TYPE_ASC</option>
<option value="a.type DESC"
>COM_PHOCACART_TYPE_DESC</option>
<option value="a.type_default ASC"
>COM_PHOCACART_DEFAULT_ASC</option>
<option value="a.type_default DESC"
>COM_PHOCACART_DEFAULT_DESC</option>
<option value="a.display_billing ASC"
>COM_PHOCACART_DISPLAY_BILLING_ASC</option>
<option value="a.display_billing DESC"
>COM_PHOCACART_DISPLAY_BILLING_DESC</option>
<option value="a.display_shipping ASC"
>COM_PHOCACART_DISPLAY_SHIPPING_ASC</option>
<option value="a.display_shipping DESC"
>COM_PHOCACART_DISPLAY_SHIPPING_DESC</option>
<option value="a.display_account ASC"
>COM_PHOCACART_DISPLAY_ACCOUNT_ASC</option>
<option value="a.display_account DESC"
>COM_PHOCACART_DISPLAY_ACCOUNT_DESC</option>
<option value="a.required ASC"
>COM_PHOCACART_REQUIRED_ASC</option>
<option value="a.required DESC"
>COM_PHOCACART_REQUIRED_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[�#ls 'models/forms/filter_phocacartgroups.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.minimum_sum
ASC">COM_PHOCACART_MINIMAL_SUM_OF_PURCHASES_ASC</option>
<option value="a.minimum_sum
DESC">COM_PHOCACART_MINIMAL_SUM_OF_PURCHASES_DESC</option>
<option value="a.type
ASC">COM_PHOCACART_DEFAULT_ASC</option>
<option value="a.type
DESC">COM_PHOCACART_DEFAULT_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[����
�
%models/forms/filter_phocacarthits.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<!--
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>-->
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.product_id ASC"
>COM_PHOCACART_PRODUCT_FILTER_ASC</option>
<option value="a.product_id DESC"
>COM_PHOCACART_PRODUCT_FILTER_DESC</option>
<option value="a.item ASC"
>COM_PHOCACART_ITEM_ASC</option>
<option value="a.item DESC"
>COM_PHOCACART_ITEM_DESC</option>
<option value="a.user_id ASC"
>COM_PHOCACART_USER_ASC</option>
<option value="a.user_id DESC"
>COM_PHOCACART_USER_DESC</option>
<option value="a.ip ASC"
>COM_PHOCACART_IP_ASC</option>
<option value="a.ip DESC"
>COM_PHOCACART_IP_DESC</option>
<option value="a.date ASC"
>COM_PHOCACART_DATE_ASC</option>
<option value="a.date DESC"
>COM_PHOCACART_DATE_DESC</option>
<option value="a.hits ASC"
>COM_PHOCACART_HITS_ASC</option>
<option value="a.hits DESC"
>COM_PHOCACART_HITS_DESC</option>
<option value="a.type ASC"
>COM_PHOCACART_TYPE_ASC</option>
<option value="a.type DESC"
>COM_PHOCACART_TYPE_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[?
y�N
N
&models/forms/filter_phocacartitems.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<field name="category_id" type="phocacartcategory"
label="JOPTION_FILTER_CATEGORY"
description="JOPTION_FILTER_CATEGORY_DESC"
onchange="this.form.submit();" />
<field name="manufacturer_id"
type="PhocaManufacturer"
label="COM_PHOCACART_OPTION_SELECT_MANUFACTURER"
description="COM_PHOCACART_OPTION_SELECT_MANUFACTURER"
onchange="this.form.submit();" />
<field name="language" type="contentlanguage"
label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="pc.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="pc.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<!-- GENERATED DYNAMICALLY BY OPTIONS
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="category_id
ASC">JCATEGORY_ASC</option>
<option value="category_id
DESC">JCATEGORY_DESC</option>
<option value="a.sku
ASC">COM_PHOCACART_SKU_ASC</option>
<option value="a.sku
DESC">COM_PHOCACART_SKU_DESC</option>
<option value="a.price
ASC">COM_PHOCACART_PRICE_ASC</option>
<option value="a.price
DESC">COM_PHOCACART_PRICE_DESC</option>
<option value="a.price_original
ASC">COM_PHOCACART_ORIGINAL_PRICE_ASC</option>
<option value="a.price_original
DESC">COM_PHOCACART_ORIGINAL_PRICE_DESC</option>
<option value="a.stock
ASC">COM_PHOCACART_STOCK_ASC</option>
<option value="a.stock
DESC">COM_PHOCACART_STOCK_DESC</option>
<option value="a.language
ASC">JGRID_HEADING_LANGUAGE_ASC</option>
<option value="a.language
DESC">JGRID_HEADING_LANGUAGE_DESC</option>
<option value="a.hits
ASC">JGLOBAL_HITS_ASC</option>
<option value="a.hits
DESC">JGLOBAL_HITS_DESC</option>
<option value="a.date ASC">JDATE_ASC</option>
<option value="a.date DESC">JDATE_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option> -->
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[���'y
y
%models/forms/filter_phocacartlogs.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<!--<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>-->
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.date ASC"
>COM_PHOCACART_DATE_ASC</option>
<option value="a.date DESC"
>COM_PHOCACART_DATE_DESC</option>
<option value="a.type ASC"
>COM_PHOCACART_TYPE_ASC</option>
<option value="a.type DESC"
>COM_PHOCACART_TYPE_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="user_username ASC"
>COM_PHOCACART_USER_ASC</option>
<option value="user_username DESC"
>COM_PHOCACART_USER_DESC</option>
<option value="a.ip ASC"
>COM_PHOCACART_IP_ASC</option>
<option value="a.ip DESC"
>COM_PHOCACART_IP_DESC</option>
<option value="a.incoming_page ASC"
>COM_PHOCACART_INCOMING_PAGE_ASC</option>
<option value="a.incoming_page DESC"
>COM_PHOCACART_INCOMING_PAGE_DESC</option>
<option value="a.description ASC"
>COM_PHOCACART_MESSAGE_ASC</option>
<option value="a.description DESC"
>COM_PHOCACART_MESSAGE_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[��^�bb.models/forms/filter_phocacartmanufacturers.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.count_products
ASC">COM_PHOCACART_PRODUCT_COUNT_ASC</option>
<option value="a.count_products
DESC">COM_PHOCACART_PRODUCT_COUNT_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[��FL� � 'models/forms/filter_phocacartorders.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<field name="status_id" default=""
type="PhocacartOrderstatus" typemethod="2"
label="COM_PHOCACART_ORDER_STATUS_LABEL"
description="COM_PHOCACART_ORDER_STATUS_DESC"
onchange="this.form.submit();">
</field>
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.date DESC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="order_number
ASC">COM_PHOCACART_ORDER_NUMBER_ASC</option>
<option value="order_number
DESC">COM_PHOCACART_ORDER_NUMBER_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="user_username
ASC">COM_PHOCACART_USER_ASC</option>
<option value="user_username
DESC">COM_PHOCACART_USER_DESC</option>
<option value="a.status_id
ASC">COM_PHOCACART_STATUS_ASC</option>
<option value="a.status_id
DESC">COM_PHOCACART_STATUS_DESC</option>
<option value="total_amount
ASC">COM_PHOCACART_TOTAL_ASC</option>
<option value="total_amount
DESC">COM_PHOCACART_TOTAL_DESC</option>
<option value="a.date
ASC">COM_PHOCACART_DATE_ADDED_ASC</option>
<option value="a.date
DESC">COM_PHOCACART_DATE_ADDED_DESC</option>
<option value="a.modified
ASC">COM_PHOCACART_DATE_MODIFIED_ASC</option>
<option value="a.modified
DESC">COM_PHOCACART_DATE_MODIFIED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[����+models/forms/filter_phocacartparameters.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[��O� � 0models/forms/filter_phocacartparametervalues.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="parameter_id"
type="PhocacartParameter"
label="COM_PHOCACART_FIELD_PARAMETER_LABEL"
description="COM_PHOCACART_FIELD_PARAMETER_DESC"
class="input" default=""
onchange="this.form.submit();" typemethod="1" />
<field name="published" type="list"
default="" label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.parameter_id
ASC">COM_PHOCACART_PARAMETER_FILTER_ASC</option>
<option value="a.parameter_id
DESC">COM_PHOCACART_PARAMETER_FILTER_DESC</option>
<option value="a.count_products
ASC">COM_PHOCACART_PRODUCT_COUNT_ASC</option>
<option value="a.count_products
DESC">COM_PHOCACART_PRODUCT_COUNT_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[=jB#��)models/forms/filter_phocacartpayments.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.method
ASC">COM_PHOCACART_METHOD_ASC</option>
<option value="a.method
DESC">COM_PHOCACART_METHOD_DESC</option>
<option value="a.cost
ASC">COM_PHOCACART_PRICE_ASC</option>
<option value="a.cost
DESC">COM_PHOCACART_PRICE_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[�.�*models/forms/filter_phocacartquestions.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="productname ASC"
>COM_PHOCACART_PRODUCT_FILTER_ASC</option>
<option value="productname DESC"
>COM_PHOCACART_PRODUCT_FILTER_DESC</option>
<option value="cattitle ASC"
>COM_PHOCACART_CATEGORY_FILTER_ASC</option>
<option value="cattitle DESC"
>COM_PHOCACART_CATEGORY_FILTER_DESC</option>
<option value="a.name ASC"
>COM_PHOCACART_NAME_ASC</option>
<option value="a.name DESC"
>COM_PHOCACART_NAME_DESC</option>
<option value="a.email ASC"
>COM_PHOCACART_EMAIL_FILTER_ASC</option>
<option value="a.email DESC"
>COM_PHOCACART_EMAIL_FILTER_DESC</option>
<option value="a.phone ASC"
>COM_PHOCACART_PHONE_ASC</option>
<option value="a.phone DESC"
>COM_PHOCACART_PHONE_DESC</option>
<option value="a.ip ASC"
>COM_PHOCACART_IP_ASC</option>
<option value="a.ip DESC"
>COM_PHOCACART_IP_DESC</option>
<option value="a.message ASC"
>COM_PHOCACART_MESSAGE_ASC</option>
<option value="a.message DESC"
>COM_PHOCACART_MESSAGE_DESC</option>
<option value="a.date ASC"
>COM_PHOCACART_DATE_ASC</option>
<option value="a.date DESC"
>COM_PHOCACART_DATE_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[�X�2
2
(models/forms/filter_phocacartregions.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="country_id" type="PhocacartCountry"
label="COM_PHOCACART_FIELD_COUNTRY_LABEL"
description="COM_PHOCACART_FIELD_COUNTRY_DESC"
class="input" default=""
onchange="this.form.submit();" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="country_title
ASC">COM_PHOCACART_COUNTRY_FILTER_ASC</option>
<option value="country_title
DESC">COM_PHOCACART_COUNTRY_FILTER_DESC</option>
<option value="a.code2
ASC">COM_PHOCACART_CODE2_ASC</option>
<option value="a.code2
DESC">COM_PHOCACART_CODE2_DESC</option>
<option value="a.code3
ASC">COM_PHOCACART_CODE3_ASC</option>
<option value="a.code3
DESC">COM_PHOCACART_CODE3_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[O�z z (models/forms/filter_phocacartreviews.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="productname
ASC">COM_PHOCACART_PRODUCT_FILTER_ASC</option>
<option value="productname
DESC">COM_PHOCACART_PRODUCT_FILTER_DESC</option>
<option value="a.name
ASC">COM_PHOCACART_NAME_ASC</option>
<option value="a.name
DESC">COM_PHOCACART_NAME_DESC</option>
<option value="a.review
ASC">COM_PHOCACART_REVIEW_ASC</option>
<option value="a.review
DESC">COM_PHOCACART_REVIEW_DESC</option>
<option value="a.rating
ASC">COM_PHOCACART_RATING_ASC</option>
<option value="a.rating
DESC">COM_PHOCACART_RATING_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[�"�R R (models/forms/filter_phocacartrewards.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="u.name ASC"
>COM_PHOCACART_USER_ASC</option>
<option value="u.name DESC"
>COM_PHOCACART_USER_DESC</option>
<option value="a.points ASC"
>COM_PHOCACART_POINTS_ASC</option>
<option value="a.points DESC"
>COM_PHOCACART_POINTS_DESC</option>
<option value="a.date ASC"
>COM_PHOCACART_DATE_ASC</option>
<option value="a.date DESC"
>COM_PHOCACART_DATE_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[v����)models/forms/filter_phocacartsections.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[�Gm���*models/forms/filter_phocacartshippings.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.method
ASC">COM_PHOCACART_METHOD_ASC</option>
<option value="a.method
DESC">COM_PHOCACART_METHOD_DESC</option>
<option value="a.cost
ASC">COM_PHOCACART_PRICE_ASC</option>
<option value="a.cost
DESC">COM_PHOCACART_PRICE_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[v����/models/forms/filter_phocacartspecifications.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[����� � )models/forms/filter_phocacartstatuses.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.stock_movements ASC"
>COM_PHOCACART_STOCK_MOVEMENTS_ASC</option>
<option value="a.stock_movements DESC"
>COM_PHOCACART_STOCK_MOVEMENTS_DESC</option>
<option value="a.download ASC"
>COM_PHOCACART_DOWNLOAD_ASC</option>
<option value="a.download DESC"
>COM_PHOCACART_DOWNLOAD_DESC</option>
<option value="a.type ASC"
>COM_PHOCACART_DEFAULT_ASC</option>
<option value="a.type DESC"
>COM_PHOCACART_DEFAULT_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[v����.models/forms/filter_phocacartstockstatuses.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[;n\���,models/forms/filter_phocacartsubmititems.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="user_username
ASC">COM_PHOCACART_USER_ASC</option>
<option value="user_username
DESC">COM_PHOCACART_USER_DESC</option>
<option value="a.date_submit
ASC">COM_PHOCACART_DATE_ASC</option>
<option value="a.date_submit
DESC">COM_PHOCACART_DATE_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[����%models/forms/filter_phocacarttags.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.type ASC"
>COM_PHOCACART_TYPE_ASC</option>
<option value="a.type DESC"
>COM_PHOCACART_TYPE_DESC</option>
<option value="a.count_products
ASC">COM_PHOCACART_PRODUCT_COUNT_ASC</option>
<option value="a.count_products
DESC">COM_PHOCACART_PRODUCT_COUNT_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[/�� &models/forms/filter_phocacarttaxes.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.tax_rate
ASC">COM_PHOCACART_TAX_RATE_ASC</option>
<option value="a.tax_rate
DESC">COM_PHOCACART_TAX_RATE_DESC</option>
<option value="a.calculation_type
ASC">COM_PHOCACART_CALCULATION_TYPE_ASC</option>
<option value="a.calculation_type
DESC">COM_PHOCACART_CALCULATION_TYPE_DESC</option>
<option value="a.published
ASC">COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published
DESC">COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[3��B B &models/forms/filter_phocacarttimes.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.type ASC"
>COM_PHOCACART_TYPE_ASC</option>
<option value="a.type DESC"
>COM_PHOCACART_TYPE_DESC</option>
<option value="a.day ASC"
>COM_PHOCACART_DAY_ASC</option>
<option value="a.day DESC"
>COM_PHOCACART_DAY_DESC</option>
<option value="a.date ASC"
>COM_PHOCACART_DATE_ASC</option>
<option value="a.date DESC"
>COM_PHOCACART_DATE_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[efl7 &models/forms/filter_phocacartunits.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="section_id" type="PhocacartSection"
label="COM_PHOCACART_FIELD_SECTION_LABEL"
description="COM_PHOCACART_FIELD_SECTION_DESC"
class="input" default=""
onchange="this.form.submit();" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="section_title
ASC">COM_PHOCACART_SECTION_ASC</option>
<option value="section_title
DESC">COM_PHOCACART_SECTION_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[�T��k
k
&models/forms/filter_phocacartusers.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="user_id" type="user"
label="COM_PHOCACART_FIELD_USER_LABEL"
description="COM_PHOCACART_FIELD_USER_DESC"
class="input" default="" onchange="adminForm =
document.getElementById('adminForm');adminForm.submit();"
/>
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.name ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="u.name ASC"
>COM_PHOCACART_NAME_ASC</option>
<option value="u.name DESC"
>COM_PHOCACART_NAME_DESC</option>
<option value="a.name_first ASC"
>COM_PHOCACART_NAME_FIRST_ASC</option>
<option value="a.name_first DESC"
>COM_PHOCACART_NAME_FIRST_DESC</option>
<option value="a.name_last ASC"
>COM_PHOCACART_NAME_LAST_ASC</option>
<option value="a.name_last DESC"
>COM_PHOCACART_NAME_LAST_DESC</option>
<option value="a.address_1 ASC"
>COM_PHOCACART_ADDRESS_ASC</option>
<option value="a.address_1 DESC"
>COM_PHOCACART_ADDRESS_DESC</option>
<option value="u.email
ASC">COM_PHOCACART_EMAIL_FILTER_ASC</option>
<option value="u.email
DESC">COM_PHOCACART_EMAIL_FILTER_DESC</option>
<option value="u.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="u.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[(�E���(models/forms/filter_phocacartvendors.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="user_username
ASC">COM_PHOCACART_USER_ASC</option>
<option value="user_username
DESC">COM_PHOCACART_USER_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[�$n n *models/forms/filter_phocacartwishlists.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="username ASC"
>COM_PHOCACART_USER_ASC</option>
<option value="username DESC"
>COM_PHOCACART_USER_DESC</option>
<option value="productname ASC"
>COM_PHOCACART_PRODUCT_FILTER_ASC</option>
<option value="productname DESC"
>COM_PHOCACART_PRODUCT_FILTER_DESC</option>
<option value="cattitle ASC"
>COM_PHOCACART_CATEGORY_FILTER_ASC</option>
<option value="cattitle DESC"
>COM_PHOCACART_CATEGORY_FILTER_DESC</option>
<option value="a.date ASC"
>COM_PHOCACART_DATE_ASC</option>
<option value="a.date DESC"
>COM_PHOCACART_DATE_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[׆���&models/forms/filter_phocacartzones.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<fields name="filter">
<field name="search" type="text"
inputmode="search" label="COM_PHOCACART_SEARCH"
description="COM_PHOCACART_SEARCH"
hint="JSEARCH_FILTER" />
<field name="published" type="list"
label="JOPTION_FILTER_PUBLISHED"
description="JOPTION_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();" >
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="1">COM_PHOCACART_PUBLISHED</option>
<option
value="0">COM_PHOCACART_UNPUBLISHED</option>
</field>
<!--<field name="language"
type="contentlanguage" label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();">
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>-->
<input type="hidden" name="form_submited"
value="1"/>
</fields>
<fields name="list">
<field name="fullordering" type="list"
label="COM_PHOCACART_LIST_FULL_ORDERING"
description="COM_PHOCACART_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();" default="a.title ASC"
validate="options" >
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.title
ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title
DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.code2
ASC">COM_PHOCACART_CODE2_ASC</option>
<option value="a.code2
DESC">COM_PHOCACART_CODE2_DESC</option>
<option value="a.code3
ASC">COM_PHOCACART_CODE3_ASC</option>
<option value="a.code3
DESC">COM_PHOCACART_CODE3_DESC</option>
<option value="a.published ASC"
>COM_PHOCACART_PUBLISHED_ASC</option>
<option value="a.published DESC"
>COM_PHOCACART_PUBLISHED_DESC</option>
<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field name="limit" type="limitbox"
label="COM_PHOCACART_LIST_LIMIT"
description="COM_PHOCACART_LIST_LIMIT_DESC"
class="input-mini" default="25"
onchange="this.form.submit();" />
</fields>
</fieldset>
</form>
PK�"�[�#o,,models/forms/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[����#models/forms/phocacartbulkprice.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text"
default="0" label="JGLOBAL_FIELD_ID_LABEL"
required="true" readonly="true"
class="readonly"/>
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true"/>
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC"/>
<field name="ordering"
type="PhocacartOrdering" table="product"
class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC"/>
<field name="description" type="textarea"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_DESCRIPTION_DESC"/>
<field name="status" type="radio"
class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_STATUS_LABEL"
description="COM_PHOCACART_FIELD_STATUS_DESC" size="1"
default="0" readonly="true">
<option value="1">COM_PHOCACART_ACTIVE</option>
<option value="0">COM_PHOCACART_INACTIVE</option>
</field>
</fieldset>
<fields name="params">
<fieldset name="params"
label="COM_PHOCACART_CONDITION">
<field name="amount" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_VALUE_LABEL"
description="COM_PHOCACART_FIELD_VALUE_DESC"
required="true"/>
<field name="operator" type="list"
label="COM_PHOCACART_FIELD_OPERATOR_PRICE_LABEL"
description="COM_PHOCACART_FIELD_OPERATOR_PRICE_DESC"
default="-">
<option value="+">+</option>
<option value="-">-</option>
</field>
<field name="calculation_type" type="list"
label="COM_PHOCACART_FIELD_CALCULATION_TYPE_LABEL"
description="COM_PHOCACART_FIELD_CALCULATION_TYPE_DESC"
class="inputbox" size="1" default="1">
<option value="1">COM_PHOCACART_PERCENTAGE</option>
<option value="0">COM_PHOCACART_FIXED_AMOUNT</option>
</field>
<field name="catid_multiple"
type="phocacartcategory"
label="COM_PHOCACART_FIELD_CATEGORY_LABEL"
description="COM_PHOCACART_FIELD_CATEGORY_DESC"
class="inputbox" multiple="true" />
<field name="calculation_rounding" type="list"
default="2"
label="COM_PHOCACART_FIELD_CALCULATION_ROUNDING_LABEL"
description="COM_PHOCACART_FIELD_CALCULATION_ROUNDING_DESC">
<option
value="-1">COM_PHOCACART_NO</option>
<option
value="0">COM_PHOCACART_YES_0_DIGITS</option>
<option
value="1">COM_PHOCACART_YES_1_DIGITS</option>
<option
value="2">COM_PHOCACART_YES_2_DIGITS</option>
</field>
<field name="original_price_change_run" type="list"
default="0"
label="COM_PHOCACART_FIELD_ORIGINAL_PRICE_CHANGE_RUN_OPTIONS_LABEL"
description="COM_PHOCACART_FIELD_ORIGINAL_PRICE_CHANGE_RUN_OPTIONS_DESC">
<option
value="0">COM_PHOCACART_NO_CHANGE</option>
<option
value="1">COM_PHOCACART_CURRENT_PRICE_BECOMES_NEW_ORIGINAL_PRICE</option>
<option
value="2">COM_PHOCACART_ORIGINAL_PRICE_WILL_BE_EMPTIED</option>
</field>
<field name="save_price_history_run" type="list"
label="COM_PHOCACART_FIELD_SAVE_PRICE_HISTORY_RUN_OPTIONS_LABEL"
description="COM_PHOCACART_FIELD_SAVE_PRICE_HISTORY_RUN_OPTIONS_DESC"
class="inputbox" size="1" default="1">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="original_price_change_revert"
type="list" default="1"
label="COM_PHOCACART_FIELD_ORIGINAL_PRICE_CHANGE_REVERT_OPTIONS_LABEL"
description="COM_PHOCACART_FIELD_ORIGINAL_PRICE_CHANGE_REVERT_OPTIONS_DESC">
<option
value="0">COM_PHOCACART_NO_CHANGE</option>
<option
value="1">COM_PHOCACART_ORIGINAL_PRICE_WILL_BE_SET_BACK</option>
<option
value="2">COM_PHOCACART_ORIGINAL_PRICE_WILL_BE_EMPTIED</option>
</field>
<field name="save_price_history_revert"
type="list"
label="COM_PHOCACART_FIELD_SAVE_PRICE_HISTORY_REVERT_OPTIONS_LABEL"
description="COM_PHOCACART_FIELD_SAVE_PRICE_HISTORY_REVERT_OPTIONS_DESC"
class="inputbox" size="1" default="1">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
</fieldset>
</fields>
</form>
PK�"�[�òD"models/forms/phocacartcategory.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text"
default="0" label="JGLOBAL_FIELD_ID_LABEL"
required="true" readonly="true"
class="readonly"/>
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true"/>
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC"/>
<field name="parent_id"
type="phocacartcategory"
label="COM_PHOCACART_FIELD_PARENT_CATEGORY_LABEL"
description="COM_PHOCACART_FIELD_PARENT_CATEGORY_DESC"
class="inputbox"/>
<field name="ordering"
type="PhocacartOrdering" table="category"
class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC"/>
<field name="access" type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC" class="inputbox"
size="1"/>
<field name="group" type="PhocacartGroups"
table="2" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CUSTOMER_GROUP_LABEL"
description="COM_PHOCACART_FIELD_CUSTOMER_GROUP_DESC"/>
<field name="type" type="list"
label="COM_PHOCACART_FIELD_TYPE_LABEL"
description="COM_PHOCACART_FIELD_TYPE_DESC"
class="inputbox" size="1" default="0">
<option
value="0">COM_PHOCACART_COMMON</option>
<option
value="1">COM_PHOCACART_ONLINE_SHOP_ONLY</option>
<option
value="2">COM_PHOCACART_POS_ONLY</option>
</field>
<field name="description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_DESCRIPTION_DESC"/>
<field name="image"
type="phocaselectfilenameimage" manager="categoryimage"
label="COM_PHOCACART_FIELD_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_DESC"
class="inputbox" size="40"/>
<field name="icon_class" type="text"
label="COM_PHOCACART_FIELD_CATEGORY_ICON_CLASS_LABEL"
description="COM_PHOCACART_FIELD_CATEGORY_ICON_CLASS_DESC"
class="inputbox" size="40" />
<field name="title_feed" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CATEGORY_TITLE_XML_FEED_LABEL"
description="COM_PHOCACART_FIELD_CATEGORY_TITLE_XML_FEED_DESC"/>
<field name="type_feed" type="textarea"
label="COM_PHOCACART_FIELD_CATEGORY_TYPE_FEED_LABEL"
description="COM_PHOCACART_FIELD_CATEGORY_TYPE_FEED_DESC"
class="inputbox" rows="3" cols="30"/>
<field name="metatitle" type="text"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
class="inputbox"/>
<field name="metakey" type="textarea"
label="JField_Meta_Keywords_Label"
description="JField_Meta_Keywords_Desc"
class="inputbox" rows="3"
cols="30"/>
<field name="metadesc" type="textarea"
label="JField_Meta_Description_Label"
description="JField_Meta_Description_Desc"
class="inputbox" rows="3"
cols="30"/>
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS">
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<field name="language"
type="contentlanguage" label="JFIELD_LANGUAGE_LABEL"
description="COM_PHOCACART_FIELD_LANGUAGE_DESC"
class="inputbox">
<option value="*">JALL</option>
</field>
<field name="date" type="Calendar"
class="inputbox" label="COM_PHOCACART_FIELD_DATE_LABEL"
description="COM_PHOCACART_FIELD_DATE_DESC"
filter="JComponentHelper::filterText"/>
<field name="created" type="Calendar"
class="inputbox"
label="COM_PHOCACART_FIELD_CREATED_DATE_LABEL"
description="COM_PHOCACART_FIELD_CREATED_DATE_DESC"
readonly="readonly" translateformat="true"
showtime="true" />
<field name="created_by" type="user"
class="inputbox"
label="COM_PHOCACART_FIELD_CREATED_BY_LABEL"
description="COM_PHOCACART_FIELD_CREATED_BY_DESC"
readonly="readonly" />
<field name="modified" type="Calendar"
class="inputbox"
label="COM_PHOCACART_FIELD_MODIFIED_DATE_LABEL"
description="COM_PHOCACART_FIELD_MODIFIED_DATE_DESC"
readonly="readonly" translateformat="true"
showtime="true" />
<field name="modified_by" type="user"
class="inputbox"
label="COM_PHOCACART_FIELD_MODIFIED_BY_LABEL"
description="COM_PHOCACART_FIELD_MODIFIED_BY_DESC"
readonly="readonly" />
<!--
<field name="hits" type="Text"
class="inputbox" size="6"
label="COM_PHOCACART_FIELD_HITS"
description="COM_PHOCACART_FIELD_HITS_DESC" />
-->
</fieldset>
<fields name="metadata">
<fieldset name="metadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<field name="robots"
type="list"
label="JFIELD_METADATA_ROBOTS_LABEL"
description="JFIELD_METADATA_ROBOTS_DESC"
>
<option
value="">JGLOBAL_USE_GLOBAL</option>
<option value="index,
follow">JGLOBAL_INDEX_FOLLOW</option>
<option value="noindex,
follow">JGLOBAL_NOINDEX_FOLLOW</option>
<option value="index,
nofollow">JGLOBAL_INDEX_NOFOLLOW</option>
<option value="noindex,
nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>
</field>
<!--
<field name="author" type="text"
label="JAUTHOR"
description="JField_Metadata_Author_Desc"
size="20" />
<field name="rights" type="text"
label="JFIELD_META_RIGHTS_LABEL"
description="JFIELD_META_RIGHTS_DESC"
required="" filter="string"
cols="30" rows="2" /> -->
</fieldset>
</fields>
</form>
PK�"�[�F�!models/forms/phocacartcountry.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="code2" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CODE2_LABEL"
description="COM_PHOCACART_FIELD_CODE2_DESC" />
<field name="code3" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CODE3_LABEL"
description="COM_PHOCACART_FIELD_CODE3_DESC" />
<field name="image" type="media"
manager="categoryimage"
label="COM_PHOCACART_FIELD_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_DESC"
class="inputbox" size="40" />
<field name="ordering" type="PhocacartOrdering"
table="country" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
<field name="metakey" type="textarea"
label="JField_Meta_Keywords_Label"
description="JField_Meta_Keywords_Desc"
class="inputbox" rows="3" cols="30" />
<field name="metadesc" type="textarea"
label="JField_Meta_Description_Label"
description="JField_Meta_Description_Desc"
class="inputbox" rows="3" cols="30" />
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<field name="language" type="contentlanguage"
label="JFIELD_LANGUAGE_LABEL"
description="COM_PHOCACART_FIELD_LANGUAGE_DESC"
class="inputbox">
<option value="*">JALL</option>
</field>
<!--
<field name="date" type="Calendar"
class="inputbox" label="COM_PHOCACART_FIELD_DATE_LABEL"
description="COM_PHOCACART_FIELD_DATE_DESC"
filter="JComponentHelper::filterText" />
<field name="hits" type="Text"
class="inputbox" size="6"
label="COM_PHOCACART_FIELD_HITS"
description="COM_PHOCACART_FIELD_HITS_DESC" />
-->
</fieldset>
<fields name="metadata">
<fieldset name="metadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<!--
<field name="robots" type="list"
label="JField_Metadata_Robots_Label"
description="JField_Metadata_Robots_Desc"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JGLOBAL_INDEX_FOLLOW</option>
<option value="1">JGLOBAL_NOINDEX_FOLLOW</option>
<option value="2">JGLOBAL_INDEX_NOFOLLOW</option>
<option value="3">JGLOBAL_NOINDEX_NOFOLLOW</option>
<option value="4">JGLOBAL_NO_ROBOTS_TAG</option>
</field>
<field name="author" type="text"
label="JAUTHOR"
description="JField_Metadata_Author_Desc" size="20"
/>
<field name="rights" type="text"
label="JFIELD_META_RIGHTS_LABEL"
description="JFIELD_META_RIGHTS_DESC"
required="" filter="string" cols="30"
rows="2" /> -->
</fieldset>
</fields>
</form>
PK�"�[N�@vDD
models/forms/phocacartcoupon.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="code" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_COUPON_CODE_LABEL"
description="COM_PHOCACART_FIELD_COUPON_CODE_DESC"
required="true" />
<field name="discount" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_DISCOUNT_LABEL"
description="COM_PHOCACART_FIELD_DISCOUNT_DESC" />
<field name="total_amount" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TOTAL_AMOUNT_LABEL"
description="COM_PHOCACART_FIELD_TOTAL_AMOUNT_DESC" />
<field name="quantity_from" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_MINIMUM_QUANTITY_COUPON_LABEL"
description="COM_PHOCACART_FIELD_MINIMUM_QUANTITY_COUPON_DESC"
/>
<field name="calculation_type" type="list"
label="COM_PHOCACART_FIELD_CALCULATION_TYPE_LABEL"
description="COM_PHOCACART_FIELD_CALCULATION_TYPE_DESC"
class="inputbox" size="1" default="1">
<option value="1">COM_PHOCACART_PERCENTAGE</option>
<option value="0">COM_PHOCACART_FIXED_AMOUNT</option>
</field>
<field name="type" type="list"
label="COM_PHOCACART_FIELD_TYPE_LABEL"
description="COM_PHOCACART_FIELD_TYPE_DESC"
class="inputbox" size="1" default="0">
<option value="0">COM_PHOCACART_COMMON</option>
<option
value="1">COM_PHOCACART_ONLINE_SHOP_ONLY</option>
<option value="2">COM_PHOCACART_POS_ONLY</option>
</field>
<field name="coupon_type" type="list"
label="COM_PHOCACART_FIELD_COUPON_TYPE_LABEL"
description="COM_PHOCACART_FIELD_COUPON_TYPE_DESC"
class="inputbox" size="1" default="0">
<option value="0">COM_PHOCACART_DEFAULT</option>
<option
value="2">COM_PHOCACART_GIFT_VOUCHER</option>
</field>
<field name="free_shipping" type="list"
label="COM_PHOCACART_FIELD_FREE_SHIPPING_LABEL"
description="COM_PHOCACART_FIELD_FREE_SHIPPING_DESC"
class="inputbox" size="1" default="0">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="free_payment" type="list"
label="COM_PHOCACART_FIELD_FREE_PAYMENT_LABEL"
description="COM_PHOCACART_FIELD_FREE_PAYMENT_DESC"
class="inputbox" size="1" default="0">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="available_quantity" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_AVAILABLE_QUANTITY_LABEL"
description="COM_PHOCACART_FIELD_AVAILABLE_QUANTITY_DESC" />
<field name="available_quantity_user" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_AVAILABLE_QUANTITY_USER_LABEL"
description="COM_PHOCACART_FIELD_AVAILABLE_QUANTITY_USER_DESC"
/>
<field name="cat_ids" type="phocacouponcategory"
label="COM_PHOCACART_FIELD_COUPON_CATEGORY_LABEL"
description="COM_PHOCACART_FIELD_COUPON_CATEGORY_DESC"
multiple="true" class="inputbox" />
<field name="category_filter" type="radio"
class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_CATEGORY_FILTER_LABEL"
description="COM_PHOCACART_FIELD_CATEGORY_FILTER_DESC"
size="1" default="1">
<option value="1">COM_PHOCACART_INCLUDE</option>
<option value="0">COM_PHOCACART_EXCLUDE</option>
</field>
<field name="product_ids" type="phocacouponproduct"
label="COM_PHOCACART_FIELD_COUPON_PRODUCT_LABEL"
description="COM_PHOCACART_FIELD_COUPON_PRODUCT_DESC"
class="inputbox" />
<field name="product_filter" type="radio"
class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_PRODUCT_FILTER_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_FILTER_DESC"
size="1" default="1">
<option value="1">COM_PHOCACART_INCLUDE</option>
<option value="0">COM_PHOCACART_EXCLUDE</option>
</field>
<field name="ordering" type="PhocacartOrdering"
table="product" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
<field name="access" type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC" class="inputbox"
size="1" />
<field name="group" type="PhocacartGroups"
table="6" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CUSTOMER_GROUP_LABEL"
description="COM_PHOCACART_FIELD_CUSTOMER_GROUP_DESC" />
<field name="description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_DESCRIPTION_DESC" />
<field name="gift_title" type="text"
label="COM_PHOCACART_FIELD_GIFT_TITLE_LABEL"
description="COM_PHOCACART_FIELD_GIFT_TITLE_DESC"
class="inputbox" size="40"/>
<field name="gift_description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_GIFT_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_GIFT_DESCRIPTION_DESC"/>
<field name="gift_image" type="media"
label="COM_PHOCACART_FIELD_GIFT_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_GIFT_IMAGE_DESC"
class="inputbox" size="40"/>
<field name="gift_recipient_name" type="text"
label="COM_PHOCACART_FIELD_GIFT_RECIPIENT_NAME_LABEL"
description="COM_PHOCACART_FIELD_GIFT_RECIPIENT_NAME_DESC"
class="inputbox" size="40"/>
<field name="gift_recipient_email" type="text"
label="COM_PHOCACART_FIELD_GIFT_RECIPIENT_EMAIL_LABEL"
description="COM_PHOCACART_FIELD_GIFT_RECIPIENT_EMAIL_DESC"
class="inputbox" size="40"/>
<field name="gift_sender_name" type="text"
label="COM_PHOCACART_FIELD_GIFT_SENDER_NAME_LABEL"
description="COM_PHOCACART_FIELD_GIFT_SENDER_NAME_DESC"
class="inputbox" size="40"/>
<field name="gift_sender_message" type="textarea"
label="COM_PHOCACART_FIELD_GIFT_SENDER_MESSAGE_LABEL"
description="COM_PHOCACART_FIELD_GIFT_SENDER_MESSAGE_DESC"
class="inputbox" size="40"/>
<field name="gift_type" type="text"
label="COM_PHOCACART_FIELD_GIFT_TYPE_LABEL"
description="COM_PHOCACART_FIELD_GIFT_TYPE_DESC"
size="40"/>
<field name="gift_class_name" type="text"
label="COM_PHOCACART_FIELD_GIFT_CLASS_NAME_LABEL"
description="COM_PHOCACART_FIELD_GIFT_CLASS_NAME_DESC"
size="40"/>
<field name="gift_order_id" type="text"
label="COM_PHOCACART_FIELD_ORDER_ID_LABEL"
description="COM_PHOCACART_FIELD_ORDER_ID_DESC"
size="40" readonly="true"
class="readonly"/>
<field name="gift_product_id" type="text"
label="COM_PHOCACART_FIELD_PRODUCT_ID_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_ID_DESC"
size="40" readonly="true"
class="readonly"/>
<field name="gift_order_product_id" type="text"
label="COM_PHOCACART_FIELD_ORDER_PRODUCT_ID_LABEL"
description="COM_PHOCACART_FIELD_ORDER_PRODUCT_ID_DESC"
size="40" readonly="true"
class="readonly"/>
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="valid_from" type="Calendar"
class="inputbox"
label="COM_PHOCACART_FIELD_VALID_FROM_LABEL"
description="COM_PHOCACART_FIELD_VALID_FROM_DESC"
filter="JComponentHelper::filterText" />
<field name="valid_to" type="Calendar"
class="inputbox"
label="COM_PHOCACART_FIELD_VALID_TO_LABEL"
description="COM_PHOCACART_FIELD_VALID_TO_DESC"
filter="JComponentHelper::filterText" />
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<field name="language" type="contentlanguage"
label="JFIELD_LANGUAGE_LABEL"
description="COM_PHOCACART_FIELD_LANGUAGE_DESC"
class="inputbox">
<option value="*">JALL</option>
</field>
</fieldset>
</form>
PK�"�[$��Ԩ�"models/forms/phocacartcurrency.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="code" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CURRENCY_CODE_LABEL"
description="COM_PHOCACART_FIELD_CURRENCY_CODE_DESC" />
<field name="exchange_rate" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_EXCHANGE_RATE_LABEL"
description="COM_PHOCACART_FIELD_EXCHANGE_RATE_DESC" />
<field name="price_format" type="list"
default="0"
label="COM_PHOCACART_FIELD_PRICE_FORMAT_LABEL"
description="COM_PHOCACART_FIELD_PRICE_FORMAT_DESC" >
<option
value="0">COM_PHOCACART_PRICE_S_CURRENCY_SYMBOL</option>
<option
value="1">COM_PHOCACART_PRICE_CURRENCY_SYMBOL</option>
<option
value="2">COM_PHOCACART_CURRENCY_SYMBOL_PRICE</option>
<option
value="3">COM_PHOCACART_CURRENCY_SYMBOL_S_PRICE</option>
</field>
<field name="price_currency_symbol" default=""
size="5" type="text"
label="COM_PHOCACART_FIELD_PRICE_CURRENCY_SYMBOL_LABEL"
description="COM_PHOCACART_FIELD_PRICE_CURRENCY_SYMBOL_LABEL"
/>
<field name="price_dec_symbol" default=","
size="5" type="text"
label="COM_PHOCACART_FIELD_PRICE_DECIMAL_SYMBOL_LABEL"
description="COM_PHOCACART_FIELD_PRICE_DECIMAL_SYMBOL_DESC" />
<field name="price_decimals" default="2"
size="5" type="text"
label="COM_PHOCACART_FIELD_PRICE_DECIMALS_LABEL"
description="COM_PHOCACART_FIELD_PRICE_DECIMALS_DESC" />
<field name="price_thousands_sep" default=""
size="5" type="text"
label="COM_PHOCACART_FIELD_PRICE_THOUSANDS_SEPARATOR_LABEL"
description="COM_PHOCACART_FIELD_PRICE_THOUSANDS_SEPARATOR_DESC"
/>
<field name="price_suffix" default=""
size="255" type="text"
label="COM_PHOCACART_FIELD_PRICE_SUFFIX_LABEL"
description="COM_PHOCACART_FIELD_PRICE_SUFFIX_DESC"
filter="safehtml" />
<field name="price_prefix" default=""
size="255" type="text"
label="COM_PHOCACART_FIELD_PRICE_PREFIX_LABEL"
description="COM_PHOCACART_FIELD_PRICE_PREFIX_LABEL"
filter="safehtml" />
<field name="image" type="media"
manager="categoryimage"
label="COM_PHOCACART_FIELD_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_DESC"
class="inputbox" size="40" />
<field name="ordering" type="PhocacartOrdering"
table="currency" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<field name="language" type="contentlanguage"
label="JFIELD_LANGUAGE_LABEL"
description="COM_PHOCACART_FIELD_LANGUAGE_DESC"
class="inputbox">
<option value="*">JALL</option>
</field>
<!--
<field name="date" type="Calendar"
class="inputbox" label="COM_PHOCACART_FIELD_DATE_LABEL"
description="COM_PHOCACART_FIELD_DATE_DESC"
filter="JComponentHelper::filterText" />
<field name="hits" type="Text"
class="inputbox" size="6"
label="COM_PHOCACART_FIELD_HITS"
description="COM_PHOCACART_FIELD_HITS_DESC" />
-->
</fieldset>
<fields name="metadata">
<fieldset name="metadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<!--
<field name="robots" type="list"
label="JField_Metadata_Robots_Label"
description="JField_Metadata_Robots_Desc"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JGLOBAL_INDEX_FOLLOW</option>
<option value="1">JGLOBAL_NOINDEX_FOLLOW</option>
<option value="2">JGLOBAL_INDEX_NOFOLLOW</option>
<option value="3">JGLOBAL_NOINDEX_NOFOLLOW</option>
<option value="4">JGLOBAL_NO_ROBOTS_TAG</option>
</field>
<field name="author" type="text"
label="JAUTHOR"
description="JField_Metadata_Author_Desc" size="20"
/>
<field name="rights" type="text"
label="JFIELD_META_RIGHTS_LABEL"
description="JFIELD_META_RIGHTS_DESC"
required="" filter="string" cols="30"
rows="2" /> -->
</fieldset>
</fields>
</form>
PK�"�[=
C��"models/forms/phocacartdiscount.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="discount" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_DISCOUNT_LABEL"
description="COM_PHOCACART_FIELD_DISCOUNT_DESC" />
<field name="total_amount" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TOTAL_AMOUNT_LABEL"
description="COM_PHOCACART_FIELD_DISCOUNT_TOTAL_AMOUNT_DESC"
/>
<field name="calculation_type" type="list"
label="COM_PHOCACART_FIELD_CALCULATION_TYPE_LABEL"
description="COM_PHOCACART_FIELD_CALCULATION_TYPE_DESC"
class="inputbox" size="1" default="1">
<option value="1">COM_PHOCACART_PERCENTAGE</option>
<option value="0">COM_PHOCACART_FIXED_AMOUNT</option>
</field>
<!--
<field name="quantity_from" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_QUANTITY_FROM_LABEL"
description="COM_PHOCACART_FIELD_QUANTITY_FROM_DESC" />
-->
<field name="quantity_from" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_MINIMUM_QUANTITY_LABEL"
description="COM_PHOCACART_FIELD_MINIMUM_QUANTITY_DESC" />
<field name="quantity_to" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_QUANTITY_TO_LABEL"
description="COM_PHOCACART_FIELD_QUANTITY_FROM_DESC" />
<field name="free_shipping" type="list"
label="COM_PHOCACART_FIELD_FREE_SHIPPING_LABEL"
description="COM_PHOCACART_FIELD_DISCOUNT_FREE_SHIPPING_DESC"
class="inputbox" size="1" default="0">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="free_payment" type="list"
label="COM_PHOCACART_FIELD_FREE_PAYMENT_LABEL"
description="COM_PHOCACART_FIELD_DISCOUNT_FREE_PAYMENT_DESC"
class="inputbox" size="1" default="0">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="cat_ids" type="phocadiscountcategory"
label="COM_PHOCACART_FIELD_DISCOUNT_CATEGORY_LABEL"
description="COM_PHOCACART_FIELD_DISCOUNT_CATEGORY_DESC"
multiple="true" class="inputbox" />
<field name="category_filter" type="radio"
class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_CATEGORY_FILTER_LABEL"
description="COM_PHOCACART_FIELD_CATEGORY_FILTER_DESC"
size="1" default="1">
<option value="1">COM_PHOCACART_INCLUDE</option>
<option value="0">COM_PHOCACART_EXCLUDE</option>
</field>
<field name="product_ids"
type="phocadiscountproduct"
label="COM_PHOCACART_FIELD_DISCOUNT_PRODUCT_LABEL"
description="COM_PHOCACART_FIELD_DISCOUNT_PRODUCT_DESC"
class="inputbox" />
<field name="product_filter" type="radio"
class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_PRODUCT_FILTER_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_FILTER_DESC"
size="1" default="1">
<option value="1">COM_PHOCACART_INCLUDE</option>
<option value="0">COM_PHOCACART_EXCLUDE</option>
</field>
<field name="ordering" type="PhocacartOrdering"
table="product" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
<field name="access" type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC" class="inputbox"
size="1" />
<field name="group" type="PhocacartGroups"
table="5" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CUSTOMER_GROUP_LABEL"
description="COM_PHOCACART_FIELD_CUSTOMER_GROUP_DESC" />
<field name="description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_DESCRIPTION_DESC" />
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="valid_from" type="Calendar"
class="inputbox"
label="COM_PHOCACART_FIELD_VALID_FROM_LABEL"
description="COM_PHOCACART_FIELD_DISCOUNT_VALID_FROM_DESC"
filter="JComponentHelper::filterText" />
<field name="valid_to" type="Calendar"
class="inputbox"
label="COM_PHOCACART_FIELD_VALID_TO_LABEL"
description="COM_PHOCACART_FIELD_DISCOUNT_VALID_TO_DESC"
filter="JComponentHelper::filterText" />
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<field name="language" type="contentlanguage"
label="JFIELD_LANGUAGE_LABEL"
description="COM_PHOCACART_FIELD_LANGUAGE_DESC"
class="inputbox">
<option value="*">JALL</option>
</field>
</fieldset>
</form>
PK�"�[�sӉ��"models/forms/phocacartdownload.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="COM_PHOCACART_ORDER_DOWNLOAD_ID_LABEL"
description="COM_PHOCACART_ORDER_DOWNLOAD_ID_DESC"
required="true" readonly="true"
class="readonly" />
<!--
<field name="user_id" type="text"
default="0" label="COM_PHOCACART_USER_ID_LABEL"
description="COM_PHOCACART_USER_ID_DESC"
required="true" readonly="true"
class="readonly" />-->
<field name="title" type="text" default=""
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC" />
<field name="download_file" type="text"
default=""
label="COM_PHOCACART_FIELD_ORDER_FILENAME_LABEL"
description="COM_PHOCACART_FIELD_ORDER_FILENAME_DESC" />
<field name="download_hits" type="text"
default=""
label="COM_PHOCACART_FIELD_DOWNLOAD_HITS_LABEL"
description="COM_PHOCACART_FIELD_DOWNLOAD_HITS_DESC" />
<field name="date" type="Calendar"
class="inputbox" label="COM_PHOCACART_FIELD_DATE_LABEL"
description="COM_PHOCACART_FIELD_DATE_DESC"
filter="JComponentHelper::filterText" />
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
</fieldset>
</form>
PK�"�[�YH�??models/forms/phocacartfeed.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="header" type="textarea"
label="COM_PHOCACART_FIELD_XML_HEADER_LABEL"
description="COM_PHOCACART_FIELD_XML_HEADER_DESC"
rows="4" cols="40" filter="raw" />
<field name="footer" type="textarea"
label="COM_PHOCACART_FIELD_XML_FOOTER_LABEL"
description="COM_PHOCACART_FIELD_XML_FOOTEr_DESC"
rows="4" cols="40" filter="raw" />
<field name="root" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_XML_ROOT_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_XML_ROOT_ELEMENT_DESC" />
<field name="item" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_XML_ITEM_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_XML_ITEM_ELEMENT_DESC" />
<field name="ordering" type="PhocacartOrdering"
table="product" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
<field name="description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_DESCRIPTION_DESC" />
<field name="feed_plugin"
type="PhocaCartXmlFeedPlugin" class="inputbox"
label="COM_PHOCACART_FIELD_XML_FEED_PLUGIN_LABEL"
description="COM_PHOCACART_FIELD_XML_FEED_PLUGIN_DESC" />
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<field name="language" type="contentlanguage"
label="JFIELD_LANGUAGE_LABEL"
description="COM_PHOCACART_FIELD_LANGUAGE_DESC"
class="inputbox">
<option value="*">JALL</option>
</field>
</fieldset>
<fields name="item_params">
<fieldset name="item_params"
label="COM_PHOCACART_PRODUCT_OPTIONS">
<field name="item_id" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_ID_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_ID_ELEMENT_DESC" />
<field name="item_title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_TITLE_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_TITLE_ELEMENT_DESC"
/>
<field name="item_title_extended" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_TITLE_EXTENDED_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_TITLE_EXTENDED_ELEMENT_DESC"
/>
<field name="item_sku" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_SKU_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_SKU_ELEMENT_DESC" />
<field name="item_ean" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_EAN_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_EAN_ELEMENT_DESC" />
<field name="item_description_short" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_DESCRIPTION_ELEMENT_SHORT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_DESCRIPTION_ELEMENT_SHORT_DESC"
/>
<field name="item_description_long" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_DESCRIPTION_ELEMENT_LONG_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_DESCRIPTION_ELEMENT_LONG_LABEL"
/>
<field name="item_features" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_FEATURES_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_FEATURES_ELEMENT_DESC"
/>
<field name="item_url" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_URL_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_URL_ELEMENT_DESC" />
<field name="item_url_image" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_IMAGE_URL_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_IMAGE_URL_ELEMENT_DESC"
/>
<field name="item_url_video" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_VIDEO_URL_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_VIDEO_URL_ELEMENT_DESC"
/>
<field name="item_manufacturer" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_MANUFACTURER_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_MANUFACTURER_ELEMENT_DESC"
/>
<field name="item_category" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CATEGORY_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_CATEGORY_ELEMENT_DESC"
/>
<field name="item_categories" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_CATEGORIES_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_CATEGORIES_ELEMENT_DESC"
/>
<field name="feed_category" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_FEED_CATEGORY_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_FEED_CATEGORY_ELEMENT_DESC"
/>
<field name="item_original_price_with_vat"
type="text" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ORIGINAL_PRICE_WITH_VAT_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_ORIGINAL_PRICE_WITH_VAT_ELEMENT_DESC"
/>
<field name="item_original_price_without_vat"
type="text" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ORIGINAL_PRICE_WITHOUT_VAT_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_ORIGINAL_PRICE_WITHOUT_VAT_ELEMENT_DESC"
/>
<field name="item_final_price_with_vat" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_FINAL_PRICE_WITH_VAT_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_FINAL_PRICE_WITH_VAT_ELEMENT_DESC"
/>
<field name="item_final_price_without_vat"
type="text" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_FINAL_PRICE_WITHOUT_VAT_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_FINAL_PRICE_WITHOUT_VAT_ELEMENT_DESC"
/>
<field name="item_vat" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_VAT_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_VAT_ELEMENT_DESC" />
<field name="item_currency" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_CURRENCY_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_CURRENCY_ELEMENT_DESC"
/>
<field name="item_stock" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_STOCK_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_STOCK_ELEMENT_DESC"
/>
<field name="item_delivery_date" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_DELIVERY_DATE_STOCK_STATUS_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_DELIVERY_DATE_STOCK_STATUS_ELEMENT_DESC"
/>
<field name="item_delivery_date_date" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_DELIVERY_DATE_DATE_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_DELIVERY_DATE_DATE_ELEMENT_DESC"
/>
<field name="feed_delivery_date" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_FEED_DELIVERY_DATE_STOCK_STATUS_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_FEED_DELIVERY_DATE_STOCK_STATUS_ELEMENT_DESC"
/>
<field name="item_attribute" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_ATTRIBUTE_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_ATTRIBUTE_ELEMENT_DESC"
/>
<field name="item_attribute_name" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_ATTRIBUTE_NAME_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_ATTRIBUTE_NAME_ELEMENT_DESC"
/>
<field name="item_attribute_value" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_ATTRIBUTE_VALUE_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_ATTRIBUTE_VALUE_ELEMENT_DESC"
/>
<field name="item_specification" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_SPECIFICATION_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_SPECIFICATION_ELEMENT_DESC"
/>
<!--<field name="item_specification_group_name"
type="text" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_SPECIFICATION_GROUP_NAME_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_SPECIFICATION_GROUP_NAME_ELEMENT_DESC"
/>-->
<field name="item_specification_name" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_SPECIFICATION_NAME_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_SPECIFICATION_NAME_ELEMENT_DESC"
/>
<field name="item_specification_value" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_SPECIFICATION_VALUE_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_SPECIFICATION_VALUE_ELEMENT_DESC"
/>
<field name="item_condition" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_CONDITION_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_CONDITION_ELEMENT_DESC"
/>
<field name="item_type_feed" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_TYPE_FEED_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_TYPE_FEED_ELEMENT_DESC"
/>
<field name="item_category_type_feed" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_CATEGORY_TYPE_FEED_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_CATEGORY_TYPE_FEED_ELEMENT_DESC"
/>
<field name="item_reward_points" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_REWARD_POINTS_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_REWARD_POINTS_ELEMENT_DESC"
/>
<field name="item_reward_points_name" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_REWARD_POINTS_NAME_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_REWARD_POINTS_NAME_ELEMENT_DESC"
/>
<field name="item_reward_points_value" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_REWARD_POINTS_VALUE_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_REWARD_POINTS_VALUE_ELEMENT_DESC"
/>
<field name="item_fixed_elements" type="textarea"
label="COM_PHOCACART_FIELD_PRODUCT_FIXED_ELEMENTS_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_FIXED_ELEMENTS_DESC"
rows="4" cols="40" filter="raw" />
<!--
<field name="item_delivery" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_DELIVERY_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_DELIVERY_ELEMENT_DESC" />
<field name="item_delivery_name" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_DELIVERY_NAME_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_DELIVERY_NAME_ELEMENT_DESC"
/>
<field name="item_delivery_price" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_DELIVERY_PRICE_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_DELIVERY_PRICE_ELEMENT_DESC"
/>
<field name="item_group_id" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_GROUP_ID_ELEMENT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_GROUP_ID_ELEMENT_DESC"
/>
-->
</fieldset>
</fields>
<fields name="feed_params">
<fieldset name="feed_params"
label="COM_PHOCACART_FEED_OPTIONS">
<field name="export_published_only" type="radio"
class="btn-group btn-group-yesno" default="1"
label="COM_PHOCACART_FIELD_EXPORT_ONLY_PUBLISHED_PRODUCTS_LABEL"
description="COM_PHOCACART_FIELD_EXPORT_ONLY_PUBLISHED_PRODUCTS_LABEL">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="export_in_stock_only" type="radio"
class="btn-group btn-group-yesno" default="0"
label="COM_PHOCACART_FIELD_EXPORT_ONLY_PRODUCTS_IN_STOCK_LABEL"
description="COM_PHOCACART_FIELD_EXPORT_ONLY_PRODUCTS_IN_STOCK_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="export_price_only" type="radio"
class="btn-group btn-group-yesno" default="1"
label="COM_PHOCACART_FIELD_EXPORT_ONLY_PRODUCTS_WITH_PRICE_LABEL"
description="COM_PHOCACART_FIELD_EXPORT_ONLY_PRODUCTS_WITH_PRICE_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="strip_html_tags_desc" type="radio"
class="btn-group btn-group-yesno" default="1"
label="COM_PHOCACART_FIELD_STRIP_HTML_TAGS_DESCRIPTION_LABEL"
description="COM_PHOCACART_FIELD_STRIP_HTML_TAGS_DESCRIPTION_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="display_attributes" type="radio"
class="btn-group btn-group-yesno" default="0"
label="COM_PHOCACART_FIELD_FEED_DISPLAY_ATTRIBUTES_LABEL"
description="COM_PHOCACART_FIELD_FEED_DISPLAY_ATTRIBUTES_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<!--
<field name="display_specifications" type="radio"
class="btn-group btn-group-yesno" default="0"
label="COM_PHOCACART_FIELD_FEED_DISPLAY_SPECIFICATIONS_LABEL"
description="COM_PHOCACART_FIELD_FEED_DISPLAY_SPECIFICATIONS_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>-->
<field name="specification_groups_id"
multiple="true" type="PhocacartSpecificationGroups"
default=""
label="COM_PHOCACART_FIELD_FEED_SPECIFICATION_GROUPS_LABEL"
description="COM_PHOCACART_FIELD_FEED_SPECIFICATION_GROUPS_DESC"
class="inputbox" />
<field name="item_limit" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_LIMIT_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_LIMIT_DESC" />
<field name="item_ordering" type="list"
default="1"
label="COM_PHOCACART_FIELD_PRODUCT_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_ORDERING_DESC">
<option
value="1">COM_PHOCACART_ORDERING_ASC</option>
<option
value="2">COM_PHOCACART_ORDERING_DESC</option>
<option value="3">COM_PHOCACART_TITLE_ASC</option>
<option value="4">COM_PHOCACART_TITLE_DESC</option>
<option value="5">COM_PHOCACART_PRICE_ASC</option>
<option value="6">COM_PHOCACART_PRICE_DESC</option>
<option value="7">COM_PHOCACART_DATE_ASC</option>
<option value="8">COM_PHOCACART_DATE_DESC</option>
<option value="9">COM_PHOCACART_RATING_ASC</option>
<option
value="10">COM_PHOCACART_RATING_DESC</option>
</field>
<field name="category_ordering" type="list"
default="0"
label="COM_PHOCACART_FIELD_CATEGORY_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_CATEGORY_ORDERING_DESC">
<option
value="0">COM_PHOCACART_ORDERING_NOT_SET</option>
<option
value="1">COM_PHOCACART_ORDERING_ASC</option>
<option
value="2">COM_PHOCACART_ORDERING_DESC</option>
<option value="3">COM_PHOCACART_TITLE_ASC</option>
<option value="4">COM_PHOCACART_TITLE_DESC</option>
<option value="5">COM_PHOCACART_DATE_ASC</option>
<option value="6">COM_PHOCACART_DATE_DESC</option>
</field>
<field name="category_separator" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CATEGORY_SEPARATOR_LABEL"
description="COM_PHOCACART_FIELD_CATEGORY_SEPARATOR_DESC" />
<field name="load_all_categories" type="radio"
class="btn-group btn-group-yesno" default="0"
label="COM_PHOCACART_FIELD_LOAD_ALL_CATEGORIES_FEED_LABEL"
description="COM_PHOCACART_FIELD_LOAD_ALL_CATEGORIES_FEED_DESC">
<option value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
</field>
<field name="price_decimals" default=""
type="text" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRICE_DECIMALS_LABEL"
description="COM_PHOCACART_FIELD_PRICE_DECIMALS_DESC" />
<field name="price_including_currency" type="list"
default="0"
label="COM_PHOCACART_FIELD_PRICE_INCLUDING_CURRENCY_LABEL"
description="COM_PHOCACART_FIELD_PRICE_INCLUDING_CURRENCY_DESC">
<option value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
</field>
</fieldset>
</fields>
</form>
PK�"�[��KCC#models/forms/phocacartformfield.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_NAME_LABEL"
description="COM_PHOCACART_FIELD_FORMFIELD_NAME_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="label" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_LABEL_LABEL"
description="COM_PHOCACART_FIELD_LABEL_LANG_STRING_DESC"
required="true" />
<field name="description" type="textarea"
label="COM_PHOCACART_FIELD_DESCRIPTION_LABEL"
description="COM_PHOCACART_FIELD_DESCRIPTION_LANG_STRING_DESC"
class="inputbox" rows="3" cols="30"
required="true" />
<field name="id_input" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ID_LABEL"
description="COM_PHOCACART_FIELD_ID_DESC" />
<field name="type" type="list"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TYPE_LABEL"
description="COM_PHOCACART_FIELD_TYPE_DESC"
required="true">
<option value="text:varchar(10)">text -
varchar(10)</option>
<option value="text:varchar(20)">text -
varchar(20)</option>
<option value="text:varchar(25)">text -
varchar(25)</option>
<option value="text:varchar(100)">text -
varchar(100)</option>
<option value="text:varchar(255)">text -
varchar(255)</option>
<option value="textarea:text">textarea -
text</option>
<option value="calendar:datetime">calendar -
datetime</option>
<option value="phocaformcountry:int(11)">country
int(11)</option>
<option value="phocaformregion:int(11)">region
int(11)</option>
</field>
<field name="predefined_values" type="textarea"
label="COM_PHOCACART_FIELD_PREDEFINED_VALUES_LABEL"
description="COM_PHOCACART_FIELD_PREDEFINED_VALUES_DESC"
class="inputbox" rows="3" cols="30"/>
<field name="predefined_values_first_option"
type="text" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PREDEFINED_VALUES_FIRST_OPTION_TITLE_LABEL"
description="COM_PHOCACART_FIELD_PREDEFINED_VALUES_FIRST_OPTION_TITLE_DESC"
/>
<field name="default" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_DEFAULT_LABEL"
description="COM_PHOCACART_FIELD_DEFAULT_DESC" />
<field name="size" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_SIZE_LABEL"
description="COM_PHOCACART_FIELD_SIZE_DESC" />
<field name="cols" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_COLS_LABEL"
description="COM_PHOCACART_FIELD_COLS_DESC" />
<field name="rows" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ROWS_LABEL"
description="COM_PHOCACART_FIELD_ROWS_DESC" />
<field name="class" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CLASS_LABEL"
description="COM_PHOCACART_FIELD_CLASS_DESC" />
<field name="filter" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_FILTER_LABEL"
description="COM_PHOCACART_FIELD_FILTER_DESC" />
<field name="required" default="0"
type="radio" class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_REQUIRED_LABEL"
description="COM_PHOCACART_FIELD_REQUIRED_DESC" >
<option value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
</field>
<field name="read_only" default="0"
type="list" class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_READ_ONLY_LABEL"
description="COM_PHOCACART_FIELD_READ_ONLY_DESC" >
<option value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
<option
value="3">COM_PHOCACART_YES_EXCEPT_FOR_ORDER_EDITING_IN_ADMINISTRATION</option>
<option
value="2">COM_PHOCACART_YES_REGISTERED_USERS_NO_GUESTS</option>
<option
value="4">COM_PHOCACART_YES_REGISTERED_USERS_NO_GUESTS_EXCEPT_FOR_ORDER_EDITING_IN_ADMINISTRATION</option>
</field>
<field name="validate" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_VALIDATE_LABEL"
description="COM_PHOCACART_FIELD_VALIDATE_DESC" />
<field name="unique" default="0"
type="radio" class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_UNIQUE_LABEL"
description="COM_PHOCACART_FIELD_UNIQUE_DESC" >
<option value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
</field>
<field name="preicon" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PREICON_LABEL"
description="COM_PHOCACART_FIELD_PREICON_DESC" />
<field name="additional"
label="COM_PHOCACART_FIELD_ADDITIONAL_ATTRIBUTES_LABEL"
description="COM_PHOCACART_FIELD_ADDITIONAL_ATTRIBUTES_DESC"
class="inputbox" />
<field name="pattern"
label="COM_PHOCACART_FIELD_PATTERN_LABEL"
description="COM_PHOCACART_FIELD_PATTERN_DESC"
class="inputbox" />
<field name="maxlength"
label="COM_PHOCACART_FIELD_MAXLENGTH_LABEL"
description="COM_PHOCACART_FIELD_MAXLENGTH_DESC"
class="inputbox" />
<field name="ordering" type="PhocacartOrdering"
table="formfield" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
<field name="access" type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC" class="inputbox"
size="1" />
<field name="group" type="PhocacartGroups"
table="9" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CUSTOMER_GROUP_LABEL"
description="COM_PHOCACART_FIELD_CUSTOMER_GROUP_DESC" />
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<field name="display_billing" default="0"
type="radio" class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_DISPLAY_BILLING_FORM_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_BILLING_FORM_DESC" >
<option value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
</field>
<field name="display_shipping" default="0"
type="radio" class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_DISPLAY_SHIPPING_FORM_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_SHIPPING_FORM_DESC" >
<option value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
</field>
<field name="display_account" default="0"
type="radio" class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_DISPLAY_USER_ACCOUNT_FORM_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_USER_ACCOUNT_FORM_DESC"
>
<option value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
</field>
<!--
<field name="language" type="contentlanguage"
label="JFIELD_LANGUAGE_LABEL"
description="COM_PHOCACART_FIELD_LANGUAGE_DESC"
class="inputbox">
<option value="*">JALL</option>
</field> -->
</fieldset>
</form>
PK�"�[堫���models/forms/phocacartgroup.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text"
default="0" label="JGLOBAL_FIELD_ID_LABEL"
required="true" readonly="true"
class="readonly"/>
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true"/>
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC"/>
<field name="image" type="media"
manager="categoryimage"
label="COM_PHOCACART_FIELD_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_DESC"
class="inputbox" size="40"/>
<field name="ordering"
type="phocacartOrdering" table="payment"
class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC"/>
<field name="access" type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC" class="inputbox"
size="1"/>
<field name="display_price" type="list"
label="COM_PHOCACART_FIELD_DISPLAY_PRICE_GROUP_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_PRICE_GROUP_DESC"
class="inputbox" size="1" default="1">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<field name="display_addtocart" type="list"
label="COM_PHOCACART_FIELD_DISPLAY_ADD_TO_CART_GROUP_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_ADD_TO_CART_GROUP_DESC"
class="inputbox" size="1" default="1">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<field name="display_attributes" type="list"
label="COM_PHOCACART_FIELD_DISPLAY_ATTRIBUTES_GROUP_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_ATTRIBUTES_GROUP_DESC"
class="inputbox" size="1" default="1">
<option
value="0">COM_PHOCACART_NO</option>
<option
value="1">COM_PHOCACART_YES</option>
</field>
<!-- RULE -->
<field name="minimum_sum" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_MINIMAL_SUM_OF_PURCHASES_LABEL"
description="COM_PHOCACART_FIELD_MINIMAL_SUM_OF_PURCHASES_DESC"/>
<field name="description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_DESCRIPTION_DESC"/>
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS">
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
</fieldset>
</form>
PK�"�[�?MnNNmodels/forms/phocacartitem.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text"
default="0" label="JGLOBAL_FIELD_ID_LABEL"
required="true" readonly="true"
class="readonly"/>
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true"/>
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC"/>
<field name="sku" type="text"
class="inputbox" size="255"
label="COM_PHOCACART_FIELD_SKU_LABEL"
description="COM_PHOCACART_FIELD_SKU_DESC"/>
<field name="upc" type="text"
class="inputbox" size="15"
label="COM_PHOCACART_FIELD_UPC_LABEL"
description="COM_PHOCACART_FIELD_UPC_DESC"/>
<field name="ean" type="text"
class="inputbox" size="15"
label="COM_PHOCACART_FIELD_EAN_LABEL"
description="COM_PHOCACART_FIELD_EAN_DESC"/>
<field name="jan" type="text"
class="inputbox" size="15"
label="COM_PHOCACART_FIELD_JAN_LABEL"
description="COM_PHOCACART_FIELD_JAN_DESC"/>
<field name="isbn" type="text"
class="inputbox" size="15"
label="COM_PHOCACART_FIELD_ISBN_LABEL"
description="COM_PHOCACART_FIELD_ISBN_DESC"/>
<field name="mpn" type="text"
class="inputbox" size="255"
label="COM_PHOCACART_FIELD_MPN_LABEL"
description="COM_PHOCACART_FIELD_MPN_DESC"/>
<field name="serial_number" type="text"
class="inputbox" size="255"
label="COM_PHOCACART_FIELD_SERIAL_NUMBER_LABEL"
description="COM_PHOCACART_FIELD_SERIAL_NUMBER_DESC"/>
<field name="registration_key" type="text"
class="inputbox" size="255"
label="COM_PHOCACART_FIELD_REGISTRATION_KEY_LABEL"
description="COM_PHOCACART_FIELD_REGISTRATION_KEY_DESC"/>
<field name="external_id" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_EXTERNAL_PRODUCT_ID_LABEL"
description="COM_PHOCACART_FIELD_EXTERNAL_PRODUCT_ID_DESC"/>
<field name="external_key" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_EXTERNAL_PRODUCT_KEY_LABEL"
description="COM_PHOCACART_FIELD_EXTERNAL_PRODUCT_KEY_DESC"/>
<field name="external_link" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_EXTERNAL_LINK_LABEL"
description="COM_PHOCACART_FIELD_EXTERNAL_LINK_DESC"/>
<field name="external_text" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_EXTERNAL_TEXT_LABEL"
description="COM_PHOCACART_FIELD_EXTERNAL_TEXT_DESC"/>
<field name="external_link2" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_EXTERNAL_LINK_2_LABEL"
description="COM_PHOCACART_FIELD_EXTERNAL_LINK_2_DESC"/>
<field name="external_text2" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_EXTERNAL_TEXT_2_LABEL"
description="COM_PHOCACART_FIELD_EXTERNAL_TEXT_2_DESC"/>
<field name="featured" type="radio"
class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_FEATURED_LABEL"
description="COM_PHOCACART_FIELD_FEATURED_DESC"
default="0">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="featured_background_image"
type="media"
label="COM_PHOCACART_FIELD_FEATURED_PRODUCT_BACKGROUND_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_FEATURED_PRODUCT_BACKGROUND_IMAGE_LABEL"
class="inputbox" size="40"/>
<field name="price" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRICE_LABEL"
description="COM_PHOCACART_FIELD_PRICE_DESC"/>
<field name="price_original" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ORIGINAL_PRICE_LABEL"
description="COM_PHOCACART_FIELD_ORIGINAL_PRICE_DESC"/>
<field name="tax_id" type="phocatax"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TAX_LABEL"
description="COM_PHOCACART_FIELD_TAX_DESC"/>
<!--
<field name="catid" type="phocacartcategory"
label="COM_PHOCACART_FIELD_CATEGORY_LABEL"
description="COM_PHOCACART_FIELD_CATEGORY_DESC"
class="inputbox" required="true" />-->
<field name="catid_multiple"
type="phocacartcategory"
label="COM_PHOCACART_FIELD_CATEGORY_LABEL"
description="COM_PHOCACART_FIELD_CATEGORY_DESC"
class="inputbox" multiple="true"
required="true"/>
<field name="manufacturer_id"
type="phocamanufacturer"
label="COM_PHOCACART_FIELD_MANUFACTURER_LABEL"
description="COM_PHOCACART_FIELD_MANUFACTURER_DESC"
class="inputbox"/>
<field name="ordering"
type="PhocacartOrdering" table="product"
class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC"/>
<field name="access" type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC" class="inputbox"
size="1"/>
<field name="group" type="PhocacartGroups"
table="3" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CUSTOMER_GROUP_LABEL"
description="COM_PHOCACART_FIELD_CUSTOMER_GROUP_DESC"/>
<field name="description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_DESCRIPTION_DESC"/>
<field name="description_long" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LONG_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_DESCRIPTION_LONG_DESC"/>
<field name="features" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_FEATURES_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_FEATURES_DESC"/>
<field name="stock" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_IN_STOCK_LABEL"
description="COM_PHOCACART_FIELD_IN_STOCK_DESC"/>
<field name="stock_calculation" type="list"
label="COM_PHOCACART_FIELD_PRODUCT_STOCK_CALCULATION_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_STOCK_CALCULATION_DESC"
class="inputbox" size="1" default="0">
<option
value="0">COM_PHOCACART_MAIN_PRODUCT</option>
<option
value="1">COM_PHOCACART_PRODUCT_VARIATIONS_ATTRIBUTES</option>
<option
value="2">COM_PHOCACART_ADVANCED_STOCK_MANAGEMENT</option>
<option
value="3">COM_PHOCACART_ADVANCED_STOCK_AND_PRICE_MANAGEMENT</option>
</field>
<field name="min_quantity" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_MIN_ORDER_QUANTITY_LABEL"
description="COM_PHOCACART_FIELD_MIN_ORDER_QUANTITY_DESC"/>
<field name="min_multiple_quantity"
type="text" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_MIN_MULTIPLE_ORDER_QUANTITY_LABEL"
description="COM_PHOCACART_FIELD_MIN_MULTIPLE_ORDER_QUANTITY_DESC"/>
<field name="min_quantity_calculation"
default="0" type="list"
label="COM_PHOCACART_FIELD_MINIMUM_QUANTITY_CALCULATION_LABEL"
description="COM_PHOCACART_FIELD_MINIMUM_QUANTITY_CALCULATION_DESC">
<option
value="0">COM_PHOCACART_MAIN_PRODUCT</option>
<option
value="1">COM_PHOCACART_PRODUCT_VARIATIONS_ATTRIBUTES</option>
<option
value="2">COM_PHOCACART_ADVANCED_STOCK_MANAGEMENT</option>
</field>
<field name="stockstatus_a_id"
type="phocastockstatus" manager="a"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_STOCK_STATUS_A_LABEL"
description="COM_PHOCACART_FIELD_STOCK_STATUS_A_DESC"
default="2"/>
<field name="stockstatus_n_id"
type="phocastockstatus" manager="n"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_STOCK_STATUS_B_LABEL"
description="COM_PHOCACART_FIELD_STOCK_STATUS_B_DESC"
default="1"/>
<field name="related" type="PhocaSelectItem"
label="COM_PHOCACART_FIELD_RELATED_PRODUCTS_LABEL"
description="COM_PHOCACART_FIELD_RELATED_PRODUCTS_DESC"
class="" size="40" multiple="true"
related="true"/>
<field name="image"
type="phocaselectfilenameimage" manager="productimage"
label="COM_PHOCACART_FIELD_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_DESC" class="inputbox
imageCreateThumbs" size="40"/>
<field name="public_download_file"
type="phocaselectfilename" manager="publicfile"
label="COM_PHOCACART_FIELD_PUBLIC_DOWNLOAD_FILE_LABEL"
description="COM_PHOCACART_FIELD_PUBLIC_DOWNLOAD_FILE_DESC"
class="inputbox" size="40"/>
<field name="public_download_text"
type="text"
label="COM_PHOCACART_FIELD_PUBLIC_DOWNLOAD_FILE_TEXT_LABEL"
description="COM_PHOCACART_FIELD_PUBLIC_DOWNLOAD_FILE_TEXT_LABEL"
class="inputbox" size="40"/>
<field name="public_play_file"
type="phocaselectfilename" manager="publicfile"
label="COM_PHOCACART_FIELD_PUBLIC_FILE_PLAY_LABEL"
description="COM_PHOCACART_FIELD_PUBLIC_FILE_PLAY_DESC"
class="inputbox"
size="40"/>
<field name="public_play_text" type="text"
label="COM_PHOCACART_FIELD_PUBLIC_FILE_PLAY_TEXT_LABEL"
description="COM_PHOCACART_FIELD_PUBLIC_FILE_PLAY_TEXT_DESC"
class="inputbox" size="40"/>
<field name="video" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_VIDEO_URL_LABEL"
description="COM_PHOCACART_FIELD_VIDEO_URL_DESC"/>
<field name="download_folder"
type="phocacarttoken" readonly="true"
manager="folder" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_DOWNLOAD_FOLDER_LABEL"
description="COM_PHOCACART_FIELD_DOWNLOAD_FOLDER_DESC"/>
<field name="download_file"
type="phocaselectfilename" manager="productfile"
label="COM_PHOCACART_FIELD_DOWNLOAD_FILE_LABEL"
description="COM_PHOCACART_FIELD_DOWNLOAD_FILE_DESC"
class="inputbox" size="40"/>
<field name="download_days" default="-1"
size="4" type="text"
label="COM_PHOCACART_FIELD_DOWNLOAD_FILE_EXPIRATION_DATE_DAYS_LABEL"
description="COM_PHOCACART_FIELD_DOWNLOAD_FILE_EXPIRATION_DATE_DAYS_DESC"/>
<field name="download_token"
type="phocacarttoken" manager="token"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_DOWNLOAD_TOKEN_LABEL"
description="COM_PHOCACART_FIELD_DOWNLOAD_TOKEN_DESC"/>
<field name="download_hits" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_DOWNLOAD_HITS_LABEL"
description="COM_PHOCACART_FIELD_DOWNLOAD_HITS_DESC"/>
<!--
<field name="attributes"
type="PhocaAttributes" multiple="1"
label="COM_PHOCACART_FIELD_ATTRIBUTES_LABEL"
description="COM_PHOCACART_FIELD_ATTRIBUTES_DESC"
class="inputbox" size="1" /> -->
<field name="unit_amount" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_UNIT_AMOUNT_LABEL"
description="COM_PHOCACART_FIELD_UNIT_AMOUNT_DESC"/>
<field name="unit_unit" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_UNIT_UNIT_LABEL"
description="COM_PHOCACART_FIELD_UNIT_UNIT_DESC"/>
<field name="length" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_LENGTH_LABEL"
description="COM_PHOCACART_FIELD_LENGTH_DESC"/>
<field name="width" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_WIDTH_LABEL"
description="COM_PHOCACART_FIELD_WIDTH_DESC"/>
<field name="height" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_HEIGHT_LABEL"
description="COM_PHOCACART_FIELD_HEIGHT_DESC"/>
<field name="weight" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_WEIGHT_LABEL"
description="COM_PHOCACART_FIELD_WEIGHT_DESC"/>
<field name="volume" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_VOLUME_LABEL"
description="COM_PHOCACART_FIELD_VOLUME_DESC"/>
<field name="points_needed" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_POINTS_NEEDED_LABEL"
description="COM_PHOCACART_FIELD_POINTS_NEEDED_DESC"/>
<field name="points_received" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_POINTS_RECEIVED_LABEL"
description="COM_PHOCACART_FIELD_POINTS_RECEIVED_DESC"/>
<field name="condition" type="list"
label="COM_PHOCACART_FIELD_PRODUCT_CONDITION_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_CONDITION_DESC"
class="inputbox" size="1" default="0">
<option
value="0">COM_PHOCACART_CONDITION_NEW</option>
<option
value="1">COM_PHOCACART_CONDITION_REFURBISHED</option>
<option
value="2">COM_PHOCACART_CONDITION_USED</option>
</field>
<field name="type_feed" type="textarea"
label="COM_PHOCACART_FIELD_PRODUCT_TYPE_FEED_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_TYPE_FEED_DESC"
class="inputbox" rows="3" cols="30"/>
<field name="type_category_feed"
type="textarea"
label="COM_PHOCACART_FIELD_PRODUCT_CATEGORY_TYPE_FEED_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_CATEGORY_TYPE_FEED_DESC"
class="inputbox" rows="3"
cols="30"/>
<field name="delivery_date" type="Calendar"
class="inputbox"
label="COM_PHOCACART_FIELD_PRODUCT_DELIVERY_DATE_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_DELIVERY_DATE_DESC"
filter="JComponentHelper::filterText"
showtime="true" format="%Y-%m-%d %H:%M:%S"/>
<field name="metatitle" type="text"
label="COM_PHOCACART_FIELD_META_TITLE_LABEL"
description="COM_PHOCACART_FIELD_META_TITLE_DESC"
class="inputbox"/>
<field name="metakey" type="textarea"
label="JFIELD_META_KEYWORDS_LABEL"
description="JFIELD_META_KEYWORDS_DESC"
class="inputbox" rows="3"
cols="30"/>
<field name="metadesc" type="textarea"
label="JFIELD_META_DESCRIPTION_LABEL"
description="JFIELD_META_DESCRIPTION_DESC"
class="inputbox" rows="3"
cols="30"/>
<!-- SUBFORM -->
<field name="additional_images"
type="subform"
label="COM_PHOCACART_FIELD_ADDITIONAL_IMAGES_LABEL"
description="COM_PHOCACART_FIELD_ADDITIONAL_IMAGES_DESC"
multiple="true"
layout="joomla.form.field.subform.repeatable"
formsource="administrator/components/com_phocacart/models/forms/subform_additional_images.xml"/>
<field name="attributes" type="subform"
label="COM_PHOCACART_FIELD_ATTRIBUTES_LABEL"
description="COM_PHOCACART_FIELD_ATTRIBUTES_DESC"
multiple="true"
layout="joomla.form.field.subform.repeatable"
formsource="administrator/components/com_phocacart/models/forms/subform_attributes.xml"
class="phSubformAttributes"/>
<field name="specifications" type="subform"
label="COM_PHOCACART_FIELD_SPECIFICATIONS_LABEL"
description="COM_PHOCACART_FIELD_SPECIFICATIONS_DESC"
multiple="true"
layout="joomla.form.field.subform.repeatable"
formsource="administrator/components/com_phocacart/models/forms/subform_specifications.xml"/>
<field name="discounts" type="subform"
label="COM_PHOCACART_FIELD_DISCOUNTS_LABEL"
description="COM_PHOCACART_FIELD_DISCOUNTS_DESC"
multiple="true"
layout="joomla.form.field.subform.repeatable"
formsource="administrator/components/com_phocacart/models/forms/subform_discounts.xml"/>
<field name="additional_download_files"
type="subform"
label="COM_PHOCACART_FIELD_ADDITIONAL_DOWNLOAD_FILES_LABEL"
description="COM_PHOCACART_FIELD_ADDITIONAL_DOWNLOAD_FILES_DESC"
multiple="true"
layout="joomla.form.field.subform.repeatable"
formsource="administrator/components/com_phocacart/models/forms/subform_additional_download_files.xml"/>
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS">
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<field name="type" default="0"
type="list"
label="COM_PHOCACART_FIELD_PRODUCT_TYPE_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_TYPE_DESC">
<option
value="0">COM_PHOCACART_PHYSICAL_PRODUCT</option>
<option
value="1">COM_PHOCACART_DIGITAL_DOWNLOADABLE_PRODUCT</option>
<option
value="2">COM_PHOCACART_MIXED_PRODUCT_DIGITAL_PHYSICAL</option>
<option
value="3">COM_PHOCACART_PRICE_ON_DEMAND_PRODUCT</option>
<option
value="4">COM_PHOCACART_GIFT_VOUCHER</option>
</field>
<field name="language"
type="contentlanguage" label="JFIELD_LANGUAGE_LABEL"
description="COM_PHOCACART_FIELD_LANGUAGE_DESC"
class="inputbox">
<option value="*">JALL</option>
</field>
<field name="date" type="Calendar"
class="inputbox" label="COM_PHOCACART_FIELD_DATE_LABEL"
description="COM_PHOCACART_FIELD_DATE_DESC"
filter="JComponentHelper::filterText"/>
<field name="date_update" type="Calendar"
class="inputbox"
label="COM_PHOCACART_FIELD_UPDATE_DATE_LABEL"
description="COM_PHOCACART_FIELD_UPDATE_DATE_DESC"
filter="JComponentHelper::filterText"/>
<field name="tags" type="phocatags"
multiple="true" label="COM_PHOCACART_FIELD_TAGS_LABEL"
description="COM_PHOCACART_FIELD_TAGS_DESC"
class="inputbox" size="1"/>
<field name="taglabels"
type="phocataglabels" multiple="true"
label="COM_PHOCACART_FIELD_LABELS_LABEL"
description="COM_PHOCACART_FIELD_LABELS_DESC"
class="inputbox" size="1"/>
<field name="created" type="Calendar"
class="inputbox"
label="COM_PHOCACART_FIELD_CREATED_DATE_LABEL"
description="COM_PHOCACART_FIELD_CREATED_DATE_DESC"
readonly="readonly" translateformat="true"
showtime="true"/>
<field name="created_by" type="user"
class="inputbox"
label="COM_PHOCACART_FIELD_CREATED_BY_LABEL"
description="COM_PHOCACART_FIELD_CREATED_BY_DESC"
readonly="readonly"/>
<field name="modified" type="Calendar"
class="inputbox"
label="COM_PHOCACART_FIELD_MODIFIED_DATE_LABEL"
description="COM_PHOCACART_FIELD_MODIFIED_DATE_DESC"
readonly="readonly" translateformat="true"
showtime="true"/>
<field name="modified_by" type="user"
class="inputbox"
label="COM_PHOCACART_FIELD_MODIFIED_BY_LABEL"
description="COM_PHOCACART_FIELD_MODIFIED_BY_DESC"
readonly="readonly"/>
<field name="hits" type="Text"
class="inputbox" size="6"
label="COM_PHOCACART_FIELD_HITS_LABEL"
description="COM_PHOCACART_FIELD_HITS_DESC" />
<field name="sales" type="Text"
class="inputbox" size="6"
label="COM_PHOCACART_FIELD_SALES_LABEL"
description="COM_PHOCACART_FIELD_SALES_DESC"
readonly="readonly" />
<field name="gift_types" type="subform"
label="COM_PHOCACART_FIELD_GIFT_VOUCHER_TYPE_LABEL"
description="COM_PHOCACART_FIELD_GIFT_VOUCHER_TYPE_DESC"
multiple="true"
layout="joomla.form.field.subform.repeatable"
formsource="administrator/components/com_phocacart/models/forms/subform_gifttypes.xml"
class="phSubformGiftTypes"/>
</fieldset>
<fields name="metadata">
<fieldset name="metadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<field name="robots"
type="list"
label="JFIELD_METADATA_ROBOTS_LABEL"
description="JFIELD_METADATA_ROBOTS_DESC"
>
<option
value="">JGLOBAL_USE_GLOBAL</option>
<option value="index,
follow">JGLOBAL_INDEX_FOLLOW</option>
<option value="noindex,
follow">JGLOBAL_NOINDEX_FOLLOW</option>
<option value="index,
nofollow">JGLOBAL_INDEX_NOFOLLOW</option>
<option value="noindex,
nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>
</field>
<!--
<field name="author" type="text"
label="JAUTHOR"
description="JField_Metadata_Author_Desc"
size="20" />
<field name="rights" type="text"
label="JFIELD_META_RIGHTS_LABEL"
description="JFIELD_META_RIGHTS_DESC"
required="" filter="string"
cols="30" rows="2" /> -->
</fieldset>
</fields>
</form>
PK�"�[Gd3o��models/forms/phocacartlog.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_NAME_LABEL"
description="COM_PHOCACART_FIELD_NAME_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="ordering" type="PhocacartOrdering"
table="formfield" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
<field name="access" type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC" class="inputbox"
size="1" />
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<!--
<field name="language" type="contentlanguage"
label="JFIELD_LANGUAGE_LABEL"
description="COM_PHOCACART_FIELD_LANGUAGE_DESC"
class="inputbox">
<option value="*">JALL</option>
</field> -->
</fieldset>
</form>
PK�"�[��jX��!models/forms/phocacartmanager.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
</fieldset>
</form>
PK�"�[J��(
(
&models/forms/phocacartmanufacturer.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="image" type="media"
manager="categoryimage"
label="COM_PHOCACART_FIELD_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_DESC"
class="inputbox" size="40" />
<field name="link" type="text"
label="COM_PHOCACART_FIELD_MANUFACTURER_LINK_LABEL"
description="COM_PHOCACART_FIELD_MANUFACTURER_LINK_DESC"
class="inputbox" size="40" />
<field name="description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_DESCRIPTION_DESC" />
<field name="ordering" type="PhocacartOrdering"
table="manufacturer" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
<field name="metakey" type="textarea"
label="JField_Meta_Keywords_Label"
description="JField_Meta_Keywords_Desc"
class="inputbox" rows="3" cols="30" />
<field name="metadesc" type="textarea"
label="JField_Meta_Description_Label"
description="JField_Meta_Description_Desc"
class="inputbox" rows="3" cols="30" />
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<field name="language" type="contentlanguage"
label="JFIELD_LANGUAGE_LABEL"
description="COM_PHOCACART_FIELD_LANGUAGE_DESC"
class="inputbox">
<option value="*">JALL</option>
</field>
<!--
<field name="date" type="Calendar"
class="inputbox" label="COM_PHOCACART_FIELD_DATE_LABEL"
description="COM_PHOCACART_FIELD_DATE_DESC"
filter="JComponentHelper::filterText" />
<field name="hits" type="Text"
class="inputbox" size="6"
label="COM_PHOCACART_FIELD_HITS"
description="COM_PHOCACART_FIELD_HITS_DESC" />
-->
</fieldset>
<fields name="metadata">
<fieldset name="metadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<!--
<field name="robots" type="list"
label="JField_Metadata_Robots_Label"
description="JField_Metadata_Robots_Desc"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JGLOBAL_INDEX_FOLLOW</option>
<option value="1">JGLOBAL_NOINDEX_FOLLOW</option>
<option value="2">JGLOBAL_INDEX_NOFOLLOW</option>
<option value="3">JGLOBAL_NOINDEX_NOFOLLOW</option>
<option value="4">JGLOBAL_NO_ROBOTS_TAG</option>
</field>
<field name="author" type="text"
label="JAUTHOR"
description="JField_Metadata_Author_Desc" size="20"
/>
<field name="rights" type="text"
label="JFIELD_META_RIGHTS_LABEL"
description="JFIELD_META_RIGHTS_DESC"
required="" filter="string" cols="30"
rows="2" /> -->
</fieldset>
</fields>
</form>
PK�"�[b����models/forms/phocacartorder.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text"
default="0" label="COM_PHOCACART_ORDER_ID_LABEL"
description="COM_PHOCACART_ORDER_ID_DESC"
required="true" readonly="true"
class="readonly"/>
<!--
<field name="user_id" type="text"
default="0" label="COM_PHOCACART_USER_ID_LABEL"
description="COM_PHOCACART_USER_ID_DESC"
required="true" readonly="true"
class="readonly" />-->
<field name="status_id"
type="PhocacartOrderStatus" default="0"
label="COM_PHOCACART_ORDER_STATUS_LABEL"
description="COM_PHOCACART_ORDER_STATUS_DESC"
required="true" readonly="true"
class="readonly"/>
<field name="order_token"
type="phocacarttoken" readonly="true"
manager="folder" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ORDER_TOKEN_LABEL"
description="COM_PHOCACART_FIELD_ORDER_TOKEN_DESC"/>
<field name="comment" type="textarea"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_COMMENT_LABEL"
description="COM_PHOCACART_FIELD_COMMENT_DESC"/>
<field name="tracking_number" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TRACKING_NUMBER_LABEL"
description="COM_PHOCACART_FIELD_TRACKING_NUMBER_DESC"/>
<field name="tracking_link_custom"
type="text" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CUSTOM_TRACKING_LINK_LABEL"
description="COM_PHOCACART_FIELD_CUSTOM_TRACKING_LINK_DESC"/>
<field name="tracking_description_custom"
type="editor" buttons="true"
hide="pagebreak,readmore" class="inputbox"
label="COM_PHOCACART_FIELD_CUSTOM_TRACKING_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_CUSTOM_TRACKING_DESCRIPTION_DESC"/>
<field name="tracking_date_shipped"
type="Calendar" class="inputbox"
label="COM_PHOCACART_FIELD_DATE_SHIPPED_LABEL"
description="COM_PHOCACART_FIELD_DATE_SHIPPED_DESC"
filter="JComponentHelper::filterText"/>
<field name="order_number" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ORDER_NUMBER_LABEL"
description="COM_PHOCACART_FIELD_ORDER_NUMBER_DESC"/>
<field name="receipt_number" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_RECEIPT_NUMBER_LABEL"
description="COM_PHOCACART_FIELD_RECEIPT_NUMBER_DESC"/>
<field name="invoice_number" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_INVOICE_NUMBER_LABEL"
description="COM_PHOCACART_FIELD_INVOICE_NUMBER_DESC"/>
<field name="queue_number" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_QUEUE_NUMBER_LABEL"
description="COM_PHOCACART_FIELD_QUEUE_NUMBER_DESC"/>
<field name="order_number_id" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ORDER_NUMBER_ID_LABEL"
description="COM_PHOCACART_FIELD_ORDER_NUMBER_ID_DESC"
readonly="readonly" />
<field name="receipt_number_id" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_RECEIPT_NUMBER_ID_LABEL"
description="COM_PHOCACART_FIELD_RECEIPT_NUMBER_ID_DESC"
readonly="readonly" />
<field name="invoice_number_id" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_INVOICE_NUMBER_ID_LABEL"
description="COM_PHOCACART_FIELD_INVOICE_NUMBER_ID_DESC"
readonly="readonly" />
<field name="queue_number_id" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_QUEUE_NUMBER_ID_LABEL"
description="COM_PHOCACART_FIELD_QUEUE_NUMBER_ID_DESC"
readonly="readonly" />
<field name="invoice_prn" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PAYMENT_REFERENCE_NUMBER_LABEL"
description="COM_PHOCACART_FIELD_PAYMENT_REFERENCE_NUMBER_DESC"/>
<field name="invoice_date" type="calendar"
class="date" size="40"
label="COM_PHOCACART_FIELD_INVOICE_DATE_LABEL"
description="COM_PHOCACART_FIELD_INVOICE_DATE_DESC"/>
<field name="invoice_due_date"
type="calendar" class="date" size="40"
label="COM_PHOCACART_FIELD_INVOICE_DUE_DATE_LABEL"
description="COM_PHOCACART_FIELD_INVOICE_DUE_DATE_DESC"/>
<field name="invoice_time_of_supply"
type="calendar" class="date" size="40"
label="COM_PHOCACART_FIELD_DATE_OF_TAXABLE_SUPPLY_LABEL"
description="COM_PHOCACART_FIELD_DATE_OF_TAXABLE_SUPPLY_DESC"/>
<field name="invoice_spec_top_desc"
type="editor" buttons="true"
hide="pagebreak,readmore" class="inputbox"
label="COM_PHOCACART_FIELD_INVOICE_SPECIFIC_TOP_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_INVOICE_SPECIFIC_TOP_DESCRIPTION_DESC"/>
<field name="invoice_spec_middle_desc"
type="editor" buttons="true"
hide="pagebreak,readmore" class="inputbox"
label="COM_PHOCACART_FIELD_INVOICE_SPECIFIC_MIDDLE_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_INVOICE_SPECIFIC_MIDDLE_DESCRIPTION_DESC"/>
<field name="invoice_spec_bottom_desc"
type="editor" buttons="true"
hide="pagebreak,readmore" class="inputbox"
label="COM_PHOCACART_FIELD_INVOICE_SPECIFIC_BOTTOM_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_INVOICE_SPECIFIC_BOTTOM_DESCRIPTION_DESC"/>
<field name="oidn_spec_billing_desc"
type="editor" buttons="true"
hide="pagebreak,readmore" class="inputbox"
label="COM_PHOCACART_FIELD_ORDER_INVOICE_DELIVERY_NOTE_BILLING_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_ORDER_INVOICE_DELIVERY_NOTE_BILLING_DESCRIPTION_DESC"/>
<field name="oidn_spec_shipping_desc"
type="editor" buttons="true"
hide="pagebreak,readmore" class="inputbox"
label="COM_PHOCACART_FIELD_ORDER_INVOICE_DELIVERY_NOTE_SHIPPING_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_ORDER_INVOICE_DELIVERY_NOTE_SHIPPING_DESCRIPTION_LABEL"/>
<field name="terms" type="radio"
class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_TERMS_AND_CONDITIONS_AGREED_LABEL"
description="COM_PHOCACART_FIELD_TERMS_AND_CONDITIONS_AGREED_DESC"
size="1" default="0">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="privacy" type="radio"
class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_PRIVACY_AGREED_LABEL"
description="COM_PHOCACART_FIELD_PRIVACY_AGREED_DESC"
size="1" default="0">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="newsletter" type="radio"
class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_NEWSLETTER_SUBSCRIBED_LABEL"
description="COM_PHOCACART_FIELD_NEWSLETTER_SUBSCRIBED_DESC"
size="1" default="0">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="date" type="text"
class="inputbox"
label="COM_PHOCACART_FIELD_CREATED_DATE_LABEL"
description="COM_PHOCACART_FIELD_CREATED_DATE_DESC"
readonly="readonly" translateformat="true"
showtime="true"/>
<field name="modified" type="text"
class="inputbox"
label="COM_PHOCACART_FIELD_MODIFIED_DATE_LABEL"
description="COM_PHOCACART_FIELD_MODIFIED_DATE_DESC"
readonly="readonly" translateformat="true"
showtime="true"/>
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS">
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
</fieldset>
</form>
PK�"�[>�Ŷ�
�
#models/forms/phocacartparameter.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text"
default="0" label="JGLOBAL_FIELD_ID_LABEL"
required="true" readonly="true"
class="readonly"/>
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true"/>
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC"/>
<field name="title_header" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PARAMETER_TITLE_HEADER_LABEL"
description="COM_PHOCACART_FIELD_PARAMETER_TITLE_HEADER_DESC"
/>
<field name="link_type" type="list"
label="COM_PHOCACART_FIELD_PARAMETER_LINK_TYPE_LABEL"
description="COM_PHOCACART_FIELD_PARAMETER_LINK_TYPE_DESC"
class="inputbox" size="1" default="0">
<option
value="0">COM_PHOCACART_NONE</option>
<option
value="1">COM_PHOCACART_SEARCH_OUTCOME_LINK</option>
</field>
<!--
<field name="link_cat"
type="phocacartcategory"
label="COM_PHOCACART_FIELD_CATEGORY_LINK_LABEL"
description="COM_PHOCACART_FIELD_CATEGORY_LINK_DESC"
class="inputbox" />
<field name="link_ext" type="text"
label="COM_PHOCACART_FIELD_EXT_LINK_TAG_LABEL"
description="COM_PHOCACART_FIELD_EXT_LINK_TAG_DESC"
class="inputbox" size="40" />
<field name="type" type="list"
label="COM_PHOCACART_FIELD_TAG_TYPE_LABEL"
description="COM_PHOCACART_FIELD_TAG_TYPE_DESC"
class="inputbox" size="1" default="0">
<option
value="0">COM_PHOCACART_TAG</option>
<option value="1">COM_PHOCACART_LABEL</option>
</field>
<field name="display_format" type="list"
label="COM_PHOCACART_FIELD_TAG_DISPLAY_FORMAT_LABEL"
description="COM_PHOCACART_FIELD_TAG_DISPLAY_FORMAT_DESC"
class="inputbox" size="1" default="1">
<option
value="1">COM_PHOCACART_TITLE_ONLY</option>
<option
value="2">COM_PHOCACART_ICON_ONLY</option>
<option value="3">COM_PHOCACART_ICON_AND_TITLE</option>
</field>
<field name="icon_class" type="text"
label="COM_PHOCACART_FIELD_TAG_ICON_CLASS_LABEL"
description="COM_PHOCACART_FIELD_TAG_ICON_CLASS_DESC"
class="inputbox" size="40" />
-->
<field name="ordering"
type="phocacartOrdering" table="tag"
class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC"/>
<field name="description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_DESCRIPTION_DESC"/>
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS">
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<field name="limit_count" default="-1"
size="10" type="text"
label="COM_PHOCACART_FIELD_LIMIT_PARAMETER_COUNT_PRODUCTS_LABEL"
description="COM_PHOCACART_FIELD_LIMIT_PARAMETER_COUNT_PRODUCTS_DESC"/>
</fieldset>
</form>
PK�"�[1�f�
�
(models/forms/phocacartparametervalue.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<!--
<field name="link_cat" type="phocacartcategory"
label="COM_PHOCACART_FIELD_CATEGORY_LINK_LABEL"
description="COM_PHOCACART_FIELD_CATEGORY_LINK_DESC"
class="inputbox" />
<field name="link_ext" type="text"
label="COM_PHOCACART_FIELD_EXT_LINK_TAG_LABEL"
description="COM_PHOCACART_FIELD_EXT_LINK_TAG_DESC"
class="inputbox" size="40" />
<field name="type" type="list"
label="COM_PHOCACART_FIELD_TAG_TYPE_LABEL"
description="COM_PHOCACART_FIELD_TAG_TYPE_DESC"
class="inputbox" size="1" default="0">
<option value="0">COM_PHOCACART_TAG</option>
<option value="1">COM_PHOCACART_LABEL</option>
</field>
<field name="display_format" type="list"
label="COM_PHOCACART_FIELD_TAG_DISPLAY_FORMAT_LABEL"
description="COM_PHOCACART_FIELD_TAG_DISPLAY_FORMAT_DESC"
class="inputbox" size="1" default="1">
<option value="1">COM_PHOCACART_TITLE_ONLY</option>
<option value="2">COM_PHOCACART_ICON_ONLY</option>
<option value="3">COM_PHOCACART_ICON_AND_TITLE</option>
</field>
<field name="icon_class" type="text"
label="COM_PHOCACART_FIELD_TAG_ICON_CLASS_LABEL"
description="COM_PHOCACART_FIELD_TAG_ICON_CLASS_DESC"
class="inputbox" size="40" />
-->
<field name="parameter_id"
type="phocacartparameter"
label="COM_PHOCACART_FIELD_PARAMETER_LABEL"
description="COM_PHOCACART_FIELD_PARAMETER_DESC"
class="inputbox" required="true" />
<field name="ordering" type="phocacartOrdering"
table="tag" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
<field name="description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_DESCRIPTION_DESC" />
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
</fieldset>
</form>
PK�"�[����!models/forms/phocacartpayment.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="method" type="phocaPluginMethod"
plugintype="1" table="" class="inputbox"
label="COM_PHOCACART_FIELD_PAYMENT_METHOD_LABEL"
description="COM_PHOCACART_FIELD_PAYMENT_METHOD_DESC" />
<field name="image" type="media"
manager="categoryimage"
label="COM_PHOCACART_FIELD_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_DESC"
class="inputbox" size="40" />
<field name="ordering" type="phocacartOrdering"
table="payment" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
<field name="access" type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC" class="inputbox"
size="1" />
<field name="group" type="PhocacartGroups"
table="8" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CUSTOMER_GROUP_LABEL"
description="COM_PHOCACART_FIELD_CUSTOMER_GROUP_DESC" />
<field name="cost" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_COST_LABEL"
description="COM_PHOCACART_FIELD_PAYMENT_COST_DESC" />
<field name="cost_additional" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ADDITIONAL_COSTS_PAYMENT_METHOD_LABEL"
description="COM_PHOCACART_FIELD_ADDITIONAL_COSTS_PAYMENT_METHOD_DESC"
/>
<field name="tax_id" type="phocatax"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TAX_LABEL"
description="COM_PHOCACART_FIELD_TAX_DESC" />
<field name="calculation_type" type="list"
label="COM_PHOCACART_FIELD_CALCULATION_TYPE_LABEL"
description="COM_PHOCACART_FIELD_CALCULATION_TYPE_DESC"
class="inputbox" size="1" default="0">
<option value="1">COM_PHOCACART_PERCENTAGE</option>
<option value="0">COM_PHOCACART_FIXED_AMOUNT</option>
</field>
<field name="type" type="list"
label="COM_PHOCACART_FIELD_TYPE_LABEL"
description="COM_PHOCACART_FIELD_TYPE_DESC"
class="inputbox" size="1" default="0">
<option value="0">COM_PHOCACART_COMMON</option>
<option
value="1">COM_PHOCACART_ONLINE_SHOP_ONLY</option>
<option value="2">COM_PHOCACART_POS_ONLY</option>
</field>
<field name="default" type="list"
label="COM_PHOCACART_FIELD_DEFAULT_LABEL"
description="COM_PHOCACART_FIELD_DEFAULT_DESC"
class="inputbox" size="1" default="0">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<!-- AMOUNT -->
<field name="lowest_amount" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_LOWEST_AMOUNT_LABEL"
description="COM_PHOCACART_FIELD_LOWEST_AMOUNT_DESC" />
<field name="highest_amount" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_HIGHEST_AMOUNT_LABEL"
description="COM_PHOCACART_FIELD_HIGHEST_AMOUNT_DESC" />
<field name="active_amount" type="radio"
class="btn-group" default="0"
label="COM_PHOCACART_FIELD_ACTIVE_AMOUNT_LABEL"
description="COM_PHOCACART_FIELD_ACTIVE_AMOUNT_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<!-- ZONE -->
<field name="zone" type="PhocacartZones"
table="payment" multiple="true"
label="COM_PHOCACART_FIELD_ZONES_LABEL"
description="COM_PHOCACART_FIELD_ZONES_DESC"
class="inputbox" size="1" />
<field name="active_zone" type="radio"
class="btn-group" default="0"
label="COM_PHOCACART_FIELD_ACTIVE_ZONE_LABEL"
description="COM_PHOCACART_FIELD_ACTIVE_ZONE_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<!-- COUNTRY -->
<field name="country" type="PhocaCartCountries"
table="payment" multiple="true"
label="COM_PHOCACART_FIELD_COUNTRIES_LABEL"
description="COM_PHOCACART_FIELD_COUNTRIES_DESC"
class="inputbox" size="1" />
<field name="active_country" type="radio"
class="btn-group" default="0"
label="COM_PHOCACART_FIELD_ACTIVE_COUNTRY_LABEL"
description="COM_PHOCACART_FIELD_ACTIVE_COUNTRY_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<!-- REGION -->
<field name="region" type="PhocacartRegions"
table="payment" multiple="true"
label="COM_PHOCACART_FIELD_REGIONS_LABEL"
description="COM_PHOCACART_FIELD_REGIONS_DESC"
class="inputbox" size="1" />
<field name="active_region" type="radio"
class="btn-group" default="0"
label="COM_PHOCACART_FIELD_ACTIVE_REGION_LABEL"
description="COM_PHOCACART_FIELD_ACTIVE_REGION_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<!-- SHIPPING -->
<field name="shipping" type="PhocacartShipping"
table="payment" multiple="true"
label="COM_PHOCACART_FIELD_SHIPPING_LABEL"
description="COM_PHOCACART_FIELD_SHIPPING_DESC"
class="inputbox" size="1" />
<field name="active_shipping" type="radio"
class="btn-group" default="0"
label="COM_PHOCACART_FIELD_ACTIVE_SHIPPING_LABEL"
description="COM_PHOCACART_FIELD_ACTIVE_SHIPPING_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_DESCRIPTION_DESC" />
<field name="description_info" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_PAYMENT_DESCRIPTION_INFO_VIEW_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_PAYMENT_DESCRIPTION_INFO_VIEW_DESC"
/>
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
</fieldset>
</form>
PK�"�[:��u��'models/forms/phocacartpaymentmethod.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fields
addfieldpath="/administrator/components/com_phocacart/models/fields"
>
<fieldset name="payment">
</fieldset>
</fields>
</form>PK�"�[hg�0FF&models/forms/phocacartpricehistory.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="price_history" type="subform"
label="COM_PHOCACART_FIELD_PRICE_HISTORY_LABEL"
description="COM_PHOCACART_FIELD_PRICE_HISTORY_DESC"
multiple="true"
layout="joomla.form.field.subform.repeatable"
formsource="administrator/components/com_phocacart/models/forms/subform_price_history.xml"/>
</fieldset>
</form>
PK�"�[�w�)]]&models/forms/phocacartproductstock.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="product_stock" type="subform"
label="COM_PHOCACART_ADVANCED_STOCK_MANAGEMENT"
description="COM_PHOCACART_ADVANCED_STOCK_MANAGEMENT"
multiple="true" buttons="false"
layout="joomla.form.field.subform.repeatable-table"
formsource="administrator/components/com_phocacart/models/forms/subform_product_stock.xml"/>
</fieldset>
</form>
PK�"�[��ٰ
"models/forms/phocacartquestion.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="product_id" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_ID_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_ID_DESC" />
<field name="category_id" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CATEGORY_ID_LABEL"
description="COM_PHOCACART_FIELD_CATEGORY_ID_DESC" />
<field name="user_id" type="user"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_USER_ID_LABEL"
description="COM_PHOCACART_FIELD_USER_ID_DESC" />
<field name="name" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_NAME_LABEL"
description="COM_PHOCACART_FIELD_NAME_DESC" />
<field name="email" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_EMAIL_LABEL"
description="COM_PHOCACART_FIELD_EMAIL_DESC" />
<field name="phone" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PHONE_LABEL"
description="COM_PHOCACART_FIELD_PHONE_DESC" />
<field name="phone_mobile" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_MOBILE_PHONE_LABEL"
description="COM_PHOCACART_FIELD_MOBILE_PHONE_DESC" />
<field name="ip" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_IP_LABEL"
description="COM_PHOCACART_FIELD_IP_DESC" />
<field name="message" type="textarea"
class="inputbox"
label="COM_PHOCACART_FIELD_MESSAGE_LABEL"
description="COM_PHOCACART_FIELD_MESSAGE_DESC" />
<field name="ordering" type="PhocacartOrdering"
table="question" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<field name="language" type="contentlanguage"
label="JFIELD_LANGUAGE_LABEL"
description="COM_PHOCACART_FIELD_LANGUAGE_DESC"
class="inputbox">
<option value="*">JALL</option>
</field>
<field name="date" type="Calendar"
class="inputbox" label="COM_PHOCACART_FIELD_DATE_LABEL"
description="COM_PHOCACART_FIELD_DATE_DESC"
filter="JComponentHelper::filterText" />
</fieldset>
</form>
PK�"�[��k_
_
models/forms/phocacartregion.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="country_id" type="PhocacartCountry"
label="COM_PHOCACART_FIELD_COUNTRY_LABEL"
description="COM_PHOCACART_FIELD_COUNTRY_DESC"
class="inputbox" required="true" />
<field name="code2" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CODE2_LABEL"
description="COM_PHOCACART_FIELD_CODE2_DESC" />
<field name="code3" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CODE_LABEL"
description="COM_PHOCACART_FIELD_CODE_DESC" />
<field name="image" type="media"
manager="categoryimage"
label="COM_PHOCACART_FIELD_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_DESC"
class="inputbox" size="40" />
<field name="ordering" type="PhocacartOrdering"
table="region" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
<field name="metakey" type="textarea"
label="JField_Meta_Keywords_Label"
description="JField_Meta_Keywords_Desc"
class="inputbox" rows="3" cols="30" />
<field name="metadesc" type="textarea"
label="JField_Meta_Description_Label"
description="JField_Meta_Description_Desc"
class="inputbox" rows="3" cols="30" />
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<field name="language" type="contentlanguage"
label="JFIELD_LANGUAGE_LABEL"
description="COM_PHOCACART_FIELD_LANGUAGE_DESC"
class="inputbox">
<option value="*">JALL</option>
</field>
<!--
<field name="date" type="Calendar"
class="inputbox" label="COM_PHOCACART_FIELD_DATE_LABEL"
description="COM_PHOCACART_FIELD_DATE_DESC"
filter="JComponentHelper::filterText" />
<field name="hits" type="Text"
class="inputbox" size="6"
label="COM_PHOCACART_FIELD_HITS"
description="COM_PHOCACART_FIELD_HITS_DESC" />
-->
</fieldset>
<fields name="metadata">
<fieldset name="metadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<!--
<field name="robots" type="list"
label="JField_Metadata_Robots_Label"
description="JField_Metadata_Robots_Desc"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JGLOBAL_INDEX_FOLLOW</option>
<option value="1">JGLOBAL_NOINDEX_FOLLOW</option>
<option value="2">JGLOBAL_INDEX_NOFOLLOW</option>
<option value="3">JGLOBAL_NOINDEX_NOFOLLOW</option>
<option value="4">JGLOBAL_NO_ROBOTS_TAG</option>
</field>
<field name="author" type="text"
label="JAUTHOR"
description="JField_Metadata_Author_Desc" size="20"
/>
<field name="rights" type="text"
label="JFIELD_META_RIGHTS_LABEL"
description="JFIELD_META_RIGHTS_DESC"
required="" filter="string" cols="30"
rows="2" /> -->
</fieldset>
</fields>
</form>
PK�"�[k��k��
models/forms/phocacartreview.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="product_id" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_ID_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_ID_DESC"
required="true" />
<field name="user_id" type="user"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_USER_ID_LABEL"
description="COM_PHOCACART_FIELD_USER_ID_DESC"
required="true" />
<field name="name" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_NAME_LABEL"
description="COM_PHOCACART_FIELD_NAME_DESC"
required="true" />
<field name="rating" type="list"
label="COM_PHOCACART_FIELD_RATING_LABEL"
description="COM_PHOCACART_FIELD_RATING_DESC"
class="inputbox" size="1" default="1">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</field>
<field name="review" type="textarea"
class="inputbox"
label="COM_PHOCACART_FIELD_REVIEW_LABEL"
description="COM_PHOCACART_FIELD_REVIEW_DESC" />
<field name="ordering" type="PhocacartOrdering"
table="review" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<field name="language" type="contentlanguage"
label="JFIELD_LANGUAGE_LABEL"
description="COM_PHOCACART_FIELD_LANGUAGE_DESC"
class="inputbox">
<option value="*">JALL</option>
</field>
<field name="date" type="Calendar"
class="inputbox" label="COM_PHOCACART_FIELD_DATE_LABEL"
description="COM_PHOCACART_FIELD_DATE_DESC"
filter="JComponentHelper::filterText" showtime="true"
format="%Y-%m-%d %H:%M:%S" />
</fieldset>
</form>
PK�"�[�Y��| |
models/forms/phocacartreward.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="points" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_REWARD_POINTS_LABEL"
description="COM_PHOCACART_FIELD_REWARD_POINTS_DESC" />
<field name="user_id" type="user"
default="0" label="COM_PHOCACART_USER_ID_LABEL"
description="COM_PHOCACART_USER_ID_DESC"
required="true" />
<field name="published" type="list"
label="COM_PHOCACART_FIELD_APPROVED_LABEL"
description="COM_PHOCACART_FIELD_APPROVED_DESC"
class="inputbox" size="1" default="1">
<option value="1">COM_PHOCACART_APPROVED</option>
<option value="0">COM_PHOCACART_NOT_APPROVED</option>
</field>
<field name="description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_DESCRIPTION_DESC" />
<field name="date" type="Calendar"
class="inputbox" label="COM_PHOCACART_FIELD_DATE_LABEL"
description="COM_PHOCACART_FIELD_DATE_DESC"
filter="JComponentHelper::filterText" />
</fieldset>
<fields name="metadata">
<fieldset name="metadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<!--
<field name="robots" type="list"
label="JField_Metadata_Robots_Label"
description="JField_Metadata_Robots_Desc"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JGLOBAL_INDEX_FOLLOW</option>
<option value="1">JGLOBAL_NOINDEX_FOLLOW</option>
<option value="2">JGLOBAL_INDEX_NOFOLLOW</option>
<option value="3">JGLOBAL_NOINDEX_NOFOLLOW</option>
<option value="4">JGLOBAL_NO_ROBOTS_TAG</option>
</field>
<field name="author" type="text"
label="JAUTHOR"
description="JField_Metadata_Author_Desc" size="20"
/>
<field name="rights" type="text"
label="JFIELD_META_RIGHTS_LABEL"
description="JFIELD_META_RIGHTS_DESC"
required="" filter="string" cols="30"
rows="2" /> -->
</fieldset>
</fields>
</form>
PK�"�[J�����!models/forms/phocacartsection.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="image" type="media"
manager="" label="COM_PHOCACART_FIELD_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_DESC"
class="inputbox" size="40" />
<field name="ordering" type="phocacartOrdering"
table="tag" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
<field name="description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_DESCRIPTION_DESC" />
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
</fieldset>
</form>
PK�"�[�Te�1�1"models/forms/phocacartshipping.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="method" type="phocaPluginMethod"
plugintype="2" table="" class="inputbox"
label="COM_PHOCACART_FIELD_SHIPPING_METHOD_LABEL"
description="COM_PHOCACART_FIELD_SHIPPING_METHOD_DESC" />
<field name="image" type="media"
manager="categoryimage"
label="COM_PHOCACART_FIELD_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_DESC"
class="inputbox" size="40" />
<field name="description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_DESCRIPTION_DESC" />
<field name="description_info" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_SHIPPING_DESCRIPTION_INFO_VIEW_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_SHIPPING_DESCRIPTION_INFO_VIEW_DESC"
/>
<field name="ordering" type="PhocacartOrdering"
table="shipping" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
<field name="access" type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC" class="inputbox"
size="1" />
<field name="group" type="PhocacartGroups"
table="7" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CUSTOMER_GROUP_LABEL"
description="COM_PHOCACART_FIELD_CUSTOMER_GROUP_DESC" />
<field name="cost" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_COST_LABEL"
description="COM_PHOCACART_FIELD_SHIPPING_COST_DESC" />
<field name="cost_additional" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ADDITIONAL_COSTS_SHIPPING_METHOD_LABEL"
description="COM_PHOCACART_FIELD_ADDITIONAL_COSTS_SHIPPING_METHOD_DESC"
/>
<field name="tax_id" type="phocatax"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TAX_LABEL"
description="COM_PHOCACART_FIELD_TAX_DESC" />
<field name="calculation_type" type="list"
label="COM_PHOCACART_FIELD_CALCULATION_TYPE_LABEL"
description="COM_PHOCACART_FIELD_CALCULATION_TYPE_DESC"
class="inputbox" size="1" default="0">
<option value="1">COM_PHOCACART_PERCENTAGE</option>
<option value="0">COM_PHOCACART_FIXED_AMOUNT</option>
</field>
<field name="type" type="list"
label="COM_PHOCACART_FIELD_TYPE_LABEL"
description="COM_PHOCACART_FIELD_TYPE_DESC"
class="inputbox" size="1" default="0">
<option value="0">COM_PHOCACART_COMMON</option>
<option
value="1">COM_PHOCACART_ONLINE_SHOP_ONLY</option>
<option value="2">COM_PHOCACART_POS_ONLY</option>
</field>
<field name="default" type="list"
label="COM_PHOCACART_FIELD_DEFAULT_LABEL"
description="COM_PHOCACART_FIELD_DEFAULT_DESC"
class="inputbox" size="1" default="0">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="tracking_link" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TRACKING_LINK_LABEL"
description="COM_PHOCACART_FIELD_TRACKING_LINK_DESC" />
<field name="tracking_description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_TRACKING_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_TRACKING_DESCRIPTION_LABEL"
/>
<!-- Height -->
<field name="lowest_weight" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_LOWEST_WEIGHT_LABEL"
description="COM_PHOCACART_FIELD_LOWEST_WEIGHT_DESC" />
<field name="highest_weight" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_HIGHEST_WEIGHT_LABEL"
description="COM_PHOCACART_FIELD_HIGHEST_WEIGHT_DESC" />
<field name="active_weight" type="radio"
class="btn-group" default="0"
label="COM_PHOCACART_FIELD_ACTIVE_WEIGHT_LABEL"
description="COM_PHOCACART_FIELD_ACTIVE_WEIGHT_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<!-- Size -->
<!--
COM_PHOCACART_FIELD_LOWEST_WIDTH_LABEL="Lowest Width"
COM_PHOCACART_FIELD_LOWEST_WIDTH_DESC="Set lowest width"
COM_PHOCACART_FIELD_LARGEST_WIDTH_LABEL="Largest Width"
COM_PHOCACART_FIELD_LARGEST_WIDTH_DESC="Set largest width"
COM_PHOCACART_FIELD_LOWEST_HEIGHT_LABEL="Lowest Height"
COM_PHOCACART_FIELD_LOWEST_HEIGHT_DESC="Set lowest height"
COM_PHOCACART_FIELD_HIGHEST_HEIGHT_LABEL="Highest Height"
COM_PHOCACART_FIELD_HIGHEST_HEIGHT_DESC="Set highest height"
COM_PHOCACART_FIELD_LONGEST_LENGTH_LABEL="Longest Length"
COM_PHOCACART_FIELD_LONGEST_LENGTH_DESC="Set longest length"
COM_PHOCACART_FIELD_SHORTEST_LENGTH_LABEL="Shortest Length"
COM_PHOCACART_FIELD_SHORTEST_LENGTH_DESC="Set shortest length"
<field name="lowest_width" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_LOWEST_WIDTH_LABEL"
description="COM_PHOCACART_FIELD_LOWEST_WIDTH_DESC" />
<field name="largest_width" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_LARGEST_WIDTH_LABEL"
description="COM_PHOCACART_FIELD_LARGEST_WIDTH_DESC" />
<field name="lowest_height" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_LOWEST_HEIGHT_LABEL"
description="COM_PHOCACART_FIELD_LOWEST_HEIGHT_DESC" />
<field name="highest_height" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_HIGHEST_HEIGHT_LABEL"
description="COM_PHOCACART_FIELD_HIGHEST_HEIGHT_DESC" />
<field name="shortest_length" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_SHORTEST_LENGTH_LABEL"
description="COM_PHOCACART_FIELD_SHORTEST_LENGTH_DESC" />
<field name="longest_length" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_LONGEST_LENGTH_LABEL"
description="COM_PHOCACART_FIELD_LONGEST_LENGTH_DESC" />
-->
<field name="maximal_width" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_MAXIMAL_WIDTH_LABEL"
description="COM_PHOCACART_FIELD_MAXIMAL_WIDTH_DESC" />
<field name="maximal_height" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_MAXIMAL_HEIGHT_LABEL"
description="COM_PHOCACART_FIELD_MAXIMAL_HEIGHT_DESC" />
<field name="maximal_length" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_MAXIMAL_LENGTH_LABEL"
description="COM_PHOCACART_FIELD_MAXIMAL_LENGTH_DESC" />
<field name="minimal_width" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_MINIMAL_WIDTH_LABEL"
description="COM_PHOCACART_FIELD_MINIMAL_WIDTH_DESC" />
<field name="minimal_height" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_MINIMAL_HEIGHT_LABEL"
description="COM_PHOCACART_FIELD_MINIMAL_HEIGHT_DESC" />
<field name="minimal_length" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_MINIMAL_LENGTH_LABEL"
description="COM_PHOCACART_FIELD_MINIMAL_LENGTH_DESC" />
<field name="active_size" type="radio"
class="btn-group" default="0"
label="COM_PHOCACART_FIELD_ACTIVE_SIZE_LABEL"
description="COM_PHOCACART_FIELD_ACTIVE_SIZE_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<!-- AMOUNT -->
<field name="lowest_amount" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_LOWEST_AMOUNT_LABEL"
description="COM_PHOCACART_FIELD_LOWEST_AMOUNT_DESC" />
<field name="highest_amount" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_HIGHEST_AMOUNT_LABEL"
description="COM_PHOCACART_FIELD_HIGHEST_AMOUNT_DESC" />
<field name="active_amount" type="radio"
class="btn-group" default="0"
label="COM_PHOCACART_FIELD_ACTIVE_AMOUNT_LABEL"
description="COM_PHOCACART_FIELD_ACTIVE_AMOUNT_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<!-- QUANTITY -->
<field name="minimal_quantity" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_MINIMAL_QUANTITY_LABEL"
description="COM_PHOCACART_FIELD_MINIMAL_QUANTITY_DESC" />
<field name="maximal_quantity" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_MAXIMAL_QUANTITY_LABEL"
description="COM_PHOCACART_FIELD_MAXIMAL_QUANTITY_DESC" />
<field name="active_quantity" type="radio"
class="btn-group" default="0"
label="COM_PHOCACART_FIELD_ACTIVE_QUANTITY_LABEL"
description="COM_PHOCACART_FIELD_ACTIVE_QUANTITY_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<!-- ZONE -->
<field name="zone" type="PhocacartZones"
table="shipping" multiple="true"
label="COM_PHOCACART_FIELD_ZONES_LABEL"
description="COM_PHOCACART_FIELD_ZONES_DESC"
class="inputbox" size="1" />
<field name="active_zone" type="radio"
class="btn-group" default="0"
label="COM_PHOCACART_FIELD_ACTIVE_ZONE_LABEL"
description="COM_PHOCACART_FIELD_ACTIVE_ZONE_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<!-- COUNTRY -->
<field name="country" type="PhocaCartCountries"
table="shipping" multiple="true"
label="COM_PHOCACART_FIELD_COUNTRIES_LABEL"
description="COM_PHOCACART_FIELD_COUNTRIES_DESC"
class="inputbox" size="1" />
<field name="active_country" type="radio"
class="btn-group" default="0"
label="COM_PHOCACART_FIELD_ACTIVE_COUNTRY_LABEL"
description="COM_PHOCACART_FIELD_ACTIVE_COUNTRY_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<!-- REGION -->
<field name="region" type="PhocacartRegions"
table="shipping" multiple="true"
label="COM_PHOCACART_FIELD_REGIONS_LABEL"
description="COM_PHOCACART_FIELD_REGIONS_DESC"
class="inputbox" size="1" />
<field name="active_region" type="radio"
class="btn-group" default="0"
label="COM_PHOCACART_FIELD_ACTIVE_REGION_LABEL"
description="COM_PHOCACART_FIELD_ACTIVE_REGION_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<!-- ZIP -->
<field name="zip" type="textarea"
label="COM_PHOCACART_FIELD_SHIPPING_ZIP_LABEL"
description="COM_PHOCACART_FIELD_SHIPPING_ZIP_DESC"
class="inputbox" size="1" />
<field name="active_zip" type="radio"
class="btn-group" default="0"
label="COM_PHOCACART_FIELD_ACTIVE_ZIP_LABEL"
description="COM_PHOCACART_FIELD_ACTIVE_ZIP_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="metakey" type="textarea"
label="JField_Meta_Keywords_Label"
description="JField_Meta_Keywords_Desc"
class="inputbox" rows="3" cols="30" />
<field name="metadesc" type="textarea"
label="JField_Meta_Description_Label"
description="JField_Meta_Description_Desc"
class="inputbox" rows="3" cols="30" />
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<!--
<field name="language" type="contentlanguage"
label="JFIELD_LANGUAGE_LABEL"
description="COM_PHOCACART_FIELD_LANGUAGE_DESC"
class="inputbox">
<option value="*">JALL</option>
</field>
<field name="date" type="Calendar"
class="inputbox" label="COM_PHOCACART_FIELD_DATE_LABEL"
description="COM_PHOCACART_FIELD_DATE_DESC"
filter="JComponentHelper::filterText" />
<field name="hits" type="Text"
class="inputbox" size="6"
label="COM_PHOCACART_FIELD_HITS"
description="COM_PHOCACART_FIELD_HITS_DESC" />
-->
</fieldset>
<fields name="metadata">
<fieldset name="metadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<!--
<field name="robots" type="list"
label="JField_Metadata_Robots_Label"
description="JField_Metadata_Robots_Desc"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JGLOBAL_INDEX_FOLLOW</option>
<option value="1">JGLOBAL_NOINDEX_FOLLOW</option>
<option value="2">JGLOBAL_INDEX_NOFOLLOW</option>
<option value="3">JGLOBAL_NOINDEX_NOFOLLOW</option>
<option value="4">JGLOBAL_NO_ROBOTS_TAG</option>
</field>
<field name="author" type="text"
label="JAUTHOR"
description="JField_Metadata_Author_Desc" size="20"
/>
<field name="rights" type="text"
label="JFIELD_META_RIGHTS_LABEL"
description="JFIELD_META_RIGHTS_DESC"
required="" filter="string" cols="30"
rows="2" /> -->
</fieldset>
</fields>
</form>
PK�"�[���Z��(models/forms/phocacartshippingmethod.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fields
addfieldpath="/administrator/components/com_phocacart/models/fields"
>
<fieldset name="shipping">
</fieldset>
</fields>
</form>PK�"�[?݁__'models/forms/phocacartspecification.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="ordering" type="PhocacartOrdering"
table="attribute" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<field name="language" type="contentlanguage"
label="JFIELD_LANGUAGE_LABEL"
description="COM_PHOCACART_FIELD_LANGUAGE_DESC"
class="inputbox">
<option value="*">JALL</option>
</field>
<field name="date" type="Calendar"
class="inputbox" label="COM_PHOCACART_FIELD_DATE_LABEL"
description="COM_PHOCACART_FIELD_DATE_DESC"
filter="JComponentHelper::filterText" />
<!--
<field name="hits" type="Text"
class="inputbox" size="6"
label="COM_PHOCACART_FIELD_HITS"
description="COM_PHOCACART_FIELD_HITS_DESC" />
-->
</fieldset>
</form>
PK�"�[+e��~*~*
models/forms/phocacartstatus.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text"
default="0" label="JGLOBAL_FIELD_ID_LABEL"
required="true" readonly="true"
class="readonly"/>
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_LANG_STRING_DESC"
required="true"/>
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC"/>
<field name="stock_movements" type="list"
label="COM_PHOCACART_FIELD_STOCK_MOVEMENTS_LABEL"
description="COM_PHOCACART_FIELD_STOCK_MOVEMENTS_DESC"
class="inputbox" size="1" default="=">
<option
value="=">COM_PHOCACART_ITEMS_UNCHANGED</option>
<option
value="+">COM_PHOCACART_ITEMS_ADDED</option>
<option
value="-">COM_PHOCACART_ITEMS_SUBTRACTED</option>
</field>
<field name="change_user_group" type="list"
label="COM_PHOCACART_FIELD_USER_GROUP_CHANGE_LABEL"
description="COM_PHOCACART_FIELD_USER_GROUP_CHANGE_DESC"
class="inputbox" size="1" default="0">
<option
value="0">COM_PHOCACART_USER_GROUP_UNCHANGED</option>
<option
value="1">COM_PHOCACART_USER_GROUP_CHANGED</option>
</field>
<field name="change_points_needed"
type="list"
label="COM_PHOCACART_FIELD_REWARD_POINTS_CHANGE_NEEDED_LABEL"
description="COM_PHOCACART_FIELD_REWARD_POINTS_CHANGE_NEEDED_DESC"
class="inputbox" size="1"
default="1">
<option
value="0">COM_PHOCACART_REWARD_POINTS_UNCHANGED</option>
<option
value="1">COM_PHOCACART_REWARD_POINTS_CHANGED_CHANGE_APPROVED</option>
<option
value="2">COM_PHOCACART_REWARD_POINTS_CHANGED_CHANGE_NOT_APPROVED</option>
</field>
<field name="change_points_received"
type="list"
label="COM_PHOCACART_FIELD_REWARD_POINTS_CHANGE_RECEIVED_LABEL"
description="COM_PHOCACART_FIELD_REWARD_POINTS_CHANGE_RECEIVED_DESC"
class="inputbox" size="1"
default="0">
<option
value="0">COM_PHOCACART_REWARD_POINTS_UNCHANGED</option>
<option
value="1">COM_PHOCACART_REWARD_POINTS_CHANGED_CHANGE_APPROVED</option>
<option
value="2">COM_PHOCACART_REWARD_POINTS_CHANGED_CHANGE_NOT_APPROVED</option>
</field>
<field name="download" type="list"
label="COM_PHOCACART_FIELD_STATUS_DOWNLOAD_LABEL"
description="COM_PHOCACART_FIELD_STATUS_DOWNLOAD_DESC"
class="inputbox" size="1" default="0">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="email_customer" type="list"
label="COM_PHOCACART_FIELD_EMAIL_CUSTOMER_LABEL"
description="COM_PHOCACART_FIELD_EMAIL_CUSTOMER_DESC"
class="inputbox" size="1" default="0">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="2">COM_PHOCACART_YES_EXCLUDING_POS</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="email_others" type="textarea"
class="inputbox"
label="COM_PHOCACART_FIELD_EMAIL_OTHERS_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_EMAIL_OTHERS_DESC"/>
<field name="email_subject" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_EMAIL_SUBJECT_LABEL"
description="COM_PHOCACART_FIELD_EMAIL_SUBJECT_DESC"/>
<field name="email_text" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_EMAIL_TEXT_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_EMAIL_TEXT_DESC"/>
<field name="email_footer" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_EMAIL_FOOTER_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_EMAIL_FOOTER_DESC"/>
<field name="email_subject_others"
type="text" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_EMAIL_SUBJECT_OTHERS_LABEL"
description="COM_PHOCACART_FIELD_EMAIL_SUBJECT_OTHERS_DESC"/>
<field name="email_text_others"
type="editor" buttons="true"
hide="pagebreak,readmore" class="inputbox"
label="COM_PHOCACART_FIELD_EMAIL_TEXT_OTHERS_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_EMAIL_TEXT_OTHERS_DESC"/>
<field name="email_send" type="list"
label="COM_PHOCACART_FIELD_EMAIL_SEND_LABEL"
description="COM_PHOCACART_FIELD_EMAIL_SEND_DESC"
class="inputbox" size="1" default="0">
<option
value="0">COM_PHOCACART_NOTHING</option>
<option
value="1">COM_PHOCACART_ORDER</option>
<option
value="2">COM_PHOCACART_INVOICE</option>
<option
value="3">COM_PHOCACART_DELIVERY_NOTE</option>
</field>
<field name="email_send_format" default="0"
type="list"
label="COM_PHOCACART_FIELD_EMAIL_SEND_FORMAT_LABEL"
description="COM_PHOCACART_FIELD_EMAIL_SEND_FORMAT_DESC">
<option
value="0">COM_PHOCACART_HTML</option>
<option
value="1">COM_PHOCACART_PDF</option>
<option
value="2">COM_PHOCACART_BOTH</option>
</field>
<field name="email_attachments"
type="subform"
label="COM_PHOCACART_FIELD_EMAIL_ATTACHMENTS_LABEL"
description="COM_PHOCACART_FIELD_EMAIL_ATTACHMENTS_DESC"
multiple="true" max="3"
layout="joomla.form.field.subform.repeatable"
formsource="administrator/components/com_phocacart/models/forms/subform_email_attachments.xml"/>
<field name="orders_view_display"
type="list"
label="COM_PHOCACART_FIELD_DISPLAY_DOCUMENT_ORDERS_VIEW_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_DOCUMENT_ORDERS_VIEW_LABEL"
class="inputbox" size="1"
filter="int_array" default=""
multiple="true">
<option
value="1">COM_PHOCACART_ORDER</option>
<option
value="2">COM_PHOCACART_INVOICE</option>
<option
value="3">COM_PHOCACART_DELIVERY_NOTE</option>
</field>
<field name="ordering"
type="PhocacartOrdering" table="status"
class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC"/>
<field name="activate_gift" type="list"
label="COM_PHOCACART_FIELD_ACTIVATE_GIFT_LABEL"
description="COM_PHOCACART_FIELD_ACTIVATE_GIFT_DESC"
class="inputbox" size="1" default="0">
<option value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="email_gift" type="list"
label="COM_PHOCACART_FIELD_SEND_EMAIL_GIFT_LABEL"
description="COM_PHOCACART_FIELD_SEND_EMAIL_GIFT_DESC"
class="inputbox" size="1" default="0">
<option
value="1">COM_PHOCACART_YES_BUYER</option>
<option
value="2">COM_PHOCACART_YES_RECIPIENT</option>
<option
value="3">COM_PHOCACART_YES_BUYER_AND_RECIPIENT</option>
<option
value="0">COM_PHOCACART_NO_ONE</option>
</field>
<field name="email_subject_gift_sender"
type="text" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_EMAIL_SUBJECT_BUYER_GIFT_LABEL"
description="COM_PHOCACART_FIELD_EMAIL_SUBJECT_BUYER_GIFT_DESC"/>
<field name="email_text_gift_sender"
type="editor" buttons="true"
hide="pagebreak,readmore" class="inputbox"
label="COM_PHOCACART_FIELD_EMAIL_TEXT_BUYER_GIFT_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_EMAIL_TEXT_BUYER_GIFT_DESC"/>
<field name="email_subject_gift_recipient"
type="text" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_EMAIL_SUBJECT_RECIPIENT_GIFT_LABEL"
description="COM_PHOCACART_FIELD_EMAIL_SUBJECT_RECIPIENT_GIFT_DESC"/>
<field name="email_text_gift_recipient"
type="editor" buttons="true"
hide="pagebreak,readmore" class="inputbox"
label="COM_PHOCACART_FIELD_EMAIL_TEXT_RECIPIENT_GIFT_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_EMAIL_TEXT_RECIPIENT_GIFT_DESC"/>
<field name="email_gift_format" default="0"
type="list"
label="COM_PHOCACART_FIELD_EMAIL_SEND_FORMAT_GIFT_LABEL"
description="COM_PHOCACART_FIELD_EMAIL_SEND_FORMAT_GIFT_DESC">
<option
value="0">COM_PHOCACART_HTML</option>
<option
value="1">COM_PHOCACART_PDF</option>
<option
value="2">COM_PHOCACART_BOTH</option>
</field>
<field name="description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_DESCRIPTION_DESC"/>
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS">
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<field name="language"
type="contentlanguage" label="JFIELD_LANGUAGE_LABEL"
description="COM_PHOCACART_FIELD_LANGUAGE_DESC"
class="inputbox">
<option value="*">JALL</option>
</field>
<!--
<field name="date" type="Calendar"
class="inputbox" label="COM_PHOCACART_FIELD_DATE_LABEL"
description="COM_PHOCACART_FIELD_DATE_DESC"
filter="JComponentHelper::filterText" />
<field name="hits" type="Text"
class="inputbox" size="6"
label="COM_PHOCACART_FIELD_HITS"
description="COM_PHOCACART_FIELD_HITS_DESC" />
-->
</fieldset>
<fields name="metadata">
<fieldset name="metadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<!--
<field name="robots" type="list"
label="JField_Metadata_Robots_Label"
description="JField_Metadata_Robots_Desc"
>
<option
value="">JGLOBAL_USE_GLOBAL</option>
<option
value="0">JGLOBAL_INDEX_FOLLOW</option>
<option
value="1">JGLOBAL_NOINDEX_FOLLOW</option>
<option
value="2">JGLOBAL_INDEX_NOFOLLOW</option>
<option
value="3">JGLOBAL_NOINDEX_NOFOLLOW</option>
<option
value="4">JGLOBAL_NO_ROBOTS_TAG</option>
</field>
<field name="author" type="text"
label="JAUTHOR"
description="JField_Metadata_Author_Desc"
size="20" />
<field name="rights" type="text"
label="JFIELD_META_RIGHTS_LABEL"
description="JFIELD_META_RIGHTS_DESC"
required="" filter="string"
cols="30" rows="2" /> -->
</fieldset>
</fields>
</form>
PK�"�[����00%models/forms/phocacartstockstatus.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text"
default="0" label="JGLOBAL_FIELD_ID_LABEL"
required="true" readonly="true"
class="readonly"/>
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_LANG_STRING_DESC"
required="true"/>
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC"/>
<field name="image" type="media"
manager="categoryimage"
label="COM_PHOCACART_FIELD_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_DESC"
class="inputbox" size="40"/>
<field name="title_feed" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_STOCK_STATUS_TITLE_XML_FEED_LABEL"
description="COM_PHOCACART_FIELD_STOCK_STATUS_TITLE_XML_FEED_DESC"/>
<field name="link" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_STOCK_STATUS_LINK_LABEL"
description="COM_PHOCACART_FIELD_STOCK_STATUS_LINK_DESC"/>
<field name="link_target" type="list"
class="inputbox"
label="COM_PHOCACART_FIELD_STOCK_STATUS_LINK_TARGET_LABEL"
description="COM_PHOCACART_FIELD_STOCK_STATUS_LINK_TARGET_DESC"
default="_self">
<option
value="_self">COM_PHOCACART_OPEN_WINDOW_SELF</option>
<option
value="_blank">COM_PHOCACART_OPEN_WINDOW_BLANK</option>
<option
value="_parent">COM_PHOCACART_OPEN_WINDOW_PARENT</option>
<option
value="_top">COM_PHOCACART_OPEN_WINDOW_TOP</option>
</field>
<field name="ordering"
type="PhocacartOrdering" table="attribute"
class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC"/>
<field name="description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_DESCRIPTION_DESC"/>
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS">
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<field name="language"
type="contentlanguage" label="JFIELD_LANGUAGE_LABEL"
description="COM_PHOCACART_FIELD_LANGUAGE_DESC"
class="inputbox">
<option value="*">JALL</option>
</field>
<!--
<field name="date" type="Calendar"
class="inputbox" label="COM_PHOCACART_FIELD_DATE_LABEL"
description="COM_PHOCACART_FIELD_DATE_DESC"
filter="JComponentHelper::filterText" />
<field name="hits" type="Text"
class="inputbox" size="6"
label="COM_PHOCACART_FIELD_HITS"
description="COM_PHOCACART_FIELD_HITS_DESC" />
-->
</fieldset>
</form>
PK�"�[�u�0� � models/forms/phocacarttag.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="link_cat" type="phocacartcategory"
label="COM_PHOCACART_FIELD_CATEGORY_LINK_LABEL"
description="COM_PHOCACART_FIELD_CATEGORY_LINK_DESC"
class="inputbox" />
<field name="link_ext" type="text"
label="COM_PHOCACART_FIELD_EXT_LINK_TAG_LABEL"
description="COM_PHOCACART_FIELD_EXT_LINK_TAG_DESC"
class="inputbox" size="40" />
<field name="type" type="list"
label="COM_PHOCACART_FIELD_TAG_TYPE_LABEL"
description="COM_PHOCACART_FIELD_TAG_TYPE_DESC"
class="inputbox" size="1" default="0">
<option value="0">COM_PHOCACART_TAG</option>
<option value="1">COM_PHOCACART_LABEL</option>
</field>
<field name="display_format" type="list"
label="COM_PHOCACART_FIELD_TAG_DISPLAY_FORMAT_LABEL"
description="COM_PHOCACART_FIELD_TAG_DISPLAY_FORMAT_DESC"
class="inputbox" size="1" default="1">
<option value="1">COM_PHOCACART_TITLE_ONLY</option>
<option value="2">COM_PHOCACART_ICON_ONLY</option>
<option value="3">COM_PHOCACART_ICON_AND_TITLE</option>
</field>
<field name="icon_class" type="text"
label="COM_PHOCACART_FIELD_TAG_ICON_CLASS_LABEL"
description="COM_PHOCACART_FIELD_TAG_ICON_CLASS_DESC"
class="inputbox" size="40" />
<field name="ordering" type="phocacartOrdering"
table="tag" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
<field name="description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_DESCRIPTION_DESC" />
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
</fieldset>
</form>
PK�"�[��ҹ))models/forms/phocacarttax.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="tax_rate" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TAX_RATE_LABEL"
description="COM_PHOCACART_FIELD_TAX_RATE_DESC" />
<field name="calculation_type" type="list"
label="COM_PHOCACART_FIELD_CALCULATION_TYPE_LABEL"
description="COM_PHOCACART_FIELD_CALCULATION_TYPE_DESC"
class="inputbox" size="1" default="1">
<option value="1">COM_PHOCACART_PERCENTAGE</option>
<option value="2">COM_PHOCACART_FIXED_AMOUNT</option>
</field>
<field name="ordering" type="PhocacartOrdering"
table="tax" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
</fieldset>
</form>PK�"�[��6���models/forms/phocacarttime.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="type" type="list"
label="COM_PHOCACART_FIELD_OPENING_TIMES_TYPE_LABEL"
description="COM_PHOCACART_FIELD_OPENING_TIMES_TYPE_DESC"
class="inputbox" size="1" default="1">
<option
value="1">COM_PHOCACART_OPENING_HOURS</option>
<option value="2">COM_PHOCACART_CLOSING_HOURS</option>
<option value="3">COM_PHOCACART_CLOSING_DAYS</option>
</field>
<field name="day" type="list"
label="COM_PHOCACART_FIELD_OPENING_TIMES_DAY_LABEL"
description="COM_PHOCACART_FIELD_OPENING_TIMES_DAY_DESC"
class="inputbox" size="1" default="-1">
<option value="-1">COM_PHOCACART_NOT_SET</option>
<option value="1">MONDAY</option>
<option value="2">TUESDAY</option>
<option value="3">WEDNESDAY</option>
<option value="4">THURSDAY</option>
<option value="5">FRIDAY</option>
<option value="6">SATURDAY</option>
<option value="0">SUNDAY</option>
</field>
<field name="hour_from" type="list"
label="COM_PHOCACART_FIELD_OPENING_TIMES_DAY_HOUR_FROM_LABEL"
description="COM_PHOCACART_FIELD_OPENING_TIMES_DAY_HOUR_FROM_DESC"
class="inputbox" size="1" default="-1">
<option value="-1">COM_PHOCACART_NOT_SET</option>
<option value="0">00</option>
<option value="1">01</option>
<option value="2">02</option>
<option value="3">03</option>
<option value="4">04</option>
<option value="5">05</option>
<option value="6">06</option>
<option value="7">07</option>
<option value="8">08</option>
<option value="9">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
</field>
<field name="minute_from" type="list"
label="COM_PHOCACART_FIELD_OPENING_TIMES_DAY_MINUTE_FROM_LABEL"
description="COM_PHOCACART_FIELD_OPENING_TIMES_DAY_MINUTE_FROM_DESC"
class="inputbox" size="1" default="-1">
<option value="-1">COM_PHOCACART_NOT_SET</option>
<option value="0">00</option>
<option value="5">05</option>
<option value="10">10</option>
<option value="15">15</option>
<option value="20">20</option>
<option value="25">25</option>
<option value="30">30</option>
<option value="35">35</option>
<option value="40">40</option>
<option value="45">45</option>
<option value="50">50</option>
<option value="55">55</option>
<option value="59">59</option>
</field>
<field name="hour_to" type="list"
label="COM_PHOCACART_FIELD_OPENING_TIMES_DAY_HOUR_TO_LABEL"
description="COM_PHOCACART_FIELD_OPENING_TIMES_DAY_HOUR_TO_DESC"
class="inputbox" size="1" default="-1">
<option value="-1">COM_PHOCACART_NOT_SET</option>
<option value="0">00</option>
<option value="1">01</option>
<option value="2">02</option>
<option value="3">03</option>
<option value="4">04</option>
<option value="5">05</option>
<option value="6">06</option>
<option value="7">07</option>
<option value="8">08</option>
<option value="9">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
</field>
<field name="minute_to" type="list"
label="COM_PHOCACART_FIELD_OPENING_TIMES_DAY_MINUTE_TO_LABEL"
description="COM_PHOCACART_FIELD_OPENING_TIMES_DAY_MINUTE_TO_DESC"
class="inputbox" size="1" default="-1">
<option value="-1">COM_PHOCACART_NOT_SET</option>
<option value="0">00</option>
<option value="5">05</option>
<option value="10">10</option>
<option value="15">15</option>
<option value="20">20</option>
<option value="25">25</option>
<option value="30">30</option>
<option value="35">35</option>
<option value="40">40</option>
<option value="45">45</option>
<option value="50">50</option>
<option value="55">55</option>
<option value="59">59</option>
</field>
<field name="date" type="Calendar"
class="inputbox"
label="COM_PHOCACART_FIELD_OPENING_TIMES_DATE_LABEL"
description="COM_PHOCACART_FIELD_OPENING_TIMES_DATE_DESC"
filter="JComponentHelper::filterText" />
<field name="ordering" type="phocacartOrdering"
table="tag" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
<field name="description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_DESCRIPTION_DESC" />
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
</fieldset>
</form>
PK�"�[Ĕ
_""models/forms/phocacartunit.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="section_id" type="PhocacartSection"
label="COM_PHOCACART_FIELD_SECTION_LABEL"
description="COM_PHOCACART_FIELD_SECTION_DESC"
class="inputbox" required="true" />
<field name="image" type="media"
manager="" label="COM_PHOCACART_FIELD_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_DESC"
class="inputbox" size="40" />
<field name="class_name" type="text"
class="inputbox"
label="COM_PHOCACART_FIELD_CSS_CLASS_NAME_LABEL"
description="COM_PHOCACART_FIELD_CSS_CLASS_NAME_DESC"
size="255" />
<field name="custom_css" type="textarea"
buttons="true" class="inputbox"
label="COM_PHOCACART_FIELD_CUSTOM_CSS_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_CUSTOM_CSS_DESC" />
<field name="ordering" type="phocacartOrdering"
table="tag" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
<field name="description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_DESCRIPTION_DESC" />
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
</fieldset>
</form>
PK�"�[3��c��models/forms/phocacartuser.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<!-- Loaded by database -->
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="user_id" type="user"
default="0" label="JGLOBAL_FIELD_ID_LABEL"
required="true" readonly="true"
class="readonly" />
<field name="group" type="PhocacartGroups"
table="1" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CUSTOMER_GROUP_LABEL"
description="COM_PHOCACART_FIELD_CUSTOMER_GROUP_DESC" />
<field name="loyalty_card_number" type="text"
table="1" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_LOYALTY_CARD_NUMBER_LABEL"
description="COM_PHOCACART_FIELD_LOYALTY_CARD_NUMBER_DESC" />
</fieldset>
</form>PK�"�[H��[[
models/forms/phocacartvendor.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<!--
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true" />-->
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="user_id" type="user"
default="0" label="JGLOBAL_FIELD_ID_LABEL"
required="true" />
<field name="image" type="media"
manager="" label="COM_PHOCACART_FIELD_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_DESC"
class="inputbox" size="40" />
<field name="ordering" type="phocacartOrdering"
table="tag" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
<field name="description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_DESCRIPTION_DESC" />
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
</fieldset>
</form>
PK�"�[\�)"models/forms/phocacartwishlist.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="product_id" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRODUCT_ID_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_ID_DESC" />
<field name="category_id" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CATEGORY_ID_LABEL"
description="COM_PHOCACART_FIELD_CATEGORY_ID_DESC" />
<field name="user_id" type="user"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_USER_ID_LABEL"
description="COM_PHOCACART_FIELD_USER_ID_DESC" />
<field name="ip" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_IP_LABEL"
description="COM_PHOCACART_FIELD_IP_DESC" />
<field name="ordering" type="PhocacartOrdering"
table="wishlist" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<field name="language" type="contentlanguage"
label="JFIELD_LANGUAGE_LABEL"
description="COM_PHOCACART_FIELD_LANGUAGE_DESC"
class="inputbox">
<option value="*">JALL</option>
</field>
<field name="date" type="Calendar"
class="inputbox" label="COM_PHOCACART_FIELD_DATE_LABEL"
description="COM_PHOCACART_FIELD_DATE_DESC"
filter="JComponentHelper::filterText" />
</fieldset>
</form>
PK�"�[3Q���models/forms/phocacartzone.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" required="true"
readonly="true" class="readonly" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="code2" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CODE2_LABEL"
description="COM_PHOCACART_FIELD_CODE2_DESC" />
<field name="code3" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CODE3_LABEL"
description="COM_PHOCACART_FIELD_CODE3_DESC" />
<!-- COUNTRY -->
<field name="country" type="PhocaCartCountries"
table="zone" multiple="true"
label="COM_PHOCACART_FIELD_COUNTRIES_LABEL"
description="COM_PHOCACART_FIELD_COUNTRIES_DESC"
class="inputbox" size="1" />
<!-- REGION -->
<field name="region" type="PhocacartRegions"
table="zone" multiple="true"
label="COM_PHOCACART_FIELD_REGIONS_LABEL"
description="COM_PHOCACART_FIELD_REGIONS_DESC"
class="inputbox" size="1" />
<field name="image" type="media"
manager="categoryimage"
label="COM_PHOCACART_FIELD_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_DESC"
class="inputbox" size="40" />
<field name="ordering" type="PhocacartOrdering"
table="country" class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC" />
<field name="metakey" type="textarea"
label="JField_Meta_Keywords_Label"
description="JField_Meta_Keywords_Desc"
class="inputbox" rows="3" cols="30" />
<field name="metadesc" type="textarea"
label="JField_Meta_Description_Label"
description="JField_Meta_Description_Desc"
class="inputbox" rows="3" cols="30" />
</fieldset>
<fieldset name="publish"
label="COM_PHOCACART_GROUP_LABEL_PUBLISHING_DETAILS" >
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<field name="language" type="contentlanguage"
label="JFIELD_LANGUAGE_LABEL"
description="COM_PHOCACART_FIELD_LANGUAGE_DESC"
class="inputbox">
<option value="*">JALL</option>
</field>
<!--
<field name="date" type="Calendar"
class="inputbox" label="COM_PHOCACART_FIELD_DATE_LABEL"
description="COM_PHOCACART_FIELD_DATE_DESC"
filter="JComponentHelper::filterText" />
<field name="hits" type="Text"
class="inputbox" size="6"
label="COM_PHOCACART_FIELD_HITS"
description="COM_PHOCACART_FIELD_HITS_DESC" />
-->
</fieldset>
<fields name="metadata">
<fieldset name="metadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
</fieldset>
</fields>
</form>
PK�"�[�A��II2models/forms/subform_additional_download_files.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset>
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" readonly="true"
class="readonly hidden" hidden="true" />
<field name="download_token" type="phocacarttoken"
manager="token" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_DOWNLOAD_TOKEN_LABEL"
description="COM_PHOCACART_FIELD_DOWNLOAD_TOKEN_DESC" />
<field name="download_file"
type="phocaselectfilename" manager="productfile"
label="COM_PHOCACART_FIELD_DOWNLOAD_FILE_LABEL"
description="COM_PHOCACART_FIELD_DOWNLOAD_FILE_DESC"
class="inputbox" size="40" />
<field name="download_days" default="-1"
size="4" type="text"
label="COM_PHOCACART_FIELD_DOWNLOAD_FILE_EXPIRATION_DATE_DAYS_LABEL"
description="COM_PHOCACART_FIELD_DOWNLOAD_FILE_EXPIRATION_DATE_DAYS_DESC"/>
</fieldset>
</form>
PK�"�[�a�7��*models/forms/subform_additional_images.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset>
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" readonly="true"
class="readonly hidden" hidden="true" />
<field name="image"
type="phocaselectfilenameimage" manager="productimage"
label="COM_PHOCACART_FIELD_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_DESC" class="inputbox
imageCreateThumbs" size="40" />
</fieldset>
</form>
PK�"�[Ϧk%%#models/forms/subform_attributes.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset>
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" readonly="true"
class="readonly hidden" hidden="true" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="required" type="radio"
class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_REQUIRED_LABEL"
description="COM_PHOCACART_FIELD_REQUIRED_DESC"
default="0" >
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="type" type="list" class="btn-group
btn-group-yesno" label="COM_PHOCACART_FIELD_TYPE_LABEL"
description="COM_PHOCACART_FIELD_TYPE_DESC" default="1"
>
<option
value="1">COM_PHOCACART_ATTR_TYPE_SELECT</option>
<option
value="2">COM_PHOCACART_ATTR_TYPE_COLOR_SELECT</option>
<option
value="3">COM_PHOCACART_ATTR_TYPE_IMAGE_SELECT</option>
<option
value="4">COM_PHOCACART_ATTR_TYPE_CHECKBOX</option>
<option
value="5">COM_PHOCACART_ATTR_TYPE_COLOR_CHECKBOX</option>
<option
value="6">COM_PHOCACART_ATTR_TYPE_IMAGE_CHECKBOX</option>
<option
value="7">COM_PHOCACART_ATTR_TYPE_TEXT_64</option>
<option
value="8">COM_PHOCACART_ATTR_TYPE_TEXT_128</option>
<option
value="9">COM_PHOCACART_ATTR_TYPE_TEXT_256</option>
<option
value="10">COM_PHOCACART_ATTR_TYPE_TEXTAREA_1024</option>
<option
value="11">COM_PHOCACART_ATTR_TYPE_TEXTAREA_2048</option>
<option
value="12">COM_PHOCACART_ATTR_TYPE_TEXT_COLOR_PICKER</option>
<option
value="20">COM_PHOCACART_ATTR_TYPE_GIFT</option>
</field>
<field name="options" type="subform"
label="COM_PHOCACART_FIELD_OPTIONS_LABEL"
description="COM_PHOCACART_FIELD_OPTIONS_DESC"
multiple="true"
layout="joomla.form.field.subform.repeatable"
formsource="administrator/components/com_phocacart/models/forms/subform_options.xml"/>
</fieldset>
</form>
PK�"�[txج� � "models/forms/subform_discounts.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset>
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" readonly="true"
class="readonly hidden" hidden="true" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="access" type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC" class="inputbox"
size="1"/>
<field name="discount" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_DISCOUNT_LABEL"
description="COM_PHOCACART_FIELD_DISCOUNT_DESC" />
<field name="calculation_type" type="list"
label="COM_PHOCACART_FIELD_CALCULATION_TYPE_LABEL"
description="COM_PHOCACART_FIELD_CALCULATION_TYPE_DESC"
default="1" >
<option
value="0">COM_PHOCACART_FIXED_AMOUNT</option>
<option value="1">COM_PHOCACART_PERCENTAGE</option>
</field>
<field name="quantity_from" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_MINIMUM_QUANTITY_LABEL"
description="COM_PHOCACART_FIELD_MINIMUM_QUANTITY_DESC" />
<!--
<field name="quantity_to" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_MAXIMUM_QUANTITY_LABEL"
description="COM_PHOCACART_FIELD_MAXIMUM_QUANTITY_DESC" />
-->
<field name="valid_from" type="Calendar"
class="inputbox"
label="COM_PHOCACART_FIELD_VALID_FROM_LABEL"
description="COM_PHOCACART_FIELD_VALID_FROM_DESC"
filter="JComponentHelper::filterText"/>
<field name="valid_to" type="Calendar"
class="inputbox"
label="COM_PHOCACART_FIELD_VALID_TO_LABEL"
description="COM_PHOCACART_FIELD_VALID_TO_DESC"
filter="JComponentHelper::filterText"/>
<field name="groups" type="PhocacartGroups"
table="4" class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CUSTOMER_GROUP_LABEL"
description="COM_PHOCACART_FIELD_CUSTOMER_GROUP_DESC" />
<field name="background_image" type="media"
label="COM_PHOCACART_FIELD_DISCOUNT_BACKGROUND_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_DISCOUNT_BACKGROUND_IMAGE_DESC"
class="inputbox" size="40"/>
<field name="description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_DISCOUNT_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_DISCOUNT_DESCRIPTION_DESC"/>
</fieldset>
</form>
PK�"�[�o�G��*models/forms/subform_email_attachments.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset>
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" readonly="true"
class="readonly hidden" hidden="true" />
<!--<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />-->
<field name="file_attachment"
type="phocaselectfilename" manager="attachmentfile"
label="COM_PHOCACART_FIELD_FILE_ATTACHMENT_LABEL"
description="COM_PHOCACART_FIELD_FILE_ATTACHMENT_DESC"
class="inputbox" size="40" />
</fieldset>
</form>
PK�"�[��0VYY"models/forms/subform_gifttypes.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset>
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" readonly="true"
class="readonly hidden" hidden="true" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="false" />
<field name="image" type="media"
default="" directoryimg="1"
label="COM_PHOCACART_FIELD_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_DESC"/>
<field name="image_small" type="media"
default="" directoryimg="1"
label="COM_PHOCACART_FIELD_IMAGE_SMALL_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_SMALL_DESC"/>
<field name="description" type="editor"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_GIFT_DESCRIPTION_LABEL"
filter="JComponentHelper::filterText"
description="COM_PHOCACART_FIELD_GIFT_DESCRIPTION_DESC"/>
<field name="expiration_date" type="Calendar"
class="inputbox"
label="COM_PHOCACART_FIELD_GIFT_EXPIRATION_DATE_LABEL"
description="COM_PHOCACART_FIELD_GIFT_EXPIRATION_DATE_DESC"
translateformat="true" showtime="false"/>
<field name="class_name" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_CLASS_NAME_LABEL"
description="COM_PHOCACART_FIELD_CLASS_NAME_DESC"
required="false" />
</fieldset>
</form>
PK�"�[}�F
models/forms/subform_options.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset>
<field name="id" type="text"
default="0" label="JGLOBAL_FIELD_ID_LABEL"
readonly="true" class="readonly hidden"
hidden="true"/>
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
required="true" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC"/>
<field name="operator" type="list"
label="COM_PHOCACART_FIELD_OPERATOR_PRICE_LABEL"
description="COM_PHOCACART_FIELD_OPERATOR_PRICE_DESC"
default="+">
<option value="+">+</option>
<option value="-">-</option>
</field>
<field name="amount" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_AMOUNT_LABEL"
description="COM_PHOCACART_FIELD_AMOUNT_DESC"/>
<field name="stock" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_STOCK_LABEL"
description="COM_PHOCACART_FIELD_STOCK_DESC"/>
<field name="operator_weight" type="list"
label="COM_PHOCACART_FIELD_OPERATOR_WEIGHT_LABEL"
description="COM_PHOCACART_FIELD_OPERATOR_WEIGHT_DESC"
default="+">
<option value="+">+</option>
<option value="-">-</option>
</field>
<field name="weight" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_WEIGHT_LABEL"
description="COM_PHOCACART_FIELD_WEIGHT_DESC"/>
<field name="image"
type="phocaselectfilenameimage" manager="productimage"
label="COM_PHOCACART_FIELD_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_DESC" class="inputbox
imageCreateThumbs" size="40"/>
<field name="image_medium"
type="phocaselectfilenameimage" manager="productimage"
label="COM_PHOCACART_FIELD_IMAGE_MEDIUM_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_MEDIUM_DESC"
class="inputbox imageCreateThumbs"
size="40"/>
<field name="image_small"
type="phocaselectfilenameimage" manager="productimage"
label="COM_PHOCACART_FIELD_IMAGE_SMALL_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_SMALL_DESC"
class="inputbox imageCreateThumbs"
size="40"/>
<field name="download_folder" type="text"
manager="productfile"
label="COM_PHOCACART_FIELD_DOWNLOAD_FOLDER_LABEL"
readonly="true"
description="COM_PHOCACART_FIELD_DOWNLOAD_FOLDER_DESC"
class="inputbox"
size="40"/>
<field name="download_token" type="text"
manager="productfile"
label="COM_PHOCACART_FIELD_DOWNLOAD_TOKEN_LABEL"
description="COM_PHOCACART_FIELD_DOWNLOAD_TOKEN_DESC"
class="inputbox" size="40"/>
<field name="download_file"
type="phocaselectfilename" manager="productfile"
label="COM_PHOCACART_FIELD_DOWNLOAD_FILE_LABEL"
description="COM_PHOCACART_FIELD_DOWNLOAD_FILE_DESC"
class="inputbox" size="40"/>
<field name="color" type="phocacolortext"
label="COM_PHOCACART_FIELD_COLOR_LABEL"
description="COM_PHOCACART_FIELD_COLOR_DESC"
class="inputbox" size="40" default=""/>
<field name="default_value" type="radio"
class="btn-group btn-group-yesno" default="0"
label="COM_PHOCACART_FIELD_DEFAULT_LABEL"
description="COM_PHOCACART_FIELD_DEFAULT_DESC">
<option
value="1">COM_PHOCACART_YES</option>
<option
value="0">COM_PHOCACART_NO</option>
</field>
<field name="required" type="radio"
class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_REQUIRED_ATTR_OPTIONS_LABEL"
description="COM_PHOCACART_FIELD_REQUIRED_ATTR_OPTIONS_DESC"
default="0" >
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
<field name="type" type="list"
class="btn-group btn-group-yesno"
label="COM_PHOCACART_FIELD_TYPE_ATTR_OPTIONS_LABEL"
description="COM_PHOCACART_FIELD_TYPE_ATTR_OPTIONS_DESC"
default="1" >
<option
value="0">COM_PHOCACART_ATTR_TYPE_DEFAULT</option>
<option
value="20">COM_PHOCACART_ATTR_TYPE_GIFT_RECIPIENT_NAME</option>
<option
value="21">COM_PHOCACART_ATTR_TYPE_GIFT_RECIPIENT_EMAIL</option>
<option
value="22">COM_PHOCACART_ATTR_TYPE_GIFT_SENDER_NAME</option>
<option
value="23">COM_PHOCACART_ATTR_TYPE_GIFT_SENDER_MESSAGE</option>
<option
value="24">COM_PHOCACART_ATTR_TYPE_GIFT_TYPE</option>
</field>
</fieldset>
</form>
PK�"�[:�/&models/forms/subform_price_history.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset>
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" readonly="true"
class="readonly hidden" hidden="true" />
<field name="price" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRICE_LABEL"
description="COM_PHOCACART_FIELD_PRICE_DESC" />
<field name="date" type="Calendar"
class="inputbox" label="COM_PHOCACART_FIELD_DATE_LABEL"
description="COM_PHOCACART_FIELD_VALID_TO_DESC"
filter="JComponentHelper::filterText"/>
</fieldset>
</form>
PK�"�[O��-��&models/forms/subform_product_stock.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset>
<!--<field name="id" type="hidden"
default="0" label="JGLOBAL_FIELD_ID_LABEL"
readonly="true" class="readonly hidden"
hidden="true" />-->
<field name="product_key" type="hidden"
class="readonly hidden" hidden="true"
size="40" label="COM_PHOCACART_PRODUCT_KEY"
description="COM_PHOCACART_PRODUCT_KEY" />
<field name="product_id" type="hidden"
class="readonly hidden" hidden="true"
size="40" label="COM_PHOCACART_PRODUCT_ID"
description="COM_PHOCACART_PRODUCT_ID" />
<field name="attributes" type="hidden"
class="readonly hidden" hidden="true"
size="40" label="COM_PHOCACART_PRODUCT_ATTRIBUTES"
description="COM_PHOCACART_PRODUCT_ATTRIBUTES" />
<field name="product_title" type="PhocaRawcontent"
class="input-mini" size="40"
label="COM_PHOCACART_TITLE"
description="COM_PHOCACART_TITLE" />
<field name="title" type="PhocaRawcontent"
class="input-mini" size="40"
label="COM_PHOCACART_ATTRIBUTES"
description="COM_PHOCACART_ATTRIBUTES" />
<field name="stock" type="text"
class="input-mini" size="20"
label="COM_PHOCACART_IN_STOCK"
description="COM_PHOCACART_IN_STOCK" />
<field name="price" type="text"
class="input-mini" size="20"
label="COM_PHOCACART_PRICE"
description="COM_PHOCACART_PRICE" />
<field name="sku" type="text"
class="input-mini" size="20"
label="COM_PHOCACART_SKU"
description="COM_PHOCACART_SKU" />
<field name="ean" type="text"
class="input-mini" size="20"
label="COM_PHOCACART_EAN"
description="COM_PHOCACART_EAN" />
<field name="image" type="phocaselectfilenameimage"
manager="productimage" size="40"
label="COM_PHOCACART_IMAGE"
description="COM_PHOCACART_IMAGE" class="inputbox
imageCreateThumbs" />
</fieldset>
</form>
PK�"�[9��CC'models/forms/subform_specifications.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset>
<field name="id" type="text" default="0"
label="JGLOBAL_FIELD_ID_LABEL" readonly="true"
class="readonly hidden" hidden="true" />
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PARAMETER_LABEL"
description="COM_PHOCACART_FIELD_PARAMETER_DESC" />
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC" />
<field name="value" type="textarea"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_VALUE_LABEL"
description="COM_PHOCACART_FIELD_VALUE_DESC" />
<field name="alias_value" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_VALUE_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_VALUE_DESC" />
<field name="group_id"
type="PhocacartSpecificationGroups" default="0"
label="COM_PHOCACART_FIELD_GROUP_LABEL"
description="COM_PHOCACART_FIELD_GROUP_DESC"
class="inputbox" />
<field name="image" type="phocaselectfilenameimage"
manager="productimage"
label="COM_PHOCACART_FIELD_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_DESC" class="inputbox
imageCreateThumbs" size="40" />
<field name="image_medium"
type="phocaselectfilenameimage" manager="productimage"
label="COM_PHOCACART_FIELD_IMAGE_MEDIUM_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_MEDIUM_DESC"
class="inputbox imageCreateThumbs" size="40" />
<field name="image_small"
type="phocaselectfilenameimage" manager="productimage"
label="COM_PHOCACART_FIELD_IMAGE_SMALL_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_SMALL_DESC"
class="inputbox imageCreateThumbs" size="40" />
<field name="color" type="phocacolortext"
label="COM_PHOCACART_FIELD_COLOR_LABEL"
description="COM_PHOCACART_FIELD_COLOR_DESC"
class="inputbox" size="40" default="" />
</fieldset>
</form>
PK�"�[��EE%models/forms/subform_submit_files.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fieldset>
<field name="id" type="text"
default="0" label="JGLOBAL_FIELD_ID_LABEL"
readonly="true" class="readonly"/>
<field name="name" type="text"
label="COM_PHOCACART_FIELD_NAME_LABEL"
description="COM_PHOCACART_FIELD_NAME_DESC"
class="inputbox" size="40"/>
<field name="size" type="text"
label="COM_PHOCACART_FIELD_SIZE_LABEL"
description="COM_PHOCACART_FIELD_SIZE_DESC"
class="inputbox" size="40"/>
<field name="nametoken" type="text"
label="COM_PHOCACART_FIELD_NAME_TOKEN_LABEL"
description="COM_PHOCACART_FIELD_NAME_TOKEN_DESC"
class="inputbox" size="40"/>
<field name="fullpath" type="text"
label="COM_PHOCACART_FIELD_FULL_PATH_LABEL"
description="COM_PHOCACART_FIELD_FULL_PATH_DESC"
class="inputbox" size="40"/>
</fieldset>
</form>
PK�"�[�!�44models/forms/submit.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fields name="items_item">
<fieldset name="items_item"
addfieldpath="/components/com_phocacart/models/fields"
addrulepath="/components/com_phocacart/models/rules">
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
filter="string"/>
<field name="alias" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ALIAS_LABEL"
description="COM_PHOCACART_FIELD_ALIAS_DESC"
filter="string"/>
<field name="sku" type="text"
class="inputbox" size="255"
label="COM_PHOCACART_FIELD_SKU_LABEL"
description="COM_PHOCACART_FIELD_SKU_DESC"
filter="string"/>
<field name="upc" type="text"
class="inputbox" size="15"
label="COM_PHOCACART_FIELD_UPC_LABEL"
description="COM_PHOCACART_FIELD_UPC_DESC"
filter="string"/>
<field name="ean" type="text"
class="inputbox" size="15"
label="COM_PHOCACART_FIELD_EAN_LABEL"
description="COM_PHOCACART_FIELD_EAN_DESC"
filter="string"/>
<field name="jan" type="text"
class="inputbox" size="15"
label="COM_PHOCACART_FIELD_JAN_LABEL"
description="COM_PHOCACART_FIELD_JAN_DESC"
filter="string"/>
<field name="isbn" type="text"
class="inputbox" size="15"
label="COM_PHOCACART_FIELD_ISBN_LABEL"
description="COM_PHOCACART_FIELD_ISBN_DESC"
filter="string"/>
<field name="mpn" type="text"
class="inputbox" size="255"
label="COM_PHOCACART_FIELD_MPN_LABEL"
description="COM_PHOCACART_FIELD_MPN_DESC"
filter="string"/>
<field name="serial_number" type="text"
class="inputbox" size="255"
label="COM_PHOCACART_FIELD_SERIAL_NUMBER_LABEL"
description="COM_PHOCACART_FIELD_SERIAL_NUMBER_DESC"
filter="string"/>
<field name="registration_key"
type="text" class="inputbox" size="255"
label="COM_PHOCACART_FIELD_REGISTRATION_KEY_LABEL"
description="COM_PHOCACART_FIELD_REGISTRATION_KEY_DESC"
filter="string"/>
<field name="external_id" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_EXTERNAL_PRODUCT_ID_LABEL"
description="COM_PHOCACART_FIELD_EXTERNAL_PRODUCT_ID_DESC"
filter="string"/>
<field name="external_key" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_EXTERNAL_PRODUCT_KEY_LABEL"
description="COM_PHOCACART_FIELD_EXTERNAL_PRODUCT_KEY_DESC"
filter="string"/>
<field name="external_link" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_EXTERNAL_LINK_LABEL"
description="COM_PHOCACART_FIELD_EXTERNAL_LINK_DESC"
filter="url"/>
<field name="external_text" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_EXTERNAL_TEXT_LABEL"
description="COM_PHOCACART_FIELD_EXTERNAL_TEXT_DESC"
filter="string"/>
<field name="external_link2" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_EXTERNAL_LINK_2_LABEL"
description="COM_PHOCACART_FIELD_EXTERNAL_LINK_2_DESC"
filter="url"/>
<field name="external_text2" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_EXTERNAL_TEXT_2_LABEL"
description="COM_PHOCACART_FIELD_EXTERNAL_TEXT_2_DESC"
filter="string"/>
<field name="price" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_PRICE_LABEL"
description="COM_PHOCACART_FIELD_PRICE_DESC"
filter="float"/>
<field name="price_original" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_ORIGINAL_PRICE_LABEL"
description="COM_PHOCACART_FIELD_ORIGINAL_PRICE_DESC"
filter="float"/>
<field name="tax_id" type="phocatax"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TAX_LABEL"
description="COM_PHOCACART_FIELD_TAX_DESC"
filter="integer"/>
<field name="catid_multiple"
type="phocacartcategory"
label="COM_PHOCACART_FIELD_CATEGORY_LABEL"
description="COM_PHOCACART_FIELD_CATEGORY_DESC"
class="inputbox" multiple="true"
filter="int_array"/>
<field name="manufacturer_id"
type="phocamanufacturer"
label="COM_PHOCACART_FIELD_MANUFACTURER_LABEL"
description="COM_PHOCACART_FIELD_MANUFACTURER_DESC"
class="inputbox" filter="integer"/>
<field name="description"
type="textarea" buttons="true"
hide="pagebreak,readmore" class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LABEL"
filter="string"
description="COM_PHOCACART_FIELD_DESCRIPTION_DESC"
cols="75" rows="10"/>
<field name="description_long"
type="textarea" buttons="true"
hide="pagebreak,readmore" class="inputbox"
label="COM_PHOCACART_FIELD_DESCRIPTION_LONG_LABEL"
filter="string"
description="COM_PHOCACART_FIELD_DESCRIPTION_LONG_DESC"
cols="75" rows="10"/>
<field name="features" type="textarea"
buttons="true" hide="pagebreak,readmore"
class="inputbox"
label="COM_PHOCACART_FIELD_FEATURES_LABEL"
filter="string"
description="COM_PHOCACART_FIELD_FEATURES_DESC"
cols="75" rows="10"/>
<!-- FRONTEND
<field name="image" type="phocacartfile"
typemethod="image"
label="COM_PHOCACART_FIELD_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_DESC" class="inputbox
imageCreateThumbs" size="40" filter="string" />
-->
<field name="image" type="subform"
label="COM_PHOCACART_FIELD_IMAGES_LABEL"
description="COM_PHOCACART_FIELD_IMAGES_DESC"
multiple="true"
layout="joomla.form.field.subform.repeatable"
formsource="administrator/components/com_phocacart/models/forms/subform_submit_files.xml"/>
<field name="video" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_VIDEO_URL_LABEL"
description="COM_PHOCACART_FIELD_VIDEO_URL_DESC"
filter="url"/>
<field name="type" default="0"
type="list"
label="COM_PHOCACART_FIELD_PRODUCT_TYPE_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_TYPE_DESC"
filter="integer">
<option
value="0">COM_PHOCACART_PHYSICAL_PRODUCT</option>
<option
value="1">COM_PHOCACART_DIGITAL_DOWNLOADABLE_PRODUCT</option>
<option
value="2">COM_PHOCACART_MIXED_PRODUCT_DIGITAL_PHYSICAL</option>
<option
value="3">COM_PHOCACART_PRICE_ON_DEMAND_PRODUCT</option>
</field>
<field name="unit_amount" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_UNIT_AMOUNT_LABEL"
description="COM_PHOCACART_FIELD_UNIT_AMOUNT_DESC"
filter="string"/>
<field name="unit_unit" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_UNIT_UNIT_LABEL"
description="COM_PHOCACART_FIELD_UNIT_UNIT_DESC"
filter="string"/>
<field name="length" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_LENGTH_LABEL"
description="COM_PHOCACART_FIELD_LENGTH_DESC"
filter="string"/>
<field name="width" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_WIDTH_LABEL"
description="COM_PHOCACART_FIELD_WIDTH_DESC"
filter="string"/>
<field name="height" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_HEIGHT_LABEL"
description="COM_PHOCACART_FIELD_HEIGHT_DESC"
filter="string"/>
<field name="weight" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_WEIGHT_LABEL"
description="COM_PHOCACART_FIELD_WEIGHT_DESC"
filter="string"/>
<field name="volume" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_VOLUME_LABEL"
description="COM_PHOCACART_FIELD_VOLUME_DESC"
filter="string"/>
<field name="condition" type="list"
label="COM_PHOCACART_FIELD_PRODUCT_CONDITION_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_CONDITION_DESC"
class="inputbox" size="1" default="0"
filter="integer">
<option
value="0">COM_PHOCACART_CONDITION_NEW</option>
<option
value="1">COM_PHOCACART_CONDITION_REFURBISHED</option>
<option
value="2">COM_PHOCACART_CONDITION_USED</option>
</field>
<field name="type_feed" type="textarea"
label="COM_PHOCACART_FIELD_PRODUCT_TYPE_FEED_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_TYPE_FEED_DESC"
class="inputbox" rows="3" cols="30"
filter="string"/>
<field name="type_category_feed"
type="textarea"
label="COM_PHOCACART_FIELD_PRODUCT_CATEGORY_TYPE_FEED_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_CATEGORY_TYPE_FEED_DESC"
class="inputbox" rows="3"
cols="30" filter="string"/>
<field name="delivery_date"
type="Calendar" class="inputbox"
label="COM_PHOCACART_FIELD_PRODUCT_DELIVERY_DATE_LABEL"
description="COM_PHOCACART_FIELD_PRODUCT_DELIVERY_DATE_DESC"
filter="string" showtime="true"
format="%Y-%m-%d %H:%M:%S"/>
<field name="metatitle" type="text"
label="COM_PHOCACART_FIELD_META_TITLE_LABEL"
description="COM_PHOCACART_FIELD_META_TITLE_DESC"
class="inputbox"
filter="string"/>
<field name="metakey" type="textarea"
label="JField_Meta_Keywords_Label"
description="JField_Meta_Keywords_Desc"
class="inputbox" rows="3"
cols="30" filter="string"/>
<field name="metadesc" type="textarea"
label="JField_Meta_Description_Label"
description="JField_Meta_Description_Desc"
class="inputbox" rows="3"
cols="30" filter="string"/>
<field name="date" type="Calendar"
class="inputbox" label="COM_PHOCACART_FIELD_DATE_LABEL"
description="COM_PHOCACART_FIELD_DATE_DESC"
filter="string"/>
<field name="date_update"
type="Calendar" class="inputbox"
label="COM_PHOCACART_FIELD_UPDATE_DATE_LABEL"
description="COM_PHOCACART_FIELD_UPDATE_DATE_DESC"
filter="string"/>
<field name="tags"
type="PhocaTagsSubmitItems" multiple="1"
label="COM_PHOCACART_FIELD_TAGS_LABEL"
description="COM_PHOCACART_FIELD_TAGS_DESC"
class="inputbox" size="1"
filter="int_array"/>
<field name="taglabels"
type="PhocaTaglabelsSubmitItems" multiple="1"
label="COM_PHOCACART_FIELD_LABELS_LABEL"
description="COM_PHOCACART_FIELD_LABELS_DESC"
class="inputbox" size="1"
filter="int_array"/>
</fieldset>
</fields>
<fields name="items_contact">
<fieldset name="items_contact"
addfieldpath="/components/com_phocacart/models/fields"
addrulepath="/components/com_phocacart/models/rules">
<field name="name" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_F_NAME_LABEL"
description="COM_PHOCACART_FIELD_F_NAME_DESC"
filter="string"/>
<field name="email" type="email"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_F_EMAIL_LABEL"
description="COM_PHOCACART_FIELD_F_EMAIL_DESC"
filter="string" validate="phocacartemail"/>
<field name="phone" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_F_PHONE_LABEL"
description="COM_PHOCACART_FIELD_F_PHONE_DESC"
filter="string"/>
<field name="phone_mobile" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_F_MOBILE_PHONE_LABEL"
description="COM_PHOCACART_FIELD_F_MOBILE_PHONE_DESC"
filter="string"/>
<field name="message" type="textarea"
class="inputbox ph-question-message"
label="COM_PHOCACART_FIELD_F_MESSAGE_LABEL"
description="COM_PHOCACART_FIELD_F_MESSAGE_DESC"
filter="string"
rows="7" cols="45"/>
</fieldset>
</fields>
<fieldset
addfieldpath="/components/com_phocacart/models/fields"
addrulepath="/components/com_phocacart/models/rules">
<field name="title" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_TITLE_LABEL"
description="COM_PHOCACART_FIELD_TITLE_DESC"
filter="string"/>
<field name="ip" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_IP_LABEL"
description="COM_PHOCACART_FIELD_IP_DESC"
filter="string"/>
<field name="id" type="text"
default="0" label="JGLOBAL_FIELD_ID_LABEL"
required="true" readonly="true"
class="readonly"/>
<field name="user_id" type="user"
default="0" label="COM_PHOCACART_USER_ID_LABEL"
description="COM_PHOCACART_USER_ID_DESC"/>
<field name="date_submit" type="Calendar"
class="inputbox" label="COM_PHOCACART_FIELD_DATE_LABEL"
description="COM_PHOCACART_FIELD_DATE_DESC"
filter="JComponentHelper::filterText"/>
<field name="published" type="list"
label="COM_PHOCACART_FIELD_PUBLISHED_LABEL"
description="COM_PHOCACART_FIELD_PUBLISHED_DESC"
class="inputbox" size="1" default="1">
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
</field>
<field name="ordering"
type="PhocacartOrdering" table="submititem"
class="inputbox"
label="COM_PHOCACART_FIELD_ORDERING_LABEL"
description="COM_PHOCACART_FIELD_ORDERING_DESC"/>
<field name="privacy" type="hidden"
filter="integer"/>
<field name="upload_folder" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_UPLOAD_FOLDER_LABEL"
description="COM_PHOCACART_FIELD_UPLOAD_FOLDER_LABEL"
filter="string"/>
<field name="upload_token" type="text"
class="inputbox" size="40"
label="COM_PHOCACART_FIELD_UPLOAD_TOKEN_LABEL"
description="COM_PHOCACART_FIELD_UPLOAD_TOKEN_LABEL"
filter="string"/>
</fieldset>
<fieldset>
<field name="hidden_field" type="text"
preicon="icon-flag" id="phocacart-hidden"
validate="phocacarthidden"/>
</fieldset>
</form>
PK�"�[�#o,,models/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�["
:V
V
models/phocacartbulkprice.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelphocacartbulkprice extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record) {
return parent::canDelete($record);
}
protected function canEditState($record) {
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartBulkprice', $prefix =
'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartbulkprice',
'phocacartbulkprice', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartbulkprice.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
if (!empty($table->params)) {
$registry = new JRegistry($table->params);
$dataPhNew = $registry->toString();
if($dataPhNew != '') {
$table->params = $dataPhNew;
}
}
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_bulk_prices');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
public function delete(&$cid = array()) {
if (count( $cid )) {
$delete = parent::delete($cid);
if ($delete) {
PhocacartPriceBulkprice::removePriceHistoryItems($cid);
}
}
}
}
?>PK�"�[��models/phocacartbulkprices.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartBulkprices extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'day', 'a.day',
'date', 'a.date',
'type', 'a.type',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.time_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_bulk_prices` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[B�Iڳ�models/phocacartcart.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.modellist' );
class PhocaCartCpModelPhocacartCart extends JModelList
{
protected $option = 'com_phocacart';
public function getData() {
$app = JFactory::getApplication();
$userid = $app->input->get('userid', 0,
'int');
$vendorid = $app->input->get('vendorid', 0,
'int');
$ticketid = $app->input->get('ticketid', 0,
'int');
$unitid = $app->input->get('unitid', 0,
'int');
$sectionid = $app->input->get('sectionid', 0,
'int');
if ((int)$userid > 0) {
$db = JFactory::getDBO();
$query = 'SELECT a.cart, a.user_id, a.vendor_id, a.ticket_id,
a.unit_id, a.section_id, u.name as user_name, u.username as user_username,
a.date'
. ' FROM #__phocacart_cart_multiple AS a'
. ' LEFT JOIN #__users AS u ON u.id = a.user_id'
. ' WHERE a.user_id = '.(int)$userid
. ' AND a.vendor_id = '.(int)$vendorid
. ' AND a.ticket_id = '.(int)$ticketid
. ' AND a.unit_id = '.(int)$unitid
. ' AND a.section_id = '.(int)$sectionid
. ' LIMIT 1';
$db->setQuery( $query );
$item = $db->loadObject();
return $item;
}
}
public function emptycart($userid, $vendorid = 0, $ticketid = 0, $unitid =
0, $sectionid = 0) {
if ((int)$userid > 0) {
$db = JFactory::getDBO();
$query = 'DELETE FROM #__phocacart_cart_multiple'
. ' WHERE user_id = '.(int)$userid
. ' AND vendor_id = '.(int)$vendorid
. ' AND ticket_id = '.(int)$ticketid
. ' AND unit_id = '.(int)$unitid
. ' AND section_id = '.(int)$sectionid;
$db->setQuery( $query );
if ($db->execute()) {
return true;
} else {
return false;
}
}
}
}
?>
PK�"�[voD�++models/phocacartcategories.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocaCartCategories extends JModelList
{
protected $option = 'com_phocacart';
protected $total = 0;
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'category_id', 'category_id',
'access', 'a.access', 'access_level',
'count_products', 'a.count_products',
'ordering', 'a.ordering',
'language', 'a.language',
'hits', 'a.hits',
'published','a.published',
'parentcat_title', 'parentcat_title'
);
// ASSOCIATION
$assoc = JLanguageAssociations::isEnabled();
if ($assoc){
$config['filter_fields'][] =
'association';
}
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC')
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
// ASSOCIATION
$forcedLanguage =
$app->input->get('forcedLanguage', '',
'cmd');
// Adjust the context to support modal layouts.
if ($layout = $app->input->get('layout')) {
$this->context .= '.' . $layout;
}
// Adjust the context to support forced languages.
if ($forcedLanguage){
$this->context .= '.' . $forcedLanguage;
}
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
$accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
// Not used in SQL - used in view in recursive category tree function
$levels =
$app->getUserStateFromRequest($this->context.'.filter.level',
'filter_level', '', 'string');
$this->setState('filter.level', $levels);
$categoryId =
$app->getUserStateFromRequest($this->context.'.filter.parent_id',
'filter_parent_id', null);
$this->setState('filter.parent_id', $categoryId);
$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
// ASSOCIATION
if (!empty($forcedLanguage)) {
$this->setState('filter.language',
$forcedLanguage);
}
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.category_id');
$id .=
':'.$this->getState('filter.language');
$id .= ':'.$this->getState('filter.category_id');
return parent::getStoreId($id);
}
/*
* Because of tree we need to load all the items
*
* We need to load all items because of creating tree
* After creating tree we get info from pagination
* and will set displaying of categories for current pagination
* E.g. pagination is limitstart 5, limit 5 - so only categories from 5 to
10 will be displayed (in Default.php)
*/
public function getItems()
{
// Get a storage key.
$store = $this->getStoreId();
// Try to load the data from internal storage.
if (!empty($this->cache[$store])) {
return $this->cache[$store];
}
// Load the list items.
try {
$query = $this->getListQuery();
//$items = $this->_getList($query,
$this->getState('list.start'),
$this->getState('list.limit'));
$items = $this->_getList($query);
} catch (RuntimeException $e) {
throw new Exception($e->getMessage(), 500);
}
// Add the items to the internal cache.
$this->cache[$store] = $items;
return $this->cache[$store];
}
protected function getListQuery()
{
/*
$query = ' SELECT a.*, cc.title AS parentname, u.name AS editor,
v.average AS ratingavg, ua.username AS usercatname, c.countid AS countid,
ag.title AS access_level'
. ' FROM #__phocadownload_categories AS a '
. ' LEFT JOIN #__users AS u ON u.id = a.checked_out '
. ' LEFT JOIN #__viewlevels AS ag ON ag.id = a.access '
. ' LEFT JOIN #__phocadownload_categories AS cc ON cc.id =
a.parent_id'
. ' LEFT JOIN #__phocadownload_votes_statistics AS v ON v.catid =
a.id'
. ' LEFT JOIN #__users AS ua ON ua.id = a.owner_id'
. ' JOIN (SELECT c.parent_id, count(*) AS countid'
. ' FROM #__phocadownload_categories AS c'
.' GROUP BY c.parent_id ) AS c'
.' ON a.parent_id = c.parent_id'
. $where
. $orderby;
*/
// Create a new query object.
$db = $this->getDbo();
$query = $db->getQuery(true);
$columns = 'a.id, a.title, a.parent_id, a.alias, a.ordering,
a.access, a.count, a.checked_out, a.hits, a.params, a.image, a.description,
a.published, a.checked_out_time, a.language, a.count_products,
a.count_date';
//$groupsFull = $columns . ', ' .'l.title, uc.name,
ag.title, c.title, c.id, cc.countid';
//$groupsFast = 'a.id';
//$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
// Select the required fields from the table.
$query->select($this->getState('list.select', $columns));
$query->from('`#__phocacart_categories` AS a');
// Join over the language
$query->select('l.title AS language_title, l.image AS
language_image');
$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id =
a.access');
// Join over the categories.
$query->select('c.title AS parentcat_title, c.id AS
parentcat_id');
$query->join('LEFT', '#__phocacart_categories AS c ON
c.id = a.parent_id');
//$query->select('ua.id AS userid, ua.username AS username,
ua.name AS usernameno');
//$query->join('LEFT', '#__users AS ua ON ua.id =
a.owner_id');
$query->select('cc.countid AS countid');
$query->join('LEFT', '(SELECT cc.parent_id, COUNT(*) AS
countid'
. ' FROM #__phocacart_categories AS cc'
.' GROUP BY cc.parent_id ) AS cc'
.' ON a.parent_id = cc.parent_id');
// ASSOCIATION
// Join over the associations.
$assoc = JLanguageAssociations::isEnabled();
if ($assoc) {
$query->select('COUNT(' .
$db->quoteName('asso2.id') . ') > 1 as ' .
$db->quoteName('association'))
->join(
'LEFT',
$db->quoteName('#__associations',
'asso') . ' ON ' .
$db->quoteName('asso.id') . ' = ' .
$db->quoteName('a.id')
. ' AND ' .
$db->quoteName('asso.context') . ' = ' .
$db->quote('com_phocacart.category')
)
->join(
'LEFT',
$db->quoteName('#__associations',
'asso2') . ' ON ' .
$db->quoteName('asso2.key') . ' = ' .
$db->quoteName('asso.key')
)
->group(
$db->quoteName(
array(
'a.id',
'a.title',
'a.alias',
'a.checked_out',
'a.checked_out_time',
'a.published',
'a.access',
'a.ordering',
'a.language',
'l.title' ,
'l.image' ,
'uc.name' ,
'ag.title'
)
)
);
}
// Filter by access level.
if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by category.
$categoryId = $this->getState('filter.parent_id');
if (is_numeric($categoryId)) {
$query->where('a.parent_id = ' . (int) $categoryId);
}
// Filter on the language.
if ($language = $this->getState('filter.language')) {
$query->where('a.language = ' . $db->quote($language));
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
//- $query->group($groups);
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
/*if ($orderCol == 'a.ordering' || $orderCol ==
'parentcat_title') {
$orderCol = 'parentcat_title '.$orderDirn.',
a.ordering';
}*/
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
public function getTotal() {
$store = $this->getStoreId('getTotal');
if (isset($this->cache[$store])) {
return $this->cache[$store];
}
// PHOCAEDIT
if (isset($this->total) && (int)$this->total > 0) {
$total = (int)$this->total;
} else {
$query = $this->_getListQuery();
try {
$total = (int) $this->_getListCount($query);
}
catch (RuntimeException $e) {
$this->setError($e->getMessage());
return false;
}
}
$this->cache[$store] = $total;
return $this->cache[$store];
}
public function setTotal($total) {
// When we use new total and new pagination, we need to clean their cache
$store1 = $this->getStoreId('getTotal');
$store2 = $this->getStoreId('getStart');
$store3 = $this->getStoreId('getPagination');
unset($this->cache[$store1]);
unset($this->cache[$store2]);
unset($this->cache[$store3]);
$this->total = (int)$total;
}
}
?>
PK�"�[�{�ycycmodels/phocacartcategory.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
use Joomla\String\StringHelper;
class PhocaCartCpModelPhocacartCategory extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
public $typeAlias =
'com_phocacart.phocacartcategory';
protected $associationsContext =
'com_phocacart.category'; // ASSOCIATION
protected function canDelete($record) {
$user = JFactory::getUser();
if (!empty($record->catid)) {
return $user->authorise('core.delete',
'com_phocacart.phocadownloadcategory.'.(int) $record->catid);
} else {
return parent::canDelete($record);
}
}
protected function canEditState($record){
$user = JFactory::getUser();
if (!empty($record->catid)) {
return $user->authorise('core.edit.state',
'com_phocacart.phocadownloadcategory.'.(int) $record->catid);
} else {
return parent::canEditState($record);
}
}
public function getTable($type = 'PhocacartCategory', $prefix =
'Table', $config = array()){
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartcategory',
'phocacartcategory', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
// Check the session for previously entered form data.
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartcategory.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
public function getItem($pk = null) {
if ($item = parent::getItem($pk)) {
// Convert the params field to an array.
if (isset($item->metadata)) {
$registry = new JRegistry;
$registry->loadString($item->metadata);
$item->metadata = $registry->toArray();
}
// ASSOCIATION
// Load associated Phoca Cart items
$assoc = JLanguageAssociations::isEnabled();
if ($assoc) {
$item->associations = array();
if ($item->id != null){
$associations =
JLanguageAssociations::getAssociations('com_phocacart',
'#__phocacart_categories', 'com_phocacart.category',
$item->id, 'id', 'alias', false);
foreach ($associations as $tag => $association){
$item->associations[$tag] = $association->id;
}
}
}
}
return $item;
}
protected function prepareTable($table){
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
$table->parent_id =
PhocacartUtils::getIntFromString($table->parent_id);
$table->date = PhocacartUtils::getDateFromString($table->date);
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_categories');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
protected function getReorderConditions($table = null)
{
$condition = array();
$condition[] = 'parent_id = '. (int) $table->parent_id;
//$condition[] = 'state >= 0';
return $condition;
}
public function save($data) {
$app = JFactory::getApplication();
$input = JFactory::getApplication()->input;
//$dispatcher = JDispatcher::getInstance();
$table = $this->getTable();
// Test thumbnail of category image
if(isset($data['image']) && $data['image'] !=
'') {
$thumb =
PhocacartFileThumbnail::getOrCreateThumbnail($data['image'],
'', 1, 1, 1, 0, 'categoryimage');
}
$user = JFactory::getUser();
// ALIAS
if (in_array($input->get('task'), array('apply',
'save', 'save2new')) &&
(!isset($data['id']) || (int) $data['id'] == 0)) {
if ($data['alias'] == null) {
if (JFactory::getConfig()->get('unicodeslugs') == 1) {
$data['alias'] =
JFilterOutput::stringURLUnicodeSlug($data['title']);
} else {
$data['alias'] =
JFilterOutput::stringURLSafe($data['title']);
}
if ($table->load(array('alias' =>
$data['alias']))){
$msg = JText::_('COM_PHOCACART_SAVE_WARNING');
}
list($title, $alias) = $this->generateNewTitle(0,
$data['alias'], $data['title']);
$data['alias'] = $alias;
if (isset($msg)) {
JFactory::getApplication()->enqueueMessage($msg,
'warning');
}
}
} else if ($table->load(array('alias' =>
$data['alias'])) && ($table->id !=
$data['id'] || $data['id'] == 0)) {
$this->setError(\JText::_('COM_PHOCACART_ERROR_ITEM_UNIQUE_ALIAS'));
return false;
}
// Trigger the before event.
JPluginHelper::importPlugin('pca');
// - START SAVE
// ----------
//$save = parent::save($data);
$key = $table->getKeyName();
$pk = (!empty($data[$key])) ? $data[$key] : (int)
$this->getState($this->getName() . '.id');
$isNew = true;
// Include the plugins for the save events.
\JPluginHelper::importPlugin($this->events_map['save']);
try {
// Load the row if saving an existing record.
if ($pk > 0) {
$table->load($pk);
$isNew = false;
}
// Bind the data.
if (!$table->bind($data)) {
$this->setError($table->getError());
return false;
}
if(intval($table->date) == 0) {
$table->date = JFactory::getDate()->toSql();
}
if ($isNew) {
$table->created = JFactory::getDate()->toSql();
$table->created_by = isset($user->id) ? (int)$user->id: 0;
} else {
$table->modified = JFactory::getDate()->toSql();
$table->modified_by = isset($user->id) ? (int)$user->id: 0;
}
// Prepare the row for saving
$this->prepareTable($table);
// Check the data.
if (!$table->check()) {
$this->setError($table->getError());
return false;
}
// Trigger the before save event.
$result =
\JFactory::getApplication()->triggerEvent('PCAonCategoryBeforeSave',
array('com_phocacart.category', &$table, $isNew, $data));
if (in_array(false, $result, true)) {
$this->setError($table->getError());
return false;
}
if (!$table->store()) {
$this->setError($table->getError());
return false;
}
$this->cleanCache();
// Trigger the after save event.
\JFactory::getApplication()->triggerEvent('PCAonCategoryAfterSave',
array('com_phocacart.category', &$table, $isNew, $data));
} catch (\Exception $e) {
$this->setError($e->getMessage());
return false;
}
if (isset($table->$key)) {
$this->setState($this->getName() . '.id',
$table->$key);
}
$this->setState($this->getName() . '.new', $isNew);
// - END SAVE
// ----------
if (!isset($data['group'])) {
$data['group'] = array();
}
$savedId = $this->getState($this->getName().'.id');
if ((int)$savedId > 0) {
PhocacartGroup::storeGroupsById((int)$savedId, 2,
$data['group']);
PhocacartCount::setProductCount(array(0 => (int)$savedId),
'category', 1);
}
$pkName = $table->getKeyName();
// ASSOCIATION
if ((int)$savedId > 0 && $this->associationsContext
&& \JLanguageAssociations::isEnabled() &&
!empty($data['associations'])) {
$associations = $data['associations'];
// Unset any invalid associations
$associations =
Joomla\Utilities\ArrayHelper::toInteger($associations);
// Unset any invalid associations
foreach ($associations as $tag => $id) {
if (!$id){
unset($associations[$tag]);
}
}
// Show a warning if the item isn't assigned to a language
but we have associations.
if ($associations && $table->language ===
'*') {
\JFactory::getApplication()->enqueueMessage(
\JText::_(strtoupper($this->option) .
'_ERROR_ALL_LANGUAGE_ASSOCIATED'),
'warning'
);
}
// Get associationskey for edited item
$db = $this->getDbo();
$query = $db->getQuery(true)
->select($db->qn('key'))
->from($db->qn('#__associations'))
->where($db->qn('context') . ' =
' . $db->quote($this->associationsContext))
->where($db->qn('id') . ' = ' .
(int) $table->$pkName);
$db->setQuery($query);
$old_key = $db->loadResult();
// Deleting old associations for the associated items
$query = $db->getQuery(true)
->delete($db->qn('#__associations'))
->where($db->qn('context') . ' =
' . $db->quote($this->associationsContext));
if ($associations) {
$query->where('(' . $db->qn('id')
. ' IN (' . implode(',', $associations) . ') OR
'
. $db->qn('key') . ' = ' .
$db->q($old_key) . ')');
} else {
$query->where($db->qn('key') . ' =
' . $db->q($old_key));
}
$db->setQuery($query);
$db->execute();
// Adding self to the association
if ($table->language !== '*') {
$associations[$table->language] = (int)
$table->$pkName;
}
if (count($associations) > 1) {
// Adding new association for these items
$key = md5(json_encode($associations));
$query = $db->getQuery(true)
->insert('#__associations');
foreach ($associations as $id) {
$query->values(((int) $id) . ',' .
$db->quote($this->associationsContext) . ',' .
$db->quote($key));
}
$db->setQuery($query);
$db->execute();
}
}
if ($app->input->get('task') ==
'editAssociations')
{
return $this->redirectToAssociations($data);
}
return true;
}
public function delete(&$cid = array()) {
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$result = false;
if (count( $cid )) {
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$cids = implode( ',', $cid );
$table = $this->getTable();
if (!$this->canDelete($table)){
$error = $this->getError();
if ($error){
JLog::add($error, JLog::WARNING);
return false;
} else {
JLog::add(JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'),
JLog::WARNING);
return false;
}
}
// FIRST - if there are subcategories - - - - -
$query = 'SELECT c.id, c.title, COUNT( s.parent_id ) AS
numcat'
. ' FROM #__phocacart_categories AS c'
. ' LEFT JOIN #__phocacart_categories AS s ON s.parent_id =
c.id'
. ' WHERE c.id IN ( '.$cids.' )'
. ' GROUP BY c.id, c.title, s.parent_id'
;
$db->setQuery( $query );
if (!($rows2 = $db->loadObjectList())) {
throw new Exception(
JText::_('COM_PHOCACART_ERROR_PROBLEM_LOADING_DATA'), 500 );
return false;
}
// Add new CID without categories which have subcategories (we
don't delete categories with subcat)
$err_cat = array();
$cid = array();
foreach ($rows2 as $row) {
if ($row->numcat == 0) {
$cid[] = (int) $row->id;
} else {
$err_cat[] = $row->title;
}
}
// - - - - - - - - - - - - - - -
// Product with new cid - - - - -
if (count( $cid )) {
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$cids = implode( ',', $cid );
// Select id's from product table, if there are some items,
don't delete it.
$query = 'SELECT c.id, c.title, COUNT( s.category_id ) AS
numproduct'
. ' FROM #__phocacart_categories AS c'
. ' LEFT JOIN #__phocacart_product_categories AS s ON
s.category_id = c.id'
. ' WHERE c.id IN ( '.$cids.' )'
. ' GROUP BY c.id, c.title, s.category_id';
$db->setQuery( $query );
if (!($rows = $db->loadObjectList())) {
throw new Exception(
JText::_('COM_PHOCACART_ERROR_PROBLEM_LOADING_DATA'), 500 );
return false;
}
$err_img = array();
$cid = array();
foreach ($rows as $row) {
if ($row->numproduct == 0) {
$cid[] = (int) $row->id;
} else {
$err_img[] = $row->title;
}
}
if (count( $cid )) {
$cids = implode( ',', $cid );
$query = 'DELETE FROM #__phocacart_categories'
. ' WHERE id IN ( '.$cids.' )';
$db->setQuery( $query );
if (!$db->execute()) {
$this->setError($db->getErrorMsg());
return false;
}
// 7. DELETE CATEGORY RELATIONSHIP (should not happen as this should
be deleted when products are deleted)
$query = 'DELETE FROM #__phocacart_product_categories'
. ' WHERE category_id IN ( '.$cids.' )';
$db->setQuery( $query );
$db->execute();
// Delete items in phocadownload_user_category
/* $query = 'DELETE FROM #__phocadownload_user_category'
. ' WHERE catid IN ( '.$cids.' )';
$db->setQuery( $query );
if (!$db->query()) {
$this->setError($this->_db->getErrorMsg());
return false;
}*/
// 9. DELETE PRODUCT CUSTOMER GROUPS
$query = 'DELETE FROM #__phocacart_item_groups'
. ' WHERE item_id IN ( '.$cids.' )'
. ' AND type = 2';
$db->setQuery( $query );
$db->execute();
}
}
// There are some images in the category - don't delete it
$msg = '';
if (count( $err_cat ) || count( $err_img )) {
if (count( $err_cat )) {
$cids_cat = implode( ", ", $err_cat );
$msg .= JText::plural(
'COM_PHOCACART_ERROR_DELETE_CONTAIN_CATEGORY', $cids_cat );
}
if (count( $err_img )) {
$cids_img = implode( ", ", $err_img );
$msg .= JText::plural(
'COM_PHOCACART_ERROR_DELETE_CONTAIN_PRODUCT', $cids_img );
}
$link =
'index.php?option=com_phocacart&view=phocacartcategories';
$app->enqueueMessage($msg, 'error');
$app->redirect($link);
}
}
return true;
}
protected function batchCopy($value, $pks, $contexts)
{
$categoryId = (int) $value;
$table = $this->getTable();
$db = $this->getDbo();
// Check that the category exists
if ($categoryId) {
$categoryTable = JTable::getInstance('PhocacartCategory',
'Table');
if (!$categoryTable->load($categoryId)) {
if ($error = $categoryTable->getError()) {
// Fatal error
$this->setError($error);
return false;
}
else {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_MOVE_CATEGORY_NOT_FOUND'));
return false;
}
}
}
//if (empty($categoryId)) {
if (!isset($categoryId)) {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_MOVE_CATEGORY_NOT_FOUND'));
return false;
}
// Check that the user has create permission for the component
$extension =
JFactory::getApplication()->input->get('option');
$user = JFactory::getUser();
if (!$user->authorise('core.create', $extension)) {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_CREATE'));
return false;
}
//$i = 0;
// Parent exists so we let's proceed
while (!empty($pks))
{
// Pop the first ID off the stack
$pk = array_shift($pks);
$table->reset();
// Check that the row actually exists
if (!$table->load($pk)) {
if ($error = $table->getError()) {
// Fatal error
$this->setError($error);
return false;
}
else {
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
continue;
}
}
// Alter the title & alias
$data = $this->generateNewTitle($categoryId, $table->alias,
$table->title);
$table->title = $data['0'];
$table->alias = $data['1'];
$table->published = 0;// As default the copied new category is
unpublished
// Reset the ID because we are making a copy
$table->id = 0;
// New category ID
$table->parent_id = $categoryId;
// Ordering
$table->ordering = $this->increaseOrdering($categoryId);
$table->hits = 0;
// Check the row.
if (!$table->check()) {
$this->setError($table->getError());
return false;
}
// Store the row.
if (!$table->store()) {
$this->setError($table->getError());
return false;
}
// Get the new item ID
$newId = $table->get('id');
// Add the new ID to the array
$newIds[$pk] = $newId;
// Store other new information
PhocacartUtilsBatchhelper::storeCategoryItems($pk, (int)$newId);
//$i++;
}
// Clean the cache
$this->cleanCache();
return $newIds;
}
protected function batchMove($value, $pks, $contexts)
{
$categoryId = (int) $value;
$table = $this->getTable();
//$db = $this->getDbo();
$app = JFactory::getApplication();
// Check that the category exists
if ($categoryId) {
$categoryTable = JTable::getInstance('PhocacartCategory',
'Table');
if (!$categoryTable->load($categoryId)) {
if ($error = $categoryTable->getError()) {
// Fatal error
$this->setError($error);
return false;
}
else {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_MOVE_CATEGORY_NOT_FOUND'));
return false;
}
}
}
//if (empty($categoryId)) {
if (!isset($categoryId)) {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_MOVE_CATEGORY_NOT_FOUND'));
return false;
}
// Check that user has create and edit permission for the component
$extension =
JFactory::getApplication()->input->get('option');
$user = JFactory::getUser();
if (!$user->authorise('core.create', $extension)) {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_CREATE'));
return false;
}
if (!$user->authorise('core.edit', $extension)) {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
// Parent exists so we let's proceed
foreach ($pks as $pk)
{
// Check that the row actually exists
if (!$table->load($pk)) {
if ($error = $table->getError()) {
// Fatal error
$this->setError($error);
return false;
}
else {
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
continue;
}
}
// Set the new category ID
$table->parent_id = $categoryId;
// Cannot move the node to be a child of itself.
if ((int)$table->id == (int)$categoryId) {
$app->enqueueMessage(JText::sprintf('JLIB_DATABASE_ERROR_INVALID_NODE_RECURSION',
get_class($pk)));
return false;
}
// Check the row.
if (!$table->check()) {
$this->setError($table->getError());
return false;
}
// Store the row.
if (!$table->store()) {
$this->setError($table->getError());
return false;
}
}
// Clean the cache
$this->cleanCache();
return true;
}
public function increaseOrdering($categoryId) {
$ordering = 1;
$this->_db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_categories WHERE parent_id='.(int)$categoryId);
$max = $this->_db->loadResult();
$ordering = $max + 1;
return $ordering;
}
public function batch($commands, $pks, $contexts)
{
// Sanitize user ids.
$pks = array_unique($pks);
\Joomla\Utilities\ArrayHelper::toInteger($pks);
// Remove any values of zero.
if (array_search(0, $pks, true)) {
unset($pks[array_search(0, $pks, true)]);
}
if (empty($pks)) {
$this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
return false;
}
$done = false;
if (!empty($commands['assetgroup_id'])) {
if (!$this->batchAccess($commands['assetgroup_id'], $pks))
{
return false;
}
$done = true;
}
//PHOCAEDIT - Parent is by Phoca 0 not 1 like by Joomla!
$comCat =false;
if ($commands['category_id'] == '') {
$comCat = false;
} else if ( $commands['category_id'] == '0') {
$comCat = true;
} else if ((int)$commands['category_id'] > 0) {
$comCat = true;
}
if ($comCat)
//if (isset($commands['category_id']))
{
$cmd = \Joomla\Utilities\ArrayHelper::getValue($commands,
'move_copy', 'c');
if ($cmd == 'c')
{
$result = $this->batchCopy($commands['category_id'], $pks,
$contexts);
if (is_array($result))
{
$pks = $result;
}
else
{
return false;
}
}
elseif ($cmd == 'm' &&
!$this->batchMove($commands['category_id'], $pks, $contexts))
{
return false;
}
$done = true;
}
if (!empty($commands['language_id']))
{
if (!$this->batchLanguage($commands['language_id'], $pks,
$contexts))
{
return false;
}
$done = true;
}
if (!$done) {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
return false;
}
// Clear the cache
$this->cleanCache();
return true;
}
protected function generateNewTitle($category_id, $alias, $title)
{
// Alter the title & alias
$table = $this->getTable();
while ($table->load(array('alias' => $alias,
'parent_id' => $category_id)))
{
$title = StringHelper::increment($title);
$alias = StringHelper::increment($alias, 'dash');
}
return array($title, $alias);
}
function recreate($cid = array(), &$message = '') {
if (count( $cid )) {
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$cids = implode( ',', $cid );
$query = 'SELECT a.image, a.title'.
' FROM #__phocacart_categories AS a' .
' WHERE a.id IN ( '.$cids.' )';
$this->_db->setQuery($query);
$files = $this->_db->loadObjectList();
if (isset($files) && count($files)) {
$msg = array();
foreach($files as $k => $v) {
$title = isset($v->title) ? $v->title : '';
$title = JText::_('COM_PHOCACART_CATEGORY') . ' '
. $v->title . ': ';
if (isset($v->image) && $v->image != '') {
$original = PhocacartFile::existsFileOriginal($v->image,
'categoryimage');
if (!$original) {
// Original does not exist - cannot generate new thumbnail
$msg[$k] = $title .
JText::_('COM_PHOCACART_FILEORIGINAL_NOT_EXISTS');
//return false;
continue;
}
// Delete old thumbnails
$deleteThubms =
PhocacartFileThumbnail::deleteFileThumbnail($v->image, 1, 1, 1,
'categoryimage');
if (!$deleteThubms) {
$msg[$k] = $title.
JText::_('COM_PHOCACART_ERROR_DELETE_THUMBNAIL');
//return false;
continue;
}
$createThubms =
PhocacartFileThumbnail::getOrCreateThumbnail($v->image, 0,
1,1,1,0,'categoryimage');
if (!$createThubms) {
$msg[$k] = $title .
JText::_('COM_PHOCACART_ERROR_WHILECREATINGTHUMB');
//return false;
continue;
}
} else {
//$msg[$k] = $title .
JText::_('COM_PHOCACART_FILENAME_NOT_EXISTS');
$msg[$k] = $title .
JText::_('COM_PHOCACART_CATEGORY_IMAGE_NOT_EXISTS');
//return false;
continue;
}
}
$message = !empty($msg) ? implode('<br />', $msg) :
'';
} else {
$message = JText::_('COM_PHOCACART_ERROR_LOADING_DATA_DB');
return false;
}
} else {
$message = JText::_('COM_PHOCACART_ERROR_ITEM_NOT_SELECTED');
return false;
}
return true;
}
// ASSOCIATION
protected function preprocessForm(JForm $form, $data, $group =
'content'){
/*if ($this->canCreateCategory())
{
$form->setFieldAttribute('catid',
'allowAdd', 'true');
}*/
// Association Phoca Cart items
if (JLanguageAssociations::isEnabled()){
$languages = JLanguageHelper::getContentLanguages(false, true,
null, 'ordering', 'asc');
if (count($languages) > 1){
$addform = new SimpleXMLElement('<form
/>');
$fields = $addform->addChild('fields');
$fields->addAttribute('name',
'associations');
$fieldset = $fields->addChild('fieldset');
$fieldset->addAttribute('name',
'item_associations');
foreach ($languages as $language)
{
$field = $fieldset->addChild('field');
$field->addAttribute('name',
$language->lang_code);
$field->addAttribute('type',
'Modal_Phocacartcategory');
$field->addAttribute('language',
$language->lang_code);
$field->addAttribute('label',
$language->title);
$field->addAttribute('translate_label',
'false');
$field->addAttribute('select',
'true');
$field->addAttribute('new',
'true');
$field->addAttribute('edit',
'true');
$field->addAttribute('clear',
'true');
$field->addAttribute('propagate',
'true');
}
$form->load($addform, false);
}
}
parent::preprocessForm($form, $data, $group);
}
}
?>
PK�"�[ʷ���models/phocacartcountries.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocaCartCountries extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'code2', 'a.code2',
'code3', 'a.code3',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.country_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
$columns = 'a.id, a.image, uc.name, a.checked_out, a.title,
a.published, a.code2, a.code3, a.ordering';
$groupsFull = $columns;
$groupsFast = 'a.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
// Select the required fields from the table.
$query->select($this->getState('list.select', $columns));
$query->from('`#__phocacart_countries` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
$query->select('GROUP_CONCAT(tc.tax_rate) AS tc_tax_rate');
$query->join('LEFT', '#__phocacart_tax_countries AS tc
ON a.id = tc.country_id');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$query->group($groups);
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[��ڢ�models/phocacartcountry.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartCountry extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record)
{
//$user = JFactory::getUser();
return parent::canDelete($record);
}
protected function canEditState($record)
{
//$user = JFactory::getUser();
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartCountry', $prefix =
'Table', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartcountry',
'phocacartcountry', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData()
{
// Check the session for previously entered form data.
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartcountry.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table)
{
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_countries');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
public function importcountries() {
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$db->setQuery('SELECT COUNT(id) FROM
#__phocacart_countries');
$sum = $db->loadResult();
/*if ((int)$sum > 240) {
$message =
JText::_('COM_PHOCACART_COUNTRIES_ALREADY_IMPORTED');
$app->enqueueMessage($message, 'error');
return false;
}*/
if ((int)$sum > 0) {
$message =
JText::_('COM_PHOCACART_COUNTRIES_CAN_BE_IMPORTED_ONLY_WHEN_COUNTRY_TABLE_IS_EMPTY');
$app->enqueueMessage($message, 'error');
return false;
}
$file = JPATH_ADMINISTRATOR .
'/components/com_phocacart/install/sql/mysql/countries.utf8.sql';
if(JFile::exists($file)) {
$buffer = file_get_contents($file);
$queries = JDatabaseDriver::splitSql($buffer);
if (count($queries) == 0) {
return false;
}
foreach ($queries as $query){
$query = trim($query);
if ($query != '' && $query[0] != '#'){
$db->setQuery($query);
if (!$db->execute()){
$app->enqueueMessage(JText::_('JLIB_INSTALLER_ERROR_SQL_ERROR'),
'error');
JLog::add(JText::_('JLIB_INSTALLER_ERROR_SQL_ERROR'),
JLog::WARNING);
return false;
}
}
}
return true;
} else {
$app->enqueueMessage(JText::_('COM_PHOCACART_IMPORT_FILE_NOT_EXIST'),
'error');
return false;
}
}
public function delete(&$cid = array()) {
$paramsC = PhocacartUtils::getComponentParameters();
$delete_regions = $paramsC->get( 'delete_regions', 0 );
if (count( $cid )) {
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$cids = implode( ',', $cid );
$table = $this->getTable();
if (!$this->canDelete($table)){
$error = $this->getError();
if ($error){
JLog::add($error, JLog::WARNING);
return false;
} else {
JLog::add(JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'),
JLog::WARNING);
return false;
}
}
// 1. DELETE COUNTRIES
$query = 'DELETE FROM #__phocacart_countries'
. ' WHERE id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 2. DELETE COUNTRY TAXES
$query = 'DELETE FROM #__phocacart_tax_countries'
. ' WHERE country_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 3. DELETE REGIONS
if ($delete_regions == 1) {
$query = 'DELETE FROM #__phocacart_regions'
. ' WHERE country_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
}
// 4. DELETE COUNTRIES IN SHIPPING METHOD
$query = 'DELETE FROM #__phocacart_shipping_method_countries'
. ' WHERE country_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 5. DELETE COUNTRIES IN PAYMENT METHOD
$query = 'DELETE FROM #__phocacart_payment_method_countries'
. ' WHERE country_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
}
return true;
}
}
?>
PK�"�[D�J���models/phocacartcoupon.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartCoupon extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record) {
return parent::canDelete($record);
}
protected function canEditState($record) {
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartCoupon', $prefix =
'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartcoupon',
'phocacartcoupon', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartcoupon.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
public function getItem($pk = null) {
if ($item = parent::getItem($pk)) {
$item->discount = PhocacartPrice::cleanPrice($item->discount);
$item->total_amount =
PhocacartPrice::cleanPrice($item->total_amount);
}
return $item;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
$table->total_amount =
PhocacartUtils::replaceCommaWithPoint($table->total_amount);
$table->discount =
PhocacartUtils::replaceCommaWithPoint($table->discount);
$table->quantity_from =
PhocacartUtils::getIntFromString($table->quantity_from);
$table->available_quantity =
PhocacartUtils::getIntFromString($table->available_quantity);
$table->available_quantity_user =
PhocacartUtils::getIntFromString($table->available_quantity_user);
$table->valid_from =
PhocacartUtils::getDateFromString($table->valid_from);
$table->valid_to =
PhocacartUtils::getDateFromString($table->valid_to);
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_coupons');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
public function save($data)
{
//$dispatcher = J EventDispatcher::getInstance();
$table = $this->getTable();
if ((!empty($data['tags']) &&
$data['tags'][0] != ''))
{
$table->newTags = $data['tags'];
}
$key = $table->getKeyName();
$pk = (!empty($data[$key])) ? $data[$key] : (int)
$this->getState($this->getName() . '.id');
$isNew = true;
// Include the content plugins for the on save events.
JPluginHelper::importPlugin('content');
// Allow an exception to be thrown.
try
{
// Load the row if saving an existing record.
if ($pk > 0)
{
$table->load($pk);
$isNew = false;
}
// Bind the data.
if (!$table->bind($data))
{
$this->setError($table->getError());
return false;
}
// Prepare the row for saving
$this->prepareTable($table);
// Check the data.
if (!$table->check())
{
$this->setError($table->getError());
return false;
}
// Trigger the onContentBeforeSave event.
$result =
\JFactory::getApplication()->triggerEvent($this->event_before_save,
array($this->option . '.' . $this->name, $table, $isNew,
$data));
if (in_array(false, $result, true))
{
$this->setError($table->getError());
return false;
}
// Store the data.
if (!$table->store())
{
$this->setError($table->getError());
return false;
}
if ((int)$table->id > 0) {
if (!isset($data['product_ids'])) {
$data['product_ids'] = '';
}
PhocacartCoupon::storeCouponProductsById($data['product_ids'],
(int)$table->id );
if (!isset($data['cat_ids'])) {
$data['cat_ids'] = array();
}
PhocacartCoupon::storeCouponCatsById($data['cat_ids'],
(int)$table->id);
if (empty($data['group'])) {
$data['group'] = array();
}
PhocacartGroup::storeGroupsById((int)$table->id, 6,
$data['group']);
}
// Clean the cache.
$this->cleanCache();
// Trigger the onContentAfterSave event.
\JFactory::getApplication()->triggerEvent($this->event_after_save,
array($this->option . '.' . $this->name, $table, $isNew));
}
catch (Exception $e)
{
$this->setError($e->getMessage());
return false;
}
$pkName = $table->getKeyName();
if (isset($table->$pkName))
{
$this->setState($this->getName() . '.id',
$table->$pkName);
}
$this->setState($this->getName() . '.new', $isNew);
return true;
}
public function delete(&$cid = array()) {
if (count( $cid )) {
$delete = parent::delete($cid);
if ($delete) {
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$cids = implode( ',', $cid );
$query = 'DELETE FROM #__phocacart_item_groups'
. ' WHERE item_id IN ( '.$cids.' )'
. ' AND type = 6';
$this->_db->setQuery( $query );
$this->_db->execute();
}
}
}
}
?>
PK�"�[Bevlnnmodels/phocacartcoupons.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartCoupons extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'code', 'a.code',
'discount', 'a.discount',
'valid_from', 'a.valid_from',
'valid_to', 'a.valid_to',
'coupon_type', 'a.coupon_type',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.status_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_coupons` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[;�+vvmodels/phocacartcurrencies.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocaCartCurrencies extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'code', 'a.code',
'price_currency_symbol', 'a.price_currency_symbol',
'exchange_rate', 'a.exchange_rate',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC')
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.currency_id');
return parent::getStoreId($id);
}
protected function getListQuery()
{
// Create a new query object.
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_currencies` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[k�� � models/phocacartcurrency.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartCurrency extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record)
{
//$user = JFactory::getUser();
return parent::canDelete($record);
}
protected function canEditState($record)
{
//$user = JFactory::getUser();
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartCurrency', $prefix =
'Table', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartcurrency',
'phocacartcurrency', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData()
{
// Check the session for previously entered form data.
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartcurrency.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table)
{
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
$table->exchange_rate =
PhocacartUtils::replaceCommaWithPoint($table->exchange_rate);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_currencies');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
}
?>PK�"�[#��models/phocacartdiscount.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartDiscount extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record) {
return parent::canDelete($record);
}
protected function canEditState($record) {
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartDiscount', $prefix =
'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartdiscount',
'phocacartdiscount', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartdiscount.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
public function getItem($pk = null) {
if ($item = parent::getItem($pk)) {
$item->discount = PhocacartPrice::cleanPrice($item->discount);
}
return $item;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
$table->valid_from =
PhocacartUtils::getDateFromString($table->valid_from);
$table->valid_to =
PhocacartUtils::getDateFromString($table->valid_to);
$table->quantity_from =
PhocacartUtils::getIntFromString($table->quantity_from);
$table->total_amount =
PhocacartUtils::replaceCommaWithPoint($table->total_amount);
$table->discount =
PhocacartUtils::replaceCommaWithPoint($table->discount);
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_discounts');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
public function save($data)
{
//$dispatcher = J EventDispatcher::getInstance();
$table = $this->getTable();
if ((!empty($data['tags']) &&
$data['tags'][0] != ''))
{
$table->newTags = $data['tags'];
}
if (empty($data['group'])) {
$data['group'] = array();
}
$key = $table->getKeyName();
$pk = (!empty($data[$key])) ? $data[$key] : (int)
$this->getState($this->getName() . '.id');
$isNew = true;
// Include the content plugins for the on save events.
JPluginHelper::importPlugin('content');
// Allow an exception to be thrown.
try
{
// Load the row if saving an existing record.
if ($pk > 0)
{
$table->load($pk);
$isNew = false;
}
// Bind the data.
if (!$table->bind($data))
{
$this->setError($table->getError());
return false;
}
// Prepare the row for saving
$this->prepareTable($table);
// Check the data.
if (!$table->check())
{
$this->setError($table->getError());
return false;
}
// Trigger the onContentBeforeSave event.
$result =
\JFactory::getApplication()->triggerEvent($this->event_before_save,
array($this->option . '.' . $this->name, $table, $isNew,
$data));
if (in_array(false, $result, true))
{
$this->setError($table->getError());
return false;
}
// Store the data.
if (!$table->store())
{
$this->setError($table->getError());
return false;
}
if ((int)$table->id > 0) {
if (!isset($data['product_ids'])) {
$data['product_ids'] = '';
}
PhocacartDiscountCart::storeDiscountProductsById($data['product_ids'],
(int)$table->id );
if (!isset($data['cat_ids'])) {
$data['cat_ids'] = array();
}
PhocacartDiscountCart::storeDiscountCatsById($data['cat_ids'],
(int)$table->id);
}
// Clean the cache.
$this->cleanCache();
// Trigger the onContentAfterSave event.
\JFactory::getApplication()->triggerEvent($this->event_after_save,
array($this->option . '.' . $this->name, $table, $isNew));
}
catch (Exception $e)
{
$this->setError($e->getMessage());
return false;
}
$pkName = $table->getKeyName();
if (isset($table->$pkName))
{
$this->setState($this->getName() . '.id',
$table->$pkName);
}
$this->setState($this->getName() . '.new', $isNew);
if ((int)$table->id > 0) {
PhocacartGroup::storeGroupsById((int)$table->id, 5,
$data['group']);
}
return true;
}
public function delete(&$cid = array()) {
if (count( $cid )) {
$delete = parent::delete($cid);
if ($delete) {
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$cids = implode( ',', $cid );
$query = 'DELETE FROM #__phocacart_item_groups'
. ' WHERE item_id IN ( '.$cids.' )'
. ' AND type = 5';
$this->_db->setQuery( $query );
$this->_db->execute();
}
}
}
}
?>
PK�"�[C���::models/phocacartdiscounts.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartDiscounts extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'discount', 'a.discount',
'valid_from', 'a.valid_from',
'valid_to', 'a.valid_to',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.discount_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_discounts` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[���sKKmodels/phocacartdownload.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartDownload extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record) {
return parent::canDelete($record);
}
protected function canEditState($record) {
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartOrderDownloads',
$prefix = 'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartdownload',
'phocacartdownload', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartdownload.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_order_downloads');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
/*
public function save($data)
{
//$dispatcher = J EventDispatcher::getInstance();
$table = $this->getTable();
if ((!empty($data['tags']) &&
$data['tags'][0] != ''))
{
$table->newTags = $data['tags'];
}
$key = $table->getKeyName();
$pk = (!empty($data[$key])) ? $data[$key] : (int)
$this->getState($this->getName() . '.id');
$isNew = true;
// Include the content plugins for the on save events.
JPluginHelper::importPlugin('content');
// Allow an exception to be thrown.
try
{
// Load the row if saving an existing record.
if ($pk > 0)
{
$table->load($pk);
$isNew = false;
}
// Store form parameters of selected method
$app = JFactory::getApplication();
$dataPh = $app->input->get('phform', array(),
'array');
$registry = new JRegistry($dataPh);
$dataPhNew = $registry->toString();
if($dataPhNew != '') {
$data['params'] = $dataPhNew;
}
// Bind the data.
if (!$table->bind($data))
{
$this->setError($table->getError());
return false;
}
// Prepare the row for saving
$this->prepareTable($table);
// Check the data.
if (!$table->check())
{
$this->setError($table->getError());
return false;
}
// Trigger the onContentBeforeSave event.
$result =
\JFactory::getApplication()->triggerEvent($this->event_before_save,
array($this->option . '.' . $this->name, $table, $isNew,
$data));
if (in_array(false, $result, true))
{
$this->setError($table->getError());
return false;
}
// Store the data.
if (!$table->store())
{
$this->setError($table->getError());
return false;
}
// Clean the cache.
$this->cleanCache();
// Trigger the onContentAfterSave event.
\JFactory::getApplication()->triggerEvent($this->event_after_save,
array($this->option . '.' . $this->name, $table, $isNew));
}
catch (Exception $e)
{
$this->setError($e->getMessage());
return false;
}
$pkName = $table->getKeyName();
if (isset($table->$pkName))
{
$this->setState($this->getName() . '.id',
$table->$pkName);
}
$this->setState($this->getName() . '.new', $isNew);
return true;
}*/
}
?>
PK�"�[�Y.[��models/phocacartdownloads.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartDownloads extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'state', 'a.state',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'download_hits', 'a.download_hits',
'download_file', 'a.download_file',
'published','a.published',
'order_id', 'a.order_id',
'date', 'a.date',
'u.name'
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.download_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_order_downloads` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
$query->select('o.id AS orderid, o.date AS order_date,
o.order_number AS order_number');
$query->join('LEFT', '#__phocacart_orders AS o ON
o.id=a.order_id');
$query->select('u.name AS user_name, u.username AS
user_username');
$query->join('LEFT', '#__users AS u ON
u.id=o.user_id');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[�`���!models/phocacarteditbulkprice.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.modellist' );
class PhocaCartCpModelPhocaCartEditBulkprice extends JModelList
{
protected $option = 'com_phocacart';
}
?>
PK�"�[U~�b��)models/phocacarteditproductpointgroup.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.modellist' );
class PhocaCartCpModelPhocaCartEditProductPointGroup extends JModelList
{
protected $option = 'com_phocacart';
public function save($data, $productId) {
if (!empty($data)) {
return PhocacartGroup::storeProductPointGroupsById($data, $productId);
}
}
}
?>PK�"�[L�/��)models/phocacarteditproductpricegroup.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.modellist' );
class PhocaCartCpModelPhocaCartEditProductPriceGroup extends JModelList
{
protected $option = 'com_phocacart';
public function save($data, $productId) {
if (!empty($data)) {
return PhocacartGroup::storeProductPriceGroupsById($data, $productId);
}
}
}
?>PK�"�[������+models/phocacarteditproductpricehistory.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.modellist' );
class PhocaCartCpModelPhocaCartEditProductPriceHistory extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
public $typeAlias =
'com_phocacart.phocacartpricehistory';
public function getTable($type = 'PhocacartProductPriceHistory',
$prefix = 'Table', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form =
$this->loadForm('com_phocacart.phocacartpricehistory',
'phocacartpricehistory', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData()
{
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartpricehistory.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
public function getItem($pk = null) {
if ($item = parent::getItem($pk)) {
$history =
PhocacartPriceHistory::getPriceHistoryById((int)$item->product_id, 0,
1);
if (!empty($history)) {
foreach($history as $k => $v) {
$history[$k]['price'] =
PhocacartPrice::cleanPrice($v['price']);
}
}
$item->set('price_history', $history);
}
return $item;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$table->price =
PhocacartUtils::replaceCommaWithPoint($table->price);
}
public function save($data/*, $productId*/) {
$app = JFactory::getApplication();
$productId = $app->input->get('id', 0,
'int');
if (!empty($data)) {
return
PhocacartPriceHistory::storePriceHistoryCustomById($data['price_history'],
$productId);
}
}
}
?>
PK�"�[EM�models/phocacarteditstatus.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.modellist' );
class PhocaCartCpModelPhocaCartEditStatus extends JModelList
{
protected $option = 'com_phocacart';
public function getData() {
$app = JFactory::getApplication();
$id = $app->input->get('id', 0, 'int');
$db = JFactory::getDBO();
$query = 'SELECT a.status_id'
. ' FROM #__phocacart_orders AS a'
. ' WHERE a.id = '.(int)$id
. ' LIMIT 1';
$db->setQuery( $query );
$item = $db->loadObject();
if (isset($item->status_id) && (int)$item->status_id >
0) {
$status = PhocacartOrderStatus::getStatus($item->status_id);
$status['select'] =
Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$status['data'], 'jform[status_id]',
'class="inputbox"', 'value',
'text', $item->status_id, 'jform_status_id' );
return $status;
}
return array();
}
public function getHistoryData() {
$app = JFactory::getApplication();
$id = $app->input->get('id', 0, 'int');
if ((int)$id > 0) {
$db = JFactory::getDBO();
$query = 'SELECT h.*,'
. ' u.name AS user_name, u.username AS user_username,'
. ' o.title as statustitle'
. ' FROM #__phocacart_order_history AS h'
. ' LEFT JOIN #__users AS u ON u.id = h.user_id'
. ' LEFT JOIN #__phocacart_order_statuses AS o ON o.id =
h.order_status_id'
. ' WHERE h.order_id = '.(int)$id
. ' ORDER BY h.date ASC';
$db->setQuery( $query );
$items = $db->loadObjectList();
return $items;
}
}
public function editStatus($data) {
$data['id'] = (int)$data['id'];
$data['status_id'] = (int)$data['status_id'];
$data['email_send'] = (int)$data['email_send'];
$data['email_send_format'] =
(int)$data['email_send_format'];
$data['email_gift'] = (int)$data['email_gift'];
$row = $this->getTable('PhocacartOrder',
'Table');
$user = JFactory::getUser();
if(isset($data['id']) && $data['id'] > 0)
{
if (!$row->load(array('id' =>
(int)$data['id']))) {
// No data yet
}
}
//$row->bind($data);
if (!$row->bind($data)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
$row->modified = $date = gmdate('Y-m-d H:i:s');
if (!$row->check()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
// Store the table to the database
if (!$row->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
// Store the history
$db = JFactory::getDBO();
// EMAIL
$notifyUser = 0;
$notifyOther = 0;
if (isset($data['notify_customer'])) {
$notifyUser = 1;
}
if (isset($data['notify_others'])) {
$notifyOther = 1;
}
// Set invoice data in case status can set invoice ID (before notify)
PhocacartOrder::storeOrderReceiptInvoiceId((int)$data['id'],
false, (int)$data['status_id'], array('I'));
$notify = PhocacartOrderStatus::changeStatus((int)$data['id'],
(int)$data['status_id'], '', $notifyUser, $notifyOther,
(int)$data['email_send'], $data['stock_movements'],
$data['change_user_group'],
$data['change_points_needed'],
$data['change_points_received'],
(int)$data['email_send_format']);
PhocacartOrderStatus::setHistory((int)$data['id'],
(int)$data['status_id'], (int)$notify,
$data['comment_history']);
return $row->id;
}
public function emptyHistory($id) {
if ((int)$id > 0) {
$db = JFactory::getDBO();
$query = 'DELETE FROM #__phocacart_order_history WHERE order_id =
'.(int)$id;
$db->setQuery( $query );
if ($db->execute()) {
return true;
} else {
return false;
}
}
}
}
?>
PK�"�[�ߥ���%models/phocacarteditstockadvanced.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.modellist' );
class PhocaCartCpModelPhocaCartEditStockAdvanced extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
public $typeAlias =
'com_phocacart.phocacartproductstock';
public function getTable($type = 'PhocacartProductStock',
$prefix = 'Table', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form =
$this->loadForm('com_phocacart.phocacartproductstock',
'phocacartproductstock', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData()
{
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartproductstock.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
public function getItem($pk = null) {
$app = JFactory::getApplication();
$productId = $app->input->get('id', 0,
'int');
if ($item = parent::getItem($pk)) {
if ($productId > 0) {
$product = PhocacartProduct::getProduct((int)$productId);
$attr_options =
PhocacartAttribute::getAttributesAndOptions((int)$productId);
$combinations = array();
$combinations_data = array();
if (!empty($product)) {
PhocacartAttribute::getCombinations($product->id,
$product->title, $attr_options, $combinations);
// Load data from database
$combinations_data =
PhocacartAttribute::getCombinationsDataByProductId($product->id);
}
if (!empty($combinations)) {
ksort($combinations);
foreach ($combinations as $k => $v) {
if
(isset($combinations_data[$v['product_key']]['stock']))
{
$combinations[$v['product_key']]['stock'] =
$combinations_data[$v['product_key']]['stock'];
}
if
(isset($combinations_data[$v['product_key']]['price']))
{
$price =
$combinations_data[$v['product_key']]['price'];
$combinations[$v['product_key']]['price'] =
PhocacartPrice::cleanPrice($price);
}
if
(isset($combinations_data[$v['product_key']]['sku'])) {
$combinations[$v['product_key']]['sku'] =
$combinations_data[$v['product_key']]['sku'];
}
if
(isset($combinations_data[$v['product_key']]['ean'])) {
$combinations[$v['product_key']]['ean'] =
$combinations_data[$v['product_key']]['ean'];
}
if
(isset($combinations_data[$v['product_key']]['image']))
{
$combinations[$v['product_key']]['image'] =
$combinations_data[$v['product_key']]['image'];
}
if (isset($v['product_key'])) {
$combinations[$v['product_key']]['product_key']
= $v['product_key'];
}
if (isset($v['product_id'])) {
$combinations[$v['product_key']]['product_id'] =
$v['product_id'];
}
if (isset($v['product_id']) &&
isset($v['attributes'])) {
$combinations[$v['product_key']]['attributes'] =
PhocacartProduct::getProductKey($v['product_id'],
$v['attributes'], 0);
}
}
$item->set('product_stock', $combinations);
}
}
}
return $item;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$table->price =
PhocacartUtils::replaceCommaWithPoint($table->price);
}
public function save($data/*, $productId*/) {
$app = JFactory::getApplication();
$productId = $app->input->get('id', 0,
'int');
if (!empty($data['product_stock'])) {
$notDeleteItems = array();
foreach($data['product_stock'] as $k => $v) {
$row = $this->getTable('PhocacartProductStock',
'Table');
if(isset($v['product_key']) &&
$v['product_key'] != '') {
if (!$row->load(array('product_key' =>
$v['product_key']))) {
// No data yet
}
}
$v['stock'] =
PhocacartUtils::getIntFromString($v['stock']);
if (!$row->bind($v)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
if (!$row->check()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
if (!$row->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
if (isset($row->id) && (int)$row->id > 0) {
$notDeleteItems[] = (int)$row->id;
}
}
if (!empty($notDeleteItems)) {
$notDeleteItemsString = implode(',', $notDeleteItems);
$query = ' DELETE '
.' FROM #__phocacart_product_stock'
.' WHERE product_id = '. (int)$productId
.' AND id NOT IN ('.$notDeleteItemsString.')';
} else {
$query = ' DELETE '
.' FROM #__phocacart_product_stock'
.' WHERE product_id = '. (int)$productId;
}
$this->_db->setQuery($query);
$this->_db->execute();
}
return true;
}
/*public function getData() {
$app = JFactory::getApplication();
$id = $app->input->get('id', 0, 'int');
$db = JFactory::getDBO();
$query = 'SELECT a.status_id'
. ' FROM #__phocacart_orders AS a'
. ' WHERE a.id = '.(int)$id
. ' LIMIT 1';
$db->setQuery( $query );
$item = $db->loadObject();
if (isset($item->status_id) && (int)$item->status_id >
0) {
$status = PhocacartOrderStatus::getStatus($item->status_id);
$status['select'] =
Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$status['data'], 'jform[status_id]',
'class="inputbox"', 'value',
'text', $item->status_id, 'jform_status_id' );
return $status;
}
return array();
}*/
/*
public function getHistoryData() {
$app = JFactory::getApplication();
$id = $app->input->get('id', 0, 'int');
if ((int)$id > 0) {
$db = JFactory::getDBO();
$query = 'SELECT h.*,'
. ' u.name AS user_name, u.username AS user_username,'
. ' o.title as statustitle'
. ' FROM #__phocacart_order_history AS h'
. ' LEFT JOIN #__users AS u ON u.id = h.user_id'
. ' LEFT JOIN #__phocacart_order_statuses AS o ON o.id =
h.order_status_id'
. ' WHERE h.order_id = '.(int)$id
. ' ORDER BY h.date ASC';
$db->setQuery( $query );
$items = $db->loadObjectList();
return $items;
}
}*/
/*
public function editStatus($data) {
$data['id'] = (int)$data['id'];
$data['status_id'] = (int)$data['status_id'];
$data['email_send'] = (int)$data['email_send'];
$row = $this->getTable('PhocacartOrder',
'Table');
$user = PhocacartUser::getUser();
if(isset($data['id']) && $data['id'] > 0)
{
if (!$row->load(array('id' =>
(int)$data['id']))) {
// No data yet
}
}
//$row->bind($data);
if (!$row->bind($data)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
$row->modified = $date = gmdate('Y-m-d H:i:s');
if (!$row->check()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
// Store the table to the database
if (!$row->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
// Store the history
$db = JFactory::getDBO();
// EMAIL
$notifyUser = 0;
$notifyOther = 0;
if (isset($data['notify_customer'])) {
$notifyUser = 1;
}
if (isset($data['notify_others'])) {
$notifyOther = 1;
}
$notify = PhocacartOrderStatus::changeStatus((int)$data['id'],
(int)$data['status_id'], '', $notifyUser, $notifyOther,
(int)$data['email_send'], $data['stock_movements']);
PhocacartOrderStatus::setHistory((int)$data['id'],
(int)$data['status_id'], (int)$notify,
$data['comment']);
return $row->id;
}*/
/*
public function emptyHistory($id) {
if ((int)$id > 0) {
$db = JFactory::getDBO();
$query = 'DELETE FROM #__phocacart_order_history WHERE order_id =
'.(int)$id;
$db->setQuery( $query );
if ($db->execute()) {
return true;
} else {
return false;
}
}
}*/
}
?>
PK�"�[m��models/phocacartedittax.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.modellist' );
class PhocaCartCpModelPhocaCartEditTax extends JModelList
{
protected $option = 'com_phocacart';
public function getData() {
$app = JFactory::getApplication();
$id = $app->input->get('id', 0, 'int');
$type = $app->input->get('type', 0, 'type');//
1 country, 2 region
$db = JFactory::getDBO();
$query = 'SELECT a.id, a.title, a.code2, a.image';
if ($type == 1) {
$query .= ' FROM #__phocacart_countries AS a';
} else {
$query .= ' FROM #__phocacart_regions AS a';
}
$query .= ' WHERE a.id = '.(int)$id
. ' LIMIT 1';
$db->setQuery( $query );
$item = $db->loadObject();
return $item;
}
public function getCountryTaxData() {
$app = JFactory::getApplication();
$id = $app->input->get('id', 0, 'int');
if ((int)$id > 0) {
return PhocacartTax::getTaxesByCountry($id);
}
}
public function getRegionTaxData() {
$app = JFactory::getApplication();
$id = $app->input->get('id', 0, 'int');
if ((int)$id > 0) {
return PhocacartTax::getTaxesByRegion($id);
}
}
public function editTax($data) {
$data['id'] = (int)$data['id'];
$data['type'] = (int)$data['type'];
$row = $this->getTable('PhocacartOrder',
'Table');
$user = JFactory::getUser();
if (!empty($data)) {
if(isset($data['id']) && $data['id'] > 0)
{
$countryOrRegionId = $data['id'];
$valuesNew = array();
$valuesUpdate = array();
foreach($data as $k => $v) {
// Ignore the $data['id']
if (isset($v['tax_id'])) {
if (!isset($v['title'])) {
$v['title'] = '';
}
if (!isset($v['alias'])) {
$v['alias'] = '';
}
if (!isset($v['tax_rate'])) {
$v['tax_rate'] = '';
}
// We need to differentiate between 0 and ''
// if 0 ... the VAT is 0
// if '' ... the VAT is not set
// if -1 ... it was set in past but now it is inactive (but we still
hold the info about the id for the country/region and tax id combination
if ($data['type'] == 2) {
/* $q = ' DELETE '
.' FROM #__phocacart_tax_regions'
. ' WHERE region_id = '.(int)$data['id'];*/
$q = ' SELECT id '
.' FROM #__phocacart_tax_regions'
. ' WHERE region_id = '.(int)$data['id']
. ' AND tax_id = '.(int)$v['tax_id'];
} else {
/*$q = ' DELETE '
.' FROM #__phocacart_tax_countries'
. ' WHERE country_id = '.(int)$data['id'];*/
$q = ' SELECT id '
.' FROM #__phocacart_tax_countries'
. ' WHERE country_id = '.(int)$data['id']
. ' AND tax_id = '.(int)$v['tax_id'];
}
$this->_db->setQuery($q);
//$this->_db->execute();
$idExists = $this->_db->loadResult();
if ((int)$idExists > 0) {
$title = $v['title'];
$alias = $v['alias'];
$taxRate = $v['tax_rate'];
if ($v['tax_rate'] == '') {
$title = '';
$alias = '';
$taxRate = -1;
}
$q = '';
if ($data['type'] == 2) {
$q .= ' UPDATE #__phocacart_tax_regions';
$q .= ' SET tax_id =
'.(int)$v['tax_id'].','
.' region_id = '.(int)$countryOrRegionId.','
.' title =
'.$this->_db->quote($title).','
.' alias =
'.$this->_db->quote($alias).','
.' tax_rate = '.$this->_db->quote($taxRate)
.' WHERE id = '.(int)$idExists;
} else {
$q .= ' UPDATE #__phocacart_tax_countries';
$q .= ' SET tax_id =
'.(int)$v['tax_id'].','
.' country_id = '.(int)$countryOrRegionId.','
.' title =
'.$this->_db->quote($title).','
.' alias =
'.$this->_db->quote($alias).','
.' tax_rate = '.$this->_db->quote($taxRate)
.' WHERE id = '.(int)$idExists;
}
//$valuesUpdate[] = $q;
$this->_db->setQuery($q);
$this->_db->execute();
} else {
if ($v['tax_rate'] == '') {
} else {
$valuesNew[] = '('.(int)$v['tax_id'].',
'.(int)$countryOrRegionId.',
'.$this->_db->quote($v['title']).',
'.$this->_db->quote($v['alias']).',
'.$this->_db->quote($v['tax_rate']).')';
}
}
}
}
// Update the existing items
if (!empty($valuesUpdate)) {
// update directly by each item
//$q = implode(';', $valuesUpdate);
//$this->_db->setQuery($q);
//$this->_db->execute();
}
// And not existing items
if (!empty($valuesNew)) {
if ($data['type'] == 2) {
$q = ' INSERT INTO #__phocacart_tax_regions (tax_id, region_id,
title, alias, tax_rate)';
} else {
$q = ' INSERT INTO #__phocacart_tax_countries (tax_id,
country_id, title, alias, tax_rate)';
}
$q .= ' VALUES ' .implode(',', $valuesNew);
$this->_db->setQuery($q);
$this->_db->execute();
}
return true;
}
}
return false;
}
public function emptyInformation($id, $type) {
if ((int)$id > 0) {
$db = JFactory::getDBO();
if ($type == 2) {
//$query = 'DELETE FROM #__phocacart_tax_regions WHERE region_id =
'.(int)$id;
$query = 'UPDATE #__phocacart_tax_regions SET tax_rate = -1, title
= \'\', alias = \'\' WHERE region_id =
'.(int)$id;
} else {
//$query = 'DELETE FROM #__phocacart_tax_countries WHERE
country_id = '.(int)$id;
$query = 'UPDATE #__phocacart_tax_countries SET tax_rate = -1,
title = \'\', alias = \'\' WHERE country_id =
'.(int)$id;
}
$db->setQuery( $query );
if ($db->execute()) {
return true;
} else {
return false;
}
}
}
}
?>PK�"�[�Ly�
models/phocacartexport.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocaCartExport extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
}
?>PK�"�[/9͵��models/phocacartexports.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocaCartExports extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
parent::__construct($config);
}
public function getItemsCountProduct() {
$db = $this->getDbo();
$user = JFactory::getUser();
$q = 'SELECT COUNT(id)'
.' FROM #__phocacart_products';
//.' GROUP BY id'
//.' ORDER BY id';
$db->setQuery($q);
$count = $db->loadResult();
return $count;
}
public function getItemsCountExport() {
$db = $this->getDbo();
$user = JFactory::getUser();
$q = 'SELECT COUNT(id)'
.' FROM #__phocacart_export'
.' WHERE user_id = '.(int) $user->id
.' AND type = 0';
//.' GROUP BY id'
//.' ORDER BY id';
$db->setQuery($q);
$count = $db->loadResult();
return $count;
}
}
?>PK�"�[�|˰�
�
models/phocacartextensions.phpnu�[���<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
version 2 or later;
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartExtensions extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array())
{
parent::__construct($config);
}
protected function populateState($ordering = 'a.date',
$direction = 'DESC')
{
$app = JFactory::getApplication('administrator');
$categoryId =
$app->getUserStateFromRequest($this->context.'.filter.category_id',
'filter_category_id', 'modules');
$this->setState('filter.category_id', $categoryId);
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
$id .= ':'.$this->getState('filter.category_id');
return parent::getStoreId($id);
}
public function getItems() {
$app = JFactory::getApplication('administrator');
$items = null;
$type = $this->getState('filter.category_id',
'modules');
$url = PhocacartUtilsSettings::getExtenstionsJSONLinks($type);
$items =
$app->getUserState('com_phocacart.getExtensions.'.$type,
null);
if ($items === null) {
$items = array();
if ($url) {
$content = @file_get_contents($url);
if (!$content || $content == '') {
$content = PhocacartUtils::curl_get_contents($url);
}
if ($content) {
$contentJSON = json_decode($content, true);
if ($contentJSON && json_last_error() == JSON_ERROR_NONE
&& !empty($contentJSON['extensions'])) {
$items = $contentJSON['extensions'];
}
} else {
$msg =
JText::_('COM_PHOCACART_ERROR_EXTENSIONS_CHANNEL_NOT_FOUND').
' ('.ucfirst($type).')';
$app->enqueueMessage($msg, 'error');
}
}
$app->setUserState('com_phocacart.getExtensions.'.$type,
$items);
} else if (empty($items)) {
$msg = JText::_('COM_PHOCACART_ERROR_NO_EXTENSION_FOUND').
' ('.ucfirst($type).')';
$app->enqueueMessage($msg, 'error');
}
return $items;
}
public function getNews() {
$app = JFactory::getApplication('administrator');
$news = null;
$type = 'news';
$url = PhocacartUtilsSettings::getExtenstionsJSONLinks($type);
$news = $app->getUserState('com_phocacart.getNews.'.$type,
null);
if ($news === null) {
$news = array();
if ($url) {
$content = @file_get_contents($url);
if (!$content || $content == '') {
$content = PhocacartUtils::curl_get_contents($url);
}
if ($content) {
$contentJSON = json_decode($content, true);
if ($contentJSON && json_last_error() == JSON_ERROR_NONE
&& !empty($contentJSON['content'])) {
$news = $contentJSON['content'];
}
} else {
//$msg =
JText::_('COM_PHOCACART_ERROR_NEWS_CHANNEL_NOT_FOUND'). '
('.ucfirst($type).')';
//$app->enqueueMessage($msg, 'error');
}
}
$app->setUserState('com_phocacart.getNews.'.$type, $news);
} else if (empty($news)) {
//$msg = JText::_('COM_PHOCACART_ERROR_NO_NEWS_ENTRY_FOUND').
' ('.ucfirst($type).')';
//$app->enqueueMessage($msg, 'error');
}
return $news;
}
}
?>
PK�"�[D�Ay��models/phocacartfeed.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
use Joomla\Registry\Registry;
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartFeed extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record) {
return parent::canDelete($record);
}
protected function canEditState($record) {
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartFeed', $prefix =
'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartfeed',
'phocacartfeed', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartfeed.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
public function getItem($pk = null) {
if ($item = parent::getItem($pk)) {
// Convert the params field to an array.
if (isset($item->item_params)) {
$registry = new JRegistry;
$registry->loadString($item->item_params);
$item->item_params = $registry->toArray();
}
if (isset($item->feed_params)) {
$registry = new JRegistry;
$registry->loadString($item->feed_params);
$item->feed_params = $registry->toArray();
}
}
return $item;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_feeds');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
public function save($data) {
if (isset($data['item_params']) &&
is_array($data['item_params'])) {
$registry = new Registry;
$registry->loadArray($data['item_params']);
$data['item_params'] = (string) $registry;
}
if (isset($data['feed_params']) &&
is_array($data['feed_params'])) {
$registry = new Registry;
$registry->loadArray($data['feed_params']);
$data['feed_params'] = (string) $registry;
}
if (parent::save($data)) {
return true;
}
return false;
}
}
?>
PK�"�[*��zFFmodels/phocacartfeeds.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartFeeds extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'code', 'a.code',
'discount', 'a.discount',
'valid_from', 'a.valid_from',
'valid_to', 'a.valid_to',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.status_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_feeds` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[�e<� �
models/phocacartformfield.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocaCartFormfield extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record)
{
//$user = JFactory::getUser();
return parent::canDelete($record);
}
protected function canEditState($record)
{
//$user = JFactory::getUser();
return parent::canEditState($record);
}
public function getTable($type = 'PhocaCartFormfield', $prefix =
'Table', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartformfield',
'phocacartformfield', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData()
{
// Check the session for previously entered form data.
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartformfield.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table)
{
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->title = str_replace('_', 'ph-u-ph',
$table->title);// only alphabetical characters possible
$table->title = PhocacartText::stringURLSafe($table->title);
$table->title = str_replace('ph-u-ph', '_',
$table->title);// only alphabetical characters possible
$table->alias = PhocacartText::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = PhocacartText::stringURLSafe($table->title);
}
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_form_fields');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
function displayItem(&$pks, $value = 1, $column =
'display_billing') {
//$dispatcher = JDispatcher::getInstance();
$user = JFactory::getUser();
$table = $this->getTable('phocacartformfield');
$pks = (array) $pks;
foreach ($pks as $i => $pk) {
if ($table->load($pk)) {
if (!$this->canEditState($table)) {
unset($pks[$i]);
$this->setError(JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'));
}
}
}
if (!$table->displayItem($pks, $value, $user->get('id'),
$column)) {
$this->setError($table->getError());
return false;
}
return true;
}
public function save($data) {
$save = parent::save($data);
if ($save) {
$savedId = $this->getState($this->getName().'.id');
if ((int)$savedId > 0) {
if (!isset($data['id']) || (isset($data['id'])
&& $data['id'] == 0)) {
$type = PhocacartFormItems::getColumnType($data['type']);
$data['title'] =
PhocacartText::stringURLSafe($data['title']);
$data['title'] = strip_tags($data['title']);
$db = JFactory::getDBO();
$config = JFactory::getConfig();
$dbName = $config->get('db', '');
if ($dbName != '' && $data['title'] !=
'' && $type != '') {
/*$query = 'SELECT * FROM information_schema.COLUMNS'
.' WHERE TABLE_SCHEMA = '.$db->quote($dbName)
.' AND TABLE_NAME =
'.$db->quote('#__phocacart_users')
.' AND COLUMN_NAME =
'.$db->quote($data['title']);*/
// Manage _ as wildcard - BECAUSE OF LIKE
$dataTitle = str_replace('_', '\_',
$db->quote($data['title']));
$dataTitle = str_replace('\\_', '\_',
$dataTitle);
$query10 = 'SHOW COLUMNS FROM #__phocacart_users LIKE
'.$dataTitle;
$db->setQuery($query10);
$column1 = $db->loadResult();
if (empty($column1)) {
$query11 = 'ALTER TABLE #__phocacart_users ADD
'.$db->quoteName($data['title']).'
'.$type.';';
$db->setQuery($query11);
if (!$db->execute()){
$this->setError($db->getErrorMsg());
return false;
}
}
$query20 = 'SHOW COLUMNS FROM #__phocacart_order_users LIKE
'.$dataTitle;
$db->setQuery($query20);
$column2 = $db->loadResult();
if (empty($column2)) {
$query21 = 'ALTER TABLE #__phocacart_order_users ADD
'.$db->quoteName($data['title']).'
'.$type.'';
$db->setQuery($query21);
if (!$db->execute()){
$this->setError($db->getErrorMsg());
return false;
}
}
}
}
PhocacartGroup::storeGroupsById((int)$savedId, 9,
$data['group']);
}
}
return $save;
}
public function delete(&$cid = array()) {
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$result = false;
if (count( $cid )) {
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$cids = implode( ',', $cid );
$table = $this->getTable();
if (!$this->canDelete($table)){
$error = $this->getError();
if ($error){
JLog::add($error, JLog::WARNING);
return false;
} else {
JLog::add(JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'),
JLog::WARNING);
return false;
}
}
// Select id's from product table, if there are some items,
don't delete it.
$query = 'SELECT a.id, a.title, a.type_default'
. ' FROM #__phocacart_form_fields AS a'
. ' WHERE a.id IN ( '.$cids.' )'
. ' GROUP BY a.id, a.title, a.type_default';
$db->setQuery( $query );
if (!($rows = $db->loadObjectList())) {
throw new Exception(
JText::_('COM_PHOCACART_ERROR_PROBLEM_LOADING_DATA'), 500 );
return false;
}
$cidOK = array();
$cidOKTitle = array();
$cidError = array();
foreach ($rows as $row) {
if ($row->type_default == 0) {
$cidOK[] = (int)$row->id;
$cidOKTitle[] = $row->title;
} else {
$cidError[] = $row->title;
}
}
if (count( $cidOK )) {
$cidsOK = implode( ',', $cidOK );
$query2 = 'DELETE FROM #__phocacart_form_fields'
. ' WHERE id IN ( '.$cidsOK.' )';
$db->setQuery( $query2 );
if (!$db->execute()) {
$this->setError($this->_db->getErrorMsg());
return false;
};
if (!empty($cidOKTitle)) {
foreach($cidOKTitle as $k => $v) {
$v = PhocacartText::stringURLSafe($v);
$v = strip_tags($v);
// Manage _ as wildcard - BECAUSE OF LIKE
$dataTitle = str_replace('_', '\_',
$db->quote($v));
$dataTitle = str_replace('\\_', '\_',
$dataTitle);
$query10 = 'SHOW COLUMNS FROM #__phocacart_users LIKE
'.$dataTitle;
$db->setQuery($query10);
$column1 = $db->loadResult();
if (!empty($column1)) {
$query11 = 'ALTER TABLE #__phocacart_users DROP COLUMN
'.$db->quoteName($v).';';
$db->setQuery($query11);
$db->execute();
}
$query20 = 'SHOW COLUMNS FROM #__phocacart_order_users LIKE
'.$dataTitle;
$db->setQuery($query20);
$column2 = $db->loadResult();
if (!empty($column2)) {
$query21 = 'ALTER TABLE #__phocacart_order_users DROP COLUMN
'.$db->quoteName($v).';';
$db->setQuery($query21);
$db->execute();
}
}
}
}
$msg = '';
if (!empty($cidError)) {
$cidErrorString = implode( ", ", $cidError );
$msg .= JText::plural(
'COM_PHOCACART_ERROR_DELETE_DEFAULT_FORM_FIELDS', $cidErrorString
);
}
if (!empty($cidOKTitle)) {
$cidOKTitleString = implode( ", ", $cidOKTitle );
if ($msg != '') { $msg .= "<br />";}
$msg .= JText::plural(
'COM_PHOCACART_SUCCESS_FORM_FIELDS_DELETED', $cidOKTitleString );
}
$link =
'index.php?option=com_phocacart&view=phocacartformfields';
$app->enqueueMessage($msg, 'error');
$app->redirect($link);
}
return true;
}
}
?>
PK�"�[aZ���models/phocacartformfields.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocaCartFormfields extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'display_billing', 'a.display_billing',
'display_shipping', 'a.display_shipping',
'display_account', 'a.display_account',
'description', 'a.description',
'label', 'a.label',
'type', 'a.type',
'type_default', 'a.type_default',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'access', 'a.access', 'access_level',
'ordering', 'a.ordering',
'published','a.published',
'required', 'a.required'
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
$accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.formfield_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_form_fields` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id =
a.access');
// Filter by access level.
if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.label
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[�=];;models/phocacartgroup.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartGroup extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record) {
return parent::canDelete($record);
}
protected function canEditState($record) {
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartGroup', $prefix =
'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartgroup',
'phocacartgroup', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartgroup.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
public function getItem($pk = null) {
if ($item = parent::getItem($pk)) {
$item->minimum_sum =
PhocacartPrice::cleanPrice($item->minimum_sum);
}
return $item;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_groups');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
if (isset($table->type) && isset($table->published)
&& $table->type == 1 && $table->published == 0) {
$table->published = 1;
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('COM_PHOCACART_ERROR_DEFAULT_ITEMS_CANNOT_BE_UNPUBLISHED'));
}
}
public function delete(&$cid = array()) {
if (count( $cid )) {
\Joomla\Utilities\ArrayHelper::toInteger($cid);
//$cids = implode( ',', $cid );
//$app = JFactory::getApplication();
$error = 0;
if (!empty($cid)) {
foreach ($cid as $k => $v) {
$query = 'SELECT type FROM #__phocacart_groups WHERE id
='.(int)$v;
$this->_db->setQuery($query);
$type = $this->_db->loadRow();
if (isset($type[0]) && $type[0] == 1) {
$error = 1;
} else {
$query = 'DELETE FROM #__phocacart_groups'
. ' WHERE id = '.(int)$v;
$this->_db->setQuery( $query );
$this->_db->execute();
}
}
}
}
if ($error) {
$this->setError(JText::_('COM_PHOCACART_ERROR_DEFAULT_ITEMS_CANNOT_BE_DELETED'));
//$app->enqueueMessage(JText::_('COM_PHOCACART_ERROR_DEFAULT_ITEMS_CANNOT_BE_DELETED'));
return false;
} else {
return true;
}
}
public function publish(&$pks, $value = 1)
{
$user = JFactory::getUser();
$table = $this->getTable();
$pks = (array) $pks;
$app = JFactory::getApplication();
$error = 0;
foreach ($pks as $i => $pk){
$table->reset();
if ($table->load($pk)) {
if (!$this->canEditState($table)){
// Prune items that you can't change.
unset($pks[$i]);
JLog::add(JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'),
JLog::WARNING, 'jerror');
return false;
}
// If the table is checked out by another user, drop it and report to
the user trying to change its state.
if (property_exists($table, 'checked_out') &&
$table->checked_out && ($table->checked_out !=
$user->id)){
JLog::add(JText::_('JLIB_APPLICATION_ERROR_CHECKIN_USER_MISMATCH'),
JLog::WARNING, 'jerror');
// Prune items that you can't change.
unset($pks[$i]);
return false;
}
if (property_exists($table, 'type') &&
$table->type && ((int)$table->type == 1) && $value ==
0){
$error = 1;
unset($pks[$i]);
//return false;
}
}
}
// Attempt to change the state of the records.
if (!empty($pks)) {
if (!$table->publish($pks, $value, $user->get('id'))) {
$this->setError($table->getError());
return false;
}
}
if ($error) {
//$this->setError(JText::_('COM_PHOCACART_ERROR_DEFAULT_ITEMS_CANNOT_BE_UNPUBLISHED'));
$app->enqueueMessage(JText::_('COM_PHOCACART_ERROR_DEFAULT_ITEMS_CANNOT_BE_UNPUBLISHED'));
return true;
} else {
return true;
}
$this->cleanCache();
}
}
?>PK�"�[y�j!MMmodels/phocacartgroups.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartGroups extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'minimum_sum', 'a.minimum_sum',
'valid_from', 'a.valid_from',
'valid_to', 'a.valid_to',
'type', 'a.type',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.group_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_groups` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[��r�qqmodels/phocacarthit.phpnu�[���<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
version 2 or later;
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocaCartHit extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
public $typeAlias = 'com_phocacart.phocacarthit';
protected function canDelete($record){
$user = JFactory::getUser();
if (!empty($record->catid)) {
// catid not used
return $user->authorise('core.delete',
'com_phocacart.phocacarthit.'.(int) $record->catid);
} else {
return parent::canDelete($record);
}
}
public function getForm($data = array(), $loadData = true) {
return false;
}
public function delete(&$cid = array()) {
if (count( $cid )) {
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$error = 0;
if (!empty($cid)) {
foreach ($cid as $k => $v) {
$q = 'DELETE FROM #__phocacart_hits'
. ' WHERE id = '.(int)$v;
$this->_db->setQuery( $q );
$this->_db->execute();
}
}
}
return true;
}
}
?>PK�"�[�/�NNmodels/phocacarthits.phpnu�[���<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
version 2 or later;
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocaCartHits extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'hits', 'a.hits',
'product_id','a.product_id',
'item','a.item',
'user_id', 'a.user_id',
'ip', 'a.ip',
'date', 'a.date'
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.date',
$direction = 'DESC') {
$app = JFactory::getApplication('administrator');
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
/* $userId =
$app->getUserStateFromRequest($this->context.'.filter.user_id',
'filter_user_id', null);
$this->setState('filter.user_id', $userId);
$productId =
$app->getUserStateFromRequest($this->context.'.filter.product_id',
'filter_product_id', null);
$this->setState('filter.product_id', $productId);
*/
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
$id .= ':'.$this->getState('filter.search');
$id .= ':'.$this->getState('filter.published');
//$id .= ':'.$this->getState('filter.product_id');
//$id .= ':'.$this->getState('filter.user_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
$columns = 'a.id, a.user_id, a.product_id, a.item, a.ip, a.type,
a.hits, a.date';
//$groupsFull = $columns;
//$groupsFast = 'a.id';
//$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
$query->select($this->getState('list.select', $columns));
$query->from('`#__phocacart_hits` AS a');
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
$query->select('u.name AS user_name, u.username AS
user_username');
$query->join('LEFT', '#__users AS u ON u.id =
a.user_id');
$query->select('p.title AS product_title, p.alias AS
product_alias');
$query->join('LEFT', '#__phocacart_products AS p ON
p.id = a.product_id');
/* // Filter by product.
$productId = $this->getState('filter.product_id');
if (is_numeric($productId)) {
$query->where('a.product_id = ' . (int) $productId);
}
// Filter by user.
$userId = $this->getState('filter.user_id');
if (is_numeric($userId)) {
$query->where('a.user_id = ' . (int) $userId);
}
*/
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( p.title LIKE '.$search.' OR p.alias
LIKE '.$search
.' OR u.name LIKE '.$search.' OR u.username LIKE
'.$search
.' OR a.item LIKE '.$search.')');
}
}
//$query->group('a.id');
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering',
'date');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[�����models/phocacartimport.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocaCartImport extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
public static function getFileType() {
$db = JFactory::getDbo();
$user = JFactory::getUser();
$q = 'SELECT file_type'
.' FROM #__phocacart_import'
.' WHERE user_id = '.(int) $user->id
.' ORDER BY id'
.' LIMIT 1';
$db->setQuery($q);
$type = $db->loadResult();
return $type;
}
public static function getUploadedProducts($limitOffset = 0, $limitCount =
1) {
$db = JFactory::getDBO();
$user = JFactory::getUser();
$q = 'SELECT item'
.' FROM #__phocacart_import'
.' WHERE user_id = '.(int) $user->id
.' AND type = 0'
.' ORDER BY id';
if ((int)$limitCount > 0) {
$q .= ' LIMIT '.(int)$limitOffset. ',
'.(int)$limitCount;
}
$db->setQuery($q);
$products = $db->loadAssocList();
return $products;
}
public static function getUploadedProductColumns() {
$db = JFactory::getDBO();
$user = JFactory::getUser();
$q = 'SELECT item'
.' FROM #__phocacart_import'
.' WHERE user_id = '.(int) $user->id
.' AND type = 1'
.' ORDER BY id'
.' LIMIT 1';
$db->setQuery($q);
$productColumns = $db->loadAssocList();
return $productColumns;
}
public function getForm($data = array(), $loadData = true) {
return false;
}
}
?>PK�"�[�3?I��models/phocacartimports.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocaCartImports extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
parent::__construct($config);
}
public function getItemsCountImport() {
$db = $this->getDbo();
$user = JFactory::getUser();
$q = 'SELECT COUNT(id)'
.' FROM #__phocacart_import'
.' WHERE user_id = '.(int) $user->id
.' AND type = 0';
//.' GROUP by id'
//.' ORDER BY id';
$db->setQuery($q);
$count = $db->loadResult();
return $count;
}
}
?>PK�"�[h���models/phocacartitem.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport('joomla.application.component.modeladmin');
use Joomla\String\StringHelper;
class PhocaCartCpModelPhocaCartItem extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
public $typeAlias =
'com_phocacart.phocacartitem';
protected $associationsContext = 'com_phocacart.item'; //
ASSOCIATION
protected function canDelete($record){
$user = JFactory::getUser();
if (!empty($record->catid)) {
// catid not used
return $user->authorise('core.delete',
'com_phocacart.phocacartitem.'.(int) $record->catid);
} else {
return parent::canDelete($record);
}
}
protected function canEditState($record) {
$user = JFactory::getUser();
if (!empty($record->catid)) {
// catid not used
return $user->authorise('core.edit.state',
'com_phocacart.phocacartitem.'.(int) $record->catid);
} else {
return parent::canEditState($record);
}
}
public function getTable($type = 'PhocaCartItem', $prefix =
'Table', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartitem',
'phocacartitem', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData()
{
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacart.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
public function getItem($pk = null) {
if ($item = parent::getItem($pk)) {
// Convert the params field to an array.
if (isset($item->metadata)) {
$registry = new JRegistry;
$registry->loadString($item->metadata);
$item->metadata = $registry->toArray();
}
if (isset($item->params_feed)) {
$registry = new JRegistry;
$registry->loadString($item->params_feed);
$item->params_feed = $registry->toArray();
}
if (isset($item->gift_types)) {
$registry = new JRegistry;
$registry->loadString($item->gift_types);
$item->gift_types = $registry->toArray();
}
// Make the numbers more readable
// it has no influence on saving it to db
$item->price = PhocacartPrice::cleanPrice($item->price);
$item->price_original =
PhocacartPrice::cleanPrice($item->price_original);
$item->length = PhocacartPrice::cleanPrice($item->length);
$item->width = PhocacartPrice::cleanPrice($item->width);
$item->height = PhocacartPrice::cleanPrice($item->height);
$item->weight = PhocacartPrice::cleanPrice($item->weight);
$item->volume = PhocacartPrice::cleanPrice($item->volume);
$item->unit_amount =
PhocacartPrice::cleanPrice($item->unit_amount);
$item->set('additional_download_files',
PhocacartFileAdditional::getProductFilesByProductId((int)$item->id, 2));
$item->set('additional_images',
PhocacartImageAdditional::getImagesByProductId((int)$item->id, 2));
$attributes = PhocacartAttribute::getAttributesById((int)$item->id,
2);
if (!empty($attributes)) {
foreach ($attributes as $k => $v) {
$attributes[$k]['options'] =
PhocacartAttribute::getOptionsById((int)$v['id'], 2);
}
}
$item->set('attributes', $attributes);
$item->set('specifications',
PhocacartSpecification::getSpecificationsById((int)$item->id, 2));
$item->set('discounts',
PhocacartDiscountProduct::getDiscountsById((int)$item->id, 2));
// ASSOCIATION
// Load associated Phoca Cart items
$assoc = JLanguageAssociations::isEnabled();
if ($assoc) {
$item->associations = array();
if ($item->id != null){
$associations =
JLanguageAssociations::getAssociations('com_phocacart',
'#__phocacart_products', 'com_phocacart.item',
$item->id, 'id', 'alias', false);
foreach ($associations as $tag => $association){
$item->associations[$tag] = $association->id;
}
}
}
}
return $item;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias =
JApplicationHelper::stringURLSafe($table->alias);
$table->price =
PhocacartUtils::replaceCommaWithPoint($table->price);
$table->price_original =
PhocacartUtils::replaceCommaWithPoint($table->price_original);
$table->length =
PhocacartUtils::replaceCommaWithPoint($table->length);
$table->width =
PhocacartUtils::replaceCommaWithPoint($table->width);
$table->height =
PhocacartUtils::replaceCommaWithPoint($table->height);
$table->weight =
PhocacartUtils::replaceCommaWithPoint($table->weight);
$table->volume =
PhocacartUtils::replaceCommaWithPoint($table->volume);
$table->tax_id =
PhocacartUtils::getIntFromString($table->tax_id);
$table->manufacturer_id =
PhocacartUtils::getIntFromString($table->manufacturer_id);
$table->stock =
PhocacartUtils::getIntFromString($table->stock);
$table->min_quantity =
PhocacartUtils::getIntFromString($table->min_quantity);
$table->min_multiple_quantity =
PhocacartUtils::getIntFromString($table->min_multiple_quantity);
$table->download_hits =
PhocacartUtils::getIntFromString($table->download_hits);
$table->points_received =
PhocacartUtils::getIntFromString($table->points_received);
$table->points_needed =
PhocacartUtils::getIntFromString($table->points_needed);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
/*
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
// WE HAVE SPECIFIC ORDERING
/*if (empty($table->ordering)) {
$db = JFactory::getDbo();
//$db->setQuery('SELECT MAX(ordering) FROM
#__phocadownload');
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_productcategories WHERE category_id =
'.(int)$table->category_id);
$max = $db->loadResult();
$table->ordering = $max+1;
}
} else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
*/
}
function save($data) {
$app = JFactory::getApplication();
/*if ($data['alias'] == '') {
$data['alias'] = $data['title'];
}*/
$app = JFactory::getApplication();
$input = JFactory::getApplication()->input;
//$dispatcher = J Dispatcher::getInstance();
$table = $this->getTable();
$pk = (!empty($data['id'])) ? $data['id'] :
(int)$this->getState($this->getName().'.id');
$isNew = true;
$user = JFactory::getUser();
// ALIAS
if (in_array($input->get('task'), array('apply',
'save', 'save2new')) &&
(!isset($data['id']) || (int) $data['id'] == 0)) {
if ($data['alias'] == null) {
if (JFactory::getConfig()->get('unicodeslugs') == 1) {
$data['alias'] =
JFilterOutput::stringURLUnicodeSlug($data['title']);
} else {
$data['alias'] =
JFilterOutput::stringURLSafe($data['title']);
}
if ($table->load(array('alias' =>
$data['alias']))){
$msg = JText::_('COM_PHOCACART_SAVE_WARNING');
}
list($title, $alias) = $this->generateNewTitle(0,
$data['alias'], $data['title']);
$data['alias'] = $alias;
if (isset($msg)) {
JFactory::getApplication()->enqueueMessage($msg,
'warning');
}
}
} else if ($table->load(array('alias' =>
$data['alias'])) && ($table->id !=
$data['id'] || $data['id'] == 0)) {
$this->setError(\JText::_('COM_PHOCACART_ERROR_ITEM_UNIQUE_ALIAS'));
return false;
}
if (!empty($data['feed'])) {
$registry = new JRegistry($data['feed']);
//$registry = new JRegistry($dataPh);
$dataFeed = $registry->toString();
if($dataFeed != '') {
$data['params_feed'] = $dataFeed;
}
} else {
$data['params_feed'] = '';
}
if (!empty($data['gift_types'])) {
$registry = new JRegistry($data['gift_types']);
$dataGiftTypes = $registry->toString();
if($dataGiftTypes != '') {
$data['gift_types'] = $dataGiftTypes;
}
} else {
$data['gift_types'] = '';
}
// Include the content plugins for the on save events.
JPluginHelper::importPlugin('content');
// Load the row if saving an existing record.
if ($pk > 0) {
$table->load($pk);
$isNew = false;
}
// Set product count for manufacturers (we need to recount obsolete data
and even new data - if manufacturer will be changed when saving, we need to
recount old data
$previousManufacturers = array();
if (!$isNew) {
$previousManufacturers =
PhocacartManufacturer::getManufacturers($data['id'], 1);
}
// Bind the data.
if (!$table->bind($data)) {
$this->setError($table->getError());
return false;
}
if(intval($table->date) == 0) {
$table->date = JFactory::getDate()->toSql();
}
if ($isNew) {
$table->created = JFactory::getDate()->toSql();
$table->created_by = isset($user->id) ? (int)$user->id: 0;
} else {
$table->modified = JFactory::getDate()->toSql();
$table->modified_by = isset($user->id) ? (int)$user->id: 0;
}
// if new item, order last in appropriate group
// Not used in multiple mode
//if (!$table->id) {
// $where = 'catid = ' . (int) $table->catid ;
// $table->ordering = $table->getNextOrder( $where );
//}
// Prepare the row for saving
$this->prepareTable($table);
// Check the data.
if (!$table->check()) {
$this->setError($table->getError());
return false;
}
// Trigger the onContentBeforeSave event.
/* $result =
\JFactory::getApplication()->triggerEvent('$this->event_before_save,
array($this->option.'.'.$this->name, $table, $isNew,
$data));
if (in_array(false, $result, true)) {
$this->setError($table->getError());
return false;
} */
// Trigger the before event.
JPluginHelper::importPlugin('pca');
$result =
\JFactory::getApplication()->triggerEvent('PCAonItemBeforeSave',
array('com_phocacart.item', &$table, $isNew, $data));
// Store the data.
if (in_array(false, $result, true) || !$table->store()) {
$this->setError($table->getError());
return false;
}
// Trigger the after save event.
\JFactory::getApplication()->triggerEvent('PCAonItemAfterSave',
array('com_phocacart.item', &$table, $isNew, $data));
// Test Thumbnails (Create if not exists)
if ($table->image != '') {
$thumb = PhocacartFileThumbnail::getOrCreateThumbnail($table->image,
'', 1, 1, 1, 0, 'productimage');
}
if ((int)$table->id > 0) {
$currentManufacturers = isset($data['manufacturer_id'])
&& (int)$data['manufacturer_id'] > 0 ? array(0 =>
(int)$data['manufacturer_id']) : array();
$allManufacturers = array_unique(array_merge($previousManufacturers,
$currentManufacturers));
PhocacartCount::setProductCount($allManufacturers,
'manufacturer', 1);// We need to recount all manufacturers -
previous (now deleted), and new
if (!isset($data['catid_multiple'])) {
$data['catid_multiple'] = array();
}
$previousCategories =
PhocacartCategoryMultiple::getCategories((int)$table->id, 1);
PhocacartCategoryMultiple::storeCategories($data['catid_multiple'],
(int)$table->id);
$allCategories = array_unique(array_merge($previousCategories,
$data['catid_multiple']));
PhocacartCount::setProductCount($allCategories, 'category',
1);// We need to recount all categories - previous (now deleted), and new
if (isset($data['featured'])) {
$this->featured((int)$table->id, $data['featured']);
}
$dataRelated = '';
if (!isset($data['related'])) {
$dataRelated = '';
} else {
$dataRelated = $data['related'];
if (isset($data['related'][0])) {
$dataRelated = $data['related'][0];
}
}
PhocacartRelated::storeRelatedItemsById($dataRelated, (int)$table->id
);
if (!isset($data['attributes'])) {
$data['attributes'] = array();
}
if (!isset($data['group'])) {
$data['group'] = array();
}
PhocacartFileAdditional::storeProductFilesByProductId((int)$table->id,
$data['additional_download_files']);
PhocacartImageAdditional::storeImagesByProductId((int)$table->id,
$data['additional_images']);
PhocacartAttribute::storeAttributesById((int)$table->id,
$data['attributes']);
PhocacartSpecification::storeSpecificationsById((int)$table->id,
$data['specifications']);
PhocacartDiscountProduct::storeDiscountsById((int)$table->id,
$data['discounts']);
//$pFormImg = $app->input->post->get('pformimg',
array(), 'array');
//PhocacartImageAdditional::storeImagesByProductId((int)$table->id,
$pFormImg);
//$pFormAttr = $app->input->post->get('pformattr',
array(), 'array');
//PhocacartAttribute::storeAttributesById((int)$table->id,
$pFormAttr);
//$pFormSpec = $app->input->post->get('pformspec',
array(), 'array');
//PhocacartSpecification::storeSpecificationsById((int)$table->id,
$pFormSpec);
//$pFormDisc = $app->input->post->get('pformdisc',
array(), 'array');
//PhocacartDiscountProduct::storeDiscountsById((int)$table->id,
$pFormDisc);
PhocacartGroup::storeGroupsById((int)$table->id, 3,
$data['group']);
PhocacartPriceHistory::storePriceHistoryById((int)$table->id,
$data['price']);
PhocacartGroup::updateGroupProductPriceById((int)$table->id,
$data['price']);
PhocacartGroup::updateGroupProductRewardPointsById((int)$table->id,
$data['points_received']);
// UPDATE this file too:
//
administrator\components\com_phocacart\libraries\phocacart\product\product.php
storeProduct() function
// TAGS
if (!isset($data['tags'])) {
$data['tags'] = array();
}
$previousTags = PhocacartTag::getTags((int)$table->id, 1);
PhocacartTag::storeTags($data['tags'], (int)$table->id);
$allTags = array_unique(array_merge($previousTags,
$data['tags']));
PhocacartCount::setProductCount($allTags, 'tag', 1);// We need
to update product count even for values which were removed when editing
($allTags)
// TAG LABELS
if (!isset($data['taglabels'])) {
$data['taglabels'] = array();
}
$previousLabels = PhocacartTag::getTagLabels((int)$table->id, 1);
PhocacartTag::storeTagLabels($data['taglabels'],
(int)$table->id);
$allLabels = array_unique(array_merge($previousLabels,
$data['taglabels']));
PhocacartCount::setProductCount($allLabels, 'label', 1);// We
need to update product count even for values which were removed when
editing ($allLabels)
// PARAMETERS
$parameters = PhocacartParameter::getAllParameters();
if (!empty($parameters)) {
foreach ($parameters as $kP => $vP) {
if (isset($vP->id) && (int)$vP->id > 0) {
$idP = (int)$vP->id;
if (empty($data['items_parameter'][$idP])) {
$data['items_parameter'][$idP] = array();
}
$previousParameterValues =
PhocacartParameter::getParameterValues((int)$table->id, $idP, 1);
PhocacartParameter::storeParameterValues($data['items_parameter'][$idP],
(int)$table->id, $idP);
$allParameterValues =
array_unique(array_merge($previousParameterValues,
$data['items_parameter'][$idP]));
PhocacartCount::setProductCount($allParameterValues,
'parameter', 1);
}
}
}
}
// Clean the cache.
$cache = JFactory::getCache($this->option);
$cache->clean();
// Trigger the onContentAfterSave event.
//\JFactory::getApplication()->triggerEvent('$this->event_after_save,
array($this->option.'.'.$this->name, $table, $isNew));
$pkName = $table->getKeyName();
if (isset($table->$pkName)) {
$this->setState($this->getName().'.id',
$table->$pkName);
}
$this->setState($this->getName().'.new', $isNew);
// ASSOCIATION
if ($this->associationsContext &&
\JLanguageAssociations::isEnabled() &&
!empty($data['associations'])) {
$associations = $data['associations'];
// Unset any invalid associations
$associations = Joomla\Utilities\ArrayHelper::toInteger($associations);
// Unset any invalid associations
foreach ($associations as $tag => $id) {
if (!$id){
unset($associations[$tag]);
}
}
// Show a warning if the item isn't assigned to a language but we
have associations.
if ($associations && $table->language === '*') {
\JFactory::getApplication()->enqueueMessage(
\JText::_(strtoupper($this->option) .
'_ERROR_ALL_LANGUAGE_ASSOCIATED'),
'warning'
);
}
// Get associationskey for edited item
$db = $this->getDbo();
$query = $db->getQuery(true)
->select($db->qn('key'))
->from($db->qn('#__associations'))
->where($db->qn('context') . ' = ' .
$db->quote($this->associationsContext))
->where($db->qn('id') . ' = ' . (int)
$table->$pkName);
$db->setQuery($query);
$old_key = $db->loadResult();
// Deleting old associations for the associated items
$query = $db->getQuery(true)
->delete($db->qn('#__associations'))
->where($db->qn('context') . ' = ' .
$db->quote($this->associationsContext));
if ($associations) {
$query->where('(' . $db->qn('id') . ' IN
(' . implode(',', $associations) . ') OR '
. $db->qn('key') . ' = ' . $db->q($old_key)
. ')');
} else {
$query->where($db->qn('key') . ' = ' .
$db->q($old_key));
}
$db->setQuery($query);
$db->execute();
// Adding self to the association
if ($table->language !== '*') {
$associations[$table->language] = (int) $table->$pkName;
}
if (count($associations) > 1) {
// Adding new association for these items
$key = md5(json_encode($associations));
$query = $db->getQuery(true)
->insert('#__associations');
foreach ($associations as $id) {
$query->values(((int) $id) . ',' .
$db->quote($this->associationsContext) . ',' .
$db->quote($key));
}
$db->setQuery($query);
$db->execute();
}
}
if ($app->input->get('task') ==
'editAssociations')
{
return $this->redirectToAssociations($data);
}
return true;
}
public function delete(&$cid = array()) {
if (count( $cid )) {
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$cids = implode( ',', $cid );
// Get all manufacturers from products which should be removed
so we can update count of products for manufacturers
$allManufacturers = PhocacartManufacturer::getManufacturersByIds($cids);
$table = $this->getTable();
if (!$this->canDelete($table)){
$error = $this->getError();
if ($error){
JLog::add($error, JLog::WARNING);
return false;
} else {
JLog::add(JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'),
JLog::WARNING);
return false;
}
}
// Find all downloadable files to remove them
$foldersP = PhocacartDownload::getProductDownloadFolderByProducts($cid);
$foldersA =
PhocacartDownload::getAttributeOptionDownloadFolderByProducts($cid);
// Will be deleted at the bottom if everything is OK
// 1. DELETE ITEMS
$query = 'DELETE FROM #__phocacart_products'
. ' WHERE id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 2. DELETE ATTRIBUTE OPTIONS
$query = 'SELECT id FROM #__phocacart_attributes WHERE product_id
IN ( '.$cids.' )';
$this->_db->setQuery($query);
$attrOptions = $this->_db->loadAssocList();
$attrArray = array();
if (!empty($attrOptions)) {
foreach($attrOptions as $k => $v) {
$attrArray[] = $v['id'];
}
if (!empty($attrArray)) {
$attrs = implode( ',', $attrArray );
$query = 'DELETE FROM #__phocacart_attribute_values'
. ' WHERE attribute_id IN ( '.$attrs.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
}
}
// 3. DELETE ATTRIBUTES
$query = 'DELETE FROM #__phocacart_attributes'
. ' WHERE product_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 4. DELETE RELATED
$query = 'DELETE FROM #__phocacart_product_related'
. ' WHERE product_a IN ( '.$cids.' ) OR product_b IN
('.$cids.')';
$this->_db->setQuery( $query );
$this->_db->execute();
// 5. DELETE FEATURED
$query = 'DELETE FROM #__phocacart_product_featured'
. ' WHERE product_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
$tableF = $this->getTable('PhocacartFeatured',
'Table');
$tableF->reorder();
// 6. DELETE IMAGES
$query = 'DELETE FROM #__phocacart_product_images'
. ' WHERE product_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 7. DELETE REVIEWS
$query = 'DELETE FROM #__phocacart_reviews'
. ' WHERE product_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 8. DELETE CATEGORY RELATIONSHIP
$allCategories =
PhocacartCategoryMultiple::getCategoriesByIds($cids);
$query = 'DELETE FROM #__phocacart_product_categories'
. ' WHERE product_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
PhocacartCount::setProductCount($allCategories, 'category',
1);
// 9. DELETE SPECIFICATIONS
$query = 'DELETE FROM #__phocacart_specifications'
. ' WHERE product_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 9. DELETE PRODUCT DISCOUNTS
$query = 'DELETE FROM #__phocacart_product_discounts'
. ' WHERE product_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 9. DELETE PRODUCT CUSTOMER GROUPS
$query = 'DELETE FROM #__phocacart_item_groups'
. ' WHERE item_id IN ( '.$cids.' )'
. ' AND type = 3';
$this->_db->setQuery( $query );
$this->_db->execute();
// 10. DELETE PRODUCT PRICE CUSTOMER GROUPS
$query = 'DELETE FROM #__phocacart_product_price_groups'
. ' WHERE product_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 11. DELETE PRODUCT POINT CUSTOMER GROUPS
$query = 'DELETE FROM #__phocacart_product_point_groups'
. ' WHERE product_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 12. DELETE PRODUCT ADDITIONAL FILES
$query = 'DELETE FROM #__phocacart_product_files'
. ' WHERE product_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 12. DELETE PRODUCT TAGS
$allTags = PhocacartTag::getTagsByIds($cids);// All these tags
will be influneced by deleting the item, so we need to recount the products
for tags then
$query = 'DELETE FROM #__phocacart_tags_related'
. ' WHERE item_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
PhocacartCount::setProductCount($allTags, 'tag', 1);
// 13. DELETE PRODUCT LABELS
$allLabels = PhocacartTag::getTagsLabelsByIds($cids);
$query = 'DELETE FROM #__phocacart_taglabels_related'
. ' WHERE item_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
PhocacartCount::setProductCount($allLabels, 'label', 1);
// 14. DELETE PRODUCT PARAMTERS
$allParameterValues =
PhocacartParameter::getParameterValuesByIds($cids);
$query = 'DELETE FROM #__phocacart_parameter_values_related'
. ' WHERE item_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
PhocacartCount::setProductCount($allParameterValues,
'parameter', 1);
// Recount all manufacturers which will be removed (after removing) so
the count will be updated
PhocacartCount::setProductCount($allManufacturers,
'manufacturer', 1);
// 16. DELETE ADVANCED STOCK ITEMS
$query = 'DELETE FROM #__phocacart_product_stock'
. ' WHERE product_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// Remove download folders
PhocacartFile::deleteDownloadFolders($foldersP,
'productfile');
PhocacartFile::deleteDownloadFolders($foldersA,
'attributefile');
}
return true;
}
protected function batchCopy($value, $pks, $contexts)
{
// Destination Category
$categoryId = (int) $value;
// Source Category (current category)
$app = JFactory::getApplication('administrator');
$currentCatid =
$app->input->post->get('filter_category_id', 0,
'int');
$batchParams = $app->input->post->get('batch',
array(), 'array');
$table = $this->getTable();
$db = $this->getDbo();
// Check that the category exists
if ($categoryId) {
$categoryTable = JTable::getInstance('PhocacartCategory',
'Table');
if (!$categoryTable->load($categoryId)) {
if ($error = $categoryTable->getError()) {
// Fatal error
$this->setError($error);
return false;
}
else {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_MOVE_CATEGORY_NOT_FOUND'));
return false;
}
}
}
if (empty($categoryId)) {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_MOVE_CATEGORY_NOT_FOUND'));
return false;
}
// Check that the user has create permission for the component
$extension =
JFactory::getApplication()->input->get('option');
$user = JFactory::getUser();
if (!$user->authorise('core.create', $extension)) {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_CREATE'));
return false;
}
//$i = 0;
// Parent exists so we let's proceed
while (!empty($pks))
{
// Pop the first ID off the stack
$pk = array_shift($pks);
$table->reset();
// Check that the row actually exists
if (!$table->load($pk)) {
if ($error = $table->getError()) {
// Fatal error
$this->setError($error);
return false;
}
else {
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
continue;
}
}
// Alter the title & alias
$data = $this->generateNewTitle($categoryId, $table->alias,
$table->title);
$table->title = $data['0'];
$table->alias = $data['1'];
$table->published = 0;// As default the copied new product is
unpublished
// Reset the ID because we are making a copy
$table->id = 0;
// New category ID
// $table->catid = $categoryId;
// Ordering
// $table->ordering = $this->increaseOrdering($categoryId);
$table->hits = 0;
$params['olddownloadfolder'] = $table->download_folder;
$params['newdownloadfolder'] =
$params['olddownloadfolder'];
// COPY OR BATCH functions - we cannot do the same tokens so create new
token and token folder and if set copy the files
// EACH DOWNLOAD FILE MUST HAVE UNIQUE DOWNLOAD TOKEN AND DOWNLOAD
FOLDER
$copy = 1;// When copying attributes or batch products we do a copy of
attributes (copy = 1) but in this case without copying download files on
the server
if (isset($batchParams['copy_download_files']) &&
$batchParams['copy_download_files'] == 1) {
$copy = 2;// The same like 1 but in this case we even copy the download
files on the server
}
if ($copy > 0) {
// First create new token and token folder
$table->download_token = PhocacartUtils::getToken();
$table->download_folder =
PhocacartUtils::getToken('folder');
$params['newdownloadfolder'] = $table->download_folder;
$pathFile = PhocacartPath::getPath('productfile');
if($copy == 2) {
// Download File
if ($table->download_file != '' &&
\Joomla\CMS\Filesystem\File::exists($pathFile['orig_abs_ds'] .
$table->download_file)) {
$newDownloadFile =
str_replace($params['olddownloadfolder'],
$table->download_folder, $table->download_file);
if
(!\Joomla\CMS\Filesystem\Folder::create($pathFile['orig_abs_ds']
. $table->download_folder)) {
// Error message will be set below:
COM_PHOCACART_ERROR_DOWNLOAD_FILE_OF_ATTRIBUTE_OPTION_DOES_NOT_EXIST
$msg = JText::_('COM_PHOCACART_DOWNLOAD_FOLDER') . ':
' . $table->download_folder . "<br />";
$msg .=
JText::_('COM_PHOCACART_ERROR_DOWNLOAD_FOLDER_NOT_CREATED');
$app->enqueueMessage($msg, 'error');
}
if
(!\Joomla\CMS\Filesystem\File::copy($pathFile['orig_abs_ds'] .
$table->download_file, $pathFile['orig_abs_ds'] .
$newDownloadFile)) {
$msg = JText::_('COM_PHOCACART_DOWNLOAD_FILE') . ':
' . $table->download_file . "<br />";
$msg .=
JText::_('COM_PHOCACART_ERROR_DOWNLOAD_FILE_NOT_COPIED');
$app->enqueueMessage($msg, 'error');
}
$table->download_file = $newDownloadFile;
}
// Additional Download Files
$downloadFiles =
PhocacartFileAdditional::getProductFilesByProductId($pk);
if(!empty($downloadFiles)) {
foreach($downloadFiles as $k => $v) {
if (isset($v['download_file']) &&
$v['download_file'] != '') {
$newDownloadFile =
str_replace($params['olddownloadfolder'],
$table->download_folder, $v['download_file']);
// In case download_file is emtpy we schould create the folder
if
(!\Joomla\CMS\Filesystem\Folder::exists($pathFile['orig_abs_ds']
. $table->download_folder)) {
if
(!\Joomla\CMS\Filesystem\Folder::create($pathFile['orig_abs_ds']
. $table->download_folder)) {
// Error message will be set below:
COM_PHOCACART_ERROR_DOWNLOAD_FILE_OF_ATTRIBUTE_OPTION_DOES_NOT_EXIST
$msg = JText::_('COM_PHOCACART_DOWNLOAD_FOLDER') .
': ' . $table->download_folder . "<br />";
$msg .=
JText::_('COM_PHOCACART_ERROR_DOWNLOAD_FOLDER_NOT_CREATED');
$app->enqueueMessage($msg, 'error');
}
}
if
(!\Joomla\CMS\Filesystem\File::copy($pathFile['orig_abs_ds'] .
$v['download_file'], $pathFile['orig_abs_ds'] .
$newDownloadFile)) {
$msg = JText::_('COM_PHOCACART_DOWNLOAD_FILE') . ':
' . $table->download_file . "<br />";
$msg .=
JText::_('COM_PHOCACART_ERROR_DOWNLOAD_FILE_NOT_COPIED');
$app->enqueueMessage($msg, 'error');
}
}
}
}
// Files copied on server, we will copy the database info below in
PhocacartUtilsBatchhelper::storeProductItems
} else {
$table->download_file = '';
}
}
// Check the row.
if (!$table->check()) {
$this->setError($table->getError());
return false;
}
// Store the row.
if (!$table->store()) {
$this->setError($table->getError());
return false;
}
$newId = $table->get('id');
// Add the new ID to the array
$newIds[$pk] = $newId;
// Store other new information
PhocacartUtilsBatchhelper::storeProductItems($pk, (int)$newId,
$batchParams, $params);
$dataCat[] = (int)$categoryId;// categoryId - the category where we
want to copy the products
// Copy all source categories
if (isset($batchParams['copy_all_cats']) &&
$batchParams['copy_all_cats'] == 1) {
$currentDataCat =
PhocacartCategoryMultiple::getAllCategoriesByProduct((int)$pk);// plus all
other categories of this product
// will be copied too
// 1) Bind categories - destination category + all categories from
source product (source product -> destination product)
$dataCat2 = array_merge($dataCat, $currentDataCat);
} else {
$dataCat2 = $dataCat;
}
// 2) Remove duplicates
$dataCat2 = array_unique($dataCat2);
/*
* Yes when copying - we duplicate the item intentionally
* // 3) Remove the source category - we copy product from source
category and the product is included in source category
// so don't copy it again to not get duplicates in the same
category*/
//
//
// $currentCatidA = array(0 => (int)$currentCatid);
// $dataCat2 = array_diff($dataCat2, $currentCatidA);
// PhocacartCategoryMultiple::storeCategories function does not delete
current category, so if we have removed it from array,
// we need to delete it from database too
//
PhocacartCategoryMultiple::deleteCategoriesFromProduct($currentCatidA,
(int)$newId);
// This is based on filtering in administration - if we display products
from category A, the A is $currentCatidA
// The following function does not delete source categories, it only
adds new so source categories needs to be deleted
PhocacartCategoryMultiple::storeCategories($dataCat2, (int)$newId);
//$i++;
}
// Clean the cache
$this->cleanCache();
return $newIds;
}
/**
* Batch move articles to a new category
*
* @param integer $value The new category ID.
* @param array $pks An array of row IDs.
*
* @return bool True if successful, false otherwise and internal error
is set.
*
* @since 11.1
*/
protected function batchMove($value, $pks, $contexts)
{
$categoryId = (int) $value;
$table = $this->getTable();
//$db = $this->getDbo();
// Check that the category exists
if ($categoryId) {
$categoryTable = JTable::getInstance('PhocacartCategory',
'Table');
if (!$categoryTable->load($categoryId)) {
if ($error = $categoryTable->getError()) {
// Fatal error
$this->setError($error);
return false;
}
else {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_MOVE_CATEGORY_NOT_FOUND'));
return false;
}
}
}
if (empty($categoryId)) {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_MOVE_CATEGORY_NOT_FOUND'));
return false;
}
// Check that user has create and edit permission for the component
$extension =
JFactory::getApplication()->input->get('option');
$user = JFactory::getUser();
if (!$user->authorise('core.create', $extension)) {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_CREATE'));
return false;
}
if (!$user->authorise('core.edit', $extension)) {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
// Parent exists so we let's proceed
foreach ($pks as $pk)
{
// Check that the row actually exists
if (!$table->load($pk)) {
if ($error = $table->getError()) {
// Fatal error
$this->setError($error);
return false;
}
else {
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
continue;
}
}
// Set the new category ID
// $table->catid = $categoryId;
// Check the row.
if (!$table->check()) {
$this->setError($table->getError());
return false;
}
// Store the row.
if (!$table->store()) {
$this->setError($table->getError());
return false;
}
$dataCat[] = (int)$categoryId;
PhocacartCategoryMultiple::storeCategories($dataCat,
(int)$table->id);
}
// Clean the cache
$this->cleanCache();
return true;
}
function recreate($cid = array(), &$message = '') {
if (count( $cid )) {
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$cids = implode( ',', $cid );
$query = 'SELECT a.id, a.image, a.title'.
' FROM #__phocacart_products AS a' .
' WHERE a.id IN ( '.$cids.' )';
$this->_db->setQuery($query);
$files = $this->_db->loadObjectList();
if (isset($files) && count($files)) {
$msg = array();
foreach($files as $k => $v) {
$title = isset($v->title) ? $v->title : '';
$title = JText::_('COM_PHOCACART_PRODUCT') . ' ' .
$v->title . ': ';
if (isset($v->image) && $v->image != '') {
$original = PhocacartFile::existsFileOriginal($v->image,
'productimage');
if (!$original) {
// Original does not exist - cannot generate new thumbnail
$msg[$k] = $title .
JText::_('COM_PHOCACART_FILEORIGINAL_NOT_EXISTS');
//return false;
continue;
}
// Delete old thumbnails
$deleteThubms =
PhocacartFileThumbnail::deleteFileThumbnail($v->image, 1, 1, 1,
'productimage');
if (!$deleteThubms) {
$msg[$k] = $title .
JText::_('COM_PHOCACART_ERROR_DELETE_THUMBNAIL');
//return false;
continue;
}
$createThubms =
PhocacartFileThumbnail::getOrCreateThumbnail($v->image, 0,
1,1,1,0,'productimage');
if (!$createThubms) {
$msg[$k] = $title .
JText::_('COM_PHOCACART_ERROR_WHILECREATINGTHUMB');
//return false;
continue;
}
// Additional images
if (isset($v->id) && (int)$v->id > 0) {
$query = 'SELECT a.image'.
' FROM #__phocacart_product_images AS a' .
' WHERE a.product_id ='.(int)$v->id;
$this->_db->setQuery($query);
$files2 = $this->_db->loadObjectList();
if (isset($files2) && count($files2)) {
foreach($files2 as $k2 => $v2) {
$original2 = PhocacartFile::existsFileOriginal($v2->image,
'productimage');
if (!$original2) {
// Original does not exist - cannot generate new thumbnail
//$message =
JText::_('COM_PHOCACART_FILEORIGINAL_NOT_EXISTS');
//return false;
continue;
}
// Delete old thumbnails
$deleteThubms2 =
PhocacartFileThumbnail::deleteFileThumbnail($v2->image, 1, 1, 1,
'productimage');
if (!$deleteThubms2) {
//$message =
JText::_('COM_PHOCACART_ERROR_DELETE_THUMBNAIL');
//return false;
continue;
}
$createThubms2 =
PhocacartFileThumbnail::getOrCreateThumbnail($v2->image, 0,
1,1,1,0,'productimage');
if (!$createThubms2) {
//$message =
JText::_('COM_PHOCACART_ERROR_WHILECREATINGTHUMB');
//return false;
continue;
}
}
}
}
} else {
$msg[$k] = $title .
JText::_('COM_PHOCACART_FILENAME_NOT_EXISTS');
//return false;
continue;
}
}
//$countMsg = count($msg);
$message = !empty($msg) ? implode('<br />', $msg) :
'';
} else {
$message = JText::_('COM_PHOCACART_ERROR_LOADING_DATA_DB');
return false;
}
} else {
$message = JText::_('COM_PHOCACART_ERROR_ITEM_NOT_SELECTED');
return false;
}
return true;
}
public function featured($pks, $value = 0) {
// Sanitize the ids.
$pks = (array) $pks;
\Joomla\Utilities\ArrayHelper::toInteger($pks);
if (empty($pks))
{
$this->setError(JText::_('COM_PHOCACART_NO_ITEM_SELECTED'));
return false;
}
$table = $this->getTable('PhocacartFeatured',
'Table');
try
{
$db = $this->getDbo();
$query = $db->getQuery(true)
->update($db->quoteName('#__phocacart_products'))
->set('featured = ' . (int) $value)
->where('id IN (' . implode(',', $pks) .
')');
$db->setQuery($query);
$db->execute();
if ((int) $value == 0)
{
// Adjust the mapping table.
// Clear the existing features settings.
$query = $db->getQuery(true)
->delete($db->quoteName('#__phocacart_product_featured'))
->where('product_id IN (' . implode(',',
$pks) . ')');
$db->setQuery($query);
$db->execute();
}
else
{
// first, we find out which of our new featured articles are already
featured.
$query = $db->getQuery(true)
->select('f.product_id')
->from('#__phocacart_product_featured AS f')
->where('product_id IN (' . implode(',', $pks)
. ')');
//echo $query;
$db->setQuery($query);
$old_featured = $db->loadColumn();
// we diff the arrays to get a list of the articles that are newly
featured
$new_featured = array_diff($pks, $old_featured);
// Featuring.
$tuples = array();
foreach ($new_featured as $pk)
{
$tuples[] = $pk . ', 0';
}
if (count($tuples))
{
$db = $this->getDbo();
$columns = array('product_id', 'ordering');
$query = $db->getQuery(true)
->insert($db->quoteName('#__phocacart_product_featured'))
->columns($db->quoteName($columns))
->values($tuples);
$db->setQuery($query);
$db->execute();
}
}
}
catch (Exception $e)
{
$this->setError($e->getMessage());
return false;
}
$table->reorder();
$this->cleanCache();
return true;
}
/* Multiple categories */
public function saveorder($pks = null, $order = null)
{
// PHOCAEDIT
//$table = $this->getTable();
$table = $this->getTable('PhocacartProductCategories',
'Table');
// CURRENT CATEGORY
$app = JFactory::getApplication('administrator');
$filter = $app->input->post->get('filter', array(),
'array');
$currentCatid = 0;
if (isset($filter['category_id'])) {
$currentCatid = (int)$filter['category_id'];
}
$tableClassName = get_class($table);
$contentType = new JUcmType;
$type = $contentType->getTypeByTable($tableClassName);
$tagsObserver =
$table->getObserverOfClass('JTableObserverTags');
$conditions = array();
if (empty($pks))
{
return
$app->enqueueMessage(JText::_($this->text_prefix.'_ERROR_NO_ITEMS_SELECTED'),
'error');
}
// Update ordering values
foreach ($pks as $i => $pk)
{
$table->load(array('product_id' => (int) $pk,
'category_id' => (int)$currentCatid));
// Access checks.
if (!$this->canEditState($table))
{
// Prune items that you can't change.
unset($pks[$i]);
JLog::add(JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'),
JLog::WARNING);
}
elseif ($table->ordering != $order[$i])
{
$table->ordering = $order[$i];
if ($type)
{
$this->createTagsHelper($tagsObserver, $type, $pk,
$type->type_alias, $table);
}
if (!$table->store())
{
$this->setError($table->getError());
return false;
}
// Remember to reorder within position and client_id
$condition = $this->getReorderConditions($table);
$found = false;
foreach ($conditions as $cond)
{
if ($cond[1] == $condition)
{
$found = true;
break;
}
}
if (!$found)
{
$key = $table->getKeyName();
//$conditions[] = array($table->$pkName,
$condition);
$conditions[] = array($table->$key, $condition);
}
}
}
// Execute reorder for each category.
foreach ($conditions as $cond)
{
$table->load(array('product_id' => (int) $cond[0],
'category_id' => (int)$currentCatid));
$table->reorder($cond[1]);
}
// Clear the component's cache
$this->cleanCache();
return true;
}
/*
protected function getReorderConditions($table = null) {
$condition = array();
$condition[] = 'catid = '. (int) $table->catid;
return $condition;
}
public function increaseOrdering($categoryId) {
$ordering = 1;
$this->_db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_products WHERE catid='.(int)$categoryId);
$max = $this->_db->loadResult();
$ordering = $max + 1;
return $ordering;
}*/
protected function getReorderConditions($table = null) {
$condition = array();
$condition[] = 'category_id = '. (int) $table->category_id ;
//$condition[] = 'product_id = '. (int) $table->product_id ;
return $condition;
}
public function increaseOrdering($categoryId) {
$ordering = 1;
$this->_db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_product_categories WHERE category_id='.(int)$categoryId);
$max = $this->_db->loadResult();
$ordering = $max + 1;
return $ordering;
}
protected function generateNewTitle($category_id, $alias, $title) {
$app = JFactory::getApplication('administrator');
$batchParams = $app->input->post->get('batch',
array(), 'array');
// Alter the title & alias
$table = $this->getTable();
// Product can be stored in different categories, so we ignore
"parent id - category" - each product will have new name
// not like standard new name for each category
while ($table->load(array('alias' => $alias))) {
// Skip creating unique name
if (isset($batchParams['skip_creating_unique_name'])
&& $batchParams['skip_creating_unique_name'] == 1) {
} else {
$title = StringHelper::increment($title);
}
$alias = StringHelper::increment($alias, 'dash');
}
return array($title, $alias);
}
public function copyattributes(&$cid = array(), $idSource = 0) {
$app = JFactory::getApplication('administrator');
$copy_attributes_download_files =
$app->input->post->get('copy_attributes_download_files',
0, 'int');
$copy = 1;// When copying attributes or batch products we do a copy of
attributes (copy = 1) but in this case without copying download files on
the server
if ($copy_attributes_download_files == 1) {
$copy = 2;// The same like 1 but in this case we even copy the download
files on the server, see: PhocacartAttribute::storeAttributesById() for
more info
}
$cA = 0;
if (count( $cid ) && (int)$idSource > 0) {
\Joomla\Utilities\ArrayHelper::toInteger($cid);
// Attributes
$aA = PhocacartAttribute::getAttributesById($idSource, 1);
if (!empty($aA)) {
foreach ($aA as $k => $v) {
if (isset($v['id']) && $v['id'] > 0) {
$oA = PhocacartAttribute::getOptionsById((int)$v['id'], 1);
if (!empty($oA)) {
$aA[$k]['options'] = $oA;
}
}
}
} else {
$app->enqueueMessage(JText::_('COM_PHOCACART_SELECTED_SOURCE_PRODUCT_DOES_NOT_HAVE_ANY_ATTRIBUTES'),
'error');
return false;
}
if (!empty($aA)) {
foreach($cid as $k => $v) {
if ((int)$v != $idSource) { // Do not copy to itself
PhocacartAttribute::storeAttributesById((int)$v, $aA, 1, $copy);
$cA++;
}
}
}
}
if ((int)$cA > 0) {
return true;
} else {
$app->enqueueMessage(JText::_('COM_PHOCACART_NO_ATTRIBUTE_COPIED'),
'error');
return false;
}
}
// ASSOCIATION/PARAMETERS
protected function preprocessForm(JForm $form, $data, $group =
'content'){
/*if ($this->canCreateCategory())
{
$form->setFieldAttribute('catid', 'allowAdd',
'true');
}*/
// Association Phoca Cart items
if (JLanguageAssociations::isEnabled()){
$languages = JLanguageHelper::getContentLanguages(false, true, null,
'ordering', 'asc');
if (count($languages) > 1){
$addform = new SimpleXMLElement('<form />');
$fields = $addform->addChild('fields');
$fields->addAttribute('name', 'associations');
$fieldset = $fields->addChild('fieldset');
$fieldset->addAttribute('name',
'item_associations');
foreach ($languages as $language)
{
$field = $fieldset->addChild('field');
$field->addAttribute('name', $language->lang_code);
$field->addAttribute('type',
'Modal_Phocacartitem');
$field->addAttribute('language',
$language->lang_code);
$field->addAttribute('label', $language->title);
$field->addAttribute('translate_label',
'false');
$field->addAttribute('select', 'true');
$field->addAttribute('new', 'true');
$field->addAttribute('edit', 'true');
$field->addAttribute('clear', 'true');
$field->addAttribute('propagate', 'true');
}
$form->load($addform, false);
}
}
// Load Feed Forms - by Plugin
$feedPlugins = PhocacartFeed::getFeedPluginMethods();
if (!empty($feedPlugins)) {
foreach ($feedPlugins as $k => $v) {
$element = htmlspecialchars($v->element, ENT_QUOTES,
'UTF-8');
$addformF = new SimpleXMLElement('<form />');
$fields = $addformF->addChild('fields');
$fields->addAttribute('name', 'feed');
//$fields->addAttribute('addfieldpath',
'associations');
$fieldset = $fields->addChild('fieldset');
$fieldset->addAttribute('name',
'feed_'.$element);
$fieldset->addAttribute('group', 'pcf');
$field = $fieldset->addChild('field');
$field->addAttribute('name', $element);
$field->addAttribute('type', 'subform');
$field->addAttribute('label',
JText::_(strtoupper($v->name)));
$field->addAttribute('multiple', 'false');
$field->addAttribute('layout',
'joomla.form.field.subform.default');
$field->addAttribute('formsource',
'plugins/pcf/'.$element.'/models/forms/item.xml');
$field->addAttribute('clear', 'true');
$field->addAttribute('propagate', 'true');
$form->load($addformF, false);
}
}
// Load Parameter Values for Parameters
$parameters = PhocacartParameter::getAllParameters();
if (count($parameters) > 0){
$addform = new SimpleXMLElement('<form />');
$fields = $addform->addChild('fields');
$fields->addAttribute('name', 'items_parameter');
$fieldset = $fields->addChild('fieldset');
$fieldset->addAttribute('name',
'items_parameter');
foreach ($parameters as $k => $v)
{
$field = $fieldset->addChild('field');
$field->addAttribute('name', $v->id);
$field->addAttribute('parameterid', $v->id);
$field->addAttribute('type',
'PhocaCartParameterValues');
//$field->addAttribute('language',
$language->lang_code);
$field->addAttribute('label', $v->title);
$field->addAttribute('multiple', 'true');
$field->addAttribute('translate_label',
'false');
$field->addAttribute('select', 'true');
$field->addAttribute('new', 'true');
$field->addAttribute('edit', 'true');
$field->addAttribute('clear', 'true');
$field->addAttribute('propagate', 'true');
}
$form->load($addform, false);
}
parent::preprocessForm($form, $data, $group);
}
}
?>
PK�"�[����9�9models/phocacartitems.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\Language\Text;
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.modellist' );
jimport( 'joomla.filesystem.folder' );
jimport( 'joomla.filesystem.file' );
class PhocaCartCpModelPhocaCartItems extends JModelList
{
protected $option = 'com_phocacart';
//protected $c = false;
protected $columns = array();
protected $columns_full = array();
public function __construct($config = array()) {
$paramsC = PhocacartUtils::getComponentParameters();
$c = new PhocacartRenderAdmincolumns();
$admin_columns_products =
$paramsC->get('admin_columns_products', 'sku=E, image,
title, published, categories, price=E, price_original=E, stock=E,
access_level, language, association, hits, id');
$admin_columns_products = explode(',',
$admin_columns_products);
$options = array();
$options['type'] = 'data';
$options['association'] = JLanguageAssociations::isEnabled();
if (!empty($admin_columns_products)) {
foreach ($admin_columns_products as $k => $v) {
$v = PhocacartText::parseDbColumnParameter($v);
$data = $c->header($v, $options);
if (isset($data['column']) &&
$data['column'] != '') {
$this->columns[] = $data['column'];
$this->columns_full[] = $data;
}
}
}
// Add ordering and fields needed for filtering (search tools)
$config['filter_fields'] =
array_merge(array('pc.ordering', 'category_id',
'manufacturer_id', 'published', 'language'),
$this->columns);
//$config['filter_fields'][] = 'pc.ordering';
/*if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'category_id', 'category_id',
'state', 'a.state',
'access', 'a.access', 'access_level',
'ordering', 'pc.ordering',
'language', 'a.language',
'hits', 'a.hits',
'date', 'a.date',
'published','a.published',
'image', 'a.image',
'price', 'a.price',
'price_original', 'a.price_original',
'stock', 'a.stock',
'sku', 'a.sku'
);
// ASSOCIATION
$assoc = JLanguageAssociations::isEnabled();
if ($assoc){
$config['filter_fields'][] =
'association';
}
}*/
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC')
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
// ASSOCIATION
$forcedLanguage =
$app->input->get('forcedLanguage', '',
'cmd');
// Adjust the context to support modal layouts.
if ($layout = $app->input->get('layout')) {
$this->context .= '.' . $layout;
}
// Adjust the context to support forced languages.
if ($forcedLanguage){
$this->context .= '.' . $forcedLanguage;
}
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
$accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
$categoryId =
$app->getUserStateFromRequest($this->context.'.filter.category_id',
'filter_category_id', null);
$this->setState('filter.category_id', $categoryId);
$categoryId =
$app->getUserStateFromRequest($this->context.'.filter.manufacturer_id',
'filter_manufacturer_id', null);
$this->setState('filter.manufacturer_id', $categoryId);
$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
// ASSOCIATION
if (!empty($forcedLanguage)) {
$this->setState('filter.language',
$forcedLanguage);
}
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.category_id');
$id .=
':'.$this->getState('filter.manufacturer_id');
$id .=
':'.$this->getState('filter.language');
$id .= ':'.$this->getState('filter.item_id');
return parent::getStoreId($id);
}
protected function getListQuery()
{
$paramsC = PhocacartUtils::getComponentParameters();
$search_matching_option_admin = $paramsC->get(
'search_matching_option_admin', 'exact' );
$db = $this->getDbo();
$query = $db->getQuery(true);
// Needed columns everytime
$col = array();
$col[] = 'a.id';
$col[] = 'a.title';
$col[] = 'a.alias';
$col[] = 'a.alias';
$col[] = 'a.checked_out';
$col[] = 'a.checked_out_time';
$col[] = 'a.published';
$col[] = 'a.ordering';
$col[] = 'a.featured';
$col[] = 'a.language';
$col = array_merge($col, $this->columns);
$col = array_unique($col);
$columns = 'DISTINCT ' .implode(',', $col);
// GROUP BY not used
//$groupsFull = $columns . ', ' .'a.tax_id,
a.manufacturer_id, a.description, l.title, uc.name, ag.title';
//$groupsFast = 'a.id';
//$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
$query->select($this->getState('list.select', $columns));
$query->from('`#__phocacart_products` AS a');
// Join over the language
$query->select('l.title AS language_title, l.image AS
language_image');
$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id =
a.access');
// Join over the categories.
// They are more ways to get the info about categories
// 1) GROUP BY + GROUP_CONCAT - slow, when only_full_group_by rule is
used - much more slower than slow
// 2) SUBQUERIES - faster even they look complicated
// 3) SPECIFIC QUERY used in view:
PhocacartCategoryMultiple::getCategoriesByProducts($idItems) (no loop used)
DISTINCT needs to be used
/*
* GROUP BY
$query->select('GROUP_CONCAT(c.title) AS category_title,
GROUP_CONCAT(c.id) AS category_id');
$query->join('LEFT', '#__phocacart_product_categories
AS pc ON a.id = pc.product_id');
$query->join('LEFT', '#__phocacart_categories AS c ON
c.id = pc.category_id');
* SUBQUERIES
$query->select('(SELECT GROUP_CONCAT(c.id) FROM
jos_phocacart_product_categories AS pc
LEFT JOIN jos_phocacart_categories AS c ON c.id = pc.category_id
WHERE a.id = pc.product_id) AS category_id');
$query->select('(SELECT GROUP_CONCAT(c.title) FROM
jos_phocacart_product_categories AS pc
LEFT JOIN jos_phocacart_categories AS c ON c.id = pc.category_id
WHERE a.id = pc.product_id) AS category_title');
$query->select('(SELECT GROUP_CONCAT(c.id, ":",
c.title) FROM jos_phocacart_product_categories AS pc
LEFT JOIN jos_phocacart_categories AS c ON c.id = pc.category_id
WHERE a.id = pc.product_id) AS category_title');
*/
// Not used
//$query->select("group_concat(c.id, '|^|', c.alias,
'|^|', c.title SEPARATOR '|~|') as categories");
//$query->select('v.average AS ratingavg');
//$query->join('LEFT',
'#__phocadownload_img_votes_statistics AS v ON v.imgid = a.id');
// ASSOCIATION
// Join over the associations.
$assoc = JLanguageAssociations::isEnabled();
if ($assoc) {
$query->select('COUNT(' .
$db->quoteName('asso2.id') . ') > 1 as ' .
$db->quoteName('association'))
->join(
'LEFT',
$db->quoteName('#__associations',
'asso') . ' ON ' .
$db->quoteName('asso.id') . ' = ' .
$db->quoteName('a.id')
. ' AND ' .
$db->quoteName('asso.context') . ' = ' .
$db->quote('com_phocacart.item')
)
->join(
'LEFT',
$db->quoteName('#__associations',
'asso2') . ' ON ' .
$db->quoteName('asso2.key') . ' = ' .
$db->quoteName('asso.key')
)
->group(
$db->quoteName(
array(
'a.id',
'a.title',
'a.alias',
'a.checked_out',
'a.checked_out_time',
'a.published',
'a.access',
'a.ordering',
'a.featured',
'a.language',
'l.title' ,
'l.image' ,
'uc.name' ,
'ag.title'
)
)
);
}
// Filter by access level.
if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// When category is selected, we need to get info about selected category
// When it is not selected, don't ask for it to make the query
faster
// pc.ordering is set as default ordering and it can be set (even
igonered) even whey category not selected
// is complicated but loads much faster
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$categoryId = $this->getState('filter.category_id');
// Filter by category.
if ($orderCol == 'pc.ordering' || is_numeric($categoryId)) {
// Ask only when really needed
$query->select('pc.ordering');
$query->join('LEFT', '#__phocacart_product_categories
AS pc ON a.id = pc.product_id');
$query->join('LEFT', '#__phocacart_categories AS c ON
c.id = pc.category_id');
}
if (is_numeric($categoryId)) {
//$query->where('a.catid = ' . (int) $categoryId);
$query->where('pc.category_id = ' . (int) $categoryId);
}
$manufacturerId = $this->getState('filter.manufacturer_id');
if (is_numeric($manufacturerId)) {
$query->join('LEFT', '#__phocacart_manufacturers AS pm
ON pm.id = a.manufacturer_id');
$query->where('a.manufacturer_id = ' . (int)
$manufacturerId);
}
// Filter on the language.
if ($language = $this->getState('filter.language')) {
$query->where('a.language = ' . $db->quote($language));
}
// Search EAN, SKU in attributes (advanced stock management)
$query->join('LEFT', '#__phocacart_product_stock AS ps
ON a.id = ps.product_id');
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
switch ($search_matching_option_admin) {
case 'all':
case 'any':
$words = explode(' ', $search);
$wheres = array();
foreach ($words as $word) {
if (!$word = trim($word)) {
continue;
}
$word = $db->quote('%'.$db->escape($word,
true).'%', false);
$wheresSub = array();
$wheresSub[] = 'a.title LIKE '.$word;
$wheresSub[] = 'a.alias LIKE '.$word;
$wheresSub[] = 'a.metakey LIKE '.$word;
$wheresSub[] = 'a.metadesc LIKE '.$word;
$wheresSub[] = 'a.description LIKE '.$word;
$wheresSub[] = 'a.sku LIKE '.$word;
$wheresSub[] = 'a.ean LIKE '.$word;
$wheresSub[] = 'ps.sku LIKE '.$word;
$wheresSub[] = 'ps.ean LIKE '.$word;
$wheres[] = implode(' OR ', $wheresSub);
}
$query->where('(' .
implode(($search_matching_option_admin == 'all' ? ') AND
(' : ') OR ('), $wheres) . ')');
break;
case 'exact':
default:
$text = $db->quote('%'.$db->escape($search,
true).'%', false);
$wheresSub = array();
$wheresSub[] = 'a.title LIKE '.$text;
$wheresSub[] = 'a.alias LIKE '.$text;
$wheresSub[] = 'a.metakey LIKE '.$text;
$wheresSub[] = 'a.metadesc LIKE '.$text;
$wheresSub[] = 'a.description LIKE '.$text;
$wheresSub[] = 'a.sku LIKE '.$text;
$wheresSub[] = 'a.ean LIKE '.$text;
$wheresSub[] = 'ps.sku LIKE '.$text;
$wheresSub[] = 'ps.ean LIKE '.$text;
$query->where('(' . implode(') OR (',
$wheresSub) . ')');
break;
}
}
}
//- $query->group($groups);
// Add the list ordering clause.
//$orderCol = $this->state->get('list.ordering',
'title');
//$orderDirn = $this->state->get('list.direction',
'asc');
//if ($orderCol == 'pc.ordering' || $orderCol ==
'category_title') {
//$orderCol = 'category_title '.$orderDirn.',
pc.ordering';
//}
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
public function getFilterForm($data = array(), $loadData = true)
{
$form = parent::getFilterForm($data, $loadData);
if ($form) {
$field = $form->getField('fullordering', 'list');
if (!empty($this->columns_full)) {
foreach ($this->columns_full as $k => $v) {
if (isset($v['column']) && $v['column'] !=
'') {
//$field->addOption(Text::_($data['title'].
'_ASC'), array('value' => $data['column']
. ' ASC'));
//$field->addOption(Text::_($data['title'].
'_DESC'), array('value' => $data['column']
. ' DESC'));
// Save hundreds of strings in translation
// DEBUG Language can mark it as not translated erroneously
$field->addOption(Text::_($v['title']). ' ' .
Text::_('COM_PHOCACART_ASCENDING'), array('value' =>
$v['column'] . ' ASC'));
$field->addOption(Text::_($v['title']). ' ' .
Text::_('COM_PHOCACART_DESCENDING'), array('value'
=> $v['column'] . ' DESC'));
}
}
}
}
return $form;
}
}
?>
PK�"�[q�==models/phocacartlog.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartLog extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
public function getTable($type = 'PhocacartLog', $prefix =
'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartlog',
'phocacartlog', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData()
{
// Check the session for previously entered form data.
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartlog.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table)
{
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_logs');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
}
?>PK�"�[��W-HHmodels/phocacartlogs.phpnu�[���<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
version 2 or later;
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartLogs extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'user_id','a.user_id',
'type_id', 'a.type_id',
'type', 'a.type',
'priority', 'a.priority',
'status', 'a.status',
'ip', 'a.ip',
'incoming_page', 'a.incoming_page',
'description', 'a.description',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'status', 'status',
'date', 'a.date',
'ordering', 'a.ordering',
'language', 'a.language',
'published','a.published',
'user_username'
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.date',
$direction = 'DESC')
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.log_id');
return parent::getStoreId($id);
}
protected function getListQuery()
{
// Create a new query object.
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_logs` AS a');
$query->select('u.name AS user_name, u.username AS
user_username');
$query->join('LEFT', '#__users AS u ON
u.id=a.user_id');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering',
'date');
$orderDirn = $this->state->get('list.direction',
'asc');
/*if ($orderCol != 'a.id') {
$orderCol = 'a.id';
}*/
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[����models/phocacartmanager.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport('joomla.application.component.modeladmin');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
class PhocaCartCpModelPhocaCartManager extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
public function getTable($type = 'PhocacartCategory', $prefix =
'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$form = $this->loadForm('com_phocacart.phocacartmanager',
'phocacartmanager', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$data =
JFactory::getApplication()->getUserState('com_phocacartm.edit.phocacartmanager.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
function getFolderState($property = null) {
static $set;
if (!$set) {
$app = JFactory::getApplication();
$session = JFactory::getSession();
// Folder = false - is not set, there is a way for session
// Folder = '' - empty/root - is not set but means a root - no
way for session
$folder = $app->input->get( 'folder', false,
'path' );
$upload = $app->input->get( 'upload', '',
'int' );
$manager = $app->input->get( 'manager', '',
'path' );
// ============ START Folder based on session - possible FR - add to
parameters
$sessionNameCurrentFolder =
'phocacartmanagercurrentfolder.'.$manager;
if ($folder === false) {
// Nothing set, try to use the value from session
if ($session->get($sessionNameCurrentFolder, '') !=
'') {
$folder = $session->get($sessionNameCurrentFolder, '');
}
} else if($folder != '') {
// Folder is set, store it to session
$session->set($sessionNameCurrentFolder, $folder);
} else if ($folder === '') {
// we are in root - no folder, no session, clear the session
$session->clear($sessionNameCurrentFolder);
}
// ============ END Folder based on session
$this->setState('folder', $folder);
$this->setState('manager', $manager);
$parent = str_replace("\\", "/", dirname($folder));
$parent = ($parent == '.') ? null : $parent;
$this->setState('parent', $parent);
$set = true;
}
return parent::getState($property);
}
function getFiles() {
$list = $this->getList();
return $list['files'];
}
function getFolders() {
$list = $this->getList();
return $list['folders'];
}
function getList() {
static $list;
$params = PhocacartUtils::getComponentParameters();
// Only process the list once per request
if (is_array($list)) {
return $list;
}
// Get current path from request
$current = $this->getState('folder');
// If undefined, set to empty
if ($current == 'undefined') {
$current = '';
}
// File Manager, Icon Manager
$manager = $this->getState('manager');
if ($manager == 'undefined') {
$manager = '';
}
$path = PhocacartPath::getPath($manager);
$group = PhocacartUtilsSettings::getManagerGroup($manager);
// Initialize variables
if (strlen($current) > 0) {
$orig_path = $path['orig_abs_ds'].$current;
} else {
$orig_path = $path['orig_abs_ds'];
}
$orig_path_server = str_replace('\\', '/',
$path['orig_abs'] .'/');
// Absolute Path defined by user
$absolutePath = $params->get('absolute_path', '');
$absolutePath = str_replace('\\', '/',
$absolutePath);
// Be aware - absolute path is not set for images folder and for preview
and play folder - see documentation
if ($absolutePath != '' && $group['f'] == 1)
{
$orig_path_server = str_replace('\\', '/',
JPath::clean($absolutePath .'/') );//$absolutePath ;
}
$files = array ();
$folders = array ();
// Get the list of files and folders from the given folder
$file_list = JFolder::files($orig_path);
if ($group['i'] == 1) {
$folder_list = JFolder::folders($orig_path, '', false, false,
array(0 => 'thumbs'));
} else {
$folder_list = JFolder::folders($orig_path, '', false, false,
array());
}
// Iterate over the files if they exist
//file - abc.img, file_no - folder/abc.img
if ($file_list !== false) {
foreach ($file_list as $file) {
if (is_file($orig_path.'/'.$file) && substr($file, 0,
1) != '.' && strtolower($file) !==
'index.html') {
$tmp = new JObject();
$tmp->name = basename($file);
$tmp->path_with_name = str_replace('\\',
'/', JPath::clean($orig_path . '/' . $file));
$tmp->path_without_name_relative= $path['orig_rel_ds'] .
str_replace($orig_path_server, '', $tmp->path_with_name);
$tmp->path_with_name = str_replace('\\',
'/', JPath::clean($orig_path . '/' . $file));
$tmp->path_with_name_relative_no= str_replace($orig_path_server,
'', $tmp->path_with_name);
$files[] = $tmp;
}
}
}
// Iterate over the folders if they exist
if ($folder_list !== false) {
foreach ($folder_list as $folder)
{
$tmp = new JObject();
$tmp->name = basename($folder);
$tmp->path_with_name = str_replace('\\', '/',
JPath::clean($orig_path . '/' . $folder));
$tmp->path_without_name_relative= $path['orig_rel_ds'] .
str_replace($orig_path_server, '', $tmp->path_with_name);
$tmp->path_with_name_relative_no= str_replace($orig_path_server,
'', $tmp->path_with_name);
$folders[] = $tmp;
}
}
$list = array('folders' => $folders, 'files' =>
$files);
return $list;
}
}
?>
PK�"�[�^, .
.
models/phocacartmanufacturer.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartManufacturer extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record) {
return parent::canDelete($record);
}
protected function canEditState($record) {
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartManufacturer',
$prefix = 'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form =
$this->loadForm('com_phocacart.phocacartmanufacturer',
'phocacartmanufacturer', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartmanufacturer.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_manufacturers');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
public function save($data) {
if (parent::save($data)) {
$savedId =
$this->getState($this->getName().'.id');
if ((int)$savedId > 0) {
PhocacartCount::setProductCount(array(0 =>
(int)$savedId), 'manufacturer', 1);
}
return true;
} else {
return false;
}
}
}
?>
PK�"�[J^"n!models/phocacartmanufacturers.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartManufacturers extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
'count_products', 'a.count_products'
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .=
':'.$this->getState('filter.manufacturer_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_manufacturers` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[J��e�/�/models/phocacartorder.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartOrder extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected $fieldsbas; //Billing and Shipping
// Billing and Shipping
public function getFieldsBaS(){
if (empty($this->fieldsbas)) {
$this->fieldsbas = PhocacartFormUser::getFormXml('_phb',
'_phs', 1, 1, 0);
}
return $this->fieldsbas;
}
public function getFormBas($orderId) {
$options = array('control' => 'jform',
'load_data' => true);
$options['control'] =
\Joomla\Utilities\ArrayHelper::getValue($options, 'control',
false);
JForm::addFormPath(JPATH_COMPONENT . '/models/forms');
JForm::addFieldPath(JPATH_COMPONENT . '/models/fields');
JForm::addFormPath(JPATH_COMPONENT . '/model/form');
JForm::addFieldPath(JPATH_COMPONENT . '/model/field');
try {
$form = JForm::getInstance('com_phocacart.order.bas',
(string)$this->fieldsbas['xml'], $options, false, false);
$order= new PhocacartOrderView();
$data = $order->getItemBaS($orderId);
$this->preprocessForm($form, $data);
$form->bind($data);
} catch (Exception $e) {
$this->setError($e->getMessage());
return false;
}
if (empty($form)) {
return false;
}
return $form;
}
/* Order table */
protected function canDelete($record) {
return parent::canDelete($record);
}
protected function canEditState($record) {
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartOrder', $prefix =
'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartorder',
'phocacartorder', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartorder.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table) {
$table->currency_exchange_rate =
PhocacartUtils::replaceCommaWithPoint($table->currency_exchange_rate);
}
public function save($data) {
$app = JFactory::getApplication();
if (!JSession::checkToken('request')) {
$app->enqueueMessage('Invalid Token', 'message');
return false;
}
$order = new PhocacartOrder();
$jform = $app->input->get('jform', array(),
'array');
$pform = $app->input->get('pform', array(),
'array');
$aform = $app->input->get('aform', array(),
'array');
$tform = $app->input->get('tform', array(),
'array');
$dform = $app->input->get('dform', array(),
'array');
$tcform = $app->input->get('tcform', array(),
'array');
// Shipping, Billing
if(!empty($jform)) {
// Form Data
$billing = array();
$shipping = array();
foreach($jform as $k => &$v) {
$posB = strpos($k, '_phb');
if ($posB === false) {
} else {
$k = str_replace('_phb', '', $k);
$billing[$k] = $v;
}
$posS = strpos($k, '_phs');
if ($posS === false) {
} else {
$k = str_replace('_phs', '', $k);
$shipping[$k] = $v;
}
}
$billingO = $this->storeOrderAddress($billing);
$shippingO = $this->storeOrderAddress($shipping);
}
// Products
if (!empty($pform)) {
foreach ($pform as $k => $v) {
$v['id'] = $k;
if (isset($v['published'])) {
$v['published'] = 1;
} else {
$v['published'] = 0;
}
$product = $this->storeOrderProducts($v);
}
}
// Attributes
if (!empty($aform)) {
foreach ($aform as $k => $v) {
$v['id'] = $k;
$attribute = $this->storeOrderAttributes($v);
}
}
// Discount Products
if (!empty($dform)) {
foreach ($dform as $k => $v) {
$v['id'] = $k;
if (isset($v['published'])) {
$v['published'] = 1;
} else {
$v['published'] = 0;
}
$discount = $this->storeOrderProductDiscounts($v);
}
}
// Total
if (!empty($tform)) {
foreach ($tform as $k => $v) {
$v['id'] = $k;
if (isset($v['published'])) {
$v['published'] = 1;
} else {
$v['published'] = 0;
}
$total = $this->storeOrderTotal($v);
}
}
// Tax Recapitulation
if (!empty($tcform)) {
foreach ($tcform as $k => $v) {
$v['id'] = $k;
$tc = $this->storeOrderTaxRecapitulation($v);
}
}
// Main table
$table = $this->getTable();
$pk = (!empty($data['id'])) ? $data['id'] :
(int)$this->getState($this->getName().'.id');
$isNew = true;
$currentStatus = 0;
$newStatus = $data['status_id'];
if ($pk > 0) {
$table->load($pk);
if (isset($table->status_id) && (int)$table->status_id
> 0) {
$currentStatus = (int)$table->status_id;
}
$isNew = false;
} else {
$app->enqueueMessage('Wrong ID', 'message');
return false;
}
if (!$table->bind($data)) {
$this->setError($table->getError());
return false;
}
$table->modified = JFactory::getDate()->toSql();
$date = $table->date;
$this->prepareTable($table);
if (!$table->check()) {
$this->setError($table->getError());
return false;
}
if (!$table->store()) {
$this->setError($table->getError());
return false;
}
// Change status only if it really changed when editing
if ((int)$currentStatus == (int)$newStatus) {
// Status still the same, don't send email, don't change
history
} else {
// Set invoice data in case status can set invoice ID (before notify)
PhocacartOrder::storeOrderReceiptInvoiceId((int)$data['id'],
$date, (int)$data['status_id'], array('I'));
$notify =
PhocacartOrderStatus::changeStatus((int)$data['id'],
(int)$data['status_id']);// Notify user, notify others, emails
send - will be decided in function
$comment = JText::_('COM_PHOCACART_ORDER_EDITED');
// Store the history
PhocacartOrderStatus::setHistory((int)$data['id'],
(int)$data['status_id'], (int)$notify, $comment);
}
$cache = JFactory::getCache($this->option);
$cache->clean();
$pkName = $table->getKeyName();
if (isset($table->$pkName)) {
$this->setState($this->getName().'.id',
$table->$pkName);
}
$this->setState($this->getName().'.new', $isNew);
return true;
}
public function storeOrderProducts($d) {
$row = JTable::getInstance('PhocacartOrderProducts',
'Table', array());
$d['netto'] =
PhocacartUtils::replaceCommaWithPoint($d['netto']);
$d['tax'] =
PhocacartUtils::replaceCommaWithPoint($d['tax']);
$d['brutto'] =
PhocacartUtils::replaceCommaWithPoint($d['brutto']);
if (!$row->bind($d)) {
throw new Exception($db->getErrorMsg());
return false;
}
if (!$row->check()) {
throw new Exception($row->getError());
return false;
}
if (!$row->store()) {
throw new Exception($row->getError());
return false;
}
}
public function storeOrderAttributes($d) {
$row = JTable::getInstance('PhocacartOrderAttributes',
'Table', array());
$d['option_value'] = urlencode($d['option_value']);
if (!$row->bind($d)) {
throw new Exception($db->getErrorMsg());
return false;
}
if (!$row->check()) {
throw new Exception($row->getError());
return false;
}
if (!$row->store()) {
throw new Exception($row->getError());
return false;
}
}
public function storeOrderTotal($d) {
$row = JTable::getInstance('PhocacartOrderTotal',
'Table', array());
$d['amount'] =
PhocacartUtils::replaceCommaWithPoint($d['amount']);
if (!$row->bind($d)) {
throw new Exception($db->getErrorMsg());
return false;
}
if (!$row->check()) {
throw new Exception($row->getError());
return false;
}
if (!$row->store()) {
throw new Exception($row->getError());
return false;
}
}
public function storeOrderTaxRecapitulation($d) {
$row = JTable::getInstance('PhocacartOrderTaxRecapitulation',
'Table', array());
$d['amount_netto'] =
PhocacartUtils::replaceCommaWithPoint($d['amount_netto']);
$d['amount_tax'] =
PhocacartUtils::replaceCommaWithPoint($d['amount_tax']);
$d['amount_brutto'] =
PhocacartUtils::replaceCommaWithPoint($d['amount_brutto']);
if (isset($d['amount_brutto_currency'])) {
$d['amount_brutto_currency'] =
PhocacartUtils::replaceCommaWithPoint($d['amount_brutto_currency']);
}
if (!$row->bind($d)) {
throw new Exception($db->getErrorMsg());
return false;
}
if (!$row->check()) {
throw new Exception($row->getError());
return false;
}
if (!$row->store()) {
throw new Exception($row->getError());
return false;
}
}
public function storeOrderAddress($d) {
$row = JTable::getInstance('PhocacartOrderUsers',
'Table', array());
if (!$row->bind($d)) {
throw new Exception($db->getErrorMsg());
return false;
}
if (!$row->check()) {
throw new Exception($row->getError());
return false;
}
if (!$row->store()) {
throw new Exception($row->getError());
return false;
}
}
public function storeOrderProductDiscounts($d) {
$row = JTable::getInstance('PhocacartOrderProductDiscounts',
'Table', array());
$d['netto'] =
PhocacartUtils::replaceCommaWithPoint($d['netto']);
$d['tax'] =
PhocacartUtils::replaceCommaWithPoint($d['tax']);
$d['brutto'] =
PhocacartUtils::replaceCommaWithPoint($d['brutto']);
if (!$row->bind($d)) {
throw new Exception($db->getErrorMsg());
return false;
}
if (!$row->check()) {
throw new Exception($row->getError());
return false;
}
if (!$row->store()) {
throw new Exception($row->getError());
return false;
}
}
function delete(&$cid = array()) {
if (count( $cid )) {
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$cids = implode( ',', $cid );
// 1. DELETE ITEMS
$query = 'DELETE FROM #__phocacart_orders'
. ' WHERE id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 2. DELETE ATTRIBUTES
$query = 'DELETE FROM #__phocacart_order_attributes'
. ' WHERE order_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 3. DELETE DISCOUNTS
$query = 'DELETE FROM #__phocacart_order_discounts'
. ' WHERE order_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 4. DELETE COUPONS
$query = 'DELETE FROM #__phocacart_order_coupons'
. ' WHERE order_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 5. DELETE DOWNLOADS
$query = 'DELETE FROM #__phocacart_order_downloads'
. ' WHERE order_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 6. DELETE HISTORY
$query = 'DELETE FROM #__phocacart_order_history'
. ' WHERE order_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 7. DELETE PRODUCTS
$query = 'DELETE FROM #__phocacart_order_products'
. ' WHERE order_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 8. DELETE PRODUCT Discounts
$query = 'DELETE FROM #__phocacart_order_product_discounts'
. ' WHERE order_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 9. DELETE TOTAL
$query = 'DELETE FROM #__phocacart_order_total'
. ' WHERE order_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 10. DELETE RECAPITULATION
$query = 'DELETE FROM #__phocacart_order_tax_recapitulation'
. ' WHERE order_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 11. DELETE USERS
$query = 'DELETE FROM #__phocacart_order_users'
. ' WHERE order_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
}
return true;
}
}
?>
PK�"�[���models/phocacartorders.phpnu�[���<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
version 2 or later;
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartOrders extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'order_number', 'order_number',
'user_username','user_username',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'status_id', 'a.status_id',
'date', 'a.date',
'total_amount', 'total_amount',
'modified', 'a.modified',
'ordering', 'a.ordering',
'language', 'a.language',
//z'hits', 'a.hits',
'published','a.published'
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.date',
$direction = 'DESC')
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
$this->setState('filter.language', $language);
$status =
$app->getUserStateFromRequest($this->context.'.filter.status_id',
'filter_status_id', '');
$this->setState('filter.status_id', $status);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.order_id');
$id .= ':'.$this->getState('filter.status_id');
return parent::getStoreId($id);
}
protected function getListQuery()
{
// Create a new query object.
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*, a.id as ordernumber'
)
);
$query->from('`#__phocacart_orders` AS a');
$query->select('u.name AS user_name, u.username AS
user_username');
$query->join('LEFT', '#__users AS u ON
u.id=a.user_id');
$query->select('uv.name AS vendor_name, uv.username AS
vendor_username');
$query->join('LEFT', '#__users AS uv ON
uv.id=a.vendor_id');
$query->select('sc.title AS section_name');
$query->join('LEFT', '#__phocacart_sections AS sc ON
sc.id=a.section_id');
$query->select('un.title AS unit_name');
$query->join('LEFT', '#__phocacart_units AS un ON
un.id=a.unit_id');
$query->select('os.title AS status_title');
$query->join('LEFT', '#__phocacart_order_statuses AS os
ON os.id = a.status_id');
$query->select('t.amount AS total_amount, t.amount_currency AS
total_amount_currency');
$query->join('LEFT', '#__phocacart_order_total AS t ON
a.id = t.order_id');
$query->where('(t.type =
'.$db->quote('brutto').' OR t.type = \'\'
OR t.type IS NULL)');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Search users in orders
$query->join('LEFT', '#__phocacart_order_users AS us0
ON a.id=us0.order_id AND us0.type = 0');// search in billing address
$query->join('LEFT', '#__phocacart_order_users AS us1
ON a.id=us1.order_id AND us1.type = 1');// search in shipping address
// Search country or region
$query->select('co0.title AS country0_title');
$query->select('co1.title AS country1_title');
//$query->join('LEFT', '#__phocacart_countries AS co ON
co.id = us0.country OR co.id = us1.country');
$query->join('LEFT', '#__phocacart_countries AS co0 ON
co0.id = us0.country');
$query->join('LEFT', '#__phocacart_countries AS co1 ON
co1.id = us1.country');
$query->select('re0.title AS region0_title');
$query->select('re1.title AS region1_title');
//$query->join('LEFT', '#__phocacart_regions AS re ON
re.id = us0.region OR re.id = us1.region');
$query->join('LEFT', '#__phocacart_regions AS re0 ON
re0.id = us0.region');
$query->join('LEFT', '#__phocacart_regions AS re1 ON
re1.id = us1.region');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
$status = (int)$this->getState('filter.status_id');
if (!empty($status)) {
if ($status != '' && $status > 0) {
$query->where('a.status_id = '.$status);
}
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$searchIn = array('name_first', 'name_middle',
'name_last', 'name_degree', 'company',
'vat_1', 'vat_2', 'address_1',
'address_2', 'city', 'zip',
'email', 'email_contact', 'phone_1',
'phone_2', 'phone_mobile', 'fax' );
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$searchInP = array();
$searchInP[] = 'a.id LIKE '. $search;
$searchInP[] = 'a.order_number LIKE '. $search;
$searchInP[] = 'a.receipt_number LIKE '. $search;
$searchInP[] = 'a.invoice_number LIKE '. $search;
$searchInP[] = 'a.title LIKE '. $search;
$searchInP[] = 'a.alias LIKE '. $search;
$searchInP[] = 'a.comment LIKE '. $search;
$searchInP[] = 'co0.title LIKE '. $search;
$searchInP[] = 'co1.title LIKE '. $search;
$searchInP[] = 're0.title LIKE '. $search;
$searchInP[] = 're1.title LIKE '. $search;
foreach($searchIn as $k => $v) {
$searchInP[] = 'us0.'.$v . ' LIKE '. $search;//
search in billing address
$searchInP[] = 'us1.'.$v . ' LIKE '. $search;//
search in shipping address
}
$query->where('('.implode(' OR ',
$searchInP).')');
//$query->where('( a.title LIKE '.$search.' OR
a.alias LIKE '.$search.')');
}
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
/*if ($orderCol != 'a.id') {
$orderCol = 'a.id';
}*/
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[���$88models/phocacartparama.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocaCartParamA extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected $formNameR;
protected $formName;
public function setFormName($formNameR, $formName) {
$this->formNameR = $formNameR;
$this->formName = $formName;
}
protected function canDelete($record) {
return parent::canDelete($record);
}
protected function canEditState($record) {
return parent::canEditState($record);
}
// PhocacartPayment
// PhocacartShipping
public function getTable($type = 'PhocacartPayment', $prefix =
'Table', $config = array()) {
$app = JFactory::getApplication();
$type = $app->input->get( 'type', '',
'int' );
if ($type == 2) {
$type = 'PhocacartShipping';
} else {
$type = 'PhocacartPayment';
}
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$form = $this->loadForm($this->formNameR, $this->formName,
array('control' => 'jform', 'load_data'
=> $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartparama.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
/*
* Add additional parameter of the payment method to load it in payment
options (x001) - pcp
* Add additional parameter of the shipping method to load it in shipping
options (x001) - pcs
*/
protected function preprocessForm(JForm $form, $data, $group =
'pcp') {
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
$app = JFactory::getApplication();
$type = $app->input->get( 'type', '',
'int' );
if ($type == 2) {
$group = 'pcs';
$folder = 'pcs';
} else {
$group = 'pcp';
$folder = 'pcp';
}
// Initialise variables.
//$folder =
'pcp';//$this->getState('item.folder');
//$element = $this->getState('item.element');
$app = JFactory::getApplication();
$method = $app->input->get( 'method', '',
'string' );// get the method, when start or when changed the
select box
$element = $method;
$lang = JFactory::getLanguage();
$client = JApplicationHelper::getClientInfo(0);
if (empty($folder) || empty($element)) {
//$app = JFactory::getApplication();
//$app->re-direct(JRoute::_('index.php?option=com_phocapdf&view=phocapdfcp',false),
JText::_('COM_PHOCACART_NO_FOLDER_OR_ELEMENT_FOUND'));
}
// Try 1.6 format: /plugins/folder/element/element.xml
$formFile =
JPath::clean($client->path.'/plugins/'.$folder.'/'.$element.'/'.$element.'.xml');
if (!file_exists($formFile)) {
// Try 1.5 format: /plugins/folder/element/element.xml
$formFile =
JPath::clean($client->path.'/plugins/'.$folder.'/'.$element.'.xml');
if (!file_exists($formFile)) {
throw new
Exception(JText::sprintf('COM_PHOCACART_ERROR_FILE_NOT_FOUND',
$element.'.xml'));
return false;
}
}
// Load the core and/or local language file(s).
$lang->load('plg_'.$folder.'_'.$element,
JPATH_ADMINISTRATOR, null, false, false)
|| $lang->load('plg_'.$folder.'_'.$element,
$client->path.'/plugins/'.$folder.'/'.$element,
null, false, false)
|| $lang->load('plg_'.$folder.'_'.$element,
JPATH_ADMINISTRATOR, $lang->getDefault(), false, false)
|| $lang->load('plg_'.$folder.'_'.$element,
$client->path.'/plugins/'.$folder.'/'.$element,
$lang->getDefault(), false, false);
if (file_exists($formFile)) {
// Get the plugin form.
if (!$form->loadFile($formFile, false, '//form')) {
throw new
Exception(JText::_('COM_PHOCACART_ERROR_LOADFILE_FAILED'));
}
}
// Attempt to load the xml file.
if (!$xml = simplexml_load_file($formFile)) {
throw new
Exception(JText::_('COM_PHOCACART_ERROR_LOADFILE_FAILED'));
}
// Get the help data from the XML file if present.
$help = $xml->xpath('/extension/help');
if (!empty($help)) {
$helpKey = trim((string) $help[0]['key']);
$helpURL = trim((string) $help[0]['url']);
$this->helpKey = $helpKey ? $helpKey : $this->helpKey;
$this->helpURL = $helpURL ? $helpURL : $this->helpURL;
}
// Trigger the default form events.
parent::preprocessForm($form, $data);
}
}
?>PK�"�[�;��models/phocacartparameter.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartParameter extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record) {
return parent::canDelete($record);
}
protected function canEditState($record) {
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartParameter', $prefix =
'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartparameter',
'phocacartparameter', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartparameter.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery("SELECT MAX(ordering) FROM
#__phocacart_parameters");
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
}
?>
PK�"�[L/n��models/phocacartparameters.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartParameters extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.parameter_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_parameters` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[��*�HH"models/phocacartparametervalue.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartParameterValue extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record) {
$user = JFactory::getUser();
if (!empty($record->catid)) {
return $user->authorise('core.delete',
'com_phocacart.phocacartparametervalue.'.(int)
$record->parent_id);
} else {
return parent::canDelete($record);
}
}
protected function canEditState($record) {
$user = JFactory::getUser();
if (!empty($record->catid)) {
return $user->authorise('core.edit.state',
'com_phocacart.phocacartparametervalue.'.(int)
$record->parent_id);
} else {
return parent::canDelete($record);
}
}
public function getTable($type = 'PhocacartParameterValue',
$prefix = 'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form =
$this->loadForm('com_phocacart.phocacartparametervalue',
'phocacartparametervalue', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$app = JFactory::getApplication('administrator');
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartparametervalue.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
// Try to preselect category when we add new image
// Take the value from filter select box in image list
if (empty($data) || (!empty($data) && (int)$data->id < 1))
{
$filter = (array)
$app->getUserState('com_phocacart.phocacartparametervalues.filter.parameter_id');
if (isset($filter[0]) && (int)$filter[0] > 0) {
$data->set('parameter_id', (int)$filter[0]);
}
}
return $data;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_parameter_values WHERE parameter_id =
'.(int)$table->parameter_id);
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
protected function getReorderConditions($table = null)
{
$condition = array();
$condition[] = 'parent_id = '. (int) $table->parent_id;;
return $condition;
}
public function save($data) {
if (parent::save($data)) {
$savedId =
$this->getState($this->getName().'.id');
if ((int)$savedId > 0) {
PhocacartCount::setProductCount(array(0 =>
(int)$savedId), 'parameter', 0);
}
return true;
} else {
return false;
}
}
}
?>
PK�"�[�ʜ�TT#models/phocacartparametervalues.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartParameterValues extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
'parameter_id', 'a.parameter_id',
'count_products', 'a.count_products',
'type', 'a.type'
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$parameterId =
$app->getUserStateFromRequest($this->context.'.filter.parameter_id',
'filter_parameter_id', 'modules');
$this->setState('filter.parameter_id', $parameterId);
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
$parameterId =
$app->getUserStateFromRequest($this->context.'.filter.parameter_id',
'filter_parameter_id');
if ($parameterId == 0) {
$this->setState('filter.parameter_id', '');
}
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.parameter_id');
$id .=
':'.$this->getState('filter.parametervalue_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_parameter_values` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
$query->select('p.title AS parameter_title, p.alias AS
parameter_alias');
$query->join('LEFT', '`#__phocacart_parameters` AS p ON
p.id = a.parameter_id');
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by category.
$parameterId = $this->getState('filter.parameter_id');
if (is_numeric($parameterId)) {
$query->where('a.parameter_id = ' . (int) $parameterId);
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[>�I??models/phocacartpayment.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartPayment extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record) {
return parent::canDelete($record);
}
protected function canEditState($record) {
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartPayment', $prefix =
'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartpayment',
'phocacartpayment', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartpayment.data',
array());
if (empty($data)) {
$data = $this->getItem();
$price = new PhocacartPrice();
$data->cost = $price->cleanPrice($data->cost);
$data->cost_additional =
$price->cleanPrice($data->cost_additional);
}
return $data;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
$table->cost =
PhocacartUtils::replaceCommaWithPoint($table->cost);
$table->cost_additional =
PhocacartUtils::replaceCommaWithPoint($table->cost_additional);
$table->lowest_amount =
PhocacartUtils::replaceCommaWithPoint($table->lowest_amount);
$table->highest_amount =
PhocacartUtils::replaceCommaWithPoint($table->highest_amount);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
$table->tax_id = PhocacartUtils::getIntFromString($table->tax_id);
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_payment_methods');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
public function save($data)
{
//$dispatcher = J EventDispatcher::getInstance();
$table = $this->getTable();
if ((!empty($data['tags']) &&
$data['tags'][0] != ''))
{
$table->newTags = $data['tags'];
}
$key = $table->getKeyName();
$pk = (!empty($data[$key])) ? $data[$key] : (int)
$this->getState($this->getName() . '.id');
$isNew = true;
// Include the content plugins for the on save events.
JPluginHelper::importPlugin('content');
// Allow an exception to be thrown.
try
{
// Load the row if saving an existing record.
if ($pk > 0)
{
$table->load($pk);
$isNew = false;
}
// Plugin parameters are converted to params column in payment table
(x001)
// Store form parameters of selected method
$app = JFactory::getApplication();
$dataPh = $app->input->get('phform', array(),
'array');
if (!empty($dataPh['params'])) {
$registry = new JRegistry($dataPh['params']);
//$registry = new JRegistry($dataPh);
$dataPhNew = $registry->toString();
if($dataPhNew != '') {
$data['params'] = $dataPhNew;
}
} else {
$data['params'] = '';
}
// Bind the data.
if (!$table->bind($data))
{
$this->setError($table->getError());
return false;
}
// Prepare the row for saving
$this->prepareTable($table);
// Check the data.
if (!$table->check())
{
$this->setError($table->getError());
return false;
}
// Trigger the onContentBeforeSave event.
$result =
\JFactory::getApplication()->triggerEvent($this->event_before_save,
array($this->option . '.' . $this->name, $table, $isNew,
$data));
if (in_array(false, $result, true))
{
$this->setError($table->getError());
return false;
}
// Store the data.
if (!$table->store())
{
$this->setError($table->getError());
return false;
}
if ((int)$table->id > 0) {
if (!isset($data['zone'])) {
$data['zone'] = array();
}
PhocacartZone::storeZones($data['zone'], (int)$table->id,
'payment');
if (!isset($data['country'])) {
$data['country'] = array();
}
PhocacartCountry::storeCountries($data['country'],
(int)$table->id, 'payment');
if (!isset($data['region'])) {
$data['region'] = array();
}
PhocacartRegion::storeRegions($data['region'],
(int)$table->id, 'payment');
if (!isset($data['shipping'])) {
$data['shipping'] = array();
}
PhocacartShipping::storeShippingMethods($data['shipping'],
(int)$table->id, 'payment');
if (!isset($data['group'])) {
$data['group'] = array();
}
PhocacartGroup::storeGroupsById((int)$table->id, 8,
$data['group']);
}
// Clean the cache.
$this->cleanCache();
// Trigger the onContentAfterSave event.
\JFactory::getApplication()->triggerEvent($this->event_after_save,
array($this->option . '.' . $this->name, $table, $isNew));
}
catch (Exception $e)
{
$this->setError($e->getMessage());
return false;
}
$pkName = $table->getKeyName();
if (isset($table->$pkName))
{
$this->setState($this->getName() . '.id',
$table->$pkName);
}
$this->setState($this->getName() . '.new', $isNew);
return true;
}
public function delete(&$cid = array()) {
if (count( $cid )) {
$delete = parent::delete($cid);
if ($delete) {
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$cids = implode( ',', $cid );
$query = 'DELETE FROM #__phocacart_item_groups'
. ' WHERE item_id IN ( '.$cids.' )'
. ' AND type = 8';
$this->_db->setQuery( $query );
$this->_db->execute();
}
}
}
public function setDefault($id = 0) {
$user = JFactory::getUser();
$db = $this->getDbo();
if (!$user->authorise('core.edit.state',
'com_phocacart')) {
throw new
Exception(JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'));
}
$table = $this->getTable();
if (!$table->load((int) $id)){
throw new
Exception(JText::_('COM_PHOCACART_ERROR_TABLE_NOT_FOUND'));
}
$db->setQuery("UPDATE #__phocacart_payment_methods SET
".$db->quoteName('default')." =
'0'");
$db->execute();
$db->setQuery("UPDATE #__phocacart_payment_methods SET
".$db->quoteName('default')." = '1' WHERE
id = " . (int) $id);
$db->execute();
$this->cleanCache();
return true;
}
public function unsetDefault($id = 0) {
$user = JFactory::getUser();
$db = $this->getDbo();
if (!$user->authorise('core.edit.state',
'com_phocacart')) {
throw new
Exception(JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'));
}
$table = $this->getTable();
if (!$table->load((int) $id)){
throw new
Exception(JText::_('COM_PHOCACART_ERROR_TABLE_NOT_FOUND'));
}
// It is possible that nothing will be set as default
$db->setQuery("UPDATE #__phocacart_payment_methods SET
".$db->quoteName('default')." = '0' WHERE
id = " . (int)$id);
$db->execute();
$this->cleanCache();
return true;
}
}
?>
PK�"�[��9���models/phocacartpayments.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartPayments extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'method', 'a.method',
'cost', 'a.cost',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'access', 'a.access', 'access_level',
'ordering', 'a.ordering',
'published','a.published',
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
$accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.payment_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_payment_methods` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id =
a.access');
// Filter by access level.
if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[�����models/phocacartquestion.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocaCartQuestion extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record)
{
//$user = JFactory::getUser();
return parent::canDelete($record);
}
protected function canEditState($record)
{
//$user = JFactory::getUser();
return parent::canEditState($record);
}
public function getTable($type = 'PhocaCartQuestion', $prefix =
'Table', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartquestion',
'phocacartquestion', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData()
{
// Check the session for previously entered form data.
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartquestion.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table)
{
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
$table->params =
PhocacartUtils::getStringFromItem($table->params);
$table->date = PhocacartUtils::getDateFromString($table->date);
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM #__phocacart_questions
WHERE product_id = '. (int) $table->product_id);
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
protected function getReorderConditions($table = null)
{
$condition = array();
$condition[] = 'product_id = '. (int) $table->product_id;
return $condition;
}
/*
public function increaseOrdering($productId) {
$ordering = 1;
$this->_db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_reviews WHERE product_id='.(int)$productId);
$max = $this->_db->loadResult();
$ordering = $max + 1;
return $ordering;
}*/
}
?>PK�"�[���rrmodels/phocacartquestions.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocaCartQuestions extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'productname', 'productname',
'cattitle', 'cattitle',
'name', 'a.name',
'email', 'a.email',
'phone', 'a.phone',
'ip', 'a.ip',
'message', 'a.message',
'date', 'a.date',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.name',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.question_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_questions` AS a');
$query->select('p.title AS productname');
$query->join('LEFT', '#__phocacart_products AS p ON
p.id=a.product_id');
$query->select('c.title AS cattitle, c.id AS catid');
$query->join('LEFT', '#__phocacart_categories AS c ON
c.id=a.category_id');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
$query->select('ua.id AS questionuserid, ua.username AS
questionusername, ua.name AS questionname');
$query->join('LEFT', '#__users AS ua ON
ua.id=a.user_id');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.name LIKE '.$search.' OR a.message
LIKE '.$search.' OR productname LIKE
'.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'productname');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[B��models/phocacartregion.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartRegion extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record)
{
//$user = JFactory::getUser();
return parent::canDelete($record);
}
protected function canEditState($record)
{
//$user = JFactory::getUser();
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartRegion', $prefix =
'Table', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartregion',
'phocacartregion', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData()
{
// Check the session for previously entered form data.
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartregion.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table)
{
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM #__phocacart_regions
WHERE country_id = '.(int)$table->country_id);
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
public function importregions() {
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$db->setQuery('SELECT COUNT(id) FROM #__phocacart_regions');
$sum = $db->loadResult();
/*if ((int)$sum > 3900) {
$message = JText::_('COM_PHOCACART_REGIONS_ALREADY_IMPORTED');
$app->enqueueMessage($message, 'error');
return false;
}*/
if ((int)$sum > 0) {
$message =
JText::_('COM_PHOCACART_REGIONS_CAN_BE_IMPORTED_ONLY_WHEN_REGION_TABLE_IS_EMPTY');
$app->enqueueMessage($message, 'error');
return false;
}
$db->setQuery('SELECT COUNT(id) FROM
#__phocacart_countries');
$sum = $db->loadResult();
if ((int)$sum < 240) {
$message =
JText::_('COM_PHOCACART_FIRST_COUNTRIES_NEED_TO_BE_IMPORTED');
$app->enqueueMessage($message, 'error');
return false;
}
$file = JPATH_ADMINISTRATOR .
'/components/com_phocacart/install/sql/mysql/regions.utf8.sql';
if(JFile::exists($file)) {
$buffer = file_get_contents($file);
$queries = JDatabaseDriver::splitSql($buffer);
if (count($queries) == 0) {
return false;
}
foreach ($queries as $query){
$query = trim($query);
if ($query != '' && $query[0] != '#'){
$db->setQuery($query);
if (!$db->execute()){
JLog::add(JText::_('JLIB_INSTALLER_ERROR_SQL_ERROR'),
JLog::WARNING);
return false;
}
}
}
return true;
} else {
$app->enqueueMessage(JText::_('COM_PHOCACART_IMPORT_FILE_NOT_EXIST'),
'error');
return false;
}
}
public function delete(&$cid = array()) {
if (count( $cid )) {
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$cids = implode( ',', $cid );
$table = $this->getTable();
if (!$this->canDelete($table)){
$error = $this->getError();
if ($error){
JLog::add($error, JLog::WARNING);
return false;
} else {
JLog::add(JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'),
JLog::WARNING);
return false;
}
}
// 1. DELETE REGIONS
$query = 'DELETE FROM #__phocacart_regions'
. ' WHERE id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 2. DELETE REGION TAXES
$query = 'DELETE FROM #__phocacart_tax_regions'
. ' WHERE region_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 3. DELETE COUNTRIES IN SHIPPING METHOD
$query = 'DELETE FROM #__phocacart_shipping_method_regions'
. ' WHERE region_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 4. DELETE COUNTRIES IN PAYMENT METHOD
$query = 'DELETE FROM #__phocacart_payment_method_regions'
. ' WHERE region_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
}
return true;
}
}
?>
PK�"�[���models/phocacartregions.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartRegions extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'country_title', 'country_title',
'code2', 'a.code2',
'code3', 'a.code3',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$countryId =
$app->getUserStateFromRequest($this->context.'.filter.country_id',
'filter_country_id', null);
$this->setState('filter.country_id', $countryId);
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.country_id');
$id .= ':'.$this->getState('filter.region_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
$columns = 'a.id, a.country_id, uc.name, c.title, a.checked_out,
a.title, a.published, a.code2, a.code3, a.ordering';
$groupsFull = $columns . ', c.id';
$groupsFast = 'a.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
$query->select($this->getState('list.select', $columns));
$query->from('`#__phocacart_regions` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
$query->select('c.title AS country_title, c.id AS
country_id');
$query->join('LEFT', '#__phocacart_countries AS c ON
c.id = a.country_id');
$query->select('GROUP_CONCAT(tr.tax_rate) AS tr_tax_rate');
$query->join('LEFT', '#__phocacart_tax_regions AS tr ON
a.id = tr.region_id');
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
// Filter by country.
$countryId = $this->getState('filter.country_id');
if (is_numeric($countryId)) {
$query->where('a.country_id = ' . (int) $countryId);
}
$query->group($groups);
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[��p�models/phocacartreport.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocaCartReport extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
public function getTable($type = 'PhocaCartReport', $prefix =
'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
return false;
}
}
?>PK�"�[���QQmodels/phocacartreports.phpnu�[���<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
version 2 or later;
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartReports extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'date', 'a.date',
'order_number', 'a.order_number',
'currency_code', 'a.currency_code',
'type', 'a.type'
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.date',
$direction = 'DESC')
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
$this->setState('filter.language', $language);
$currency =
$app->getUserStateFromRequest($this->context.'.filter.currency',
'filter_currency', '');
$this->setState('filter.currency', $currency);
$shopType =
$app->getUserStateFromRequest($this->context.'.filter.shop_type',
'filter_shop_type', '');
$this->setState('filter.shop_type', $shopType);
$orderStatus =
$app->getUserStateFromRequest($this->context.'.filter.order_status',
'filter_order_status', '');
$this->setState('filter.order_status', $orderStatus);
//$order =
$app->getUserStateFromRequest($this->context.'.filter.order',
'filter_order', '');
//$this->setState('filter.order', $order);
$date_from =
$app->getUserStateFromRequest($this->context.'.filter.date_from',
'filter_date_from', PhocacartDate::getCurrentDate(30),
'string');
$this->setState('filter.date_from', $date_from);
$date_to =
$app->getUserStateFromRequest($this->context.'.filter.date_to',
'filter_date_to', PhocacartDate::getCurrentDate(),
'string');
$this->setState('filter.date_to', $date_to);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.date_from');
$id .= ':'.$this->getState('filter.date_to');
$id .= ':'.$this->getState('filter.currency');
$id .= ':'.$this->getState('filter.shop_type');
$id .= ':'.$this->getState('filter.order_status');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
$query->select(
$this->getState(
'list.select',
//- 'a.id, DATE(a.date) AS date_only, COUNT(DATE(a.date)) AS
count_orders'
//'DATE(a.date) AS date_only, COUNT(DATE(a.date)) AS
count_orders'
'a.id, a.date, a.order_number, a.currency_id, a.currency_code,
a.currency_exchange_rate, a.type, a.payment_id'
)
);
$query->from('`#__phocacart_orders` AS a');
//$query->select('SUM(t.amount) AS order_amount');
//$query->join('LEFT', '#__phocacart_order_total AS t
ON a.id=t.order_id');
//$query->where('t.type = \'brutto\'' );
// Filter by order status
/* $whereOrderStatus = '';
if (!PhocacartStatistics::setWhereByOrderStatus($whereOrderStatus)) {
$dummyQuery = 'SELECT "" AS date_only, 0 AS count_orders
FROM `#__phocacart_orders`';
return $dummyQuery;
}
if ($whereOrderStatus != '') {
$query->where( $whereOrderStatus );
}*/
// TOTAL
/*$query->select('tn.amount AS total_netto');
$query->join('LEFT', '#__phocacart_order_total AS tn ON
a.id = tn.order_id');
$query->where('tn.type =
'.$db->quote('netto'));
$query->select('SUM(tv.amount) AS total_vat');
$query->join('LEFT', '#__phocacart_order_total AS tv ON
a.id = tv.order_id');
$query->where('tv.type = '.$db->quote('tax'));
$query->select('tb.amount AS total_brutto, tb.amount_currency AS
total_brutto_currency');
$query->join('LEFT', '#__phocacart_order_total AS tb ON
a.id = tb.order_id');
$query->where('tb.type =
'.$db->quote('brutto'));*/
// USERS
$query->select('ou.name_first AS user_name_first, ou.name_last AS
user_name_last, ou.company AS user_company, ou.vat_1 AS user_vat_1,'
.' ou.address_1 AS user_address_1, ou.city AS user_city, ou.zip AS
user_zip, co.title AS user_country');
$query->join('LEFT', '#__phocacart_order_users AS ou ON
a.id = ou.order_id AND ou.type = 0');
$query->join('LEFT', '#__phocacart_countries AS co ON
ou.country = co.id');
// PAYMENT
$query->select('p.title as payment_title');
$query->join('LEFT', '#__phocacart_payment_methods AS p
ON a.payment_id = p.id');
// Filter by search in title
$dateFrom = $this->getState('filter.date_from',
PhocacartDate::getCurrentDate(30));
$dateTo = $this->getState('filter.date_to',
PhocacartDate::getCurrentDate());
if ($dateTo != '' && $dateFrom != '') {
$dateFrom = $db->Quote($dateFrom);
$dateTo = $db->Quote($dateTo);
$query->where('DATE(a.date) >= '.$dateFrom.' AND
DATE(a.date) <= '.$dateTo );
}
$currency = $this->getState('filter.currency', 0);
if ($currency > 0) {
$query->where('a.currency_id = '.(int)$currency );
}
$shopType = $this->getState('filter.shop_type', 0);
if ($shopType > 0) {
$query->where('a.type = '.(int)$shopType );
}
$orderStatus = $this->getState('filter.order_status', 0);
if ($orderStatus > 0) {
$query->where('a.status_id = '.(int)$orderStatus );
}
//- $query->group('DATE(a.date), a.id');
//$query->group('DATE(a.date)');
$query->group('a.id');
$orderCol = $this->state->get('list.ordering',
'a.date');
$orderDirn = $this->state->get('list.direction',
'DESC');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[y��ddmodels/phocacartreview.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartReview extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record)
{
//$user = JFactory::getUser();
return parent::canDelete($record);
}
protected function canEditState($record)
{
//$user = JFactory::getUser();
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartReview', $prefix =
'Table', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartreview',
'phocacartreview', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData()
{
// Check the session for previously entered form data.
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartreview.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table)
{
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
$table->date = PhocacartUtils::getDateFromString($table->date);
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM #__phocacart_reviews
WHERE product_id = '. (int) $table->product_id);
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
protected function getReorderConditions($table = null)
{
$condition = array();
$condition[] = 'product_id = '. (int) $table->product_id;
return $condition;
}
/*
public function increaseOrdering($productId) {
$ordering = 1;
$this->_db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_reviews WHERE product_id='.(int)$productId);
$max = $this->_db->loadResult();
$ordering = $max + 1;
return $ordering;
}*/
}
?>PK�"�[��HWWmodels/phocacartreviews.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartReviews extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'productname', 'p.title',
'name', 'a.name',
'rating', 'a.rating',
'review', 'a.review',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.name',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.review_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_reviews` AS a');
$query->select('p.title AS productname');
$query->join('LEFT', '#__phocacart_products AS p ON
p.id=a.product_id');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
$query->select('ua.id AS reviewuserid, ua.username AS
reviewusername, ua.name AS reviewname');
$query->join('LEFT', '#__users AS ua ON
ua.id=a.user_id');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.name LIKE '.$search.' OR a.review
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[6� models/phocacartreward.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartReward extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record) {
return parent::canDelete($record);
}
protected function canEditState($record) {
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartRewardPoint', $prefix
= 'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartreward',
'phocacartreward', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartreward.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
$table->points =
PhocacartUtils::getIntFromString($table->points);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_reward_points');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
}
?>PK�"�[��oomodels/phocacartrewards.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartRewards extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'points', 'a.points',
'user_id', 'a.user_id',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
'u.name'
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.date',
$direction = 'DESC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
$user =
$app->getUserStateFromRequest($this->context.'.filter.user',
'filter_user');
$this->setState('filter.user', $user);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
$id .= ':'.$this->getState('filter.user');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.reward_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_reward_points` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
$query->select('u.name AS user_name, u.username AS
user_username');
$query->join('LEFT', '#__users AS u ON
u.id=a.user_id');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.' OR u.name LIKE '.$search.' OR
u.username LIKE '.$search.')');
}
}
$user = $this->getState('filter.user');
if (!empty($user)){
$query->select('u2.name AS user_name_selected');
$query->join('LEFT', '#__users AS u2 ON
u2.id=a.user_id');
$query->where('( u.id = '.(int)$user.')');
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[7`G��models/phocacartsection.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartSection extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record) {
return parent::canDelete($record);
}
protected function canEditState($record) {
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartSection', $prefix =
'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartsection',
'phocacartsection', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartsection.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
if (empty($table->id)) {
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_sections');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
}
?>PK�"�[6���models/phocacartsections.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartSections extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.section_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_sections` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[(}阝!�!models/phocacartshipping.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartShipping extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record) {
return parent::canDelete($record);
}
protected function canEditState($record) {
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartShipping', $prefix =
'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartshipping',
'phocacartshipping', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartshipping.data',
array());
if (empty($data)) {
$data = $this->getItem();
$price = new PhocacartPrice();
$data->cost = $price->cleanPrice($data->cost);
$data->cost_additional =
$price->cleanPrice($data->cost_additional);
}
return $data;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
$table->cost =
PhocacartUtils::replaceCommaWithPoint($table->cost);
$table->cost_additional =
PhocacartUtils::replaceCommaWithPoint($table->cost_additional);
$table->lowest_weight =
PhocacartUtils::replaceCommaWithPoint($table->lowest_weight);
$table->highest_weight =
PhocacartUtils::replaceCommaWithPoint($table->highest_weight);
$table->lowest_volume =
PhocacartUtils::replaceCommaWithPoint($table->lowest_volume);
$table->highest_volume =
PhocacartUtils::replaceCommaWithPoint($table->highest_volume);
$table->lowest_amount =
PhocacartUtils::replaceCommaWithPoint($table->lowest_amount);
$table->highest_amount =
PhocacartUtils::replaceCommaWithPoint($table->highest_amount);
$table->maximal_width =
PhocacartUtils::replaceCommaWithPoint($table->maximal_width);
$table->maximal_height =
PhocacartUtils::replaceCommaWithPoint($table->maximal_height);
$table->maximal_length =
PhocacartUtils::replaceCommaWithPoint($table->maximal_length);
$table->minimal_width =
PhocacartUtils::replaceCommaWithPoint($table->minimal_width);
$table->minimal_height =
PhocacartUtils::replaceCommaWithPoint($table->minimal_height);
$table->minimal_length =
PhocacartUtils::replaceCommaWithPoint($table->minimal_length);
$table->minimal_quantity=
PhocacartUtils::replaceCommaWithPoint($table->minimal_quantity);
$table->maximal_quantity=
PhocacartUtils::replaceCommaWithPoint($table->maximal_quantity);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
$table->tax_id = PhocacartUtils::getIntFromString($table->tax_id);
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_shipping_methods');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
public function save($data)
{
//$dispatcher = J EventDispatcher::getInstance();
$table = $this->getTable();
if ((!empty($data['tags']) &&
$data['tags'][0] != ''))
{
$table->newTags = $data['tags'];
}
$key = $table->getKeyName();
$pk = (!empty($data[$key])) ? $data[$key] : (int)
$this->getState($this->getName() . '.id');
$isNew = true;
// Include the content plugins for the on save events.
JPluginHelper::importPlugin('content');
// Allow an exception to be thrown.
try
{
// Load the row if saving an existing record.
if ($pk > 0)
{
$table->load($pk);
$isNew = false;
}
// Plugin parameters are converted to params column in shipping table
(x001)
// Store form parameters of selected method
$app = JFactory::getApplication();
$dataPh = $app->input->get('phform', array(),
'array');
if (!empty($dataPh['params'])) {
$registry = new JRegistry($dataPh['params']);
//$registry = new JRegistry($dataPh);
$dataPhNew = $registry->toString();
if($dataPhNew != '') {
$data['params'] = $dataPhNew;
}
} else {
$data['params'] = '';
}
// Bind the data.
if (!$table->bind($data))
{
$this->setError($table->getError());
return false;
}
// Prepare the row for saving
$this->prepareTable($table);
// Check the data.
if (!$table->check())
{
$this->setError($table->getError());
return false;
}
// Trigger the onContentBeforeSave event.
$result =
\JFactory::getApplication()->triggerEvent($this->event_before_save,
array($this->option . '.' . $this->name, $table, $isNew,
$data));
if (in_array(false, $result, true))
{
$this->setError($table->getError());
return false;
}
// Store the data.
if (!$table->store())
{
$this->setError($table->getError());
return false;
}
if ((int)$table->id > 0) {
if (!isset($data['zone'])) { $data['zone'] =
array();}
PhocacartZone::storeZones($data['zone'], (int)$table->id);
if (!isset($data['country'])) {$data['country'] =
array();}
PhocacartCountry::storeCountries($data['country'],
(int)$table->id);
if (!isset($data['region'])) {$data['region'] =
array();}
PhocacartRegion::storeRegions($data['region'],
(int)$table->id);
if (!isset($data['group'])) {$data['group'] =
array();}
PhocacartGroup::storeGroupsById((int)$table->id, 7,
$data['group']);
}
// Clean the cache.
$this->cleanCache();
// Trigger the onContentAfterSave event.
\JFactory::getApplication()->triggerEvent($this->event_after_save,
array($this->option . '.' . $this->name, $table, $isNew));
}
catch (Exception $e)
{
$this->setError($e->getMessage());
return false;
}
$pkName = $table->getKeyName();
if (isset($table->$pkName))
{
$this->setState($this->getName() . '.id',
$table->$pkName);
}
$this->setState($this->getName() . '.new', $isNew);
return true;
}
public function delete(&$cid = array()) {
if (count( $cid )) {
$delete = parent::delete($cid);
if ($delete) {
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$cids = implode( ',', $cid );
$query = 'DELETE FROM #__phocacart_item_groups'
. ' WHERE item_id IN ( '.$cids.' )'
. ' AND type = 7';
$this->_db->setQuery( $query );
$this->_db->execute();
}
}
}
public function setDefault($id = 0) {
$user = JFactory::getUser();
$db = $this->getDbo();
if (!$user->authorise('core.edit.state',
'com_phocacart')) {
throw new
Exception(JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'));
}
$table = $this->getTable();
if (!$table->load((int) $id)){
throw new
Exception(JText::_('COM_PHOCACART_ERROR_TABLE_NOT_FOUND'));
}
$db->setQuery("UPDATE #__phocacart_shipping_methods SET
".$db->quoteName('default')." =
'0'");
$db->execute();
$db->setQuery("UPDATE #__phocacart_shipping_methods SET
".$db->quoteName('default')." = '1' WHERE
id = " . (int) $id);
$db->execute();
$this->cleanCache();
return true;
}
public function unsetDefault($id = 0) {
$user = JFactory::getUser();
$db = $this->getDbo();
if (!$user->authorise('core.edit.state',
'com_phocacart')) {
throw new
Exception(JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'));
}
$table = $this->getTable();
if (!$table->load((int) $id)){
throw new
Exception(JText::_('COM_PHOCACART_ERROR_TABLE_NOT_FOUND'));
}
// It is possible that nothing will be set as default
$db->setQuery("UPDATE #__phocacart_shipping_methods SET
".$db->quoteName('default')." = '0' WHERE
id = " . (int)$id);
$db->execute();
$this->cleanCache();
return true;
}
}
?>
PK�"�[=���models/phocacartshippings.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartShippings extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'method', 'a.method',
'cost', 'a.cost',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'access', 'a.access', 'access_level',
'ordering', 'a.ordering',
'published','a.published',
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
$accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.shipping_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_shipping_methods` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id =
a.access');
// Filter by access level.
if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[���/� � !models/phocacartspecification.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartSpecification extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record)
{
//$user = JFactory::getUser();
return parent::canDelete($record);
}
protected function canEditState($record)
{
//$user = JFactory::getUser();
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartSpecification',
$prefix = 'Table', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form =
$this->loadForm('com_phocacart.phocacartspecification',
'phocacartspecification', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData()
{
// Check the session for previously entered form data.
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartspecification.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table)
{
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
$table->date = PhocacartUtils::getDateFromString($table->date);
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_specification_groups');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
}
?>PK�"�[��6��"models/phocacartspecifications.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartSpecifications extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC')
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.attribute_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_specification_groups` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[�я�models/phocacartstatistic.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocaCartStatistic extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
public function getTable($type = 'PhocaCartStatistic', $prefix =
'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
return false;
}
}
?>PK�"�[{B7-��models/phocacartstatistics.phpnu�[���<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
version 2 or later;
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartStatistics extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id'
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.date',
$direction = 'DESC')
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
$this->setState('filter.language', $language);
$date_from =
$app->getUserStateFromRequest($this->context.'.filter.date_from',
'filter_date_from', PhocacartDate::getCurrentDate(30),
'string');
$this->setState('filter.date_from', $date_from);
$date_to =
$app->getUserStateFromRequest($this->context.'.filter.date_to',
'filter_date_to', PhocacartDate::getCurrentDate(),
'string');
$this->setState('filter.date_to', $date_to);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.date_from');
$id .= ':'.$this->getState('filter.date_to');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
$query->select(
$this->getState(
'list.select',
//- 'a.id, DATE(a.date) AS date_only, COUNT(DATE(a.date)) AS
count_orders'
'DATE(a.date) AS date_only, COUNT(DATE(a.date)) AS
count_orders'
)
);
$query->from('`#__phocacart_orders` AS a');
$query->select('SUM(t.amount) AS order_amount');
$query->join('LEFT', '#__phocacart_order_total AS t ON
a.id=t.order_id');
$query->where('t.type = \'brutto\'' );
// Filter by order status
$whereOrderStatus = '';
if (!PhocacartStatistics::setWhereByOrderStatus($whereOrderStatus)) {
$dummyQuery = 'SELECT "" AS date_only, 0 AS count_orders
FROM `#__phocacart_orders`';
return $dummyQuery;
}
if ($whereOrderStatus != '') {
$query->where( $whereOrderStatus );
}
// Filter by search in title
$dateFrom = $this->getState('filter.date_from',
PhocacartDate::getCurrentDate(30));
$dateTo = $this->getState('filter.date_to',
PhocacartDate::getCurrentDate());
if ($dateTo != '' && $dateFrom != '') {
$dateFrom = $db->Quote($dateFrom);
$dateTo = $db->Quote($dateTo);
$query->where('DATE(a.date) >= '.$dateFrom.' AND
DATE(a.date) <= '.$dateTo );
}
//- $query->group('DATE(a.date), a.id');
$query->group('DATE(a.date)');
$query->order($db->escape('a.date ASC'));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[*RdL66models/phocacartstatus.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocaCartStatus extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record) {
return parent::canDelete($record);
}
protected function canEditState($record) {
return parent::canEditState($record);
}
public function getTable($type = 'PhocaCartStatus', $prefix =
'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartstatus',
'phocacartstatus', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartstatus.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_order_statuses');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
if (isset($table->type) && isset($table->published)
&& $table->type == 1 && $table->published == 0) {
$table->published = 1;
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('COM_PHOCACART_ERROR_DEFAULT_ITEMS_CANNOT_BE_UNPUBLISHED'));
}
}
public function delete(&$cid = array()) {
if (count( $cid )) {
\Joomla\Utilities\ArrayHelper::toInteger($cid);
//$cids = implode( ',', $cid );
//$app = JFactory::getApplication();
$error = 0;
if (!empty($cid)) {
foreach ($cid as $k => $v) {
$query = 'SELECT type FROM #__phocacart_order_statuses WHERE id
='.(int)$v;
$this->_db->setQuery($query);
$type = $this->_db->loadRow();
if (isset($type[0]) && $type[0] == 1) {
$error = 1;
} else {
$query = 'DELETE FROM #__phocacart_order_statuses'
. ' WHERE id = '.(int)$v;
$this->_db->setQuery( $query );
$this->_db->execute();
}
}
}
}
if ($error) {
$this->setError(JText::_('COM_PHOCACART_ERROR_DEFAULT_ITEMS_CANNOT_BE_DELETED'));
//$app->enqueueMessage(JText::_('COM_PHOCACART_ERROR_DEFAULT_ITEMS_CANNOT_BE_DELETED'));
return false;
} else {
return true;
}
}
public function publish(&$pks, $value = 1)
{
$user = JFactory::getUser();
$table = $this->getTable();
$pks = (array) $pks;
$app = JFactory::getApplication();
$error = 0;
foreach ($pks as $i => $pk){
$table->reset();
if ($table->load($pk)) {
if (!$this->canEditState($table)){
// Prune items that you can't change.
unset($pks[$i]);
JLog::add(JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'),
JLog::WARNING, 'jerror');
return false;
}
// If the table is checked out by another user, drop it and report to
the user trying to change its state.
if (property_exists($table, 'checked_out') &&
$table->checked_out && ($table->checked_out !=
$user->id)){
JLog::add(JText::_('JLIB_APPLICATION_ERROR_CHECKIN_USER_MISMATCH'),
JLog::WARNING, 'jerror');
// Prune items that you can't change.
unset($pks[$i]);
return false;
}
if (property_exists($table, 'type') &&
$table->type && ((int)$table->type == 1) && $value ==
0){
$error = 1;
unset($pks[$i]);
//return false;
}
}
}
// Attempt to change the state of the records.
if (!empty($pks)) {
if (!$table->publish($pks, $value, $user->get('id'))) {
$this->setError($table->getError());
return false;
}
}
if ($error) {
//$this->setError(JText::_('COM_PHOCACART_ERROR_DEFAULT_ITEMS_CANNOT_BE_UNPUBLISHED'));
$app->enqueueMessage(JText::_('COM_PHOCACART_ERROR_DEFAULT_ITEMS_CANNOT_BE_UNPUBLISHED'));
return true;
} else {
return true;
}
$this->cleanCache();
}
public function save($data) {
if(!isset($data['orders_view_display'])) {
$data['orders_view_display'] = array();
}
if(!isset($data['email_attachments'])) {
$data['email_attachments'] = array();
}
$data['orders_view_display'] =
json_encode($data['orders_view_display']);
$data['email_attachments'] =
json_encode($data['email_attachments']);
return parent::save($data);
}
}
?>
PK�"�[��B==models/phocacartstatuses.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocaCartStatuses extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
'download', 'a.download',
'stock_movements', 'a.stock_movements',
'type', 'a.type'
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.status_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_order_statuses` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[�ꨱ��models/phocacartstockstatus.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartStockStatus extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record) {
return parent::canDelete($record);
}
protected function canEditState($record) {
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartStockStatus', $prefix
= 'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form =
$this->loadForm('com_phocacart.phocacartstockstatus',
'phocacartstockstatus', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartstockstatus.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_stock_statuses');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
}
?>PK�"�[8|s��!models/phocacartstockstatuses.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartStockStatuses extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .=
':'.$this->getState('filter.stockstatus_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_stock_statuses` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[/M �g�gmodels/phocacartsubmititem.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport('joomla.application.component.modeladmin');
use Joomla\String\StringHelper;
class PhocaCartCpModelPhocaCartSubmititem extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
public $typeAlias =
'com_phocacart.phocacartsubmititem';
protected $associationsContext =
'com_phocacart.submititem'; // ASSOCIATION
protected function canDelete($record){
$user = JFactory::getUser();
if (!empty($record->catid)) {
// catid not used
return $user->authorise('core.delete',
'com_phocacart.phocacartsubmititem.'.(int) $record->catid);
} else {
return parent::canDelete($record);
}
}
protected function canEditState($record) {
$user = JFactory::getUser();
if (!empty($record->catid)) {
// catid not used
return $user->authorise('core.edit.state',
'com_phocacart.phocacartsubmititem.'.(int) $record->catid);
} else {
return parent::canEditState($record);
}
}
public function getTable($type = 'PhocaCartSubmititem', $prefix
= 'Table', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form =
$this->loadForm('com_phocacart.phocacartsubmititem',
'submit', array('control' => 'jform',
'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData()
{
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacart.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
public function getItem($pk = null) {
if ($item = parent::getItem($pk)) {
// Convert the params field to an array.
if (isset($item->metadata)) {
$registry = new JRegistry;
$registry->loadString($item->metadata);
$item->metadata = $registry->toArray();
}
if (isset($item->params_feed)) {
$registry = new JRegistry;
$registry->loadString($item->params_feed);
$item->params_feed = $registry->toArray();
}
if (isset($item->items_item)) {
$registry = new JRegistry;
$registry->loadString($item->items_item);
$itemI = $registry->toArray();
$item->items_item = $itemI;
}
if (isset($item->items_contact)) {
$registry = new JRegistry;
$registry->loadString($item->items_contact);
$contactI = $registry->toArray();
$item->items_contact = $contactI;
}
if (isset($item->items_parameter)) {
$registry = new JRegistry;
$registry->loadString($item->items_parameter);
$parameterI = $registry->toArray();
$item->items_parameter = $parameterI;
}
}
return $item;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias =
JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
}
function save($data) {
$app = JFactory::getApplication();
$input = JFactory::getApplication()->input;
$table = $this->getTable();
$pk = (!empty($data['id'])) ? $data['id'] :
(int)$this->getState($this->getName().'.id');
$isNew = true;
$params = PhocacartUtils::getComponentParameters();
//$submit_item_max_char_textarea =
$params->get('submit_item_max_char_textarea', 5000);
$submit_item_form_fields =
$params->get('submit_item_form_fields', '');
$items = array_map('trim', explode(',',
$submit_item_form_fields));
$items = array_unique($items);
$submit_item_form_fields_contact =
$params->get('submit_item_form_fields_contact', '');
$itemsC = array_map('trim', explode(',',
$submit_item_form_fields_contact));
$itemsC = array_unique($itemsC);
$submit_item_form_fields_parameters = $params->get(
'submit_item_form_fields_parameters', '' );
$itemsP = array_map('trim', explode(',',
$submit_item_form_fields_parameters));
$itemsP = array_unique($itemsP);
$item = array();
$contact = array();
$parameter = array();
if (!empty($items)) {
foreach ($items as $k => $v) {
$v = trim(str_replace('*', '', $v));
if (isset($data['items_item'][$v]) &&
$data['items_item'][$v] != '') {
$item[$v] = $data['items_item'][$v];
}
}
}
if (!empty($itemsC)) {
foreach ($itemsC as $k => $v) {
$v = trim(str_replace('*', '', $v));
if (isset($data['items_contact'][$v]) &&
$data['items_contact'][$v] != '') {
$contact[$v] = $data['items_contact'][$v];
}
}
}
if (!empty($itemsP)) {
$parameters = PhocacartParameter::getAllParameters('alias');
foreach ($itemsP as $k => $v) {
$v = trim(str_replace('*', '', $v));
$vId = 0;
if (isset($parameters[$v]->id) &&
$parameters[$v]->id > 0) {
$vId = (int)$parameters[$v]->id;
}
if (!empty($data['items_parameter'][$vId])) {
$parameter[$vId] =
$data['items_parameter'][$vId];
}
}
}
$tempData = $data;
$data = array();
$data = $tempData;
$data['items_item'] = json_encode($item);
$data['items_contact'] = json_encode($contact);
$data['items_parameter'] = json_encode($parameter);
$data['date_submit']= $tempData['date_submit'];
$data['user_id'] = $tempData['user_id'];
$data['title'] = $tempData['title'];
$data['alias'] =
PhocacartUtils::getAliasName($data['title']);
$data['ordering'] = $this->increaseOrdering();
$data['published'] = 1;
$data['upload_token'] = PhocacartUtils::getToken();
$data['upload_folder'] =
PhocacartUtils::getToken('folder');
// ALIAS
if (in_array($input->get('task'), array('apply',
'save', 'save2new')) &&
(!isset($data['id']) || (int) $data['id'] == 0)) {
if ($data['alias'] == null) {
if (JFactory::getConfig()->get('unicodeslugs') == 1) {
$data['alias'] =
JFilterOutput::stringURLUnicodeSlug($data['title']);
} else {
$data['alias'] =
JFilterOutput::stringURLSafe($data['title']);
}
if ($table->load(array('alias' =>
$data['alias']))){
$msg = JText::_('COM_PHOCACART_SAVE_WARNING');
}
list($title, $alias) = $this->generateNewTitle(0,
$data['alias'], $data['title']);
$data['alias'] = $alias;
if (isset($msg)) {
JFactory::getApplication()->enqueueMessage($msg,
'warning');
}
}
} else if ($table->load(array('alias' =>
$data['alias'])) && ($table->id !=
$data['id'] || $data['id'] == 0)) {
//$this->setError(\JText::_('COM_PHOCACART_ERROR_ITEM_UNIQUE_ALIAS'));
//return false;
}
// Include the content plugins for the on save events.
//JPluginHelper::importPlugin('content');
// Load the row if saving an existing record.
if ($pk > 0) {
$table->load($pk);
$isNew = false;
}
// Bind the data.
if (!$table->bind($data)) {
$this->setError($table->getError());
return false;
}
// Prepare the row for saving
$this->prepareTable($table);
// Check the data.
if (!$table->check()) {
$this->setError($table->getError());
return false;
}
if (!$table->store()) {
$this->setError($table->getError());
return false;
}
if ((int)$table->id > 0) {
}
// Clean the cache.
$cache = JFactory::getCache($this->option);
$cache->clean();
// Trigger the onContentAfterSave event.
//\JFactory::getApplication()->triggerEvent('$this->event_after_save,
array($this->option.'.'.$this->name, $table, $isNew));
$pkName = $table->getKeyName();
if (isset($table->$pkName)) {
$this->setState($this->getName().'.id',
$table->$pkName);
}
$this->setState($this->getName().'.new', $isNew);
return true;
}
public function delete(&$cid = array()) {
$app = JFactory::getApplication();
if (count( $cid )) {
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$cids = implode( ',', $cid );
$table = $this->getTable();
if (!$this->canDelete($table)){
$error = $this->getError();
if ($error){
JLog::add($error, JLog::WARNING);
return false;
} else {
JLog::add(JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'),
JLog::WARNING);
return false;
}
}
// 1. DELETE ITEMS
$query = 'DELETE FROM #__phocacart_submit_items' . '
WHERE id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 2. DELETE UPLOAD FOLDERS
$query = 'SELECT upload_folder FROM #__phocacart_submit_items'
. ' WHERE id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$items = $this->_db->loadObjectList();
if (!empty($items)) {
$pathSubmit = PhocacartPath::getPath('submititem');
foreach($items as $k => $v) {
if (isset($v->upload_folder) && $v->upload_folder !=
'') {
if
(\Joomla\CMS\Filesystem\Folder::exists($pathSubmit['orig_abs_ds']
. $v->upload_folder)) {
if
(!\Joomla\CMS\Filesystem\Folder::delete($pathSubmit['orig_abs_ds']
. $v->upload_folder)) {
$msg = JText::_('COM_PHOCACART_FOLDER') . ': '
. $v->upload_folder . " - " .
JText::_('COM_PHOCACART_ERROR_FOLDER_NOT_DELETED');
$app->enqueueMessage($msg, 'error');
}
}
}
}
}
}
return true;
}
function create($cid = array(), &$message) {
if (count( $cid )) {
$paramsC = PhocacartUtils::getComponentParameters();
$chunkMethod = $paramsC->get('multiple_upload_chunk', 0);
$sIMoveImgFolder =
$paramsC->get('submit_item_move_image_folder', 0);
$sIMoveImageFolderSpecific =
$paramsC->get('submit_item_move_image_folder_specific',
'');
$sIRemoveItemCreateProduct =
$paramsC->get('submit_item_remove_item_create_product', 0);
$sIConvertMarkdownCreateProduct =
$paramsC->get('submit_item_convert_markdown_create_product',
0);
if ($sIMoveImgFolder == 1 &&
PhocacartText::filterValue($sIMoveImageFolderSpecific, 'folder')
== '') {
$sIMoveImgFolder = 0;
}
$pathImage = PhocacartPath::getPath('productimage');
$pathSubmit = PhocacartPath::getPath('submititem');
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$cids = implode( ',', $cid );
$query = 'SELECT a.*'.
' FROM #__phocacart_submit_items AS a' .
' WHERE a.id IN ( '.$cids.' )';
$this->_db->setQuery($query);
$items = $this->_db->loadObjectList();
if (isset($items) && count($items)) {
$msg = array();
$addedItems = 0;
$notAddedItems = 0;
foreach($items as $k => $v) {
if (isset($v->items_item)) {
$table = $this->getTable('PhocaCartItem');
$data = json_decode($v->items_item, true);
// Test if item includes category
if (!empty($data['catid_multiple']) &&
isset($data['catid_multiple'][0]) &&
(int)$data['catid_multiple'][0] > 0) {
} else {
$msg[] = JText::_('COM_PHOCACART_ITEM') . ': ' .
$v->title . " - ".
JText::_('COM_PHOCACART_ERROR_PRODUCT_FROM_ITEM_NOT_CREATED_NO_CATEGORY');
$notAddedItems++;
continue;
}
// Images
$iI = 0;
$dataImage = '';
$dataImageAdditional = array();
$dataImageMove = array();
if (!empty($data['image'])) {
foreach($data['image'] as $kI => $vI) {
if ($iI == 0) {
// First image as image
$dataImage = $vI['name'];
} else {
// All others as additional images
$dataImageAdditional[$iI]['id'] = 0;
$dataImageAdditional[$iI]['image'] =
$vI['name'];
}
// 0) Root folder of phoca cart product images
$folder = '';
$dataImageMove[$iI]['dest'] =
$pathImage['orig_abs_ds'] . $vI['name'];
if ($sIMoveImgFolder == 1) {
// 1) Specific folder
$folder = PhocacartText::filterValue($sIMoveImageFolderSpecific,
'folder');
if ($folder != '') {
if
(!Joomla\CMS\Filesystem\Folder::exists($pathImage['orig_abs_ds']
. $folder)) {
if
(!Joomla\CMS\Filesystem\Folder::create($pathImage['orig_abs_ds']
. $folder)) {
$msg[] = JText::_('COM_PHOCACART_FOLDER') . ':
' . $folder . " - ".
JText::_('COM_PHOCACART_ERROR_FOLDER_NOT_CREATED');
}
}
$folder = $folder . '/';
}
if ($folder != '') {
$dataImageMove[$iI]['dest'] =
$pathImage['orig_abs_ds'] . $folder . $vI['name'];
}
// Update image path
if ($iI == 0) {
$dataImage = $folder . $dataImage;
} else {
$dataImageAdditional[$iI]['image'] = $folder .
$vI['name'];
}
} else if ($sIMoveImgFolder == 2 || $sIMoveImgFolder == 3) {
// 2) Folder created from first letter of file or title
$folder =
PhocacartText::filterValue(substr($data['title'], 0, 1));
if ($sIMoveImgFolder == 2) {
$folder =
PhocacartText::filterValue(substr($vI['name'], 0, 1));
}
if ($folder != '') {
if
(!Joomla\CMS\Filesystem\Folder::exists($pathImage['orig_abs_ds']
. $folder)) {
if
(!Joomla\CMS\Filesystem\Folder::create($pathImage['orig_abs_ds']
. $folder)) {
$msg[] = JText::_('COM_PHOCACART_FOLDER') . ':
' . $folder . " - ".
JText::_('COM_PHOCACART_ERROR_FOLDER_NOT_CREATED');
}
}
$folder = $folder . '/';
}
if ($folder != '') {
$dataImageMove[$iI]['dest'] =
$pathImage['orig_abs_ds'] . $folder . $vI['name'];
}
// Update image path
if ($iI == 0) {
$dataImage = $folder . $dataImage;
} else {
$dataImageAdditional[$iI]['image'] = $folder .
$vI['name'];
}
}
$dataImageMove[$iI]['src'] = $vI['fullpath'];
$dataImageMove[$iI]['image'] = $vI['name'];
$dataImageMove[$iI]['fileno'] = $folder .
$vI['name'];
$iI++;
}
}
$data['image'] = $dataImage;
$data['user_id'] = $v->user_id;
if ($sIConvertMarkdownCreateProduct == 1) {
if (!class_exists('Parsedown')) {
require_once(JPATH_ADMINISTRATOR .
'/components/com_phocacart/libraries/Parsedown/Parsedown.php');
}
$p = new Parsedown();
$data['description'] =
$p->text($data['description']);
$data['description_long'] =
$p->text($data['description_long']);
$data['features'] =
$p->text($data['features']);
}
// Add default values
if (!isset($data['language'])) {
$data['language'] = '*';
}
$date = JFactory::getDate()->toSql();
if (!isset($data['date'])) {
$data['date'] = $date;
}
if (!isset($data['date_update'])) {
$data['date_update'] = $date;
}
$user = JFactory::getUser();
$data['created'] = $date;
$data['created_by'] = isset($user->id) ?
(int)$user->id: 0;
//$data['modified'] = $date;
//$data['modified_by'] = isset($user->id) ?
(int)$user->id: 0;
// TEST - REMOVE in STABLE
//$table->id = 1189;
// Bind the data.
if (!$table->bind($data)) {
$this->setError($table->getError());
$message = $table->getError();
return false;
}
//$this->prepareTable($table);
// Check the data.
if (!$table->check()) {
$this->setError($table->getError());
$message = $table->getError();
return false;
}
if (!$table->store()) {
$this->setError($table->getError());
$message = $table->getError();
return false;
}
// TEST - REMOVE in STABLE
//$table->id = 1189;
if ((int)$table->id > 0) {
$data['items_parameter'] =
json_decode($v->items_parameter, true);
$previousManufacturers = array();
$currentManufacturers = isset($data['manufacturer_id'])
&& (int)$data['manufacturer_id'] > 0 ? array(0 =>
(int)$data['manufacturer_id']) : array();
$allManufacturers = array_unique(array_merge($previousManufacturers,
$currentManufacturers));
PhocacartCount::setProductCount($allManufacturers,
'manufacturer', 1);// We need to recount all manufacturers -
previous (now deleted), and new
if (!isset($data['catid_multiple'])) {
$data['catid_multiple'] = array();
}
$previousCategories =
PhocacartCategoryMultiple::getCategories((int)$table->id, 1);
PhocacartCategoryMultiple::storeCategories($data['catid_multiple'],
(int)$table->id);
$allCategories = array_unique(array_merge($previousCategories,
$data['catid_multiple']));
PhocacartCount::setProductCount($allCategories,
'category', 1);// We need to recount all categories - previous
(now deleted), and new
PhocacartImageAdditional::storeImagesByProductId((int)$table->id,
$dataImageAdditional);
// TAGS
if (!isset($data['tags'])) {
$data['tags'] = array();
}
$previousTags = PhocacartTag::getTags((int)$table->id, 1);
PhocacartTag::storeTags($data['tags'],
(int)$table->id);
$allTags = array_unique(array_merge($previousTags,
$data['tags']));
PhocacartCount::setProductCount($allTags, 'tag', 1);// We
need to update product count even for values which were removed when
editing ($allTags)
// TAG LABELS
if (!isset($data['taglabels'])) {
$data['taglabels'] = array();
}
$previousLabels = PhocacartTag::getTagLabels((int)$table->id, 1);
PhocacartTag::storeTagLabels($data['taglabels'],
(int)$table->id);
$allLabels = array_unique(array_merge($previousLabels,
$data['taglabels']));
PhocacartCount::setProductCount($allLabels, 'label', 1);//
We need to update product count even for values which were removed when
editing ($allLabels)
// PARAMETERS
$parameters = PhocacartParameter::getAllParameters();
if (!empty($parameters)) {
foreach ($parameters as $kP => $vP) {
if (isset($vP->id) && (int)$vP->id > 0) {
$idP = (int)$vP->id;
if (empty($data['items_parameter'][$idP])) {
$data['items_parameter'][$idP] = array();
}
$previousParameterValues =
PhocacartParameter::getParameterValues((int)$table->id, $idP, 1);
PhocacartParameter::storeParameterValues($data['items_parameter'][$idP],
(int)$table->id, $idP);
$allParameterValues =
array_unique(array_merge($previousParameterValues,
$data['items_parameter'][$idP]));
PhocacartCount::setProductCount($allParameterValues,
'parameter', 1);
}
}
}
// Copy images to product image folder
if (!empty($dataImageMove)) {
foreach($dataImageMove as $kIm => $vIm) {
if (!\Joomla\CMS\Filesystem\File::copy($vIm['src'],
$vIm['dest'])) {
$msg[] = JText::_('COM_PHOCACART_IMAGE') . ':
' . $vIm['image'] . " - ".
JText::_('COM_PHOCACART_ERROR_IMAGE_NOT_COPIED');
} else {
$createThubms =
PhocacartFileThumbnail::getOrCreateThumbnail($vIm['fileno'], 0,
1, 1, 1, 0, 'productimage');
if (!$createThubms) {
$msg[] = $vIm['image'] .
JText::_('COM_PHOCACART_ERROR_WHILECREATINGTHUMB');
}
}
}
}
$msg[] = JText::_('COM_PHOCACART_ITEM') . ': ' .
$v->title . " - ".
JText::_('COM_PHOCACART_SUCCESS_PRODUCT_FROM_ITEM_CREATED');
$addedItems++;
}
}
if ($sIRemoveItemCreateProduct == 1) {
// Delete the submit item folder for all images
if (isset($v->upload_folder) && $v->upload_folder !=
'') {
if
(\Joomla\CMS\Filesystem\Folder::exists($pathSubmit['orig_abs_ds']
. $v->upload_folder)) {
if
(!\Joomla\CMS\Filesystem\Folder::delete($pathSubmit['orig_abs_ds']
. $v->upload_folder)) {
$msg[] = JText::_('COM_PHOCACART_FOLDER') . ':
' . $v->upload_folder . " - " .
JText::_('COM_PHOCACART_ERROR_FOLDER_NOT_DELETED');
}
}
}
// Delete the submit item after moving to product
if (isset($v->id) && $v->id > 0) {
$query = 'DELETE FROM #__phocacart_submit_items'
. ' WHERE id = ' . (int)$v->id;
$this->_db->setQuery($query);
$this->_db->execute();
}
}
}
//$countMsg = count($msg);
$message = !empty($msg) ? implode('<br />', $msg) :
'';
if ($addedItems == 0) {
return false;
}
} else {
$message = JText::_('COM_PHOCACART_ERROR_LOADING_DATA_DB');
return false;
}
} else {
$message = JText::_('COM_PHOCACART_ERROR_ITEM_NOT_SELECTED');
return false;
}
return true;
}
public function increaseOrdering() {
$ordering = 1;
$this->_db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_submit_items');
$max = $this->_db->loadResult();
$ordering = $max + 1;
return $ordering;
}
protected function generateNewTitle($category_id, $alias, $title) {
$app = JFactory::getApplication('administrator');
$batchParams = $app->input->post->get('batch',
array(), 'array');
// Alter the title & alias
$table = $this->getTable();
// Product can be stored in different categories, so we ignore
"parent id - category" - each product will have new name
// not like standard new name for each category
while ($table->load(array('alias' => $alias))) {
// Skip creating unique name
if (isset($batchParams['skip_creating_unique_name'])
&& $batchParams['skip_creating_unique_name'] == 1) {
} else {
$title = StringHelper::increment($title);
}
$alias = StringHelper::increment($alias, 'dash');
}
return array($title, $alias);
}
// ASSOCIATION
protected function preprocessForm(JForm $form, $data, $group =
'content'){
/*if ($this->canCreateCategory())
{
$form->setFieldAttribute('catid', 'allowAdd',
'true');
}*/
// Association Phoca Cart items
if (JLanguageAssociations::isEnabled()){
$languages = JLanguageHelper::getContentLanguages(false, true, null,
'ordering', 'asc');
if (count($languages) > 1){
$addform = new SimpleXMLElement('<form />');
$fields = $addform->addChild('fields');
$fields->addAttribute('name', 'associations');
$fieldset = $fields->addChild('fieldset');
$fieldset->addAttribute('name',
'item_associations');
foreach ($languages as $language)
{
$field = $fieldset->addChild('field');
$field->addAttribute('name', $language->lang_code);
$field->addAttribute('type',
'Modal_Phocacartitem');
$field->addAttribute('language',
$language->lang_code);
$field->addAttribute('label', $language->title);
$field->addAttribute('translate_label',
'false');
$field->addAttribute('select', 'true');
$field->addAttribute('new', 'true');
$field->addAttribute('edit', 'true');
$field->addAttribute('clear', 'true');
$field->addAttribute('propagate', 'true');
}
$form->load($addform, false);
}
}
// Load Feed Forms - by Plugin
$feedPlugins = PhocacartFeed::getFeedPluginMethods();
if (!empty($feedPlugins)) {
foreach ($feedPlugins as $k => $v) {
$element = htmlspecialchars($v->element, ENT_QUOTES,
'UTF-8');
$addformF = new SimpleXMLElement('<form />');
$fields = $addformF->addChild('fields');
$fields->addAttribute('name', 'feed');
//$fields->addAttribute('addfieldpath',
'associations');
$fieldset = $fields->addChild('fieldset');
$fieldset->addAttribute('name',
'feed_'.$element);
$fieldset->addAttribute('group', 'pcf');
$field = $fieldset->addChild('field');
$field->addAttribute('name', $element);
$field->addAttribute('type', 'subform');
$field->addAttribute('label',
JText::_(strtoupper($v->name)));
$field->addAttribute('multiple', 'false');
$field->addAttribute('layout',
'joomla.form.field.subform.default');
$field->addAttribute('formsource',
'plugins/pcf/'.$element.'/models/forms/item.xml');
$field->addAttribute('clear', 'true');
$field->addAttribute('propagate', 'true');
$form->load($addformF, false);
}
}
// Load Parameter Values for Parameters
$parameters = PhocacartParameter::getAllParameters();
// Items and Items (Contact) are defined in view
// Items (Parameters) will be defined here
$pC = PhocacartUtils::getComponentParameters();
// Items and Items (Contact) are defined in this view
// Items (Parameters) will be defined model (when creating the form)
$submit_item_form_fields_parameters = $pC->get(
'submit_item_form_fields_parameters', '' );
if($submit_item_form_fields_parameters != '') {
$itemsP = array_map('trim', explode(',',
$submit_item_form_fields_parameters));
$itemsP = array_unique($itemsP);
if (count($parameters) > 0 && !empty($itemsP)) {
$addform = new SimpleXMLElement('<form />');
$fields = $addform->addChild('fields');
$fields->addAttribute('name',
'items_parameter');
$fieldset = $fields->addChild('fieldset');
$fieldset->addAttribute('name',
'items_parameter');
foreach ($parameters as $k => $v) {
$isIncluded = 0;
if (in_array($v->alias, $itemsP)) {
$isIncluded = 1;// included
}
if (in_array($v->alias . '*', $itemsP)) {
$isIncluded = 2;// included and required
}
if ($isIncluded > 0) {
$field = $fieldset->addChild('field');
$field->addAttribute('name', $v->id);
$field->addAttribute('parameterid', $v->id);
$field->addAttribute('parameteralias',
$v->alias);
$field->addAttribute('type',
'PhocaCartParameterValuesSubmitItems');
//$field->addAttribute('language',
$language->lang_code);
$field->addAttribute('label', $v->title);
$field->addAttribute('class',
'chosen-select');
$field->addAttribute('multiple', 'true');
$field->addAttribute('translate_label',
'false');
$field->addAttribute('select', 'true');
$field->addAttribute('new', 'true');
$field->addAttribute('edit', 'true');
$field->addAttribute('clear', 'true');
$field->addAttribute('propagate', 'true');
$field->addAttribute('filter', 'int_array');
if ($isIncluded == 2) {
$field->addAttribute('required', 'true');
}
}
}
$form->load($addform, false);
}
}
parent::preprocessForm($form, $data, $group);
}
}
?>
PK�"�[O&�=��models/phocacartsubmititems.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.modellist' );
jimport( 'joomla.filesystem.folder' );
jimport( 'joomla.filesystem.file' );
class PhocaCartCpModelPhocaCartSubmititems extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'date_submit', 'a.date_submit',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'date_submit', 'a.date_submit',
'published','a.published',
'user_id','a.user_id',
'user_username'
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.date_submit',
$direction = 'DESC')
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
// $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
// $this->setState('filter.access', $accessId);
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
// $categoryId =
$app->getUserStateFromRequest($this->context.'.filter.category_id',
'filter_category_id', null);
// $this->setState('filter.category_id', $categoryId);
// $language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
// $this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
// ASSOCIATION
if (!empty($forcedLanguage)) {
$this->setState('filter.language',
$forcedLanguage);
}
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
// $id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
// $id .=
':'.$this->getState('filter.category_id');
// $id .=
':'.$this->getState('filter.language');
$id .= ':'.$this->getState('filter.item_id');
return parent::getStoreId($id);
}
protected function getListQuery()
{
$paramsC = PhocacartUtils::getComponentParameters();
$search_matching_option_admin = $paramsC->get(
'search_matching_option_admin', 'exact' );
$db = $this->getDbo();
$query = $db->getQuery(true);
$columns = 'DISTINCT a.id, a.title, a.published, a.checked_out,
a.checked_out_time, a.alias, a.date_submit, a.ordering';
// GROUP BY not used
//$groupsFull = $columns . ', ' .'a.tax_id,
a.manufacturer_id, a.description, l.title, uc.name, ag.title';
//$groupsFast = 'a.id';
//$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
$query->select($this->getState('list.select', $columns));
$query->from('`#__phocacart_submit_items` AS a');
$query->select('u.name AS user_name, u.username AS
user_username');
$query->join('LEFT', '#__users AS u ON
u.id=a.user_id');
// Join over the language
$query->select('l.title AS language_title, l.image AS
language_image');
$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id =
a.access');
// Join over the categories.
// They are more ways to get the info about categories
// 1) GROUP BY + GROUP_CONCAT - slow, when only_full_group_by rule is
used - much more slower than slow
// 2) SUBQUERIES - faster even they look complicated
// 3) SPECIFIC QUERY used in view:
PhocacartCategoryMultiple::getCategoriesByProducts($idItems) (no loop used)
DISTINCT needs to be used
/*
* GROUP BY
$query->select('GROUP_CONCAT(c.title) AS category_title,
GROUP_CONCAT(c.id) AS category_id');
$query->join('LEFT', '#__phocacart_product_categories
AS pc ON a.id = pc.product_id');
$query->join('LEFT', '#__phocacart_categories AS c ON
c.id = pc.category_id');
* SUBQUERIES
$query->select('(SELECT GROUP_CONCAT(c.id) FROM
jos_phocacart_product_categories AS pc
LEFT JOIN jos_phocacart_categories AS c ON c.id = pc.category_id
WHERE a.id = pc.product_id) AS category_id');
$query->select('(SELECT GROUP_CONCAT(c.title) FROM
jos_phocacart_product_categories AS pc
LEFT JOIN jos_phocacart_categories AS c ON c.id = pc.category_id
WHERE a.id = pc.product_id) AS category_title');
$query->select('(SELECT GROUP_CONCAT(c.id, ":",
c.title) FROM jos_phocacart_product_categories AS pc
LEFT JOIN jos_phocacart_categories AS c ON c.id = pc.category_id
WHERE a.id = pc.product_id) AS category_title');
*/
// Not used
//$query->select("group_concat(c.id, '|^|', c.alias,
'|^|', c.title SEPARATOR '|~|') as categories");
//$query->select('v.average AS ratingavg');
//$query->join('LEFT',
'#__phocadownload_img_votes_statistics AS v ON v.imgid = a.id');
// Filter by access level.
if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// When category is selected, we need to get info about selected category
// When it is not selected, don't ask for it to make the query
faster
// pc.ordering is set as default ordering and it can be set (even
igonered) even whey category not selected
// is complicated but loads much faster
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$categoryId = $this->getState('filter.category_id');
// Filter by category.
if ($orderCol == 'pc.ordering' || is_numeric($categoryId)) {
// Ask only when really needed
$query->select('pc.ordering');
$query->join('LEFT', '#__phocacart_product_categories
AS pc ON a.id = pc.product_id');
$query->join('LEFT', '#__phocacart_categories AS c ON
c.id = pc.category_id');
}
if (is_numeric($categoryId)) {
//$query->where('a.catid = ' . (int) $categoryId);
$query->where('pc.category_id = ' . (int) $categoryId);
}
// Filter on the language.
if ($language = $this->getState('filter.language')) {
$query->where('a.language = ' . $db->quote($language));
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[2d]"G
G
models/phocacarttag.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartTag extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record) {
return parent::canDelete($record);
}
protected function canEditState($record) {
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartTag', $prefix =
'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacarttag',
'phocacarttag', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacarttag.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_tags');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
public function save($data) {
if (parent::save($data)) {
$savedId =
$this->getState($this->getName().'.id');
if ((int)$savedId > 0) {
PhocacartCount::setProductCount(array(0 =>
(int)$savedId), 'tag', 1);
PhocacartCount::setProductCount(array(0 =>
(int)$savedId), 'label', 1);
}
return true;
} else {
return false;
}
}
}
?>
PK�"�[y��2
models/phocacarttags.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartTags extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'type', 'a.type',
'count_products', 'a.count_products',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.tag_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_tags` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[�6C�
�
models/phocacarttax.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartTax extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record)
{
//$user = JFactory::getUser();
return parent::canDelete($record);
}
protected function canEditState($record)
{
//$user = JFactory::getUser();
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartTax', $prefix =
'Table', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacarttax',
'phocacarttax', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData()
{
// Check the session for previously entered form data.
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacarttax.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
public function getItem($pk = null) {
if ($item = parent::getItem($pk)) {
$item->tax_rate = PhocacartPrice::cleanPrice($item->tax_rate);
}
return $item;
}
protected function prepareTable($table)
{
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
$table->tax_rate =
PhocacartUtils::replaceCommaWithPoint($table->tax_rate);
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_taxes');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
public function delete(&$cid = array()) {
if (count( $cid )) {
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$cids = implode( ',', $cid );
$table = $this->getTable();
if (!$this->canDelete($table)){
$error = $this->getError();
if ($error){
JLog::add($error, JLog::WARNING);
return false;
} else {
JLog::add(JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'),
JLog::WARNING);
return false;
}
}
// 1. DELETE TAXES
$query = 'DELETE FROM #__phocacart_taxes'
. ' WHERE id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 2. DELETE COUNTRY TAXES
$query = 'DELETE FROM #__phocacart_tax_countries'
. ' WHERE tax_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
}
return true;
}
}
?>PK�"�[��[<>>models/phocacarttaxes.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartTaxes extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'tax_rate', 'a.tax_rate',
'calculation_type', 'a.calculation_type',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC')
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.tax_id');
return parent::getStoreId($id);
}
protected function getListQuery()
{
// Create a new query object.
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_taxes` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[��p9��models/phocacarttime.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartTime extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record) {
return parent::canDelete($record);
}
protected function canEditState($record) {
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartTime', $prefix =
'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacarttime',
'phocacarttime', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacarttime.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_opening_times');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
}
?>PK�"�[�|$�models/phocacarttimes.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartTimes extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'day', 'a.day',
'date', 'a.date',
'type', 'a.type',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.time_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_opening_times` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[���Kmodels/phocacarttool.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocaCartTool extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
}
?>PK�"�[v)<���models/phocacarttools.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocaCartTools extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
parent::__construct($config);
}
public function getItemsCountProduct() {
$db = $this->getDbo();
$user = JFactory::getUser();
$q = 'SELECT COUNT(id)'
.' FROM #__phocacart_products';
//.' GROUP BY id'
//.' ORDER BY id';
$db->setQuery($q);
$count = $db->loadResult();
return $count;
}
public function getItemsCountExport() {
$db = $this->getDbo();
$user = JFactory::getUser();
$q = 'SELECT COUNT(id)'
.' FROM #__phocacart_export'
.' WHERE user_id = '.(int) $user->id
.' AND type = 0';
//.' GROUP BY id'
//.' ORDER BY id';
$db->setQuery($q);
$count = $db->loadResult();
return $count;
}
}
?>PK�"�[��@:��models/phocacartunit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartUnit extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record) {
return parent::canDelete($record);
}
protected function canEditState($record) {
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartUnit', $prefix =
'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartunit',
'phocacartunit', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartunit.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
$table->section_id =
PhocacartUtils::getIntFromString($table->section_id);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
if (empty($table->id)) {
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_units');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
}
?>PK�"�[�j.���models/phocacartunits.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartUnits extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'section_id', 'section_title',
'section_title',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
$section =
$app->getUserStateFromRequest($this->context.'.filter.section_id',
'filter_section_id');
$this->setState('filter.section_id', $section);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.unit_id');
$id .= ':'.$this->getState('filter.section_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_units` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
$query->select('s.title AS section_title');
$query->join('LEFT', '`#__phocacart_sections` AS s ON
s.id = a.section_id');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
$sectionId = $this->getState('filter.section_id');
if (is_numeric($sectionId)) {
$query->where('a.section_id = ' . (int)$sectionId);
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[�Л ��models/phocacartuser.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartUser extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected $fields;
public function getFields(){
if (empty($this->fields)) {
$this->fields = PhocacartFormUser::getFormXml('',
'_phs', 1, 1, 0);//Fields in XML Format
}
return $this->fields;
}
protected function canDelete($record) {
return parent::canDelete($record);
}
protected function canEditState($record) {
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartUser', $prefix =
'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getFormSpecific($data = array(), $loadData = true) {
if (empty($this->fields['xml'])) {
$this->fields = $this->getFields();
}
$form = $this->loadForm('com_phocacart.userspecific',
(string)$this->fields['xml'], array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
public function getForm($data = array(), $loadData = true) {
$form = $this->loadForm('com_phocacart.user',
'phocacartuser', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$formData = (array)
JFactory::getApplication()->getUserState('com_phocacart.user.data',
array());
if (empty($data)) {
$formData = $this->getItem();
}
return $formData;
}
public function getItem($pk = null) {
$app = JFactory::getApplication();
if (empty($pk)) {
$pk = (int) $this->getState($this->getName() . '.id');
}
$user = $this->getUser($pk);
$table = $this->getTable('PhocacartUser',
'Table');
$tableS = $this->getTable('PhocacartUser',
'Table');
// Billing
if(isset($user->id) && (int)$user->id > 0) {
$return = $table->load(array('user_id' =>
(int)$user->id, 'type' => 0));
if ($return === false && $table->getError()) {
$this->setError($table->getError());
return false;
}
}
// Shipping
if(isset($user->id) && (int)$user->id > 0) {
$returnS = $tableS->load(array('user_id' =>
(int)$user->id, 'type' => 1));
if ($returnS === false && $tableS->getError()) {
$this->setError($tableS->getError());
return false;
}
}
// Convert to the JObject before adding other data.
$properties = $table->getProperties(1);
$item = \Joomla\Utilities\ArrayHelper::toObject($properties,
'JObject');
$propertiesS = $tableS->getProperties(1);
//$itemS = \Joomla\Utilities\ArrayHelper::toObject($propertiesS,
'JObject');
//Add shipping data to billing and do both data package
if(!empty($propertiesS) && is_object($item)) {
foreach($propertiesS as $k => $v) {
$newName = $k . '_phs';
$item->$newName = $v;
}
}
/*
if (property_exists($item, 'params'))
{
$registry = new JRegistry;
$registry->loadString($item->params);
$item->params = $registry->toArray();
}*/
return $item;
}
/*
* User id is the key, not the id in table users
* we are managing two rows in table - shipping, billing
* so we cannot do standard checkout
*/
public function checkout($pk = null) {
return true;
}
protected function getUser() {
$app = JFactory::getApplication();
$userId = $app->input->get('id', 0, 'int');
$user = JFactory::getUser($userId);
return $user;
}
public function save($data, $type = 0) {
$app = JFactory::getApplication();
$data['type'] = (int)$type;
$data['country'] =
PhocacartUtils::getIntFromString($data['country']);
$data['region'] =
PhocacartUtils::getIntFromString($data['region']);
$row = $this->getTable('PhocacartUser', 'Table');
if(isset($data['user_id']) &&
$data['user_id'] > 0) {
if (!$row->load(array('user_id' =>
(int)$data['user_id'], 'type' => $type))) {
// No data yet
} else {
if (isset($row->id) && (int)$row->id > 0 &&
(!isset($data['id']) || (isset($data['id']) &&
$data['id'] == ''))) {
$data['id'] = (int)$row->id;
}
}
}
if (!$row->bind($data)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
$row->date = gmdate('Y-m-d H:i:s');
if (!$row->check()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
if ($row->id == '') {
// fix the type by new items
$row->id = null;
}
// Store the table to the database
if (!$row->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
// We save shipping and billing after each other - twice, so don't
delete the group and run only once
if (empty($data['group'])) {
$data['group'] = array();
}
if ($type == 0) {
PhocacartGroup::storeGroupsById((int)$row->user_id, 1,
$data['group']);
}
return $row->user_id;
}
public function delete(&$cid = array()) {
return false;
}
}
?>PK�"�[!$<x��models/phocacartusers.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartUsers extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'user_username', 'u.username',
'user_name', 'u.name',
'name_first', 'a.name_first',
'name_last', 'a.name_last',
'address_1', 'a.address_1',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
'user_id', 'a.user_id',
'user_name_selected',
'u.email'
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'u.name',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
$user =
$app->getUserStateFromRequest($this->context.'.filter.user_id',
'filter_user_id');
$this->setState('filter.user_id', $user);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
// Let the parent do the filtering but to close the filter fields we need
"" instead of 0 for users
$user =
$app->getUserStateFromRequest($this->context.'.filter.user_id',
'filter_user_id');
if ($user == 0) {
$this->setState('filter.user_id', '');
}
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
$id .= ':'.$this->getState('filter.user_id');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.user_id_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
$columns = 'a.id, a.checked_out, a.name_last, a.name_first,
a.address_1, a.city, a.ordering, a.email';
$groupsFull = $columns = $columns . ', ' . 'u.id, u.name,
u.username, u.email, ou.user_id, c.date, c.user_id, c.vendor_id,
c.ticket_id, c.unit_id, c.section_id, uc.name';
$groupsFast = 'a.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
$query->select($this->getState('list.select',
'DISTINCT' . ' ' .$columns));
$query->from('`#__users` AS u');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
// GROUP_CONCAT(c.date ORDER BY c.date) AS cartdate,
$query->select('c.date AS cartdate, c.user_id as cartuserid,
c.vendor_id as cartvendorid, c.ticket_id as cartticketid, c.unit_id as
cartunitid, c.section_id as cartsectionid');
$query->join('LEFT', '#__phocacart_cart_multiple AS c
ON c.user_id = u.id');
$query->select('u.name AS user_name, u.username AS user_username,
u.id as user_id, u.email AS user_email');
$query->join('LEFT', '#__phocacart_users AS a ON
a.user_id=u.id');
$query->select('ou.user_id AS orderuserid');
$query->join('LEFT', '#__phocacart_orders AS ou ON
a.user_id=ou.user_id');
$query->select('uv.name AS vendor_name, uv.username AS
vendor_username');
$query->join('LEFT', '#__users AS uv ON
uv.id=c.vendor_id');
$query->select('sc.title AS section_name');
$query->join('LEFT', '#__phocacart_sections AS sc ON
sc.id=c.section_id');
$query->select('un.title AS unit_name');
$query->join('LEFT', '#__phocacart_units AS un ON
un.id=c.unit_id');
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
$query->select('GROUP_CONCAT(DISTINCT g.title ORDER BY g.title)
AS usergroups');
$query->join('LEFT', '#__phocacart_item_groups AS ug ON
ug.item_id=u.id AND ug.type = 1');
$query->join('LEFT', '#__phocacart_groups AS g ON
g.id=ug.group_id');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
/*$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('u.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(u.published IN (0, 1))');
}*/
// List only payment or shipping data - to not duplicity the list
//$query->where('a.type = 0');
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( u.name LIKE '.$search.' OR
u.username LIKE '.$search.' OR a.name_last LIKE
'.$search.')');
}
}
// We have two rows for one customer - for billing and shipping address,
but we need to list only one
// is type zero (not one) or type does not exists (for users who are not
stored in phoca user table yet)
$query->where('(a.type = 0 OR a.type IS NULL)');
// ONLY AS CUSTOMERS
// $query->where('c.vendor_id = 0');
//$query->where('u.name <> '.$db->quote('Super
User'));
$query->group($groups);
$user = $this->getState('filter.user_id');
if (!empty($user)){
$query->select('u2.name AS user_name_selected');
$query->join('LEFT', '#__users AS u2 ON
u2.id=a.user_id');
$query->where('( u.id = '.(int)$user.')');
}
$orderCol = $this->state->get('list.ordering',
'u.name');
$orderDirn = $this->state->get('list.direction',
'u.name');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[w4��models/phocacartvendor.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartVendor extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record) {
return parent::canDelete($record);
}
protected function canEditState($record) {
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartVendor', $prefix =
'Table', $config = array()) {
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartvendor',
'phocacartvendor', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData() {
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartvendor.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table) {
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
$table->user_id =
PhocacartUtils::getIntFromString($table->user_id);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
if (empty($table->id)) {
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_vendors');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
}
?>PK�"�[
k�llmodels/phocacartvendors.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartVendors extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array()) {
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
'user_username'
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.vendor_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_vendors` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
$query->select('u.name AS user_name, u.username AS
user_username');
$query->join('LEFT', '#__users AS u ON
u.id=a.user_id');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[H��lccmodels/phocacartwishlist.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartWishlist extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record)
{
//$user = JFactory::getUser();
return parent::canDelete($record);
}
protected function canEditState($record)
{
//$user = JFactory::getUser();
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartWishlist', $prefix =
'Table', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartwishlist',
'phocacartwishlist', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData()
{
// Check the session for previously entered form data.
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartwishlist.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table)
{
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
$table->date = PhocacartUtils::getDateFromString($table->date);
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM #__phocacart_wishlists
WHERE user_id = '. (int) $table->user_id);
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
protected function getReorderConditions($table = null)
{
$condition = array();
$condition[] = 'user_id = '. (int) $table->user_id;
return $condition;
}
/*
public function increaseOrdering($productId) {
$ordering = 1;
$this->_db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_reviews WHERE product_id='.(int)$productId);
$max = $this->_db->loadResult();
$ordering = $max + 1;
return $ordering;
}*/
}
?>PK�"�[
^�models/phocacartwishlists.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartWishlists extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'productname', 'productname',
'cattitle', 'cattitle',
'username', 'username',
'ip', 'a.ip',
'date', 'a.date',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
/* $accessId =
$app->getUserStateFromRequest($this->context.'.filter.access',
'filter_access', null, 'int');
$this->setState('filter.access', $accessId);*/
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.wishlist_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__phocacart_wishlists` AS a');
$query->select('p.title AS productname');
$query->join('LEFT', '#__phocacart_products AS p ON
p.id=a.product_id');
$query->select('c.title AS cattitle, c.id AS catid');
$query->join('LEFT', '#__phocacart_categories AS c ON
c.id=a.category_id');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
$query->select('ua.id AS userid, ua.username AS username, ua.name
AS name');
$query->join('LEFT', '#__users AS ua ON
ua.id=a.user_id');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( name LIKE '.$search.' OR username
LIKE '.$search.' OR productname LIKE
'.$search.')');
}
}
$orderCol = $this->state->get('list.ordering',
'username');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[�J^44models/phocacartzone.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modeladmin');
class PhocaCartCpModelPhocacartZone extends JModelAdmin
{
protected $option = 'com_phocacart';
protected $text_prefix = 'com_phocacart';
protected function canDelete($record)
{
//$user = JFactory::getUser();
return parent::canDelete($record);
}
protected function canEditState($record)
{
//$user = JFactory::getUser();
return parent::canEditState($record);
}
public function getTable($type = 'PhocacartZone', $prefix =
'Table', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
public function getForm($data = array(), $loadData = true) {
$app = JFactory::getApplication();
$form = $this->loadForm('com_phocacart.phocacartzone',
'phocacartzone', array('control' =>
'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
return $form;
}
protected function loadFormData()
{
// Check the session for previously entered form data.
$data =
JFactory::getApplication()->getUserState('com_phocacart.edit.phocacartzone.data',
array());
if (empty($data)) {
$data = $this->getItem();
}
return $data;
}
protected function prepareTable($table)
{
jimport('joomla.filter.output');
$date = JFactory::getDate();
$user = JFactory::getUser();
$table->title = htmlspecialchars_decode($table->title,
ENT_QUOTES);
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
if (empty($table->alias)) {
$table->alias = JApplicationHelper::stringURLSafe($table->title);
}
if (empty($table->id)) {
// Set the values
//$table->created = $date->toSql();
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = JFactory::getDbo();
$db->setQuery('SELECT MAX(ordering) FROM
#__phocacart_zones');
$max = $db->loadResult();
$table->ordering = $max+1;
}
}
else {
// Set the values
//$table->modified = $date->toSql();
//$table->modified_by = $user->get('id');
}
}
public function delete(&$cid = array()) {
if (count( $cid )) {
\Joomla\Utilities\ArrayHelper::toInteger($cid);
$cids = implode( ',', $cid );
$table = $this->getTable();
if (!$this->canDelete($table)){
$error = $this->getError();
if ($error){
JLog::add($error, JLog::WARNING);
return false;
} else {
JLog::add(JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'),
JLog::WARNING);
return false;
}
}
// 1. DELETE ZONES
$query = 'DELETE FROM #__phocacart_zones'
. ' WHERE id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 2. DELETE ZONES IN SHIPPING METHOD
$query = 'DELETE FROM #__phocacart_shipping_method_zones'
. ' WHERE zone_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 3. DELETE ZONES IN PAYMENT METHOD
$query = 'DELETE FROM #__phocacart_payment_method_zones'
. ' WHERE zone_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 4. DELETE COUNTRIES IN ZONES
$query = 'DELETE FROM #__phocacart_zone_countries'
. ' WHERE zone_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
// 5. DELETE REGIONS IN ZONES
$query = 'DELETE FROM #__phocacart_zone_regions'
. ' WHERE zone_id IN ( '.$cids.' )';
$this->_db->setQuery( $query );
$this->_db->execute();
}
return true;
}
public function save($data)
{
//$dispatcher = J EventDispatcher::getInstance();
$table = $this->getTable();
/*
if ((!empty($data['tags']) &&
$data['tags'][0] != ''))
{
$table->newTags = $data['tags'];
}
*/
$key = $table->getKeyName();
$pk = (!empty($data[$key])) ? $data[$key] : (int)
$this->getState($this->getName() . '.id');
$isNew = true;
// Include the content plugins for the on save events.
JPluginHelper::importPlugin('content');
// Allow an exception to be thrown.
try
{
// Load the row if saving an existing record.
if ($pk > 0)
{
$table->load($pk);
$isNew = false;
}
/*
// Plugin parameters are converted to params column in payment table
(x001)
// Store form parameters of selected method
$app = JFactory::getApplication();
$dataPh = $app->input->get('phform', array(),
'array');
$registry = new JRegistry($dataPh['params']);
//$registry = new JRegistry($dataPh);
$dataPhNew = $registry->toString();
if($dataPhNew != '') {
$data['params'] = $dataPhNew;
}
*/
// Bind the data.
if (!$table->bind($data))
{
$this->setError($table->getError());
return false;
}
// Prepare the row for saving
$this->prepareTable($table);
// Check the data.
if (!$table->check())
{
$this->setError($table->getError());
return false;
}
// Trigger the onContentBeforeSave event.
$result =
\JFactory::getApplication()->triggerEvent($this->event_before_save,
array($this->option . '.' . $this->name, $table, $isNew,
$data));
if (in_array(false, $result, true))
{
$this->setError($table->getError());
return false;
}
// Store the data.
if (!$table->store())
{
$this->setError($table->getError());
return false;
}
if ((int)$table->id > 0) {
if (!isset($data['country'])) {
$data['country'] = array();
}
PhocacartCountry::storeCountries($data['country'],
(int)$table->id, 'zone');
if (!isset($data['region'])) {
$data['region'] = array();
}
PhocacartRegion::storeRegions($data['region'],
(int)$table->id, 'zone');
}
// Clean the cache.
$this->cleanCache();
// Trigger the onContentAfterSave event.
\JFactory::getApplication()->triggerEvent($this->event_after_save,
array($this->option . '.' . $this->name, $table, $isNew));
}
catch (Exception $e)
{
$this->setError($e->getMessage());
return false;
}
$pkName = $table->getKeyName();
if (isset($table->$pkName))
{
$this->setState($this->getName() . '.id',
$table->$pkName);
}
$this->setState($this->getName() . '.new', $isNew);
return true;
}
}
?>
PK�"�[��"5��models/phocacartzones.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport('joomla.application.component.modellist');
class PhocaCartCpModelPhocacartZones extends JModelList
{
protected $option = 'com_phocacart';
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'code2', 'a.code2',
'code3', 'a.code3',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'ordering', 'a.ordering',
'published','a.published',
);
}
parent::__construct($config);
}
protected function populateState($ordering = 'a.title',
$direction = 'ASC') {
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search =
$app->getUserStateFromRequest($this->context.'.filter.search',
'filter_search');
$this->setState('filter.search', $search);
$state =
$app->getUserStateFromRequest($this->context.'.filter.published',
'filter_published', '', 'string');
$this->setState('filter.published', $state);
//$language =
$app->getUserStateFromRequest($this->context.'.filter.language',
'filter_language', '');
//$this->setState('filter.language', $language);
// Load the parameters.
$params = PhocacartUtils::getComponentParameters();
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.zone_id');
return parent::getStoreId($id);
}
protected function getListQuery() {
$db = $this->getDbo();
$query = $db->getQuery(true);
$columns = 'a.id, a.image, uc.name, a.ordering, a.checked_out,
a.title, a.published, a.code2, a.code3';
$groupsFull = $columns;
$groupsFast = 'a.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
// Select the required fields from the table.
$query->select($this->getState('list.select', $columns));
$query->from('`#__phocacart_zones` AS a');
// Join over the language
//$query->select('l.title AS language_title');
//$query->join('LEFT', '`#__languages` AS l ON
l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON
uc.id=a.checked_out');
// Filter by published state.
$published = $this->getState('filter.published');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->escape($search,
true).'%');
$query->where('( a.title LIKE '.$search.' OR a.alias
LIKE '.$search.')');
}
}
$query->group($groups);
$orderCol = $this->state->get('list.ordering',
'title');
$orderDirn = $this->state->get('list.direction',
'asc');
$query->order($db->escape($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__', 'jos_',
$query->__toString()));
return $query;
}
}
?>
PK�"�[��X
phocacart.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
if (!JFactory::getUser()->authorise('core.manage',
'com_phocacart')) {
throw new
Exception(JText::_('COM_PHOCACART_ERROR_ALERTNOAUTHOR'), 404);
}
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
require_once( JPATH_COMPONENT.'/controller.php' );
JLoader::registerPrefix('Phocacart', JPATH_ADMINISTRATOR .
'/components/com_phocacart/libraries/phocacart');
require JPATH_ADMINISTRATOR .
'/components/com_phocacart/libraries/autoloadPhoca.php';
jimport('joomla.application.component.controller');
$controller = JControllerLegacy::getInstance('phocacartCp');
$controller->execute(JFactory::getApplication()->input->get('task'));
$controller->redirect();
?>
PK�"�[7��Mj'j'
phocacart.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<extension type="component" method="upgrade"
version="3.9">
<name>com_phocacart</name>
<author>Jan Pavelka (www.phoca.cz)</author>
<creationDate>14/10/2021</creationDate>
<authorEmail></authorEmail>
<authorUrl>https://www.phoca.cz</authorUrl>
<copyright>Jan Pavelka</copyright>
<license>GNU/GPL</license>
<version>3.5.8</version>
<description>COM_PHOCACART_XML_DESCRIPTION</description>
<scriptfile>script.php</scriptfile>
<projectName>PhocaCart</projectName>
<install>
<sql>
<file driver="mysql"
charset="utf8">install/sql/mysql/install.utf8.sql</file>
</sql>
</install>
<uninstall>
<sql>
<file driver="mysql"
charset="utf8">install/sql/mysql/uninstall.utf8.sql</file>
</sql>
</uninstall>
<update>
<schemas>
<schemapath
type="mysql">update/sql/mysql</schemapath>
</schemas>
</update>
<files folder="site">
<folder>assets</folder>
<folder>controllers</folder>
<folder>helpers</folder>
<folder>layouts</folder>
<folder>models</folder>
<folder>views</folder>
<filename>controller.php</filename>
<filename>index.html</filename>
<filename>phocacart.php</filename>
<filename>router.php</filename>
</files>
<media destination="com_phocacart"
folder="media">
<folder>bootstrap</folder>
<folder>css</folder>
<folder>duotone</folder>
<folder>images</folder>
<folder>js</folder>
<filename>index.html</filename>
</media>
<languages folder="admin/language">
<language tag="en-GB"
client="site">en-GB/en-GB.com_phocacart.ini</language>
<language tag="en-GB"
client="site">en-GB/en-GB.com_phocacart.sys.ini</language>
</languages>
<administration>
<menu img="class:cp" alt="COM_PHOCACART"
link="option=com_phocacart">COM_PHOCACART</menu>
<submenu>
<menu img="class:cp"
alt="COM_PHOCACART_CONTROLPANEL" view="phocacartcp"
link="option=com_phocacart">COM_PHOCACART_CONTROLPANEL</menu>
<menu img="class:items"
alt="COM_PHOCACART_PRODUCTS" view="phocacartitems"
link="option=com_phocacart&view=phocacartitems">COM_PHOCACART_PRODUCTS</menu>
<menu img="class:categories"
alt="COM_PHOCACART_CATEGORIES"
view="phocacartcategories"
link="option=com_phocacart&view=phocacartcategories">COM_PHOCACART_CATEGORIES</menu>
<menu img="class:specifications"
alt="COM_PHOCACART_SPECIFICATIONS"
view="phocacartspecifications"
link="option=com_phocacart&view=phocacartspecifications">COM_PHOCACART_SPECIFICATIONS</menu>
<menu img="class:manufacturers"
alt="COM_PHOCACART_MANUFACTURERS"
view="phocacartmanufacturers"
link="option=com_phocacart&view=phocacartmanufacturers">COM_PHOCACART_MANUFACTURERS</menu>
<menu img="class:orders"
alt="COM_PHOCACART_ORDERS" view="phocacartorders"
link="option=com_phocacart&view=phocacartorders">COM_PHOCACART_ORDERS</menu>
<menu img="class:orderstatuses"
alt="COM_PHOCACART_ORDER_STATUSES"
view="phocacartstatuses"
link="option=com_phocacart&view=phocacartstatuses">COM_PHOCACART_ORDER_STATUSES</menu>
<menu img="class:stockstatuses"
alt="COM_PHOCACART_STOCK_STATUSES"
view="phocacartstockstatuses"
link="option=com_phocacart&view=phocacartstockstatuses">COM_PHOCACART_STOCK_STATUSES</menu>
<menu img="class:shippings"
alt="COM_PHOCACART_SHIPPING" view="phocacartshippings"
link="option=com_phocacart&view=phocacartshippings">COM_PHOCACART_SHIPPING</menu>
<menu img="class:countries"
alt="COM_PHOCACART_COUNTRIES" view="phocacartcountries"
link="option=com_phocacart&view=phocacartcountries">COM_PHOCACART_COUNTRIES</menu>
<menu img="class:regions"
alt="COM_PHOCACART_REGIONS" view="phocacartregions"
link="option=com_phocacart&view=phocacartregions">COM_PHOCACART_REGIONS</menu>
<menu img="class:zones"
alt="COM_PHOCACART_ZONES" view="phocacartzones"
link="option=com_phocacart&view=phocacartzones">COM_PHOCACART_ZONES</menu>
<menu img="class:payments"
alt="COM_PHOCACART_PAYMENT" view="phocacartpayments"
link="option=com_phocacart&view=phocacartpayments">COM_PHOCACART_PAYMENT</menu>
<menu img="class:currencies"
alt="COM_PHOCACART_CURRENCIES"
view="phocacartcurrencies"
link="option=com_phocacart&view=phocacartcurrencies">COM_PHOCACART_CURRENCIES</menu>
<menu img="class:taxes"
alt="COM_PHOCACART_TAXES" view="phocacarttaxes"
link="option=com_phocacart&view=phocacarttaxes">COM_PHOCACART_TAXES</menu>
<menu img="class:users"
alt="COM_PHOCACART_CUSTOMERS" view="phocacartusers"
link="option=com_phocacart&view=phocacartusers">COM_PHOCACART_CUSTOMERS</menu>
<menu img="class:groups"
alt="COM_PHOCACART_CUSTOMER_GROUPS"
view="phocacartgroups"
link="option=com_phocacart&view=phocacartgroups">COM_PHOCACART_CUSTOMER_GROUPS</menu>
<menu img="class:rewards"
alt="COM_PHOCACART_REWARD_POINTS"
view="phocacartrewards"
link="option=com_phocacart&view=phocacartrewards">COM_PHOCACART_REWARD_POINTS</menu>
<menu img="class:formfields"
alt="COM_PHOCACART_FORM_FIELDS"
view="phocacartformfields"
link="option=com_phocacart&view=phocacartformfields">COM_PHOCACART_FORM_FIELDS</menu>
<menu img="class:reviews"
alt="COM_PHOCACART_REVIEWS" view="phocacartreviews"
link="option=com_phocacart&view=phocacartreviews">COM_PHOCACART_REVIEWS</menu>
<menu img="class:coupons"
alt="COM_PHOCACART_COUPONS" view="phocacartcoupons"
link="option=com_phocacart&view=phocacartcoupons">COM_PHOCACART_COUPONS</menu>
<menu img="class:discounts"
alt="COM_PHOCACART_DISCOUNTS" view="phocacartdiscounts"
link="option=com_phocacart&view=phocacartdiscounts">COM_PHOCACART_DISCOUNTS</menu>
<menu img="class:downloads"
alt="COM_PHOCACART_DOWNLOADS" view="phocacartdownloads"
link="option=com_phocacart&view=phocacartdownloads">COM_PHOCACART_DOWNLOADS</menu>
<menu img="class:tags" alt="COM_PHOCACART_TAGS"
view="phocacarttags"
link="option=com_phocacart&view=phocacarttags">COM_PHOCACART_TAGS</menu>
<menu img="class:parameters"
alt="COM_PHOCACART_PARAMETERS"
view="phocacartparameters"
link="option=com_phocacart&view=phocacartparameters">COM_PHOCACART_PARAMETERS</menu>
<menu img="class:parametervalues"
alt="COM_PHOCACART_PARAMETER_VALUES"
view="phocacartparametervalues"
link="option=com_phocacart&view=phocacartparametervalues">COM_PHOCACART_PARAMETER_VALUES</menu>
<menu img="class:feeds"
alt="COM_PHOCACART_XML_FEEDS" view="phocacartfeeds"
link="option=com_phocacart&view=phocacartfeeds">COM_PHOCACART_XML_FEEDS</menu>
<menu img="class:wishlists"
alt="COM_PHOCACART_WISH_LISTS"
view="phocacartwishlists"
link="option=com_phocacart&view=phocacartwishlists">COM_PHOCACART_WISH_LISTS</menu>
<menu img="class:questions"
alt="COM_PHOCACART_QUESTIONS" view="phocacartquestions"
link="option=com_phocacart&view=phocacartquestions">COM_PHOCACART_QUESTIONS</menu>
<menu img="class:times"
alt="COM_PHOCACART_OPENING_TIMES" view="phocacarttimes"
link="option=com_phocacart&view=phocacarttimes">COM_PHOCACART_OPENING_TIMES</menu>
<menu img="class:submititems"
alt="COM_PHOCACART_SUBMITTED_ITEMS"
view="phocacartsubmititems"
link="option=com_phocacart&view=phocacartsubmititems">COM_PHOCACART_SUBMITTED_ITEMS</menu>
<menu img="class:statistics"
alt="COM_PHOCACART_STATISTICS"
view="phocacartstatistics"
link="option=com_phocacart&view=phocacartstatistics">COM_PHOCACART_STATISTICS</menu>
<menu img="class:reports"
alt="COM_PHOCACART_REPORTS" view="phocacartreports"
link="option=com_phocacart&view=phocacartreports">COM_PHOCACART_REPORTS</menu>
<menu img="class:hits" alt="COM_PHOCACART_HITS"
view="phocacarthits"
link="option=com_phocacart&view=phocacarthits">COM_PHOCACART_HITS</menu>
<menu img="class:imports"
alt="COM_PHOCACART_IMPORT" view="phocacartimports"
link="option=com_phocacart&view=phocacartimports">COM_PHOCACART_IMPORT</menu>
<menu img="class:exports"
alt="COM_PHOCACART_EXPORT" view="phocacartexports"
link="option=com_phocacart&view=phocacartexports">COM_PHOCACART_EXPORT</menu>
<menu img="class:logs"
alt="COM_PHOCACART_SYSTEM_LOG" view="phocacartlogs"
link="option=com_phocacart&view=phocacartlogs">COM_PHOCACART_SYSTEM_LOG</menu>
<menu img="class:info" alt="COM_PHOCACART_INFO"
view="phocacartinfo"
link="option=com_phocacart&view=phocacartinfo">COM_PHOCACART_INFO</menu>
<menu img="class:extensions"
alt="COM_PHOCACART_EXTENSIONS"
view="phocacartextensions"
link="option=com_phocacart&view=phocacartextensions">COM_PHOCACART_EXTENSIONS</menu>
<menu img="class:vendors"
alt="COM_PHOCACART_VENDORS" view="phocacartvendors"
link="option=com_phocacart&view=phocacartvendors">COM_PHOCACART_VENDORS</menu>
<menu img="class:sections"
alt="COM_PHOCACART_SECTIONS" view="phocacartsections"
link="option=com_phocacart&view=phocacartsections">COM_PHOCACART_SECTIONS</menu>
<menu img="class:units"
alt="COM_PHOCACART_UNITS" view="phocacartunits"
link="option=com_phocacart&view=phocacartunits">COM_PHOCACART_UNITS</menu>
<menu img="class:bulkprices"
alt="COM_PHOCACART_BULK_PRICE_EDITOR"
view="phocacartbulkprices"
link="option=com_phocacart&view=phocacartbulkprices">COM_PHOCACART_BULK_PRICE_EDITOR</menu>
</submenu>
<files folder="admin">
<folder>controllers</folder>
<folder>help</folder>
<folder>helpers</folder>
<folder>install</folder>
<folder>layouts</folder>
<folder>libraries</folder>
<folder>models</folder>
<folder>tables</folder>
<folder>update</folder>
<folder>views</folder>
<filename>access.xml</filename>
<filename>config.xml</filename>
<filename>controller.php</filename>
<filename>index.html</filename>
<filename>phocacart.php</filename>
</files>
<languages folder="admin/language">
<language
tag="en-GB">en-GB/en-GB.com_phocacart.ini</language>
<language
tag="en-GB">en-GB/en-GB.com_phocacart.sys.ini</language>
</languages>
</administration>
<updateservers>
<server type="extension" name="COM_PHOCACART"
priority="1"><![CDATA[https://raw.githubusercontent.com/PhocaCz/PhocaCart/master/manifest.xml]]></server>
</updateservers>
</extension>
PK�"�[_�����
script.phpnu�[���<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
version 2 or later;
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.filesystem.folder' );
class com_phocacartInstallerScript
{
protected $extension = 'com_phocacart';
protected $updatetext = 'COM_PHOCACART_UPDATE_TEXT';
protected $installtext = 'COM_PHOCACART_INSTALL_TEXT';
protected $versiontext = 'COM_PHOCACART_VERSION';
protected $extensiontext= 'COM_PHOCACART';
protected $configuretext= 'COM_PHOCACART_CONFIGURE';
function createFolders() {
$folder[0][0] = 'images' .
'/phocacartcategories' ;
$folder[0][1] = JPATH_ROOT . '/' . $folder[0][0];
$folder[1][0] = 'images' . '/phocacartproducts'
;
$folder[1][1] = JPATH_ROOT . '/' . $folder[1][0];
$folder[2][0] = 'phocacartdownload' ;
$folder[2][1] = JPATH_ROOT . '/' . $folder[2][0];
$folder[3][0] = 'phocacartdownloadpublic' ;
$folder[3][1] = JPATH_ROOT . '/' . $folder[3][0];
$folder[4][0] = 'phocacartattachment' ;
$folder[4][1] = JPATH_ROOT . '/' . $folder[4][0];
$folder[5][0] = 'plugins/pcs' ; // Shipping
$folder[5][1] = JPATH_ROOT . '/' . $folder[5][0];
$folder[6][0] = 'plugins/pcp' ; // Payment
$folder[6][1] = JPATH_ROOT . '/' . $folder[6][0];
$folder[7][0] = 'plugins/pcv' ; // View
$folder[7][1] = JPATH_ROOT . '/' . $folder[7][0];
$folder[8][0] = 'plugins/pcf' ; // Feed
$folder[8][1] = JPATH_ROOT . '/' . $folder[8][0];
$folder[9][0] = 'plugins/pcl' ; // Layout
$folder[9][1] = JPATH_ROOT . '/' . $folder[9][0];
$msg = '';
foreach ($folder as $k => $v) {
if (!JFolder::exists( $v[1])) {
if (JFolder::create( $v[1], 0755 )) {
$data = "<html>\n<body
bgcolor=\"#FFFFFF\">\n</body>\n</html>";
JFile::write($v[1].'/'."index.html", $data);
$msg .= '<div><b><span
style="color:#009933">Folder</span> ' . $v[0]
.' <span
style="color:#009933">created!</span></b></div>';
} else {
$msg .= '<div><b><span
style="color:#CC0033">Folder</span> ' . $v[0]
.' <span style="color:#CC0033">creation
failed!</span></b> Please create it
manually.</div>';
}
} else {
// Folder exists
$msg .= '<div><b><span
style="color:#009933">Folder</span> ' . $v[0]
.' <span
style="color:#009933">exists!</span></b></div>';
}
}
return $msg;
}
function enablePlugins() {
// Enable plugins
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->update('#__extensions');
$query->set($db->quoteName('enabled') . ' =
1');
$query->where(
'(' . $db->quoteName('name') . ' =
' . $db->quote('plg_pcp_cash_on_delivery')
. ' OR '
. $db->quoteName('name') . ' = ' .
$db->quote('plg_pcp_paypal_standard')
. ' OR '
. $db->quoteName('name') . ' = ' .
$db->quote('plg_pcs_shipping_standard')
. ' OR '
. $db->quoteName('name') . ' = ' .
$db->quote('plg_pcp_pos_cash')
. ')');
$query->where($db->quoteName('type') . ' =
' . $db->quote('plugin'));
$db->setQuery($query);
$db->execute();
return true;
}
function install($parent) {
$this->loadLanguage($parent);
$msg = $this->createFolders();
$this->enablePlugins();
JFactory::getApplication()->enqueueMessage($msg,
'message');
return true;
}
function uninstall($parent) {
//$this->loadLanguage($parent);
return true;
}
function update($parent) {
//$this->loadLanguage($parent);
$msg = $this->createFolders();
JFactory::getApplication()->enqueueMessage($msg,
'message');
return true;
}
public function loadLanguage($parent) {
$extension = $this->extension;
$lang = JFactory::getLanguage();
$path = $parent->getParent()->getPath('source');
$lang->load($this->extension, $path, 'en-GB', true);
$lang->load($this->extension, $path, $lang->getDefault(),
true);
$lang->load($this->extension, $path, null, true);
$lang->load($this->extension . '.sys', $path,
'en-GB', true);
$lang->load($this->extension . '.sys', $path,
$lang->getDefault(), true);
$lang->load($this->extension . '.sys', $path, null,
true);
return true;
}
function preflight($type, $parent) {
$this->loadLanguage($parent);
return true;
}
function postflight($type, $parent) {
$this->loadLanguage($parent);
if ($type == 'update' || $type == 'install') {
if ($type == 'update') {
$status = JText::_($this->updatetext);
} else {
$status = JText::_($this->installtext);
}
$version = JText::_($this->versiontext). ': ' .
$parent->getManifest()->version;
$link = 'index.php?option='.$this->extension;
$component = JText::_($this->extensiontext);
$configure = JText::_($this->configuretext);
$o = '';
$o .= $this->getStyle();
$o .= '<div class="g5i">';
$o .= ' <h1>';
$o .= ' <span
class="g5-title">'.$status.'</span>';
$o .= ' <span
class="g5-info">'.$version.'</span>';
$o .= ' </h1>';
$o .= ' ';
$o .= ' <div class="g5-actions">';
$o .= ' <a href="'.$link.'"
class="g5-button">'.$configure.'
'.$component.'<span class="g5-icon
icon-chevron-right"></span></a>';
$o .= ' </div>';
$o .= ' <div class="g5-phoca">';
$o .= '<a href="https://www.phoca.cz"
target="_blank"><span>Phoca</span></a>';
$o .= ' </div>';
$o .= '</div>';
echo $o;
}
return true;
}
function getStyle() {
return "<style>
.g5i h1 {
color: white;
background: rgba(0, 0, 0, 0.3);
padding: 1rem;
text-align: center;
left: 50%;
position: relative;
/*margin: 1rem -0.5rem 0;*/
margin: 1rem 0 0 0;
transform: translateX(-50%);
line-height: 1.5;
border-top: 1px solid rgba(0, 0, 0, 0.1);
}
.g5i p {
font-size: 1rem;
color: white;
margin: 1rem 10%;
text-shadow: 0 0 9px black;
text-align: center;
background: rgba(0, 0, 0, 0.1);
padding: 0.5rem;
border-radius: 3px;
line-height: 1.5;
}
.g5i .g5-info {
display: block;
font-size: 1rem;
font-weight: normal;
}
.g5i .g5-actions {
text-align: center;
border-top: 1px solid rgba(255, 255, 255, 0.1);
padding: 1rem;
}
.g5i .g5-button {
display: inline-block;
font-size: 1rem;
color: white;
border: 2px solid rgba(255, 255, 255, 0.8);
border-radius: 3px;
padding: 0.5rem 1rem;
background: rgba(82, 195, 255, 0.1);
vertical-align: middle;
transition: background .2s;
text-decoration: none;
}
.g5i .g5-button:hover {
background-color: rgba(255, 255, 255, 0.2);
transition: background .2s;
}
.g5i .g5-icon {
line-height: 11px;
vertical-align: middle;
}
.g5i .g5-phoca {
background:
url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIIAAAAxCAYAAAAWXXEmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAt+wAALfsB/IdK5wAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAAWdEVYdENyZWF0aW9uIFRpbWUAMDMvMjkvMTg/PVhkAAAT30lEQVR4nO2ceZRcVZ3HP/e9erUvvTdZm6wQSAiibGGHdFBSzY6ALB6ZA6N4GFFHHcbxKB4FlPGMuCADMxGdwZFFHE6aLewoBgEjIYmkzUKWzt7d1V1de7337vxxX3VXV71KutNB5oT+nvN6eXXv7/7evb/7+/3u7/d7JRqWda0BfEzgw4z3PMBswP9BczKBDxRS+6A5mMD/D0wIwgSACUGYgIMJQZgAMCEIE3DgGUtjOYa2Ypx0R9P/YPsBSAmmlFgOEU2ARwi0sTA+GrqArgn0cdCtNe/jZHUERiUIAshbkoIt0cWBh7eRmDZYtkTXBCGPwOMywxJIFW08FTRt1DgBj0C6zIJw+gkBomw6pDNlIY9Wc/LSRZu8JQl7NZr9OlGvjibU/Z6cRSJvoQlBxNDQxeiFP2tKsqZNyNBoDujEvDq6gIwpSeQtenMWppSEDQ2fJkZFVwB5W1KwqufdkhKvLkZN60AYlSBkTMmCRh93n9JSc3GGIMC0Jf15mw3JAit3Z3llZ4bdGZM6nz40ubZUC3fv6a0sbPIP0xRg2XDHqh6e604TMqqtV6po8+WFDVw0IzJypQT8smuA+9/tJ1LWTwBZS5Izbc6YFOSKWVHOmBRgetggbGgIIGdJdmdMVvXk+N/3Blm+NcVgUVLnrS1UAijakmTB5qPNfq6eE+WcKSFmRAwiDt2CLenNWazvL7CiO81vNifZPFAcMRe1kLMkbRGDH5/eSsTQhuZICBgs2tzy+z1sHSziG4+6cTAqQchaNie1+DlzcnDMA3xhAXSnivx0XYIfvZMAAQFdYElJo0/n+qNiePXqxW6fFqJzS4qQMfK+BBCCq+fEmN9QHRBNF23uXdc/9L8A+gs208Ievn/KJK6YFa3o4WgRTWNWzMusmJcrZkV5uyfHbX/cyzPb0tT79So1LFAbxNDgntNbufnY+gqtp+gGNI2pYY2pYYPFU0Pc9pFG7n67lx+s7jvgjk4XbK6bG+PcKSHXz6+bG+W2lfvwBfQaFEaPUTuLRVuxK6Uc8zU1bHDnyS0sv2AqYY8ga0oEaqoGi3YVXVCmqJYRFKgFd+uXMZXJKLVLFGxOaPLxu4vaHCGo5A/nKqMjJcc3+Xl66XS+tLCBRM6qVDxkTEnEq/H00mn8w4IGPJo4IF0pJfU+nTtObuFXiydj2cPzWglbQtincdGRYdd5B7iwLUzYp1GDxJjwNzk1lJg/d0qIR5dMVebjUBi2/aDkR8yNeXnygmlMDRtDC1TZrlLepMMzwA8WtfL5+fUkctZQuxLvj7VPYdERwRGLU0m7EiVBu2xmlB+e1kLSEehKpE2bk1oCzKv34W5AJMc0+DmxOUDadKcxFhwSQRBCuF6VkFJy5uQgt8yvJ5O3DsXQNWFKZUt/fs4RNAc8VQs1xKNzufFc6vPD01o5qTXAYNFGAAN5i9tOaOSMycFquhW0Xek6P286pp72qaEhrViOoim5ZEgbVD9f6d7FM8IUD8GuGtPxsRIl9f6Lrn72Zq0h9RjwaJw7JchRdT7XnfK5Y+u4d11i6Ij1fiBZsLjh6DpOaXVZLCEoWJIfrenjpZ0Zipbk2AYftx7XQFvEGNFeSolHE3znxCY+8VQ3WUsyK+bli8fVuw8sBL/emOShDQPkTMn0iMFnj6njxJZABV0lgzfNq+P57vQIEpaEhoBOhyMI+8OFbWG+9VYPlmRcR9RxCQIChIQ7V/XS1ZMDj6NgJAS9Gr89fwpLpoUrFkLSFvGysNHPu4n8uIavBSklXk1w47xYNctCHWuvem4Hv92QxOPV0AQ8ty3FY5sHefHC6cyJeat4bp8W4uQWP3/oTnPZ/HrChu4qYD9bl+Dml3eheTQ8AgrbJY9sTPK7i9s4vslf1ee0IwK0BjxkTHvI2UwXbT4xPURbxOuuDoYflCOjXha1Bnh2e5qo9+AV/CExDXU+Hb9fp8G5GgM6WdPmrj/3AlCuGUvPNTNq1HSUxgtpSY6q8/HR5oDLp4KHNgzw201JGsIeol6NsKHRGPTQPVjkqyv3Oq0qeRa0Tw2BDedNqT49CSHYmzX59ls9hHw6dSW6AZ1UwWLZ+gFXXlsCHiaHPJRbB9OWXDozosbe33M6vy+dEcEc51y+L86iBAK6xt6shWVL3NymoGf/gRBbeWxYLpcp5f6DKJbkmHqv2mFlO6rExSObBtE9Ix9dAjG/zss7M2xOFkZKr4OFTX48fp05Ma/rsC/vUPGS8nO9BHRdY3uqqHio8Bt0TRD1algOn6YtmRTycMH0arNQy/e6oC1Ea9AzLmEYn2nYDzIFi5nRIHrFYpSQLNj7DZEaGng9GgG9esGQcv+hYAmTQ57h9iUIQd6y2VIjCKMLGCjYdPUXmBmtXuzWgE6jX6+pgjcmC673/bpgfX+Bt/ZlqfMOmxQhBLvSJu8lh/lJFW2WtoVpqXBwhRDsyZgIwcjPpOSIoMFZk4M8tilJne/gYgqHRBDSpk2uaA85f1LCMY1+vntSs/q/rG1JoLsGCnhreDdSSm6cV8cnZ0VdF1xKaApU2+hyBDzutPOWJG/LmqrQlrLmccyrCXy6QKsRZs/X8H79umBHusjZT2yreua8JfEIRVsCNnCZYxYq8dCGAQxNcMuChqF7JX172YwIj2xM1niqA2NcglBah2VnTyJVtClt/oBH4/hGHz6P5rJYgjW9Odb25mkJ1h4+4tWJePcn3dUxgdHALW7g1uZgUKufBAxNDAWZyuHTxdDpq2BLjoyoCKQb3ae2pfHpShBKfUponxZiWsSgP29hHETm7JBohBNb3Jwyqr1q5/fdq/vIm7V3pVvfwwEqSVYbqaLN1bOjxLwV2k4I9mVNVvfmMDRBImdR79eHpKoUsTxvSpBfdA1QfxDm4ZA4i7VCy+UQKtLCsvX9PPTXAcK+iVKISmhCcNkMd7PwxJYUPf0FdvXl6dyWcm1z+czIQWuz981ZLEGZU8XeT9b08Y8r9xI2amf0hvsd+JEORmtIDpxaPlhddKAspTKfw6clgfIJooZGwZbMjXlrJvY0AdctaHCcZfdxzp4cYlbMy860OeaM5CERhP0tWsGSvLIrzT3v9PHkthQxr4ZHCAr7OeoIIXh6W4pHNiar0tASNalfO76RWVWBn2HUctx8msCrCWpF54UQBF2yoTjjFmz3vAJQ0/kt2JImv879Z02i3qdjO/01IdgyWOAbb+6jP6eCSAEXv0pKyQ1H13HD0XUj7lW2CRka508L8ZM1CXz62MzDIRGEhzcm6cmZQ5Exy4bevMWmgQKrenKs7y8gJTQ4tms0O+6tfTkeXN2HqEixSgBT8um5MWbVOM8jYFfGrL4vJT6PxvSwQVd/AX/FwtkSQh7B7JhR3RfoyakCk8GiTYPLmyCzou79MqZkYaOfK2dXpsABQixbP8DeVKbmaUGxPjo9demMCPet6x86TYwW48s1OK7rN9/soasnOxxidqBpAr8uRhSJjBZ+XYBfr3J8JJDVpWvF0xB0wbuJAraUShWXnCqco9bMMM9sGQTvyOKV/oJF+9QQc2LuGb+1fXmKWYtNyaIK/1bgnMkhWoIe0kV7hGq2bEmzI9CVsQHTVhVMRzf6Obkl4DruWHDaEQHm1XvZmCwSGIN5OEQhZm1EiLl01Xm1ql33t4BwBOGd3pzLp5Lr59bR3hamL2WSNm2ypqoiihoad53cgqiIgZUs33PdaRDw0o5MNVUpaQ16+OZHG0nnLZIFm6wl6S/YIOHKqoIYhX1Zky3JIpfOCDtJu4pnEbWzu5UWWUqJV9dYOj1MtkZ6uxYOS9ddCEHWtF3j+1IqW/74+VO57aQmPtLk55h6L1fPifLKRW2c0FydGALB67szvLY7iz/g4bHNg2RN2zVtffP8Bv57yRTOnBRkXp2X86YEeeT8KZw3NeSq3t/Ym6Ng2lwxy90s5EzJznSR3ZmR1850kXyN9PMlMyP49LHVMr7vp4YPClGfzoNdA9w4r44FjSMXV0pVRHrHyS2lO5QsqltGEeAbb/ZgS4gYgvWJPD9Zm+ArxzdWDywl18yJcc2cGFLKYWGpEVP58doE85v9HN/kp9IsCCH45zf2ct+6RFXoOJG3uHVBA3ee0lKVKf1Ys5+FTX7e6c0R9Ixurx+WGgHAEKr48zMv73Iqnqt3r5pAWfH/MEpdbn9rH893qzSvBKJejW//qYc39mRdi05KVUjKh3LiKpUMCsHjm5O8sDnJ9XNjgKgwR0qrPbUthS1VGL/8siU8uS1FwRr5bFKq00hHW5jcGApWDltBkKjz+ap9OS55ppv+vKXsamU7l7AvlDSB4Pt/7uH2t3pG7EhDE5g2XPpsN2/ty7rb6xLtKrqK9h92Z7jx5d2EgwYX1yhAeX1Plk0DRYKGOnKXXyFDo6u/wJt73fwgVbkU9o6+nnHUguB1vPSRaVRVjjWW+v9yCAFh50RRmZ49kJNZUnmV/YJl7zRI1JH1hR1pznxiKy90p0eUjw1VqlHtlG1LFbn+xZ187fV9xJx3HyijG/IIevMWSzq38+9/SQDVjpwbXRDc/5cES5/qpi9ncu60IHPqfK7P0rk1hWlL12OgQMVonnKijJV95zf4WdQ6+nrGUfkIPl3wdk+etX15/PrwcayURt2eNocEZbTQhaA/b9O5NcXCchsuVKn773dnMVyEQaAyhE9vT+H3VLv3K7anKbemJWHYMFDggqe2c8H0MFfNjnJqa4DJIY86hjoqvCdvsqY3zxNbUjy8McmerEmD3z0wo4RBRQQ/++puftE1wLVzY5w7OUhbxCDg0YYcgXRRpb5f3pnhoQ0DrNyTJWJoBAydvpzNmt68877I8Lz25S2e2DI4tFHcEDI0Hn9vkEtnRkbkJ4QQpE2b/oJNjSRs9bw2LOvKcoAvyhCoSJ0QOMUew5/lbZVGNQ7ijRtbKrojdr9QC1201fsPtWhmTakyd6U0nCMTeUvWTEFLYLBgY0lJk19VBtX5NHQEg0WbPVmT3RmTgi2JGtqYnilj2uRMScynMznkocmv49UEOUu9QbUrbZIs2Pg9YliboeZPUDGvQu12rSw97QYBTqQTtWnK+peqv0b5JtRfRyUIJbjZmwNl1A6Eki2txGgUjBs/o1VMllSTZTmGXBMCQ2P/gapRwC6jWypQ9Qj1yl8t0q7zimuRlCtcfZEx9Af+Oqbj43hfEHXDGBkegfHwowvQ9dFUJ4wNmsCJKo4hqjdOFsa7GeEwPjVMYGyYEIQJABOCMAEHE4IwAUAJwsR3LE6g3gPczWGcfLKFZvdHpgwgtOETll3UGgZ31hWlMActox+B0IXli2pWOGEZiZhmxjQhRcIyBsKaGUrZeiasWcGU7Uk36MU6gLStZ/K2nkEgwloxYgjpTVhGf0Qzw4O2kYxpxRgCMWB5Bhr0Yv2graeLtp5FSE+9XowJEDmp5TO2lm/QzWifZQzU6cVoxtazFkhLakWkMAF8mhXKSy2HFBbCNup0M6qVHRT6LCPhE7Y/pFmBAVtPWbaeQyD8mhnyIY0By0gAIKRRrxejphTmoG0kARnWijGvkP3icKwWrsJU0Y4oE/YiaXbLV0Fof3n20WssSWiBb/AFzvnMhq0rHj6/bcmVzwJsX/HrxdPmPvfang2LP9Z66n1/3LHyc6dPab/qRQBefaBtbaZ+sQDr2I9f/qBq/3D79CVXPb9pxcPxmUs+uRxgiN6r90//c6bxykbNXD19yZUrAFh5T0tfunlGw+JP/XHvc/9zWkv71a/x6gNt+aK/bp9lNCdsY7YE/Th/8tn3CqGjBm297Qi9sLql/erXyh9vy4qHP35kZPcqTv3CXuvFX85/txA8VQILZvzuVxx1T/rdZx+7rihFpFkvrpvUftUrAGueeewmiTCO+/jlPwXJYS8IclFokoCdFbcH+UM6+vjzLy0xculfAl8GvgdcA/wnsATYC6wBbgG+A3wFuLcjHp8DsLyz815gAfA8sBS4DHgZuAL4E/AN4KfO35cAjztj3AR8ryMef3R5Z+dZwA+BM4EkcAzwVWA7cCXwI2Af0Af8CrgV+DpwT0c8fr/DRyPQAzzUEY9fu7yzsxPIAS8BNwB3AD8Dvgb8PbAMaAe6HdqzO+LxGz4MzqIE0hX3St+tU0AtQBDoBfYAg4Dl9EsARad9saxfie4rHfH47Sg1fRawA+V3rQMuBs4AuoDFwNvO4v0dsMqh8boz7jWoxV4KxICnnPFagQZgE5ACAkAe2FrGx6eA/wLqli9f7nH4XwWscPpGgS3Ac8AuYAZKOI8F1gJfgolTQ6mifB9KAxyPk5LoiMfTgMHIOSqviC2vDy3/W3fo3Qn8K8MV9LnlnZ1NwD0oYaAjHs+jdubXURrnCqBOKk1koARrO0owQQnNeuCEMj6uQGmA2QixCCXMlwO3ozTIG6gvXr8bJUB3IuUDKC33aZTG+NALQgk2EEZN+DrgC8s7O7+IWoSdKGe6CLQu7+y8dnln51KUUCxw2qVQqrj0rlpDRzz+G2AlcBzwNDAPOAe1mOVfF7MaaLJt++coIdpzoRJC3RlTB450/rYdXuoBlnd2Hg00ozTAC8C1KI3yQEc8/qmOePwJ5/PNHfH41R3x+K0d8XgSIf4DmO/w3AYfDkGwUDZ0X9nVay0KIYW+FzW5DwKrO+LxR4FvAZ8Hvouy13uAzagFzKJ29D8594512t7cEY93O/fSKHMASius74jH3wX+DXgEmIKy/SWsAh6/6MILJfAk8IpzfzNwF/BzlKba5PAZRcrbnTbzgZc64vH7UD5ABGXqEmX0B4ENFXPyL85z3oXyZfg/WEEESTL9tx0AAAAASUVORK5CYII=');
width: 130px;
height: 31px;
background-repeat: no-repeat;
position: absolute;
bottom: 5px;
right: 5px;
background-size: contain;
}
.g5i .g5-phoca a {
display: block;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
font-size: 0;
}
/* container */
.g5i {
position: relative;
margin: 15px 15px 15px -15px;
background:
url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAsICAgJCAwJCQwRCwoLERQPDAwPFBcSEhISEhcYExQUFBQTGBYaGxwbGhYiIiQkIiIuLi4uLjAwMDAwMDAwMDD/2wBDAQwMDBAQEBcRERcYFBMUGB4bHBwbHiQeHh8eHiQpIyAgICAjKSYoJCQkKCYrKykpKyswMDAwMDAwMDAwMDAwMDD/wAARCAGRBIADAREAAhEBAxEB/8QAHAAAAwEBAQEBAQAAAAAAAAAAAAIDAQQFBggH/8QAMBAAAwACAgICAgIBBQACAgMBAAECAxEEEiExBRMiQTJRFAYjM0JhFVJxgSQlkaH/xAAaAQEBAQEBAQEAAAAAAAAAAAAAAQIDBAUG/8QAJREBAQEBAAIDAQEAAQUBAAAAAAERAgMSBCExE0EiBRQyUWFC/9oADAMBAAIRAxEAPwD+UGWmFAAAAAAAAGkVhUAAAAAAAAAG78aAwAA0KAADQNAAh0loK1EU2grUAxAAboDdEGhTaAbr4IE0UACsoRlQjCEYQpRhRgRgAAAAGAAAAAAAAICqCtCgAA0AAANCnkiunDjrJcxPunpGbWn0PyH+k/kfjuFHMzL/AG7OM8stwleVjg1a6R148Zztajsxwc7WnVEmKqqlkDaIOTm3paNRXnG2lERVsdapMzR9BxPmFjwdDydeHbo8/Nn+3I6OvPOK3HemLFdf27RzxDSwKpkAwhNeSi2PD2Jqa6o4myazq08Anszqn+Ev6HsmkfHS/RdNL9SLoV8eWXU1LJwU0bnRrz8/AcvaOs6NNjStdb8UZsanSWbj9RK3rkqDap9CjegD/SNC/SxqMePQUnUozqUZ1AxoDz+Xy9fhH/8Ap244cuu3ms7OLNBC6KM0BmgM0FZoDNBGaKM0BmgDQGaAZIg3QVqQFJRlp0Y0YrcdeJHOtx2YzlXR1QjCqpEDpEQ+gN0A0oI6saMVXXiMDuxGarsxmBdEGhGabegrqfx+RYvsJrn/AEm4Xi4lkydaFXq5D/J8aMWPcl4rPHWvzkfoHgYUAAAAAAFaAEAwVhUAAAAAAAAAAAAAGgADIKe6VfrQChDIinSCm0RWgaQaBugN0BoGgaBgGAYFI0VCMqEaARlRhUKBgAAAAABgAAAAAAAPLCnCgDQNAAAAIqkkV1YLcXNz7l7RmtR9Jzf9T/I/I8KOHmf+3Bw/nl1qR5+LGW10jsx4zla06ogwOnHBmjpnGtGBPMlC2ag8Xk33s6xtFIodIgdEVSTIrJFVlkF4ZjB0SzItLJgHQxFcMdjNR6XH42znaza9PHxtIzrFqjxpBlfFhhryRm1x8vFKfg3ysrhaOisSAokEJeFUWUcPJ4njaOvPQ83JmrH+ORbX9nT11qdJN47/AIsZY6az62RR1AdAXx8erl0ltT7M6ahlxmpRPHx6y5Fjn+VeEW0X+R+J5Px7lZ1/Lyic96k615mXLjxL8mdZzaXp5nI5d5PE+Ed+eMcuu3G0dGC6CM6gZ1AzqFZ1AzqAdQFclGaAzRBqlaCl6gCht6Gj3uZ/pnLxfi4+Qdpzf6OHPn3r1Hg6O4ZICsoy0vCMVt1YjnWo7MRzro6oRzqrqSB0iIdIDdAPjnbJUejjxLRz1DqdMNOvGZo7MZgXlED9QBLT2B2VzqeLpomOX8/vXEqqa7L2V1ZyMl3D7MvKfj89H33zQVTzjqvSJrU4tdOP4/PfqTlfNI78/G6rqj4TPX6OV+Ty9E+D0r/8Bn/ox/3ca/7Gkv4PkT+jU+VyzfhVy5Pjs8e5Os80rh18bqOasVT7R1nTjeLCNFYrFr9lRgQAAAAAAAAAAGgAGgaBoGoBkiKdIKcyrdAboDdBDKdkG6ANAaAAGijNAN0IqVI0JNFQjARlQpUYBgGAAAAMDAAAAAAAA2fYHfn+P5GDDOa1qb9EacpRoGgAAFMiKdEV0YyVqO7jzs5dNx6scfUpnC9Oi8QYVVIg93/O+P8A/ilx1i//AJH/ANzl63XPLrim1o1jTz+fyf8AqjfMajy/bOim6EDJBTpEDJEFERVZMisEHRJlFdkAvLA9DiRto5dM19HxuI1jV/o4Wudro6hln1NlRKnWM0OXK3RqKj9ZsasQRv1kB0KEyY9yWDw/kMHs9PFHz2Wai/xej0D0uLy+mL812OXXjX3SfPwuvWifzrc7Unk8ev8AsT0rXs9HjZcShr7PD9nK81L05uVn40f9jfPNT2cH/wAnOK1eL+U+mdf5aXtL5D5vn8+l9tb6+Eb58XPLnrzM85G+1HWJqHU0heoGdQM6lGdSKzqBnUBljCkcAZ1AxwFK5AzQB1A3qQXyc7l5MKwXkbxr1JmczdHNo2GSIK40StOhSYaWgxWnZiRzrbsxo51p0JGA6QQyQHVxsPHuLeWurX8TNtZqM/jRR2Rm8GcFYfZhXbiRijtxowLogZBWhGNAIyieT+DNQfn+YdPSPu24+fzzb+PV4XxGTL5a8Hl8nyJH0PD8O39e5g+JwYl5W2eDv5Fr6fHxueXdGCJ9I4Xuu85kWUGLVVUGdDqF/RnUZXEw3/KSzyWM2SvP5XwGHItwvJ6OPl2frh34Oa+Z+R+Iy8d+vB9Pw/InT5vm+LZ+PKqGvZ6pXhvOF0VkFGBAAAAAAAaAAaBoGgaQNoB0gGRFOiK0DdAbogdeAADQgCtAwDCjWyCVFE2jQmwhGVGaKFAwDAMAAADAAAAAAAAEB2ZfkeTmwzhyVuI9BrUEwNA0DQABkRTojTpxGa1Ho8dHLp1j1MTbRwrToSMCiQFEQRz8jotIuDzKp3WzatlBVvGiBdFDJEDpEVRIgokQVlGRWSIbZMFMK2xR7XCx+jh0zX0GHJX1qf0cccjgXnWhjLmzpM3ByvGaULEVB9YRvQoWoARwVXm87jeGdeKuvmeZg02ermjgbpeDqyn12FPOF62EdeJ6RlHPnezUVzdTQxfi9gbmyd1oQc2iiuSoqEkvIEeoGdQrOoGOQM6hTaAWkFKpA3oRSVBQvUA6gN9ZBnXqFJooNBFJ8Gaq8mWnRjRitR2Ykcq27MaOavS4Xx+blb+tejj33IWkyYaxW4r2jUujNFBoICisER14TNHdiMUdmNmRcimAbZBjZQpRPL/Blg/knx3xKn88iPV5vkf+nr+P8WT7r24iZWpR4rdfQkw6RkVmDFoooM6iswZtRRQZ1D/WZ01vQmprl5nFx5vxpHbx+S8mS/r5X5X4Rxu4Xg+r8f5O/rwef43/AKfO5MTh6Z9GXXy+uMT0aYxgQFRgQAADLWgrAAIZEGgaUaiB0AyAZEU6IG0RWpAboBiAAAGmXTSX7CPY5H+nOXg4M8yv4Ucp5ZesY/pNx4x2bYBgUrRRNoqJtFQjRRjQClGaAxoBQMAAMAAAAAAAAAANTAdMK3YABoU6CqyZadWJGK3Ho4Dj06x6WJnGq6ZMivoghn5SlaRqRXnXkdvybVqAdEDogfQDJEQ6RBRIgokRVEiBtgL2A6uN5ZjpH0XBj0cOmK9aV4MMHA3yVCuWyoz6wg6FRjgDOpQlSUZMgQ5eP8TfI+W+RxrbPVxWniZJ8neBepUUj+iCqnwREMkeTUEupQjkom5KFcAZ1AOoVnUKOoGOSKTqAdQM6hR1CjRArkBHJRsoiuhStEVHJIEtFRmgGSCrQjKunGjnWnbjOdadeM5tPV+O+Ry8TfT9nDvj2SwmXI82R5K9ssmKTRoboqM6hDwgOrEZR24jKuvGzI6JZBZdOj3/AC/QT70uiKxoowBMv8Gag/n0rwc6+1FEjCqxjdPwZtHQsFz7Rz9oKLGzOopMGdZ1WYMamqTjM2o2oQ0ctzujrK1E8mGck9aRqdYr5L5v4j627leD6/xvkb9PB8jwf6+bqGno+lK+X1zhGisYXRUYGQUYEaAAaA/T8O3/APwgwBkA2gNQDAMiCkkVTRlRoDdAAAAANL6vf9BHqZvnubn4i4l1/to5TxTdY9JuvPmNnVstzoCZRjKEZRNoqJsBWUKyjAFYGAYArAAAAAAAAAAAAANgN2AbYGoKpIV0QjNbjrxI5V0juxHKukdsVowqv+TE/szio5ea68IvqOZ06fkqnQFEQOgHQQyIHRBRIg7uLxIzY7qr6uf0c+usTSdNFUPwAjZQv7A7+GvJz6R9LwfSOHTFemkYYOkUP1CN6hGuSom0UIVCsBdFBoCHJf4m+VfMfI+Wz08NPEyTtncJ9bCBLQD9ionXkBGijHJQjgozoBnQDOgB0Cs6BWdCKVwAvQKzoRW9AMcBS9AEqQF1oKdUQLT2UTaAzQDJAWhGVdEGKrrxsxWnRDMK6sbMVXRJgPoBkgg6hDzAR0RJB0QjI6sZFdUGRZEVoQFC6CpZf4MsHwkT4ONfZiqgxquzhzKv8jj5PxHp5vpc+DzTWUPrWjemsWMamqqTOobqRCZPCLFieLF3fk1esbLePrWiyjn5PAfKw1KWzpx5vSp1j+f/AC3BrjZ6lrR+g+P5fbl8v5HjyvLaPU8dhWjTGF0VlgRgQAADBGoBkgGSAZIBkgN0AyRA6IKIyp1IBoKxoBQAAA0IrN6AW72AhUYAjRRNmhNgKyhQMYGFCsBQMYGAAAAAAAAAAAAAAAAyoKrOQK6IyoxW46sfIlGK6RdcvXo546ax8u2PU0LLT9smKrNEVaaIKyzIqiB0BREQ6QDogoiC0VpGQ3YgV0UJsDUB38Tw0Y6H0XBr0efpzr2I8oyyqpCadIIdQEDkIfBjl1+RUJzccL0UcJpoII3QHHzH+JvlXzPP9s9PLTy9eTsjWvARFoqs6hCNGhmgDQB02B04sPG+i3k39v8A0JqOb6yqPrAz6wo+sKz6yKR4wJuArOoVvUgPrCj6WAr47GqR8djRKsTRUTclC6A3QGpAVhGReUZVeGZrWrzRjFdWJmLFdcMwq0mTVEiIooCGUhFJRB0wiDohEV0QQWRFMAaAxoIhm/gzUV8XE+DzV9iVaYOdotMGLTV8cUc7UXSZhF+yeNRr1+znn2xn3pdFaYBz5a2zpGoWW16FaNp0wO/iWsK/JHDua49zXx/+rOIslvLK9n2P+n+TJjPk43l8Pcaej7cr5fXJEkq8+jTGDL1dfgtIsZ6S6tmtYxmiss0EboI1IBuugGSCGSAZIgdSQb1ANAMgKIyqiIrdAY0AmigUN+gGrFc+0TQhRhQBAABGsohZoTYClCsBQMKFYCAYAAAAAAAAAAAAAAAAAIBtBVZMtxeDFdIsjLbQp5ZFXgyqqogrNkF4oyq8syHTCH7EDKgG7kwMshMG/YMGdxgeSCsog6uO9MzUe/wK9HDpivfwejmw7Ps/2+mv/wBmvb6xkTD9/omfWmq6IhaAVY7flFRDKq/7Gg+PhVa2y5TU83GeL/8AANQfhBXl87L4Z15ivnOZfs9HKvOb8nUDYCaKNCEaKKRjTRAfUEVx4kBesS0Qczx+Sqz6wN+oKti4+1trwZtC5eM/crwNHNWMrSbxBSPEFYsTYHTj4zZKOmOF/wCGdNV/wf8AwaaS+D/4NTXJm4X/AIa1Xn5uM0bHLUaKF0UMkQVlEFZMht6Ji6rFEsXXXiZzsXXZjZzsXV4ZnDXRJkXkgdIiL8eMbypZHqP2yM2rZVijK1ie4/TCw0sirQwqyZFPPlkFXpEQrKObkfwZqK+Rxz4R4+n1o6Jxs5WqtEGLU11448HK1NNUmU0utFU+KVeRS/CZnq5EtyH+Rw4+PrpW9k8XVv6z4er1+vLPQ7nRKOjGkc6jp69jDLzvmeEsnFrwej43kzo3X815mDplaP0nj62Pn+Xn7cjxnbXC8kcGpXO8l6tF1nC9TTGNUBMDgqF6lQ2gGUkQ6kIdSQdOHi1cul+jNolS86KF0BugHRA8kaMBmgrNAPiro9kQ+fN9gkHNo0MACjAjAjK2iibNDNBCNBSMoUBWUIwFAwAAAAAAAAAAAAAAAADZemFNvYVSTLUXgxXSLIy20KZAVmjKm2QetxfhuVyOFfNj/jj2cevLJ16q5IrXg6C85DIfuQMsgDKwG7EFE/BBmwKSQXhGR0SiIvinyZo9ng310cemK9/jZNnJh2ryEVV1rr+jW3MZUVGQlFFotKQjmzNb2VHVgyy4OvPWIjzMk9dGL91XkcjJ1RqRp4XNz+zvzGnicits7Qc2jQ6+Xh4cY8b499qa/Nf0xGXJo0rNAbMbAtOMiH+sBlOgG8sgz6aGhXGiq1QQU3fTp/1IrpxcxY+NWFxt1+zFn2zjznG2bbMsBNUPjpjQ8cMaa9n4fgcSs2uV4kzazafkcfDGali8x+iJqX1oqlrGgOfJhTKa8/kcT/w3GteTyOM1+jY43GmaApArKMhtBChdUgmGuzCYsa11x4OeGujGzNi66ZZjDVoomGrSzOJp9kw1s0MXXRBDXdxMH2MxUvS/IwfUSLOnNNmsdFlZMRjoDl5N/gzfMV89gj0fO7fVjujGjhamtcrZDTyzFQ/sgVhUrvp/+TUjUjnu7t7p7NyY3JjEih0jKLYtmay7ccs42sWqZcKvBSf9Di50x7fb+Z/N8dTya1/Z+k+N1vLHljyXiPZrzWE+ousYSsZuVzsScGtc7GKSsm6OvCKh1j6TSqdt+mNZTnEVDdCIbqEapAvGS4nS9MzRPWyg6gZ1A3QDoKZEU2iKzQGaKFaAXQRmijNAYwF3oqFutmkTKMCFYCsqkYCMoQDAMAAAAAAAAAAAAAAAAAEA6CqSZbjogxXSKmW2hTAaiB0RXbh+R5eLA+PFtY69o53x826JSzQtjr8vJKrpyOOvgxBJUaDpkFEQUWyCkogvCMjohGUdEog9T47jTlfk493GOq9DNgnDrRiXWZXTxcwsHrYcm0YZdKKh0BjKhd+QjMqWio5u7n9lVDLyP7ZqRXl8rkbOnMV4XKyts78xXC/JsNihVkma8JvyEfU/K/CfFYPiZz4aX26//wBL/jEr5TRW2zj2B048SM6iv0k1CVOijNFVbBi7MzaleguNPUxrGuLkYUmalbiU4nXhF1o9cbIv0TTUnia9l1WfVt+CCv16IKYsO2E13YuME1b6uoQvUoVyAjRV1JyDR9CpA15vM4q/o1DXicjB1Z0i65+po1uiGt02DW9GvYNPMkNdGMzYa6Zoxi66cdGLDV5ZMXVZZnDXRjmmYquhYWZ0b9LGqotoIvg5v0szeNRXP8h9pJxjUc32msdNVxZdksXT5K0Zwcma/wAGbivKw+Ej5fT6brm/BysQy8mRSZ2Yoq8f4djGo5rtI3I3I562zo6MmHT8DVV/x7SMe7OiYKmuzj41vycuqx1XpdYeuq0cXm2pZ/GKv/wa4/Wo/m/zc75Nf/k/R/G/8V7eW8Z6tcqR4zWuVSrGblc6m8RvXMfQy6y2I6VsrKmZq14QjKKg0jfrIg6BG9AjeoG9QDqAvUKzRUbogYKZEVpFGgFaKFaKF0ArRUKyibKibKhSg0whWAjKJsoVgKFKAAAAAAAAAAAAAAAAAAADoiqyR0i8GK3FkZbNKIp+hNXGFGogoiCkhV1C1syM2wKSQWmCaPRwcJVj7HK9CDjrWjQeUQXhGR0QiI6ZRhHXxs1Yn4M2azXVfJrJ7M+uJi/HvRKPWwZjDDux5URFvtRQfagidZUaEcnI/wDS4OHNy0jc5V5ufmf+nScjivP2NyDhzPZuCGjSt0EUeTLU9apuV+gFUgWxY234IlehXx3KxY1luGof7IzpFIErxsAWMqqY11ZB1rOupnGccmauzNNRbhdJv8jNK9DkXgceDEZjys2tnR0TiurKO3hvBkb+wxWaopj7Px9FHbijwaZbcgRqSjPoyOe3V9f7Kak5KE6ANK0MRDk400DXgczGtnSNa89wbNZ0Bpsa61tkqLZqnJrqiSBOpTXTxeNWV+DFS9OrPwrwrbM7pO0oYxrXTj2zNi69HjYHRy6rUeni46RxtbWUSYVScKr9EGXxGaiOPLxKOsZ1H6bRrDW/VRMa9hPaSY1pu9MzjWsya+tiLrzsMblHyen049LjYsfX8jzd1KncKa8ehKoVpCxV3ll4zln2Y4KTbejtK6F0VXRxUu3k59p09C+nQ4xwm64unk666a6MS0ZrFrrmvBzxyR5daw0dPHPsj+e/JfnyGfoPD9Qrl+o7axSPCa1zqdYTcrnU/qN6506laKwjWPyaZZ9RdRv0l1lv0k1CvGXUZ0GhepUbogwoXQUdSozQFuPim71Rm0NyMU461PkRYkFAUALooxoBGionRUTo0JMqEZUdXGy4Zh915JUrkyUuz0aVJlCMBQMCsAwAAAAAAAAAAAAAAAADQGQaWhGK3HRCMV0iyRl0VhGVWfoio0jSMSCKSmRTyQU7MDUQWxko6ZMDpnkXM9UZ9Qu9vZRaEZF5REd3AjFXIhZv+Pf5GKzXofI4eJOf/wDiPeMyzNc0oNOiERHVjlmKy78UUkZZWjM5Ad8kuBf8kuCd8r/01Ijjzcz/ANNyDzs3Kb9HSRXFeds6YEVsIx+SjEgp1Ff0Bv11/Q1GqGB2cNqMs0/0yVmvqef8vx8vB+qV5aLe9mOb51NGWmNJgZ1Ko6EGOGVWdAoUhTfkQTqWUK4AxJr0VHfw5bYZr28eD8SMalcGhGpKPTx8/BPC+lz+Wje/SPHc+TKl6FNZ0CanfHy5fxxz2ZTXhc6Gqctaa9m4a85wVdJ0KaOoDTITT9CGu/gZpw15MdRjp0c/mTknSJzynLzoN46a7+JHZnPpY97i4kkeXp1jtWNs541plx6Lh7O/jcda8k9WbV7wSPVNQycedGpBwZcC34R0ZTalLyhiyouJYxvSfUtkxrSZ4/BkxrXkYM89UfG75fYkdkZd+jjYYKdMi4XqFZ5IoTaWv7Cs0BSfBmpVk6ZnGFYkjFq8wZYtWmCMWuP5W1j47R38E2pHw2ae+Vs+3z9RWfWa1ktYzUrnUqxnSOdTeM3HOlnD2ZrWKa+M5LOmWY+P3rRdSr5OF9Xsz7M6k8RdRGsZoSqCok5KFZQugo0EABooFtegB7fsKwACsAArAhaKiVGhKmaRKmVEmVC7AUoUDApQMCsAwAAAAAAAAAAAAAAAADQp0RVoM10jokxW4vJh0iiMtH2BmgHUDRn8QgQDoB5ILQQdC7L2YDryBaUQXhGR0QjKOjH4M1HSr2jOIrCIi8Ig6sT0zNZd05V18GMZQqvJppOrZqIXtTNIOZieGJrt27GuWdeVlyNnWK5nVJ+DYn1ZVOpIjpw8O8n/AIjN6V3Y+Fjn35Od6VdYY/omjrxcTHS8oztZLfxuGvS0Wdo5L4Dw2m/Mfs6zrURzVDt/X4n+jSJbKqkJsIvOMyin1DRscd3aSJq6pzVj/GJnTXskSOPoabZooFHatf2B6+H4C8mLuzPs53p5XK4lcfK4o6StTpTivrRUr2sWZdRjApbNCTgoRwArgqaOgTSuCmlx8zJw7d41vZYmvC5u82Wsj90aNcNYimoVBV0nUpqk4aa2l4ImtSJgNA0dWypp5gGvV4GPyjj23y+gwR6PNY6vUwcfaM4mur/HlIuGsUtejWDfZMCUhhonjw1tlcuq4ubx5U7RYnPTyjWOsrUzONSsyeYYbfM4H4R8ft96O/HZ5qK9jCmTIBkGaAdQZ1DKQisSRi10RJiudrpiSOeqpaRGdfN/O8re5R9H43Cx84p87PohtBmko3GKlR0jlU2jbFE/i9mnOnu+4jLInT2iotTq/ZGU3JRG4NDnuTQhUlEmihSgAwKAgAABoBShWVWFC9ghHRRKmVEqZpE2UIwFKMAUDApQMCsAwAAAAAAAAAAAAAAAADQpkBWTLcdEGK6R0SYrpFUZaMQaA6ZFGig6hDJAPJB0Y/DTM0dN2qRjBsgWhEF4RkdmPBkeJ5v+i8GWdPJB04r6w41vt+yMq4zI6JIh0yD0+FzcOLBePJHaq9MMWORsjTt4fxeTlY3kT0isWoXh+qnD9oqa5eQto3yPLyLydYqXU0HWMaOzjcPt+dejn10r0Zx6Wkcxv1gbMAdWPaRllVBBcpo1B5fK4en2k689DmWBm9RScTRNF5REU0QbO5e0AtTWS/7bCqcr47Px4m79UbsxdcfQimxrrar+is19Pxvk8H0Lb00iRzfP/J5pz53U+jfMWJcNR9y+z+JpK9fphvMpwvwIzqmSOldd7NGk6FCuCoVyBmiojlpJFHm8jIaxlwU0y4iGRIo56krRegNViqmeq9MmJWdCprpzcGcfHjMrVO/+v9ETUJxbKav/AI1yttBPZ6XAx+Ucu3TmvpONx3pM8+O2vTxpShgeqLgeHPU685g569+DjYCJ7PyTAmfIsJZHLp5nK5P2LSN+rMjh6h1MoMVqMyS/rZG5XyuB+EfG7foo65ZwqqqjAtDRihq0ZGJhFUZZPKDNWiSOdrpxyYc7XbHGvr214L63N/xwvkmuXnZlhxP+zXi52tT7fFc3K82Vn2PFzkdHNrR1ZY2aZqdG451KjpGKU051rS0ac2T5Ky6uPgWTJMN9d/slrFqmfAsOVwn21+ySpKl9ba2v0VULRRCsbZoSULt5KI8iZXosVys2K41GvJBJ+yqwIAAAKFAxlCMomwJs0hGVCNFCMoRgIUYBgChWAYFKAAYAAAAAAAAAAAAAAAAAyCqyRuLwzFbjohmK6RZGGzkUyQFZgzqhzoDdFQ0xT9Jsmh4kmi/XSIjZIO/i54x47isat36f9GLBkgXgiOiKrr13+P8AREWhGReEZReQi8kRSUQVlEQ6x0/RB08f5LkcSXjXpmmLHHk5NXTuvbNSDmy5dm5By0jYTqUXwYndpGbR7MY+spHDRSYAboAddAUlBFUggNB5xKl5Gojy8PGXVYlqv2dtjKF8akttaIEjFutBVsvHeKurIE6AK509r2iqpyOVn5EqMj8SXdHN0KM6FQKPJpC1j8+DUQvTRpFcWRy9orLrjM6e29lxHTNIuIbaCEbRUQyWUcfK+yZ3S0mVNeTmyG8HPsqEfkBHIB1A1IIdIIdRsIrjjTTCa7MmX7IU6GMOz47H+SMdOvNfWcfr9SRxx6YZoijRcB1IMcDBN7n0TCuLkOr9m8cq5fqnzv8A/QIRYjLa84DnVZmwr66MtSv57w+VjywnLPl+Tiyv0nFln09ficTkcmXWKdqfZ5O+pydd88/qVU5py/aH66R08OMvJyfXj9mOvpjvqcTafPOTBkePJ/JGYc9TqbGRRLFXhmGK6IRlzrpiDOudrrxwYcrXVfOjDh0z0+Pydevp/jz/AMtuvkPlfkPtppM9fh8WPRJjxz1xU7NxlCqOkYqbo3GKm2bjnS9jTFY7NMU2NlYdcMyycIzyBGyhOyRRyZn52jUVyWzSpMowowAAAM2UZsDNlGbKEbARlQjKEKhaKJsBGihWUKwFAUK0BaAQKAMAAAAAAAAAAAAAAAAA1BVJZFisszW46cbMV1jqxnOukW0ZaPKRBeOpiqXJosCI0j6n/TvynxfD4WfDy8P2ZLX4s83k5trHUrxrie9XK0m9pHSNpNmkNIReCC8GReERHRCMo6IkyjpjGRFVOiC0oiOnBi7vRm1KrWPo9ER2cV4lP5ErFcHPqO/4nTlY4XR1xSzFZK6ytsqJ1Lmmn7RUYkB6Px2Pz2OfdV6OjmGQHTh4eXMu0+jU5t/E1DLDiute0RSyUWTCAo6cRGaM2JJqzXNZPy+Tiy4phLR267lmI47xROur2YUjTfsgOoC1JVT6FULHt6Kiy4/9o0xorjopqLw+TcZ0tYWaTUHLTNw1XG9FZ1ZZNFZ0PMXEJWYYOe8xrEUyfIzl6RmncT7GMPI5XSstPGtT+kaajmclUgCsIwBkBWEGV4gJq0wGdWjHthHr8LF10Zrpy9nFevBzsd+a6U0yY6a0mBkhgGMRy5WMZtc1TsrKbxkUTjMVpbqc6qOdf7dEaj8+/H/L5eNfvwdfL4J09vg+TeX9A/05/q3Hih421qj4XyvhXdj6N9PNl0/I5UZM1XL8V5OfPFke3mZD8XnZePk+zE9UTrjWe/HOplUyczJyMjyZHumZ9MOeJzMimOzFiV2YqOVjnXbiZzrlXbjaS8mHKo8n5PDgn35OvHhtYx4+b5H/ACE9M9vPh9R5GT+b8nrgjdaNyIjdm5Ga56o6SMVN0bxikdGsYpXRpivX43xEZuDXJ7pNfo53vLjjevt5szpnVXVCIyqiIZLYQmbGkhE1zfRktblGtXXFn3L0zcVzNr9mlRplUmyjNlBsA2BmwF2Bmyi2Xi5seNZKX4skqa5tmlYVGBC6KFaKF67AkyhGArKFYCMKwDGwpQADAAAAAAA0FAQAAAAAaBgGgMg0pLMtLRRmxuV14rOdjrKurMY3p1RBSaZFNpgbIHTi9mKq93taRmImpNIpMjRbFDdJf2ZqPZ5vw9cLDiy91X2LekcefJtZ1zRDNarpjGyajpx4zLLqmTKH0BSZIistz6CKKt+xiGqL67QTXBlb35OsEulNmjXVjwVK7z4ZnWNcmVPu9+zcaCQV6nx6/A5dju0YGMD0OF8hGHH0pHbx+T0ZvLlz39+V3/Zzql+sg3qUUUFFYTRGWcjJ+BYjj7bNodBTJBD9VoCbRVL0KL8VTORNmozXXyXOR7S0a6usodQyn1XY2gqVo0y4ckfkdIF6lRjRWU62aRJ7KidALoqIZEBz0iqm0AjQUfrQQ0oItElR0xAZWS0GXVx42wPY4+PSMusdK2iNarNkxv2XitkxfZTsTF9iVYxNQabKhepFDxVrf6MtJemYV0YkqMWITmRP00Zaj8vHudFcPIyYnuWY64ldOPJeXscX57Lj0qezx9/Fle/x/Nz9exx/nsFfy8Hj6+JY93HyuK9HF8pxq/7Hn68HTr/Tmu3F8hx//ujjfD0e0dM/LcWf+xz/AO36c7Y2v9R8fH/Fmp8TquVscmf/AFRVeJZ6OPhY5XqPNy/JZcz8s9M8M5Y9m4uVc/st4TT/AOS29j0TSVm2WcpqVZTeM6R2axhJ2bkZL3NYxR2Kyvi5OaZ6Kn1f6JeXOxWAjpgjCiIjd6CJZcjZcHZxOZgx4mr9mLzWLK8P5DLN5W59HfmOnLzqZ0aRplUuwDYBsDNlGbAzYGb8lR05OXly4ljp/ijPqmOZmlIUaBgQrKEZRNgIyhWUIwFYUoChWAAGAAAAAAAAAAAAAAAAAaBoU6I0eWRV4pozXSV0RRiukq8sxWl4M1pfxowpSorJFdGOWzFHTGLZnUd2Hg7Wzne0NfE6PwJ0iyWW0ldNpetk+kXx4CajrjAZ1F5wk1lVYhqN+oaG66KjGUL20yo61yZ+vRMYx57aeTZ0VVuUgyz/AC1rRcXHNb71s0rUgr0vj37Ry6R3mFGtgUjBsamulcfSJrOs6FB9ZVOpCGUlEeXiahM1Ecak0htAOgG8gHUo3qUClmkU2zTLKs1Iyg6e9m4hayNmsZT0aQdTTJKRUSpGmU3ICOCpqVJoCFIohaCpNBSNACRUUlBHZhwVS2kGLV4jQZ1XqVNd3Dx+SVqPZwwjLpFqxLQxpHXkIvj9EDhtnUit6kUjRFZWRqOoa1yUZCzneMxYI8zmOsVIzjUj81nrdAAAMqaJiy4pPIyT+zN4jpPL0tPOzL/sY/lG/wC/Sq52Z/8AYz/KN/2qsci37ZPWL711YshixrXbjyHOxrV5yGMNP9gw0rsuJpe5cZ1jo1jKbo0yJ8srKrx6WwyyX5Ky68dGGV5ojK00EawyjZRz2aHHlRuNORvTNiGStsKTZQ6XgBGA06ASn5KF2UYA6ZEDYUhQAACsoVlCNBCMoRgIyqVgIwrGAoABgAAAAAAAAAAAAAAAAABoU6CnkirPJ2SX9Gcb1WGZrcdEMxY6ReWYaVlmVVmSUdGPGYtV34Mfg52q7sWA5Xpl6GHwtHOo7cXAefzox74xrcnx7xFnemmxYC6jqjCZ1FpwjWXXxeHOa+tPqjXP3WbU+TxpxZXEvaRb9Ulc1SVUak2iNoqIu2jYi78msB9rZcRiArKIKJEHTxac2Z6HrLytnJVMc+QjtifBlldegyjaWyqwqtUlQ/UDjz06ev0dIiKRQ3Ug1IobRQ2ig0VDqTSByaZRqTcCOTUZJ1NsjqVmsaKylSNIlRUKEKwiORFHNSKqFgT0ArRRqQFJRUe5wMvHWFq/ZnHHoqmatteioaoSKO3hySt8vUj8TLqo72NXSEDygqiQbN1DWAgSkQRoDntGVQyJkHFyP4My3H52PQ6AAIAAKNIqksjUrox0Yrcr2PisfHyt/dXXXo4eTZ+Osraczkal7X6JF085Bhp/sJgO4w1jsuMs7lxC9io2b09lZX+7aJiCWEWhkZdeJbMsunWkZZI6KhPslS01t/oqOambHLk8vRpXJnmoeqNxXKyhSjr4PI4+J3/kR9ia1P8A4zNiVyvy20aVgChQUAAAAAGoBgFaARooRlCMIRlVNhSMoRgYwFAAMAAAAAAAAAAAAAAAAAAG34CmcNSq/TChMB5ZFXhmXSLxRityuiKMVuVfGYrTtxTs51p6fFwJnDrpp3Tg0zl7I7MWMxajpjGZ1l7XBzRE+Tj1HPpvKyzfovMSJY5RsrrjCTWdU6aKjfXoqEryaRGkaghSNiFybg5rk2IVJpE9FFJRBaUQejwuC+QznembX0GD4zjYsGqXn+yRnXnbmMjj9fomNx0QjCumK8BkzyaCJ9tlU0JhHTMhCZrSWkag4qnZoLrRRqApGN09FRd8ZpBEdaNDUjQZIqBmoibRuMlcm0T6mmW6KzU6RplGjSJNBDZeNlxQrpeGEc7ZUQtlVCgIWVSAKEUxYqyV1n2EqnRzXV+0VFICV04raDFdKnJXkrL1OB49ma3HoMw6sCgKpIaVlB0kOVtjIlTZGE6kg57Xkga3j+oyrx+T/Cg3H51OzoAoIAAAAHTCqwzLcdWK2jFjUrpizON6srM4HVExW9hgx0XEPxpnLnjHT6zT02S/jOvS+b+O43AyRPHyrKqW3ox4+71+syvLTOqnREVlgWlmWXfxIrIm0/4mKxVVe/AZRt6rRoRqjUEnZRz3entGkcufJVvbNRXMzQUAAdAdE8LNeJ5UvxRn2iezkfhmlYVQAAAABqAYAARlCNFCNATZVTYE2UIwFAwDAAAAAAAAAAAAAAAAAADQADdhQA8sKqqI3qsUZaldMUc66R1YTnW49LAca6R63GrR5+ld8PZyR1RSMsuvEuxism31ZUPNBHdxvLJWK9TH10c3Om+l5HqTUTU83DyY52blNcfY2pGzQmzQk5NCVYyohWI3on9RdB00BSUQehweY+OYsZsd1/KvIv6M+qerhrI6vZrGnbg5PjVGbB2TUv0zKGCmidhHXj6RPk6cdSfrKV5v1JjEQap+TQ2ZX7KFuVsoVIovhalhHU8k9Sjl69maR04MK/Z04m0byMSS2jXXOFcrQZK0aQjRuMlU7ejSGz4li1p7NM1zUVhGiokwjcufJklRT2l6KOakESpFEaQEakqpNAKB1cTrvbemGKy/5v8AZQ8IJXXgj8lsMV7eOMf1kcbRiaV+A7cPQS2jLvGKKDch1jDWKqQ3IdINyN0VS0RmkIw3QxXPmkyy5LRlXFyZ/Bkaj84nZ3BAAAAAAagKSw06IZitOiKMtLJmVWmiKKoBd7KG0/ZEa7qv5PYGoIogiksgrLIi8W16ZMZOrZEDsqI1ZpEboo57o2iFMomwEKNAZMDuxfJZcfHeFemY9ftm8/689vb2bbYUaBgAAAAGgAGFCsBKKqVATZRNlCMBQMAwAAAAAAAAAA0ACgIAADANAAAKAhgpkw0tDMtR042YrpHdgOXTrHo4aOFbjvxZTlY07ceY52I6oymcZdOPkOTPqh/u2x6orOUYy7uLnSM2MV9H8ZGLPDqn5Ovg8XPX/l9OPTf8jDg5Djfg5d8519IblczD9T097MjwaybbO0jZexQ8w2AOGioPr2NGPANRN4TWiNYjWhOuiqdIB0QOgKyyItNNeiIp9+T+xgvjy5GTEdS215MsmSKh0ArRQjRRiRoNoo3RR0Y5Kysno1E1lt0a0tRcmoylSNRCa8m0N9DpbRply5N70zSVFlZTZUTpBE2VEqZRjyNx00ERaAnSAjSKJuQBbKKyEdWFIMV1wGHROS/QTHbxIbfkjfL1YnwHr4ikrQdp9BkKZBY0NABWgzYRmWAUTvyYrDkyzoyrh5P/AB0Go/Nx1egEAAAAABqAdBVYZGnTBhpaSKojKjYGy/IFuy0QT2UUkiKIgpK8bCGQFEyMn7BC1ZURqyiVUaRGqKiVMoQqADQMA3sApVAH0XwnwPH5/Ey5smVQ4XhHHvuyuPk8llx4WfGseWoXnqzrHWJFUAAGgaBgGBRk668Ac1mhGiibAQowDAMAAoCAKAAIAADQoAAAIAoCAAAAADQppCuiJMtx0YjnXWOzG9HOukdUZDFiurHkMWNOzFlOdg6oymcR0RlM4i6p62ZxFJyFxHrcLhcjPHePRy66kc7T/wCTyONbjblljOaV8i6e2/JrDDfbT9sYjexoPL8hHdh66MM1tpNiC+XiLDM1232OnXOGp9TmFeMqPQn4/jPjbfvRUeDlx9aaNxpPRpTIgv8A4+b6/s6vp/ZU0i2QVWyCiCOnCZR2R6MsHKNAwoVsozZoVxw69GpNG9dMrK8eghjaAqIV7NwTZpCM0hpzuVo0yXO8Vyuq/L9mkrkqQyrxccN+SsUvPx45XgI8/stGhz17KBSEXXFVY+xNZ1xXHnRWi/RTJqqTw2zPu3OT/wCF/wCE/o16N/wy+56GWBya9nO8H60a1yvLr48f2VMerx50RvmO2GV6uacjoCDQsaGgBgQrCU2loLiF+GYrj05M1IykefyX+FEbj83nR6AAAAAAAADoKrBFjpVLRltWWZVREGhQBuyDUBRUQUVBFEyIbYG9gPQ4/GjJidNmLWK87O+ttI6QQdm0TdlE3QRgRhRgQAAVgG6KMArj5OfEnMW5T9kxMTbb9lVgABoABgUAaFToolRVQoqJsBdAZoA0FGgY1pfoLhdBBoA0FZoICoAAACgAA0IpGCrx1afiQuJBAEAUAMgKSiNOn6smPSuXO/WzGukVgy3F5ZltaKMq6cdGarqx2c7FdWOzODqVr9GMRdZnrRMQ82MR9P8ADfMzhw/V12zz9+P7ceuXDzOV92d1rR055yLISaKq00GVUEUkI6IpogrLbIjoW37CHSIG6gLVWp678FHFlk2OdyaUJFHrT8lvif4/Tz62a/p/xxjHHOM5rqigiN66ApjYHVNmWVFYQ3YBOxRaMeOsTpvydZzMEpkyLY7rH6N83E0O+z2EMr0aQ/2o0y3tsqJs0FaNomzURMrLKKylRpCd3L8BlDPdX7KOfRQrnT8lRugyO966ohh8fGdGL06Tl24+Gjhe3WcrfRKMa6SFcSNawvVGtMb9cs1KzYeeKmdJ053h0Y+No6zpyvK+upWFIsrpzVlQdpTEbboNyGCgAAzQTGNEMc+WWZcrHBk2ZZcnI/gyLH5vOj0gAAAAAAAGQFJZGlZZGl4ZlVkyKbZFaAAaQMgHTCH7EB3CB2XA08zJC0mPVEKytvbNIm7KhHZUL2CHVAZsIxsA2UGwHkgZgTKAAAEA70AoC7Ko2AbIrNhStlE6KIUULoA6kXB1C4zQMACgGgN0AaC4zQTC6KjAjCgAAAAA3bAwIAjQoCmSIq+Naaf9Ga1Hocrm5uY4rNr8F1WjnJjpEkVpRGVVkjTohmR0QzFV0wzI6YZkXlkRaWQet8PlWHOsnhv/ANOfbn09DkcHPyFfLxz+Ht6JzrGuGCtO7iVjjIqyT2n+iM071VtytL9ICsyRFZkItKAvJlFUgh0gFpFHLkg0qDg0E6gWxyRlVIIZIiG6vWyhE9MCs0QUTCN7BG9ihpZRZMrJm/BUS7G1Hc0jUzSLTRWTM0jCspuTSEaNISkVlGiolRpEKKhPQE7bb2yoF5Ijqw4NnPrpvmPQxYVKPPenokVMNJ2GkKNKUopHsqO7BJuMunqdIeqdydI4dcpJPZXN040Ho4iyQd8aFAAAAAAQK0Zo5c2BV6OWsXl5vL49LHRZWMfmk6vQAAAAAAAA1AOgqssjSs0ZaVVEDqiKbsA2yK3YG7AbyQNq/wChpg6ZP6GxMTvtPsom6NMkdlCuioXsEZ2Kh8f5Wpb1v9kqOjl4Z49qZtX49okRz9iq3YDIDVWgjewGbANgGwM2VRsgNlGbKM35Ir63mYP9NL/TePJhv/8AsP2jn96zN18i2dHQjooRsBdBXZx7404KWSd2/TMXdachQrKJsqMAAAAQDEVugpWgmFaKyRlRhUAAAAAAEAGoKfQU8oixeFoxXSKoy2okRVJIqsoyq0Iyr1eDwfvx1fbXU49d4pOvWmv6NC+NGR14cfb29GbUPM+SI6sTqfRKj08HyPLx4KwTX4V7MsXksIg6YQReERHRJGVZQRVICskRVAMEY/IVOoNCFQUSclQ8JhFdERSZCPQqsH+P/wDoo8ivYVssIoqA3sEHYoeL8lRdUismb8FRFs2NRpFEzSHRWTpmkMVljKidGkSplRCmaROiok5KidIIm0UPinbM2rHq8eEkebqu/MdDZzdCNkEboNItmlNinswldKxIsZdmFeDpFWNqxzs1GbzrFjNaz6HRW4dMro0AAAAAACDDNGaOdghyZX00YMflQ9DQAAAAAAADQGQU6ZFUTI0dURVJeyB/QUdgHndeiK7OPxttO/Ry66bnL0bnj6XVHHa1gULW0hq4xOV+gYlmiMn6NSpjgzcf/wCp2nbneXBaqX5Osc6TsaZZsA2EbsC+OsXSvs81/wBSIlsoefJAyrTKM3tkBsDdlG7IM2UZsDdgGyqVsDNhRsisbKpGAaA3qZaGgpGEIyoQoAAAA1EU6QUaIoAxoqJtFYpCssKAAAAAACK919fXXn+w0xEFoRmtx0SjDpDpEaUSI0rKMqvOMyuKxJnVdeKskLUvSZiqtMsg6ccmdR0TLMotMhHTjgzqOmJIy6cckZdMQRF5kItKIi0oMqygLLGyIZSUboBlAA8YRG4NCDnyUehmy8T/ABVMr8jv11x6/X6y4ZZwD9gharYBx8Sy5VLNDq5nDjDHaTXXODh2ZGbKNTCHTKhlTKi034NMj2zSOnF0WNpryblmJpegZ0GkMmaRWF2LIhK8MrKdMqI0USaNMkaKhQhKQRGkUX48eTn3XTiPRnwjz16YG2yK3o2ZRO8bRVc7K02K6sI68eTsWI7cXo6QVRpo6NNMZUpTTmZbDcOaaAAAAAAAECs50c/KtfVRyNflU9DQAAAAAAAAAZBTIKdMim2RVYoixSsiIpY3T0KR6ODHMLb9nHqusjo+wxjY+wYGnNWtEwb3AWrA1fW4bb8hlwZomztzWLHn5JcM7SuViezTLdgbsI3ZBqZUNsit2EbsA2BuwNQAyqzYBsDNgY2FLsA2FGwrAp0ZUxGmMCNFQjNMlYAAAPGNszrUjtw8K7/Ri9uk4dsfE5GvRz/q36syfF3K9CeQ9XFl4tQdJ0zeXO50bYxJorFTaNMlKywDQADAABkBSUZajohGK6xZIjaiRlpSZMqrKIrpn0ZaWiTCumJM0dkpddGB9H8Hxvir4eWuU9Zf+p5+7dcu91wzhntTn+Kfg3rRvrQ1FsaCOmJIy7MWIzrLtxYttIms16i+KX1735H3+sezheJxTn+iqeYfsqKwvJB3QlojCdLyVpswEVUBG9QJXj2ByZMejaouSjAgCNKCXUV2n2EUy58uVap+CiOgjCgKh0A6NMnRUVk0ytJWTmoySjaF2aDq9eisldBE2yhWVlNlQjKhP2VFfq2iMa5Ms6o01HVxkce3fh2HB3bC8kHRojJLS0RXn5V5NNwhR04Co9LH6NwVlG3SGKoLEGjSY0K00AoAAAAAAgVnLocPOxV9VOTiY/LZ6mgAAAAAAAABoDIKZBTBW7MhthXdx8eltnLqu3Mel/h5/o+7X4HD3m46Y5O5tB3Lg1ZCYG+wYrHYxE6s1iE7FZSzSqRqVnqOF+GdY4go0DQNCN2BuwDYDSwGbAxUAOgF2FGwDYCtgGwo2FAVqIKIjYbIpGwibNIVlQoQAVx49sza3I9n4/455WvB5+/JjvOX13x3wS0to8XflLXt4/hsSXo4/wBKx7p8j4TG14RZ5Cdvm/k/hem2kejjyuv6+W5fFcU/B7OemOuXn3OjtHKxGjTnSMrLCo2X1pPW9foituu1N61v9AIVGgMiKtCM1uOmEYdYqkZbUlGVXmSNqTJlV4kyrpiTFV045MUdWODOo6ZkyjoxvREWXkjK8SEdWKPJlivQxR4MsV1Y/wAWmRmvUnnL69a8mtv4xjhv8qb/ALCqRVKXP6ZQSgKpsIdBF4h62XKhzINADkI5c0mlcdGlTKAI3f6CGSKgYRNsoUqBFDFQyZWTpmkd2LiZKjsdZ47iYX09Gcc63Zpk0JV7NQRyamtI2jEyo1hNRdFQvYqD9BE6ZUKnplF1mWiMY48t9qNLHZxTh29PDsaODsxPTCK90RC1aA5LW2VpJrQV0cX2Ur1oXg68tcnOmNNGKDaAgCAKA0NIMAAAAAxnLpUeT/w0cv8AVflM9QAAAAAAAAAGA0KYK0DSCuGe1Gem+XoekcXd1f8Ayeb/AB/o/wCpz/nN1r2cLo6MjsVDNXK2/RFL3LiazuDWbCM2Ubsg5c86ezrzXLuIG3NoVoGgGwjdhWpga6X6AzYBsA2AbAzYBsDNgGwo2FOmFaiNKGWisBGVCMIVmkYEbK8krUep8fhl3+S2cPJXfiPt/huDKSej53k7b6fVYMSmfB53ntXQRRLZBxc/hzcPwWdN818H81wVNPSPd4e3d8rnx6Z7ua49Rx0jo41NmmaUMgoAAAAeSNOjGjFdI6oRzrrFUjLaiki4vEsxrTojGZtaxeMRjVx0RjM6OnHBm0dUSYRdIiHmQzXTjkjLrxyRl040Rmu/EvBliuiUGVCoE/JUV2tAaiook36KG8p+QOtZlUaO3Xl3n1Yxh51CAZgcmY0OK0aVPRQNBAEaEY2VCM0FKgQQxUYbRSWVl62LnR9ST9o9HPk+l93JeTtTZzcbWdzTI7s0hGzSCKKlM6DLmyV5NKVUB6WOuN/jPf8AI03PX1/+vLu1sjkR2UIm6YZM8T9hNdXFrXg49vRxXoJOkeeu5XDQCVsCLtlVmyBaYFeLeqKPYx+jpzXXlQ7ANAACAMgADQAAAKAAJRhytVHkf8NHNX5TPUAAAAAAAANA0BgrUAwUEHXxZ/Zz7deHQzm6kZUI2VGbAtk5NXCh/ozOWr0hs0yNgb2A1AACZo3JqVnqOTR1cTIDSKpODJcu5luV7ZNMT0aRmgAA2AbANgZsA2AAAGAGwo2BqDSkkaihlpjAVlRNlQpUYBXGvJmt8vd+LxrsjyeWvTzH3XxmkkfO6Z7e9H8TDhTbCL4yInyddTLXL5H5vEqTPR4q9XL4fm49Uz6fFY7jy8i8nePPUGac6UqAoAgA1EVSERqOrHJzrrHVCMO0i0oy0tGMxa1jqx4jFrTqjGc7WnTGIxo6IwmdR0xhM6iqgmo3RUViQzXVjkjNdMIjLogjDtx5fw66JjKk2VDdioZFRSQi0hHTxskxX5HXxdTm/aUZrm73I8nU662EZLOQoqCHTRAVXgDlyPZpXNS2VWKAy3ogjHBUTZQjKEZpE2yoEyofZWWbNsqIrNVVaRYxW9zaNXl6NM6rlx9NedmmakzSJOtGgryMqJOgM7FQrtgSdgK7ZQ2O9MM10vMupGGYcv5GOo7cV7XHtVB5eo9EqmT0RpzUBzX7KpG2gJuih8D/ADRKr3sP8EXiusVO+jUdJQC0BjVYQaAFQFAAFAUBiqU42qlyP+GhyPymekAAAAAAAAaAwGgagpgrSDt438Tl27cLNMw6JMrJWihCgAwAA0BkQUSIrMv8CxOnB+zs4NAzYHbg+Ry4OPeCddb9mbzt1XJs0gKMAUDQhQAAKAAAAMCggZBpSWRqHMtADGUSZWWFRhBbD7M1vl73xr00ePyvVy+t4OfWjxdQ6j3uPyE0cnCx1TSDCyyykRMcfK5K0R15j5z5TKnLO3jjvzHxnOf5M+l42e3kZfZ6Y83SDNOZCsgAKAIZEadfHx9mY6rrxHd9Ck467+p5kjS+ODFrcjrx4zna06YgxarpxwYtV24sRztR1Y8O2kjFqV338flxY1dLwYncrGuWkbVP9m0XxkZrqgjLokMrwGHRJEWhNhk6XkqOmUtBln7KHTKHQQ6AYDQG2Eb5ZBK0US0BjRUCCN8NBHPk9mhTHxu62NZtTz8foWU1xs2FKG7GmKzsaZVx0u3k0xXVlrH08Fjm5ps2VRWaYpnbftmmSujSJ0zSJuihGwCU7rqgmnzce8S3QNc2m3pFU18fNM9qnSAkAJhl0cee1rySpr2OLqcqnZwvLv4+npZlCxjuTHsuY8tvbOLm3qRE6ko5b8MqrcKPszIz03y95LSJK7GOsqNN6AaAAKNKAICgACgJqlOV6GHPVS5H/DQlH5UPYAAAAAAAANAYDQNCmCgg7uF58HLt24eh0XU4urjyrTNxmpM0hCgRA112/WgEKNSIKrwRW7Ckyv8AAsY6cJ2cQUaAEAUAGhQEYwECAAKMAAAAAArUyKoiNRRGWwFFNaCJM0yUqACmN+TNb5exwcmmjzeSPTxX0PGz+EeLqOr1ePzNHKxi8u2ef/6Zxz9DP5D/ANJi+jkzczZcbnLxPkORtM9Hj5afN8q9tnu4jl287Id489QZpzLoqDQG6ANAOkRY6cLcmK68u6KdHKvRHRMnNt044MWtR1RJzadESYo6sUmLR3Y0c6jpxX9dKv6M2ald3J+VebEsevRjnx4x6vOb2dlKkaR0Y5MsumURheSovIZWlkZWmgh0yotNMMnRUUSAdIIZIodAMgh5jZBbqgiOSQORvTKo2EYVCthEafk0O3j5F1IxYzkuaQhI4frTfhbN60Hi17RdRO5k1KiX17fg3KxY7cPxuS47M3HPK4881ivozcYTVG0Oshpim+w0yHl2aZK62VA4ethNSZVX42O991+iM2m5XJrJ+L/QI58N/Xlmn6RWnrczn8W+L1X8mVvruWPA7BzZsCivXoMKYuZUZE9mby1K9p5c14015X7OF4d+O9Tm0zlY7aqqWjInbRRy37NK9T43D1x937Zy6rvxHeZbaanQ06ygKNNIDQ0oCoAAANDGceqpTjarNkEuQ/8AZos/VflU9qAAAAAI0AA0K0DUBoVoVoHRxcnWjn1G+K9bj6zPq66nnr0RyZlq2vZuM1FmkKBgGlAQUSI0AACHIrxo3y59uU6OIKNCgAA0KAADGEIABAUb+gpQgAAAK0KdMixRMy2NgK2ApUYVABssix3cfLpnLrl34r2uJyUeTvh6JXqYsnb0eexp07pGEwryv+ymOfPylK9m+eR4/K5aez1ccMXp5GXJtnpkcOq5qNuVI0aZCQG6IYOpTB1IuHmSLI6sGNUYtdeY6sc6OddpHXCOVdHXik51p0xJi1XTEmKOiEZo6JejLJ+4xGplR0YcGTK9RO2S1m0ZMdYrcX4a9jUdfGU/szWavk6/okZEmkVkMrSysqywiiYRWQjohBleJIivQqBQA3UqN6gUgCgEsvoI8/I/yNNp9gje5UTrIULM79gWVa9EQPyEdXBWPb7ezpxm/aD5B4/+vsveb9JXmZGIiUX1rZpmvTx/JzMaNy2M/bzuXf3W7R05rnY4+2jrHOjuajI7mmWqzTJlemVF/uXUjDnqtsrSuLPULSDNI26ewEoGp6b9eShdPeippck3H8loJqX2lxSO2MHTg+R5GGXKrwyXlZ1i2Pn6Od8bc7Xn5Bf2cr43Wdn/AM2X+zPo17jHyJyZJlfsl5+mp19vpcOlCSPLXs5/DthonZ7IiiOsGmpRp1lRpuDSoCgFGGPZRszewrZytUrZkJsCWd/7VCK/LJ7kAAAAARoABoVoGgaFADBWy9PZKSu/Fe58HGx3layKRlCsDAAoaUQUMtlCMb0tlRxZa7Udo4dUhpAQaFAAUaAAAGECsqFCAAACgA0KwDAGTIqiZG40isCAoxlGBARVIrRGpXZh5DRy65duenq8X5Dqefvxu06d1fJpo5fyXU/8+W/LNfzNcXM5afpnXjhnrp5WXK2eiRwvSy+L5d8F89T/ALCemx7zcZcDNssKjUiB+pNaxvUGGUE1cOoJrWKxJmtyOvHJzrrI7MWM5Wukjtxwc7WnREmB0QjIvKMIYrLUBWUGX0vwfL4WHBX26Vnn7l15/Jza8bnZZy8m7j02duZ9OnM+i47aKq822GavLIyrLKytBGVkGTootAZdUEZdWMiLBlhQIocIzWgrewRDLkKrit+TTSbZQrKgmdkFPRAroqM7lRn2temEY7deyolbNog2biM7s0wepyRrutb9G2ahl8raOnNc7HP3OscqbsaZMmVk2yoNgGwh0ysVbj1CyLv6IxTc68W10KkcmLNWO+0+zTWqRX592Ri1nP5E5ZSS1osTlwcb6ayNZq6o03aR9e76+V+gmseimoXbQxdL99Ieq63/ACqJ6L7PQ+Eus3MX9I4+eZy7eD76fZYr8nzq+nHTpsTm1onqjIqmjpOgbMWg2anQbZ0nQDfsg2X2Bsl6GGL0oMjNCTRjkWYhNEVHkf8AFQg/LR7gAARoGBWhAABWgaBoGhWhWkRXDl6szY3zXV2TXg5uzGArAyZdPS9lGNNPTIL448Ga3I2kArCOXNl/SOkjn105zbkAAoYisKAo0AAAMIBxWt68AxMrICgAACgAwDAjUFdGLpryZrryV+yDCoAMKAI0KCB1WiNarOVozY1OlFyGZ9WvdjzsvqexKytlxnSbKi3+ZyFg/wAdZH9T/wCn6J6z9Nc7NIxBFERo5FOktbI2dEVXHjqvSM2tyKqNGdax14YOdrpHZjk5Vt14znVWRlFpIPRxTj+rycr+sual+Xj0bgaCoqiMn34CEKishF4IyvLIypLCOqJpe1oMLyRFEVFIDLphkRedhlWaCNbAaCouggaNXmwTtEHHmZqNOSmaUmyjV5IiutIyEbKpGVCUVCFQN6KidUVlOjaJd+r3/RuItn5uTOpV/wDX0bYqHY1GK5snijty5WBUbYOqKydUVk6kM2sa0VnWplZodBEqsqE7+SiyyeAxUc+TwWEedVfkadVJrwGKaXt+QifJ1L8Fhy5dlaZso97/AExO8t3/AEeT5X49fxf19TjeqPn19B6EV4Lz36tJ0c7dqsQFCI1FUxuKDaAAIMIgAZG+VBb9hdHMQ5M/7VCD8rnuAAAAGhAAAAUAaBoGhTAaFYA8ZXJmxqdOhZZZzx0laGmba8ogP3tgdWN+DFdITJklFkZtcmTPvwjrOXLrpA05gACgAACgKADQMACK9TJ8lgr4xcT6l9i/7nOcX2109pjxzq4gAAAAAKMAwIANTCnTI03YUBQECCmIAKANIoA0AANgZsI3XgDEBRb0RoyIpkwsWx+WkZrcexjwrBh7/wBnmt2vTJkcfbtWzbLqwmK3HZByra8swKzZBaWRFZuv7JiOueRj+j6+v5f2Y9ftkkM1RR+PZGVZy4/rafsmIlL2aFoIytIRVMMujF4af9EZr1OTzIz44iY6uS9da5TnEZMKtCbCKrwVFJoMrzkCGnJ5CO78KlaNWzENMaJIh1rZ38Ukv2hqa0ejzeTm85EkTcpnixpzZuN29E1XBl4+STUqud7Xs0GxvySirogm2BkZPrtV70alwJmy/ZbvWtlt1E0wyWmWIk2aQjZqIjTOkZJs0zR2NsJ5fM7OnLHUTk6OSiZpk8vyViulPwHOlt+CspKiox0VlJs0JtlGfY0VEcmRsLI5mytnmgyZ2ESptlUhQrCPpf8ASy/DIzxfKe74r6JezxPa7cVbkxWobRFZ1AZMgZFUxuAN6AgwiMAAN2XRuxqgCPJ/4aJB+VT3AAANAAgAAAKANAAGCtAAoAwINtEw0yy0iY17H+8nq17t+8ep7t/yK0T1X3TdN+zTOsCAK0A0AAYAFAUAABgABgChAAAAAAFGAYEBRgRpGjJkU+w0ANRFaAEU0rYajaWgUoRoGNhC9iozZUamQOiNu182XwlxvrW099/2c/X/AJa37fWOZG0MiKpL0ZrcdX+Tkc9d+DHrHT2EMlWOvHRzrpHXjs51tdUYU80QdEWRFlREOqIh5y9XsmIpk5LyvfoSIyfJR14cFWto52s1Tq4emVlWURFUgytjIy6ZIlWkMvV4mKXPk52ufTM+OZfg1KkQNqaNv0B2YeM35ozrLtmVJYyc6yoC6AgCaMMVSNJ+zKufLxIv0anSuGuLWM37CTAVlE2UTbKhexUY6KylVGkSqjUZRqjcQuzcZrTTJnP4mpWKjKOuuWH0a1lpWKdZDTnYysmyxnEzSVpWAVlK0FSrZVRoqk6kaPELQ1mscjQvUuiuTq8Myo1S90NY/wBczkutPpP9L/xyI8fynt+K+jUniexbE9PRmrHQRsMgQCia6naevr/9GKjno3ZdGmlYGQAAAAABU+R/w0IPyqe5QABAFaEAAAAAUAaBoGgAUAAGBABhFaAyCwxFAUAAGhWBABhQFGAAAAAYAoZAUAAABhQAYVGAAQAAU2yLpl5I0bYXW7IrQrUyK1sBdlRnYJpXRWdLsIAGQaVRlsyIpkRTBo6MqqjLcVgzW46YZiujohmK06Jow0oiCssiOnHO1syDYQyYRWCIvJlHp8TkTE6Zy65YsJmyK72jUiGhhF58kZVnwRlaWEWhhl24c9QjOM2KPI6CCZdvSKPR4/HUrbM6xa6SI0ujTcqA1oBoCBWzCl2FaQHVUvJRxcjifuTU6HDUa8G9EaRRGjQlTNIk7KiVZDURN2bZLs0zWoqOrHxstY/sS/EezmVr8TUqVzo7SuZ0XWMNo3rFZ1NazYbFheTIo/8AsXWcdHM+Pri2pb7bLqdc45updc8Z1GphHBdTHt/FcT46+JTza7/+jXfx882XXz3JxQs1rH/HfguueJfWTRnRjTG9Bph4x/kNSumsM9Rrm4bx+TWtPa/01+Oap/s83yfx6vjfr6uIb9Hjk178Llipey9c4YrjraObUORWaANAYtJFBD2ywUZuzAplBso0oANCt0FS5H/DRYPyoe1AFAGhAAAAAAAAAFaBoBsAA0KxgYRAUaFMiLDEaAAABQEAABhQABQAAVjCMYChAAAAAUYBgQFGBABgQBWgPjyOHtEalxnYLrdkXW9gaOwNHYYvszsVnWbCazYGBGhTyRqKojcOjLRkRo5FOiNKyZbismW4rLMtKzRGnRFmLGnRDMVV5MotNNGRqCKIIvBlFpMopIRWSMqyEdOJmazV9mWToItAZXlhl04l2ZNSvV4+BQt/s565ugqNAAA0Aug2TRnYaYRsjWMA0BpCG9lRwcrB/wBkalV5uRnSDltmhCjQlSNIlSNoR7KyUqKSXWXfh5mSMP1L0yMeqNfxZqFiCR11zx2YuHV4+49nOpddPRvWcN0NazjZh72i+zOLNVf83svszYWsQ9kwn1F9k9WPEPYxN46XheC+x6p/SPYxjwj2XGfUNXGfUNMN9Y1Ma09F1n1SeMvsY7Piq+rmS/0zn5fvl08X10+yw1o8vi79a+lFMmqRry9+xjm/jRwRZPZGjFVhETsBN6KH7suo3YGplDFGlDIrQAlyP+GhB+VD2gAANCAAAAAAAAAACgDQAACgIANCgK1EDkaAGoKdSRWUioQIAMKNIAoAMCsKFYZYAAAGFAEYAFGBAEYAAAAABW7CjYBsA2AAAAAAAGgMiNKIy3FERo6MtHRG1ZRlqKyjLcURGzbIrewwVizNi668VnOxp1wzFVZGRREQ6CLwZRVGRSWRFZDK0kZVkiLzRGVEwi0sjK0siPY4GLf5M59Vz6ekRzBQAAABjYUroLhdhrGbA3ZQbA1PyEsU2GCZEnLQ1XhcuHFs78q42dAvRmmNZ9ZpNK8LNM6nWAGl+oA+saKTJNTGZX40b5ZsTlG9Yx14uRcx1XoMXliW2a1PVacZfZnFJxD2ZxT6h7J6t+svsnqX6S+x6j6vPgeyepLwVvdIex6k+kex6keIvsepPqLq+o+oeyY6sPx/2R2J7M1y5OP1pyX2XE/qNeyYJhxapfoWk/X1nEyfZhmjxdfVe/i/S7omtI0EZNNMKunsLGsikYRNlGFG7CGTKHTKHQDGmm6OnPOiPJ/4qMWZR+VD2oAoA0IAAAAAAAAAGm9S1r2F0oQ0T2egsY/DAAAAA0KAoAdMypgoCn7EUrZUKEAGAaUBRqIqs/V9b37I39OejTnSBAAAYVGAAAUARgQAYABQABAABQAAAAFAGhAFAAAxFOmRpSWZbiksy3FZI3FZMtxVMy2NhR2BrOwRSaGLK68VnOx0jtxWcrGnVDOYqiCiCKwZZXkgdGUVkMuiPJlFdDWWoIstr2RldV40RFsP5WkSpX0nFjrjR57XHp0F1kF1GDVaWANWInfgw1E3RW8ZsK0INlBsDdgOmRlvsqOPn8btHZHXiprx+nnR6Yza6/rx/X/6WRytTnBs2l6U/wAcJ7JXgBqDwkrWl+ow0x49LY0ctJ1RuVDLGzWorMDWcXiB7JjoiBrOLxx7rzKLPtPUyhj2TG/WPYwfWX2MPjjVJsezOKcjra8Iey45HjLpiVYy6mE+supjOhdMWx5bidIjPqjU9ntl0wv1l1MNj481erel/ZZTHpfG5FLeHfhejj5I7+K/49HRxd8K0VGKQG9FQ3YLrPBFK0UIBhQbCHllFUFMbUOtF97ylc3Ky/7VGN2pr8sn0WgAAAGhAAAAAAAAAAAAAFAGgAGhQFAGkUyZBoUBQEAAAAYUBQEGNgKVGBABhRgAAFQAYEAGAAAAAAAAAAAABQFaABAFAABTB9f2r7f4fsla5/8Apsrx/Y/q/h+iLWJhYomZblVVGW1Zszjcp1ZMa0dhi63YGhTJkHTiozW47MdnOxt1RkOdiumL2Ywd+JR0OVCb/LwaRaDKKoyiiCOjGzNZVTIy3fkos8ztJf0TGTQwj2PjeL3rszj3059V7qXVaODk3ZRnY0YV0Fw6o1Ky3aLehHJRhvmI7K2eUEp9BklFabPkqB+CATKLQyxzp8kJ4z2Xx8zmWX7YeJeHWRnTli1ScR0xztdGPBt6NTnWFq4/X2W8WJfpz5MRzXXNWIzW4T6jnW0ck9vxRF02PhbM+6HridUX3Evr8mvYxacY0VmRpj0ONniI6tHbx+acwTc96bX7OV6ZsOsRNTG/UXTG/Wi6YVyi6mJVCNaYjWMrKTg1qEcmmQkEDQRXFi2S1FKwLRNZ1BJ4cipfov63zXs4ciyQqRxsezm7DmQFAWIXIkvR07kn4IdmjAPuLgX75GGtnLDYNNeTGkBNciAL488MGnvPMLZqU9nLl5ff0XrrUc+bN/t0ZivzOfSUBQAAaEAAAAAAAAAAAAAAFOuvX/0NFCNIAqgAA1EU2wrSAAAAAAwowoxsDAjAgA3QXG9GTVxv1savqz62NPUrhl1PUuis4wqAIwAAAAAAAAAAAAK0KAAIAoAAAI0jTUFOmRpRMy3KdURrTqiNaZMNHky1FURo2iKaXoC85DFjWuiMpnGnVjynOxXXjzv+zneR0RWzI9L4ucVcvGs3/Hvycu/xjr8fQfOcfgJR/i63+9HHmuPjvX+vEqNHXXYk3oqLrITEb2CKSwi0VpkZfS/EZU4PL5HHuPSdHJjC9irhXRWsI7K1jVbCYOzBhWwrCikMjNPsqJ0GgnoqBvYDY9dvPo6ePPb7/GevxanPb8fR28vrv/FiKLyi8s1xZsX5nq4cOmzjOrjavC6vZvn6SU913Nd3VvWpVKONiOXIkjFdJXNVb8GLGyTK7HKtO2NaOFGZdaJKSOJ+zpra0LwNQ6Q0XxxsaY64hI0mH0aXCtEZwujSEqTSJUaE2jTJNFZZUrRWUGtGmS78lR2YfRisVUiObOjUaivCqsfh/wAWZ6deO8eicnqaBgQrRUTqSiVyaRz3JUQe0UTq6f7KpFTArORoyHeWn7IuF7AJlf8AtsRX5xPpqAADQjAADQAAAAAAAAAAAAoA0DQoAwDQAA2Fbsg3YUbANhRsIzZTWbCMAANSCqTibM2tzl0Rxmzne3aeN0TwzF8jrPErPCM/0bniU/wDP9Wv4pv481/VP4oZOA/0jU8rnfA5cnEpfo6zyOPXhc9YmjpK43xp6KxYCowAAAgAAAAAArQAAAAoAAAAA0imQUyZGjpkah0zLaiI0rJl0iqMtmAAhkwqs2ZVeMhmxrXVjymLFdmHL5OdivZ4dT42eftK9XvHQ4Yw5MuSTpIrm2bDqgik0RFZsMqKyI+h+Gv8Ty+VjqPX7nBjCOyribs01hU9gVREOGSMrRNlVqoIvjewx0MmkEiWytNA1M1EVT2dY510T6O3LDl5D1Z7OI8vkoizrjjqnZFNHYGlqiGuXKtmK3HO/By6dYnTOFdIxcho5WNYx8jsZaxioLi8Mmpi0+Ro7MK8F1HQa0aaBOt+Tr4rJ19si3O/B183XNv/ABROvRxSoM0yTRpKxorCbRpE6RUQpaNMq48uiM2KvMiM457y7Zpo88lKdExMX43O1XW/Ri8u/j7/AMekmmto5vQ0KwIVhlNw2UxG8VF0ctw0a0c9oqJsKFQDbIptkC5X/tsK/OZ9QAAABAAAaAAAAAAAAAAAAFMlsLG3PV69gpQAAAAgCgACgAA0DAAIArAGlEWR04sLZi9O3PDvw8U4ddvVz43dj43/AIcb27zh3cXiQ6/P0cO/I6TlauEuz6+jH9G/Uy4bJ/RfVv8Ahf8Ag/ovqV8Ff0P6nojk+MVfo3PMl8cebyfiGv0ejjzuPXgeVn4NT+j1c+V5O/juKsTR2nTy9eMjk1rnhdFRgQBAABQEAGgAUBQEAUAAABoVpFMiKdEaOiNqIy2tJG4omYbNsDQNAZBVE2iC+KtszWo7U+q2c2nVg5vX9nPrgdf/AMk9a2Y/mF/y2/2PRDrkD1RRZieqKTmJgos49WW/5A9R9H8DyNo8fn5Zse28h5Uwv2GjB2AaQiiZAyYZwUyiOzSjsA05GgmGeRsGDYBsIZM3EqsM6xzrqj0d+XJy51uz2cPL5GxiZ11y9VPqZF/mx46B6UnVt6L+pIjlWvZjpqOOzj07R28Xi47x9q8nnrpHn/JYpw3+P7OTpy4Ybqkl+yV0dlcfJi12/Zj2RbHJNHVEMmo6pTjW/wBnTrm8/v8ArKmyaN2b1GMuozqXUK0zWoTqzWss6s1rJGjUrJax0lvRtMSqa96KmIUisovwaZK2wF7FBsA2QdvE51Y/xrzJix157x62PLGRblnKvROpT62a459lGjN+gElxSszaylcJjUcWfB+5NzocFG9E9lVqogZUQJnyTOJunpFkH55PqAAAAAAAjQAAAAAAAAAACgAAAAAAAAAAAAACt2Ab0FY3sIAjCqaVsix2YMDpnLrp6eOHqYOMebrt6+eHoYONs8/Xbvzy9LDwjz9eR1nL0MfBSRwvkbxVceUY91xjiUNUrSLoXSKo6oDpx8LHyV5RzvkvI8j5P4mYb0evw+es3mV85yvj9b8H0OPK8/fgeVl4zk9M7eLvwuesWjrOnn64ScmtcrClYAAAAYEaAAAUBQAAAGgAUxFMiNGRGjojSsmW4ojLcURGzEDAPjx3kpRC7U/SJbiunNw+TxWlyMbx79bMzuX8VKmaStitAW+5kxdE5CYaqsxMNVnMZw1ecxn1F5ykwOspMFFkJiMeVlxHuf6e5X+51PJ8nn6H1+Oe71vR85m/SWT8L0bWfYWQGKxWyItPlkZWU+CMankeixpDZtWoA2EamA+wDYG9jUZVxs6xzrtx+j0eNyo6Lez18uF5MdExqCn0baxKlp7Xsz7Y52PP5FPb2Yt1hw5bOPTryMXPvDOl6OHTrI4+TyLz1ujk68w3GjdHLqtPUuKqV2/Ry1lvHS7+RarupToayTyzXtRSUWVDm5RptAUGjSYzqVnGOTTN5Sa0zUrGLfdiaUs9v9ebJGlMk4/re/R36nPqWPDvXZ6PC4ov2aZrHorJ8/8AjfSun8/2VpybANkDJkRfHyLxvcszWpcetxuU7j8/DOV+no56dSpMzregisZkJQRGho87lRp7R15o42bCXlx41u6SNSWpsjy+Z/qHi4FrG+9Hfn49rl15pHzvN+X5XL3uus/0j2ceHnl5r5LX8zD3AAAAAACAK0IAAAAAAACgAAAAAAAAAAwAA0AAwAAAAoArp4+Pszn1Xfx869zi8bweLvt9Djh6eDjHm67ejnl6fH46R5+u3WR345mTz2qv9ngxipujSpVRoKUYAAWxcisfoxedE81vL7NczB5XL456vH0rxORgR7OenLrh5+Tjnonby9+JyZMGjrOnk78bmqNHWV5uuUzTmAjAAI0ACgACgDdeNgYBoARTBTIimRGzojSsmW4pJltREbMQMB2/FcxcHm4+S57KHvRjyc+0xXs/6p/1Ji+arH9WL61COXh8V5/WeZkfOnoVqAYg0BkwKTRMFZsmC05DOKtNmcDqxiB0B3fE8n6uRJy83O8j77Bl745pHx+plU9TskRNrRsNGTRB0TlJjOLfetExj1Ru2ytE2aG7A3YDywjdgYRDpFlSqx7OkrFd2N6k9Xi6cOjdj089ONaddBsajexfZdI2c70jg53hdjPsmPJyZDFrfMc1Wca7cwqezl06uvjPqzj0PQ+7wckw2IVXXG2RlVIsZOdIgNjTWgNaNLqA1BptCVIZscmadFlcsc+TPk1134OvtUczryGSXRUxF2aZwhVKwDZFMqAaXukZpj1sfiUjz2uhu7Xpk1pj5mSf/QvsxfJrsla8GpPs9nTyudxsWJVve/0enyc8ev8Ax/T2eXk+bwL9HCeOnu8v5D/UCnE3Eejt4/D9s3yvmOR/qXm34j8T38/G5cL5q8vNzuVnf+5bZ2nHMcr1akjbJ9eCLHwJzfRAAAAAAAAaAAAAAAAAAAAAAAAABgAAAAGoDAAAKAAAaFtkrfMexwOPvTPJ5en0PDw9/jcf0eDvt7ueXq4MH/h5uunWR0a6nP8AVb3GK3uTArouBSjQAAIAAKJZo7Sa5qvF5eLR6+KV5tT5PTHKoZMWzc6ce+NcGbDo789PF5PG5KnR2jydcpmnNgZAVoAAAAUAAGgAUEDBTIinRGjojaiMtxSSNxRGWzAMQMAAaBoGgMBqIHQFEQUTIKzRkUVEGuyhseRzSZLEfb/Bc9ZcKhvyj5XyPHlbe332jyondGhJUaFJZEXglSuq3j+sw5/euTZ0bVwz2M2pW5I6llCJlG7IHjz4JUdLwNTsmufsyGkblKrfKlTpHo4cOoJ5B6JXGx0S9rZ0nSYz7C+yM+xD2CVlM6uOLmZN4mZ1qR4dZNi10kIcrXWK4p8nHpp244OVHQpMDrwwZSuqVojBzcQGxpUBrRprQFGnTlGnTRhKiOadozrHUebmnR0lYxytm2U6o0IOvJWR2KhXQUvYDVRBTHX5ozVevNeEeeugdGVSsujkyG5UcuTZ0lRyZEdJWMebzl/s0ejx/rHT5up8nujizqaQ0oiK68EV/PTL6IAAAAA0AAAAAAAAAAAAAA0KAMCMAAAAAAAAAAAoAADp42PtSOXdejxcvp+BxvCPm+Xt9bx8PcwYlKPF1Xoker8d9Xb8zzeXVpvk/pX8DPi3/U5ebs9LQ2BoVpAwQAAAAADA8zmwejx1Xi5Vpns5YqRplHJj2jfNcu+Nefmw6PRz08Hk8bkqdHWV47CGmAABQEAAFAABoABpFaFMiKdEaOiNqIy2dEaURGzoimIGA0AAANCGQDIitTApLAomZDJkDpgbsBthHp/Fc98fKvPg4ebx7GpX23H5Ky41Us+V1zlaO6MoNlFJZEdEsiGb8ERPZoNGRz6IHduwgA3q9bCMV9XsDpfO3Gv2Zxj+bg5fyE4Mb8+Tt4+NWxy8Tn/fPbZ6LzjlY7FyBK5+rtxc7U6Na53lv+Rsup6j7R7GFrITVxx8zLrExGpHkdjVdJFJOVbdOI49K7cZzqLyYHbhkyxVzUZaaAUAGmgF1Aa0adZzc1Gj2APYJRnUrg5Mm5XPHl5HpnaVEnRpHPV+SpjO5UxncGM7BcHYhjVk8kMevx8qvGjz9NxbZhSUxo57RrRC4NysuXLjOsrLx/k/E9P7PX4XLt4zxHslcUnGmb1FMWGrepRNS1bJxcmOfyRNOen8zD6QAAAAAYDANAwAAAAAAAAAA0KGFYGWAAAAAAAAABQAAGgd/B/kjz+X8e3wPrOD/FHy/I+rw9WPR5XZ0cb+Rz7G8v2Txq5TqgQDEVoGhGgAABgDAefzTt41eFn9nt5Y6QNstv8AiCuLOd+Xi8rzsh6I+f2ibcQAAAAABQAAAGgaiK0KZEaOiNHRGlEZbOiNKIjR0RoyIGA0AAAjQGQDEVoDSBRGQ6CmIhgNCK4v5oUj7b4f/gR8nz/ro9E840oaSMuiCIYgU0gQFpIhiIrX8DI5WbUhVeL8z6PV4GKn8R/xs6+Rzr14OTC8ljNVRWVEEYyK4ef/AALy1HmyarcXg5VXVjOVV1YznUdOMzR6GL0YYqhuMtKAoAAo0qA1A/6Pd/8Ahkp42mADKjh5JYxXk5/Z3jDmZtEL9mkKAoGhWEAB6nA/geftqOw5qVgToolRuMubKdIj5/5T/lPd4XDt51Hqjihfs2O74z/lRnpz7/Ho/J/8RmMeN//Z');
padding: 1rem;
background-repeat: no-repeat;
background-size: cover;
border-radius: 6px;
}
</style>";
}
}
PK�"�[�#o,,tables/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[&��.��tables/phocacartbulkprice.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartBulkprice extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_bulk_prices', 'id',
$db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
$this->date = JFactory::getDate()->toSql();
return true;
}
}
?>PK�"�[~���tables/phocacartcart.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartCart extends JTable
{
// NOT USED
/* function __construct(& $db) {
parent::__construct('#__phocacart_cart', 'user_id',
$db);
}
function __construct(& $db) {
parent::__construct('#__phocacart_cart_multiple',
'id', $db);
}
*/
function __construct(& $db) {
parent::__construct('#__phocacart_cart_multiple',
array('user_id', 'vendor_id', 'ticket_id',
'unit_id', 'section_id'), $db);
}
}
?>PK�"�[�,
,
tables/phocacartcategory.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
use Joomla\String\StringHelper;
class TablePhocacartCategory extends JTable
{
protected $_jsonEncode = array('params', 'metadata');
function __construct(& $db) {
parent::__construct('#__phocacart_categories', 'id',
$db);
}
function check() {
if (trim( $this->title ) == '') {
$this->setError( JText::_(
'COM_PHOCACART_CATEGORY_MUST_HAVE_TITLE') );
return false;
}
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
// Add prefix to category alias if it or its name starts with digit
// Needed, when: SUBCATEGORY is used, SUBCATEGORY NAME starts with
digit, SEF is used because of possible problems in router
// Digit in subcategory name can be handled as product ID because
two Numbers will be displayed in URL (first real subcategory ID, second
digit in alias title which will confuse router
$pC = PhocacartUtils::getComponentParameters();
$category_alias_prefix = $pC->get('category_alias_prefix',
'');
if ($category_alias_prefix != '' &&
is_numeric(substr($this->alias, 0, 1))) {
$this->alias =
JApplicationHelper::stringURLSafe($category_alias_prefix .
$this->alias);
}
// Clean up keywords -- eliminate extra spaces between phrases
// and cr (\r) and lf (\n) characters from string if not empty
if (!empty($this->metakey))
{
// Array of characters to remove
$bad_characters = array("\n", "\r",
"\"", '<', '>');
// Remove bad characters
$after_clean = StringHelper::str_ireplace($bad_characters, '',
$this->metakey);
// Create array using commas as delimiter
$keys = explode(',', $after_clean);
$clean_keys = array();
foreach ($keys as $key)
{
if (trim($key))
{
// Ignore blank keywords
$clean_keys[] = trim($key);
}
}
// Put array back together delimited by ", "
$this->metakey = implode(', ', $clean_keys);
}
// Clean up description -- eliminate quotes and <> brackets
if (!empty($this->metadesc))
{
// Only process if not empty
$bad_characters = array("\"", '<',
'>');
$this->metadesc = StringHelper::str_ireplace($bad_characters,
'', $this->metadesc);
}
return true;
}
}
?>
PK�"�[2�D��tables/phocacartcountry.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartCountry extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_countries', 'id',
$db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
}
?>PK�"�[�@��tables/phocacartcoupon.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartCoupon extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_coupons', 'id',
$db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
}
?>PK�"�[㦄x��tables/phocacartcurrency.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartCurrency extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_currencies', 'id',
$db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
if ($this->exchange_rate == 0 || $this->exchange_rate <
0.00000001) {
$this->setError( JText::_(
'COM_PHOCACART_ERROR_EXCHANGE_RATE_MUST_BE_GREATER_THAN_ZERO') );
return false;
}
return true;
}
}
?>
PK�"�[XKw���tables/phocacartdiscount.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartDiscount extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_discounts', 'id',
$db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
}
?>PK�"�[C��2''tables/phocacartexport.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocaCartExport extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_export', 'id',
$db);
}
function check() {
return true;
}
}
?>PK�"�[2���``tables/phocacartfeatured.phpnu�[���<?php
/**
* @package Joomla.Administrator
* @subpackage com_content
*
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* @package Joomla.Administrator
* @subpackage com_content
*/
class TablePhocacartFeatured extends JTable
{
/**
* @param JDatabaseDriver A database connector object
*/
public function __construct(&$db)
{
parent::__construct('#__phocacart_product_featured',
'product_id', $db);
}
}
PK�"�[�cB���tables/phocacartfeed.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartFeed extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_feeds', 'id', $db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
}
?>PK�"�[ӻp��tables/phocacartformfield.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocaCartFormfield extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_form_fields', 'id',
$db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
public function displayItem($pks = null, $state = 1, $userId = 0, $column
= 'display_billing') {
$k = $this->_tbl_key;
\Joomla\Utilities\ArrayHelper::toInteger($pks);
$userId = (int) $userId;
$state = (int) $state;
if (empty($pks)) {
if ($this->$k) {
$pks = array($this->$k);
} else {
$this->setError(JText::_('JLIB_DATABASE_ERROR_NO_ROWS_SELECTED'));
return false;
}
}
$where = $k.'='.implode(' OR '.$k.'=',
$pks);
if (!property_exists($this, 'checked_out') ||
!property_exists($this, 'checked_out_time')) {
$checkin = '';
} else {
$checkin = ' AND (checked_out = 0 OR checked_out = '.(int)
$userId.')';
}
$this->_db->setQuery(
'UPDATE `'.$this->_tbl.'`' .
' SET '.
$this->_db->quoteName(htmlspecialchars($column)).' =
'.(int) $state .
' WHERE ('.$where.')' .
$checkin
);
//$this->_db->query();
try {
$this->_db->execute();
} catch (RuntimeException $e) {
throw new Exception($e->getMessage(), 500);
return false;
}
if ($checkin && (count($pks) ==
$this->_db->getAffectedRows())) {
foreach($pks as $pk) {
$this->checkin($pk);
}
}
if (in_array($this->$k, $pks)) {
$this->state = $state;
}
$this->setError('');
return true;
}
}
?>
PK�"�[��%�tables/phocacartgroup.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
class TablePhocacartGroup extends JTable
{
function __construct( &$db ) {
parent::__construct( '#__phocacart_groups', 'id', $db
);
}
function check(){
return true;
}
}
?>PK�"�[C �tables/phocacarthits.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
class TablePhocacartOrderAttributes extends JTable
{
function __construct( &$db ) {
parent::__construct( '#__phocacart_hits', 'id', $db
);
}
function check(){
return true;
}
}
?>PK�"�[rc��''tables/phocacartimport.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocaCartImport extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_import', 'id',
$db);
}
function check() {
return true;
}
}
?>PK�"�[�K\�\\tables/phocacartitem.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
use Joomla\String\StringHelper;
class TablePhocaCartItem extends JTable
{
protected $_jsonEncode = array('params', 'metadata');
function __construct(& $db) {
parent::__construct('#__phocacart_products', 'id',
$db);
}
function check() {
if (trim( $this->title ) == '') {
$this->setError( JText::_(
'COM_PHOCACART_PRODUCT_MUST_HAVE_TITLE') );
return false;
}
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
// Clean up keywords -- eliminate extra spaces between phrases
// and cr (\r) and lf (\n) characters from string if not empty
if (!empty($this->metakey))
{
// Array of characters to remove
$bad_characters = array("\n", "\r",
"\"", '<', '>');
// Remove bad characters
$after_clean = StringHelper::str_ireplace($bad_characters, '',
$this->metakey);
// Create array using commas as delimiter
$keys = explode(',', $after_clean);
$clean_keys = array();
foreach ($keys as $key)
{
if (trim($key))
{
// Ignore blank keywords
$clean_keys[] = trim($key);
}
}
// Put array back together delimited by ", "
$this->metakey = implode(', ', $clean_keys);
}
// Clean up description -- eliminate quotes and <> brackets
if (!empty($this->metadesc))
{
// Only process if not empty
$bad_characters = array("\"", '<',
'>');
$this->metadesc = StringHelper::str_ireplace($bad_characters,
'', $this->metadesc);
}
return true;
}
}
?>PK�"�[�K6���tables/phocacartlog.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartLog extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_logs', 'id', $db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
}
?>PK�"�[b`����
tables/phocacartmanufacturer.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartManufacturer extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_manufacturers',
'id', $db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
}
?>PK�"�[�ow��tables/phocacartorder.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
class TablePhocacartOrder extends JTable
{
function __construct( &$db ) {
parent::__construct( '#__phocacart_orders', 'id', $db
);
}
function check(){
/*if (trim( $this->title ) == '') {
$this->setError( JText::_(
'COM_PHOCACART_ERROR_TITLE_NOT_SET') );
return false;
}
if (empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = JApplicationHelper::stringURLSafe($this->alias);
if (trim(str_replace('-', '', $this->alias)) ==
'') {
$this->alias =
JFactory::getDate()->format("Y-m-d-H-i-s");
}*/
return true;
}
}
?>PK�"�[�#tables/phocacartorderattributes.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
class TablePhocacartOrderAttributes extends JTable
{
function __construct( &$db ) {
parent::__construct( '#__phocacart_order_attributes',
'id', $db );
}
function check(){
return true;
}
}
?>PK�"�[��1=
tables/phocacartordercoupons.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
class TablePhocacartOrderCoupons extends JTable
{
function __construct( &$db ) {
parent::__construct( '#__phocacart_order_coupons',
'id', $db );
}
function check(){
return true;
}
}
?>PK�"�[R�$"tables/phocacartorderdiscounts.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
class TablePhocacartOrderDiscounts extends JTable
{
function __construct( &$db ) {
parent::__construct( '#__phocacart_order_discounts',
'id', $db );
}
function check(){
return true;
}
}
?>PK�"�[=�("tables/phocacartorderdownloads.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
class TablePhocacartOrderDownloads extends JTable
{
function __construct( &$db ) {
parent::__construct( '#__phocacart_order_downloads',
'id', $db );
}
function check(){
return true;
}
}
?>PK�"�[oD�
tables/phocacartorderhistory.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
class TablePhocacartOrderHistory extends JTable
{
function __construct( &$db ) {
parent::__construct( '#__phocacart_order_history',
'id', $db );
}
function check(){
return true;
}
}
?>PK�"�[K^
�(()tables/phocacartorderproductdiscounts.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
class TablePhocacartOrderProductDiscounts extends JTable
{
function __construct( &$db ) {
parent::__construct( '#__phocacart_order_product_discounts',
'id', $db );
}
function check(){
return true;
}
}
?>PK�"�[�φ�!tables/phocacartorderproducts.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
class TablePhocacartOrderProducts extends JTable
{
function __construct( &$db ) {
parent::__construct( '#__phocacart_order_products',
'id', $db );
}
function check(){
return true;
}
}
?>PK�"�[f^CC*tables/phocacartordertaxrecapitulation.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class TablePhocacartOrderTaxRecapitulation extends JTable
{
function __construct( &$db ) {
parent::__construct( '#__phocacart_order_tax_recapitulation',
'id', $db );
}
function check(){
return true;
}
}
?>PK�"�[���**tables/phocacartordertotal.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class TablePhocacartOrderTotal extends JTable
{
function __construct( &$db ) {
parent::__construct( '#__phocacart_order_total',
'id', $db );
}
function check(){
return true;
}
}
?>PK�"�[[��**tables/phocacartorderusers.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class TablePhocacartOrderUsers extends JTable
{
function __construct( &$db ) {
parent::__construct( '#__phocacart_order_users',
'id', $db );
}
function check(){
return true;
}
}
?>PK�"�[������tables/phocacartparameter.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartParameter extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_parameters', 'id',
$db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
$wrongAlias = array(
// Default Parameters
'c', 'price_from', 'price_to',
'tag', 'label', 'manufacturer',
'a', 's',
// Joomla! Suffix Parameters
'start', 'limitstart', 'tmpl',
'format',
// AJAX
'option', 'view', 'typeview',
'task',
// AJAX - com_ajax used for ajax refresching modules
'module', 'method', 'plugin'
);
if (in_array(trim($this->alias), $wrongAlias)) {
$this->setError(JText::_('COM_PHOCACART_ERROR_TITLE_ALIAS_CANNOT_BE_USED_ALREADY_IN_USE_BY_ANOTHER_PARAMETER'),
'error');
return false;
}
return true;
}
}
?>
PK�"�[�J��"tables/phocacartparametervalue.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartParameterValue extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_parameter_values',
'id', $db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
}
?>
PK�"�[��JJtables/phocacartpayment.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartPayment extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_payment_methods',
'id', $db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
public function store($updateNulls = false){
if ($this->default != '0') {
$query = $this->_db->getQuery(true)
->update('#__phocacart_payment_methods')
->set($this->_db->quoteName('default').' =
\'0\'')
->where($this->_db->quoteName('default').' =
' . $this->_db->quote($this->default));
$this->_db->setQuery($query);
$this->_db->execute();
}
return parent::store($updateNulls);
}
}
?>PK�"�[s:��==%tables/phocacartproductcategories.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
class TablePhocacartProductCategories extends JTable
{
function __construct( &$db ) {
parent::__construct( '#__phocacart_product_categories',
array('product_id', 'category_id'), $db );
}
function check(){
return true;
}
}
?>PK�"�[a@�
::%tables/phocacartproductpointgroup.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class TablePhocacartProductPointGroup extends JTable
{
function __construct( &$db ) {
parent::__construct( '#__phocacart_product_point_groups',
'id', $db );
}
function check(){
return true;
}
}
?>PK�"�[�f��::%tables/phocacartproductpricegroup.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class TablePhocacartProductPriceGroup extends JTable
{
function __construct( &$db ) {
parent::__construct( '#__phocacart_product_price_groups',
'id', $db );
}
function check(){
return true;
}
}
?>PK�"�[�]B�EE'tables/phocacartproductpricehistory.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class TablePhocacartProductPriceHistory extends JTable
{
function __construct( &$db ) {
parent::__construct( '#__phocacart_product_price_history',
'product_id', $db );
}
function check(){
return true;
}
}
?>PK�"�[k3͟..
tables/phocacartproductstock.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class TablePhocacartProductStock extends JTable
{
function __construct( &$db ) {
parent::__construct( '#__phocacart_product_stock',
'id', $db );
}
function check(){
return true;
}
}
?>
PK�"�[�oHݰ�tables/phocacartquestion.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocaCartQuestion extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_questions', 'id',
$db);
}
function check() {
/*if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
*/
return true;
}
}
?>PK�"�[Q Z-��tables/phocacartregion.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartRegion extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_regions', 'id',
$db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
}
?>PK�"�[�#��tables/phocacartreview.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartReview extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_reviews', 'id',
$db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
}
?>PK�"�[R;8��tables/phocacartrewardpoint.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartRewardPoint extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_reward_points',
'id', $db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
}
?>PK�"�[�J����tables/phocacartsection.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartSection extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_sections', 'id',
$db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
}
?>PK�"�[ú;kMMtables/phocacartshipping.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartShipping extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_shipping_methods',
'id', $db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
public function store($updateNulls = false){
if ($this->default != '0') {
$query = $this->_db->getQuery(true)
->update('#__phocacart_shipping_methods')
->set($this->_db->quoteName('default').' =
\'0\'')
->where($this->_db->quoteName('default').' =
' . $this->_db->quote($this->default));
$this->_db->setQuery($query);
$this->_db->execute();
}
return parent::store($updateNulls);
}
}
?>PK�"�[�Ku��!tables/phocacartspecification.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartSpecification extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_specification_groups',
'id', $db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
}
?>PK�"�[���1��tables/phocacartstatus.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocaCartStatus extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_order_statuses',
'id', $db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
}
?>PK�"�[́6��tables/phocacartstockstatus.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartStockStatus extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_stock_statuses',
'id', $db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
}
?>PK�"�[��m���tables/phocacartsubmititem.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocaCartSubmititem extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_submit_items',
'id', $db);
}
function check() {
/*if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
*/
return true;
}
}
?>PK�"�[8��2��tables/phocacarttag.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartTag extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_tags', 'id', $db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
}
?>PK�"�[0�">��tables/phocacarttax.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartTax extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_taxes', 'id', $db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
}
?>PK�"�[�zN��tables/phocacarttime.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartTime extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_opening_times',
'id', $db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
$timeFrom = PhocacartTime::getTime($this->hour_from,
$this->minute_from);
$timeTo = PhocacartTime::getTime($this->hour_to, $this->minute_to);
if (strtotime($timeFrom) > 0 && strtotime($timeTo) == 0) {
$this->setError(JText::_('COM_PHOCACART_IF_TIME_FROM_SET_THEN_TIME_TO_MUST_BE_SET_TOO'));
return false;
}
if (strtotime($timeTo) > 0 && strtotime($timeFrom) == 0) {
$this->setError(JText::_('COM_PHOCACART_IF_TIME_TO_SET_THEN_TIME_FROM_MUST_BE_SET_TOO'));
return false;
}
if(strtotime($timeFrom) > strtotime($timeTo)) {
//$app = JFactory::getApplication();
//$app->enqueueMessage(JText::_('COM_PHOCACART_TIME_FROM_CANNOT_BE_GREATER_THAN_TIME_TO'),
'error');
$this->setError(JText::_('COM_PHOCACART_TIME_FROM_CANNOT_BE_GREATER_THAN_TIME_TO'));
return false;
}
return true;
}
}
?>PK�"�[�X�+��tables/phocacartunit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartUnit extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_units', 'id', $db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
}
?>PK�"�[$G�n��tables/phocacartuser.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartUser extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_users', 'id', $db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
}
?>PK�"�[��!���tables/phocacartvendor.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartVendor extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_vendors', 'id',
$db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
}
?>PK�"�[
�����tables/phocacartwishlist.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartWishlist extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_wishlists', 'id',
$db);
}
function check() {
/*if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
*/
return true;
}
}
?>PK�"�[��eޢ�tables/phocacartzone.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.filter.input');
class TablePhocacartZone extends JTable
{
function __construct(& $db) {
parent::__construct('#__phocacart_zones', 'id', $db);
}
function check() {
if(empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = PhocacartUtils::getAliasName($this->alias);
return true;
}
}
?>PK�"�[V�b::update/index.htmlnu�[���<html><body
style="background-color:
#000;"></body></html>PK�"�[V�b::update/sql/index.htmlnu�[���<html><body
style="background-color:
#000;"></body></html>PK�"�[
�.��update/sql/mysql/3.0.1.sqlnu�[���ALTER TABLE
`#__phocacart_shipping_methods` ADD COLUMN `active_quantity` tinyint(1) NOT
NULL DEFAULT '0';
ALTER TABLE `#__phocacart_shipping_methods` ADD COLUMN `minimal_quantity`
int(11) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_shipping_methods` ADD COLUMN `maximal_quantity`
int(11) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_order_statuses` ADD COLUMN `email_text_others`
text;
ALTER TABLE `#__phocacart_order_statuses` ADD COLUMN `email_subject_others`
varchar(255) NOT NULL DEFAULT '';
PK�"�[E#�##update/sql/mysql/3.0.2.sqlnu�[���ALTER
TABLE `#__phocacart_product_stock` ADD COLUMN `operator` char(1) NOT NULL
DEFAULT '';
ALTER TABLE `#__phocacart_product_stock` ADD COLUMN `amount` DECIMAL( 15, 4
) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_product_stock` ADD COLUMN `price` DECIMAL( 15, 4
) NOT NULL DEFAULT '0';
PK�"�[%߾�ddupdate/sql/mysql/3.0.3.sqlnu�[���ALTER
TABLE `#__phocacart_product_stock` ADD COLUMN `active_price` tinyint(1) NOT
NULL DEFAULT '0';
PK�"�[��zr��update/sql/mysql/3.1.0.sqlnu�[���/*CREATE
TABLE IF NOT EXISTS `#__phocacart_cart_multiple` (
`id` int(11) NOT NULL DEFAULT '0',
`user_id` int(11) NOT NULL DEFAULT '0',
`vendor_id` int(11) NOT NULL DEFAULT '0',
`ticket_id` int(11) NOT NULL DEFAULT '0',
`unit_id` int(11) NOT NULL DEFAULT '0',
`section_id` int(11) NOT NULL DEFAULT '0',
`loyalty_card_number` varchar(30) NOT NULL DEFAULT '',
`cart` text,
`shipping` int(11) NOT NULL DEFAULT '0',
`coupon` int(11) NOT NULL DEFAULT '0',
`payment` int(11) NOT NULL DEFAULT '0',
`reward` int(11) NOT NULL DEFAULT '0',
`type` tinyint(3) NOT NULL default '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
INSERT INTO `#__phocacart_cart_multiple` (id, user_id, cart, shipping,
coupon, payment, reward, date, vendor_id, ticket_id) SELECT row_number()
over (ORDER BY (SELECT NULL)), user_id, cart, shipping, coupon, payment,
reward, date, 0 AS vendor_id, 0 AS ticket_id FROM `#__phocacart_cart`;*/
-- 3.1.0 Alpha
CREATE TABLE IF NOT EXISTS `#__phocacart_cart_multiple` (
`user_id` int(11) NOT NULL DEFAULT '0',
`vendor_id` int(11) NOT NULL DEFAULT '0',
`ticket_id` int(11) NOT NULL DEFAULT '0',
`unit_id` int(11) NOT NULL DEFAULT '0',
`section_id` int(11) NOT NULL DEFAULT '0',
`loyalty_card_number` varchar(30) NOT NULL DEFAULT '',
`cart` text,
`shipping` int(11) NOT NULL DEFAULT '0',
`coupon` int(11) NOT NULL DEFAULT '0',
`payment` int(11) NOT NULL DEFAULT '0',
`reward` int(11) NOT NULL DEFAULT '0',
`type` tinyint(3) NOT NULL default '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
KEY `idx_uvtus` (`user_id`, `vendor_id`, `ticket_id`, `unit_id`,
`section_id`)
) DEFAULT CHARSET=utf8;
INSERT INTO `#__phocacart_cart_multiple` (user_id, cart, shipping, coupon,
payment, reward, date, vendor_id, ticket_id, unit_id, section_id) SELECT
user_id, cart, shipping, coupon, payment, reward, date, 0 AS vendor_id, 1
AS ticket_id, 1 AS unit_id, 1 AS section_id FROM `#__phocacart_cart`;
CREATE TABLE IF NOT EXISTS `#__phocacart_vendors` (
`id` int(11) NOT NULL auto_increment,
`user_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`description` text,
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`access` int(11) unsigned NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `cat_idx` (`published`,`access`),
KEY `idx_access` (`access`),
KEY `idx_checkout` (`checked_out`),
KEY `idx_published` (`published`),
KEY `idx_alias` (`alias`),
KEY `idx_language` (`language`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_sections` (
`id` int(11) NOT NULL auto_increment,
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`description` text,
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`access` int(11) unsigned NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `cat_idx` (`published`,`access`),
KEY `idx_access` (`access`),
KEY `idx_checkout` (`checked_out`),
KEY `idx_published` (`published`),
KEY `idx_alias` (`alias`),
KEY `idx_language` (`language`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_units` (
`id` int(11) NOT NULL auto_increment,
`section_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`description` text,
`class_name` varchar(255) NOT NULL DEFAULT '',
`custom_css` text,
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`access` int(11) unsigned NOT NULL DEFAULT '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `cat_idx` (`published`,`access`),
KEY `idx_access` (`access`),
KEY `idx_checkout` (`checked_out`),
KEY `idx_published` (`published`),
KEY `idx_alias` (`alias`),
KEY `idx_language` (`language`)
) DEFAULT CHARSET=utf8;
ALTER TABLE `#__phocacart_users` ADD COLUMN `loyalty_card_number`
varchar(30) NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_taxes` ADD COLUMN `code` varchar(5) NOT NULL
DEFAULT '';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `type` tinyint(3) NOT NULL
default '0';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `vendor_id` int(11) NOT NULL
DEFAULT '0';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `ticket_id` int(11) NOT NULL
DEFAULT '0';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `unit_id` int(11) NOT NULL
DEFAULT '0';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `section_id` int(11) NOT NULL
DEFAULT '0';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `loyalty_card_number`
varchar(30) NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_payment_methods` ADD COLUMN `type` tinyint(3) NOT
NULL default '0';
ALTER TABLE `#__phocacart_shipping_methods` ADD COLUMN `type` tinyint(3)
NOT NULL default '0';
ALTER TABLE `#__phocacart_coupons` ADD COLUMN `type` tinyint(3) NOT NULL
default '0';
ALTER TABLE `#__phocacart_discounts` ADD COLUMN `type` tinyint(3) NOT NULL
default '0';
ALTER TABLE `#__phocacart_products` ADD COLUMN `type` tinyint(3) NOT NULL
default '0';
ALTER TABLE `#__phocacart_categories` ADD COLUMN `type` tinyint(3) NOT NULL
default '0';
-- 3.1.0 Beta
ALTER TABLE `#__phocacart_orders` ADD COLUMN `reference_field1`
varchar(128) NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `reference_field2`
varchar(128) NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `reference_data` text;
ALTER TABLE `#__phocacart_orders` ADD COLUMN `order_number` varchar(64) NOT
NULL DEFAULT '';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `receipt_number` varchar(64)
NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `invoice_number` varchar(64)
NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `invoice_prn` varchar(64) NOT
NULL DEFAULT '';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `invoice_date` datetime NOT
NULL DEFAULT '0000-00-00 00:00:00';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `invoice_due_date` datetime
NOT NULL DEFAULT '0000-00-00 00:00:00';
-- 3.1.0 Stable
ALTER TABLE `#__phocacart_form_fields` ADD COLUMN `display_docs` tinyint(1)
NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `invoice_spec_top_desc` text;
ALTER TABLE `#__phocacart_orders` ADD COLUMN `invoice_spec_middle_desc`
text;
ALTER TABLE `#__phocacart_orders` ADD COLUMN `invoice_spec_bottom_desc`
text;
ALTER TABLE `#__phocacart_order_attributes` ADD COLUMN `option_value` text;
ALTER TABLE `#__phocacart_orders` ADD COLUMN `privacy` tinyint(1) NOT NULL
default '0';
ALTER TABLE `#__phocacart_users` ADD COLUMN `privacy` tinyint(1) NOT NULL
default '0';
ALTER TABLE `#__phocacart_questions` ADD COLUMN `privacy` tinyint(1) NOT
NULL default '0';
ALTER TABLE `#__phocacart_payment_methods` ADD COLUMN `privacy` tinyint(1)
NOT NULL default '0';
ALTER TABLE `#__phocacart_shipping_methods` ADD COLUMN `privacy` tinyint(1)
NOT NULL default '0';
PK�"�[�y���update/sql/mysql/3.1.1.sqlnu�[���ALTER
TABLE `#__phocacart_product_stock` ADD COLUMN `sku` varchar(255) NOT NULL
DEFAULT '';
ALTER TABLE `#__phocacart_product_stock` ADD COLUMN `ean` varchar(15) NOT
NULL DEFAULT '';
ALTER TABLE `#__phocacart_payment_methods` ADD COLUMN `cost_additional`
DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_shipping_methods` ADD COLUMN `cost_additional`
DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `amount_pay` DECIMAL( 15, 4 )
NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `amount_tendered` DECIMAL(
15, 4 ) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `amount_change` DECIMAL( 15,
4 ) NOT NULL DEFAULT '0';
PK�"�[<�]update/sql/mysql/3.1.2.sqlnu�[���ALTER
TABLE `#__phocacart_tags` ADD COLUMN `type` tinyint(3) NOT NULL default
'0';
ALTER TABLE `#__phocacart_tags` ADD COLUMN `display_format` tinyint(3) NOT
NULL default '0';
ALTER TABLE `#__phocacart_tags` ADD COLUMN `icon_class` varchar(64) NOT
NULL DEFAULT '';
CREATE TABLE IF NOT EXISTS `#__phocacart_taglabels_related` (
`id` SERIAL,
`item_id` int(11) NOT NULL DEFAULT '0',
`tag_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `i_file_id` (`item_id`,`tag_id`)
) DEFAULT CHARSET=utf8;
PK�"�[�8:m##update/sql/mysql/3.1.4.sqlnu�[���--
3.1.4
CREATE TABLE IF NOT EXISTS `#__phocacart_opening_times` (
`id` int(11) NOT NULL auto_increment,
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`type` tinyint(1) NOT NULL default '0',
`status` tinyint(1) NOT NULL default '0',
`day` tinyint(1) NOT NULL default '0',
`hour_from` int(2) NOT NULL default '0',
`minute_from` int(2) NOT NULL default '0',
`hour_to` int(2) NOT NULL default '0',
`minute_to` int(2) NOT NULL default '0',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`description` text,
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
ALTER TABLE `#__phocacart_orders` ADD COLUMN `required_delivery_time`
datetime NOT NULL DEFAULT '0000-00-00 00:00:00';
PK�"�[
�Gg��update/sql/mysql/3.1.6.sqlnu�[���--
3.1.6
ALTER TABLE `#__phocacart_products` ADD COLUMN `condition` tinyint(2) NOT
NULL DEFAULT 0;
ALTER TABLE `#__phocacart_products` ADD COLUMN `delivery_date` datetime NOT
NULL DEFAULT '0000-00-00 00:00:00';
ALTER TABLE `#__phocacart_products` ADD COLUMN `type_feed` text;
ALTER TABLE `#__phocacart_products` ADD COLUMN `type_category_feed` text;
ALTER TABLE `#__phocacart_categories` ADD COLUMN `type_feed` text;
-- country and region can have different tax
ALTER TABLE `#__phocacart_order_total` ADD COLUMN `item_id_c` int(11) NOT
NULL DEFAULT '0';
ALTER TABLE `#__phocacart_order_total` ADD COLUMN `item_id_r` int(11) NOT
NULL DEFAULT '0';
ALTER TABLE `#__phocacart_order_products` ADD COLUMN `default_tax_id_c`
int(11) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_order_products` ADD COLUMN `default_tax_id_r`
int(11) NOT NULL DEFAULT '0';
CREATE TABLE IF NOT EXISTS `#__phocacart_order_tax_recapitulation` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` int(11) NOT NULL DEFAULT '0',
`item_id` int(11) NOT NULL DEFAULT '0',
`item_id_c` int(11) NOT NULL DEFAULT '0',
`item_id_r` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`type` varchar(50) NOT NULL DEFAULT '',
`amount_netto` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`amount_tax` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`amount_brutto` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`amount_brutto_currency` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `order_id` (`order_id`)
) DEFAULT CHARSET=utf8;
PK�"�[�Ώ��update/sql/mysql/3.1.7.sqlnu�[���--
3.1.7
-- time of supply | date of taxable supply | tax point
ALTER TABLE `#__phocacart_orders` ADD COLUMN `invoice_time_of_supply`
datetime NOT NULL DEFAULT '0000-00-00 00:00:00';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `credit_id` int(11) NOT NULL
DEFAULT '0';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `credit_number` varchar(64)
NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `order_number_id` int(11) NOT
NULL DEFAULT '0';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `receipt_number_id` int(11)
NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `invoice_number_id` int(11)
NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `credit_number_id` int(11) NOT
NULL DEFAULT '0';
PK�"�[����update/sql/mysql/3.1.8.sqlnu�[���--
3.1.8
ALTER TABLE `#__phocacart_orders` ADD COLUMN `user_lang` char(7) NOT NULL
DEFAULT '';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `default_lang` char(7) NOT
NULL DEFAULT '';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `oidn_spec_billing_desc` text;
ALTER TABLE `#__phocacart_orders` ADD COLUMN `oidn_spec_shipping_desc`
text;
ALTER TABLE `#__phocacart_order_total` ADD COLUMN `title_lang` varchar(255)
NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_order_total` ADD COLUMN `title_lang_suffix`
varchar(100) NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_order_total` ADD COLUMN `title_lang_suffix2`
varchar(100) NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_order_tax_recapitulation` ADD COLUMN `title_lang`
varchar(255) NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_order_tax_recapitulation` ADD COLUMN
`title_lang_suffix` varchar(100) NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_order_tax_recapitulation` ADD COLUMN
`title_lang_suffix2` varchar(100) NOT NULL DEFAULT '';
PK�"�[1I0��update/sql/mysql/3.1.9.sqlnu�[���--
3.1.9
ALTER TABLE `#__phocacart_attribute_values` ADD COLUMN `download_token`
char(64) NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_attribute_values` ADD COLUMN `download_folder`
varchar(255) NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_attribute_values` ADD COLUMN `download_file`
varchar(255) NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_attribute_values` ADD COLUMN `download_hits`
int(11) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_order_downloads` ADD COLUMN `attribute_id`
int(11) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_order_downloads` ADD COLUMN `option_id` int(11)
NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_order_downloads` ADD COLUMN `order_attribute_id`
int(11) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_order_downloads` ADD COLUMN `order_option_id`
int(11) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_stock_statuses` ADD COLUMN `link` varchar(255)
NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_stock_statuses` ADD COLUMN `link_target`
varchar(10) NOT NULL DEFAULT
'';PK�"�[�4m���update/sql/mysql/3.2.0.sqlnu�[���--
3.2.0
ALTER TABLE `#__phocacart_specifications` ADD COLUMN `image` varchar(255)
NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_specifications` ADD COLUMN `image_medium`
varchar(255) NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_specifications` ADD COLUMN `image_small`
varchar(255) NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_specifications` ADD COLUMN `color` varchar(50)
NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_groups` ADD COLUMN `display_addtocart` tinyint(1)
unsigned NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_groups` ADD COLUMN `display_attributes`
tinyint(1) unsigned NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_categories` ADD COLUMN `created_by` int(11) NOT
NULL DEFAULT '0';
ALTER TABLE `#__phocacart_categories` ADD COLUMN `created` datetime NOT
NULL DEFAULT '0000-00-00 00:00:00';
ALTER TABLE `#__phocacart_categories` ADD COLUMN `modified_by` int(11) NOT
NULL DEFAULT '0';
ALTER TABLE `#__phocacart_categories` ADD COLUMN `modified` datetime NOT
NULL DEFAULT '0000-00-00 00:00:00';
ALTER TABLE `#__phocacart_products` ADD COLUMN `created_by` int(11) NOT
NULL DEFAULT '0';
ALTER TABLE `#__phocacart_products` ADD COLUMN `created` datetime NOT NULL
DEFAULT '0000-00-00 00:00:00';
ALTER TABLE `#__phocacart_products` ADD COLUMN `modified_by` int(11) NOT
NULL DEFAULT '0';
ALTER TABLE `#__phocacart_products` ADD COLUMN `modified` datetime NOT NULL
DEFAULT '0000-00-00 00:00:00';
PK�"�[��QHCCupdate/sql/mysql/3.2.2.sqlnu�[���--
3.2.2
ALTER TABLE `#__phocacart_shipping_methods` ADD `minimal_width` DECIMAL(
15, 4 ) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_shipping_methods` ADD `minimal_height` DECIMAL(
15, 4 ) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_shipping_methods` ADD `minimal_length` DECIMAL(
15, 4 ) NOT NULL DEFAULT '0';
PK�"�[@��ddupdate/sql/mysql/3.3.0.sqlnu�[���--
3.3.0
ALTER TABLE `#__phocacart_orders` ADD COLUMN `newsletter` tinyint(1) NOT
NULL default '0';
PK�"�[b:n��update/sql/mysql/3.3.1.sqlnu�[���--
3.3.1
ALTER TABLE `#__phocacart_products` ADD COLUMN `params_feed` text;
ALTER TABLE `#__phocacart_feeds` ADD COLUMN `feed_plugin` varchar(64) NOT
NULL DEFAULT '';
PK�"�[��PSSupdate/sql/mysql/3.3.2.sqlnu�[���--
3.3.1
ALTER TABLE `#__phocacart_order_statuses` ADD COLUMN `email_footer` text;
PK�"�[N�nQPPupdate/sql/mysql/3.4.0.sqlnu�[���--
3.4.0
CREATE TABLE IF NOT EXISTS `#__phocacart_product_files` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`product_id` int(11) NOT NULL DEFAULT '0',
`download_token` char(64) NOT NULL DEFAULT '',
`download_folder` varchar(255) NOT NULL DEFAULT '',
`download_file` varchar(255) NOT NULL DEFAULT '',
`download_hits` int(11) NOT NULL DEFAULT '0',
`type` tinyint(1) NOT NULL DEFAULT '0',
`ordering` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `idx_product` (`product_id`)
) DEFAULT CHARSET=utf8;
ALTER TABLE `#__phocacart_product_images` ADD COLUMN `type` tinyint(1) NOT
NULL DEFAULT '0';
ALTER TABLE `#__phocacart_product_images` ADD COLUMN `ordering` int(11) NOT
NULL DEFAULT '0';
ALTER TABLE `#__phocacart_product_price_history` ADD COLUMN `ordering`
int(11) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_order_downloads` ADD COLUMN `type` tinyint(1) NOT
NULL DEFAULT '0';
ALTER TABLE `#__phocacart_products` ADD COLUMN `public_play_file`
varchar(255) NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_products` ADD COLUMN `public_play_text`
varchar(255) NOT NULL DEFAULT
'';PK�"�[ߝ����update/sql/mysql/3.5.0.sqlnu�[���--
3.5.0 RC
ALTER TABLE `#__phocacart_order_statuses` ADD COLUMN `email_attachments`
text;
ALTER TABLE `#__phocacart_orders` ADD COLUMN `terms` tinyint(1) NOT NULL
default '0';
-- 3.5.0 Beta
ALTER TABLE `#__phocacart_products` ADD COLUMN `date_update` datetime NOT
NULL DEFAULT '0000-00-00 00:00:00';
ALTER TABLE `#__phocacart_products` ADD COLUMN `external_link2`
varchar(255) NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_products` ADD COLUMN `external_text2`
varchar(255) NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_products` ADD COLUMN `features` text;
ALTER TABLE `#__phocacart_categories` ADD COLUMN `count_date` datetime NOT
NULL DEFAULT '0000-00-00 00:00:00';
ALTER TABLE `#__phocacart_categories` ADD COLUMN `count_products` int(11)
NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_tags` ADD COLUMN `count_date` datetime NOT NULL
DEFAULT '0000-00-00 00:00:00';
ALTER TABLE `#__phocacart_tags` ADD COLUMN `count_products` int(11) NOT
NULL DEFAULT '0';
ALTER TABLE `#__phocacart_manufacturers` ADD COLUMN `count_date` datetime
NOT NULL DEFAULT '0000-00-00 00:00:00';
ALTER TABLE `#__phocacart_manufacturers` ADD COLUMN `count_products`
int(11) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_categories` ADD COLUMN `icon_class` varchar(64)
NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_products` ADD COLUMN `user_id` int(11) NOT NULL;
ALTER TABLE `#__phocacart_products` ADD COLUMN `vendor_id` int(11) NOT
NULL;
ALTER TABLE `#__phocacart_categories` ADD COLUMN `user_id` int(11) NOT
NULL;
ALTER TABLE `#__phocacart_categories` ADD COLUMN `vendor_id` int(11) NOT
NULL;
ALTER TABLE `#__phocacart_order_statuses` ADD COLUMN `orders_view_display`
text;
ALTER TABLE `#__phocacart_products` ADD COLUMN `download_days` int(11) NOT
NULL DEFAULT '-1';
ALTER TABLE `#__phocacart_product_files` ADD COLUMN `download_days` int(11)
NOT NULL DEFAULT '-1';
ALTER TABLE `#__phocacart_order_downloads` ADD COLUMN `download_days`
int(11) NOT NULL DEFAULT '-1';
ALTER TABLE `#__phocacart_products` ADD INDEX `idx_price` (`price`);
CREATE TABLE IF NOT EXISTS `#__phocacart_parameters` (
`id` int(11) NOT NULL auto_increment,
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`title_header` varchar(255) NOT NULL DEFAULT '',
`type` tinyint(1) NOT NULL default '0',
`link_type` tinyint(1) NOT NULL DEFAULT '0',
`limit_count` int(11) NOT NULL DEFAULT '0',
`description` text,
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_parameter_values` (
`id` int(11) NOT NULL auto_increment,
`parameter_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`type` tinyint(1) NOT NULL default '0',
`display_format` tinyint(1) NOT NULL default '0',
`icon_class` varchar(64) NOT NULL DEFAULT '',
`link_ext` varchar(255) NOT NULL DEFAULT '',
`link_cat` int(11) unsigned NOT NULL DEFAULT '0',
`description` text,
`count_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`count_products` int(11) NOT NULL DEFAULT '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
-- `id` SERIAL,
CREATE TABLE IF NOT EXISTS `#__phocacart_parameter_values_related` (
`item_id` int(11) NOT NULL DEFAULT '0',
`parameter_value_id` int(11) NOT NULL DEFAULT '0',
`parameter_id` int(11) NOT NULL DEFAULT '0',
UNIQUE KEY `i_parameter_id` (`item_id`,`parameter_value_id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__phocacart_submit_items` (
`id` int(11) unsigned NOT NULL auto_increment,
`user_id` int(11) NOT NULL default '0',
`title` varchar(200) NOT NULL default '',
`alias` varchar(255) NOT NULL default '',
`ip` varchar(20) NOT NULL default '',
`items_item` text,
`items_contact` text,
`items_parameter` text,
`access` int(11) unsigned NOT NULL DEFAULT '0',
`upload_token` char(64) NOT NULL DEFAULT '',
`upload_folder` varchar(255) NOT NULL DEFAULT '',
`date_submit` datetime NOT NULL default '0000-00-00 00:00:00',
`privacy` tinyint(1) NOT NULL default '0',
`published` tinyint(1) NOT NULL default '0',
`checked_out` int(11) NOT NULL default '0',
`checked_out_time` datetime NOT NULL default '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL default '',
PRIMARY KEY (`id`),
KEY `published` (`published`)
) DEFAULT
CHARSET=utf8;PK�"�[$��ǿ�update/sql/mysql/3.5.1.sqlnu�[���--
3.5.1
-- user_id - the one who bought (orders)
-- vendor_id - the one who sold (orders)
-- owner_id - the one to which item is assigned (category, product, product
sold)
ALTER TABLE `#__phocacart_categories` ADD COLUMN `owner_id` int(11) NOT
NULL DEFAULT '0';
ALTER TABLE `#__phocacart_products` ADD COLUMN `owner_id` int(11) NOT NULL
DEFAULT '0';
ALTER TABLE `#__phocacart_order_products` ADD COLUMN `owner_id` int(11) NOT
NULL DEFAULT '0';
--ALTER TABLE `#__phocacart_order_products` ADD COLUMN `vendor_id` int(11)
NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_form_fields` ADD COLUMN `pattern` text;
ALTER TABLE `#__phocacart_form_fields` ADD COLUMN `maxlength` int(11) NOT
NULL DEFAULT '0';
PK�"�[]����update/sql/mysql/3.5.3.sqlnu�[���--
3.5.3
ALTER TABLE `#__phocacart_orders` ADD COLUMN `queue_number` varchar(64) NOT
NULL DEFAULT '';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `queue_number_id` int(11) NOT
NULL DEFAULT '0';
ALTER TABLE `#__phocacart_product_discounts` ADD COLUMN `image`
varchar(255) NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_product_discounts` ADD COLUMN `background_image`
varchar(255) NOT NULL DEFAULT '';
PK�"�[��aԏ�update/sql/mysql/3.5.4.sqlnu�[���--
3.5.4
ALTER TABLE `#__phocacart_product_stock` ADD COLUMN `sku` varchar(255) NOT
NULL DEFAULT '';
ALTER TABLE `#__phocacart_product_stock` ADD COLUMN `ean` varchar(15) NOT
NULL DEFAULT '';
-- Maria DB
-- ALTER TABLE `#__phocacart_product_stock` ADD COLUMN IF NOT EXISTS `sku`
varchar(255) NOT NULL DEFAULT '';
-- ALTER TABLE `#__phocacart_product_stock` ADD COLUMN IF NOT EXISTS `ean`
varchar(15) NOT NULL DEFAULT '';
-- MySQL
-- SET @dbname = DATABASE();
-- SET @tablename = `#__phocacart_product_stock`;
-- SET @columnname = `sku`;
-- SET @preparedStatement = (SELECT IF(
-- (
-- SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS
-- WHERE
-- (table_name = @tablename)
-- AND (table_schema = @dbname)
-- AND (column_name = @columnname)
-- ) > 0,
-- "SELECT 1",
-- CONCAT("ALTER TABLE ", @tablename, " ADD ",
@columnname, " varchar(255) NOT NULL DEFAULT '';")
-- ));
-- PREPARE alterIfNotExists FROM @preparedStatement;
-- EXECUTE alterIfNotExists;
-- DEALLOCATE PREPARE alterIfNotExists;
-- DROP PROCEDURE IF EXISTS `acs`;
-- DELIMITER // CREATE PROCEDURE `acs`() BEGIN DECLARE CONTINUE HANDLER FOR
SQLEXCEPTION BEGIN END; ALTER TABLE `#__phocacart_product_stock` ADD COLUMN
`sku` varchar(255) NOT NULL DEFAULT ''; END //
-- DELIMITER ;
-- CALL `acs`();
-- DROP PROCEDURE `acs`;
-- delimiter ;;
--DROP PROCEDURE IF EXISTS foo;;
--create procedure foo ()
--begin
-- declare continue handler for 1060 begin end;
-- alter table `#__phocacart_product_stock` add `sku` varchar(255) NOT
NULL DEFAULT '';
--end;;
--call foo();;
ALTER TABLE `#__phocacart_products` ADD COLUMN `featured_background_image`
varchar(255) NOT NULL DEFAULT '';
PK�"�[�kQ�SSupdate/sql/mysql/3.5.5.sqlnu�[���--
3.5.5
ALTER TABLE `#__phocacart_form_fields` ADD COLUMN `predefined_values` text;
ALTER TABLE `#__phocacart_form_fields` ADD COLUMN
`predefined_values_first_option` varchar(100) NOT NULL DEFAULT
'';
ALTER TABLE `#__phocacart_orders` ADD COLUMN `params_shipping` text;
ALTER TABLE `#__phocacart_orders` ADD COLUMN `params_payment`
text;PK�"�[�~����update/sql/mysql/3.5.7.sqlnu�[���--
3.5.7
ALTER TABLE `#__phocacart_order_statuses` ADD COLUMN `email_send_format`
int(2) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_product_price_history` ADD COLUMN `bulk_id`
int(11) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_product_price_history` ADD COLUMN
`price_original` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_product_price_history` ADD COLUMN `current_price`
DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_product_price_history` ADD COLUMN
`current_price_original` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_product_price_history` ADD COLUMN `type`
tinyint(1) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_shipping_methods` ADD COLUMN `active_zip`
tinyint(1) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_shipping_methods` ADD COLUMN `zip` text;
ALTER TABLE `#__phocacart_shipping_methods` ADD COLUMN `description_info`
text;
ALTER TABLE `#__phocacart_payment_methods` ADD COLUMN `description_info`
text;
ALTER TABLE `#__phocacart_attribute_values` ADD COLUMN `required`
tinyint(1) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_products` ADD COLUMN `gift_types` text;
ALTER TABLE `#__phocacart_coupons` ADD COLUMN `gift_title` varchar(255) NOT
NULL DEFAULT '';
ALTER TABLE `#__phocacart_coupons` ADD COLUMN `gift_description` text;
ALTER TABLE `#__phocacart_coupons` ADD COLUMN `gift_image` varchar(255) NOT
NULL DEFAULT '';
ALTER TABLE `#__phocacart_coupons` ADD COLUMN `gift_recipient_name`
varchar(100) NOT NULL default '';
ALTER TABLE `#__phocacart_coupons` ADD COLUMN `gift_recipient_email`
varchar(50) NOT NULL default '';
ALTER TABLE `#__phocacart_coupons` ADD COLUMN `gift_sender_name`
varchar(100) NOT NULL default '';
ALTER TABLE `#__phocacart_coupons` ADD COLUMN `gift_sender_message` text;
ALTER TABLE `#__phocacart_coupons` ADD COLUMN `gift_type` tinyint(1) NOT
NULL DEFAULT '-1';
ALTER TABLE `#__phocacart_coupons` ADD COLUMN `gift_order_id` int(11) NOT
NULL DEFAULT '0';
ALTER TABLE `#__phocacart_coupons` ADD COLUMN `gift_product_id` int(11) NOT
NULL DEFAULT '0';
ALTER TABLE `#__phocacart_coupons` ADD COLUMN `gift_order_product_id`
int(11) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_coupons` ADD COLUMN `coupon_type` tinyint(1) NOT
NULL DEFAULT '0';
ALTER TABLE `#__phocacart_coupons` ADD COLUMN `gift_class_name` varchar(50)
NOT NULL default '';
ALTER TABLE `#__phocacart_order_statuses` ADD COLUMN `activate_gift`
tinyint(1) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_order_statuses` ADD COLUMN `email_gift`
tinyint(1) NOT NULL DEFAULT '0';
ALTER TABLE `#__phocacart_order_statuses` ADD COLUMN
`email_subject_gift_sender` varchar(255) NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_order_statuses` ADD COLUMN
`email_text_gift_sender` text;
ALTER TABLE `#__phocacart_order_statuses` ADD COLUMN
`email_subject_gift_recipient` varchar(255) NOT NULL DEFAULT '';
ALTER TABLE `#__phocacart_order_statuses` ADD COLUMN
`email_text_gift_recipient` text;
ALTER TABLE `#__phocacart_order_statuses` ADD COLUMN `email_gift_format`
tinyint(1) NOT NULL DEFAULT '0';
CREATE TABLE IF NOT EXISTS `#__phocacart_bulk_prices` (
`id` int(11) NOT NULL auto_increment,
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`description` text,
`type` tinyint(1) NOT NULL DEFAULT '0',
`status` tinyint(1) NOT NULL default '0',
`access` int(11) unsigned NOT NULL DEFAULT '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00
00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`params` text,
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) DEFAULT
CHARSET=utf8;PK�"�[V�b::update/sql/mysql/index.htmlnu�[���<html><body
style="background-color:
#000;"></body></html>PK�"�[�#o,,views/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�#o,,$views/phocacartattributea/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�bl�WW*views/phocacartattributea/tmpl/default.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
?>PK�"�[�#o,,)views/phocacartattributea/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[v���--'views/phocacartattributea/view.json.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
class PhocaCartCpViewPhocaCartAttributeA extends JViewLegacy
{
function display($tpl = null){
if (!JSession::checkToken('request')) {
$response = array(
'status' => '0',
'error' => '<span class="ph-result-txt
ph-error-txt">' . JText::_('JINVALID_TOKEN') .
'</span>');
echo json_encode($response);
return;
}
$app = JFactory::getApplication();
$task = $app->input->get( 'task', '',
'string' );
if ($task == 'gettoken') {
// Only tokens and names - don't create folders now they will be
created when accessing manager
$token = PhocacartUtils::getToken();
$folder = PhocacartUtils::getToken('folder');
$msg = '';// No message when all OK
$response = array(
'status' => '1',
'error' => '',
'message' => '<span class="ph-result-txt
ph-success-txt">'.$msg.'</span>',
'token' => $token,
'folder' => $folder
);
echo json_encode($response);
return;
} else if ($task == 'removefolder') {
$folderA = $app->input->get( 'folder', '',
'array' );
$nrDeletedFolders = 0;
$errorMsg = '';
if (!empty($folderA)) {
foreach($folderA as $k => $v) {
$path = PhocacartPath::getPath('attributefile');
if(JFolder::exists($path['orig_abs_ds'] . $v)) {
if(JFolder::delete($path['orig_abs_ds'] .
$v)) {
$nrDeletedFolders++;
} else {
$errorMsg =
JText::_('COM_PHOCACART_ERROR_REMOVE_ATTRIBUTE_OPTION_DOWNLOAD_FOLDER')
. ': ' . $v;
}
}
}
}
if ($nrDeletedFolders == 1) {
$errorMsg = $errorMsg != '' ? '<br>' .
$errorMsg : '';
$response = array(
'status' => '1',
'message' => '<span
class="ph-result-txt ph-success-txt">'
.JText::_('COM_PHOCACART_DOWNLOAD_FOLDER_OF_REMOVED_ATTRIBUTE_OPTION_DELETED')
. $errorMsg . '</span>');
echo json_encode($response);
return;
} else if ($nrDeletedFolders > 1) {
$errorMsg = $errorMsg != '' ?
'<br>' . $errorMsg : '';
$response = array(
'status' => '1',
'message' => '<span
class="ph-result-txt ph-success-txt">'
.JText::_('COM_PHOCACART_DOWNLOAD_FOLDERS_OF_REMOVED_ATTRIBUTE_OPTIONS_DELETED')
. $errorMsg . '</span>');
echo json_encode($response);
return;
} else if ($errorMsg != '') {
$response = array(
'status' => '0',
'error' => '<span
class="ph-result-txt ph-error-txt">' . $errorMsg .
'</span>');
echo json_encode($response);
return;
} else {
// The attribute option does not include any folder yet - OK - no
message
$response = array(
'status' => '2',
'message' => '');
echo json_encode($response);
return;
}
}
$response = array(
'status' => '0',
'error' => '<span class="ph-result-txt
ph-error-txt">' .
JText::_('COM_PHOCACART_NO_TASK_SELECTED') .
'</span>');
echo json_encode($response);
return;
}
}
?>
PK�"�[�#o,,#views/phocacartbulkprice/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[#4*�&views/phocacartbulkprice/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('title', 'description',
'status');
echo $r->group($this->form, $formArray);
// STORE SPECIFIC PARAMETERS TO ONLY ONE COLUMN - PARAMS
foreach($this->form->getFieldset('params') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs();
echo $r->endForm();
?>
PK�"�[�#o,,(views/phocacartbulkprice/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[v=K1��&views/phocacartbulkprice/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartBulkprice extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $attributeoption;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('bulkprice');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.bulkprice_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_BULK_PRICE_JOB' ).': <small><small>[ ' .
$text.' ]</small></small>' ,
'folder-close');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,$views/phocacartbulkprices/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�\(���*views/phocacartbulkprices/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\Language\Text;
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
$idMdRun = 'phEditBulkPriceRunModal';
$idMdRevert = 'phEditBulkPriceRevertModal';
$textButtonRun = 'COM_PHOCACART_RUN';
$textButtonRevert = 'COM_PHOCACART_REVERT';
$w = 500;
$h = 400;
$rV = new PhocacartRenderAdminview();
echo $rV->modalWindowDynamic($idMdRun, $textButtonRun, $w, $h, true);
echo $rV->modalWindowDynamic($idMdRevert, $textButtonRevert, $w, $h,
true);
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th
class="ph-title2">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TITLE', 'a.title',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-desc">'.Text::_('COM_PHOCACART_DESCRIPTION').'</th>'."\n";
echo '<th
class="ph-desc">'.Text::_('COM_PHOCACART_CALCULATION').'</th>'."\n";
echo '<th
class="ph-status">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_STATUS', 'a.status',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-action">'.Text::_('COM_PHOCACART_ACTION').'</th>'."\n";
echo '<th
class="ph-date">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_DATE', 'a.date',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-id">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ID', 'a.id', $listDirn,
$listOrder ).'</th>'."\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart && $j
< (int)$this->pagination->limit) {
$j++;
$urlEdit =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
$urlTask =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit. $item->id );
$linkRun = JRoute::_('index.php?option=' .
$this->t['o'] .
'&view=phocacarteditbulkprice&status='.(int)$item->status.'&tmpl=component&id='
. (int)$item->id);
$linkRevert = JRoute::_('index.php?option=' .
$this->t['o'] .
'&view=phocacarteditbulkprice&status='.(int)$item->status.'&tmpl=component&id='
. (int)$item->id);
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid :
0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'.
$this->escape($item->title).'</a>';
} else {
$checkO .= $this->escape($item->title);
}
echo $r->td($checkO, "small");
echo $r->td($item->description, "small");
$registry = new JRegistry;
$registry->loadString($item->params);
$item->params = $registry;
$amount = $item->params->get('amount', '');
$operator = $item->params->get('operator', '');
$calculation_price = $item->params->get('calculation_type',
'');
if ($calculation_price == 1) {
$calculation_price = '%';
} else {
$calculation_price = '';
}
echo $r->td($operator . $amount . $calculation_price,
"small");
$status = '';
if ($item->status == 1) {
$status .= '<span class="label label-success label-success
badge
badge-success">'.JText::_('COM_PHOCACART_ACTIVE').
'</span>';
} else {
$status .= '<span class="label label-important label-danger
badge
badge-danger">'.JText::_('COM_PHOCACART_INACTIVE').
'</span>';
}
echo $r->td($status, "small");
$action = '';
if ($item->status == 0) {
$action .= ' <span><a href="#' . $idMdRun .
'" role="button" class="btn btn-success ' .
$idMdRun . 'ModalButton" data-toggle="modal"
title="' . JText::_($textButtonRun) . '"
data-src="' . $linkRun . '" data-height="' .
$h . '" data-width="' . $w . '">' .
JText::_($textButtonRun) . '</a></span>';
}
if ($item->status == 1) {
$action .= ' <span><a href="#' . $idMdRevert .
'" role="button" class="btn btn-danger ' .
$idMdRevert . 'ModalButton" data-toggle="modal"
title="' . JText::_($textButtonRevert) . '"
data-src="' . $linkRevert . '" data-height="'
. $h . '" data-width="' . $w . '">' .
JText::_($textButtonRevert) . '</a></span>';
}
echo $r->td($action, "small");
echo $r->td($item->date, "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 12);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,)views/phocacartbulkprices/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�l�U�
�
'views/phocacartbulkprices/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartBulkprices extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('bulkprice');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.bulkprice_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_BULK_PRICE_JOBS' ),
'folder-close' );
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartbulkprices.delete',
$this->t['l'].'_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,views/phocacartcart/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[66q
XX$views/phocacartcart/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
// All is solved in the rendercart and cart (include the asked userid)
if (isset($this->item->user_id) &&
(int)$this->item->user_id > 0) {
$link = JRoute::_(
'index.php?option='.$this->t['o'].'&view=phocacartcart&tmpl=component&&id='.(int)$this->item->user_id);
$cart = new PhocacartCartRendercart();
$cart->setType(array());// all types
$cart->setFullItems();
$this->t['shippingid'] = $cart->getShippingId();
if (isset($this->t['shippingid']) &&
(int)$this->t['shippingid'] > 0 &&
$this->t['shippingedit'] == 0) {
$cart->addShippingCosts($this->t['shippingid']);
$this->t['shippingmethodexists'] = true;
}
$this->t['paymentid'] = $cart->getPaymentId();
if (isset($this->t['paymentid']) &&
(int)$this->t['paymentid'] > 0 &&
$this->t['paymentedit'] == 0) {
$cart->addPaymentCosts($this->t['paymentid']);// validity
of payment will be checked
$this->t['paymentmethodexists'] = true;
}
$cart->roundTotalAmount();
$cart->getItems();
$total = $cart->getTotal();
echo '<div class="ph-cart-info-box">';
echo $cart->render();
echo '</div>';
echo '<div
class="ph-last-cart-activity">'.JText::_('COM_PHOCACART_LAST_CART_ACTIVITY').':
'.$this->item->date.'</div>';
$userName = $this->item->user_name;
if (isset($this->item->user_username)) {
$userName .= '
<small>('.$this->item->user_username.')</small>';
}
echo '<div
class="ph-cart-info-user">'.JText::_('COM_PHOCACART_USER').':
'.$userName.'</div>';
echo '<form action="'.$link.'"
method="post">';
echo '<input type="hidden" name="userid"
value="'.(int)$this->item->user_id.'">';
echo '<input type="hidden" name="vendorid"
value="'.(int)$this->item->vendor_id.'">';
echo '<input type="hidden" name="ticketid"
value="'.(int)$this->item->ticket_id.'">';
echo '<input type="hidden" name="unitid"
value="'.(int)$this->item->unit_id.'">';
echo '<input type="hidden" name="sectionid"
value="'.(int)$this->item->section_id.'">';
echo '<input type="hidden" name="task"
value="phocacartcart.emptycart">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<button class="btn btn-primary btn-sm
ph-btn"><span class="icon-delete"></span>
'.JText::_('COM_PHOCACART_EMPTY_USER_CART').'</button>';
echo '</div>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
} else {
echo '<div
class="ph-cart-info-user">'.JText::_('COM_PHOCACART_NO_ACTIVE_CART_FOR_THIS_USER').'</div>';
}
?>
PK�"�[�#o,,#views/phocacartcart/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��w��!views/phocacartcart/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
/*
phocacart import('phocacart.cart.cart');
phocacart import('phocacart.cart.cartdb');
phocacart import('phocacart.cart.rendercart');
phocacart import('phocacart.currency.currency');
*/
class PhocaCartCpViewPhocacartCart extends JViewLegacy
{
protected $t;
protected $r;
protected $item;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('cart');
$this->r = new PhocacartRenderAdminview();
$this->item = $this->get('Data');
$media = new PhocacartRenderAdminmedia();
parent::display($tpl);
}
}
?>
PK�"�[�#o,,"views/phocacartcatalogs/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[���(views/phocacartcatalogs/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$layout = new JLayoutFile('catalog', null,
array('component' => 'com_phocacart'));
if (!empty($this->items)) {
$d = array();
$d['s'] = $this->s;
$d['items'] = $this->items;
$d['params'] = $this->params;
$d['format'] = $this->t['format'];
echo $layout->render($d);
}
?>
PK�"�[�#o,,'views/phocacartcatalogs/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[E)v��%views/phocacartcatalogs/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartCatalogs extends JViewLegacy
{
protected $state;
protected $t;
protected $r;
protected $s;
protected $params;
protected $items = array();
function display($tpl = null) {
$document = JFactory::getDocument();
$document->setTitle(JText::_('COM_PHOCACART_CATALOG'));
$this->t = PhocacartUtils::setVars('catalog');
$this->s = PhocacartRenderStyle::getStyles();
$this->state = $this->get('State');
$this->params = PhocacartUtils::getComponentParameters();
$app = JFactory::getApplication();
$this->t['format'] =
$app->input->get('format', '',
'string');
$cid = $app->input->get('cid', '',
'string');
$cidA = array_map('intval', explode(',', $cid));
$this->items = PhocacartProduct::getProductsByCategories($cidA);
parent::display();
}
}
?>
PK�"�[1c1A��$views/phocacartcatalogs/view.pdf.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartCatalogs extends JViewLegacy
{
protected $state;
protected $t;
protected $r;
protected $s;
protected $params;
protected $items = array();
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('catalog');
$this->s = PhocacartRenderStyle::getStyles();
$this->state = $this->get('State');
$this->params = PhocacartUtils::getComponentParameters();
$app = JFactory::getApplication();
$this->t['format'] =
$app->input->get('format', '',
'string');
$cid = $app->input->get('cid', '',
'string');
$cidA = array_map('intval', explode(',', $cid));
$this->items = PhocacartProduct::getProductsByCategories($cidA);
$this->document->setName(JText::_('COM_PHOCACART_CATALOG'));
parent::display();
}
}
?>
PK�"�[E)v��$views/phocacartcatalogs/view.raw.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartCatalogs extends JViewLegacy
{
protected $state;
protected $t;
protected $r;
protected $s;
protected $params;
protected $items = array();
function display($tpl = null) {
$document = JFactory::getDocument();
$document->setTitle(JText::_('COM_PHOCACART_CATALOG'));
$this->t = PhocacartUtils::setVars('catalog');
$this->s = PhocacartRenderStyle::getStyles();
$this->state = $this->get('State');
$this->params = PhocacartUtils::getComponentParameters();
$app = JFactory::getApplication();
$this->t['format'] =
$app->input->get('format', '',
'string');
$cid = $app->input->get('cid', '',
'string');
$cidA = array_map('intval', explode(',', $cid));
$this->items = PhocacartProduct::getProductsByCategories($cidA);
parent::display();
}
}
?>
PK�"�[�#o,,$views/phocacartcategories/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[b����*views/phocacartcategories/tmpl/default.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
$nrColumns = 10;
$assoc = JLanguageAssociations::isEnabled();
if ($assoc) {$nrColumns = 11;}
echo $r->jsJorderTable($listOrder);
//echo '<div class="clearfix"></div>';
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo $r->endFilter();
echo $r->startMainContainer();
if ($this->t['search']) {
echo '<div class="alert alert-message">' .
JText::_('COM_PHOCACART_SEARCH_FILTER_IS_ACTIVE')
.'</div>';
}
//echo $r->startFilterBar();
/*
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
echo $r->selectFilterLevels('COM_PHOCACART_SELECT_MAX_LEVELS',
$this->state->get('filter.level'));
echo $r->endFilterBar();
*/
//echo $r->endFilterBar();
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
//echo $r->thOrderingXML('JGRID_HEADING_ORDERING', $listDirn,
$listOrder);
//echo $r->thCheck('JGLOBAL_CHECK_ALL');
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th
class="ph-title">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TITLE', 'a.title',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-published">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PUBLISHED',
'a.published', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-parentcattitle">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PARENT_CATEGORY',
'parentcat_title', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-productcount">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PRODUCT_COUNT',
'a.count_products', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-access">'.JTEXT::_($this->t['l'].'_ACCESS').'</th>'."\n";
if ($assoc) {
echo '<th class="ph-association">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
'COM_PHOCACART_HEADING_ASSOCIATION', 'association',
$listDirn, $listOrder) . '</th>' . "\n";
}
echo '<th
class="ph-language">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
'JGRID_HEADING_LANGUAGE', 'a.language', $listDirn,
$listOrder ).'</th>'."\n";
echo '<th
class="ph-hits">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_HITS', 'a.hits',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-id">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ID', 'a.id', $listDirn,
$listOrder ).'</th>'."\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
if ($i >= (int)$this->pagination->limitstart && $j <
(int)$this->pagination->limit) {
$j++;
$urlEdit =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
$orderkey = array_search($item->id,
$this->ordering[$item->parent_id]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit.(int) $item->id );
$linkParent = JRoute::_( $urlEdit.(int) $item->parent_id );
$canEditParent = $user->authorise('core.edit',
$this->t['o']);
$parentsStr = '';
if (isset($item->parentstree)) {
$parentsStr = ' '.$item->parentstree;
}
if (!isset($item->level)) {
$item->level = 0;
}
$iD = $i % 2;
//echo $r->startTr($i, isset($item->catid) ? (int)$item->catid :
0);
echo '<tr class="row'.$iD.'"
sortable-group-id="'.$item->parent_id.'"
item-id="'.$item->id.'"
parents="'.$parentsStr.'" level="'.
$item->level.'">'. "\n";
//echo $r->tdOrder($canChange, $saveOrder, $orderkey,
$item->ordering);
//echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('grid.id', $i,
$item->id), "small");
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'.
$this->escape($item->title).'</a>';
} else {
$checkO .= $this->escape($item->title);
}
$checkO .= ' <span
class="smallsub">(<span>'.JText::_($this->t['l'].'_FIELD_ALIAS_LABEL').':</span>'.
$this->escape($item->alias).')</span>';
echo $r->td($checkO, "small");
echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'].'.',
$canChange), "small");
if ($canEditParent) {
$parentO = '<a href="'.
JRoute::_($linkParent).'">'.
$this->escape($item->parentcat_title).'</a>';
} else {
$parentO = $this->escape($item->parentcat_title);
}
echo $r->td($parentO, "small");
$pC = '<div
class="center">'.$item->count_products;
if (PhocacartUtils::validateDate($item->count_date)) {
$pC .= '<br><small
class="nowrap">('.Joomla\CMS\HTML\HTMLHelper::_('date',
$item->count_date, 'd-m-Y H:i').')</small>';
}
$pC .= '</div>';
echo $r->td($pC, "small");
echo $r->td($this->escape($item->access_level),
"small");
if ($assoc) {
if ($item->association) {
echo
$r->td(Joomla\CMS\HTML\HTMLHelper::_('phocacartcategory.association',
$item->id));
} else {
echo $r->td('');
}
}
//echo $r->tdLanguage($item->language, $item->language_title,
$this->escape($item->language_title));
echo $r->td(JLayoutHelper::render('joomla.content.language',
$item));
echo $r->td($item->hits, "small");
echo $r->td($item->id, "small");
echo $r->endTr();
}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), $nrColumns);
echo $r->endTable();
echo $this->loadTemplate('batch');
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[P�FF0views/phocacartcategories/tmpl/default_batch.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
use Joomla\CMS\Layout\LayoutHelper;
//$published = $this->state->get('filter.published');
$published = (int)$this->state->get('filter.published');
?>
<div class="modal hide fade" id="collapseModal">
<div class="modal-header">
<button type="button" role="presentation"
class="close" data-dismiss="modal">x</button>
<h3><?php echo JText::_($this->t['l'] .
'_BATCH_OPTIONS_CATEGORIES');?></h3>
</div>
<div class="modal-body">
<p><?php /* echo JText::_('COM_CONTENT_BATCH_TIP');*/
?></p>
<div class="control-group">
<div class="controls">
<?php echo
LayoutHelper::render('joomla.html.batch.access', []);?>
</div>
</div>
<div class="control-group">
<div class="controls">
<?php echo
LayoutHelper::render('joomla.html.batch.language', []); ?>
</div>
</div>
<?php if ($published >= 0) : ?>
<div class="control-group">
<div class="controls">
<?php
$class = $this->t['n'].'HtmlBatch';
echo $class::item($published, 1);
?>
</div>
</div>
<?php endif; ?>
</div>
<div class="modal-footer">
<button class="btn" type="button"
onclick="document.getElementById('batch-category-id').value='';document.getElementById('batch-access').value='';document.getElementById('batch-language-id').value=''"
data-dismiss="modal">
<?php echo JText::_('JCANCEL'); ?>
</button>
<button class="btn btn-primary" type="submit"
onclick="Joomla.submitbutton('<?php echo
$this->t['task'] ?>.batch');">
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
</button>
</div>
</div>
PK�"�[�#o,,)views/phocacartcategories/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�Ւ/#/#(views/phocacartcategories/tmpl/modal.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
// ASSOCIATION
$app = JFactory::getApplication();
if ($app->isClient('site')) {
JSession::checkToken('get') or
die(JText::_('JINVALID_TOKEN'));
}
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$function = $app->input->getCmd('function',
'jSelectPhocacartcategory');
$onclick = $this->escape($function);
if (!empty($editor)) {
// This view is used also in com_menus. Load the xtd script only if the
editor is set!
JFactory::getDocument()->addScriptOptions('xtd-phocacartcategories',
array('editor' => $editor));
$onclick = "jSelectPhocacartcategory";
}
$iconStates = array(
-2 => 'icon-trash',
0 => 'icon-unpublish',
1 => 'icon-publish',
2 => 'icon-archive',
);
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
//echo '<div class="clearfix"></div>';
// phocacartcategory-form => adminForm
echo $r->startFormModal($this->t['o'],
$this->t['tasks'], 'adminForm',
'adminForm', $function);
echo $r->startMainContainerNoSubmenu();
/*
echo $r->startFilterNoSubmenu();
echo $r->endFilter();
echo $r->startMainContainerNoSubmenu();
if ($this->t['search']) {
echo '<div class="alert alert-message">' .
JText::_('COM_PHOCACART_SEARCH_FILTER_IS_ACTIVE')
.'</div>';
}
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
echo $r->selectFilterLevels('COM_PHOCACART_SELECT_MAX_LEVELS',
$this->state->get('filter.level'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th
class="ph-title">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TITLE', 'a.title',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-published">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PUBLISHED',
'a.published', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-parentcattitle">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PARENT_CATEGORY',
'parentcat_title', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-access">'.JTEXT::_($this->t['l'].'_ACCESS').'</th>'."\n";
echo '<th
class="ph-language">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
'JGRID_HEADING_LANGUAGE', 'a.language', $listDirn,
$listOrder ).'</th>'."\n";
echo '<th
class="ph-hits">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_HITS', 'a.hits',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-id">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ID', 'a.id', $listDirn,
$listOrder ).'</th>'."\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
if ($i >= (int)$this->pagination->limitstart && $j <
(int)$this->pagination->limit) {
$j++;
$urlEdit =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
$orderkey = array_search($item->id,
$this->ordering[$item->parent_id]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit.(int) $item->id );
$linkParent = JRoute::_( $urlEdit.(int) $item->parent_id );
$canEditParent = 0;//$user->authorise('core.edit',
$this->t['o']);
$linkLang =
JRoute::_('index.php?option='.$this->t['o'].'&view=phocacartcategory&id='.$this->escape($item->id).'&lang='.$this->escape($item->language));
//$linkCat = JRoute::_(
'index.php?option='.$this->t['o'].'&task='.$this->t['c'].'category.edit&id='.(int)
$item->category_id );
$canEdit = 0;// FORCE NOT EDITING CATEGORY IN MODAL
$user->authorise('core.edit', $this->t['o']);
if ($item->language && JLanguageMultilang::isEnabled()) {
$tag = strlen($item->language);
if ($tag == 5) {
$lang = substr($item->language, 0, 2);
} else if ($tag == 6) {
$lang = substr($item->language, 0, 3);
} else {
$lang = '';
}
} else if (!JLanguageMultilang::isEnabled()) {
$lang = '';
}
$parentsStr = '';
if (isset($item->parentstree)) {
$parentsStr = ' '.$item->parentstree;
}
if (!isset($item->level)) {
$item->level = 0;
}
//echo $r->startTr($i, $this->t['catid']);
$iD = $i % 2;
echo '<tr class="row'.$iD.'"
sortable-group-id="'.$item->parent_id.'"
item-id="'.$item->id.'"
parents="'.$parentsStr.'" level="'.
$item->level.'">'. "\n";
//echo '<tr class="row'.$iD.'"
sortable-group-id="'.$item->parent_id.'" >'.
"\n";
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering, false);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering, false);
/*$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout',
$i, $item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'.
$this->escape($item->title).'</a>';
} else {
$checkO .= $this->escape($item->title);
}
$checkO .= ' <span
class="smallsub">(<span>'.JText::_($this->t['l'].'_FIELD_ALIAS_LABEL').':</span>'.
$this->escape($item->alias).')</span>';
echo $r->td($checkO, "small");
*/
//$linkBox = '<a class="select-link"
href="javascript:void(0)"
data-function="'.$this->escape($onclick).'"
data-id="'.$item->id.'"
data-title="'.$this->escape($item->title).'"
data-uri="'. $this->escape($linkLang).'"
data-language="'.$this->escape($lang).'">';
$linkBox = '<a class="select-link"
href="javascript:void(0)" onclick="if (window.parent)
window.parent.'.$this->escape($function).'(\''.
$item->id.'\', \''.
$this->escape(addslashes($item->title)).'\', null,
\''. $this->escape($linkLang).'\', \''.
$this->escape($lang).'\', null);">';
$linkBox .= $this->escape($item->title);
$linkBox .= '</a>';
echo $r->td($linkBox, "small");
//echo
$r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'].'.',
$canChange), "small");
echo $r->td('<span
class="'.$iconStates[$this->escape($item->published)].'"
aria-hidden="true"></span>');
if ($canEditParent) {
$parentO = '<a href="'.
JRoute::_($linkParent).'">'.
$this->escape($item->parentcat_title).'</a>';
} else {
$parentO = $this->escape($item->parentcat_title);
}
echo $r->td($parentO, "small");
echo $r->td($this->escape($item->access_level),
"small");
//echo $r->tdLanguage($item->language, $item->language_title,
$this->escape($item->language_title));
echo
$r->td(JLayoutHelper::render('joomla.content.language',
$item));
echo $r->td($item->hits, "small");
echo $r->td($item->id, "small");
echo $r->endTr();
}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 9);
echo $r->endTable();
echo $this->loadTemplate('batch');
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�ɟ��0�0'views/phocacartcategories/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocaCartCategories extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('category');
$this->r = new PhocacartRenderAdminviews();
$this->s = PhocacartRenderStyle::getStyles();
$model = $this->getModel();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[$item->parent_id][] = $item->id;
}
// if search, don't do a tree, only display the searched items
$this->t['search'] =
$this->state->get('filter.search');
// We need to load all items because of creating tree
// After creating tree we get info from pagination
// and will set displaying of categories for current pagination
//E.g. pagination is limitstart 5, limit 5 - so only categories from 5 to
10 will be displayed
// the same for max levels
$this->t['level'] =
$this->state->get('filter.level');
if (!empty($this->items) && !$this->t['search'])
{
$text = ''; // text is tree name e.g. Category >>
Subcategory
$tree = array();
// Filter max levels
if (isset($this->t['level']) &&
$this->t['level'] > 0) {
$maxLevel = (int)$this->t['level'] + 1;
} else {
$maxLevel = false;
}
$this->items = $this->processTree($this->items, $tree, 0,
$text, -1, 0, '', $maxLevel);
// Re count the pagination
$countTotal = count($this->items);
$model->setTotal($countTotal);
$this->pagination = $model->getPagination();
}
$media = new PhocacartRenderAdminmedia();
// ASSOCIATION
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') {
$this->addToolbar();
//$this->sidebar = JHtmlSidebar::render();
} else {
// In article associations modal we need to remove language
filter if forcing a language.
// We also need to change the category filter to show show
categories with All or the forced language.
if ($forcedLanguage =
JFactory::getApplication()->input->get('forcedLanguage',
'', 'CMD'))
{
// If the language is forced we can't allow to select
the language, so transform the language selector filter into a hidden
field.
//$languageXml = new SimpleXMLElement('<field
name="language" type="hidden" default="' .
$forcedLanguage . '" />');
//$this->filterForm->setField($languageXml,
'filter', true);
// Also, unset the active language filter so the search
tools is not open by default with this filter.
unset($this->activeFilters['language']);
// One last changes needed is to change the category filter
to just show categories with All language or with the forced language.
//
$this->filterForm->setFieldAttribute('category_id',
'language', '*,' . $forcedLanguage,
'filter');
}
}
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$pC = PhocacartUtils::getComponentParameters();
$printed_catalog_enable = $pC->get(
'printed_catalog_enable', 0);
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.category_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_CATEGORIES' ),
'folder-open' );
$user = JFactory::getUser();
$bar = JToolbar::getInstance('toolbar');
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList( JText::_(
$this->t['l'].'_WARNING_DELETE_ITEMS' ),
$this->t['tasks'].'.delete',
$this->t['l'].'_DELETE');
}
// Add a batch button
if ($user->authorise('core.edit'))
{
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.renderModal',
'collapseModal');
$title = JText::_('JTOOLBAR_BATCH');
$dhtml = "<button data-toggle=\"modal\"
data-target=\"#collapseModal\" class=\"btn
btn-small\">
<i class=\"icon-checkbox-partial\"
title=\"$title\"></i>
$title</button>";
$bar->appendButton('Custom', $dhtml, 'batch');
}
$dhtml = '<button class="btn btn-small"
onclick="javascript:if(document.adminForm.boxchecked.value==0){alert(\''.JText::_('COM_PHOCACART_WARNING_RECREATE_MAKE_SELECTION').'\');}else{if(confirm(\''.JText::_('COM_PHOCACART_WARNING_RECREATE_THUMBNAILS_CATEGORIES').'\')){submitbutton(\'phocacartcategory.recreate\');}}"
><i class="icon-image"
title="'.JText::_('COM_PHOCACART_RECREATE_THUMBS').'"></i>
'.JText::_('COM_PHOCACART_RECREATE_THUMBS').'</button>';
$bar->appendButton('Custom', $dhtml);
$dhtml = '<button
onclick="javascript:if(document.adminForm.boxchecked.value==0){alert(\''.JText::_('COM_PHOCACART_WARNING_COUNT_PRODUCTS_MAKE_SELECTION').'\');}else{Joomla.submitbutton(\'phocacartcategory.countproducts\');}"
class="btn btn-small button-plus"><i
class="icon-plus"
title="'.JText::_($this->t['l'].'_COUNT_PRODUCTS').'"></i>
'.JText::_($this->t['l'].'_COUNT_PRODUCTS').'</button>';
$bar->appendButton('Custom', $dhtml,
'countproducts');
// Catalog JS
if ($printed_catalog_enable == 1) {
JFactory::getDocument()->addScriptDeclaration('
function phOpenCatalog(href){
var categories = [];
jQuery("input:checkbox[name=\'cid[]\']:checked").each(function(){
categories.push(parseInt(jQuery(this).val()));
});
if (categories === undefined || categories.length == 0) {
alert(\'' .
JText::_('COM_PHOCACART_WARNING_CATALOG_MAKE_SELECTION') .
'\');
return false;
} else {
var categoriesString = categories.join(",");
href = href + "&cid=" + categoriesString;
window.open(href, \'catalog\',
\'width=880,height=560,scrollbars=yes,menubar=no,resizable=yes\');
return false;
}
}'
);
// Catalog HTML
$linkTxt =
JRoute::_('index.php?option=com_phocacart&view=phocacartcatalogs&tmpl=component&format=raw&'
. JSession::getFormToken() . '=1');
$linkTxtHandler =
'onclick="javascript:if(document.adminForm.boxchecked.value==0){alert(\''
. JText::_('COM_PHOCACART_WARNING_CATALOG_MAKE_SELECTION') .
'\');return false;}else{phOpenCatalog(this.href);return
false;}"';
// Catalog PDF
$dhtml = '<a href="' . $linkTxt . '"
class="btn btn-small btn-primary" ' . $linkTxtHandler .
'><i id="ph-icon-text" class="icon-dummy ' .
$this->s['i']['list-alt'] . '
ph-icon-text"></i>' .
JText::_('COM_PHOCACART_CREATE_CATALOG_HTML') .
'</a>';
$bar->appendButton('Custom', $dhtml,
'countproducts');
$this->t['plugin-pdf'] =
PhocacartUtilsExtension::getExtensionInfo('phocacart',
'plugin', 'phocapdf');
$this->t['component-pdf'] =
PhocacartUtilsExtension::getExtensionInfo('com_phocapdf');
if ($this->t['plugin-pdf'] == 1 &&
$this->t['component-pdf']) {
$linkPdf =
JRoute::_('index.php?option=com_phocacart&view=phocacartcatalogs&tmpl=component&format=pdf&'
. JSession::getFormToken() . '=1');
$linkPdfHandler =
'onclick="javascript:if(document.adminForm.boxchecked.value==0){alert(\''
. JText::_('COM_PHOCACART_WARNING_CATALOG_MAKE_SELECTION') .
'\');return false;}else{phOpenCatalog(this.href);return
false;}"';
$dhtml = '<a href="' . $linkPdf . '"
class="btn btn-small btn-danger" ' . $linkPdfHandler .
'><i id="ph-icon-pdf" class="icon-dummy ' .
$this->s['i']['list-alt'] . '
ph-icon-pdf"></i>' .
JText::_('COM_PHOCACART_CREATE_CATALOG_PDF') .
'</a>';
$bar->appendButton('Custom', $dhtml);
}
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
PhocacartRenderAdminview::renderWizardButton('back');
}
protected function processTree( $data, $tree, $id = 0, $text='',
$currentId = 0, $level = 0, $parentsTreeString = '', $maxLevel =
false) {
$countItemsInCat = 0;// Ordering
$level = $level + 1;
$parentsTreeString = $id . ' '. $parentsTreeString;
// Limit the level of tree
if (!$maxLevel || ($maxLevel && $level < $maxLevel)) {
foreach ($data as $key) {
$show_text = $text . $key->title;
static $iCT = 0;// All displayed items
if ($key->parent_id == $id && $currentId != $id &&
$currentId != $key->id ) {
$tree[$iCT] = new JObject();
// Ordering MUST be solved here
if ($countItemsInCat > 0) {
$tree[$iCT]->orderup = 1;
} else {
$tree[$iCT]->orderup = 0;
}
if ($countItemsInCat < ($key->countid - 1)) {
$tree[$iCT]->orderdown = 1;
} else {
$tree[$iCT]->orderdown = 0;
}
$tree[$iCT] = new JObject();
$tree[$iCT]->level = $level;
$tree[$iCT]->parentstree = $parentsTreeString;
$tree[$iCT]->id = $key->id;
$tree[$iCT]->title = $show_text;
$tree[$iCT]->title_self = $key->title;
$tree[$iCT]->parent_id = $key->parent_id;
$tree[$iCT]->alias = $key->alias;
$tree[$iCT]->image = $key->image;
$tree[$iCT]->description = $key->description;
$tree[$iCT]->published = $key->published;
$tree[$iCT]->editor = $key->editor;
$tree[$iCT]->ordering = $key->ordering;
$tree[$iCT]->access = $key->access;
$tree[$iCT]->access_level = $key->access_level;
$tree[$iCT]->count = $key->count;
$tree[$iCT]->params = $key->params;
$tree[$iCT]->checked_out = $key->checked_out;
$tree[$iCT]->checked_out_time = $key->checked_out_time;
$tree[$iCT]->groupname = 0;
// $tree[$iCT]->username = $key->username;
// $tree[$iCT]->usernameno = $key->usernameno;
$tree[$iCT]->parentcat_title = $key->parentcat_title;
$tree[$iCT]->parentcat_id = $key->parentcat_id;
$tree[$iCT]->hits = $key->hits;
// $tree[$iCT]->ratingavg = $key->ratingavg;
// $tree[$iCT]->accessuserid = $key->accessuserid;
// $tree[$iCT]->uploaduserid = $key->uploaduserid;
$tree[$iCT]->association = isset($key->association) ?
$key->association : 0;
$tree[$iCT]->language = $key->language;
$tree[$iCT]->language_title = $key->language_title;
$tree[$iCT]->language_image = $key->language_image;
$tree[$iCT]->count_date = $key->count_date;
$tree[$iCT]->count_products = $key->count_products;
// $tree[$iCT]->deleteuserid = $key->deleteuserid;
// $tree[$iCT]->userfolder = $key->userfolder;
// $tree[$iCT]->approved = $key->approved;
// $tree[$iCT]->link = '';
// $tree[$iCT]->filename = '';// Will be added in View
(after items will be reduced)
// $tree[$iCT]->linkthumbnailpath = '';
$iCT++;
$tree = $this->processTree($data, $tree, $key->id, $show_text .
" - ", $currentId, $level, $parentsTreeString, $maxLevel);
$countItemsInCat++;
}
}
}
return($tree);
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'parent_title' => JText::_($this->t['l'] .
'_PARENT_CATEGORY'),
'a.count_products' => JText::_($this->t['l']
. '_PRODUCT_COUNT'),
'language' =>
JText::_('JGRID_HEADING_LANGUAGE'),
'a.hits' => JText::_($this->t['l'] .
'_HITS'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,"views/phocacartcategory/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[R��((%views/phocacartcategory/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
// ASSOCIATION
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
$app = JFactory::getApplication();
$input = $app->input;
$class = $this->t['n'] . 'RenderAdminview';
$r = new PhocacartRenderAdminview();
// phocacartcategory-form => adminForm
$js = '
var phRequestActive = null;
function phCheckRequestStatus(i, task) {
i++;
if (i > 30) {
/* Stop Loop */
phRequestActive = null;
}
if (phRequestActive) {
setTimeout(function(){
phCheckRequestStatus(i, task);
}, 1000);
} else {
if (task == "'. $this->t['task']
.'.cancel" || task == "phocacartwizard.backtowizard" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task,
document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
}
Joomla.submitbutton = function(task) {
phCheckRequestStatus(0, task);
}
';
JFactory::getDocument()->addScriptDeclaration($js);
// ASSOCIATION
$assoc = JLanguageAssociations::isEnabled();
// In case of modal
$isModal = $input->get('layout') == 'modal' ?
true : false;
$layout = $isModal ? 'modal' : 'edit';
$tmpl = $isModal || $input->get('tmpl', '',
'cmd') === 'component' ? 'component' :
'';
// Fieldsets to not automatically render by
/layouts/joomla/edit/params.php
$this->ignore_fieldsets = array('details',
'item_associations', 'jmetadata');
// phocacartcategory-form => adminForm
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm', '', $layout,
$tmpl);
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'),
'metadata' =>
JText::_($this->t['l'].'_METADATA_OPTIONS'));
if (!$isModal && $assoc) {
$tabs['associations'] =
JText::_($this->t['l'].'_ASSOCIATIONS');
}
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('title', 'alias',
'image', 'icon_class', 'parent_id',
'type', 'ordering', 'access',
'group', 'title_feed', 'type_feed');
echo $r->group($this->form, $formArray);
$formArray = array('description');
echo $r->group($this->form, $formArray, 1);
// ASSOCIATION
$this->form->setFieldAttribute('id', 'type',
'hidden');
$formArray = array ('id');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->startTab('metadata', $tabs['metadata']);
echo $this->loadTemplate('metadata');
echo $r->endTab();
// ASSOCIATION
$assoc = JLanguageAssociations::isEnabled();
if (!$isModal && $assoc) {
echo $r->startTab('associations',
$tabs['associations']);
echo $this->loadTemplate('associations');
echo $r->endTab();
} else if ($isModal && $assoc) {
echo '<div class="hidden">'.
$this->loadTemplate('associations').'</div>';
}
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs($this->t['task']);
if ($forcedLanguage =
JFactory::getApplication()->input->get('forcedLanguage',
'', 'CMD')) {
echo '<input type="hidden"
name="forcedLanguage" value="' . $forcedLanguage .
'" />';
}
echo $r->endForm();
?>
PK�"�[�"��2views/phocacartcategory/tmpl/edit_associations.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
echo JLayoutHelper::render('joomla.edit.associations', $this);
PK�"�[��P��.views/phocacartcategory/tmpl/edit_metadata.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$fieldSets = $this->form->getFieldsets('metadata');
foreach ($fieldSets as $name => $fieldSet) :
?>
<fieldset class="panelform">
<div class="adminform">
<?php if ($name == 'metadata') : // Include the real fields
in this panel. ?>
<div class="control-group">
<div class="control-label"><?php echo
$this->form->getLabel('metatitle'); ?></div>
<div class="controls"><?php echo
$this->form->getInput('metatitle');
?></div></div>
<div class="control-group">
<div class="control-label"><?php echo
$this->form->getLabel('metadesc'); ?></div>
<div class="controls"><?php echo
$this->form->getInput('metadesc');
?></div></div>
<div class="control-group">
<div class="control-label"><?php echo
$this->form->getLabel('metakey'); ?></div>
<div class="controls"><?php echo
$this->form->getInput('metakey');
?></div></div>
<?php endif; ?>
<?php foreach ($this->form->getFieldset($name) as $field) :
?>
<div class="control-group">
<div class="control-label"><?php echo
$field->label; ?></div>
<div class="controls"><?php echo $field->input;
?></div></div>
<?php endforeach; ?>
</div>
</fieldset>
<?php endforeach;
?>PK�"�[�#o,,'views/phocacartcategory/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�#C�{{&views/phocacartcategory/tmpl/modal.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die;
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tooltip',
'.hasTooltip', array('placement' =>
'bottom'));
// @deprecated 4.0 the function parameter, the inline js and the buttons
are not needed since 3.7.0.
$function =
JFactory::getApplication()->input->getCmd('function',
'jEditPhocacartcategory_' . (int) $this->item->id);
// Function to update input title when changed
// phocacartcategory-form => adminForm
JFactory::getDocument()->addScriptDeclaration('
function jEditPhocacartcategoryModal() {
if (window.parent &&
document.formvalidator.isValid(document.getElementById("adminForm")))
{
return window.parent.' . $this->escape($function) .
'(document.getElementById("jform_title").value);
}
}
');
?>
<button id="applyBtn" type="button"
class="hidden"
onclick="Joomla.submitbutton('phocacartcategory.apply');
jEditPhocacartcategoryModal();"></button>
<button id="saveBtn" type="button"
class="hidden"
onclick="Joomla.submitbutton('phocacartcategory.save');
jEditPhocacartcategoryModal();"></button>
<button id="closeBtn" type="button"
class="hidden"
onclick="Joomla.submitbutton('phocacartcategory.cancel');"></button>
<div class="container-popup">
<?php $this->setLayout('edit'); ?>
<?php echo $this->loadTemplate(); ?>
</div>
PK�"�[�"��3views/phocacartcategory/tmpl/modal_associations.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
echo JLayoutHelper::render('joomla.edit.associations', $this);
PK�"�[#��uu%views/phocacartcategory/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartCategory extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('category');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$user = JFactory::getUser();
$model = $this->getModel();
//Joomla\CMS\HTML\HTMLHelper::_('behavior.calendar');
$media = new PhocacartRenderAdminmedia();
//Data from model
//$this->item =& $this->get('Data');
$lists = array();
$isNew = ((int)$this->item->id == 0);
// Edit or Create?
if (!$isNew) {
$model->checkout( $user->get('id') );
} else {
// Initialise new record
$this->item->published = 1;
$this->item->order = 0;
$this->item->access = 0;
}
//$url =
'index.php?option=com_phocacart&view=phocacartthumba&format=json&tmpl=component&'.
JSession::getFormToken().'=1';
//PhocacartRenderAdminjs::phEventCreateImageThumbnail($url,
JText::_('COM_PHOCACART_CHECKING_IMAGE_THUMBNAIL_PLEASE_WAIT'),
'categoryimage', 'imageCreateThumbs');
//PhocacartRenderAdminjs::phAddValueImage($url,
JText::_('COM_PHOCACART_CHECKING_IMAGE_THUMBNAIL_PLEASE_WAIT'),
'categoryimage');
// ASSOCIATION
// If we are forcing a language in modal (used for associations).
if ($this->getLayout() === 'modal' &&
$forcedLanguage =
JFactory::getApplication()->input->get('forcedLanguage',
'', 'cmd')) {
// Set the language field to the forcedLanguage and disable changing it.
$this->form->setValue('language', null,
$forcedLanguage);
$this->form->setFieldAttribute('language',
'readonly', 'true');
// Only allow to select categories with All language or with the forced
language.
$this->form->setFieldAttribute('parent_id',
'language', '*,' . $forcedLanguage);
// Possible FR - add tags (including modifying tag field - to filter
language)
// Only allow to select tags with All language or with the forced
language.
//$this->form->setFieldAttribute('tags',
'language', '*,' . $forcedLanguage);
}
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.category_id'));
$text = $isNew ? JText::_( $this->t['l'].'_NEW' )
: JText::_($this->t['l'].'_EDIT');
JToolbarHelper::title( JText::_(
$this->t['l'].'_CATEGORY' ).':
<small><small>[ ' . $text.'
]</small></small>' , 'folder-open');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
//JToolbarHelper::custom($this->t['c'].'cat.save2copy',
'copy.png', 'copy_f2.png',
'JTOOLBAR_SAVE_AS_COPY', false);
}
if (!$isNew && JLanguageAssociations::isEnabled() &&
JComponentHelper::isEnabled('com_associations')) {
JToolbarHelper::custom($this->t['task'] .
'.editAssociations', 'contract', 'contract',
'JTOOLBAR_ASSOCIATIONS', false, false);
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
PhocacartRenderAdminview::renderWizardButton('back');
}
}
?>
PK�"�[�#o,,#views/phocacartcountries/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[L�
)views/phocacartcountries/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
$idMd = 'phEditStatusModal';
$textButton = 'COM_PHOCACART_EDIT_TAX';
$w = 500;
$h = 400;
$rV = new PhocacartRenderAdminview();
echo $rV->modalWindowDynamic($idMd, $textButton, $w, $h, true);
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th
class="ph-title">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TITLE', 'a.title',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-taxrate">'.JText::_($this->t['l'].'_TAX_RATE').'</th>'."\n";
echo '<th
class="ph-published">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PUBLISHED',
'a.published', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-code">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_CODE2', 'a.code2',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-code">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_CODE3', 'a.code3',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-id">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ID', 'a.id', $listDirn,
$listOrder ).'</th>'."\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart && $j
< (int)$this->pagination->limit) {
$j++;
$urlEdit =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
$urlTask =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit. $item->id );
$linkTax = JRoute::_(
'index.php?option='.$this->t['o'].'&view=phocacartedittax&type=1&tmpl=component&id='.(int)$item->id
);
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid :
0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
if (isset($item->code2) && $item->code2 != '') {
$checkO .= '
<span>'.PhocacartCountry::getCountryFlag($item->code2, 0,
$item->image, '20px') . '<span> ';
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'.
$this->escape($item->title).'</a>';
} else {
$checkO .= $this->escape($item->title);
}
echo $r->td($checkO, "small");
//$tax = '<span class="label
label-default">'.$this->escape(JText::_($item->status_title)).'</span>';
$tax = '';
$tax .= ' <span><a href="#'.$idMd.'"
role="button" class="ph-u
'.$idMd.'ModalButton" data-toggle="modal"
title="' . JText::_($textButton) . '"
data-src="'.$linkTax.'"
data-height="'.$h.'"
data-width="'.$w.'">'. JText::_($textButton) .
'</a></span>';
if (isset($item->tc_tax_rate) && $item->tc_tax_rate !=
'') {
$taxRateA = explode(',', $item->tc_tax_rate);
if (!empty($taxRateA)) {
foreach($taxRateA as $k => $v) {
$taxRateA[$k] = PhocacartPrice::cleanPrice($v);
}
$taxRateS = implode(', ', $taxRateA);
$tax .= '
<small>('.$taxRateS.')</small>';
}
}
echo $r->td($tax, "small");
echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'].'.',
$canChange), "small");
echo $r->td($item->code2, "small");
echo $r->td($item->code3, "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 8);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,(views/phocacartcountries/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[,`�+KK&views/phocacartcountries/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocaCartCountries extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('country');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
JHtml::stylesheet( $this->t['bootstrap'] .
'css/bootstrap.glyphicons-icons-only.min.css' );
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.country_id'));
$bar = JToolbar::getInstance('toolbar');
JToolbarHelper::title( JText::_(
$this->t['l'].'_COUNTRIES' ), 'globe' );
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartcountries.delete',
$this->t['l'].'_DELETE');
}
//dummy gly phicon gly phicon-globe ph-icon-earth
//JToolbarHelper::custom($this->t['task'].'.importcountries',
'earth', 'earth',
$this->t['l'].'_IMPORT_WORLD_COUNTRIES', false);
$dhtml = '<button onclick="if
(confirm(\''.JText::_('COM_PHOCACART_WARNING_IMPORT_COUNTRIES').'\'))
{ Joomla.submitbutton(\'phocacartcountry.importcountries\');
}" class="btn btn-small button-earth"><i
class="icon-earth"
title="'.JText::_($this->t['l'].'_IMPORT_WORLD_COUNTRIES').'"></i>
'.JText::_($this->t['l'].'_IMPORT_WORLD_COUNTRIES').'</button>';
$bar->appendButton('Custom', $dhtml,
'importcountries');
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
PhocacartRenderAdminview::renderWizardButton('back');
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.code2' => JText::_($this->t['l'] .
'_CODE2'),
'a.code3' => JText::_($this->t['l'] .
'_CODE3'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,!views/phocacartcountry/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�
���$views/phocacartcountry/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" || task == "phocacartwizard.backtowizard" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('title', 'code2',
'code3', 'image', 'ordering');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs($this->t['task']);
echo $r->endForm();
?>
PK�"�[�#o,,&views/phocacartcountry/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[{ �e e $views/phocacartcountry/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartCountry extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $attributeoption;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('country');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
JHtml::stylesheet( $this->t['bootstrap'] .
'css/bootstrap.glyphicons-icons-only.min.css' );
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.country_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_COUNTRY' ).': <small><small>[ ' .
$text.' ]</small></small>' , 'globe');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
PhocacartRenderAdminview::renderWizardButton('back');
}
}
?>
PK�"�[�#o,,
views/phocacartcoupon/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[pw�#views/phocacartcoupon/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'rules' =>
JText::_($this->t['l'].'_RULES'),
'gift' =>
JText::_($this->t['l'].'_GIFT_VOUCHER_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('title', 'code',
'discount', 'calculation_type', 'type',
'access', 'group');
echo $r->group($this->form, $formArray);
$formArray = array('description');
echo $r->group($this->form, $formArray, 1);
echo $r->endTab();
echo $r->startTab('gift', $tabs['general']);
$formArray = array ('gift_title',
'gift_recipient_name', 'gift_recipient_email',
'gift_sender_name', 'gift_sender_message',
'gift_type', 'gift_class_name',
'gift_order_id', 'gift_product_id',
'gift_order_product_id');
echo $r->group($this->form, $formArray);
$formArray = array('gift_description');
echo $r->group($this->form, $formArray, 1);
echo $r->endTab();
echo $r->startTab('rules', $tabs['rules']);
$formArray = array ('total_amount', 'quantity_from',
'available_quantity', 'available_quantity_user',
'product_ids', 'product_filter', 'cat_ids',
'category_filter', 'free_shipping',
'free_payment');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs();
echo $r->endForm();
?>
PK�"�[�#o,,%views/phocacartcoupon/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��Bx��#views/phocacartcoupon/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartCoupon extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $attributeoption;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('coupon');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.coupon_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_COUPON' ).': <small><small>[ ' .
$text.' ]</small></small>' , 'gift');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,!views/phocacartcoupons/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[ܨ��N
N 'views/phocacartcoupons/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th
class="ph-title-short">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TITLE', 'a.title',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-published">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PUBLISHED',
'a.published', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-code">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_CODE', 'a.code',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-discount">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_DISCOUNT', 'a.discount',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-date">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_VALID_FROM',
'a.valid_from', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-date">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_VALID_TO', 'a.valid_to',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-date">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_COUPON_TYPE',
'a.coupon_type', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-status">'.JText::_($this->t['l'].'_STATUS').'</th>'."\n";
echo '<th
class="ph-id">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ID', 'a.id', $listDirn,
$listOrder ).'</th>'."\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart && $j
< (int)$this->pagination->limit) {
$j++;
$urlEdit =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
$urlTask =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit. $item->id );
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid :
0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'.
$this->escape($item->title).'</a>';
} else {
$checkO .= $this->escape($item->title);
}
echo $r->td($checkO, "small");
echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'].'.',
$canChange), "small");
echo $r->td($this->escape($item->code), "small");
//echo
$r->td($this->escape(PhocacartPrice::cleanPrice($item->discount)),
"small");
echo $r->td('<span class="ph-editinplace-text ph-eip-text
ph-eip-price"
id="coupons:discount:'.(int)$item->id.'">'.$this->escape(PhocacartPrice::cleanPrice($item->discount)).'</span>',
"small");
echo $r->td($this->escape($item->valid_from), "small");
echo $r->td($this->escape($item->valid_to), "small");
$couponType = '';
if ($item->coupon_type == 2) {
$couponType = '<span class="label label-warning badge
badge-warning">' .
JText::_('COM_PHOCACART_GIFT_VOUCHER') .
'</span>';
if (isset($item->gift_order_id) && (int)$item->gift_order_id
> 0) {
$couponType .=
'<br><small>'.JText::_('COM_PHOCACART_ORDER_ID').
': '. $item->gift_order_id. '</small>';
}
// ACTION
$linkCouponView = JRoute::_('index.php?option=' .
$this->t['o'] .
'&view=phocacartcouponview&tmpl=component&id=' .
(int)$item->id . '');
$linkCouponViewHandler = 'onclick="window.open(this.href,
\'couponview\',
\'width=780,height=560,scrollbars=yes,menubar=no,resizable=yes\');return
false;"';
$couponType .= '<div class="ph-action-row">';
$couponType .= '<a href="' . $linkCouponView .
'" class="btn btn-transparent btn-small btn-xs ph-btn"
role="button" ' . $linkCouponViewHandler .
'><span title="' .
JText::_('COM_PHOCACART_VIEW_COUPON') . '"
class="' . $this->s['i']['search'] .
' ph-icon-success"></span></a>';
if ($this->t['plugin-pdf'] == 1 &&
$this->t['component-pdf']) {
$couponType .= ' ';
$formatPDF = '&format=pdf';
$couponType .= '<a href="' . $linkCouponView .
$formatPDF . '" class="btn btn-transparent btn-small btn-xs
ph-btn" role="button" ' . $linkCouponViewHandler .
'><span title="' .
JText::_('COM_PHOCACART_VIEW_COUPON') . '"
class="' . $this->s['i']['search'] .
' ph-icon-success"></span><br /><span
class="ph-icon-success-txt">' .
JText::_('COM_PHOCACART_PDF') .
'</span></a>';
}
$couponType .= '</div>';
} else {
$couponType = '<span class="label label-success badge
badge-success">' .
JText::_('COM_PHOCACART_GIFT_COUPON') .
'</span>';
}
echo $r->td($couponType, "small");
$status = PhocacartDate::getActiveDate($item->valid_from,
$item->valid_to, 1);
if ($item->published == 0) {
$status = '<span class="label
label-default">'.JText::_('COM_PHOCACART_UNPUBLISHED').'</span>';
}
echo $r->td($status, "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 11);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,&views/phocacartcoupons/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�_�Y
$views/phocacartcoupons/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartCoupons extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
protected $s;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('coupon');
$this->r = new PhocacartRenderAdminviews();
$this->s = PhocacartRenderStyle::getStyles();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->t['plugin-pdf'] =
PhocacartUtilsExtension::getExtensionInfo('phocacart',
'plugin', 'phocapdf');
$this->t['component-pdf'] =
PhocacartUtilsExtension::getExtensionInfo('com_phocapdf');
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.coupon_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_COUPONS' ), 'gift' );
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartcoupons.delete',
$this->t['l'].'_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.code' => JText::_($this->t['l'] .
'_CODE'),
'a.discount' => JText::_($this->t['l'] .
'_DISCOUNT'),
'a.valid_from' => JText::_($this->t['l'] .
'_VALID_FROM'),
'a.valid_to' => JText::_($this->t['l'] .
'_VALLID_TO'),
'a.coupon_type' => JText::_($this->t['l'] .
'_COUPON_TYPE'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,$views/phocacartcouponview/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�bl�WW*views/phocacartcouponview/tmpl/default.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
?>PK�"�[�#o,,)views/phocacartcouponview/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�S�s��'views/phocacartcouponview/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartCouponView extends JViewLegacy
{
public function display($tpl = null) {
$app = JFactory::getApplication();
$this->t = PhocacartUtils::setVars('couponview');
$this->r = new PhocacartRenderAdminview();
$id = $app->input->get('id', 0, 'int');
$format = $app->input->get('format', '',
'string');
/*$order = new PhocacartOrderRender();
$o = $order->render($id, $type, $format);
echo $o;*/
$layoutG = new JLayoutFile('gift_voucher', null,
array('component' => 'com_phocacart',
'client' => 0));
$price = new PhocacartPrice();
$gift = PhocacartCoupon::getGiftByCouponId($id);
$d = $gift;
$d['typeview'] = 'Coupon';
$d['product_id'] = $gift['gift_product_id'];
$d['discount'] =
$price->getPriceFormat($gift['discount']);
$d['valid_from'] = JHtml::date($gift['valid_from'],
JText::_('DATE_FORMAT_LC3'));
$d['valid_to'] = JHtml::date($gift['valid_to'],
JText::_('DATE_FORMAT_LC3'));
$d['format'] = 'html';
echo $layoutG->render($d);
$media = new PhocacartRenderAdminmedia();
parent::display($tpl);
}
}
?>
PK�"�[Og0#]
]
&views/phocacartcouponview/view.pdf.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartCouponView extends JViewLegacy
{
protected $t;
protected $r;
public function display($tpl = null) {
$app = JFactory::getApplication();
$this->t = PhocacartUtils::setVars('couponview');
$this->r = new PhocacartRenderAdminview();
$id = $app->input->get('id', 0, 'int');
$format = $app->input->get('format', '',
'string');
$pdfV = array();
$pdfV['plugin-pdf'] =
PhocacartUtilsExtension::getExtensionInfo('phocacart',
'plugin', 'phocapdf');
$pdfV['component-pdf'] =
PhocacartUtilsExtension::getExtensionInfo('com_phocapdf');
$pdfV['pdf'] = 0;
if ($pdfV['plugin-pdf'] == 1 &&
$pdfV['component-pdf'] == 1) {
if (JFile::exists(JPATH_ADMINISTRATOR .
'/components/com_phocapdf/helpers/phocapdfrender.php')) {
require_once(JPATH_ADMINISTRATOR .
'/components/com_phocapdf/helpers/phocapdfrender.php');
} else {
PhocacartLog::add(2, 'Coupon View - ERROR (PDF Class)',
(int)$orderId, 'Render PDF file could not be found in system');
throw new Exception('Error - Phoca PDF Helper - Render PDF file
could not be found in system', 500);
return false;
}
$pdfV['pdf'] = 1;
}
if ($pdfV['pdf'] == 1) {
$layoutG = new JLayoutFile('gift_voucher', null,
array('component' => 'com_phocacart',
'client' => 0));
$price = new PhocacartPrice();
$gift = PhocacartCoupon::getGiftByCouponId($id);
$d = $gift;
$staticData = array();
$staticData['option'] = 'com_phocacart';
$staticData['title'] = $d['title'];
$staticData['file'] = '';// Must be empty to
not save the pdf to server
$staticData['filename'] = strip_tags( 'cooupon_' .
$id) . '.pdf';
$staticData['subject'] = '';
$staticData['keywords'] = '';
$staticData['output'] = '';
// Initialize PDF for buyer which gets all the coupons
// we need to initilaize PDF here because we need tcpdf classed in
template output
$pdf = new stdClass();
$content = new stdClass();
$document = new stdClass();
PhocaPDFRender::initializePDF($pdf, $content, $document, $staticData);
$d['typeview'] = 'Coupon';
$d['product_id'] = $gift['gift_product_id'];
$d['discount'] =
$price->getPriceFormat($gift['discount']);
$d['valid_from'] = JHtml::date($gift['valid_from'],
JText::_('DATE_FORMAT_LC3'));
$d['valid_to'] = JHtml::date($gift['valid_to'],
JText::_('DATE_FORMAT_LC3'));
$d['format'] = 'pdf';
$d['pdf_instance'] = $pdf;// we need tcpdf instance in output
to use different tcpdf functions
$staticData['pdf_destination'] = 'I';
$staticData['output'] = $layoutG->render($d);
PhocaPDFRender::renderInitializedPDF($pdf, $content, $document,
$staticData);
exit;
}
// Set title here, if customized in pdf plugin parameters, it overwrites
this title - this is only default title
// PDF document name
//$media = new PhocacartRenderAdminmedia();
//parent::display($tpl);
}
}
?>
PK�"�[�#o,,views/phocacartcp/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[;M��;�;"views/phocacartcp/tmpl/default.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$s = new PhocacartStatistics();
$link =
'index.php?option='.$this->t['o'].'&view=';
$cOrdersW = $s->getNumberOfOrders();
$cOrdersD = $s->getNumberOfOrders(0);
$cUsersW = $s->getNumberOfUsers();
$cUsersD = $s->getNumberOfUsers(0);
$cAmountW = $s->getAmountOfOrders();
$cAmountD = $s->getAmountOfOrders(0);
echo '<form action="index.php" method="post"
name="adminForm">';
echo $r->startCp('phAdminBox', 'ph-admin-box');
?>
<div class="row-fluid ph-cpanel-top-stats">
<div class="col-xs-12 col-sm-6 col-md-2">
<div class="ph-cpanel-color ph-cpanel-color1">
<div class="ph-cpanel-color-left"><span
class="glyphicon glyphicon-user"></span></div>
<div class="ph-cpanel-color-right">
<div class="ph-cpanel-color-header"><?php echo
JText::_('COM_PHOCACART_TODAY'); ?></div>
<div class="ph-cpanel-stat-value"><?php echo
$cUsersD; ?></div>
<div class="ph-cpanel-color-header"><?php echo
JText::plural( 'COM_PHOCACART_CUSTOMERS', $cUsersD);
?></div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-2">
<div class="ph-cpanel-color ph-cpanel-color2">
<div class="ph-cpanel-color-left"><span
class="glyphicon
glyphicon-shopping-cart"></span></div>
<div class="ph-cpanel-color-right">
<div class="ph-cpanel-color-header"><?php echo
JText::_('COM_PHOCACART_TODAY'); ?></div>
<div class="ph-cpanel-stat-value"><?php echo
$cOrdersD; ?></div>
<div class="ph-cpanel-color-header"><?php echo
JText::plural( 'COM_PHOCACART_ORDERS', $cOrdersD);
?></div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-2">
<div class="ph-cpanel-color ph-cpanel-color3">
<div class="ph-cpanel-color-left"><span
class="glyphicon glyphicon-stats"></span></div>
<div class="ph-cpanel-color-right">
<div class="ph-cpanel-color-header"><?php echo
JText::_('COM_PHOCACART_TODAY'); ?></div>
<div class="ph-cpanel-stat-value"><?php echo
$cAmountD; ?></div>
<div class="ph-cpanel-color-header"><?php echo
JText::_('COM_PHOCACART_SALES'); ?></div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-2">
<div class="ph-cpanel-color ph-cpanel-color4">
<div class="ph-cpanel-color-left"><span
class="glyphicon glyphicon-user"></span></div>
<div class="ph-cpanel-color-right">
<div class="ph-cpanel-color-header"><?php echo
JText::_('COM_PHOCACART_THIS_WEEK'); ?></div>
<div class="ph-cpanel-stat-value"><?php echo
$cUsersW; ?></div>
<div class="ph-cpanel-color-header"><?php echo
JText::plural( 'COM_PHOCACART_CUSTOMERS', $cUsersW);
?></div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-2">
<div class="ph-cpanel-color ph-cpanel-color5">
<div class="ph-cpanel-color-left"><span
class="glyphicon
glyphicon-shopping-cart"></span></div>
<div class="ph-cpanel-color-right">
<div class="ph-cpanel-color-header"><?php echo
JText::_('COM_PHOCACART_THIS_WEEK'); ?></div>
<div class="ph-cpanel-stat-value"><?php echo
$cOrdersW; ?></div>
<div class="ph-cpanel-color-header"><?php echo
JText::plural( 'COM_PHOCACART_ORDERS', $cOrdersW);
?></div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-2">
<div class="ph-cpanel-color ph-cpanel-color6">
<div class="ph-cpanel-color-left"><span
class="glyphicon glyphicon-stats"></span></div>
<div class="ph-cpanel-color-right">
<div class="ph-cpanel-color-header"><?php echo
JText::_('COM_PHOCACART_THIS_WEEK'); ?></div>
<div class="ph-cpanel-stat-value"><?php echo
$cAmountW; ?></div>
<div class="ph-cpanel-color-header"><?php echo
JText::_('COM_PHOCACART_SALES'); ?></div>
</div>
</div>
</div>
</div><?php
echo '<div class="ph-box-cp">';
echo '<div class="ph-left-cp">';
echo '<div class="ph-cp-item-box">';
$link =
'index.php?option='.$this->t['o'].'&view=';
foreach ($this->views as $k => $v) {
$linkV = $link . $this->t['c'] . $k;
echo $r->quickIconButton( $linkV, JText::_($v[0]), $v[1], $v[2], $k);
}
echo '</div>';
echo '</div>';
echo '<civ class="ph-right-cp">';
?>
<div class="ph-cpanel-chart-box">
<h3 class="ph-cpanel-color-header-block"><?php
echo JText::_('COM_PHOCACART_CHART'); ?> (<?php echo
JText::_('COM_PHOCACART_THIS_WEEK'); ?>)</h3>
<?php
$dataS = $s->getDataChart();
$s->renderChartJsLine('phChartAreaLine',
$dataS['amount'],
JText::_('COM_PHOCACART_TOTAL_AMOUNT'),
$dataS['orders'],
JText::_('COM_PHOCACART_TOTAL_ORDERS'),
$dataS['ticks']);
$s->setFunction('phChartAreaLine', 'Line');
$s->renderFunctions();
/* <div class="ph-chart-legend"><span
class="ph-orders"> </span> <?php echo
JText::_('COM_PHOCACART_TOTAL_ORDERS'); ?> <span
class="ph-amount"> </span> <?php echo
JText::_('COM_PHOCACART_TOTAL_AMOUNT'); ?></div> */
?>
<div id="ph-canvas-holder2"
class="phChartAreaLineholder" style="width: 97%;" >
<canvas id="phChartAreaLine"
class="ph-chart-area"s></canvas>
</div>
</div><?php
echo '<div class="ph-extension-info-box
ph-cpanel-info-box">';
echo '<div
class="ph-cpanel-logo">'.Joomla\CMS\HTML\HTMLHelper::_('image',
$this->t['i'] .
'logo-'.str_replace('phoca', 'phoca-',
$this->t['c']).'.png', 'Phoca.cz') .
'</div>';
echo '<div style="float:right;margin:10px;">'.
Joomla\CMS\HTML\HTMLHelper::_('image', $this->t['i']
. 'logo-phoca.png', 'Phoca.cz'
).'</div>';
echo '<h3>'. JText::_($this->t['l'] .
'_VERSION').'</h3>'
.'<p>'. $this->t['version']
.'</p>';
echo '<h3>'. JText::_($this->t['l'] .
'_COPYRIGHT').'</h3>'
.'<p>© 2007 - '. date("Y"). ' Jan
Pavelka</p>'
.'<p><a href="https://www.phoca.cz/"
target="_blank">www.phoca.cz</a></p>';
echo '<h3>'. JText::_($this->t['l'] .
'_LICENSE').'</h3>'
.'<p><a
href="http://www.gnu.org/licenses/gpl-2.0.html"
target="_blank">GPLv2</a></p>';
echo '<h3>'. JText::_($this->t['l'] .
'_TRANSLATION').': '.
JText::_($this->t['l'] .
'_TRANSLATION_LANGUAGE_TAG').'</h3>'
.'<p>© 2007 - '. date("Y"). ' '.
JText::_($this->t['l'] . '_TRANSLATER').
'</p>'
.'<p>'.JText::_($this->t['l'] .
'_TRANSLATION_SUPPORT_URL').'</p>';
echo '<div style="border-top:1px solid
#c2c2c2"></div><p> </p>'
.'<div class="btn-group"><a class="btn
btn-large btn-primary"
href="https://www.phoca.cz/version/index.php?'.$this->t['c'].'='.
$this->t['version'] .'"
target="_blank"><i class="icon-loop
icon-white"></i> '.
JText::_($this->t['l'] . '_CHECK_FOR_UPDATE')
.'</a></div>'
.'<div style="float:right; margin: 0 10px"><a
href="https://www.phoca.cz/"
target="_blank">'.Joomla\CMS\HTML\HTMLHelper::_('image',
$this->t['i'] . 'logo.png', 'Phoca.cz'
).'</a></div>';
echo '</div>';
echo '<div class="ph-extension-links-box
ph-cpanel-info-box">';
echo $r->getLinks();
echo '</div>';
echo '</div>';
echo '</div>';
echo $r->endCp();
echo '<input type="hidden" name="option"
value="'. $this->t['c'] .'" />';
echo '<input type="hidden" name="view"
value="'. $this->t['c'] .'cp" />';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
echo $this->t['modalwindowdynamic'];
/*
$s = new PhocacartStatistics();
$r = new PhocacartRenderAdminviews();
$link =
'index.php?option='.$this->t['o'].'&view=';
$cOrdersW = $s->getNumberOfOrders();
$cOrdersD = $s->getNumberOfOrders(0);
$cUsersW = $s->getNumberOfUsers();
$cUsersD = $s->getNumberOfUsers(0);
$cAmountW = $s->getAmountOfOrders();
$cAmountD = $s->getAmountOfOrders(0);
?><form action="index.php" method="post"
name="adminForm">
<div id="phAdminBox" class="row-fluid
ph-admin-box">
<div class="col-xs-12 col-sm-2 col-md-2
ph-admin-box-menu"><?php echo JHtmlSidebar::render();
?></div>
<?php /* <div id="j-main-container" class="col-xs-12
col-sm-10 col-md-10 ph-admin-box-content">*//*
echo $r->startMainContainer();
?>
<div class="row-fluid ph-cpanel-top-stats">
<div class="col-xs-12 col-sm-6 col-md-2">
<div class="ph-cpanel-color ph-cpanel-color1">
<div class="ph-cpanel-color-left"><span
class="glyphicon glyphicon-user"></span></div>
<div class="ph-cpanel-color-right">
<div class="ph-cpanel-color-header"><?php echo
JText::_('COM_PHOCACART_TODAY'); ?></div>
<div class="ph-cpanel-stat-value"><?php echo
$cUsersD; ?></div>
<div class="ph-cpanel-color-header"><?php echo
JText::plural( 'COM_PHOCACART_CUSTOMERS', $cUsersD);
?></div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-2">
<div class="ph-cpanel-color ph-cpanel-color2">
<div class="ph-cpanel-color-left"><span
class="glyphicon
glyphicon-shopping-cart"></span></div>
<div class="ph-cpanel-color-right">
<div class="ph-cpanel-color-header"><?php echo
JText::_('COM_PHOCACART_TODAY'); ?></div>
<div class="ph-cpanel-stat-value"><?php echo
$cOrdersD; ?></div>
<div class="ph-cpanel-color-header"><?php echo
JText::plural( 'COM_PHOCACART_ORDERS', $cOrdersD);
?></div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-2">
<div class="ph-cpanel-color ph-cpanel-color3">
<div class="ph-cpanel-color-left"><span
class="glyphicon glyphicon-stats"></span></div>
<div class="ph-cpanel-color-right">
<div class="ph-cpanel-color-header"><?php echo
JText::_('COM_PHOCACART_TODAY'); ?></div>
<div class="ph-cpanel-stat-value"><?php echo
$cAmountD; ?></div>
<div class="ph-cpanel-color-header"><?php echo
JText::_('COM_PHOCACART_SALES'); ?></div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-2">
<div class="ph-cpanel-color ph-cpanel-color4">
<div class="ph-cpanel-color-left"><span
class="glyphicon glyphicon-user"></span></div>
<div class="ph-cpanel-color-right">
<div class="ph-cpanel-color-header"><?php echo
JText::_('COM_PHOCACART_THIS_WEEK'); ?></div>
<div class="ph-cpanel-stat-value"><?php echo
$cUsersW; ?></div>
<div class="ph-cpanel-color-header"><?php echo
JText::plural( 'COM_PHOCACART_CUSTOMERS', $cUsersW);
?></div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-2">
<div class="ph-cpanel-color ph-cpanel-color5">
<div class="ph-cpanel-color-left"><span
class="glyphicon
glyphicon-shopping-cart"></span></div>
<div class="ph-cpanel-color-right">
<div class="ph-cpanel-color-header"><?php echo
JText::_('COM_PHOCACART_THIS_WEEK'); ?></div>
<div class="ph-cpanel-stat-value"><?php echo
$cOrdersW; ?></div>
<div class="ph-cpanel-color-header"><?php echo
JText::plural( 'COM_PHOCACART_ORDERS', $cOrdersW);
?></div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-2">
<div class="ph-cpanel-color ph-cpanel-color6">
<div class="ph-cpanel-color-left"><span
class="glyphicon glyphicon-stats"></span></div>
<div class="ph-cpanel-color-right">
<div class="ph-cpanel-color-header"><?php echo
JText::_('COM_PHOCACART_THIS_WEEK'); ?></div>
<div class="ph-cpanel-stat-value"><?php echo
$cAmountW; ?></div>
<div class="ph-cpanel-color-header"><?php echo
JText::_('COM_PHOCACART_SALES'); ?></div>
</div>
</div>
</div>
</div>
<div class="row-fluid">
<div class="col-xs-12 col-sm-6 col-md-6">
<div class="ph-cpanel-icon-box">
<div class="row-fluid">
<?php
foreach ($this->views as $k => $v) {
$linkV = $link . $this->t['c'] . $k;
//echo PhocacartRenderAdmin::quickIconButton( $linkV,
'icon-48-'.$k.'.png', JText::_($v[0]),
$this->t['i']);
echo '<div class="col-xs-6 col-sm-6 col-md-6
col-lg-3">';
echo PhocacartRenderAdmin::quickIconButton( $linkV, JText::_($v[0]),
$v[1], $v[2]);
echo '</div>';
}
?>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-6">
<div class="ph-cpanel-chart-box">
<h3 class="ph-cpanel-color-header-block"><?php
echo JText::_('COM_PHOCACART_CHART'); ?> (<?php echo
JText::_('COM_PHOCACART_THIS_WEEK'); ?>)</h3>
<?php
$dataS = $s->getDataChart();
$s->renderChartJsLine('phChartAreaLine',
$dataS['amount'],
JText::_('COM_PHOCACART_TOTAL_AMOUNT'),
$dataS['orders'],
JText::_('COM_PHOCACART_TOTAL_ORDERS'),
$dataS['ticks']);
$s->setFunction('phChartAreaLine', 'Line');
$s->renderFunctions();
/* <div class="ph-chart-legend"><span
class="ph-orders"> </span> <?php echo
JText::_('COM_PHOCACART_TOTAL_ORDERS'); ?> <span
class="ph-amount"> </span> <?php echo
JText::_('COM_PHOCACART_TOTAL_AMOUNT'); ?></div> *//*
?>
<div id="ph-canvas-holder2"
class="phChartAreaLineholder" style="width: 97%;" >
<canvas id="phChartAreaLine"
class="ph-chart-area"s></canvas>
</div>
</div>
<div class="ph-cpanel-info-box"><?php
echo '<div
class="ph-cpanel-logo">'.Joomla\CMS\HTML\HTMLHelper::_('image',
$this->t['i'] . 'logo-phoca-cart.png',
'Phoca.cz') . '</div>';
?><div style="float:right;margin:10px;"><?php
echo Joomla\CMS\HTML\HTMLHelper::_('image',
$this->t['i'] . 'logo-phoca.png',
'Phoca.cz' );?></div><?php
echo '<h3>'. JText::_($this->t['l'] .
'_VERSION').'</h3>'
.'<p>'. $this->t['version']
.'</p>';
echo '<h3>'. JText::_($this->t['l'] .
'_COPYRIGHT').'</h3>'
.'<p>© 2007 - '. date("Y"). ' Jan
Pavelka</p>'
.'<p><a href="https://www.phoca.cz/"
target="_blank">www.phoca.cz</a></p>';
echo '<h3>'. JText::_($this->t['l'] .
'_LICENSE').'</h3>'
.'<p><a
href="http://www.gnu.org/licenses/gpl-2.0.html"
target="_blank">GPLv2</a></p>';
echo '<h3>'. JText::_($this->t['l'] .
'_TRANSLATION').': '.
JText::_($this->t['l'] .
'_TRANSLATION_LANGUAGE_TAG').'</h3>'
.'<p>© 2007 - '. date("Y"). ' '.
JText::_($this->t['l'] . '_TRANSLATER').
'</p>'
.'<p>'.JText::_($this->t['l'] .
'_TRANSLATION_SUPPORT_URL').'</p>';
echo '<div style="border-top:1px solid
#c2c2c2"></div><p> </p>'
.'<div><a class="btn btn-large btn-primary"
href="https://www.phoca.cz/version/index.php?'.$this->t['c'].'='.
$this->t['version'] .'"
target="_blank"><i class="icon-loop
icon-white"></i> '.
JText::_($this->t['l'] . '_CHECK_FOR_UPDATE')
.'</a>'.'<div style="float:right; margin: 0
10px"><a href="https://www.phoca.cz/"
target="_blank">'.Joomla\CMS\HTML\HTMLHelper::_('image',
$this->t['i'] . 'logo.png', 'Phoca.cz'
).'</a></div></div>';
?></div>
</div>
<div class="col-xs-12 col-sm-6 col-md-6">
<div class="ph-cpanel-tips-box">
<?php echo PhocacartRenderAdmin::getLinks(); ?>
</div>
</div>
</div>
<p> </p>
<?php echo $r->endMainContainer(); ?>
</div>
</div>
<input type="hidden" name="option"
value="<?php echo $this->t['c'] ?>" />
<input type="hidden" name="view"
value="<?php echo $this->t['c'] ?>cp" />
<?php echo Joomla\CMS\HTML\HTMLHelper::_('form.token'); ?>
</form>
*/
PK�"�[�#o,,!views/phocacartcp/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�hx6x6views/phocacartcp/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
use Phoca\Render\Adminviews;
class PhocaCartCpViewPhocaCartCp extends JViewLegacy
{
protected $t;
protected $r;
protected $s;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars();
$this->s = PhocacartRenderStyle::getStyles();
$this->r = new PhocacartRenderAdminview();
/*$this->views= array(
'items' => array($this->t['l'] .
'_PRODUCTS', 'folder-close', '#c1a46d'),
'categories' => array($this->t['l'] .
'_CATEGORIES', 'folder-open', '#da7400'),
'specifications'=> array($this->t['l'] .
'_SPECIFICATIONS', 'th-list', '#4e5f81'),
'manufacturers' => array($this->t['l'] .
'_MANUFACTURERS', 'home', '#ff7d49'),
'orders' => array($this->t['l'] .
'_ORDERS', 'shopping-cart', '#0099CC'),
'statuses' => array($this->t['l'] .
'_ORDER_STATUSES', 'time', '#c1976d'),
'stockstatuses' => array($this->t['l'] .
'_STOCK_STATUSES', 'tasks', '#777777'),
'shippings' => array($this->t['l'] .
'_SHIPPING', 'barcode', '#afbb6a'),
'countries' => array($this->t['l'] .
'_COUNTRIES', 'globe', '#478CD1'),
'regions' => array($this->t['l'] .
'_REGIONS', 'globe', '#01868B'),
'zones' => array($this->t['l'] .
'_ZONES', 'globe', '#a5dee5'),
'payments' => array($this->t['l'] .
'_PAYMENT', 'credit-card', '#4f9ce2'),
'currencies' => array($this->t['l'] .
'_CURRENCIES', 'eur', '#dca300'),
'taxes' => array($this->t['l'] .
'_TAXES', 'calendar', '#dd5500'),
'users' => array($this->t['l'] .
'_CUSTOMERS', 'user', '#7faa7f'),
'groups' => array($this->t['l'] .
'_CUSTOMER_GROUPS', 'user', '#aa7faa'),
'rewards' => array($this->t['l'] .
'_REWARD_POINTS', 'certificate', '#7faaaa'),
'formfields' => array($this->t['l'] .
'_FORM_FIELDS', 'list-alt', '#ffde00'),
'reviews' => array($this->t['l'] .
'_REVIEWS', 'comment', '#399ed0'),
//'ratings' => array($this->t['l'] .
'_RATINGS', 'x x x', '#ffde00'),
//'vouchers' => array($this->t['l'] .
'_VOUCHERS', 'x x x', '#ffde00'),
'coupons' => array($this->t['l'] .
'_COUPONS', 'gift', '#FF6685'),
'discounts' => array($this->t['l'] .
'_DISCOUNTS', 'piggy-bank', '#aa56fe'),
'downloads' => array($this->t['l'] .
'_DOWNLOADS', 'download-alt', '#33af49'),
'tags' => array($this->t['l'] .
'_TAGS', 'tag', '#CC0033'),
'parameters' => array($this->t['l'] .
'_PARAMETERS', 'align-justify', '#0040ff'),
'parametervalues'=> array($this->t['l'] .
'_PARAMETER_VALUES', 'list', '#0040ff'),
'feeds' => array($this->t['l'] .
'_XML_FEEDS', 'bullhorn', '#ffb300'),
'wishlists' => array($this->t['l'] .
'_WISH_LISTS', 'heart', '#EA7C7C'),
'questions' => array($this->t['l'] .
'_QUESTIONS', 'question-sign', '#9900CC'),
'times' => array($this->t['l'] .
'_OPENING_TIMES', 'time', '#73b9ff'),
'submititems' => array($this->t['l'] .
'_SUBMITTED_ITEMS', 'duplicate', '#7fff73'),
'statistics' => array($this->t['l'] .
'_STATISTICS', 'stats', '#c1756d'),
'reports' => array($this->t['l'] .
'_REPORTS', 'list-alt', '#8c0069'),
'hits' => array($this->t['l'] .
'_HITS', 'equalizer', '#fb1000'),
'imports' => array($this->t['l'] .
'_IMPORT', 'import', '#668099'),
'exports' => array($this->t['l'] .
'_EXPORT', 'export', '#669999'),
'logs' => array($this->t['l'] .
'_SYSTEM_LOG', 'list', '#c0c0c0'),
'info' => array($this->t['l'] .
'_INFO', 'info-sign', '#3378cc'),
'extensions' => array($this->t['l'] .
'_EXTENSIONS', 'th-large', '#2693ff'),
'vendors' => array($this->t['l'] .
'_VENDORS', 'user', '#b30059'),
'sections' => array($this->t['l'] .
'_SECTIONS', 'unchecked', '#b35900'),
'units' => array($this->t['l'] .
'_UNITS', 'modal-window', '#ff9326'),
);*/
$i = ' icon-';
$d = 'duotone ';
$this->views= array(
'items' => array($this->t['l'] .
'_PRODUCTS', $d.$i .'archive', '#c1a46d'),
'categories' => array($this->t['l'] .
'_CATEGORIES', $d.$i .'folder-open',
'#da7400'),
'specifications'=> array($this->t['l'] .
'_SPECIFICATIONS', $d.$i .'equalizer',
'#4e5f81'),
'manufacturers' => array($this->t['l'] .
'_MANUFACTURERS', $d.$i .'home', '#ff7d49'),
'orders' => array($this->t['l'] .
'_ORDERS', $d.$i .'cart', '#0099CC'),
'statuses' => array($this->t['l'] .
'_ORDER_STATUSES', $d.$i .'disable-motion',
'#c1976d'),
'stockstatuses' => array($this->t['l'] .
'_STOCK_STATUSES', $d.$i .'components',
'#777777'),
'shippings' => array($this->t['l'] .
'_SHIPPING', $d.$i .'cube', '#afbb6a'),
'countries' => array($this->t['l'] .
'_COUNTRIES', $i .'globe', '#478CD1'),
'regions' => array($this->t['l'] .
'_REGIONS', $i .'globe', '#01868B'),
'zones' => array($this->t['l'] .
'_ZONES', $d.$i .'location', '#a5dee5'),
'payments' => array($this->t['l'] .
'_PAYMENT', $d.$i .'credit', '#4f9ce2'),
'currencies' => array($this->t['l'] .
'_CURRENCIES', $d.$i .'tags-squared',
'#dca300'),
'taxes' => array($this->t['l'] .
'_TAXES', $i .'calendar', '#dd5500'),
'users' => array($this->t['l'] .
'_CUSTOMERS', $d.$i .'users', '#7faa7f'),
'groups' => array($this->t['l'] .
'_CUSTOMER_GROUPS', $d.$i .'groups',
'#aa7faa'),
'rewards' => array($this->t['l'] .
'_REWARD_POINTS', $d.$i .'vcard',
'#7faaaa'),
'formfields' => array($this->t['l'] .
'_FORM_FIELDS', $d.$i .'fields',
'#ffde00'),
'reviews' => array($this->t['l'] .
'_REVIEWS', $d.$i.'comment', '#399ed0'),
//'ratings' => array($this->t['l'] .
'_RATINGS', $i .'x x x', '#ffde00'),
//'vouchers' => array($this->t['l'] .
'_VOUCHERS', $i .'x x x', '#ffde00'),
'coupons' => array($this->t['l'] .
'_COUPONS', $i .'gift', '#FF6685'),
'discounts' => array($this->t['l'] .
'_DISCOUNTS',$d.$i .'scissors', '#aa56fe'),
'downloads' => array($this->t['l'] .
'_DOWNLOADS', $i .'download-alt',
'#33af49'),
'tags' => array($this->t['l'] .
'_TAGS', $d.$i .'tag-double', '#CC0033'),
'parameters' => array($this->t['l'] .
'_PARAMETERS', $i .'ellipsis-h', '#0040ff'),
'parametervalues'=> array($this->t['l'] .
'_PARAMETER_VALUES', $i .'ellipsis-v',
'#0040ff'),
'feeds' => array($this->t['l'] .
'_XML_FEEDS', $i .'feed', '#ffb300'),
'wishlists' => array($this->t['l'] .
'_WISH_LISTS', $i .'heart', '#EA7C7C'),
'questions' => array($this->t['l'] .
'_QUESTIONS', $d.$i .'messaging',
'#9900CC'),
'times' => array($this->t['l'] .
'_OPENING_TIMES', $i .'clock-alt',
'#73b9ff'),
'submititems' => array($this->t['l'] .
'_SUBMITTED_ITEMS', $d.$i .'duplicate-alt',
'#7fff73'),
'statistics' => array($this->t['l'] .
'_STATISTICS', $d.$i .'pie', '#c1756d'),
'reports' => array($this->t['l'] .
'_REPORTS', $d.$i .'chart', '#8c0069'),
'hits' => array($this->t['l'] .
'_HITS', $d.$i .'mouse-pointer-highlighter',
'#fb1000'),
'imports' => array($this->t['l'] .
'_IMPORT', $d.$i .'sign-in', '#668099'),
'exports' => array($this->t['l'] .
'_EXPORT', $d.$i .'sign-out', '#669999'),
'logs' => array($this->t['l'] .
'_SYSTEM_LOG', $d.$i .'logs', '#c0c0c0'),
'info' => array($this->t['l'] .
'_INFO', $d.$i .'info-circle', '#3378cc'),
'extensions' => array($this->t['l'] .
'_EXTENSIONS', $d.$i .'modules', '#2693ff'),
'vendors' => array($this->t['l'] .
'_VENDORS', $d.$i .'users', '#b30059'),
'sections' => array($this->t['l'] .
'_SECTIONS', $d.$i .'notification-circle',
'#b35900'),
'units' => array($this->t['l'] .
'_UNITS', $d.$i .'menu', '#ff9326'),
'bulkprices' => array($this->t['l'] .
'_BULK_PRICE_EDITOR', $d.$i .'click',
'#f310de')
);
/*
$this->views= array(
'items' => array($this->t['l'] .
'_PRODUCTS', 'folder-close', '#eff8a5'),
'categories' => array($this->t['l'] .
'_CATEGORIES', 'folder-open', '#fdb784'),
'specifications'=> array($this->t['l'] .
'_SPECIFICATIONS', 'th-list', '#fa9d58'),
'manufacturers' => array($this->t['l'] .
'_MANUFACTURERS', 'home', '#ed145b'),
'orders' => array($this->t['l'] .
'_ORDERS', 'shopping-cart', '#f86cb5'),
'statuses' => array($this->t['l'] .
'_ORDER_STATUSES', 'time', '#f86cd9'),
'stockstatuses' => array($this->t['l'] .
'_STOCK_STATUSES', 'tasks', '#d673dd'),
'shippings' => array($this->t['l'] .
'_SHIPPING', 'barcode', '#f4adf9'),
'countries' => array($this->t['l'] .
'_COUNTRIES', 'globe', '#4f70a6'),
'regions' => array($this->t['l'] .
'_REGIONS', 'globe', '#7fadf8'),
'payments' => array($this->t['l'] .
'_PAYMENT', 'credit-card', '#88ecac'),
'currencies' => array($this->t['l'] .
'_CURRENCIES', 'eur', '#b9f3cd'),
'taxes' => array($this->t['l'] .
'_TAXES', 'calendar', '#eff8a5'),
'users' => array($this->t['l'] .
'_USERS', 'user', '#fdb784'),
'formfields' => array($this->t['l'] .
'_FORM_FIELDS', 'list-alt', '#fa9d58'),
'reviews' => array($this->t['l'] .
'_REVIEWS', 'comment', '#ed145b'),
//'ratings' => array($this->t['l'] .
'_RATINGS', 'x x x', '#ffde00'),
//'vouchers' => array($this->t['l'] .
'_VOUCHERS', 'x x x', '#ffde00'),
'coupons' => array($this->t['l'] .
'_COUPONS', 'gift', '#f86cb5'),
'downloads' => array($this->t['l'] .
'_DOWNLOADS', 'download-alt', '#f86cd9'),
'tags' => array($this->t['l'] .
'_TAGS', 'tag', '#d673dd'),
'statistics' => array($this->t['l'] .
'_STATISTICS', 'stats', '#f4adf9'),
'logs' => array($this->t['l'] .
'_SYSTEM_LOG', 'list', '#4f70a6'),
'info' => array($this->t['l'] .
'_INFO', 'info-sign', '#7fadf8')
);
*/
$this->t['version'] =
PhocacartUtils::getPhocaVersion('com_phocacart');
$paramsC = PhocacartUtils::getComponentParameters();
$this->t['enable_wizard'] = $paramsC->get(
'enable_wizard', 1 );
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once JPATH_COMPONENT.'/helpers/phocacartcp.php';
$state = $this->get('State');
$canDo = PhocaCartCpHelper::getActions();
JToolbarHelper::title( JText::_(
'COM_PHOCACART_PC_CONTROL_PANEL' ), 'home' );
// This button is unnecessary but it is displayed because Joomla! design
bug
$bar = JToolbar::getInstance( 'toolbar' );
$dhtml = '<a href="index.php?option=com_phocacart"
class="btn btn-small"><i class="icon-home-2"
title="'.JText::_('COM_PHOCACART_CONTROL_PANEL').'"></i>
'.JText::_('COM_PHOCACART_CONTROL_PANEL').'</a>';
$bar->appendButton('Custom', $dhtml);
if ($canDo->get('core.admin')) {
JToolbarHelper::preferences('com_phocacart');
JToolbarHelper::divider();
}
JToolbarHelper::help( 'screen.phocacart', true );
$this->addModal();
}
protected function addModal() {
// Getting Started Wizard
$this->t['modalwindowdynamic'] = '';
$autoOpenModal = 0;
$idMd = 'phWizardStatusModal';
$textButton = 'COM_PHOCACART_GETTING_STARTED_WIZARD';
$linkWizard = JRoute::_(
'index.php?option=com_phocacart&view=phocacartwizard&tmpl=component&page=0',
false );
$w = 700;
$h = 400;
// WIZARD
// 1 ... run wizard automatically but only if product and category do not
exist
// 2 ... run wizard automatically - force it any way
// 11 ... run wizard automatically - go to first site of wizard
// ------------------------------
// 1) MANUALLY RUN START WIZARD
// ------------------------------
// Render Button to Stard Wizard
PhocacartRenderAdminview::renderWizardButton('start', $idMd ,
$linkWizard, $w, $h);
// ---------------------------------
// 2) AUTOMATICALLY RUN START WIZARD
// ---------------------------------
// 2a) Enable Wizard is disabled but category and product exists,
don't run wizard at start automatically
// Seems like user added some data yet, he/she can start wizard manually
// 2b) But if in Options FORCE WIZARD SET, then run it (enable_wizard
=2)
// 2c) But if in Options FORCE WIZARD SET, then run it (enable_wizard
=2)
$category = PhocacartUtils::doesExist('category');
$product = PhocacartUtils::doesExist('product');
if ($this->t['enable_wizard'] == 0 && $category == 1
&& $product == 1) {
$autoOpenModal = 0;
} else if ($this->t['enable_wizard'] == 1 &&
$category == 0 && $product == 0) {
$autoOpenModal = 1;
$linkWizard = JRoute::_(
'index.php?option=com_phocacart&view=phocacartwizard&tmpl=component&page=0',
false );
} else if ($this->t['enable_wizard'] == 2) {
$autoOpenModal = 1;
$linkWizard = JRoute::_(
'index.php?option=com_phocacart&view=phocacartwizard&tmpl=component&page=0',
false );
}
// 2d) Run the first page of wizard - user currently work with wizard so
it will be automatically loaded
// 11 means: 1 ... enable 1 ... to to page 1 = 11
if ($this->t['enable_wizard'] == 11) {
$autoOpenModal = 1;
$linkWizard = JRoute::_(
'index.php?option=com_phocacart&view=phocacartwizard&tmpl=component&page=1',
false );
}
$customFooter = '<form
action="'.JRoute::_('index.php?option=com_phocacart').'"
method="post" style="display: inline;">'
.' <input type="hidden" name="task"
value="phocacartwizard.skipwizard">'
.' <input type="hidden" name="tmpl"
value="component" />'
.' <input type="hidden" name="option"
value="com_phocacart" />'
.' <button class="btn btn-primary ph-btn"><span
class="icon-delete"></span>
'.JText::_('COM_PHOCACART_SKIP_WIZARD').'</button>'
. Joomla\CMS\HTML\HTMLHelper::_('form.token')
. '</form> ';
$pageClass = 'ph-wizard-start-page-window';
$rV = new PhocacartRenderAdminview();
$this->t['modalwindowdynamic'] =
$rV->modalWindowDynamic($idMd, $textButton, $w, $h, false,
$autoOpenModal, $linkWizard, 'ph-body-iframe-wizard',
$customFooter, $pageClass);
}
}
?>
PK�"�[�#o,,$views/phocacartcurrencies/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[� �E��*views/phocacartcurrencies/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th
class="ph-title">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TITLE', 'a.title',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-published">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PUBLISHED',
'a.published', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-code">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_CODE', 'a.code',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-currency-symbol">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_CURRENCY_SYMBOL',
'a.price_currency_symbol', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-exchange-rate">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_EXCHANGE_RATE',
'a.exchange_rate', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-id">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ID', 'a.id', $listDirn,
$listOrder ).'</th>'."\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart && $j
< (int)$this->pagination->limit) {
$j++;
$urlEdit =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
$urlTask =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit. $item->id );
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid :
0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'.
$this->escape($item->title).'</a>';
} else {
$checkO .= $this->escape($item->title);
}
//$checkO .= ' <span
class="smallsub">(<span>'.JText::_($this->t['l'].'_FIELD_ALIAS_LABEL').':</span>'.
$this->escape($item->alias).')</span>';
echo $r->td($checkO, "small");
echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'].'.',
$canChange), "small");
echo $r->td($this->escape($item->code), "small");
echo $r->td($this->escape($item->price_currency_symbol),
"small");
$this->t['current_currency'] = array();
$this->t['current_currency']['id'] = $item->id;
$this->t['current_currency']['code'] =
$item->code;
$this->t['current_currency']['exchange_rate'] =
$item->exchange_rate;
$exchangeInfo =
PhocacartCurrency::getCurrencyRelation($this->t['current_currency'],
$this->t['default_currency']);
//echo
$r->td($this->escape(PhocacartPrice::cleanPrice($item->exchange_rate))
. $exchangeInfo, "small");
echo $r->td('<span class="ph-editinplace-text ph-eip-text
ph-eip-price"
id="currencies:exchange_rate:'.(int)$item->id.'"
data-id="'.(int)$item->id.'">'
.
$this->escape(PhocacartPrice::cleanPrice($item->exchange_rate)).'</span>'
. '<div class="ph-exchange-info
phChangeEditInPlace'.(int)$item->id.'">'.$exchangeInfo.'</div>',
"small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 8);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,)views/phocacartcurrencies/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[q�٘�'views/phocacartcurrencies/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocaCartCurrencies extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('currency');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
$this->t['default_currency'] =
PhocacartCurrency::getDefaultCurrencyArray();
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.tax_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_CURRENCIES' ), 'eur' );
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartcurrencies.delete',
$this->t['l'].'_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.code' => JText::_($this->t['l'] .
'_CODE'),
'a.price_currency_symbol' =>
JText::_($this->t['l'] . '_CURRENCY_SYMBOL'),
'a.exchange_rate' => JText::_($this->t['l'] .
'_EXCHANGE_RATE'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,"views/phocacartcurrency/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�p�� � %views/phocacartcurrency/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('title', 'code',
'exchange_rate', 'price_format',
'price_currency_symbol', 'price_dec_symbol',
'price_decimals', 'price_thousands_sep',
'price_suffix', 'price_prefix', 'image',
'ordering');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2">';
if ((int)$this->item->id > 0) {
$this->t['current_currency'] = array();
$this->t['current_currency']['id'] =
$this->item->id;
$this->t['current_currency']['code'] =
$this->item->code;
$this->t['current_currency']['exchange_rate'] =
$this->item->exchange_rate;
$exchangeInfo =
PhocacartCurrency::getCurrencyRelation($this->t['current_currency'],
$this->t['default_currency']);
if ($exchangeInfo != '') {
echo '<div class="alert
alert-info"><small>'.
$exchangeInfo.'</small></div>';
}
}
echo '</div>';//end span2
echo $r->formInputs();
echo $r->endForm();
?>
PK�"�[�#o,,'views/phocacartcurrency/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��g� %views/phocacartcurrency/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartCurrency extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('currency');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->t['default_currency'] =
PhocacartCurrency::getDefaultCurrencyArray();
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.currency_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_CURRENCY' ).': <small><small>[ ' .
$text.' ]</small></small>' , 'eur');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,"views/phocacartdiscount/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[[lW��%views/phocacartdiscount/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'rules' =>
JText::_($this->t['l'].'_RULES'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('title', 'discount',
'calculation_type', 'access', 'group');
echo $r->group($this->form, $formArray);
$formArray = array('description');
echo $r->group($this->form, $formArray, 1);
echo $r->endTab();
echo $r->startTab('rules', $tabs['rules']);
$formArray = array ('total_amount', 'quantity_from',
'product_ids', 'product_filter', 'cat_ids',
'category_filter', 'free_shipping',
'free_payment');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs();
echo $r->endForm();
?>
PK�"�[�#o,,'views/phocacartdiscount/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[W|Hh��%views/phocacartdiscount/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartDiscount extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $attributeoption;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('discount');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.discount_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_DISCOUNT' ).': <small><small>[ ' .
$text.' ]</small></small>' , 'piggy-bank');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,#views/phocacartdiscounts/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�-
�##)views/phocacartdiscounts/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th
class="ph-title-short">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TITLE', 'a.title',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-published">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PUBLISHED',
'a.published', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-discount">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_DISCOUNT', 'a.discount',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-date">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_VALID_FROM',
'a.valid_from', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-date">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_VALID_TO', 'a.valid_to',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-status">'.JText::_($this->t['l'].'_STATUS').'</th>'."\n";
echo '<th
class="ph-id">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ID', 'a.id', $listDirn,
$listOrder ).'</th>'."\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart && $j
< (int)$this->pagination->limit) {
$j++;
$urlEdit =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
$urlTask =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit. $item->id );
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid :
0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'.
$this->escape($item->title).'</a>';
} else {
$checkO .= $this->escape($item->title);
}
echo $r->td($checkO, "small");
echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'].'.',
$canChange), "small");
//echo
$r->td($this->escape(PhocacartPrice::cleanPrice($item->discount)),
"small");
echo $r->td('<span class="ph-editinplace-text ph-eip-text
ph-eip-price"
id="discounts:discount:'.(int)$item->id.'">'.$this->escape(PhocacartPrice::cleanPrice($item->discount)).'</span>',
"small");
echo $r->td($this->escape($item->valid_from), "small");
echo $r->td($this->escape($item->valid_to), "small");
$status = PhocacartDate::getActiveDate($item->valid_from,
$item->valid_to, 1);
if ($item->published == 0) {
$status = '<span class="label
label-default">'.JText::_('COM_PHOCACART_UNPUBLISHED').'</span>';
}
echo $r->td($status, "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 9);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,(views/phocacartdiscounts/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[{M��FF&views/phocacartdiscounts/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartDiscounts extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('discount');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.discount_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_DISCOUNTS' ), 'piggy-bank'
);
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartdiscounts.delete',
$this->t['l'].'_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.discount' => JText::_($this->t['l'] .
'_DISCOUNT'),
'a.valid_from' => JText::_($this->t['l'] .
'_VALID_FROM'),
'a.valid_to' => JText::_($this->t['l'] .
'_VALLID_TO'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,"views/phocacartdownload/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[zC�'cc%views/phocacartdownload/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('title', 'download_file',
'date', 'download_hits');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs();
echo $r->endForm();
?>
PK�"�[�#o,,'views/phocacartdownload/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��d��%views/phocacartdownload/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartDownload extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('download');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.download_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_DOWNLOAD' ).': <small><small>[ ' .
$text.' ]</small></small>' ,
'download-alt');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
//JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,#views/phocacartdownloads/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[ԍ���)views/phocacartdownloads/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th
class="ph-title-small">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TITLE', 'a.title',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-published">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PUBLISHED',
'a.published', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-title-small">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ORDER_NUMBER',
'a.order_id', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-title-small">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_USER', 'u.name',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-filename">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_FILENAME',
'a.download_file', $listDirn, $listOrder
).'</th>'."\n";
echo '<th class="ph-status">'.JText::_(
$this->t['l'].'_STATUS'
).'</th>'."\n";
echo '<th
class="ph-date">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_DATE', 'a.date',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-download">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_DOWNLOADS',
'a.download_hits', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-id">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ID', 'a.id', $listDirn,
$listOrder ).'</th>'."\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart && $j
< (int)$this->pagination->limit) {
$j++;
$urlEdit =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
$urlTask =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit. $item->id );
$iD = $i % 2;
echo "\n\n";
//echo '<tr class="row'.$iD.'"
sortable-group-id="0"
item-id="'.$item->id.'" parents="0"
level="0">'. "\n";
echo $r->tdOrder($canChange, $saveOrder, $orderkey,
$item->ordering);
echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('grid.id', $i,
$item->id), "small");
$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'.
$this->escape($item->title).'</a>';
} else {
$checkO .= $this->escape($item->title);
}
echo $r->td($checkO, "small");
echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'].'.',
$canChange), "small");
/*
$rules = array();
if($item->active_amount) {$rules[] = '<span class="label
label-important label-danger badge
badge-danger">'.JText::_('COM_PHOCACART_AMOUNT_RULE').
'</span>';}
if($item->active_country) {$rules[] = '<span class="label
label-warning badge badge-warning
label-warning">'.JText::_('COM_PHOCACART_COUNTRY_RULE').
'</span>';}
if($item->active_region) {$rules[] = '<span class="label
label-info badge badge-info
label-info">'.JText::_('COM_PHOCACART_REGION_RULE').
'</span>';}
if($item->active_weight) {$rules[] = '<span class="label
label-success badge badge-success
label-success">'.JText::_('COM_PHOCACART_WEIGHT_RULE').
'</span>';}
echo $r->td(implode(" ", $rules), "small");*/
echo
$r->td($this->escape(PhocacartOrder::getOrderNumber($item->order_id,
$item->order_date, $item->order_number)), "small");
$userO = $this->escape($item->user_name);
if (isset($item->user_username)) {
$userO .= '
<small>('.$item->user_username.')</small>';
}
echo $r->td($userO, "small");
echo $r->td($item->download_file, "small");
$status = '';
if((int)$this->t['download_count'] > 0 &&
((int)$this->t['download_count'] ==
(int)$item->download_hits ||
(int)$this->t['download_count'] <
(int)$item->download_hits)) {
$status .= '<span class="label label-important label-danger
badge
badge-danger">'.JText::_('COM_PHOCACART_MAXIMUM_DOWNLOADS_REACHED').
'</span>';
}
if((int)$this->t['download_days'] > 0 &&
!PhocacartDownload::isActive($item->date,
$this->t['download_days'])) {
$status .= '<span class="label label-important label-danger
badge
badge-danger">'.JText::_('COM_PHOCACART_DOWNLOAD_DATE_EXPIRED').
'</span>';
}
if ($status == '') {
$status = '<span class="label label-success badge
badge-success
label-success">'.JText::_('COM_PHOCACART_ACTIVE').
'</span>';
}
//COM_PHOCACART_DOWNLOAD_DATE_EXPIRED
echo $r->td($status, "small");
echo $r->td($item->date, "small");
echo $r->td($item->download_hits, "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 11);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,(views/phocacartdownloads/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[U݇���&views/phocacartdownloads/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartDownloads extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('download');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
$paramsC = PhocacartUtils::getComponentParameters();
$this->t['download_days'] = $paramsC->get(
'download_days', 0 );
$this->t['download_count'] = $paramsC->get(
'download_count', 0 );
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.download_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_DOWNLOADS' ),
'download-alt' );
if ($canDo->get('core.create')) {
//JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
//JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartdownloads.delete',
$this->t['l'].'_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
//'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'u.name' => JText::_($this->t['l'] .
'_USER'),
'a.order_id' => JText::_($this->t['l'] .
'_ORDER_NUMBER'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.date' => JText::_($this->t['l'] .
'_DATE'),
'a.download_hits' => JText::_($this->t['l'] .
'_DOWNLOADS'),
'a.download_file' => JText::_($this->t['l'] .
'_FILENAME'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,'views/phocacarteditbulkprice/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[���p��-views/phocacarteditbulkprice/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tooltip');
Joomla\CMS\HTML\HTMLHelper::_('behavior.multiselect');
Joomla\CMS\HTML\HTMLHelper::_('dropdown.init');
Joomla\CMS\HTML\HTMLHelper::_('formbehavior.chosen',
'select');
jimport( 'joomla.filesystem.folder' );
jimport( 'joomla.filesystem.file' );
$link = JRoute::_(
'index.php?option='.$this->t['o'].'&view=phocacartedittax&tmpl=component&id='.(int)$this->id);
if (isset($this->item->id) && (int)$this->item->id >
0 && isset($this->item->title) &&
$this->item->title != '') {
echo '<h1
class="ph-modal-header">'.$this->item->title.'</h1>';
if (isset($this->item->description) &&
$this->item->description != '') {
echo
'<div>'.$this->item->description.'</div>';
}
// Params
$amount = $this->item->params->get('amount',
'');
$operator = $this->item->params->get('operator',
'');
$calculation_price =
$this->item->params->get('calculation_type',
'');
if ($calculation_price == 1) {
$calculation_price = '%';
} else {
$calculation_price = '';
}
echo '<div>';
echo '<b>' .
JText::_('COM_PHOCACART_CALCULATION') . "</b>:
".$operator . $amount . $calculation_price ;
echo '</div>';
$categoriesA = array();
if (!empty($this->item->categories)) {
foreach ($this->item->categories as $k => $v) {
$categoriesA[] = $v->title;
}
echo '<div>';
echo '<b>' .
JText::_('COM_PHOCACART_CATEGORIES') . "</b>: " .
implode(', ', $categoriesA);
echo '<div>';
}
echo
'<div><b>'.JText::_('COM_PHOCACART_NUMBER_OF_AFFECTED_PRODUCTS').'</b>:
'.$this->item->productcount.'</div>';
if (isset($this->item->status) &&
(int)$this->item->status == 1) {
// REVERT
echo '<form class="form-inline"
id="phBulkPriceRevert" action=""
method="post">';
echo '<div class="form-group">';
//echo '<label for="file_import">'.
JText::_('COM_PHOCACART_RUN').':</label>';
echo '<input class="btn btn-danger"
type="submit" name="submit" value="'.
JText::_('COM_PHOCACART_REVERT').'">';
echo '<input type="hidden" name="id"
value="'.(int)$this->item->id.'" />';
echo '<input type="hidden" name="task"
value="phocacartbulkprice.revert" />';
echo '<input type="hidden" name="token"
value="'.JSession::getFormToken().'" />';
echo '</div>';
echo '</form>';
} else {
// RUN
echo '<form class="form-inline"
id="phBulkPriceRun" action=""
method="post">';
echo '<div class="form-group">';
//echo '<label for="file_import">'.
JText::_('COM_PHOCACART_RUN').':</label>';
echo '<input class="btn btn-success"
type="submit" name="submit" value="'.
JText::_('COM_PHOCACART_RUN').'">';
echo '<input type="hidden" name="id"
value="'.(int)$this->item->id.'" />';
echo '<input type="hidden" name="task"
value="phocacartbulkprice.run" />';
echo '<input type="hidden" name="token"
value="'.JSession::getFormToken().'" />';
echo '</div>';
echo '</form>';
}
echo '<div id="phBulkPriceOutputBox"
class="phAjaxOutputBox"></div>';
/*$flag = '';
if (isset($this->item->code2) && $this->item->code2 !=
'') {
$flag = PhocacartCountry::getCountryFlag($this->item->code2, 0,
$this->item->image, '20px');
}
echo '<h1 class="ph-modal-header">'.$flag
.' '.$this->item->title.'</h1>';
echo '<form action="'.$link.'"
method="post">';
//echo '<table class="ph-tax-edit">';
echo '<div class="row-fluid
ph-tax-edit-header">';
echo '<div class="span4 col-sm-4
col-md-4">'.JText::_('COM_PHOCACART_TAX_NAME').'</div>';
echo '<div class="span2 col-sm-2
col-md-2">'.JText::_('COM_PHOCACART_TAX_RATE').'</div>';
echo '<div class="span2 col-sm-2
col-md-2">'.JText::_('COM_PHOCACART_TITLE').'</div>';
echo '<div class="span2 col-sm-2
col-md-2">'.JText::_('COM_PHOCACART_ALIAS').'</div>';
echo '<div class="span2 col-sm-2 col-md-2">'.
($this->type == 2 ? JText::_('COM_PHOCACART_TAX_RATE_REGION')
:
JText::_('COM_PHOCACART_TAX_RATE_COUNTRY')).'</div>';
echo '</div>';
if (!empty($this->itemcountrytax)) {
foreach($this->itemcountrytax as $k => $v) {
echo '<div class="row-fluid
ph-tax-edit-item">';
echo '<div class="span4 col-sm-4
col-md-4">'.JText::_($v->title).'</div>';
echo '<div class="span2 col-sm-2
col-md-2">'.PhocacartPrice::cleanPrice($v->tax_rate).'</div>';
echo '<div class="span2 col-sm-2 col-md-2">';
echo '<input class="input-small input-sm"
type="text"
name="jform['.(int)$v->id.'][title]"
value="'.htmlspecialchars($v->tcr_title).'">';
echo '<input type="hidden"
name="jform['.(int)$v->id.'][tax_id]"
value="'.(int)$v->id.'">';
echo '</div>';
echo '<div class="span2 col-sm-2
col-md-2"><input class="input-small input-sm"
type="text"
name="jform['.(int)$v->id.'][alias]"
value="'.htmlspecialchars($v->tcr_alias).'"></div>';
// cleanPrice method add 0 to empty values which is wrong in this case
as we have:
// VAT = 0 (valid VAT)
// VAT = '' (vat not set)
$tcTaxRate = '';
if ($v->tcr_tax_rate != '') {
$tcTaxRate = PhocacartPrice::cleanPrice($v->tcr_tax_rate);
}
if ($v->tcr_tax_rate == -1) {
$tcTaxRate = '';// -1 means, it was not active but we still
hold the ID of such tax for comparison in reports
}
echo '<div class="span2 col-sm-2
col-md-2"><input class="input-small input-sm"
type="text"
name="jform['.(int)$v->id.'][tax_rate]"
value="'.htmlspecialchars($tcTaxRate).'"></div>';
echo '</div>';
}
}
//echo '</table>';
echo '<input type="hidden" name="jform[id]"
value="'.(int)$this->id.'">';
echo '<input type="hidden" name="jform[type]"
value="'.(int)$this->type.'">';
echo '<input type="hidden" name="task"
value="phocacartedittax.edittax">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<div class="ph-tax-edit-button"><button
class="btn btn-success btn-sm ph-btn"><span
class="icon-edit"></span>
'.JText::_('COM_PHOCACART_SAVE').'</button></div>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';*/
}
/*
echo '<p> </p>';
echo '<form action="'.$link.'"
method="post">';
echo '<input type="hidden" name="jform[id]"
value="'.(int)$this->id.'">';
echo '<input type="hidden" name="jform[type]"
value="'.(int)$this->type.'">';
echo '<input type="hidden" name="task"
value="phocacartedittax.emptyinformation">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<button class="btn btn-primary btn-sm
ph-btn"><span class="icon-delete"></span>
'.JText::_('COM_PHOCACART_EMPTY_TAX_INFORMATION').'</button>';
echo '</div>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
*/
?>
PK�"�[�#o,,,views/phocacarteditbulkprice/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�����*views/phocacarteditbulkprice/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\HTML\HTMLHelper;
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocaCartEditBulkprice extends JViewLegacy
{
protected $t;
protected $r;
protected $item;
protected $itemhistory;
protected $id;
protected $type;
function display($tpl = null) {
$app = JFactory::getApplication();
$id = $app->input->get('id', 0, 'int');
$status = $app->input->get('status', 0,
'int');// 0 inactive - make run, 1 active - make revert
JFactory::getDocument()->addScriptOptions('phLang', array(
'COM_PHOCACART_CLOSE' =>
JText::_('COM_PHOCACART_CLOSE'))
);
JFactory::getDocument()->addScriptOptions('phVars',
array('token' => JSession::getFormToken(),
'urlbulkprice' =>
JURI::base(true).'/index.php?option=com_phocacart&format=json&'.
JSession::getFormToken().'=1'));
HTMLHelper::_('jquery.framework', false);
HTMLHelper::_('script',
'media/com_phocacart/js/administrator/phocacartbulkprice.js',
array('version' => 'auto'));
$this->r = new PhocacartRenderAdminview();
$this->item = PhocacartPriceBulkprice::getItem($id);
if ($status == 0) {
$this->t = PhocacartUtils::setVars('run');
} else if($status == 1) {
$this->t = PhocacartUtils::setVars('revert');
} else {
echo
'<div>'.JText::_('COM_PHOCACART_ERROR_NO_STATUS_DEFINED').'</div>';
return;
}
$media = new PhocacartRenderAdminmedia();
parent::display($tpl);
}
}
?>
PK�"�[�#o,,/views/phocacarteditproductpointgroup/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[XpC��5views/phocacarteditproductpointgroup/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tooltip');
Joomla\CMS\HTML\HTMLHelper::_('behavior.multiselect');
Joomla\CMS\HTML\HTMLHelper::_('dropdown.init');
Joomla\CMS\HTML\HTMLHelper::_('formbehavior.chosen',
'select');
$link = JRoute::_(
'index.php?option='.$this->t['o'].'&view=phocacarteditproductpointgroup&tmpl=component&id='.(int)$this->id);
echo '<div id="phAdminEditPopup"
class="ph-edit-stock-advanced-box">';
echo '<div class="alert alert-info"><button
type="button" class="close"
data-dismiss="alert">×</button>'
.
'<ul><li>'.JText::_('COM_PHOCACART_TO_SEE_ALL_CUSTOMER_GROUPS_LISTED_CLOSE_WINDOW_SAVE_THE_PRODUCT_FIRST')
. '</li>'
. '<li>'.
JText::_('COM_PHOCACART_CHECK_LIST_EVERY_TIME_CUSTOMER_GROUPS_CHANGE').'</li>'
.
'<li>'.JText::_('COM_PHOCACART_IF_YOU_SET_ZERO_AS_POINT_THEN_POINT_WILL_BE_ZERO').'</li>'
.'</ul></div>';
if (!empty($this->t['product'])) {
echo '<div
class="ph-product-customer-group-box">';
echo '<form action="'.$link.'"
method="post">';
if (!empty($this->t['groups'])) {
echo '<table
class="ph-product-customer-group-box">';
echo '<tr>';
echo
'<th>'.JText::_('COM_PHOCACART_CUSTOMER_GROUP').'</th>';
//echo
'<th>'.JText::_('COM_PHOCACART_PRODUCT_KEY').'</th>';
echo
'<th>'.JText::_('COM_PHOCACART_POINTS_RECEIVED').'</th>';
echo '</tr>';
/* // Default is the main price
echo '<tr>';
echo
'<td>'.JText::_('COM_PHOCACART_DEFAULT').'</td>';
echo '<td><input type="text"
class="input-small" name="jformdefault[]"
value="'.$this->t['product']->points_received.'"
readonly />';
echo '</td>';
echo '</tr>';*/
foreach($this->t['groups'] as $k => $v) {
echo '<tr>';
echo
'<td>'.JText::_($v['title']).'</td>';
if ($v['type'] == 1) {
//continue;
// Default
echo '<td><input type="text"
class="input-small"
name="jform['.$v['id'].'][points_received]"
value="'.$this->t['product']->points_received.'"
readonly />';
echo '<input type="hidden"
name="jform['.$v['id'].'][group_id]"
value="'.$v['id'].'" />';
echo '<input type="hidden"
name="jform['.$v['id'].'][product_id]"
value="'.$this->id.'" />';
} else {
// Set value from database
$points = '';
if
(isset($this->t['product_groups'][$v['id']]['points_received']))
{
$points =
$this->t['product_groups'][$v['id']]['points_received'];
}
echo '<td><input type="text"
class="input-small"
name="jform['.$v['id'].'][points_received]"
value="'.$points.'" />';
echo '<input type="hidden"
name="jform['.$v['id'].'][group_id]"
value="'.$v['id'].'" />';
echo '<input type="hidden"
name="jform['.$v['id'].'][product_id]"
value="'.$this->id.'" />';
//echo '<input type="hidden"
name="jform['.$v['id'].'][product_id]"
value="'.$v['product_id'].'" />';
//echo '<input type="hidden"
name="jform['.$v['id'].'][attributes]"
value="'.serialize($v['attributes']).'"
/>';
}
echo '</td>';
echo '</tr>';
}
echo '<tr><td
colspan="2"></td></tr>';
echo '<tr>';
echo '<td></td>';
echo '<td>';
echo '<input type="hidden" name="id"
value="'.(int)$this->t['product']->id.'">';
echo '<input type="hidden" name="task"
value="phocacarteditproductpointgroup.save">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<button class="btn btn-success btn-sm
ph-btn"><span class="icon-ok
ph-icon-white"></span>
'.JText::_('COM_PHOCACART_SAVE').'</button>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</tr>';
echo '</table>';
}
}
?>
PK�"�[�#o,,4views/phocacarteditproductpointgroup/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�TsJ2views/phocacarteditproductpointgroup/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
/*
phocacart import('phocacart.cart.cart');
phocacart import('phocacart.cart.cartdb');
phocacart import('phocacart.cart.rendercart');
phocacart import('phocacart.currency.currency');
*/
class PhocaCartCpViewPhocaCartEditProductPointGroup extends JViewLegacy
{
protected $t;
protected $r;
protected $item;
protected $itemhistory;
protected $id;
function display($tpl = null) {
$app = JFactory::getApplication();
$this->id = $app->input->get('id', 0,
'int');
if ($this->id < 1) {
echo '<div class="alert alert-error">';
echo JText::_('COM_PHOCACART_NO_PRODUCT_FOUND').
'<br/>';
echo
JText::_('COM_PHOCACART_CLOSE_WINDOW_SAVE_THE_PRODUCT_FIRST');
echo '</div>';
return;
}
$this->t = PhocacartUtils::setVars('product');
$this->r = new PhocacartRenderAdminview();
$this->t['product'] =
PhocacartProduct::getProduct((int)$this->id);
$this->t['groups'] =
PhocacartGroup::getGroupsById((int)$this->id, 3, 2);
$this->t['product_groups'] =
PhocacartGroup::getProductPointGroupsById((int)$this->id, 3, 2);
$media = new PhocacartRenderAdminmedia();
parent::display($tpl);
}
}
?>
PK�"�[�#o,,/views/phocacarteditproductpricegroup/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[&�̪335views/phocacarteditproductpricegroup/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tooltip');
Joomla\CMS\HTML\HTMLHelper::_('behavior.multiselect');
Joomla\CMS\HTML\HTMLHelper::_('dropdown.init');
Joomla\CMS\HTML\HTMLHelper::_('formbehavior.chosen',
'select');
$link = JRoute::_(
'index.php?option='.$this->t['o'].'&view=phocacarteditproductpricegroup&tmpl=component&id='.(int)$this->id);
echo '<div id="phAdminEditPopup"
class="ph-edit-stock-advanced-box">';
echo '<div class="alert alert-info"><button
type="button" class="close"
data-dismiss="alert">×</button>'
. '<ul>'
.'<li>'.JText::_('COM_PHOCACART_ONLY_GROUPS_WHICH_ARE_SET_IN_PARAMETER_CUSTOMER_GROUP_ARE_LISTED_HERE')
. '</li>'
.'<li>'.JText::_('COM_PHOCACART_TO_SEE_ALL_CUSTOMER_GROUPS_LISTED_CLOSE_WINDOW_SAVE_THE_PRODUCT_FIRST')
. '</li>'
. '<li>'.
JText::_('COM_PHOCACART_CHECK_LIST_EVERY_TIME_CUSTOMER_GROUPS_CHANGE').'</li>'
.
'<li>'.JText::_('COM_PHOCACART_IF_YOU_SET_ZERO_AS_PRICE_THEN_PRICE_WILL_BE_ZERO').'</li>'
.'</ul></div>';
if (!empty($this->t['product'])) {
echo '<div
class="ph-product-customer-group-box">';
echo '<form action="'.$link.'"
method="post">';
if (!empty($this->t['groups'])) {
echo '<table
class="ph-product-customer-group-box">';
echo '<tr>';
echo
'<th>'.JText::_('COM_PHOCACART_CUSTOMER_GROUP').'</th>';
//echo
'<th>'.JText::_('COM_PHOCACART_PRODUCT_KEY').'</th>';
echo
'<th>'.JText::_('COM_PHOCACART_PRICE').'</th>';
echo '</tr>';
foreach($this->t['groups'] as $k => $v) {
echo '<tr>';
echo
'<td>'.JText::_($v['title']).'</td>';
if ($v['type'] == 1) {
// Default
echo '<td><input type="text"
class="input-small"
name="jform['.$v['id'].'][price]"
value="'.PhocacartPrice::cleanPrice($this->t['product']->price).'"
readonly />';
echo '<input type="hidden"
name="jform['.$v['id'].'][group_id]"
value="'.$v['id'].'" />';
echo '<input type="hidden"
name="jform['.$v['id'].'][product_id]"
value="'.$this->id.'" />';
} else {
// Set value from database
$price = '';
if
(isset($this->t['product_groups'][$v['id']]['price']))
{
$price =
$this->t['product_groups'][$v['id']]['price'];
if ($price > 0 || $price == 0) {
$price = PhocacartPrice::cleanPrice($price);
}
}
echo '<td><input type="text"
class="input-small"
name="jform['.$v['id'].'][price]"
value="'.$price.'" />';
echo '<input type="hidden"
name="jform['.$v['id'].'][group_id]"
value="'.$v['id'].'" />';
echo '<input type="hidden"
name="jform['.$v['id'].'][product_id]"
value="'.$this->id.'" />';
//echo '<input type="hidden"
name="jform['.$v['id'].'][product_id]"
value="'.$v['product_id'].'" />';
//echo '<input type="hidden"
name="jform['.$v['id'].'][attributes]"
value="'.serialize($v['attributes']).'"
/>';
}
echo '</td>';
echo '</tr>';
}
echo '<tr><td
colspan="2"></td></tr>';
echo '<tr>';
echo '<td></td>';
echo '<td>';
echo '<input type="hidden" name="id"
value="'.(int)$this->t['product']->id.'">';
echo '<input type="hidden" name="task"
value="phocacarteditproductpricegroup.save">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<button class="btn btn-success btn-sm
ph-btn"><span class="icon-ok
ph-icon-white"></span>
'.JText::_('COM_PHOCACART_SAVE').'</button>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</tr>';
echo '</table>';
}
}
?>
PK�"�[�#o,,4views/phocacarteditproductpricegroup/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�:V2views/phocacarteditproductpricegroup/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
/*
phocacart import('phocacart.cart.cart');
phocacart import('phocacart.cart.cartdb');
phocacart import('phocacart.cart.rendercart');
phocacart import('phocacart.currency.currency');
*/
class PhocaCartCpViewPhocaCartEditProductPriceGroup extends JViewLegacy
{
protected $t;
protected $r;
protected $item;
protected $itemhistory;
protected $id;
function display($tpl = null) {
$app = JFactory::getApplication();
$this->id = $app->input->get('id', 0,
'int');
if ($this->id < 1) {
echo '<div class="alert alert-error">';
echo JText::_('COM_PHOCACART_NO_PRODUCT_FOUND').
'<br/>';
echo
JText::_('COM_PHOCACART_CLOSE_WINDOW_SAVE_THE_PRODUCT_FIRST');
echo '</div>';
return;
}
$this->t = PhocacartUtils::setVars('product');
$this->r = new PhocacartRenderAdminview();
$this->t['product'] =
PhocacartProduct::getProduct((int)$this->id);
$this->t['groups'] =
PhocacartGroup::getGroupsById((int)$this->id, 3, 2);
$this->t['product_groups'] =
PhocacartGroup::getProductPriceGroupsById((int)$this->id, 3, 2);
$media = new PhocacartRenderAdminmedia();
parent::display($tpl);
}
}
?>
PK�"�[�#o,,1views/phocacarteditproductpricehistory/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[-[iX++7views/phocacarteditproductpricehistory/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tooltip');
Joomla\CMS\HTML\HTMLHelper::_('behavior.multiselect');
Joomla\CMS\HTML\HTMLHelper::_('dropdown.init');
Joomla\CMS\HTML\HTMLHelper::_('formbehavior.chosen',
'select');
//- $link = JRoute::_(
'index.php?option='.$this->t['o'].'&view=phocacarteditproductpricehistory&tmpl=component&id='.(int)$this->id);
echo '<div id="phAdminEditPopup"
class="ph-edit-price-history-box">';
/*
echo '<div class="alert alert-info"><button
type="button" class="close"
data-dismiss="alert">×</button>'
.
'<ul><li>'.JText::_('COM_PHOCACART_TO_SEE_ALL_CUSTOMER_GROUPS_LISTED_CLOSE_WINDOW_SAVE_THE_PRODUCT_FIRST')
. '</li>'
.'</ul></div>';
*/
//- echo '<div
class="ph-product-price-history-box">';
//- echo '<form action="'.$link.'"
method="post">';
/*
echo '<div
class="ph-product-price-history-box">';
echo '<div class="row-fluid
ph-row">'."\n";
echo '<div class="col-xs-12 col-sm-3
col-md-3">'.JText::_('COM_PHOCACART_DATE').'</div>';
echo '<div class="col-xs-12 col-sm-2
col-md-2">'.JText::_('COM_PHOCACART_PRICE').'</div>';
echo '<div class="col-xs-12 col-sm-1
col-md-1"></div>';
echo '<div class="col-xs-12 col-sm-6
col-md-6"></div>';
echo '</div>';
echo '<div
class="ph-cb"></div>'."\n";
$r = new PhocacartRenderAdminview();
if (!empty($this->t['history'])) {
$i = 0;
foreach($this->t['history'] as $k => $v) {
echo $r->additionalPricehistoryRow((int)$i, (int)$v['id'],
$v['price'], $v['date'], $this->id, 0);
$i++;
}
$newRow = $r->additionalPricehistoryRow('\' +
phRowCountPricehistory + \'', '', '',
'', $this->id, 1);
$newRow = preg_replace('/[\x00-\x1F\x80-\x9F]/u', '',
$newRow);
PhocacartRenderAdminjs::renderJsManageRowPricehistory($i, $newRow);
} else {
$newRow = $r->additionalPricehistoryRow('\' +
phRowCountPricehistory + \'', '', '',
'', $this->id, 1);
$newRow = preg_replace('/[\x00-\x1F\x80-\x9F]/u', '',
$newRow);
PhocacartRenderAdminjs::renderJsManageRowPricehistory(0, $newRow);
}
echo $r->addRowButton(JText::_('COM_PHOCACART_ADD_PRICE'),
'pricehistory');
//echo '</td></tr>';
echo '<div class="col-xs-12 col-sm-3
col-md-3"></div>';
echo '<div class="col-xs-12 col-sm-2
col-md-2">';
echo '<input type="hidden" name="id"
value="'.(int)$this->id.'">';
echo '<input type="hidden" name="task"
value="phocacarteditproductpricehistory.save">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<button class="btn btn-success btn-sm
ph-btn"><span class="icon-ok
ph-icon-white"></span>
'.JText::_('COM_PHOCACART_SAVE').'</button>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</div>';
echo '<div class="col-xs-12 col-sm-1
col-md-1"></div>';
echo '<div class="col-xs-12 col-sm-6
col-md-6"></div>';
*/
$app = JFactory::getApplication();
$input = $app->input;
$class = $this->t['n'] . 'RenderAdminview';
$r = new PhocacartRenderAdminview();
$isModal = $input->get('layout') == 'modal' ?
true : false;
$layout = $isModal ? 'modal' : 'edit';
$tmpl = $isModal || $input->get('tmpl', '',
'cmd') === 'component' ? 'component' :
'';
//phocacartitem-form => adminForm
echo $r->startForm($this->t['o'],
$this->t['task'], (int)$this->id, 'adminForm',
'adminForm', '', $layout, $tmpl);
echo '<div class="span12 form-horizontal">';
echo '<div class="tab-pane"
id="price_history">'. "\n";
echo
'<h3>'.JText::_($this->t['l'].'_PRICE_HISTORY').'</h3>';
$formArray = array ('price_history');
echo $r->group($this->form, $formArray);
echo '</div>'. "\n";
//echo $r->formInputs($this->t['task']);
echo '<input type="hidden" name="id"
value="'.(int)$this->id.'">';
echo '<input type="hidden" name="task"
value="phocacarteditproductpricehistory.save">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<button class="btn btn-success btn-sm ph-btn pull-right
ph-right"><span class="icon-ok
ph-icon-white"></span>
'.JText::_('COM_PHOCACART_SAVE').'</button>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</div>';
echo $r->endForm();
echo '</div>';// end ph-product-price-history-box
?>
PK�"�[�#o,,6views/phocacarteditproductpricehistory/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��kt��4views/phocacarteditproductpricehistory/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
/*
phocacart import('phocacart.cart.cart');
phocacart import('phocacart.cart.cartdb');
phocacart import('phocacart.cart.rendercart');
phocacart import('phocacart.currency.currency');
*/
class PhocaCartCpViewPhocaCartEditProductPriceHistory extends JViewLegacy
{
protected $t;
protected $r;
protected $item;
protected $itemhistory;
protected $id;
function display($tpl = null) {
$app = JFactory::getApplication();
$this->id = $app->input->get('id', 0,
'int');
if ($this->id < 1) {
echo '<div class="alert alert-error">';
echo JText::_('COM_PHOCACART_NO_PRODUCT_FOUND').
'<br/>';
echo
JText::_('COM_PHOCACART_CLOSE_WINDOW_SAVE_THE_PRODUCT_FIRST');
echo '</div>';
return;
}
$this->t = PhocacartUtils::setVars('pricehistory');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->state->set('phocacarteditproductpricehistory.id',
(int)$this->id);
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->t = PhocacartUtils::setVars('product');
$this->r = new PhocacartRenderAdminview();
$this->t['history'] =
PhocacartPriceHistory::getPriceHistoryById((int)$this->id, 0, 1);
$media = new PhocacartRenderAdminmedia();
parent::display($tpl);
}
}
?>
PK�"�[�#o,,$views/phocacarteditstatus/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[P�P���*views/phocacarteditstatus/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tooltip');
Joomla\CMS\HTML\HTMLHelper::_('behavior.multiselect');
Joomla\CMS\HTML\HTMLHelper::_('dropdown.init');
Joomla\CMS\HTML\HTMLHelper::_('formbehavior.chosen',
'select');
if (!empty($this->itemhistory)) {
//echo '<table class="ph-order-status-edit">';
echo '<div class="row-fluid
ph-order-status-edit-header">';
echo '<div class="span4 col-sm-4
col-md-4">'.JText::_('COM_PHOCACART_DATE').'</div>';
echo '<div class="span2 col-sm-2
col-md-2">'.JText::_('COM_PHOCACART_STATUS').'</div>';
echo '<div class="span2 col-sm-2
col-md-2">'.JText::_('COM_PHOCACART_USER').'</div>';
echo '<div class="span2 col-sm-2
col-md-2">'.JText::_('COM_PHOCACART_USER_NOTIFIED').'</div>';
echo '<div class="span2 col-sm-2
col-md-2">'.JText::_('COM_PHOCACART_COMMENT').'</div>';
echo '</div>';
foreach($this->itemhistory as $k => $v) {
echo '<div class="row-fluid
ph-order-status-edit-item">';
echo '<div class="span4 col-sm-4
col-md-4">'.JHtml::date($v->date,
JText::_('DATE_FORMAT_LC5')).'</div>';
echo '<div class="span2 col-sm-2
col-md-2">'.JText::_($v->statustitle).'</div>';
$userO = $v->user_name;
if (isset($v->user_username)) {
$userO .= '
<small>('.$v->user_username.')</small>';
}
echo '<div class="span2 col-sm-2
col-md-2">'.$userO.'</div>';
$notifyText = JText::_('COM_PHOCACART_NO');
if ($v->notify == -1) {
$notifyText = JText::_('COM_PHOCACART_NO_ERROR');
} else if ($v->notify > 0) {
$notifyText = JText::_('COM_PHOCACART_YES');
}
echo '<div class="span2 col-sm-2
col-md-2">'.$notifyText.'</div>';
$comment = '';
if ($v->comment != '') {
$comment = $v->comment;
}
echo '<div class="span2 col-sm-2
col-md-2">'.$comment.'</div>';
echo '</div>';
}
//echo '</table>';
}
echo '<p> </p>';
echo '<p> </p>';
$link = JRoute::_(
'index.php?option='.$this->t['o'].'&view=phocacarteditstatus&tmpl=component&id='.(int)$this->id);
echo '<form action="'.$link.'"
method="post">';
echo '<input type="hidden" name="jform[id]"
value="'.(int)$this->id.'">';
echo '<input type="hidden" name="task"
value="phocacarteditstatus.editstatus">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
//echo '<table class="ph-edit-status-box">';
echo '<div class="row-fluid">';
echo '<div class="span3 col-sm-3
col-md-3">'.JText::_('COM_PHOCACART_COMMENT').'</div>';
echo '<div class="span3 col-sm-3
col-md-3"><textarea
name="jform[comment_history]"></textarea></div>';
echo '<div class="span6 col-sm-6
col-md-6"></div>';
echo '</div>';
echo '<div class="row-fluid">';
echo '<div class="span3 col-sm-3
col-md-3">'.JText::_('COM_PHOCACART_NOTIFY_CUSTOMER').'</div>';
$checked = '';
if (isset($this->item['email_customer']) &&
(int)$this->item['email_customer'] > 0) {
$checked = 'checked="checked"';
}
echo '<div class="span3 col-sm-3 col-md-3"><input
type="checkbox" name="jform[notify_customer]"
'.$checked.' /></div>';
echo '<div class="span6 col-sm-6
col-md-6"></div>';
echo '</div>';
echo '<div class="row-fluid">';
echo '<div class="span3 col-sm-3
col-md-3">'.JText::_('COM_PHOCACART_NOTIFY_OTHERS').'</div>';
$checked = '';
if (isset($this->item['email_others']) &&
$this->item['email_others'] != '') {
$checked = 'checked="checked"';
}
echo '<div class="span3 col-sm-3 col-md-3"><input
type="checkbox" name="jform[notify_others]"
'.$checked.' /></div>';
echo '<div class="span6 col-sm-6
col-md-6"></div>';
echo '</div>';
echo '<div class="row-fluid">';
echo '<div class="span12 col-sm-12 col-md-12"><div
class="alert alter-warning" style="display:none"
id="phWarningNotify">'.JText::_('COM_PHOCACART_WARNING_ORDER_STATUS_CHANGED_CHECK_NOTIFY_CUSTOMER_NOTIFY_OTHERS_FIELDS_AGAIN').'</div></div>';
echo '</div>';
echo '<div class="row-fluid">';
echo '<div class="span3 col-sm-3
col-md-3">'.JText::_('COM_PHOCACART_FIELD_EMAIL_SEND_ATTACHMENT_LABEL').'</div>';
echo '<div class="span3 col-sm-3
col-md-3">'.PhocacartOrderStatus::getEmailSendSelectBox($this->item['email_send']).'</div>';
echo '<div class="span6 col-sm-6
col-md-6"></div>';
echo '</div>';
echo '<div class="row-fluid">';
echo '<div class="span3 col-sm-3
col-md-3">'.JText::_('COM_PHOCACART_FIELD_EMAIL_SEND_FORMAT_LABEL').'</div>';
echo '<div class="span3 col-sm-3
col-md-3">'.PhocacartOrderStatus::getEmailSendFormatSelectBox($this->item['email_send_format']).'</div>';
echo '<div class="span6 col-sm-6
col-md-6"></div>';
echo '</div>';
echo '<div class="row-fluid">';
echo '<div class="span3 col-sm-3
col-md-3">'.JText::_('COM_PHOCACART_STATUS').'</div>';
echo '<div class="span3 col-sm-3
col-md-3">'.$this->item['select'].'</div>';
echo '<div class="span6 col-sm-6
col-md-6"></div>';
echo '</div>';
echo '<div class="row-fluid">';
echo '<div class="span3 col-sm-3
col-md-3">'.JText::_('COM_PHOCACART_FIELD_STOCK_MOVEMENTS_LABEL').'</div>';
echo '<div class="span3 col-sm-3
col-md-3">'.PhocacartOrderStatus::getStockMovementsSelectBox($this->item['stock_movements']).'</div>';
echo '<div class="span6 col-sm-6
col-md-6"></div>';
echo '</div>';
echo '<div class="row-fluid">';
echo '<div class="span3 col-sm-3
col-md-3">'.JText::_('COM_PHOCACART_FIELD_USER_GROUP_CHANGE_LABEL').'</div>';
echo '<div class="span3 col-sm-3
col-md-3">'.PhocacartOrderStatus::getChangeUserGroupSelectBox($this->item['change_user_group']).'</div>';
echo '<div class="span6 col-sm-6
col-md-6"></div>';
echo '</div>';
echo '<div class="row-fluid">';
echo '<div class="span3 col-sm-3
col-md-3">'.JText::_('COM_PHOCACART_FIELD_REWARD_POINTS_CHANGE_NEEDED_LABEL').'</div>';
echo '<div class="span3 col-sm-3
col-md-3">'.PhocacartOrderStatus::getChangeChangePointsNeededSelectBox($this->item['change_points_needed']).'</div>';
echo '<div class="span6 col-sm-6
col-md-6"></div>';
echo '</div>';
echo '<div class="row-fluid">';
echo '<div class="span3 col-sm-3
col-md-3">'.JText::_('COM_PHOCACART_FIELD_REWARD_POINTS_CHANGE_RECEIVED_LABEL').'</div>';
echo '<div class="span3 col-sm-3
col-md-3">'.PhocacartOrderStatus::getChangePointsReceivedSelectBox($this->item['change_points_received']).'</div>';
echo '<div class="span6 col-sm-6
col-md-6"></div>';
echo '</div>';
/*
echo '<div class="row-fluid">';
echo '<div class="span3 col-sm-3
col-md-3">'.JText::_('COM_PHOCACART_FIELD_REWARD_EMAIL_SEND_GIFT_VOUCHERS_LABEL').'</div>';
echo '<div class="span3 col-sm-3
col-md-3">'.PhocacartOrderStatus::getEmailSendGiftSelectBox($this->item['email_gift']).'</div>';
echo '<div class="span6 col-sm-6
col-md-6"></div>';
echo '</div>';
*/
echo '<div class="row-fluid">';
echo '<div class="span3 col-sm-3 col-md-3
ph-tax-edit-button"><button class="btn btn-success btn-sm
ph-btn"><span class="icon-edit"></span>
'.JText::_('COM_PHOCACART_EDIT_STATUS').'</button></div>';
echo '<div class="span3 col-sm-3
col-md-3"></div>';
echo '<div class="span6 col-sm-6
col-md-6"></div>';
echo '</div>';
//echo '</table>';
echo '<div
class="ph-cb"> </div>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
echo '<p> </p>';
echo '<form action="'.$link.'"
method="post">';
echo '<input type="hidden" name="jform[id]"
value="'.(int)$this->id.'">';
echo '<input type="hidden" name="task"
value="phocacarteditstatus.emptyhistory">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<button class="btn btn-primary btn-sm
ph-btn"><span class="icon-delete"></span>
'.JText::_('COM_PHOCACART_EMPTY_ORDER_HISTORY').'</button>';
echo '</div>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
?>
PK�"�[�#o,,)views/phocacarteditstatus/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[q�iw��'views/phocacarteditstatus/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
/*
phocacart import('phocacart.cart.cart');
phocacart import('phocacart.cart.cartdb');
phocacart import('phocacart.cart.rendercart');
phocacart import('phocacart.currency.currency');
*/
class PhocaCartCpViewPhocaCartEditStatus extends JViewLegacy
{
protected $t;
protected $r;
protected $item;
protected $itemhistory;
protected $id;
function display($tpl = null) {
$app = JFactory::getApplication();
$this->id = $app->input->get('id', 0,
'int');
$this->t = PhocacartUtils::setVars('cart');
$this->r = new PhocacartRenderAdminviews();
$this->item = $this->get('Data');
$this->itemhistory = $this->get('HistoryData');
$media = new PhocacartRenderAdminmedia();
PhocacartRenderAdminjs::renderHtmlAfterChange('#jform_status_id',
'#phWarningNotify');
parent::display($tpl);
}
}
?>
PK�"�[�#o,,+views/phocacarteditstockadvanced/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[
,�oo1views/phocacarteditstockadvanced/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tooltip');
Joomla\CMS\HTML\HTMLHelper::_('behavior.multiselect');
Joomla\CMS\HTML\HTMLHelper::_('dropdown.init');
Joomla\CMS\HTML\HTMLHelper::_('formbehavior.chosen',
'select');
echo '<div id="phEditStockAdvancedBox"
class="ph-edit-stock-advanced-box">';
echo '<div class="alert alert-info"><button
type="button" class="close"
data-dismiss="alert">×</button>'
.
'<ul><li>'.JText::_('COM_PHOCACART_TO_SEE_ALL_ATTRIBUTES_LISTED_CLOSE_WINDOW_SAVE_THE_PRODUCT_FIRST')
. '</li>'
. '<li>'.
JText::_('COM_PHOCACART_CHECK_LIST_EVERY_TIME_ATTRIBUTES_CHANGE').'</li>'
. '<li><b>'.
JText::_('COM_PHOCACART_ADVANCED_STOCK_MANAGEMENT').'</b>:
'.JText::_('COM_PHOCACART_ONLY_STOCK_VALUES_ARE_ACTIVE').'</li>'
. '<li><b>'.
JText::_('COM_PHOCACART_ADVANCED_STOCK_AND_PRICE_MANAGEMENT').'</b>:
'.JText::_('COM_PHOCACART_STOCK_VALUES_AND_PRICE_VALUES_ARE_ACTIVE').'.
'.JText::_('COM_PHOCACART_PRICE_VALUES_OVERWRITE_CUSTOMER_GROUP_PRICES').'</li>'
.'</ul></div>';
$app = JFactory::getApplication();
$input = $app->input;
$class = $this->t['n'] . 'RenderAdminview';
$r = new PhocacartRenderAdminview();
$isModal = $input->get('layout') == 'modal' ?
true : false;
$layout = $isModal ? 'modal' : 'edit';
$tmpl = $isModal || $input->get('tmpl', '',
'cmd') === 'component' ? 'component' :
'';
//phocacartitem-form => adminForm
echo $r->startForm($this->t['o'],
$this->t['task'], (int)$this->id, 'adminForm',
'adminForm', '', $layout, $tmpl);
echo '<div class="span12 form-horizontal">';
echo '<div class="tab-pane"
id="product_stock">'. "\n";
//echo
'<h3>'.JText::_($this->t['l'].'_PRODUCT_STOCK').'</h3>';
$formArray = array ('product_stock');
echo $r->group($this->form, $formArray);
echo '</div>'. "\n";
//echo $r->formInputs($this->t['task']);
echo '<input type="hidden" name="id"
value="'.(int)$this->id.'">';
echo '<input type="hidden" name="task"
value="phocacarteditstockadvanced.save">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<button class="btn btn-success btn-sm ph-btn pull-right
ph-right"><span class="icon-ok
ph-icon-white"></span>
'.JText::_('COM_PHOCACART_SAVE').'</button>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</div>';
echo $r->endForm();
echo '</div>';// end ph-edit-stock-advanced-box
/*
$formArray = array ('product_stock');
$link = JRoute::_(
'index.php?option='.$this->t['o'].'&view=phocacarteditstockadvanced&tmpl=component&id='.(int)$this->id);
echo '<div class="ph-edit-stock-advanced-box">';
echo '<div class="alert alert-info"><button
type="button" class="close"
data-dismiss="alert">×</button>'
.
'<ul><li>'.JText::_('COM_PHOCACART_TO_SEE_ALL_ATTRIBUTES_LISTED_CLOSE_WINDOW_SAVE_THE_PRODUCT_FIRST')
. '</li>'
. '<li>'.
JText::_('COM_PHOCACART_CHECK_LIST_EVERY_TIME_ATTRIBUTES_CHANGE').'</li>'
. '<li><b>'.
JText::_('COM_PHOCACART_ADVANCED_STOCK_MANAGEMENT').'</b>:
'.JText::_('COM_PHOCACART_ONLY_STOCK_VALUES_ARE_ACTIVE').'</li>'
. '<li><b>'.
JText::_('COM_PHOCACART_ADVANCED_STOCK_AND_PRICE_MANAGEMENT').'</b>:
'.JText::_('COM_PHOCACART_STOCK_VALUES_AND_PRICE_VALUES_ARE_ACTIVE').'.
'.JText::_('COM_PHOCACART_PRICE_VALUES_OVERWRITE_CUSTOMER_GROUP_PRICES').'</li>'
.'</ul></div>';
if (!empty($this->t['product'])) {
echo '<div class="ph-attribute-box">';
echo '<form action="'.$link.'"
method="post">';
if (!empty($this->t['combinations'])) {
ksort($this->t['combinations']);
echo '<table
class="ph-attribute-option-box">';
echo '<tr>';
echo
'<th>'.JText::_('COM_PHOCACART_TITLE').'</th>';
echo
'<th>'.JText::_('COM_PHOCACART_ATTRIBUTES').'</th>';
//echo
'<th>'.JText::_('COM_PHOCACART_PRODUCT_KEY').'</th>';
echo
'<th>'.JText::_('COM_PHOCACART_IN_STOCK').'</th>';
echo
'<th>'.JText::_('COM_PHOCACART_PRICE').'</th>';
echo
'<th>'.JText::_('COM_PHOCACART_SKU').'</th>';
echo
'<th>'.JText::_('COM_PHOCACART_EAN').'</th>';
echo
'<th>'.JText::_('COM_PHOCACART_IMAGE').'</th>';
echo '</tr>';
foreach($this->t['combinations'] as $k => $v) {
echo '<tr>';
echo
'<td>'.$v['product_title'].'</td>';
echo
'<td>'.$v['title'].'</td>';
//echo '<td><input type="text"
class="input-large"
name="jform['.$v['product_key'].'][product_key]"
value="'.$v['product_key'].'"
/></td>';
// Set value from database
$stock = 0;
if
(isset($this->t['combinations_data'][$v['product_key']]['stock']))
{
$stock =
$this->t['combinations_data'][$v['product_key']]['stock'];
}
$price = '';
if
(isset($this->t['combinations_data'][$v['product_key']]['price']))
{
$price =
$this->t['combinations_data'][$v['product_key']]['price'];
$price = PhocacartPrice::cleanPrice($price);
}
$sku ='';
if
(isset($this->t['combinations_data'][$v['product_key']]['sku']))
{
$sku =
$this->t['combinations_data'][$v['product_key']]['sku'];
}
$ean = '';
if
(isset($this->t['combinations_data'][$v['product_key']]['ean']))
{
$ean =
$this->t['combinations_data'][$v['product_key']]['ean'];
}
$image = '';
if
(isset($this->t['combinations_data'][$v['product_key']]['image']))
{
$image =
$this->t['combinations_data'][$v['product_key']]['image'];
}
echo '<td><input type="text"
class="input-mini"
name="jform['.$v['product_key'].'][stock]"
value="'.$stock.'" />';
echo '<input type="hidden"
name="jform['.$v['product_key'].'][product_key]"
value="'.$v['product_key'].'" />';
echo '<input type="hidden"
name="jform['.$v['product_key'].'][product_id]"
value="'.$v['product_id'].'" />';
echo '<input type="hidden"
name="jform['.$v['product_key'].'][attributes]"
value="'.PhocacartProduct::getProductKey($v['product_id'],
$v['attributes'], 0).'" />';
echo '</td>';
echo '<td><input type="text"
class="input-mini"
name="jform['.$v['product_key'].'][price]"
value="'.$price.'" /></td>';
echo '<td><input type="text"
class="input-mini"
name="jform['.$v['product_key'].'][sku]"
value="'.$sku.'" /></td>';
echo '<td><input type="text"
class="input-mini"
name="jform['.$v['product_key'].'][ean]"
value="'.$ean.'" /></td>';
echo '<td><input type="text"
class="input-mini"
name="jform['.$v['product_key'].'][image]"
value="'.$image.'" /></td>';
echo '</tr>';
}
echo '<tr><td
colspan="6"></td></tr>';
echo '<tr>';
echo '<td></td>';
echo '<td></td>';
echo '<td></td>';
echo '<td></td>';
echo '<td></td>';
echo '<td></td>';
echo '<td>';
echo '<input type="hidden" name="id"
value="'.(int)$this->t['product']->id.'">';
echo '<input type="hidden" name="task"
value="phocacarteditstockadvanced.save">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<button class="btn btn-success btn-sm
ph-btn"><span class="icon-ok
ph-icon-white"></span>
'.JText::_('COM_PHOCACART_SAVE').'</button>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</tr>';
echo '</table>';
}
}*/
?>
PK�"�[�#o,,0views/phocacarteditstockadvanced/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[w�:s.views/phocacarteditstockadvanced/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
/*
phocacart import('phocacart.cart.cart');
phocacart import('phocacart.cart.cartdb');
phocacart import('phocacart.cart.rendercart');
phocacart import('phocacart.currency.currency');
*/
class PhocaCartCpViewPhocaCartEditStockAdvanced extends JViewLegacy
{
protected $t;
protected $r;
protected $item;
protected $itemhistory;
protected $id;
function display($tpl = null) {
$app = JFactory::getApplication();
$this->id = $app->input->get('id', 0,
'int');
if ($this->id < 1) {
echo '<div class="alert alert-error">';
echo JText::_('COM_PHOCACART_NO_PRODUCT_FOUND').
'<br/>';
echo
JText::_('COM_PHOCACART_CLOSE_WINDOW_SAVE_THE_PRODUCT_FIRST');
echo '</div>';
return;
}
$this->state = $this->get('State');
$this->state->set('phocacarteditstockadvanced.id',
(int)$this->id);
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->t =
PhocacartUtils::setVars('editstockadvanced');
$this->r = new PhocacartRenderAdminview();
/*$this->t['product'] =
PhocacartProduct::getProduct((int)$this->id);
$this->t['attr_options'] =
PhocacartAttribute::getAttributesAndOptions((int)$this->id);
$this->t['combinations'] = array();
$this->t['combinations_data'] = array();
if (!empty($this->t['product'])) {
PhocacartAttribute::getCombinations(
$this->t['product']->id,
$this->t['product']->title,
$this->t['attr_options'],
$this->t['combinations']);
// Load data from database
$this->t['combinations_data'] =
PhocacartAttribute::getCombinationsDataByProductId($this->t['product']->id);
}*/
parent::display($tpl);
}
}
?>
PK�"�[�#o,,!views/phocacartedittax/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[q�ֿ44'views/phocacartedittax/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tooltip');
Joomla\CMS\HTML\HTMLHelper::_('behavior.multiselect');
Joomla\CMS\HTML\HTMLHelper::_('dropdown.init');
Joomla\CMS\HTML\HTMLHelper::_('formbehavior.chosen',
'select');
jimport( 'joomla.filesystem.folder' );
jimport( 'joomla.filesystem.file' );
$link = JRoute::_(
'index.php?option='.$this->t['o'].'&view=phocacartedittax&tmpl=component&id='.(int)$this->id);
if (isset($this->item->id) && (int)$this->item->id >
0 && isset($this->item->title) &&
$this->item->title != '') {
$flag = '';
if (isset($this->item->code2) && $this->item->code2 !=
'') {
$flag = PhocacartCountry::getCountryFlag($this->item->code2, 0,
$this->item->image, '20px');
}
echo '<h1 class="ph-modal-header">'.$flag
.' '.$this->item->title.'</h1>';
echo '<form action="'.$link.'"
method="post">';
//echo '<table class="ph-tax-edit">';
echo '<div class="row-fluid
ph-tax-edit-header">';
echo '<div class="span4 col-sm-4
col-md-4">'.JText::_('COM_PHOCACART_TAX_NAME').'</div>';
echo '<div class="span2 col-sm-2
col-md-2">'.JText::_('COM_PHOCACART_TAX_RATE').'</div>';
echo '<div class="span2 col-sm-2
col-md-2">'.JText::_('COM_PHOCACART_TITLE').'</div>';
echo '<div class="span2 col-sm-2
col-md-2">'.JText::_('COM_PHOCACART_ALIAS').'</div>';
echo '<div class="span2 col-sm-2 col-md-2">'.
($this->type == 2 ? JText::_('COM_PHOCACART_TAX_RATE_REGION')
:
JText::_('COM_PHOCACART_TAX_RATE_COUNTRY')).'</div>';
echo '</div>';
if (!empty($this->itemcountrytax)) {
foreach($this->itemcountrytax as $k => $v) {
echo '<div class="row-fluid
ph-tax-edit-item">';
echo '<div class="span4 col-sm-4
col-md-4">'.JText::_($v->title).'</div>';
echo '<div class="span2 col-sm-2
col-md-2">'.PhocacartPrice::cleanPrice($v->tax_rate).'</div>';
echo '<div class="span2 col-sm-2 col-md-2">';
echo '<input class="input-small input-sm"
type="text"
name="jform['.(int)$v->id.'][title]"
value="'.htmlspecialchars($v->tcr_title).'">';
echo '<input type="hidden"
name="jform['.(int)$v->id.'][tax_id]"
value="'.(int)$v->id.'">';
echo '</div>';
echo '<div class="span2 col-sm-2
col-md-2"><input class="input-small input-sm"
type="text"
name="jform['.(int)$v->id.'][alias]"
value="'.htmlspecialchars($v->tcr_alias).'"></div>';
// cleanPrice method add 0 to empty values which is wrong in this case
as we have:
// VAT = 0 (valid VAT)
// VAT = '' (vat not set)
$tcTaxRate = '';
if ($v->tcr_tax_rate != '') {
$tcTaxRate = PhocacartPrice::cleanPrice($v->tcr_tax_rate);
}
if ($v->tcr_tax_rate == -1) {
$tcTaxRate = '';// -1 means, it was not active but we still
hold the ID of such tax for comparison in reports
}
echo '<div class="span2 col-sm-2
col-md-2"><input class="input-small input-sm"
type="text"
name="jform['.(int)$v->id.'][tax_rate]"
value="'.htmlspecialchars($tcTaxRate).'"></div>';
echo '</div>';
}
}
//echo '</table>';
echo '<input type="hidden" name="jform[id]"
value="'.(int)$this->id.'">';
echo '<input type="hidden" name="jform[type]"
value="'.(int)$this->type.'">';
echo '<input type="hidden" name="task"
value="phocacartedittax.edittax">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<div class="ph-tax-edit-button"><button
class="btn btn-success btn-sm ph-btn"><span
class="icon-edit"></span>
'.JText::_('COM_PHOCACART_SAVE').'</button></div>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
}
echo '<p> </p>';
echo '<form action="'.$link.'"
method="post">';
echo '<input type="hidden" name="jform[id]"
value="'.(int)$this->id.'">';
echo '<input type="hidden" name="jform[type]"
value="'.(int)$this->type.'">';
echo '<input type="hidden" name="task"
value="phocacartedittax.emptyinformation">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<button class="btn btn-primary btn-sm
ph-btn"><span class="icon-delete"></span>
'.JText::_('COM_PHOCACART_EMPTY_TAX_INFORMATION').'</button>';
echo '</div>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
?>
PK�"�[�#o,,&views/phocacartedittax/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�G:"��$views/phocacartedittax/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocaCartEditTax extends JViewLegacy
{
protected $t;
protected $r;
protected $item;
protected $itemhistory;
protected $id;
protected $type;
function display($tpl = null) {
$app = JFactory::getApplication();
$this->id = $app->input->get('id', 0,
'int');
$this->type = $app->input->get('type', 1,
'int');// 1 country, 2 region
if ($this->type == 1) {
$this->t = PhocacartUtils::setVars('country');
$this->r = new PhocacartRenderAdminview();
$this->item = $this->get('Data');
$this->itemcountrytax = $this->get('CountryTaxData');
} else {
$this->t = PhocacartUtils::setVars('region');
$this->r = new PhocacartRenderAdminview();
$this->item = $this->get('Data');
$this->itemcountrytax = $this->get('RegionTaxData');
}
$media = new PhocacartRenderAdminmedia();
parent::display($tpl);
}
}
?>
PK�"�[�#o,,!views/phocacartexports/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��(��'views/phocacartexports/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$s = 'jQuery(document).ready(function (){
jQuery(\'#phSubmitDownload\').on(\'click\', function
() {
jQuery(".circle").attr(\'class\',
\'circle-active\');
})
});';
JFactory::getDocument()->addScriptDeclaration($s);
echo '<div
id="'.$this->t['tasks'].'">';
//echo $r->startFilter();
//echo $r->endFilter();
echo $r->startMainContainer();
$url =
JRoute::_('index.php?option=com_phocacart&view=phocacartexports');
$c1 = $c2 = 'circle';
$msg = '';
echo '<div class="import-export">';
if ((int)$this->t['count'] < 1) {
$msg .= '<div class="alert alert-success">';
$msg .=
JText::_('COM_PHOCACART_THERE_ARE_NO_ITEMS_READY_TO_EXPORT');
$msg .= '</div>';
?>
<div class="row-fluid import-export-row-message">
<div class="col-xs-12 col-sm-12 col-md-12">
<div id="phMessageBox"><?php echo $msg
?></div>
</div>
</div>
<?php
} else {
// Prouducts count > 0
if ((int)$this->t['count'] > 0) {
$url2 =
'index.php?option=com_phocacart&task=phocacartexport.export&format=json&tmpl=component&'.
JSession::getFormToken().'=1';
PhocacartRenderAdminjs::renderImportExportItems($url2,
'phMessageBox', 'phFormExport',
(int)$this->t['count_pagination'],
JText::_('COM_PHOCACART_ALL_PRODUCTS_EXPORTED'), 1);
}
// Products were exported to export table
if ((int)$this->t['countexport'] > 0) {
$c1 = 'circle-active';
}
// Products were exported to export table and then the browser reloaded
the page so we need to inform the user about success
if ((int)$this->t['countexport'] ==
(int)$this->t['count']) {
$msg .= '<div class="alert alert-success">';
$msg .= JText::_('COM_PHOCACART_ALL_PRODUCTS_EXPORTED');
$msg .= '</div>';
}
?><div class="row-fluid import-export-row-message">
<div class="col-xs-12 col-sm-12 col-md-12">
<div id="phMessageBox"><?php echo $msg
?></div>
</div>
</div>
<div class="row-fluid import-export-row">
<div class="col-xs-12 col-sm-6 col-md-6">
<div class="import-export-box">
<?php if ((int)$this->t['count'] > 0) { ?>
<div class="<?php echo $c1; ?>">1</div>
<h2><?php echo JText::_('COM_PHOCACART_EXPORT');
?></h2>
<?php if ((int)$this->t['countexport'] > 0) {
} else { ?>
<div class="import-export-desc"><?php echo
JText::_('COM_PHOCACART_THERE_ARE_ITEMS_READY_TO_EXPORT'); ?>:
<?php echo $this->t['count']; ?><br /><?php
echo
JText::_('COM_PHOCACART_CLICK_EXPORT_BUTTON_TO_EXPORT_THEM_TO_FILE');
?></div>
<?php } ?>
<p> </p>
<form class="form-inline" id="phFormExport"
action="<?php echo $url2; ?>" method="post"
data-message="phMessageBox">
<div class="form-group">
<label for="file_import"><?php echo
JText::_('COM_PHOCACART_EXPORT'); ?>:</label>
<input class="btn btn-primary" type="submit"
name="submit" value="<?php echo
JText::_('COM_PHOCACART_EXPORT');?>">
</div>
</form>
<div class="progress progress-striped active" >
<div id="phProgressBar"
class="bar"></div>
</div>
<?php } else { ?>
<div class="import-export-desc"><?php echo
JText::_('COM_PHOCACART_THERE_ARE_NO_ITEMS_READY_TO_EXPORT');
?></div>
<?php } ?>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-6">
<?php if ((int)$this->t['countexport'] > 0) { ?>
<div class="import-export-box">
<div class="<?php echo $c2; ?>">2</div>
<h2><?php echo JText::_('COM_PHOCACART_DOWNLOAD');
?></h2>
<div class="import-export-desc"><?php echo
JText::_('COM_PHOCACART_EXPORT_FILE_IS_READY_TO_DOWNLOAD');
?><br /><?php echo
JText::_('COM_PHOCACART_CLICK_DOWNLOAD_BUTTON_TO_DOWNLOAD_FILE');
?></div>
<p> </p>
<form class="form-inline" id="phFormUpload"
action="<?php echo $url; ?>"
enctype="multipart/form-data" method="post"
data-message="phMessageBox">
<div class="form-group">
<label for="file_download"><?php echo
JText::_('COM_PHOCACART_FILE'); ?>:</label>
<input id="phSubmitDownload" class="btn
btn-primary" type="submit" name="submit"
value="<?php echo
JText::_('COM_PHOCACART_DOWNLOAD');?>">
<input type="hidden" name="task"
value="phocacartexport.download" />
<?php echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
?>
</div>
</form>
</div>
<?php } ?>
</div>
</div><?php
}
echo '</div>';// end import-export
echo $r->endMainContainer();
echo '</div>';
?>
PK�"�[�#o,,&views/phocacartexports/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[/O���$views/phocacartexports/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport('joomla.application.component.view');
class PhocaCartCpViewPhocaCartExports extends JViewLegacy
{
protected $t;
protected $r;
function display($tpl = null) {
$this->t =
PhocacartUtils::setVars('export');
$this->r = new PhocacartRenderAdminviews();
$model = $this->getModel();
$this->t['countexport'] =
$model->getItemsCountExport(); // count of products ready in export
table
$this->t['count'] =
$model->getItemsCountProduct();// count of products
$paramsC =
PhocacartUtils::getComponentParameters();
$this->t['import_export_pagination'] =
$paramsC->get('import_export_pagination', 20);
$this->t['count_pagination'] = 0;
if ($this->t['count'] > 0) {
if ((int)$this->t['import_export_pagination'] >
(int)$this->t['count'] ||
(int)$this->t['import_export_pagination'] ==
(int)$this->t['count']) {
$this->t['count_pagination'] = 1;
} else if ((int)$this->t['count'] >
(int)$this->t['import_export_pagination'] &&
(int)$this->t['import_export_pagination'] >
0) {
$this->t['count_pagination'] =
ceil((int)$this->t['count'] /
(int)$this->t['import_export_pagination']);
}
}
$media = new PhocacartRenderAdminmedia();
JHtml::stylesheet($this->t['bootstrap'] .
'css/bootstrap.glyphicons-icons-only.min.css');
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework', false);
//PhocacartRenderJs::renderOverlayOnSubmit('phFormUpload');
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once JPATH_COMPONENT . '/helpers/' .
$this->t['tasks'] . '.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']) .
'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.export'));
JToolbarHelper::title(JText::_($this->t['l'] .
'_EXPORT'), 'export');
// This button is unnecessary but it is displayed because Joomla!
design bug
$bar = JToolbar::getInstance('toolbar');
$dhtml = '<a
href="index.php?option=com_phocacart" class="btn
btn-small"><i class="icon-home-2" title="' .
JText::_('COM_PHOCACART_CONTROL_PANEL') .
'"></i> ' .
JText::_('COM_PHOCACART_CONTROL_PANEL') . '</a>';
$bar->appendButton('Custom', $dhtml);
if ($canDo->get('core.edit')) {
}
JToolbarHelper::divider();
JToolbarHelper::help('screen.' .
$this->t['c'], true);
}
protected function getSortFields() {
return array();
}
}
?>
PK�"�[�#o,,$views/phocacartextensions/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�*�9�-�-*views/phocacartextensions/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$linkIcon = '';//'<sup><span class="glyph icon
glyph icon-link"></span></sup>';
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$saveOrderingUrl = '';
if ($this->t['load_extension_list'] == 0) {
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->endFilter();
echo $r->startMainContainer();
echo '<div class="alert alert-warning">';
echo '<button type="button" class="close"
data-dismiss="alert">×</button>';
//echo '<h4
class="alert-heading">'.JText::_('COM_PHOCACART_INFO').'</h4>';
echo '<div class="alert-message">' .
JText::_('COM_PHOCACART_LOADING_OF_EXTENSION_LIST_DISABLED') .
'</div>';
echo '</div>';
echo '<div class="alert alert-info">';
echo '<button type="button" class="close"
data-dismiss="alert">×</button>';
//echo '<h4
class="alert-heading">'.JText::_('COM_PHOCACART_INFO').'</h4>';
echo '<div class="alert-message">' .
JText::_('COM_PHOCACART_DISCOVER') . ' <a
href="https://www.phoca.cz/phocacart-extensions"
target="_blank" style="text-decoration:
underline">' .
JText::_('COM_PHOCACART_PHOCA_CART_EXTENSIONS') .
'</a> ' . $linkIcon . '</div>';
echo '</div>';
/* echo $r->startFilterBar();
echo $r->startFilterBar(2);
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo $r->endMainContainer();
echo $r->endForm();
} else {
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = false;
/*if ($this->t['ordering'] &&
!empty($this->ordering)) {
$saveOrder = $listOrder == 'pc.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
}*/
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo
$r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocacartCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
echo '<div class="alert alert-info">';
echo '<button type="button" class="close"
data-dismiss="alert">×</button>';
//echo '<h4
class="alert-heading">'.JText::_('COM_PHOCACART_INFO').'</h4>';
echo '<div class="alert-message">' .
JText::_('COM_PHOCACART_DISCOVER') . ' <a
href="https://www.phoca.cz/phocacart-extensions"
target="_blank" style="text-decoration:
underline">' .
JText::_('COM_PHOCACART_PHOCA_CART_EXTENSIONS') .
'</a> ' . $linkIcon . '</div>';
echo '</div>';
if (is_array($this->news)) {
foreach ($this->news as $n => $m) {
if (isset($m['name']) && $m['name']
!= '' && isset($m['description']) &&
$m['description'] != '') {
$mClass = isset($m['class']) ?
$this->escape(strip_tags($m['class'])) : '';
$mStyle = isset($m['style']) ?
$this->escape(strip_tags($m['style'])) : '';
$mImage = isset($m['image']) ?
$this->escape(strip_tags($m['image'])) : '';
$mImageLarge = isset($m['imagelarge']) ?
$this->escape(strip_tags($m['imagelarge'])) : '';
$mLink = isset($m['link']) ?
$this->escape(strip_tags($m['link'])) : '';
$aStart = '';
$aEnd = '';
if ($mLink != '') {
$aStart = '<a href="' . $mLink .
'" target="_blank">';
$aEnd = '</a>';
}
echo '<div class="ph-featured-box ' .
$mClass . '" style="' . $mStyle .
'">';
echo '<div
class="ph-featured-head">' . $aStart .
$this->escape(strip_tags($m['name'])) . $aEnd .
'</div>';
echo '<div
class="ph-featured-image-large">' . $aStart .
'<img src="' . $mImageLarge . '"
alt="" />' . $aEnd . '</div>';
echo '<div
class="ph-featured-description">';
if ($mImage != '') {
echo '<div
class="ph-featured-image">' . $aStart . '<img
src="' . $mImage . '" alt="" />' .
$aEnd . '</div>';
}
echo $aStart .
$this->escape(strip_tags($m['description'])) . $aEnd;
echo '<div
class="ph-cb"></div>';
echo '</div>';
echo '</div>';
}
}
}
/* echo $r->startFilterBar();
echo $r->startFilterBar(2);
echo
$r->selectFilterCategory(PhocacartUtilsSettings::getExtenstionsArray($this->t['o']),
'', $this->state->get('filter.category_id'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
$filters = $this->filterForm->getGroup('filter');
if ($filters) {
echo '<div class="js-stools
ph-pull-right">';
foreach ($filters as $fieldName => $field) {
echo '<div
class="js-stools-field-filter">';
echo $field->input;
echo '</div >';
}
echo '</div>';
}
echo $r->startTable('extensionList');
echo $r->startTblHeader();
echo '<th class="ph-image">' .
JText::_($this->t['l'] . '_IMAGE') .
'</th>' . "\n";
echo '<th class="ph-title-small">' .
JText::_($this->t['l'] . '_NAME') .
'</th>' . "\n";
echo '<th class="ph-description">' .
JTEXT::_($this->t['l'] . '_DESCRIPTION') .
'</th>' . "\n";
echo '<th class="ph-version">' .
JText::_($this->t['l'] . '_VERSION') .
'</th>' . "\n";
echo '<th class="ph-developer">' .
JTEXT::_($this->t['l'] . '_DEVELOPER') .
'</th>' . "\n";
echo '<th class="ph-type">' .
JTEXT::_($this->t['l'] . '_TYPE') .
'</th>' . "\n";
echo '<th class="ph-action">' .
JTEXT::_($this->t['l'] . '_ACTION') .
'</th>' . "\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
$price = new PhocacartPrice();
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
$j++;
/*
$urlEdit =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
$urlTask =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'];
//$orderkey = array_search($item->id,
$this->ordering[$item->catid]);
$orderkey = 0;
if ($this->t['ordering'] &&
!empty($this->ordering)) {
$orderkey = array_search($item->id,
$this->ordering[$this->t['catid']]);
}
$ordering = ($listOrder == 'pc.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit. $item->id );
//$linkCat = JRoute::_(
'index.php?option='.$this->t['o'].'&task='.$this->t['c'].'category.edit&id='.(int)
$item->category_id );
$canEditCat = $user->authorise('core.edit',
$this->t['o']);*/
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') || $item->checked_out ==
$user->get('id') || $item->checked_out == 0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$element = isset($item['element']) ?
$item['element'] : '';
$type = isset($item['type']) ?
$item['type'] : '';
$folder = isset($item['folder']) ?
$item['folder'] : '';
$version = isset($item['version']) ?
$item['version'] : '';
$extension = array();
$extension['installed'] = false;
$extension['enabled'] = false;
$extension['version'] = $version;
$extension['versioncurrent'] = null;
PhocacartUtilsExtension::getExtensionLoadInfo($extension,
$element, $type, $folder);
$trClass = '';
if (isset($item['featured']) &&
$item['featured'] == 1) {
$trClass = 'ph-featured';
}
$iD = $i % 2;
echo "\n\n";
echo '<tr class="row' . $iD . ' ' .
$trClass . '" sortable-group-id="0">' .
"\n";
$image = isset($item['image']) ?
$item['image'] : '';
if ($image != '') {
$image = '<img src="' .
$this->escape($image) . '" alt="" style="width:
48px;height: 48px" />';
}
echo $r->td($image, "small");
$name = isset($item['name']) ?
$item['name'] : '';
$linkName = isset($item['link']) ?
$item['link'] : '';
if ($name != '' && $linkName != '')
{
$name = '<a href="' .
$this->escape($linkName) . '"
target="_blank">' . $name . '</a> ' .
$linkIcon;
}
echo $r->td($name, "small");
$description = isset($item['description']) ?
$item['description'] : '';
echo $r->td($description);
$versionCurrent = $extension['versioncurrent'] ?
$extension['versioncurrent'] : $extension['version'];
echo $r->td($versionCurrent);
$developer = isset($item['developer']) ?
$item['developer'] : '';
$linkDeveloper = isset($item['developerlink']) ?
$item['developerlink'] : '';
if ($developer != '' && $linkDeveloper !=
'') {
$developer = '<a href="' .
$this->escape($linkDeveloper) . '"
target="_blank">' . $developer . '</a> '
. $linkIcon;
}
echo $r->td($developer, "small");
$obtainType = isset($item['obtaintype']) ?
$item['obtaintype'] : '';
echo
$r->td(PhocacartUtilsSettings::getExtensionsJSONObtainTypeText($obtainType));
// ACTION
if ($canCreate && $canChange && $canEdit) {
$download = isset($item['download']) ?
$item['download'] : '';
echo
$r->td(PhocacartUtilsExtension::getExtensionsObtainTypeButton($obtainType,
$download, $extension));
}
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot('', 7);//
echo $r->endTable();
echo '<input type="hidden" name="type"
value="' .
$this->state->get('filter.category_id') . '"
/>' . "\n";
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
}
?>
PK�"�[�#o,,)views/phocacartextensions/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�|I1��'views/phocacartextensions/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport('joomla.application.component.view');
class PhocaCartCpViewPhocacartExtensions extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
protected $d;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$document = JFactory::getDocument();
$this->t = PhocacartUtils::setVars('extension');
$this->r = new PhocacartRenderAdminviews();
$paramsC =
PhocacartUtils::getComponentParameters();
$this->t['load_extension_list'] =
$paramsC->get('load_extension_list', 1);
if ($this->t['load_extension_list'] == 1) {
$this->items = $this->get('Items');
$this->news = $this->get('News');
$this->state = $this->get('State');
$this->filterForm =
$this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once JPATH_COMPONENT . '/helpers/' .
$this->t['tasks'] . '.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']) .
'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.extension_id'));
JToolbarHelper::title(JText::_($this->t['l'] .
'_EXTENSIONS'), 'th-large');
// This button is unnecessary but it is displayed because Joomla!
design bug
$bar = JToolbar::getInstance('toolbar');
$dhtml = '<a
href="index.php?option=com_phocacart" class="btn
btn-small"><i class="icon-home-2" title="' .
JText::_('COM_PHOCACART_CONTROL_PANEL') .
'"></i> ' .
JText::_('COM_PHOCACART_CONTROL_PANEL') . '</a>';
$bar->appendButton('Custom', $dhtml);
if ($this->t['load_extension_list'] == 1) {
JToolbarHelper::custom($this->t['task'] .
'.refresh', 'refresh.png', 'refresh.png',
'COM_PHOCACART_REFRESH', false);
}
/*
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartlogs.delete',
$this->t['l'].'_DELETE');
}*/
JToolbarHelper::divider();
JToolbarHelper::help('screen.' .
$this->t['c'], true);
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.published' =>
JText::_($this->t['l'] . '_PUBLISHED'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,views/phocacartfeed/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[J��}}!views/phocacartfeed/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'product' =>
JText::_($this->t['l'].'_PRODUCT_OPTIONS'),
'feed' =>
JText::_($this->t['l'].'_FEED_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('title', 'alias',
'header', 'footer', 'root', 'item',
'feed_plugin');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('product', $tabs['product']);
$fieldSets = $this->form->getFieldsets('item_params');
foreach ($fieldSets as $name => $fieldSet) {
foreach ($this->form->getFieldset($name) as $field) {
echo $r->itemLabel($field->input, $field->label);
}
}
echo $r->endTab();
echo $r->startTab('feed', $tabs['feed']);
$fieldSets = $this->form->getFieldsets('feed_params');
foreach ($fieldSets as $name => $fieldSet) {
foreach ($this->form->getFieldset($name) as $field) {
echo $r->itemLabel($field->input, $field->label);
}
}
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2">';
if (isset($this->item->id) && (int)$this->item->id >
0 && isset($this->item->alias) &&
$this->item->alias != '') {
/* phocacart import('phocacart.path.route'); */
$xmlLink = PhocacartRoute::getFeedRoute((int)$this->item->id,
$this->item->alias);
$xmlLink2 = PhocacartRoute::getFeedRoute((int)$this->item->id,
$this->item->alias, 1);
$app = JApplicationCms::getInstance('site');
$router = $app->getRouter();
$uri = $router->build($xmlLink);
$frontendUrl = str_replace(JURI::root(true).'/administrator/',
'',$uri->toString());
$frontendUrl = str_replace(JURI::root(true), '',
$frontendUrl);
$frontendUrl = str_replace('\\', '/',
$frontendUrl);
//$frontendUrl = JURI::root(false). str_replace('//',
'/', $frontendUrl);
$frontendUrl = preg_replace('/([^:])(\/{2,})/',
'$1/', JURI::root(false). $frontendUrl);
$frontendUrl2 = JURI::root(false).
str_replace(JURI::root(true).'/administrator/',
'',$xmlLink2);
echo
'<div>'.JText::_('COM_PHOCACART_XML_FEED_URL').'</div>';
echo '<textarea
rows="5">'.$frontendUrl.'</textarea>';
echo
'<div><small>('.JText::_('COM_PHOCACART_URL_FORMAT_DEPENDS_ON_SEF').')</small></div>';
echo '<div> </div>';
echo
'<div>'.JText::_('COM_PHOCACART_XML_FEED_URL_NO_SEF').'</div>';
echo '<textarea
rows="5">'.$frontendUrl2.'</textarea>';
}
echo '</div>';//end span2
echo $r->formInputs();
echo $r->endForm();
?>
PK�"�[�#o,,#views/phocacartfeed/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[������!views/phocacartfeed/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartFeed extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $attributeoption;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('feed');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.feed_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_XML_FEED' ).': <small><small>[ ' .
$text.' ]</small></small>' , 'bullhorn');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,views/phocacartfeeds/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�Lh��%views/phocacartfeeds/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th class="ph-title-short">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_TITLE', 'a.title',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-published">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_PUBLISHED',
'a.published', $listDirn, $listOrder) . '</th>' .
"\n";
echo '<th class="ph-id">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_ID', 'a.id', $listDirn,
$listOrder) . '</th>' . "\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart &&
$j < (int)$this->pagination->limit) {
$j++;
$urlEdit = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'] . '.edit&id=';
$urlTask = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') || $item->checked_out ==
$user->get('id') || $item->checked_out == 0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_($urlEdit . $item->id);
echo $r->startTr($i, isset($item->catid) ?
(int)$item->catid : 0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .=
Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'] . '.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="' . JRoute::_($linkEdit)
. '">' . $this->escape($item->title) .
'</a>';
} else {
$checkO .= $this->escape($item->title);
}
echo $r->td($checkO, "small");
echo
$r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'] . '.',
$canChange), "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 5);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,$views/phocacartfeeds/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[m��
z
z
"views/phocacartfeeds/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartFeeds extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('feed');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.feed_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_XML_FEEDS' ), 'bullhorn'
);
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartfeeds.delete',
$this->t['l'].'_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,#views/phocacartformfield/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[9v�H &views/phocacartformfield/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
echo $r->item($this->form, 'title');
echo $r->item($this->form, 'label',
'<small>('.JText::_($this->form->getValue('label')).')</small>',
1);
echo $r->item($this->form, 'description',
'<small>('.JText::_($this->form->getValue('description')).')</small>',
1);
$formArray = array ('type', 'predefined_values',
'predefined_values_first_option', 'default',
'class', 'required', 'read_only',
'pattern', 'maxlength', /*'additional',*/
'validate', 'unique', 'ordering',
'access', 'group');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs();
echo $r->endForm();
?>
PK�"�[�#o,,(views/phocacartformfield/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��� � � &views/phocacartformfield/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocaCartFormfield extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $attributeoption;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('formfield');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
if (isset($this->item->id) && (int)$this->item->id
> 0) {
$this->form->setFieldAttribute( 'title',
'readonly', 'true' );
$this->form->setFieldAttribute( 'type',
'readonly', 'true' );
}
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.formfield_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_FORM_FIELD' ).': <small><small>[ ' .
$text.' ]</small></small>' , 'list-alt');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
//JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,$views/phocacartformfields/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��O�__*views/phocacartformfields/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th
class="ph-title-small">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_NAME', 'a.title',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-published">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PUBLISHED',
'a.published', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-required">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_REQUIRED', 'a.required',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-label">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_LABEL', 'a.label',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-type">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TYPE', 'a.type',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th class="ph-type
ph-center">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_DEFAULT',
'a.type_default', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-published">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_FORM_DISPLAY_BILLING',
'a.display_billing', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-published">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_FORM_DISPLAY_SHIPPING',
'a.display_shipping', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-published">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_FORM_DISPLAY_ACCOUNT',
'a.display_account', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-access">'.JTEXT::_($this->t['l'].'_ACCESS').'</th>'."\n";
echo '<th
class="ph-id">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ID', 'a.id', $listDirn,
$listOrder ).'</th>'."\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart && $j
< (int)$this->pagination->limit) {
$j++;
$urlEdit =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
$urlTask =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit. $item->id );
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid :
0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'.
$this->escape($item->title).'</a>';
} else {
$checkO .= $this->escape($item->title);
}
echo $r->td($checkO, "small");
echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'].'.',
$canChange), "small");
echo $r->td(PhocacartHtmlJgrid::displayRequired( $item->required, $i,
$this->t['tasks'].'.', $canChange),
"small");
echo $r->td($item->label . '<br
/><small>('.JText::_($this->escape($item->label)).')</small>',
"small");
echo $r->td($item->type, "small");
if ($item->type_default == 1) {
$default = '<a
data-original-title="'.JText::_('COM_PHOCACART_DEFAULT').'"
class="btn btn-micro disabled jgrid hasTooltip"
title="'.JText::_('COM_PHOCACART_DEFAULT').'"><i
class="icon-featured"></i></a>';
echo $r->td($default, "small ph-center");
} else {
echo $r->td('', "small");
}
echo $r->td(PhocacartHtmlJgrid::displayBilling(
$item->display_billing, $i,
$this->t['tasks'].'.', $canChange),
"small");
echo $r->td(PhocacartHtmlJgrid::displayShipping(
$item->display_shipping, $i,
$this->t['tasks'].'.', $canChange),
"small");
echo $r->td(PhocacartHtmlJgrid::displayAccount(
$item->display_account, $i,
$this->t['tasks'].'.', $canChange),
"small");
echo $r->td($this->escape($item->access_level));
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 13);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,)views/phocacartformfields/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�L��tt'views/phocacartformfields/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport('joomla.application.component.view');
class PhocaCartCpViewPhocaCartFormfields extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t =
PhocacartUtils::setVars('formfield');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once JPATH_COMPONENT . '/helpers/' .
$this->t['tasks'] . '.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']) .
'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.formfield_id'));
JToolbarHelper::title(JText::_($this->t['l'] .
'_FORM_FIELDS'), 'list-alt');
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'] .
'.add', 'JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'] .
'.edit', 'JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'] .
'.publish', 'publish.png', 'publish_f2.png',
'JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'] .
'.unpublish', 'unpublish.png',
'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList($this->t['l'] .
'_WARNING_DELETE_ITEMS_MAY_MEAN_DELETING_USER_DATA',
'phocacartformfields.delete', $this->t['l'] .
'_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help('screen.' .
$this->t['c'], true);
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_NAME'),
'a.label' => JText::_($this->t['l'] .
'_LABEL'),
'a.type' => JText::_($this->t['l'] .
'_TYPE'),
'a.type_default' =>
JText::_($this->t['l'] . '_DEFAULT'),
'a.display_billing' =>
JText::_($this->t['l'] . '_FORM_DISPLAY_BILLING'),
'a.display_shipping' =>
JText::_($this->t['l'] . '_FORM_DISPLAY_SHIPPING'),
'a.display_account' =>
JText::_($this->t['l'] . '_FORM_DISPLAY_ACCOUNT'),
'a.published' =>
JText::_($this->t['l'] . '_PUBLISHED'),
'a.required' =>
JText::_($this->t['l'] . '_REQUIRED'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,views/phocacartgroup/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�Q�3U U "views/phocacartgroup/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'rules' =>
JText::_($this->t['l'].'_RULES'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$translatedTitle = $this->form->getValue('title') ?
'<small>('.JText::_($this->form->getValue('title')).')</small>'
: '';
echo $r->item($this->form, 'title', $translatedTitle, 1);
$formArray = array ('display_price',
'display_addtocart', 'display_attributes');
echo $r->group($this->form, $formArray);
$formArray = array('description');
echo $r->group($this->form, $formArray, 1);
echo $r->endTab();
echo $r->startTab('rules', $tabs['rules']);
$formArray = array ('minimum_sum');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2">';
echo '</div>';//end span2
echo $r->formInputs($this->t['task']);
echo $r->endForm();
?>
PK�"�[�#o,,$views/phocacartgroup/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[l�h h "views/phocacartgroup/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartGroup extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $attributeoption;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('group');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
if (isset($this->item->type) &&
(int)$this->item->type == 1) {
$this->form->setFieldAttribute( 'minimum_sum',
'readonly', 'true' );
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.group_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_CUSTOMER_GROUP' ).': <small><small>[ ' .
$text.' ]</small></small>' ,
'credit-card');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,
views/phocacartgroups/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[:�f
ii&views/phocacartgroups/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo $r->inputFilterSearch($this->t['l'] .
'_FILTER_SEARCH_LABEL', $this->t['l'] .
'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('groupList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th class="ph-title">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_TITLE', 'a.title',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-published">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_PUBLISHED',
'a.published', $listDirn, $listOrder) . '</th>' .
"\n";
echo '<th class="ph-min-purchase">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_MINIMAL_SUM_OF_PURCHASES',
'a.minimum_sum', $listDirn, $listOrder) . '</th>'
. "\n";
echo '<th class="ph-default">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_DEFAULT', 'a.type',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-id">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_ID', 'a.id', $listDirn,
$listOrder) . '</th>' . "\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart &&
$j < (int)$this->pagination->limit) {
$j++;
$urlEdit = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'] . '.edit&id=';
$urlTask = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') || $item->checked_out ==
$user->get('id') || $item->checked_out == 0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_($urlEdit . $item->id);
echo $r->startTr($i, isset($item->catid) ?
(int)$item->catid : 0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .=
Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'] . '.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="' . JRoute::_($linkEdit)
. '">' . $this->escape(JText::_($item->title)) .
'</a>' . ' <small>(' .
$this->escape($item->title) . ')</small>';
} else {
$checkO .= $this->escape(JText::_($item->title)) . '
<small>(' . $this->escape($item->title) .
')</small>';
}
echo $r->td($checkO, "small");
echo
$r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'] . '.',
$canChange), "small");
echo $r->td(PhocacartPrice::cleanPrice($item->minimum_sum),
"small");
if ($item->type == 1) {
$default = '<a data-original-title="' .
JText::_('COM_PHOCACART_DEFAULT') . '" class="btn
btn-micro disabled jgrid hasTooltip" title="' .
JText::_('COM_PHOCACART_DEFAULT') . '"><i
class="icon-featured"></i></a>';
echo $r->td($default, "small ph-center");
} else {
echo $r->td('', "small");
}
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 7);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,%views/phocacartgroups/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[H���BB#views/phocacartgroups/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartGroups extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('group');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.group_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_CUSTOMER_GROUPS' ), 'user'
);
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartgroups.delete',
$this->t['l'].'_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.minimum_sum' => JText::_($this->t['l'].
'_MINIMAL_SUM_OF_PURCHASES'),
'a.type' => JText::_($this->t['l'].
'_DEFAULT'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,views/phocacarthits/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��Uk��$views/phocacarthits/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = false;
$saveOrderingUrl = '';
$sortFields = $this->getSortFields();
//echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocacartCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocacartCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder, 'a', true);
echo $r->secondColumnHeader($listDirn, $listOrder, 'a',
true);
echo '<th class="ph-product">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_PRODUCT',
'a.product_id', $listDirn, $listOrder) . '</th>'
. "\n";
echo '<th class="ph-item">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_ITEM', 'a.item',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-user">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_USER', 'a.user_id',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-ip">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_IP', 'a.ip', $listDirn,
$listOrder) . '</th>' . "\n";
echo '<th class="ph-date">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_DATE', 'a.date',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-hits">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_HITS', 'a.hits',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-type">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_TYPE', 'a.type',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-id">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_ID', 'a.id', $listDirn,
$listOrder) . '</th>' . "\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
$price = new PhocacartPrice();
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart &&
$j < (int)$this->pagination->limit) {
$j++;
$urlEdit = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'] . '.edit&id=';
$urlTask = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'];
//$orderkey = array_search($item->id,
$this->ordering[$item->catid]);
/*$orderkey = 0;
if ($this->t['ordering'] &&
!empty($this->ordering)) {
$orderkey = array_search($item->id,
$this->ordering[$this->t['catid']]);
}
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit. $item->id );
//$linkCat = JRoute::_(
'index.php?option='.$this->t['o'].'&task='.$this->t['c'].'category.edit&id='.(int)
$item->category_id );
$canEditCat = $user->authorise('core.edit',
$this->t['o']);*/
$this->t['ordering'] = 0;
$item->ordering = 0;
$orderkey = 0;
$canChange = 0;
echo $r->startTr($i, isset($item->catid) ?
(int)$item->catid : 0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->td($this->escape($item->product_title),
"small");
echo $r->td($this->escape($item->item),
"small");
// Name
$nameSuffix = '';
if (isset($item->user_username) &&
$item->user_username != '') {
$nameSuffix = ' <small>(' .
$this->escape($item->user_username) . ')</small>';
}
echo $r->td($this->escape($item->user_name) . $nameSuffix,
"small");
echo $r->td($this->escape($item->ip), "small");
echo $r->td($item->date, "small");
echo $r->td($item->hits, "small");
$typeTxt =
PhocacartUtilsSettings::getAdditionalHitsType($item->type);
echo $r->td($typeTxt, "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 16);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,#views/phocacarthits/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�?�E��!views/phocacarthits/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport('joomla.application.component.view');
class PhocaCartCpViewPhocaCartHits extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('hit');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once JPATH_COMPONENT . '/helpers/' .
$this->t['tasks'] . '.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']) .
'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.hit_id'));
$user = JFactory::getUser();
$bar = JToolbar::getInstance('toolbar');
JToolbarHelper::title(JText::_($this->t['l'] .
'_HITS'), 'equalizer');
/*if ($canDo->get('core.create')) {
JToolbarHelper::addNew(
$this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.featured',
'featured.png', 'featured_f2.png',
'JFEATURED', true);
}*/
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(JText::_($this->t['l']
. '_WARNING_DELETE_ITEMS'), $this->t['tasks'] .
'.delete', $this->t['l'] . '_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help('screen.' .
$this->t['c'], true);
}
protected function getSortFields() {
return array(
//'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.product_id' =>
JText::_($this->t['l'] . '_PRODUCT'),
'a.item' => JText::_($this->t['l'] .
'_ITEM'),
'a.user_id' => JText::_($this->t['l']
. '_USER'),
'a.ip' => JText::_($this->t['l'] .
'_IP'),
'a.date' => JText::_($this->t['l'] .
'_DATE'),
'a.hits' => JText::_($this->t['l'] .
'_HITS'),
'a.type' => JText::_($this->t['l'] .
'_TYPE'),
'a.id' => JText::_($this->t['l'] .
'_ID'),
);
}
}
?>
PK�"�[�#o,,
views/phocacartimagea/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�bl�WW&views/phocacartimagea/tmpl/default.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
?>PK�"�[�#o,,%views/phocacartimagea/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��RHW$W$#views/phocacartimagea/view.json.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
class PhocaCartCpViewPhocaCartImageA extends JViewLegacy
{
function display($tpl = null){
if (!JSession::checkToken('request')) {
$response = array(
'status' => '0',
'error' => '<span class="ph-result-txt
ph-error-txt">' . JText::_('JINVALID_TOKEN') .
'</span>');
echo json_encode($response);
return;
}
$pC = PhocacartUtils::getComponentParameters();
$width = $pC->get( 'copypaste_width', 0 );// 448;
$height = $pC->get( 'copypaste_height', 0 );// 338;
$copypaste_overwrite_file = $pC->get(
'copypaste_overwrite_file', 1 );
$copypaste_enable = $pC->get( 'copypaste_enable', 0 );
$copypaste_folder_creation = $pC->get(
'copypaste_folder_creation', 0 );
$copypaste_folder = $pC->get( 'copypaste_folder',
'' );
$copypaste_folder = PhocacartText::filterValue($copypaste_folder,
'folder');
$app = JFactory::getApplication();
$title = $app->input->get( 'imagetitle', '',
'string' );
$format = $app->input->get( 'imageformat',
'', 'string' );
$image = $app->input->get( 'image', '',
'base64' );
$sE = '<span class="ph-result-txt
ph-error-txt">';
$eE = '</span>';
$sM = '<span class="ph-result-txt
ph-success-txt">';
$eM = '</span>';
if ($copypaste_enable == 0) {
$response = array('status' => '0',
'error' => $sE .
JText::_('COM_PHOCACART_ERROR_COPY_PASTE_IMAGES_FUNCTION_DISABLED')
. $eE);
echo json_encode($response);
return;
}
$image = base64_decode($image);
if ($image == '') {
$response = array('status' => '0',
'error' => $sE .
JText::_('COM_PHOCACART_ERROR_NO_IMAGE_PASTED') . $eE);
echo json_encode($response);
return;
}
$path = PhocacartPath::getPath('productimage');
$imgFormat = 'png';
if (strpos($format, 'image/jpg') !== false || strpos($format,
'image/jpeg') !== false) {
$imgFormat = 'jpg';
} else if (strpos($format, 'image/webp') !== false) {
$imgFormat = 'webp';
}
$imgName = strtolower(trim(PhocacartText::filterValue($title,
'alphanumeric'))). '.'.$imgFormat;
if ($copypaste_folder_creation == 0) {
$folder = '';
} else if ($copypaste_folder_creation == 1 ) {
$folder = $copypaste_folder;
if ($folder != '') {
if
(!Joomla\CMS\Filesystem\Folder::exists($path['orig_abs_ds'] .
$folder)){
if
(!Joomla\CMS\Filesystem\Folder::create($path['orig_abs_ds'] .
$folder)){
$response = array('status' => '0',
'error' => $sE .
JText::_('COM_PHOCACART_ERROR_WRITING_FOLDER') . $eE);
echo json_encode($response);
return;
}
}
$folder = $folder . '/';
}
} else if ($copypaste_folder_creation == 2) {
$folder = substr($imgName, 0, 1);
if ($folder != '') {
if
(!Joomla\CMS\Filesystem\Folder::exists($path['orig_abs_ds'] .
$folder)) {
if
(!Joomla\CMS\Filesystem\Folder::create($path['orig_abs_ds'] .
$folder)) {
$response = array('status' => '0',
'error' => $sE .
JText::_('COM_PHOCACART_ERROR_WRITING_FOLDER') . $eE);
echo json_encode($response);
return;
}
}
$folder = $folder . '/';
}
}
$pathImageName = $path['orig_abs_ds'] . $folder .$imgName;
if (Joomla\CMS\Filesystem\File::exists($pathImageName) &&
$copypaste_overwrite_file == 0) {
$response = array('status' => '0',
'error' => $sE .
JText::_('COM_PHOCACART_ERROR_IMAGE_ALREADY_EXITS') . $eE);
echo json_encode($response);
return;
} else {
if (Joomla\CMS\Filesystem\File::write($pathImageName, $image)) {
if (Joomla\CMS\Filesystem\File::exists($pathImageName)) {
list($w, $h, $type) = GetImageSize($pathImageName);
$width = $width == 0 ? $w : $width;
$height = $height == 0 ? $h : $height;
$scale = (($width / $w) > ($height / $h)) ? ($width / $w) :
($height / $h); // greater rate
$newW = $width/$scale; // check the size of in file
$newH = $height/$scale;
$fileIn = $pathImageName;
$fileOut= $pathImageName;
// which side is larger (rounding error)
if (($w - $newW) > ($h - $newH)) {
$src = array(floor(($w - $newW)/2), 0, floor($newW), $h);
} else {
//$src = array(0, floor(($h - $newH)/2), $w, floor($newH));
$src = array(0, 0, $w, floor($newH));// go from top
}
$dst = array(0,0, floor($width), floor($height));
switch($type) {
case IMAGETYPE_JPEG:
if (!function_exists('ImageCreateFromJPEG')) {
$response = array('status' => '0',
'error' => $sE . JText::_('COM_PHOCACART_ERROR') .
': ErrorNoJPGFunction' . $eE);
echo json_encode($response);
return;
}
try {
$image1 = ImageCreateFromJPEG($fileIn);
} catch(\Exception $exception) {
$response = array('status' => '0',
'error' => $sE . JText::_('COM_PHOCACART_ERROR') .
': ErrorNoJPGFunction' . $eE);
echo json_encode($response);
return;
}
break;
case IMAGETYPE_PNG :
if (!function_exists('ImageCreateFromPNG')) {
$response = array('status' => '0',
'error' => $sE . JText::_('COM_PHOCACART_ERROR') .
': ErrorNoPNGFunction' . $eE);
echo json_encode($response);
return;
}
try {
$image1 = ImageCreateFromPNG($fileIn);
} catch(\Exception $exception) {
$response = array('status' => '0',
'error' => $sE . JText::_('COM_PHOCACART_ERROR') .
': ErrorNoPNGFunction' . $eE);
echo json_encode($response);
return;
}
break;
case IMAGETYPE_WEBP:
if (!function_exists('ImageCreateFromWEBP')) {
$response = array('status' => '0',
'error' => $sE . JText::_('COM_PHOCACART_ERROR') .
': ErrorNoWEBPFunction' . $eE);
echo json_encode($response);
return;
}
//$image1 = ImageCreateFromGIF($fileIn);
try {
$image1 = ImageCreateFromWEBP($fileIn);
} catch(\Exception $exception) {
$response = array('status' => '0',
'error' => $sE . JText::_('COM_PHOCACART_ERROR') .
': ErrorNoWEBPFunction' . $eE);
echo json_encode($response);
return;
}
break;
default:
$response = array('status' => '0',
'error' => $sE . JText::_('COM_PHOCACART_ERROR') .
': ErrorNotSupportedImage' . $eE);
echo json_encode($response);
return;
break;
}
if ($image1) {
$image2 = @ImageCreateTruecolor($dst[2], $dst[3]);
if (!$image2) {
$response = array('status' => '0',
'error' => $sE . JText::_('COM_PHOCACART_ERROR') .
': ErrorNoImageCreateTruecolor' . $eE);
echo json_encode($response);
return;
}
ImageCopyResampled($image2, $image1, $dst[0], $dst[1], $src[0],
$src[1], $dst[2], $dst[3], $src[2], $src[3]);
switch ($type) {
case IMAGETYPE_JPEG:
if (!function_exists('ImageJPEG')) {
$response = array('status' => '0',
'error' => $sE . JText::_('COM_PHOCACART_ERROR') .
': ErrorNoJPGFunction' . $eE);
echo json_encode($response);
return;
}
if (!@ImageJPEG($image2, $fileOut, 100)) {
$response = array('status' => '0',
'error' => $sE .
JText::_('COM_PHOCACART_ERROR_WRITING_IMAGE_FILE') . $eE);
echo json_encode($response);
return;
}
break;
case IMAGETYPE_PNG :
if (!function_exists('ImagePNG')) {
$response = array('status' => '0',
'error' => $sE . JText::_('COM_PHOCACART_ERROR') .
': ErrorNoPNGFunction' . $eE);
echo json_encode($response);
return;
}
if (!@ImagePNG($image2, $fileOut)) {
$response = array('status' => '0',
'error' => $sE . JText::_('COM_PHOCACART_ERROR') .
': ErrorWriteFile' . $eE);
echo json_encode($response);
return;
}
break;
case IMAGETYPE_WEBP :
if (!function_exists('ImageWEBP')) {
$response = array('status' => '0',
'error' => $sE . JText::_('COM_PHOCACART_ERROR') .
': ErrorNoWEBPFunction' . $eE);
echo json_encode($response);
return;
}
if (!@imagewebp($image2, $fileOut)) {
$response = array('status' => '0',
'error' => $sE .
JText::_('COM_PHOCACART_ERROR_WRITING_IMAGE_FILE') . $eE);
echo json_encode($response);
return;
}
break;
default:
$response = array('status' => '0',
'error' => $sE . JText::_('COM_PHOCACART_ERROR') .
': ErrorNotSupportedImage' . $eE);
echo json_encode($response);
return;
break;
}
ImageDestroy($image1);
ImageDestroy($image2);
}
}
} else {
$response = array('status' => '0',
'error' => $sE . JText::_('COM_PHOCACART_ERROR') .
': ErrorWriteFile' . $eE);
echo json_encode($response);
return;
}
$response = array(
'status' => '1',
'file' => $folder .$imgName,
'message' => $sM .
JText::_('COM_PHOCACART_SUCCESS_IMAGE_PASTED') . $eM);
echo json_encode($response);
return;
}
}
}
?>
PK�"�[�#o,,!views/phocacartimports/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�AP���'views/phocacartimports/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
echo '<div
id="'.$this->t['tasks'].'">';
//echo $r->startFilter();
//echo $r->endFilter();
echo $r->startMainContainer();
$url =
JRoute::_('index.php?option=com_phocacart&view=phocacartimports');
$c1 = $c2 = 'circle';
if ((int)$this->t['count'] > 0) {
$c1 = 'circle-active';
$url2 =
'index.php?option=com_phocacart&task=phocacartimport.import&format=json&tmpl=component&'.
JSession::getFormToken().'=1';
PhocacartRenderAdminjs::renderImportExportItems($url2,
'phMessageBox', 'phFormImport',
(int)$this->t['count_pagination'],
JText::_('COM_PHOCACART_ALL_PRODUCTS_IMPORTED'));
}
?>
<div class="import-export">
<div class="row import-export-row-message">
<div class="col-xs-12 col-sm-12 col-md-12">
<div id="phMessageBox"></div>
</div>
</div>
<div class="row import-export-row">
<div class="col-xs-12 col-sm-6 col-md-6">
<div class="import-export-box">
<div class="<?php echo $c1; ?>">1</div>
<h2><?php echo JText::_('COM_PHOCACART_UPLOAD');
?></h2>
<div class="import-export-desc"><?php echo
JText::_('COM_PHOCACART_SELECT_FILE_TO_IMPORT_ITEMS'); ?>
(CSV, XML)</div>
<p> </p>
<form class="form-inline" id="phFormUpload"
action="<?php echo $url; ?>"
enctype="multipart/form-data" method="post"
data-message="phMessageBox">
<div class="form-group">
<label for="file_upload"><?php echo
JText::_('COM_PHOCACART_FILE'); ?>:</label>
<input type="file" name="Filedata"
id="file_upload" >
<input class="btn btn-primary" type="submit"
name="submit" value="<?php echo
JText::_('COM_PHOCACART_UPLOAD');?>">
<input type="hidden" name="task"
value="phocacartimport.upload" />
<?php echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
?>
</div>
</form>
</div></div>
<div class="col-xs-12 col-sm-6 col-md-6">
<?php if ((int)$this->t['count'] > 0) { ?>
<div class="import-export-box">
<div class="<?php echo $c2; ?>">2</div>
<h2><?php echo JText::_('COM_PHOCACART_IMPORT');
?></h2>
<div class="import-export-desc"><?php echo
JText::_('COM_PHOCACART_THERE_ARE_ITEMS_READY_TO_IMPORT'); ?>:
<?php echo $this->t['count']; ?><br /><?php
echo
JText::_('COM_PHOCACART_CLICK_IMPORT_BUTTON_TO_IMPORT_THEM_TO_SHOP');
?></div>
<div class="alert alert-warning"><?php echo
JText::_('COM_PHOCACART_BE_AWARE_IMPORT_CAN_OVERWRITE_CURRENT_ITEMS_IN_SHOP');
?></div>
<p> </p>
<form class="form-inline" id="phFormImport"
action="<?php echo $url2; ?>" method="post"
data-message="phMessageBox">
<div class="form-group">
<label for="file_import"><?php echo
JText::_('COM_PHOCACART_IMPORT'); ?>:</label>
<input class="btn btn-primary" type="submit"
name="submit" value="<?php echo
JText::_('COM_PHOCACART_IMPORT');?>">
</div>
</form>
<div class="progress progress-striped active" >
<div id="phProgressBar"
class="bar"></div>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
<?php
echo $r->endMainContainer();
echo '</div>';
PK�"�[�#o,,&views/phocacartimports/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�s�V
$views/phocacartimports/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocaCartImports extends JViewLegacy
{
protected $t;
protected $r;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('import');
$this->r = new PhocacartRenderAdminviews();
$model = $this->getModel();
$this->t['count'] = $model->getItemsCountImport();
$paramsC = PhocacartUtils::getComponentParameters();
$this->t['import_export_pagination'] = $paramsC->get(
'import_export_pagination', 20 );
$this->t['count_pagination'] = 0;
if ($this->t['count'] > 0) {
if ((int)$this->t['import_export_pagination'] >
(int)$this->t['count'] ||
(int)$this->t['import_export_pagination'] ==
(int)$this->t['count']) {
$this->t['count_pagination'] = 1;
} else if ((int)$this->t['count'] >
(int)$this->t['import_export_pagination'] &&
(int)$this->t['import_export_pagination'] > 0 ) {
$this->t['count_pagination'] =
ceil((int)$this->t['count'] /
(int)$this->t['import_export_pagination']);
}
}
$media = new PhocacartRenderAdminmedia();
JHtml::stylesheet( $this->t['bootstrap'] .
'css/bootstrap.glyphicons-icons-only.min.css' );
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework', false);
PhocacartRenderAdminjs::renderOverlayOnSubmit('phFormUpload');
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.import'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_IMPORT' ), 'import' );
// This button is unnecessary but it is displayed because Joomla! design
bug
$bar = JToolbar::getInstance( 'toolbar' );
$dhtml = '<a href="index.php?option=com_phocacart"
class="btn btn-small"><i class="icon-home-2"
title="'.JText::_('COM_PHOCACART_CONTROL_PANEL').'"></i>
'.JText::_('COM_PHOCACART_CONTROL_PANEL').'</a>';
$bar->appendButton('Custom', $dhtml);
if ($canDo->get('core.edit')) {
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array();
}
}
?>
PK�"�[�#o,,views/phocacartinfo/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[2U�g$views/phocacartinfo/tmpl/default.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
echo '<form action="index.php" method="post"
name="adminForm">';
echo $r->startCp('phAdminBox', 'ph-admin-box');
echo '<div class="ph-box-info">';
echo '<div style="float:right;margin:10px;">' .
Joomla\CMS\HTML\HTMLHelper::_('image', $this->t['i']
. 'logo-phoca.png', 'Phoca.cz') .
'</div>'
. '<div class="ph-cpanel-logo-info">' .
Joomla\CMS\HTML\HTMLHelper::_('image', $this->t['i']
. 'logo-' . str_replace('phoca', 'phoca-',
$this->t['c']) . '.png', 'Phoca.cz') .
'</div>'
. '<h3>' .
JText::_($this->t['component_head']) . ' - ' .
JText::_($this->t['l'] . '_INFORMATION') .
'</h3>'
. '<div style="clear:both;"></div>';
echo '<h3>' . JText::_($this->t['l'] .
'_HELP') . '</h3>';
echo '<div>';
if (!empty($this->t['component_links'])) {
foreach ($this->t['component_links'] as $k => $v) {
echo '<div><a href="' . $v[1] .
'" target="_blank">' . $v[0] .
'</a></div>';
}
}
echo '</div>';
echo '<h3>' . JText::_($this->t['l'] .
'_VERSION') . '</h3>'
. '<p>' . $this->t['version'] .
'</p>';
echo '<h3>' . JText::_($this->t['l'] .
'_COPYRIGHT') . '</h3>'
. '<p>© 2007 - ' . date("Y") . ' Jan
Pavelka</p>'
. '<p><a href="https://www.phoca.cz/"
target="_blank">www.phoca.cz</a></p>';
echo '<h3>' . JText::_($this->t['l'] .
'_LICENSE') . '</h3>'
. '<p><a
href="http://www.gnu.org/licenses/gpl-2.0.html"
target="_blank">GPLv2</a></p>';
echo '<h3>' . JText::_($this->t['l'] .
'_TRANSLATION') . ': ' .
JText::_($this->t['l'] .
'_TRANSLATION_LANGUAGE_TAG') . '</h3>'
. '<p>© 2007 - ' . date("Y") . ' '
. JText::_($this->t['l'] . '_TRANSLATER') .
'</p>'
. '<p>' . JText::_($this->t['l'] .
'_TRANSLATION_SUPPORT_URL') . '</p>';
echo '<input type="hidden" name="task"
value="" />'
. '<input type="hidden" name="option"
value="' . $this->t['o'] . '" />'
. '<input type="hidden" name="controller"
value="' . $this->t['c'] . 'info"
/>';
echo Joomla\CMS\HTML\HTMLHelper::_('image',
$this->t['i'] . 'logo.png', 'Phoca.cz');
echo '<p> </p>';
echo '<div style="border-top:1px solid
#eee"></div><p> </p>' .
'<div class="btn-group">
<a class="btn btn-large btn-primary"
href="https://www.phoca.cz/version/index.php?' .
$this->t['c'] . '=' .
$this->t['version'] . '"
target="_blank"><i class="icon-loop
icon-white"></i> ' .
JText::_($this->t['l'] . '_CHECK_FOR_UPDATE') .
'</a></div>';
echo '<div style="margin-top:30px;height:39px;background:
url(\'' . JURI::root(true) . '/media/com_' .
$this->t['c'] . '/images/administrator/line.png\')
100% 0 no-repeat;"> </div>';
echo '</div>';
echo '</div>';
echo $r->endCp();
echo '<input type="hidden" name="option"
value="'. $this->t['c'] .'" />';
echo '<input type="hidden" name="view"
value="'. $this->t['c'] .'cp"
/>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
/*
echo '<form action="index.php" method="post"
name="adminForm" id="' . $this->t['c'] .
'info-form">';
echo '<div id="phAdminBox" class="row-fluid
ph-admin-box">';
echo '<div class="col-xs-12 col-sm-2 col-md-2
ph-admin-box-menu">' . JHtmlSidebar::render() .
'</div>';
echo '<div id="j-main-container" class="col-xs-12
col-sm-10 col-md-10 ph-admin-box-content">';
echo '<div style="float:right;margin:10px;">'
. Joomla\CMS\HTML\HTMLHelper::_('image',
$this->t['i'] . 'logo-phoca.png',
'Phoca.cz')
. '</div>'
. Joomla\CMS\HTML\HTMLHelper::_('image',
$this->t['i'] . 'logo-phoca-cart.png',
'Phoca.cz')
. '<div style="clear:both;"></div>'
. '<h3>' . JText::_($this->t['l'] .
'_PHOCA_CART') . ' - ' .
JText::_($this->t['l'] . '_INFORMATION') .
'</h3>';
echo '<h3>' . JText::_($this->t['l'] .
'_HELP') . '</h3>';
echo '<p>'
. '<a href="https://www.phoca.cz/phocacart/"
target="_blank">Phoca Cart Main Site</a><br
/>'
. '<a href="https://www.phoca.cz/documentation/"
target="_blank">Phoca Cart User Manual</a><br
/>'
. '<a href="https://www.phoca.cz/forum/"
target="_blank">Phoca Cart Forum</a><br />'
. '</p>';
echo '<h3>' . JText::_($this->t['l'] .
'_VERSION') . '</h3>'
. '<p>' . $this->t['version'] .
'</p>';
echo '<h3>' . JText::_($this->t['l'] .
'_COPYRIGHT') . '</h3>'
. '<p>© 2007 - ' . date("Y") . ' Jan
Pavelka</p>'
. '<p><a href="https://www.phoca.cz/"
target="_blank">www.phoca.cz</a></p>';
echo '<br />' .
Joomla\CMS\HTML\HTMLHelper::_('image', $this->t['i']
. 'logo.png', 'Phoca.cz') . '<br />';
echo '<h3>' . JText::_($this->t['l'] .
'_LICENSE') . '</h3>'
. '<p><a
href="http://www.gnu.org/licenses/gpl-2.0.html"
target="_blank">GPLv2</a></p>';
echo '<h3>' . JText::_($this->t['l'] .
'_TRANSLATION') . ': ' .
JText::_($this->t['l'] .
'_TRANSLATION_LANGUAGE_TAG') . '</h3>'
. '<p>© 2007 - ' . date("Y") . ' '
. JText::_($this->t['l'] . '_TRANSLATER') .
'</p>'
. '<p>' . JText::_($this->t['l'] .
'_TRANSLATION_SUPPORT_URL') . '</p>';
echo '<input type="hidden" name="task"
value="" />'
. '<input type="hidden" name="option"
value="' . $this->t['o'] . '" />'
. '<input type="hidden" name="controller"
value="' . $this->t['c'] . 'info"
/>';
echo '<p> </p>';
echo '<div style="border-top:1px solid
#eee"></div><p> </p>'
. '<div>
<a class="btn btn-large btn-primary"
href="https://www.phoca.cz/version/index.php?' .
$this->t['c'] . '=' .
$this->t['version'] . '"
target="_blank"><i class="icon-loop
icon-white"></i> ' .
JText::_($this->t['l'] . '_CHECK_FOR_UPDATE') .
'</a></div>';
echo '<div style="margin-top:30px;height:39px;background:
url(\'' . JURI::root(true) . '/media/com_' .
$this->t['c'] . '/images/administrator/line.png\')
100% 0 no-repeat;"> </div>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</form>';
*/
?>
PK�"�[�#o,,#views/phocacartinfo/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[2U�@��!views/phocacartinfo/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport('joomla.application.component.view');
class PhocaCartCpViewPhocaCartInfo extends JViewLegacy
{
protected $t;
protected $r;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars();
$this->r = new PhocacartRenderAdminview();
$media = new PhocacartRenderAdminmedia();
$this->t['version'] =
PhocacartUtils::getPhocaVersion('com_phocacart');
$this->t['component_head'] =
$this->t['l'] . '_PHOCA_CART';
$this->t['component_links'] =
$this->r->getLinks(1);
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once JPATH_COMPONENT . '/helpers/' .
$this->t['c'] . 'cp.php';
$class = $this->t['n'] . 'CpHelper';
$canDo = $class::getActions($this->t['c']);
JToolbarHelper::title(JText::_($this->t['l'] .
'_PM_INFO'), 'info-sign');
// This button is unnecessary but it is displayed because Joomla!
design bug
$bar = JToolbar::getInstance('toolbar');
$dhtml = '<a
href="index.php?option=com_phocacart" class="btn
btn-small"><i class="icon-home-2" title="' .
JText::_('COM_PHOCACART_CONTROL_PANEL') .
'"></i> ' .
JText::_('COM_PHOCACART_CONTROL_PANEL') . '</a>';
$bar->appendButton('Custom', $dhtml);
if ($canDo->get('core.admin')) {
JToolbarHelper::preferences('com_' .
$this->t['c']);
}
JToolbarHelper::divider();
JToolbarHelper::help('screen.' .
$this->t['c'], true);
}
}
?>
PK�"�[�#o,,views/phocacartitem/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�7ь66!views/phocacartitem/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
// ASSOCIATION
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
$app = JFactory::getApplication();
$input = $app->input;
$r = $this->r;
// phocacartitem-form ==> adminForm
$js = '
var phRequestActive = null;
function phCheckRequestStatus(i, task) {
i++;
if (i > 30) {
/* Stop Loop */
phRequestActive = null;
}
if (phRequestActive) {
setTimeout(function(){
phCheckRequestStatus(i, task);
}, 1000);
} else {
if (task == "' . $this->t['task'] .
'.cancel" || task == "phocacartwizard.backtowizard" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task,
document.getElementById("adminForm"));
/* Close Modal */
if (task !== "phocacartitem.apply") {
window.parent.jQuery("#phocacartitemEdit' .
$this->item->id . 'Modal").modal("hide");
}
}
else {
Joomla.renderMessages({error: ["' .
JText::_('JGLOBAL_VALIDATION_FORM_FAILED', true) .
'"]});
}
}
}
Joomla.submitbutton = function(task) {
phCheckRequestStatus(0, task);
}
';
JFactory::getDocument()->addScriptDeclaration($js);
// ASSOCIATION
$assoc = JLanguageAssociations::isEnabled();
// In case of modal
$isModal = $input->get('layout') == 'modal' ? true :
false;
$layout = $isModal ? 'modal' : 'edit';
$tmpl = $isModal || $input->get('tmpl', '',
'cmd') === 'component' ? 'component' :
'';
// Fieldsets to not automatically render by
/layouts/joomla/edit/params.php
$this->ignore_fieldsets = array('details',
'item_associations', 'jmetadata');
echo $r->startForm($this->t['o'],
$this->t['task'], (int)$this->item->id,
'adminForm', 'adminForm', '', $layout,
$tmpl);
// First Column
echo '<div class="span12 form-horizontal">';
$tabs = array();
$tabs['general'] = JText::_($this->t['l'] .
'_GENERAL_OPTIONS');
$tabs['image'] = JText::_($this->t['l'] .
'_IMAGE_OPTIONS');
$tabs['attributes'] = JText::_($this->t['l'] .
'_ATTRIBUTES');
$tabs['specifications'] = JText::_($this->t['l'] .
'_SPECIFICATIONS');
$tabs['related'] = JText::_($this->t['l'] .
'_RELATED_PRODUCTS');
$tabs['stock'] = JText::_($this->t['l'] .
'_STOCK_OPTIONS');
$tabs['discount'] = JText::_($this->t['l'] .
'_DISCOUNT_OPTIONS');
$tabs['download'] = JText::_($this->t['l'] .
'_DOWNLOAD_OPTIONS');
$tabs['size'] = JText::_($this->t['l'] .
'_SIZE_OPTIONS');
$tabs['reward'] = JText::_($this->t['l'] .
'_REWARD_POINTS');
$tabs['publishing'] = JText::_($this->t['l'] .
'_PUBLISHING_OPTIONS');
$tabs['feed'] = JText::_($this->t['l'] .
'_FEED_OPTIONS');
$tabs['metadata'] = JText::_($this->t['l'] .
'_METADATA_OPTIONS');
if (!$isModal && $assoc) {
$tabs['associations'] = JText::_($this->t['l'] .
'_ASSOCIATIONS');
}
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
// Customer Group Price
$idMd = 'phEditProductPriceGroupModal';
$textButton = 'COM_PHOCACART_CUSTOMER_GROUP_PRICES';
$w = 500;
$h = 400;
echo '<div class="ph-float-right
ph-admin-additional-box">';
if ($this->item->image != '') {
$pathImage = PhocacartPath::getPath('productimage');
$image = PhocacartImage::getThumbnailName($pathImage,
$this->item->image, 'small');
echo '<div
class="ph-admin-additional-box-img-box"><img
src="' . Juri::root() . $image->rel . '"
alt="" /></div><hr />';
}
$linkStatus = JRoute::_('index.php?option=' .
$this->t['o'] .
'&view=phocacarteditproductpricegroup&tmpl=component&id='
. (int)$this->item->id);
echo '<a href="#' . $idMd . '"
role="button" class="ph-u ' . $idMd .
'ModalButton" data-toggle="modal" title="' .
JText::_($textButton) . '" data-src="' . $linkStatus .
'" data-height="' . $h . '"
data-width="' . $w . '">' .
JText::_($textButton) . '</a>';
echo $r->modalWindowDynamic($idMd, $textButton, $w, $h, false);
// Product Price History
$idMd = 'phEditProductPriceHistoryModal';
$textButton = 'COM_PHOCACART_PRODUCT_PRICE_HISTORY';
$w = 500;
$h = 400;
$linkStatus = JRoute::_('index.php?option=' .
$this->t['o'] .
'&view=phocacarteditproductpricehistory&tmpl=component&id='
. (int)$this->item->id);
echo '<br /><a href="#' . $idMd . '"
role="button" class="ph-u ' . $idMd .
'ModalButton" data-toggle="modal" title="' .
JText::_($textButton) . '" data-src="' . $linkStatus .
'" data-height="' . $h . '"
data-width="' . $w . '">' .
JText::_($textButton) . '</a>';
echo $r->modalWindowDynamic($idMd, $textButton, $w, $h, false);
// Preview
if ((int)$this->item->id > 0) {
$catidA =
PhocacartCategoryMultiple::getCategories((int)$this->item->id, 1);
if (isset($catidA[0]) && $catidA[0] > 0) {
$idPr = 'phEditProductPreview';
$textButton = 'COM_PHOCACART_PRODUCT_PREVIEW';
$w = 500;
$h = 400;
$linkPreview =
PhocacartRoute::getItemRoute((int)$this->item->id, (int)$catidA[0],
'', '', array('pl-PL'), 1) /* .
'&tmpl=component'*/
;
$linkPreview = PhocacartPath::getRightPathLink($linkPreview);
echo '<br /><a href="#' . $idPr .
'" role="button" class="ph-u ' . $idPr .
'ModalButton" data-toggle="modal" title="' .
JText::_($textButton) . '" data-src="' . $linkPreview .
'" data-height="' . $h . '"
data-width="' . $w . '">' .
JText::_($textButton) . '</a>';
$footer = '<span
class="ph-warning-modal-window">' .
JText::_('COM_PHOCACART_YOU_ARE_PREVIEWING_LIVE_PAGE') .
'</span><button type="button" class="btn"
data-dismiss="modal" aria-hidden="true">' .
JText::_('COM_PHOCACART_CLOSE') . '</button>';
echo $r->modalWindowDynamic($idPr, $textButton, $w, $h, false,
0, '', '', $footer);
}
}
echo '</div>';
// ORDERING cannot be used
$formArray = array('title', 'alias', 'price',
'price_original', 'tax_id', 'catid_multiple',
'manufacturer_id', 'sku', 'upc',
'ean', 'jan', 'mpn', 'isbn',
'serial_number', 'registration_key',
'external_id', 'external_key',
'external_link', 'external_text',
'external_link2', 'external_text2', 'access',
'group', 'featured',
'featured_background_image', 'video',
'public_download_file', 'public_download_text',
'public_play_file', 'public_play_text',
'condition', 'type_feed',
'type_category_feed');
echo $r->group($this->form, $formArray);
$formArray = array('description');
echo $r->group($this->form, $formArray, 1);
$formArray = array('description_long');
echo $r->group($this->form, $formArray, 1);
$formArray = array('features');
echo $r->group($this->form, $formArray, 1);
//$formArray = array ('upc', 'ean', 'jan',
'mpn', 'isbn');
//echo $r->group($this->form, $formArray);
// ASSOCIATION
$this->form->setFieldAttribute('id', 'type',
'hidden');
$formArray = array('id');
echo $r->group($this->form, $formArray);
echo $r->endTab();
// IMAGES
echo $r->startTab('image', $tabs['image']);
$formArray = array('image');
echo $r->group($this->form, $formArray);
echo '<h3>' . JText::_($this->t['l'] .
'_ADDITIONAL_IMAGES') . '</h3>';
$formArray = array('additional_images');// ,
'download_hits' - it is counted in orders
echo $r->group($this->form, $formArray);
echo $r->endTab();
// ATTRIBUTES, OPTIONS
/*
$pathAttributes = PhocacartPath::getPath('attributefile');
$w = 700;
$h = 400;
$urlO =
'index.php?option=com_phocacart&view=phocacartmanager&tmpl=component&manager=productimage&field=jform_optionimage';
$urlO2 =
'index.php?option=com_phocacart&view=phocacartmanager&tmpl=component&manager=productimage&field=jform_optionimage_medium';
$urlO3 =
'index.php?option=com_phocacart&view=phocacartmanager&tmpl=component&manager=productimage&field=jform_optionimage_small';
$urlO4 =
'index.php?option=com_phocacart&view=phocacartmanager&tmpl=component&manager=attributefile&field=jform_optiondownload_file';
*/
echo $r->startTab('attributes',
$tabs['attributes']);
echo '<h3>' . JText::_($this->t['l'] .
'_ATTRIBUTES') . '</h3>';
$formArray = array('attributes');
echo $r->group($this->form, $formArray);
echo $r->endTab();
// SPECIFICATIONS
/*$w = 700;
$h = 400;
$urlO =
'index.php?option=com_phocacart&view=phocacartmanager&tmpl=component&manager=productimage&field=jform_specimage';
$urlO2 =
'index.php?option=com_phocacart&view=phocacartmanager&tmpl=component&manager=productimage&field=jform_specimage_medium';
$urlO3 =
'index.php?option=com_phocacart&view=phocacartmanager&tmpl=component&manager=productimage&field=jform_specimage_small';
*/
echo $r->startTab('specifications',
$tabs['specifications']);
echo '<h3>' . JText::_($this->t['l'] .
'_SPECIFICATIONS') . '</h3>';
$formArray = array('specifications');
echo $r->group($this->form, $formArray);
echo $r->endTab();
// RELATED
echo $r->startTab('related', $tabs['related']);
$formArray = array('related');
echo $r->group($this->form, $formArray);
echo $r->endTab();
// STOCK
echo $r->startTab('stock', $tabs['stock']);
$idMd = 'phEditStockAdvancedModal';
$textButton = 'COM_PHOCACART_ADVANCED_STOCK_OPTIONS';
$w = 500;
$h = 400;
$linkStatus = JRoute::_('index.php?option=' .
$this->t['o'] .
'&view=phocacarteditstockadvanced&tmpl=component&id='
. (int)$this->item->id);
echo '<div class="ph-float-right
ph-admin-additional-box"><a href="#' . $idMd .
'" role="button" class="ph-u ' . $idMd .
'ModalButton" data-toggle="modal" title="' .
JText::_($textButton) . '" data-src="' . $linkStatus .
'" data-height="' . $h . '"
data-width="' . $w . '">' .
JText::_($textButton) . '</a>';
echo $r->modalWindowDynamic($idMd, $textButton, $w, $h, false);
echo '</div>';
$formArray = array('stock', 'stock_calculation',
'min_quantity', 'min_multiple_quantity',
'min_quantity_calculation', 'stockstatus_a_id',
'stockstatus_n_id', 'delivery_date');
echo $r->group($this->form, $formArray);
echo $r->endTab();
// PRODUCT DISCOUNTS
echo $r->startTab('discount', $tabs['discount']);
echo '<h3>' . JText::_($this->t['l'] .
'_PRODUCT_DISCOUNT') . '</h3>';
$formArray = array('discounts');
echo $r->group($this->form, $formArray);
echo $r->endTab();
// DOWNLOAD
echo $r->startTab('download', $tabs['download']);
$formArray = array('download_folder', 'download_token',
'download_file', 'download_days');// ,
'download_hits' - it is counted in orders
echo $r->group($this->form, $formArray);
echo '<h3>' . JText::_($this->t['l'] .
'_ADDITIONAL_DOWNLOAD_FILES') . '</h3>';
$formArray = array('additional_download_files');// ,
'download_hits' - it is counted in orders
echo $r->group($this->form, $formArray);
echo $r->endTab();
// SIZE
echo $r->startTab('size', $tabs['size']);
$formArray = array('length', 'width',
'height', 'weight', 'volume',
'unit_amount', 'unit_unit',);
echo $r->group($this->form, $formArray);
echo $r->endTab();
// REWARD POINTS
echo $r->startTab('reward', $tabs['reward']);
$idMd = 'phEditProductPointGroupModal';
$textButton = 'COM_PHOCACART_CUSTOMER_GROUP_RECEIVED_POINTS';
$w = 500;
$h = 400;
$linkStatus = JRoute::_('index.php?option=' .
$this->t['o'] .
'&view=phocacarteditproductpointgroup&tmpl=component&id='
. (int)$this->item->id);
echo '<div class="ph-float-right
ph-admin-additional-box"><a href="#' . $idMd .
'" role="button" class="ph-u ' . $idMd .
'ModalButton" data-toggle="modal" title="' .
JText::_($textButton) . '" data-src="' . $linkStatus .
'" data-height="' . $h . '"
data-width="' . $w . '">' .
JText::_($textButton) . '</a>';
echo $r->modalWindowDynamic($idMd, $textButton, $w, $h, false);
echo '</div>';
$formArray = array('points_needed',
'points_received');
echo $r->group($this->form, $formArray);
echo $r->endTab();
// PUBLISHING
echo $r->startTab('publishing',
$tabs['publishing']);
foreach ($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div class="control-label">' .
$field->label . '</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $this->loadTemplate('parameter');
echo $r->endTab();
// FEED
echo $r->startTab('feed', $tabs['feed']);
echo $this->loadTemplate('feed');
echo $r->endTab();
// METADATA
echo $r->startTab('metadata', $tabs['metadata']);
echo $this->loadTemplate('metadata');
echo $r->endTab();
// ASSOCIATION
$assoc = JLanguageAssociations::isEnabled();
if (!$isModal && $assoc) {
echo $r->startTab('associations',
$tabs['associations']);
echo $this->loadTemplate('associations');
echo $r->endTab();
} else if ($isModal && $assoc) {
echo '<div class="hidden">' .
$this->loadTemplate('associations') .
'</div>';
}
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
//echo '<div class="col-xs-12 col-sm-2
col-md-2">';
//echo '</div>';//end span2
echo $r->formInputs($this->t['task']);
if ($forcedLanguage =
JFactory::getApplication()->input->get('forcedLanguage',
'', 'CMD')) {
echo '<input type="hidden"
name="forcedLanguage" value="' . $forcedLanguage .
'" />';
}
echo $r->endForm();
?>
PK�"�[�!���.views/phocacartitem/tmpl/edit_associations.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
echo JLayoutHelper::render('joomla.edit.associations',
$this);PK�"�[��(G++&views/phocacartitem/tmpl/edit_feed.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$fieldSets = $this->form->getFieldsets();
$o = '';
foreach($fieldSets as $name => $fieldSet) {
// Manage only Phoca Cart Feed plugins
if (isset($fieldSet->group) && $fieldSet->group ==
'pcf') {
foreach ($this->form->getFieldset($name) as $field) {
// We use subforms to load all feeds at once and to store them
only to one column in product table
// Example: Plugin zbozi_cz
plugins\pcf\zbozi_cz\models\forms\item.xml
// is linked by dynamically created form in
administrator/components/com_phocacart/models/phocacartitem.php in
preprocessForm() function
// In preprocssForm we build the XML Form inclusive the subform
XML of all feed plugins
// And here we need to fill the form with stored data (column
in product table is called params_feed
if ($field->type == 'Subform') {
$subform = $field->loadSubform();// e.g. zbozi_cz
$nameFeed = str_replace('feed_', '',
$name);// we have created dynamically the field as feed_zbozi_cz to
differentiate from other fields, now return back to plugin name
if (isset($this->item->params_feed[$nameFeed])) {
$subform->bind($this->item->params_feed[$nameFeed]);// bind
the data from $this->item->param_feed['zbozi_cz'] to the
subform
}
$o .= '<div
class="control-group">';
$o .= '<div
class="control-label">' . $field->label .
'</div>';
$o .= '<div class="controls">' .
$field->input . '</div>';
$o .= '</div>';
}
}
}
}
if ($o != '') {
echo $o;
} else {
echo '<div class="alert
alert-info">'.JText::_('COM_PHOCACART_NO_ACTIVE_FEED_PLUGIN_FOUND').'</div>';
}
PK�"�[��P��*views/phocacartitem/tmpl/edit_metadata.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$fieldSets = $this->form->getFieldsets('metadata');
foreach ($fieldSets as $name => $fieldSet) :
?>
<fieldset class="panelform">
<div class="adminform">
<?php if ($name == 'metadata') : // Include the real fields
in this panel. ?>
<div class="control-group">
<div class="control-label"><?php echo
$this->form->getLabel('metatitle'); ?></div>
<div class="controls"><?php echo
$this->form->getInput('metatitle');
?></div></div>
<div class="control-group">
<div class="control-label"><?php echo
$this->form->getLabel('metadesc'); ?></div>
<div class="controls"><?php echo
$this->form->getInput('metadesc');
?></div></div>
<div class="control-group">
<div class="control-label"><?php echo
$this->form->getLabel('metakey'); ?></div>
<div class="controls"><?php echo
$this->form->getInput('metakey');
?></div></div>
<?php endif; ?>
<?php foreach ($this->form->getFieldset($name) as $field) :
?>
<div class="control-group">
<div class="control-label"><?php echo
$field->label; ?></div>
<div class="controls"><?php echo $field->input;
?></div></div>
<?php endforeach; ?>
</div>
</fieldset>
<?php endforeach;
?>PK�"�[(֣BB+views/phocacartitem/tmpl/edit_parameter.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$fieldSets = $this->form->getFieldsets();
$o = '';
foreach($fieldSets as $name => $fieldSet) {
if (isset($fieldSet->name) && $fieldSet->name ==
'items_parameter') {
foreach ($this->form->getFieldset($name) as $field) {
$o .= '<div class="control-group">';
$o .= '<div class="control-label">' .
$field->label . '</div>';
$o .= '<div class="controls">' .
$field->input . '</div>';
$o .= '</div>';
}
}
}
echo $o;
PK�"�[�#o,,#views/phocacartitem/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�+�\\"views/phocacartitem/tmpl/modal.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die;
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tooltip',
'.hasTooltip', array('placement' =>
'bottom'));
// @deprecated 4.0 the function parameter, the inline js and the buttons
are not needed since 3.7.0.
$function =
JFactory::getApplication()->input->getCmd('function',
'jEditPhocacartitem_' . (int) $this->item->id);
// Function to update input title when changed
// phocacartitem-form ==> adminForm
JFactory::getDocument()->addScriptDeclaration('
function jEditPhocacartitemModal() {
if (window.parent &&
document.formvalidator.isValid(document.getElementById("adminForm")))
{
return window.parent.' . $this->escape($function) .
'(document.getElementById("jform_title").value);
}
}
');
?>
<button id="applyBtn" type="button"
class="hidden"
onclick="Joomla.submitbutton('phocacartitem.apply');
jEditPhocacartitemModal();"></button>
<button id="saveBtn" type="button"
class="hidden"
onclick="Joomla.submitbutton('phocacartitem.save');
jEditPhocacartitemModal();"></button>
<button id="closeBtn" type="button"
class="hidden"
onclick="Joomla.submitbutton('phocacartitem.cancel');"></button>
<div class="container-popup">
<?php $this->setLayout('edit'); ?>
<?php echo $this->loadTemplate(); ?>
</div>
PK�"�[�r����/views/phocacartitem/tmpl/modal_associations.phpnu�[���<?php
/**
* @package Phoca Cart
* @author Jan Pavelka - https://www.phoca.cz
* @copyright Copyright (C) Jan Pavelka https://www.phoca.cz
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 and later
* @cms Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die;
echo JLayoutHelper::render('joomla.edit.associations', $this);
PK�"�[�,���!views/phocacartitem/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocaCartItem extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $attributes;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('item');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
//$url =
'index.php?option=com_phocacart&view=phocacartthumba&format=json&tmpl=component&'.
JSession::getFormToken().'=1';
// FIELD: IMAGE, ADDITIONAL IMAGE
// EVENT - ONCHANGE - 1) create thumbnails
//PhocacartRenderAdminjs::phEventCreateImageThumbnail($url,
JText::_('COM_PHOCACART_CHECKING_IMAGE_THUMBNAIL_PLEASE_WAIT'),
'productimage', 'imageCreateThumbs');
// EVENT - ONCLICK - 1) paste selected image 2) create thumbnails
//PhocacartRenderAdminjs::phAddValueImage($url,
JText::_('COM_PHOCACART_CHECKING_IMAGE_THUMBNAIL_PLEASE_WAIT'),
'productimage');
// FIELD: FILE (DOWNLOAD), ADDITIONAL FILES (DOWNLOAD), PUBLIC DOWNLOAD
FILE
// EVENT - ONCLICK - 1) paste selected image 2) create thumbnails
//
// Attribute Option
if ((int)$this->item->id > 0) {
//$this->attributes =
PhocacartAttribute::getAttributesById((int)$this->item->id);
//$this->specifications =
PhocacartSpecification::getSpecificationsById((int)$this->item->id);
//$this->discounts =
PhocacartDiscountProduct::getDiscountsById((int)$this->item->id);
//$this->additional_images =
PhocacartImageAdditional::getImagesByProductId((int)$this->item->id);
}
// ASSOCIATION
// If we are forcing a language in modal (used for associations).
if ($this->getLayout() === 'modal' &&
$forcedLanguage =
JFactory::getApplication()->input->get('forcedLanguage',
'', 'cmd')) {
// Set the language field to the forcedLanguage and disable changing it.
$this->form->setValue('language', null,
$forcedLanguage);
$this->form->setFieldAttribute('language',
'readonly', 'true');
// Only allow to select categories with All language or with the forced
language.
$this->form->setFieldAttribute('catid_multiple',
'language', '*,' . $forcedLanguage);
// Possible FR - add tags (including modifying tag field - to filter
language)
// Only allow to select tags with All language or with the forced
language.
//$this->form->setFieldAttribute('tags',
'language', '*,' . $forcedLanguage);
}
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.category_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_PRODUCT' ).': <small><small>[ ' .
$text.' ]</small></small>' ,
'folder-close');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'] .
'.apply', 'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'] . '.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'] .
'.save2new', 'JTOOLBAR_SAVE_AND_NEW');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
//JToolbarHelper::custom($this->t.'.save2copy',
'copy.png', 'copy_f2.png',
'JTOOLBAR_SAVE_AS_COPY', false);
}
if (!$isNew && JLanguageAssociations::isEnabled() &&
JComponentHelper::isEnabled('com_associations')) {
JToolbarHelper::custom($this->t['task'] .
'.editAssociations', 'contract', 'contract',
'JTOOLBAR_ASSOCIATIONS', false, false);
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'] .
'.cancel', 'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'] .
'.cancel', 'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
PhocacartRenderAdminview::renderWizardButton('back');
}
}
?>
PK�"�[�#o,,views/phocacartitema/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�bl�WW%views/phocacartitema/tmpl/default.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
?>PK�"�[�#o,,$views/phocacartitema/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��}��
�
"views/phocacartitema/view.json.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
class PhocaCartCpViewPhocaCartItemA extends JViewLegacy
{
function display($tpl = null){
if (!JSession::checkToken('request')) {
$response = array(
'status' => '0',
'error' => '<span class="ph-result-txt
ph-error-txt">' . JText::_('JINVALID_TOKEN') .
'</span>');
echo json_encode($response);
return;
}
$app = JFactory::getApplication();
$q = $app->input->get( 'q', '',
'string' );
$id = $app->input->get( 'item_id', '',
'int' );
if (isset($q) && $q != '') {
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$path = PhocacartPath::getPath('productimage');
$columns = 'a.id as id, a.title as title, a.image as image';
$groupsFull = 'a.id, a.title, a.image';
$groupsFast = 'a.id';
$groups = PhocacartUtilsSettings::isFullGroupBy() ? $groupsFull :
$groupsFast;
$query->select($columns);
$query->from('`#__phocacart_products` AS a');
//$query->select('c.title AS category_title, c.id AS
category_id');
//$query->join('LEFT', '#__phocacart_categories AS c
ON c.id = a.catid');
$query->select('group_concat(CONCAT_WS(":", c.id,
c.title) SEPARATOR \',\') AS categories');
$query->select('group_concat(c.id SEPARATOR \',\') AS
categories_id');
$query->select('group_concat(c.title SEPARATOR \' \')
AS categories_title');
$query->join('LEFT', '#__phocacart_product_categories
AS pc ON pc.product_id = a.id');
$query->join('LEFT', '#__phocacart_categories AS c ON
c.id = pc.category_id');
$search = $db->Quote('%'.$db->escape($q,
true).'%');
if ((int)$id > 0) {
$query->where('( a.id <> '.(int)$id.')');
}
$query->where('( a.title LIKE '.$search.')');
$query->group($db->escape($groups));
$query->order($db->escape('a.ordering'));
$db->setQuery($query);
try {
$items = $db->loadObjectList();
} catch (\RuntimeException $e) {
$response = array(
'status' => '0',
'error' => '<span
class="ph-result-txt ph-error-txt">Database Error - Getting
Selected Products</span>');
echo json_encode($response);
return;
}
/*if (!$db->query()) {
$response = array(
'status' => '0',
'error' => '<span class="ph-result-txt
ph-error-txt">Database Error - Getting Selected
Products</span>');
echo json_encode($response);
return;
}
$items = $db->loadObjectList();*/
$itemsA = array();
if (!empty($items)) {
foreach ($items as $k => $v) {
$itemsA[$k]['id'] = $v->id;
$itemsA[$k]['title'] = $v->title . '
('.$v->categories_title.')';
$itemsA[$k]['categories'] = $v->categories;
if ($v->image != '') {
$thumb = PhocacartFileThumbnail::getOrCreateThumbnail($v->image,
'', 0, 0, 0, 0, 'productimage');
if ($thumb['thumb_name_s_no_rel'] != '') {
$itemsA[$k]['image']=
$thumb['thumb_name_s_no_rel'];
}
}
}
}
$response = array(
'status' => '1',
'items' => $itemsA);
echo json_encode($response);
return;
}
$response = array(
'status' => '1',
'items' => array());
echo json_encode($response);
return;
}
}
?>
PK�"�[�#o,,views/phocacartitems/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��a"�7�7%views/phocacartitems/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
defined('_JEXEC') or die();
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = false;
$saveOrderingUrl = '';
if ($this->t['ordering'] &&
!empty($this->ordering)) {
$saveOrder = $listOrder == 'pc.ordering';
/*$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}*/
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
}
//$sortFields = $this->getSortFields();
/*
$nrColumns = 19;
$assoc = JLanguageAssociations::isEnabled();
if ($assoc) {
$nrColumns = 20;
}*/
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
/*echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocacartCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
echo $r->endFilter();*/
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
echo
$r->selectFilterCategory(PhocacartCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
echo $r->endFilterBar();
echo $r->endFilterBar();
*/
//echo $r->startFilterBar();
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
//echo $r->endFilterBar();
echo $r->startTable('categoryList');
echo $r->startTblHeader();
//echo $r->thOrderingXML('JGRID_HEADING_ORDERING', $listDirn,
$listOrder, 'pc');
//echo $r->thCheck('JGLOBAL_CHECK_ALL');
echo $r->firstColumnHeader($listDirn, $listOrder, 'pc');
echo $r->secondColumnHeader($listDirn, $listOrder, 'pc');
$options = array();
$options['listdirn'] = $listDirn;
$options['listorder'] = $listOrder;
$options['count'] = 2;
$options['type'] = 'render';
$options['association'] = JLanguageAssociations::isEnabled();
$options['tasks'] = $this->t['tasks'];
$c = new PhocacartRenderAdmincolumns();
echo $c->renderHeader($this->t['admin_columns_products'],
$options);
/*
echo '<th class="ph-image">' .
Text::_($this->t['l'] . '_IMAGE') .
'</th>' . "\n";
echo '<th class="ph-sku">' .
HTMLHelper::_('searchtools.sort', $this->t['l'] .
'_SKU', 'a.sku', $listDirn, $listOrder) .
'</th>' . "\n";
echo '<th class="ph-title">' .
HTMLHelper::_('searchtools.sort', $this->t['l'] .
'_TITLE', 'a.title', $listDirn, $listOrder) .
'</th>' . "\n";
echo '<th class="ph-published">' .
HTMLHelper::_('searchtools.sort', $this->t['l'] .
'_PUBLISHED', 'a.published', $listDirn, $listOrder) .
'</th>' . "\n";
//echo '<th
class="ph-parentcattitle">'.HTMLHelper::_('searchtools.sort',
$this->t['l'].'_CATEGORY', 'category_id',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th class="ph-parentcattitle">' .
Text::_($this->t['l'] . '_CATEGORY') .
'</th>' . "\n";
echo '<th class="ph-price">' .
HTMLHelper::_('searchtools.sort', $this->t['l'] .
'_PRICE', 'a.price', $listDirn, $listOrder) .
'</th>' . "\n";
echo '<th class="ph-price_original">' .
HTMLHelper::_('searchtools.sort', $this->t['l'] .
'_ORIGINAL_PRICE', 'a.price_original', $listDirn,
$listOrder) . '</th>' . "\n";
echo '<th class="ph-stock">' .
HTMLHelper::_('searchtools.sort', $this->t['l'] .
'_IN_STOCK', 'a.stock', $listDirn, $listOrder) .
'</th>' . "\n";
//echo '<th
class="ph-hits">'.HTMLHelper::_('searchtools.sort',
$this->t['l'].'_HITS', 'a.hits',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th class="ph-access">' .
Text::_($this->t['l'] . '_ACCESS') .
'</th>' . "\n";
if ($options['association']) {
echo '<th class="ph-association">' .
HTMLHelper::_('searchtools.sort',
'COM_PHOCACART_HEADING_ASSOCIATION', 'association',
$listDirn, $listOrder) . '</th>' . "\n";
}
echo '<th class="ph-language">' .
HTMLHelper::_('searchtools.sort',
'JGRID_HEADING_LANGUAGE', 'a.language', $listDirn,
$listOrder) . '</th>' . "\n";
echo '<th class="ph-hits">' .
HTMLHelper::_('searchtools.sort', $this->t['l'] .
'_HITS', 'a.hits', $listDirn, $listOrder) .
'</th>' . "\n";
echo '<th class="ph-id">' .
HTMLHelper::_('searchtools.sort', $this->t['l'] .
'_ID', 'a.id', $listDirn, $listOrder) .
'</th>' . "\n";
*/
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
$price = new PhocacartPrice();
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart &&
$j < (int)$this->pagination->limit) {
$j++;
$urlTask = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'];
$urlEdit = $urlTask . '.edit&id=';
//$orderkey = array_search($item->id,
$this->ordering[$item->catid]);
$orderkey = 0;
$orderingItem = 0;
if ($this->t['ordering'] &&
!empty($this->ordering)) {
$orderkey = array_search($item->id,
$this->ordering[$this->t['catid']]);
$orderingItem = $orderkey;
}
$ordering = ($listOrder == 'pc.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') || $item->checked_out ==
$user->get('id') || $item->checked_out == 0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_($urlEdit . $item->id);
//$linkCat = JRoute::_(
'index.php?option='.$this->t['o'].'&task='.$this->t['c'].'category.edit&id='.(int)
$item->category_id );
$canEditCat = $user->authorise('core.edit',
$this->t['o']);
$linkEditCat = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['c'] . 'category.edit';
echo $r->startTr($i, $this->t['catid']);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $orderingItem, false);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $orderingItem, false);
if (!empty($this->t['admin_columns_products'])) {
foreach ($this->t['admin_columns_products'] as $k
=> $v) {
$columnParams = array();
$itemColumn = array();
$itemColumn['i'] = $i;
$itemColumn['params'] = array();
$itemColumn['params']['edit'] = false;
$v =
PhocacartText::parseDbColumnParameter($v,
$itemColumn['params']);
$itemColumn['name'] = $v;
$itemColumn['value'] =
isset($item->{$v}) ? $item->{$v} : '';
$itemColumn['id'] =
isset($item->id) ? $item->id : 0;
$itemColumn['idtoken'] =
'products:' . $v . ':' .
(int)$itemColumn['id'];
$itemColumn['cancreate'] = $canCreate;
$itemColumn['canedit'] = $canEdit;
$itemColumn['canchange'] = $canChange;
$itemColumn['linkedit'] = $linkEdit;
$itemColumn['editclass'] =
'text';
$itemColumn['editfilter'] =
'text';
if ($v == 'title') {
$itemColumn['cancheckin'] =
$canCheckin;
$itemColumn['checked_out'] =
$item->checked_out;
$itemColumn['checked_out_time'] =
$item->checked_out_time;
$itemColumn['editor'] =
$item->editor;
$itemColumn['valuealias'] =
$item->alias;
$itemColumn['namealias'] =
'alias';
$itemColumn['idtokencombined'] =
'products:alias:' . (int)$itemColumn['id'];
}
if ($v == 'published') {
$itemColumn['valuefeatured'] =
$item->featured;
$itemColumn['namefeatured'] =
'featured';
}
if ($v == 'categories') {
$itemColumn['value'] =
$this->t['categories'];
$itemColumn['caneditcategory'] =
$canEditCat;
$itemColumn['linkeditcategory'] =
$linkEditCat;
}
if ($v == 'language') {
$itemColumn['value'] = new
stdClass();
$itemColumn['value']->language =
$item->language;
$itemColumn['value']->language_title =
$item->language_title;
$itemColumn['value']->language_image =
$item->language_image;
}
echo $c->item($v, $itemColumn, $options);
}
}
/*
echo $r->tdImageCart($this->escape($item->image),
'small', 'productimage', 'small
ph-items-image-box');
//echo $r->td($this->escape($item->sku),
'small');
echo $r->td('<span class="ph-editinplace-text
ph-eip-sku" id="products:sku:' . (int)$item->id .
'">' . $this->escape($item->sku) .
'</span>', "small");
$checkO = '';
if ($item->checked_out) {
$checkO .=
Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'] . '.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="' . JRoute::_($linkEdit)
. '"><span id="phIdTitle' . $item->id .
'">' . $this->escape($item->title) .
'</span></a>';
} else {
$checkO .= '<span id="phIdTitle' .
$item->id . '">' . $this->escape($item->title) .
'</span>';// Id needed for displaying Copy Attributes
Titles
}
$checkO .= '<br /><span
class="smallsub">(<span>' .
JText::_($this->t['l'] . '_FIELD_ALIAS_LABEL') .
':</span>' . $this->escape($item->alias) .
')</span>';
echo $r->td($checkO, "small");
echo $r->td(
'<div class="btn-group">' .
Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'] . '.',
$canChange)
. PhocacartHtmlFeatured::featured($item->featured, $i,
$canChange) . '</div>',
"small");
$catO = array();
if (isset($this->t['categories'][$item->id])) {
foreach ($this->t['categories'][$item->id] as
$k => $v) {
if ($canEditCat) {
$linkCat = JRoute::_('index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['c'] . 'category.edit&id=' .
(int)$v['id']);
$catO[] = '<a href="' .
JRoute::_($linkCat) . '">' .
$this->escape($v['title']) . '</a>';
} else {
$catO[] = $this->escape($v['title']);
}
}
}
echo $r->td(implode(' ', $catO), "small");
//echo $r->td($this->escape($item->access_level),
"small");
echo $r->td('<span class="ph-editinplace-text
ph-eip-price" id="products:price:' . (int)$item->id .
'">' . PhocacartPrice::cleanPrice($item->price) .
'</span>', "small");
echo $r->td('<span class="ph-editinplace-text
ph-eip-price_original" id="products:price_original:' .
(int)$item->id . '">' .
PhocacartPrice::cleanPrice($item->price_original) .
'</span>', "small");
//echo $r->td($item->hits, "small");
echo $r->td('<span class="ph-editinplace-text
ph-eip-price" id="products:stock:' . (int)$item->id .
'">' . PhocacartPrice::cleanPrice($item->stock) .
'</span>', "small");
echo $r->td($this->escape($item->access_level));
if ($options['association']) {
if ($item->association) {
echo
$r->td(Joomla\CMS\HTML\HTMLHelper::_('phocacartitem.association',
$item->id));
} else {
echo $r->td('');
}
}
//echo $r->tdLanguage($item->language,
$item->language_title, $this->escape($item->language_title));
echo
$r->td(JLayoutHelper::render('joomla.content.language',
$item));
echo $r->td($item->hits, "small");
echo $r->td($item->id, "small");
*/
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(),
$options['count']);
echo $r->endTable();
echo $this->loadTemplate('batch');
echo $this->loadTemplate('copy_attributes');
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�m�G��+views/phocacartitems/tmpl/default_batch.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
use Joomla\CMS\Layout\LayoutHelper;
//$published = $this->state->get('filter.published');
$published = (int)$this->state->get('filter.published');
?>
<div class="modal hide fade" id="collapseModal">
<div class="modal-header">
<button type="button" role="presentation"
class="close" data-dismiss="modal">x</button>
<h3><?php echo JText::_($this->t['l'] .
'_BATCH_OPTIONS_ITEMS');?></h3>
</div>
<div class="modal-body">
<div class="row" style="margin:0;padding:0;">
<div class="col-sm-6 col-md-6">
<p><?php /* echo
JText::_('COM_CONTENT_BATCH_TIP');*/ ?></p>
<div class="control-group">
<div class="controls">
<?php echo
LayoutHelper::render('joomla.html.batch.access', []);?>
</div>
</div>
<div class="control-group">
<div class="controls">
<?php echo
LayoutHelper::render('joomla.html.batch.language', []); ?>
</div>
</div>
<?php if ($published >= 0) : ?>
<div class="control-group">
<div class="controls">
<?php
$class = $this->t['n'].'HtmlBatch';
echo $class::item($published, 0);
?>
</div>
</div>
<?php endif; ?>
</div>
<div class="col-sm-6 col-md-6">
<h4><?php echo JText::_('COPY_FUNCTION_PARAMETERS');
?></h4>
<div class="control-group">
<div class="controls">
<label id="batch-choose-action-lbl"
for="batch-choose-action"><?php echo
JText::_('COM_PHOCACART_COPY_ALL_CATEGORIES_FROM_SOURCE')
?></label>
<select name="batch[copy_all_cats]"
class="inputbox" id="batch-category-copy-all-cats">
<option value="1"><?php echo
JText::_('COM_PHOCACART_YES'); ?></option>
<option value="0" selected><?php echo
JText::_('COM_PHOCACART_NO'); ?></option>
</select>
</div>
</div>
<div class="control-group">
<div class="controls">
<label id="batch-choose-action-lbl"
for="batch-choose-action"><?php echo
JText::_('COM_PHOCACART_SKIP_CREATING_UNIQUE_NAME')
?></label>
<select name="batch[skip_creating_unique_name]"
class="inputbox"
id="batch-category-batch[skip_creating_unique_name]">
<option value="1"><?php echo
JText::_('COM_PHOCACART_YES'); ?></option>
<option value="0" selected><?php echo
JText::_('COM_PHOCACART_NO'); ?></option>
</select>
</div>
</div>
<div class="control-group">
<div class="controls">
<label id="batch-choose-action-lbl"
for="batch-choose-action"><?php echo
JText::_('COM_PHOCACART_COPY_DOWNLOAD_FILES') ?></label>
<select
name="batch[copy_download_files]" class="inputbox"
id="batch[copy_download_files]">
<option value="1"><?php echo
JText::_('COM_PHOCACART_YES'); ?></option>
<option value="0"
selected><?php echo JText::_('COM_PHOCACART_NO');
?></option>
</select>
</div>
</div>
<div class="control-group">
<div class="controls">
<label id="batch-choose-action-lbl"
for="batch-choose-action"><?php echo
JText::_('COM_PHOCACART_COPY_ATTRIBUTE_OPTION_DOWNLOAD_FILES')
?></label>
<select
name="batch[copy_attributes_download_files]"
class="inputbox"
id="batch[copy_attributes_download_files]">
<option value="1"><?php echo
JText::_('COM_PHOCACART_YES'); ?></option>
<option value="0"
selected><?php echo JText::_('COM_PHOCACART_NO');
?></option>
</select>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn" type="button"
onclick="document.getElementById('batch-category-id').value='';document.getElementById('batch-access').value='';document.getElementById('batch-language-id').value=''"
data-dismiss="modal">
<?php echo JText::_('JCANCEL'); ?>
</button>
<button class="btn btn-primary" type="submit"
onclick="Joomla.submitbutton('<?php echo
$this->t['task'] ?>.batch');">
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
</button>
</div>
</div>
PK�"�[Qg�c��5views/phocacartitems/tmpl/default_copy_attributes.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
//$published = $this->state->get('filter.published');
$published = (int)$this->state->get('filter.published');
?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#collapseModalCA').on('shown.bs.modal',
function (e) {
var phTitleString = '';
var phCheckedValues =
jQuery('input[name="cid[]"]:checked');
jQuery.each(phCheckedValues, function( i, v ) {
var phIdTitle = '.phIdTitle' + v.value;
phTitleString += '<li>' + jQuery(phIdTitle).html() +
'</li>';
});
jQuery('#phCopyAttributesTo').html('<ul>' +
phTitleString + '</ul>');
});
});
</script>
<div class="modal hide fade"
id="collapseModalCA">
<div class="modal-header">
<button type="button" role="presentation"
class="close" data-dismiss="modal">x</button>
<h3><?php echo JText::_($this->t['l'] .
'_COPY_ATTRIBUTES_TO_SELECTED_ITEMS');?></h3>
</div>
<div class="modal-body">
<div class="row-fluid">
<div class="span5 col-sm-5 col-md-5">
<h3><?php echo JText::_('COM_PHOCACART_PRODUCT');
?> (<?php echo
JText::_('COM_PHOCACART_COPY_ATTRIBUTES_FROM'); ?>)</h3>
<p><?php echo
JText::_('COM_PHOCACART_SELECT_PRODUCT_FROM_WHICH_ATTRIBUTES_WILL_BE_COPIED');
?></p>
<div class="control-group">
<div class="controls">
<?php
JFormHelper::addFieldPath(JPATH_COMPONENT .
'/models/fields');
$item = JFormHelper::loadFieldType('PhocaSelectItem',
true);
$itemO = $item->getInputWithoutFormData();
echo $itemO;
?>
</div>
</div>
<div class="control-group">
<div class="controls">
<label
id="copy_attributes_download_files-lbl"
for="copy_attributes_download_files"><?php echo
JText::_('COM_PHOCACART_COPY_ATTRIBUTE_OPTION_DOWNLOAD_FILES')
?></label>
<select
name="copy_attributes_download_files" class="inputbox"
id="copy_attributes_download_files">
<option value="1"><?php echo
JText::_('COM_PHOCACART_YES'); ?></option>
<option value="0"
selected><?php echo JText::_('COM_PHOCACART_NO');
?></option>
</select>
</div>
</div>
</div>
<div class="span2 col-sm-2 col-md-2
ph-vertical-align-single">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0
100 100" width="100" height="100"
background-color="#ffffff00"><path d="M28.5 34.8L50
34.8 50 25 73 45.5 50 66 50 56.3 50 56.3 50 56.3 50 56.6 28.5 56.6 28.5
34.8 28.5 34.8Z" fill="#468c00"/></svg>
</div>
<div class="span5 col-sm-5 col-md-5">
<h3><?php echo JText::_('COM_PHOCACART_PRODUCTS');
?> (<?php echo
JText::_('COM_PHOCACART_COPY_ATTRIBUTES_TO'); ?>)</h3>
<div class="alert alert-error"><?php echo
JText::_('COM_PHOCACART_BE_AWARE_COPYING_OF_ATTRIBUTES_CAN_OVERWRITE_CURRENT_ATTRIBUTES_OF_SELECTED_PRODUCTS');
?></div>
<div id="phCopyAttributesTo"></div>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn" type="button"
onclick="document.getElementById('batch-category-id').value='';document.getElementById('batch-access').value='';document.getElementById('batch-language-id').value=''"
data-dismiss="modal">
<?php echo JText::_('JCANCEL'); ?>
</button>
<button class="btn btn-primary" type="submit"
onclick="Joomla.submitbutton('<?php echo
$this->t['task'] ?>.copyattributes');">
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
</button>
</div>
</div>
PK�"�[�#o,,$views/phocacartitems/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��A�A#views/phocacartitems/tmpl/modal.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
defined('_JEXEC') or die();
// ASSOCIATION
$app = JFactory::getApplication();
if ($app->isClient('site')) {
JSession::checkToken('get') or
die(JText::_('JINVALID_TOKEN'));
}
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$function = $app->input->getCmd('function',
'jSelectPhocacartitem');
$onclick = $this->escape($function);
if (!empty($editor)) {
// This view is used also in com_menus. Load the xtd script only if the
editor is set!
JFactory::getDocument()->addScriptOptions('xtd-phocacartitems',
array('editor' => $editor));
$onclick = "jSelectPhocacartitem";
}
// Special case for the search field tooltip. TO DO
/*$searchFilterDesc =
$this->filterForm->getFieldAttribute('search',
'description', null, 'filter');
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tooltip',
'#filter_search', array('title' =>
JText::_($searchFilterDesc), 'placement' =>
'bottom'));
*/
$iconStates = array(
-2 => 'icon-trash',
0 => 'icon-unpublish',
1 => 'icon-publish',
2 => 'icon-archive',
);
$saveOrder = false;
$saveOrderingUrl = '';
if ($this->t['ordering'] &&
!empty($this->ordering)) {
$saveOrder = $listOrder == 'pc.ordering';
/*$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}*/
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
}
//$sortFields = array();// $this->getSortFields();
echo $r->jsJorderTable($listOrder);
// phocacartitem-form => adminForm
echo $r->startFormModal($this->t['o'],
$this->t['tasks'], 'adminForm',
'adminForm', $function);
//echo $r->startFilterNoSubmenu();
//echo $r->endFilter();
echo $r->startMainContainerNoSubmenu();
/*
echo $r->startFilterBar();
echo $r->inputFilterSearch($this->t['l'] .
'_FILTER_SEARCH_LABEL', $this->t['l'] .
'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
echo
$r->selectFilterCategory(PhocacartCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
echo $r->endFilterBar();
echo $r->endFilterBar();
*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder, 'pc');
echo $r->secondColumnHeader($listDirn, $listOrder, 'pc');
$options = array();
$options['listdirn'] = $listDirn;
$options['listorder'] = $listOrder;
$options['count'] = 2;
$options['type'] = 'render';
$options['association'] = JLanguageAssociations::isEnabled();
$options['tasks'] = $this->t['tasks'];
$c = new PhocacartRenderAdmincolumns();
$adminColumnProducts = array();
if(!empty($this->t['admin_columns_products'])) {
foreach ($this->t['admin_columns_products'] as $k =>
$v) {
$item = explode('=', $v);
if (isset($item[0]) && $item[0] != '') {
$itemO = PhocacartText::filterValue($item[0],
'alphanumeric2');
if ($itemO != 'phoca_action') {
$adminColumnProducts[] = $itemO;
}
}
}
}
echo $c->renderHeader($adminColumnProducts, $options);
/*
echo '<th class="ph-image">' .
JText::_($this->t['l'] . '_IMAGE') .
'</th>' . "\n";
echo '<th class="ph-sku">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_SKU', 'a.sku',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-title">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_TITLE', 'a.title',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-published">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_PUBLISHED',
'a.published', $listDirn, $listOrder) . '</th>' .
"\n";
//echo '<th
class="ph-parentcattitle">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_CATEGORY', 'category_id',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th class="ph-parentcattitle">' .
JTEXT::_($this->t['l'] . '_CATEGORY') .
'</th>' . "\n";
echo '<th class="ph-price">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_PRICE', 'a.price',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-price">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_ORIGINAL_PRICE',
'a.price_original', $listDirn, $listOrder) .
'</th>' . "\n";
echo '<th class="ph-stock">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_IN_STOCK', 'a.stock',
$listDirn, $listOrder) . '</th>' . "\n";
//echo '<th
class="ph-hits">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_HITS', 'a.hits',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th class="ph-access">' .
JTEXT::_($this->t['l'] . '_ACCESS') .
'</th>' . "\n";
echo '<th class="ph-language">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
'JGRID_HEADING_LANGUAGE', 'a.language', $listDirn,
$listOrder) . '</th>' . "\n";
echo '<th class="ph-hits">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_HITS', 'a.hits',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-id">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_ID', 'a.id', $listDirn,
$listOrder) . '</th>' . "\n";
*/
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
$price = new PhocacartPrice();
if (!empty($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart &&
$j < (int)$this->pagination->limit) {
$j++;
$urlEdit = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'] . '.edit&id=';
$urlTask = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'];
//$orderkey = array_search($item->id,
$this->ordering[$item->catid]);
$orderkey = 0;
$orderingItem = 0;
if ($this->t['ordering'] &&
!empty($this->ordering)) {
$orderkey = array_search($item->id,
$this->ordering[$this->t['catid']]);
$orderingItem = $orderkey;
}
$ordering = ($listOrder == 'pc.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') || $item->checked_out ==
$user->get('id') || $item->checked_out == 0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_($urlEdit . $item->id);
$linkLang = JRoute::_('index.php?option=' .
$this->t['o'] . '&view=phocacartitem&id=' .
$this->escape($item->id) . '&lang=' .
$this->escape($item->language));
//$linkCat = JRoute::_(
'index.php?option='.$this->t['o'].'&task='.$this->t['c'].'category.edit&id='.(int)
$item->category_id );
$canEditCat = 0;// FORCE NOT EDITING CATEGORY IN MODAL
$user->authorise('core.edit', $this->t['o']);
if ($item->language && JLanguageMultilang::isEnabled())
{
$tag = strlen($item->language);
if ($tag == 5) {
$lang = substr($item->language, 0, 2);
} else if ($tag == 6) {
$lang = substr($item->language, 0, 3);
} else {
$lang = '';
}
} else if (!JLanguageMultilang::isEnabled()) {
$lang = '';
}
// $linkEditBox = '<a class="select-link
phIdTitle' . (int)$item->id . '"
href="javascript:void(0)" data-function="' .
$this->escape($onclick) . '" data-id="' .
$item->id . '" data-title="' .
$this->escape($item->title) . '" data-uri="' .
$this->escape($linkLang) . '" data-language="' .
$this->escape($lang) . '">';
$linkEditBox = '<a class="select-link phIdTitle'
. (int)$item->id . '" href="javascript:void(0)"
onclick="if (window.parent)
window.parent.'.$this->escape($onclick).'(\''.
$item->id.'\', \''.
$this->escape(addslashes($item->title)).'\', null,
\''. $this->escape($linkLang).'\', \''.
$this->escape($lang).'\', null);">';
$linkEditBox .= $this->escape($item->title);
$linkEditBox .= '</a>';
$linkEdit = '';
$linkEditCat = '';
echo $r->startTr($i, $this->t['catid']);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $orderingItem, false);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $orderingItem, false);
if (!empty($adminColumnProducts)) {
foreach ($adminColumnProducts as $k => $v) {
$columnParams = array();
$itemColumn = array();
$itemColumn['i'] = $i;
$itemColumn['params'] = array();
$itemColumn['params']['edit'] = false;
$v =
PhocacartText::parseDbColumnParameter($v, $itemColumn['params']);
$itemColumn['name'] = $v;
$itemColumn['value'] =
isset($item->{$v}) ? $item->{$v} : '';
$itemColumn['id'] =
isset($item->id) ? $item->id : 0;
$itemColumn['idtoken'] =
'products:' . $v . ':' .
(int)$itemColumn['id'];
$itemColumn['cancreate'] = $canCreate;
$itemColumn['canedit'] = $canEdit;
$itemColumn['canchange'] = $canChange;
$itemColumn['linkedit'] = $linkEdit;
$itemColumn['linkeditbox'] = $linkEditBox;
$itemColumn['editclass'] = 'text';
$itemColumn['editfilter'] = 'text';
if ($v == 'title') {
$itemColumn['cancheckin'] =
$canCheckin;
$itemColumn['checked_out'] =
$item->checked_out;
$itemColumn['checked_out_time'] =
$item->checked_out_time;
$itemColumn['editor'] =
$item->editor;
$itemColumn['valuealias'] =
$item->alias;
$itemColumn['namealias'] =
'alias';
$itemColumn['idtokencombined'] =
'products:alias:' . (int)$itemColumn['id'];
}
if ($v == 'published') {
$itemColumn['valuefeatured'] =
$item->featured;
$itemColumn['namefeatured'] =
'featured';
}
if ($v == 'categories') {
$itemColumn['value'] =
$this->t['categories'];
$itemColumn['caneditcategory'] =
$canEditCat;
$itemColumn['linkeditcategory'] =
$linkEditCat;
}
if ($v == 'language') {
$itemColumn['value'] = new
stdClass();
$itemColumn['value']->language =
$item->language;
$itemColumn['value']->language_title =
$item->language_title;
$itemColumn['value']->language_image =
$item->language_image;
}
echo $c->item($v, $itemColumn, $options);
}
}
/*
echo $r->tdImageCart($this->escape($item->image),
'small', 'productimage', 'small
ph-items-image-box');
//echo $r->td($this->escape($item->sku),
'small');
echo $r->td('<span class="ph-editinplace-text
ph-eip-text ph-eip-sku" id="products:sku:' .
(int)$item->id . '">' .
$this->escape($item->sku) . '</span>',
"small");
/*
$checkO = '';
if ($item->checked_out) {
$checkO .=
Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'"><span
id="phIdTitle'.$item->id.'">'.
$this->escape($item->title).'</span></a>';
} else {
$checkO .= '<span
id="phIdTitle'.$item->id.'">'.$this->escape($item->title).'</span>';//
Id needed for displaying Copy Attributes Titles
}
$checkO .= '<br /><span
class="smallsub">(<span>'.JText::_($this->t['l'].'_FIELD_ALIAS_LABEL').':</span>'.
$this->escape($item->alias).')</span>';
echo $r->td($checkO, "small");*/
/*
$linkBox = '<a class="select-link"
href="javascript:void(0)" data-function="' .
$this->escape($onclick) . '" data-id="' .
$item->id . '" data-title="' .
$this->escape($item->title) . '" data-uri="' .
$this->escape($linkLang) . '" data-language="' .
$this->escape($lang) . '">';
$linkBox .= $this->escape($item->title);
$linkBox .= '</a>';
echo $r->td($linkBox, "small");
/*echo $r->td(
'<div
class="btn-group">'.Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'].'.',
$canChange)
. PhocacartHtmlFeatured::featured($item->featured, $i,
$canChange). '</div>',
"small");*/
/*
echo $r->td('<span class="' .
$iconStates[$this->escape($item->published)] . '"
aria-hidden="true"></span>');
/*
if ($canEditCat) {
$catO = '<a href="'.
JRoute::_($linkCat).'">'.
$this->escape($item->category_title).'</a>';
} else {
$catO = $this->escape($item->category_title);
}*/
/* $catO = array();
if (isset($this->t['categories'][$item->id])) {
foreach ($this->t['categories'][$item->id] as
$k => $v) {
if ($canEditCat) {
$linkCat = JRoute::_('index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['c'] . 'category.edit&id=' .
(int)$v['id']);
$catO[] = '<a href="' .
JRoute::_($linkCat) . '">' .
$this->escape($v['title']) . '</a>';
} else {
$catO[] = $this->escape($v['title']);
}
}
}
echo $r->td(implode(' ', $catO), "small");
//echo $r->td($this->escape($item->access_level),
"small");
echo $r->td('<span class="ph-editinplace-text
ph-eip-text ph-eip-price" id="products:price:' .
(int)$item->id . '">' .
PhocacartPrice::cleanPrice($item->price) . '</span>',
"small");
echo $r->td('<span class="ph-editinplace-text
ph-eip-text ph-eip-price_original"
id="products:price_original:' . (int)$item->id .
'">' .
PhocacartPrice::cleanPrice($item->price_original) .
'</span>', "small");
//echo $r->td($item->hits, "small");
echo $r->td('<span class="ph-editinplace-text
ph-eip-text ph-eip-price" id="products:stock:' .
(int)$item->id . '">' .
PhocacartPrice::cleanPrice($item->stock) . '</span>',
"small");
echo $r->td($this->escape($item->access_level));
//echo $r->tdLanguage($item->language,
$item->language_title, $this->escape($item->language_title));
echo
$r->td(JLayoutHelper::render('joomla.content.language',
$item));
echo $r->td($item->hits, "small");
echo $r->td($item->id, "small");
*/
echo $r->endTr();
//}
}
} else {
// No items
echo '<div class="alert alert-no-items">' .
JText::_('JGLOBAL_NO_MATCHING_RESULTS') .
'</div>';
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 19);
echo $r->endTable();
//echo $this->loadTemplate('batch');
//echo $this->loadTemplate('copy_attributes');
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo '<input type="hidden"
name="forcedLanguage" value="' .
$app->input->get('forcedLanguage', '',
'CMD') . '" />';
echo $r->endForm();
?>
PK�"�[�"b��"views/phocacartitems/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\Language\Text;
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocaCartItems extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
//if ($this->getLayout() !== 'modal') {
// ContactHelper::addSubmenu('phocacartitems');
//}
$this->t = PhocacartUtils::setVars('item');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
$paramsC = PhocacartUtils::getComponentParameters();
$this->t['admin_columns_products'] =
$paramsC->get('admin_columns_products', 'sku=E, image,
title, published, categories, price=E, price_original=E, stock=E,
access_level, language, association, hits, id');
$this->t['admin_columns_products'] =
explode(',', $this->t['admin_columns_products']);
// Multiple categories, ordering
$this->t['catid'] =
$this->escape($this->state->get('filter.category_id'));
$this->t['ordering']= false;// Is specific ordering used
(ordering in phocacart_product_categories reference table)
if (isset($this->t['catid']) &&
(int)$this->t['catid'] > 0) {
$this->t['ordering']= true;
}
// Multiple categories: Ordering and list all ids on the site ($idItems)
$idItems = array();
foreach ($this->items as &$item) {
if (isset($this->t['catid']) &&
(int)$this->t['catid'] > 0) {
$this->ordering[(int)$this->t['catid']][$item->ordering]
= $item->id;
}
$idItems[] = $item->id;
}
// Make list of categories for each product (don't run group_concat
alternative but own sql)
$categories =
PhocacartCategoryMultiple::getCategoriesByProducts($idItems);
$this->t['categories'] = array();
if (!empty($categories)) {
foreach ($categories as $k => $v) {
$id = $v['product_id'];
$this->t['categories'][$id][$k]['id'] =
$v['id'];
$this->t['categories'][$id][$k]['alias'] =
$v['alias'];
$this->t['categories'][$id][$k]['title'] =
$v['title'];
}
}
$media = new PhocacartRenderAdminmedia();
// ASSOCIATION
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') {
$this->addToolbar();
//$this->sidebar = JHtmlSidebar::render();
} else {
// In article associations modal we need to remove language
filter if forcing a language.
// We also need to change the category filter to show show
categories with All or the forced language.
if ($forcedLanguage =
JFactory::getApplication()->input->get('forcedLanguage',
'', 'CMD'))
{
// If the language is forced we can't allow to select
the language, so transform the language selector filter into a hidden
field.
//$languageXml = new SimpleXMLElement('<field
name="language" type="hidden" default="' .
$forcedLanguage . '" />');
//$this->filterForm->setField($languageXml,
'filter', true);
// Also, unset the active language filter so the search
tools is not open by default with this filter.
unset($this->activeFilters['language']);
// One last changes needed is to change the category filter
to just show categories with All language or with the forced language.
//
$this->filterForm->setFieldAttribute('category_id',
'language', '*,' . $forcedLanguage,
'filter');
}
}
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.item_id'));
$user = JFactory::getUser();
$bar = JToolbar::getInstance('toolbar');
JToolbarHelper::title(
Text::_($this->t['l'].'_PRODUCTS'),
'folder-close' );
if ($canDo->get('core.create')) {
JToolbarHelper::addNew(
$this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.featured',
'featured.png', 'featured_f2.png',
'JFEATURED', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList( Text::_(
$this->t['l'].'_WARNING_DELETE_ITEMS' ),
$this->t['tasks'].'.delete',
$this->t['l'].'_DELETE');
}
// Add a batch button
if ($user->authorise('core.edit'))
{
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.renderModal',
'collapseModal');
$title = Text::_('JTOOLBAR_BATCH');
$dhtml = "<button data-toggle=\"modal\"
data-target=\"#collapseModal\" class=\"btn
btn-small\">
<i class=\"icon-checkbox-partial\"
title=\"$title\"></i>
$title</button>";
$bar->appendButton('Custom', $dhtml, 'batch');
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.renderModal',
'collapseModalCA');
$title = Text::_('COM_PHOCACART_COPY_ATTRIBUTES');
$dhtml = "<button data-toggle=\"modal\"
data-target=\"#collapseModalCA\" class=\"btn
btn-small\">
<i class=\"icon-checkbox-partial\"
title=\"$title\"></i>
$title</button>";
$bar->appendButton('Custom', $dhtml,
'copy_attributes');
}
$dhtml = '<button class="btn btn-small"
onclick="javascript:if(document.adminForm.boxchecked.value==0){alert(\''.Text::_('COM_PHOCACART_WARNING_RECREATE_MAKE_SELECTION').'\');}else{if(confirm(\''.Text::_('COM_PHOCACART_WARNING_RECREATE_THUMBNAILS').'\')){submitbutton(\'phocacartitem.recreate\');}}"
><i class="icon-image"
title="'.Text::_('COM_PHOCACART_RECREATE_THUMBS').'"></i>
'.Text::_('COM_PHOCACART_RECREATE_THUMBS').'</button>';
$bar->appendButton('Custom', $dhtml);
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
PhocacartRenderAdminview::renderWizardButton('back');
}
}
?>
PK�"�[�#o,,views/phocacartlogs/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�['�S� $views/phocacartlogs/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
if($this->t['enable_logging'] == 0) {
echo '<div class="alert alert-info">';
echo '<button type="button" class="close"
data-dismiss="alert">×</button>';
//echo '<h4
class="alert-heading">'.JText::_('COM_PHOCACART_INFO').'</h4>';
echo '<div
class="alert-message">'.JText::_('COM_PHOCACART_LOGGING_IS_DISABLED_AT_THE_MOMENT').'</div>';
echo '</div>';
}
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th
class="ph-date">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_DATE', 'a.date',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-type">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TYPE', 'a.type',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-title">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TITLE', 'a.title',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-user">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_USER', 'user_username',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-ip">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_IP', 'a.ip', $listDirn,
$listOrder ).'</th>'."\n";
echo '<th
class="ph-incoming-page">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_INCOMING_PAGE',
'a.incoming_page', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-description">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_MESSAGE',
'a.description', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-id">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ID', 'a.id', $listDirn,
$listOrder ).'</th>'."\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart && $j
< (int)$this->pagination->limit) {
$j++;
$urlEdit =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
$urlTask =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit. $item->id );
$iD = $i % 2;
echo "\n\n";
//echo '<tr class="row'.$iD.'"
sortable-group-id="0"
item-id="'.$item->id.'" parents="0"
level="0">'. "\n";
echo '<tr class="row'.$iD.'"
sortable-group-id="0" >'. "\n";
echo $r->tdOrder($canChange, $saveOrder, $orderkey,
$item->ordering);
//echo $r->tdOrder(0, $saveOrder, $orderkey);// ORDERING DISABLED
echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('grid.id', $i,
$item->id), "small");
echo $r->td($item->date, "small");
/*$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'.
$this->escape($item->title).'</a>';
} else {
$checkO .= $this->escape($item->title);
}*/
$item->type = 4;
switch($item->type) {
case 2:
$type = '<span class="label label-important label-danger
badge
badge-danger">'.JText::_('COM_PHOCACART_ERROR').'</span>';
break;
case 3:
$type = '<span class="label label-warning badge
badge-warning">'.JText::_('COM_PHOCACART_WARNING').'</span>';
break;
case 4:
$type = '<span class="label label-info badge
badge-info">'.JText::_('COM_PHOCACART_NOTICE').'</span>';
break;
case 1:
default:
$type = '<span class="label
label-default">'.JText::_('COM_PHOCACART_GENERAL').'</span>';
break;
}
echo $r->td($type, "small");
$checkO = $this->escape($item->title);
echo $r->td('<b>'.$checkO.'</b>',
"small");
//echo $r->td(JHtml::date($v->date,
JText::_('DATE_FORMAT_LC5')), "small");
//echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'].'.',
$canChange), "small");
echo $r->td($item->user_username, "small");
echo $r->td($item->ip, "small");
// Because of Chrome
$item->incoming_page = str_replace('?',
'<wbr>?', $item->incoming_page);
$item->incoming_page = str_replace('&',
'<wbr>&', $item->incoming_page);
echo $r->td($item->incoming_page, "small
ph-incoming-page");
echo
$r->td('<textarea>'.$item->description.'</textarea>');
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 10);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,#views/phocacartlogs/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�QB!views/phocacartlogs/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport('joomla.application.component.view');
class PhocaCartCpViewPhocacartLogs extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('log');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
$paramsC =
PhocacartUtils::getComponentParameters();
$this->t['enable_logging'] =
$paramsC->get('enable_logging', 0);
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once JPATH_COMPONENT . '/helpers/' .
$this->t['tasks'] . '.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']) .
'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.log_id'));
JToolbarHelper::title(JText::_($this->t['l'] .
'_SYSTEM_LOG'), 'list');
// This button is unnecessary but it is displayed because Joomla!
design bug
$bar = JToolbar::getInstance('toolbar');
$dhtml = '<a
href="index.php?option=com_phocacart" class="btn
btn-small"><i class="icon-home-2" title="' .
JText::_('COM_PHOCACART_CONTROL_PANEL') .
'"></i> ' .
JText::_('COM_PHOCACART_CONTROL_PANEL') . '</a>';
$bar->appendButton('Custom', $dhtml);
/*
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}*/
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList($this->t['l'] .
'_WARNING_DELETE_ITEMS', 'phocacartlogs.delete',
$this->t['l'] . '_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help('screen.' .
$this->t['c'], true);
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.date' => JText::_($this->t['l'] .
'_DATE'),
'a.type' => JText::_($this->t['l'] .
'_TYPE'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'user_username' =>
JText::_($this->t['l'] . '_USER'),
'a.ip' => JText::_($this->t['l'] .
'_IP'),
'a.incoming_page' =>
JText::_($this->t['l'] . '_INCOMING_PAGE'),
'a.description' =>
JText::_($this->t['l'] . '_MESSAGE'),
'a.published' =>
JText::_($this->t['l'] . '_PUBLISHED'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,!views/phocacartmanager/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�;%'views/phocacartmanager/tmpl/default.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tooltip');
Joomla\CMS\HTML\HTMLHelper::_('behavior.multiselect');
Joomla\CMS\HTML\HTMLHelper::_('dropdown.init');
Joomla\CMS\HTML\HTMLHelper::_('formbehavior.chosen',
'select');
$r = new PhocacartRenderAdminview();
echo '<div id="phocacartmanager">';
echo '<div class="span12 form-horizontal">';
echo '<div class="ph-admin-path">' .
JText::_('COM_PHOCACART_PATH'). ':
'.JPath::clean($this->t['path']['orig_abs_ds'].
$this->folderstate->folder) .'</div>';
//$countFaF = count($this->images) + count($this->folders);
echo '<table class="table table-hover table-condensed
ph-multiple-table">'
.'<thead>'
.'<tr>';
echo '<th class=" ph-check">'. "\n";
//echo '<input type="checkbox"
name="checkall-toggle" value=""
title="'.JText::_('JGLOBAL_CHECK_ALL').'"
onclick="Joomla.checkAll(this)" />'. "\n";
echo '</th>'. "\n";
echo '<th width="20"> </th>'
.'<th width="95%">'.JText::_(
$this->t['l'].'_FILENAME' ).'</th>'
.'</tr>'
.'</thead>';
echo '<tbody>';
echo $this->loadTemplate('up');
if (count($this->files) > 0 || count($this->folders) > 0) {
echo '<div>';
for ($i=0,$n=count($this->folders); $i<$n; $i++) :
$this->setFolder($i);
$this->folderi = $i;
echo $this->loadTemplate('folder');
endfor;
for ($i=0,$n=count($this->files); $i<$n; $i++) :
$this->setFile($i);
$this->filei = $i;
echo $this->loadTemplate('file');
endfor;
echo '</div>';
} else {
echo '<tr>'
.'<td> </td>'
.'<td> </td>'
.'<td>'.JText::_(
$this->t['l'].'_THERE_IS_NO_FILE'
).'</td>'
.'</tr>';
}
echo '</tbody>'
.'</table>';
echo '<div style="border-bottom:1px solid
#cccccc;margin-bottom: 10px"> </div>';
/*
echo '<ul class="nav nav-tabs"
id="configTabs">';
if((int)$this->t['enablemultiple'] >= 0) {
$label = Joomla\CMS\HTML\HTMLHelper::_( 'image',
$this->t['i'].'icon-16-upload-multiple.png','')
.
' '.JText::_($this->t['l'].'_MULTIPLE_UPLOAD');
echo '<li><a href="#multipleupload"
data-toggle="tab">'.$label.'</a></li>';
}
$label = Joomla\CMS\HTML\HTMLHelper::_( 'image',
$this->t['i'].'icon-16-upload.png','') .
' '.JText::_($this->t['l'].'_UPLOAD');
echo '<li><a href="#upload"
data-toggle="tab">'.$label.'</a></li>';
$label = Joomla\CMS\HTML\HTMLHelper::_( 'image',
$this->t['i'].'icon-16-folder.png','') .
' '.JText::_($this->t['l'].'_CREATE_FOLDER');
echo '<li><a href="#createfolder"
data-toggle="tab">'.$label.'</a></li>';
echo '</ul>';
*/
$activeTab = 'multipleupload';
if (isset($this->t['tab']) &&
$this->t['tab'] != '') {
$activeTab = $this->t['tab'];
}
echo $r->startTabs($activeTab);
echo $r->startTabs();
$tabs = array();
$tabs['multipleupload'] = '<span
class="ph-cp-item"><i class="phi phi-fs-s phi-fc-bl
duotone icon-upload"></i></span>' .
' '.JText::_('COM_PHOCACART_MULTIPLE_UPLOAD');
$tabs['upload'] = '<span
class="ph-cp-item"><i class="phi phi-fs-s phi-fc-bd
duotone icon-upload"></i></span>' .
' '.JText::_('COM_PHOCACART_UPLOAD');
$tabs['createfolder'] = '<span
class="ph-cp-item"><i class="phi phi-fs-s phi-fc-brd
duotone icon-folder"></i></span>' .
' '.JText::_('COM_PHOCACART_CREATE_FOLDER');
echo $r->navigation($tabs, $activeTab);
echo $r->startTab('multipleupload',
$tabs['multipleupload'], $activeTab == 'multipleupload'
? 'active' : '');
echo $this->loadTemplate('multipleupload');
echo $r->endTab();
echo $r->startTab('upload', $tabs['upload'],
$activeTab == 'upload' ? 'active' : '');
echo $this->loadTemplate('upload');
echo $r->endTab();
echo $r->startTab('createfolder',
$tabs['createfolder'], $activeTab == 'createfolder' ?
'active' : '');
echo
PhocacartFileUpload::renderCreateFolder($this->session->getName(),
$this->session->getId(), $this->currentFolder,
'phocacartmanager',
'manager='.$this->manager.'&tab=createfolder&field='.
$this->field );
echo $r->endTab();
echo $r->endTabs();
echo '</div>';
echo '</div>';
if ($this->t['tab'] != '') {$jsCt =
'a[href=#'.PhocacartText::filterValue($this->t['tab'],
'alphanumeric') .']';} else {$jsCt =
'a:first';}
echo '<script type="text/javascript">';
echo ' jQuery(\'#configTabs
'.$jsCt.'\').tab(\'show\');'; // Select first
tab
echo '</script>';
?>
PK�"�[�s�/,views/phocacartmanager/tmpl/default_file.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.filesystem.file' );
$ext = PhocacartFile::getExtension(
$this->_tmp_file->path_without_name_relative );
$group = PhocacartUtilsSettings::getManagerGroup($this->manager);
if ($this->manager == 'productimage' || $this->manager ==
'categoryimage') {
/* Own function - this function is used for e.g. additional images, etc.
for input forms which
are rendered by javascript - addtional images, attribute options
(values), etc.
Do request - create thumbnails = yes
There are more form fields mostly made by javascript (e.g. add new
attribute row)
*/
$path = PhocacartPath::getPath($this->manager);
$pathImage = Juri::root() . $path['orig_rel_ds'];
$url =
'index.php?option=com_phocacart&view=phocacartthumba&format=json&tmpl=component&'.
JSession::getFormToken().'=1';
$jsParams = '{'
.' request: 1,'
.' manager: \''.$this->manager.'\','
.' pathimage:
\''.strip_tags(addslashes($pathImage)).'\','
.' requesturl: \''.$url.'\','
.' requestmsg:
\''.strip_tags(addslashes(JText::_('COM_PHOCACART_CHECKING_IMAGE_THUMBNAIL_PLEASE_WAIT'))).'\''
.'}';
$onclick= 'if (window.parent)
window.parent.phAddValueImage(\''.PhocacartText::filterValue($this->field,
'alphanumeric2').'\', \''
.PhocacartText::filterValue($this->_tmp_file->path_with_name_relative_no,
'folderpath').'\', '.$jsParams.')';
} else if ($this->manager == 'attributefile'){
// Skip doing request - no thumbnails for downloadable files
// There are more form fields mostly made by javascript (e.g. add new
attribute row)
/*$path = PhocacartPath::getPath($this->manager);
$pathImage = Juri::root() . $path['orig_rel_ds'];
$url =
'index.php?option=com_phocacart&view=phocacartthumba&format=json&tmpl=component&'.
JSession::getFormToken().'=1';
$jsParams = '{
request: 1,
manager: "'.$this->manager.'",
pathimage: "'.strip_tags(addslashes($pathImage)).'",
requesturl: "'.$url.'",
requestmsg:
"'.strip_tags(addslashes(JText::_('COM_PHOCACART_CHECKING_IMAGE_THUMBNAIL_PLEASE_WAIT'))).'"
}';*/
$onclick= 'if (window.parent)
window.parent.phAddValueFile(\''.PhocacartText::filterValue($this->field,
'alphanumeric2').'\', \''
.PhocacartText::filterValue($this->_tmp_file->path_with_name_relative_no,
'folderpath').'\')';
} else {
// Form field is one and the function is set for this form field
// productfile, publicfile
$onclick= 'if (window.parent)
window.parent.phAddValueFile(\''.PhocacartText::filterValue($this->field,
'alphanumeric2').'\', \''
.PhocacartText::filterValue($this->_tmp_file->path_with_name_relative_no,
'folderpath').'\')';
}
if ($this->manager == 'filemultiple') {
$checked = Joomla\CMS\HTML\HTMLHelper::_('grid.id',
$this->filei + count($this->folders),
$this->files[$this->filei]->path_with_name_relative_no );
$icon = PhocacartFile::getMimeTypeIcon($this->_tmp_file->name);
echo '<tr>'
.' <td>'. $checked .'</td>'
.' <td class="ph-img-table">'
. $icon .'</a></td>'
.' <td>' . $this->_tmp_file->name .
'</td>'
.'</tr>';
} else {
if (($group['i'] == 1) && ($ext == 'png' ||
$ext == 'jpg' || $ext == 'gif' || $ext ==
'jpeg' || $ext = 'webp') ) {
echo '<tr>'
.'<td></td>'
.'<td>'
.'<a href="#"
onclick="'.$onclick.'">'
. Joomla\CMS\HTML\HTMLHelper::_( 'image', str_replace(
'../', '',
$this->_tmp_file->path_without_name_relative),
JText::_('COM_PHOCACART_INSERT'), array('title' =>
JText::_('COM_PHOCACART_INSERT_IMAGE'), 'width' =>
'16', 'height' => '16'))
.'</a>'
.' <td>'
.'<a href="#"
onclick="'.$onclick.'">'
. $this->_tmp_file->name
.'</a>'
.'</td>'
.'</tr>';
} else {
echo '<tr>'
.'<td></td>'
.'<td>'
.'<a href="#"
onclick="'.$onclick.'">'
. Joomla\CMS\HTML\HTMLHelper::_( 'image',
$this->t['i'].'icon-16-file-insert.png',
'', JText::_('COM_PHOCACART_INSERT_FILENAME'))
.'</a>'
.' <td>'
.'<a href="#"
onclick="'.$onclick.'">'
. $this->_tmp_file->name
.'</a>'
.'</td>'
.'</tr>';
}
}
?>
PK�"�[+�]:66.views/phocacartmanager/tmpl/default_folder.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$group = PhocacartUtilsSettings::getManagerGroup($this->manager);
if ($this->manager == 'filemultiple') {
$checked = Joomla\CMS\HTML\HTMLHelper::_('grid.id',
$this->folderi,
$this->folders[$this->folderi]->path_with_name_relative_no, 0,
'foldercid' );
$link =
'index.php?option=com_phocacart&view=phocacartmanager'
.'&manager='.$this->manager
.$group['c']
.'&folder='.$this->_tmp_folder->path_with_name_relative_no
.'&field='. $this->field;
echo '<tr>'
.' <td>'. $checked .'</td>'
.' <td class="ph-img-table"><a href="'.
JRoute::_( $link ).'">'
. Joomla\CMS\HTML\HTMLHelper::_( 'image',
$this->t['i'].'icon-16-folder-small.png',
'').'</a></td>'
.' <td><a href="'. JRoute::_( $link
).'">'.
$this->_tmp_folder->name.'</a></td>'
.'</tr>';
} else {
$link =
'index.php?option=com_phocacart&view=phocacartmanager'
.'&manager='.
PhocacartText::filterValue($this->manager, 'alphanumeric')
. $group['c']
.'&folder='.PhocacartText::filterValue($this->_tmp_folder->path_with_name_relative_no,
'folderpath')
.'&field='.
PhocacartText::filterValue($this->field, 'alphanumeric2');
echo '<tr>'
.' <td></td>'
.' <td class="ph-img-table"><a href="'.
JRoute::_( $link ).'">'
. Joomla\CMS\HTML\HTMLHelper::_( 'image',
$this->t['i'].'icon-16-folder-small.png',
JText::_('COM_PHOCACART_OPEN')).'</a></td>'
.' <td><a href="'. JRoute::_( $link
).'">'.
$this->_tmp_folder->name.'</a></td>'
.'</tr>';
}
?>
PK�"�[�N����6views/phocacartmanager/tmpl/default_multipleupload.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
echo '<div
id="'.$this->t['c'].'-multipleupload"
class="ph-in">';
echo $this->t['mu_response_msg'] ;
echo '<form action="'.
JURI::base().'index.php?option='.$this->t['o'].'"
>';
if ($this->t['ftp']) {echo
PhocacartFileUpload::renderFTPaccess();}
echo '<div class="ph-head-form-small">' .
JText::_( $this->t['l'].'_UPLOAD_FILE' );
if (isset($this->tmpl['uploadmaxsizeread']) &&
$this->tmpl['uploadmaxsizeread'] &&
$this->tmpl['uploadmaxsizeread'] != '0 B' ) {
echo ' [ ' . JText::_(
$this->t['l'].'_MAX_SIZE'
).': '.$this->tmpl['uploadmaxsizeread'].']';
}
echo '</div>';
echo
'<small>'.JText::_($this->t['l'].'_SELECT_FILES').'.
'.JText::_($this->t['l'].'_ADD_FILES_TO_UPLOAD_QUEUE_AND_CLICK_START_BUTTON').'</small>';
echo $this->t['mu_output'];
echo '</form>';
echo '</div>';
?>
PK�"�[Z���*views/phocacartmanager/tmpl/default_up.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$group = PhocacartUtilsSettings::getManagerGroup($this->manager);
if ($this->currentFolder === '' || ($this->currentFolder ==
$this->downloadFolder)) {
// Don't display arrow up when we are in root or download file
root (download file root = download token folder)
} else {
$link =
'index.php?option='.$this->t['o'].'&view='.
PhocacartText::filterValue($this->t['task'],
'alphanumeric').'&manager='.PhocacartText::filterValue($this->manager,
'alphanumeric') . $group['c']
.'&folder='.PhocacartText::filterValue($this->folderstate->parent,
'folderpath') .'&field='.
PhocacartText::filterValue($this->field, 'alphanumeric2');
echo '<tr><td> </td>'
.'<td class="ph-img-table">'
.'<a href="'.$link.'" >'
. Joomla\CMS\HTML\HTMLHelper::_( 'image',
$this->t['i'].'icon-16-up.png',
'').'</a>'
.'</td>'
.'<td><a href="'.$link.'"
>..</a></td>'
.'</tr>';
}
PK�"�[�7��%%.views/phocacartmanager/tmpl/default_upload.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
echo '<div
id="'.$this->t['c'].'-upload"
class="ph-in">';
echo '<div id="upload-noflash"
class="actions">';
echo '<form action="'. $this->t['su_url']
.'" id="uploadFormU" method="post"
enctype="multipart/form-data">';
if ($this->t['ftp']) { echo
PhocacartFileUpload::renderFTPaccess();}
echo '<div class="ph-head-form-small">' .
JText::_( $this->t['l'].'_UPLOAD_FILE' );
if (isset($this->tmpl['uploadmaxsizeread']) &&
$this->tmpl['uploadmaxsizeread'] &&
$this->tmpl['uploadmaxsizeread'] != '0 B' ) {
echo ' [ ' . JText::_(
$this->t['l'].'_MAX_SIZE'
).': '.$this->tmpl['uploadmaxsizeread'].']';
}
echo '</div>';
echo $this->t['su_output'];
echo '</form>';
echo '</div>';
echo '</div>';
?>
PK�"�[�#o,,&views/phocacartmanager/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[����$views/phocacartmanager/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.client.helper' );
jimport( 'joomla.application.component.view' );
jimport( 'joomla.html.pane' );
class PhocaCartCpViewPhocaCartManager extends JViewLegacy
{
protected $field;
protected $fce;
protected $type;
protected $folderstate;
protected $images;
protected $manager;
protected $folders;
protected $tmpl;
protected $session;
protected $currentFolder;
protected $downloadFolder;
protected $t;
protected $r;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('manager');
$this->r = new PhocacartRenderAdminview();
$this->field =
JFactory::getApplication()->input->get('field');
$this->fce = 'phocaSelectFileName_'.$this->field;
$this->manager = JFactory::getApplication()->input->get(
'manager', '', 'file' );
$this->downloadFolder = JFactory::getApplication()->input->get(
'downloadfolder', '', 'string' );
$downloadFolderExists =
PhocacartFile::createDownloadFolder($this->downloadFolder);
$this->folderstate = $this->get('FolderState');
$this->files = $this->get('Files');
$this->folders = $this->get('Folders');
$this->session = JFactory::getSession();
$params = JComponentHelper::getParams($this->t['o']);
$this->t['multipleuploadchunk'] = $params->get(
'multiple_upload_chunk', 0 );
$this->t['uploadmaxsize'] = $params->get(
'upload_maxsize', 3145728 );
$this->t['uploadmaxsizeread'] =
PhocacartFile::getFileSizeReadable($this->t['uploadmaxsize']);
$this->t['enablemultiple'] = $params->get(
'enable_multiple', 0 );
$this->t['multipleuploadmethod'] = $params->get(
'multiple_upload_method', 4 );
/*if ($this->manager == 'filemultiple') {
$this->form = $this->get('Form');
}*/
$this->currentFolder = '';
if (isset($this->folderstate->folder) &&
$this->folderstate->folder != '') {
$this->currentFolder = $this->folderstate->folder;
}
// - - - - - - - - - -
//TABS
// - - - - - - - - - -
$this->t['tab'] =
JFactory::getApplication()->input->get('tab', '',
'', 'string');
$this->t['currenttab']['upload'] = 1;
if((int)$this->t['enablemultiple'] >= 0) {
$this->t['currenttab']['multipleupload'] = 1;
}
$group = PhocacartUtilsSettings::getManagerGroup($this->manager);
// - - - - - - - - - - -
// Upload
// - - - - - - - - - - -
$sU = new PhocacartFileUploadsingle();
$sU->returnUrl =
'index.php?option=com_phocacart&view=phocacartmanager&tab=upload'.str_replace('&',
'&',
$group['c']).'&manager='.PhocacartText::filterValue($this->manager,
'alphanumeric').'&field='.PhocacartText::filterValue($this->field,
'alphanumeric2').'&folder='.
PhocacartText::filterValue($this->currentFolder,
'folderpath');
$sU->tab = 'upload';
$this->t['su_output'] = $sU->getSingleUploadHTML();
$this->t['su_url'] =
JURI::base().'index.php?option=com_phocacart&task=phocacartupload.upload&'
.$this->session->getName().'='.$this->session->getId().'&'
.
JSession::getFormToken().'=1&viewback=phocacartmanager&manager='.PhocacartText::filterValue($this->manager,
'alphanumeric').'&field='.PhocacartText::filterValue($this->field,
'alphanumeric2').'&'
.'folder='.
PhocacartText::filterValue($this->currentFolder,
'folderpath').'&tab=upload';
// - - - - - - - - - - -
// Multiple Upload
// - - - - - - - - - - -
// Get infos from multiple upload
$muFailed = JFactory::getApplication()->input->get(
'mufailed', '0', '', 'int' );
$muUploaded = JFactory::getApplication()->input->get(
'muuploaded', '0', '', 'int' );
$this->t['mu_response_msg'] = $muUploadedMsg =
'';
if ($muUploaded > 0) {
$muUploadedMsg =
JText::_('COM_PHOCACART_COUNT_UPLOADED_FILE'). ': ' .
$muUploaded;
}
if ($muFailed > 0) {
$muFailedMsg =
JText::_('COM_PHOCACART_COUNT_NOT_UPLOADED_FILE'). ': '
. $muFailed;
}
if ($muFailed > 0 && $muUploaded > 0) {
$this->t['mu_response_msg'] = '<div
class="alert alert-info">'
.'<button type="button" class="close"
data-dismiss="alert">×</button>'
.JText::_('COM_PHOCACART_COUNT_UPLOADED_FILE'). ': '
. $muUploaded .'<br />'
.JText::_('COM_PHOCACART_COUNT_NOT_UPLOADED_FILE'). ':
' . $muFailed.'</div>';
} else if ($muFailed > 0 && $muUploaded == 0) {
$this->t['mu_response_msg'] = '<div
class="alert alert-error">'
.'<button type="button" class="close"
data-dismiss="alert">×</button>'
.JText::_('COM_PHOCACART_COUNT_NOT_UPLOADED_FILE'). ':
' . $muFailed.'</div>';
} else if ($muFailed == 0 && $muUploaded > 0){
$this->t['mu_response_msg'] = '<div
class="alert alert-success">'
.'<button type="button" class="close"
data-dismiss="alert">×</button>'
.JText::_('COM_PHOCACART_COUNT_UPLOADED_FILE'). ': '
. $muUploaded.'</div>';
} else {
$this->t['mu_response_msg'] = '';
}
if((int)$this->t['enablemultiple'] >= 0) {
PhocacartFileUploadmultiple::renderMultipleUploadLibraries();
$mU = new PhocacartFileUploadmultiple();
$mU->frontEnd = 0;
$mU->method = $this->t['multipleuploadmethod'];
$mU->url =
JURI::base().'index.php?option=com_phocacart&task=phocacartupload.multipleupload&'
.$this->session->getName().'='.$this->session->getId().'&'
.
JSession::getFormToken().'=1&tab=multipleupload&manager='.PhocacartText::filterValue($this->manager,
'alphanumeric').'&field='.PhocacartText::filterValue($this->field,
'alphanumeric2').'&folder='.
PhocacartText::filterValue($this->currentFolder,
'folderpath');
$mU->reload =
JURI::base().'index.php?option=com_phocacart&view=phocacartmanager'
.str_replace('&', '&',
$group['c']).'&'
.$this->session->getName().'='.$this->session->getId().'&'
.
JSession::getFormToken().'=1&tab=multipleupload&'
.'manager='.PhocacartText::filterValue($this->manager,
'alphanumeric').'&field='.PhocacartText::filterValue($this->field,
'alphanumeric2').'&folder='.
PhocacartText::filterValue($this->currentFolder,
'folderpath');
$mU->maxFileSize =
PhocacartFileUploadmultiple::getMultipleUploadSizeFormat($this->t['uploadmaxsize']);
$mU->chunkSize = '1mb';
$mU->renderMultipleUploadJS(0,
$this->t['multipleuploadchunk']);
$this->t['mu_output']= $mU->getMultipleUploadHTML();
}
$this->t['ftp'] =
!JClientHelper::hasCredentials('ftp');
$this->t['path'] =
PhocacartPath::getPath($this->manager);
$this->addToolbar();
$media = new PhocacartRenderAdminmedia();
parent::display($tpl);
echo Joomla\CMS\HTML\HTMLHelper::_('behavior.keepalive');
}
function setFolder($index = 0) {
if (isset($this->folders[$index])) {
$this->_tmp_folder = &$this->folders[$index];
} else {
$this->_tmp_folder = new JObject;
}
}
function setFile($index = 0) {
if (isset($this->files[$index])) {
$this->_tmp_file = &$this->files[$index];
} else {
$this->_tmp_file = new JObject;
}
}
protected function addToolbar() {
JFactory::getApplication()->input->set('hidemainmenu',
true);
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['task'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['task']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.multiple'));
//JToolbarHelper::title( JText::_(
$this->t['l'].'_MULTIPLE_ADD' ),
'multiple.png' );
if ($canDo->get('core.create')){
JToolbarHelper::save($this->t['c'].'m.save',
'JTOOLBAR_SAVE');
}
JToolbarHelper::cancel($this->t['c'].'m.cancel',
'JTOOLBAR_CLOSE');
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,&views/phocacartmanufacturer/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[*�����)views/phocacartmanufacturer/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('title', 'alias',
'image', 'link', 'ordering');
echo $r->group($this->form, $formArray);
$formArray = array('description');
echo $r->group($this->form, $formArray, 1);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs();
echo $r->endForm();
?>
PK�"�[�#o,,+views/phocacartmanufacturer/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[S]z.��)views/phocacartmanufacturer/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartManufacturer extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $attributeoption;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('manufacturer');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.manufacturer_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_MANUFACTURER' ).': <small><small>[ ' .
$text.' ]</small></small>' , 'home');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,'views/phocacartmanufacturers/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[;'��gg-views/phocacartmanufacturers/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*echo $r->startFilterBar();
echo $r->inputFilterSearch($this->t['l'] .
'_FILTER_SEARCH_LABEL', $this->t['l'] .
'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();
*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th class="ph-title">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_TITLE', 'a.title',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-productcount">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_PRODUCT_COUNT',
'a.count_products', $listDirn, $listOrder) .
'</th>' . "\n";
echo '<th class="ph-published">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_PUBLISHED',
'a.published', $listDirn, $listOrder) . '</th>' .
"\n";
echo '<th class="ph-id">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_ID', 'a.id', $listDirn,
$listOrder) . '</th>' . "\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart &&
$j < (int)$this->pagination->limit) {
$j++;
$urlEdit = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'] . '.edit&id=';
$urlTask = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') || $item->checked_out ==
$user->get('id') || $item->checked_out == 0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_($urlEdit . $item->id);
echo $r->startTr($i, isset($item->catid) ?
(int)$item->catid : 0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .=
Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'] . '.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="' . JRoute::_($linkEdit)
. '">' . $this->escape($item->title) .
'</a>';
} else {
$checkO .= $this->escape($item->title);
}
echo $r->td($checkO, "small");
$pC = '<div class="center">' .
$item->count_products;
if (PhocacartUtils::validateDate($item->count_date)) {
$pC .= '<br><small
class="nowrap">(' .
Joomla\CMS\HTML\HTMLHelper::_('date', $item->count_date,
'd-m-Y H:i') . ')</small>';
}
$pC .= '</div>';
echo $r->td($pC, "small");
echo
$r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'] . '.',
$canChange), "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 6);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,,views/phocacartmanufacturers/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[Ā
*views/phocacartmanufacturers/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartManufacturers extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('manufacturer');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.manufacturer_id'));
$bar = JToolbar::getInstance('toolbar');
JToolbarHelper::title( JText::_(
$this->t['l'].'_MANUFACTURERS' ), 'home'
);
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartmanufacturers.delete',
$this->t['l'].'_DELETE');
}
$dhtml = '<button
onclick="javascript:if(document.adminForm.boxchecked.value==0){alert(\''.JText::_('COM_PHOCACART_WARNING_COUNT_PRODUCTS_MAKE_SELECTION').'\');}else{Joomla.submitbutton(\'phocacartmanufacturer.countproducts\');}"
class="btn btn-small button-plus"><i
class="icon-plus"
title="'.JText::_($this->t['l'].'_COUNT_PRODUCTS').'"></i>
'.JText::_($this->t['l'].'_COUNT_PRODUCTS').'</button>';
$bar->appendButton('Custom', $dhtml,
'countproducts');
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.count_products' => JText::_($this->t['l']
. '_PRODUCT_COUNT'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,views/phocacartorder/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[TE6�``"views/phocacartorder/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\Factory;
defined('_JEXEC') or die();
$r = new PhocacartRenderAdminview();
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'order' =>
JText::_($this->t['l'].'_ORDER_OPTIONS'),
'billingaddress' =>
JText::_($this->t['l'].'_BILLING_ADDRESS'),
'shippingaddress' =>
JText::_($this->t['l'].'_SHIPPING_ADDRESS'),
'tracking' =>
JText::_($this->t['l'].'_SHIPMENT_TRACKING_OPTIONS'),
'products' =>
JText::_($this->t['l'].'_ORDERED_PRODUCTS'),
'download' =>
JText::_($this->t['l'].'_DOWNLOAD_LINKS'),
'orderlink' =>
JText::_($this->t['l'].'_ORDER_LINK'),
'billing' =>
JText::_($this->t['l'].'_BILLING'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('order', $tabs['order'],
'active');
echo
$r->itemText(PhocacartOrder::getOrderNumber($this->itemcommon->id,
$this->itemcommon->date, $this->itemcommon->order_number),
JText::_('COM_PHOCACART_ORDER_NUMBER'));
$user = $this->itemcommon->user_name;
if ($this->itemcommon->user_username != '') {
$user .= '
<small>('.$this->itemcommon->user_username.')</small>';
}
if ($user != '') {
echo $r->itemText($user, JText::_('COM_PHOCACART_USER'));
} else {
echo $r->itemText('<span class="label label-info badge
badge-info">'.JText::_('COM_PHOCACART_GUEST').'</span>',
JText::_('COM_PHOCACART_USER'));
}
if (isset($this->itemcommon->vendor_name) &&
$this->itemcommon->vendor_name != '') {
$vendor = $this->itemcommon->vendor_name;
if ($this->itemcommon->vendor_username != '') {
$vendor .= '
<small>('.$this->itemcommon->vendor_username.')</small>';
}
echo $r->itemText($vendor,
JText::_('COM_PHOCACART_VENDOR'));
}
if (isset($this->itemcommon->section_name) &&
$this->itemcommon->section_name != '') {
echo $r->itemText($this->itemcommon->section_name,
JText::_('COM_PHOCACART_SECTION'));
}
if (isset($this->itemcommon->unit_name) &&
$this->itemcommon->unit_name != '') {
echo $r->itemText($this->itemcommon->unit_name,
JText::_('COM_PHOCACART_UNIT'));
}
if (isset($this->itemcommon->ticket_id) &&
$this->itemcommon->ticket_id != '') {
echo $r->itemText($this->itemcommon->ticket_id,
JText::_('COM_PHOCACART_TICKET'));
}
echo $r->itemText($this->itemcommon->ip,
JText::_('COM_PHOCACART_USER_IP'));
echo $r->itemText($this->itemcommon->user_agent,
JText::_('COM_PHOCACART_USER_AGENT'));
echo $r->itemText(JHtml::date($this->itemcommon->date,
JText::_('DATE_FORMAT_LC2')),
JText::_('COM_PHOCACART_DATE'));
if ($this->itemcommon->currencytitle != '') {
echo $r->itemText($this->itemcommon->currencytitle,
JText::_('COM_PHOCACART_CURRENCY'));
}
if ($this->itemcommon->discounttitle != '') {
echo $r->itemText($this->itemcommon->discounttitle,
JText::_('COM_PHOCACART_CART_DISCOUNT'));
}
if ($this->itemcommon->coupontitle != '') {
echo $r->itemText($this->itemcommon->coupontitle,
JText::_('COM_PHOCACART_COUPON'));
}
if ($this->itemcommon->shippingtitle != '') {
echo $r->itemText($this->itemcommon->shippingtitle,
JText::_('COM_PHOCACART_SHIPPING_METHOD'));
}
if (isset($this->itemcommon->shipping_id) &&
(int)$this->itemcommon->shipping_id > 0 &&
isset($this->itemcommon->params_shipping)) {
//$shipping = new PhocacartShipping();
//$shippingMethod =
$shipping->getShippingMethod((int)$this->itemcommon->shipping_id);
$paramsShipping = json_decode($this->itemcommon->params_shipping,
true);
if (isset($paramsShipping['method']) &&
$paramsShipping['method'] != '') {
JPluginHelper::importPlugin('pcs',
htmlspecialchars(strip_tags($paramsShipping['method'])));
$eventData = array();
$eventData['pluginname'] =
htmlspecialchars(strip_tags($paramsShipping['method']));
$eventData['item']['id'] =
(int)$this->itemcommon->id;
$eventData['item']['shipping_id'] =
(int)$this->itemcommon->shipping_id;
$results =
Factory::getApplication()->triggerEvent('PCSgetShippingBrancheInfoAdmin',
array('com_phocacart.phocacartorder', $eventData));
if (!empty($results)) {
echo trim(implode("\n", $results));
}
}
}
if ($this->itemcommon->paymenttitle != '') {
echo $r->itemText($this->itemcommon->paymenttitle,
JText::_('COM_PHOCACART_PAYMENT_METHOD'));
}
$formArray = array ('id', 'status_id',
'order_token', 'comment', 'terms',
'privacy', 'newsletter');
echo $r->group($this->form, $formArray);
echo $r->endTab();
$data = PhocacartUser::getAddressDataForm($this->formbas,
$this->fieldsbas['array'], $this->u, '_phb',
'_phs');
echo $r->startTab('billingaddress',
$tabs['billingaddress']);
echo $data['b'];
echo $r->endTab();
echo $r->startTab('shippingaddress',
$tabs['shippingaddress']);
echo $data['s'];
echo $r->endTab();
echo $r->startTab('tracking', $tabs['tracking']);
if ($this->itemcommon->shippingtrackinglink != '') {
PhocacartRenderJs::renderJsAddTrackingCode('jform_tracking_number',
'tracking-link');
echo $r->itemText($this->itemcommon->shippingtrackinglink,
JText::_('COM_PHOCACART_TRACKING_LINK'),
'tracking-link');
}
$formArray = array ('tracking_number',
'tracking_link_custom', 'tracking_date_shipped',
'tracking_description_custom');
echo $r->group($this->form, $formArray);
if ($this->itemcommon->shippingtrackingdescription != '')
{
echo $r->itemText($this->itemcommon->shippingtrackingdescription,
JText::_('COM_PHOCACART_TRACKING_DESCRIPTION'));
}
echo $r->endTab();
echo $r->startTab('products', $tabs['products']);
echo '<table class="ph-order-products"
id="phAdminEditProducts">';
if (!empty($this->itemproducts)) {
echo '<tr>';
echo
'<th>'.JText::_('COM_PHOCACART_TITLE').'</th>';
echo
'<th>'.JText::_('COM_PHOCACART_QUANTITY').'</th>';
echo
'<th>'.JText::_('COM_PHOCACART_PRICE_EXCL_TAX').'</th>';
echo
'<th>'.JText::_('COM_PHOCACART_TAX').'</th>';
echo
'<th>'.JText::_('COM_PHOCACART_PRICE_INCL_TAX').'</td>';
echo
'<th>'.JText::_('COM_PHOCACART_PUBLISHED').'</td>';
echo
'<th>'.JText::_('COM_PHOCACART_AMOUNT').'</td>';
echo '</tr>';
foreach($this->itemproducts as $k => $v) {
echo '<tr>';
echo '<td>'.$r->itemCalc($v->id, 'title',
$v->title, 'pform', 2).'</td>';
echo '<td>'.$r->itemCalc($v->id,
'quantity', $v->quantity, 'pform',
0).'</td>';
echo '<td>'.$r->itemCalc($v->id, 'netto',
PhocacartPrice::cleanPrice($v->netto)).'</td>';
echo '<td>'.$r->itemCalc($v->id, 'tax',
PhocacartPrice::cleanPrice($v->tax)).'</td>';
echo '<td>'.$r->itemCalc($v->id,
'brutto',
PhocacartPrice::cleanPrice($v->brutto)).'</td>';
echo '<td
align="center">'.$r->itemCalcCheckBox($v->id,
'published', $v->published).'</td>';
echo '<td class="ph-col-add-cur">( '.
$this->pr->getPriceFormat($v->brutto).' )</td>';
echo '</tr>';
if (!empty($this->itemproductdiscounts[$v->product_id_key])) {
foreach($this->itemproductdiscounts[$v->product_id_key] as $k3
=> $v3) {
echo '<tr>';
//echo '<td></td>';
echo '<td colspan="2"
align="right">'.$v3->title.': </td>';
echo '<td>'.$r->itemCalc($v3->id,
'netto', PhocacartPrice::cleanPrice($v3->netto),
'dform').'</td>';
echo '<td>'.$r->itemCalc($v3->id,
'tax', PhocacartPrice::cleanPrice($v3->tax),
'dform').'</td>';
echo '<td>'.$r->itemCalc($v3->id,
'brutto', PhocacartPrice::cleanPrice($v3->brutto),
'dform').'</td>';
echo '<td
align="center">'.$r->itemCalcCheckBox($v3->id,
'published', $v3->published,
'dform').'</td>';
echo '<td class="ph-col-add-cur">(
'.$this->pr->getPriceFormat($v3->brutto).'
)</td>';
echo '</tr>';
}
}
/*if ($v->dnetto != '' || $v->dbrutto != '' ||
$v->dtax != '') {
echo '<tr>';
echo '<td colspan="2"
align="right">'.JText::_('COM_PHOCACART_PRICE_AFTER_DISCOUNT').':
</td>';
//echo '<td></td>';
echo '<td>'.$r->itemCalc($v->id,
'dnetto',
PhocacartPrice::cleanPrice($v->dnetto)).'</td>';
echo '<td>'.$r->itemCalc($v->id, 'dtax',
PhocacartPrice::cleanPrice($v->dtax)).'</td>';
echo '<td>'.$r->itemCalc($v->id,
'dbrutto',
PhocacartPrice::cleanPrice($v->dbrutto)).'</td>';
echo '<td align="center"></td>';
echo '<td class="ph-col-add-cur">(
'.$this->pr->getPriceFormat($v->dbrutto).'
)</td>';
echo '</tr>';
}*/
if (!empty($v->attributes)) {
foreach ($v->attributes as $k2 => $v2) {
echo '<tr>';
echo '<td align="left">';
echo JText::_('COM_PHOCACART_ATTRIBUTES').': <br
/>';
echo $r->itemCalc($v2->id, 'attribute_title',
$v2->attribute_title, 'aform', 1).' ';
echo ''.$r->itemCalc($v2->id, 'option_title',
$v2->option_title, 'aform', 1);
$size = 1;
if ($v2->type == 10 || $v2->type == 11) {
$size = 3;
}
echo ''.$r->itemCalc($v2->id, 'option_value',
htmlspecialchars(urldecode($v2->option_value)), 'aform',
$size);
echo '</td>';
echo '<td></td>';
echo '<td></td>';
echo '<td></td>';
echo '<td></td>';
echo '<td></td>';
echo '<td></td>';
echo '</tr>';
}
}
}
}
$warningCurrency = 0;
if (!empty($this->itemtotal)) {
echo '<tr><td class="ph-order-products-hr"
colspan="7"> </td></tr>';
echo '<tr><td class=""
colspan="7"> </td></tr>';
foreach($this->itemtotal as $k => $v) {
echo '<tr class="PhocacartRenderAdminview">';
// Language Variables
if ($this->p['order_language_variables'] == 1) {
echo '<td
colspan="3">'.$r->itemCalc($v->id,
'title_lang', $v->title_lang, 'tform', 1).
'';
echo ''.$r->itemCalc($v->id,
'title_lang_suffix', $v->title_lang_suffix, 'tform',
1). '';
echo ''.$r->itemCalc($v->id,
'title_lang_suffix2', $v->title_lang_suffix2,
'tform', 0). '<br>';
echo '<span
class="ph-col-title-small">'.PhocacartLanguage::renderTitle($v->title,
$v->title_lang, array(0 => array($v->title_lang_suffix, '
'), 1 => array($v->title_lang_suffix2, '
'))).'</span></td>';
} else {
echo '<td></td>';
echo '<td
colspan="2">'.$r->itemCalc($v->id,
'title', $v->title, 'tform', 2).
'</td>';
}
$typeTxt = '';
$pos = strpos($v->type, 'brutto');
if ($pos !== false) {
$typeTxt = JText::_('COM_PHOCACART_INCL_TAX_SUFFIX');
}
$pos2 = strpos($v->type, 'netto');
if ($pos2 !== false) {
$typeTxt = JText::_('COM_PHOCACART_EXCL_TAX_SUFFIX');
}
echo '<td
class="ph-col-add-suffix">'.$typeTxt.'</td>';
echo '<td>'.$r->itemCalc($v->id,
'amount', PhocacartPrice::cleanPrice($v->amount),
'tform').'</td>';
echo '<td
align="center">'.$r->itemCalcCheckBox($v->id,
'published', $v->published,
'tform').'</td>';
echo '<td class="ph-col-add-cur">(
'.$this->pr->getPriceFormat($v->amount).'
)</td>';
echo '</tr>';
// ROUNDING CURRENCY
if ($v->type == 'rounding' && $v->amount_currency
> 0 && $v->amount_currency != $v->amount) {
$warningCurrency = 1;
echo '<tr class="ph-currency-row">';
echo '<td></td>';
echo '<td
colspan="2">'.$r->itemCalc($v->id,
'title', $v->title . '
('.JText::_('COM_PHOCACART_CURRENCY').')',
'tform', 2). '</td>';
echo '<td
class="ph-col-add-suffix">'.$typeTxt.'</td>';
echo '<td>'.$r->itemCalc($v->id,
'amount_currency',
PhocacartPrice::cleanPrice($v->amount_currency),
'tform').'</td>';
echo '<td align="center"></td>';
echo '<td
class="ph-col-add-cur"></td>';
echo '</tr>';
}
// BRUTTO CURRENCY
if ($v->type == 'brutto' && $v->amount_currency
> 0 && $v->amount_currency != $v->amount) {
$warningCurrency = 1;
echo '<tr class="ph-currency-row">';
echo '<td></td>';
echo '<td
colspan="2">'.$r->itemCalc($v->id,
'title', $v->title . '
('.JText::_('COM_PHOCACART_CURRENCY').')',
'tform', 2). '</td>';
echo '<td
class="ph-col-add-suffix">'.$typeTxt.'</td>';
echo '<td>'.$r->itemCalc($v->id,
'amount_currency',
PhocacartPrice::cleanPrice($v->amount_currency),
'tform').'</td>';
echo '<td align="center"></td>';
echo '<td
class="ph-col-add-cur"></td>';
echo '</tr>';
}
}
}
echo '</table>';
echo '<div> </div>';
echo '<div
class="ph-order-products-hr"></div>';
echo '<div> </div>';
echo
'<h3>'.JText::_('COM_PHOCACART_TAX_RECAPITULATION').'</h3>';
// Tax Recapitulation
if (!empty($this->itemtaxrecapitulation)) {
// First we render the body of the table to know if there is some currency
value
// If yes then add specific column even add specific column to header
$oTr = array();
$totalCurrency = 0;
foreach($this->itemtaxrecapitulation as $k => $v) {
// Tax recapitulation rounding included rounding (Tax recapitulation
rounding = Tax recapitulation rounding + calculation rounding)
$oTr[] = '<tr>';
// Language Variables
if ($this->p['order_language_variables'] == 1) {
$oTr[] = '<td>'.$r->itemCalc($v->id,
'title_lang', $v->title_lang, 'tcform', 1).
'';
$oTr[] = ''.$r->itemCalc($v->id,
'title_lang_suffix', $v->title_lang_suffix,
'tcform', 1). '';
$oTr[] = ''.$r->itemCalc($v->id,
'title_lang_suffix2', $v->title_lang_suffix2,
'tcform', 0). '<br>';
$oTr[] = '</td>';
} else {
$oTr[] = '<td>'.$r->itemCalc($v->id,
'title', $v->title, 'tcform',
2).'</td>';
}
$oTr[] = '<td>'.$r->itemCalc($v->id,
'amount_netto', PhocacartPrice::cleanPrice($v->amount_netto),
'tcform', 0, 'ph-right').'</td>';
$oTr[] = '<td>'.$r->itemCalc($v->id,
'amount_tax', PhocacartPrice::cleanPrice($v->amount_tax),
'tcform', 0, 'ph-right').'</td>';
$oTr[] = '<td>'.$r->itemCalc($v->id,
'amount_brutto',
PhocacartPrice::cleanPrice($v->amount_brutto), 'tcform', 0,
'ph-right').'</td>';
if ($v->amount_brutto_currency > 0) {
$oTr[] = '<td class="ph-col-add-cur
ph-currency-col">'.$r->itemCalc($v->id,
'amount_brutto_currency',
PhocacartPrice::cleanPrice($v->amount_brutto_currency),
'tcform', 0, 'ph-right').'</td>';
$totalCurrency = 1;
} else {
$oTr[] = '<td class=""></td>';
}
$oTr[] = '</tr>';
$oTr[] = '<tr>';
// Language Variables
if ($this->p['order_language_variables'] == 1) {
$oTr[] = '<td
class="ph-col-title-small">'.PhocacartLanguage::renderTitle($v->title,
$v->title_lang, array(0 => array($v->title_lang_suffix, '
'), 1 => array($v->title_lang_suffix2, '
'))).'</td>';
} else {
$oTr[] = '<td
class="ph-col-add-cur"></td>';
}
$oTr[] = '<td class="ph-col-add-cur">( '.
$this->pr->getPriceFormat($v->amount_netto).'
)</td>';
$oTr[] = '<td class="ph-col-add-cur">( '.
$this->pr->getPriceFormat($v->amount_tax).'
)</td>';
$oTr[] = '<td class="ph-col-add-cur">( '.
$this->pr->getPriceFormat($v->amount_brutto).'
)</td>';
if ($v->amount_brutto_currency > 0) {
$oTr[] = '<td class="ph-col-add-cur
ph-currency-col"></td>';
} else {
$oTr[] = '<td class=""></td>';
}
$oTr[] = '</tr>';
}
echo '<table class="ph-order-tax-recapitulation"
id="phAdminEditTaxRecapitulation">';
echo '<tr>';
echo
'<th>'.JText::_('COM_PHOCACART_TITLE').'</th>';
echo
'<th>'.JText::_('COM_PHOCACART_TAX_BASIS').'</th>';
echo
'<th>'.JText::_('COM_PHOCACART_TAX').'</th>';
echo
'<th>'.JText::_('COM_PHOCACART_TOTAL').'</th>';
if ($totalCurrency == 1) {
echo '<th
class="ph-currency-col">'.JText::_('COM_PHOCACART_TOTAL').'
'.JText::_('COM_PHOCACART_CURRENCY').'</td>';
}
echo '</tr>';
echo implode("\n", $oTr);
echo '</table>';
}
if ($warningCurrency == 1) {
echo '<div> </div>';
echo '<div
class="ph-order-products-hr"></div>';
echo '<div> </div>';
echo '<div class="alert alert-warning">';
echo '<span
class="ph-currency-row"> </span>
'.JText::_('COM_PHOCACART_ROUNDING_CURRENCY_NOT_STORED_IN_DEFAULT_CURRENCY_BUT_ORDER_CURRENCY');
echo '</div>';
}
echo '<div> </div>';
echo '<div
class="ph-order-products-hr"></div>';
echo $r->endTab();
echo $r->startTab('download', $tabs['download']);
if (!empty($this->itemproducts)) {
/*phocacart import('phocacart.path.route');*/
foreach($this->itemproducts as $k => $v) {
echo '<div
class="ph-admin-download-links">';
echo '<h3>'.$v->title.'</h3>';
echo '<table
class="ph-table-download-links">';
echo '<tr><td
width="10%"> </td><td
width="90%"> </td></tr>';
if (!empty($v->downloads)) {
foreach ($v->downloads as $k2 => $v2) {
if ($v2->download_token) {
if ($v2->type == 0 || $v2->type == 1) {
$type = '<span class="label
label-success badge badge-success">' .
JText::_('COM_PHOCACART_DOWNLOAD_FILE') .
'</span>';
} else if ($v2->type == 2) {
$type = '<span class="label label-info
badge badge-info">' .
JText::_('COM_PHOCACART_ADDITIONAL_DOWNLOAD_FILE') .
'</span>';
} /*else {
$type = '<span class="label label-warning
badge
badge-warning">'.JText::_('COM_PHOCACART_DOWNLOAD_FILE_ATTRIBUTE').'</span>';
}*/
echo '<tr><td>' . $type.
'</td>';
echo
'<td>'.htmlspecialchars($v2->download_file) .
'</td></tr>';
//$dLink = JRoute::_(PhocacartRoute::getDownloadRoute()
.
'&o='.htmlspecialchars($this->itemcommon->order_token)
//.
'&d='.htmlspecialchars($v->download_token));
$link = PhocacartRoute::getDownloadRoute() .
'&o=' .
htmlspecialchars($this->itemcommon->order_token)
. '&d=' .
htmlspecialchars($v2->download_token);
$dLink = PhocacartPath::getRightPathLink($link);
echo
'<tr><td>'.JText::_('COM_PHOCACART_DOWNLOAD_LINK').':
</td>';
echo '<td><input type="text"
name="" value="' . $dLink . '"
style="width: 90%;" /></td></tr>';
}
}
if (!empty($v->attributes)) {
foreach ($v->attributes as $k2 => $v2) {
if ($v2->download_token) {
$type = '<span class="label
label-warning badge
badge-warning">'.JText::_('COM_PHOCACART_DOWNLOAD_FILE_ATTRIBUTE').'</span>';
echo
'<tr><td>'.$type.'</td>';
echo
'<td>'.htmlspecialchars($v2->download_file).'</td></tr>';
$link = PhocacartRoute::getDownloadRoute() .
'&o='.$this->itemcommon->order_token.'&d='.htmlspecialchars($v2->download_token);
$dLink = PhocacartPath::getRightPathLink($link);
echo
'<tr><td>'.$v2->attribute_title.':
'.$v2->option_title.'</td>';
echo '<td><input
type="text" name=""
value="'.$dLink.'" style="width: 90%;"
/></td></tr>';
}
}
}
}
echo '</table>';
echo '</div>';
/*
if (isset($v->download_token)) {
echo
'<tr><td>'.$v->title.'</td>';
//$dLink = JRoute::_(PhocacartRoute::getDownloadRoute() .
'&o='.htmlspecialchars($this->itemcommon->order_token)
//.
'&d='.htmlspecialchars($v->download_token));
$link = PhocacartRoute::getDownloadRoute() .
'&o='.htmlspecialchars($this->itemcommon->order_token)
. '&d='.htmlspecialchars($v->download_token);
$dLink = PhocacartPath::getRightPathLink($link);
echo '<td><input type="text"
name="" value="'.$dLink.'" style="width:
90%;" /></td></tr>';
if ($v->download_type == 0 || $v->download_type == 1) {
$type = '<span class="label label-success
badge
badge-success">'.JText::_('COM_PHOCACART_DOWNLOAD_FILE').'</span>';
} else if ($v->download_type == 2) {
$type = '<span class="label label-info badge
badge-info">'.JText::_('COM_PHOCACART_ADDITIONAL_DOWNLOAD_FILE').'</span>';
} /*else {
$type = '<span class="label label-warning
badge
badge-warning">'.JText::_('COM_PHOCACART_DOWNLOAD_FILE_ATTRIBUTE').'</span>';
}*/
/* echo
'<tr><td>'.$type.'</td>';
echo
'<td><small>('.htmlspecialchars($v->download_file).')</small></td></tr>';
// Product Attribute Option Download File
if (!empty($v->attributes)) {
foreach ($v->attributes as $k2 => $v2) {
if ($v2->download_token) {
echo
'<tr><td> </td>';
echo
'<td> </td></tr>';
echo
'<tr><td>'.$v->title.'('.$v2->attribute_title.':
'.$v2->option_title.')</td>';
$link = PhocacartRoute::getDownloadRoute() .
'&o='.$this->itemcommon->order_token.'&d='.htmlspecialchars($v2->download_token);
$dLink = PhocacartPath::getRightPathLink($link);
echo '<td><input
type="text" name=""
value="'.$dLink.'" style="width: 90%;"
/></td></tr>';
$type = '<span class="label
label-warning badge
badge-warning">'.JText::_('COM_PHOCACART_DOWNLOAD_FILE_ATTRIBUTE').'</span>';
echo
'<tr><td>'.$type.'</td>';
echo
'<td><small>('.htmlspecialchars($v2->download_file).')</small></td></tr>';
}
}
}
echo '<tr><td> </td>';
echo '<td> </td></tr>';
}*/
}
//echo '</table>';*/
}
echo $r->endTab();
echo $r->startTab('orderlink', $tabs['orderlink']);
if (isset($this->itemcommon->order_token)) {
if (!empty($this->itemproducts)) {
/*phocacart import('phocacart.path.route');*/
echo '<div
class="ph-admin-order-link">';
echo '<table class="ph-table-order-link">';
echo '<tr><td
width="10%"> </td><td
width="90%"> </td></tr>';
//$dLink = JRoute::_(PhocacartRoute::getDownloadRoute() .
'&o='.htmlspecialchars($this->itemcommon->order_token)
//. '&d='.htmlspecialchars($v->download_token));
$link = PhocacartRoute::getOrdersRoute() .
'&o='.htmlspecialchars($this->itemcommon->order_token);
$oLink = PhocacartPath::getRightPathLink($link);
echo
'<tr><td>'.JText::_('COM_PHOCACART_ORDER_LINK').':
</td><td><input type="text" name=""
value="'.$oLink.'" style="width: 90%;"
/></td></tr>';
echo '</table>';
echo '</div>';
}
}
echo $r->endTab();
echo $r->startTab('billing', $tabs['billing']);
$formArray = array ('order_number', 'order_number_id',
'receipt_number', 'receipt_number_id',
'invoice_number', 'invoice_number_id',
'invoice_prn', 'queue_number',
'queue_number_id', 'invoice_date',
'invoice_due_date', 'invoice_time_of_supply',
'date', 'modified', 'invoice_spec_top_desc',
'invoice_spec_middle_desc', 'invoice_spec_bottom_desc',
'oidn_spec_billing_desc', 'oidn_spec_shipping_desc');
echo $r->group($this->form, $formArray);
echo $r->endTab();
/*
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo '</div>';*/
echo $r->endTabs();
echo '</div>';//end col-xs-12 col-sm-10 col-md-10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2">';
echo '<div class="alert alert-error
alert-danger">'.JText::_('COM_PHOCACART_WARNING_EDIT_ORDER').'</div>';
echo '</div>';//end span2
echo $r->formInputs();
echo $r->endForm();
?>
PK�"�[�#o,,$views/phocacartorder/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[8~����"views/phocacartorder/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartOrder extends JViewLegacy
{
protected $state;
protected $item;
protected $itemcommon;
protected $itemproducts;
protected $itemtotal;
protected $form;
protected $fieldsbas;
protected $formbas;
protected $t;
protected $r;
protected $u;
protected $pr;
protected $p;
public function display($tpl = null) {
$paramsC = PhocacartUtils::getComponentParameters();
$this->p['order_language_variables'] = $paramsC->get(
'order_language_variables', 0 );
$this->t = PhocacartUtils::setVars('order');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$model = $this->getModel();
$this->u = JFactory::getUser($this->item->user_id);
$order = new PhocacartOrderView();
$this->pr = new PhocacartPrice();
$this->pr->setCurrency($this->item->currency_id,
$this->item->id);
$this->fieldsbas = $model->getFieldsBaS($this->item->id);
$this->formbas = $model->getFormBaS($this->item->id);
$this->itemcommon =
$order->getItemCommon($this->item->id);
$this->itemproducts =
$order->getItemProducts($this->item->id);
$this->itemproductdiscounts =
$order->getItemProductDiscounts($this->item->id);
$this->itemtotal = $order->getItemTotal($this->item->id);
$this->itemtaxrecapitulation =
$order->getItemTaxRecapitulation($this->item->id);
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.order_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_ORDER' ).': <small><small>[ ' .
$text.' ]</small></small>' ,
'shopping-cart');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
//JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,
views/phocacartorders/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[ �z-�7�7&views/phocacartorders/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$d = new PhocacartPrice();
$d->setCurrency(1, 6);
$b = new PhocacartPrice();
$b->setCurrency(1, 0);
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
//echo $r->startFilterBar();
/*echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
//echo $r->endFilterBar();
$idMd = 'phEditStatusModal';
$textButton = 'COM_PHOCACART_EDIT_STATUS';
$w = 500;
$h = 400;
$rV = new PhocacartRenderAdminview();
echo $rV->modalWindowDynamic($idMd, $textButton, $w, $h, true);
echo $r->startTable('orderList');
echo $r->startTblHeader();
echo $r->thOrderingXML('JGRID_HEADING_ORDERING', $listDirn,
$listOrder);
echo $r->thCheck('JGLOBAL_CHECK_ALL');
echo '<th class="ph-order">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_ORDER_NUMBER',
'order_number', $listDirn, $listOrder) . '</th>'
. "\n";
echo '<th class="ph-user">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_USER', 'user_username',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-status">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_STATUS', 'a.status_id',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-info">' .
JText::_($this->t['l'] . '_INFO') .
'</th>' . "\n";
echo '<th class="ph-action">' .
JText::_($this->t['l'] . '_ACTION') .
'</th>' . "\n";
echo '<th class="ph-total-center">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_TOTAL', 'total_amount',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-invoice">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_INVOICE_NUMBER',
'invoice_number', $listDirn, $listOrder) .
'</th>' . "\n";
echo '<th class="ph-date">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_DATE_ADDED', 'a.date',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-date">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_DATE_MODIFIED',
'a.modified', $listDirn, $listOrder) . '</th>' .
"\n";
echo '<th class="ph-published">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_PUBLISHED',
'a.published', $listDirn, $listOrder) . '</th>' .
"\n";
echo '<th class="ph-id">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_ID', 'a.id', $listDirn,
$listOrder) . '</th>' . "\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$price = new PhocacartPrice();
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart &&
$j < (int)$this->pagination->limit) {
$j++;
$urlEdit = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'] . '.edit&id=';
$urlTask = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'];
$orderkey = array_search($item->id,
$this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') || $item->checked_out ==
$user->get('id') || $item->checked_out == 0;
$canChange =
$user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_($urlEdit . $item->id);
$linkStatus = JRoute::_('index.php?option=' .
$this->t['o'] .
'&view=phocacarteditstatus&tmpl=component&id=' .
(int)$item->id);
$linkStatusHandler = 'rel="{handler:
\'iframe\', size: {x: 580, y: 460}, onClose:function(){var js =
window.location.reload();}}"';
$linkOrderView = JRoute::_('index.php?option=' .
$this->t['o'] .
'&view=phocacartorderview&tmpl=component&id=' .
(int)$item->id . '&type=1');
$linkInvoiceView = JRoute::_('index.php?option=' .
$this->t['o'] .
'&view=phocacartorderview&tmpl=component&id=' .
(int)$item->id . '&type=2');
$linkDelNoteView = JRoute::_('index.php?option=' .
$this->t['o'] .
'&view=phocacartorderview&tmpl=component&id=' .
(int)$item->id . '&type=3');
//$linkOrderViewHandler= 'rel="{handler:
\'iframe\', size: {x: 580, y: 460}}"';
$linkOrderViewHandler = 'onclick="window.open(this.href,
\'orderview\',
\'width=780,height=560,scrollbars=yes,menubar=no,resizable=yes\');return
false;"';
echo $r->startTr($i, isset($item->catid) ?
(int)$item->catid : 0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .=
Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'] . '.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="' . JRoute::_($linkEdit)
. '">' .
$this->escape(PhocacartOrder::getOrderNumber($item->id,
$item->date, $item->order_number)) . '</a>';
} else {
$checkO .= $this->escape($item->title);
}
echo $r->td($checkO, "small");
if ($item->user_id > 0) {
$userO = $this->escape($item->user_name);
if (isset($item->user_username)) {
$userO .= ' <small>(' .
$item->user_username . ')</small>';
}
} else {
$userO = '<span class="label label-info badge
badge-info">' . JText::_('COM_PHOCACART_GUEST') .
'</span>';
$userData =
PhocacartOrder::getOrderCustomerData($item->id);
if (isset($userData[0]['name_first']) &&
isset($userData[0]['name_last'])) {
$userO .= '<br /><span>' .
$userData[0]['name_first'] . ' ' .
$userData[0]['name_last'] . '</span>';
}
}
echo $r->td($userO, "small");
//$status =
PhocacartOrderStatus::getStatus((int)$item->status_id, $item->id);
//$statusSelect =
Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$status['data'], 'phorderstatus',
'class="inputbox"', 'value',
'text', (int)$item->status_id,
'phorderstatus'.(int)$item->id );
$statusClass =
PhocacartUtilsSettings::getOrderStatusClass($item->status_title);
$status = '<span class="' . $statusClass .
'">' . $this->escape(JText::_($item->status_title))
. '</span>';
//$status .= ' <a class="modal_edit_status ph-u"
href="'.$linkStatus.'" '.$linkStatusHandler.'
><small>'.JText::_('COM_PHOCACART_EDIT_STATUS').'</small></a>';
$status .= ' <span><a href="#' . $idMd .
'" role="button" class="ph-u ph-no-wrap ' .
$idMd . 'ModalButton" data-toggle="modal"
title="' . JText::_($textButton) . '"
data-src="' . $linkStatus . '" data-height="'
. $h . '" data-width="' . $w . '">' .
JText::_($textButton) . '</a></span>';
echo $r->td($status, "small");
// INFO
$info = '<div
class="ph-order-info-box">';
if ($item->type == 2) {
// POS
if (isset($item->vendor_username) &&
isset($item->vendor_name)) {
$vendorO = $this->escape($item->vendor_name);
$vendorO .= ' <small>(' .
$item->vendor_username . ')</small>';
$info .= '<span class="label label-success
badge badge-success">' .
JText::_('COM_PHOCACART_VENDOR') . ': ' . $vendorO .
'</span>';
}
if (isset($item->section_name)) {
$section = $this->escape($item->section_name);
$info .= '<span class="label
label-primary">' . JText::_('COM_PHOCACART_SECTION')
. ': ' . $section . '</span>';
}
if (isset($item->unit_name)) {
$unit = $this->escape($item->unit_name);
$info .= '<span class="label label-info badge
badge-info">' . JText::_('COM_PHOCACART_UNIT') .
': ' . $unit . '</span>';
}
if (isset($item->ticket_id) &&
(int)$item->ticket_id > 0) {
$info .= '<span class="label label-warning
badge badge-warning">' .
JText::_('COM_PHOCACART_TICKET') . ': ' .
$item->ticket_id . '</span>';
}
} else if ($item->type == 1) {
$info = '<span class="label label-info badge
badge-info">' .
JText::_('COM_PHOCACART_ONLINE_SHOP') .
'</span>';
}
$info .= '</div>';
echo $r->td($info, "small");
// ACTION
$view = '<div class="ph-action-row">';
$view .= '<a href="' . $linkOrderView .
'" class="btn btn-transparent btn-small btn-xs ph-btn"
role="button" ' . $linkOrderViewHandler . '><span
title="' . JText::_('COM_PHOCACART_VIEW_ORDER') .
'" class="' .
$this->s['i']['search'] . '
ph-icon-success"></span></a>';
$view .= ' <a href="' . $linkInvoiceView .
'" class="btn btn-transparent btn-small btn-xs ph-btn"
role="button" ' . $linkOrderViewHandler . '><span
title="' . JText::_('COM_PHOCACART_VIEW_INVOICE') .
'" class="' .
$this->s['i']['list-alt'] . '
ph-icon-danger"></span></a>';
$view .= ' <a href="' . $linkDelNoteView .
'" class="btn btn-transparent btn-small btn-xs ph-btn"
role="button" ' . $linkOrderViewHandler . '><span
title="' . JText::_('COM_PHOCACART_VIEW_DELIVERY_NOTE')
. '" class="' .
$this->s['i']['barcode'] . '
ph-icon-warning"></span></a>';
$view .= '</div>';
if ($this->t['plugin-pdf'] == 1 &&
$this->t['component-pdf']) {
$formatPDF = '&format=pdf';
$view .= '<div
class="ph-action-row">';
$view .= '<a href="' . $linkOrderView .
$formatPDF . '" class="btn btn-transparent btn-small btn-xs
ph-btn" role="button" ' . $linkOrderViewHandler .
'><span title="' .
JText::_('COM_PHOCACART_VIEW_ORDER') . '"
class="' . $this->s['i']['search'] .
' ph-icon-success"></span><br /><span
class="ph-icon-success-txt">' .
JText::_('COM_PHOCACART_PDF') .
'</span></a>';
$view .= ' <a href="' . $linkInvoiceView
. $formatPDF . '" class="btn btn-transparent btn-small
btn-xs ph-btn" role="button" ' . $linkOrderViewHandler
. '><span title="' .
JText::_('COM_PHOCACART_VIEW_INVOICE') . '"
class="' . $this->s['i']['list-alt'] .
' ph-icon-danger"></span><br /><span
class="ph-icon-danger-txt">' .
JText::_('COM_PHOCACART_PDF') .
'</span></a>';
$view .= ' <a href="' . $linkDelNoteView
. $formatPDF . '" class="btn btn-transparent btn-small
btn-xs ph-btn" role="button" ' . $linkOrderViewHandler
. '><span title="' .
JText::_('COM_PHOCACART_VIEW_DELIVERY_NOTE') . '"
class="' . $this->s['i']['barcode'] .
' ph-icon-warning"></span><br /><span
class="ph-icon-warning-txt">' .
JText::_('COM_PHOCACART_PDF') .
'</span></a>';
$view .= '</div>';
}
echo $r->td($view, "small");
$price->setCurrency($item->currency_id, $item->id);
$amount = (isset($item->total_amount_currency) &&
$item->total_amount_currency > 0) ?
$price->getPriceFormat($item->total_amount_currency, 0, 1) :
$price->getPriceFormat($item->total_amount);
echo $r->td($amount, "small ph-right ph-p-r-med
ph-no-wrap");
echo
$r->td($this->escape(PhocacartOrder::getInvoiceNumber($item->id,
$item->date, $item->invoice_number, $item->invoice_number_id)),
"small");
echo $r->td(JHtml::date($item->date,
JText::_('DATE_FORMAT_LC5')), "small");
echo $r->td(JHtml::date($item->modified,
JText::_('DATE_FORMAT_LC5')), "small");
echo
$r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'] . '.',
$canChange), "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 12);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,%views/phocacartorders/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�['�Yг�#views/phocacartorders/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport('joomla.application.component.view');
class PhocaCartCpViewPhocacartOrders extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
public $filterForm;
public $activeFilters;
protected $t;
protected $r;
protected $s;
function display($tpl = null)
{
$document = JFactory::getDocument();
$this->t =
PhocacartUtils::setVars('order');
$this->r = new PhocacartRenderAdminviews();
$this->s = PhocacartRenderStyle::getStyles();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
JHtml::stylesheet($this->t['bootstrap'] .
'css/bootstrap.glyphicons-icons-only.min.css');
$this->t['plugin-pdf'] =
PhocacartUtilsExtension::getExtensionInfo('phocacart',
'plugin', 'phocapdf');
$this->t['component-pdf'] =
PhocacartUtilsExtension::getExtensionInfo('com_phocapdf');
$this->addToolbar();
parent::display($tpl);
}
function addToolbar()
{
require_once JPATH_COMPONENT . '/helpers/' .
$this->t['tasks'] . '.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']) .
'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.order_id'));
JToolbarHelper::title(JText::_($this->t['l'] .
'_ORDERS'), 'shopping-cart');
if ($canDo->get('core.create')) {
//JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'] .
'.edit', 'JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'] .
'.publish', 'publish.png', 'publish_f2.png',
'JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'] .
'.unpublish', 'unpublish.png',
'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList($this->t['l'] .
'_WARNING_DELETE_ITEMS', 'phocacartorders.delete',
$this->t['l'] . '_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help('screen.' .
$this->t['c'], true);
}
protected function getSortFields()
{
return array(
//'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'order_number' =>
JText::_($this->t['l'] . '_ORDER_NUMBER'),
'user_username' =>
JText::_($this->t['l'] . '_USER'),
'a.status_id' =>
JText::_($this->t['l'] . '_STATUS'),
'total_amount' =>
JText::_($this->t['l'] . '_TOTAL'),
'a.date' => JText::_($this->t['l'] .
'_DATE_ADDED'),
'a.modified' =>
JText::_($this->t['l'] . '_DATE_MODIFIED'),
'a.notify' => JText::_($this->t['l']
. '_USER_NOTIFIED'),
'a.published' =>
JText::_($this->t['l'] . '_PUBLISHED'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,#views/phocacartorderview/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�bl�WW)views/phocacartorderview/tmpl/default.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
?>PK�"�[�#o,,(views/phocacartorderview/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[Q��K��&views/phocacartorderview/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartOrderView extends JViewLegacy
{
public function display($tpl = null) {
$app = JFactory::getApplication();
$this->t = PhocacartUtils::setVars('orderview');
$this->r = new PhocacartRenderAdminview();
$id = $app->input->get('id', 0, 'int');
$type = $app->input->get('type', 0, 'int');
$format = $app->input->get('format', '',
'string');
$order = new PhocacartOrderRender();
$o = $order->render($id, $type, $format);
echo $o;
$media = new PhocacartRenderAdminmedia();
parent::display($tpl);
}
}
?>
PK�"�[�HOO%views/phocacartorderview/view.pdf.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartOrderView extends JViewLegacy
{
protected $t;
protected $r;
public function display($tpl = null) {
$app = JFactory::getApplication();
$this->t = PhocacartUtils::setVars('orderview');
$this->r = new PhocacartRenderAdminview();
$id = $app->input->get('id', 0, 'int');
$type = $app->input->get('type', 0, 'int');
$format = $app->input->get('format', '',
'string');
$orderBillingData = PhocacartOrder::getOrderBillingData($id);
$paramsC = PhocacartUtils::getComponentParameters();
//$invoice_prefix = $paramsC->get( 'invoice_prefix',
'');
$order = new PhocacartOrderRender();
$o = $order->render($id, $type, $format);
switch($type) {
case 2:
$invoiceNumber = PhocacartOrder::getInvoiceNumber($id,
$orderBillingData['date'],
$orderBillingData['invoice_number']);
$title = JText::_('COM_PHOCACART_INVOICE_NR'). ':
'. $invoiceNumber;
break;
case 1:
case 3:
default:
$orderNumber = PhocacartOrder::getOrderNumber($id,
$orderBillingData['date'],
$orderBillingData['order_number']);
$title = JText::_('COM_PHOCACART_ORDER_NR'). ':
'. $orderNumber;
break;
}
// Set title here, if customized in pdf plugin parameters, it overwrites
this title - this is only default title
$this->document->setTitle($title);
echo $o;
// PDF document name
$this->document->setName($title);
//$media = new PhocacartRenderAdminmedia();
//parent::display($tpl);
}
}
?>
PK�"�[�#o,,
views/phocacartparama/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�bl�WW&views/phocacartparama/tmpl/default.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
?>PK�"�[�#o,,%views/phocacartparama/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[9�'DD#views/phocacartparama/view.json.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
class PhocaCartCpViewPhocaCartParamA extends JViewLegacy
{
function display($tpl = null){
if (!JSession::checkToken('request')) {
$response = array(
'status' => '0',
'error' => '<div class="alert
alert-error">' . JText::_('JINVALID_TOKEN') .
'</div>');
echo json_encode($response);
return;
}
$app = JFactory::getApplication();
$method = $app->input->get( 'method', '',
'string' );
$id = $app->input->get( 'id', '',
'int' );
$type = $app->input->get( 'type', '',
'int' ); // 1) payment plugin 2) shipping plugin
//$method = PhocacartUtilsSettings::getPaymentMethod((int)$method);
// TEMP
//$method = 'paypal';
//$id = 1;
//
index.php?option=com_phocacart&view=phocacartparama&format=json&tmpl=component&5bf6b09593b13dd0b717228bb82296a9=1&id=1
$model = $this->getModel();
//$method = 'coupon';
if ($type == 2) {
$model->setFormName('com_phocacart.phocacartshippingmethod',
'phocacartshippingmethod'); // Abstract XML
} else {
$model->setFormName('com_phocacart.phocacartpaymentmethod',
'phocacartpaymentmethod'); // Abstract XML
}
$form = $model->getForm();
$item = $model->getItem();
/*
* PAYMENT - method selected in Phoca Cart (x001) (or SHIPPINNG))
* PAYMENT METHOD - method type like Paypal, Cash on Delivery - set in
plugin
* Payment method parameters are defined in plugins
plugins/pcp/paypal_standard.xml e.g.
* This ajax loads the XML from plugin and bind the data with common
payment table:
* #__phocacart_payment_methods (#__phocacart_shipping_methods)
*
* In plugin, parameters are only defined in form tag, but stored are in
params column of table: #__phocacart_payment_methods
*
*
administrator\components\com_phocacart\views\phocacartparama\view.json.php
- ajax loading
* administrator\components\com_phocacart\models\phocacartparama.php -
model where the plugin parameters are pasted to abstract xml
*
administrator\components\com_phocacart\models\forms\phocacartpaymentmethod.xml
- abastract class so we can load parameters from
* plugin
* administrator\components\com_phocacart\models\phocacartpayment.php -
here standard parameters of payment are stored and the
* plugin parameters are converted to params column and stored in payment
table: #__phocacart_payment_methods
*
* Ajax is loading when changing payment method or when starting/loading
the payment to edit (at start when editing)
* The loading is set in field:
administrator\components\com_phocacart\models\fields\phocapaymentmethod.php
*
*/
$o = '';
$i = 0;
if ($form) {
$form->bind($item->params);// if empty (new id), nothing will be
assigned
$fieldSets = $form->getFieldsets();// the xml must have a fieldset
name: <fieldset name="payment">
foreach ($fieldSets as $name => $fieldSet) {
$o .= '<div class="tab-pane" id="'.
$name.'">';
if (isset($fieldSet->description) &&
!empty($fieldSet->description)) {
$o .= '<p
class="tab-description">'.JText::_($fieldSet->description).'</p>';
}
$i = 0;
foreach ($form->getFieldset($name) as $field) {
$o .= '<div class="control-group">';
if (!$field->hidden && $name != "permissions") {
$o .= '<div class="control-label">' .
str_replace('jform', 'phform', $field->label) .
'</div>';
}
$o .= '<div class="';
if ($name != "permissions") {
$o .= 'controls';
}
$o .= '">' . str_replace('jform',
'phform', $field->input) .'</div>';
$o .= '</div>';
$i++; // count of parameters, if there is no parameter, see below -
the message will say no parameters found
}
$o .= '</div>';
}
}
$message = '';
if ($i == 0 || $o == '') {
if ($type == 2) {
$message = '<div
class="ph-extended-params-inbox">' .
JText::_('COM_PHOCACART_THERE_ARE_NO_PARAMETERS_FOR_THIS_SHIPPING_METHOD')
. '</div>';
} else {
$message = '<div
class="ph-extended-params-inbox">' .
JText::_('COM_PHOCACART_THERE_ARE_NO_PARAMETERS_FOR_THIS_PAYMENT_METHOD')
. '</div>';
}
} else {
$message = '<div
class="ph-extended-params-inbox">' . $o .
'</div>';
}
$response = array(
'status' => '1',
'message' => $message);
echo json_encode($response);
return;
}
}
?>PK�"�[�#o,,#views/phocacartparameter/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[K��C��&views/phocacartparameter/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('title', 'title_header',
'alias', 'link_type', 'ordering');
echo $r->group($this->form, $formArray);
$formArray = array('description');
echo $r->group($this->form, $formArray, 1);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs();
echo $r->endForm();
?>
PK�"�[�#o,,(views/phocacartparameter/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�?R��&views/phocacartparameter/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartParameter extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $attributeoption;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('parameter');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.parameter_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_PARAMETER' ).': <small><small>[ ' .
$text.' ]</small></small>' ,
'align-justify');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,$views/phocacartparameters/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[gZa���*views/phocacartparameters/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th
class="ph-title">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TITLE', 'a.title',
$listDirn, $listOrder ).'</th>'."\n";
//echo '<th
class="ph-title">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TYPE', 'a.type',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-published">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PUBLISHED',
'a.published', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-id">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ID', 'a.id', $listDirn,
$listOrder ).'</th>'."\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart && $j
< (int)$this->pagination->limit) {
$j++;
$urlEdit =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
$urlTask =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit. $item->id );
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid :
0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'.
$this->escape($item->title).'</a>';
} else {
$checkO .= $this->escape($item->title);
}
$checkO .= ' <span
class="smallsub">(<span>'.JText::_($this->t['l'].'_FIELD_ALIAS_LABEL').':</span>'.
$this->escape($item->alias).')</span>';
echo $r->td($checkO, "small");
//echo $r->td(PhocacartTag::getTagType($item->type),
"small");
echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'].'.',
$canChange), "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 6);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,)views/phocacartparameters/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�Vi?�
�
'views/phocacartparameters/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartParameters extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('parameter');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.tag_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_PARAMETERS' ),
'align-justify' );
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartparameters.delete',
$this->t['l'].'_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,(views/phocacartparametervalue/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�}ʋ��+views/phocacartparametervalue/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('title', 'alias',
'parameter_id', 'ordering');
echo $r->group($this->form, $formArray);
$formArray = array('description');
echo $r->group($this->form, $formArray, 1);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs();
echo $r->endForm();
?>
PK�"�[�#o,,-views/phocacartparametervalue/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�f]i��+views/phocacartparametervalue/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartParameterValue extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $attributeoption;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('parametervalue');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.parametervalue_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_PARAMETER_VALUE' ).': <small><small>[ ' .
$text.' ]</small></small>' , 'list');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,)views/phocacartparametervalues/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�i��FF/views/phocacartparametervalues/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo
$r->selectFilterParameter(PhocacartParameter::options($this->t['o']),
'COM_PHOCACART_SELECT_PARAMETER',
$this->state->get('filter.parameter_id'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th
class="ph-title">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TITLE', 'a.title',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-title">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PARAMETER',
'a.parameter_id', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-productcount">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PRODUCT_COUNT',
'a.count_products', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-published">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PUBLISHED',
'a.published', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-id">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ID', 'a.id', $listDirn,
$listOrder ).'</th>'."\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart && $j
< (int)$this->pagination->limit) {
$j++;
$urlEdit =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
$urlTask =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit. $item->id );
$urlEditP =
'index.php?option='.$this->t['o'].'&task=phocacartparameter.edit&id=';
$linkEditP = JRoute::_( $urlEditP. $item->parameter_id );
/*
$iD = $i % 2;
echo "\n\n";
//echo '<tr class="row'.$iD.'"
sortable-group-id="0"
item-id="'.$item->id.'" parents="0"
level="0">'. "\n";
//echo '<tr class="row'.$iD.'"
sortable-group-id="0" >'. "\n";
echo '<tr class="row'.$iD.'"
sortable-group-id="'.$item->parameter_id.'"
>'. "\n";
echo $r->tdOrder($canChange, $saveOrder, $orderkey,
$item->ordering);
echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('grid.id', $i,
$item->id), "small");
*/
echo $r->startTr($i, isset($item->parameter_id) ?
(int)$item->parameter_id : 0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'.
$this->escape($item->title).'</a>';
} else {
$checkO .= $this->escape($item->title);
}
$checkO .= ' <span
class="smallsub">(<span>'.JText::_($this->t['l'].'_FIELD_ALIAS_LABEL').':</span>'.
$this->escape($item->alias).')</span>';
echo $r->td($checkO, "small");
$paramO = '';
if ($canCreate || $canEdit) {
$paramO .= '<a href="'.
JRoute::_($linkEditP).'">'.
$this->escape($item->parameter_title).'</a>';
} else {
$paramO .= $this->escape($item->parameter_title);
}
echo $r->td($paramO, "small");
$pC = '<div
class="center">'.$item->count_products;
if (PhocacartUtils::validateDate($item->count_date)) {
$pC .= '<br><small
class="nowrap">('.Joomla\CMS\HTML\HTMLHelper::_('date',
$item->count_date, 'd-m-Y H:i').')</small>';
}
$pC .= '</div>';
echo $r->td($pC, "small");
echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'].'.',
$canChange), "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 7);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,.views/phocacartparametervalues/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[���]g
g
,views/phocacartparametervalues/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartParameterValues extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('parametervalue');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.parametervalue_id'));
$bar = JToolbar::getInstance('toolbar');
JToolbarHelper::title( JText::_(
$this->t['l'].'_PARAMETER_VALUES' ),
'list' );
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartparametervalues.delete',
$this->t['l'].'_DELETE');
}
$dhtml = '<button
onclick="javascript:if(document.adminForm.boxchecked.value==0){alert(\''.JText::_('COM_PHOCACART_WARNING_COUNT_PRODUCTS_MAKE_SELECTION').'\');}else{Joomla.submitbutton(\'phocacartparametervalue.countproducts\');}"
class="btn btn-small button-plus"><i
class="icon-plus"
title="'.JText::_($this->t['l'].'_COUNT_PRODUCTS').'"></i>
'.JText::_($this->t['l'].'_COUNT_PRODUCTS').'</button>';
$bar->appendButton('Custom', $dhtml,
'countproducts');
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.parameter_id' => JText::_($this->t['l'] .
'_PARAMETER'),
'a.count_products' => JText::_($this->t['l']
. '_PRODUCT_COUNT'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,!views/phocacartpayment/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�,�,��$views/phocacartpayment/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" || task == "phocacartwizard.backtowizard" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'amount' =>
JText::_($this->t['l'].'_AMOUNT_RULE'),
'zone' =>
JText::_($this->t['l'].'_ZONE_RULE'),
'country' =>
JText::_($this->t['l'].'_COUNTRY_RULE'),
'region' =>
JText::_($this->t['l'].'_REGION_RULE'),
'shipping' =>
JText::_($this->t['l'].'_SHIPPING_RULE'),
'method' =>
JText::_($this->t['l'].'_PAYMENT_METHOD_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('title', 'cost',
'cost_additional', 'tax_id',
'calculation_type', 'default', 'type');
echo $r->group($this->form, $formArray);
$formArray = array ('method');
echo $r->group($this->form, $formArray);
echo '<div id="ph-extended-params-msg"
class="ph-extended-params-msg"></div>';
$formArray = array ('image', 'ordering',
'access', 'group');
echo $r->group($this->form, $formArray);
$formArray = array('description');
echo $r->group($this->form, $formArray, 1);
$formArray = array('description_info');
echo $r->group($this->form, $formArray, 1);
echo $r->endTab();
echo $r->startTab('amount', $tabs['amount']);
$formArray = array ('lowest_amount', 'highest_amount',
'active_amount');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('zone', $tabs['zone']);
$formArray = array ('zone', 'active_zone');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('country', $tabs['country']);
$formArray = array ('country', 'active_country');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('region', $tabs['region']);
$formArray = array ('region', 'active_region');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('shipping', $tabs['shipping']);
$formArray = array ('shipping', 'active_shipping');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('method', $tabs['method']);
echo '<div id="ph-extended-params"
class="ph-extended-params">'.JText::_('COM_PHOCACART_SELECT_PAYMENT_METHOD_TO_DISPLAY_PARAMETERS').'</div>';
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2">';
echo '<div id="ph-sandbox-msg" class="alert
alert-danger">'.JText::_('COM_PHOCACART_SANDBOX_ENABLED_NO_REAL_MONEY_WILL_BE_TRANSFERRED').'</div>';
echo '</div>';//end span2
echo $r->formInputs($this->t['task']);
echo $r->endForm();
?>
PK�"�[�#o,,&views/phocacartpayment/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[g�r
$views/phocacartpayment/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartPayment extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $attributeoption;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('payment');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.payment_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_PAYMENT' ).': <small><small>[ ' .
$text.' ]</small></small>' ,
'credit-card');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
PhocacartRenderAdminview::renderWizardButton('back');
}
}
?>
PK�"�[�#o,,"views/phocacartpayments/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[���'B
B (views/phocacartpayments/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$adminDesc = new PhocacartUtilsAdmindescription();
$nrColumns = $adminDesc->isActive() ? 11 : 10;
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo $r->inputFilterSearch($this->t['l'] .
'_FILTER_SEARCH_LABEL', $this->t['l'] .
'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th class="ph-title-small">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_TITLE', 'a.title',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-published">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_PUBLISHED',
'a.published', $listDirn, $listOrder) . '</th>' .
"\n";
echo '<th class="ph-default">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_DEFAULT', 'a.default',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-method">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_PAYMENT_METHOD',
'a.method', $listDirn, $listOrder) . '</th>' .
"\n";
echo '<th class="ph-price">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_PRICE', 'a.cost',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-rule">' .
JText::_($this->t['l'] . '_ACTIVE_RULE_S') .
'</th>' . "\n";
echo $adminDesc->isActive() ? '<th
class="ph-description-small">' .
JText::_($this->t['l'] . '_DESCRIPTION') .
'</th>' . "\n" : '';
echo '<th class="ph-access">' .
JTEXT::_($this->t['l'] . '_ACCESS') .
'</th>' . "\n";
echo '<th class="ph-id">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_ID', 'a.id', $listDirn,
$listOrder) . '</th>' . "\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart &&
$j < (int)$this->pagination->limit) {
$j++;
$urlEdit = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'] . '.edit&id=';
$urlTask = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') || $item->checked_out ==
$user->get('id') || $item->checked_out == 0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_($urlEdit . $item->id);
echo $r->startTr($i, isset($item->catid) ?
(int)$item->catid : 0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .=
Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'] . '.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="' . JRoute::_($linkEdit)
. '">' . $this->escape($item->title) .
'</a>';
} else {
$checkO .= $this->escape($item->title);
}
echo $r->td($checkO, "small");
echo
$r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'] . '.',
$canChange), "small");
if ($item->default == '0' || $item->default ==
'1') {
$default =
Joomla\CMS\HTML\HTMLHelper::_('jgrid.isdefault',
$item->default, $i, $this->t['tasks'] . '.',
$canChange);
} else if ($canChange) {
$default = '<a href="' .
JRoute::_('index.php?option=com_phocacart&task=' .
$this->t['tasks'] . '.unsetDefault&cid[]=' .
$item->id . '&' . JSession::getFormToken() .
'=1') . '">';
}
echo $r->td($default, "small");
//$method =
PhocacartUtilsSettings::getPaymentMethod($item->method);
echo $r->td(JText::_($item->method), "small");
echo $r->td('<span class="ph-editinplace-text
ph-eip-text ph-eip-price" id="payment_methods:cost:' .
(int)$item->id . '">' .
PhocacartPrice::cleanPrice($item->cost) . '</span>',
"small");
$rules = array();
if ($item->active_amount) {
$rules[] = '<span class="label label-important
label-danger badge badge-danger">' .
JText::_('COM_PHOCACART_AMOUNT_RULE') .
'</span>';
}
if ($item->active_country) {
$rules[] = '<span class="label label-warning badge
badge-warning label-warning">' .
JText::_('COM_PHOCACART_COUNTRY_RULE') .
'</span>';
}
if ($item->active_region) {
$rules[] = '<span class="label label-info badge
badge-info label-info">' .
JText::_('COM_PHOCACART_REGION_RULE') .
'</span>';
}
if ($item->active_shipping) {
$rules[] = '<span class="label label-success badge
badge-success label-success">' .
JText::_('COM_PHOCACART_SHIPPING_RULE') .
'</span>';
}
if ($item->active_zone) {
$rules[] = '<span class="label label-primary badge
badge-primary label-primary">' .
JText::_('COM_PHOCACART_ZONE_RULE') . '</span>';
}
echo $r->td(implode(" ", $rules), "small");
if ($adminDesc->isActive()) {
echo
$r->td($this->escape($adminDesc->getAdminDescription($item->description)));
}
echo $r->td($this->escape($item->access_level));
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), $nrColumns);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,'views/phocacartpayments/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[g�K}%views/phocacartpayments/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartPayments extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('payment');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.payment_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_PAYMENT_METHODS' ),
'credit-card' );
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartpayments.delete',
$this->t['l'].'_DELETE');
}
if ($canDo->get('core.edit.state')){
JToolbarHelper::makeDefault($this->t['tasks'].'.setDefault',
'COM_PHOCACART_DEFAULT');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
PhocacartRenderAdminview::renderWizardButton('back');
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.method' => JText::_($this->t['l'] .
'_METHOD'),
'a.cost' => JText::_($this->t['l']
. '_PRICE'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,"views/phocacartquestion/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[Ar搕�%views/phocacartquestion/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('product_id', 'category_id',
'user_id', 'name', 'email',
'phone', 'ip', 'message', 'date',
'ordering');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs();
echo $r->endForm();
?>
PK�"�[�#o,,'views/phocacartquestion/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[OhJe��%views/phocacartquestion/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocaCartQuestion extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('question');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.question_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_QUESTION' ).': <small><small>[ ' .
$text.' ]</small></small>' ,
'question-sign');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,#views/phocacartquestions/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��#PP)views/phocacartquestions/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo $r->inputFilterSearch($this->t['l'] .
'_FILTER_SEARCH_LABEL', $this->t['l'] .
'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th class="ph-product">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_PRODUCT', 'productname',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-category">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_CATEGORY', 'cattitle',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-name">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_NAME', 'a.name',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-email">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_EMAIL', 'a.email',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-phone">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_PHONE', 'a.phone',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-ip">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_IP', 'a.ip', $listDirn,
$listOrder) . '</th>' . "\n";
//echo '<th
class="ph-published">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PUBLISHED',
'a.published', $listDirn, $listOrder
).'</th>'."\n";
echo '<th class="ph-message">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_MESSAGE', 'a.message',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-date">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_DATE', 'a.date',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-id">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_ID', 'a.id', $listDirn,
$listOrder) . '</th>' . "\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart &&
$j < (int)$this->pagination->limit) {
$j++;
$urlEdit = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'] . '.edit&id=';
$urlTask = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'];
$orderkey = array_search($item->id,
$this->ordering[$item->product_id]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') || $item->checked_out ==
$user->get('id') || $item->checked_out == 0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_($urlEdit . $item->id);
echo $r->startTr($i, isset($item->catid) ?
(int)$item->catid : 0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .=
Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'] . '.', $canCheckin);
}
// Product
$item->productname = !isset($item->productname) ?
JText::_('COM_PHOCACART_NO_PRODUCT') : $item->productname;
if ($canCreate || $canEdit) {
$checkO .= '<a href="' . JRoute::_($linkEdit)
. '">' . $this->escape($item->productname) .
'</a>';
} else {
$checkO .= $this->escape($item->productname);
}
echo $r->td($checkO, "small");
// Category
$item->cattitle = !isset($item->cattitle) ?
JText::_('COM_PHOCACART_NO_PRODUCT') : $item->cattitle;
echo $r->td($this->escape($item->cattitle),
"small");
// Name
$nameSuffix = '';
if (isset($item->reviewname) &&
isset($item->reviewusername) && $item->reviewname !=
'' && $item->reviewusername != '') {
$nameSuffix = ' <small>(' .
$item->reviewname . ' - ' . $item->reviewusername .
')</small>';
}
echo $r->td($this->escape($item->name . $nameSuffix),
"small");
echo $r->td($this->escape($item->email),
"small");
echo $r->td($this->escape($item->phone),
"small");
echo $r->td($this->escape($item->ip), "small");
//echo
$r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'].'.',
$canChange), "small");
echo $r->td(PhocacartUtils::wordDeleteWhole($item->message,
50), "small");
echo $r->td(JHtml::date($item->date,
JText::_('DATE_FORMAT_LC5')), "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 11);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,(views/phocacartquestions/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[FE��##&views/phocacartquestions/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocaCartQuestions extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('question');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[$item->product_id][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.question_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_QUESTIONS' ),
'question-sign' );
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartquestions.delete',
$this->t['l'].'_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'productname' => JText::_($this->t['l'] .
'_PRODUCT'),
'cattitle' => JText::_($this->t['l'] .
'_CATEGORY'),
'a.name' => JText::_($this->t['l'] .
'_NAME'),
'a.email' => JText::_($this->t['l'] .
'_EMAIL'),
'a.phone' => JText::_($this->t['l'] .
'_PHONE'),
'a.ip' => JText::_($this->t['l'] .
'_IP'),
'a.message' => JText::_($this->t['l'] .
'_MESSAGE'),
'a.date' => JText::_($this->t['l'] .
'_DATE'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,
views/phocacartregion/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�{��#views/phocacartregion/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" || task == "phocacartwizard.backtowizard" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('title', 'country_id',
'code2', 'code3', 'image',
'ordering');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs($this->t['task']);
echo $r->endForm();
?>
PK�"�[�#o,,%views/phocacartregion/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[鋻a a #views/phocacartregion/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartRegion extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $attributeoption;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('region');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
JHtml::stylesheet( $this->t['bootstrap'] .
'css/bootstrap.glyphicons-icons-only.min.css' );
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.region_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_REGION' ).': <small><small>[ ' .
$text.' ]</small></small>' , 'globe');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
PhocacartRenderAdminview::renderWizardButton('back');
}
}
?>
PK�"�[�#o,,!views/phocacartregions/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�$v�'views/phocacartregions/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCountry(PhocacartCountry::options($this->t['o']),
'COM_PHOCACART_SELECT_COUNTRY',
$this->state->get('filter.country_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo
$r->selectFilterCountry(PhocacartCountry::options($this->t['o']),
'COM_PHOCACART_SELECT_COUNTRY',
$this->state->get('filter.country_id'));
echo $r->endFilterBar();
echo $r->endFilterBar();
*/
$idMd = 'phEditStatusModal';
$textButton = 'COM_PHOCACART_EDIT_TAX';
$w = 500;
$h = 400;
$rV = new PhocacartRenderAdminview();
echo $rV->modalWindowDynamic($idMd, $textButton, $w, $h, true);
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th class="ph-title">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_TITLE', 'a.title',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-taxrate">' .
JText::_($this->t['l'] . '_TAX_RATE') .
'</th>' . "\n";
echo '<th class="ph-published">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_PUBLISHED',
'a.published', $listDirn, $listOrder) . '</th>' .
"\n";
echo '<th class="ph-country">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_COUNTRY',
'country_title', $listDirn, $listOrder) . '</th>'
. "\n";
echo '<th class="ph-code">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_CODE2', 'a.code2',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-code">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_CODE3', 'a.code3',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-id">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_ID', 'a.id', $listDirn,
$listOrder) . '</th>' . "\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart &&
$j < (int)$this->pagination->limit) {
$j++;
$urlEdit = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'] . '.edit&id=';
$urlTask = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'];
$orderkey = array_search($item->id,
$this->ordering[$item->country_id]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') || $item->checked_out ==
$user->get('id') || $item->checked_out == 0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_($urlEdit . $item->id);
$linkTax = JRoute::_('index.php?option=' .
$this->t['o'] .
'&view=phocacartedittax&type=2&tmpl=component&id='
. (int)$item->id);
/*$iD = $i % 2;
echo "\n\n";
//echo '<tr class="row'.$iD.'"
sortable-group-id="0"
item-id="'.$item->id.'" parents="0"
level="0">'. "\n";
echo '<tr class="row' . $iD . '"
sortable-group-id="' . $item->country_id . '"
>' . "\n";
echo $r->tdOrder($canChange, $saveOrder, $orderkey,
$item->ordering);
echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('grid.id',
$i, $item->id), "small");*/
echo $r->startTr($i, isset($item->country_id) ?
(int)$item->country_id : 0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .=
Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'] . '.', $canCheckin);
}
if (isset($item->image) && $item->image !=
'') {
$checkO .= ' <span>' .
PhocacartImage::getImage($item->image, '', '20px') .
'<span> ';
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="' . JRoute::_($linkEdit)
. '">' . $item->title . '</a>';
} else {
$checkO .= $this->escape($item->title);
}
echo $r->td($checkO, "small");
$tax = '';
$tax .= ' <span><a href="#' . $idMd .
'" role="button" class="ph-u ' . $idMd .
'ModalButton" data-toggle="modal" title="' .
JText::_($textButton) . '" data-src="' . $linkTax .
'" data-height="' . $h . '"
data-width="' . $w . '">' .
JText::_($textButton) . '</a></span>';
if (isset($item->tr_tax_rate) && $item->tr_tax_rate
!= '') {
$taxRateA = explode(',', $item->tr_tax_rate);
if (!empty($taxRateA)) {
foreach ($taxRateA as $k => $v) {
$taxRateA[$k] = PhocacartPrice::cleanPrice($v);
}
$taxRateS = implode(', ', $taxRateA);
$tax .= ' <small>(' . $taxRateS .
')</small>';
}
}
echo $r->td($tax, "small");
echo
$r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'] . '.',
$canChange), "small");
echo $r->td($item->country_title, "small");
echo $r->td($item->code2, "small");
echo $r->td($item->code3, "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 9);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,&views/phocacartregions/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�]��
�
$views/phocacartregions/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartRegions extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('region');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
foreach ($this->items as &$item) {
$this->ordering[$item->country_id][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
JHtml::stylesheet( $this->t['bootstrap'] .
'css/bootstrap.glyphicons-icons-only.min.css' );
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.region_id'));
$bar = JToolbar::getInstance('toolbar');
JToolbarHelper::title( JText::_(
$this->t['l'].'_REGIONS' ), 'globe' );
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartregions.delete',
$this->t['l'].'_DELETE');
}
//JToolbarHelper::custom($this->t['task'].'.importregions',
'earth', 'earth',
$this->t['l'].'_IMPORT_REGIONS', false);
$dhtml = '<button onclick="if
(confirm(\''.JText::_('COM_PHOCACART_WARNING_IMPORT_REGIONS').'\'))
{ Joomla.submitbutton(\'phocacartregion.importregions\'); }"
class="btn btn-small button-earth"><i
class="icon-earth"
title="'.JText::_($this->t['l'].'_IMPORT_REGIONS').'"></i>
'.JText::_($this->t['l'].'_IMPORT_REGIONS').'</button>';
$bar->appendButton('Custom', $dhtml,
'importregions');
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
PhocacartRenderAdminview::renderWizardButton('back');
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'country_title' => JText::_($this->t['l'] .
'_COUNTRY'),
'a.code2' => JText::_($this->t['l'] .
'_CODE2'),
'a.code3' => JText::_($this->t['l'] .
'_CODE3'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,!views/phocacartreports/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�����
�
'views/phocacartreports/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tooltip');
Joomla\CMS\HTML\HTMLHelper::_('behavior.multiselect');
Joomla\CMS\HTML\HTMLHelper::_('dropdown.init');
Joomla\CMS\HTML\HTMLHelper::_('formbehavior.chosen',
'select');
$r = $this->r;
$user = JFactory::getUser();
//$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$listFullOrdering =
$this->escape($this->state->get('list.fullordering'));
//$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
//echo $r->startFilterBar();
//echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
//$this->escape($this->state->get('filter.search')));
//echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
//echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
//echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
//echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
//echo $r->endFilterBar();
echo '<div class="js-stools">';
$ascDir = $descDir = '';
if ($listDirn == 'asc') {$ascDir =
'selected="selected"';}
if ($listDirn == 'desc') {$descDir =
'selected="selected"';}
/*
echo '<div class="ph-inline-param">'.
"\n"
.'<label for="directionTable"
class="element-invisible">'
.JText::_('JFIELD_ORDERING_DESC').'</label>'.
"\n"
.'<select name="filter_order_Dir"
id="directionTable" class="input-medium">'.
"\n"
.'<option value="">'
.JText::_('JFIELD_ORDERING_DESC').'</option>'.
"\n"
.'<option value="asc" '.$ascDir.'>' .
JText::_('JGLOBAL_ORDER_ASCENDING').'</option>'.
"\n"
.'<option value="desc" '.$descDir.'>' .
JText::_('JGLOBAL_ORDER_DESCENDING').'</option>'.
"\n"
.'</select>'. "\n"
.'</div>'. "\n";
echo '<div class="ph-inline-param">'.
"\n"
.'<label for="sortTable"
class="element-invisible">'.JText::_('JGLOBAL_SORT_BY').'</label>'.
"\n"
.'<select name="filter_order" id="sortTable"
class="input-medium">'. "\n"
.'<option
value="">'.JText::_('JGLOBAL_SORT_BY').'</option>'.
"\n"
. Joomla\CMS\HTML\HTMLHelper::_('select.options', $sortFields,
'value', 'text', $listOrder). "\n"
.'</select>'. "\n"
.'</div>'. "\n";*/
$sF = array();
if (!empty($sortFields)) {
foreach($sortFields as $k => $v) {
$newK = $k . ' ASC';
$newV = $v . ' '.
JText::_('COM_PHOCACART_ASCENDING');
$sF[$newK] = $newV;
$newK = $k . ' DESC';
$newV = $v . ' '.
JText::_('COM_PHOCACART_DESCENDING');
$sF[$newK] = $newV;
}
}
$lO = $listOrder . ' '. strtoupper($listDirn);
echo '<div class="ph-inline-param">'.
"\n"
.'<label for="sortTable"
class="element-invisible">'.JText::_('JGLOBAL_SORT_BY').'</label>'.
"\n"
.'<select id="list_fullordering"
name="list[fullordering]">'. "\n"
.'<option
value="">'.JText::_('JGLOBAL_SORT_BY').'</option>'.
"\n"
. Joomla\CMS\HTML\HTMLHelper::_('select.options', $sF,
'value', 'text', $lO). "\n"
.'</select>'. "\n"
.'</div>'. "\n";
$listCurrency =
$this->escape($this->state->get('filter.currency'));
$currencies = PhocacartCurrency::getAllCurrencies();
echo '<div class="ph-inline-param">'.
"\n"
.'<label for="sortTable"
class="element-invisible">'.JText::_('COM_PHOCACART_SELECT_CURRENCY').'</label>'.
"\n"
.'<select name="filter_currency"
id="currencyTable" class="input-medium">'.
"\n"
.'<option
value="">'.JText::_('COM_PHOCACART_SELECT_CURRENCY').'</option>'.
"\n";
if (!empty($currencies)) {
echo Joomla\CMS\HTML\HTMLHelper::_('select.options',
$currencies, 'value', 'text', $listCurrency).
"\n";
}
echo '</select>'. "\n"
.'</div>'. "\n";
$listShopType =
$this->escape($this->state->get('filter.shop_type'));
$shopTypes = PhocacartUtilsSettings::getShopTypes();
echo '<div class="ph-inline-param">'.
"\n"
.'<label for="sortTable"
class="element-invisible">'.JText::_('COM_PHOCACART_SELECT_CURRENCY').'</label>'.
"\n"
.'<select name="filter_shop_type"
id="shopTypeTable" class="input-medium">'.
"\n"
. Joomla\CMS\HTML\HTMLHelper::_('select.options', $shopTypes,
'value', 'text', $listShopType). "\n"
.'</select>'. "\n"
.'</div>'. "\n";
$listOrderStatus =
$this->escape($this->state->get('filter.order_status'));
$orderStatuses = PhocacartOrderStatus::getOrderStatuses();
array_unshift($orderStatuses,
Joomla\CMS\HTML\HTMLHelper::_('select.option', '',
'' .
JText::_('COM_PHOCACART_OPTION_SELECT_ORDER_STATUS') .
'', 'value', 'text'));
echo '<div class="ph-inline-param">'.
"\n"
.'<label for="sortTable"
class="element-invisible">'.JText::_('COM_PHOCACART_SELECT_ORDER_STATUS').'</label>'.
"\n"
.'<select name="filter_order_status"
id="orderStatusTable" class="input-medium">'.
"\n"
. Joomla\CMS\HTML\HTMLHelper::_('select.options', $orderStatuses,
'value', 'text', $listOrderStatus). "\n"
.'</select>'. "\n"
.'</div>'. "\n";
echo '</div>';
echo '<div style="clear:both"></div>';
// DATE FROM - DATE TO
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework');
Joomla\CMS\HTML\HTMLHelper::_('script',
'system/html5fallback.js', false, true);
// DATE FROM
$name = "filter_date_from";
$id = 'filter_date_from';
$format = '%Y-%m-%d';
$attributes = '';
$valueFrom =
$this->escape($this->state->get('filter.date_from',
PhocacartDate::getCurrentDate(30)));
echo '<div class="ph-inline-param">'.
JText::_('COM_PHOCACART_DATE_FROM') . ': ';
echo Joomla\CMS\HTML\HTMLHelper::_('calendar', $valueFrom,
$name, $id, $format, $attributes).'</div>';
//DATE TO
$name = "filter_date_to";
$id = 'filter_date_to';
$valueTo =
$this->escape($this->state->get('filter.date_to',
PhocacartDate::getCurrentDate()));
echo '<div class="ph-inline-param">'.
JText::_('COM_PHOCACART_DATE_TO') . ': ';
echo Joomla\CMS\HTML\HTMLHelper::_('calendar', $valueTo, $name,
$id, $format, $attributes).'</div>';
echo '<div class="ph-inline-param">';
//echo '<input type="hidden"
name="filter_date_from"
value="'.$this->escape($this->state->get('filter.date_from')).'"
/>'. "\n";
//echo '<input type="hidden"
name="filter_date_to"
value="'.$this->escape($this->state->get('filter.date_to')).'"
/>'. "\n";
echo '<input type="hidden" name="limitstart"
value="0" />'. "\n";
echo '<input type="hidden" name="limit"
value="" />'. "\n";
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '<input class="btn btn-success"
type="submit" name="submit"
value="'.JText::_('COM_PHOCACART_SELECT').'"
/></div>';
//echo $r->endFilterBar();
echo '<p> </p>';
echo '<div class="row-fluid
ph-admin-stat-row">';
echo $this->loadTemplate('report');
echo '</div>';// end row
echo '<input type="hidden" name="task"
value="" />'. "\n"
//.'<input type="hidden" name="filter_order"
value="'.$listOrder.'" />'. "\n"
//.'<input type="hidden"
name="filter_order_Dir" value="'.$listDirn.'"
/>'. "\n"
//.'<input type="hidden" name="filter_currency"
value="'.$listCurrency.'" />'. "\n"
//.'<input type="hidden"
name="filter_shop_type"
value="'.$listShopType.'" />'. "\n"
. Joomla\CMS\HTML\HTMLHelper::_('form.token'). "\n";
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[5�^�.views/phocacartreports/tmpl/default_report.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$layout = new JLayoutFile('report', null,
array('component' => 'com_phocacart'));
if (!empty($this->items) &&
!empty($this->t['date_days'])) {
$d = array();
$d['s'] = $this->s;
$d['items'] = $this->items;
$d['total'] = $this->total;
$d['params'] = $this->params;
$d['date_from'] = $this->t['date_from'];
$d['date_to'] = $this->t['date_to'];
$d['format'] = $this->t['format'];
/* if ($d['format'] == 'raw') {
header('Content-Type: text/txt');
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' .
'report.html');
} else if ($d['format'] == 'pdf') {
/*header('Content-Type: application/pdf');
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' .
'report.pdf'); */
//}
/*if ($d['format'] == 'raw') {
header('Content-Transfer-Encoding: binary');
header('Connection: Keep-Alive');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0,
pre-check=0');
header('Pragma: public');
//header('Content-Length: ' . $size);
}*/
if ($d['format'] == 'raw') {
echo
'<html><head><title>'.JText::_('COM_PHOCACART_REPORT').'</title></head><body>';
}
echo $layout->render($d);
if ($d['format'] == 'raw') {
echo '</body></html>';
}
}
?>
PK�"�[�#o,,&views/phocacartreports/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[W�a���$views/phocacartreports/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartReports extends JViewLegacy
{
protected $state;
protected $t;
protected $r;
protected $s;
protected $params;
protected $items = array();
protected $total = array();
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('report');
$this->r = new PhocacartRenderAdminviews();
$this->s = PhocacartRenderStyle::getStyles();
$this->state = $this->get('State');
$this->t['date_from'] =
$this->state->get('filter.date_from',
PhocacartDate::getCurrentDate(30));
$this->t['date_to'] =
$this->state->get('filter.date_to',
PhocacartDate::getCurrentDate());
$this->t['date_days'] =
PhocacartDate::getDateDays($this->t['date_from'],
$this->t['date_to']);
$this->params = PhocacartUtils::getComponentParameters();
$app = JFactory::getApplication();
$this->t['format'] =
$app->input->get('format', '',
'string');
if (!empty($this->t['date_days'])) {
$count = iterator_count($this->t['date_days']);
} else {
$count = 0;
}
$this->t['data_error'] = 0;
$this->t['data_possible_days'] = 365;
if ($count > (int)$this->t['data_possible_days']) {
$this->state->set('filter.date_to', '');
$this->state->set('filter.date_from', '');
$this->t['data_error'] = 1;
}
if ($this->t['data_error'] == 0) {
$items = $this->get('Items');
$orderCalc = new PhocacartOrderCalculation();
$orderCalc->calculateOrderItems($items);
$this->items = $orderCalc->getItems();
$this->total = $orderCalc->getTotal();
$this->currencies = $orderCalc->getCurrencies();
}
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.report_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_REPORTS' ), 'list-alt' );
// This button is unnecessary but it is displayed because Joomla! design
bug
$bar = JToolbar::getInstance( 'toolbar' );
$dhtml = '<a href="index.php?option=com_phocacart"
class="btn btn-small"><i class="icon-home-2"
title="'.JText::_('COM_PHOCACART_CONTROL_PANEL').'"></i>
'.JText::_('COM_PHOCACART_CONTROL_PANEL').'</a>';
$bar->appendButton('Custom', $dhtml);
$linkTxt = JRoute::_(
'index.php?option=com_phocacart&view=phocacartreports&tmpl=component&format=raw'
);
// Direct download
$linkTxtHandler = 'onclick="window.open(this.href,
\'orderview\',
\'width=880,height=560,scrollbars=yes,menubar=no,resizable=yes\');return
false;"';
//$linkTxtHandler = '';
$dhtml = '<a href="'.$linkTxt.'"
class="btn btn-small btn-primary"
'.$linkTxtHandler.'><i id="ph-icon-text"
class="icon-dummy
'.$this->s['i']['list-alt'].'
ph-icon-text"></i>'.JText::_('COM_PHOCACART_VIEW_REPORT_HTML').'</a>';
$bar->appendButton('Custom', $dhtml);
$this->t['plugin-pdf'] =
PhocacartUtilsExtension::getExtensionInfo('phocacart',
'plugin', 'phocapdf');
$this->t['component-pdf'] =
PhocacartUtilsExtension::getExtensionInfo('com_phocapdf');
if ($this->t['plugin-pdf'] == 1 &&
$this->t['component-pdf']) {
$linkPdf = JRoute::_(
'index.php?option=com_phocacart&view=phocacartreports&tmpl=component&format=pdf'
);
$linkPdfHandler = 'onclick="window.open(this.href,
\'orderview\',
\'width=880,height=560,scrollbars=yes,menubar=no,resizable=yes\');return
false;"';
//$linkPdfHandler = '';
$dhtml = '<a href="'.$linkPdf.'"
class="btn btn-small btn-danger"
'.$linkPdfHandler.'><i id="ph-icon-pdf"
class="icon-dummy
'.$this->s['i']['list-alt'].'
ph-icon-pdf"></i>'.JText::_('COM_PHOCACART_VIEW_REPORT_PDF').'</a>';
$bar->appendButton('Custom', $dhtml);
}
/*
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartlogs.delete',
$this->t['l'].'_DELETE');
}*/
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
/*'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.id' => JText::_('JGRID_HEADING_ID'),*/
'a.date' => JText::_($this->t['l'] .
'_DATE'),
'a.order_number' => JText::_($this->t['l'] .
'_ORDER_NUMBER'),
'a.currency_code' => JText::_($this->t['l'] .
'_CURRENCY'),
//'a.type' => JText::_($this->t['l'] .
'_TYPE')
);
}
}
?>
PK�"�[N��;��#views/phocacartreports/view.pdf.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartReports extends JViewLegacy
{
protected $state;
protected $t;
protected $r;
protected $s;
protected $params;
protected $items = array();
protected $total = array();
function display($tpl = null) {
$document = JFactory::getDocument();
$document->setTitle(JText::_('COM_PHOCACART_REPORT'));
$this->t = PhocacartUtils::setVars('report');
$this->s = PhocacartRenderStyle::getStyles();
$this->state = $this->get('State');
$this->t['date_from'] =
$this->state->get('filter.date_from',
PhocacartDate::getCurrentDate(30));
$this->t['date_to'] =
$this->state->get('filter.date_to',
PhocacartDate::getCurrentDate());
$this->t['date_days'] =
PhocacartDate::getDateDays($this->t['date_from'],
$this->t['date_to']);
$this->params = PhocacartUtils::getComponentParameters();
$app = JFactory::getApplication();
$this->t['format'] =
$app->input->get('format', '',
'string');
if (!empty($this->t['date_days'])) {
$count = iterator_count($this->t['date_days']);
} else {
$count = 0;
}
$this->t['data_error'] = 0;
$this->t['data_possible_days'] = 365;
if ($count > (int)$this->t['data_possible_days']) {
$this->state->set('filter.date_to', '');
$this->state->set('filter.date_from', '');
$this->t['data_error'] = 1;
}
if ($this->t['data_error'] == 0) {
$items = $this->get('Items');
$orderCalc = new PhocacartOrderCalculation();
$orderCalc->calculateOrderItems($items);
$this->items = $orderCalc->getItems();
$this->total = $orderCalc->getTotal();
$this->currencies = $orderCalc->getCurrencies();
}
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
$this->document->setName(JText::_('COM_PHOCACART_REPORT'));
parent::display('report');
}
}
?>
PK�"�[@��#views/phocacartreports/view.raw.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartReports extends JViewLegacy
{
protected $state;
protected $t;
protected $r;
protected $s;
protected $params;
protected $items = array();
protected $total = array();
function display($tpl = null) {
$document = JFactory::getDocument();
$document->setTitle(JText::_('COM_PHOCACART_REPORT'));
$this->t = PhocacartUtils::setVars('report');
$this->s = PhocacartRenderStyle::getStyles();
$this->state = $this->get('State');
$this->t['date_from'] =
$this->state->get('filter.date_from',
PhocacartDate::getCurrentDate(30));
$this->t['date_to'] =
$this->state->get('filter.date_to',
PhocacartDate::getCurrentDate());
$this->t['date_days'] =
PhocacartDate::getDateDays($this->t['date_from'],
$this->t['date_to']);
$this->params = PhocacartUtils::getComponentParameters();
$app = JFactory::getApplication();
$this->t['format'] =
$app->input->get('format', '',
'string');
if (!empty($this->t['date_days'])) {
$count = iterator_count($this->t['date_days']);
} else {
$count = 0;
}
$this->t['data_error'] = 0;
$this->t['data_possible_days'] = 365;
if ($count > (int)$this->t['data_possible_days']) {
$this->state->set('filter.date_to', '');
$this->state->set('filter.date_from', '');
$this->t['data_error'] = 1;
}
if ($this->t['data_error'] == 0) {
$items = $this->get('Items');
$orderCalc = new PhocacartOrderCalculation();
$orderCalc->calculateOrderItems($items);
$this->items = $orderCalc->getItems();
$this->total = $orderCalc->getTotal();
$this->currencies = $orderCalc->getCurrencies();
}
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
parent::display('report');
}
}
?>
PK�"�[�#o,,
views/phocacartreview/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��oo#views/phocacartreview/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('product_id', 'user_id',
'name', 'review', 'rating',
'ordering');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs();
echo $r->endForm();
?>
PK�"�[�#o,,%views/phocacartreview/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[6�:y��#views/phocacartreview/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartReview extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('review');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.review_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_REVIEW' ).': <small><small>[ ' .
$text.' ]</small></small>' , 'comment');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,!views/phocacartreviews/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[
��,,'views/phocacartreviews/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th
class="ph-product">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PRODUCT', 'productname',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-name">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_NAME', 'a.name',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-published">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PUBLISHED',
'a.published', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-review">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_REVIEW', 'a.review',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-rating">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_RATING', 'a.rating',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-id">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ID', 'a.id', $listDirn,
$listOrder ).'</th>'."\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart && $j
< (int)$this->pagination->limit) {
$j++;
$urlEdit =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
$urlTask =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'];
$orderkey = array_search($item->id,
$this->ordering[$item->product_id]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit. $item->id );
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid :
0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'.
$this->escape($item->productname).'</a>';
} else {
$checkO .= $this->escape($item->productname);
}
echo $r->td($checkO, "small");
$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
$nameSuffix = '';
if (isset($item->reviewname) && isset($item->reviewusername)
&& $item->reviewname != '' &&
$item->reviewusername != '') {
$nameSuffix = ' <small>('.$item->reviewname.' -
'.$item->reviewusername.')</small>';
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'.
$this->escape($item->name).'</a>';
} else {
$checkO .= $this->escape($item->name);
}
$checkO .= $nameSuffix;
echo $r->td($checkO, "small");
echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'].'.',
$canChange), "small");
echo $r->td(substr($item->review, 0, 50) . ' ...',
"small");
$rating = 0;
if ((int)$item->rating > 0) {
$rating = (int)$item->rating;
$rating = $rating * 16;
}
$rating = '<div><span class="ph-stars"><span
style="width:'.(int)$rating
.'px;"></span></span></div>';
echo $r->td($rating, "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 8);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,&views/phocacartreviews/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��l&;;$views/phocacartreviews/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartReviews extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('review');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[$item->product_id][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.review_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_REVIEWS' ), 'comment' );
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartreviews.delete',
$this->t['l'].'_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'productname' => JText::_($this->t['l'] .
'_PRODUCT'),
'a.name' => JText::_($this->t['l'] .
'_NAME'),
'a.review' => JText::_($this->t['l'] .
'_REVIEW'),
'a.rating' => JText::_($this->t['l'] .
'_RATING'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,
views/phocacartreward/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�2ZD��#views/phocacartreward/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('title', 'points',
'user_id', 'published');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs();
echo $r->endForm();
?>
PK�"�[�#o,,%views/phocacartreward/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�&��#views/phocacartreward/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartReward extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('reward');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.reward_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_REWARD_POINTS' ).': <small><small>[ ' .
$text.' ]</small></small>' ,
'certificate');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,!views/phocacartrewards/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��99'views/phocacartrewards/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
$userNameSelected = isset($this->items[0]->user_name_selected) ?
$this->items[0]->user_name_selected : '';
echo
$r->inputFilterUser($this->t['l'].'_FILTER_USER_LABEL',
$this->t['l'].'_FILTER_USER_DESC',
$this->escape($this->state->get('filter.user')),
$userNameSelected);
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR', array(0 =>
'field-user-input'));
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th
class="ph-title-small">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TITLE', 'a.title',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-published">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_APPROVED', 'a.published',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-title-small">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_USER', 'u.name',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-points">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_REWARD_POINTS',
'a.points', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-points">'.JText::_($this->t['l'].'_TOTAL_POINTS').'</th>'."\n";
echo '<th
class="ph-date">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_DATE', 'a.date',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-id">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ID', 'a.id', $listDirn,
$listOrder ).'</th>'."\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
$reward = new PhocacartReward();
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart && $j
< (int)$this->pagination->limit) {
$j++;
$urlEdit =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
$urlTask =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit. $item->id );
$iD = $i % 2;
echo "\n\n";
//echo '<tr class="row'.$iD.'"
sortable-group-id="0"
item-id="'.$item->id.'" parents="0"
level="0">'. "\n";
echo $r->tdOrder($canChange, $saveOrder, $orderkey,
$item->ordering);
echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('grid.id', $i,
$item->id), "small");
$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'.
$this->escape($item->title).'</a>';
} else {
$checkO .= $this->escape($item->title);
}
echo $r->td($checkO, "small");
echo $r->td(PhocacartHtmlJgrid::approve($item->published, $i,
$this->t['tasks'].'.', $canChange),
"small");
$userO = $this->escape($item->user_name);
if (isset($item->user_username)) {
$userO .= '
<small>('.$item->user_username.')</small>';
}
echo $r->td($userO, "small");
$approvedClass = 'approved';
if ($item->published == 0) {
$approvedClass = 'not-approved';
}
if ($item->type == 1) {
echo $r->td('<span class="label label-success badge
badge-success
'.$approvedClass.'">'.$item->points.'</span>',
"small");
} else if ($item->type == -1) {
echo $r->td('<span class="label label-important
label-danger badge badge-danger
'.$approvedClass.'">'.$item->points.'</span>',
"small");
} else {
echo $r->td('<span
class="label">'.$item->points.'</span>',
"small");
}
$total = $reward->getTotalPointsByUserId($item->user_id);
echo $r->td($total, "small");
echo $r->td($item->date, "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 9);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,&views/phocacartrewards/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[YH��}}$views/phocacartrewards/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartRewards extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('reward');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.reward_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_REWARD_POINTS' ),
'certificate' );
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','COM_PHOCACART_APPROVE', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'COM_PHOCACART_DISAPPROVE', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartrewards.delete',
$this->t['l'].'_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
//'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'u.name' => JText::_($this->t['l'] .
'_USER'),
'a.published' => JText::_($this->t['l'] .
'_APPROVED'),
'a.points' => JText::_($this->t['l'] .
'_REWARD_POINTS'),
'a.date' => JText::_($this->t['l'] .
'_DATE'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,!views/phocacartsection/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[b��[kk$views/phocacartsection/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('title', 'image',
'description', 'ordering');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs($this->t['task']);
echo $r->endForm();
?>
PK�"�[�#o,,&views/phocacartsection/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[f^�"��$views/phocacartsection/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartSection extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $attributeoption;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('section');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.section_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_SECTION' ).': <small><small>[ ' .
$text.' ]</small></small>' , 'unchecked');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,"views/phocacartsections/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[Wj&��(views/phocacartsections/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCountry(PhocacartCountry::options($this->t['o']),
'COM_PHOCACART_SELECT_COUNTRY',
$this->state->get('filter.country_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
$idMd = 'phEditStatusModal';
$textButton = 'COM_PHOCACART_EDIT_TAX';
$w = 500;
$h = 400;
$rV = new PhocacartRenderAdminview();
echo $rV->modalWindowDynamic($idMd, $textButton, $w, $h, true);
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th
class="ph-title">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TITLE', 'a.title',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-published">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PUBLISHED',
'a.published', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-id">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ID', 'a.id', $listDirn,
$listOrder ).'</th>'."\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart && $j
< (int)$this->pagination->limit) {
$j++;
$urlEdit =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
$urlTask =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit. $item->id );
$linkTax = JRoute::_(
'index.php?option='.$this->t['o'].'&view=phocacartedittax&type=2&tmpl=component&id='.(int)$item->id
);
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid :
0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'.
$item->title.'</a>';
} else {
$checkO .= $this->escape($item->title);
}
echo $r->td($checkO, "small");
echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'].'.',
$canChange), "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(),5);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,'views/phocacartsections/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[,���
�
%views/phocacartsections/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartSections extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('section');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.section_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_SECTIONS' ), 'unchecked'
);
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartsections.delete',
$this->t['l'].'_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,"views/phocacartshipping/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[u~%�aa%views/phocacartshipping/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" || task == "phocacartwizard.backtowizard" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="span12 form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'amount' =>
JText::_($this->t['l'].'_AMOUNT_RULE'),
'quantity' =>
JText::_($this->t['l'].'_QUANTITY_RULE'),
'zone' =>
JText::_($this->t['l'].'_ZONE_RULE'),
'country' =>
JText::_($this->t['l'].'_COUNTRY_RULE'),
'region' =>
JText::_($this->t['l'].'_REGION_RULE'),
'zip' =>
JText::_($this->t['l'].'_ZIP_RULE'),
'weight' =>
JText::_($this->t['l'].'_WEIGHT_RULE'),
'size' =>
JText::_($this->t['l'].'_SIZE_RULE'),
'method' =>
JText::_($this->t['l'].'_SHIPPING_METHOD_OPTIONS'),
'tracking' =>
JText::_($this->t['l'].'_SHIPMENT_TRACKING_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('title', 'cost',
'cost_additional', 'tax_id',
'calculation_type', 'default', 'type');
echo $r->group($this->form, $formArray);
$formArray = array ('method');
echo $r->group($this->form, $formArray);
echo '<div id="ph-extended-params-msg"
class="ph-extended-params-msg"></div>';
$formArray = array ('image', 'ordering',
'access', 'group');
echo $r->group($this->form, $formArray);
$formArray = array('description');
echo $r->group($this->form, $formArray, 1);
$formArray = array('description_info');
echo $r->group($this->form, $formArray, 1);
echo $r->endTab();
echo $r->startTab('quantity', $tabs['quantity']);
$formArray = array ('minimal_quantity',
'maximal_quantity', 'active_quantity');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('amount', $tabs['amount']);
$formArray = array ('lowest_amount', 'highest_amount',
'active_amount');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('zone', $tabs['zone']);
$formArray = array ('zone', 'active_zone');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('country', $tabs['country']);
$formArray = array ('country', 'active_country');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('region', $tabs['region']);
$formArray = array ('region', 'active_region');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('zip', $tabs['zip']);
$formArray = array ('zip', 'active_zip');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('weight', $tabs['weight']);
$formArray = array ('lowest_weight', 'highest_weight',
'active_weight');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('size', $tabs['size']);
//$formArray = array ('shortest_length',
'longest_length', 'lowest_width',
'largest_width', 'lowest_height',
'highest_height', 'active_size');
$formArray = array ('minimal_length', 'maximal_length',
'minimal_width', 'maximal_width',
'minimal_height', 'maximal_height',
'active_size');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('method', $tabs['method']);
echo '<div id="ph-extended-params"
class="ph-extended-params">'.JText::_('COM_PHOCACART_SELECT_SHIPPING_METHOD_TO_DISPLAY_PARAMETERS').'</div>';
echo $r->endTab();
echo $r->startTab('tracking', $tabs['tracking']);
$formArray = array ('tracking_link',
'tracking_description');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
//echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs($this->t['task']);
echo $r->endForm();
?>
PK�"�[�#o,,'views/phocacartshipping/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��g� %views/phocacartshipping/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartShipping extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $attributeoption;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('shipping');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.shipping_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_SHIPPING' ).': <small><small>[ ' .
$text.' ]</small></small>' , 'barcode');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
PhocacartRenderAdminview::renderWizardButton('back');
}
}
?>
PK�"�[�#o,,#views/phocacartshippings/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[]�|�!�!)views/phocacartshippings/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$adminDesc = new PhocacartUtilsAdmindescription();
$nrColumns = $adminDesc->isActive() ? 11 : 10;
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo $r->inputFilterSearch($this->t['l'] .
'_FILTER_SEARCH_LABEL', $this->t['l'] .
'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();
*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th class="ph-title-small">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_TITLE', 'a.title',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-published">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_PUBLISHED',
'a.published', $listDirn, $listOrder) . '</th>' .
"\n";
echo '<th class="ph-default">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_DEFAULT', 'a.default',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-method">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_SHIPPING_METHOD',
'a.method', $listDirn, $listOrder) . '</th>' .
"\n";
echo '<th class="ph-price">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_PRICE', 'a.cost',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-rule">' .
JText::_($this->t['l'] . '_ACTIVE_RULE_S') .
'</th>' . "\n";
echo $adminDesc->isActive() ? '<th
class="ph-description-small">' .
JText::_($this->t['l'] . '_DESCRIPTION') .
'</th>' . "\n" : '';
echo '<th class="ph-access">' .
JTEXT::_($this->t['l'] . '_ACCESS') .
'</th>' . "\n";
echo '<th class="ph-id">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_ID', 'a.id', $listDirn,
$listOrder) . '</th>' . "\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart &&
$j < (int)$this->pagination->limit) {
$j++;
$urlEdit = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'] . '.edit&id=';
$urlTask = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') || $item->checked_out ==
$user->get('id') || $item->checked_out == 0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_($urlEdit . $item->id);
echo $r->startTr($i, isset($item->catid) ?
(int)$item->catid : 0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .=
Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'] . '.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="' . JRoute::_($linkEdit)
. '">' . $this->escape($item->title) .
'</a>';
} else {
$checkO .= $this->escape($item->title);
}
echo $r->td($checkO, "small");
echo
$r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'] . '.',
$canChange), "small");
if ($item->default == '0' || $item->default ==
'1') {
$default =
Joomla\CMS\HTML\HTMLHelper::_('jgrid.isdefault',
$item->default, $i, $this->t['tasks'] . '.',
$canChange);
} else if ($canChange) {
$default = '<a href="' .
JRoute::_('index.php?option=com_phocacart&task=' .
$this->t['tasks'] . '.unsetDefault&cid[]=' .
$item->id . '&' . JSession::getFormToken() .
'=1') . '">';
}
echo $r->td($default, "small");
echo $r->td(JText::_($item->method), "small");
echo
$r->tdEip('shipping_methods:cost:'.(int)$item->id,
PhocacartPrice::cleanPrice($item->cost));
$rules = array();
if ($item->active_amount) {
$rules[] = '<span class="label label-important
label-danger badge badge-danger">' .
JText::_('COM_PHOCACART_AMOUNT_RULE') .
'</span>';
}
if ($item->active_quantity) {
$rules[] = '<span class="label label-default
label-default">' .
JText::_('COM_PHOCACART_QUANTITY_RULE') .
'</span>';
}
if ($item->active_country) {
$rules[] = '<span class="label label-warning badge
badge-warning label-warning">' .
JText::_('COM_PHOCACART_COUNTRY_RULE') .
'</span>';
}
if ($item->active_region) {
$rules[] = '<span class="label label-info badge
badge-info label-info">' .
JText::_('COM_PHOCACART_REGION_RULE') .
'</span>';
}
if ($item->active_zip) {
$rules[] = '<span class="label label-success badge
badge-success label-success">' .
JText::_('COM_PHOCACART_ZIP_RULE') . '</span>';
}
if ($item->active_zone) {
$rules[] = '<span class="label label-primary badge
badge-primary label-primary">' .
JText::_('COM_PHOCACART_ZONE_RULE') . '</span>';
}
if ($item->active_weight) {
$rules[] = '<span class="label label-success badge
badge-success label-success">' .
JText::_('COM_PHOCACART_WEIGHT_RULE') .
'</span>';
}
if ($item->active_size) {
$rules[] = '<span class="label label-primary
label-primary">' .
JText::_('COM_PHOCACART_SIZE_RULE') . '</span>';
}
echo $r->td(implode(" ", $rules), "small");
if ($adminDesc->isActive()) {
echo
$r->td($this->escape($adminDesc->getAdminDescription($item->description)));
}
echo $r->td($this->escape($item->access_level));
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), $nrColumns);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,(views/phocacartshippings/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[���\&views/phocacartshippings/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartShippings extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('shipping');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.shipping_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_SHIPPING_METHODS' ),
'barcode' );
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartshippings.delete',
$this->t['l'].'_DELETE');
}
if ($canDo->get('core.edit.state')){
JToolbarHelper::makeDefault($this->t['tasks'].'.setDefault',
'COM_PHOCACART_DEFAULT');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
PhocacartRenderAdminview::renderWizardButton('back');
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.method' =>
JText::_($this->t['l'] . '_METHOD'),
'a.cost' => JText::_($this->t['l']
. '_PRICE'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,'views/phocacartspecification/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[c�>EE*views/phocacartspecification/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('title', 'ordering');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs();
echo $r->endForm();
?>
PK�"�[�#o,,,views/phocacartspecification/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�����*views/phocacartspecification/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartSpecification extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('specification');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.specification_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_SPECIFICATION_GROUP' ).': <small><small>[
' . $text.' ]</small></small>' ,
'list');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,(views/phocacartspecifications/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��v��.views/phocacartspecifications/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo $r->inputFilterSearch($this->t['l'] .
'_FILTER_SEARCH_LABEL', $this->t['l'] .
'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();
*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th class="ph-title">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_TITLE', 'a.title',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-published">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_PUBLISHED',
'a.published', $listDirn, $listOrder) . '</th>' .
"\n";
echo '<th class="ph-id">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_ID', 'a.id', $listDirn,
$listOrder) . '</th>' . "\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart &&
$j < (int)$this->pagination->limit) {
$j++;
$urlEdit = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'] . '.edit&id=';
$urlTask = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') || $item->checked_out ==
$user->get('id') || $item->checked_out == 0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_($urlEdit . $item->id);
echo $r->startTr($i, isset($item->catid) ?
(int)$item->catid : 0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($canCreate || $canEdit) {
$checkO .= '<a href="' . JRoute::_($linkEdit)
. '">' . $this->escape($item->title) .
'</a>';
} else {
$checkO .= $this->escape($item->title);
}
echo $r->td($checkO, "small");
echo
$r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'] . '.',
$canChange), "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 5);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,-views/phocacartspecifications/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[
`�M�
�
+views/phocacartspecifications/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartSpecifications extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('specification');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.specification_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_SPECIFICATION_GROUPS' ),
'list' );
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
$this->t['tasks'].'.delete',
$this->t['l'].'_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,$views/phocacartstatistics/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[6�?�2"2"*views/phocacartstatistics/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
//echo $r->startFilterBar();
//echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
//$this->escape($this->state->get('filter.search')));
//echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
//echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
//echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
//echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
// DATE FROM - DATE TO
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework');
Joomla\CMS\HTML\HTMLHelper::_('script',
'system/html5fallback.js', false, true);
// DATE FROM
$name = "filter_date_from";
$id = 'filter_date_from';
$format = '%Y-%m-%d';
$attributes = '';
$valueFrom =
$this->escape($this->state->get('filter.date_from',
PhocacartDate::getCurrentDate(30)));
echo '<div class="ph-inline-param">'.
JText::_('COM_PHOCACART_DATE_FROM') . ': ';
echo Joomla\CMS\HTML\HTMLHelper::_('calendar', $valueFrom,
$name, $id, $format, $attributes).'</div>';
//DATE TO
$name = "filter_date_to";
$id = 'filter_date_to';
$valueTo =
$this->escape($this->state->get('filter.date_to',
PhocacartDate::getCurrentDate()));
echo '<div class="ph-inline-param">'.
JText::_('COM_PHOCACART_DATE_TO') . ': ';
echo Joomla\CMS\HTML\HTMLHelper::_('calendar', $valueTo, $name,
$id, $format, $attributes).'</div>';
echo '<div class="ph-inline-param">';
//echo '<input type="hidden"
name="filter_date_from"
value="'.$this->escape($this->state->get('filter.date_from')).'"
/>'. "\n";
//echo '<input type="hidden"
name="filter_date_to"
value="'.$this->escape($this->state->get('filter.date_to')).'"
/>'. "\n";
echo '<input type="hidden" name="limitstart"
value="0" />'. "\n";
echo '<input type="hidden" name="limit"
value="" />'. "\n";
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '<input class="btn btn-success"
type="submit" name="submit"
value="'.JText::_('COM_PHOCACART_SELECT').'"
/></div>';
echo '<div style="clear:both"></div>';
//echo $r->endFilterBar();
// Chart
$s = new PhocacartStatistics();
$s->renderChartJsLine('phChartAreaLine',
$this->d['amount'],
JText::_('COM_PHOCACART_TOTAL_AMOUNT'),
$this->d['orders'],
JText::_('COM_PHOCACART_TOTAL_ORDERS'),
$this->d['ticks']);
$s->setFunction('phChartAreaLine', 'Line');
if ($this->t['data_error'] == 1) {
echo '<div class="alert
alert-error">'.JText::_('COM_PHOCACART_MAXIMUM_NUMBER_OF_DAYS_SELECTED_EXCEEDED').'
('.
JText::_('COM_PHOCACART_MAXIMUM_NUMBER_OF_DAYS_SELECTED') .
':
'.$this->t['data_possible_days'].')</div>';
} else {
/*
<div class="ph-chart-legend"><span
class="ph-orders"> </span> <?php echo
JText::_('COM_PHOCACART_TOTAL_ORDERS'); ?> <span
class="ph-amount"> </span> <?php echo
JText::_('COM_PHOCACART_TOTAL_AMOUNT'); ?></div> */
?>
<div class="ph-cpanel-chart-box">
<div id="phChartAreaLineHolder"
class="ph-chart-canvas-holder" style="width:95%" >
<canvas id="phChartAreaLine"
class="ph-chart-area-line"></canvas>
</div>
</div>
<?php
}
$originalOrders = array();
echo '<p> </p>';
echo '<div class="row-fluid
ph-admin-stat-row">';
// Best selling - period
echo '<div class="col-xs-12 col-sm-4 col-md-4
ph-admin-stat-box">';
echo '<h2>'. JText::_('COM_PHOCACART_TOP_5') .
' - '.
JText::_('COM_PHOCACART_BEST_SELLING_PRODUCTS').'<br
/>';
echo '('. $this->t['date_from'] .' - '.
$this->t['date_to'] .')</h2>';
$dataBs2 = array();
if (!empty($this->t['best_selling2'])) {
echo '<table>';
foreach ($this->t['best_selling2'] as $k => $v) {
$dataBs2[$k]['title'] = $v->title;
$dataBs2[$k]['items'] = $v->count_products;
echo '<tr><td>'. $v->title.
'</td><td
class="ph-table-td-left">'.$v->count_products.'x</td></tr>';
}
echo '</table>';
$s->renderChartJsPie('phChartAreaPieBs2', $dataBs2);
$s->setFunction('phChartAreaPieBs2', 'Pie');
echo '<div id="phChartAreaPieBs2Holder"
style="width: 300px;margin-top:10px;" >';
echo '<canvas class="ph-stats-canvas"
id="phChartAreaPieBs2" width="300"
height="300" />';
echo '</div>';
if ($this->t['best_selling2_count'] != '') {
echo '<div class="ph-stat-total">';
echo
'<h3>'.JText::_('COM_PHOCACART_ALL_PRODUCTS').
'</h3>';
echo '<div>'.JText::_('COM_PHOCACART_TOTAL').
':
'.$this->t['best_selling2_count'].'</div>';
echo '</div>';
}
} else {
echo JText::_('COM_PHOCACART_NO_PRODUCTS_SOLD_IN_THIS_PERIOD');
}
echo '</div>';
// Best selling
$dataBs1 = array();
echo '<div class="col-xs-12 col-sm-4 col-md-4
ph-admin-stat-box">';
echo '<h2>'. JText::_('COM_PHOCACART_TOP_5') .
' - '.
JText::_('COM_PHOCACART_BEST_SELLING_PRODUCTS').'<br
/>';
echo
JText::_('COM_PHOCACART_FOR_THE_WHOLE_PERIOD').'</h2>';
if (!empty($this->t['best_selling'])) {
$dataBs = array();
echo '<table>';
foreach ($this->t['best_selling'] as $k => $v) {
$dataBs1[$k]['title'] = $v->title;
$dataBs1[$k]['items'] = $v->count_products;
echo '<tr><td>'. $v->title.
'</td><td
class="ph-table-td-left">'.$v->count_products.'x</td></tr>';
}
echo '</table>';
$s->renderChartJsPie('phChartAreaPieBs1', $dataBs1);
$s->setFunction('phChartAreaPieBs1', 'Pie');
echo '<div id="phChartAreaPieBs1Holder"
style="width: 300px;margin-top:10px;" >';
echo '<canvas class="ph-stats-canvas"
id="phChartAreaPieBs1" width="300"
height="300" />';
echo '</div>';
if ($this->t['best_selling_count'] != '') {
echo '<div class="ph-stat-total">';
echo
'<h3>'.JText::_('COM_PHOCACART_ALL_PRODUCTS').
'</h3>';
echo '<div>'.JText::_('COM_PHOCACART_TOTAL').
':
'.$this->t['best_selling_count'].'</div>';
echo '</div>';
}
} else {
echo
JText::_('COM_PHOCACART_NO_PRODUCTS_SOLD_FOR_THE_WHOLE_PERIOD');
}
echo '</div>';
// Most viewed
$dataMv = array();
echo '<div class="col-xs-12 col-sm-4 col-md-4
ph-admin-stat-box">';
echo '<h2>'. JText::_('COM_PHOCACART_TOP_5') .
' - '.
JText::_('COM_PHOCACART_MOST_VIEWED_PRODUCTS').'<br
/>';
echo
JText::_('COM_PHOCACART_FOR_THE_WHOLE_PERIOD').'</h2>';
if (!empty($this->t['most_viewed'])) {
echo '<table>';
foreach ($this->t['most_viewed'] as $k => $v) {
$dataMv[$k]['title'] = $v->title;
$dataMv[$k]['items'] = $v->hits;
echo '<tr><td>'. $v->title.
'</td><td
class="ph-table-td-left">'.$v->hits.'x</td></tr>';
}
echo '</table>';
$s->renderChartJsPie('phChartAreaPieMv', $dataMv);
$s->setFunction('phChartAreaPieMv', 'Pie');
echo '<div id="phChartAreaPieMvHolder"
style="width: 300px;margin-top:10px;" >';
echo '<canvas class="ph-stats-canvas"
id="phChartAreaPieMv" width="300"
height="300" />';
echo '</div>';
if ($this->t['most_viewed_count'] != '') {
echo '<div class="ph-stat-total">';
echo
'<h3>'.JText::_('COM_PHOCACART_ALL_PRODUCTS').
'</h3>';
echo '<div>'.JText::_('COM_PHOCACART_TOTAL').
':
'.$this->t['most_viewed_count'].'</div>';
echo '</div>';
}
} else {
echo
JText::_('COM_PHOCACART_NO_PRODUCTS_DISPLAYED_FOR_THE_WHOLE_PERIOD');
}
echo '</div>';
$s->renderFunctions();
//echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';
echo '</div>';// end row
//echo $r->formInputs();
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,)views/phocacartstatistics/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��6���'views/phocacartstatistics/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartStatistics extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
protected $d;
function display($tpl = null) {
$document = JFactory::getDocument();
$this->t = PhocacartUtils::setVars('statistic');
$this->r = new PhocacartRenderAdminviews();
$this->state = $this->get('State');
$this->t['date_from'] =
$this->state->get('filter.date_from',
PhocacartDate::getCurrentDate(30));
$this->t['date_to'] =
$this->state->get('filter.date_to',
PhocacartDate::getCurrentDate());
$dateDays =
PhocacartDate::getDateDays($this->t['date_from'],
$this->t['date_to']);
if (!empty($dateDays)) {
$count = iterator_count($dateDays);
} else {
$count = 0;
}
$this->t['data_error'] = 0;
$this->t['data_possible_days'] = 365;
if ($count > (int)$this->t['data_possible_days']) {
$this->state->set('filter.date_to', '');
$this->state->set('filter.date_from', '');
$this->t['data_error'] = 1;
}
if ($this->t['data_error'] == 0) {
$this->items = $this->get('Items');
//$this->pagination = $this->get('Pagination');
}
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
$dataGraph = '';
$amount = array();
$orders = array();
if (!empty($this->items) && !empty($dateDays)) {
foreach($dateDays as $date) {
$amount[ $date->format('Y-m-d') ] = 0;
$orders[ $date->format('Y-m-d') ] = 0;
}
foreach($this->items as $k => $v) {
if (isset($amount[$v->date_only])) {
//- $amount[$v->date_only] += $v->order_amount;
$amount[$v->date_only] = $v->order_amount;
}
if (isset($orders[$v->date_only])) {
//- $orders[$v->date_only] += $v->count_orders;
$orders[$v->date_only] = $v->count_orders;
}
}
}
$this->d['amount'] = '';
$this->d['orders'] = '';
$this->d['ticks'] = '';
$i = 1;
foreach ($amount as $k => $v) {
if ($this->d['amount'] != '') {
$this->d['amount'] .= ', ';
}
//$this->d['amount'] .=
'["'.$i.'",'.$v.']';
//$this->d['amount'] .=
'\''.$v.'\'';
$this->d['amount'] .= (int)$v;
$i++;
}
$i = 1;
foreach ($orders as $k => $v) {
if ($this->d['orders'] != '') {
$this->d['orders'] .= ', ';
}
if ($this->d['ticks'] != '') {
$this->d['ticks'] .= ', ';
}
//$this->d['orders'] .=
'["'.$i.'",'.$v.']';
//$this->d['orders'] .=
'\''.$v.'\'';
$this->d['orders'] .= (int)$v;
//$this->d['ticks'] .=
'['.$i.',"'.$k.'"]';
$this->d['ticks'] .=
'\''.$k.'\'';
$i++;
}
$media = new PhocacartRenderAdminmedia();
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework', false);
$document->addScript(JURI::root(true).'/media/com_phocacart/js/administrator/jquery.equalheights.min.js');
$document->addScriptDeclaration(
//'jQuery(window).load(function(){
'jQuery(window).on(\'load\', function(){
jQuery(\'.ph-admin-stat-box\').equalHeights();
});');
// Most viewed and best-selling products
$this->t['most_viewed'] =
PhocacartProduct::getMostViewedProducts(0, false, false);
$this->t['best_selling'] =
PhocacartProduct::getBestSellingProducts();
$this->t['best_selling2'] =
PhocacartProduct::getBestSellingProducts(5,
$this->t['date_from'], $this->t['date_to']);
$this->t['most_viewed_count'] =
PhocacartProduct::getMostViewedProducts(0, false, false, true);
$this->t['best_selling_count'] =
PhocacartProduct::getBestSellingProducts(0, '', '',
true);
$this->t['best_selling2_count'] =
PhocacartProduct::getBestSellingProducts(5,
$this->t['date_from'], $this->t['date_to'],
true);
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.statistic_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_STATISTICS' ), 'stats' );
// This button is unnecessary but it is displayed because Joomla! design
bug
$bar = JToolbar::getInstance( 'toolbar' );
$dhtml = '<a href="index.php?option=com_phocacart"
class="btn btn-small"><i class="icon-home-2"
title="'.JText::_('COM_PHOCACART_CONTROL_PANEL').'"></i>
'.JText::_('COM_PHOCACART_CONTROL_PANEL').'</a>';
$bar->appendButton('Custom', $dhtml);
/*
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartlogs.delete',
$this->t['l'].'_DELETE');
}*/
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,
views/phocacartstatus/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�x�Zhh#views/phocacartstatus/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'email' =>
JText::_($this->t['l'].'_EMAIL_OPTIONS'),
'gift' =>
JText::_($this->t['l'].'_GIFT_VOUCHER_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$translatedTitle = $this->form->getValue('title') ?
'<small>('.JText::_($this->form->getValue('title')).')</small>'
: '';
echo $r->item($this->form, 'title', $translatedTitle, 1);
$formArray = array ( 'stock_movements',
'change_user_group', 'change_points_needed',
'change_points_received', 'download');
echo $r->group($this->form, $formArray);
$formArray = array ('ordering');
echo $r->group($this->form, $formArray);
$formArray = array('description');
echo $r->group($this->form, $formArray, 1);
echo $r->endTab();
echo $r->startTab('email', $tabs['email']);
$formArray = array ('email_subject',
'email_customer');
echo $r->group($this->form, $formArray);
$formArray = array('email_text');
echo $r->group($this->form, $formArray, 1);
$formArray = array( 'email_footer');
echo $r->group($this->form, $formArray, 1);
$formArray = array ( 'email_subject_others',
'email_others');
echo $r->group($this->form, $formArray);
$formArray = array( 'email_text_others');
echo $r->group($this->form, $formArray, 1);
$formArray = array ('email_send', 'email_send_format',
'orders_view_display', 'email_attachments');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('gift', $tabs['gift']);
$formArray = array ( 'activate_gift', 'email_gift',
'email_subject_gift_sender');
echo $r->group($this->form, $formArray);
$formArray = array ( 'email_text_gift_sender');
echo $r->group($this->form, $formArray, 1);
$formArray = array ( 'email_subject_gift_recipient');
echo $r->group($this->form, $formArray);
$formArray = array ( 'email_text_gift_recipient');
echo $r->group($this->form, $formArray, 1);
$formArray = array ( 'email_gift_format');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs();
echo $r->endForm();
//echo '</div>';
?>
PK�"�[�#o,,%views/phocacartstatus/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�ߤ���#views/phocacartstatus/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocaCartStatus extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $attributeoption;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('status');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.status_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_ORDER_STATUS' ).': <small><small>[ ' .
$text.' ]</small></small>' , 'time');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,"views/phocacartstatuses/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��ǿ�(views/phocacartstatuses/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th class="ph-title">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_TITLE', 'a.title',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-published">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_PUBLISHED',
'a.published', $listDirn, $listOrder) . '</th>' .
"\n";
echo '<th class="ph-movements ph-center">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_STOCK_MOVEMENTS',
'a.stock_movements', $listDirn, $listOrder) .
'</th>' . "\n";
echo '<th class="ph-download ph-center">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_DOWNLOAD', 'a.download',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-type ph-center">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_DEFAULT', 'a.type',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-id ph-center">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_ID', 'a.id', $listDirn,
$listOrder) . '</th>' . "\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart &&
$j < (int)$this->pagination->limit) {
$j++;
$urlEdit = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'] . '.edit&id=';
$urlTask = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') || $item->checked_out ==
$user->get('id') || $item->checked_out == 0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_($urlEdit . $item->id);
echo $r->startTr($i, isset($item->catid) ?
(int)$item->catid : 0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .=
Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'] . '.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="' . JRoute::_($linkEdit)
. '">' . $this->escape(JText::_($item->title)) .
'</a>' . ' <small>(' .
$this->escape($item->title) . ')</small>';
} else {
$checkO .= $this->escape(JText::_($item->title)) . '
<small>(' . $this->escape($item->title) .
')</small>';
}
echo $r->td($checkO, "small");
echo
$r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'] . '.',
$canChange), "small");
echo $r->td($this->escape($item->stock_movements),
"small ph-center");
if ($item->download == 1) {
$download = '<span class="label label-success
badge badge-success">' .
JText::_('COM_PHOCACART_YES') . '</span>';
} else {
$download = '<span class="label label-important
label-danger badge badge-danger">' .
JText::_('COM_PHOCACART_NO') . '</span>';
}
echo $r->td($download, "small ph-center");
if ($item->type == 1) {
$default = '<a data-original-title="' .
JText::_('COM_PHOCACART_DEFAULT') . '" class="btn
btn-micro disabled jgrid hasTooltip" title="' .
JText::_('COM_PHOCACART_DEFAULT') . '"><i
class="icon-featured"></i></a>';
echo $r->td($default, "small ph-center");
} else {
echo $r->td('', "small");
}
echo $r->td($item->id, "small ph-center");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 8);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,'views/phocacartstatuses/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[5�"�{{%views/phocacartstatuses/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocaCartStatuses extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('status');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.status_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_ORDER_STATUSES' ), 'time'
);
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartstatuses.delete',
$this->t['l'].'_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.stock_movements' => JText::_($this->t['l']
. '_STOCK_MOVEMENTS'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.download' => JText::_($this->t['l'].
'_DOWNLOAD'),
'a.type' => JText::_($this->t['l'].
'_DEFAULT'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,%views/phocacartstockstatus/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�{�P,,(views/phocacartstockstatus/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
echo $r->item($this->form, 'title',
'<small>('.JText::_($this->form->getValue('title')).')</small>',
1);
$formArray = array ( 'image', 'ordering',
'title_feed', 'link', 'link_target');
echo $r->group($this->form, $formArray);
$formArray = array('description');
echo $r->group($this->form, $formArray, 1);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs();
echo $r->endForm();
?>
PK�"�[�#o,,*views/phocacartstockstatus/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�kvo��(views/phocacartstockstatus/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartStockStatus extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $attributeoption;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('stockstatus');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.stockstatus_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_STOCK_STATUS' ).': <small><small>[ ' .
$text.' ]</small></small>' , 'tasks');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,'views/phocacartstockstatuses/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[
��22-views/phocacartstockstatuses/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo $r->inputFilterSearch($this->t['l'] .
'_FILTER_SEARCH_LABEL', $this->t['l'] .
'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th class="ph-title">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_TITLE', 'a.title',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-published">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_PUBLISHED',
'a.published', $listDirn, $listOrder) . '</th>' .
"\n";
echo '<th class="ph-id">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_ID', 'a.id', $listDirn,
$listOrder) . '</th>' . "\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart &&
$j < (int)$this->pagination->limit) {
$j++;
$urlEdit = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'] . '.edit&id=';
$urlTask = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') || $item->checked_out ==
$user->get('id') || $item->checked_out == 0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_($urlEdit . $item->id);
echo $r->startTr($i, isset($item->catid) ?
(int)$item->catid : 0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .=
Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'] . '.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="' . JRoute::_($linkEdit)
. '">' . $this->escape(JText::_($item->title)) .
'</a>' . ' <small>(' .
$this->escape($item->title) . ')</small>';
} else {
$checkO .= $this->escape(JText::_($item->title)) . '
<small>(' . $this->escape($item->title) .
')</small>';
}
echo $r->td($checkO, "small");
echo
$r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'] . '.',
$canChange), "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 5);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,,views/phocacartstockstatuses/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�U2�""*views/phocacartstockstatuses/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartStockStatuses extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
protected $s;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('stockstatus');
$this->r = new PhocacartRenderAdminviews();
$this->s = PhocacartRenderStyle::getStyles();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.stockstatus_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_STOCK_STATUSES' ), 'tasks'
);
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartstockstatuses.delete',
$this->t['l'].'_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,$views/phocacartsubmititem/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��Ny��'views/phocacartsubmititem/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array(
'general' => JText::_($this->t['l'] .
'_GENERAL_OPTIONS'),
'item' => JText::_($this->t['l'] .
'_PRODUCT_INFORMATION'),
'contact' => JText::_($this->t['l'] .
'_CONTACT_INFORMATION'));
echo $r->navigation($tabs);
echo $r->startTabs();
// GENERAL OPTIONS
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array('title', 'user_id', 'ip',
'date_submit', 'published', 'ordering',
'upload_folder', 'upload_token');
echo $r->group($this->form, $formArray);
echo $r->endTab();
// PRODUCT INFORMATION
echo $r->startTab('item', $tabs['item']);
// Items
if (!empty($this->t['items_item'])) {
$fieldSets = $this->form->getFieldsets();
foreach ($fieldSets as $name => $fieldSet) {
if (isset($fieldSet->name) && $fieldSet->name ==
'items_item') {
foreach ($this->form->getFieldset($name) as $field) {
$isIncluded = 0;
if (in_array($field->fieldname,
$this->t['items_item'])) {
$isIncluded = 1;// included
}
if (in_array($field->fieldname . '*',
$this->t['items_item'])) {
$isIncluded = 2;// included and required
}
if ($isIncluded > 0) {
if ($isIncluded == 2) {
$field->__set('required',
true);//$field->required =
true;//$field->addAttribute('required', 'true');
}
echo '<div class="' .
$this->s['c']['control-group'] .
'">';
echo '<div class="' .
$this->s['c']['control-label'] .
'">' . $field->label . '</div>';
echo '<div class="' .
$this->s['c']['controls'] . '">' .
$field->input . '</div>';
echo '</div>';
} else {
// Because of validation, add empty values of not used
form fiels
$field->__set('required', false);
$field->__set('hidden', true);
$field->__set('class',
'hidden');
echo '<div
style="display:none">' . $field->input .
'</div>';
}
}
}
}
}
// Items - Parameter
if (!empty($this->t['items_parameter'])) {
$fieldSets = $this->form->getFieldsets();
foreach ($fieldSets as $name => $fieldSet) {
if (isset($fieldSet->name) && $fieldSet->name ==
'items_parameter') {
$parameters = PhocacartParameter::getAllParameters();
foreach ($this->form->getFieldset($name) as $field) {
// We store parameters with ID not aliases in DB
$alias = '';
$fN = (int)$field->fieldname;
if (isset($parameters[$fN]->alias) &&
$parameters[$fN]->alias != '') {
$alias = $parameters[$fN]->alias;
}
$isIncluded = 0;
if ($alias != '' && in_array($alias,
$this->t['items_parameter'])) {
$isIncluded = 1;// included
}
if ($alias != '' && in_array($alias .
'*', $this->t['items_parameter'])) {
$isIncluded = 2;// included and required
}
if ($isIncluded > 0) {
if ($isIncluded == 2) {
$field->__set('required', true);
}
echo '<div class="' .
$this->s['c']['control-group'] .
'">';
echo '<div class="' .
$this->s['c']['control-label'] .
'">' . $field->label . '</div>';
echo '<div class="' .
$this->s['c']['controls'] . '">' .
$field->input . '</div>';
echo '</div>';
} else {
$field->__set('required', false);
$field->__set('hidden', true);
$field->__set('class',
'hidden');
echo '<div
style="display:none">' . $field->input .
'</div>';
}
}
}
}
}
echo $r->endTab();
// CONTACT INFORMATION
echo $r->startTab('contact', $tabs['contact']);
if (!empty($this->t['items_contact'])) {
$fieldSets = $this->form->getFieldsets();
foreach ($fieldSets as $name => $fieldSet) {
if (isset($fieldSet->name) && $fieldSet->name ==
'items_contact') {
foreach ($this->form->getFieldset($name) as $field) {
$isIncluded = 0;
if (in_array($field->fieldname,
$this->t['items_contact'])) {
$isIncluded = 1;// included
}
if (in_array($field->fieldname . '*',
$this->t['items_contact'])) {
$isIncluded = 2;// included and required
}
if ($isIncluded > 0) {
if ($isIncluded == 2) {
$field->__set('required', true);
}
echo '<div class="' .
$this->s['c']['control-group'] .
'">';
echo '<div class="' .
$this->s['c']['control-label'] .
'">' . $field->label . '</div>';
echo '<div class="' .
$this->s['c']['controls'] . '">' .
$field->input . '</div>';
echo '</div>';
} else {
$field->__set('required', false);
$field->__set('hidden', true);
$field->__set('class',
'hidden');
echo '<div
style="display:none">' . $field->input .
'</div>';
}
}
}
}
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2">';
echo '</div>';//end span2
echo $r->formInputs();
echo $r->endForm();
?>
PK�"�[���AA1views/phocacartsubmititem/tmpl/edit_parameter.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$fieldSets = $this->form->getFieldsets();
$o = '';
foreach($fieldSets as $name => $fieldSet) {
if (isset($fieldSet->name) && $fieldSet->name ==
'items_parameter') {
foreach ($this->form->getFieldset($name) as $field) {
$o .= '<div class="control-group">';
$o .= '<div class="control-label">' .
$field->label . '</div>';
$o .= '<div class="controls">' .
$field->input . '</div>';
$o .= '</div>';
}
}
}
echo $o;
PK�"�[�#o,,)views/phocacartsubmititem/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��VV'views/phocacartsubmititem/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocaCartSubmititem extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $p;
protected $s;
protected $attributes;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('submititem');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->p = PhocacartUtils::getComponentParameters();
$this->s = PhocacartRenderStyle::getStyles();
// Items and Items (Contact) are defined in this view
// Items (Parameters) will be defined model (when creating the form)
$this->t['submit_item_form_fields'] = $this->p->get(
'submit_item_form_fields', '' );
//$this->t['items'] = explode(',',
$this->t['submit_item_form_fields']);
$this->t['items_item'] = array_map('trim',
explode(',', $this->t['submit_item_form_fields']));
$this->t['items_item'] =
array_unique($this->t['items_item']);
$this->t['submit_item_form_fields_parameters'] =
$this->p->get( 'submit_item_form_fields_parameters',
'' );
$this->t['items_parameter'] = array_map('trim',
explode(',',
$this->t['submit_item_form_fields_parameters']));
$this->t['items_parameter'] =
array_unique($this->t['items_parameter']);
$this->t['submit_item_form_fields_contact'] =
$this->p->get( 'submit_item_form_fields_contact',
'' );
$this->t['items_contact'] = array_map('trim',
explode(',',
$this->t['submit_item_form_fields_contact']));
$this->t['items_contact'] =
array_unique($this->t['items_contact']);
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.item_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_SUBMITTED_ITEM' ).': <small><small>[ ' .
$text.' ]</small></small>' , 'duplicate');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'] .
'.apply', 'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'] . '.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'] .
'.save2new', 'JTOOLBAR_SAVE_AND_NEW');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
//JToolbarHelper::custom($this->t.'.save2copy',
'copy.png', 'copy_f2.png',
'JTOOLBAR_SAVE_AS_COPY', false);
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'] .
'.cancel', 'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'] .
'.cancel', 'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,%views/phocacartsubmititems/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��Kuu+views/phocacartsubmititems/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tooltip');
Joomla\CMS\HTML\HTMLHelper::_('behavior.multiselect');
Joomla\CMS\HTML\HTMLHelper::_('dropdown.init');
Joomla\CMS\HTML\HTMLHelper::_('formbehavior.chosen',
'select');
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th class="ph-title">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_TITLE', 'a.title',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-published">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_PUBLISHED',
'a.published', $listDirn, $listOrder) . '</th>' .
"\n";
echo '<th
class="ph-user">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_USER', 'user_username',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th class="ph-date">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_DATE', 'a.date_submit',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-id">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_ID', 'a.id', $listDirn,
$listOrder) . '</th>' . "\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart &&
$j < (int)$this->pagination->limit) {
$j++;
$urlEdit = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'] . '.edit&id=';
$urlTask = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') || $item->checked_out ==
$user->get('id') || $item->checked_out == 0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_($urlEdit . $item->id);
echo $r->startTr($i, isset($item->catid) ?
(int)$item->catid : 0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .=
Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'] . '.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="' . JRoute::_($linkEdit)
. '">' . $this->escape($item->title) .
'</a>';
} else {
$checkO .= $this->escape($item->title);
}
//$checkO .= ' <span
class="smallsub">(<span>'.JText::_($this->t['l'].'_FIELD_ALIAS_LABEL').':</span>'.
$this->escape($item->alias).')</span>';
echo $r->td($checkO, "small");
echo
$r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'] . '.',
$canChange), "small");
$userO = $this->escape($item->user_name);
if (isset($item->user_username)) {
$userO .= '
<small>('.$item->user_username.')</small>';
}
echo $r->td($userO, "small");
echo $r->td($item->date_submit, "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 8);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,*views/phocacartsubmititems/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��(���(views/phocacartsubmititems/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocaCartSubmititems extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
//protected $sidebar;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('submititem');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.item_id'));
$user = JFactory::getUser();
$bar = JToolbar::getInstance('toolbar');
JToolbarHelper::title(
JText::_($this->t['l'].'_SUBMITTED_ITEMS'),
'duplicate' );
if ($canDo->get('core.create')) {
JToolbarHelper::addNew(
$this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList( JText::_(
$this->t['l'].'_WARNING_DELETE_ITEMS' ),
$this->t['tasks'].'.delete',
$this->t['l'].'_DELETE');
}
// Add a batch button
/* if ($user->authorise('core.edit'))
{
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.renderModal',
'collapseModal');
$title = JText::_('JTOOLBAR_BATCH');
$dhtml = "<button data-toggle=\"modal\"
data-target=\"#collapseModal\" class=\"btn
btn-small\">
<i class=\"icon-checkbox-partial\"
title=\"$title\"></i>
$title</button>";
$bar->appendButton('Custom', $dhtml, 'batch');
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.renderModal',
'collapseModalCA');
$title = JText::_('COM_PHOCACART_COPY_ATTRIBUTES');
$dhtml = "<button data-toggle=\"modal\"
data-target=\"#collapseModalCA\" class=\"btn
btn-small\">
<i class=\"icon-checkbox-partial\"
title=\"$title\"></i>
$title</button>";
$bar->appendButton('Custom', $dhtml,
'copy_attributes');
}
*/
$dhtml = '<button class="btn btn-small"
onclick="javascript:
if(document.adminForm.boxchecked.value==0){alert(\''.JText::_('COM_PHOCACART_WARNING_CREATE_PRODUCTS_ITEMS_MAKE_SELECTION').'\');}else{if(confirm(\''.JText::_('COM_PHOCACART_WARNING_CREATE_PRODUCTS_ITEMS').'\')){submitbutton(\'phocacartsubmititem.create\');}}"
><i class="icon-new"
title="'.JText::_('COM_PHOCACART_CREATE_PRODUCTS').'"></i>
'.JText::_('COM_PHOCACART_CREATE_PRODUCTS').'</button>';
$bar->appendButton('Custom', $dhtml);
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
//PhocacartRenderAdminview::renderWizardButton('back');
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.submit_date' => JText::_($this->t['l'] .
'_DATE'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,views/phocacarttag/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[z7���
views/phocacarttag/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('title', 'alias',
'link_ext', 'link_cat', 'type',
'display_format', 'icon_class', 'ordering');
echo $r->group($this->form, $formArray);
$formArray = array('description');
echo $r->group($this->form, $formArray, 1);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs();
echo $r->endForm();
?>
PK�"�[�#o,,"views/phocacarttag/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�/���
views/phocacarttag/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartTag extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $attributeoption;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('tag');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.tag_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_TAG' ).': <small><small>[ ' .
$text.' ]</small></small>' , 'tags');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,views/phocacarttags/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[f��$views/phocacarttags/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th
class="ph-title">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TITLE', 'a.title',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-title">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TYPE', 'a.type',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-productcount">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PRODUCT_COUNT',
'a.count_products', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-published">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PUBLISHED',
'a.published', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-id">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ID', 'a.id', $listDirn,
$listOrder ).'</th>'."\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart && $j
< (int)$this->pagination->limit) {
$j++;
$urlEdit =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
$urlTask =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit. $item->id );
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid :
0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'.
$this->escape($item->title).'</a>';
} else {
$checkO .= $this->escape($item->title);
}
echo $r->td($checkO, "small");
echo $r->td(PhocacartTag::getTagType($item->type),
"small");
$pC = '<div
class="center">'.$item->count_products;
if (PhocacartUtils::validateDate($item->count_date)) {
$pC .= '<br><small
class="nowrap">('.Joomla\CMS\HTML\HTMLHelper::_('date',
$item->count_date, 'd-m-Y H:i').')</small>';
}
$pC .= '</div>';
echo $r->td($pC, "small");
echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'].'.',
$canChange), "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 7);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,#views/phocacarttags/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�F�
!views/phocacarttags/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartTags extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('tag');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.tag_id'));
$bar = JToolbar::getInstance('toolbar');
JToolbarHelper::title( JText::_(
$this->t['l'].'_TAGS' ), 'tags' );
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacarttags.delete',
$this->t['l'].'_DELETE');
}
$dhtml = '<button
onclick="javascript:if(document.adminForm.boxchecked.value==0){alert(\''.JText::_('COM_PHOCACART_WARNING_COUNT_PRODUCTS_MAKE_SELECTION').'\');}else{Joomla.submitbutton(\'phocacarttag.countproducts\');}"
class="btn btn-small button-plus"><i
class="icon-plus"
title="'.JText::_($this->t['l'].'_COUNT_PRODUCTS').'"></i>
'.JText::_($this->t['l'].'_COUNT_PRODUCTS').'</button>';
$bar->appendButton('Custom', $dhtml,
'countproducts');
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.type' => JText::_($this->t['l'] .
'_TYPE'),
'a.count_products' => JText::_($this->t['l']
. '_PRODUCT_COUNT'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,views/phocacarttax/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[1�+[��
views/phocacarttax/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" || task == "phocacartwizard.backtowizard" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('title', 'tax_rate',
'calculation_type', 'ordering');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs($this->t['task']);
echo $r->endForm();
?>
PK�"�[�#o,,"views/phocacarttax/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[ȳ����
views/phocacarttax/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartTax extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('tax');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.tax_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_TAX' ).': <small><small>[ ' .
$text.' ]</small></small>' , 'calendar');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
PhocacartRenderAdminview::renderWizardButton('back');
}
}
?>
PK�"�[�#o,,views/phocacarttaxes/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�����%views/phocacarttaxes/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th
class="ph-title">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TITLE', 'a.title',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-published">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PUBLISHED',
'a.published', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-taxrate">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TAX_RATE', 'a.tax_rate',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-type">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_CALCULATION_TYPE',
'a.calculation_type', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-id">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ID', 'a.id', $listDirn,
$listOrder ).'</th>'."\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart && $j
< (int)$this->pagination->limit) {
$j++;
$urlEdit =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
$urlTask =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit. $item->id );
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid :
0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'.
$this->escape(JText::_($item->title)).'</a>';
} else {
$checkO .= $this->escape(JText::_($item->title));
}
$checkO .= '
<small>('.$this->escape($item->title).')</small>';
echo $r->td($checkO, "small");
echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'].'.',
$canChange), "small");
//echo
$r->td($this->escape(PhocacartPrice::cleanPrice($item->tax_rate)),
"small");
echo $r->td('<span class="ph-editinplace-text ph-eip-text
ph-eip-price"
id="taxes:tax_rate:'.(int)$item->id.'">'.$this->escape(PhocacartPrice::cleanPrice($item->tax_rate)).'</span>',
"small");
$calcType =
PhocacartUtilsSettings::getTaxCalculationType($item->calculation_type);
echo $r->td($this->escape($calcType), "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 7);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,$views/phocacarttaxes/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�[��nn"views/phocacarttaxes/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartTaxes extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('tax');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.tax_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_TAXES' ), 'calendar' );
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacarttaxes.delete',
$this->t['l'].'_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
PhocacartRenderAdminview::renderWizardButton('back');
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.tax_rate' => JText::_($this->t['l'] .
'_TAX_RATE'),
'a.calculation_type' => JText::_($this->t['l']
. '_CALCULATION_TYPE'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,
views/phocacartthumba/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�bl�WW&views/phocacartthumba/tmpl/default.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
?>PK�"�[�#o,,%views/phocacartthumba/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[h�""��#views/phocacartthumba/view.json.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
class PhocaCartCpViewPhocaCartThumbA extends JViewLegacy
{
function display($tpl = null){
if (!JSession::checkToken('request')) {
$response = array(
'status' => '0',
'error' => '<span class="ph-result-txt
ph-error-txt">' . JText::_('JINVALID_TOKEN') .
'</span>');
echo json_encode($response);
return;
}
$app = JFactory::getApplication();
$fileName = $app->input->get( 'filename', '',
'string' );
$fileName = rawUrlDecode($fileName);
$manager = $app->input->get( 'manager', '',
'string' );
$path = PhocacartPath::getPath($manager);
$absPath = $path['orig_abs_ds'] . $fileName;
if (trim($fileName) == '') {
$response = array(
'status' => '2');
echo json_encode($response);
return;
}
if (!JFile::exists($absPath)) {
$response = array(
'status' => '0',
'error' => '<span class="ph-result-txt
ph-error-txt">' .
JText::_('COM_PHOCACART_ERROR_FILE_NOT_EXIST') . '
('.rawUrlDecode($fileName).')</span>');
echo json_encode($response);
return;
}
$folder = PhocacartFile::getFolderFromTheFile($fileName);
$absPathFolder = $path['orig_abs_ds'] . $folder;
/*
if (!JFolder::exists($absPathFolder . 'thumbs')) {
if (JFolder::create( $absPathFolder . 'thumbs', 0755 )) {
$data = "<html>\n<body
bgcolor=\"#FFFFFF\">\n</body>\n</html>";
JFile::write($absPathFolder .
'thumbs/'."index.html", $data);
} else {
$response = array(
'status' => '0',
'error' => '<span class="ph-result-txt
ph-error-txt">' .
JText::_('COM_PHOCACART_ERROR_CREATING_THUMBS_FOLDER') . '
('.$folder . 'thumbs'.')</span>');
echo json_encode($response);
return;
}
}*/
$ext = strtolower(JFile::getExt($fileName));
switch ($ext) {
case 'jpg':
case 'png':
case 'gif':
case 'jpeg':
case 'webp':
$thumbnail = PhocacartFileThumbnail::getOrCreateThumbnail($fileName,
'', 1, 1, 1, 0, $manager);
//DO THUMBNAILS and return if true or false
$string = $thumbnail;
if (is_array($thumbnail)) {
$string = '';
foreach ($thumbnail as $k => $v) {
$string .= '['.$k.'] ... '.$v.'<br
/>';
}
}
break;
default:
$string = '<span class="ph-result-txt
ph-error-txt">' .
JText::_('COM_PHOCACART_SELECTED_IMAGE_TYPE_NOT_SUPPORTED') .
'</span>';
break;
}
$msg = $string;
$response = array(
'status' => '1',
'error' => '',
'message' => $msg);// $msg included the span '<span
class="ph-result-txt ph-success-txt"></span>'
echo json_encode($response);
return;
/*$msg = JText::_('COM_PHOCACART_SUCCESS_THUMBNAIL_EXISTS');
$response = array(
'status' => '1',
'error' => '',
'message' => '<span class="ph-result-txt
ph-success-txt">'.$msg.'</span>');
echo json_encode($response);
return;*/
/*
$app = JFactory::getApplication();
$params = &$app->getParams();
$ratingVote = $app->input->get( 'ratingVote', 0,
'post', 'int' );
$ratingId = $app->input->get( 'ratingId', 0,
'post', 'int' );// ID of File
$format = $app->input->get( 'format', '',
'post', 'string' );
$task = $app->input->get( 'task', '',
'get', 'string' );
$view = $app->input->get( 'view', '',
'get', 'string' );
$small = $app->input->get( 'small', 1, 'get',
'string' );//small or large rating icons
$paramsC = JComponentHelper::getParams('com_phocadownload');
$param['displayratingfile'] = $paramsC->get(
'display_rating_file', 0 );
// Check if rating is enabled - if not then user should not be able to
rate or to see updated reating
if ($task == 'refreshrate' &&
(int)$param['displayratingfile'] > 0) {
$ratingOutput = PhocaDownloadRate::renderRateFile((int)$ratingId, 1,
$small, true);// ID of File
$response = array(
'status' => '0',
'message' => $ratingOutput);
echo json_encode($response);
return;
//return $ratingOutput;
} else if ($task == 'rate') {
$user =JFactory::getUser();
$neededAccessLevels = PhocaDownloadAccess::getNeededAccessLevels();
$access =
PhocaDownloadAccess::isAccess($user->getAuthorisedViewLevels(),
$neededAccessLevels);
$post['fileid'] = (int)$ratingId;
$post['userid'] = $user->id;
$post['rating'] = (int)$ratingVote;
if ($format != 'json') {
$msg = JText::_('COM_PHOCADOWNLOAD_ERROR_WRONG_RATING') ;
$response = array(
'status' => '0',
'error' => $msg);
echo json_encode($response);
return;
}
if ((int)$post['fileid'] < 1) {
$msg = JText::_('COM_PHOCADOWNLOAD_ERROR_FILE_NOT_EXISTS');
$response = array(
'status' => '0',
'error' => $msg);
echo json_encode($response);
return;
}
$model = $this->getModel();
$checkUserVote = PhocaDownloadRate::checkUserVoteFile(
$post['fileid'], $post['userid'] );
// User has already rated this category
if ($checkUserVote) {
$msg =
JText::_('COM_PHOCADOWNLOAD_RATING_ALREADY_RATED_FILE');
$response = array(
'status' => '0',
'error' => '',
'message' => $msg);
echo json_encode($response);
return;
} else {
if ((int)$post['rating'] < 1 ||
(int)$post['rating'] > 5) {
$msg = JText::_('COM_PHOCADOWNLOAD_ERROR_WRONG_RATING');
$response = array(
'status' => '0',
'error' => $msg);
echo json_encode($response);
return;
}
if ($access > 0 && $user->id > 0) {
if(!$model->rate($post)) {
$msg = JText::_('COM_PHOCADOWNLOAD_ERROR_RATING_FILE');
$response = array(
'status' => '0',
'error' => $msg);
echo json_encode($response);
return;
} else {
$msg = JText::_('COM_PHOCADOWNLOAD_SUCCESS_RATING_FILE');
$response = array(
'status' => '1',
'error' => '',
'message' => $msg);
echo json_encode($response);
return;
}
} else {
$msg = JText::_('COM_PHOCADOWNLOAD_NOT_AUTHORISED_ACTION');
$response = array(
'status' => '0',
'error' => $msg);
echo json_encode($response);
return;
}
}
} else {
$msg = JText::_('COM_PHOCADOWNLOAD_NOT_AUTHORISED_ACTION');
$response = array(
'status' => '0',
'error' => $msg);
echo json_encode($response);
return;
}
*/
}
}
?>
PK�"�[�#o,,views/phocacarttime/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�<E��!views/phocacarttime/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('title', 'alias', 'type',
'date', 'day', 'hour_from',
'minute_from', 'hour_to', 'minute_to');
echo $r->group($this->form, $formArray);
$formArray = array('description');
echo $r->group($this->form, $formArray, 1);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs();
echo $r->endForm();
?>
PK�"�[�#o,,#views/phocacarttime/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[X�6��!views/phocacarttime/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartTime extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $attributeoption;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('time');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.time_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_OPENING_TIMES_ITEM' ).': <small><small>[
' . $text.' ]</small></small>' ,
'time');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,views/phocacarttimes/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[]�T���%views/phocacarttimes/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th
class="ph-title">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TITLE', 'a.title',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-title">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TYPE', 'a.type',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-title">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_DAY', 'a.day',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-title">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_DATE', 'a.date',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-title">'.JText::_($this->t['l'].'_TIME_FROM').'</th>'."\n";
echo '<th
class="ph-title">'.JText::_($this->t['l'].'_TIME_TO').'</th>'."\n";
echo '<th
class="ph-published">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PUBLISHED',
'a.published', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-id">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ID', 'a.id', $listDirn,
$listOrder ).'</th>'."\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart && $j
< (int)$this->pagination->limit) {
$j++;
$urlEdit =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
$urlTask =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit. $item->id );
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid :
0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'.
$this->escape($item->title).'</a>';
} else {
$checkO .= $this->escape($item->title);
}
echo $r->td($checkO, "small");
echo $r->td(PhocacartTime::getTimeType($item->type, 1),
"small");
$d = PhocacartTime::getDayOrDate($item->day, $item->date);
echo $r->td($d['day'], "small");
echo $r->td($d['date'], "small");
$timeFrom = PhocaCartTime::getTime($item->hour_from,
$item->minute_from, $item->type);
$timeTo = PhocaCartTime::getTime($item->hour_to, $item->minute_to,
$item->type);
echo $r->td($timeFrom, "small");
echo $r->td($timeTo, "small");
echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'].'.',
$canChange), "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 10);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,$views/phocacarttimes/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��3UU"views/phocacarttimes/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartTimes extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('time');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.time_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_OPENING_TIMES' ), 'time'
);
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacarttimes.delete',
$this->t['l'].'_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.day' => JText::_($this->t['l'] .
'_DAY'),
'a.date' => JText::_($this->t['l'] .
'_DATE'),
'a.type' => JText::_($this->t['l'] .
'_TYPE'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,views/phocacarttools/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�
�?��%views/phocacarttools/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$rv = $this->rv;
$s = 'jQuery(document).ready(function (){
jQuery(\'#phSubmitDownload\').on(\'click\', function
() {
jQuery(".circle").attr(\'class\',
\'circle-active\');
})
});';
JFactory::getDocument()->addScriptDeclaration($s);
JFactory::getDocument()->addScriptOptions('phLang', array(
'COM_PHOCACART_CLOSE' =>
JText::_('COM_PHOCACART_CLOSE'))
);
JFactory::getDocument()->addScriptOptions('phVars',
array('token' => JSession::getFormToken(),
'urltools' =>
JURI::base(true).'/index.php?option=com_phocacart&format=json&'.
JSession::getFormToken().'=1'));
echo '<div
id="'.$this->t['tasks'].'">';
//echo $r->startFilter();
//echo $r->endFilter();
echo $r->startMainContainer();
$url =
JRoute::_('index.php?option=com_phocacart&view=phocacarttools');
$c1 = $c2 = 'circle';
$msg = '';
$tabs = array();
$tabs['bpuv'] =
JText::_('COM_PHOCACART_BULK_PRICE_UPDATE_VALUE');
$tabs['bpuk'] =
JText::_('COM_PHOCACART_BULK_PRICE_UPDATE_KEY');
echo $rv->navigation($tabs);
echo $rv->startTabs();
echo $rv->startTab('bpuv', $tabs['bpuv'],
'active');
echo '<form class="form-inline"
id="phAdvancedToolBulkPriceValue" action=""
method="post" data-message="phMessageBox">';
echo '<div class="form-group">';
echo '<label for="file_import">'.
JText::_('COM_PHOCACART_EXPORT').':</label>';
echo '<input class="btn btn-primary"
type="submit" name="submit" value="'.
JText::_('COM_PHOCACART_EXPORT').'">';
echo '</div>';
echo '</form>';
echo '<div id="phBulkPriceOutputBox"
class="phAjaxOutputBox"></div>';
echo $rv->endTab();
echo $rv->endTabs();
echo $r->endMainContainer();
echo '</div>';
/*
echo '<div class="import-export">';
if ((int)$this->t['count'] < 1) {
$msg .= '<div class="alert alert-success">';
$msg .=
JText::_('COM_PHOCACART_THERE_ARE_NO_ITEMS_READY_TO_EXPORT');
$msg .= '</div>';
?>
<div class="row-fluid import-export-row-message">
<div class="col-xs-12 col-sm-12 col-md-12">
<div id="phMessageBox"><?php echo $msg
?></div>
</div>
</div>
<?php
} else {
// Prouducts count > 0
if ((int)$this->t['count'] > 0) {
$url2 =
'index.php?option=com_phocacart&task=phocacartexport.export&format=json&tmpl=component&'.
JSession::getFormToken().'=1';
PhocacartRenderAdminjs::renderImportExportItems($url2,
'phMessageBox', 'phFormExport',
(int)$this->t['count_pagination'],
JText::_('COM_PHOCACART_ALL_PRODUCTS_EXPORTED'), 1);
}
// Products were exported to export table
if ((int)$this->t['countexport'] > 0) {
$c1 = 'circle-active';
}
// Products were exported to export table and then the browser reloaded
the page so we need to inform the user about success
if ((int)$this->t['countexport'] ==
(int)$this->t['count']) {
$msg .= '<div class="alert alert-success">';
$msg .= JText::_('COM_PHOCACART_ALL_PRODUCTS_EXPORTED');
$msg .= '</div>';
}
?><div class="row-fluid import-export-row-message">
<div class="col-xs-12 col-sm-12 col-md-12">
<div id="phMessageBox"><?php echo $msg
?></div>
</div>
</div>
<div class="row-fluid import-export-row">
<div class="col-xs-12 col-sm-6 col-md-6">
<div class="import-export-box">
<?php if ((int)$this->t['count'] > 0) { ?>
<div class="<?php echo $c1; ?>">1</div>
<h2><?php echo JText::_('COM_PHOCACART_TOOLS');
?></h2>
<?php if ((int)$this->t['countexport'] > 0) {
} else { ?>
<div class="import-export-desc"><?php echo
JText::_('COM_PHOCACART_THERE_ARE_ITEMS_READY_TO_EXPORT'); ?>:
<?php echo $this->t['count']; ?><br /><?php
echo
JText::_('COM_PHOCACART_CLICK_EXPORT_BUTTON_TO_EXPORT_THEM_TO_FILE');
?></div>
<?php } ?>
<p> </p>
<form class="form-inline" id="phFormExport"
action="<?php echo $url2; ?>" method="post"
data-message="phMessageBox">
<div class="form-group">
<label for="file_import"><?php echo
JText::_('COM_PHOCACART_EXPORT'); ?>:</label>
<input class="btn btn-primary" type="submit"
name="submit" value="<?php echo
JText::_('COM_PHOCACART_EXPORT');?>">
</div>
</form>
<div class="progress progress-striped active" >
<div id="phProgressBar"
class="bar"></div>
</div>
<?php } else { ?>
<div class="import-export-desc"><?php echo
JText::_('COM_PHOCACART_THERE_ARE_NO_ITEMS_READY_TO_EXPORT');
?></div>
<?php } ?>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-6">
<?php if ((int)$this->t['countexport'] > 0) { ?>
<div class="import-export-box">
<div class="<?php echo $c2; ?>">2</div>
<h2><?php echo JText::_('COM_PHOCACART_DOWNLOAD');
?></h2>
<div class="import-export-desc"><?php echo
JText::_('COM_PHOCACART_EXPORT_FILE_IS_READY_TO_DOWNLOAD');
?><br /><?php echo
JText::_('COM_PHOCACART_CLICK_DOWNLOAD_BUTTON_TO_DOWNLOAD_FILE');
?></div>
<p> </p>
<form class="form-inline" id="phFormUpload"
action="<?php echo $url; ?>"
enctype="multipart/form-data" method="post"
data-message="phMessageBox">
<div class="form-group">
<label for="file_download"><?php echo
JText::_('COM_PHOCACART_FILE'); ?>:</label>
<input id="phSubmitDownload" class="btn
btn-primary" type="submit" name="submit"
value="<?php echo
JText::_('COM_PHOCACART_DOWNLOAD');?>">
<input type="hidden" name="task"
value="phocacartexport.download" />
<?php echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
?>
</div>
</form>
</div>
<?php } ?>
</div>
</div><?php
}
echo '</div>';// end import-export
echo $r->endMainContainer();
echo '</div>';
*/
?>
PK�"�[�#o,,$views/phocacarttools/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[���O��"views/phocacarttools/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\HTML\HTMLHelper;
defined('_JEXEC') or die();
jimport('joomla.application.component.view');
class PhocaCartCpViewPhocaCartTools extends JViewLegacy
{
protected $t;
protected $r;
protected $rv;
function display($tpl = null) {
$this->t =
PhocacartUtils::setVars('tool');
$this->r = new PhocacartRenderAdminviews();
$this->rv = new PhocacartRenderAdminview();
$model = $this->getModel();
$this->t['countexport'] =
$model->getItemsCountExport(); // count of products ready in export
table
$this->t['count'] =
$model->getItemsCountProduct();// count of products
HTMLHelper::_('script',
'media/com_phocacart/js/administrator/phocacarttools.js',
array('version' => 'auto'));
$paramsC =
PhocacartUtils::getComponentParameters();
$this->t['import_export_pagination'] =
$paramsC->get('import_export_pagination', 20);
$this->t['count_pagination'] = 0;
if ($this->t['count'] > 0) {
if ((int)$this->t['import_export_pagination'] >
(int)$this->t['count'] ||
(int)$this->t['import_export_pagination'] ==
(int)$this->t['count']) {
$this->t['count_pagination'] = 1;
} else if ((int)$this->t['count'] >
(int)$this->t['import_export_pagination'] &&
(int)$this->t['import_export_pagination'] >
0) {
$this->t['count_pagination'] =
ceil((int)$this->t['count'] /
(int)$this->t['import_export_pagination']);
}
}
$media = new PhocacartRenderAdminmedia();
JHtml::stylesheet($this->t['bootstrap'] .
'css/bootstrap.glyphicons-icons-only.min.css');
HTMLHelper::_('jquery.framework', false);
//PhocacartRenderJs::renderOverlayOnSubmit('phFormUpload');
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once JPATH_COMPONENT . '/helpers/' .
$this->t['tasks'] . '.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']) .
'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.export'));
JToolbarHelper::title(JText::_($this->t['l'] .
'_ADVANCED_TOOLS'), 'tool');
// This button is unnecessary but it is displayed because Joomla!
design bug
$bar = JToolbar::getInstance('toolbar');
$dhtml = '<a
href="index.php?option=com_phocacart" class="btn
btn-small"><i class="icon-home-2" title="' .
JText::_('COM_PHOCACART_CONTROL_PANEL') .
'"></i> ' .
JText::_('COM_PHOCACART_CONTROL_PANEL') . '</a>';
$bar->appendButton('Custom', $dhtml);
if ($canDo->get('core.edit')) {
}
JToolbarHelper::divider();
JToolbarHelper::help('screen.' .
$this->t['c'], true);
}
protected function getSortFields() {
return array();
}
}
?>
PK�"�[�#o,,views/phocacartunit/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�\j��!views/phocacartunit/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('title', 'section_id',
'image','class_name', 'custom_css',
'description', 'ordering');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs($this->t['task']);
echo $r->endForm();
?>
PK�"�[�#o,,#views/phocacartunit/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�5�]��!views/phocacartunit/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartUnit extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $attributeoption;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('unit');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.unit_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_UNIT' ).': <small><small>[ ' .
$text.' ]</small></small>' ,
'modal-window');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,views/phocacartunits/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[_Y
��%views/phocacartunits/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->selectFilterSection(PhocacartSection::options(),
'COM_PHOCACART_SELECT_SECTION',
$this->state->get('filter.section_id'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
$idMd = 'phEditStatusModal';
$textButton = 'COM_PHOCACART_EDIT_TAX';
$w = 500;
$h = 400;
$rV = new PhocacartRenderAdminview();
echo $rV->modalWindowDynamic($idMd, $textButton, $w, $h, true);
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th class="ph-title">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_TITLE', 'a.title',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-section">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_SECTION',
'section_title', $listDirn, $listOrder) . '</th>'
. "\n";
echo '<th class="ph-published">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_PUBLISHED',
'a.published', $listDirn, $listOrder) . '</th>' .
"\n";
echo '<th class="ph-id">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_ID', 'a.id', $listDirn,
$listOrder) . '</th>' . "\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart &&
$j < (int)$this->pagination->limit) {
$j++;
$urlEdit = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'] . '.edit&id=';
$urlTask = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') || $item->checked_out ==
$user->get('id') || $item->checked_out == 0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_($urlEdit . $item->id);
$linkTax = JRoute::_('index.php?option=' .
$this->t['o'] .
'&view=phocacartedittax&type=2&tmpl=component&id='
. (int)$item->id);
echo $r->startTr($i, isset($item->catid) ?
(int)$item->catid : 0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .=
Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'] . '.', $canCheckin);
}
if (isset($item->image) && $item->image !=
'') {
$checkO .= ' <span>' .
PhocacartImage::getImage($item->image, '', '20px') .
'<span> ';
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="' . JRoute::_($linkEdit)
. '">' . $item->title . '</a>';
} else {
$checkO .= $this->escape($item->title);
}
echo $r->td($checkO, "small");
echo $r->td($item->section_title, "small");
echo
$r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'] . '.',
$canChange), "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 6);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,$views/phocacartunits/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[2�#��
�
"views/phocacartunits/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartUnits extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('unit');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.unit_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_UNITS' ), 'modal-window'
);
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartunits.delete',
$this->t['l'].'_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'section_title' => JText::_($this->t['l'] .
'_SECTION'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,#views/phocacartunittests/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[~�faa)views/phocacartunittests/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
?>PK�"�[�#o,,(views/phocacartunittests/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�#o,,views/phocacartuser/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[d�|
!views/phocacartuser/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo '<div id="ph-request-message"
style="display:none"></div>';
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'billing' =>
JText::_($this->t['l'].'_BILLING_OPTIONS'),
'shipping' =>
JText::_($this->t['l'].'_SHIPPING_OPTIONS'),
'main' =>
JText::_($this->t['l'].'_MAIN_OPTIONS'),
'groups' =>
JText::_($this->t['l'].'_GROUP_OPTIONS'));
echo $r->navigation($tabs);
$data = PhocacartUser::getAddressDataForm($this->formspecific,
$this->fields['array'], $this->u);
echo $r->startTabs();
echo $r->startTab('billing', $tabs['billing'],
'active');
echo $data['b'];
echo $r->endTab();
echo $r->startTab('shipping', $tabs['shipping']);
echo $data['s'];
echo $r->endTab();
echo $r->startTab('main', $tabs['main']);
$formArray = array ('loyalty_card_number');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('groups', $tabs['groups']);
$formArray = array ('group');
echo $r->group($this->form, $formArray);
echo '<input type="hidden"
name="jform[user_id]" id="jform_user_id"
value="'.(int)$this->u->id.'" />';
echo $r->endTab();
/*
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo '</div>';*/
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs();
echo $r->endForm();
?>
PK�"�[�#o,,#views/phocacartuser/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�\��EE!views/phocacartuser/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartUser extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $formspecific;
protected $fields;
protected $t;
protected $r;
protected $u;
public function display($tpl = null) {
$app = JFactory::getApplication();
$this->t = PhocacartUtils::setVars('user');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->formspecific = $this->get('FormSpecific');
$this->item = $this->get('Item');
$this->fields = $this->get('Fields');
if (isset($this->item->user_id) &&
(int)$this->item->user_id > 0) {
$user_id = $this->item->user_id;
} else {
$user_id = $this->state->get($this->getName() .
'.id');
}
$this->u = JFactory::getUser($user_id);
// There are two forms
// 1) billing and shipping created by code
// 2) other info created by XML (user_id, group)
//$this->form->setValue('user_id', $user_id); // Add
user_id to 2) so the field can get right Parameters
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.user_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_CUSTOMER' ).': <small><small>[ ' .
$text.' ]</small></small>' , 'user');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
//JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,views/phocacartusers/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�Z��44%views/phocacartusers/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
$userNameSelected = isset($this->items[0]->user_name_selected) ?
$this->items[0]->user_name_selected : '';
echo
$r->inputFilterUser($this->t['l'].'_FILTER_USER_LABEL',
$this->t['l'].'_FILTER_USER_DESC',
$this->escape($this->state->get('filter.user')),
$userNameSelected);
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR', array(0 =>
'field-user-input'));
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
$idMd = 'phViewCartModal';
$textButton = 'COM_PHOCACART_VIEW_CART';
$w = 500;
$h = 400;
$rV = new PhocacartRenderAdminview();
echo $rV->modalWindowDynamic($idMd, $textButton, $w, $h, true);
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th
class="ph-name">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_NAME', 'u.name',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-status">'.JText::_($this->t['l'].'_STATUS').'</th>'."\n";
echo '<th class="ph-action">' .
JText::_($this->t['l'] . '_INFO') .
'</th>' . "\n";
echo '<th
class="ph-group">'.JText::_($this->t['l'].'_GROUPS').'</th>'."\n";
echo '<th
class="ph-name">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_FIRST_NAME_LABEL',
'a.name_first', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-name">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_LAST_NAME_LABEL',
'a.name_last', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-address">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ADDRESS_1_LABEL',
'a.address_1', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-email">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_EMAIL_LABEL', 'u.email',
$listDirn, $listOrder ).'</th>'."\n";
//echo '<th
class="ph-published">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PUBLISHED',
'a.published', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-id">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ID', 'u.id', $listDirn,
$listOrder ).'</th>'."\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
$emailConflict = 0;
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart && $j
< (int)$this->pagination->limit) {
$j++;
$urlEdit =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
$urlTask =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit. $item->user_id );
$linkCart = JRoute::_(
'index.php?option='.$this->t['o'].'&view=phocacartcart&tmpl=component&userid='.(int)$item->cartuserid
. '&vendorid='.(int)$item->cartvendorid .
'&ticketid='.(int)$item->cartticketid .
'&unitid='.(int)$item->cartunitid .
'§ionid='.(int)$item->cartsectionid );
$linkCartHandler= 'rel="{handler: \'iframe\', size: {x:
580, y: 460}}"';
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid :
0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
//if (($canCreate || $canEdit) && (int)$item->id > 0) {
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'.
$this->escape($item->user_name).'</a>';
} else {
$checkO .= $this->escape($item->user_name);
}
if (isset($item->user_username)) {
$checkO .= '
<small>('.$item->user_username.')</small>';
}
echo $r->td($checkO, "small");
// Status
// NOT ACTIVE
$active = 0;
if ((int)$item->id < 1 && (int)$item->cartuserid < 1)
{
echo $r->td( '<span class="label label-important
label-danger badge
badge-danger">'.JText::_('COM_PHOCACART_NOT_ACTIVE').'</span>',
"small");
}
// ORDER MADE
else if ( (int)$item->orderuserid > 0 ) {
$o = '<span class="label label-success badge
badge-success">'.JText::_('COM_PHOCACART_ACTIVE_ORDER').'</span>';
if ((int)$item->cartuserid > 0) {
//$o .= ' <a class="modal_view_cart ph-u"
href="'.$linkCart.'" '.$linkCartHandler.'
><small>'.JText::_('COM_PHOCACART_VIEW_CART').'</small></a>';
$o .= ' <span><a href="#'.$idMd.'"
role="button" class="ph-u
'.$idMd.'ModalButton" data-toggle="modal"
title="' . JText::_($textButton) . '"
data-src="'.$linkCart.'"
data-height="'.$h.'"
data-width="'.$w.'">'. JText::_($textButton) .
'</a></span>';
}
echo $r->td( $o, "small");
$active = 1;
}
// ADDED BILLING AND SHIPPING ADDRESS
else if ((int)$item->id > 0 && ($item->name_last !=
'' || $item->name_first != '' || $item->city !=
'' || $item->address_1 != '')) {
$o = '<span class="label label-warning badge badge-warning
label-info">'.JText::_('COM_PHOCACART_ACTIVE').'</span>';
if ((int)$item->cartuserid > 0) {
//$o .= ' <a class="modal_view_cart ph-u"
href="'.$linkCart.'" '.$linkCartHandler.'
><small>'.JText::_('COM_PHOCACART_VIEW_CART').'</small></a>';
$o .= ' <span><a href="#'.$idMd.'"
role="button" class="ph-u
'.$idMd.'ModalButton" data-toggle="modal"
title="' . JText::_($textButton) . '"
data-src="'.$linkCart.'"
data-height="'.$h.'"
data-width="'.$w.'">'. JText::_($textButton) .
'</a></span>';
}
echo $r->td( $o, "small");
$active = 1;
}
// ADDED ITEMS TO CART BUT NO ORDER, NO BILLING OR SHIPPING ADDRESS
else if ( (int)$item->cartuserid > 0 || ($item->name_last !=
'' || $item->name_first != '' || $item->city !=
'' || $item->address_1 != '')) {
$o = '<span class="label label-warning badge badge-warning
label-warning">'.JText::_('COM_PHOCACART_PARTIALLY_ACTIVE').'</span>';
if ((int)$item->cartuserid > 0) {
//$o .= ' <a class="modal_view_cart ph-u"
href="'.$linkCart.'" '.$linkCartHandler.'
><small>'.JText::_('COM_PHOCACART_VIEW_CART').'</small></a>';
$o .= ' <span><a href="#'.$idMd.'"
role="button" class="ph-u
'.$idMd.'ModalButton" data-toggle="modal"
title="' . JText::_($textButton) . '"
data-src="'.$linkCart.'"
data-height="'.$h.'"
data-width="'.$w.'">'. JText::_($textButton) .
'</a></span>';
}
echo $r->td( $o, "small");
$active = 1;
}
// ADDED ITEMS TO CART BUT NO ORDER, NO BILLING OR SHIPPING ADDRESS
else if ( (int)$item->cartuserid > 0) {
$o = '<span class="label label-warning badge badge-warning
label-warning">'.JText::_('COM_PHOCACART_PARTIALLY_ACTIVE').'</span>';
if ((int)$item->cartuserid > 0) {
//$o .= ' <a class="modal_view_cart ph-u"
href="'.$linkCart.'" '.$linkCartHandler.'
><small>'.JText::_('COM_PHOCACART_VIEW_CART').'</small></a>';
$o .= ' <span><a href="#'.$idMd.'"
role="button" class="ph-u
'.$idMd.'ModalButton" data-toggle="modal"
title="' . JText::_($textButton) . '"
data-src="'.$linkCart.'"
data-height="'.$h.'"
data-width="'.$w.'">'. JText::_($textButton) .
'</a></span>';
}
echo $r->td( $o, "small");
$active = 1;
}
// OTHER
else {
echo $r->td( '<span class="label label-important
label-danger badge
badge-danger">'.JText::_('COM_PHOCACART_NOT_ACTIVE').'</span>',
"small");
//echo $r->td('-', "small");
}
// INFO
$info = '<div class="ph-order-info-box">';
if ($active == 1 && isset($item->vendor_id) &&
(int)$item->vendor_id > 0) {
// POS
if (isset($item->vendor_username) &&
isset($item->vendor_name)) {
$vendorO = $this->escape($item->vendor_name);
$vendorO .= ' <small>(' . $item->vendor_username .
')</small>';
$info .= '<span class="label label-success badge
badge-success">' . JText::_('COM_PHOCACART_VENDOR')
. ': ' . $vendorO . '</span>';
}
if (isset($item->section_name)) {
$section = $this->escape($item->section_name);
$info .= '<span class="label
label-primary">' . JText::_('COM_PHOCACART_SECTION')
. ': ' . $section . '</span>';
}
if (isset($item->unit_name)) {
$unit = $this->escape($item->unit_name);
$info .= '<span class="label label-info badge
badge-info">' . JText::_('COM_PHOCACART_UNIT') .
': ' . $unit . '</span>';
}
if (isset($item->ticket_id) && (int)$item->ticket_id > 0)
{
$info .= '<span class="label label-warning badge
badge-warning">' . JText::_('COM_PHOCACART_TICKET')
. ': ' . $item->ticket_id . '</span>';
}
} else if ($active == 1) {
$info = '<span class="label label-info badge
badge-info">' .
JText::_('COM_PHOCACART_ONLINE_SHOP') .
'</span>';
} else {
$info = '';
}
$info .= '</div>';
echo $r->td($info, "small");
// GROUP
if (isset($item->usergroups) && $item->usergroups !=
'') {
$groupsA = explode(',', $item->usergroups);
asort($groupsA);
$groupsI = '';
foreach($groupsA as $k => $v) {
$groupsI .= ' '.JText::_($v);
}
echo $r->td($groupsI, "small");
} else {
echo $r->td('', "small");
}
echo $r->td($item->name_last, "small");
echo $r->td($item->name_first, "small");
echo $r->td($item->address_1, "small");
$email = $item->email;
if ($item->email != $item->user_email) {
$email = JText::_('COM_PHOCACART_EMAIL_CART'). ': '.
$item->email
. '<br />'.
JText::_('COM_PHOCACART_EMAIL_SYSTEM'). ':
'.$item->user_email . ' <span
class="ph-important-text">*</span>';
$emailConflict = 1;
}
echo $r->td($email, "small");
echo $r->td($item->user_id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 11);
echo $r->endTable();
echo '<div
class="ph-notes-box"><h3>'.JText::_('COM_PHOCACART_NOTES').'</h3>';
echo '<div><span class="label label-important
label-danger badge
badge-danger">'.JText::_('COM_PHOCACART_NOT_ACTIVE').'</span>
...
'.JText::_('COM_PHOCACART_NOTE_NOT_ACTIVE').'</div>';
echo '<div><span class="label label-warning badge
badge-warning">'.JText::_('COM_PHOCACART_PARTIALLY_ACTIVE').'</span>
...
'.JText::_('COM_PHOCACART_NOTE_PARTIALLY_ACTIVE').'</div>';
echo '<div><span class="label label-info badge
badge-info">'.JText::_('COM_PHOCACART_ACTIVE').'</span>
...
'.JText::_('COM_PHOCACART_NOTE_ACTIVE').'</div>';
echo '<div><span class="label label-success badge
badge-success">'.JText::_('COM_PHOCACART_ACTIVE_ORDER').'</span>
...
'.JText::_('COM_PHOCACART_NOTE_ACTIVE_ORDER').'</div>';
if ($emailConflict == 1) {
echo '<div> </div>';
echo '<div><span
class="ph-important-text">*</span> ...
'.JText::_('COM_PHOCACART_NOTE_DIFFERENT_EMAILS').'</div>';
}
echo '</div>';
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,$views/phocacartusers/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�3="views/phocacartusers/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartUsers extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('user');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.user_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_CUSTOMERS' ), 'user' );
if ($canDo->get('core.create')) {
//JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
//JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
//JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
//JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartusers.delete',
$this->t['l'].'_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
//'u.username' => JText::_($this->t['l'] .
'_USERNAME'),
'u.name' => JText::_($this->t['l'] .
'_NAME'),
'a.name_first' => JText::_($this->t['l'] .
'_FIRST_NAME_LABEL'),
'a.name_last' => JText::_($this->t['l'] .
'_LAST_NAME_LABEL'),
'a.address_1' => JText::_($this->t['l'] .
'_ADDRESS_1_LABEL'),
//'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'u.email' => JText::_($this->t['l'] .
'_EMAIL_LABEL'),
'u.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,
views/phocacartvendor/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[E9�__#views/phocacartvendor/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ( 'user_id', 'image',
'ordering');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs($this->t['task']);
echo $r->endForm();
?>
PK�"�[�#o,,%views/phocacartvendor/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[�֜��#views/phocacartvendor/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartVendor extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $attributeoption;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('vendor');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.vendor_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_VENDOR' ).': <small><small>[ ' .
$text.' ]</small></small>' , 'user');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,!views/phocacartvendors/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[D<�99'views/phocacartvendors/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCountry(PhocacartCountry::options($this->t['o']),
'COM_PHOCACART_SELECT_COUNTRY',
$this->state->get('filter.country_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
$idMd = 'phEditStatusModal';
$textButton = 'COM_PHOCACART_EDIT_TAX';
$w = 500;
$h = 400;
$rV = new PhocacartRenderAdminview();
echo $rV->modalWindowDynamic($idMd, $textButton, $w, $h, true);
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th
class="ph-image">'.JText::_($this->t['l'].'_IMAGE').'</th>'."\n";
//echo '<th
class="ph-title">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_TITLE', 'a.title',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-user">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_USER', 'user_username',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-published">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PUBLISHED',
'a.published', $listDirn, $listOrder
).'</th>'."\n";
echo '<th
class="ph-id">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ID', 'a.id', $listDirn,
$listOrder ).'</th>'."\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart && $j
< (int)$this->pagination->limit) {
$j++;
$urlEdit =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
$urlTask =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit. $item->id );
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid :
0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$image = '';
if (isset($item->image) && $item->image != '') {
$image = '
<span>'.PhocacartImage::getImage($item->image, '',
'30px', 'auto') . '<span> ';
}
echo $r->td($image, "small");
/*
$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'.
$item->title.'</a>';
} else {
$checkO .= $this->escape($item->title);
}
echo $r->td($checkO, "small");
*/
$uO = '';
if ($item->user_id > 0) {
$userCurrent = JFactory::getUser($item->user_id);
$uO .= $this->escape($userCurrent->name);
$uO .= '
<small>('.$this->escape($userCurrent->username).')</small>';
}
//echo $r->td($uO, "small");
$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'. $uO.'</a>';
} else {
$checkO .= $uO;// is escaped yet
}
echo $r->td($checkO, "small");
echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'].'.',
$canChange), "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(),7);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,&views/phocacartvendors/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[0����$views/phocacartvendors/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport('joomla.application.component.view');
class PhocaCartCpViewPhocacartVendors extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t =
PhocacartUtils::setVars('vendor');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once JPATH_COMPONENT . '/helpers/' .
$this->t['tasks'] . '.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']) .
'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.vendor_id'));
JToolbarHelper::title(JText::_($this->t['l'] .
'_VENDORS'), 'user');
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'] .
'.add', 'JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'] .
'.edit', 'JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'] .
'.publish', 'publish.png', 'publish_f2.png',
'JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'] .
'.unpublish', 'unpublish.png',
'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList($this->t['l'] .
'_WARNING_DELETE_ITEMS', 'phocacartvendors.delete',
$this->t['l'] . '_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help('screen.' .
$this->t['c'], true);
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'user_username' =>
JText::_($this->t['l'] . '_USER'),
'a.published' =>
JText::_($this->t['l'] . '_PUBLISHED'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,"views/phocacartwishlist/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��2pp%views/phocacartwishlist/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('product_id', 'category_id',
'user_id', 'ip', 'date',
'ordering');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs();
echo $r->endForm();
?>
PK�"�[�#o,,'views/phocacartwishlist/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[ǯt��%views/phocacartwishlist/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocaCartWishlist extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('wishlist');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.wishlist_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_WISH_LIST' ).': <small><small>[ ' .
$text.' ]</small></small>' , 'heart');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,#views/phocacartwishlists/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��W��)views/phocacartwishlists/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo
$r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL',
$this->t['l'].'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th
class="ph-name">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_USER', 'username',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-product">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_PRODUCT', 'productname',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-category">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_CATEGORY', 'cattitle',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-date">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_DATE', 'a.date',
$listDirn, $listOrder ).'</th>'."\n";
echo '<th
class="ph-id">'.Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'].'_ID', 'a.id', $listDirn,
$listOrder ).'</th>'."\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart && $j
< (int)$this->pagination->limit) {
$j++;
$urlEdit =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
$urlTask =
'index.php?option='.$this->t['o'].'&task='.$this->t['task'];
$orderkey = array_search($item->id,
$this->ordering[$item->user_id]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') ||
$item->checked_out==$user->get('id') ||
$item->checked_out==0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_( $urlEdit. $item->id );
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid :
0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .= Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'].'.', $canCheckin);
}
// Name
//echo $r->td($checkO . $this->escape($item->name.'
<small>('.$item->username.')</small>'),
"small");
// Name
if ($canCreate || $canEdit) {
$checkO .= '<a href="'.
JRoute::_($linkEdit).'">'.
$this->escape($item->name) .'
<small>('.$this->escape($item->username).')</small>'.'</a>';
} else {
$checkO .= $this->escape( $item->name ) .'
<small>('.$this->escape($item->username).')</small>';
}
echo $r->td($checkO, "small");
echo $r->td($this->escape($item->productname),
"small");
// Category
echo $r->td($this->escape($item->cattitle), "small");
//echo $r->td($this->escape($item->ip), "small");
//echo $r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'].'.',
$canChange), "small");
//echo $r->td(PhocacartUtils::wordDeleteWhole($item->message, 50),
"small");
echo $r->td(JHtml::date($item->date,
JText::_('DATE_FORMAT_LC5')), "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 7);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,(views/phocacartwishlists/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[����&views/phocacartwishlists/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocaCartWishlists extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('wishlist');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[(int)$item->user_id][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.question_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_WISH_LISTS' ), 'heart' );
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
//JToolbarHelper::divider();
//JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
//JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartwishlists.delete',
$this->t['l'].'_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'username' => JText::_($this->t['l'] .
'_USER'),
'productname' => JText::_($this->t['l'] .
'_PRODUCT'),
'cattitle' => JText::_($this->t['l'] .
'_CATEGORY'),
//'a.ip' => JText::_($this->t['l'] .
'_IP'),
'a.date' => JText::_($this->t['l'] .
'_DATE'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[�#o,,
views/phocacartwizard/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[ÓD�7�7&views/phocacartwizard/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
/*
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tooltip');
Joomla\CMS\HTML\HTMLHelper::_('behavior.multiselect');
Joomla\CMS\HTML\HTMLHelper::_('dropdown.init');
Joomla\CMS\HTML\HTMLHelper::_('formbehavior.chosen',
'select');
jimport( 'joomla.filesystem.folder' );
jimport( 'joomla.filesystem.file' );
*/
$linkWizard =
'index.php?option=com_phocacart&view=phocacartwizard&tmpl=component';
$linkCategoryEdit =
'index.php?option=com_phocacart&view=phocacartcategory&layout=edit';
$linkProductEdit =
'index.php?option=com_phocacart&view=phocacartitem&layout=edit';
$linkTaxEdit =
'index.php?option=com_phocacart&view=phocacarttax&layout=edit';
$linkShippingEdit =
'index.php?option=com_phocacart&view=phocacartshipping&layout=edit';
$linkPaymentEdit =
'index.php?option=com_phocacart&view=phocacartpayment&layout=edit';
$linkCountryView =
'index.php?option=com_phocacart&view=phocacartcountries';
$linkRegionView =
'index.php?option=com_phocacart&view=phocacartregions';
$linkMenus = 'index.php?option=com_menus&view=items';
$linkModules = 'index.php?option=com_modules';
$linkOptions =
'index.php?option=com_config&view=component&component=com_phocacart&path=&return=aHR0cDovL2xvY2FsaG9zdC9KMzYyL2FkbWluaXN0cmF0b3IvaW5kZXgucGhwP29wdGlvbj1jb21fcGhvY2FjYXJ0';
$urlAjax =
'index.php?option=com_phocacart&task=phocacartwizard.updatestatus&format=json&'.
JSession::getFormToken().'=1';
$urlAjaxSkipWizard =
'index.php?option=com_phocacart&task=phocacartwizard.skipwizard&format=json&'.
JSession::getFormToken().'=1';
PhocacartRenderAdminjs::renderAjaxDoRequestWizard(); // Event what must
happen to run renderAjaxDoRequestWizardAfterChange
PhocacartRenderAdminjs::renderAjaxDoRequestWizardAfterChange($urlAjax,
'phClickBtn');// Ajax to render changes
PhocacartRenderAdminjs::renderAjaxDoRequestWizardController($urlAjaxSkipWizard,
'phCloseWizard');
if ($this->page == 0) { ?>
<div class="ph-wizard-start-page-window firstpage"
data-page="0">
<h1 class="ph-modal-content-header"><?php echo
JText::_('COM_PHOCACART_WIZARD_WELCOME'); ?></h1>
<div class="ph-wizard-top-text"><?php echo
JText::_('COM_PHOCACART_WIZARD_THANK_YOU_FOR_CHOOSING_PHOCA_CART');
?></div>
<div class="row-fluid">
<div class="span6 col-sm-6 col-md-6">
<div class="ph-wizard-start-page-box">
<div><?php echo
JText::_('COM_PHOCACART_WIZARD_DOWNLOAD_DEMO_DATA');
?>:</div>
<div class="ph-wizard-center-button"><a
class="btn btn-primary
ph-btn"href="https://www.phoca.cz/download/category/100-phoca-cart-component"
target="_blank"><span class="<?php
$this->s['i']['download']?>
icon-download"></span> <?php echo
JText::_('COM_PHOCACART_DOWNLOAD'); ?></a></div>
<ol>
<li><?php echo
JText::_('COM_PHOCACART_WIZARD_INSTALL_BOTH_PACKAGES');
?></li>
<li><?php echo
JText::_('COM_PHOCACART_WIZARD_CREATE_OR_IMPORT_COUNTRIES');
?></li>
<li><?php echo
JText::_('COM_PHOCACART_WIZARD_CREATE_MENU_LINK');
?></li>
<li><?php echo
JText::_('COM_PHOCACART_WIZARD_BOOTSTRAP_TEMPLATE_RECOMMENDED');
?> <a href="https://www.phoca.cz/joomla-templates"
target="_blank"><?php echo
JText::_('COM_PHOCACART_WIZARD_DOWNLOAD_BOOTSTRAP_TEMPLATE');
?></a>.</li>
</ol>
<div><?php echo
JText::_('COM_PHOCACART_FOR_MORE_INFORMATION_FOLLOW_THIS_GUIDE');
?>: <a
href="https://www.phoca.cz/documents/116-phoca-cart-component/807-installing-sample-data-demo-data-in-phoca-cart"
target="_blank"><?php echo
JText::_('COM_PHOCACART_INSTALLING_SAMPLE_DATA_IN_PHOCA_CART');
?></a>.</div>
</div>
</div>
<div class="span6 col-sm-6 col-md-6">
<div class="ph-wizard-start-page-box">
<div><?php echo
JText::_('COM_PHOCACART_WIZARD_START_QUICK_SETUP_WIZARD');?>.</div>
<div> </div>
<div class="ph-wizard-center-button"><a
class="btn btn-primary ph-btn" href="<?php echo
JRoute::_($linkWizard.'&page=1'); ?>"><span
class="glyphicon glyphicon-ok share-alt
icon-share"></span> <?php echo
JText::_('COM_PHOCACART_START_WIZARD');
?></a></div>
</div>
</div>
</div>
</div><?php
} else if ($this->page == 1) {
?>
<div class="ph-wizard-start-page-window nextpage"
data-page="1">
<div class="row-fluid ph-vertical-align ph-wizard-row">
<div class="span12 col-sm-12 col-md-12">
<div id="phResultWizardAll" class="ph-center"
style="display:none;">
<div><?php echo
JText::_('COM_PHOCACART_YOUR_STORE_IS_READY'); ?></div>
<div><button id="phCloseWizard" class="btn
btn-success ph-btn"><span
class="icon-delete"></span> <?php echo
JText::_('COM_PHOCACART_CLOSE_WIZARD');
?></button></div>
</div>
</div>
</div>
<div class="row-fluid ph-vertical-align ph-wizard-row">
<div class="span6 col-sm-6 col-md-6"><?php echo
JText::_('COM_PHOCACART_CREATE_AT_LEAST_ONE_CATEGORY');
?></div>
<div class="span3 col-sm-3 col-md-3 "><a
class="btn btn-primary ph-btn phClickBtn" href="<?php
echo JRoute::_($linkCategoryEdit);?>"
target="_parent"><?php echo
JText::_('COM_PHOCACART_CREATE_CATEGORY');
?></a></div>
<div class="span3 col-sm-3 col-md-3"><div
id="phResultWizardCategory"></div></div>
</div>
<div class="row-fluid ph-vertical-align ph-wizard-row">
<div class="span6 col-sm-6 col-md-6"><?php echo
JText::_('COM_PHOCACART_CREATE_TAX_IN_CASE_TAXABLE_PRODUCTS_WILL_BE_SOLD_IN_SHOP');
?></div>
<div class="span3 col-sm-3 col-md-3 "><a
class="btn btn-primary ph-btn phClickBtn" href="<?php
echo JRoute::_($linkTaxEdit);?>"
target="_parent"><?php echo
JText::_('COM_PHOCACART_CREATE_TAX');
?></a></div>
<div class="span3 col-sm-3 col-md-3"><div
id="phResultWizardTax"></div></div>
</div>
<div class="row-fluid ph-vertical-align ph-wizard-row">
<div class="span6 col-sm-6 col-md-6"><?php echo
JText::_('COM_PHOCACART_CREATE_AT_LEAST_ONE_PRODUCT');
?></div>
<div class="span3 col-sm-3 col-md-3 "><a
class="btn btn-primary ph-btn phClickBtn" href="<?php
echo JRoute::_($linkProductEdit);?>"
target="_parent"><?php echo
JText::_('COM_PHOCACART_CREATE_PRODUCT');
?></a></div>
<div class="span3 col-sm-3 col-md-3"><div
id="phResultWizardProduct"></div></div>
</div>
<div class="row-fluid ph-vertical-align ph-wizard-row">
<div class="span6 col-sm-6 col-md-6"><?php echo
JText::_('COM_PHOCACART_CREATE_AT_LEAST_ONE_SHIPPING_METHOD');
?></div>
<div class="span3 col-sm-3 col-md-3 "><a
class="btn btn-primary ph-btn phClickBtn" href="<?php
echo JRoute::_($linkShippingEdit);?>"
target="_parent"><?php echo
JText::_('COM_PHOCACART_CREATE_SHIPPING_METHOD');
?></a></div>
<div class="span3 col-sm-3 col-md-3"><div
id="phResultWizardShipping"></div></div>
</div>
<div class="row-fluid ph-vertical-align ph-wizard-row">
<div class="span6 col-sm-6 col-md-6"><?php echo
JText::_('COM_PHOCACART_CREATE_AT_LEAST_ONE_PAYMENT_METHOD');
?></div>
<div class="span3 col-sm-3 col-md-3 "><a
class="btn btn-primary ph-btn phClickBtn" href="<?php
echo JRoute::_($linkPaymentEdit);?>"
target="_parent"><?php echo
JText::_('COM_PHOCACART_CREATE_PAYMENT_METHOD');
?></a></div>
<div class="span3 col-sm-3 col-md-3"><div
id="phResultWizardPayment"></div></div>
</div>
<div class="row-fluid ph-vertical-align ph-wizard-row">
<div class="span6 col-sm-6 col-md-6"><?php echo
JText::_('COM_PHOCACART_ADD_OR_IMPORT_COUNTRIES');
?></div>
<div class="span3 col-sm-3 col-md-3 "><a
class="btn btn-primary ph-btn phClickBtn" href="<?php
echo JRoute::_($linkCountryView);?>"
target="_parent"><?php echo
JText::_('COM_PHOCACART_ADD_OR_IMPORT_COUNTRY');
?></a></div>
<div class="span3 col-sm-3 col-md-3"><div
id="phResultWizardCountry"></div></div>
</div>
<div class="row-fluid ph-vertical-align ph-wizard-row">
<div class="span6 col-sm-6 col-md-6"><?php echo
JText::_('COM_PHOCACART_ADD_OR_IMPORT_REGIONS');
?></div>
<div class="span3 col-sm-3 col-md-3 "><a
class="btn btn-primary ph-btn phClickBtn" href="<?php
echo JRoute::_($linkRegionView);?>"
target="_parent"><?php echo
JText::_('COM_PHOCACART_ADD_OR_IMPORT_REGION');
?></a></div>
<div class="span3 col-sm-3 col-md-3"><div
id="phResultWizardRegion"></div></div>
</div>
<div class="row-fluid ph-vertical-align ph-wizard-row">
<div class="span6 col-sm-6 col-md-6"><?php echo
JText::_('COM_PHOCACART_CREATE_MENU_LINK_TO_PHOCA_CART');
?></div>
<div class="span3 col-sm-3 col-md-3 "><a
class="btn btn-primary ph-btn phClickBtn" href="<?php
echo JRoute::_($linkMenus);?>"
target="_parent"><?php echo
JText::_('COM_PHOCACART_CREATE_MENU_LINK');
?></a></div>
<div class="span3 col-sm-3 col-md-3"><div
id="phResultWizardMenu"></div></div>
</div>
<div class="row-fluid ph-vertical-align ph-wizard-row">
<div class="span6 col-sm-6 col-md-6"><?php echo
JText::_('COM_PHOCACART_ADD_OR_EDIT_PHOCA_CART_MODULES'); ?>
(<a
href="https://www.phoca.cz/download/category/100-phoca-cart-component"
target="_blank"><?php echo
JText::_('COM_PHOCACART_DOWNLOAD_PHOCA_CART_MODULES');
?></a>)</div>
<div class="span3 col-sm-3 col-md-3 "><a
class="btn btn-primary ph-btn phClickBtn" href="<?php
echo JRoute::_($linkModules);?>"
target="_parent"><?php echo
JText::_('COM_PHOCACART_ADD_OR_EDIT_MODULES');
?></a></div>
<div class="span3 col-sm-3 col-md-3"><div
id="phResultWizardModule"></div></div>
</div>
<div class="row-fluid ph-vertical-align ph-wizard-row">
<div class="span6 col-sm-6 col-md-6"><?php echo
JText::_('COM_PHOCACART_EDIT_PHOCA_CART_OPTIONS');
?></div>
<div class="span3 col-sm-3 col-md-3 "><a
class="btn btn-primary ph-btn phClickBtn" href="<?php
echo JRoute::_($linkOptions);?>"
target="_parent"><?php echo
JText::_('COM_PHOCACART_OPTIONS'); ?></a></div>
<div class="span3 col-sm-3 col-md-3"><div
id="phResultWizardOption"></div></div>
</div>
<div class="row-fluid ph-vertical-align ph-wizard-row">
<div class="span12 col-sm-12 col-md-12"><?php echo
JText::_('COM_PHOCACART_WIZARD_BOOTSTRAP_TEMPLATE_RECOMMENDED');
?> <a href="https://www.phoca.cz/joomla-templates"
target="_blank"><?php echo
JText::_('COM_PHOCACART_WIZARD_DOWNLOAD_BOOTSTRAP_TEMPLATE');
?></a>.</div>
</div>
<div class="row-fluid ph-vertical-align ph-wizard-row">
<div class="span12 col-sm-12 col-md-12"><?php echo
JText::_('COM_PHOCACART_DISCOVER'); ?> <a
href="https://www.phoca.cz/phocacart-extensions"
target="_blank"><?php echo
JText::_('COM_PHOCACART_PHOCA_CART_EXTENSIONS');
?></a>.</div>
</div>
</div><?php
}
/*
$link = JRoute::_(
'index.php?option='.$this->t['o'].'&view=phocacartedittax&tmpl=component&id='.(int)$this->id);
if (isset($this->item->id) && (int)$this->item->id >
0 && isset($this->item->title) &&
$this->item->title != '') {
$flag = '';
if (isset($this->item->code2) && $this->item->code2 !=
'') {
$flag = PhocacartUtils::getCountryFlag($this->item->code2);
}
echo '<h1 class="ph-modal-header">'.$flag
.' '.$this->item->title.'</h1>';
echo '<form action="'.$link.'"
method="post">';
//echo '<table class="ph-tax-edit">';
echo '<div class="row-fluid
ph-tax-edit-header">';
echo '<div class="span4 col-sm-4
col-md-4">'.JText::_('COM_PHOCACART_TAX_NAME').'</div>';
echo '<div class="span2 col-sm-2
col-md-2">'.JText::_('COM_PHOCACART_TAX_RATE').'</div>';
echo '<div class="span2 col-sm-2
col-md-2">'.JText::_('COM_PHOCACART_TITLE').'</div>';
echo '<div class="span2 col-sm-2
col-md-2">'.JText::_('COM_PHOCACART_ALIAS').'</div>';
echo '<div class="span2 col-sm-2
col-md-2">'.JText::_('COM_PHOCACART_TAX_RATE_COUNTRY').'</div>';
echo '</div>';
if (!empty($this->itemcountrytax)) {
foreach($this->itemcountrytax as $k => $v) {
echo '<div class="row-fluid
ph-tax-edit-item">';
echo '<div class="span4 col-sm-4
col-md-4">'.JText::_($v->title).'</div>';
echo '<div class="span2 col-sm-2
col-md-2">'.PhocacartPrice::cleanPrice($v->tax_rate).'</div>';
echo '<div class="span2 col-sm-2 col-md-2">';
echo '<input class="input-small input-sm"
type="text"
name="jform['.(int)$v->id.'][title]"
value="'.htmlspecialchars($v->tc_title).'">';
echo '<input type="hidden"
name="jform['.(int)$v->id.'][tax_id]"
value="'.(int)$v->id.'">';
echo '</div>';
echo '<div class="span2 col-sm-2
col-md-2"><input class="input-small input-sm"
type="text"
name="jform['.(int)$v->id.'][alias]"
value="'.htmlspecialchars($v->tc_alias).'"></div>';
// cleanPrice method add 0 to empty values which is wrong in this case
as we have:
// VAT = 0 (valid VAT)
// VAT = '' (vat not set)
$tcTaxRate = '';
if ($v->tc_tax_rate != '') {
$tcTaxRate = PhocacartPrice::cleanPrice($v->tc_tax_rate);
}
echo '<div class="span2 col-sm-2
col-md-2"><input class="input-small input-sm"
type="text"
name="jform['.(int)$v->id.'][tax_rate]"
value="'.htmlspecialchars($tcTaxRate).'"></div>';
echo '</div>';
}
}
//echo '</table>';
echo '<input type="hidden" name="jform[id]"
value="'.(int)$this->id.'">';
echo '<input type="hidden" name="task"
value="phocacartedittax.edittax">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<div class="ph-tax-edit-button"><button
class="btn btn-success btn-sm ph-btn"><span
class="icon-edit"></span>
'.JText::_('COM_PHOCACART_SAVE').'</button></div>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
}
echo '<p> </p>';
echo '<form action="'.$link.'"
method="post">';
echo '<input type="hidden" name="jform[id]"
value="'.(int)$this->id.'">';
echo '<input type="hidden" name="task"
value="phocacartedittax.emptyinformation">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<button class="btn btn-primary btn-sm
ph-btn"><span class="icon-delete"></span>
'.JText::_('COM_PHOCACART_EMPTY_TAX_INFORMATION').'</button>';
echo '</div>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
*/
?>
PK�"�[�#o,,%views/phocacartwizard/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[H�<��#views/phocacartwizard/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocaCartWizard extends JViewLegacy
{
protected $t;
protected $r;
protected $s;
protected $page;
function display($tpl = null) {
$app = JFactory::getApplication();
$this->page = $app->input->get('page', 0,
'int');
$this->t = PhocacartUtils::setVars('wizard');
$this->r = new PhocacartRenderAdminview();
$this->s = PhocacartRenderStyle::getStyles();
$media = new PhocacartRenderAdminmedia();
parent::display($tpl);
}
}
?>
PK�"�[�#o,,views/phocacartzone/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[O/g�ss!views/phocacartzone/tmpl/edit.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$js ='
Joomla.submitbutton = function(task) {
if (task == "'. $this->t['task']
.'.cancel" ||
document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
} else {
Joomla.renderMessages({"error": ["'.
JText::_('JGLOBAL_VALIDATION_FORM_FAILED',
true).'"]});
}
}
';
JFactory::getDocument()->addScriptDeclaration($js);
echo $r->startForm($this->t['o'],
$this->t['task'], $this->item->id,
'adminForm', 'adminForm');
// First Column
echo '<div class="col-xs-12 col-sm-10 col-md-10
form-horizontal">';
$tabs = array (
'general' =>
JText::_($this->t['l'].'_GENERAL_OPTIONS'),
'publishing' =>
JText::_($this->t['l'].'_PUBLISHING_OPTIONS'));
echo $r->navigation($tabs);
echo $r->startTabs();
echo $r->startTab('general', $tabs['general'],
'active');
$formArray = array ('title', 'code2',
'code3', 'country', 'region',
'image', 'ordering');
echo $r->group($this->form, $formArray);
echo $r->endTab();
echo $r->startTab('publishing',
$tabs['publishing']);
foreach($this->form->getFieldset('publish') as $field) {
echo '<div class="control-group">';
if (!$field->hidden) {
echo '<div
class="control-label">'.$field->label.'</div>';
}
echo '<div class="controls">';
echo $field->input;
echo '</div></div>';
}
echo $r->endTab();
echo $r->endTabs();
echo '</div>';//end span10
// Second Column
echo '<div class="col-xs-12 col-sm-2
col-md-2"></div>';//end span2
echo $r->formInputs();
echo $r->endForm();
?>
PK�"�[�#o,,#views/phocacartzone/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[M� �
!views/phocacartzone/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartZone extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
protected $t;
protected $r;
protected $attributeoption;
public function display($tpl = null) {
$this->t = PhocacartUtils::setVars('zone');
$this->r = new PhocacartRenderAdminview();
$this->state = $this->get('State');
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$media = new PhocacartRenderAdminmedia();
JHtml::stylesheet( $this->t['bootstrap'] .
'css/bootstrap.glyphicons-icons-only.min.css' );
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
JFactory::getApplication()->input->set('hidemainmenu',
true);
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 ||
$this->item->checked_out == $user->get('id'));
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$this->state->get('filter.zone_id'));
$text = $isNew ? JText::_( $this->t['l'] . '_NEW'
) : JText::_($this->t['l'] . '_EDIT');
JToolbarHelper::title( JText::_( $this->t['l'] .
'_ZONE' ).': <small><small>[ ' .
$text.' ]</small></small>' , 'globe');
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')){
JToolbarHelper::apply($this->t['task'].'.apply',
'JTOOLBAR_APPLY');
JToolbarHelper::save($this->t['task'].'.save',
'JTOOLBAR_SAVE');
JToolbarHelper::addNew($this->t['task'].'.save2new',
'JTOOLBAR_SAVE_AND_NEW');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CANCEL');
}
else {
JToolbarHelper::cancel($this->t['task'].'.cancel',
'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
}
?>
PK�"�[�#o,,views/phocacartzones/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[��SZZ%views/phocacartzones/tmpl/default.phpnu�[���<?php
/*
* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @component Phoca Cart
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$r = $this->r;
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state',
$this->t['o']);
$saveOrder = $listOrder == 'a.ordering';
$saveOrderingUrl = '';
if ($saveOrder && !empty($this->items)) {
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
}
$sortFields = $this->getSortFields();
echo $r->jsJorderTable($listOrder);
echo $r->startForm($this->t['o'],
$this->t['tasks'], 'adminForm');
//echo $r->startFilter();
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE',
$this->state->get('filter.language'));
//echo
$r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']),
'JOPTION_SELECT_CATEGORY',
$this->state->get('filter.category_id'));
//echo $r->endFilter();
echo $r->startMainContainer();
/*
echo $r->startFilterBar();
echo $r->inputFilterSearch($this->t['l'] .
'_FILTER_SEARCH_LABEL', $this->t['l'] .
'_FILTER_SEARCH_DESC',
$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT',
'JSEARCH_FILTER_CLEAR');
echo
$r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC',
$this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC',
'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING',
$listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields,
$listOrder);
echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED',
$this->state->get('filter.published'));
echo $r->endFilterBar();
echo $r->endFilterBar();*/
$idMd = 'phEditStatusModal';
$textButton = 'COM_PHOCACART_EDIT_TAX';
$w = 500;
$h = 400;
$rV = new PhocacartRenderAdminview();
echo $rV->modalWindowDynamic($idMd, $textButton, $w, $h, true);
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
echo $r->startTable('categoryList');
echo $r->startTblHeader();
echo $r->firstColumnHeader($listDirn, $listOrder);
echo $r->secondColumnHeader($listDirn, $listOrder);
echo '<th class="ph-title">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_TITLE', 'a.title',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-countries">' .
JText::_($this->t['l'] . '_COUNTRIES') .
'</th>' . "\n";
echo '<th class="ph-regions">' .
JText::_($this->t['l'] . '_REGIONS') .
'</th>' . "\n";
echo '<th class="ph-published">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_PUBLISHED',
'a.published', $listDirn, $listOrder) . '</th>' .
"\n";
echo '<th class="ph-code">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_CODE2', 'a.code2',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-code">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_CODE3', 'a.code3',
$listDirn, $listOrder) . '</th>' . "\n";
echo '<th class="ph-id">' .
Joomla\CMS\HTML\HTMLHelper::_('searchtools.sort',
$this->t['l'] . '_ID', 'a.id', $listDirn,
$listOrder) . '</th>' . "\n";
echo $r->endTblHeader();
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
$originalOrders = array();
$parentsStr = "";
$j = 0;
if (is_array($this->items)) {
foreach ($this->items as $i => $item) {
//if ($i >= (int)$this->pagination->limitstart &&
$j < (int)$this->pagination->limit) {
$j++;
$urlEdit = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'] . '.edit&id=';
$urlTask = 'index.php?option=' .
$this->t['o'] . '&task=' .
$this->t['task'];
$orderkey = array_search($item->id, $this->ordering[0]);
$ordering = ($listOrder == 'a.ordering');
$canCreate = $user->authorise('core.create',
$this->t['o']);
$canEdit = $user->authorise('core.edit',
$this->t['o']);
$canCheckin = $user->authorise('core.manage',
'com_checkin') || $item->checked_out ==
$user->get('id') || $item->checked_out == 0;
$canChange = $user->authorise('core.edit.state',
$this->t['o']) && $canCheckin;
$linkEdit = JRoute::_($urlEdit . $item->id);
$linkTax = JRoute::_('index.php?option=' .
$this->t['o'] .
'&view=phocacartedittax&tmpl=component&id=' .
(int)$item->id);
echo $r->startTr($i, isset($item->catid) ?
(int)$item->catid : 0);
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder,
$orderkey, $item->ordering);
$checkO = '';
if ($item->checked_out) {
$checkO .=
Joomla\CMS\HTML\HTMLHelper::_('jgrid.checkedout', $i,
$item->editor, $item->checked_out_time,
$this->t['tasks'] . '.', $canCheckin);
}
if (isset($item->image) && $item->image !=
'') {
$checkO .= ' <span>' .
PhocacartImage::getImage($item->image, '', '20px') .
'<span> ';
}
if ($canCreate || $canEdit) {
$checkO .= '<a href="' . JRoute::_($linkEdit)
. '">' . $this->escape($item->title) .
'</a>';
} else {
$checkO .= $this->escape($item->title);
}
echo $r->td($checkO, "small");
$countries = PhocacartCountry::getCountries($item->id, 0,
'zone');
$cA = array();
$cO = '';
if (!empty($countries)) {
foreach ($countries as $k => $v) {
$cA[] = $v->title;
}
}
if (!empty($cA)) {
$cO .= '<small>' . implode(' ', $cA)
. '</small>';
}
echo $r->td($cO, "small");
$regions = PhocacartRegion::getRegions($item->id, 0,
'zone');
$rA = array();
$rO = '';
if (!empty($regions)) {
foreach ($regions as $k => $v) {
$rA[] = $v->title;
}
}
if (!empty($rA)) {
$rO .= '<small>' . implode(' ', $rA)
. '</small>';
}
echo $r->td($rO, "small");
echo
$r->td(Joomla\CMS\HTML\HTMLHelper::_('jgrid.published',
$item->published, $i, $this->t['tasks'] . '.',
$canChange), "small");
echo $r->td($item->code2, "small");
echo $r->td($item->code3, "small");
echo $r->td($item->id, "small");
echo $r->endTr();
//}
}
}
echo $r->endTblBody();
echo $r->tblFoot($this->pagination->getListFooter(), 10);
echo $r->endTable();
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
echo $r->endMainContainer();
echo $r->endForm();
?>
PK�"�[�#o,,$views/phocacartzones/tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK�"�[V��n~~"views/phocacartzones/view.html.phpnu�[���<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined( '_JEXEC' ) or die();
jimport( 'joomla.application.component.view' );
class PhocaCartCpViewPhocacartZones extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected $t;
protected $r;
public $filterForm;
public $activeFilters;
function display($tpl = null) {
$this->t = PhocacartUtils::setVars('zone');
$this->r = new PhocacartRenderAdminviews();
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[0][] = $item->id;
}
$media = new PhocacartRenderAdminmedia();
JHtml::stylesheet( $this->t['bootstrap'] .
'css/bootstrap.glyphicons-icons-only.min.css' );
$this->addToolbar();
parent::display($tpl);
}
function addToolbar() {
require_once
JPATH_COMPONENT.'/helpers/'.$this->t['tasks'].'.php';
$state = $this->get('State');
$class = ucfirst($this->t['tasks']).'Helper';
$canDo = $class::getActions($this->t,
$state->get('filter.zone_id'));
JToolbarHelper::title( JText::_(
$this->t['l'].'_ZONES' ), 'globe' );
if ($canDo->get('core.create')) {
JToolbarHelper::addNew($this->t['task'].'.add','JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList($this->t['task'].'.edit','JTOOLBAR_EDIT');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::divider();
JToolbarHelper::custom($this->t['tasks'].'.publish',
'publish.png',
'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolbarHelper::custom($this->t['tasks'].'.unpublish',
'unpublish.png', 'unpublish_f2.png',
'JTOOLBAR_UNPUBLISH', true);
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList(
$this->t['l'].'_WARNING_DELETE_ITEMS',
'phocacartzones.delete',
$this->t['l'].'_DELETE');
}
JToolbarHelper::divider();
JToolbarHelper::help( 'screen.'.$this->t['c'],
true );
}
protected function getSortFields() {
return array(
'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.title' => JText::_($this->t['l'] .
'_TITLE'),
'a.code2' => JText::_($this->t['l'] .
'_CODE2'),
'a.code3' => JText::_($this->t['l'] .
'_CODE3'),
'a.published' => JText::_($this->t['l'] .
'_PUBLISHED'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}
?>
PK�"�[G�5�..
access.xmlnu�[���PK�"�[b�`�����
hconfig.xmlnu�[���PK�"�[@�� ��1�controller.phpnu�[���PK�"�[��%�
*�controllers/ajax.json.phpnu�[���PK�"�[�#o,,��controllers/index.htmlnu�[���PK�"�[�S�=�*�*'��controllers/phocacartbulkprice.json.phpnu�[���PK�"�[g~����"��controllers/phocacartbulkprice.phpnu�[���PK�"�[�b�!!#@�controllers/phocacartbulkprices.phpnu�[���PK�"�[�
�9((��controllers/phocacartcart.phpnu�[���PK�"�[���V��#)�controllers/phocacartcategories.phpnu�[���PK�"�[<
��!C�controllers/phocacartcategory.phpnu�[���PK�"�[S�EW``��controllers/phocacartcommon.phpnu�[���PK�"�[��Fmm
<�controllers/phocacartcommons.phpnu�[���PK�"�[DmT���"��controllers/phocacartcountries.phpnu�[���PK�"�[�_����
�controllers/phocacartcountry.phpnu�[���PK�"�[�ˠW��.controllers/phocacartcoupon.phpnu�[���PK�"�[���@��
pcontrollers/phocacartcoupons.phpnu�[���PK�"�[��.��#�controllers/phocacartcurrencies.phpnu�[���PK�"�[MJ#V��!�controllers/phocacartcurrency.phpnu�[���PK�"�[���!�
controllers/phocacartdiscount.phpnu�[���PK�"�[�U����")
controllers/phocacartdiscounts.phpnu�[���PK�"�[�(ճ��!Acontrollers/phocacartdownload.phpnu�[���PK�"�[#��4��"�controllers/phocacartdownloads.phpnu�[���PK�"�[�=���&�controllers/phocacarteditbulkprice.phpnu�[���PK�"�[�����)�controllers/phocacarteditinplace.json.phpnu�[���PK�"�[a����.�
controllers/phocacarteditproductpointgroup.phpnu�[���PK�"�[c͞���.�'controllers/phocacarteditproductpricegroup.phpnu�[���PK�"�[��B���0/controllers/phocacarteditproductpricehistory.phpnu�[���PK�"�[�b�6� � #Q6controllers/phocacarteditstatus.phpnu�[���PK�"�[a��>��*f@controllers/phocacarteditstockadvanced.phpnu�[���PK�"�[�^�
�
fGcontrollers/phocacartedittax.phpnu�[���PK�"�[J���
${Rcontrollers/phocacartexport.json.phpnu�[���PK�"�[K3ϑ���\controllers/phocacartexport.phpnu�[���PK�"�[,���
�hcontrollers/phocacartexports.phpnu�[���PK�"�[3߁l[ [ "�kcontrollers/phocacartextension.phpnu�[���PK�"�[$���#�ucontrollers/phocacartextensions.phpnu�[���PK�"�[!�QP���xcontrollers/phocacartfeed.phpnu�[���PK�"�[��aF���zcontrollers/phocacartfeeds.phpnu�[���PK�"�[�C���"�}controllers/phocacartformfield.phpnu�[���PK�"�[��~X#4�controllers/phocacartformfields.phpnu�[���PK�"�[9
H6����controllers/phocacartgroup.phpnu�[���PK�"�[��a��ݖcontrollers/phocacartgroups.phpnu�[���PK�"�[^����controllers/phocacarthits.phpnu�[���PK�"�[�QD� � $��controllers/phocacartimport.json.phpnu�[���PK�"�[|+���-�controllers/phocacartimport.phpnu�[���PK�"�[6q��
x�controllers/phocacartimports.phpnu�[���PK�"�[�9u����controllers/phocacartinfo.phpnu�[���PK�"�[�U�����controllers/phocacartitem.phpnu�[���PK�"�[�2����controllers/phocacartitems.phpnu�[���PK�"�[������controllers/phocacartlogs.phpnu�[���PK�"�[@M�%��controllers/phocacartmanufacturer.phpnu�[���PK�"�[���y��&6�controllers/phocacartmanufacturers.phpnu�[���PK�"�[^���>>Y�controllers/phocacartorder.phpnu�[���PK�"�[$1S�����controllers/phocacartorders.phpnu�[���PK�"�[p�Y���"��controllers/phocacartparameter.phpnu�[���PK�"�[SG
���#=�controllers/phocacartparameters.phpnu�[���PK�"�[`<@�
'X�controllers/phocacartparametervalue.phpnu�[���PK�"�[�����(��controllers/phocacartparametervalues.phpnu�[���PK�"�[��Mz��
��controllers/phocacartpayment.phpnu�[���PK�"�[O��!=�controllers/phocacartpayments.phpnu�[���PK�"�[��]���!��controllers/phocacartquestion.phpnu�[���PK�"�[2�����"�controllers/phocacartquestions.phpnu�[���PK�"�[Hz�:���controllers/phocacartregion.phpnu�[���PK�"�[嫃���
controllers/phocacartregions.phpnu�[���PK�"�[�#r��
controllers/phocacartreports.phpnu�[���PK�"�[�'���,controllers/phocacartreview.phpnu�[���PK�"�[�AD���
ncontrollers/phocacartreviews.phpnu�[���PK�"�[$#���controllers/phocacartreward.phpnu�[���PK�"�[&����
�controllers/phocacartrewards.phpnu�[���PK�"�[Xe���
�controllers/phocacartsection.phpnu�[���PK�"�[�A��!controllers/phocacartsections.phpnu�[���PK�"�[@GE��!�controllers/phocacartshipping.phpnu�[���PK�"�[.9D�"�controllers/phocacartshippings.phpnu�[���PK�"�[>�t.��&/'controllers/phocacartspecification.phpnu�[���PK�"�[�x(���')controllers/phocacartspecifications.phpnu�[���PK�"�[��Kg��#�,controllers/phocacartstatistics.phpnu�[���PK�"�[\�o�uu�/controllers/phocacartstatus.phpnu�[���PK�"�[�m�B��!�2controllers/phocacartstatuses.phpnu�[���PK�"�[�B�0$�5controllers/phocacartstockstatus.phpnu�[���PK�"�[��^���&l8controllers/phocacartstockstatuses.phpnu�[���PK�"�[��%((#�;controllers/phocacartsubmititem.phpnu�[���PK�"�[��~�##$
Bcontrollers/phocacartsubmititems.phpnu�[���PK�"�[�HMTT�Econtrollers/phocacarttag.phpnu�[���PK�"�[�vTe��!Jcontrollers/phocacarttags.phpnu�[���PK�"�[�[����)Mcontrollers/phocacarttax.phpnu�[���PK�"�[���)��fOcontrollers/phocacarttaxes.phpnu�[���PK�"�[-a�{��qRcontrollers/phocacarttime.phpnu�[���PK�"�[��,!���Tcontrollers/phocacarttimes.phpnu�[���PK�"�[l�����Wcontrollers/phocacarttool.phpnu�[���PK�"�[O�����Ycontrollers/phocacarttools.phpnu�[���PK�"�[~�O���]controllers/phocacartunit.phpnu�[���PK�"�[�!2G_controllers/phocacartunits.phpnu�[���PK�"�[*�tv�
�
�bcontrollers/phocacartupload.phpnu�[���PK�"�[�o3��"�pcontrollers/phocacartuser.json.phpnu�[���PK�"�[��)t7'7'vcontrollers/phocacartuser.phpnu�[���PK�"�[��<����controllers/phocacartusers.phpnu�[���PK�"�[P�����controllers/phocacartvendor.phpnu�[���PK�"�[�##�
ݢcontrollers/phocacartvendors.phpnu�[���PK�"�[?72��!F�controllers/phocacartwishlist.phpnu�[���PK�"�[�����"��controllers/phocacartwishlists.phpnu�[���PK�"�[�,�8gg$��controllers/phocacartwizard.json.phpnu�[���PK�"�[�W!0�
�
_�controllers/phocacartwizard.phpnu�[���PK�"�[W���B�controllers/phocacartzone.phpnu�[���PK�"�[�4;����controllers/phocacartzones.phpnu�[���PK�"�[�#o,,��help/en-GB/index.htmlnu�[���PK�"�[#*�JJ��help/en-GB/logo-phoca.pngnu�[���PK�"�[�Z`77
��help/en-GB/screen.phocacart.htmlnu�[���PK�"�[�#o,,�help/index.htmlnu�[���PK�"�[#*�JJ��help/logo-phoca.pngnu�[���PK�"�[�Z`77help/screen.phocacart.htmlnu�[���PK�"�[(���1helpers/associations.phpnu�[���PK�"�[�#o,,�@helpers/html/index.htmlnu�[���PK�"�[g�cYY"SAhelpers/html/phocacartcategory.phpnu�[���PK�"�[
ad,,�Qhelpers/html/phocacartitem.phpnu�[���PK�"�[�#o,,xbhelpers/index.htmlnu�[���PK�"�[��g����bhelpers/phocacartbulkprices.phpnu�[���PK�"�[[��$��
ehelpers/phocacartcategories.phpnu�[���PK�"�[��eBB4ghelpers/phocacartcommon.phpnu�[���PK�"�[q����jhelpers/phocacartcountries.phpnu�[���PK�"�[������lhelpers/phocacartcoupons.phpnu�[���PK�"�[��|�22ohelpers/phocacartcp.phpnu�[���PK�"�[
ʬ?��zrhelpers/phocacartcurrencies.phpnu�[���PK�"�[�3<���thelpers/phocacartdiscounts.phpnu�[���PK�"�[=����vhelpers/phocacartdownloads.phpnu�[���PK�"�[.o�����xhelpers/phocacartexports.phpnu�[���PK�"�[7����{helpers/phocacartextensions.phpnu�[���PK�"�[��|b��-}helpers/phocacartfeeds.phpnu�[���PK�"�[D4׆��Ghelpers/phocacartformfields.phpnu�[���PK�"�[ޥ#��k�helpers/phocacartgroups.phpnu�[���PK�"�[�=WS����helpers/phocacarthits.phpnu�[���PK�"�[E�����helpers/phocacartimports.phpnu�[���PK�"�[��u���Çhelpers/phocacartitems.phpnu�[���PK�"�[/iA����helpers/phocacartlogs.phpnu�[���PK�"�[lζ]����helpers/phocacartmanager.phpnu�[���PK�"�[Y©\��"�helpers/phocacartmanufacturers.phpnu�[���PK�"�[Zj����B�helpers/phocacartorders.phpnu�[���PK�"�[U�4��^�helpers/phocacartparameters.phpnu�[���PK�"�[�<.��$��helpers/phocacartparametervalues.phpnu�[���PK�"�[�}1�����helpers/phocacartpayments.phpnu�[���PK�"�[�C���Ҙhelpers/phocacartquestions.phpnu�[���PK�"�[�ט����helpers/phocacartregions.phpnu�[���PK�"�[��5����helpers/phocacartreports.phpnu�[���PK�"�[uk!���9�helpers/phocacartreviews.phpnu�[���PK�"�[#����Z�helpers/phocacartrewards.phpnu�[���PK�"�[i�u/��x�helpers/phocacartsections.phpnu�[���PK�"�[�]F4����helpers/phocacartshippings.phpnu�[���PK�"�[����#��helpers/phocacartspecifications.phpnu�[���PK�"�[c�7���helpers/phocacartstatistics.phpnu�[���PK�"�[C�j���helpers/phocacartstatuses.phpnu�[���PK�"�[V^�T��"2�helpers/phocacartstockstatuses.phpnu�[���PK�"�[՚(���
\�helpers/phocacartsubmititems.phpnu�[���PK�"�[_)�����helpers/phocacarttags.phpnu�[���PK�"�[������helpers/phocacarttaxes.phpnu�[���PK�"�[�������helpers/phocacarttimes.phpnu�[���PK�"�[K�����Ѹhelpers/phocacarttools.phpnu�[���PK�"�[�2v����helpers/phocacartunits.phpnu�[���PK�"�[�ѫ����helpers/phocacartusers.phpnu�[���PK�"�[�B��%�helpers/phocacartvendors.phpnu�[���PK�"�[��z���F�helpers/phocacartwishlists.phpnu�[���PK�"�[���~��k�helpers/phocacartzones.phpnu�[���PK�"�[�#o,,
��index.htmlnu�[���PK�"�[V�b::��install/index.htmlnu�[���PK�"�[V�b::g�install/sql/index.htmlnu�[���PK�"�[�7���W�W$��install/sql/mysql/countries.utf8.sqlnu�[���PK�"�[V�b::�install/sql/mysql/index.htmlnu�[���PK�"�[��tlE�E�"tinstall/sql/mysql/install.utf8.sqlnu�[���PK�"�[}������"�install/sql/mysql/regions.utf8.sqlnu�[���PK�"�[�<�FF$� install/sql/mysql/uninstall.utf8.sqlnu�[���PK�"�[��e
�� layouts/catalog.phpnu�[���PK�"�[�#o,,�� layouts/index.htmlnu�[���PK�"�[�V�[� layouts/joomla/index.htmlnu�[���PK�"�[�V�!�� layouts/joomla/toolbar/index.htmlnu�[���PK�"�[-Կv&&
3� layouts/joomla/toolbar/title.phpnu�[���PK�"�[��������� layouts/product_export.phpnu�[���PK�"�["3V�fefe��
layouts/product_import.phpnu�[���PK�"�[۹��7�7B�
layouts/report.phpnu�[���PK�"�[�4"�yyx
libraries/autoloadEscpos.phpnu�[���PK�"�[Ŕdww=$libraries/autoloadPhoca.phpnu�[���PK�"�[X���Y%Y%&�'libraries/Escpos/CapabilityProfile.phpnu�[���PK�"�[���rr@�Mlibraries/Escpos/CapabilityProfiles/DefaultCapabilityProfile.phpnu�[���PK�"�[�^��ss@�Plibraries/Escpos/CapabilityProfiles/EposTepCapabilityProfile.phpnu�[���PK�"�[�#o,,.sSlibraries/Escpos/CapabilityProfiles/index.htmlnu�[���PK�"�[�,1nn>�Slibraries/Escpos/CapabilityProfiles/P822DCapabilityProfile.phpnu�[���PK�"�[�Xpp?�Vlibraries/Escpos/CapabilityProfiles/SimpleCapabilityProfile.phpnu�[���PK�"�[���nn=�Ylibraries/Escpos/CapabilityProfiles/StarCapabilityProfile.phpnu�[���PK�"�[��K�HH�\libraries/Escpos/CodePage.phpnu�[���PK�"�[Z�;�
(rlibraries/Escpos/CONTRIBUTING.mdnu�[���PK�"�[�PU\��
�libraries/Escpos/CONTRIBUTORS.mdnu�[���PK�"�[���1��libraries/Escpos/Devices/AuresCustomerDisplay.phpnu�[���PK�"�[�#o,,#�libraries/Escpos/Devices/index.htmlnu�[���PK�"�[ȥ�I=I=
��libraries/Escpos/EscposImage.phpnu�[���PK�"�[�GW���"�libraries/Escpos/GdEscposImage.phpnu�[���PK�"�[#Ռm'm''&�libraries/Escpos/ImagickEscposImage.phpnu�[���PK�"�[�#o,,�libraries/Escpos/index.htmlnu�[���PK�"�[έ���alibraries/Escpos/LICENSE.mdnu�[���PK�"�[�g�j__&1 libraries/Escpos/NativeEscposImage.phpnu�[���PK�"�[V"t�4�4<�libraries/Escpos/PrintBuffers/cache/Characters-default.ser.znu�[���PK�"�[�#o,,.
Alibraries/Escpos/PrintBuffers/cache/index.htmlnu�[���PK�"�[���/�&�&3�Alibraries/Escpos/PrintBuffers/EscposPrintBuffer.phpnu�[���PK�"�[zL�882�hlibraries/Escpos/PrintBuffers/ImagePrintBuffer.phpnu�[���PK�"�[�#o,,(Vxlibraries/Escpos/PrintBuffers/index.htmlnu�[���PK�"�['ʯj-�xlibraries/Escpos/PrintBuffers/PrintBuffer.phpnu�[���PK�"�[ɑ( 6V�libraries/Escpos/PrintConnectors/ApiPrintConnector.phpnu�[���PK�"�[�t����7��libraries/Escpos/PrintConnectors/CupsPrintConnector.phpnu�[���PK�"�[E��?��8�libraries/Escpos/PrintConnectors/DummyPrintConnector.phpnu�[���PK�"�[��+���7B�libraries/Escpos/PrintConnectors/FilePrintConnector.phpnu�[���PK�"�[�#o,,+2�libraries/Escpos/PrintConnectors/index.htmlnu�[���PK�"�[%���:��libraries/Escpos/PrintConnectors/NetworkPrintConnector.phpnu�[���PK�"�[�|�w3��libraries/Escpos/PrintConnectors/PrintConnector.phpnu�[���PK�"�[�d��33:2�libraries/Escpos/PrintConnectors/WindowsPrintConnector.phpnu�[���PK�"�[�G�<�<���libraries/Escpos/Printer.phpnu�[���PK�"�[���,O,OB�
libraries/Escpos/README.mdnu�[���PK�"�[~�t�!�!�,��
libraries/Escpos/resources/capabilities.jsonnu�[���PK�"�[�#o,,%5�libraries/Escpos/resources/index.htmlnu�[���PK�"�[�#o,,��libraries/index.htmlnu�[���PK�"�[�[�O O &�libraries/loader.phpnu�[���PK�"�[�#o,,��libraries/Parsedown/index.htmlnu�[���PK�"�[�@BII3�libraries/Parsedown/LICENSE.txtnu�[���PK�"�[/H��b�b�!˥libraries/Parsedown/Parsedown.phpnu�[���PK�"�[�W+55$~qlibraries/Phoca/Render/Adminview.phpnu�[���PK�"�[
$6�G�G%Ԧlibraries/Phoca/Render/Adminviews.phpnu�[���PK�"�[B�n��%��libraries/phocacart/access/access.phpnu�[���PK�"�[�#o,,%�libraries/phocacart/access/index.htmlnu�[���PK�"�[���L��%M�libraries/phocacart/access/rights.phpnu�[���PK�"�[��68L8L+"libraries/phocacart/attribute/attribute.phpnu�[���PK�"�[�#o,,(�blibraries/phocacart/attribute/index.htmlnu�[���PK�"�[D4���/9clibraries/phocacart/calculation/calculation.phpnu�[���PK�"�[�#o,,*%zlibraries/phocacart/calculation/index.htmlnu�[���PK�"�[=�M�77'�zlibraries/phocacart/captcha/captcha.phpnu�[���PK�"�[�#o,,&9libraries/phocacart/captcha/index.htmlnu�[���PK�"�[s�Q�
�
)�libraries/phocacart/captcha/recaptcha.phpnu�[���PK�"�[1���gYgY(��libraries/phocacart/cart/calculation.phpnu�[���PK�"�[Y�(�����!i�libraries/phocacart/cart/cart.phpnu�[���PK�"�[��K]�libraries/phocacart/cart/db.phpnu�[���PK�"�[�#o,,#Ƚlibraries/phocacart/cart/index.htmlnu�[���PK�"�[��=@
'G�libraries/phocacart/cart/rendercart.phpnu�[���PK�"�[+�?�
�
+��libraries/phocacart/cart/rendercheckout.phpnu�[���PK�"�[4U7O�:�:)��libraries/phocacart/category/category.phpnu�[���PK�"�[�#o,,'�libraries/phocacart/category/index.htmlnu�[���PK�"�[�5�2727)alibraries/phocacart/category/multiple.phpnu�[���PK�"�[���
'�Flibraries/phocacart/compare/compare.phpnu�[���PK�"�[�#o,,&cflibraries/phocacart/compare/index.htmlnu�[���PK�"�[>c&���#�flibraries/phocacart/count/count.phpnu�[���PK�"�[�#o,,$|libraries/phocacart/count/index.htmlnu�[���PK�"�[�%J$$'�|libraries/phocacart/country/country.phpnu�[���PK�"�[�#o,,&
�libraries/phocacart/country/index.htmlnu�[���PK�"�[�Ї�M�M%��libraries/phocacart/coupon/coupon.phpnu�[���PK�"�[�#o,,%��libraries/phocacart/coupon/index.htmlnu�[���PK�"�[�}��a
a
)�libraries/phocacart/currency/currency.phpnu�[���PK�"�[�#o,,'�libraries/phocacart/currency/index.htmlnu�[���PK�"�[�)�
�
!V�libraries/phocacart/date/date.phpnu�[���PK�"�[�#o,,#2libraries/phocacart/date/index.htmlnu�[���PK�"�[9�w�4�4%�libraries/phocacart/discount/cart.phpnu�[���PK�"�[�#o,,'�Alibraries/phocacart/discount/index.htmlnu�[���PK�"�[�}�u�u(4Blibraries/phocacart/discount/product.phpnu�[���PK�"�[s9n��B�B)#�libraries/phocacart/download/download.phpnu�[���PK�"�[�#o,,'j�libraries/phocacart/download/index.htmlnu�[���PK�"�[Ԋ����!�libraries/phocacart/edit/edit.phpnu�[���PK�"�[�f��Z6Z6#libraries/phocacart/email/email.phpnu�[���PK�"�[�#o,,$�Olibraries/phocacart/email/index.htmlnu�[���PK�"�[X�d��!8Plibraries/phocacart/feed/feed.phpnu�[���PK�"�[�#o,,#OUlibraries/phocacart/feed/index.htmlnu�[���PK�"�[���'�Ulibraries/phocacart/file/additional.phpnu�[���PK�"�[���Ů
�
!Bflibraries/phocacart/file/file.phpnu�[���PK�"�[�#o,,#A�libraries/phocacart/file/index.htmlnu�[���PK�"�[�T��DGDG&��libraries/phocacart/file/thumbnail.phpnu�[���PK�"�[�\j�j�#Z�libraries/phocacart/file/upload.phpnu�[���PK�"�[�&z%+%++elibraries/phocacart/file/uploadmultiple.phpnu�[���PK�"�[f���BB)��libraries/phocacart/file/uploadsingle.phpnu�[���PK�"�[���n�}�}%2�libraries/phocacart/filter/filter.phpnu�[���PK�"�[�#o,,%Olibraries/phocacart/filter/index.htmlnu�[���PK�"�[�#o,,#�libraries/phocacart/form/index.htmlnu�[���PK�"�[���<QQ"Olibraries/phocacart/form/items.phpnu�[���PK�"�[��011!�$libraries/phocacart/form/user.phpnu�[���PK�"�[�;�H?H?#t?libraries/phocacart/group/group.phpnu�[���PK�"�[�#o,,$libraries/phocacart/group/index.htmlnu�[���PK�"�[�An���"�libraries/phocacart/html/batch.phpnu�[���PK�"�[�]���%��libraries/phocacart/html/featured.phpnu�[���PK�"�[�͚cc!�libraries/phocacart/html/grid.phpnu�[���PK�"�[wtW�#��libraries/phocacart/html/index.htmlnu�[���PK�"�[R�����"�libraries/phocacart/html/jgrid.phpnu�[���PK�"�[F��<``��libraries/phocacart/id/id.phpnu�[���PK�"�[�#o,,!��libraries/phocacart/id/index.htmlnu�[���PK�"�[�
t�($�libraries/phocacart/image/additional.phpnu�[���PK�"�[hf�Y.>.>#��libraries/phocacart/image/image.phpnu�[���PK�"�[�#o,,$�libraries/phocacart/image/index.htmlnu�[���PK�"�[(�Y��H�H#��libraries/phocacart/image/magic.phpnu�[���PK�"�[�#o,,fClibraries/phocacart/index.htmlnu�[���PK�"�[�#o,,'�Clibraries/phocacart/language/index.htmlnu�[���PK�"�[�4��)cDlibraries/phocacart/language/language.phpnu�[���PK�"�[�#o,,"TSlibraries/phocacart/log/index.htmlnu�[���PK�"�[����Slibraries/phocacart/log/log.phpnu�[���PK�"�[�#o,,+<`libraries/phocacart/manufacturer/index.htmlnu�[���PK�"�[G'5��1�`libraries/phocacart/manufacturer/manufacturer.phpnu�[���PK�"�[�#o,,)�slibraries/phocacart/newsletter/index.htmlnu�[���PK�"�[i���-qtlibraries/phocacart/newsletter/newsletter.phpnu�[���PK�"�[�ɢ`/`/)X�libraries/phocacart/order/calculation.phpnu�[���PK�"�[�#o,,$�libraries/phocacart/order/index.htmlnu�[���PK�"�[f7��#��libraries/phocacart/order/order.phpnu�[���PK�"�[�S����$��libraries/phocacart/order/render.phpnu�[���PK�"�[�b���$A�libraries/phocacart/order/status.phpnu�[���PK�"�[&��B�5�5"��libraries/phocacart/order/view.phpnu�[���PK�"�[�#o,,'��libraries/phocacart/ordering/index.htmlnu�[���PK�"�[R��88)'�libraries/phocacart/ordering/ordering.phpnu�[���PK�"�[�#o,,)�libraries/phocacart/pagination/index.htmlnu�[���PK�"�[�]��-libraries/phocacart/pagination/pagination.phpnu�[���PK�"�[�#o,,()libraries/phocacart/parameter/index.htmlnu�[���PK�"�[�wQ/Q/+�libraries/phocacart/parameter/parameter.phpnu�[���PK�"�[�#o,,#YClibraries/phocacart/path/index.htmlnu�[���PK�"�[��yE��!�Clibraries/phocacart/path/path.phpnu�[���PK�"�[�#o,,&�_libraries/phocacart/payment/index.htmlnu�[���PK�"�[xs�{�S�S'\`libraries/phocacart/payment/payment.phpnu�[���PK�"�[�#o,,"U�libraries/phocacart/pdf/index.htmlnu�[���PK�"�[���>Ӵlibraries/phocacart/pdf/pdf.phpnu�[���PK�"�[�#o,,%8�libraries/phocacart/plugin/index.htmlnu�[���PK�"�[�
X�� � %��libraries/phocacart/plugin/plugin.phpnu�[���PK�"�[�#o,,"
�libraries/phocacart/pos/index.htmlnu�[���PK�"�[�h��#�#��libraries/phocacart/pos/pos.phpnu�[���PK�"�[��+f//!]�libraries/phocacart/pos/print.phpnu�[���PK�"�[��{%%'�libraries/phocacart/price/bulkprice.phpnu�[���PK�"�[�|o#o#%14libraries/phocacart/price/history.phpnu�[���PK�"�[�#o,,$�Wlibraries/phocacart/price/index.htmlnu�[���PK�"�[��!�ƱƱ#uXlibraries/phocacart/price/price.phpnu�[���PK�"�[�#o,,&�
libraries/phocacart/product/index.htmlnu�[���PK�"�[_Qe7�7�'libraries/phocacart/product/product.phpnu�[���PK�"�[�#o,,%�
libraries/phocacart/region/index.htmlnu�[���PK�"�[=ec���%
libraries/phocacart/region/region.phpnu�[���PK�"�[�#o,,&_!
libraries/phocacart/related/index.htmlnu�[���PK�"�[?ߘ7��'�!
libraries/phocacart/related/related.phpnu�[���PK�"�[�M*���$�<
libraries/phocacart/render/admin.phpnu�[���PK�"�[.I)��w�w+S
libraries/phocacart/render/admincolumns.phpnu�[���PK�"�[��^PP&*�
libraries/phocacart/render/adminjs.phpnu�[���PK�"�[��z�)�!libraries/phocacart/render/adminmedia.phpnu�[���PK�"�[i����(�7!libraries/phocacart/render/adminview.phpnu�[���PK�"�[w��Sz7z7)K"libraries/phocacart/render/adminviews.phpnu�[���PK�"�[�j�e�e$>"libraries/phocacart/render/front.phpnu�[���PK�"�[�t;d��#��"libraries/phocacart/render/icon.phpnu�[���PK�"�[�#o,,%�"libraries/phocacart/render/index.htmlnu�[���PK�"�[C���!p�"libraries/phocacart/render/js.phpnu�[���PK�"�[����(y(y$Ĺ#libraries/phocacart/render/media.phpnu�[���PK�"�[��$Ym7m7$@3$libraries/phocacart/render/style.phpnu�[���PK�"�[�#o,,%k$libraries/phocacart/review/index.htmlnu�[���PK�"�[�G���%�k$libraries/phocacart/review/review.phpnu�[���PK�"�[�#o,,%�t$libraries/phocacart/reward/index.htmlnu�[���PK�"�[��%Iu$libraries/phocacart/reward/reward.phpnu�[���PK�"�[��ys@N@N#��$libraries/phocacart/route/route.phpnu�[���PK�"�[�#o,,%L�$libraries/phocacart/search/index.htmlnu�[���PK�"�[�.+�B.B.%��$libraries/phocacart/search/search.phpnu�[���PK�"�[�#o,,&d
%libraries/phocacart/section/index.htmlnu�[���PK�"�[��]Z��'�
%libraries/phocacart/section/section.phpnu�[���PK�"�[�#o,,'+%libraries/phocacart/security/index.htmlnu�[���PK�"�[�jF��)�%libraries/phocacart/security/security.phpnu�[���PK�"�[�#o,,'�$%libraries/phocacart/shipping/index.htmlnu�[���PK�"�[��8{_{_)Y%%libraries/phocacart/shipping/shipping.phpnu�[���PK�"�[z��;��!-�%libraries/phocacart/size/size.phpnu�[���PK�"�[�#o,,,-�%libraries/phocacart/specification/index.htmlnu�[���PK�"�[�;f��1�13��%libraries/phocacart/specification/specification.phpnu�[���PK�"�[wI���'�%libraries/phocacart/statistics/hits.phpnu�[���PK�"�[�#o,,)��%libraries/phocacart/statistics/index.htmlnu�[���PK�"�[�m:m:-[�%libraries/phocacart/statistics/statistics.phpnu�[���PK�"�[�#o,,$%
&libraries/phocacart/stock/index.htmlnu�[���PK�"�[�f�}A}A#�
&libraries/phocacart/stock/stock.phpnu�[���PK�"�[�#o,,%uO&libraries/phocacart/submit/index.htmlnu�[���PK�"�[^�\��%�O&libraries/phocacart/submit/submit.phpnu�[���PK�"�[�#o,,"�V&libraries/phocacart/tag/index.htmlnu�[���PK�"�[RJ#�6�6gW&libraries/phocacart/tag/tag.phpnu�[���PK�"�[�#o,,"��&libraries/phocacart/tax/index.htmlnu�[���PK�"�[?��e** �&libraries/phocacart/tax/tax.phpnu�[���PK�"�[�#o,,#c�&libraries/phocacart/text/index.htmlnu�[���PK�"�[����[�[!�&libraries/phocacart/text/text.phpnu�[���PK�"�[�#o,,%1'libraries/phocacart/ticket/index.htmlnu�[���PK�"�[&���%�'libraries/phocacart/ticket/ticket.phpnu�[���PK�"�[�#o,,#4'libraries/phocacart/time/index.htmlnu�[���PK�"�[?�mm!�4'libraries/phocacart/time/time.phpnu�[���PK�"�[�#o,,#TO'libraries/phocacart/type/index.htmlnu�[���PK�"�[�_��nn!�O'libraries/phocacart/type/type.phpnu�[���PK�"�[�#o,,#�S'libraries/phocacart/unit/index.htmlnu�[���PK�"�[hM!���!T'libraries/phocacart/unit/unit.phpnu�[���PK�"�[y����&KZ'libraries/phocacart/user/guestuser.phpnu�[���PK�"�[�#o,,#�j'libraries/phocacart/user/index.htmlnu�[���PK�"�[&���T�T!k'libraries/phocacart/user/user.phpnu�[���PK�"�[�B�Tgg.^�'libraries/phocacart/utils/admindescription.phpnu�[���PK�"�[)��3��)#�'libraries/phocacart/utils/batchhelper.phpnu�[���PK�"�[�g
��',�'libraries/phocacart/utils/exception.phpnu�[���PK�"�[d�sp��'X�'libraries/phocacart/utils/extension.phpnu�[���PK�"�[�#o,,$��'libraries/phocacart/utils/index.htmlnu�[���PK�"�[��%%"-�'libraries/phocacart/utils/info.phpnu�[���PK�"�[҂5���%�(libraries/phocacart/utils/options.phpnu�[���PK�"�[��H9H9&�(libraries/phocacart/utils/settings.phpnu�[���PK�"�[�� 9 9#�F(libraries/phocacart/utils/utils.phpnu�[���PK�"�[�#o,,%�(libraries/phocacart/vendor/index.htmlnu�[���PK�"�[\/�jj%`�(libraries/phocacart/vendor/vendor.phpnu�[���PK�"�[�#o,,'�(libraries/phocacart/wishlist/index.htmlnu�[���PK�"�[a�I�7/7/)��(libraries/phocacart/wishlist/wishlist.phpnu�[���PK�"�[�#o,,#2�(libraries/phocacart/zone/index.htmlnu�[���PK�"�[�@�b��!��(libraries/phocacart/zone/zone.phpnu�[���PK�"�[�#o,,��(models/fields/index.htmlnu�[���PK�"�[�#o,,�(models/fields/modal/index.htmlnu�[���PK�"�[d=E09(9(){�(models/fields/modal/phocacartcategory.phpnu�[���PK�"�[��$��'�'%
�(models/fields/modal/phocacartitem.phpnu�[���PK�"�[!{)!1)models/fields/phocaattributes.phpnu�[���PK�"�[���+II#�)models/fields/phocacartcategory.phpnu�[���PK�"�[�K]muu$:/)models/fields/phocacartcountries.phpnu�[���PK�"�[�mm"4)models/fields/phocacartcountry.phpnu�[���PK�"�[N%��%�;)models/fields/phocacartextensions.phpnu�[���PK�"�[��77�A)models/fields/phocacartfeed.phpnu�[���PK�"�[Uy�bb!G)models/fields/phocacartgroups.phpnu�[���PK�"�[ł���'�K)models/fields/phocacartlayoutplugin.phpnu�[���PK�"�[��� � &�R)models/fields/phocacartmailinglist.phpnu�[���PK�"�[��v�GG#�\)models/fields/phocacartordering.phpnu�[���PK�"�[�9�8�
�
&n)models/fields/phocacartorderstatus.phpnu�[���PK�"�[�����$y)models/fields/phocacartparameter.phpnu�[���PK�"�[mU*�)models/fields/phocacartparametervalues.phpnu�[���PK�"�[lo��(i�)models/fields/phocacartpaymentmethod.phpnu�[���PK�"�[1%�cc"nj)models/fields/phocacartregions.phpnu�[���PK�"�[�Kq�PP"|�)models/fields/phocacartsection.phpnu�[���PK�"�[c)N/@@#�)models/fields/phocacartshipping.phpnu�[���PK�"�['�^�)��)models/fields/phocacartshippingmethod.phpnu�[���PK�"�[�T$NN.�)models/fields/phocacartspecificationgroups.phpnu�[���PK�"�[pA���
��)models/fields/phocacarttoken.phpnu�[���PK�"�[2�|UU(
�)models/fields/phocacartxmlfeedplugin.phpnu�[���PK�"�[��
��)models/fields/phocacartzones.phpnu�[���PK�"�[����
"�)models/fields/phocacolortext.phpnu�[���PK�"�[��0..%D�)models/fields/phocacouponcategory.phpnu�[���PK�"�[lLL$��)models/fields/phocacouponproduct.phpnu�[���PK�"�[*���::'g�)models/fields/phocadiscountcategory.phpnu�[���PK�"�[���XX&��)models/fields/phocadiscountproduct.phpnu�[���PK�"�[\�������)models/fields/phocahead.phpnu�[���PK�"�[X���!�)models/fields/phocaheadexpert.phpnu�[���PK�"�[��&/
#.*models/fields/phocamanufacturer.phpnu�[���PK�"�[˟�G��#� *models/fields/phocapluginmethod.phpnu�[���PK�"�[W�a4MM!�*models/fields/phocarawcontent.phpnu�[���PK�"�[+l�
OO%W*models/fields/phocaselectfilename.phpnu�[���PK�"�[��x�*�)*models/fields/phocaselectfilenameimage.phpnu�[���PK�"�[h(���!d:*models/fields/phocaselectitem.phpnu�[���PK�"�[v��W��)�Z*models/fields/phocaselectitemcategory.phpnu�[���PK�"�[K���"�b*models/fields/phocastockstatus.phpnu�[���PK�"�[
��EE
i*models/fields/phocataglabels.phpnu�[���PK�"�["�tZ22�n*models/fields/phocatags.phpnu�[���PK�"�[n��β�$t*models/fields/phocatax.phpnu�[���PK�"�[+��gg
y*models/fields/phocaunit.phpnu�[���PK�"�[�����+�|*models/forms/filter_phocacartbulkprices.xmlnu�[���PK�"�[Zz'm +��*models/forms/filter_phocacartcategories.xmlnu�[���PK�"�[�z��*\�*models/forms/filter_phocacartcountries.xmlnu�[���PK�"�[X@�5�
�
(x�*models/forms/filter_phocacartcoupons.xmlnu�[���PK�"�[V]c� � +|�*models/forms/filter_phocacartcurrencies.xmlnu�[���PK�"�[Ftu� � *s�*models/forms/filter_phocacartdiscounts.xmlnu�[���PK�"�[ q+��
�
*]�*models/forms/filter_phocacartdownloads.xmlnu�[���PK�"�[qWJ��+g�*models/forms/filter_phocacartextensions.xmlnu�[���PK�"�[�%��&o�*models/forms/filter_phocacartfeeds.xmlnu�[���PK�"�[��0T+��*models/forms/filter_phocacartformfields.xmlnu�[���PK�"�[�#ls '��*models/forms/filter_phocacartgroups.xmlnu�[���PK�"�[����
�
%E�*models/forms/filter_phocacarthits.xmlnu�[���PK�"�[?
y�N
N
&y�*models/forms/filter_phocacartitems.xmlnu�[���PK�"�[���'y
y
%�*models/forms/filter_phocacartlogs.xmlnu�[���PK�"�[��^�bb.�+models/forms/filter_phocacartmanufacturers.xmlnu�[���PK�"�[��FL� � '�+models/forms/filter_phocacartorders.xmlnu�[���PK�"�[����+�+models/forms/filter_phocacartparameters.xmlnu�[���PK�"�[��O� � 0!+models/forms/filter_phocacartparametervalues.xmlnu�[���PK�"�[=jB#��)r++models/forms/filter_phocacartpayments.xmlnu�[���PK�"�[�.�*�4+models/forms/filter_phocacartquestions.xmlnu�[���PK�"�[�X�2
2
(�?+models/forms/filter_phocacartregions.xmlnu�[���PK�"�[O�z z (�J+models/forms/filter_phocacartreviews.xmlnu�[���PK�"�[�"�R R ([T+models/forms/filter_phocacartrewards.xmlnu�[���PK�"�[v����)^+models/forms/filter_phocacartsections.xmlnu�[���PK�"�[�Gm���*f+models/forms/filter_phocacartshippings.xmlnu�[���PK�"�[v����/:o+models/forms/filter_phocacartspecifications.xmlnu�[���PK�"�[����� � )Ww+models/forms/filter_phocacartstatuses.xmlnu�[���PK�"�[v����.0�+models/forms/filter_phocacartstockstatuses.xmlnu�[���PK�"�[;n\���,L�+models/forms/filter_phocacartsubmititems.xmlnu�[���PK�"�[����%��+models/forms/filter_phocacarttags.xmlnu�[���PK�"�[/�� &ɛ+models/forms/filter_phocacarttaxes.xmlnu�[���PK�"�[3��B B &�+models/forms/filter_phocacarttimes.xmlnu�[���PK�"�[efl7 &��+models/forms/filter_phocacartunits.xmlnu�[���PK�"�[�T��k
k
&'�+models/forms/filter_phocacartusers.xmlnu�[���PK�"�[(�E���(��+models/forms/filter_phocacartvendors.xmlnu�[���PK�"�[�$n n *�+models/forms/filter_phocacartwishlists.xmlnu�[���PK�"�[׆���&��+models/forms/filter_phocacartzones.xmlnu�[���PK�"�[�#o,,��+models/forms/index.htmlnu�[���PK�"�[����#o�+models/forms/phocacartbulkprice.xmlnu�[���PK�"�[�òD"f�+models/forms/phocacartcategory.xmlnu�[���PK�"�[�Fä��!�,models/forms/phocacartcountry.xmlnu�[���PK�"�[N�@vDD
�,models/forms/phocacartcoupon.xmlnu�[���PK�"�[$��Ԩ�"X5,models/forms/phocacartcurrency.xmlnu�[���PK�"�[=
C��"RG,models/forms/phocacartdiscount.xmlnu�[���PK�"�[�sӉ��"@[,models/forms/phocacartdownload.xmlnu�[���PK�"�[�YH�??va,models/forms/phocacartfeed.xmlnu�[���PK�"�[��KCC#٠,models/forms/phocacartformfield.xmlnu�[���PK�"�[堫���o�,models/forms/phocacartgroup.xmlnu�[���PK�"�[�?MnNN��,models/forms/phocacartitem.xmlnu�[���PK�"�[Gd3o��Z-models/forms/phocacartlog.xmlnu�[���PK�"�[��jX��!P-models/forms/phocacartmanager.xmlnu�[���PK�"�[J��(
(
&8-models/forms/phocacartmanufacturer.xmlnu�[���PK�"�[b�����+-models/forms/phocacartorder.xmlnu�[���PK�"�[>�Ŷ�
�
#�J-models/forms/phocacartparameter.xmlnu�[���PK�"�[1�f�
�
(�X-models/forms/phocacartparametervalue.xmlnu�[���PK�"�[����!�c-models/forms/phocacartpayment.xmlnu�[���PK�"�[:��u��'�|-models/forms/phocacartpaymentmethod.xmlnu�[���PK�"�[hg�0FF&�}-models/forms/phocacartpricehistory.xmlnu�[���PK�"�[�w�)]]&.�-models/forms/phocacartproductstock.xmlnu�[���PK�"�[��ٰ
"�-models/forms/phocacartquestion.xmlnu�[���PK�"�[��k_
_
6�-models/forms/phocacartregion.xmlnu�[���PK�"�[k��k��
�-models/forms/phocacartreview.xmlnu�[���PK�"�[�Y��| |
ģ-models/forms/phocacartreward.xmlnu�[���PK�"�[J�����!��-models/forms/phocacartsection.xmlnu�[���PK�"�[�Te�1�1"Գ-models/forms/phocacartshipping.xmlnu�[���PK�"�[���Z��(��-models/forms/phocacartshippingmethod.xmlnu�[���PK�"�[?݁__'�-models/forms/phocacartspecification.xmlnu�[���PK�"�[+e��~*~*
��-models/forms/phocacartstatus.xmlnu�[���PK�"�[����00%�.models/forms/phocacartstockstatus.xmlnu�[���PK�"�[�u�0� � %.models/forms/phocacarttag.xmlnu�[���PK�"�[��ҹ))!/.models/forms/phocacarttax.xmlnu�[���PK�"�[��6����5.models/forms/phocacarttime.xmlnu�[���PK�"�[Ĕ
_""�L.models/forms/phocacartunit.xmlnu�[���PK�"�[3��c��U.models/forms/phocacartuser.xmlnu�[���PK�"�[H��[[
X.models/forms/phocacartvendor.xmlnu�[���PK�"�[\�)"�^.models/forms/phocacartwishlist.xmlnu�[���PK�"�[3Q���f.models/forms/phocacartzone.xmlnu�[���PK�"�[�A��II2r.models/forms/subform_additional_download_files.xmlnu�[���PK�"�[�a�7��*�u.models/forms/subform_additional_images.xmlnu�[���PK�"�[Ϧk%%#�w.models/forms/subform_attributes.xmlnu�[���PK�"�[txج� � "&�.models/forms/subform_discounts.xmlnu�[���PK�"�[�o�G��*)�.models/forms/subform_email_attachments.xmlnu�[���PK�"�[��0VYY"s�.models/forms/subform_gifttypes.xmlnu�[���PK�"�[}�F
�.models/forms/subform_options.xmlnu�[���PK�"�[:�/&|�.models/forms/subform_price_history.xmlnu�[���PK�"�[O��-��&�.models/forms/subform_product_stock.xmlnu�[���PK�"�[9��CC'��.models/forms/subform_specifications.xmlnu�[���PK�"�[��EE%��.models/forms/subform_submit_files.xmlnu�[���PK�"�[�!�441�.models/forms/submit.xmlnu�[���PK�"�[�#o,,��.models/index.htmlnu�[���PK�"�["
:V
V
d�.models/phocacartbulkprice.phpnu�[���PK�"�[���.models/phocacartbulkprices.phpnu�[���PK�"�[B�Iڳ�p/models/phocacartcart.phpnu�[���PK�"�[voD�++k/models/phocacartcategories.phpnu�[���PK�"�[�{�ycyc�;/models/phocacartcategory.phpnu�[���PK�"�[ʷ�����/models/phocacartcountries.phpnu�[���PK�"�[��ڢ�|�/models/phocacartcountry.phpnu�[���PK�"�[D�J���i�/models/phocacartcoupon.phpnu�[���PK�"�[Bevlnn��/models/phocacartcoupons.phpnu�[���PK�"�[;�+vvK�/models/phocacartcurrencies.phpnu�[���PK�"�[k�� � �/models/phocacartcurrency.phpnu�[���PK�"�[#��
0models/phocacartdiscount.phpnu�[���PK�"�[C���::Y0models/phocacartdiscounts.phpnu�[���PK�"�[���sKK�+0models/phocacartdownload.phpnu�[���PK�"�[�Y.[��w=0models/phocacartdownloads.phpnu�[���PK�"�[�`���!uN0models/phocacarteditbulkprice.phpnu�[���PK�"�[U~�b��)�P0models/phocacarteditproductpointgroup.phpnu�[���PK�"�[L�/��)�S0models/phocacarteditproductpricegroup.phpnu�[���PK�"�[������+�V0models/phocacarteditproductpricehistory.phpnu�[���PK�"�[EM��_0models/phocacarteditstatus.phpnu�[���PK�"�[�ߥ���%�n0models/phocacarteditstockadvanced.phpnu�[���PK�"�[m��
�0models/phocacartedittax.phpnu�[���PK�"�[�Ly�
�0models/phocacartexport.phpnu�[���PK�"�[/9͵��}�0models/phocacartexports.phpnu�[���PK�"�[�|˰�
�
��0models/phocacartextensions.phpnu�[���PK�"�[D�Ay��~�0models/phocacartfeed.phpnu�[���PK�"�[*��zFFa�0models/phocacartfeeds.phpnu�[���PK�"�[�e<�
�
��0models/phocacartformfield.phpnu�[���PK�"�[aZ����0models/phocacartformfields.phpnu�[���PK�"�[�=];;�
1models/phocacartgroup.phpnu�[���PK�"�[y�j!MMO1models/phocacartgroups.phpnu�[���PK�"�[��r�qq�.1models/phocacarthit.phpnu�[���PK�"�[�/�NN�41models/phocacarthits.phpnu�[���PK�"�[�����4E1models/phocacartimport.phpnu�[���PK�"�[�3?I��jL1models/phocacartimports.phpnu�[���PK�"�[h���aP1models/phocacartitem.phpnu�[���PK�"�[����9�9�2models/phocacartitems.phpnu�[���PK�"�[q�==�J2models/phocacartlog.phpnu�[���PK�"�[��W-HHHS2models/phocacartlogs.phpnu�[���PK�"�[�����d2models/phocacartmanager.phpnu�[���PK�"�[�^, .
.
|2models/phocacartmanufacturer.phpnu�[���PK�"�[J^"n!��2models/phocacartmanufacturers.phpnu�[���PK�"�[J��e�/�/�2models/phocacartorder.phpnu�[���PK�"�[�����2models/phocacartorders.phpnu�[���PK�"�[���$88��2models/phocacartparama.phpnu�[���PK�"�[�;��W�2models/phocacartparameter.phpnu�[���PK�"�[L/n��j�2models/phocacartparameters.phpnu�[���PK�"�[��*�HH"�3models/phocacartparametervalue.phpnu�[���PK�"�[�ʜ�TT#13models/phocacartparametervalues.phpnu�[���PK�"�[>�I??�/3models/phocacartpayment.phpnu�[���PK�"�[��9���bN3models/phocacartpayments.phpnu�[���PK�"�[�����|^3models/phocacartquestion.phpnu�[���PK�"�[���rr�j3models/phocacartquestions.phpnu�[���PK�"�[B��A|3models/phocacartregion.phpnu�[���PK�"�[�����3models/phocacartregions.phpnu�[���PK�"�[��p���3models/phocacartreport.phpnu�[���PK�"�[���QQ��3models/phocacartreports.phpnu�[���PK�"�[y��dd��3models/phocacartreview.phpnu�[���PK�"�[��HWW@�3models/phocacartreviews.phpnu�[���PK�"�[6� ��3models/phocacartreward.phpnu�[���PK�"�[��oo:�3models/phocacartrewards.phpnu�[���PK�"�[7`G���3models/phocacartsection.phpnu�[���PK�"�[6����4models/phocacartsections.phpnu�[���PK�"�[(}阝!�!�4models/phocacartshipping.phpnu�[���PK�"�[=����24models/phocacartshippings.phpnu�[���PK�"�[���/� � !C4models/phocacartspecification.phpnu�[���PK�"�[��6��"M4models/phocacartspecifications.phpnu�[���PK�"�[�я�T\4models/phocacartstatistic.phpnu�[���PK�"�[{B7-���_4models/phocacartstatistics.phpnu�[���PK�"�[*RdL66�o4models/phocacartstatus.phpnu�[���PK�"�[��B==�4models/phocacartstatuses.phpnu�[���PK�"�[�ꨱ����4models/phocacartstockstatus.phpnu�[���PK�"�[8|s��!��4models/phocacartstockstatuses.phpnu�[���PK�"�[/M �g�g�4models/phocacartsubmititem.phpnu�[���PK�"�[O&�=��5models/phocacartsubmititems.phpnu�[���PK�"�[2d]"G
G
'45models/phocacarttag.phpnu�[���PK�"�[y��2
�>5models/phocacarttags.phpnu�[���PK�"�[�6C�
�
N5models/phocacarttax.phpnu�[���PK�"�[��[<>>�[5models/phocacarttaxes.phpnu�[���PK�"�[��p9��Zk5models/phocacarttime.phpnu�[���PK�"�[�|$�Wt5models/phocacarttimes.phpnu�[���PK�"�[���K��5models/phocacarttool.phpnu�[���PK�"�[v)<����5models/phocacarttools.phpnu�[���PK�"�[��@:��.�5models/phocacartunit.phpnu�[���PK�"�[�j.���7�5models/phocacartunits.phpnu�[���PK�"�[�Л ��a�5models/phocacartuser.phpnu�[���PK�"�[!$<x��|�5models/phocacartusers.phpnu�[���PK�"�[w4��S�5models/phocacartvendor.phpnu�[���PK�"�[
k�lld�5models/phocacartvendors.phpnu�[���PK�"�[H��lcc�5models/phocacartwishlist.phpnu�[���PK�"�[
^��5models/phocacartwishlists.phpnu�[���PK�"�[�J^44&6models/phocacartzone.phpnu�[���PK�"�[��"5���$6models/phocacartzones.phpnu�[���PK�"�[��X
�36phocacart.phpnu�[���PK�"�[7��Mj'j'
�76phocacart.xmlnu�[���PK�"�[_�����
�_6script.phpnu�[���PK�"�[�#o,,�
7tables/index.htmlnu�[���PK�"�[&��.��!7tables/phocacartbulkprice.phpnu�[���PK�"�[~���C$7tables/phocacartcart.phpnu�[���PK�"�[�,
,
�'7tables/phocacartcategory.phpnu�[���PK�"�[2�D��27tables/phocacartcountry.phpnu�[���PK�"�[�@��57tables/phocacartcoupon.phpnu�[���PK�"�[㦄x��87tables/phocacartcurrency.phpnu�[���PK�"�[XKw����;7tables/phocacartdiscount.phpnu�[���PK�"�[C��2''�>7tables/phocacartexport.phpnu�[���PK�"�[2���``5A7tables/phocacartfeatured.phpnu�[���PK�"�[�cB����C7tables/phocacartfeed.phpnu�[���PK�"�[ӻp���F7tables/phocacartformfield.phpnu�[���PK�"�[��%��N7tables/phocacartgroup.phpnu�[���PK�"�[C ��P7tables/phocacarthits.phpnu�[���PK�"�[rc��''IS7tables/phocacartimport.phpnu�[���PK�"�[�K\�\\�U7tables/phocacartitem.phpnu�[���PK�"�[�K6���^]7tables/phocacartlog.phpnu�[���PK�"�[b`����
E`7tables/phocacartmanufacturer.phpnu�[���PK�"�[�ow��Gc7tables/phocacartorder.phpnu�[���PK�"�[�#g7tables/phocacartorderattributes.phpnu�[���PK�"�[��1=
�i7tables/phocacartordercoupons.phpnu�[���PK�"�[R�$"�k7tables/phocacartorderdiscounts.phpnu�[���PK�"�[=�("Zn7tables/phocacartorderdownloads.phpnu�[���PK�"�[oD�
�p7tables/phocacartorderhistory.phpnu�[���PK�"�[K^
�(()*s7tables/phocacartorderproductdiscounts.phpnu�[���PK�"�[�φ�!�u7tables/phocacartorderproducts.phpnu�[���PK�"�[f^CC*x7tables/phocacartordertaxrecapitulation.phpnu�[���PK�"�[���**�z7tables/phocacartordertotal.phpnu�[���PK�"�[[��**(}7tables/phocacartorderusers.phpnu�[���PK�"�[�������7tables/phocacartparameter.phpnu�[���PK�"�[�J��"��7tables/phocacartparametervalue.phpnu�[���PK�"�[��JJÇ7tables/phocacartpayment.phpnu�[���PK�"�[s:��==%X�7tables/phocacartproductcategories.phpnu�[���PK�"�[a@�
::%�7tables/phocacartproductpointgroup.phpnu�[���PK�"�[�f��::%y�7tables/phocacartproductpricegroup.phpnu�[���PK�"�[�]B�EE'�7tables/phocacartproductpricehistory.phpnu�[���PK�"�[k3͟..
��7tables/phocacartproductstock.phpnu�[���PK�"�[�oHݰ�"�7tables/phocacartquestion.phpnu�[���PK�"�[Q Z-���7tables/phocacartregion.phpnu�[���PK�"�[�#���7tables/phocacartreview.phpnu�[���PK�"�[R;8����7tables/phocacartrewardpoint.phpnu�[���PK�"�[�J������7tables/phocacartsection.phpnu�[���PK�"�[ú;kMM�7tables/phocacartshipping.phpnu�[���PK�"�[�Ku��!��7tables/phocacartspecification.phpnu�[���PK�"�[���1����7tables/phocacartstatus.phpnu�[���PK�"�[́6����7tables/phocacartstockstatus.phpnu�[���PK�"�[��m�����7tables/phocacartsubmititem.phpnu�[���PK�"�[8��2����7tables/phocacarttag.phpnu�[���PK�"�[0�">��v�7tables/phocacarttax.phpnu�[���PK�"�[�zN��^�7tables/phocacarttime.phpnu�[���PK�"�[�X�+����7tables/phocacartunit.phpnu�[���PK�"�[$G�n��j�7tables/phocacartuser.phpnu�[���PK�"�[��!���T�7tables/phocacartvendor.phpnu�[���PK�"�[
�����D�7tables/phocacartwishlist.phpnu�[���PK�"�[��eޢ�@�7tables/phocacartzone.phpnu�[���PK�"�[V�b::*�7update/index.htmlnu�[���PK�"�[V�b::��7update/sql/index.htmlnu�[���PK�"�[
�.��$�7update/sql/mysql/3.0.1.sqlnu�[���PK�"�[E#�##e�7update/sql/mysql/3.0.2.sqlnu�[���PK�"�[%߾�dd��7update/sql/mysql/3.0.3.sqlnu�[���PK�"�[��zr����7update/sql/mysql/3.1.0.sqlnu�[���PK�"�[�y���x�7update/sql/mysql/3.1.1.sqlnu�[���PK�"�[<�]��7update/sql/mysql/3.1.2.sqlnu�[���PK�"�[�8:m##�7update/sql/mysql/3.1.4.sqlnu�[���PK�"�[
�Gg��H8update/sql/mysql/3.1.6.sqlnu�[���PK�"�[�Ώ��\8update/sql/mysql/3.1.7.sqlnu�[���PK�"�[�����8update/sql/mysql/3.1.8.sqlnu�[���PK�"�[1I0���8update/sql/mysql/3.1.9.sqlnu�[���PK�"�[�4m���8update/sql/mysql/3.2.0.sqlnu�[���PK�"�[��QHCC�8update/sql/mysql/3.2.2.sqlnu�[���PK�"�[@��dd_8update/sql/mysql/3.3.0.sqlnu�[���PK�"�[b:n��
8update/sql/mysql/3.3.1.sqlnu�[���PK�"�[��PSS�8update/sql/mysql/3.3.2.sqlnu�[���PK�"�[N�nQPP�8update/sql/mysql/3.4.0.sqlnu�[���PK�"�[ߝ����5"8update/sql/mysql/3.5.0.sqlnu�[���PK�"�[$��ǿ�'68update/sql/mysql/3.5.1.sqlnu�[���PK�"�[]����098update/sql/mysql/3.5.3.sqlnu�[���PK�"�[��aԏ�
;8update/sql/mysql/3.5.4.sqlnu�[���PK�"�[�kQ�SS�A8update/sql/mysql/3.5.5.sqlnu�[���PK�"�[�~�����C8update/sql/mysql/3.5.7.sqlnu�[���PK�"�[V�b::�R8update/sql/mysql/index.htmlnu�[���PK�"�[�#o,,%S8views/index.htmlnu�[���PK�"�[�#o,,$�S8views/phocacartattributea/index.htmlnu�[���PK�"�[�bl�WW*T8views/phocacartattributea/tmpl/default.phpnu�[���PK�"�[�#o,,)�U8views/phocacartattributea/tmpl/index.htmlnu�[���PK�"�[v���--'GV8views/phocacartattributea/view.json.phpnu�[���PK�"�[�#o,,#�d8views/phocacartbulkprice/index.htmlnu�[���PK�"�[#4*�&Je8views/phocacartbulkprice/tmpl/edit.phpnu�[���PK�"�[�#o,,(�l8views/phocacartbulkprice/tmpl/index.htmlnu�[���PK�"�[v=K1��&'m8views/phocacartbulkprice/view.html.phpnu�[���PK�"�[�#o,,$`v8views/phocacartbulkprices/index.htmlnu�[���PK�"�[�\(���*�v8views/phocacartbulkprices/tmpl/default.phpnu�[���PK�"�[�#o,,)ݔ8views/phocacartbulkprices/tmpl/index.htmlnu�[���PK�"�[�l�U�
�
'b�8views/phocacartbulkprices/view.html.phpnu�[���PK�"�[�#o,,��8views/phocacartcart/index.htmlnu�[���PK�"�[66q
XX$ �8views/phocacartcart/tmpl/default.phpnu�[���PK�"�[�#o,,#��8views/phocacartcart/tmpl/index.htmlnu�[���PK�"�[��w��!4�8views/phocacartcart/view.html.phpnu�[���PK�"�[�#o,,"$�8views/phocacartcatalogs/index.htmlnu�[���PK�"�[���(��8views/phocacartcatalogs/tmpl/default.phpnu�[���PK�"�[�#o,,'��8views/phocacartcatalogs/tmpl/index.htmlnu�[���PK�"�[E)v��%�8views/phocacartcatalogs/view.html.phpnu�[���PK�"�[1c1A��$(�8views/phocacartcatalogs/view.pdf.phpnu�[���PK�"�[E)v��$%�8views/phocacartcatalogs/view.raw.phpnu�[���PK�"�[�#o,,$D�8views/phocacartcategories/index.htmlnu�[���PK�"�[b����*��8views/phocacartcategories/tmpl/default.phpnu�[���PK�"�[P�FF0��8views/phocacartcategories/tmpl/default_batch.phpnu�[���PK�"�[�#o,,)��8views/phocacartcategories/tmpl/index.htmlnu�[���PK�"�[�Ւ/#/#(�8views/phocacartcategories/tmpl/modal.phpnu�[���PK�"�[�ɟ��0�0'�9views/phocacartcategories/view.html.phpnu�[���PK�"�[�#o,,"�A9views/phocacartcategory/index.htmlnu�[���PK�"�[R��((%:B9views/phocacartcategory/tmpl/edit.phpnu�[���PK�"�[�"��2�R9views/phocacartcategory/tmpl/edit_associations.phpnu�[���PK�"�[��P��.�T9views/phocacartcategory/tmpl/edit_metadata.phpnu�[���PK�"�[�#o,,'�Z9views/phocacartcategory/tmpl/index.htmlnu�[���PK�"�[�#C�{{&f[9views/phocacartcategory/tmpl/modal.phpnu�[���PK�"�[�"��37b9views/phocacartcategory/tmpl/modal_associations.phpnu�[���PK�"�[#��uu%.d9views/phocacartcategory/view.html.phpnu�[���PK�"�[�#o,,#�u9views/phocacartcountries/index.htmlnu�[���PK�"�[L�
)wv9views/phocacartcountries/tmpl/default.phpnu�[���PK�"�[�#o,,(ѐ9views/phocacartcountries/tmpl/index.htmlnu�[���PK�"�[,`�+KK&U�9views/phocacartcountries/view.html.phpnu�[���PK�"�[�#o,,!��9views/phocacartcountry/index.htmlnu�[���PK�"�[�
���$s�9views/phocacartcountry/tmpl/edit.phpnu�[���PK�"�[�#o,,&a�9views/phocacartcountry/tmpl/index.htmlnu�[���PK�"�[{ �e e $�9views/phocacartcountry/view.html.phpnu�[���PK�"�[�#o,,
��9views/phocacartcoupon/index.htmlnu�[���PK�"�[pw�#�9views/phocacartcoupon/tmpl/edit.phpnu�[���PK�"�[�#o,,%��9views/phocacartcoupon/tmpl/index.htmlnu�[���PK�"�[��Bx��#�9views/phocacartcoupon/view.html.phpnu�[���PK�"�[�#o,,!(�9views/phocacartcoupons/index.htmlnu�[���PK�"�[ܨ��N
N
'��9views/phocacartcoupons/tmpl/default.phpnu�[���PK�"�[�#o,,&J�9views/phocacartcoupons/tmpl/index.htmlnu�[���PK�"�[�_�Y
$��9views/phocacartcoupons/view.html.phpnu�[���PK�"�[�#o,,$!�9views/phocacartcouponview/index.htmlnu�[���PK�"�[�bl�WW*��9views/phocacartcouponview/tmpl/default.phpnu�[���PK�"�[�#o,,)R�9views/phocacartcouponview/tmpl/index.htmlnu�[���PK�"�[�S�s��'�9views/phocacartcouponview/view.html.phpnu�[���PK�"�[Og0#]
]
&:views/phocacartcouponview/view.pdf.phpnu�[���PK�"�[�#o,,�
:views/phocacartcp/index.htmlnu�[���PK�"�[;M��;�;"<:views/phocacartcp/tmpl/default.phpnu�[���PK�"�[�#o,,!ZJ:views/phocacartcp/tmpl/index.htmlnu�[���PK�"�[�hx6x6�J:views/phocacartcp/view.html.phpnu�[���PK�"�[�#o,,$��:views/phocacartcurrencies/index.htmlnu�[���PK�"�[� �E��*�:views/phocacartcurrencies/tmpl/default.phpnu�[���PK�"�[�#o,,)��:views/phocacartcurrencies/tmpl/index.htmlnu�[���PK�"�[q�٘�'��:views/phocacartcurrencies/view.html.phpnu�[���PK�"�[�#o,,"q�:views/phocacartcurrency/index.htmlnu�[���PK�"�[�p�� � %�:views/phocacartcurrency/tmpl/edit.phpnu�[���PK�"�[�#o,,'3�:views/phocacartcurrency/tmpl/index.htmlnu�[���PK�"�[��g� %��:views/phocacartcurrency/view.html.phpnu�[���PK�"�[�#o,,"�:views/phocacartdiscount/index.htmlnu�[���PK�"�[[lW��%��:views/phocacartdiscount/tmpl/edit.phpnu�[���PK�"�[�#o,,'��:views/phocacartdiscount/tmpl/index.htmlnu�[���PK�"�[W|Hh��%Z�:views/phocacartdiscount/view.html.phpnu�[���PK�"�[�#o,,#��:views/phocacartdiscounts/index.htmlnu�[���PK�"�[�-
�##) �:views/phocacartdiscounts/tmpl/default.phpnu�[���PK�"�[�#o,,(��:views/phocacartdiscounts/tmpl/index.htmlnu�[���PK�"�[{M��FF& �:views/phocacartdiscounts/view.html.phpnu�[���PK�"�[�#o,,"��:views/phocacartdownload/index.htmlnu�[���PK�"�[zC�'cc%#�:views/phocacartdownload/tmpl/edit.phpnu�[���PK�"�[�#o,,'�:views/phocacartdownload/tmpl/index.htmlnu�[���PK�"�[��d��%^�:views/phocacartdownload/view.html.phpnu�[���PK�"�[�#o,,#r;views/phocacartdownloads/index.htmlnu�[���PK�"�[ԍ���)�;views/phocacartdownloads/tmpl/default.phpnu�[���PK�"�[�#o,,(';views/phocacartdownloads/tmpl/index.htmlnu�[���PK�"�[U݇���&�';views/phocacartdownloads/view.html.phpnu�[���PK�"�[�#o,,'�4;views/phocacarteditbulkprice/index.htmlnu�[���PK�"�[���p��-!5;views/phocacarteditbulkprice/tmpl/default.phpnu�[���PK�"�[�#o,,,4Q;views/phocacarteditbulkprice/tmpl/index.htmlnu�[���PK�"�[�����*�Q;views/phocacarteditbulkprice/view.html.phpnu�[���PK�"�[�#o,,/�X;views/phocacarteditproductpointgroup/index.htmlnu�[���PK�"�[XpC��5�Y;views/phocacarteditproductpointgroup/tmpl/default.phpnu�[���PK�"�[�#o,,4�i;views/phocacarteditproductpointgroup/tmpl/index.htmlnu�[���PK�"�[�TsJ2Jj;views/phocacarteditproductpointgroup/view.html.phpnu�[���PK�"�[�#o,,/�p;views/phocacarteditproductpricegroup/index.htmlnu�[���PK�"�[&�̪335;q;views/phocacarteditproductpricegroup/tmpl/default.phpnu�[���PK�"�[�#o,,4Ӏ;views/phocacarteditproductpricegroup/tmpl/index.htmlnu�[���PK�"�[�:V2c�;views/phocacarteditproductpricegroup/view.html.phpnu�[���PK�"�[�#o,,1ɇ;views/phocacarteditproductpricehistory/index.htmlnu�[���PK�"�[-[iX++7V�;views/phocacarteditproductpricehistory/tmpl/default.phpnu�[���PK�"�[�#o,,6�;views/phocacarteditproductpricehistory/tmpl/index.htmlnu�[���PK�"�[��kt��4z�;views/phocacarteditproductpricehistory/view.html.phpnu�[���PK�"�[�#o,,$r�;views/phocacarteditstatus/index.htmlnu�[���PK�"�[P�P���*�;views/phocacarteditstatus/tmpl/default.phpnu�[���PK�"�[�#o,,)�;views/phocacarteditstatus/tmpl/index.htmlnu�[���PK�"�[q�iw��'��;views/phocacarteditstatus/view.html.phpnu�[���PK�"�[�#o,,+��;views/phocacarteditstockadvanced/index.htmlnu�[���PK�"�[
,�oo12�;views/phocacarteditstockadvanced/tmpl/default.phpnu�[���PK�"�[�#o,,0�;views/phocacarteditstockadvanced/tmpl/index.htmlnu�[���PK�"�[w�:s.��;views/phocacarteditstockadvanced/view.html.phpnu�[���PK�"�[�#o,,!��;views/phocacartedittax/index.htmlnu�[���PK�"�[q�ֿ44'y�;views/phocacartedittax/tmpl/default.phpnu�[���PK�"�[�#o,,&<views/phocacartedittax/tmpl/index.htmlnu�[���PK�"�[�G:"��$�<views/phocacartedittax/view.html.phpnu�[���PK�"�[�#o,,!�<views/phocacartexports/index.htmlnu�[���PK�"�[��(��'V <views/phocacartexports/tmpl/default.phpnu�[���PK�"�[�#o,,&c<views/phocacartexports/tmpl/index.htmlnu�[���PK�"�[/O���$�<views/phocacartexports/view.html.phpnu�[���PK�"�[�#o,,$')<views/phocacartextensions/index.htmlnu�[���PK�"�[�*�9�-�-*�)<views/phocacartextensions/tmpl/default.phpnu�[���PK�"�[�#o,,)�W<views/phocacartextensions/tmpl/index.htmlnu�[���PK�"�[�|I1��'uX<views/phocacartextensions/view.html.phpnu�[���PK�"�[�#o,,bg<views/phocacartfeed/index.htmlnu�[���PK�"�[J��}}!�g<views/phocacartfeed/tmpl/edit.phpnu�[���PK�"�[�#o,,#�w<views/phocacartfeed/tmpl/index.htmlnu�[���PK�"�[������!)x<views/phocacartfeed/view.html.phpnu�[���PK�"�[�#o,,G�<views/phocacartfeeds/index.htmlnu�[���PK�"�[�Lh��%<views/phocacartfeeds/tmpl/default.phpnu�[���PK�"�[�#o,,$Ζ<views/phocacartfeeds/tmpl/index.htmlnu�[���PK�"�[m��
z
z
"N�<views/phocacartfeeds/view.html.phpnu�[���PK�"�[�#o,,#�<views/phocacartformfield/index.htmlnu�[���PK�"�[9v�H &��<views/phocacartformfield/tmpl/edit.phpnu�[���PK�"�[�#o,,(��<views/phocacartformfield/tmpl/index.htmlnu�[���PK�"�[��� � � &z�<views/phocacartformfield/view.html.phpnu�[���PK�"�[�#o,,$r�<views/phocacartformfields/index.htmlnu�[���PK�"�[��O�__*�<views/phocacartformfields/tmpl/default.phpnu�[���PK�"�[�#o,,)��<views/phocacartformfields/tmpl/index.htmlnu�[���PK�"�[�L��tt'0�<views/phocacartformfields/view.html.phpnu�[���PK�"�[�#o,,��<views/phocacartgroup/index.htmlnu�[���PK�"�[�Q�3U U "v�<views/phocacartgroup/tmpl/edit.phpnu�[���PK�"�[�#o,,$�<views/phocacartgroup/tmpl/index.htmlnu�[���PK�"�[l�h h "��<views/phocacartgroup/view.html.phpnu�[���PK�"�[�#o,,
W�<views/phocacartgroups/index.htmlnu�[���PK�"�[:�f
ii&�<views/phocacartgroups/tmpl/default.phpnu�[���PK�"�[�#o,,%�=views/phocacartgroups/tmpl/index.htmlnu�[���PK�"�[H���BB#=views/phocacartgroups/view.html.phpnu�[���PK�"�[�#o,,�=views/phocacarthits/index.htmlnu�[���PK�"�[��Uk��$"=views/phocacarthits/tmpl/default.phpnu�[���PK�"�[�#o,,#8=views/phocacarthits/tmpl/index.htmlnu�[���PK�"�[�?�E��!�8=views/phocacarthits/view.html.phpnu�[���PK�"�[�#o,,
�E=views/phocacartimagea/index.htmlnu�[���PK�"�[�bl�WW&JF=views/phocacartimagea/tmpl/default.phpnu�[���PK�"�[�#o,,%�G=views/phocacartimagea/tmpl/index.htmlnu�[���PK�"�[��RHW$W$#xH=views/phocacartimagea/view.json.phpnu�[���PK�"�[�#o,,!"m=views/phocacartimports/index.htmlnu�[���PK�"�[�AP���'�m=views/phocacartimports/tmpl/default.phpnu�[���PK�"�[�#o,,&�z=views/phocacartimports/tmpl/index.htmlnu�[���PK�"�[�s�V
$R{=views/phocacartimports/view.html.phpnu�[���PK�"�[�#o,,Å=views/phocacartinfo/index.htmlnu�[���PK�"�[2U�g$=�=views/phocacartinfo/tmpl/default.phpnu�[���PK�"�[�#o,,#��=views/phocacartinfo/tmpl/index.htmlnu�[���PK�"�[2U�@��!�=views/phocacartinfo/view.html.phpnu�[���PK�"�[�#o,,�=views/phocacartitem/index.htmlnu�[���PK�"�[�7ь66!��=views/phocacartitem/tmpl/edit.phpnu�[���PK�"�[�!���.��=views/phocacartitem/tmpl/edit_associations.phpnu�[���PK�"�[��(G++&��=views/phocacartitem/tmpl/edit_feed.phpnu�[���PK�"�[��P��*_�=views/phocacartitem/tmpl/edit_metadata.phpnu�[���PK�"�[(֣BB+��=views/phocacartitem/tmpl/edit_parameter.phpnu�[���PK�"�[�#o,,#.�=views/phocacartitem/tmpl/index.htmlnu�[���PK�"�[�+�\\"��=views/phocacartitem/tmpl/modal.phpnu�[���PK�"�[�r����/[�=views/phocacartitem/tmpl/modal_associations.phpnu�[���PK�"�[�,���!��=views/phocacartitem/view.html.phpnu�[���PK�"�[�#o,,�>views/phocacartitema/index.htmlnu�[���PK�"�[�bl�WW%!>views/phocacartitema/tmpl/default.phpnu�[���PK�"�[�#o,,$�>views/phocacartitema/tmpl/index.htmlnu�[���PK�"�[��}��
�
"M>views/phocacartitema/view.json.phpnu�[���PK�"�[�#o,,�>views/phocacartitems/index.htmlnu�[���PK�"�[��a"�7�7%
>views/phocacartitems/tmpl/default.phpnu�[���PK�"�[�m�G��+7X>views/phocacartitems/tmpl/default_batch.phpnu�[���PK�"�[Qg�c��58j>views/phocacartitems/tmpl/default_copy_attributes.phpnu�[���PK�"�[�#o,,$ky>views/phocacartitems/tmpl/index.htmlnu�[���PK�"�[��A�A#�y>views/phocacartitems/tmpl/modal.phpnu�[���PK�"�[�"b��"3�>views/phocacartitems/view.html.phpnu�[���PK�"�[�#o,,[�>views/phocacartlogs/index.htmlnu�[���PK�"�['�S� $��>views/phocacartlogs/tmpl/default.phpnu�[���PK�"�[�#o,,#2�>views/phocacartlogs/tmpl/index.htmlnu�[���PK�"�[�QB!��>views/phocacartlogs/view.html.phpnu�[���PK�"�[�#o,,!?views/phocacartmanager/index.htmlnu�[���PK�"�[�;%'�?views/phocacartmanager/tmpl/default.phpnu�[���PK�"�[�s�/,�?views/phocacartmanager/tmpl/default_file.phpnu�[���PK�"�[+�]:66.\*?views/phocacartmanager/tmpl/default_folder.phpnu�[���PK�"�[�N����6�1?views/phocacartmanager/tmpl/default_multipleupload.phpnu�[���PK�"�[Z���*�6?views/phocacartmanager/tmpl/default_up.phpnu�[���PK�"�[�7��%%.<?views/phocacartmanager/tmpl/default_upload.phpnu�[���PK�"�[�#o,,&�@?views/phocacartmanager/tmpl/index.htmlnu�[���PK�"�[����$A?views/phocacartmanager/view.html.phpnu�[���PK�"�[�#o,,&/a?views/phocacartmanufacturer/index.htmlnu�[���PK�"�[*�����)�a?views/phocacartmanufacturer/tmpl/edit.phpnu�[���PK�"�[�#o,,+�i?views/phocacartmanufacturer/tmpl/index.htmlnu�[���PK�"�[S]z.��)?j?views/phocacartmanufacturer/view.html.phpnu�[���PK�"�[�#o,,'{s?views/phocacartmanufacturers/index.htmlnu�[���PK�"�[;'��gg-�s?views/phocacartmanufacturers/tmpl/default.phpnu�[���PK�"�[�#o,,,?views/phocacartmanufacturers/tmpl/index.htmlnu�[���PK�"�[Ā
*J�?views/phocacartmanufacturers/view.html.phpnu�[���PK�"�[�#o,,��?views/phocacartorder/index.htmlnu�[���PK�"�[TE6�``"7�?views/phocacartorder/tmpl/edit.phpnu�[���PK�"�[�#o,,$��?views/phocacartorder/tmpl/index.htmlnu�[���PK�"�[8~����" �?views/phocacartorder/view.html.phpnu�[���PK�"�[�#o,,
%@views/phocacartorders/index.htmlnu�[���PK�"�[ �z-�7�7&�@views/phocacartorders/tmpl/default.phpnu�[���PK�"�[�#o,,%�?@views/phocacartorders/tmpl/index.htmlnu�[���PK�"�['�Yг�#m@@views/phocacartorders/view.html.phpnu�[���PK�"�[�#o,,#sP@views/phocacartorderview/index.htmlnu�[���PK�"�[�bl�WW)�P@views/phocacartorderview/tmpl/default.phpnu�[���PK�"�[�#o,,(�R@views/phocacartorderview/tmpl/index.htmlnu�[���PK�"�[Q��K��&&S@views/phocacartorderview/view.html.phpnu�[���PK�"�[�HOO%8W@views/phocacartorderview/view.pdf.phpnu�[���PK�"�[�#o,,
�^@views/phocacartparama/index.htmlnu�[���PK�"�[�bl�WW&X_@views/phocacartparama/tmpl/default.phpnu�[���PK�"�[�#o,,%a@views/phocacartparama/tmpl/index.htmlnu�[���PK�"�[9�'DD#�a@views/phocacartparama/view.json.phpnu�[���PK�"�[�#o,,#t@views/phocacartparameter/index.htmlnu�[���PK�"�[K��C��&�t@views/phocacartparameter/tmpl/edit.phpnu�[���PK�"�[�#o,,(�|@views/phocacartparameter/tmpl/index.htmlnu�[���PK�"�[�?R��&0}@views/phocacartparameter/view.html.phpnu�[���PK�"�[�#o,,$d�@views/phocacartparameters/index.htmlnu�[���PK�"�[gZa���*�@views/phocacartparameters/tmpl/default.phpnu�[���PK�"�[�#o,,)�@views/phocacartparameters/tmpl/index.htmlnu�[���PK�"�[�Vi?�
�
'��@views/phocacartparameters/view.html.phpnu�[���PK�"�[�#o,,(��@views/phocacartparametervalue/index.htmlnu�[���PK�"�[�}ʋ��+?�@views/phocacartparametervalue/tmpl/edit.phpnu�[���PK�"�[�#o,,-I�@views/phocacartparametervalue/tmpl/index.htmlnu�[���PK�"�[�f]i��+Ұ@views/phocacartparametervalue/view.html.phpnu�[���PK�"�[�#o,,)�@views/phocacartparametervalues/index.htmlnu�[���PK�"�[�i��FF/��@views/phocacartparametervalues/tmpl/default.phpnu�[���PK�"�[�#o,,.A�@views/phocacartparametervalues/tmpl/index.htmlnu�[���PK�"�[���]g
g
,��@views/phocacartparametervalues/view.html.phpnu�[���PK�"�[�#o,,!��@views/phocacartpayment/index.htmlnu�[���PK�"�[�,�,��$�@views/phocacartpayment/tmpl/edit.phpnu�[���PK�"�[�#o,,&��@views/phocacartpayment/tmpl/index.htmlnu�[���PK�"�[g�r
$c�@views/phocacartpayment/view.html.phpnu�[���PK�"�[�#o,,"�@views/phocacartpayments/index.htmlnu�[���PK�"�[���'B
B
(B�@views/phocacartpayments/tmpl/default.phpnu�[���PK�"�[�#o,,'�Aviews/phocacartpayments/tmpl/index.htmlnu�[���PK�"�[g�K}%_Aviews/phocacartpayments/view.html.phpnu�[���PK�"�[�#o,,"�+Aviews/phocacartquestion/index.htmlnu�[���PK�"�[Ar搕�%7,Aviews/phocacartquestion/tmpl/edit.phpnu�[���PK�"�[�#o,,'!4Aviews/phocacartquestion/tmpl/index.htmlnu�[���PK�"�[OhJe��%�4Aviews/phocacartquestion/view.html.phpnu�[���PK�"�[�#o,,#�=Aviews/phocacartquestions/index.htmlnu�[���PK�"�[��#PP)5>Aviews/phocacartquestions/tmpl/default.phpnu�[���PK�"�[�#o,,(�[Aviews/phocacartquestions/tmpl/index.htmlnu�[���PK�"�[FE��##&b\Aviews/phocacartquestions/view.html.phpnu�[���PK�"�[�#o,,
�hAviews/phocacartregion/index.htmlnu�[���PK�"�[�{��#WiAviews/phocacartregion/tmpl/edit.phpnu�[���PK�"�[�#o,,%RqAviews/phocacartregion/tmpl/index.htmlnu�[���PK�"�[鋻a a #�qAviews/phocacartregion/view.html.phpnu�[���PK�"�[�#o,,!�{Aviews/phocacartregions/index.htmlnu�[���PK�"�[�$v�'|Aviews/phocacartregions/tmpl/default.phpnu�[���PK�"�[�#o,,&m�Aviews/phocacartregions/tmpl/index.htmlnu�[���PK�"�[�]��
�
$�Aviews/phocacartregions/view.html.phpnu�[���PK�"�[�#o,,!B�Aviews/phocacartreports/index.htmlnu�[���PK�"�[�����
�
'��Aviews/phocacartreports/tmpl/default.phpnu�[���PK�"�[5�^�.��Aviews/phocacartreports/tmpl/default_report.phpnu�[���PK�"�[�#o,,&@�Aviews/phocacartreports/tmpl/index.htmlnu�[���PK�"�[W�a���$��Aviews/phocacartreports/view.html.phpnu�[���PK�"�[N��;��#�Aviews/phocacartreports/view.pdf.phpnu�[���PK�"�[@��#>�Aviews/phocacartreports/view.raw.phpnu�[���PK�"�[�#o,,
(�Aviews/phocacartreview/index.htmlnu�[���PK�"�[��oo#��Aviews/phocacartreview/tmpl/edit.phpnu�[���PK�"�[�#o,,%fBviews/phocacartreview/tmpl/index.htmlnu�[���PK�"�[6�:y��#�Bviews/phocacartreview/view.html.phpnu�[���PK�"�[�#o,,!�
Bviews/phocacartreviews/index.htmlnu�[���PK�"�[
��,,'fBviews/phocacartreviews/tmpl/default.phpnu�[���PK�"�[�#o,,&�'Bviews/phocacartreviews/tmpl/index.htmlnu�[���PK�"�[��l&;;$k(Bviews/phocacartreviews/view.html.phpnu�[���PK�"�[�#o,,
�3Bviews/phocacartreward/index.htmlnu�[���PK�"�[�2ZD��#v4Bviews/phocacartreward/tmpl/edit.phpnu�[���PK�"�[�#o,,%�:Bviews/phocacartreward/tmpl/index.htmlnu�[���PK�"�[�&��#
;Bviews/phocacartreward/view.html.phpnu�[���PK�"�[�#o,,!DBviews/phocacartrewards/index.htmlnu�[���PK�"�[��99'�DBviews/phocacartrewards/tmpl/default.phpnu�[���PK�"�[�#o,,&(_Bviews/phocacartrewards/tmpl/index.htmlnu�[���PK�"�[YH��}}$�_Bviews/phocacartrewards/view.html.phpnu�[���PK�"�[�#o,,!{kBviews/phocacartsection/index.htmlnu�[���PK�"�[b��[kk$�kBviews/phocacartsection/tmpl/edit.phpnu�[���PK�"�[�#o,,&�sBviews/phocacartsection/tmpl/index.htmlnu�[���PK�"�[f^�"��$9tBviews/phocacartsection/view.html.phpnu�[���PK�"�[�#o,,"_}Bviews/phocacartsections/index.htmlnu�[���PK�"�[Wj&��(�}Bviews/phocacartsections/tmpl/default.phpnu�[���PK�"�[�#o,,'ؒBviews/phocacartsections/tmpl/index.htmlnu�[���PK�"�[,���
�
%[�Bviews/phocacartsections/view.html.phpnu�[���PK�"�[�#o,,"t�Bviews/phocacartshipping/index.htmlnu�[���PK�"�[u~%�aa%�Bviews/phocacartshipping/tmpl/edit.phpnu�[���PK�"�[�#o,,'��Bviews/phocacartshipping/tmpl/index.htmlnu�[���PK�"�[��g� %+�Bviews/phocacartshipping/view.html.phpnu�[���PK�"�[�#o,,#��Bviews/phocacartshippings/index.htmlnu�[���PK�"�[]�|�!�!)
�Bviews/phocacartshippings/tmpl/default.phpnu�[���PK�"�[�#o,,(U�Bviews/phocacartshippings/tmpl/index.htmlnu�[���PK�"�[���\&��Bviews/phocacartshippings/view.html.phpnu�[���PK�"�[�#o,,'>�Bviews/phocacartspecification/index.htmlnu�[���PK�"�[c�>EE*��Bviews/phocacartspecification/tmpl/edit.phpnu�[���PK�"�[�#o,,,`�Bviews/phocacartspecification/tmpl/index.htmlnu�[���PK�"�[�����*��Bviews/phocacartspecification/view.html.phpnu�[���PK�"�[�#o,,(�Bviews/phocacartspecifications/index.htmlnu�[���PK�"�[��v��.��Bviews/phocacartspecifications/tmpl/default.phpnu�[���PK�"�[�#o,,-�Cviews/phocacartspecifications/tmpl/index.htmlnu�[���PK�"�[
`�M�
�
+Cviews/phocacartspecifications/view.html.phpnu�[���PK�"�[�#o,,$GCviews/phocacartstatistics/index.htmlnu�[���PK�"�[6�?�2"2"*�Cviews/phocacartstatistics/tmpl/default.phpnu�[���PK�"�[�#o,,)SACviews/phocacartstatistics/tmpl/index.htmlnu�[���PK�"�[��6���'�ACviews/phocacartstatistics/view.html.phpnu�[���PK�"�[�#o,,
!YCviews/phocacartstatus/index.htmlnu�[���PK�"�[�x�Zhh#�YCviews/phocacartstatus/tmpl/edit.phpnu�[���PK�"�[�#o,,%XhCviews/phocacartstatus/tmpl/index.htmlnu�[���PK�"�[�ߤ���#�hCviews/phocacartstatus/view.html.phpnu�[���PK�"�[�#o,,"rCviews/phocacartstatuses/index.htmlnu�[���PK�"�[��ǿ�(~rCviews/phocacartstatuses/tmpl/default.phpnu�[���PK�"�[�#o,,'��Cviews/phocacartstatuses/tmpl/index.htmlnu�[���PK�"�[5�"�{{%�Cviews/phocacartstatuses/view.html.phpnu�[���PK�"�[�#o,,%�Cviews/phocacartstockstatus/index.htmlnu�[���PK�"�[�{�P,,(i�Cviews/phocacartstockstatus/tmpl/edit.phpnu�[���PK�"�[�#o,,*�Cviews/phocacartstockstatus/tmpl/index.htmlnu�[���PK�"�[�kvo��(s�Cviews/phocacartstockstatus/view.html.phpnu�[���PK�"�[�#o,,'��Cviews/phocacartstockstatuses/index.htmlnu�[���PK�"�[
��22-1�Cviews/phocacartstockstatuses/tmpl/default.phpnu�[���PK�"�[�#o,,,��Cviews/phocacartstockstatuses/tmpl/index.htmlnu�[���PK�"�[�U2�""*H�Cviews/phocacartstockstatuses/view.html.phpnu�[���PK�"�[�#o,,$��Cviews/phocacartsubmititem/index.htmlnu�[���PK�"�[��Ny��'D�Cviews/phocacartsubmititem/tmpl/edit.phpnu�[���PK�"�[���AA1��Cviews/phocacartsubmititem/tmpl/edit_parameter.phpnu�[���PK�"�[�#o,,)(�Cviews/phocacartsubmititem/tmpl/index.htmlnu�[���PK�"�[��VV'��Cviews/phocacartsubmititem/view.html.phpnu�[���PK�"�[�#o,,%Z�Cviews/phocacartsubmititems/index.htmlnu�[���PK�"�[��Kuu+�Cviews/phocacartsubmititems/tmpl/default.phpnu�[���PK�"�[�#o,,*�Dviews/phocacartsubmititems/tmpl/index.htmlnu�[���PK�"�[��(���(1Dviews/phocacartsubmititems/view.html.phpnu�[���PK�"�[�#o,,t(Dviews/phocacarttag/index.htmlnu�[���PK�"�[z7���
�(Dviews/phocacarttag/tmpl/edit.phpnu�[���PK�"�[�#o,,"1Dviews/phocacarttag/tmpl/index.htmlnu�[���PK�"�[�/���
�1Dviews/phocacarttag/view.html.phpnu�[���PK�"�[�#o,,�:Dviews/phocacarttags/index.htmlnu�[���PK�"�[f��$!;Dviews/phocacarttags/tmpl/default.phpnu�[���PK�"�[�#o,,#�QDviews/phocacarttags/tmpl/index.htmlnu�[���PK�"�[�F�
!RDviews/phocacarttags/view.html.phpnu�[���PK�"�[�#o,,q_Dviews/phocacarttax/index.htmlnu�[���PK�"�[1�+[��
�_Dviews/phocacarttax/tmpl/edit.phpnu�[���PK�"�[�#o,,"�gDviews/phocacarttax/tmpl/index.htmlnu�[���PK�"�[ȳ����
UhDviews/phocacarttax/view.html.phpnu�[���PK�"�[�#o,,�qDviews/phocacarttaxes/index.htmlnu�[���PK�"�[�����%�qDviews/phocacarttaxes/tmpl/default.phpnu�[���PK�"�[�#o,,$��Dviews/phocacarttaxes/tmpl/index.htmlnu�[���PK�"�[�[��nn"|�Dviews/phocacarttaxes/view.html.phpnu�[���PK�"�[�#o,,
<�Dviews/phocacartthumba/index.htmlnu�[���PK�"�[�bl�WW&��Dviews/phocacartthumba/tmpl/default.phpnu�[���PK�"�[�#o,,%e�Dviews/phocacartthumba/tmpl/index.htmlnu�[���PK�"�[h�""��#�Dviews/phocacartthumba/view.json.phpnu�[���PK�"�[�#o,,�Dviews/phocacarttime/index.htmlnu�[���PK�"�[�<E��!\�Dviews/phocacarttime/tmpl/edit.phpnu�[���PK�"�[�#o,,#��Dviews/phocacarttime/tmpl/index.htmlnu�[���PK�"�[X�6��!�Dviews/phocacarttime/view.html.phpnu�[���PK�"�[�#o,,(�Dviews/phocacarttimes/index.htmlnu�[���PK�"�[]�T���%��Dviews/phocacarttimes/tmpl/default.phpnu�[���PK�"�[�#o,,$��Dviews/phocacarttimes/tmpl/index.htmlnu�[���PK�"�[��3UU"�Dviews/phocacarttimes/view.html.phpnu�[���PK�"�[�#o,,��Dviews/phocacarttools/index.htmlnu�[���PK�"�[�
�?��%)�Dviews/phocacarttools/tmpl/default.phpnu�[���PK�"�[�#o,,$�Eviews/phocacarttools/tmpl/index.htmlnu�[���PK�"�[���O��"Eviews/phocacarttools/view.html.phpnu�[���PK�"�[�#o,,�Eviews/phocacartunit/index.htmlnu�[���PK�"�[�\j��!Eviews/phocacartunit/tmpl/edit.phpnu�[���PK�"�[�#o,,#�Eviews/phocacartunit/tmpl/index.htmlnu�[���PK�"�[�5�]��!~Eviews/phocacartunit/view.html.phpnu�[���PK�"�[�#o,,�
Eviews/phocacartunits/index.htmlnu�[���PK�"�[_Y
��%!Eviews/phocacartunits/tmpl/default.phpnu�[���PK�"�[�#o,,$�8Eviews/phocacartunits/tmpl/index.htmlnu�[���PK�"�[2�#��
�
"y9Eviews/phocacartunits/view.html.phpnu�[���PK�"�[�#o,,#�DEviews/phocacartunittests/index.htmlnu�[���PK�"�[~�faa)?EEviews/phocacartunittests/tmpl/default.phpnu�[���PK�"�[�#o,,(�FEviews/phocacartunittests/tmpl/index.htmlnu�[���PK�"�[�#o,,}GEviews/phocacartuser/index.htmlnu�[���PK�"�[d�|
!�GEviews/phocacartuser/tmpl/edit.phpnu�[���PK�"�[�#o,,#QREviews/phocacartuser/tmpl/index.htmlnu�[���PK�"�[�\��EE!�REviews/phocacartuser/view.html.phpnu�[���PK�"�[�#o,,f^Eviews/phocacartusers/index.htmlnu�[���PK�"�[�Z��44%�^Eviews/phocacartusers/tmpl/default.phpnu�[���PK�"�[�#o,,$P�Eviews/phocacartusers/tmpl/index.htmlnu�[���PK�"�[�3="ГEviews/phocacartusers/view.html.phpnu�[���PK�"�[�#o,,
-�Eviews/phocacartvendor/index.htmlnu�[���PK�"�[E9�__#��Eviews/phocacartvendor/tmpl/edit.phpnu�[���PK�"�[�#o,,%[�Eviews/phocacartvendor/tmpl/index.htmlnu�[���PK�"�[�֜��#ܨEviews/phocacartvendor/view.html.phpnu�[���PK�"�[�#o,,!��Eviews/phocacartvendors/index.htmlnu�[���PK�"�[D<�99'u�Eviews/phocacartvendors/tmpl/default.phpnu�[���PK�"�[�#o,,&�Eviews/phocacartvendors/tmpl/index.htmlnu�[���PK�"�[0����$��Eviews/phocacartvendors/view.html.phpnu�[���PK�"�[�#o,,"[�Eviews/phocacartwishlist/index.htmlnu�[���PK�"�[��2pp%��Eviews/phocacartwishlist/tmpl/edit.phpnu�[���PK�"�[�#o,,'��Eviews/phocacartwishlist/tmpl/index.htmlnu�[���PK�"�[ǯt��%!�Eviews/phocacartwishlist/view.html.phpnu�[���PK�"�[�#o,,#,�Eviews/phocacartwishlists/index.htmlnu�[���PK�"�[��W��)��Eviews/phocacartwishlists/tmpl/default.phpnu�[���PK�"�[�#o,,(�Fviews/phocacartwishlists/tmpl/index.htmlnu�[���PK�"�[����&�Fviews/phocacartwishlists/view.html.phpnu�[���PK�"�[�#o,,
ZFviews/phocacartwizard/index.htmlnu�[���PK�"�[ÓD�7�7&�Fviews/phocacartwizard/tmpl/default.phpnu�[���PK�"�[�#o,,%�FFviews/phocacartwizard/tmpl/index.htmlnu�[���PK�"�[H�<��#GFviews/phocacartwizard/view.html.phpnu�[���PK�"�[�#o,,RKFviews/phocacartzone/index.htmlnu�[���PK�"�[O/g�ss!�KFviews/phocacartzone/tmpl/edit.phpnu�[���PK�"�[�#o,,#�SFviews/phocacartzone/tmpl/index.htmlnu�[���PK�"�[M� �
!TFviews/phocacartzone/view.html.phpnu�[���PK�"�[�#o,,�]Fviews/phocacartzones/index.htmlnu�[���PK�"�[��SZZ%�]Fviews/phocacartzones/tmpl/default.phpnu�[���PK�"�[�#o,,$�zFviews/phocacartzones/tmpl/index.htmlnu�[���PK�"�[V��n~~"*{Fviews/phocacartzones/view.html.phpnu�[���PKdd����F