$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
            $items[$row['cu_iso_3']] = '<option value="' . $row['cu_iso_3'] . '"' . ($this->cookie['selected_currency'] == $row['cu_iso_3'] ? ' selected' : '') . '>' . htmlspecialchars($row['cu_name_en']) . '</option>' . "\n";
        }
    }
    $content .= implode($items);
    $content .= '
	</select>
	</form>
	';
    $GLOBALS['TSFE']->additionalHeaderData[] = '
	<script>
		jQuery(document).ready(function($)
		{
			$(\'#multishop_currency_selector\').change(function(){
				var selected_currency=$("#multishop_currency_selector option:selected").val();
				if (selected_currency)
				{
					$.ajax({
							type:   "POST",
							url:    "' . mslib_fe::typolink($this->shop_pid . ',2002', '&tx_multishop_pi1[page_section]=update_currency') . '",
							data:   "tx_multishop_pi1[selected_currency]="+selected_currency,
							success: function(msg) {
								parent.window.location.reload();
							}
					});
				}
			});
		});
	</script>
	';
}
    $markerArray['ORDERS_ID'] = $order['orders_id'];
    $markerArray['USER_AGENT'] = $order['user_agent'];
    // custom page hook that can be controlled by third-party plugin eof
    $orderItem .= $this->cObj->substituteMarkerArray($subparts['useragents_listing'], $markerArray, '###|###');
}
$actions = array();
$formFields = array();
$query_string = mslib_fe::tep_get_all_get_params(array('tx_multishop_pi1[action]', 'tx_multishop_pi1[order_by]', 'tx_multishop_pi1[order]', 'p', 'Submit', 'weergave', 'clearcache'));
$subpartArray = array();
$subpartArray['###LABEL_HEADER_ORDERS_ID###'] = $this->pi_getLL('orders_id');
$subpartArray['###LABEL_FOOTER_ORDERS_ID###'] = $this->pi_getLL('orders_id');
$subpartArray['###LABEL_HEADER_CUSTOMER###'] = $this->pi_getLL('customer');
$subpartArray['###LABEL_FOOTER_CUSTOMER###'] = $this->pi_getLL('customer');
$subpartArray['###LABEL_HEADER_IP_ADDRESS###'] = $this->pi_getLL('ip_address');
$subpartArray['###LABEL_FOOTER_IP_ADDRESS###'] = $this->pi_getLL('ip_address');
$subpartArray['###LABEL_HEADER_USER_AGENT###'] = $this->pi_getLL('user_agent', 'user agents');
$subpartArray['###LABEL_FOOTER_USER_AGENT###'] = $this->pi_getLL('user_agent', 'user agents');
$subpartArray['###ADMIN_LABEL_LINK_DOWNLOAD_AS_EXCEL###'] = $this->pi_getLL('admin_label_link_download_as_excel');
// pagination
$this->ms['MODULES']['PAGESET_LIMIT'] = $this->ms['MODULES']['ORDERS_LISTING_LIMIT'];
if (!$this->ms['nopagenav'] and $pageset['total_rows'] > $this->ms['MODULES']['PAGESET_LIMIT']) {
    $tmp = '';
    require \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('multishop') . 'scripts/admin_pages/includes/admin_pagination.php';
    $pagination_listing = $tmp;
}
// pagination eof
$subpartArray['###DOWNLOAD_EXCEL###'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_useragent_export');
$subpartArray['###PAGINATION###'] = $pagination_listing;
$subpartArray['###ORDERS_LISTING###'] = $orderItem;
// custom page hook that can be controlled by third-party plugin eof
$order_results = $this->cObj->substituteMarkerArrayCached($subparts['useragents_results'], array(), $subpartArray);
            $tmp .= '<li><div class="dyna_button"><span>' . $x . '</span></div></li>';
        } else {
            $tmp .= '<li><div class="dyna_button"><a class="ajax_link pagination_button" href="' . mslib_fe::typolink('', 'p=' . ($x - 1) . '&' . mslib_fe::tep_get_all_get_params(array('p', 'Submit', 'page', 'mini_foto', 'clearcache')), 1) . '">' . $x . '</a></div></li>';
        }
    }
    $tmp .= '</ul>
</li>';
    $tmp .= '<li class="pagenav_next"><div class="dyna_button">';
    if (($p + 1) * $limit_per_page < $pageset['total_rows']) {
        $tmp .= '<a class="ajax_link pagination_button" href="' . mslib_fe::typolink('', 'p=' . ($p + 1) . '&' . mslib_fe::tep_get_all_get_params(array('p', 'Submit', 'page', 'mini_foto', 'clearcache')), 1) . '">' . $this->pi_getLL('next') . '</a>';
    } else {
        $tmp .= '<span>' . $this->pi_getLL('next') . '</span>';
    }
    $tmp .= '</div></li>';
    $tmp .= '<li class="pagenav_last"><div class="dyna_button">';
    if (($p + 1) * $limit_per_page < $pageset['total_rows']) {
        $times = $pageset['total_rows'] / $limit_per_page;
        $lastpage = floor($times);
        if ($lastpage == $times) {
            $lastpage--;
        }
        $tmp .= '<a class="ajax_link pagination_button" href="' . mslib_fe::typolink('', 'p=' . $lastpage . '&' . mslib_fe::tep_get_all_get_params(array('p', 'Submit', 'page', 'mini_foto', 'clearcache')), 1) . '">' . $this->pi_getLL('last') . '</a>';
    } else {
        $tmp .= '<span>' . $this->pi_getLL('last') . '</span>';
    }
    $tmp .= '</div></li>';
    $tmp .= '</ul>
</div>
';
    $content .= $tmp;
}
	<script>
	  jQuery(document).ready(function($) {
		$(".disabled_product").css({ opacity: 0.6 });
		$(".disabled_product").hover(
		  function () {
			$(".disabled_product").css({ opacity: 1 });
		  },
		  function () {
			$(".disabled_product").css({ opacity: 0.6 });
		  }
		);			  
		var result = jQuery(".product_listing").sortable({
			cursor:     "move", 
			//axis:       "y", 
			update: function(e, ui) { 
				href = "' . mslib_fe::typolink($this->shop_pid . ',2002', '&tx_multishop_pi1[page_section]=product&catid=' . $current_product['categories_id']) . '";
				jQuery(this).sortable("refresh"); 
				sorted = jQuery(this).sortable("serialize", "id"); 
				jQuery.ajax({ 
						type:   "POST", 
						url:    href, 
						data:   sorted, 
						success: function(msg) { 
								//do something with the sorted data 
						} 
				}); 
			} 

		});
	  });
	  </script>					
