/** Product Finder mod
 * /includes/functions/extra_functions/product_finder.php
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: product_finder.php 2010-08-05
 */
function zen_my_image_submit($image, $alt = '', $parameters = '', $sec_class = '')
{
    global $template, $current_page_base, $zco_notifier;
    $zco_notifier->notify('PAGE_OUTPUT_IMAGE_SUBMIT');
    $image_submit = '<input type="image" src="' . zen_output_string($template->get_template_dir($image, DIR_WS_TEMPLATE, $current_page_base, 'buttons/' . $_SESSION['language'] . '/') . $image) . '" alt="' . zen_output_string($alt) . '"';
    if (zen_not_null($alt)) {
        $image_submit .= ' title=" ' . zen_output_string($alt) . ' "';
    }
    if (zen_not_null($parameters)) {
        $image_submit .= ' ' . $parameters;
    }
    $image_submit .= ' />';
    return $image_submit;
}
function zen_draw_pull_down_menu_SBAmod($name, $values, $default = '', $parameters = '', $required = false, $disable = null, $options_menu_images = null)
{
    global $template_dir;
    $tmp_attribID = trim($name, 'id[]');
    //used to get the select ID reference to be used in jquery
    $field = '<script type="text/javascript">
	  			$(function(){
					$("#attrib-' . $tmp_attribID . '").on("click", function(){
						$("#SBA_ProductImage").attr("src", $(this).find(":selected").attr("data-src"));
					});
				});
			</script>';
    $field .= '<select name="' . zen_output_string($name) . '" onclick=""';
    if (zen_not_null($parameters)) {
        $field .= ' ' . $parameters;
    }
    $field .= '>' . "\n";
    if (empty($default) && isset($GLOBALS[$name]) && is_string($GLOBALS[$name])) {
        $default = stripslashes($GLOBALS[$name]);
    }
    for ($i = 0, $n = sizeof($values); $i < $n; $i++) {
        $field .= '  <option value="' . zen_output_string($values[$i]['id']) . '"';
        if ($default == $values[$i]['id']) {
            $field .= ' selected="selected"';
        }
        //"Stock by Attributes" // Need to determine this being disabled by a
        // numerical method rather than a text possessing method.  If PWA_OUTOF_STOCK is not present then the item may not be disabled... :/
        if ($disable && strpos($values[$i]['text'], trim(PWA_OUT_OF_STOCK))) {
            $field .= $disable;
        }
        //add image link if available
        if (!empty($options_menu_images[$i]['src'])) {
            $field .= ' data-src="' . $options_menu_images[$i]['src'] . '"';
        }
        //close tag and display text
        //      $field .= '>' . zen_output_string($values[$i]['text'], array('"' => '&quot;', '\'' => '&#039;', '<' => '&lt;', '>' => '&gt;')) . '</option>' . "\n";
        $field .= '>' . zen_output_string_protected($values[$i]['text']) . '</option>' . "\n";
    }
    $field .= '</select>' . "\n";
    if ($required == true) {
        $field .= TEXT_FIELD_REQUIRED;
    }
    return $field;
}
Example #3
0
/**
 * Zen Lightbox
 *
 * @author Alex Clarke (aclarke@ansellandclarke.co.uk)
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: zen_lightbox.php 2008-12-11 aclarke $
 */
function zen_lightbox($src, $alt = '', $width = '', $height = '', $parameters = '')
{
    global $template_dir;
    // auto replace with defined missing image
    if ($src == DIR_WS_IMAGES and PRODUCTS_IMAGE_NO_IMAGE_STATUS == '1') {
        $src = DIR_WS_IMAGES . PRODUCTS_IMAGE_NO_IMAGE;
    }
    if ((empty($src) || $src == DIR_WS_IMAGES) && IMAGE_REQUIRED == 'false') {
        return false;
    }
    // if not in current template switch to template_default
    if (!file_exists($src)) {
        $src = str_replace(DIR_WS_TEMPLATES . $template_dir, DIR_WS_TEMPLATES . 'template_default', $src);
    }
    // hook for handle_image() function such as Image Handler etc
    if (function_exists('handle_image')) {
        $newimg = handle_image($src, $alt, $width, $height, $parameters);
        list($src, $alt, $width, $height, $parameters) = $newimg;
    }
    $image = zen_output_string($src);
    return $image;
}
Example #4
0
 * if (($_GET['main_page']==FILENAME_DEFAULT and ($_GET['cPath'] == '' or $_GET['cPath'] == 0)) or ($request_type == 'SSL')) { $show_manufacturers= false; } else { $show_manufacturers= true; }
 */
if ($show_manufacturers) {
    // only check products if requested - this may slow down the processing of the manufacturers sidebox
    if (PRODUCTS_MANUFACTURERS_STATUS == '1') {
        $manufacturer_sidebox_query = "select distinct m.manufacturers_id, m.manufacturers_name\n                            from " . TABLE_MANUFACTURERS . " m\n                            left join " . TABLE_PRODUCTS . " p on m.manufacturers_id = p.manufacturers_id\n                            where m.manufacturers_id = p.manufacturers_id and p.products_status= 1\n                            order by manufacturers_name";
    } else {
        $manufacturer_sidebox_query = "select m.manufacturers_id, m.manufacturers_name\n                            from " . TABLE_MANUFACTURERS . " m\n                            order by manufacturers_name";
    }
    $manufacturer_sidebox = $db->Execute($manufacturer_sidebox_query);
    if ($manufacturer_sidebox->RecordCount() > 0) {
        $number_of_rows = $manufacturer_sidebox->RecordCount() + 1;
        // Display a list
        $manufacturer_sidebox_array = array();
        if (!isset($_GET['manufacturers_id']) || $_GET['manufacturers_id'] == '') {
            $manufacturer_sidebox_array[] = array('id' => '', 'text' => PULL_DOWN_ALL);
        } else {
            $manufacturer_sidebox_array[] = array('id' => '', 'text' => PULL_DOWN_MANUFACTURERS);
        }
        while (!$manufacturer_sidebox->EOF) {
            $manufacturer_sidebox_name = zen_output_string(strlen($manufacturer_sidebox->fields['manufacturers_name']) > (int) MAX_DISPLAY_MANUFACTURER_NAME_LEN ? substr($manufacturer_sidebox->fields['manufacturers_name'], 0, (int) MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturer_sidebox->fields['manufacturers_name'], false, true);
            $manufacturer_sidebox_array[] = array('id' => $manufacturer_sidebox->fields['manufacturers_id'], 'text' => $manufacturer_sidebox_name);
            $manufacturer_sidebox->MoveNext();
        }
        require $template->get_template_dir('tpl_manufacturers_select.php', DIR_WS_TEMPLATE, $current_page_base, 'sideboxes') . '/tpl_manufacturers_select.php';
        $title = '<label>' . BOX_HEADING_MANUFACTURERS . '</label>';
        $title_link = false;
        require $template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base, 'common') . '/' . $column_box_default;
    }
}
// $show_manufacturers
			<label class="inputLabel"
				<?php 
                    echo $selection[$i]['fields'][$j]['tag'] ? ' for="' . $selection[$i]['fields'][$j]['tag'] . '"' : '';
                    ?>
