function display_links($query_numrows, $max_rows_per_page, $max_page_links, $current_page_number, $parameters = '', $page_name = 'page')
 {
     if (xos_not_null($parameters) && substr($parameters, -1) != '&') {
         $parameters .= '&';
     }
     // calculate number of pages needing links
     $num_pages = ceil($query_numrows / $max_rows_per_page);
     $pages_array = array();
     for ($i = 1; $i <= $num_pages; $i++) {
         $pages_array[] = array('id' => $i, 'text' => $i);
     }
     if ($num_pages > 1) {
         $display_links = xos_draw_form('pages', basename($_SERVER['PHP_SELF']), '', 'get');
         if ($current_page_number > 1) {
             $display_links .= '<a href="' . xos_href_link(basename($_SERVER['PHP_SELF']), $parameters . $page_name . '=' . ($current_page_number - 1)) . '" class="splitPageLink">' . PREVNEXT_BUTTON_PREV . '</a>&nbsp;&nbsp;';
         } else {
             $display_links .= PREVNEXT_BUTTON_PREV . '&nbsp;&nbsp;';
         }
         $display_links .= sprintf(TEXT_RESULT_PAGE, xos_draw_pull_down_menu($page_name, $pages_array, $current_page_number, 'onchange="this.form.submit();"'), $num_pages);
         if ($current_page_number < $num_pages && $num_pages != 1) {
             $display_links .= '&nbsp;&nbsp;<a href="' . xos_href_link(basename($_SERVER['PHP_SELF']), $parameters . $page_name . '=' . ($current_page_number + 1)) . '" class="splitPageLink">' . PREVNEXT_BUTTON_NEXT . '</a>';
         } else {
             $display_links .= '&nbsp;&nbsp;' . PREVNEXT_BUTTON_NEXT;
         }
         if ($parameters != '') {
             if (substr($parameters, -1) == '&') {
                 $parameters = substr($parameters, 0, -1);
             }
             $pairs = explode('&', $parameters);
             while (list(, $pair) = each($pairs)) {
                 list($key, $value) = explode('=', $pair);
                 $display_links .= xos_draw_hidden_field(rawurldecode($key), rawurldecode($value));
             }
         }
         if (SESSID) {
             $display_links .= xos_draw_hidden_field(xos_session_name(), xos_session_id());
         }
         $display_links .= '</form>';
     } else {
         $display_links = sprintf(TEXT_RESULT_PAGE, $num_pages, $num_pages);
     }
     return $display_links;
 }