Exemple #5
0
$mslib_cart->init($this);
$cart = $mslib_cart->getCart();
$cart_total_amount = $mslib_cart->countCartTotalPrice(0);
$count_products = count($cart['products']);
if (!empty($this->ms['MODULES']['MINIMUM_ORDER_AMOUNT']) && $this->ms['MODULES']['MINIMUM_ORDER_AMOUNT'] > 0) {
    if ($cart_total_amount < $this->ms['MODULES']['MINIMUM_ORDER_AMOUNT']) {
        // redirect to shopping cart page
        header('Location: ' . $this->FULL_HTTP_URL . mslib_fe::typolink($this->conf['shoppingcart_page_pid'], '&tx_multishop_pi1[page_section]=shopping_cart'));
        exit;
    }
}
// maximum order amount
if (!empty($this->ms['MODULES']['MAXIMUM_ORDER_AMOUNT']) && $this->ms['MODULES']['MAXIMUM_ORDER_AMOUNT'] > 0) {
    if ($cart_total_amount > $this->ms['MODULES']['MAXIMUM_ORDER_AMOUNT']) {
        // redirect to shopping cart page
        header('Location: ' . $this->FULL_HTTP_URL . mslib_fe::typolink($this->conf['shoppingcart_page_pid'], '&tx_multishop_pi1[page_section]=shopping_cart'));
        exit;
    }
}
if (is_array($cart['products']) and $count_products) {
    // load customer country
    // use for filtering the available payment on the customer country
    $address = $cart['user'];
    if (isset($this->post['country']) && !empty($this->post['country']) && $this->post['country'] != $address['country']) {
        $address['country'] = $this->post['country'];
    }
    if (!$address['country']) {
        $user_country = 0;
    } else {
        $iso_customer = mslib_fe::getCountryByName($address['country']);
        $user_country = $iso_customer['cn_iso_nr'];
 public function loginAsUser($uid, $section = '')
 {
     if (!is_numeric($uid)) {
         return false;
     }
     $user = mslib_fe::getUser($uid);
     if ($user['uid']) {
         $GLOBALS['TSFE']->fe_user->logoff();
         $GLOBALS['TSFE']->loginUser = 0;
         $fe_user = $GLOBALS['TSFE']->fe_user;
         $fe_user->createUserSession(array('uid' => $uid));
         $fe_user->user = $fe_user->getRawUserByUid($uid);
         $fe_user->fetchGroupData();
         $GLOBALS['TSFE']->loginUser = 1;
         /*
          * Old style, dont use this anymore. use above approach which uses the $uid
         // auto login the user
         $loginData=array(
         	'uname'=>$user['username'],
         	//usernmae
         	'uident'=>$user['password'],
         	//password
         	'status'=>'login'
         );
         $GLOBALS['TSFE']->fe_user->checkPid=0; //do not use a particular pid
         $info=$GLOBALS['TSFE']->fe_user->getAuthInfoArray();
         $user=$GLOBALS['TSFE']->fe_user->fetchUserRecord($info['db_user'], $loginData['uname']);
         $GLOBALS['TSFE']->fe_user->createUserSession($user);
         */
         // auto login the user
         if (is_numeric($this->conf['login_as_customer_target_pid'])) {
             $targetPid = $this->conf['login_as_customer_target_pid'];
         } else {
             $targetPid = $this->shop_pid;
         }
         $redirect_url = $this->FULL_HTTP_URL . mslib_fe::typolink($targetPid);
         //hook to let other plugins further manipulate the redirect link
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['loginAsUserRedirectLinkPreProc'])) {
             $params = array('user' => $user, 'redirect_url' => &$redirect_url, 'section' => &$section);
             foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['loginAsUserRedirectLinkPreProc'] as $funcRef) {
                 \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
             }
         }
         if ($redirect_url) {
             header("Location: " . $redirect_url);
         }
         exit;
     }
 }
            $cats = array_reverse($cats);
            $where = '';
            if (count($cats) > 0) {
                foreach ($cats as $item) {
                    $where .= "categories_id[" . $level . "]=" . $item['id'] . "&";
                    $level++;
                }
                $where = substr($where, 0, strlen($where) - 1);
                $where .= '&';
            }
            $where .= 'categories_id[' . $level . ']=' . $category['categories_id'];
            // get all cats to generate multilevel fake url eof
            if ($category['categories_external_url']) {
                $link = $category['categories_external_url'];
            } else {
                $link = mslib_fe::typolink($this->conf['products_listing_page_pid'], '&' . $where . '&tx_multishop_pi1[page_section]=products_listing');
            }
            $name = '<a href="' . $link . '" class="ajax_link">' . $category['categories_name'] . '</a>';
            $html = '<div class="main_category_box">' . "\n" . '
			<h2>' . $name . '</h2>' . "\n" . '</div>';
        } else {
            $name = '<span>' . $category['categories_name'] . '</span>';
            $subcats_html = mslib_fe::get_subcategories_as_ul($category['categories_id']);
            if ($subcats_html) {
                $html = '<div class="main_category_box">' . "\n" . '
				<h2>' . $name . '</h2>' . "\n";
                $html .= $subcats_html . "\n" . '
				</div>';
            }
        }
        if ($html) {
$subpartArray['###BACK_BUTTON###'] = '<hr><div class="clearfix"><a class="btn btn-success msAdminBackToCatalog" href="' . mslib_fe::typolink() . '"><span class="fa-stack"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-arrow-left fa-stack-1x"></i></span> ' . $this->pi_getLL('admin_close_and_go_back_to_catalog') . '</a></div>';
// Instantiate admin interface object
$objRef =& \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj('EXT:multishop/pi1/classes/class.tx_mslib_admin_interface.php:&tx_mslib_admin_interface');
$objRef->setInterfaceKey('admin_categories');
// Header buttons
$headerButtons = array();
// Create category button
$headingButton = array();
$headingButton['btn_class'] = 'btn btn-primary';
$headingButton['fa_class'] = 'fa fa-plus-circle';
$headingButton['title'] = $this->pi_getLL('admin_add_new_category_to_the_catalog');
$headingButton['href'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=add_category&action=add_category');
$headerButtons[] = $headingButton;
// Create multiple categories button
$headingButton = array();
$headingButton['btn_class'] = 'btn btn-primary';
$headingButton['fa_class'] = 'fa fa-plus-circle';
$headingButton['title'] = $this->pi_getLL('admin_add_new_multiple_category_to_the_catalog', 'Add new categories simultaneous');
$headingButton['href'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=add_multiple_category&action=add_multiple_category');
$headerButtons[] = $headingButton;
$headingButton = array();
$headingButton['btn_class'] = 'btn btn-primary';
$headingButton['fa_class'] = 'fa fa-plus-circle';
$headingButton['title'] = $this->pi_getLL('admin_create_new_products_here');
$headingButton['href'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=add_product&action=add_product');
$headerButtons[] = $headingButton;
// Set header buttons through interface class so other plugins can adjust it
$objRef->setHeaderButtons($headerButtons);
// Get header buttons through interface class so we can render them
$subpartArray['###INTERFACE_HEADER_BUTTONS###'] = $objRef->renderHeaderButtons();
$content .= $this->cObj->substituteMarkerArrayCached($subparts['template'], array(), $subpartArray);
Exemple #9
0
                $deliver_to_sb .= '
				<select name="deliver_to_country" id="deliver_to_country" class="country" title="' . $this->pi_getLL('country_is_required') . '">
					' . $tmpcontent_con . '
				</select>
				';
            }
        }
        // country eof
        $subpartArray['###SHIPPING_COST_COUNTRY_SELECTION###'] = '
		<div class="shoppingcart_shipping_cost_wrapper">
			<div class="shipping_deliver_to"><label for="deliver_to_country">' . $this->pi_getLL('deliver_in') . '<label>' . $deliver_to_sb . '</div>
			<div class="shipping_deliver_by"></div>
		</div>
		';
    }
    // custom hook that can be controlled by third-party plugin
    if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/front_pages/shopping_cart/default.php']['shoppingCartPagePostHook'])) {
        $params = array('template' => $template, 'subpartArray' => &$subpartArray, 'cart' => &$cart);
        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/front_pages/shopping_cart/default.php']['shoppingCartPagePostHook'] as $funcRef) {
            \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
        }
    }
    // completed the template expansion by replacing the "item" marker in the template
    $content .= $this->cObj->substituteMarkerArrayCached($subparts['template'], array(), $subpartArray);
} else {
    $content .= '<div class="noitems_message">' . $this->pi_getLL('there_are_no_products_in_your_cart') . '</div>';
    $content .= '
	<div id="bottom-navigation"><a href="' . mslib_fe::typolink($this->shop_pid) . '" class="msFrontButton continueState arrowRight arrowPosLeft proceed_to_shop"><span>' . $this->pi_getLL('go_to_catalog') . '</span></a>
		<div class="cart"></div>
	</div>';
}
if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}
$content .= '
<form action="index.php" method="get" name="products_searchform" id="multishop_products_searchform">
<input name="id" type="hidden" value="' . $this->conf['search_page_pid'] . '" />
<input name="tx_multishop_pi1[page_section]" type="hidden" value="products_search" />

<div class="form-fieldset">
<select name="manufacturers_id" id="manufacturers_dropdown_menu"><option value="">' . htmlspecialchars($this->pi_getLL('manufacturers')) . '</option>
';
$str = "SELECT * from tx_multishop_manufacturers m, tx_multishop_manufacturers_info mi where m.manufacturers_id=mi.manufacturers_id and m.status=1 order by m.sort_order,m.manufacturers_name";
$qry = $GLOBALS['TYPO3_DB']->sql_query($str);
$manufacturers = array();
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry)) {
    $manufacturers[] = $row;
}
if (count($manufacturers) > 0) {
    foreach ($manufacturers as $manufacturer) {
        $link = $this->FULL_HTTP_URL . mslib_fe::typolink($this->shop_pid, 'tx_multishop_pi1[page_section]=manufacturers_products_listing&manufacturers_id=' . $manufacturer['manufacturers_id']);
        $content .= '<option value="' . $link . '"' . ($this->get['manufacturers_id'] == $manufacturer['manufacturers_id'] ? ' selected' : '') . '>' . htmlspecialchars($manufacturer['manufacturers_name']) . '</option>' . "\n";
    }
}
$content .= '</select>
</div>
</form>
<script>
	jQuery("#manufacturers_dropdown_menu").change(function() {
		window.location = jQuery(this).val();
	});						