><?php 
                    echo $selection[$i]['fields'][$j]['title'];
                    ?>
</label>      
      <?php 
                    echo $selection[$i]['fields'][$j]['field'];
                    ?>
      <?php 
                    if ($selection[$i]['module'] != MODULE_ORDER_TOTAL_INSURANCE_TITLE && $selection[$i]['module'] != MODULE_ORDER_TOTAL_SC_TITLE) {
                        ?>
      <div class="buttonRow"><?php 
                        echo zen_image(zen_output_string($template->get_template_dir(BUTTON_IMAGE_UPDATE, DIR_WS_TEMPLATE, $current_page_base, 'buttons/' . $_SESSION['language'] . '/') . BUTTON_IMAGE_UPDATE), BUTTON_UPDATE_ALT, '', '', 'onclick="updateForm();"');
                        ?>
</div>
      <?php 
                    }
                    ?>
  
    </div>
	</fieldset>
</div>
<?php 
                    if ($selectionStyle == 'split' && $box == 'even') {
                        echo '<br class="clearBoth" />';
                    }
                    ?>
		
Example #6
0
function zen_create_sort_heading($sortby, $colnum, $heading)
{
    global $PHP_SELF;
    $sort_prefix = '';
    $sort_suffix = '';
    if ($sortby) {
        $sort_prefix = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('page', 'info', 'sort')) . 'page=1&sort=' . $colnum . ($sortby == $colnum . 'a' ? 'd' : 'a')) . '" title="' . zen_output_string(TEXT_SORT_PRODUCTS . ($sortby == $colnum . 'd' || substr($sortby, 0, 1) != $colnum ? TEXT_ASCENDINGLY : TEXT_DESCENDINGLY) . TEXT_BY . $heading) . '" class="productListing-heading">';
        $sort_suffix = (substr($sortby, 0, 1) == $colnum ? substr($sortby, 1, 1) == 'a' ? PRODUCT_LIST_SORT_ORDER_ASCENDING : PRODUCT_LIST_SORT_ORDER_DESCENDING : '') . '</a>';
    }
    return $sort_prefix . $heading . $sort_suffix;
}
              <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">