Esempio n. 2
0
 function confirm()
 {
     $mail_addresses_query = xos_db_query("select s.subscriber_id, s.subscriber_email_address, c.customers_firstname, c.customers_lastname  from " . TABLE_NEWSLETTER_SUBSCRIBERS . " s left join " . TABLE_CUSTOMERS . " c on s.customers_id = c.customers_id where s.newsletter_status = '1' " . ($this->language_id > 0 ? 'and s.subscriber_language_id = ' . $this->language_id : '') . " order by s.customers_id");
     $count = 0;
     $costomers_array = array();
     while ($mail_addresses = xos_db_fetch_array($mail_addresses_query)) {
         $count++;
         $costomers_array[] = array('id' => $mail_addresses['subscriber_id'], 'text' => '&lt;' . $mail_addresses['subscriber_email_address'] . '&gt; ' . $mail_addresses['customers_firstname'] . ' ' . $mail_addresses['customers_lastname']);
     }
     $cancel_button = '<script type="text/javascript">' . "\n" . '/* <![CDATA[ */' . "\n" . 'document.write(\'<input type="button" value="' . BUTTON_CANCEL . '" style="width: 8em;" onclick="document.location=\\\'' . xos_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $_GET['nID']) . '\\\'" />\');' . "\n" . '/* ]]> */' . "\n" . '</script>';
     $confirm_string = "\n" . '<script type="text/javascript">' . "\n" . '/* <![CDATA[ */' . "\n" . 'function mover(move) {' . "\n" . '  if (move == \'remove\') {' . "\n" . '    for (x=0; x<(document.notifications.costomers.length); x++) {' . "\n" . '      if (document.notifications.costomers.options[x].selected) {' . "\n" . '        with(document.notifications.elements[\'customers_chosen[]\']) {' . "\n" . '          options[options.length] = new Option(document.notifications.costomers.options[x].text,document.notifications.costomers.options[x].value);' . "\n" . '        }' . "\n" . '        document.notifications.costomers.options[x] = null;' . "\n" . '        x = -1;' . "\n" . '      }' . "\n" . '    }' . "\n" . '  }' . "\n" . '  if (move == \'add\') {' . "\n" . '    for (x=0; x<(document.notifications.elements[\'customers_chosen[]\'].length); x++) {' . "\n" . '      if (document.notifications.elements[\'customers_chosen[]\'].options[x].selected) {' . "\n" . '        with(document.notifications.costomers) {' . "\n" . '          options[options.length] = new Option(document.notifications.elements[\'customers_chosen[]\'].options[x].text,document.notifications.elements[\'customers_chosen[]\'].options[x].value);' . "\n" . '        }' . "\n" . '        document.notifications.elements[\'customers_chosen[]\'].options[x] = null;' . "\n" . '        x = -1;' . "\n" . '      }' . "\n" . '    }' . "\n" . '  }' . "\n" . '  return true;' . "\n" . '}' . "\n\n" . 'function selectAll(FormName, SelectBox) {' . "\n" . '  temp = "document." + FormName + ".elements[\'" + SelectBox + "\']";' . "\n" . '  Source = eval(temp);' . "\n\n" . '  for (x=0; x<(Source.length); x++) {' . "\n" . '    Source.options[x].selected = "true";' . "\n" . '  }' . "\n\n" . '  if (x<1) {' . "\n" . '    alert(\'' . JS_PLEASE_SELECT_CUSTOMERS . '\');' . "\n" . '    return false;' . "\n" . '  } else {' . "\n" . '    return true;' . "\n" . '  }' . "\n" . '}' . "\n" . '/* ]]> */' . "\n" . '</script>' . "\n";
     $confirm_string .= '<table width="100%" border="0" cellspacing="0" cellpadding="2">' . "\n" . '  <tr class="dataTableRow">' . "\n" . '    <td class="main"><b>' . sprintf(TEXT_COUNT_CUSTOMERS, $count) . '</b></td>' . "\n" . '  </tr>' . "\n" . ($count > 0 ? '  <tr class="dataTableRow">' . "\n" . '    <td>' . xos_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr class="dataTableRow">' . "\n" . '    <td>' . '      <form name="notifications" action="' . xos_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $_GET['nID'] . '&action=confirm_send') . '" method="post" onsubmit="return selectAll(\'notifications\', \'customers_chosen[]\')"><table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n" . '        <tr>' . "\n" . '          <td align="center" class="main"><b>' . TEXT_CUSTOMERS . '</b><br />' . xos_draw_pull_down_menu('costomers', $costomers_array, '', 'size="30" style="width: 30em; font-size:9px" multiple="multiple"') . '</td>' . "\n" . '          <td align="center" class="main"><input type="button" value="' . BUTTON_SELECT . '" style="width: 8em;" onclick="mover(\'remove\');" /><br /><br /><input type="button" value="' . htmlspecialchars(BUTTON_UNSELECT) . '" style="width: 8em;" onclick="mover(\'add\');" /><br /><br /><br /><br /><input type="submit" value="' . BUTTON_SEND . '" style="width: 8em;" /><br /><br />' . $cancel_button . '</td>' . "\n" . '          <td align="center" class="main"><b>' . TEXT_SELECTED_CUSTOMERS . '</b><br />' . xos_draw_pull_down_menu('customers_chosen[]', array(), '', 'size="30" style="width: 30em; font-size:9px" multiple="multiple"') . '</td>' . "\n" . '       </tr>' . "\n" . '     </table></form>' . '    </td>' . '  </tr>' . "\n" : '  <tr class="dataTableRow">' . "\n" . '    <td>' . xos_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr class="dataTableRow">' . "\n" . '    <td>' . '      <form name="notifications" action="' . xos_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $_GET['nID'] . '&action=confirm_send') . '" method="post" onsubmit="return selectAll(\'notifications\', \'customers_chosen[]\')"><table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n" . '        <tr>' . "\n" . '          <td align="center" class="main"><b>' . TEXT_CUSTOMERS . '</b><br />' . xos_draw_pull_down_menu('costomers', $costomers_array, '', 'size="30" style="width: 30em; font-size:9px" multiple="multiple"') . '</td>' . "\n" . '          <td align="center" class="main">' . $cancel_button . '</td>' . "\n" . '          <td align="center" class="main"><b>' . TEXT_SELECTED_CUSTOMERS . '</b><br />' . xos_draw_pull_down_menu('customers_chosen[]', array(), '', 'size="30" style="width: 30em; font-size:9px" multiple="multiple"') . '</td>' . "\n" . '       </tr>' . "\n" . '     </table></form>' . '    </td>' . '  </tr>' . "\n") . '  <tr class="dataTableRow">' . "\n" . '    <td>' . xos_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr class="dataTableRow">' . "\n" . '    <td class="main"><b>' . $this->title . '</b></td>' . "\n" . '  </tr>' . "\n" . '  <tr class="dataTableRow">' . "\n" . '    <td>' . xos_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" . '  </tr>' . "\n";
     if ($this->content_text_htlm != '' && EMAIL_USE_HTML == 'true') {
         $confirm_string .= '  <tr class="dataHeadingRow">' . "\n" . '    <td class="dataHeadingContent" valign="top">' . TEXT_TEXT . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr>' . "\n" . '    <td>' . xos_draw_separator('pixel_black.gif', '100%', '1') . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr>' . "\n" . '    <td class="main"><pre>' . wordwrap($this->content_text_plain, 100) . '</pre></td>' . "\n" . '  </tr>' . "\n" . '  <tr>' . "\n" . '    <td>' . xos_draw_separator('pixel_black.gif', '100%', '1') . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr class="dataTableRow">' . "\n" . '    <td>' . xos_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr class="dataHeadingRow">' . "\n" . '    <td class="dataHeadingContent" valign="top">' . TEXT_HTML . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr>' . "\n" . '    <td>' . xos_draw_separator('pixel_black.gif', '100%', '1') . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr>' . "\n" . '    <td>' . $this->content_text_htlm . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr>' . "\n" . '    <td>' . xos_draw_separator('pixel_black.gif', '100%', '1') . '</td>' . "\n" . '  </tr>' . "\n";
     } else {
         $confirm_string .= '  <tr class="dataHeadingRow">' . "\n" . '    <td class="dataHeadingContent" valign="top">' . TEXT_TEXT . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr>' . "\n" . '    <td>' . xos_draw_separator('pixel_black.gif', '100%', '1') . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr>' . "\n" . '    <td class="main"><pre>' . wordwrap($this->content_text_plain, 100) . '</pre></td>' . "\n" . '  </tr>' . "\n" . '  <tr>' . "\n" . '    <td>' . xos_draw_separator('pixel_black.gif', '100%', '1') . '</td>' . "\n" . '  </tr>' . "\n";
     }
     $confirm_string .= '</table>';
     return $confirm_string;
 }
//              MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//              GNU General Public License for more details.
//
//              You should have received a copy of the GNU General Public License
//              along with XOS-Shop.  If not, see <http://www.gnu.org/licenses/>.
//------------------------------------------------------------------------------
// this file is based on:
//              osCommerce, Open Source E-Commerce Solutions
//              http://www.oscommerce.com
//              Copyright (c) 2003 osCommerce
//              filename: currencies.php
//
//              Released under the GNU General Public License
////////////////////////////////////////////////////////////////////////////////
if (!(@(include DIR_FS_SMARTY . 'catalog/templates/' . SELECTED_TPL . '/php/includes/boxes/template_changer.php') == 'overwrite_all')) {
    $registered_tpls = array();
    $registered_tpls = explode(',', REGISTERED_TPLS);
    if (sizeof($registered_tpls) > 1) {
        for ($i = 0; $i < sizeof($registered_tpls); $i++) {
            $tpl_array[] = array('id' => xos_href_link(basename($_SERVER['PHP_SELF']), xos_get_all_get_params(array('tpl')) . 'tpl=' . $registered_tpls[$i], $request_type, true, true, false, false, false), 'text' => $registered_tpls[$i]);
            $template_changer_content_noscript .= '<a href="' . xos_href_link(basename($_SERVER['PHP_SELF']), xos_get_all_get_params(array('tpl')) . 'tpl=' . $registered_tpls[$i], $request_type, true, true, false, false, false) . '">' . '&nbsp; ' . (SELECTED_TPL == $registered_tpls[$i] ? '<b>' . $registered_tpls[$i] . '</b>' : $registered_tpls[$i]) . '</a><br />';
        }
        $template_changer_content_noscript = substr($template_changer_content_noscript, 0, -6);
        $template_changer_content = xos_draw_form('templates', xos_href_link(basename($_SERVER['PHP_SELF']), '', $request_type, false, true, false, false, false), 'get');
        $template_changer_content .= xos_draw_pull_down_menu('tpl', $tpl_array, xos_href_link(basename($_SERVER['PHP_SELF']), xos_get_all_get_params(array('tpl')) . 'tpl=' . SELECTED_TPL, $request_type, true, true, false, false, false), 'class="form-control" onchange="location = form.tpl.options[form.tpl.selectedIndex].value;"');
        $template_changer_content .= '</form>';
        $smarty->assign(array('box_template_changer_content' => $template_changer_content, 'box_template_changer_content_noscript' => $template_changer_content_noscript));
        $output_template_changer = $smarty->fetch(SELECTED_TPL . '/includes/boxes/template_changer.tpl');
        $smarty->assign('box_template_changer', $output_template_changer);
    }
}
Esempio n. 4
0
 case 'edit':
     $check_query = xos_db_query("select ab.entry_zone_id, zgz.zone_id from " . TABLE_ADDRESS_BOOK . " ab, " . TABLE_ZONES_TO_GEO_ZONES . " zgz where ab.entry_zone_id = '" . (int) $cInfo->zone_id . "' or zgz.zone_id = '" . (int) $cInfo->zone_id . "' LIMIT 1");
     $heading_title = '<b>' . TEXT_INFO_HEADING_EDIT_ZONE . '</b>';
     $form_tag = xos_draw_form('zones', FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id . '&action=save');
     $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
     if (isset($_GET['error_name'])) {
         if (empty($_GET['error_name'])) {
             $contents[] = array('text' => '<br />' . TEXT_INFO_ZONES_NAME_ERROR_EMPTY . '<br />');
         } else {
             $contents[] = array('text' => '<br />' . sprintf(TEXT_INFO_ZONES_NAME_ERROR, $_GET['error_name']) . '<br />');
         }
     }
     $contents[] = array('text' => '<br />' . TEXT_INFO_ZONES_NAME . '<br />' . xos_draw_input_field('zone_name', isset($_GET['zone_name']) ? $_GET['zone_name'] : $cInfo->zone_name) . xos_draw_hidden_field('actual_zone_name', $cInfo->zone_name));
     $contents[] = array('text' => '<br />' . TEXT_INFO_ZONES_CODE . '<br />' . xos_draw_input_field('zone_code', isset($_GET['zone_code']) ? $_GET['zone_code'] : $cInfo->zone_code));
     if (!xos_db_num_rows($check_query) && STORE_ZONE != $cInfo->zone_id) {
         $contents[] = array('text' => '<br />' . TEXT_INFO_COUNTRY_NAME . '<br />' . xos_draw_pull_down_menu('zone_country_id', xos_get_countries(), isset($_GET['zone_country_id']) ? $_GET['zone_country_id'] : $cInfo->countries_id, 'style="font-size:9px"') . xos_draw_hidden_field('actual_zone_country_id', $cInfo->countries_id));
     } else {
         $contents[] = array('text' => '<br />' . TEXT_INFO_COUNTRY_NAME . '<br /><b>' . $cInfo->countries_name . '</b>' . xos_draw_hidden_field('zone_country_id', $cInfo->countries_id) . xos_draw_hidden_field('actual_zone_country_id', $cInfo->countries_id));
     }
     $contents[] = array('text' => '<br /><a href="" onclick="zones.submit(); return false" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_UPDATE . ' "><span>' . BUTTON_TEXT_UPDATE . '</span></a><a href="' . xos_href_link(FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id) . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_CANCEL . ' "><span>' . BUTTON_TEXT_CANCEL . '</span></a><br />&nbsp;');
     break;
 case 'delete':
     $check_query = xos_db_query("select ab.entry_zone_id, zgz.zone_id from " . TABLE_ADDRESS_BOOK . " ab, " . TABLE_ZONES_TO_GEO_ZONES . " zgz where ab.entry_zone_id = '" . (int) $cInfo->zone_id . "' or zgz.zone_id = '" . (int) $cInfo->zone_id . "' LIMIT 1");
     $heading_title = '<b>' . TEXT_INFO_HEADING_DELETE_ZONE . '</b>';
     if (!xos_db_num_rows($check_query) && STORE_ZONE != $cInfo->zone_id) {
         $form_tag = xos_draw_form('zones', FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id . '&action=deleteconfirm');
         $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
         $contents[] = array('text' => '<br /><b>' . $cInfo->zone_name . '</b>');
         $contents[] = array('text' => '<br /><a href="" onclick="zones.submit(); return false" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_DELETE . ' "><span>' . BUTTON_TEXT_DELETE . '</span></a><a href="' . xos_href_link(FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id) . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_CANCEL . ' "><span>' . BUTTON_TEXT_CANCEL . '</span></a><br />&nbsp;');
     } else {
         $contents[] = array('text' => TEXT_INFO_DELETE_NOT_ALLOWED . '<br /><br />');
Esempio n. 5
0
            $male = $account['customers_gender'] == 'm' ? true : false;
        }
        $female = !$male;
        $smarty->assign(array('account_gender' => true, 'input_gender' => xos_draw_radio_field('gender', 'm', $male, 'id="gender_m"') . '<label class="control-label" for="gender_m">&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;</label>' . xos_draw_radio_field('gender', 'f', $female, 'id="gender_f"') . '<label class="control-label" for="gender_f">&nbsp;&nbsp;' . FEMALE . '&nbsp;</label>' . (xos_not_null(ENTRY_GENDER_TEXT) ? '<span class="input-requirement">' . ENTRY_GENDER_TEXT . '</span>' : '')));
    }
    if (ACCOUNT_DOB == 'true') {
        $smarty->assign(array('account_dob' => true, 'input_dob' => xos_draw_input_field('dob', xos_date_short($account['customers_dob']), 'class="form-control" id="dob"') . '&nbsp;' . (xos_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="input-requirement">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>' : '')));
    }
    reset($lng->catalog_languages);
    if (sizeof($lng->catalog_languages) > 1) {
        $lang_array = array();
        $languages_selected = '';
        while (list($key, $value) = each($lng->catalog_languages)) {
            $lang_array[] = array('id' => $value['id'], 'text' => $value['name']);
            if (!empty($language_id)) {
                $languages_selected = $language_id;
            } elseif ($value['id'] == $account['customers_language_id']) {
                $languages_selected = $account['customers_language_id'];
            }
        }
        $smarty->assign(array('languages' => true, 'pull_down_menu_languages' => xos_draw_pull_down_menu('languages', $lang_array, $languages_selected, 'class="form-control" id="languages"')));
    } else {
        $smarty->assign('hidden_field_languages', xos_draw_hidden_field('languages', $account['customers_language_id']));
    }
    $smarty->assign(array('form_begin' => xos_draw_form('account_edit', xos_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL'), 'post', 'onsubmit="return true;"', true), 'hidden_field' => xos_draw_hidden_field('action', 'process'), 'link_filename_account' => xos_href_link(FILENAME_ACCOUNT, '', 'SSL'), 'c_id' => $account['customers_c_id'], 'input_firstname' => xos_draw_input_field('firstname', $account['customers_firstname'], 'class="form-control" id="firstname"') . '&nbsp;' . (xos_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="input-requirement">' . ENTRY_FIRST_NAME_TEXT . '</span>' : ''), 'input_lastname' => xos_draw_input_field('lastname', $account['customers_lastname'], 'class="form-control" id="lastname"') . '&nbsp;' . (xos_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="input-requirement">' . ENTRY_LAST_NAME_TEXT . '</span>' : ''), 'input_email_address' => xos_draw_input_field('email_address', $account['customers_email_address'], 'class="form-control" id="email_address"') . '&nbsp;' . (xos_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="input-requirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>' : ''), 'input_telephone' => xos_draw_input_field('telephone', $account['customers_telephone'], 'class="form-control" id="telephone"') . '&nbsp;' . (xos_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="input-requirement">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>' : ''), 'input_fax' => xos_draw_input_field('fax', $account['customers_fax'], 'class="form-control" id="fax"') . '&nbsp;' . (xos_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="input-requirement">' . ENTRY_FAX_NUMBER_TEXT . '</span>' : ''), 'form_end' => '</form>'));
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'account_edit');
    $output_account_edit = $smarty->fetch(SELECTED_TPL . '/account_edit.tpl');
    $smarty->assign('central_contents', $output_account_edit);
    $smarty->display(SELECTED_TPL . '/frame.tpl');
    require DIR_WS_INCLUDES . 'application_bottom.php';
}
Esempio n. 6
0
        while ($orders = xos_db_fetch_array($orders_query)) {
            $oder_total_query = xos_db_query("select text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int) $orders['orders_id'] . "' and class = 'ot_total' order by orders_total_id DESC limit 1");
            $oder_total = xos_db_fetch_array($oder_total_query);
            if ((!isset($_GET['oID']) || isset($_GET['oID']) && $_GET['oID'] == $orders['orders_id']) && !isset($oInfo)) {
                $oInfo = new objectInfo($orders);
            }
            $selected = false;
            if (isset($oInfo) && is_object($oInfo) && $orders['orders_id'] == $oInfo->orders_id) {
                $selected = true;
                $link_filename_orders = xos_href_link(FILENAME_ORDERS, xos_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit');
            } else {
                $link_filename_orders = xos_href_link(FILENAME_ORDERS, xos_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']);
            }
            $orders_array[] = array('selected' => $selected, 'link_filename_orders' => $link_filename_orders, 'link_filename_orders_action_edit' => xos_href_link(FILENAME_ORDERS, xos_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders['orders_id'] . '&action=edit'), 'customers_name' => $orders['customers_name'], 'order_total' => strip_tags($oder_total['text']), 'date_purchased' => xos_datetime_short($orders['date_purchased']), 'order_status_name' => $orders['orders_status_name']);
        }
        if (SESSID) {
            $smarty->assign('hidden_field_session', xos_draw_hidden_field(xos_session_name(), xos_session_id()));
        }
        $smarty->assign(array('form_begin_orders' => xos_draw_form('orders', FILENAME_ORDERS, '', 'get'), 'input_oid' => xos_draw_input_field('oID', '', 'size="12"'), 'hidden_action' => xos_draw_hidden_field('action', 'edit'), 'form_begin_status' => xos_draw_form('new_status', FILENAME_ORDERS, '', 'get'), 'pull_down_status' => xos_draw_pull_down_menu('status', array_merge(array(array('id' => '', 'text' => TEXT_ALL_ORDERS)), (array) $orders_statuses), '', 'onchange="this.form.submit();"'), 'form_end' => '</form>', 'orders' => $orders_array, 'nav_bar_number' => $orders_split->display_count($orders_query_numrows, MAX_DISPLAY_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_ORDERS), 'nav_bar_result' => $orders_split->display_links($orders_query_numrows, MAX_DISPLAY_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], xos_get_all_get_params(array('page', 'oID', 'action')))));
        require DIR_WS_BOXES . 'infobox_orders.php';
    }
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'orders');
    $language_directory_query = xos_db_query("select directory from " . TABLE_LANGUAGES . " where use_in_id > '1' and directory = '" . $order->info['language_directory'] . "'");
    if (xos_db_num_rows($language_directory_query)) {
        $smarty->configLoad(DIR_FS_SMARTY . 'catalog/languages/' . $order->info['language_directory'] . '.conf', 'order_info');
    }
    $output_orders = $smarty->fetch(ADMIN_TPL . '/orders.tpl');
    $smarty->assign('central_contents', $output_orders);
    $smarty->display(ADMIN_TPL . '/frame.tpl');
    require DIR_WS_INCLUDES . 'application_bottom.php';
}
Esempio n. 7
0
     } elseif (EMAIL_USE_HTML == 'true') {
         $smarty->assign(array('use_html' => true, 'textarea_content_text_htlm' => xos_draw_textarea_field('content_text_htlm', '130', '25', $nInfo->content_text_htlm)));
     }
     $smarty->assign('textarea_content_text_plain', xos_draw_textarea_field('content_text_plain', '130', '25', $nInfo->content_text_plain));
     $languages = xos_get_languages();
     if (sizeof($languages) > 1) {
         $languages_id_selected = '';
         $lang_array = array(array('id' => '0', 'text' => TEXT_ALL_LANGUAGES));
         for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
             $lang_array[] = array('id' => $languages[$i]['id'], 'text' => $languages[$i]['name']);
         }
         $smarty->assign(array('languages' => true, 'pull_down_languages' => xos_draw_pull_down_menu('language_id', $lang_array, $nInfo->language_id)));
     } else {
         $smarty->assign('hidden_field_language_id', xos_draw_hidden_field('language_id', $languages[0]['id']));
     }
     $smarty->assign(array('action' => 'new', 'form_begin_new' => xos_draw_form('newsletter', FILENAME_NEWSLETTERS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'action=' . $form_action, 'post', 'onsubmit="return confirm(\'' . ($form_action == 'insert' ? JS_CONFIRM_INSERT : JS_CONFIRM_UPDATE) . '\')" enctype="multipart/form-data"'), 'pull_down_module' => xos_draw_pull_down_menu('module', $modules_array, $nInfo->module), 'input_title' => xos_draw_input_field('title', $nInfo->title, '', true), 'link_filename_newsletters_cancel' => xos_href_link(FILENAME_NEWSLETTERS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['nID']) ? 'nID=' . $_GET['nID'] : ''))));
 } elseif ($action == 'preview') {
     $nID = xos_db_prepare_input($_GET['nID']);
     $newsletter_query = xos_db_query("select title, content_text_plain, content_text_htlm, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int) $nID . "'");
     $newsletter = xos_db_fetch_array($newsletter_query);
     $nInfo = new objectInfo($newsletter);
     if ($nInfo->content_text_htlm != '' && EMAIL_USE_HTML == 'true') {
         $smarty->assign(array('content_text_plain' => wordwrap($nInfo->content_text_plain, 100), 'content_text_htlm' => $nInfo->content_text_htlm));
     } else {
         $smarty->assign('content_text_plain', wordwrap($nInfo->content_text_plain, 100));
     }
     $smarty->assign(array('action' => 'preview', 'link_filename_newsletters_back' => xos_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $_GET['nID'])));
 } elseif ($action == 'send') {
     $nID = xos_db_prepare_input($_GET['nID']);
     $newsletter_query = xos_db_query("select ns.title, ns.language_id, ns.content_text_plain, ns.content_text_htlm, ns.module, ls.code as language_code, ls.directory as language_directory from " . TABLE_NEWSLETTERS . " ns left join " . TABLE_LANGUAGES . " ls on ns.language_id = ls.languages_id where newsletters_id = '" . (int) $nID . "'");
     $newsletter = xos_db_fetch_array($newsletter_query);
Esempio n. 8
0
             $smarty->assign('newsletter_in_out_values', xos_draw_pull_down_menu('newsletter_status', $newsletter_array, $cInfo->newsletter_status == '1' ? '1' : '0'));
         }
     }
     if ($processed != true) {
         $index = 0;
         while ($existing_customers = xos_db_fetch_array($existing_customers_query)) {
             $existing_customers_array[] = array("id" => $existing_customers['customers_group_id'], "text" => '&nbsp;' . $existing_customers['customers_group_name'] . '&nbsp;');
             ++$index;
         }
     }
     if ($processed == true) {
         $customer_group_name_query = xos_db_query("select customers_group_name as name from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id = '" . $cInfo->customers_group_id . "'");
         $customer_group_name = xos_db_fetch_array($customer_group_name_query);
         $smarty->assign('customers_group_id_in_out_values', $customer_group_name['name'] . xos_draw_hidden_field('customers_group_id'));
     } else {
         $smarty->assign('customers_group_id_in_out_values', xos_draw_pull_down_menu('customers_group_id', $existing_customers_array, $cInfo->customers_group_id));
     }
     if ($processed == true) {
         $smarty->assign(array('several_lng_in_admin' => false, 'comments_in_out_values' => nl2br($cInfo->customers_comments) . xos_draw_hidden_field('customers_comments')));
     } else {
         $lng_query = xos_db_query("select languages_id from " . TABLE_LANGUAGES . " where use_in_id <> '2'");
         $smarty->assign(array('several_lng_in_admin' => xos_db_num_rows($lng_query) > 1 ? true : false, 'comments_in_out_values' => xos_draw_textarea_field('customers_comments', '80', '10', $cInfo->customers_comments)));
     }
     $smarty->assign(array('edit_or_update' => true, 'form_begin_customers' => xos_draw_form('customers', FILENAME_CUSTOMERS, xos_get_all_get_params(array('action')) . 'action=update', 'post', 'onsubmit="return check_form();"'), 'hidden_default_address_id' => xos_draw_hidden_field('default_address_id', $cInfo->customers_default_address_id), 'link_filename_customers' => xos_href_link(FILENAME_CUSTOMERS, xos_get_all_get_params(array('action'))), 'form_end' => '</form>'));
 } else {
     switch ($_GET['listing']) {
         case "id-asc":
             $order = "c.customers_id";
             break;
         case "cg_name":
             $order = "cg.customers_group_name, c.customers_lastname";
Esempio n. 9
0
                $redemptions = xos_db_num_rows($redeem_query);
                $coupon_status = false;
                if ($cc_list['coupon_active'] == 'Y') {
                    $coupon_status = true;
                }
                $cc_list_array[] = array('selected' => $selected, 'status' => $coupon_status, 'name' => $coupon_desc['coupon_name'], 'amount' => $coupon_amount, 'code' => $cc_list['coupon_code'], 'redemptions' => $redemptions, 'icon_status_green' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_green.gif', ICON_TITLE_STATUS_GREEN), 'icon_status_red' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_red.gif', ICON_TITLE_STATUS_RED), 'icon_status_green_light' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_green_light.gif', ICON_TITLE_STATUS_GREEN_LIGHT), 'icon_status_red_light' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_red_light.gif', ICON_TITLE_STATUS_RED_LIGHT), 'link_filename_coupon_admin_action_setflag_N' => xos_href_link(FILENAME_COUPON_ADMIN, 'action=setflag&flag=N&cid=' . $cc_list['coupon_id']), 'link_filename_coupon_admin_action_setflag_Y' => xos_href_link(FILENAME_COUPON_ADMIN, 'action=setflag&flag=Y&cid=' . $cc_list['coupon_id']), 'link_filename_coupon_admin' => xos_href_link(FILENAME_COUPON_ADMIN, xos_get_all_get_params(array('cid', 'action')) . 'cid=' . $cc_list['coupon_id']), 'link_filename_coupon_admin_edit' => $link_filename_coupon_admin_edit);
            }
            $smarty->assign('cc_list', $cc_list_array);
            $status_array[] = array('id' => 'Y', 'text' => TEXT_COUPON_ACTIVE);
            $status_array[] = array('id' => 'N', 'text' => TEXT_COUPON_INACTIVE);
            $status_array[] = array('id' => 'R', 'text' => TEXT_COUPON_REDEEMED);
            $status_array[] = array('id' => '*', 'text' => TEXT_COUPON_ALL);
            if ($_GET['status']) {
                $status = xos_db_prepare_input($_GET['status']);
            } else {
                // Changed from "Y" to "*" to see the Red Active and the Green Inactive status
                $status = '*';
            }
            if (SESSID) {
                $smarty->assign('hidden_field_session', xos_draw_hidden_field(xos_session_name(), xos_session_id()));
            }
            $smarty->assign(array('form_begin_status' => xos_draw_form('status', FILENAME_COUPON_ADMIN, '', 'get'), 'pull_down_status' => xos_draw_pull_down_menu('status', $status_array, $status, 'onchange="this.form.submit();"'), 'form_end' => '</form>'));
            $smarty->assign(array('nav_bar_number' => $cc_split->display_count($cc_query_numrows, MAX_DISPLAY_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_COUPONS), 'nav_bar_result' => $cc_split->display_links($cc_query_numrows, MAX_DISPLAY_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], 'status=' . $_GET['status']), 'link_filename_coupon_admin_new' => xos_href_link(FILENAME_COUPON_ADMIN, 'page=' . $_GET['page'] . '&cID=' . $cInfo->coupon_id . '&action=new')));
            require DIR_WS_BOXES . 'infobox_coupon_admin.php';
    }
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'coupon_admin');
    $output_coupon_admin = $smarty->fetch(ADMIN_TPL . '/coupon_admin.tpl');
    $smarty->assign('central_contents', $output_coupon_admin);
    $smarty->display(ADMIN_TPL . '/frame.tpl');
    require DIR_WS_INCLUDES . 'application_bottom.php';
}
Esempio n. 10
0
function xos_cfg_pull_down_order_statuses($order_status_id, $key = '')
{
    $name = $key ? 'configuration[' . $key . ']' : 'configuration_value';
    $statuses_array = array(array('id' => '0', 'text' => TEXT_DEFAULT));
    $statuses_query = xos_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where orders_status_code = '' and language_id = '" . (int) $_SESSION['used_lng_id'] . "' order by orders_status_name");
    while ($statuses = xos_db_fetch_array($statuses_query)) {
        $statuses_array[] = array('id' => $statuses['orders_status_id'], 'text' => $statuses['orders_status_name']);
    }
    return '<div class="form-group">' . xos_draw_pull_down_menu($name, $statuses_array, $order_status_id, 'class="form-control"') . '</div>';
}
 function confirm()
 {
     $audience = array();
     if (isset($_GET['global']) && $_GET['global'] == 'true') {
         $products_query = xos_db_query("select distinct pn.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_PRODUCTS_NOTIFICATIONS . " pn where c.customers_id = pn.customers_id " . ($this->language_id > 0 ? 'and c.customers_language_id = ' . $this->language_id : '') . "");
         while ($products = xos_db_fetch_array($products_query)) {
             $audience[$products['customers_id']] = array('firstname' => $products['customers_firstname'], 'lastname' => $products['customers_lastname'], 'email_address' => $products['customers_email_address']);
         }
         $customers_query = xos_db_query("select c.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_INFO . " ci where c.customers_id = ci.customers_info_id and ci.global_product_notifications = '1' " . ($this->language_id > 0 ? 'and c.customers_language_id = ' . $this->language_id : '') . "");
         while ($customers = xos_db_fetch_array($customers_query)) {
             $audience[$customers['customers_id']] = array('firstname' => $customers['customers_firstname'], 'lastname' => $customers['customers_lastname'], 'email_address' => $customers['customers_email_address']);
         }
     } else {
         $chosen = $_POST['chosen'];
         $ids = implode(',', $chosen);
         $products_query = xos_db_query("select distinct pn.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_PRODUCTS_NOTIFICATIONS . " pn where c.customers_id = pn.customers_id " . ($this->language_id > 0 ? 'and c.customers_language_id = ' . $this->language_id : '') . " and pn.products_id in (" . $ids . ")");
         while ($products = xos_db_fetch_array($products_query)) {
             $audience[$products['customers_id']] = array('firstname' => $products['customers_firstname'], 'lastname' => $products['customers_lastname'], 'email_address' => $products['customers_email_address']);
         }
         $customers_query = xos_db_query("select c.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_INFO . " ci where c.customers_id = ci.customers_info_id and ci.global_product_notifications = '1' " . ($this->language_id > 0 ? 'and c.customers_language_id = ' . $this->language_id : '') . "");
         while ($customers = xos_db_fetch_array($customers_query)) {
             $audience[$customers['customers_id']] = array('firstname' => $customers['customers_firstname'], 'lastname' => $customers['customers_lastname'], 'email_address' => $customers['customers_email_address']);
         }
     }
     $count = 0;
     $costomers_array = array();
     reset($audience);
     while (list($key, $value) = each($audience)) {
         $count++;
         $costomers_array[] = array('id' => $key, 'text' => $value['firstname'] . ' ' . $value['lastname'] . ' &lt;' . $value['email_address'] . '&gt;');
     }
     $cancel_button = '<script type="text/javascript">' . "\n" . '/* <![CDATA[ */' . "\n" . 'document.write(\'<input type="button" value="' . BUTTON_CANCEL . '" style="width: 8em;" onclick="document.location=\\\'' . xos_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $_GET['nID']) . '\\\'" />\');' . "\n" . '/* ]]> */' . "\n" . '</script>';
     $return_button = '<script type="text/javascript">' . "\n" . '/* <![CDATA[ */' . "\n" . 'document.write(\'<input type="button" value="' . BUTTON_BACK . '" style="width: 8em;" onclick="document.location=\\\'' . xos_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $_GET['nID']) . '&action=send \\\'" />\');' . "\n" . '/* ]]> */' . "\n" . '</script>';
     $confirm_string = "\n" . '<script type="text/javascript">' . "\n" . '/* <![CDATA[ */' . "\n" . 'function mover(move) {' . "\n" . '  if (move == \'remove\') {' . "\n" . '    for (x=0; x<(document.notifications.costomers.length); x++) {' . "\n" . '      if (document.notifications.costomers.options[x].selected) {' . "\n" . '        with(document.notifications.elements[\'customers_chosen[]\']) {' . "\n" . '          options[options.length] = new Option(document.notifications.costomers.options[x].text,document.notifications.costomers.options[x].value);' . "\n" . '        }' . "\n" . '        document.notifications.costomers.options[x] = null;' . "\n" . '        x = -1;' . "\n" . '      }' . "\n" . '    }' . "\n" . '  }' . "\n" . '  if (move == \'add\') {' . "\n" . '    for (x=0; x<(document.notifications.elements[\'customers_chosen[]\'].length); x++) {' . "\n" . '      if (document.notifications.elements[\'customers_chosen[]\'].options[x].selected) {' . "\n" . '        with(document.notifications.costomers) {' . "\n" . '          options[options.length] = new Option(document.notifications.elements[\'customers_chosen[]\'].options[x].text,document.notifications.elements[\'customers_chosen[]\'].options[x].value);' . "\n" . '        }' . "\n" . '        document.notifications.elements[\'customers_chosen[]\'].options[x] = null;' . "\n" . '        x = -1;' . "\n" . '      }' . "\n" . '    }' . "\n" . '  }' . "\n" . '  return true;' . "\n" . '}' . "\n\n" . 'function selectAll(FormName, SelectBox) {' . "\n" . '  temp = "document." + FormName + ".elements[\'" + SelectBox + "\']";' . "\n" . '  Source = eval(temp);' . "\n\n" . '  for (x=0; x<(Source.length); x++) {' . "\n" . '    Source.options[x].selected = "true";' . "\n" . '  }' . "\n\n" . '  if (x<1) {' . "\n" . '    alert(\'' . JS_PLEASE_SELECT_CUSTOMERS . '\');' . "\n" . '    return false;' . "\n" . '  } else {' . "\n" . '    return true;' . "\n" . '  }' . "\n" . '}' . "\n" . '/* ]]> */' . "\n" . '</script>' . "\n";
     $confirm_string .= '<table width="100%" border="0" cellspacing="0" cellpadding="2">' . "\n" . '  <tr class="dataTableRow">' . "\n" . '    <td class="main"><b>' . sprintf(TEXT_COUNT_CUSTOMERS, $count) . '</b></td>' . "\n" . '  </tr>' . "\n" . ($count > 0 ? '  <tr class="dataTableRow">' . "\n" . '    <td>' . xos_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr class="dataTableRow">' . "\n" . '    <td>' . '      <form name="notifications" action="' . xos_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $_GET['nID'] . '&action=confirm_send') . '" method="post" onsubmit="return selectAll(\'notifications\', \'customers_chosen[]\')"><table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n" . '        <tr>' . "\n" . '          <td align="center" class="main"><b>' . TEXT_CUSTOMERS . '</b><br />' . xos_draw_pull_down_menu('costomers', $costomers_array, '', 'size="30" style="width: 30em; font-size:9px" multiple="multiple"') . '</td>' . "\n" . '          <td align="center" class="main"><input type="button" value="' . BUTTON_SELECT . '" style="width: 8em;" onclick="mover(\'remove\');" /><br /><br /><input type="button" value="' . htmlspecialchars(BUTTON_UNSELECT) . '" style="width: 8em;" onclick="mover(\'add\');" /><br /><br /><br /><br /><input type="submit" value="' . BUTTON_SEND . '" style="width: 8em;" /><br /><br />' . $return_button . '<br /><br />' . $cancel_button . '</td>' . "\n" . '          <td align="center" class="main"><b>' . TEXT_SELECTED_CUSTOMERS . '</b><br />' . xos_draw_pull_down_menu('customers_chosen[]', array(), '', 'size="30" style="width: 30em; font-size:9px" multiple="multiple"') . '</td>' . "\n" . '       </tr>' . "\n" . '     </table></form>' . '    </td>' . '  </tr>' . "\n" : '  <tr class="dataTableRow">' . "\n" . '    <td>' . xos_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr class="dataTableRow">' . "\n" . '    <td>' . '      <form name="notifications" action="' . xos_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $_GET['nID'] . '&action=confirm_send') . '" method="post" onsubmit="return selectAll(\'notifications\', \'customers_chosen[]\')"><table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n" . '        <tr>' . "\n" . '          <td align="center" class="main"><b>' . TEXT_CUSTOMERS . '</b><br />' . xos_draw_pull_down_menu('costomers', $costomers_array, '', 'size="30" style="width: 30em; font-size:9px" multiple="multiple"') . '</td>' . "\n" . '          <td align="center" class="main">' . $return_button . '<br /><br />' . $cancel_button . '</td>' . "\n" . '          <td align="center" class="main"><b>' . TEXT_SELECTED_CUSTOMERS . '</b><br />' . xos_draw_pull_down_menu('customers_chosen[]', array(), '', 'size="30" style="width: 30em; font-size:9px" multiple="multiple"') . '</td>' . "\n" . '       </tr>' . "\n" . '     </table></form>' . '    </td>' . '  </tr>' . "\n") . '  <tr class="dataTableRow">' . "\n" . '    <td>' . xos_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr class="dataTableRow">' . "\n" . '    <td class="main"><b>' . $this->title . '</b></td>' . "\n" . '  </tr>' . "\n" . '  <tr class="dataTableRow">' . "\n" . '    <td>' . xos_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" . '  </tr>' . "\n";
     if ($this->content_text_htlm != '' && EMAIL_USE_HTML == 'true') {
         $confirm_string .= '  <tr class="dataHeadingRow">' . "\n" . '    <td class="dataHeadingContent" valign="top">' . TEXT_TEXT . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr>' . "\n" . '    <td>' . xos_draw_separator('pixel_black.gif', '100%', '1') . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr>' . "\n" . '    <td class="main"><pre>' . wordwrap($this->content_text_plain, 100) . '</pre></td>' . "\n" . '  </tr>' . "\n" . '  <tr>' . "\n" . '    <td>' . xos_draw_separator('pixel_black.gif', '100%', '1') . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr class="dataTableRow">' . "\n" . '    <td>' . xos_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr class="dataHeadingRow">' . "\n" . '    <td class="dataHeadingContent" valign="top">' . TEXT_HTML . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr>' . "\n" . '    <td>' . xos_draw_separator('pixel_black.gif', '100%', '1') . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr>' . "\n" . '    <td>' . $this->content_text_htlm . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr>' . "\n" . '    <td>' . xos_draw_separator('pixel_black.gif', '100%', '1') . '</td>' . "\n" . '  </tr>' . "\n";
     } else {
         $confirm_string .= '  <tr class="dataHeadingRow">' . "\n" . '    <td class="dataHeadingContent" valign="top">' . TEXT_TEXT . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr>' . "\n" . '    <td>' . xos_draw_separator('pixel_black.gif', '100%', '1') . '</td>' . "\n" . '  </tr>' . "\n" . '  <tr>' . "\n" . '    <td class="main"><pre>' . wordwrap($this->content_text_plain, 100) . '</pre></td>' . "\n" . '  </tr>' . "\n" . '  <tr>' . "\n" . '    <td>' . xos_draw_separator('pixel_black.gif', '100%', '1') . '</td>' . "\n" . '  </tr>' . "\n";
     }
     $confirm_string .= '</table>';
     return $confirm_string;
 }
Esempio n. 12
0
 // Land kann geaendert werden, auch wenn bereits zugeortnet
 case 'edit':
     $heading_title = '<b>' . TEXT_INFO_HEADING_EDIT_COUNTRY . '</b>';
     $form_tag = xos_draw_form('countries', FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->countries_id . '&action=save');
     $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
     if (isset($_GET['error_name'])) {
         if (empty($_GET['error_name'])) {
             $contents[] = array('text' => '<br />' . TEXT_INFO_COUNTRY_NAME_ERROR_EMPTY . '<br />');
         } else {
             $contents[] = array('text' => '<br />' . sprintf(TEXT_INFO_COUNTRY_NAME_ERROR, $_GET['error_name']) . '<br />');
         }
     }
     $contents[] = array('text' => '<br />' . TEXT_INFO_COUNTRY_NAME . '<br />' . xos_draw_input_field('countries_name', isset($_GET['countries_name']) ? $_GET['countries_name'] : $cInfo->countries_name) . xos_draw_hidden_field('actual_countries_name', $cInfo->countries_name));
     $contents[] = array('text' => '<br />' . TEXT_INFO_COUNTRY_CODE_2 . '<br />' . xos_draw_input_field('countries_iso_code_2', isset($_GET['countries_iso_code_2']) ? $_GET['countries_iso_code_2'] : $cInfo->countries_iso_code_2));
     $contents[] = array('text' => '<br />' . TEXT_INFO_COUNTRY_CODE_3 . '<br />' . xos_draw_input_field('countries_iso_code_3', isset($_GET['countries_iso_code_3']) ? $_GET['countries_iso_code_3'] : $cInfo->countries_iso_code_3));
     $contents[] = array('text' => '<br />' . TEXT_INFO_ADDRESS_FORMAT . '<br />' . xos_draw_pull_down_menu('address_format_id', xos_get_address_formats(), isset($_GET['address_format_id']) ? $_GET['address_format_id'] : $cInfo->address_format_id));
     $contents[] = array('text' => '<br /><a href="" onclick="countries.submit(); return false" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_UPDATE . ' "><span>' . BUTTON_TEXT_UPDATE . '</span></a><a href="' . xos_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->countries_id) . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_CANCEL . ' "><span>' . BUTTON_TEXT_CANCEL . '</span></a><br />&nbsp;');
     break;
 case 'delete':
     $check_query = xos_db_query("select ab.entry_country_id, zgz.zone_country_id from " . TABLE_ADDRESS_BOOK . " ab, " . TABLE_ZONES_TO_GEO_ZONES . " zgz where ab.entry_country_id = '" . (int) $cInfo->countries_id . "' or zgz.zone_country_id = '" . (int) $cInfo->countries_id . "' LIMIT 1");
     $heading_title = '<b>' . TEXT_INFO_HEADING_DELETE_COUNTRY . '</b>';
     if (!xos_db_num_rows($check_query) && STORE_COUNTRY != $cInfo->countries_id) {
         $form_tag = xos_draw_form('countries', FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->countries_id . '&action=deleteconfirm');
         $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
         $contents[] = array('text' => '<br /><b>' . $cInfo->countries_name . '</b>');
         $contents[] = array('text' => '<br /><a href="" onclick="countries.submit(); return false" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_DELETE . ' "><span>' . BUTTON_TEXT_DELETE . '</span></a><a href="' . xos_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->countries_id) . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_CANCEL . ' "><span>' . BUTTON_TEXT_CANCEL . '</span></a><br />&nbsp;');
     } else {
         $contents[] = array('text' => TEXT_INFO_DELETE_NOT_ALLOWED . '<br /><br />');
         $contents[] = array('text' => '<br /><a href="' . xos_href_link(FILENAME_COUNTRIES, xos_get_all_get_params(array('action'))) . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_BACK . ' "><span>' . BUTTON_TEXT_BACK . '</span></a><br />&nbsp;');
     }
     break;
Esempio n. 13
0
 $banner = xos_db_fetch_array($banner_query);
 $years_array = array();
 $years_query = xos_db_query("select distinct year(banners_history_date) as banner_year from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . (int) $_GET['bID'] . "'");
 while ($years = xos_db_fetch_array($years_query)) {
     $years_array[] = array('id' => $years['banner_year'], 'text' => $years['banner_year']);
 }
 $months_array = array();
 for ($i = 1; $i < 13; $i++) {
     $months_array[] = array('id' => $i, 'text' => xos_date_format('%B', mktime(0, 0, 0, $i)));
 }
 $type_array = array(array('id' => 'daily', 'text' => STATISTICS_TYPE_DAILY), array('id' => 'monthly', 'text' => STATISTICS_TYPE_MONTHLY), array('id' => 'yearly', 'text' => STATISTICS_TYPE_YEARLY));
 require DIR_WS_INCLUDES . 'html_header.php';
 require DIR_WS_INCLUDES . 'header.php';
 require DIR_WS_INCLUDES . 'column_left.php';
 require DIR_WS_INCLUDES . 'footer.php';
 $smarty->assign(array('link_filename_banner_manager' => xos_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $_GET['bID']), 'form_begin' => xos_draw_form('year', FILENAME_BANNER_STATISTICS, '', 'get'), 'pull_down_type' => xos_draw_pull_down_menu('type', $type_array, xos_not_null($type) ? $type : 'daily', 'onchange="this.form.submit();"'), 'pull_down_year' => xos_draw_pull_down_menu('year', $years_array, isset($_GET['year']) ? $_GET['year'] : date('Y'), 'onchange="this.form.submit();"'), 'pull_down_month' => xos_draw_pull_down_menu('month', $months_array, isset($_GET['month']) ? $_GET['month'] : date('n'), 'onchange="this.form.submit();"'), 'hidden_field_page' => xos_draw_hidden_field('page', $_GET['page']), 'hidden_field_bid' => xos_draw_hidden_field('bID', $_GET['bID'])));
 if (SESSID) {
     $smarty->assign('hidden_field_session', xos_draw_hidden_field(xos_session_name(), xos_session_id()));
 }
 $smarty->assign('form_end', '</form>');
 switch ($type) {
     case 'yearly':
         break;
     case 'monthly':
         $smarty->assign('case_monthly', true);
         break;
     default:
     case 'daily':
         $smarty->assign('case_daily', true);
         break;
 }
Esempio n. 14
0
 if ($action == 'list') {
     switch ($saction) {
         case 'new':
             $heading_title = '<b>' . TEXT_INFO_HEADING_NEW_SUB_ZONE . '</b>';
             $form_tag = xos_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&' . (isset($_GET['sID']) ? 'sID=' . $_GET['sID'] . '&' : '') . 'saction=insert_sub');
             $contents[] = array('text' => TEXT_INFO_NEW_SUB_ZONE_INTRO);
             $contents[] = array('text' => '<br />' . TEXT_INFO_COUNTRY . '<br /><div class="form-group">' . xos_draw_pull_down_menu('zone_country_id', xos_get_countries(TEXT_ALL_COUNTRIES), '', 'class="form-control" onchange="update_zone(this.form);"') . '</div>');
             $contents[] = array('text' => '<br />' . TEXT_INFO_COUNTRY_ZONE . '<br /><div class="form-group">' . xos_draw_pull_down_menu('zone_id', xos_prepare_country_zones_pull_down(), '', 'class="form-control"') . '</div>');
             $contents[] = array('text' => '<br /><a href="" onclick="zones.submit(); return false" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_INSERT . ' ">' . BUTTON_TEXT_INSERT . '</a><a href="' . xos_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&' . (isset($_GET['sID']) ? 'sID=' . $_GET['sID'] : '')) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a><br />&nbsp;');
             break;
         case 'edit':
             $heading_title = '<b>' . TEXT_INFO_HEADING_EDIT_SUB_ZONE . '</b>';
             $form_tag = xos_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=save_sub');
             $contents[] = array('text' => TEXT_INFO_EDIT_SUB_ZONE_INTRO);
             $contents[] = array('text' => '<br />' . TEXT_INFO_COUNTRY . '<br /><div class="form-group">' . xos_draw_pull_down_menu('zone_country_id', xos_get_countries(TEXT_ALL_COUNTRIES), $sInfo->zone_country_id, 'class="form-control" onchange="update_zone(this.form);"') . '</div>');
             $contents[] = array('text' => '<br />' . TEXT_INFO_COUNTRY_ZONE . '<br /><div class="form-group">' . xos_draw_pull_down_menu('zone_id', xos_prepare_country_zones_pull_down($sInfo->zone_country_id), $sInfo->zone_id, 'class="form-control"') . '</div>');
             $contents[] = array('text' => '<br /><a href="" onclick="zones.submit(); return false" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_UPDATE . ' ">' . BUTTON_TEXT_UPDATE . '</a><a href="' . xos_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a><br />&nbsp;');
             break;
         case 'delete':
             $heading_title = '<b>' . TEXT_INFO_HEADING_DELETE_SUB_ZONE . '</b>';
             $form_tag = xos_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=deleteconfirm_sub');
             $contents[] = array('text' => TEXT_INFO_DELETE_SUB_ZONE_INTRO);
             $contents[] = array('text' => '<br /><b>' . $sInfo->countries_name . '</b>');
             $contents[] = array('text' => '<br /><a href="" onclick="zones.submit(); return false" class="btn btn-danger btn-margin-infobox" title=" ' . BUTTON_TITLE_DELETE . ' ">' . BUTTON_TEXT_DELETE . '</a><a href="' . xos_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a><br />&nbsp;');
             break;
         default:
             if (isset($sInfo) && is_object($sInfo)) {
                 $heading_title = '<b>' . $sInfo->countries_name . '</b>';
                 $contents[] = array('text' => '<a href="' . xos_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=edit') . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_EDIT . ' ">' . BUTTON_TEXT_EDIT . '</a><a href="' . xos_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=delete') . '" class="btn btn-danger btn-margin-infobox" title=" ' . BUTTON_TITLE_DELETE . ' ">' . BUTTON_TEXT_DELETE . '</a>');
                 $contents[] = array('text' => '<br />' . TEXT_INFO_DATE_ADDED . ' ' . xos_date_short($sInfo->date_added));
                 if (xos_not_null($sInfo->last_modified)) {
Esempio n. 15
0
                $cInfo_array = array_merge((array) $pages, (array) $page_children);
                $cInfo = new objectInfo($cInfo_array);
            }
            $pages_array[] = array('selected' => isset($cInfo) && is_object($cInfo) && $pages['categories_or_pages_id'] == $cInfo->categories_or_pages_id ? true : false, 'children' => $children_in_page > 0 ? $children_in_page : false, 'status' => $pages['categories_or_pages_status'] == '1' ? true : false, 'page_not_in_menu' => $pages['page_not_in_menu'] == '1' ? true : false, 'name' => htmlspecialchars($pages['categories_or_pages_name']), 'sort_order' => $pages['sort_order'], 'icon_status_green' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_green.gif', ICON_TITLE_STATUS_GREEN), 'icon_status_red' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_red.gif', ICON_TITLE_STATUS_RED), 'icon_status_green_light' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_green_light.gif', ICON_TITLE_STATUS_GREEN_LIGHT), 'icon_status_red_light' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_red_light.gif', ICON_TITLE_STATUS_RED_LIGHT), 'icon_not_in_menu_green' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_not_in_menu_green.gif', ICON_TITLE_STATUS_GREEN), 'icon_not_in_menu_red' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_not_in_menu_red.gif', ICON_TITLE_STATUS_RED), 'icon_not_in_menu_green_light' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_not_in_menu_green_light.gif', ICON_TITLE_STATUS_GREEN_LIGHT), 'icon_not_in_menu_red_light' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_not_in_menu_red_light.gif', ICON_TITLE_STATUS_RED_LIGHT), 'link_filename_pages_flag_status_0' => xos_href_link(FILENAME_PAGES, 'action=setflag_status&flag_status=0&cpID=' . $pages['categories_or_pages_id'] . '&cPath=' . $cPath), 'link_filename_pages_flag_status_1' => xos_href_link(FILENAME_PAGES, 'action=setflag_status&flag_status=1&cpID=' . $pages['categories_or_pages_id'] . '&cPath=' . $cPath), 'link_filename_pages_flag_not_in_menu_0' => xos_href_link(FILENAME_PAGES, 'action=setflag_menu&flag_menu=0&cpID=' . $pages['categories_or_pages_id'] . '&cPath=' . $cPath), 'link_filename_pages_flag_not_in_menu_1' => xos_href_link(FILENAME_PAGES, 'action=setflag_menu&flag_menu=1&cpID=' . $pages['categories_or_pages_id'] . '&cPath=' . $cPath), 'link_filename_pages_get_path' => xos_href_link(FILENAME_PAGES, xos_get_path($pages['categories_or_pages_id'])), 'link_filename_pages_edit' => xos_href_link(FILENAME_PAGES, 'cPath=' . $cPath . '&cpID=' . $pages['categories_or_pages_id'] . '&action=new_page'), 'link_filename_pages_cpath_cpath_cid' => xos_href_link(FILENAME_PAGES, 'cPath=' . $cPath . '&cpID=' . $pages['categories_or_pages_id']));
        }
        $cPath_back = '';
        $page_path = xos_generate_page_path($current_page_id);
        for ($i = sizeof($page_path[0]) - 1; $i > 0; $i--) {
            $current_page_id != $page_path[0][$i]['id'] ? $cPath_back .= $page_path[0][$i]['id'] . '_' : '';
        }
        $cPath_back = substr($cPath_back, 0, -1);
        $cPath_back = xos_not_null($cPath_back) ? 'cPath=' . $cPath_back . '&' : '';
        if ($current_page_id > 0) {
            $smarty->assign('link_filename_pages_back', xos_href_link(FILENAME_PAGES, $cPath_back . 'cpID=' . $current_page_id));
        }
        $page_tree = xos_get_page_tree();
        $current_page_name = '';
        for ($i = 0, $n = sizeof($page_tree); $i < $n; $i++) {
            if ($current_page_id == $page_tree[$i]['id']) {
                $current_page_name = ltrim($page_tree[$i]['text'], '&nbsp;');
            }
        }
        $smarty->assign(array('pages' => $pages_array, 'pages_count' => $pages_count, 'current_page_name' => $current_page_name, 'link_filename_pages_action_new_page' => xos_href_link(FILENAME_PAGES, 'cPath=' . $cPath . '&action=new_page'), 'form_begin_goto' => xos_draw_form('goto', FILENAME_PAGES, 'action=goto_page'), 'pull_down_pages' => xos_draw_pull_down_menu('goto_page_id', $page_tree, $cInfo->categories_or_pages_id, 'onchange="this.form.submit();"'), 'form_end' => '</form>'));
        require DIR_WS_BOXES . 'infobox_pages.php';
        $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'pages');
        $output_pages = $smarty->fetch(ADMIN_TPL . '/pages.tpl');
        $smarty->assign('central_contents', $output_pages);
    }
    $smarty->display(ADMIN_TPL . '/frame.tpl');
    require DIR_WS_INCLUDES . 'application_bottom.php';
}
Esempio n. 16
0
        $amount = $_POST['amount'];
        $message = $_POST['message'];
        $customers = array();
        $customers[] = array('id' => '', 'text' => TEXT_SELECT_CUSTOMER);
        $customers[] = array('id' => '***', 'text' => TEXT_ALL_CUSTOMERS);
        $customers[] = array('id' => '**D', 'text' => TEXT_NEWSLETTER_CUSTOMERS);
        $mail_query = xos_db_query("select customers_email_address, customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " order by customers_lastname");
        while ($customers_values = xos_db_fetch_array($mail_query)) {
            $customers[] = array('id' => $customers_values['customers_email_address'], 'text' => $customers_values['customers_lastname'] . ', ' . $customers_values['customers_firstname'] . ' (' . $customers_values['customers_email_address'] . ')');
        }
        $languages = xos_get_languages();
        if (sizeof($languages) > 1) {
            $language_dir_selected = '';
            for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
                if ($languages[$i]['id'] == $_SESSION['used_lng_id']) {
                    $language_dir_selected = $languages[$i]['directory'];
                }
                $lang_array[] = array('id' => $languages[$i]['directory'], 'text' => $languages[$i]['name']);
            }
            $smarty->assign(array('languages' => true, 'pull_down_languages' => xos_draw_pull_down_menu('language_dir', $lang_array, $language_dir ? $language_dir : $language_dir_selected)));
        } else {
            $smarty->assign('hidden_field_language_dir', xos_draw_hidden_field('language_dir', $languages[0]['directory']));
        }
        $smarty->assign(array('form_begin_action_preview' => xos_draw_form('mail', FILENAME_GV_MAIL, 'action=preview', 'post', 'onsubmit="return check_email_to();"'), 'pull_down_customers_email_address' => xos_draw_pull_down_menu('customers_email_address', $customers, isset($_GET['customer']) ? $_GET['customer'] : ''), 'input_email_to' => xos_draw_input_field('email_to', '', 'onkeyup="updateLanguage()"') . ($entry_email_to_error == true ? '&nbsp;' . ENTRY_EMAIL_ADDRESS_ERROR : ($entry_email_to_check_error ? '&nbsp;' . ENTRY_EMAIL_ADDRESS_CHECK_ERROR : '&nbsp;' . TEXT_SINGLE_EMAIL)), 'input_from' => xos_draw_input_field('from', EMAIL_FROM), 'input_subject' => xos_draw_input_field('subject'), 'input_amount' => xos_draw_input_field('amount'), 'textarea_message' => xos_draw_textarea_field('message', '60', '15'), 'form_end' => '</form>'));
    }
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'gv_mail');
    $output_gv_mail = $smarty->fetch(ADMIN_TPL . '/gv_mail.tpl');
    $smarty->assign('central_contents', $output_gv_mail);
    $smarty->display(ADMIN_TPL . '/frame.tpl');
    require DIR_WS_INCLUDES . 'application_bottom.php';
}
                } else {
                    $options_name = '';
                }
                $current_attributes_values_array[$attributes_values['products_attributes_id']] = array('value_price' => $attributes_values['options_values_price'], 'price_prefix' => $attributes_values['price_prefix']);
                $attributes_values_array[] = array('option_name' => $options_name, 'value_name' => $attributes_values['products_options_values_name'], 'input_value_price' => xos_draw_input_field('value_price_' . $attributes_values['products_attributes_id'], $attributes_values['options_values_price'], 'style="background: #fffffe;" size ="11" onkeyup="updateGross(\'value_price_' . $attributes_values['products_attributes_id'] . '\', \'value_price_gross_' . $attributes_values['products_attributes_id'] . '\')"'), 'input_value_price_gross' => xos_draw_input_field('value_price_gross_' . $attributes_values['products_attributes_id'], $attributes_values['options_values_price'], 'style="background: #fffffe;" size ="11" onkeyup="updateNet(\'value_price_gross_' . $attributes_values['products_attributes_id'] . '\', \'value_price_' . $attributes_values['products_attributes_id'] . '\')"'), 'input_price_prefix' => xos_draw_input_field('price_prefix_' . $attributes_values['products_attributes_id'], $attributes_values['price_prefix'], 'style="background: #fffffe; text-align:center;" size ="1"'));
                $update_gross_string .= 'updateGross(\'value_price_' . $attributes_values['products_attributes_id'] . '\', \'value_price_gross_' . $attributes_values['products_attributes_id'] . '\');' . "\n";
                $update_net_string .= 'updateNet(\'value_price_gross_' . $attributes_values['products_attributes_id'] . '\', \'value_price_' . $attributes_values['products_attributes_id'] . '\');' . "\n";
            }
        }
        ///////////////////////////////////////
        $javascript .= "\n" . 'function toggle(targetId, iState) {' . "\n" . '  var obj = document.getElementById(targetId).style;' . "\n" . '  if (obj.display == "none" && iState != 0 && iState != 1){' . "\n" . '    obj.display="";' . "\n" . '  } else if (iState != 0 && iState != 1){' . "\n" . '    obj.display="none";' . "\n" . '  }' . "\n" . '  if (iState == 1){' . "\n" . '    obj.display="";' . "\n" . '  } else if (iState == 0){' . "\n" . '    obj.display="none";' . "\n" . '  }' . "\n" . '}' . "\n\n" . 'function updateChecked(cuID) {' . "\n" . '  var selected = document.forms["' . $form_action . '"].elements["option[" + cuID + "]"].checked;' . "\n" . '  if (selected) {' . "\n" . '    toggle("box_" + cuID,1);' . "\n" . '  } else {' . "\n" . '    toggle("box_" + cuID,0);' . "\n" . '  }' . "\n" . '}' . "\n\n" . 'function doRound(x, places) {' . "\n" . '  return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);' . "\n" . '}' . "\n\n" . 'function getTaxRate() {' . "\n" . '  var selected_value = document.forms["' . $form_action . '"].tax_rates_final_id.selectedIndex;' . "\n" . '  var parameterVal = document.forms["' . $form_action . '"].tax_rates_final_id[selected_value].value;' . "\n\n" . '  if ( (parameterVal > 0) && (tax_rates[parameterVal] > 0) ) {' . "\n" . '    return tax_rates[parameterVal];' . "\n" . '  } else {' . "\n" . '    return 0;' . "\n" . '  }' . "\n" . '}' . "\n\n" . 'function updateGross(inField, setField) {' . "\n" . '  var taxRate = getTaxRate();' . "\n" . '  var grossValue = document.forms["' . $form_action . '"].elements[inField].value;' . "\n\n" . '  if (taxRate > 0) {' . "\n" . '    grossValue = grossValue * ((taxRate / 100) + 1);' . "\n" . '  }' . "\n\n" . '  document.forms["' . $form_action . '"].elements[setField].value = doRound(grossValue, 4);' . "\n" . '}' . "\n\n" . 'function updateNet(inField, setField) {' . "\n" . '  var taxRate = getTaxRate();' . "\n" . '  var netValue = document.forms["' . $form_action . '"].elements[inField].value;' . "\n\n" . '  if (taxRate > 0) {' . "\n" . '    netValue = netValue / ((taxRate / 100) + 1);' . "\n" . '  }' . "\n\n" . '  document.forms["' . $form_action . '"].elements[setField].value = doRound(netValue, 4);' . "\n" . '}' . "\n\n" . 'function updatePrices(net, gross) {' . "\n\n" . '  if (gross) {' . "\n" . '    ' . $update_gross_string . "\n" . '  }' . "\n\n" . '  if (net) {' . "\n" . '    ' . $update_net_string . "\n" . '  }' . "\n\n" . '}' . "\n\n" . '/* ]]> */' . "\n" . '</script>' . "\n";
        if ($product['products_status'] == '1') {
            $products_status_image = xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_green.gif', ICON_TITLE_STATUS_GREEN);
        } else {
            $products_status_image = xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_red.gif', ICON_TITLE_STATUS_RED);
        }
        if (isset($_GET['pID'])) {
            $smarty->assign('update', true);
        }
        if ($messageStack->size('price_error') > 0) {
            $smarty->assign('message_price_error', $messageStack->output('price_error'));
        }
        $smarty->assign(array('edit_prices' => true, 'product_id' => $product['products_id'], 'product_model' => $product['products_model'], 'product_status_image' => $products_status_image, 'product_name' => $product['products_name'], 'javascript' => $javascript, 'form_begin' => xos_draw_form($form_action, FILENAME_UPDATE_PRODUCTS_PRICES, 'product_ID=' . $product['products_id'] . '&categories_or_pages_id=' . $categories_or_pages_id . '&manufacturers_id=' . $manufacturers_id . '&max_rows=' . $_GET['max_rows'] . '&page=' . $_GET['page'] . ($_GET['specials_only'] ? '&specials_only=' . $_GET['specials_only'] : '') . '&action=' . $form_action, 'post', 'onsubmit="return confirm(\'' . JS_CONFIRM_UPDATE . '\')" enctype="multipart/form-data"'), 'pull_down_products_tax_class' => xos_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $product['products_tax_class_id']), 'pull_down_tax_rates' => xos_draw_pull_down_menu('tax_rates_final_id', $tax_rates_final_array, '', 'onchange="updatePrices(false, true)"'), 'update_prices' => 'updatePrices(true, true)', 'update_checked_string' => $update_checked_string, 'customers_groups' => $customers_groups_array, 'attributes_values' => $attributes_values_array, 'hidden_price_array' => xos_draw_hidden_field('price_array', $product['products_price']), 'hidden_attributes_price_array' => xos_draw_hidden_field('attributes_price_array', serialize($current_attributes_values_array)), 'link_filename_update_products_prices' => xos_href_link(FILENAME_UPDATE_PRODUCTS_PRICES, 'categories_or_pages_id=' . $categories_or_pages_id . '&manufacturers_id=' . $manufacturers_id . '&max_rows=' . $_GET['max_rows'] . '&page=' . $_GET['page'] . ($_GET['specials_only'] ? '&specials_only=' . $_GET['specials_only'] : ''))));
    }
    $smarty->assign('form_end', '</form>');
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'update_products_prices');
    $output_update_products_prices = $smarty->fetch(ADMIN_TPL . '/update_products_prices.tpl');
    $smarty->assign('central_contents', $output_update_products_prices);
    $smarty->display(ADMIN_TPL . '/frame.tpl');
    require DIR_WS_INCLUDES . 'application_bottom.php';
}
Esempio n. 18
0
     $form_tag = xos_draw_form('pages', FILENAME_PAGES, 'action=delete_page_confirm&cPath=' . $cPath) . xos_draw_hidden_field('categories_or_pages_id', $cInfo->categories_or_pages_id);
     $contents[] = array('text' => TEXT_DELETE_PAGE_INTRO);
     $contents[] = array('text' => '<br /><b>' . $cInfo->categories_or_pages_name . '</b>');
     if ($cInfo->children_count > 0) {
         $contents[] = array('text' => '<br />' . sprintf(TEXT_DELETE_WARNING_CHILDREN, $cInfo->children_count));
     }
     if ($cInfo->products_count > 0) {
         $contents[] = array('text' => '<br />' . sprintf(TEXT_DELETE_WARNING_PRODUCTS, $cInfo->products_count));
     }
     $contents[] = array('text' => '<br /><a href="" onclick="pages.submit(); return false" class="btn btn-danger btn-margin-infobox" title=" ' . BUTTON_TITLE_DELETE . ' ">' . BUTTON_TEXT_DELETE . '</a><a href="' . xos_href_link(FILENAME_PAGES, 'cPath=' . $cPath . '&cpID=' . $cInfo->categories_or_pages_id) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a><br />&nbsp;');
     break;
 case 'move_page':
     $heading_title = '<b>' . TEXT_INFO_HEADING_MOVE_PAGE . '</b>';
     $form_tag = xos_draw_form('pages', FILENAME_PAGES, 'action=move_page_confirm&cPath=' . $cPath) . xos_draw_hidden_field('categories_or_pages_id', $cInfo->categories_or_pages_id);
     $contents[] = array('text' => sprintf(TEXT_MOVE_PAGES_INTRO, $cInfo->categories_or_pages_name));
     $contents[] = array('text' => '<br />' . sprintf(TEXT_MOVE, $cInfo->categories_or_pages_name) . '<br /><div class="form-group">' . xos_draw_pull_down_menu('move_to_page_id', xos_get_page_tree(), $cInfo->categories_or_pages_id, 'class="form-control"') . '</div>');
     $contents[] = array('text' => '<br /><a href="" onclick="pages.submit(); return false" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_MOVE . ' ">' . BUTTON_TEXT_MOVE . '</a><a href="' . xos_href_link(FILENAME_PAGES, 'cPath=' . $cPath . '&cpID=' . $cInfo->categories_or_pages_id) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a><br />&nbsp;');
     break;
 default:
     if ($rows > 0) {
         if (isset($cInfo) && is_object($cInfo)) {
             // page info box contents
             $page_path_string = '';
             $page_path = xos_generate_page_path($cInfo->categories_or_pages_id);
             for ($i = sizeof($page_path[0]) - 1; $i > 0; $i--) {
                 $page_path_string .= $page_path[0][$i]['id'] . '_';
             }
             $page_path_string = substr($page_path_string, 0, -1);
             $heading_title = '<b>' . $cInfo->categories_or_pages_name . '</b>';
             $contents[] = array('text' => '<a href="' . xos_href_link(FILENAME_PAGES, 'cPath=' . $page_path_string . '&cpID=' . $cInfo->categories_or_pages_id . '&action=new_page') . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_EDIT . ' ">' . BUTTON_TEXT_EDIT . '</a><a href="' . xos_href_link(FILENAME_PAGES, 'cPath=' . $page_path_string . '&cpID=' . $cInfo->categories_or_pages_id . '&action=move_page') . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_MOVE . ' ">' . BUTTON_TEXT_MOVE . '</a><a href="' . xos_href_link(FILENAME_PAGES, 'cPath=' . $page_path_string . '&cpID=' . $cInfo->categories_or_pages_id . '&action=delete_page') . '" class="btn btn-danger btn-margin-infobox" title=" ' . BUTTON_TITLE_DELETE . ' ">' . BUTTON_TEXT_DELETE . '</a><a href="' . xos_href_link(FILENAME_PAGES, xos_get_path($cInfo->categories_or_pages_id) . '&action=new_page') . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_NEW_PAGE . ' ' . $cInfo->categories_or_pages_name . ' ">' . BUTTON_TEXT_NEW_PAGE . ' "' . $cInfo->categories_or_pages_name . '"</a>');
             $contents[] = array('text' => '<br />' . TEXT_DATE_ADDED . ' ' . xos_date_short($cInfo->date_added));
     $categories_query = xos_db_query("select c.categories_or_pages_id, cpd.categories_or_pages_name, c.parent_id from " . TABLE_CATEGORIES_OR_PAGES . " c, " . TABLE_CATEGORIES_OR_PAGES_DATA . " cpd where c.categories_or_pages_id = cpd.categories_or_pages_id and cpd.language_id = '" . (int) $_SESSION['used_lng_id'] . "' and c.parent_id = '" . (int) $parent_id . "' order by c.sort_order, cpd.categories_or_pages_name");
     while ($categories = xos_db_fetch_array($categories_query)) {
         $categories_string .= " or p2c.categories_or_pages_id = '" . $categories['categories_or_pages_id'] . "'";
         $categories_string = xos_get_categories_string($categories['categories_or_pages_id'], '', $categories_string);
     }
     return $categories_string;
 }
 $javascript = '<script type="text/javascript">' . "\n" . '/* <![CDATA[ */' . "\n\n" . 'function toggle() {' . "\n" . '  if (document.getElementById("options").style.display == "none"){' . "\n" . '    document.getElementById("filter").style.display="none";' . "\n" . '    document.getElementById("no-filter").style.display="";' . "\n" . '    document.getElementById("options").style.display="";' . "\n" . '    document.getElementById("attributes").style.display="none";' . "\n" . '  } else {' . "\n" . '    document.getElementById("filter").style.display="";' . "\n" . '    document.getElementById("no-filter").style.display="none";' . "\n" . '    document.getElementById("options").style.display="none";' . "\n" . '    document.getElementById("attributes").style.display="";' . "\n" . '  }' . "\n" . '}' . "\n\n" . '/* ]]> */' . "\n" . '</script>' . "\n";
 require DIR_WS_INCLUDES . 'html_header.php';
 require DIR_WS_INCLUDES . 'header.php';
 require DIR_WS_INCLUDES . 'column_left.php';
 require DIR_WS_INCLUDES . 'footer.php';
 if ($pID) {
     $smarty->assign(array('single_product' => true, 'text_new_product' => sprintf(TEXT_NEW_PRODUCT_3, $form_action == 'insert_product' ? TEXT_NEW_PRODUCT_1 : TEXT_NEW_PRODUCT_2, xos_output_generated_category_path($current_category_id)), 'link_back_to_product_list' => xos_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pID), 'form_begin_filter_products_attributes' => xos_draw_form('filter_products_attributes', FILENAME_PRODUCTS_ATTRIBUTES, '', 'get'), 'pull_down_menu_max_rows' => xos_draw_pull_down_menu('max_rows', $max_display_rows_array, $_GET['max_rows'], 'style="width: 75px;"'), 'hidden_fields_page_info' => xos_draw_hidden_field('pID', $pID) . xos_draw_hidden_field('cPath', $cPath) . xos_draw_hidden_field('selected_tax_rate_id', $_GET['selected_tax_rate_id']) . xos_draw_hidden_field('option_page', $_GET['option_page']) . xos_draw_hidden_field('value_page', $_GET['value_page']) . xos_draw_hidden_field('attribute_page', $_GET['attribute_page']), 'form_end_filter' => '</form>'));
 } else {
     $smarty->assign(array('form_begin_filter_products_attributes' => xos_draw_form('filter_products_attributes', FILENAME_PRODUCTS_ATTRIBUTES, '', 'get'), 'pull_down_menu_categories_or_pages_id' => xos_draw_pull_down_menu('categories_or_pages_id', xos_get_category_tree(), $categories_or_pages_id), 'pull_down_menu_manufacturers_id' => xos_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $manufacturers_id), 'pull_down_menu_max_rows' => xos_draw_pull_down_menu('max_rows', $max_display_rows_array, $_GET['max_rows'], 'style="width: 75px;"'), 'pull_down_menu_max_products' => xos_draw_pull_down_menu('max_products_in_pullwown', $max_display_products_in_pulldown_array, $_GET['max_products_in_pullwown'], 'style="width: 155px;"'), 'hidden_fields_page_info' => xos_draw_hidden_field('selected_tax_rate_id', $_GET['selected_tax_rate_id']) . xos_draw_hidden_field('option_page', $_GET['option_page']) . xos_draw_hidden_field('value_page', $_GET['value_page']) . xos_draw_hidden_field('attribute_page', $_GET['attribute_page']), 'form_end_filter' => '</form>'));
 }
 if (SESSID) {
     $smarty->assign('hidden_field_session', xos_draw_hidden_field(xos_session_name(), xos_session_id()));
 }
 $js_init_style = '<script type="text/javascript">' . "\n" . '/* <![CDATA[ */' . "\n\n";
 if ($_GET['first_entrance']) {
     $js_init_style .= '    document.getElementById("filter").style.display="";' . "\n" . '    document.getElementById("no-filter").style.display="none";' . "\n" . '    document.getElementById("options").style.display="none";' . "\n" . '    document.getElementById("attributes").style.display="none";' . "\n\n";
 } elseif ($_GET['options_page']) {
     $js_init_style .= '    document.getElementById("filter").style.display="none";' . "\n" . '    document.getElementById("no-filter").style.display="";' . "\n" . '    document.getElementById("options").style.display="";' . "\n" . '    document.getElementById("attributes").style.display="none";' . "\n\n";
 } else {
     $js_init_style .= '    document.getElementById("filter").style.display="";' . "\n" . '    document.getElementById("no-filter").style.display="none";' . "\n" . '    document.getElementById("options").style.display="none";' . "\n" . '    document.getElementById("attributes").style.display="";' . "\n\n";
 }
 $js_init_style .= '/* ]]> */' . "\n" . '</script>' . "\n";
 $smarty->assign('js_init_style', $js_init_style);
 if (!$_GET['first_entrance']) {
            for ($i = 10; $i <= 50; $i = $i + 10) {
                if (MAX_DISPLAY_SEARCH_RESULTS <= $i && $set == false) {
                    $max_display_search_results_array[] = array('id' => xos_href_link(FILENAME_ADVANCED_SEARCH_AND_RESULTS, xos_get_all_get_params(array('mdsr', 'page')) . 'mdsr=' . MAX_DISPLAY_SEARCH_RESULTS, 'NONSSL', true, true, false, false, false), 'text' => MAX_DISPLAY_SEARCH_RESULTS . TEXT_MAX_PRODUCTS);
                    $max_display_search_results_array_noscript[] = array('id' => MAX_DISPLAY_SEARCH_RESULTS, 'text' => MAX_DISPLAY_SEARCH_RESULTS . TEXT_MAX_PRODUCTS);
                    $set = true;
                }
                if (MAX_DISPLAY_SEARCH_RESULTS != $i) {
                    $max_display_search_results_array[] = array('id' => xos_href_link(FILENAME_ADVANCED_SEARCH_AND_RESULTS, xos_get_all_get_params(array('mdsr', 'page')) . 'mdsr=' . $i, 'NONSSL', true, true, false, false, false), 'text' => $i . TEXT_MAX_PRODUCTS);
                    $max_display_search_results_array_noscript[] = array('id' => $i, 'text' => $i . TEXT_MAX_PRODUCTS);
                }
            }
            if ($set == false) {
                $max_display_search_results_array[] = array('id' => xos_href_link(FILENAME_ADVANCED_SEARCH_AND_RESULTS, xos_get_all_get_params(array('mdsr', 'page')) . 'mdsr=' . MAX_DISPLAY_SEARCH_RESULTS, 'NONSSL', true, true, false, false, false), 'text' => MAX_DISPLAY_SEARCH_RESULTS . TEXT_MAX_PRODUCTS);
                $max_display_search_results_array_noscript[] = array('id' => MAX_DISPLAY_SEARCH_RESULTS, 'text' => MAX_DISPLAY_SEARCH_RESULTS . TEXT_MAX_PRODUCTS);
            }
            $pull_down_menu_display_search_results .= xos_draw_pull_down_menu('mdsr', $max_display_search_results_array, xos_href_link(FILENAME_ADVANCED_SEARCH_AND_RESULTS, xos_get_all_get_params(array('mdsr', 'page')) . 'mdsr=' . (isset($_SESSION['mdsr']) ? $_SESSION['mdsr'] : MAX_DISPLAY_SEARCH_RESULTS), 'NONSSL', true, true, false, false, false), 'class="form-control" id="mdsr" onchange="location = form.mdsr.options[form.mdsr.selectedIndex].value;"') . '</form>';
            $pull_down_menu_display_search_results_noscript .= xos_draw_pull_down_menu('mdsr', $max_display_search_results_array_noscript, isset($_SESSION['mdsr']) ? $_SESSION['mdsr'] : MAX_DISPLAY_SEARCH_RESULTS, 'class="form-control" id="mdsr"');
            $link_switch_search_results_view = xos_href_link(FILENAME_ADVANCED_SEARCH_AND_RESULTS, xos_get_all_get_params(array('srv', 'sort', 'page')) . 'srv=' . ($product_list_b ? 'list' : 'grid'), 'NONSSL', true, true, false, false, false);
        }
        $smarty->assign(array('pull_down_menu_display_products' => $pull_down_menu_display_search_results, 'pull_down_menu_display_products_noscript_begin' => $pull_down_menu_display_search_results_noscript, 'pull_down_menu_display_products_noscript_end' => '</form>', 'label_for_max_display_products' => 'mdsr', 'link_switch_view' => $link_switch_search_results_view));
        $listing_sql = $select_str . $from_str . $where_str . $order_str;
        $max_display = isset($_SESSION['mdsr']) ? $_SESSION['mdsr'] : MAX_DISPLAY_SEARCH_RESULTS;
        require DIR_WS_MODULES . FILENAME_PRODUCT_LISTING;
    }
    ///////////////////////////////////////////////////////////
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'advanced_search_and_results');
    $output_advanced_search_and_results = $smarty->fetch(SELECTED_TPL . '/advanced_search_and_results.tpl');
    $smarty->assign('central_contents', $output_advanced_search_and_results);
    $smarty->display(SELECTED_TPL . '/frame.tpl');
    require DIR_WS_INCLUDES . 'application_bottom.php';
}
Esempio n. 21
0
     while ($categories = xos_db_fetch_array($categories_query)) {
         $categories_string .= " or p2c.categories_or_pages_id = '" . $categories['categories_or_pages_id'] . "'";
         $categories_string = xos_get_categories_string($categories['categories_or_pages_id'], '', $categories_string);
     }
     return $categories_string;
 }
 $javascript = '<script type="text/JavaScript">' . "\n" . '/* <![CDATA[ */' . "\n" . '  function cOn(td) {' . "\n" . '    if(document.getElementById||(document.all && !(document.getElementById))) {' . "\n" . '      td.style.backgroundColor="#CCCCCC";' . "\n" . '    }' . "\n" . '  }' . "\n\n" . '  function cOnA(td) {' . "\n" . '    if(document.getElementById||(document.all && !(document.getElementById))) {' . "\n" . '      td.style.backgroundColor="#CCFFFF";' . "\n" . '    }' . "\n" . '  }' . "\n\n" . '  function cOut(td) {' . "\n" . '    if(document.getElementById||(document.all && !(document.getElementById))) {' . "\n" . '      td.style.backgroundColor="#DFE4F4";' . "\n" . '    }' . "\n" . '  }' . "\n" . '/* ]]> */' . "\n" . '</script>' . "\n";
 require DIR_WS_INCLUDES . 'html_header.php';
 require DIR_WS_INCLUDES . 'header.php';
 require DIR_WS_INCLUDES . 'column_left.php';
 require DIR_WS_INCLUDES . 'footer.php';
 if (!$_GET['sort'] && !$_POST['run_update']) {
     if ($_GET['page'] == '') {
         $_GET['page'] = '1';
     }
     $smarty->assign(array('set_filter' => true, 'form_begin_filter_xsell_products' => xos_draw_form('filter_xsell_products', FILENAME_XSELL_PRODUCTS, $_GET['first_entrance'] ? '' : xos_get_all_get_params(), 'get'), 'pull_down_menu_categories_or_pages_id' => xos_draw_pull_down_menu('categories_or_pages_id', xos_get_category_tree(), $categories_or_pages_id), 'pull_down_menu_manufacturers_id' => xos_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $manufacturers_id), 'pull_down_menu_max_rows' => xos_draw_pull_down_menu('max_rows', $max_display_xsell_results_array, $_GET['max_rows'], 'style="width: 75px;"'), 'hidden_field_add_related_product_ID' => xos_draw_hidden_field('add_related_product_ID', $_GET['add_related_product_ID'])));
     if (SESSID) {
         $smarty->assign('hidden_field_session', xos_draw_hidden_field(xos_session_name(), xos_session_id()));
     }
 }
 //////////////////////////////////////////////////////////////////////////////////
 if (!$_GET['add_related_product_ID'] && !$_GET['first_entrance']) {
     if ($categories_or_pages_id) {
         $includes_categories = xos_get_categories_string($categories_or_pages_id, true);
     }
     $products_query_raw = "select distinct a.products_id, b.products_name, a.products_model, a.products_status from " . TABLE_PRODUCTS . " a, " . TABLE_PRODUCTS_DESCRIPTION . " b, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where b.products_id = a.products_id and b.products_id = p2c.products_id and b.language_id = '" . (int) $_SESSION['used_lng_id'] . "'" . ($categories_or_pages_id ? " and (" . $includes_categories . ")" : "") . ($manufacturers_id ? " and a.manufacturers_id ='" . $manufacturers_id . "'" : "") . " ORDER BY b.products_name";
     $products_split = new splitPageResults($_GET['page'], $_GET['max_rows'], $products_query_raw, $products_query_numrows, 'a.products_id');
     $products_query = xos_db_query($products_query_raw);
     if ($products_query_numrows > 0) {
         /* now we will query the DB for existing related items */
         $products_array = array();
Esempio n. 22
0
                if (substr($file, strrpos($file, '.')) == $file_extension) {
                    $files_array[] = array('filename' => $file, 'link_filename_define_language_filename' => xos_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $_GET['lngdir'] . '&subdir=payment&filename=' . $file));
                }
            }
            $dir->close();
            $smarty->assign('files_payment', $files_array);
        }
        if ($dir = @dir(DIR_FS_SMARTY . 'catalog/languages/' . $_GET['lngdir'] . '/modules/shipping')) {
            $file_extension = substr(basename($_SERVER['PHP_SELF']), strrpos(basename($_SERVER['PHP_SELF']), '.'));
            $files_array = array();
            while ($file = $dir->read()) {
                if (substr($file, strrpos($file, '.')) == $file_extension) {
                    $files_array[] = array('filename' => $file, 'link_filename_define_language_filename' => xos_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $_GET['lngdir'] . '&subdir=shipping&filename=' . $file));
                }
            }
            $dir->close();
            $smarty->assign('files_shipping', $files_array);
        }
        $smarty->assign(array('filename' => $filename, 'filename_conf' => $filename_conf, 'filename_email_conf' => $filename_email_conf, 'link_filename_define_language_filename' => xos_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $_GET['lngdir'] . '&filename=' . $filename), 'link_filename_define_language_filename_conf' => xos_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $_GET['lngdir'] . '&filename=' . $filename_conf), 'link_filename_define_language_filename_email_conf' => xos_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $_GET['lngdir'] . '&filename=' . $filename_email_conf), 'link_filename_file_manager' => xos_href_link(FILENAME_FILE_MANAGER, 'goto=' . DIR_FS_SMARTY . 'catalog/languages/')));
        //    $smarty->assign('link_filename_file_manager', xos_href_link(FILENAME_FILE_MANAGER, 'goto=' . DIR_FS_SMARTY . 'catalog/languages/' . $_GET['lngdir']));
    }
    if (SESSID) {
        $smarty->assign('hidden_field_session', xos_draw_hidden_field(xos_session_name(), xos_session_id()));
    }
    $smarty->assign(array('form_begin_language' => xos_draw_form('lng', FILENAME_DEFINE_LANGUAGE, '', 'get'), 'pull_down_lngdir' => xos_draw_pull_down_menu('lngdir', $languages_array, $_GET['lngdir'], 'onchange="this.form.submit();"'), 'form_end' => '</form>'));
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'define_language');
    $output_define_language = $smarty->fetch(ADMIN_TPL . '/define_language.tpl');
    $smarty->assign('central_contents', $output_define_language);
    $smarty->display(ADMIN_TPL . '/frame.tpl');
    require DIR_WS_INCLUDES . 'application_bottom.php';
}
Esempio n. 23
0
     $shipping_allowed_array = array();
     for ($i = 0, $n = sizeof($ship_directory_array); $i < $n; $i++) {
         $file = $ship_directory_array[$i];
         if (in_array($ship_directory_array[$i], $ship_module_active)) {
             include $ship_module_directory . $file;
             include DIR_FS_SMARTY . 'admin/languages/' . $_SESSION['language'] . '/modules/shipping/' . $file;
             $ship_class = substr($file, 0, strrpos($file, '.'));
             if (xos_class_exists($ship_class)) {
                 $ship_module = new $ship_class();
                 if ($ship_module->enabled) {
                     $shipping_allowed_array[] = array('group_shipping_allowed_in_values' => xos_draw_checkbox_field('shipping_allowed[' . $y . ']', $file, 0), 'group_shipping_allowed_title' => $ship_module->title);
                 }
             }
         }
     }
     $smarty->assign(array('shipping_allowed' => $shipping_allowed_array, 'new' => true, 'form_begin_customers_new' => xos_draw_form('customers', FILENAME_CUSTOMERS_GROUPS, xos_get_all_get_params(array('action')) . 'action=newconfirm', 'post', 'onsubmit="return check_form();"'), 'group_name_in_values' => xos_draw_input_field('customers_group_name', '', 'maxlength="32"', false), 'group_discount_in_out_values' => xos_draw_input_field('customers_group_discount', $cInfo->customers_group_discount, 'maxlength="5" size="5"', false), 'group_show_tax_in_values' => xos_draw_pull_down_menu('customers_group_show_tax', $cg_show_tax_array, '1'), 'group_tax_exempt_in_values' => xos_draw_pull_down_menu('customers_group_tax_exempt', $cg_tax_exempt_array, '0'), 'group_payment_settings_in_values_1' => xos_draw_radio_field('group_payment_settings', '1', false, '0'), 'group_payment_settings_in_values_0' => xos_draw_radio_field('group_payment_settings', '0', false, '0'), 'group_shipment_settings_in_values_1' => xos_draw_radio_field('group_shipment_settings', '1', false, xos_not_null($cInfo->group_shipment_allowed) ? '1' : '0'), 'group_shipment_settings_in_values_0' => xos_draw_radio_field('group_shipment_settings', '0', false, xos_not_null($cInfo->group_shipment_allowed) ? '1' : '0'), 'link_filename_customers_groups' => xos_href_link(FILENAME_CUSTOMERS_GROUPS, xos_get_all_get_params(array('action', 'cID'))), 'form_end' => '</form>'));
 } else {
     switch ($_GET[listing]) {
         case "group":
             $order = "g.customers_group_name";
             break;
         case "group-desc":
             $order = "g.customers_group_name DESC";
             break;
         default:
             $order = "g.customers_group_id ASC";
     }
     $search_string = '';
     if ($_GET['search'] && xos_not_null($_GET['search'])) {
         $keywords = xos_db_input(xos_db_prepare_input($_GET['search']));
         $search_string = "where g.customers_group_name like '%" . $keywords . "%'";
Esempio n. 24
0
        }
        $product_images[] = array('img_no' => $img_no, 'selection_delete_image' => xos_draw_selection_field('delete_product_image_' . $i, 'checkbox', 'true'), 'radio_large_image_default_size' => xos_draw_radio_field('large_image_size_' . $i, 'default', true), 'radio_large_image_uploaded_size' => xos_draw_radio_field('large_image_size_' . $i, 'uploaded', false), 'radio_large_image_input_size' => xos_draw_radio_field('large_image_size_' . $i, 'input', false), 'input_large_image_max_width' => xos_draw_input_field('large_image_max_width_' . $i, '', 'style="background: #fffffe;" size ="2"'), 'input_large_image_max_height' => xos_draw_input_field('large_image_max_height_' . $i, '', 'style="background: #fffffe;" size ="2"'), 'small_product_image_max_height' => SMALL_PRODUCT_IMAGE_MAX_HEIGHT, 'image' => xos_image(DIR_WS_CATALOG_IMAGES . 'products/small/' . $products_image[$i]['name'], $pInfo->products_name), 'file_image' => xos_draw_file_field('products_image_' . $i), 'image_name' => $products_image[$i]['name'], 'large_img_width' => $large_img_size[0], 'large_img_height' => $large_img_size[1], 'large_img_base' => $products_image[$i]['large_image_max_width'] == 'default' ? 'default_size' : ($products_image[$i]['large_image_max_width'] == '0' ? 'origin_size' : ((int) $products_image[$i]['large_image_max_width'] > 0 ? 'self_selected_size' : '')), 'hidden_current_image' => xos_draw_hidden_field('current_product_image_' . $i, $products_image[$i]['name']));
        if (empty($products_image[$i]['name'])) {
            $more_images = true;
        }
    }
    $product_values = array();
    if (WYSIWYG_FOR_PRODUCT == 'true') {
        $smarty->assign(array('wysiwyg' => true, 'link_filename_popup_file_manager_link_selection' => str_replace('&amp;', '&', xos_href_link(FILENAME_POPUP_FILE_MANAGER, 'action=link_entrence&goto=' . DIR_FS_DOCUMENT_ROOT . 'contents')), 'link_filename_popup_file_manager_image' => str_replace('&amp;', '&', xos_href_link(FILENAME_POPUP_FILE_MANAGER, 'action=no_link_entrence&goto=' . DIR_FS_DOCUMENT_ROOT . 'contents/image')), 'link_filename_popup_file_manager_flash' => str_replace('&amp;', '&', xos_href_link(FILENAME_POPUP_FILE_MANAGER, 'action=no_link_entrence&goto=' . DIR_FS_DOCUMENT_ROOT . 'contents/flash')), 'product_config' => (ENABLE_SSL == 'true' ? $_SESSION['disable_ssl'] ? HTTP_SERVER : HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/ckconfig/product_config.js', 'product_base_href' => ENABLE_SSL == 'true' ? $_SESSION['disable_ssl'] ? HTTP_SERVER : HTTPS_SERVER : HTTP_SERVER, 'lang_code' => xos_get_languages_code()));
    }
    for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
        sizeof($languages) > 1 ? $sort_order = 'products_id' : ($sort_order = 'products_p_unit');
        $products_p_units_array = array(array('id' => '', 'text' => TEXT_NONE));
        $products_p_units_query = xos_db_query("select distinct products_p_unit from " . TABLE_PRODUCTS_DESCRIPTION . " where language_id = '" . $languages[$i]['id'] . "' order by '" . $sort_order . "'");
        while ($products_p_units = xos_db_fetch_array($products_p_units_query)) {
            if (!empty($products_p_units['products_p_unit'])) {
                $products_p_units_array[] = array('id' => $products_p_units['products_p_unit'], 'text' => $products_p_units['products_p_unit']);
            }
        }
        $product_values[] = array('languages_image' => xos_image(DIR_WS_CATALOG_IMAGES . 'catalog/templates/' . DEFAULT_TPL . '/' . $languages[$i]['directory'] . '/' . $languages[$i]['image'], $languages[$i]['name']), 'input_name' => xos_draw_input_field('products_name[' . $languages[$i]['id'] . ']', isset($products_name[$languages[$i]['id']]) ? stripslashes($products_name[$languages[$i]['id']]) : xos_get_products_name($pInfo->products_id, $languages[$i]['id']), 'size="30"'), 'input_description_tab_label' => xos_draw_input_field('products_description_tab_label[' . $languages[$i]['id'] . ']', isset($products_description_tab_label[$languages[$i]['id']]) ? stripslashes($products_description_tab_label[$languages[$i]['id']]) : xos_get_products_description_tab_label($pInfo->products_id, $languages[$i]['id']), 'size="90"'), 'pull_down_input_p_unit' => xos_draw_pull_down_menu('products_p_unit[' . $languages[$i]['id'] . ']', $products_p_units_array, isset($products_p_unit[$languages[$i]['id']]) ? stripslashes($products_p_unit[$languages[$i]['id']]) : xos_get_products_p_unit($pInfo->products_id, $languages[$i]['id']), 'style="width: 17em"'), 'input_new_p_unit' => xos_draw_input_field('products_new_p_unit[' . $languages[$i]['id'] . ']'), 'info_name' => 'products_info[' . $languages[$i]['id'] . ']', 'description_name' => 'products_description[' . $languages[$i]['id'] . ']', 'product_info_template_file' => (ENABLE_SSL == 'true' ? $_SESSION['disable_ssl'] ? HTTP_SERVER : HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN . 'includes/ckconfig/templates/' . $languages[$i]['directory'] . '/product_info_template.js', 'product_info_template_lang' => $languages[$i]['directory'] . '_default', 'product_description_template_file' => (ENABLE_SSL == 'true' ? $_SESSION['disable_ssl'] ? HTTP_SERVER : HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN . 'includes/ckconfig/templates/' . $languages[$i]['directory'] . '/product_description_template.js', 'product_description_template_lang' => $languages[$i]['directory'] . '_default', 'textarea_info' => xos_draw_textarea_field('products_info[' . $languages[$i]['id'] . ']', '90', '4', isset($products_info[$languages[$i]['id']]) ? stripslashes($products_info[$languages[$i]['id']]) : xos_get_products_info($pInfo->products_id, $languages[$i]['id'])), 'textarea_description' => xos_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', '90', '15', isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : xos_get_products_description($pInfo->products_id, $languages[$i]['id'])), 'input_url' => xos_draw_input_field('products_url[' . $languages[$i]['id'] . ']', isset($products_url[$languages[$i]['id']]) ? stripslashes($products_url[$languages[$i]['id']]) : xos_get_products_url($pInfo->products_id, $languages[$i]['id'])));
    }
    if (isset($_GET['pID'])) {
        $smarty->assign('update', true);
    }
    if ($messageStack->size('price_error') > 0) {
        $smarty->assign('message_price_error', $messageStack->output('price_error'));
    }
    $smarty->assign(array('javascript' => $javascript, 'form_begin' => xos_draw_form($form_action, FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '') . '&action=' . $form_action, 'post', 'onsubmit="return confirm(\'' . ($form_action == 'insert_product' ? JS_CONFIRM_INSERT : JS_CONFIRM_UPDATE) . '\')" enctype="multipart/form-data"'), 'text_new_product' => sprintf(TEXT_NEW_PRODUCT_3, $form_action == 'insert_product' ? TEXT_NEW_PRODUCT_1 : TEXT_NEW_PRODUCT_2, xos_output_generated_category_path($current_category_id)), 'radio_products_status_1' => xos_draw_radio_field('products_status', '1', $in_status), 'radio_products_status_0' => xos_draw_radio_field('products_status', '0', $out_status), 'pull_down_manufacturers' => xos_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $pInfo->manufacturers_id), 'pull_down_delivery_times' => xos_draw_pull_down_menu('products_delivery_time_id', $delivery_times_array, $pInfo->products_delivery_time_id == '' ? DEFAULT_DELIVERY_TIMES_ID : $pInfo->products_delivery_time_id), 'pull_down_products_tax_class' => xos_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id), 'pull_down_tax_rates' => xos_draw_pull_down_menu('tax_rates_final_id', $tax_rates_final_array, '', 'onchange="updatePrices(false, true)"'), 'update_prices' => 'updatePrices(true, true)', 'update_checked_string' => $update_checked_string, 'customers_groups' => $customers_groups_array, 'attributes_values' => $attributes_values_array, 'input_products_date_available' => xos_draw_input_field('products_date_available', $pInfo->products_date_available, 'id="products_date_available" style="background: #ebebff; color : red;" size ="10"'), 'input_products_quantity' => STOCK_CHECK == 'true' ? $has_product_attributes ? '<span id="total_qty">' . $pInfo->products_quantity . '</span>&nbsp;<a href="" onclick="get_attributes_qty_list(\'' . xos_href_link(FILENAME_ATTRIBUTES_QTY_LIST, 'products_id=' . $pInfo->products_id) . '\'); return false">' . xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_arrow_down.gif', '', 24, 15) . '</a>' . xos_draw_hidden_field('products_quantity', $pInfo->products_quantity) : xos_draw_input_field('products_quantity', $pInfo->products_quantity, 'size ="8"') : $pInfo->products_quantity, 'input_products_sort_order' => xos_draw_input_field('products_sort_order', $pInfo->products_sort_order, 'size ="8"'), 'input_products_model' => xos_draw_input_field('products_model', $pInfo->products_model), 'hidden_image_array' => xos_draw_hidden_field('image_array', $pInfo->products_image), 'hidden_price_array' => xos_draw_hidden_field('price_array', $pInfo->products_price), 'hidden_attributes_price_array' => xos_draw_hidden_field('attributes_price_array', serialize($current_attributes_values_array)), 'has_attributes_quantities' => STOCK_CHECK == 'true' && $has_product_attributes ? true : false, 'product_images' => $product_images, 'more_images' => $more_images, 'product_values' => $product_values, 'input_products_weight' => xos_draw_input_field('products_weight', $pInfo->products_weight, 'size ="8"'), 'hidden_products_date_added' => xos_draw_hidden_field('products_date_added', xos_not_null($pInfo->products_date_added) ? $pInfo->products_date_added : date('Y-m-d')), 'link_filename_categories' => xos_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '')), 'form_end' => '</form>'));
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'categories');
    $output_new_product = $smarty->fetch(ADMIN_TPL . '/includes/modules/new_product.tpl');
}
Esempio n. 25
0
                     if ($selected_attribute == false) {
                         $combi_str .= $products_options_name['products_options_id'] . ',' . $products_options['products_options_values_id'] . '_';
                         $flag = true;
                     } elseif ($selected_attribute == $products_options['products_options_values_id']) {
                         $combi_str .= $products_options_name['products_options_id'] . ',' . $products_options['products_options_values_id'] . '_';
                         $flag = true;
                     }
                 }
             }
         }
         if ($selected == false) {
             $products_options_noscript_array[0] = $products_options_noscript_selected_string;
         }
         $products_options_list_noscript = implode($products_options_noscript_array);
         if (xos_not_null($products_options_array)) {
             $product_options_array[] = array('products_options_name' => $products_options_name['products_options_name'], 'products_options_id' => $products_options_name['products_options_id'], 'products_options_list_noscript' => $products_options_list_noscript, 'products_options_pull_down' => xos_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute, 'class="form-control" id="option_' . $products_options_name['products_options_id'] . '" onchange="updateOptions(\'' . xos_href_link(FILENAME_UPDATE_OPTIONS, 'p=' . xos_get_prid($_GET['p']), 'NONSSL', true, false) . '\')"'));
             //                                           'products_options_pull_down' => xos_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute, 'class="form-control" id="option_' . $products_options_name['products_options_id'] . '" onchange="change_action(this.form); this.form.submit();"'));
         }
     }
     $jscript_op = '<script type="text/javascript">' . "\n\n" . '    var http_request = false;' . "\n\n" . '    function updateOptions(url,serialized_attributes) {' . "\n\n" . '      var serialized_options = "";' . "\n\n" . '      if(typeof(serialized_attributes) == "undefined"){' . "\n" . '        for (var i = 0; i < document.getElementsByTagName("select").length; i++) {' . "\n" . '          if(document.getElementsByTagName("select")[i].form.name == "cart_quantity") {' . "\n" . '            option_name = document.getElementsByTagName("select")[i].name;' . "\n" . '            selected_options_value_id = document.getElementsByTagName("select")[i].options[document.getElementsByTagName("select")[i].selectedIndex].value;' . "\n" . '            serialized_options += option_name + "=" + selected_options_value_id + "&";' . "\n" . '          }' . "\n" . '        }' . "\n" . '      } else {' . "\n" . '        serialized_options = serialized_attributes;' . "\n" . '      }' . "\n\n" . '      http_request = false;' . "\n\n" . '      if (window.XMLHttpRequest) { // Mozilla, Safari,...' . "\n" . '        http_request = new XMLHttpRequest();' . "\n" . '        if (http_request.overrideMimeType) {' . "\n" . '          http_request.overrideMimeType("text/html");' . "\n" . '        }' . "\n" . '      } else if (window.ActiveXObject) { // IE' . "\n" . '        try {' . "\n" . '          http_request = new ActiveXObject("Msxml2.XMLHTTP");' . "\n" . '        } catch (e) {' . "\n" . '          try {' . "\n" . '            http_request = new ActiveXObject("Microsoft.XMLHTTP");' . "\n" . '          } catch (e) {}' . "\n" . '        }' . "\n" . '      }' . "\n\n" . '      if (!http_request) {' . "\n" . '        alert("Ende : Kann keine XMLHTTP-Instanz erzeugen");' . "\n" . '        return false;' . "\n" . '      }' . "\n" . '      http_request.onreadystatechange = response_processing;' . "\n" . '      http_request.open("POST", url, true);' . "\n" . '      http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");' . "\n" . '      http_request.send(encodeURI(serialized_options));' . "\n\n" . '    }' . "\n\n" . '    function response_processing() {' . "\n" . '      if (http_request.readyState == 1) {' . "\n" . '        document.getElementById("options").style.visibility = "hidden";' . "\n" . '        document.getElementById("loading").style.visibility = "visible";' . "\n" . '        document.getElementById("inc").style.visibility = "hidden";' . "\n" . '        document.getElementById("dec").style.visibility = "hidden";' . "\n" . '        document.getElementById("products_quantity").style.visibility = "hidden";' . "\n" . '        document.getElementById("add_to_cart").style.visibility = "hidden";' . "\n" . '      } else if (http_request.readyState == 4) {' . "\n" . '        if (http_request.status == 200) {' . "\n" . '          document.getElementById("options").innerHTML = http_request.responseText;' . "\n" . '          document.getElementById("options").style.visibility = "visible";' . "\n" . '          document.getElementById("loading").style.visibility = "hidden";' . "\n" . '          document.getElementById("inc").style.visibility = "visible";' . "\n" . '          document.getElementById("dec").style.visibility = "visible";' . "\n" . '          document.getElementById("products_quantity").style.visibility = "visible";' . "\n" . '          document.getElementById("add_to_cart").style.visibility = "visible";' . "\n" . '        } else {' . "\n" . '          alert("Bei dem Request ist ein Problem aufgetreten.");' . "\n" . '        }' . "\n" . '      }' . "\n" . '    }' . "\n\n" . '    function getOptionsList(url) {' . "\n\n" . '      if (typeof(isLoaded) != "undefined" && isLoaded == true) {' . "\n" . '          toggle("box_products_options_overview");' . "\n" . '      } else {' . "\n\n" . '        http_request = false;' . "\n\n" . '        if (window.XMLHttpRequest) { // Mozilla, Safari,...' . "\n" . '            http_request = new XMLHttpRequest();' . "\n" . '            if (http_request.overrideMimeType) {' . "\n" . '                http_request.overrideMimeType("text/html");' . "\n" . '            }' . "\n" . '        } else if (window.ActiveXObject) { // IE' . "\n" . '            try {' . "\n" . '                http_request = new ActiveXObject("Msxml2.XMLHTTP");' . "\n" . '            } catch (e) {' . "\n" . '                try {' . "\n" . '                    http_request = new ActiveXObject("Microsoft.XMLHTTP");' . "\n" . '                } catch (e) {}' . "\n" . '            }' . "\n" . '        }' . "\n\n" . '        if (!http_request) {' . "\n" . '            alert("Ende : Kann keine XMLHTTP-Instanz erzeugen");' . "\n" . '            return false;' . "\n" . '        }' . "\n" . '        http_request.onreadystatechange = response_processing_list;' . "\n" . '        http_request.open("GET", url, true);' . "\n" . '        http_request.send(null);' . "\n\n" . '      }' . "\n\n" . '    }' . "\n\n" . '    function response_processing_list() {' . "\n" . '      if (http_request.readyState == 1) {' . "\n" . '        $("#loading_list").show(1);' . "\n" . '      } else if (http_request.readyState == 4) {' . "\n" . '        if (http_request.status == 200) {' . "\n" . '          document.getElementById("box_products_options_overview").innerHTML = http_request.responseText;' . "\n" . '          document.getElementById("loading_list").style.display = "none";' . "\n" . '          isLoaded = true;' . "\n" . '          toggle("box_products_options_overview");' . "\n" . '        } else {' . "\n" . '          alert("Bei dem Request ist ein Problem aufgetreten.");' . "\n" . '        }' . "\n" . '      }' . "\n" . '    }' . "\n\n" . '    function getAbsoluteX (elm) {' . "\n" . '      var x = 0;' . "\n" . '      if (elm && typeof elm.offsetParent != "undefined") {' . "\n" . '        while (elm && typeof elm.offsetLeft == "number") {' . "\n" . '          x += elm.offsetLeft;' . "\n" . '          elm = elm.offsetParent;' . "\n" . '        }' . "\n" . '      }' . "\n" . '      return x;' . "\n" . '    }' . "\n\n" . '    function toggle(targetId) {' . "\n" . '      var elem = document.getElementById(targetId);' . "\n" . '      if (elem.style.display == "none"){' . "\n" . '        elem.style.display="block";' . "\n" . '        var x = getAbsoluteX(elem);' . "\n" . '        elem.style.display="none";' . "\n" . '        if (x < 0){' . "\n" . '          oldRightValue = elem.style.right;' . "\n" . '          $("#"+targetId).css({"right" : x+"px"}).show(1);' . "\n" . '        } else {' . "\n" . '          $("#"+targetId).show(1);' . "\n" . '        }' . "\n" . '      } else {' . "\n" . '        if(typeof(oldRightValue) != "undefined" && oldRightValue != ""){' . "\n" . '          elem.style.right=oldRightValue;' . "\n" . '        }' . "\n" . '        elem.style.display="none";' . "\n" . '      }' . "\n" . '    }' . "\n\n" . '    function toggleByClassName(targetClass) {' . "\n" . '      var allElems = document.getElementsByTagName("span");' . "\n" . '      for (var i = 0; i < allElems.length; i++) {' . "\n" . '        var thisElem = allElems[i];' . "\n" . '        if (thisElem.className && thisElem.className == targetClass) {' . "\n" . '          if (thisElem.style.display == "none"){' . "\n" . '            thisElem.style.display = "";' . "\n" . '          } else {' . "\n" . '            thisElem.style.display = "none";' . "\n" . '          }' . "\n" . '        }' . "\n" . '      }' . "\n" . '    }' . "\n\n" . '</script>' . "\n";
     if (xos_not_null($attributes_quantity) && STOCK_CHECK == 'true') {
         if ($flag == false) {
             $combi_str .= $c_str;
         }
         $att_qty = $attributes_quantity[substr($combi_str, 0, -1)];
         $smarty->assign('qty_for_these_options', $att_qty > 0 ? $att_qty : '<span class="red-mark">' . $att_qty . '</span>');
     }
     $smarty->assign(array('link_options_noscript' => xos_href_link(FILENAME_OPTIONS_WINDOW, 'p=' . $product_info['products_id'] . '&products_name=' . urlencode($product_info['products_name'])), 'get_otions_list' => 'getOptionsList(\'' . xos_href_link(FILENAME_OPTIONS_LIST, 'p=' . xos_get_prid($_GET['p']), 'NONSSL', true, false) . '\');', 'products_options' => $product_options_array));
 }
 $reviews_query = xos_db_query("select count(*) as count from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . (int) $_GET['p'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int) $_SESSION['languages_id'] . "'");
 $reviews = xos_db_fetch_array($reviews_query);
Esempio n. 26
0
//              Released under the GNU General Public License
////////////////////////////////////////////////////////////////////////////////
if (!(@(include DIR_FS_SMARTY . 'catalog/templates/' . SELECTED_TPL . '/php/includes/boxes/manufacturers.php') == 'overwrite_all')) {
    $manufacturers_query = xos_db_query("select distinct mi.manufacturers_id, mi.manufacturers_name from " . TABLE_MANUFACTURERS_INFO . " mi left join " . TABLE_PRODUCTS . " p on mi.manufacturers_id = p.manufacturers_id left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id left join " . TABLE_CATEGORIES_OR_PAGES . " c on p2c.categories_or_pages_id = c.categories_or_pages_id where c.categories_or_pages_status = '1' and p.products_status = '1' and mi.languages_id = '" . (int) $_SESSION['languages_id'] . "' order by mi.manufacturers_name");
    if ($number_of_rows = xos_db_num_rows($manufacturers_query)) {
        $manufacturers_content = '';
        $manufacturers_content_noscript = '';
        $manufacturers_array = array();
        if (MAX_MANUFACTURERS_LIST < 2) {
            $manufacturers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
        }
        while ($manufacturers = xos_db_fetch_array($manufacturers_query)) {
            $manufacturers_name = strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN ? (function_exists('mb_substr') ? mb_substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN, 'UTF-8') : substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN)) . '..' : $manufacturers['manufacturers_name'];
            $manufacturers_array[] = array('id' => xos_href_link(FILENAME_DEFAULT, 'm=' . $manufacturers['manufacturers_id']), 'text' => $manufacturers_name);
            if (isset($_GET['m']) && $_GET['m'] == $manufacturers['manufacturers_id']) {
                $manufacturers_name = '<b>' . $manufacturers_name . '</b>';
            }
            $manufacturers_content_noscript .= '<a href="' . xos_href_link(FILENAME_DEFAULT, 'm=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a><br />';
        }
        $manufacturers_content_noscript = substr($manufacturers_content_noscript, 0, -6);
        $manufacturers_content = xos_draw_form('manufacturers', xos_href_link(FILENAME_DEFAULT, '', $request_type, false, true, false, false, false), 'get');
        $manufacturers_content .= xos_draw_pull_down_menu('m', $manufacturers_array, isset($_GET['m']) ? xos_href_link(FILENAME_DEFAULT, 'm=' . $_GET['m']) : '', 'class="form-control" onchange="if (form.m.selectedIndex != 0) location = form.m.options[form.m.selectedIndex].value;" size="' . MAX_MANUFACTURERS_LIST . '"');
        $manufacturers_content .= '</form>';
        if ($number_of_rows <= MAX_DISPLAY_MANUFACTURERS_IN_A_LIST) {
            $manufacturers_content = $manufacturers_content_noscript;
        }
        $smarty->assign(array('box_manufacturers_manufacturers' => $manufacturers_content, 'box_manufacturers_manufacturers_noscript' => $manufacturers_content_noscript));
        $output_manufacturers = $smarty->fetch(SELECTED_TPL . '/includes/boxes/manufacturers.tpl');
        $smarty->assign('box_manufacturers', $output_manufacturers);
    }
}
     $contents[] = array('text' => '<br />' . TEXT_INFO_FIRSTNAME . '<br />' . xos_draw_input_field('admin_firstname', $mInfo->admin_firstname));
     $contents[] = array('text' => '<br />' . TEXT_INFO_LASTNAME . '<br />' . xos_draw_input_field('admin_lastname', $mInfo->admin_lastname));
     if (isset($_GET['error'])) {
         $contents[] = array('text' => '<br />' . TEXT_INFO_EMAIL . '<br />' . xos_draw_input_field('admin_email_address'));
     } else {
         $contents[] = array('text' => '<br />' . TEXT_INFO_EMAIL . '<br />' . xos_draw_input_field('admin_email_address', $mInfo->admin_email_address));
     }
     if ($mInfo->admin_id == 1) {
         $contents[] = array('text' => xos_draw_hidden_field('admin_groups_id', $mInfo->admin_groups_id));
     } else {
         $groups_array = array(array('id' => '0', 'text' => TEXT_NONE));
         $groups_query = xos_db_query("select admin_groups_id, admin_groups_name from " . TABLE_ADMIN_GROUPS);
         while ($groups = xos_db_fetch_array($groups_query)) {
             $groups_array[] = array('id' => $groups['admin_groups_id'], 'text' => $groups['admin_groups_name']);
         }
         $contents[] = array('text' => '<br />' . TEXT_INFO_GROUP . '<br />' . xos_draw_pull_down_menu('admin_groups_id', $groups_array, $mInfo->admin_groups_id));
     }
     $contents[] = array('text' => '<br /><a href="" onclick="validateForm(); if(document.returnValue)newmember.submit(); return false" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_UPDATE . ' "><span>' . BUTTON_TEXT_UPDATE . '</span></a><a href="' . xos_href_link(FILENAME_ADMIN_MEMBERS, 'page=' . $_GET['page'] . '&mID=' . $_GET['mID']) . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_CANCEL . ' "><span>' . BUTTON_TEXT_CANCEL . '</span></a><br />&nbsp;');
     break;
 case 'del_member':
     $heading_title = '<b>' . TEXT_INFO_HEADING_DELETE . '</b>';
     if ($mInfo->admin_id == 1 || $mInfo->admin_email_address == STORE_OWNER_EMAIL_ADDRESS) {
         $contents[] = array('text' => '<br /><a href="' . xos_href_link(FILENAME_ADMIN_MEMBERS, 'page=' . $_GET['page'] . '&mID=' . $mInfo->admin_id) . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_BACK . ' "><span>' . BUTTON_TEXT_BACK . '</span></a><br />&nbsp;');
     } else {
         $form_tag = xos_draw_form('edit', FILENAME_ADMIN_MEMBERS, 'action=member_delete&page=' . $_GET['page'] . '&mID=' . $admin['admin_id'], 'post', 'enctype="multipart/form-data"');
         $contents[] = array('text' => xos_draw_hidden_field('admin_id', $mInfo->admin_id));
         $contents[] = array('text' => sprintf(TEXT_INFO_DELETE_INTRO, $mInfo->admin_firstname . ' ' . $mInfo->admin_lastname));
         $contents[] = array('text' => '<br /><a href="" onclick="edit.submit(); return false" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_DELETE . ' "><span>' . BUTTON_TEXT_DELETE . '</span></a><a href="' . xos_href_link(FILENAME_ADMIN_MEMBERS, 'page=' . $_GET['page'] . '&mID=' . $_GET['mID']) . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_CANCEL . ' "><span>' . BUTTON_TEXT_CANCEL . '</span></a><br />&nbsp;');
     }
     break;
 case 'new_group':
        $smarty->assign(array('account_gender' => true, 'input_gender' => xos_draw_radio_field('gender', 'm', $male, 'id="gender_m"') . '<label class="control-label" for="gender_m">&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;</label>' . xos_draw_radio_field('gender', 'f', $female, 'id="gender_f"') . '<label class="control-label" for="gender_f">&nbsp;&nbsp;' . FEMALE . '&nbsp;</label>' . (xos_not_null(ENTRY_GENDER_TEXT) ? '<span class="input-requirement">' . ENTRY_GENDER_TEXT . '</span>' : '')));
    }
    if (ACCOUNT_COMPANY == 'true') {
        $smarty->assign(array('account_company' => true, 'input_company' => xos_draw_input_field('company', '', 'class="form-control" id="company"') . '&nbsp;' . (xos_not_null(ENTRY_COMPANY_TEXT) ? '<span class="input-requirement">' . ENTRY_COMPANY_TEXT . '</span>' : '')));
    }
    if (ACCOUNT_SUBURB == 'true') {
        $smarty->assign(array('account_suburb' => true, 'input_suburb' => xos_draw_input_field('suburb', '', 'class="form-control" id="suburb"') . '&nbsp;' . (xos_not_null(ENTRY_SUBURB_TEXT) ? '<span class="input-requirement">' . ENTRY_SUBURB_TEXT . '</span>' : '')));
    }
    if (ACCOUNT_STATE == 'true') {
        $smarty->assign('account_state', true);
        if ($process == true) {
            if ($entry_state_has_zones == true) {
                $zones_array = array();
                $zones_query = xos_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int) $country . "' order by zone_name");
                while ($zones_values = xos_db_fetch_array($zones_query)) {
                    $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
                }
                $smarty->assign('input_state', xos_draw_pull_down_menu('state', $zones_array, '', 'class="form-control" id="state"') . '&nbsp;' . (xos_not_null(ENTRY_STATE_TEXT) ? '<span class="input-requirement">' . ENTRY_STATE_TEXT . '</span>' : ''));
            } else {
                $smarty->assign('input_state', xos_draw_input_field('state', '', 'class="form-control" id="state"') . '&nbsp;' . (xos_not_null(ENTRY_STATE_TEXT) ? '<span class="input-requirement">' . ENTRY_STATE_TEXT . '</span>' : ''));
            }
        } else {
            $smarty->assign('input_state', xos_draw_input_field('state', '', 'class="form-control" id="state"') . '&nbsp;' . (xos_not_null(ENTRY_STATE_TEXT) ? '<span class="input-requirement">' . ENTRY_STATE_TEXT . '</span>' : ''));
        }
    }
    $smarty->assign(array('input_firstname' => xos_draw_input_field('firstname', '', 'class="form-control" id="firstname"') . '&nbsp;' . (xos_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="input-requirement">' . ENTRY_FIRST_NAME_TEXT . '</span>' : ''), 'input_lastname' => xos_draw_input_field('lastname', '', 'class="form-control" id="lastname"') . '&nbsp;' . (xos_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="input-requirement">' . ENTRY_LAST_NAME_TEXT . '</span>' : ''), 'input_street_address' => xos_draw_input_field('street_address', '', 'class="form-control" id="street_address"') . '&nbsp;' . (xos_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="input-requirement">' . ENTRY_STREET_ADDRESS_TEXT . '</span>' : ''), 'input_postcode' => xos_draw_input_field('postcode', '', 'class="form-control" id="postcode"') . '&nbsp;' . (xos_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="input-requirement">' . ENTRY_POST_CODE_TEXT . '</span>' : ''), 'input_city' => xos_draw_input_field('city', '', 'class="form-control" id="city"') . '&nbsp;' . (xos_not_null(ENTRY_CITY_TEXT) ? '<span class="input-requirement">' . ENTRY_CITY_TEXT . '</span>' : ''), 'input_country' => xos_get_country_list('country', '', 'class="form-control" id="country"') . '&nbsp;' . (xos_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="input-requirement">' . ENTRY_COUNTRY_TEXT . '</span>' : '')));
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'checkout_new_address');
    $output_checkout_new_address = $smarty->fetch(SELECTED_TPL . '/includes/modules/checkout_new_address.tpl');
    $smarty->clearAssign(array('account_gender', 'input_gender', 'account_company', 'input_company', 'account_suburb', 'input_suburb', 'account_state', 'input_state', 'input_firstname', 'input_lastname', 'input_street_address', 'input_postcode', 'input_city', 'input_country'));
    $smarty->assign('checkout_new_address', $output_checkout_new_address);
}
Esempio n. 29
0
                $onclick_link = 'info=' . urlencode($contents[$i]['name']);
            }
            if ($contents[$i]['is_dir']) {
                if ($contents[$i]['name'] == '..') {
                    $icon = xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icons/previous_level.gif', ICON_TITLE_PREVIOUS_LEVEL);
                } else {
                    $icon = isset($fInfo) && is_object($fInfo) && $contents[$i]['name'] == $fInfo->name ? xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icons/current_folder.gif', ICON_TITLE_CURRENT_FOLDER) : xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icons/folder.gif', ICON_TITLE_FOLDER);
                }
                $link = xos_href_link(FILENAME_FILE_MANAGER, 'goto=' . $goto_link);
            } else {
                $icon = $contents[$i]['is_image'] ? xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icons/image_download.gif', ICON_TITLE_FILE_DOWNLOAD) : xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icons/file_download.gif', ICON_TITLE_FILE_DOWNLOAD);
                $link = xos_href_link(FILENAME_FILE_MANAGER, 'action=download&filename=' . urlencode($contents[$i]['name']));
            }
            if ($contents[$i]['name'] != '..') {
                $link_delete = xos_href_link(FILENAME_FILE_MANAGER, 'info=' . urlencode($contents[$i]['name']) . '&action=delete');
            }
            $folders_and_files_array[] = array('selected' => $selected, 'link_onclick' => xos_href_link(FILENAME_FILE_MANAGER, $onclick_link), 'link' => $link, 'icon' => $icon, 'name' => $contents[$i]['name'], 'size' => $contents[$i]['is_dir'] ? '&nbsp;' : $contents[$i]['size'], 'permissions' => $contents[$i]['permissions'], 'user' => $contents[$i]['user'], 'group' => $contents[$i]['group'], 'last_modified' => $contents[$i]['last_modified'], 'link_delete' => $link_delete, 'link_filename_file_manager_info' => xos_href_link(FILENAME_FILE_MANAGER, 'info=' . urlencode($contents[$i]['name'])));
        }
        $smarty->assign(array('folders_and_files' => $folders_and_files_array, 'link_filename_file_manager_reset' => xos_href_link(FILENAME_FILE_MANAGER, 'action=reset'), 'link_filename_file_manager_upload' => xos_href_link(FILENAME_FILE_MANAGER, (isset($_GET['info']) ? 'info=' . urlencode($_GET['info']) . '&' : '') . 'action=upload'), 'link_filename_file_manager_new_file' => xos_href_link(FILENAME_FILE_MANAGER, (isset($_GET['info']) ? 'info=' . urlencode($_GET['info']) . '&' : '') . 'action=new_file'), 'link_filename_file_manager_new_folder' => xos_href_link(FILENAME_FILE_MANAGER, (isset($_GET['info']) ? 'info=' . urlencode($_GET['info']) . '&' : '') . 'action=new_folder')));
        require DIR_WS_BOXES . 'infobox_file_manager.php';
    }
    if (SESSID) {
        $smarty->assign('hidden_field_session', xos_draw_hidden_field(xos_session_name(), xos_session_id()));
    }
    $smarty->assign(array('form_begin_goto' => xos_draw_form('goto', FILENAME_FILE_MANAGER, '', 'get'), 'current_path' => $_SESSION['current_path'], 'pull_down_goto' => xos_draw_pull_down_menu('goto', $goto_array, $_SESSION['current_path'], 'onchange="this.form.submit();"'), 'form_end' => '</form>'));
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'file_manager');
    $output_file_manager = $smarty->fetch(ADMIN_TPL . '/file_manager.tpl');
    $smarty->assign('central_contents', $output_file_manager);
    $smarty->display(ADMIN_TPL . '/frame.tpl');
    require DIR_WS_INCLUDES . 'application_bottom.php';
}
Esempio n. 30
0
//
//              Released under the GNU General Public License
////////////////////////////////////////////////////////////////////////////////
if (!(@(include DIR_FS_SMARTY . 'catalog/templates/' . SELECTED_TPL . '/php/includes/boxes/currencies.php') == 'overwrite_all')) {
    if (isset($currencies) && is_object($currencies)) {
        $currencies_content = '';
        $currencies_content_string = '';
        $currencies_content_noscript = '';
        reset($currencies->currencies);
        if (sizeof($currencies->currencies) > 1) {
            $currencies_array = array();
            while (list($key, $value) = each($currencies->currencies)) {
                $currencies_array[] = array('id' => xos_href_link(basename($_SERVER['PHP_SELF']), xos_get_all_get_params(array('cur')) . 'cur=' . $key, $request_type, true, true, false, false, false), 'text' => $value['title']);
                if ($_SESSION['currency'] == $key) {
                    $currencies_content_string .= '<span><b>' . $value['title'] . '</b></span>';
                    $currencies_content_noscript .= '<a href="' . xos_href_link(basename($_SERVER['PHP_SELF']), xos_get_all_get_params(array('cur')) . 'cur=' . $key, $request_type, true, true, false, false, false) . '">' . '&nbsp; <b>' . $value['title'] . '</b></a><br />';
                } else {
                    $currencies_content_string .= '<a href="' . xos_href_link(basename($_SERVER['PHP_SELF']), xos_get_all_get_params(array('cur')) . 'cur=' . $key, $request_type, true, true, false, false, false) . '">' . $value['title'] . '</a>';
                    $currencies_content_noscript .= '<a href="' . xos_href_link(basename($_SERVER['PHP_SELF']), xos_get_all_get_params(array('cur')) . 'cur=' . $key, $request_type, true, true, false, false, false) . '">' . '&nbsp; ' . $value['title'] . '</a><br />';
                }
            }
            $currencies_content_noscript = substr($currencies_content_noscript, 0, -6);
            $currencies_content = xos_draw_form('currencies', xos_href_link(basename($_SERVER['PHP_SELF']), '', $request_type, false, true, false, false, false), 'get');
            $currencies_content .= xos_draw_pull_down_menu('cur', $currencies_array, xos_href_link(basename($_SERVER['PHP_SELF']), xos_get_all_get_params(array('cur')) . 'cur=' . $_SESSION['currency'], $request_type, true, true, false, false, false), 'class="form-control input-sm" onchange="location = form.cur.options[form.cur.selectedIndex].value;"');
            $currencies_content .= '</form>';
            $smarty->assign(array('box_currencies_currencies' => $currencies_content, 'box_currencies_currencies_string' => $currencies_content_string, 'box_currencies_currencies_noscript' => $currencies_content_noscript));
            $output_currencies = $smarty->fetch(SELECTED_TPL . '/includes/boxes/currencies.tpl');
            $smarty->assign('box_currencies', $output_currencies);
        }
    }
}