/* Decoded by unphp.net */ ?> isStarted('sefu') && ((substr($page,0,7) != 'http://') && substr($page,0,8) != 'https://')) { $use_full_address = true; } if(((basename($page) == FILENAME_CHECKOUT || basename($page) == FILENAME_ACCOUNT) || $connection=='SSL') && (ENABLE_SSL === true)){ if ($request_type == 'SSL') { $link = ($use_full_address === false) ? '' : HTTPS_SERVER . DIR_WS_STORE_SSL; } else { $link = HTTPS_SERVER . DIR_WS_STORE_SSL; } } elseif($connection=='AUTO'){ if ( ($request_type == 'SSL') && (ENABLE_SSL === true) && ($page == null)) { $link = HTTPS_SERVER . DIR_WS_STORE_SSL; } else { $link = HTTP_SERVER . DIR_WS_STORE; } } else { if ($request_type == 'NONSSL') { $link = ($use_full_address === false) ? '' : HTTP_SERVER . DIR_WS_STORE; } else { $link = HTTP_SERVER . DIR_WS_STORE; } } $link .= $page; if (!empty($parameters)) { $link .= '?' . mxp_output_string($parameters); $separator = '&'; } else { $separator = '?'; } while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) { $link = substr($link, 0, -1); } // Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined if ( ($add_session_id === true) && $MxpSession->hasStarted() && (SERVICE_SESSION_FORCE_COOKIE_USAGE == '-1') ) { if (!mxp_empty(SID)) { $_sid = SID; } elseif ( (($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL === true)) || (($request_type == 'SSL') && ($connection != 'SSL')) ) { if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) { $_sid = $MxpSession->getName() . '=' . $MxpSession->getID(); } } } if (isset($_sid)) { $link .= $separator . mxp_output_string($_sid); } while (strstr($link, '&&')) { $link = str_replace('&&', '&', $link); } if ( ($search_engine_safe === true) && isset($MxpServices) && $MxpServices->isStarted('sefu')) { $link = str_replace(array('?', '&', '='), array('/', '/', ','), $link); } else { if (strpos($link, '&') !== false) { $link = str_replace('&', '&', $link); } } return $link; } function mxp_link_object($link, $object, $parameters = null, $new_window = true) { if(defined('MXP_IN_ADMIN') && MXP_IN_ADMIN && isset($_SESSION['admin']) && MxpAdministration_Templates::getTemplateWindow($_SESSION['admin']['id']) && $new_window){ return '' . $object . ''; } if(defined('MXP_IN_ADMIN') && MXP_IN_ADMIN && isset($_SESSION['admin']) && MxpAdministration_Templates::getTemplateWindow($_SESSION['admin']['id'])){ return '' . $object . ''; } else{ return '' . $object . ''; } } function mxp_icon($image, $title = null, $group = null, $parameters = null, $deep_image = null, $type_image= 'png', $force_type=false) { global $MxpLanguage, $MxpTemplate; if($type_image == 'gif')$type_image = 'png'; if ( is_null($title) ) { $title = $MxpLanguage->get('icon_' . substr($image, 0, strpos($image, '.'))); } if($type_image=='png' && (((int)$group==64 || (int)$group==72) || (defined('MXP_IN_ADMIN') && MXP_IN_ADMIN))){ if($group == null){ $group = '16'; } if((int)$group <= 32 && $deep_image == null){ $deep_image = 'hot'; } if($deep_image == null){ $deep_image = 'normal'; } $src = HTTP_MAXPHO_SERVER . 'icons/png/' . $deep_image . '/' . $group . '/' . $image . '_' . $group . '.png'; } elseif ( (!defined('MXP_IN_ADMIN')) && $force_type ) { if($group == null){ $group = '16'; } $src = HTTP_MAXPHO_SERVER . 'icons/' . $type_image . '/normal' . '/' . $group . '/' . $image . '_' . $group . '.' . $type_image; } elseif ( (!defined('MXP_IN_ADMIN')) ) { if($group == null){ $group = '16'; } $src = HTTP_MAXPHO_SERVER . 'icons/png/normal' . '/' . $group . '/' . $image . '_' . $group . '.png'; } else{ $src = HTTP_MAXPHO_SERVER . 'icons/png/' . $image . '.png'; } $image = ''; return $image; //return mxp_image('templates/' . $MxpTemplate->getCode() . '/images/icons/' . (!empty($group) ? $group . '/' : null) . $image, $title, null, null, $parameters); } function mxp_icon_raw($image, $group = '16', $type_image = 'normal', $ext_image = 'png') { global $MxpTemplate; if($ext_image == 'gif')$ext_image = 'png'; //return 'templates/' . $MxpTemplate->getCode() . '/images/icons/' . (!empty($group) ? $group . '/' : null) . $image; if($ext_image === 'png') return HTTP_MAXPHO_SERVER . 'icons/png/' . $type_image . '/' . $group . '/' . $image . '_' . $group . '.'.$ext_image; return HTTP_MAXPHO_SERVER . 'icons/gif/' . $image . '.'.$ext_image; } function mxp_image($image, $title = null, $width = 0, $height = 0, $parameters = null) { global $request_type; if ( (empty($image) || ($image == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == '-1') ) { return false; } if (!is_numeric($width)) { $width = 0; } if (!is_numeric($height)) { $height = 0; } //the follow function check if $image is now present in https, if yes do nothing, else copy it. $image = mxp_check_ssl_image($image); $image = '' . mxp_output_string($title) . ' 0) { $image .= ' width="' . (int)$width . '"'; } if ($height > 0) { $image .= ' height="' . (int)$height . '"'; } if (!empty($parameters)) { $image .= ' ' . $parameters; } $image .= ' />'; return $image; } function mxp_draw_image_submit_button($image, $title = null, $parameters = null, $onclick=null) { global $MxpLanguage, $niceforms; //$image_submit = '' . mxp_image(DIR_WS_IMAGES . 'forms/images/'.$niceforms.'/button_right.png', null, null, null, 'class="buttonImg"'); return $image_submit; } function mxp_draw_image_button($image, $title = null, $parameters = null, $destination_form = null, $type='submit', $events='') { global $MxpLanguage, $niceforms; $result = ($destination_form != null)? (mxp_draw_form($title, $destination_form, 'get')) : ''; $result .= mxp_image(DIR_WS_IMAGES . 'forms/images/'.$niceforms.'/button_left.png', null, null, null, 'class="buttonImg"') . '' . mxp_image(DIR_WS_IMAGES . 'forms/images/'.$niceforms.'/button_right.png', null, null, null, 'class="buttonImg"'); $result .= ($destination_form != null)? '' : ''; return $result; } function mxp_draw_input_field( $name, $value = null, $parameters = null, $override = true, $type = 'text', $rand = '' ) { global $niceforms; if ( !is_bool($override) ) { $override = true; } if ( $override===true ) { if ( strpos($name, '[') !== false ) { $name_string = substr($name, 0, strpos($name, '[')); $name_key = substr($name, strpos($name, '[') + 1, strlen($name) - (strpos($name, '[') + 2)); if ( isset($_GET[$name_string][$name_key]) ) { $value = $_GET[$name_string][$name_key]; } elseif ( isset($_POST[$name_string][$name_key]) ) { $value = $_POST[$name_string][$name_key]; } } else { if ( isset($_GET[$name]) ) { $value = $_GET[$name]; } elseif ( isset($_POST[$name]) ) { $value = $_POST[$name]; } } } if (!in_array($type, array('text', 'password', 'file'))) { $type = 'text'; } if(!defined('MXP_IN_ADMIN') && isset($niceforms) && $niceforms!="" && $type!="file"){ $field = mxp_image(DIR_WS_IMAGES . 'forms/images/'.$niceforms.'/input_left.png', null, null, null, 'class="inputCorner"') . 'get('maximum_file_upload_size')), mxp_output_string($upload_max_filesize)); } } return $field; } function mxp_draw_selection_field($name, $type, $values, $default = null, $parameters = null, $separator = '  ') { if (!is_array($values)) { $values = array($values); } if ( strpos($name, '[') !== false ) { $name_string = substr($name, 0, strpos($name, '[')); if ( isset($_GET[$name_string]) ) { $default = $_GET[$name_string]; } elseif ( isset($_POST[$name_string]) ) { $default = $_POST[$name_string]; } } else { if ( isset($_GET[$name]) ) { $default = $_GET[$name]; } elseif ( isset($_POST[$name]) ) { $default = $_POST[$name]; } } $field = ''; $counter = 0; foreach ($values as $key => $value) { $counter++; if (is_array($value)) { $selection_value = $value['id']; $selection_text = ' ' . $value['text']; } else { $selection_value = $value; $selection_text = ''; } $field .= ' 1 ? $counter : '') . '" class="fieldLabel">' . $selection_text . ''; } $field .= $separator; } if (!empty($field)) { $field = substr($field, 0, strlen($field)-strlen($separator)); } return $field; } function mxp_draw_selection_field_2nd($name, $type, $values, $default = null, $parameters = null, $separator = '  ') { if (!is_array($values)) { $values = array($values); } if ( strpos($name, '[') !== false ) { $name_string = substr($name, 0, strpos($name, '[')); if ( isset($_GET[$name_string]) ) { $default = $_GET[$name_string]; } elseif ( isset($_POST[$name_string]) ) { $default = $_POST[$name_string]; } } else { if ( isset($_GET[$name]) ) { $default = $_GET[$name]; } elseif ( isset($_POST[$name]) ) { $default = $_POST[$name]; } } $field = ''; $counter = 0; foreach ($values as $key => $value) { $counter++; if (is_array($value)) { $selection_value = $value['id']; $selection_text = ' ' . $value['text']; } else { $selection_value = $value; $selection_text = ''; } if (!empty($selection_text)) { $field .= '
'; } $field .= '
'; return $field; } function mxp_draw_hidden_field($name, $value = null, $parameters = null) { $field = 'hasStarted() && !mxp_empty(SID)) { return mxp_draw_hidden_field($MxpSession->getName(), $MxpSession->getID()); } } function mxp_draw_pull_down_menu($name, $values, $default = null, $parameters = null, $onChangePath = null, $show_key = true) { $group = false; if($default == null){ if (isset($_GET[$name])) { $default = $_GET[$name]; } elseif (isset($_POST[$name])) { $default = $_POST[$name]; } elseif (isset($_SESSION[$name])){ $default = $_SESSION[$name]; } } $field = ''; return $field; } function mxp_draw_label($text, $for, $access_key = null, $required = false, $parameters='') { if (!is_bool($required)) { $required = false; } return ''; } function mxp_draw_date_pull_down_menu($name, $value = null, $default_today = true, $show_days = true, $use_month_names = true, $year_range_start = 0, $year_range_end = 1) { $year = date('Y'); if (!is_bool($default_today)) { $default_today = true; } if (!is_bool($show_days)) { $show_days = true; } if (!is_bool($use_month_names)) { $use_month_names = true; } if (!is_numeric($year_range_start)) { $year_range_start = 0; } if (!is_numeric($year_range_end)) { $year_range_end = 1; } if (!is_array($value)) { $value = array(); } if (!isset($value['year']) || !is_numeric($value['year']) || ($value['year'] < ($year - $year_range_start)) || ($value['year'] > ($year + $year_range_end))) { if ($default_today === true) { $value['year'] = $year; } else { $value['year'] = $year - $year_range_start; } } if (!isset($value['month']) || !is_numeric($value['month']) || ($value['month'] < 1) || ($value['month'] > 12)) { if ($default_today === true) { $value['month'] = date('n'); } else { $value['month'] = 1; } } if (!isset($value['date']) || !is_numeric($value['date']) || ($value['date'] < 1) || ($value['date'] > 31)) { if ($default_today === true) { $value['date'] = date('j'); } else { $value['date'] = 1; } } $params = ''; $days_select_string = ''; if ($show_days === true) { $params = 'onchange="updateDatePullDownMenu(this.form, \'' . $name . '\');"'; $days_in_month = ($default_today === true) ? date('t') : 31; $days_array = array(); for ($i=1; $i<=$days_in_month; $i++) { $days_array[] = array('id' => $i, 'text' => $i); } $days_select_string = mxp_draw_pull_down_menu($name . '_days', $days_array, $value['date']); } $months_array = array(); for ($i=1; $i<=12; $i++) { $months_array[] = array('id' => $i, 'text' => (($use_month_names === true) ? strftime('%B', mktime(0, 0, 0, $i, 1)) : $i)); } $months_select_string = mxp_draw_pull_down_menu($name . '_months', $months_array, $value['month'], $params); $years_array = array(); for ($i = ($year - $year_range_start); $i <= ($year + $year_range_end); $i++) { $years_array[] = array('id' => $i, 'text' => $i); } $years_select_string = mxp_draw_pull_down_menu($name . '_years', $years_array, $value['year'], $params); return $days_select_string . $months_select_string . $years_select_string; } function mxp_draw_form($name, $action=null, $method='post', $parameter = ''){ $action = $action==null ? 'javascript: void(0);' : $action; $form_output = '
'; } function mxp_draw_languages($type = '', $page=null){ global $MxpSession, $MxpLanguage; $concat = (mxp_get_all_get_params(array('language')) == '') ? '' : '&'; $action = mxp_href_link(basename($_SERVER['SCRIPT_FILENAME']), mxp_get_all_get_params(array('language')) , 'AUTO'); $data = array(); $content = ''; if(count($MxpLanguage->getAll())>1){ foreach ($MxpLanguage->getAll() as $value) { if(defined('GROUP') && GROUP=='products'){ if (empty($_GET) === false) { $first_array = array_slice($_GET, 0, 1); $product_keyword = mxp_sanitize_string(basename(key($first_array))); if (!mxp_file_exists('includes/content/' . GROUP . '/' . $product_keyword . '.php')) { $product_keyword_language = mxp_product_keyword_language($product_keyword, $value['id']); $all_parameters = $product_keyword_language."&".mxp_get_all_get_params(array('language', $product_keyword)); } } } $_session_id = ''; if ($MxpSession->hasStarted() && !mxp_empty(SID)) { $_session_id = '&sid='.$MxpSession->getID(); } if(!isset($all_parameters)){ $all_parameters = mxp_get_all_get_params(array('language')); } if($page=='admin_login'){ $language_link = HTTP_SERVER.DIR_WS_ADMIN.FILENAME_LOGIN.'?'.$all_parameters.$concat.'language=' . $value['code'].$_session_id; }else{ //$language_link = mxp_href_link(mxp_get_page_language($value['code']), $all_parameters.$concat.'language=' . $value['code'].$_session_id, 'AUTO', false); $language_link = mxp_href_link(mxp_get_page_language($value['code']), $all_parameters.$concat.$_session_id, 'AUTO', false); } if($type == 'select'){ if($value['code'] == $_SESSION['language']){ $default = $language_link; } $data[] = array('id' => $language_link, 'text' => $value['name']); }else{ $content .= mxp_link_object($language_link, $MxpLanguage->showImage($value['code'])) . '   '; } } } if($type == 'select'){ if (sizeof($data) > 1) { $content = mxp_draw_form('languages', $action, 'get'). mxp_draw_pull_down_menu('language', $data, $default, null, '-1') . mxp_draw_hidden_session_id_field() . '
'; } } return $content; } function mxp_draw_orders(){ global $MxpLanguage; $column_list = array(); $define_list = array( /*'PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,*/ 'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE, 'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME, /*'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,*/ /*'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,*/ /*'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,*/ /*'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,*/ /*'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW*/ ); reset($define_list); //porto il puntatore all'inizio while (list($key, $value) = each($define_list)) { if ($value > 0) $column_list[] = $key; } $action = mxp_href_link(basename($_SERVER['SCRIPT_FILENAME']), mxp_get_all_get_params(array('page', 'sort'))); $result = '