<?php
// edit option name
      if (($action == 'update_option') && ($_GET['option_id'] == $options_values->fields['products_options_id'])) {
        echo '<form name="option" action="' . zen_href_link(FILENAME_OPTIONS_NAME_MANAGER, 'action=update_option_name' . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '')  . '&option_order_by=' . $option_order_by) . '" method="post">';echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']);
        $inputs = '';
        $inputs2 = '';
        for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) {
          $option_name = $db->Execute("select products_options_name, products_options_sort_order, products_options_size, products_options_length, products_options_comment, products_options_images_per_row, products_options_images_style, products_options_rows
                                       from " . TABLE_PRODUCTS_OPTIONS . "
                                       where products_options_id = '" . (int)$options_values->fields['products_options_id'] . "'
                                       and language_id = '" . (int)$languages[$i]['id'] . "'");

          $inputs .= $languages[$i]['code'] . ':&nbsp;<input type="text" name="option_name[' . $languages[$i]['id'] . ']" ' . zen_set_field_length(TABLE_PRODUCTS_OPTIONS, 'products_options_name', 40) . ' value="' . zen_output_string($option_name->fields['products_options_name']) . '">' . TEXT_SORT . '<input type="text" name="products_options_sort_order[' . $languages[$i]['id'] . ']" size="3" value="' . $option_name->fields['products_options_sort_order'] . '">&nbsp;<br />';
          $inputs2 .= $languages[$i]['code'] . ':&nbsp; ' .
                   '&nbsp;' . TEXT_OPTION_VALUE_COMMENTS . '<input type="text" name="products_options_comment[' . $languages[$i]['id'] . ']" size="50" value="' . zen_output_string($option_name->fields['products_options_comment']) . '">' .
                   '<br /><br />' . TEXT_OPTION_VALUE_ROWS . '<input type="text" name="products_options_rows[' . $languages[$i]['id'] . ']" size="3" value="' . $option_name->fields['products_options_rows'] . '">' .
                   '&nbsp;' . TEXT_OPTION_VALUE_SIZE . '<input type="text" name="products_options_size[' . $languages[$i]['id'] . ']" size="3" value="' . $option_name->fields['products_options_size'] . '">' .
                   '&nbsp;' . TEXT_OPTION_VALUE_MAX . '<input type="text" name="products_options_length[' . $languages[$i]['id'] . ']" size="3" value="' . $option_name->fields['products_options_length'] . '">' .
                   '<br /><br />' . TEXT_OPTION_ATTRIBUTE_IMAGES_PER_ROW . '<input type="text" name="products_options_images_per_row[' . $languages[$i]['id'] . ']" size="3" value="' . $option_name->fields['products_options_images_per_row'] . '">' .
                   '&nbsp;' . TEXT_OPTION_ATTRIBUTE_IMAGES_STYLE . '<input type="text" name="products_options_images_style[' . $languages[$i]['id'] . ']" size="3" value="' . $option_name->fields['products_options_images_style'] . '">' . '<br /><br />';

        }

//CLR 030212 - Add column for option type
?>
                <td height="50" align="center" class="attributeBoxContent">&nbsp;<?php echo $options_values->fields['products_options_id']; ?><input type="hidden" name="option_id" value="<?php echo $options_values->fields['products_options_id']; ?>">&nbsp;</td>
                <td class="attributeBoxContent"><?php echo $inputs; ?></td>
                <td class="attributeBoxContent"><?php echo draw_optiontype_pulldown('option_type', $options_values->fields['products_options_type']); ?></td>
                <td colspan="3" align="left" class="attributeBoxContent">&nbsp;</td>
                <td colspan="1"  align="center" class="attributeBoxContent">&nbsp;<?php echo zen_image_submit('button_update.gif', IMAGE_UPDATE); ?>&nbsp;<?php echo '<a href="' . zen_href_link(FILENAME_OPTIONS_NAME_MANAGER, (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&option_order_by=' . $option_order_by ) . '">'; ?><?php echo zen_image_button('button_cancel.gif', IMAGE_CANCEL); ?></a>&nbsp;</td>
        ?>
              <tr class="<?php 
        echo floor($rows / 2) == $rows / 2 ? 'attributes-even' : 'attributes-odd';
        ?>
">
<?php 
        // edit option name
        if ($action == 'update_option' && $_GET['option_id'] == $options_values->fields['products_options_id']) {
            echo '<form name="option" action="' . zen_href_link(FILENAME_OPTIONS_NAME_MANAGER, 'action=update_option_name' . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&option_order_by=' . $option_order_by) . '" method="post">';
            echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']);
            $inputs = '';
            $inputs2 = '';
            for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
                $option_name = $db->Execute("select products_options_name, products_options_sort_order, products_options_size, products_options_length, products_options_comment, products_options_images_per_row, products_options_images_style, products_options_rows\n                                       from " . TABLE_PRODUCTS_OPTIONS . "\n                                       where products_options_id = '" . (int) $options_values->fields['products_options_id'] . "'\n                                       and language_id = '" . (int) $languages[$i]['id'] . "'");
                $inputs .= $languages[$i]['code'] . ':&nbsp;<input type="text" name="option_name[' . $languages[$i]['id'] . ']" ' . zen_set_field_length(TABLE_PRODUCTS_OPTIONS, 'products_options_name', 40) . ' value="' . zen_output_string($option_name->fields['products_options_name']) . '">' . TEXT_SORT . '<input type="text" name="products_options_sort_order[' . $languages[$i]['id'] . ']" size="3" value="' . $option_name->fields['products_options_sort_order'] . '">&nbsp;<br />';
                $inputs2 .= $languages[$i]['code'] . ':&nbsp; ' . '&nbsp;' . TEXT_OPTION_VALUE_COMMENTS . '<input type="text" name="products_options_comment[' . $languages[$i]['id'] . ']" size="50" value="' . zen_output_string($option_name->fields['products_options_comment']) . '">' . '<br /><br />' . TEXT_OPTION_VALUE_ROWS . '<input type="text" name="products_options_rows[' . $languages[$i]['id'] . ']" size="3" value="' . $option_name->fields['products_options_rows'] . '">' . '&nbsp;' . TEXT_OPTION_VALUE_SIZE . '<input type="text" name="products_options_size[' . $languages[$i]['id'] . ']" size="3" value="' . $option_name->fields['products_options_size'] . '">' . '&nbsp;' . TEXT_OPTION_VALUE_MAX . '<input type="text" name="products_options_length[' . $languages[$i]['id'] . ']" size="3" value="' . $option_name->fields['products_options_length'] . '">' . '<br /><br />' . TEXT_OPTION_ATTRIBUTE_IMAGES_PER_ROW . '<input type="text" name="products_options_images_per_row[' . $languages[$i]['id'] . ']" size="3" value="' . $option_name->fields['products_options_images_per_row'] . '">' . '&nbsp;' . TEXT_OPTION_ATTRIBUTE_IMAGES_STYLE . '<input type="text" name="products_options_images_style[' . $languages[$i]['id'] . ']" size="3" value="' . $option_name->fields['products_options_images_style'] . '">' . '<br /><br />';
            }
            //CLR 030212 - Add column for option type
            ?>
                <td height="50" align="center" class="attributeBoxContent">&nbsp;<?php 
            echo $options_values->fields['products_options_id'];
            ?>
<input type="hidden" name="option_id" value="<?php 
            echo $options_values->fields['products_options_id'];
            ?>
">&nbsp;</td>
                <td class="attributeBoxContent"><?php 
            echo $inputs;
            ?>
</td>
                <td class="attributeBoxContent"><?php 
Example #9
0
    <p class="messageStackError"><?php 
    echo $message;
    ?>
</p>
    <label class="loginLabel" for="admin_name-<?php 
    echo $_SESSION['securityToken'];
    ?>
"><?php 
    echo TEXT_ADMIN_NAME;
    ?>
</label>
    <input style="float: left" type="text" id="admin_name" name="admin_name-<?php 
    echo $_SESSION['securityToken'];
    ?>
" value="<?php 
    echo zen_output_string($admin_name);
    ?>
" autocomplete="off"/>
    <br class="clearBoth" />
    <label class="loginLabel" for="oldpwd-<?php 
    echo $_SESSION['securityToken'];
    ?>
"><?php 
    echo TEXT_ADMIN_OLD_PASSWORD;
    ?>
</label>
    <input style="float: left" type="password" id="old_pwd" name="oldpwd-<?php 
    echo $_SESSION['securityToken'];
    ?>
" autocomplete="off" />
    <br class="clearBoth" />
 function imageSubmit($image, $alt = '', $parameters = '', $sec_class = '')
 {
     global $current_page_base;
     if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes' && strlen($alt) < 30) {
         return zenCssButton($image, $alt, 'submit', $sec_class);
     }
     $image_submit = '<input type="image" src="' . zen_output_string($this->_getTemplateDir($image, $current_page_base, 'buttons/' . $_SESSION['language'] . '/') . $image) . '" alt="' . zen_output_string($alt) . '"';
     if (zen_not_null($alt)) {
         $image_submit .= ' title=" ' . zen_output_string($alt) . ' "';
     }
     if (zen_not_null($parameters)) {
         $image_submit .= ' ' . $parameters;
     }
     $image_submit .= ' />';
     return $image_submit;
 }
Example #11
0
</strong>
        <input class="checkButton" type="button" value="Check All" onclick="checkAll(this.form,'<?php 
        echo $menuKey;
        ?>
',true);">
        <input class="checkButton" type="button" value="Uncheck All" onclick="checkAll(this.form,'<?php 
        echo $menuKey;
        ?>
',false);">
      </dt>
<?php 
        foreach ($pageList as $pageKey => $page) {
            ?>
      <dd><label><?php 
            echo zen_draw_checkbox_field('p[]', htmlspecialchars($pageKey, ENT_COMPAT, CHARSET, TRUE), isset($_POST['p']) && in_array($pageKey, $_POST['p']), '', ' class="' . $menuKey . '"');
            echo zen_output_string($page['name'], false, true);
            ?>
</label></dd>
<?php 
        }
        ?>
    </dl>
<?php 
    }
    ?>
    <div class="formButtons">
      <?php 
    echo zen_image_submit('button_save.gif', IMAGE_SAVE);
    ?>
      <a href="<?php 
    echo zen_href_link(FILENAME_PROFILES);
Example #12
0
function zen_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false, $blank = false)
{
    $field = '<select class="form-control" name="' . zen_output_string($name) . '"';
    if (zen_not_null($parameters)) {
        $field .= ' ' . $parameters;
    }
    $field .= '>';
    if ($blank) {
        $field .= '<option value=""></option>';
    }
    if (empty($default) && isset($GLOBALS[$name]) && is_string($GLOBALS[$name])) {
        $default = stripslashes($GLOBALS[$name]);
    }
    foreach (array_keys($values) as $i) {
        $field .= '<option value="' . zen_output_string($values[$i]['id']) . '"';
        if ($default == $values[$i]['id']) {
            $field .= ' selected="selected"';
        }
        $field .= '>' . zen_output_string($values[$i]['text'], array('"' => '&quot;', '\'' => '&#039;', '<' => '&lt;', '>' => '&gt;')) . '</option>';
    }
    $field .= '</select>';
    if ($required == true) {
        $field .= TEXT_FIELD_REQUIRED;
    }
    return $field;
}
Example #13
0
    <input type="submit" name="submit" class="button" value="Login" id="btn_submit"/>
    <input type="hidden" name="action" value="do<?php echo $_SESSION['securityToken']; ?>" id="action1"/>
    <img id="actionImg" src = "images/loading.gif" class="hiddenField" />
    <br /><a style="float: right;" href="<?php echo zen_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL');?>"><?php echo TEXT_PASSWORD_FORGOTTEN; ?></a>
  </fieldset>
</form>
<div id="loginExpiryPolicy"><?php echo LOGIN_EXPIRY_NOTICE; ?></div>
</body>
<?php } else { ?>
<body id="login" onload="document.getElementById('old_pwd').focus()">
<form id="loginForm" name="loginForm" action="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>" method="post" onsubmit="animate(this)">
  <fieldset>
    <legend><?php echo HEADING_TITLE_EXPIRED; ?></legend>
    <p class="messageStackError"><?php echo $message; ?></p>
    <label class="loginLabel" for="admin_name-<?php echo $_SESSION['securityToken']; ?>"><?php echo TEXT_ADMIN_NAME; ?></label>
    <input style="float: left" type="text" id="admin_name" name="admin_name-<?php echo $_SESSION['securityToken']; ?>" value="<?php echo zen_output_string($admin_name); ?>" autocomplete="off"/>
    <br class="clearBoth" />
    <label class="loginLabel" for="oldpwd-<?php echo $_SESSION['securityToken']; ?>"><?php echo TEXT_ADMIN_OLD_PASSWORD; ?></label>
    <input style="float: left" type="password" id="old_pwd" name="oldpwd-<?php echo $_SESSION['securityToken']; ?>" autocomplete="off" />
    <br class="clearBoth" />
    <label  class="loginLabel" for="newpwd-<?php echo $_SESSION['securityToken']; ?>"><?php echo TEXT_ADMIN_NEW_PASSWORD; ?></label>
    <input style="float: left" type="password" id="admin_pass" name="newpwd-<?php echo $_SESSION['securityToken']; ?>" autocomplete="off" />
    <br class="clearBoth" />
    <label  class="loginLabel" for="confpwd"-<?php echo $_SESSION['securityToken']; ?>><?php echo TEXT_ADMIN_CONFIRM_PASSWORD; ?></label>
    <input style="float: left" type="password" id="admin_pass2" name="confpwd-<?php echo $_SESSION['securityToken']; ?>" autocomplete="off" />
    <br class="clearBoth" />
    <input type="hidden" name="securityToken" value="<?php echo $_SESSION['securityToken']; ?>">
    <input type="submit" name="submit" class="button" value="Submit" id="btn_submit" />
    <input type="hidden" name="action" value="rs<?php echo $_SESSION['securityToken']; ?>" id="action1"/>
    <img id="actionImg" src = "images/loading.gif" class="hiddenField" />
  </fieldset>
if ($num_images) {
    $row = 0;
    $col = 0;
    if ($num_images < IMAGES_AUTO_ADDED || IMAGES_AUTO_ADDED == 0) {
        $col_width = floor(100 / $num_images);
    } else {
        $col_width = floor(100 / IMAGES_AUTO_ADDED);
    }
    for ($i = 0, $n = $num_images; $i < $n; $i++) {
        $file = $images_array[$i];
        $products_image_large = str_replace(DIR_WS_IMAGES, DIR_WS_IMAGES . 'large/', $products_image_directory) . str_replace($products_image_extension, '', $file) . IMAGE_SUFFIX_LARGE . $products_image_extension;
        //  Begin Image Handler changes 1 of 2
        if (function_exists('handle_image')) {
            $newimg = handle_image($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, '');
            list($src, $alt, $width, $height, $parameters) = $newimg;
            $products_image_large = zen_output_string($src);
        }
        $flag_has_large = file_exists($products_image_large);
        //  End Image Handler changes 1 of 2
        $products_image_large = $flag_has_large ? $products_image_large : $products_image_directory . $file;
        $flag_display_large = IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE == 'Yes' || $flag_has_large;
        $base_image = $products_image_directory . $file;
        $thumb_slashes = zen_image(addslashes($base_image), addslashes($products_name), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
        //  Begin Image Handler changes 2 of 2
        //  remove additional single quotes from image attributes (important!)
        $thumb_slashes = preg_replace("/([^\\\\])'/", '$1\\\'', $thumb_slashes);
        //  End Image Handler changes 2 of 2
        $thumb_regular = zen_image($base_image, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
        $large_link = zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large);
        // Link Preparation:
        $script_link = '<script type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="javascript:popupWindow(\\\'' . str_replace($products_image_large, urlencode(addslashes($products_image_large)), $large_link) . '\\\')">' . $thumb_slashes . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>';
Example #15
0
 /**
  * 生产一个slelect的下拉框
  *
  * @param unknown_type $name
  * @param unknown_type $values
  * @param unknown_type $default
  * @param unknown_type $parameters
  * @return string
  */
 public static function drawSelectFiled($name, $values, $default, $parameters = '')
 {
     $field = '<select name="' . zen_output_string($name) . '"';
     if (!empty($parameters)) {
         $field .= ' ' . $parameters;
     }
     $field .= '>' . "\n";
     for ($i = 0, $n = sizeof($values); $i < $n; $i++) {
         $field .= '  <option value="' . self::outputString($values[$i]['id']) . '"';
         if ($default == $values[$i]['id']) {
             $field .= ' selected="selected"';
         }
         $field .= '>' . self::outputString($values[$i]['text'], array('"' => '&quot;', '&' => '&', '\'' => '&#039;', '<' => '&lt;', '>' => '&gt;')) . '</option>' . "\n";
     }
     $field .= '</select>' . "\n";
     return $field;
 }
Example #16
0
function zen_links_image($src, $alt = '', $width = '', $height = '', $parameters = '')
{
    if ((empty($src) || $src == DIR_WS_IMAGES) && IMAGE_REQUIRED == 'false') {
        return false;
    }
    // alt is added to the img tag even if it is null to prevent browsers from outputting
    // the image filename as default
    $image = '<img src="' . zen_output_string($src) . '" alt="' . zen_output_string($alt) . '"';
    if (zen_not_null($alt)) {
        $image .= ' title=" ' . zen_output_string($alt) . ' "';
    }
    if (CONFIG_CALCULATE_IMAGE_SIZE == 'true' && (empty($width) || empty($height))) {
        if ($image_size = @getimagesize($src)) {
            if (empty($width) && zen_not_null($height)) {
                $ratio = $height / $image_size[1];
                $width = $image_size[0] * $ratio;
            } elseif (zen_not_null($width) && empty($height)) {
                $ratio = $width / $image_size[0];
                $height = $image_size[1] * $ratio;
            } elseif (empty($width) && empty($height)) {
                $width = $image_size[0];
                $height = $image_size[1];
            }
        } elseif (IMAGE_REQUIRED == 'false') {
            return false;
        }
    }
    // VJ begin maintain image proportion
    $calculate_image_proportion = 'true';
    if ($calculate_image_proportion == 'true' && (!empty($width) && !empty($height))) {
        if ($image_size = @getimagesize($src)) {
            $image_width = $image_size[0];
            $image_height = $image_size[1];
            if ($image_width != 1 && $image_height != 1) {
                $whfactor = $image_width / $image_height;
                $hwfactor = $image_height / $image_width;
                if (!($image_width > $width) && !($image_height > $height)) {
                    $width = $image_width;
                    $height = $image_height;
                } elseif ($image_width > $width && !($image_height > $height)) {
                    $height = $width * $hwfactor;
                } elseif (!($image_width > $width) && $image_height > $height) {
                    $width = $height * $whfactor;
                } elseif ($image_width > $width && $image_height > $height) {
                    if ($image_width > $image_height) {
                        $height = $width * $hwfactor;
                    } else {
                        $width = $height * $whfactor;
                    }
                }
            }
        }
    }
    //VJ end maintain image proportion
    if (zen_not_null($width) && zen_not_null($height)) {
        $image .= ' width="' . (int) zen_output_string($width) . '" height="' . (int) zen_output_string($height) . '"';
    }
    if (zen_not_null($parameters)) {
        $image .= ' ' . $parameters;
    }
    $image .= ' />';
    return $image;
}
        $rows++;
        ?>
              <tr class="<?php 
        echo floor($rows / 2) == $rows / 2 ? 'attributes-even' : 'attributes-odd';
        ?>
">
<?php 
        // FIX HERE
        // edit option values
        if ($action == 'update_option_value' && $_GET['value_id'] == $values_values->fields['products_options_values_id']) {
            echo '<form name="values" action="' . zen_href_link(FILENAME_OPTIONS_VALUES_MANAGER, 'action=update_value' . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '')) . '" method="post">';
            echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']);
            $inputs = '';
            for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
                $value_name = $db->Execute("select products_options_values_name\n                                      from " . TABLE_PRODUCTS_OPTIONS_VALUES . "\n                                      where products_options_values_id = '" . (int) $values_values->fields['products_options_values_id'] . "' and language_id = '" . (int) $languages[$i]['id'] . "'");
                $inputs .= $languages[$i]['code'] . ':&nbsp;<input type="text" name="value_name[' . $languages[$i]['id'] . ']" ' . zen_set_field_length(TABLE_PRODUCTS_OPTIONS_VALUES, 'products_options_values_name', 50) . ' value="' . zen_output_string($value_name->fields['products_options_values_name']) . '">&nbsp;<br />';
            }
            $products_options_values_sort_order = $db->Execute("select distinct products_options_values_sort_order from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int) $values_values->fields['products_options_values_id'] . "'");
            $inputs2 .= '&nbsp;<input type="text" name="products_options_values_sort_order" size="4" value="' . $products_options_values_sort_order->fields['products_options_values_sort_order'] . '">&nbsp;';
            ?>
                <td align="center" class="attributeBoxContent">&nbsp;<?php 
            echo $values_values->fields['products_options_values_id'];
            ?>
<input type="hidden" name="value_id" value="<?php 
            echo $values_values->fields['products_options_values_id'];
            ?>
">&nbsp;</td>
                <td align="center" class="attributeBoxContent">&nbsp;<?php 
            echo "\n";
            ?>
<select name="option_id">
Example #18
0
function zen_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true)
{
    $field = '<textarea class="form-control" name="' . zen_output_string($name) . '" wrap="' . zen_output_string($wrap) . '" cols="' . zen_output_string($width) . '" rows="' . zen_output_string($height) . '"';
    if (zen_not_null($parameters)) {
        $field .= ' ' . $parameters;
    }
    $field .= '>';
    if (isset($GLOBALS[$name]) && $reinsert_value == true) {
        $field .= stripslashes($GLOBALS[$name]);
    } elseif (zen_not_null($text)) {
        $field .= $text;
    }
    $field .= '</textarea>';
    return $field;
}
</head>
<body id="login">
<form name="login" action="<?php 
echo zen_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL');
?>
" method = "POST">
<fieldset>
<legend><?php 
echo HEADING_TITLE;
?>
</legend>
<label for="admin_email"><?php 
echo TEXT_ADMIN_EMAIL;
?>
<input type="text" id="admin_email" name="admin_email" value="<?php 
echo zen_output_string($admin_email);
?>
" /></label>
<?php 
echo $email_message;
?>

<input type="submit" name="submit" class="button" value="resend" />
<input type="submit" name="login" class="button" value="login" />

</fieldset>
</form>
</body>
</html>
<?php 
require 'includes/application_bottom.php';
Example #20
0
function zen_output_string_protected($string)
{
    return zen_output_string($string, false, true);
}
Example #21
0
 function tableBox($contents, $direct_output = false)
 {
     $tableBox_string = '<table border="' . zen_output_string($this->table_border) . '" width="' . zen_output_string($this->table_width) . '" cellspacing="' . zen_output_string($this->table_cellspacing) . '" cellpadding="' . zen_output_string($this->table_cellpadding) . '"';
     if (zen_not_null($this->table_parameters)) {
         $tableBox_string .= ' ' . $this->table_parameters;
     }
     $tableBox_string .= '>' . "\n";
     for ($i = 0, $n = sizeof($contents); $i < $n; $i++) {
         if (isset($contents[$i]['form']) && zen_not_null($contents[$i]['form'])) {
             $tableBox_string .= $contents[$i]['form'] . "\n";
         }
         $tableBox_string .= '  <tr';
         if (zen_not_null($this->table_row_parameters)) {
             $tableBox_string .= ' ' . $this->table_row_parameters;
         }
         if (isset($contents[$i]['params']) && zen_not_null($contents[$i]['params'])) {
             $tableBox_string .= ' ' . $contents[$i]['params'];
         }
         $tableBox_string .= '>' . "\n";
         if (isset($contents[$i][0]) && is_array($contents[$i][0])) {
             for ($x = 0, $n2 = sizeof($contents[$i]); $x < $n2; $x++) {
                 if (isset($contents[$i][$x]['text']) && zen_not_null($contents[$i][$x]['text'])) {
                     $tableBox_string .= '    <td';
                     if (isset($contents[$i][$x]['align']) && zen_not_null($contents[$i][$x]['align'])) {
                         $tableBox_string .= ' align="' . zen_output_string($contents[$i][$x]['align']) . '"';
                     }
                     if (isset($contents[$i][$x]['params']) && zen_not_null($contents[$i][$x]['params'])) {
                         $tableBox_string .= ' ' . $contents[$i][$x]['params'];
                     } elseif (zen_not_null($this->table_data_parameters)) {
                         $tableBox_string .= ' ' . $this->table_data_parameters;
                     }
                     $tableBox_string .= '>';
                     if (isset($contents[$i][$x]['form']) && zen_not_null($contents[$i][$x]['form'])) {
                         $tableBox_string .= $contents[$i][$x]['form'];
                     }
                     $tableBox_string .= $contents[$i][$x]['text'];
                     if (isset($contents[$i][$x]['form']) && zen_not_null($contents[$i][$x]['form'])) {
                         $tableBox_string .= '</form>';
                     }
                     $tableBox_string .= '</td>' . "\n";
                 }
             }
         } else {
             $tableBox_string .= '    <td';
             if (isset($contents[$i]['align']) && zen_not_null($contents[$i]['align'])) {
                 $tableBox_string .= ' align="' . zen_output_string($contents[$i]['align']) . '"';
             }
             if (isset($contents[$i]['params']) && zen_not_null($contents[$i]['params'])) {
                 $tableBox_string .= ' ' . $contents[$i]['params'];
             } elseif (zen_not_null($this->table_data_parameters)) {
                 $tableBox_string .= ' ' . $this->table_data_parameters;
             }
             $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n";
         }
         $tableBox_string .= '  </tr>' . "\n";
         if (isset($contents[$i]['form']) && zen_not_null($contents[$i]['form'])) {
             $tableBox_string .= '</form>' . "\n";
         }
     }
     $tableBox_string .= '</table>' . "\n";
     if ($direct_output == true) {
         echo $tableBox_string;
     }
     return $tableBox_string;
 }
Example #22
0
 function drawMobileInputField($name, $value = '', $parameters = '', $type = 'text', $reinsert_value = true, $input_style = '')
 {
     $field = '<input type="' . zen_output_string($type) . '" name="' . zen_output_string($name) . '"';
     if (isset($GLOBALS[$name]) && $reinsert_value == true) {
         $field .= ' value="' . zen_output_string(stripslashes($GLOBALS[$name])) . '"';
     } elseif (zen_not_null($value)) {
         $field .= ' value="' . zen_output_string($value) . '"';
     }
     if (zen_not_null($parameters)) {
         $field .= ' ' . $parameters;
     }
     if (zen_not_null($input_style)) {
         $field .= ' ' . $this->mobileInputStyle($input_style);
     }
     $field .= ' />';
     return $field;
 }
Example #23
0
</legend>
    <label class="loginLabel" for="admin_name"><?php 
echo TEXT_ADMIN_NAME;
?>
</label>
<input style="float: left" type="text" id="admin_name" name="admin_name" value="<?php 
echo zen_output_string($admin_name);
?>
" />
<br class="clearBoth" />
    <label  class="loginLabel" for="admin_pass"><?php 
echo TEXT_ADMIN_PASS;
?>
</label>
<input style="float: left" type="password" id="admin_pass" name="admin_pass" value="<?php 
echo zen_output_string($admin_pass);
?>
" />
<br class="clearBoth" />
    <?php 
echo $pass_message;
?>
    <input type="submit" name="submit" class="button" value="Login" />
    <?php 
echo '<a style="float: right;" href="' . zen_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . TEXT_PASSWORD_FORGOTTEN . '</a>';
?>
  </fieldset>
</form>
</body>
</html>
<?php 
    $products_price = $flash_page->fields['products_price'];
    //caizhouqing update discount
    $specials_price = $rs->fields['specials_new_products_price'];
    if ($rs->RecordCount() > 0) {
        $discount = 100 - $specials_price / $products_price * 100;
    } else {
        $discount = 0;
    }
    $flash_discount[] = (int) $discount;
    $flash_page->fields['specials_price'] = $specials_price;
    $flash_page_items[] = $flash_page->fields;
    $flash_page_id_con[] = $flash_page->fields['products_id'];
    $flash_page_images_src = is_int(strpos($flash_page->fields['products_image'], ',')) ? substr($flash_page->fields['products_image'], 0, strpos($flash_page->fields['products_image'], ',')) : $flash_page->fields['products_image'];
    $flash_page_images_con[] = '"' . (zen_not_null($flash_page->fields['products_image']) ? $flash_page_images_src : PRODUCTS_IMAGE_NO_IMAGE) . '"';
    $flash_page_price_con[] = '"' . $currencies->display_price(zen_get_products_base_price($flash_page->fields['products_id']), zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . '"';
    $flash_page_name_con[] = '"' . zen_output_string(zen_get_products_name($flash_page->fields['products_id'])) . '"';
    $flash_page->MoveNext();
}
$flash_discount = implode(",", $flash_discount);
$flash_page_id = implode(",", $flash_page_id_con);
$flash_page_images = implode(",", $flash_page_images_con);
$flash_page_price = implode(",", $flash_page_price_con);
$flash_page_name = implode(",", $flash_page_name_con);
$flash_page_display_num = $flash_page->RecordCount() < 8 ? $flash_page->RecordCount() : 8;
?>

<?php 
for ($i = 0; $i < $flash_page_display_num; $i++) {
    ?>
<li id="li<?php 
    echo $i;
Example #25
0
<?php

/**
 * Header code file for the Advanced Search Input page
 *
 * @package page
 * @copyright Copyright 2003-2010 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: header_php.php 17600 2010-09-22 00:45:20Z drbyte $
 */
require DIR_WS_MODULES . zen_get_module_directory('require_languages.php');
$breadcrumb->add(NAVBAR_TITLE_1);
//test:
//&keyword=die+hard&categories_id=10&inc_subcat=1&manufacturers_id=4&pfrom=1&pto=50&dfrom=01%2F01%2F2003&dto=12%2F20%2F2005
$sData['keyword'] = stripslashes(isset($_GET['keyword']) ? zen_output_string_protected($_GET['keyword']) : zen_output_string_protected(KEYWORD_FORMAT_STRING));
$sData['search_in_description'] = isset($_GET['search_in_description']) ? zen_output_string((int) $_GET['search_in_description']) : 1;
$sData['categories_id'] = isset($_GET['categories_id']) ? zen_output_string((int) $_GET['categories_id']) : 0;
$sData['inc_subcat'] = isset($_GET['inc_subcat']) ? zen_output_string((int) $_GET['inc_subcat']) : 1;
$sData['manufacturers_id'] = isset($_GET['manufacturers_id']) ? zen_output_string((int) $_GET['manufacturers_id']) : 0;
$sData['dfrom'] = isset($_GET['dfrom']) ? zen_output_string($_GET['dfrom']) : zen_output_string(DOB_FORMAT_STRING);
$sData['dto'] = isset($_GET['dto']) ? zen_output_string($_GET['dto']) : zen_output_string(DOB_FORMAT_STRING);
$sData['pfrom'] = isset($_GET['pfrom']) ? zen_output_string($_GET['pfrom']) : '';
$sData['pto'] = isset($_GET['pto']) ? zen_output_string($_GET['pto']) : '';
function zen_image_lazy($src, $alt = '', $width = '', $height = '', $parameters = '')
{
    global $template_dir;
    // soft clean the alt tag
    $alt = zen_clean_html($alt);
    // use old method on template images
    if (strstr($src, 'includes/templates') or strstr($src, 'includes/languages') or PROPORTIONAL_IMAGES_STATUS == '0') {
        return zen_image_OLD($src, $alt, $width, $height, $parameters);
    }
    //auto replace with defined missing image
    if ($src == DIR_WS_IMAGES and PRODUCTS_IMAGE_NO_IMAGE_STATUS == '1') {
        $src = DIR_WS_IMAGES . PRODUCTS_IMAGE_NO_IMAGE;
    }
    if ((empty($src) || $src == DIR_WS_IMAGES) && IMAGE_REQUIRED == 'false') {
        return false;
    }
    // if not in current template switch to template_default
    if (!file_exists($src)) {
        $src = str_replace(DIR_WS_TEMPLATES . $template_dir, DIR_WS_TEMPLATES . 'template_default', $src);
    }
    // hook for handle_image() function such as Image Handler etc
    if (function_exists('handle_image')) {
        $newimg = handle_image($src, $alt, $width, $height, $parameters);
        list($src, $alt, $width, $height, $parameters) = $newimg;
    }
    // Convert width/height to int for proper validation.
    // intval() used to support compatibility with plugins like image-handler
    $width = empty($width) ? $width : intval($width);
    $height = empty($height) ? $height : intval($height);
    // alt is added to the img tag even if it is null to prevent browsers from outputting
    // the image filename as default
    $image = '<img  src="' . DIR_WS_TEMPLATES . $template_dir . '/images/greyLoader.gif" data-original="' . zen_output_string($src) . '" alt="' . zen_output_string($alt) . '"';
    if (zen_not_null($alt)) {
        $image .= ' title=" ' . zen_output_string($alt) . ' "';
    }
    if (CONFIG_CALCULATE_IMAGE_SIZE == 'true' && (empty($width) || empty($height))) {
        if ($image_size = @getimagesize($src)) {
            if (empty($width) && zen_not_null($height)) {
                $ratio = $height / $image_size[1];
                $width = $image_size[0] * $ratio;
            } elseif (zen_not_null($width) && empty($height)) {
                $ratio = $width / $image_size[0];
                $height = $image_size[1] * $ratio;
            } elseif (empty($width) && empty($height)) {
                $width = $image_size[0];
                $height = $image_size[1];
            }
        } elseif (IMAGE_REQUIRED == 'false') {
            return false;
        }
    }
    if (zen_not_null($width) && zen_not_null($height) and file_exists($src)) {
        //      $image .= ' width="' . zen_output_string($width) . '" height="' . zen_output_string($height) . '"';
        // proportional images
        $image_size = @getimagesize($src);
        // fix division by zero error
        $ratio = $image_size[0] != 0 ? $width / $image_size[0] : 1;
        if ($image_size[1] * $ratio > $height) {
            $ratio = $height / $image_size[1];
            $width = $image_size[0] * $ratio;
        } else {
            $height = $image_size[1] * $ratio;
        }
        // only use proportional image when image is larger than proportional size
        if ($image_size[0] < $width and $image_size[1] < $height) {
            $image .= ' width="' . $image_size[0] . '" height="' . intval($image_size[1]) . '"';
        } else {
            $image .= ' width="' . round($width) . '" height="' . round($height) . '"';
        }
    } else {
        // override on missing image to allow for proportional and required/not required
        if (IMAGE_REQUIRED == 'false') {
            return false;
        } else {
            $image .= ' width="' . intval(SMALL_IMAGE_WIDTH) . '" height="' . intval(SMALL_IMAGE_HEIGHT) . '"';
        }
    }
    // inject rollover class if one is defined. NOTE: This could end up with 2 "class" elements if $parameters contains "class" already.
    if (defined('IMAGE_ROLLOVER_CLASS') && IMAGE_ROLLOVER_CLASS != '') {
        $parameters .= (zen_not_null($parameters) ? ' ' : '') . 'class="rollover"';
    }
    // add $parameters to the tag output
    if (zen_not_null($parameters)) {
        $image .= ' ' . $parameters;
    }
    $image .= ' />';
    return $image;
}
Example #27
0
function zcInstallAddSID($connection = '')
{
    global $request_type, $session_started, $http_domain, $https_domain;
    $sid = '';
    if ($connection == '') {
        $connection = $request_type;
    }
    // Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined
    if ($session_started == true) {
        if (defined('SID') && zen_not_null(SID)) {
            $sid = SID;
        } elseif ($request_type == 'NONSSL' && $connection == 'SSL' || $request_type == 'SSL' && $connection == 'NONSSL') {
            if ($http_domain != $https_domain) {
                $sid = zen_session_name() . '=' . zen_session_id();
            }
        }
    }
    return $sid == '' ? '' : '&' . zen_output_string($sid);
}
Example #28
0
                        $result = mysql_query($sql);
                        $message = XSELL_UPLOAD_OK_RELATED;
                    } else {
                        if (xsell_is_registered_relation($mainProductId, $relateProductId)) {
                            $message = xsell_make_error_deco(XSELL_UPLOAD_ERR_ALREADY_HAS_RELATION);
                        } else {
                            $sortOrder = xsell_allocate_sort_order($mainProductId);
                            // insert relation ship
                            $sql = "INSERT INTO " . TABLE_PRODUCTS_XSELL . " (products_id,xsell_id,sort_order)" . " VALUES('" . $mainProductId . "','" . $relateProductId . "','" . $sortOrder . "')";
                            $result = mysql_query($sql);
                            // make relation ship in this upload step
                            $message = XSELL_UPLOAD_OK_RELATED;
                        }
                    }
                } while (false);
                echo zen_output_string($mainProductsModel) . "," . zen_output_string($relateProductsModel) . "," . $action . "," . " " . $message . "<br>";
            }
        } while (false);
    }
}
?>
<!-- body_text_eof //-->
  </td>
 </tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<div class="footer-area">