</script>';
Exemple #11
0
			<th valign="top">Product</td>
		</tr>
		</thead><tbody>
	';
    while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry)) != false) {
        if ($row['categories_id']) {
            // get all cats to generate multilevel fake url
            $level = 0;
            $cats = mslib_fe::Crumbar($row['categories_id']);
            $cats = array_reverse($cats);
            $where = '';
            if (count($cats) > 0) {
                foreach ($cats as $cat) {
                    $where .= "categories_id[" . $level . "]=" . $cat['id'] . "&";
                    $level++;
                }
                $where = substr($where, 0, strlen($where) - 1);
            }
            // get all cats to generate multilevel fake url eof
            $productLink = mslib_fe::typolink($this->conf['products_detail_page_pid'], '&' . $where . '&products_id=' . $row['products_id'] . '&tx_multishop_pi1[page_section]=products_detail');
        } else {
            $productLink = '';
        }
        $content .= '<tr>';
        $content .= '<td class="text-right">' . number_format(round($row['total'], 1), 0, '', '.') . '</td>';
        $content .= '<td><a href="' . $productLink . '" target="_blank">' . htmlspecialchars($row['products_name']) . '</a></td>';
        $content .= '</tr>';
    }
    $content .= '</tbody></table>';
}
$content = '<div class="panel panel-default"><div class="panel-body">' . mslib_fe::shadowBox($content) . '</div></div>';
    $prod['Title'] = '<div class="ajax_products_name">' . substr($product['products_name'], 0, 50) . '</div><div class="ajax_products_model">' . substr($product['products_model'], 0, 50) . '</div>';
    $prod['Title'] = $prod['Title'];
    $prod['Desc'] = '<div class="ajax_products_shortdescription">' . addslashes(mslib_befe::str_highlight(substr($product['products_shortdescription'], 0, 75), $this->get['q'])) . '</div>';
    if ($product['products_price'] != $product['final_price']) {
        $prod['Price'] = '<div class="ajax_products_price"><div class="ajax_old_price">' . mslib_fe::amount2Cents($product['products_price']) . '</div><div class="ajax_specials_price">' . mslib_fe::amount2Cents($product['final_price']) . '</div></div>';
    } else {
        $prod['Price'] = '<div class="ajax_products_price"><div class="ajax_normal_price">' . mslib_fe::amount2Cents($product['products_price']) . '</div></div>';
    }
    $prod['Name'] = substr($product['products_name'], 0, 50);
    $prod['skeyword'] = $this->get['q'];
    $prod['Page'] = $pages;
    $prod['Product'] = true;
    $data[] = $prod;
}
if (isset($this->get['page'])) {
    if ($totpage > 1) {
        //echo $totpage;
        if ($pages != $totpage) {
            $prod = array();
            $prod['Name'] = $this->pi_getLL('more_results');
            $prod['Title'] = '<span id="more-results">' . htmlspecialchars($this->pi_getLL('more_results')) . ' >></span>';
            $prod['Link'] = mslib_fe::typolink($this->shop_pid, 'tx_multishop_pi1[page_section]=products_search&skeyword=' . urlencode($this->get['q']));
            $prod['skeyword'] = $this->get['q'];
            $prod['Page'] = $pages;
            $prod['Product'] = false;
            $data[] = $prod;
        }
    }
}
$content = array("products" => $data);
//print_r($alldata);
Exemple #13
0
                    $tmp_pagination .= '<li><a alt="' . urlencode($this->get['q']) . '" tabindex="-1" class="ajax_link pagination_button ui-corner-all" href="' . mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_search&page=' . ($x - 1) . '&ms_admin_skeyword=' . urlencode($this->get['q'])) . '">' . $x . '</a></li>';
                }
            }
            $tmp_pagination .= '</ul>
			</li>';
            $tmp_pagination .= '<li class="pagenav_next">';
            if ($this->get['page'] < $global_max_page - 1) {
                $tmp_pagination .= '<a alt="' . urlencode($this->get['q']) . '" tabindex="-1" class="pagination_button msBackendButton continueState arrowRight arrowPosLeft ui-corner-all" href="' . mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_search&page=' . ($this->get['page'] + 1) . '&ms_admin_skeyword=' . urlencode($this->get['q'])) . '"><span>' . $this->pi_getLL('next') . '</span></a>';
            } else {
                $tmp_pagination .= '<span class="pagination_button msBackendButton continueState arrowRight arrowPosLeft disabled"><span>' . $this->pi_getLL('next') . '</span></span>';
            }
            $tmp_pagination .= '</li>';
            $tmp_pagination .= '<li class="pagenav_last">';
            if ($this->get['page'] < $global_max_page - 1) {
                $lastpage = $global_max_page - 1;
                $tmp_pagination .= '<a alt="' . urlencode($this->get['q']) . '" tabindex="-1" class="pagination_button msBackendButton continueState arrowRight arrowPosLeft ui-corner-all" href="' . mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_search&page=' . $lastpage . '&ms_admin_skeyword=' . urlencode($this->get['q'])) . '"><span>' . $this->pi_getLL('last') . '</span></a>';
            } else {
                $tmp_pagination .= '<span class="pagination_button msBackendButton continueState arrowRight arrowPosLeft disabled"><span>' . $this->pi_getLL('last') . '</span></span>';
            }
            $tmp_pagination .= '</li>';
            $tmp_pagination .= '</ul>
			</div>';
        }
        // eol pagination
        if ($have_paging) {
            $tmp_listing .= '<li class="ui-menu-item" role="menuitem">' . $tmp_pagination . '</li>';
        } else {
            $prod = array();
            if ($results_counter > 0) {
                $tmp_listing .= '<li class="ui-menu-item" role="menuitem">' . $tmp_pagination . '</li>';
            } else {
    $subpartArray['###JS_FUNCTIONS_EXTRA###'] = implode("\n", $js_extra['functions']);
}
if (!count($js_extra['triggers'])) {
    $subpartArray['###JS_TRIGGERS_EXTRA###'] = '';
} else {
    $subpartArray['###JS_TRIGGERS_EXTRA###'] = implode("\n", $js_extra['triggers']);
}
$subpartArray['###LABEL_BACK_TO_CATALOG###'] = $this->pi_getLL('admin_close_and_go_back_to_catalog');
$subpartArray['###BACK_TO_CATALOG_LINK###'] = mslib_fe::typolink();
$head = '';
$head .= '
<script type="text/javascript">
jQuery(document).ready(function($) {
	var usersSearchList=[];
	var usersList=[];
	var ajax_url="' . mslib_fe::typolink($this->shop_pid . ',2002', '&tx_multishop_pi1[page_section]=get_users') . '"
	$("#userIdSelect2").select2({
		placeholder: "' . $this->pi_getLL('select_members') . '",
		multiple: true,
		minimumInputLength: 0,
		query: function(query) {
			if (usersSearchList[query.term] !== undefined) {
				query.callback({results: usersSearchList[query.term]});
			} else {
				$.ajax(ajax_url, {
					data: {
						q: query.term
					},
					dataType: "json"
				}).done(function(data) {
					usersSearchList[query.term]=data;
Exemple #15
0
         $item_products_specials_price = '<div class="price_excluding_vat">' . $this->pi_getLL('excluding_vat') . ' ' . mslib_fe::amount2Cents($product['final_price']) . '</div>';
     }
     $item_products_price = '';
     if ($product['products_price'] != $product['final_price']) {
         if ($product['tax_rate'] and $this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
             $old_price = $product['products_price'] * (1 + $product['tax_rate']);
         } else {
             $old_price = $product['products_price'];
         }
         $item_products_price = '<div class="old_price">' . mslib_fe::amount2Cents($old_price) . '</div><div class="final_price">' . mslib_fe::amount2Cents($final_price) . '</div>';
     } else {
         $item_products_price = '<div class="final_price">' . mslib_fe::amount2Cents($final_price) . '</div>';
     }
     $admin_menu = '';
     if ($this->ADMIN_USER) {
         $admin_menu = '<div class="admin_menu"><a href="' . mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=edit_product&pid=' . $product['products_id'] . '&action=edit_product', 1) . '" class="admin_menu_edit"><i class="fa fa-pencil"></i></a><a href="' . mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=delete_product&pid=' . $product['products_id'] . '&action=delete_product', 1) . '" class="admin_menu_remove" title="Remove"><i class="fa fa-trash-o"></i></a></div>';
     }
     if (!strstr($product['products_url'], 'http://') and !strstr($product['products_url'], 'http://')) {
         $product['products_url'] = 'http://' . $product['products_url'];
     }
 }
 $markerArray = array();
 $markerArray['ITEM_PRODUCTS_ID'] = $product['products_id'];
 $markerArray['ITEM_PRODUCT_DETAILS_PAGE_LINK'] = $link;
 $markerArray['ITEM_PRODUCTS_NAME'] = htmlspecialchars($product['products_name']);
 $markerArray['ITEM_PRODUCTS_IMAGE'] = $image;
 $markerArray['ITEM_PRODUCTS_SPECIAL_PRICE'] = $item_products_specials_price;
 $markerArray['ITEM_PRODUCTS_PRICE'] = $item_products_price;
 $markerArray['ADMIN_MENU'] = $admin_menu;
 $markerArray['ADMIN_ICONS'] = $admin_menu;
 $markerArray['ITEM_PRODUCT_DETAILS_PAGE_LINK_TITLE'] = htmlspecialchars($this->pi_getLL('view')) . ' ' . htmlspecialchars($product['products_name']);
		$res = $GLOBALS['TYPO3_DB']->sql_query($query3);
		$counter++;
	}
}
die();
*/
$navItems = array();
$navItems['categories'] = $this->pi_getLL('categories');
$navItems['products'] = $this->pi_getLL('products');
$navItems['products_attributes'] = $this->pi_getLL('admin_label_products_attributes');
$navItems['manufacturers'] = $this->pi_getLL('manufacturers');
$navItems['orders'] = $this->pi_getLL('orders');
$navItems['everything'] = $this->pi_getLL('admin_label_everything');
$content .= '<div class="panel panel-default"><div class="panel-heading"><h3>' . $this->pi_getLL('admin_label_clear_database') . '</h3></div>
<div class="panel-body">
<form action="' . mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_clear_database') . '" method="post" class="form-horizontal">
	<div class="form-group">
			<label class="control-label col-md-2">' . $this->pi_getLL('admin_label_items_to_delete') . '</label>
			<div class="col-md-10">
			';
foreach ($navItems as $key => $val) {
    $content .= '<div class="checkbox checkbox-success"><input name="tx_multishop_pi1[items][]" type="checkbox" id="' . $key . '" value="' . $key . '" /><label for="' . $key . '">' . $val . '</label></div>' . "\n";
}
$content .= '
			</div>
	</div>
	<hr>
	<div class="clearfix">
		<div class="pull-right">
			<button type="submit" id="submit" class="btn btn-success" value=""><i class="fa fa-save"></i> ' . $this->pi_getLL('delete') . '</button>
		</div>
Exemple #17
0
    } else {
        $content = '<div class="main-title"><h1>' . $this->pi_getLL('the_requested_manufacturer_does_not_exist') . '</h1></div>';
    }
    if ($page[0]['content']) {
        $content .= $page[0]['content'];
    }
}
if ($this->ROOTADMIN_USER or $this->ADMIN_USER and $this->CATALOGADMIN_USER) {
    $content .= '
	<script type="text/javascript">
	jQuery(document).ready(function($) {
		jQuery("#manufacturers_sortable_' . $output['manufacturers_uid'] . '").sortable({
			cursor:     "move",
			//axis:       "y",
			update: function(e, ui) {
				href = "' . mslib_fe::typolink($this->shop_pid . ',2002', '&tx_multishop_pi1[page_section]=manufacturers') . '";
				jQuery(this).sortable("refresh");
				sorted = jQuery(this).sortable("serialize", "id");
				jQuery.ajax({
					type:   "POST",
					url:    href,
					data:   sorted,
					success: function(msg) {
							//do something with the sorted data
					}
				});
			}
		});
	});
	</script>
	';
Exemple #18
0
$content .= '</div>';
$content = '<div class="panel-heading"><h3>' . $this->pi_getLL('admin_multishop_settings') . '</h3></div>';
$content .= '<div class="panel-body">
<div id="tab-container" class="msadminVerticalTabs">
    <ul class="nav nav-tabs" role="tablist" id="admin_modules">';
$count = 0;
foreach ($tabs as $key => $value) {
    $count++;
    $content .= '<li' . ($count == 1 ? '' : '') . ' role="presentation"><a href="#' . $key . '" aria-controls="profile" role="tab" data-toggle="tab">' . $value[0] . '</a></li>';
}
$content .= '
    </ul>
    <div class="tab-content">
	';
$count = 0;
foreach ($tabs as $key => $value) {
    $count++;
    $content .= '
        <div id="' . $key . '" class="tab-pane" role="tabpanel">
        	<form id="form1" name="form1" method="get" action="index.php">
			' . $formTopSearch . '
			</form>
			' . $value[1] . '
        </div>
	';
}
$content .= '
    </div>
</div>';
$content .= '<hr><div class="clearfix"><div class="pull-right"><a class="btn btn-success msAdminBackToCatalog" href="' . mslib_fe::typolink() . '">' . $this->pi_getLL('admin_close_and_go_back_to_catalog') . '</a></div></div></div>';
$content = '<div class="panel panel-default">' . mslib_fe::shadowBox($content) . '</div>';
$headingButton['btn_class'] = 'btn btn-primary';
$headingButton['fa_class'] = 'fa fa-plus-circle';
$headingButton['title'] = $this->pi_getLL('admin_create_new_products_here');
$headingButton['href'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=add_product&action=add_product');
$headerButtons[] = $headingButton;
// Create category button
$headingButton['btn_class'] = 'btn btn-primary';
$headingButton['fa_class'] = 'fa fa-plus-circle';
$headingButton['title'] = $this->pi_getLL('admin_add_new_category_to_the_catalog');
$headingButton['href'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=add_category&action=add_category');
$headerButtons[] = $headingButton;
// Create multiple categories button
$headingButton = array();
$headingButton['btn_class'] = 'btn btn-primary';
$headingButton['fa_class'] = 'fa fa-plus-circle';
$headingButton['title'] = $this->pi_getLL('admin_add_new_multiple_category_to_the_catalog', 'Add new categories simultaneous');
$headingButton['href'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=add_multiple_category&action=add_multiple_category');
$headerButtons[] = $headingButton;
// Set header buttons through interface class so other plugins can adjust it
$objRef->setHeaderButtons($headerButtons);
// Get header buttons through interface class so we can render them
$interfaceHeaderButtons = $objRef->renderHeaderButtons();
// Get header buttons through interface class so we can render them
$subpartArray['###INTERFACE_HEADER_BUTTONS###'] = $objRef->renderHeaderButtons();
$content .= $this->cObj->substituteMarkerArrayCached($subparts['template'], array(), $subpartArray);
$content = $prepending_content . '<div class="fullwidth_div">' . mslib_fe::shadowBox($content) . '</div>';
$GLOBALS['TSFE']->additionalHeaderData[] = '<script type="text/javascript" data-ignore="1">
var product_tax_rate_js=[];
' . implode("\n", $product_tax_rate_js) . '
</script>
';
    function renderInterface($params, &$that)
    {
        mslib_fe::init($that);
        //hook to let other plugins further manipulate the method
        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/class.tx_mslib_admin_interface.php']['renderInterfacePreProc'])) {
            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/class.tx_mslib_admin_interface.php']['renderInterfacePreProc'] as $funcRef) {
                \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
            }
        }
        // for pagination
        $this->get = $that->get;
        $this->post = $that->post;
        if ($this->post) {
            if ($params['postErno']) {
                if (count($params['postErno'])) {
                    $returnMarkup = '
                    <div style="display:none" id="msAdminPostMessage">
                    <table class="table table-striped table-bordered">
                    <thead>
                    <tr>
                        <th class="text-center">Status</th>
                        <th>Message</th>
                    </tr>
                    </thead>
                    <tbody>
                    ';
                    foreach ($params['postErno'] as $item) {
                        switch ($item['status']) {
                            case 'error':
                                $item['status'] = '<span class="fa-stack text-danger"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-thumbs-down fa-stack-1x fa-inverse"></i></span>';
                                break;
                            case 'info':
                                $item['status'] = '<span class="fa-stack"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-thumbs-up fa-stack-1x fa-inverse"></i></span>';
                                break;
                        }
                        $returnMarkup .= '<tr><td class="text-center">' . $item['status'] . '</td><td>' . $item['message'] . '</td></tr>' . "\n";
                    }
                    $returnMarkup .= '</tbody></table></div>';
                    $tableContent .= $returnMarkup;
                    $GLOBALS['TSFE']->additionalHeaderData[] = '<script type="text/javascript" data-ignore="1">
                    jQuery(document).ready(function ($) {
                        $.confirm({
                            title: \'\',
                            content: $(\'#msAdminPostMessage\').html()
                        });
                    });
                    </script>
                    ';
                }
            }
        }
        $updateCookie = 0;
        if ($that->get['Search'] and $that->get['limit'] != $that->cookie['limit']) {
            $that->cookie['limit'] = $that->get['limit'];
            $updateCookie = 1;
        }
        if ($that->get['Search'] and $that->get['display_all_records'] != $that->cookie['display_all_records']) {
            $that->cookie['display_all_records'] = $that->get['display_all_records'];
            $updateCookie = 1;
        }
        if ($updateCookie) {
            $GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_multishop_cookie', $that->cookie);
            $GLOBALS['TSFE']->storeSessionData();
        }
        if ($that->cookie['display_all_records']) {
            $that->get['display_all_records'] = $that->cookie['display_all_records'];
        } else {
            $that->get['display_all_records'] = '';
        }
        if ($that->cookie['limit']) {
            $that->get['limit'] = $that->cookie['limit'];
        } else {
            $that->get['limit'] = 50;
        }
        $that->ms['MODULES']['PAGESET_LIMIT'] = $that->get['limit'];
        if ($params['settings']['limit'] && is_numeric($params['settings']['limit'])) {
            $that->ms['MODULES']['PAGESET_LIMIT'] = $params['settings']['limit'];
        }
        if (is_numeric($that->get['p'])) {
            $p = $that->get['p'];
        }
        $that->searchKeywords = array();
        if ($that->get['tx_multishop_pi1']['keyword']) {
            //  using $_REQUEST cause TYPO3 converts "Command & Conquer" to "Conquer" (the & sign sucks ass)
            $that->get['tx_multishop_pi1']['keyword'] = trim($that->get['tx_multishop_pi1']['keyword']);
            $that->get['tx_multishop_pi1']['keyword'] = $GLOBALS['TSFE']->csConvObj->utf8_encode($that->get['tx_multishop_pi1']['keyword'], $GLOBALS['TSFE']->metaCharset);
            $that->get['tx_multishop_pi1']['keyword'] = $GLOBALS['TSFE']->csConvObj->entities_to_utf8($that->get['tx_multishop_pi1']['keyword'], true);
            $that->get['tx_multishop_pi1']['keyword'] = mslib_fe::RemoveXSS($that->get['tx_multishop_pi1']['keyword']);
            $that->searchKeywords[] = $that->get['tx_multishop_pi1']['keyword'];
            $that->searchMode = '%keyword%';
        }
        $limit_search_result_selectbox = '<select name="limit" class="form-control">';
        $limits = array();
        $limits[] = '10';
        $limits[] = '15';
        $limits[] = '20';
        $limits[] = '25';
        $limits[] = '30';
        $limits[] = '40';
        $limits[] = '50';
        $limits[] = '100';
        $limits[] = '150';
        $limits[] = '200';
        $limits[] = '250';
        $limits[] = '300';
        $limits[] = '350';
        $limits[] = '400';
        $limits[] = '450';
        $limits[] = '500';
        $limits[] = '600';
        $limits[] = '700';
        $limits[] = '800';
        $limits[] = '900';
        $limits[] = '1000';
        $limits[] = '1500';
        $limits[] = '2000';
        $limits[] = '2500';
        $limits[] = '3000';
        $limits[] = '3500';
        foreach ($limits as $limit) {
            $limit_search_result_selectbox .= '<option value="' . $limit . '"' . ($limit == $that->get['limit'] ? ' selected="selected"' : '') . '>' . $limit . '</option>';
        }
        $limit_search_result_selectbox .= '</select>';
        $queryData = array();
        $queryData['where'] = array();
        if (count($that->searchKeywords)) {
            $keywordOr = array();
            $that->searchMode = '%keyword%';
            foreach ($that->searchKeywords as $searchKeyword) {
                if ($searchKeyword) {
                    switch ($that->searchMode) {
                        case 'keyword%':
                            $that->sqlKeyword = addslashes($searchKeyword) . '%';
                            break;
                        case '%keyword%':
                        default:
                            $that->sqlKeyword = '%' . addslashes($searchKeyword) . '%';
                            break;
                    }
                    if (is_array($params['query']['keywordSearchByColumns']) && count($params['query']['keywordSearchByColumns'])) {
                        foreach ($params['query']['keywordSearchByColumns'] as $col) {
                            $keywordOr[] = $col . " like '" . $that->sqlKeyword . "'";
                        }
                    }
                }
            }
            if (is_array($keywordOr) && count($keywordOr)) {
                $queryData['where'][] = "(" . implode(" OR ", $keywordOr) . ")";
            }
        }
        if ($params['query']['where']) {
            if (is_array($params['query']['where'])) {
                $queryData['where'] = array_merge(array_values($queryData['where']), array_values($params['query']['where']));
            } else {
                $queryData['where'][] = $params['query']['where'];
            }
        }
        switch ($that->get['tx_multishop_pi1']['order_by']) {
            default:
                if (is_array($params['query']['defaultOrderByColumns']) && count($params['query']['defaultOrderByColumns'])) {
                    $order_by = implode(',', $params['query']['defaultOrderByColumns']);
                }
                break;
        }
        switch ($that->get['tx_multishop_pi1']['order']) {
            case 'a':
                $order = 'asc';
                $order_link = 'd';
                break;
            case 'd':
                $order = 'desc';
                $order_link = 'a';
                break;
            default:
                if ($params['query']['defaultOrder'] == 'asc') {
                    $order = 'asc';
                    $order_link = 'd';
                } else {
                    $order = 'desc';
                    $order_link = 'a';
                }
                break;
        }
        $orderby[] = $order_by . ' ' . $order;
        if (is_array($params['query']['select'])) {
            $queryData['select'] = implode(',', $params['query']['select']);
        } else {
            $queryData['select'] = $params['query']['select'];
        }
        if (is_array($params['query']['from'])) {
            $queryData['from'] = implode(',', $params['query']['from']);
        } else {
            $queryData['from'] = $params['query']['from'];
        }
        if (is_array($params['query']['group_by'])) {
            $queryData['group_by'] = implode(',', $params['query']['group_by']);
        } elseif ($params['query']['group_by']) {
            $queryData['group_by'][] = $params['query']['group_by'];
        }
        if (is_array($params['query']['having'])) {
            $queryData['having'] = $params['query']['having'];
        } elseif ($params['query']['having']) {
            $queryData['having'][] = $params['query']['having'];
        }
        $queryData['order_by'] = $orderby;
        $queryData['limit'] = $that->ms['MODULES']['PAGESET_LIMIT'];
        if (is_numeric($that->get['p'])) {
            $p = $that->get['p'];
        }
        if ($p > 0) {
            $queryData['offset'] = $p * $that->ms['MODULES']['PAGESET_LIMIT'];
        } else {
            $p = 0;
            $queryData['offset'] = 0;
        }
        if ($params['msDebug']) {
            $this->msDebug = 1;
        }
        //$this->msDebug=1;
        //echo print_r($queryData);
        //die();
        $pageset = mslib_fe::getRecordsPageSet($queryData);
        if ($this->msDebug) {
            echo $this->msDebugInfo;
            die;
        }
        if ($params['returnResultsSet']) {
            return $pageset;
        }
        //echo print_r($queryData);
        //die();
        if (count($pageset['dataset'])) {
            $tr_type = 'even';
            if (!$params['settings']['disableForm']) {
                $tableContent .= '<form method="post" action="' . $params['postForm']['actionUrl'] . '" enctype="multipart/form-data">';
            }
            $tableContent .= '<div class="table-responsive">';
            $tableContent .= '<table class="table table-striped table-bordered" id="msAdminTableInterface">';
            $tableContent .= '<tr><thead>';
            if ($params['settings']['enableRowBasedCheckboxSelection']) {
                $headerData = '';
                $headerData .= '
				<script type="text/javascript">
					jQuery(document).ready(function($) {
						$(\'#check_all_1\').click(function(){
							$(\'td > div.checkbox > input:checkbox\').prop(\'checked\', this.checked);
						});
					});
				</script>';
                $GLOBALS['TSFE']->additionalHeaderData[] = $headerData;
                $headerData = '';
                $tableContent .= '
				<th class="cellCheckbox">
					<div class="checkbox checkbox-success checkbox-inline">
					<input type="checkbox" id="check_all_1">
					<label for="check_all_1"></label>
					</div>
				</th>';
            }
            foreach ($params['tableColumns'] as $col => $valArray) {
                $tdClass = array();
                if ($valArray['align']) {
                    $tdClass[] = 'text-' . $valArray['align'];
                }
                if ($valArray['nowrap']) {
                    $tdClass[] = 'cellNoWrap';
                }
                if ($valArray['class']) {
                    $tdClass[] = $valArray['class'];
                }
                $tableContent .= '<th' . (count($tdClass) ? ' class="' . implode(' ', $tdClass) . '"' : '') . '>' . $valArray['title'] . '</th>';
            }
            $tableContent .= '</thead></tr><tbody>';
            $summarize = array();
            $recordCounter = 0;
            foreach ($pageset['dataset'] as $rowKey => $row) {
                $recordCounter++;
                if (!$tr_type or $tr_type == 'even') {
                    $tr_type = 'odd';
                } else {
                    $tr_type = 'even';
                }
                $tableContent .= '<tr class="' . $tr_type . '">';
                if ($params['settings']['enableRowBasedCheckboxSelection'] && $params['settings']['rowBasedCheckboxSelectionKey']) {
                    $headerData = '';
                    $headerData .= '
					<script type="text/javascript">
						jQuery(document).ready(function($) {
							$(\'#check_all_1\').click(function(){
								$(\'td > div.checkbox > input:checkbox\').prop(\'checked\', this.checked);
							});
						});
					</script>';
                    $GLOBALS['TSFE']->additionalHeaderData[] = $headerData;
                    $headerData = '';
                    $tableContent .= '<td class="cellCheckbox">
						<div class="checkbox checkbox-success checkbox-inline">
							<input type="checkbox" name="tx_multishop_pi1[tableOverviewSelection][]" id="tableOverviewSelectionCheckbox_' . $row[$params['settings']['rowBasedCheckboxSelectionKey']] . '" value="' . htmlspecialchars($row[$params['settings']['rowBasedCheckboxSelectionKey']]) . '">
							<label for="tableOverviewSelectionCheckbox_' . $row[$params['settings']['rowBasedCheckboxSelectionKey']] . '"></label>
						</div>
					</td>';
                }
                foreach ($params['tableColumns'] as $col => $valArray) {
                    $originalValue = $row[$col];
                    switch ($valArray['valueType']) {
                        case 'number_format_2_decimals':
                            $row[$col] = round(number_format($row[$col], 2, '.', ''), 2);
                            $summarize[$col] += $row[$col];
                            break;
                        case 'number_format_thousand_seperator':
                            $row[$col] = round(number_format($row[$col], 2, '.', ''), 2);
                            break;
                        case 'recordCounter':
                            $row[$col] = $recordCounter;
                            break;
                        case 'download_invoice':
                            $row[$col] = '<a href="uploads/tx_multishopexactonline/' . $row[$col] . '" target="_blank">' . $row[$col] . '</a>';
                            break;
                        case 'currency':
                            $summarize[$col] += $row[$col];
                            $row[$col] = mslib_fe::amount2Cents($row[$col], 0);
                            break;
                        case 'domain_name':
                            if ($row[$col]) {
                                $row[$col] = '<a href="http://' . $row[$col] . '" target="_blank">' . $row[$col] . '</a>';
                            }
                            break;
                        case 'datetime':
                            if ($row[$col]) {
                                $row[$col] = strftime("%x %X", strtotime($row[$col]));
                            } else {
                                $row[$col] = '';
                            }
                            break;
                        case 'timestamp':
                            if (is_numeric($row[$col]) && $row[$col] > 0) {
                                $row[$col] = strftime("%x %X", $row[$col]);
                            } else {
                                $row[$col] = '';
                            }
                            break;
                        case 'timestamp_to_day_date_time':
                            if (is_numeric($row[$col]) && $row[$col] > 0) {
                                $row[$col] = strftime("%a. %x<br/>%X", $row[$col]);
                            } else {
                                $row[$col] = '';
                            }
                            break;
                        case 'timestamp_to_date':
                            if (is_numeric($row[$col]) && $row[$col] > 0) {
                                $row[$col] = strftime("%x", $row[$col]);
                            } else {
                                $row[$col] = '';
                            }
                            break;
                        case 'form':
                            $content = '<form method="';
                            switch ($valArray['formAction']) {
                                case 'post':
                                    $content .= 'POST';
                                    break;
                                case 'get':
                                default:
                                    $content .= 'GET';
                                    break;
                            }
                            $content .= '" action="' . $valArray['actionUrl'] . '" enctype="multipart/form-data">';
                            if ($valArray['content']) {
                                $content .= $valArray['content'];
                            }
                            if (is_array($valArray['hiddenFields'])) {
                                foreach ($valArray['hiddenFields'] as $hiddenFieldKey => $hiddenFieldVal) {
                                    foreach ($row as $tmpCol => $tmpVal) {
                                        $hiddenFieldVal = str_replace('###' . $tmpCol . '###', $row[$tmpCol], $hiddenFieldVal);
                                    }
                                    $content .= '<input name="' . $hiddenFieldKey . '" type="hidden" value="' . $hiddenFieldVal . '" />';
                                }
                            }
                            $content .= '</form>';
                            $row[$col] = $content;
                            break;
                        case 'content':
                            foreach ($row as $tmpCol => $tmpVal) {
                                $valArray['content'] = str_replace('###' . $tmpCol . '###', $row[$tmpCol], $valArray['content']);
                            }
                            $row[$col] = $valArray['content'];
                            break;
                        case 'products_detail_page_link':
                            $where = '';
                            if ($row['categories_id']) {
                                // get all cats to generate multilevel fake url
                                $level = 0;
                                $cats = mslib_fe::Crumbar($row['categories_id']);
                                $cats = array_reverse($cats);
                                $where = '';
                                if (count($cats) > 0) {
                                    foreach ($cats as $cat) {
                                        $where .= "categories_id[" . $level . "]=" . $cat['id'] . "&";
                                        $level++;
                                    }
                                    $where = substr($where, 0, strlen($where) - 1);
                                    $where .= '&';
                                }
                                // get all cats to generate multilevel fake url eof
                            }
                            $product_detail_link = mslib_fe::typolink($this->conf['products_detail_page_pid'], '&' . $where . '&products_id=' . $row['products_id'] . '&tx_multishop_pi1[page_section]=products_detail', 1);
                            $row[$col] = '<a href="' . $product_detail_link . '" target="_blank">' . htmlspecialchars($row['products_name']) . '</a>';
                            break;
                        case 'boolean':
                            $status_html = '';
                            if (!$row[$col]) {
                                $status_html .= '<span class="admin_status_red" alt="' . $this->pi_getLL('no') . '"></span>';
                            } else {
                                $status_html .= '<span class="admin_status_green" alt="' . $this->pi_getLL('yes') . '"></span>';
                            }
                            $row[$col] = $status_html;
                            break;
                        case 'booleanToggle':
                            $status_html = '';
                            if (!$row[$col]) {
                                $status_html .= '<span class="admin_status_red" alt="' . $this->pi_getLL('disable') . '"></span>';
                                if ($valArray['hrefEnable']) {
                                    foreach ($row as $tmpCol => $tmpVal) {
                                        $valArray['hrefEnable'] = str_replace('###' . $tmpCol . '###', $row[$tmpCol], $valArray['hrefEnable']);
                                    }
                                    $status_html .= '<a href="' . $valArray['hrefEnable'] . '"><span class="admin_status_green disabled" alt="' . $this->pi_getLL('enabled') . '"></span></a>';
                                }
                            } else {
                                if ($valArray['hrefDisable']) {
                                    foreach ($row as $tmpCol => $tmpVal) {
                                        $valArray['hrefDisable'] = str_replace('###' . $tmpCol . '###', $row[$tmpCol], $valArray['hrefDisable']);
                                    }
                                    $status_html .= '<a href="' . $valArray['hrefDisable'] . '"><span class="admin_status_red disabled" alt="' . $this->pi_getLL('disabled') . '"></span></a>';
                                }
                                $status_html .= '<span class="admin_status_green" alt="' . $this->pi_getLL('enable') . '"></span>';
                            }
                            $row[$col] = $status_html;
                            break;
                    }
                    $adjustedValue = $row[$col];
                    if ($valArray['href']) {
                        foreach ($row as $tmpCol => $tmpVal) {
                            $valArray['href'] = str_replace('###' . $tmpCol . '###', $row[$tmpCol], $valArray['href']);
                        }
                        $adjustedValue = '<a ' . ($valArray['hrefNoFollow'] ? ' rel="nofollow"' : '') . ' href="' . $valArray['href'] . '"' . ($valArray['href_target'] ? ' target="' . $valArray['href_target'] . '""' : '') . '>' . $adjustedValue . '</a>';
                    }
                    if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_admin_interface.php']['tableColumnsPreProc'])) {
                        $conf = array('col' => &$col, 'row' => &$row, 'originalValue' => &$originalValue, 'adjustedValue' => &$adjustedValue, 'params' => &$params, 'valArray' => &$valArray, 'summarize' => &$summarize);
                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_admin_interface.php']['tableColumnsPreProc'] as $funcRef) {
                            \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $conf, $that);
                        }
                    }
                    $tdClass = array();
                    if ($valArray['align']) {
                        $tdClass[] = 'text-' . $valArray['align'];
                    }
                    if ($valArray['nowrap']) {
                        $tdClass[] = 'cellNoWrap';
                    }
                    if ($valArray['class']) {
                        $tdClass[] = $valArray['class'];
                    }
                    $tableContent .= '<td' . (count($tdClass) ? ' class="' . implode(' ', $tdClass) . '"' : '') . '>' . $adjustedValue . '</td>';
                }
                $tableContent .= '</tr>';
                if ($params['settings']['returnResultSetAsArray']) {
                    $pageset['dataset'][$rowKey] = $row;
                }
            }
            $tableContent .= '</tbody>';
            if (!$params['settings']['skipSummarize']) {
                // Summarize footer
                $tableContent .= '<tfoot><tr>';
                if ($params['settings']['enableRowBasedCheckboxSelection']) {
                    $tableContent .= '<th></th>';
                }
                foreach ($params['tableColumns'] as $col => $valArray) {
                    switch ($valArray['valueType']) {
                        case 'currency':
                            $row[$col] = mslib_fe::amount2Cents($summarize[$col], 0);
                            break;
                        case 'number_format_2_decimals':
                            $row[$col] = round(number_format($summarize[$col], 2, ',', '.'), 2);
                            break;
                        default:
                            $row[$col] = $valArray['title'];
                            break;
                    }
                    $tdClass = array();
                    if ($valArray['align']) {
                        $tdClass[] = 'text-' . $valArray['align'];
                    }
                    if ($valArray['nowrap']) {
                        $tdClass[] = 'cellNoWrap';
                    }
                    if ($valArray['class']) {
                        $tdClass[] = $valArray['class'];
                    }
                    $tableContent .= '<th' . (count($tdClass) ? ' class="' . implode(' ', $tdClass) . '"' : '') . '>' . $row[$col] . '</th>';
                    // $tableContent.='<th'.($valArray['align'] ? ' class="text-'.$valArray['align'].'"' : '').($valArray['nowrap'] ? ' nowrap' : '').'>'.$row[$col].'</th>';
                }
                $tableContent .= '</tr></tfoot>';
            }
            $tableContent .= '</table>';
            if ($params['settings']['enableActionSelectionForm'] && is_array($params['settings']['tableSelectionActions']) && count($params['settings']['tableSelectionActions'])) {
                $actions = $params['settings']['tableSelectionActions'];
                if (count($actions)) {
                    // custom page hook that can be controlled by third-party plugin eof
                    $action_selectbox .= '<select name="tx_multishop_pi1[action]" id="msAdminTableAction" class="form-control"><option value="">' . htmlspecialchars($this->pi_getLL('choose_action')) . '</option>';
                    foreach ($actions as $key => $value) {
                        $action_selectbox .= '<option value="' . htmlspecialchars($key) . '">' . htmlspecialchars($value) . '</option>';
                    }
                    $action_selectbox .= '</select>';
                    $tableContent .= $action_selectbox;
                }
            }
            if ($params['settings']['contentBelowTable']) {
                $tableContent .= $params['settings']['contentBelowTable'];
            }
            if ($params['settings']['enableActionSelectionForm'] && is_array($params['settings']['tableSelectionActions']) && count($params['settings']['tableSelectionActions'])) {
                $tableContent .= '<div class="form-group">
                    <input class="btn btn-success" type="submit" name="submit" value="' . htmlspecialchars($this->pi_getLL('submit_form')) . '" />
                </div>';
            }
            $tableContent .= '
			</div>
			';
            if (!$params['settings']['disableForm']) {
                $tableContent .= '</form>';
            }
            // pagination
            $paginationMarkup = '';
            if (!$params['settings']['skipPaginationMarkup'] and $pageset['total_rows'] > $that->ms['MODULES']['PAGESET_LIMIT']) {
                $total_pages = ceil($pageset['total_rows'] / $that->ms['MODULES']['PAGESET_LIMIT']);
                require \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('multishop') . 'scripts/admin_pages/includes/admin_pagination.php';
                $paginationMarkup = $tmp;
                $tableContent .= $tmp;
                $tmp = '';
            }
            // pagination eof
        }
        $content = '';
        $content .= '<div class="panel panel-default">';
        $content .= '<div class="panel-heading">';
        if ($params['interfaceTitle']) {
            $interfaceTitle = $params['interfaceTitle'];
        } else {
            $interfaceTitle = $params['title'];
        }
        $content .= '<h3>' . htmlspecialchars($interfaceTitle) . '</h3>';
        if (is_array($params['settings']['headingButtons'])) {
            $content .= '<div class="form-inline">';
            foreach ($params['settings']['headingButtons'] as $headingButton) {
                $content .= '<a href="' . $headingButton['href'] . '" class="' . $headingButton['btn_class'] . '"' . ($headingButton['attributes'] ? ' ' . $headingButton['attributes'] : '') . '><i class="' . $headingButton['fa_class'] . '"></i> ' . htmlspecialchars($headingButton['title']) . '</a> ';
            }
            $content .= '</div>';
        }
        $content .= '</div>';
        $content .= '<div class="panel-body">';
        if (!$params['settings']['skipTabMarkup']) {
            $GLOBALS['TSFE']->additionalHeaderData['msAdminTabJs'] = '<script type="text/javascript">
			jQuery(document).ready(function ($) {
				$(\'.nav-tabs a:first\').tab(\'show\');
			});
			</script>
			';
            $content .= '
				<div id="tab-container">
				<ul class="nav nav-tabs" id="admin_orders" role="tablist">
					<li role="presentation"><a href="#CmsListing" aria-controls="profile" role="tab" data-toggle="tab">' . htmlspecialchars($params['title']) . '</a></li>
				</ul>
				<div class="tab-content">
			';
        }
        $searchForm = '';
        if ($params['settings']['enableKeywordSearch']) {
            $searchForm = '
			<form id="form1" name="form1" method="get" action="index.php">
				<div class="well">
					<div class="row formfield-container-wrapper">
						';
            foreach ($params['searchForm']['hiddenFields'] as $key => $val) {
                $searchForm .= '<input name="' . $key . '" type="hidden" value="' . htmlspecialchars($val) . '" />' . "\n";
            }
            $searchForm .= '
						<div class="col-sm-8 formfield-wrapper">
							<div class="form-inline">
								<label class="control-label">' . $that->pi_getLL('keyword') . '</label>
								<input type="text" name="tx_multishop_pi1[keyword]" class="form-control" value="' . htmlspecialchars($that->get['tx_multishop_pi1']['keyword']) . '" />
								<input type="submit" name="Search" class="btn btn-success" value="' . $that->pi_getLL('search') . '" />
							</div>
						</div>
						<div class="col-sm-4 formfield-wrapper">
							<div class="pull-right form-inline">
								<label class="control-label">' . $that->pi_getLL('limit_number_of_records_to') . '</label>
								' . $limit_search_result_selectbox . '
							</div>
						</div>
					</div>
				</div>
			</form>
			';
            //hook to let other plugins further manipulate the method
            if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/class.tx_mslib_admin_interface.php']['setAdminInterfaceSearchFormPostProc'])) {
                $interfaceKey =& $this->interfaceKey;
                $params_searchform = array('interfaceKey' => &$interfaceKey, 'searchForm' => &$searchForm, 'adminInterfaceParams' => &$params);
                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/class.tx_mslib_admin_interface.php']['setAdminInterfaceSearchFormPostProc'] as $funcRef) {
                    \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params_searchform, $this);
                }
            }
        }
        if (!$params['settings']['skipTabMarkup']) {
            $content .= '
				<div role="tabpanel" id="CmsListing" class="tab-pane">
					' . $searchForm . '
					' . $tableContent . '
				</div>
			</div>
			</div>
			';
        } else {
            $content .= $searchForm . $tableContent;
        }
        if ($params['settings']['skipRecordCount'] || $params['settings']['skipRecordCountWhenZeroResults'] && !$pageset['total_rows']) {
            $skipRecordCount = 1;
        }
        if ($params['settings']['skipTotalCount'] || $params['settings']['skipTotalCountWhenZeroResults'] && !$params['summarizeData']['totalRecordsInTable']) {
            $skipTotalCount = 1;
        }
        if (!$skipRecordCount) {
            $content .= '<p class="text-center">' . $this->pi_getLL('found_records') . ': <strong>' . number_format($pageset['total_rows'], 0, '', '.') . '</strong></p>';
        }
        if (!$skipTotalCount && isset($params['summarizeData']['totalRecordsInTable'])) {
            $content .= '<p class="text-center">' . $this->pi_getLL('total_records_in_database') . ': <strong>' . number_format($params['summarizeData']['totalRecordsInTable'], 0, '', '.') . '</strong></p>';
        }
        if (!$params['settings']['skipFooterMarkup']) {
            $content .= '<hr><div class="clearfix"><a class="btn btn-success msAdminBackToCatalog" href="' . mslib_fe::typolink() . '"><span class="fa-stack"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-arrow-left fa-stack-1x"></i></span> ' . $that->pi_getLL('admin_close_and_go_back_to_catalog') . '</a></div>';
        }
        $content .= '</div>';
        $content .= '</div>';
        if ($params['settings']['returnOnlyWhenRecordsFound'] && !$pageset['total_rows']) {
            //return;
        } else {
            if ($params['settings']['returnResultSetAsArray']) {
                $array = array();
                $array['searchForm'] = $searchForm;
                $array['paginationMarkup'] = $paginationMarkup;
                $array['dataset'] = $pageset['dataset'];
                return $array;
            } else {
                return $content;
            }
        }
    }