' . mxp_draw_form('orders', $action , 'get'); $data = array(); for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { $lc_key = false; $lc_align = ''; switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': $lc_text = $MxpLanguage->get('listing_model_heading'); $lc_key = 'model'; break; case 'PRODUCT_LIST_NAME': $lc_text = $MxpLanguage->get('listing_name_heading'); $lc_key = 'name'; break; case 'PRODUCT_LIST_MANUFACTURER': $lc_text = $MxpLanguage->get('listing_manufacturer_heading'); $lc_key = 'manufacturer'; break; case 'PRODUCT_LIST_PRICE': $lc_text = $MxpLanguage->get('listing_price_heading'); $lc_key = 'price'; $lc_align = 'right'; break; case 'PRODUCT_LIST_QUANTITY': $lc_text = $MxpLanguage->get('listing_quantity_heading'); $lc_key = 'quantity'; $lc_align = 'right'; break; case 'PRODUCT_LIST_WEIGHT': $lc_text = $MxpLanguage->get('listing_weight_heading'); $lc_key = 'weight'; $lc_align = 'right'; break; case 'PRODUCT_LIST_IMAGE': $lc_text = $MxpLanguage->get('listing_image_heading'); $lc_align = 'center'; break; case 'PRODUCT_LIST_BUY_NOW': $lc_text = $MxpLanguage->get('listing_buy_now_heading'); $lc_align = 'center'; break; } //print the option value to search if ($lc_key !== false) { $data[] = array('id'=>$lc_key.'|d', 'text'=>sprintf($MxpLanguage->get('listing_sort_descendingly'), mb_convert_case($lc_text, MB_CASE_LOWER, 'UTF-8'))); $data[] = array('id'=>$lc_key, 'text'=>sprintf($MxpLanguage->get('listing_sort_ascendingly'), mb_convert_case($lc_text, MB_CASE_LOWER, 'UTF-8'))); } } $result.= mxp_draw_pull_down_menu('sort', $data, ((isset($_GET['sort']))? $_GET['sort'] : $data[3]['id']), null, $action) . mxp_draw_hidden_session_id_field() . '

'; return $result; } function mxp_draw_currency($param=null){ global $MxpSession, $MxpCurrencies; $content = ''; $data = array(); foreach ($MxpCurrencies->currencies as $key => $value) { $data[] = array('id' => $key, 'text' => $value['title']); } if (sizeof($data) > 1) { $hidden_get_variables = ''; foreach ($_GET as $key => $value) { if ( ($key != 'currency') && ($key != $MxpSession->getName()) && ($key != 'x') && ($key != 'y') ) { $hidden_get_variables .= mxp_draw_hidden_field($key, $value); } } $action = mxp_href_link(basename($_SERVER['SCRIPT_FILENAME']), mxp_get_all_get_params(array('currency')), 'AUTO'); $content = mxp_draw_form('currencies', $action, 'get') . $hidden_get_variables . mxp_draw_pull_down_menu('currency', $data, $_SESSION['currency'], $param, $action) . mxp_draw_hidden_session_id_field() . ''; } unset($hidden_get_variables); return $content; } ?>