<?php 
require DIR_WS_INCLUDES . 'footer.php';
?>
Example #29
0
function zen_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false)
{
    $field = '<select name="' . zen_output_string($name) . '"';
    if (zen_not_null($parameters)) {
        $field .= ' ' . $parameters;
    }
    $field .= '>' . "\n";
    if (empty($default) && isset($GLOBALS[$name]) && is_string($GLOBALS[$name])) {
        $default = stripslashes($GLOBALS[$name]);
    }
    for ($i = 0, $n = sizeof($values); $i < $n; $i++) {
        $field .= '  <option value="' . zen_output_string($values[$i]['id']) . '"';
        if ($default == $values[$i]['id']) {
            $field .= ' selected="selected"';
        }
        $field .= '>' . zen_output_string($values[$i]['text'], array('"' => '&quot;', '\'' => '&#039;', '<' => '&lt;', '>' => '&gt;')) . '</option>' . "\n";
    }
    $field .= '</select>' . "\n";
    if ($required == true) {
        $field .= TEXT_FIELD_REQUIRED;
    }
    return $field;
}
Example #30
0
 /**
  * Parses the paramaters for a page to generate a valid url for the page.
  *
  * @param string $page the name of the page
  * @param string $params any paramaters for the page
  * @param string $separator the separator to use between the link and this paramater (if needed)
  * @return Ambigous <string, unknown>
  */
 function parse_parameters($page, $params, &$separator)
 {
     $p = @explode('&', $params);
     sort($p);
     // We need cPath to always appear before id's
     $container = array();
     foreach ($p as $index => $valuepair) {
         $p2 = @explode('=', $valuepair);
         switch ($p2[0]) {
             case 'products_id':
                 // Make sure if uprid is passed it is converted to the correct pid
                 $p2[1] = zen_get_prid($p2[1]);
                 // If a cPath was present we need to determine the immediate parent cid
                 $cID = null;
                 if (array_key_exists('cPath', $container)) {
                     $cID = strrpos($container['cPath'], '_');
                     if ($cID !== false) {
                         $cID = substr($container['cPath'], $cID + 1);
                     } else {
                         $cID = $container['cPath'];
                     }
                     if (SEO_URL_CATEGORY_DIR != 'off' || SEO_URL_CPATH != 'auto') {
                         unset($container['cPath']);
                     }
                 }
                 switch (true) {
                     case $page == FILENAME_PRODUCT_REVIEWS:
                         $url = $this->make_url($page, $this->get_product_name($p2[1], $cID), 'products_id_review', $p2[1], SEO_URL_END, $separator);
                         break;
                     case $page == FILENAME_PRODUCT_REVIEWS_INFO:
                         $url = $this->make_url($page, $this->get_product_name($p2[1], $cID), 'products_id_review_info', $p2[1], SEO_URL_END, $separator);
                         break;
                     case $page == FILENAME_DEFAULT:
                         $container[$p2[0]] = $p2[1];
                         break;
                     case $page == FILENAME_PRODUCT_INFO:
                     default:
                         $url = $this->make_url($page, $this->get_product_name($p2[1], $cID), $p2[0], $p2[1], SEO_URL_END, $separator);
                         break;
                 }
                 # end switch
                 break;
             case 'cPath':
                 switch (true) {
                     case $page == FILENAME_DEFAULT:
                         // Change $p2[1] to the actual category id
                         $tmp = strrpos($p2[1], '_');
                         if ($tmp !== false) {
                             $p2[1] = substr($p2[1], $tmp + 1);
                         }
                         $category = $this->get_category_name($p2[1]);
                         if (SEO_URL_CATEGORY_DIR == 'off') {
                             $url = $this->make_url($page, $category, $p2[0], $p2[1], SEO_URL_END, $separator);
                         } else {
                             $url = $this->make_url($page, $category, $p2[0], $p2[1], '/', $separator);
                         }
                         unset($category);
                         break;
                     default:
                         $container[$p2[0]] = $p2[1];
                         break;
                 }
                 # end switch
                 break;
             case 'manufacturers_id':
                 switch (true) {
                     case $page == FILENAME_DEFAULT && !$this->is_cPath_string($params) && !$this->is_product_string($params):
                         $url = $this->make_url($page, $this->get_manufacturer_name($p2[1]), $p2[0], $p2[1], SEO_URL_END, $separator);
                         break;
                     case $page == FILENAME_PRODUCT_INFO:
                         break;
                     default:
                         $container[$p2[0]] = $p2[1];
                         break;
                 }
                 # end switch
                 break;
             case 'pID':
                 switch (true) {
                     case $page == FILENAME_POPUP_IMAGE:
                         $url = $this->make_url($page, $this->get_product_name($p2[1]), $p2[0], $p2[1], SEO_URL_END, $separator);
                         break;
                     default:
                         $container[$p2[0]] = $p2[1];
                         break;
                 }
                 # end switch
                 break;
             case 'id':
                 // EZ-Pages
                 switch (true) {
                     case $page == FILENAME_EZPAGES:
                         $url = $this->make_url($page, $this->get_ezpages_name($p2[1]), $p2[0], $p2[1], SEO_URL_END, $separator);
                         break;
                     default:
                         $container[$p2[0]] = $p2[1];
                         break;
                 }
                 # end switch
                 break;
             default:
                 $container[$p2[0]] = $p2[1];
                 break;
         }
         # end switch
     }
     # end foreach $p
     $url = isset($url) ? $url : $page . SEO_URL_END;
     if (sizeof($container) > 0) {
         if ($imploded_params = $this->implode_assoc($container)) {
             $url .= $separator . zen_output_string($imploded_params);
             $separator = '&';
         }
     }
     return $url;
 }