<input id="checkbox_paid_orders_only" name="paid_orders_only_py" type="checkbox" value="1" ' . ($this->cookie['paid_orders_only_py'] ? 'checked' : '') . ' /><label for="checkbox_paid_orders_only">' . $this->pi_getLL('show_paid_orders_only') . '</label>
</div>
</div>
</form>
<hr>
<script type="text/javascript" language="JavaScript">
jQuery(document).ready(function($) {
	$(document).on("click", "#checkbox_paid_orders_only", function(e) {
		$("#orders_stats_form").submit();
	});
	$(document).on("click", ".admin_sales_stats_order_status", function() {
		var serial=$(".admin_sales_stats_order_status").serialize();
		if (serial!="") {
			location.href = "' . mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_stats_invoices&tx_multishop_pi1[stats_section]=turnoverPerYear') . '&" + serial;
		} else {
			location.href = "' . mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_stats_invoices&tx_multishop_pi1[stats_section]=turnoverPerYear') . '";
		}
	});
});
</script>
';
$year_total_amount = array();
$year_total_order = array();
for ($yr = $current_year; $yr >= $oldest_year; $yr--) {
    $dates = array();
    for ($i = 1; $i < 13; $i++) {
        $time = strtotime(date($yr . "-" . $i . "-01") . " 00:00:00");
        $dates[strftime("%B %Y", $time)] = date($yr . "-" . "m", $time);
    }
    $total_amount = 0;
    $total_orders_per_year = 0;
Exemple #22
0
	var ultrasearch_categories_id;
	var ultrasearch_exclude_negative_filter_values;
	var ultrasearch_fields=\'' . base64_encode($this->ultrasearch_fields) . '\';';
    if ($this->filterCategoriesFormByCategoriesIdGetParam and is_numeric($this->get['categories_id'])) {
        //$headers.='ultrasearch_categories_id=\''.$this->get['categories_id'].'\';';
        $headers .= 'filterCategoriesFormByCategoriesIdGetParam=\'1\';';
    }
    if ($this->ultrasearch_exclude_negative_filter_values) {
        $headers .= 'ultrasearch_exclude_negative_filter_values=\'1\';';
    }
    $headers .= '// location of the ultrasearch server
	var ultrasearch_resultset_server_path=\'' . mslib_fe::typolink($this->shop_pid . ',2002', '&tx_multishop_pi1[page_section]=ultrasearch_server&manufacturers_id=' . $this->get['manufacturers_id'] . '&categories_id=' . $this->get['categories_id'] . '&ultrasearch_exclude_negative_filter_values=' . $this->ultrasearch_exclude_negative_filter_values . '&filterCategoriesFormByCategoriesIdGetParam=' . $this->filterCategoriesFormByCategoriesIdGetParam, 1) . '\';
	var shipping_costs_overview=false;' . "\n";
    if ($this->ms['MODULES']['DISPLAY_SHIPPING_COSTS_ON_PRODUCTS_LISTING_PAGE']) {
        $headers .= '
		var ultrasearch_shipping_costs_review_url=\'' . mslib_fe::typolink('', 'type=2002&tx_multishop_pi1[page_section]=get_product_shippingcost_overview') . '\';
		var labels_shipping_costs = \'' . $this->pi_getLL('shipping_costs') . '\';
		var labels_product_shipping_and_handling_cost_overview = \'' . $this->pi_getLL('product_shipping_and_handling_cost_overview') . '\';
		var labels_deliver_to = \'' . $this->pi_getLL('deliver_to') . '\';
		var labels_shipping_and_handling_cost_overview = \'' . $this->pi_getLL('shipping_and_handling_cost_overview') . '\';
		var labels_deliver_by = \'' . $this->pi_getLL('deliver_by') . '\';
		var labels_delivery_time=\'' . $this->pi_getLL('admin_delivery_time') . '\';
		var shipping_costs_overview=true;
		' . "\n";
    }
    if ($this->hideHeader) {
        $headers .= 'var ultrasearcch_resultset_header=\'\';';
    } else {
        $cmsDescriptionArray = array();
        if (isset($this->get['manufacturers_id']) && is_numeric($this->get['manufacturers_id'])) {
            $strCms = $GLOBALS['TYPO3_DB']->SELECTquery('m.manufacturers_id, mc.content, mc.content_footer, m.manufacturers_name', 'tx_multishop_manufacturers m, tx_multishop_manufacturers_cms mc', "m.manufacturers_id='" . $this->get['manufacturers_id'] . "' AND m.status=1 and mc.language_id='" . $this->sys_language_uid . "' and m.manufacturers_id=mc.manufacturers_id", '', '', '');
$subpartArray['###HEADER_INVOICES_ACTION###'] = $this->pi_getLL('action');
//
$subpartArray['###PAGINATION###'] = $pagination_listing;
$subpartArray['###INVOICES_LISTING###'] = $invoiceItem;
$subpartArray['###FORM_FIELDS_LISTING_ACTION_BLOCK###'] = $form_fields_listing_block;
//
$subpartArray['###FOOTER_INVOICES_NUMBER###'] = $this->pi_getLL('invoice_number');
$subpartArray['###FOOTER_INVOICES_ORDER_ID###'] = $this->pi_getLL('orders_id');
$subpartArray['###FOOTER_MASTER_SHOP###'] = $master_shop;
$subpartArray['###FOOTER_INVOICES_CUSTOMER###'] = $this->pi_getLL('customers');
$subpartArray['###FOOTER_INVOICES_ORDER_DATE###'] = $this->pi_getLL('order_date');
$subpartArray['###FOOTER_INVOICES_PAYMENT_METHOD###'] = $this->pi_getLL('payment_method');
$subpartArray['###FOOTER_INVOICES_PAYMENT_CONDITION###'] = $this->pi_getLL('payment_condition');
$subpartArray['###FOOTER_INVOICES_AMOUNT###'] = mslib_fe::amount2Cents($totalAmount, 0);
$subpartArray['###FOOTER_INVOICES_DATE_LAST_SENT###'] = $this->pi_getLL('date_last_sent');
$subpartArray['###FOOTER_INVOICES_PAID_STATUS###'] = $this->pi_getLL('admin_paid');
$subpartArray['###FOOTER_INVOICES_ACTION###'] = $this->pi_getLL('action');
$subpartArray['###CUSTOM_MARKER_0_HEADER###'] = '';
$subpartArray['###CUSTOM_MARKER_0_FOOTER###'] = '';
$subpartArray['###CUSTOM_MARKER_1_HEADER###'] = '';
$subpartArray['###CUSTOM_MARKER_1_FOOTER###'] = '';
$subpartArray['###SHOP_PID2###'] = $this->shop_pid;
$subpartArray['###FORM_POST_ACTION_URL###'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_invoices');
// custom page hook that can be controlled by third-party plugin
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/includes/invoices/invoices_listing_table.php']['adminInvoicesListingTmplPreProc'])) {
    $params = array('subpartArray' => &$subpartArray, 'invoice' => &$invoice);
    foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/includes/invoices/invoices_listing_table.php']['adminInvoicesListingTmplPreProc'] as $funcRef) {
        \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
    }
}
$invoices_results = $this->cObj->substituteMarkerArrayCached($subparts['invoices_results'], array(), $subpartArray);
Exemple #24
0
<?php

if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}
$this->box_class = "multishop_basket";
$this->cObj->data['header'] = '<a href="' . mslib_fe::typolink($this->conf['shoppingcart_page_pid'], '&tx_multishop_pi1[page_section]=shopping_cart') . '">' . $this->pi_getLL('basket') . '</a>';
//$cart=$GLOBALS['TSFE']->fe_user->getKey('ses', $this->cart_page_uid);
require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('multishop') . 'pi1/classes/class.tx_mslib_cart.php';
$mslib_cart = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_mslib_cart');
$mslib_cart->init($this);
$cart = $mslib_cart->getCart();
$totalitems = 0;
if (count($cart['products']) > 0) {
    foreach ($cart['products'] as $product) {
        if (is_numeric($product['qty'])) {
            $totalitems = $totalitems + $product['qty'];
        }
    }
}
$content .= '
<a href="' . mslib_fe::typolink($this->conf['shoppingcart_page_pid'], '&tx_multishop_pi1[page_section]=shopping_cart') . '" class="multishop_basketbox"><span>' . $totalitems . '</span></a>
';
Exemple #25
0
								shipping_cost_popup+=\'</div>\';
								//modalBox.find(\'.modal-title\').html(' . $this->pi_getLL('product_shipping_and_handling_cost_overview') . ');
								modalBox.find(\'.modal-body\').empty();
								modalBox.find(\'.modal-body\').html(shipping_cost_popup);
								//msDialog("' . $this->pi_getLL('shipping_costs') . '", shipping_cost_popup, 650);
							}
						}
					});
				}
			});

			/*$(document).on("click", ".show_shipping_cost_table", function(e) {
				e.preventDefault();
				var pid=jQuery(this).attr("rel");
				jQuery.ajax({
					url: \'' . mslib_fe::typolink('', 'type=2002&tx_multishop_pi1[page_section]=get_product_shippingcost_overview') . '\',
					data: \'tx_multishop_pi1[pid]=\' + pid + \'&tx_multishop_pi1[qty]=1\',
					type: \'post\',
					dataType: \'json\',
					success: function (j) {
						if (j) {
							var shipping_cost_popup=\'<div class="product_shippingcost_popup_wrapper">\';
							shipping_cost_popup+=\'<div class="product_shippingcost_popup_header">' . $this->pi_getLL('product_shipping_and_handling_cost_overview') . '</div>\';
							shipping_cost_popup+=\'<div class="product_shippingcost_popup_table_wrapper">\';
							shipping_cost_popup+=\'<table id="product_shippingcost_popup_table">\';
							shipping_cost_popup+=\'<tr>\';
							shipping_cost_popup+=\'<td colspan="3" class="product_shippingcost_popup_table_product_name">\' + j.products_name + \'</td>\';
							shipping_cost_popup+=\'</tr>\';
							shipping_cost_popup+=\'<tr>\';
							shipping_cost_popup+=\'<td class="product_shippingcost_popup_table_left_col">' . $this->pi_getLL('deliver_in') . '</td>\';
							shipping_cost_popup+=\'<td class="product_shippingcost_popup_table_center_col">' . $this->pi_getLL('shipping_and_handling_cost_overview') . '</td>\';
				} else {
					$("#crop_save_btn_wrapper").show();
					$("#crop_restore_btn_wrapper").hide();
					$("#minsize_settings_btn_wrapper").show();
					$("#remove_minsize").prop("checked", true);
					$("#aspectratio_settings_btn_wrapper").show();
					$("#remove_aspectratio").prop("checked", true);
					activate_jcrop_js(r.aspectratio[$("#jCropImageSize").val()], r.minsize[$("#jCropImageSize").val()], r.setselect[$("#jCropImageSize").val()], r.truesize[$("#jCropImageSize").val()]);
				}
			}
		}
	});
});
$(document).on(\'click\',"#crop_restore",function(e) {
	e.preventDefault();
	href = "' . mslib_fe::typolink($this->shop_pid . ',2002', 'tx_multishop_pi1[page_section]=restore_crop_image&tx_multishop_pi1[crop_section]=categories') . '";
	var cropall=0;
	if ($("#onecrop_for_all").prop("checked")) {
		cropall=1;
	}
	jQuery.ajax({
		type:"POST",
		url:href,
		data: $(".jcrop_coords").serialize() + "cid=' . (isset($this->get['cid']) && $this->get['cid'] > 0 ? $this->get['cid'] : '') . '",
		dataType: "json",
		success: function(r) {
			//do something with the sorted data
			if (r.status=="OK") {
				var new_image=\'<img src="\' + r.images[$("#jCropImageSize").val()] + \'" id="cropbox"/>\';
				$("#jCropX").val("");
				$("#jCropY").val("");
     $subpartArray['###FOOTER_BUTTON_SAVE_AS_NEW###'] = '<button name="save_as_new" type="submit" value="" class="btn btn-primary submit save_as_new"><span class="fa-stack"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-floppy-o fa-stack-1x"></i></span> ' . $this->pi_getLL('admin_save_as_new') . '</button>';
 } else {
     $subpartArray['###BUTTON_SAVE_AS_NEW###'] = '';
     $subpartArray['###FOOTER_BUTTON_SAVE_AS_NEW###'] = '';
 }
 $subpartArray['###FOOTER_VALUE_ADVANCED_OPTION###'] = $_COOKIE['hide_advanced_options'] == 1 ? $this->pi_getLL('admin_show_options') : $this->pi_getLL('admin_hide_options');
 $subpartArray['###FOOTER_LABEL_BUTTON_CANCEL###'] = $this->pi_getLL('admin_cancel');
 if ($this->get['action'] == 'edit_product') {
     $subpartArray['###FOOTER_LABEL_BUTTON_SAVE###'] = $this->pi_getLL('update');
     $subpartArray['###FOOTER_LABEL_BUTTON_SAVE_CLOSE###'] = $this->pi_getLL('admin_update_close');
 } else {
     $subpartArray['###FOOTER_LABEL_BUTTON_SAVE###'] = $this->pi_getLL('admin_save');
     $subpartArray['###FOOTER_LABEL_BUTTON_SAVE_CLOSE###'] = $this->pi_getLL('admin_save_close');
 }
 $subpartArray['###PRODUCT_PID###'] = $product['products_id'];
 $subpartArray['###FORM_ACTION_URL###'] = mslib_fe::typolink($this->shop_pid . ',2003', '&tx_multishop_pi1[page_section]=' . $_REQUEST['action'] . '&pid=' . $this->get['pid'] . "&cid=" . $this->get['cid'] . "&action=edit_product");
 if ($_COOKIE['hide_advanced_options'] == 1) {
     $subpartArray['###JS_ADVANCED_OPTION_TOGGLE###'] = '$(".toggle_advanced_option").hide();' . "\n";
 } else {
     $subpartArray['###JS_ADVANCED_OPTION_TOGGLE###'] = '$(".toggle_advanced_option").show();' . "\n";
 }
 $subpartArray['###LABEL_HEADING_EDIT_PRODUCT###'] = $heading_page;
 $subpartArray['###LABEL_PRODUCT_STATUS###'] = $this->pi_getLL('admin_visible');
 $subpartArray['###LABEL_PRODUCT_STATUS_ON_CHECKED###'] = ($product['products_status'] or $_REQUEST['action'] == 'add_product') ? 'checked="checked"' : '';
 $subpartArray['###LABEL_ADMIN_YES###'] = $this->pi_getLL('admin_yes');
 $subpartArray['###LABEL_PRODUCT_STATUS_OFF_CHECKED###'] = (!$product['products_status'] and $_REQUEST['action'] == 'edit_product') ? 'checked="checked"' : '';
 $subpartArray['###LABEL_ADMIN_NO###'] = $this->pi_getLL('admin_no');
 $subpartArray['###LABEL_PRODUCT_SEARCH_ENGINE_INDEXING###'] = $this->pi_getLL('search_engine_indexing');
 $subpartArray['###LABEL_PRODUCT_SEARCH_ENGINE_INDEXING_ON_CHECKED###'] = ($product['search_engines_allow_indexing'] or $_REQUEST['action'] == 'add_product') ? 'checked="checked"' : '';
 $subpartArray['###LABEL_ADMIN_YES_INDEXING###'] = $this->pi_getLL('admin_yes');
 $subpartArray['###LABEL_PRODUCT_SEARCH_ENGINE_INDEXING_OFF_CHECKED###'] = (!$product['search_engines_allow_indexing'] and $_REQUEST['action'] == 'edit_product') ? 'checked="checked"' : '';
        foreach ($unused_values as $unused_value_id) {
            $have_povp_record = false;
            $have_pa_record = false;
            //
            $sql_chk = $GLOBALS['TYPO3_DB']->SELECTquery('products_options_values_id', 'tx_multishop_products_options_values_to_products_options', "products_options_values_id = '" . $unused_value_id . "'", '', '', '');
            $qry_chk = $GLOBALS['TYPO3_DB']->sql_query($sql_chk);
            if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry_chk) > 0) {
                $have_povp_record = true;
            }
            //
            $sql_chk = $GLOBALS['TYPO3_DB']->SELECTquery('options_values_id', 'tx_multishop_products_attributes', "options_values_id = '" . $unused_value_id . "' and page_uid='" . $this->showCatalogFromPage . "'", '', '', '');
            $qry_chk = $GLOBALS['TYPO3_DB']->sql_query($sql_chk);
            if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry_chk) > 0) {
                $have_pa_record = true;
            }
            if (!$have_povp_record && !$have_pa_record) {
                $query = $GLOBALS['TYPO3_DB']->DELETEquery('tx_multishop_products_options_values', 'products_options_values_id=' . $unused_value_id);
                $res = $GLOBALS['TYPO3_DB']->sql_query($query);
            }
        }
        // delete double record
        $delete_qry = "DELETE povp1 FROM tx_multishop_products_options_values_to_products_options povp1, tx_multishop_products_options_values_to_products_options povp2 WHERE povp1.products_options_values_to_products_options_id > povp2.products_options_values_to_products_options_id AND povp1.products_options_id = povp2.products_options_id AND povp1.products_options_values_id = povp2.products_options_values_id";
        $GLOBALS['TYPO3_DB']->sql_query($delete_qry);
        //
        $delete_qry = "DELETE pa1 FROM tx_multishop_products_attributes pa1, tx_multishop_products_attributes pa2 WHERE pa1.products_attributes_id > pa2.products_attributes_id AND pa1.products_id = pa2.products_id AND pa1.options_id = pa2.options_id AND pa1.options_values_id = pa2.options_values_id";
        $GLOBALS['TYPO3_DB']->sql_query($delete_qry);
    }
    //
    header('Location: ' . $this->FULL_HTTP_URL . mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=merge_attribute_options_values'));
    exit;
}
		<div class="panel-body">
			<form action="' . mslib_fe::typolink($this->shop_pid . ',2003', '&tx_multishop_pi1[page_section]=admin_customer_import&upload=task') . '" method="post" enctype="multipart/form-data" name="upload_task" id="upload_task" class="form-horizontal blockSubmitForm">
				<div class="form-group">
					<label for="new_cron_name" class="control-label col-md-2">' . $this->pi_getLL('name') . '</label>
					<div class="col-md-10">
					<input name="new_cron_name" type="text" value="" class="form-control" >
					</div>
				</div>
				<div class="form-group">
					<label for="new_prefix_source_name" class="control-label col-md-2">' . $this->pi_getLL('source_name') . '</label>
					<div class="col-md-10">
					<input name="new_prefix_source_name" type="text" value="" class="form-control" />
					</div>
				</div>
				<div class="form-group">
					<label for="upload_task_file" class="control-label col-md-2">' . $this->pi_getLL('file') . '</label>
					<div class="col-md-10">
					<input type="file" name="task_file" class="form-control">
					</div>
				</div>
				<div class="form-group">
					<div class="col-md-10 col-md-offset-2">
					<input type="submit" name="upload_task_file" class="submit btn btn-success" id="upload_task_file" value="upload">
					</div>
			</form>
			</div>
		</div></div>';
    }
}
$content .= '<hr><div class="clearfix"><a class="btn btn-success msAdminBackToCatalog" href="' . mslib_fe::typolink() . '"><span class="fa-stack"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-arrow-left fa-stack-1x"></i></span> ' . $this->pi_getLL('admin_close_and_go_back_to_catalog') . '</a></div></div>';
$content = '<div class="panel panel-default">' . mslib_fe::shadowBox($content) . '</div>';
			placement: \'bottom\',
			html: true,
			trigger:"hover",
			delay: {show: 20, hide: 200}
		});
		var tooltip_is_shown=\'\';
		$(\'.popover-link\').on(\'show.bs.popover, mouseover\', function () {
			var that=$(this);
			//$(".popover").remove();
			//$(".popover-link").popover(\'hide\');
			var orders_id=$(this).attr(\'rel\');
			//if (tooltip_is_shown != orders_id) {
				tooltip_is_shown=orders_id;
				$.ajax({
					type:   "POST",
					url:    \'' . mslib_fe::typolink($this->shop_pid . ',2002', '&tx_multishop_pi1[page_section]=getAdminOrdersListingDetails&') . '\',
					data:   \'tx_multishop_pi1[orders_id]=\'+orders_id,
					dataType: "json",
					success: function(data) {
            			if (data.content!="") {
            				that.next().html(\'<div class="arrow"></div>\' + data.title + data.content);
            				//that.next().popover("show");
            				//$(that).popover(\'show\');
            			} else {
            				$(".popover").remove();
            			}
					}
				});
			//}
		});
		$(\'#check_all_1\').click(function(){