Example #1
0
 public static function getHandlerInformation()
 {
     global $db;
     DbIoHandler::loadHandlerMessageFile('Products');
     $manufacturers_options = array();
     $manufacturers_info = $db->Execute("SELECT manufacturers_id as `id`, manufacturers_name as `text` FROM " . TABLE_MANUFACTURERS . " ORDER BY manufacturers_name ASC");
     while (!$manufacturers_info->EOF) {
         $manufacturers_options[] = $manufacturers_info->fields;
         $manufacturers_info->MoveNext();
     }
     unset($manufacturers_info);
     $status_options = array(array('id' => 'all', 'text' => DBIO_PRODUCTS_TEXT_STATUS_ALL), array('id' => '1', 'text' => DBIO_PRODUCTS_TEXT_STATUS_ENABLED), array('id' => '0', 'text' => DBIO_PRODUCTS_TEXT_STATUS_DISABLED));
     $categories_options = zen_get_category_tree();
     unset($categories_options[0]);
     $my_config = array('version' => '1.0.0', 'handler_version' => '1.0.0', 'include_header' => true, 'export_only' => false, 'description' => DBIO_PRODUCTS_DESCRIPTION, 'export_filters' => array('products_filters' => array('type' => 'array', 'label' => DBIO_PRODUCTS_FILTERS_LABEL, 'fields' => array('products_status' => array('type' => 'dropdown', 'dropdown_options' => $status_options, 'label' => DBIO_PRODUCTS_STATUS_LABEL)))));
     if (count($manufacturers_options) > 0) {
         $my_config['export_filters']['products_filters']['fields']['products_manufacturers'] = array('type' => 'dropdown_multiple', 'dropdown_options' => $manufacturers_options, 'label' => DBIO_PRODUCTS_MANUFACTURERS_LABEL);
     }
     $my_config['export_filters']['products_filters']['fields']['products_categories'] = array('type' => 'dropdown_multiple', 'dropdown_options' => array_values($categories_options), 'label' => DBIO_PRODUCTS_CATEGORIES_LABEL);
     return $my_config;
 }
Example #2
0
          </tr>
          <tr>
            <td class="main"><?php 
    echo TEXT_SALEMAKER_DATE_END;
    ?>
&nbsp;</td>
            <td class="main"><script language="javascript">EndDate.writeControl(); EndDate.dateFormat="<?php 
    echo DATE_FORMAT_SPIFFYCAL;
    ?>
";</script></td>
          </tr>
        </table>
      </tr>
<tr><table width="750" border="0" cellspacing="2" cellpadding="2">
<?php 
    $categories_array = zen_get_category_tree('0', '&nbsp;&nbsp;', '0');
    $n = sizeof($categories_array);
    for ($i = 0; $i < $n; $i++) {
        $parents = $db->Execute("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . $categories_array[$i]['id'] . "' ");
        $categories_array[$i]['parent_id'] = $parents->fields['parent_id'];
        $categories_array[$i]['categories_id'] = $categories_array[$i]['id'];
        $categories_array[$i]['path'] = $categories_array[$i]['categories_id'];
        $categories_array[$i]['indent'] = 0;
        $parent = $categories_array[$i]['parent_id'];
        while ($parent != 0) {
            $categories_array[$i]['indent']++;
            for ($j = 0; $j < $n; $j++) {
                if ($categories_array[$j]['categories_id'] == $parent) {
                    $categories_array[$i]['path'] = $parent . '_' . $categories_array[$i]['path'];
                    $parent = $categories_array[$j]['parent_id'];
                    break;
Example #3
0
    $products->MoveNext();
}
?>
                    <td class="smallText" valign="top"><?php 
echo HEADER_CATEGORY_NAME;
?>
</td>
                    <td class="smallText" align="left"></td><form name="restrict_product" method="post" action="<?php 
echo zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'info=' . $cInfo->restrict_id, 'NONSSL');
?>
">
                    <?php 
echo zen_hide_session_id();
?>
                    <td class="smallText" align="left"><?php 
echo zen_draw_pull_down_menu('cPath_prod', zen_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"');
?>
</td></form>
<?php 
if (sizeof($products_array) > 0) {
    ?>
                    <form name="restrict_category" method="post" action="<?php 
    echo zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=add_product&info=' . $cInfo->restrict_id . '&build_cat=' . $current_category_id, 'NONSSL');
    ?>
"><?php 
    echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']);
    ?>
                    <td class="smallText" valign="top"><?php 
    echo HEADER_PRODUCT_NAME;
    ?>
</td>
<?php

//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers                           |
// |                                                                      |
// | http://www.zen-cart.com/index.php                                    |
// |                                                                      |
// | Portions Copyright (c) 2003 osCommerce                                 |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | license@zen-cart.com so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
//  $Id: sidebox_move_product.php 290 2004-09-15 19:48:26Z wilt $
//
$heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_MOVE_PRODUCT . '</b>');
$contents = array('form' => zen_draw_form('products', $type_admin_handler, 'action=move_product_confirm&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('products_id', $pInfo->products_id));
$contents[] = array('text' => sprintf(TEXT_MOVE_PRODUCTS_INTRO, $pInfo->products_name));
$contents[] = array('text' => '<br />' . TEXT_INFO_CURRENT_CATEGORIES . '<br /><b>' . zen_output_generated_category_path($pInfo->products_id, 'product') . '</b>');
$contents[] = array('text' => '<br />' . sprintf(TEXT_MOVE, $pInfo->products_name) . '<br />' . zen_draw_pull_down_menu('move_to_category_id', zen_get_category_tree(), $current_category_id));
$contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_move.gif', IMAGE_MOVE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
                </td>
            </tr>
            <tr>
                <td>
                    <?php 
echo zen_draw_form('bulk_add_tare_groups', FILENAME_TARE_GROUPS_BULK);
echo zen_draw_hidden_field('bulk_add_tare_groups', 'true');
?>
                    <table>
                        <tr>
                            <td><?php 
echo 'Category: ';
?>
</td>
                            <td><?php 
echo zen_draw_pull_down_menu('category', zen_get_category_tree());
?>
</td>
                        </tr>
                        <tr>
                            <td><?php 
echo TEXT_PRODUCT_TARE_GROUPS . ': ';
?>
</td>
                            <td><?php 
echo zen_draw_pull_down_menu('products_tare_group', $tare_group_array);
?>
</td>
                        </tr>
                        <tr>
                            <td colspan="2">
 case 'copy_to':
     $copy_attributes_delete_first = '0';
     $copy_attributes_duplicates_skipped = '0';
     $copy_attributes_duplicates_overwrite = '0';
     $copy_attributes_include_downloads = '1';
     $copy_attributes_include_filename = '1';
     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_COPY_TO . '</b>');
     // WebMakers.com Added: Split Page
     if (empty($pInfo->products_id)) {
         $pInfo->products_id = $pID;
     }
     $contents = array('form' => zen_draw_form('copy_to', FILENAME_CATEGORIES, 'action=copy_to_confirm&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('products_id', $pInfo->products_id));
     $contents[] = array('text' => TEXT_INFO_COPY_TO_INTRO);
     $contents[] = array('text' => '<br />' . TEXT_INFO_CURRENT_PRODUCT . '<br /><b>' . $pInfo->products_name . ' ID#' . $pInfo->products_id . '</b>');
     $contents[] = array('text' => '<br />' . TEXT_INFO_CURRENT_CATEGORIES . '<br /><b>' . zen_output_generated_category_path($pInfo->products_id, 'product') . '</b>');
     $contents[] = array('text' => '<br />' . TEXT_CATEGORIES . '<br />' . zen_draw_pull_down_menu('categories_id', zen_get_category_tree(), $current_category_id));
     $contents[] = array('text' => '<br />' . TEXT_HOW_TO_COPY . '<br />' . zen_draw_radio_field('copy_as', 'link', true) . ' ' . TEXT_COPY_AS_LINK . '<br />' . zen_draw_radio_field('copy_as', 'duplicate') . ' ' . TEXT_COPY_AS_DUPLICATE);
     // only ask about attributes if they exist
     if (zen_has_product_attributes($pInfo->products_id, 'false')) {
         $contents[] = array('text' => '<br />' . zen_image(DIR_WS_IMAGES . 'pixel_black.gif', '', '100%', '3'));
         $contents[] = array('text' => '<br />' . TEXT_COPY_ATTRIBUTES_ONLY);
         $contents[] = array('text' => '<br />' . TEXT_COPY_ATTRIBUTES . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_yes', true) . ' ' . TEXT_COPY_ATTRIBUTES_YES . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_no') . ' ' . TEXT_COPY_ATTRIBUTES_NO);
         // future          $contents[] = array('align' => 'center', 'text' => '<br />' . ATTRIBUTES_NAMES_HELPER . '<br />' . zen_draw_separator('pixel_trans.gif', '1', '10'));
         $contents[] = array('text' => '<br />' . zen_image(DIR_WS_IMAGES . 'pixel_black.gif', '', '100%', '3'));
     }
     $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_copy.gif', IMAGE_COPY) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
     break;
     // attribute features
 // attribute features
 case 'attribute_features':
     $copy_attributes_delete_first = '0';
          <td align="center" class="main"><a
					href="<?php 
    echo zen_href_link($curr_page, "products_filter=" . $previous . '&current_category_id=' . $current_category_id);
    ?>
"><?php 
    echo zen_image_button('button_prev.gif', BUTTON_PREVIOUS_ALT);
    ?>
</a>&nbsp;&nbsp;</td>
        <?php 
}
?>
        <td align="left" class="main"><?php 
echo zen_draw_form('new_category', $curr_page, '', 'get');
?>
&nbsp;&nbsp;<?php 
echo zen_draw_pull_down_menu('current_category_id', zen_get_category_tree('', '', '0', '', '', true), $current_category_id, 'onChange="this.form.submit();"');
echo zen_draw_hidden_field('products_filter', $_GET['products_filter']);
echo zen_hide_session_id();
echo zen_draw_hidden_field('action', 'new_cat');
?>
&nbsp;&nbsp;</form></td>
        <?php 
if ($counter > 0) {
    ?>
          <td align="center" class="main">&nbsp;&nbsp;<a
					href="<?php 
    echo zen_href_link($curr_page, "products_filter=" . $next_item . '&current_category_id=' . $current_category_id);
    ?>
"><?php 
    echo zen_image_button('button_next.gif', BUTTON_NEXT_ALT);
    ?>
Example #8
0
 case 'delete':
     $heading[] = array('text' => '<strong>' . TEXT_HEADING_DELETE_MEDIA_COLLECTION . '</strong>');
     $contents = array('form' => zen_draw_form('collections', FILENAME_MEDIA_MANAGER, 'page=' . $_GET['page'] . '&mID=' . $mInfo->media_id . '&action=deleteconfirm'));
     $contents[] = array('text' => TEXT_DELETE_INTRO);
     $contents[] = array('text' => '<br><strong>' . $mInfo->media_name . '</strong>');
     if ($mInfo->products_count > 0) {
         $contents[] = array('text' => '<br>' . zen_draw_checkbox_field('delete_products') . ' ' . TEXT_DELETE_PRODUCTS);
         $contents[] = array('text' => '<br>' . sprintf(TEXT_DELETE_WARNING_PRODUCTS, $mInfo->products_count));
     }
     $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . zen_href_link(FILENAME_MEDIA_MANAGER, 'page=' . $_GET['page'] . '&mID=' . $mInfo->media_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
     break;
 case 'products':
     $new_product_query = $db->Execute("select ptc.*, pd.products_name from " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc  left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on ptc.products_id = pd.products_id and pd.language_id = '" . (int) $_SESSION['languages_id'] . "' where ptc.categories_id='" . $current_category_id . "' order by pd.products_name");
     $heading[] = array('text' => '<strong>' . TEXT_HEADING_ASSIGN_MEDIA_COLLECTION . '</strong>');
     $contents[] = array('text' => TEXT_PRODUCTS_INTRO . '<br /><br />');
     $contents[] = array('text' => zen_draw_form('new_category', FILENAME_MEDIA_MANAGER, '', 'get') . '&nbsp;&nbsp;' . zen_draw_pull_down_menu('current_category_id', zen_get_category_tree('', '', '0'), '', 'onChange="this.form.submit();"') . zen_hide_session_id() . zen_draw_hidden_field('products_filter', $_GET['products_filter']) . zen_draw_hidden_field('action', 'new_cat') . zen_draw_hidden_field('mID', $mInfo->media_id) . zen_draw_hidden_field('page', $_GET['page']) . '&nbsp;&nbsp;</form>');
     $product_array = $zc_products->get_products_in_category($current_category_id, false);
     if ($product_array) {
         $contents[] = array('text' => zen_draw_form('new_product', FILENAME_MEDIA_MANAGER, '', 'get') . '&nbsp;&nbsp;' . zen_draw_pull_down_menu('current_product_id', $product_array) . '&nbsp;' . '<input type="submit" name="add_product" value="Add">' . zen_draw_hidden_field('current_category_id', $current_category_id) . zen_draw_hidden_field('action', 'add_product') . zen_draw_hidden_field('page', $_GET['page']) . zen_draw_hidden_field('mID', $mInfo->media_id) . '&nbsp;&nbsp;</form>');
     } else {
         $contents[] = array('text' => '&nbsp;&nbsp;' . TEXT_NO_PRODUCTS);
     }
     $products_linked_query = "select * from " . TABLE_MEDIA_TO_PRODUCTS . "\n                                where media_id = '" . $mInfo->media_id . "'";
     $products_linked = $db->Execute($products_linked_query);
     while (!$products_linked->EOF) {
         $contents[] = array('text' => '<a href="' . zen_href_link(FILENAME_MEDIA_MANAGER, 'action=remove_product&mID=' . $mInfo->media_id . '&page=' . $_GET['page'] . '&product_id=' . $products_linked->fields['product_id']) . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>&nbsp;' . $zc_products->products_name($products_linked->fields['product_id']) . '<br />');
         $products_linked->MoveNext();
     }
     $contents[] = array('align' => 'center', 'text' => '<br /><a href="' . zen_href_link(FILENAME_MEDIA_MANAGER, 'page=' . $_GET['page'] . '&mID=' . $mInfo->media_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
     break;
 default:
        $products->MoveNext();
    }
    echo '</select><br />' . "\n";
}
?>
    <?php 
if ($categories->RecordCount() > 0) {
    echo '<label for="categories">' . LABEL_CATEGORIES . '</label>' . "\n";
    $categories_size = $categories->RecordCount() > 10 ? 10 : $categories->RecordCount();
    /*
            echo '<select name="categories[]" multiple="multiple" size="' . $categories_size . '">' . "\n";
            while (!$categories->EOF) {
              echo '<option value="' . $categories->fields['categories_id'] . '">' . $categories->fields['categories_name'] . '</option>' . "\n";
              $categories->MoveNext();
            }*/
    echo zen_draw_pull_down_menu('categories[]', zen_get_category_tree('', '', '0', '', '', true, false, array(TAGS_MASTER_CATEGORY_ID)), '', 'multiple="multiple" size="' . $categories_size . '"');
    echo '</select><br />' . "\n";
}
?>
    
    <label for="discount_amount"><?php 
echo LABEL_DISCOUNT_AMOUNT;
?>
</label>
    <?php 
echo zen_draw_input_field('discount_amount', '', 'size=10 id="discount_amount"');
?>
    <label id="discountType"><?php 
echo LABEL_DISCOUNT_TYPE;
?>
</label>
 echo zen_draw_hidden_field('basemodulepath', $modulePath, 'id="basemodulepath" ');
 $model = array();
 $model[] = array('id' => '', 'text' => TEXT_PLEASE_SELECT);
 if ($_REQUEST['cPath1'] != "") {
     $model = array_merge($model, $dropdownArray);
 }
 if (isset($_REQUEST['select_model'])) {
     $value = $_REQUEST['select_model'];
 }
 echo '<span class="pf_selectbox_name">' . TEXT_MODEL . '</span>' . zen_draw_pull_down_menu('select_model', $model, $value, 'id="select_model" class="pf_selectbox_text"');
 echo "</li>\n";
 echo "<li>";
 echo "<noscript>";
 if ($_REQUEST['select_model'] != "") {
     $value = $_REQUEST['select_model'];
     $dropdownArray = zen_get_category_tree($value);
 }
 echo zen_my_image_submit(PF_NOSCRIPT_SUBMIT, 'Go');
 echo "</noscript>";
 echo "</li>\n";
 echo "<li>";
 $year = array();
 $year[] = array('id' => '', 'text' => TEXT_PLEASE_SELECT);
 if ($_REQUEST['select_model'] != "") {
     $year = array_merge($year, $dropdownArray);
 }
 if (isset($_REQUEST['cPath'])) {
     $value = $_REQUEST['cPath'];
 }
 if ($_REQUEST['select_model'] != "") {
     echo '<span class="pf_selectbox_name">' . TEXT_YEAR . '</span>' . zen_draw_pull_down_menu('cPath', $year, $value, 'id="select_year" class="pf_selectbox_text"');
Example #11
0
function zen_get_category_tree($parent_id = '0', $spacing = '', $exclude = '', $category_tree_array = '', $include_itself = false, $category_has_products = false, $limit = false)
{
    global $gBitDb;
    if ($limit) {
        $limit_count = 1;
    } else {
        $limit_count = 100;
    }
    if (!is_array($category_tree_array)) {
        $category_tree_array = array();
    }
    if (sizeof($category_tree_array) < 1 && $exclude != '0') {
        $category_tree_array[] = array('id' => '0', 'text' => TEXT_TOP);
    }
    if ($include_itself) {
        $category = $gBitDb->Execute("SELECT cd.`categories_name`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM " . TABLE_CATEGORIES_DESCRIPTION . " cd\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE cd.`language_id` = '" . (int) $_SESSION['languages_id'] . "'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tand cd.`categories_id` = '" . (int) $parent_id . "'");
        $category_tree_array[] = array('id' => $parent_id, 'text' => $category->fields['categories_name']);
    }
    $categories = $gBitDb->Execute("SELECT c.`categories_id`, cd.`categories_name`, c.`parent_id`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE c.`categories_id` = cd.`categories_id`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tand cd.`language_id` = '" . (int) $_SESSION['languages_id'] . "'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tand c.`parent_id` = '" . (int) $parent_id . "'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY c.`sort_order`, cd.`categories_name`");
    while (!$categories->EOF) {
        if ($category_has_products == true and zen_products_in_category_count($categories->fields['categories_id'], '', false, true) >= 1) {
            $mark = '*';
        } else {
            $mark = '&nbsp;&nbsp;';
        }
        if ($exclude != $categories->fields['categories_id']) {
            $category_tree_array[] = array('id' => $categories->fields['categories_id'], 'text' => $spacing . $categories->fields['categories_name'] . $mark);
        }
        $category_tree_array = zen_get_category_tree($categories->fields['categories_id'], $spacing . '&nbsp;&nbsp;&nbsp;', $exclude, $category_tree_array, '', $category_has_products);
        $categories->MoveNext();
    }
    return $category_tree_array;
}
 $delete_product = FALSE;
 while (!$products_types->EOF) {
     if ($products_types->fields['type_handler'] . '.php' == $filename) {
         $delete_product = TRUE;
         break;
     }
     $products_types->MoveNext();
 }
 if ($delete_product && $_GET['action'] == 'delete_product_confirm' && $_POST['products_id'] > 0) {
     $products_id = zen_db_prepare_input($_POST['products_id']);
     $query = 'delete from ' . TABLE_CUSTOMERS_VIEWED_PRODUCTS . ' where products_id="' . $products_id . '"';
     $db->Execute($query);
 } else {
     if ($filename == FILENAME_CATEGORIES . '.php' && $_GET['action'] == 'delete_category_confirm' && $_POST['categories_id'] > 0) {
         $categories_id = zen_db_prepare_input($_POST['categories_id']);
         $categories = zen_get_category_tree($categories_id, '', '0', '', true);
         zen_set_time_limit(600);
         for ($i = 0, $n = sizeof($categories); $i < $n; $i++) {
             $sql = "select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . $categories[$i]['id'] . "'";
             $category_products = $db->Execute($sql);
             while (!$category_products->EOF) {
                 $query = 'delete from ' . TABLE_CUSTOMERS_VIEWED_PRODUCTS . ' where products_id="' . $category_products->fields['products_id'] . '"';
                 $db->Execute($query);
                 $category_products->MoveNext();
             }
         }
     } else {
         if ($filename == FILENAME_CUSTOMERS . '.php' && $_GET['action'] == 'deleteconfirm' && $_GET['cID'] > 0) {
             $customers_id = zen_db_prepare_input($_GET['cID']);
             $query = 'delete from ' . TABLE_CUSTOMERS_VIEWED_PRODUCTS . ' where customers_id="' . (int) $customers_id . '"';
             $db->Execute($query);
} else {
    ?>
        <?php 
    echo zen_draw_form('quantity_discounts', FILENAME_QUANTITIY_DISCOUNTS, '', 'post');
    ?>
        
        <table cellspacing="0" cellpadding="5" id="table_info">
          <tr>
            <th>
              Categories Qty Discounts
            </th>      
          </tr>
          <tr>
            <td>
              <?php 
    echo zen_draw_pull_down_menu('cat_id', zen_get_category_tree(), isset($category_id) ? $category_id : '', ' onchange="this.form.submit();"');
    ?>
              <br/><br/>Or Input Categoriy Id <br/><br/>
              <?php 
    echo zen_draw_input_field('cat_id_input', '');
    ?>
            </td>
          </tr>
         </table>
        <?php 
    echo '</form>';
}
?>
        

        </td>
Example #14
0
            $csv_format_id = $_SESSION['product_csv']['csv_format_id'];
        }
        if (array_key_exists('ignore_first_line', $_SESSION['product_csv'])) {
            $ignore_first_line = $_SESSION['product_csv']['ignore_first_line'];
        }
        unset($_SESSION['product_csv']);
    }
    $body = '<tr><th>' . zen_draw_form('import', FILENAME_ADDON_MODULES_ADMIN, 'module=product_csv&action=import', 'post', 'enctype="multipart/form-data"') . PRODUCT_CSV_IMPORT_TITLE . '</th></tr><tr><td>' . PRODUCT_CSV_IMPORT_MESSAGE . '<table border="0" width="100%" cellspacing="0" cellpadding="0" class="tableLayout3"><tr><th width="40%">
<label for="format">' . PRODUCT_CSV_FORMAT . ': </label></th><td>' . zen_draw_pull_down_menu('csv_format_id', $formats, '', 'id="format"') . '</td></tr>
<tr><th width="40%"><label for="ignore">' . PRODUCT_CSV_IGNORE_FIRST_LINE . ': </label>' . zen_draw_checkbox_field('ignore_first_line', 'ignore', false, '', 'id="ignore"') . zen_draw_hidden_field('MAX_FILE_SIZE', return_bytes(ini_get(upload_max_filesize))) . '</th><td>' . zen_draw_file_field('file') . ' <input type="submit" name="upfile" value="' . PRODUCT_CSV_IMPORT_BUTTON . '" disabled="disabled" id="upfile"/><br/>
</form></td></tr></table></tr><tr><th>' . zen_draw_form('export', FILENAME_ADDON_MODULES_ADMIN, 'module=product_csv&action=export', 'post') . PRODUCT_CSV_EXPORT_TITLE . '</th></tr><tr><td><table border="0" width="100%" cellspacing="0" cellpadding="0" class="tableLayout3">
<tr>
<th width="40%"><label for="format">' . PRODUCT_CSV_FORMAT . ': </label></th><td>' . zen_draw_pull_down_menu('csv_format_id', $formats, '', 'id="format"') . '</td>
</tr>
<tr>
<th width="40%"><label for="category">' . PRODUCT_CSV_EXPORT_CATEGORY . ': </label></th><td>' . zen_draw_pull_down_menu('category_id', zen_get_category_tree(), '', 'id="category"') . '</td>
</tr>
<tr>
<td  colspan="2" align="center"><input type="submit" name="downfile" value="' . PRODUCT_CSV_EXPORT_BUTTON . '"/></td>
</form>
</tr>
</table>
</td></tr>';
}
$zco_notifier->notify('NOTIFY_PRODUCT_CSV_FINISH_BODY_GENERATE');
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php 
echo HTML_PARAMS;
?>
>
     $catcount++;
     for ($i = 1; $i < $catcount; $i++) {
         $texttempcat2 = $categoriesarr[$i][text];
         $idtempcat2 = $categoriesarr[$i][id];
         $categoriesarr[$i][id] = $idtempcat1;
         $categoriesarr[$i][text] = $texttempcat1;
         $texttempcat1 = $texttempcat2;
         $idtempcat1 = $idtempcat2;
     }
     $categoriesarr[0][text] = "Choose Category";
     $categoriesarr[0][id] = 0.5;
     $categoryselectoutput = zen_draw_pull_down_menu('add_product_categories_id', $categoriesarr, $current_category_id, 'onChange="this.form.submit();"');
     $categoryselectoutput = str_replace('<option value="0" SELECTED>', '<option value="0">', $categoryselectoutput);
     $categoryselectoutput = str_replace('<option value=".5">', '<option value=".5" SELECTED>', $categoryselectoutput);
 } else {
     $categoryselectoutput = zen_draw_pull_down_menu('add_product_categories_id', zen_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"');
 }
 echo "<tr class='dataTableRow'>" . zen_draw_form('add_prdct', FILENAME_ORDER_EDIT, zen_get_all_get_params(array('action', 'oID')) . 'oID=' . $oID . '&action=add_prdct', 'post', '', true);
 //			echo "<tr class=\"dataTableRow\"><form action='$PHP_SELF?oID=$oID&amp;action=$action' method='POST'>\n";
 echo "<td class='dataTableContent' align='right'><strong>" . ADDPRODUCT_TEXT_STEP1 . "</strong></td><td class='dataTableContent' valign='top'>";
 echo ' ' . $categoryselectoutput;
 echo "<input type='hidden' name='step' value='2'>";
 echo "</td>\n";
 echo "</form></tr>\n";
 echo "<tr><td colspan='3'>&nbsp;</td></tr>\n";
 // Step 2: Choose Product
 if ($step > 1 && $add_product_categories_id != 0.5) {
     echo "<tr class='dataTableRow'>" . zen_draw_form('add_prdct', FILENAME_ORDER_EDIT, zen_get_all_get_params(array('action', 'oID')) . 'oID=' . $oID . '&action=add_prdct', 'post', '', true);
     //			echo "<tr class=\"dataTableRow\"><form action='$PHP_SELF?oID=$oID&amp;action=$action' method='post'>\n";
     echo "<td class='dataTableContent' align='right'><strong>" . ADDPRODUCT_TEXT_STEP2 . "</strong></td><td class='dataTableContent' valign='top'><select name=\"add_product_products_id\" onChange=\"this.form.submit();\">";
     $ProductOptions = "<option value='0'>" . ADDPRODUCT_TEXT_SELECT_PRODUCT . "\n";
Example #16
0
function zen_get_category_tree($parent_id = '0', $spacing = '', $exclude = '', $category_tree_array = '', $include_itself = false, $category_has_products = false, $limit = false)
{
    global $db;
    if ($limit) {
        $limit_count = " limit 1";
    } else {
        $limit_count = '';
    }
    if (!is_array($category_tree_array)) {
        $category_tree_array = array();
    }
    if (sizeof($category_tree_array) < 1 && $exclude != '0') {
        $category_tree_array[] = array('id' => '0', 'text' => TEXT_TOP);
    }
    if ($include_itself) {
        $category = $db->Execute("select cd.categories_name\n                                from " . TABLE_CATEGORIES_DESCRIPTION . " cd\n                                where cd.language_id = '" . (int) $_SESSION['languages_id'] . "'\n                                and cd.categories_id = '" . (int) $parent_id . "'");
        $category_tree_array[] = array('id' => $parent_id, 'text' => $category->fields['categories_name']);
    }
    $categories = $db->Execute("select c.categories_id, cd.categories_name, c.parent_id\n                                from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd\n                                where c.categories_id = cd.categories_id\n                                and cd.language_id = '" . (int) $_SESSION['languages_id'] . "'\n                                and c.parent_id = '" . (int) $parent_id . "'\n                                order by c.sort_order, cd.categories_name");
    while (!$categories->EOF) {
        if ($category_has_products == true and zen_products_in_category_count($categories->fields['categories_id'], '', false, true) >= 1) {
            $mark = '*';
        } else {
            $mark = '&nbsp;&nbsp;';
        }
        if ($exclude != $categories->fields['categories_id']) {
            $category_tree_array[] = array('id' => $categories->fields['categories_id'], 'text' => $spacing . $categories->fields['categories_name'] . $mark);
        }
        $category_tree_array = zen_get_category_tree($categories->fields['categories_id'], $spacing . '&nbsp;&nbsp;&nbsp;', $exclude, $category_tree_array, '', $category_has_products);
        $categories->MoveNext();
    }
    return $category_tree_array;
}
<?php

global $gBitSmarty;
$gBitSmarty->assign('currentCategoryId', $current_category_id);
$gBitSmarty->assign('catMenu', zen_draw_pull_down_menu('cPath', zen_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"'));
$catListHash = $_REQUEST;
if (isset($_GET['search'])) {
    $prodListHash['search'] = $_GET['search'];
    $catListHash['search'] = $_GET['search'];
} else {
    $catListHash['parent_id'] = $current_category_id;
}
$catCount = 0;
if ($catList = CommerceCategory::getList($catListHash)) {
    $catCount = count($catList);
    if ($gCommerceSystem->isConfigActive('SHOW_COUNTS_ADMIN')) {
        foreach (array_keys($catList) as $catId) {
            $catList[$catId]['total_products'] = zen_get_products_to_categories($catId, true);
            $catList[$catId]['total_products_on'] = zen_get_products_to_categories($catId, false);
        }
    }
    $gBitSmarty->assign('catList', $catList);
    $gBitSmarty->assign('catListHash', $catListHash);
}
$gBitSmarty->assign('catCount', $catCount);
$product = new CommerceProduct();
$offset = new splitPageResults($_GET['page'], MAX_DISPLAY_RESULTS_CATEGORIES, $products_query_raw, $products_query_numrows);
$prodListHash = $_REQUEST;
$prodListHash['all_status'] = 1;
$prodListHash['category_id'] = $current_category_id;
if ($prodList = $product->getList($prodListHash)) {
if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
    $keywords = zen_db_input(zen_db_prepare_input($_GET['search']));
    echo '<br />' . TEXT_INFO_SEARCH_DETAIL_FILTER . $keywords;
}
echo '</form>';
?>
                </td>
              </tr>
              <tr>
                <td class="smallText" align="right">
<?php 
if ($_SESSION['display_categories_dropdown'] == 0) {
    echo '<a href="' . zen_href_link(FILENAME_CATEGORIES, 'set_display_categories_dropdown=1&cID=' . $categories->fields['categories_id'] . '&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image(DIR_WS_ICONS . 'cross.gif', IMAGE_ICON_STATUS_OFF) . '</a>&nbsp;&nbsp;';
    echo zen_draw_form('goto', FILENAME_CATEGORIES, '', 'get');
    echo zen_hide_session_id();
    echo HEADING_TITLE_GOTO . ' ' . zen_draw_pull_down_menu('cPath', zen_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"');
    echo '</form>';
} else {
    echo '<a href="' . zen_href_link(FILENAME_CATEGORIES, 'set_display_categories_dropdown=0&cID=' . $categories->fields['categories_id'] . '&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image(DIR_WS_ICONS . 'tick.gif', IMAGE_ICON_STATUS_ON) . '</a>&nbsp;&nbsp;';
    echo HEADING_TITLE_GOTO;
}
?>
                </td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
if ($ep_uses_mysqli) {
    $manufacturers_query = mysqli_query($db->link, "SELECT manufacturers_id, manufacturers_name FROM " . TABLE_MANUFACTURERS . " ORDER BY manufacturers_name");
    while ($manufacturers = mysqli_fetch_array($manufacturers_query)) {
        $manufacturers_array[] = array("id" => $manufacturers['manufacturers_id'], 'text' => $manufacturers['manufacturers_name']);
    }
} else {
    $manufacturers_query = mysql_query("SELECT manufacturers_id, manufacturers_name FROM " . TABLE_MANUFACTURERS . " ORDER BY manufacturers_name");
    while ($manufacturers = mysql_fetch_array($manufacturers_query)) {
        $manufacturers_array[] = array("id" => $manufacturers['manufacturers_id'], 'text' => $manufacturers['manufacturers_name']);
    }
}
$status_array = array(array("id" => '1', 'text' => "Status"), array("id" => '1', 'text' => "active"), array("id" => '0', 'text' => "inactive"), array("id" => '3', 'text' => "all"));
$export_type_array = array(array("id" => '0', 'text' => "Download Type"), array("id" => '0', 'text' => "Complete Products"), array("id" => '1', 'text' => "Model/Price/Qty"), array("id" => '2', 'text' => "Model/Price/Breaks"));
echo "<b>Filterable Exports:</b><br>";
echo zen_draw_pull_down_menu('ep_export_type', $export_type_array) . ' ';
echo ' ' . zen_draw_pull_down_menu('ep_category_filter', array_merge(array(0 => array("id" => '', 'text' => "Categories")), zen_get_category_tree())) . ' ';
echo ' ' . zen_draw_pull_down_menu('ep_manufacturer_filter', $manufacturers_array) . ' ';
echo ' ' . zen_draw_pull_down_menu('ep_status_filter', $status_array) . ' ';
echo zen_draw_input_field('export', 'Export', ' style="padding: 0px"', false, 'submit');
?>
				
    <br /><br>
    </div>

    <b>Product &amp; Pricing Export/Import Options:</b><br />
    <!-- Download file links -->
    <a href="easypopulate_4.php?export=full"><b>Complete Products</b> (with Metatags)</a><br />
    <a href="easypopulate_4.php?export=priceqty"><b>Model/Price/Qty</b> (with Specials)</a><br />
    <a href="easypopulate_4.php?export=pricebreaks"><b>Model/Price/Breaks</b></a><br />
    <a href="easypopulate_4.php?export=featured"><b>Featured Products</b></a><br />
    
    $sql = "select ptc.*\n    from " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc\n    left join " . TABLE_PRODUCTS_DESCRIPTION . " pd\n    on ptc.products_id = pd.products_id\n    and pd.language_id = '" . (int) $_SESSION['languages_id'] . "'\n    where ptc.categories_id='" . $current_category_id . "'\n    order by pd.products_name";
    $new_product_query = $db->Execute($sql);
    $products_filter = $new_product_query->fields['products_id'];
    zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter . '&current_category_id=' . $current_category_id));
}
// set categories and products if not set
if ($products_filter == '' and $current_category_id != '') {
    $sql = "select ptc.*\n    from " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc\n    left join " . TABLE_PRODUCTS_DESCRIPTION . " pd\n    on ptc.products_id = pd.products_id\n    and pd.language_id = '" . (int) $_SESSION['languages_id'] . "'\n    where ptc.categories_id='" . $current_category_id . "'\n    order by pd.products_name";
    $new_product_query = $db->Execute($sql);
    $products_filter = $new_product_query->fields['products_id'];
    if ($products_filter != '') {
        zen_redirect(zen_href_link(FILENAME_PRODUCTS_PRICE_MANAGER, 'products_filter=' . $products_filter . '&current_category_id=' . $current_category_id));
    }
} else {
    if ($products_filter == '' and $current_category_id == '') {
        $reset_categories_id = zen_get_category_tree('', '', '0', '', '', true);
        $current_category_id = $reset_categories_id[0]['id'];
        $sql = "select ptc.*\n      from " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc\n      left join " . TABLE_PRODUCTS_DESCRIPTION . " pd\n      on ptc.products_id = pd.products_id and pd.language_id = '" . (int) $_SESSION['languages_id'] . "'\n      where ptc.categories_id='" . $current_category_id . "'\n      order by pd.products_name";
        $new_product_query = $db->Execute($sql);
        $products_filter = $new_product_query->fields['products_id'];
        $_GET['products_filter'] = $products_filter;
    }
}
require DIR_WS_MODULES . FILENAME_PREV_NEXT;
if (zen_not_null($action)) {
    $_SESSION['page_info'] = '';
    if (isset($_GET['option_page'])) {
        $_SESSION['page_info'] .= 'option_page=' . $_GET['option_page'] . '&';
    }
    if (isset($_GET['value_page'])) {
        $_SESSION['page_info'] .= 'value_page=' . $_GET['value_page'] . '&';
Example #21
0
            bit_redirect($_SERVER['SCRIPT_NAME'] . '?cid=' . $gCoupon->mCouponId);
            break;
        case 'Add':
            $gCoupon->storeRestriction($_REQUEST);
            bit_redirect($_SERVER['SCRIPT_NAME'] . '?cid=' . $gCoupon->mCouponId);
            break;
        case 'remove':
            if (!empty($_GET['info'])) {
                $gBitDb->query("delete from " . TABLE_COUPON_RESTRICT . " where restrict_id = ?", array($_GET['info']));
            }
            bit_redirect($_SERVER['SCRIPT_NAME'] . '?cid=' . $gCoupon->mCouponId);
            break;
    }
}
if (isset($_POST['cPath_prod'])) {
    $current_category_id = $_POST['cPath_prod'];
} else {
    $_POST['cPath_prod'] = NULL;
}
$productsList = $gBitDb->getAssoc("select p.`products_id`, pd.`products_name` from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.`products_id` = pd.`products_id` and pd.`language_id` = ? and p.`products_id` = p2c.`products_id` and p2c.`categories_id` = ? order by pd.`products_name`", array($_SESSION['languages_id'], $_POST['cPath_prod']));
$gBitSmarty->assign_by_ref('productsList', $productsList);
$gBitSmarty->assign_by_ref('gCoupon', $gCoupon);
require_once BITCOMMERCE_PKG_PATH . 'classes/CommerceProductManager.php';
$productManager = new CommerceProductManager();
$gBitSmarty->assign('optionsList', $productManager->getOptionsList());
$categoryTree = zen_get_category_tree();
$gBitSmarty->assign('categorySelect', zen_draw_pull_down_menu('category_id', $categoryTree, $current_category_id));
$gBitSmarty->assign('productCategorySelect', zen_draw_pull_down_menu('cPath_prod', $categoryTree, $current_category_id, 'onChange="this.form.submit();"'));
$gBitSmarty->assign('productTypes', $productManager->getProductTypes());
$gBitSmarty->assign_by_ref('feedback', $feedback);
$gBitSystem->display('bitpackage:bitcommerce/admin_coupon_restrict.tpl', HEADING_TITLE, array('display_mode' => 'admin'));
Example #22
0
while (!$classes->EOF) {
    $tax_class_array[] = array('id' => $classes->fields['tax_class_id'], 'text' => $classes->fields['tax_class_title']);
    $classes->MoveNext();
}
// eof get tx classes
// bof get manufacturers
$manufacturers_array = array(array('id' => '0', 'text' => NO_MANUFACTURER));
//$manufacturers_array = array(array('id' => '0', 'text' => TEXT_ALL_MANUFACTURERS));
$manufacturers = $db->Execute("select manufacturers_id, manufacturers_name\n                         from " . TABLE_MANUFACTURERS . "\n                         order by manufacturers_name");
while (!$manufacturers->EOF) {
    $manufacturers_array[] = array('id' => $manufacturers->fields['manufacturers_id'], 'text' => $manufacturers->fields['manufacturers_name']);
    $manufacturers->MoveNext();
}
// eof get manufacturers
// bof get category_tree
$quick_updates_category_tree = zen_get_category_tree();
// eof get category_tree
// bof Update database
switch ($_GET['action']) {
    case 'update':
        // bof prepare al new data for database input
        if (sizeof($_POST['quick_updates_new']) > 0) {
            foreach ($_POST['quick_updates_new'] as $key => $value) {
                // $value is an array here (contains values like ['products_model'][$products_id] = '1' for example)
                $_POST['quick_updates_new'][$key] = zen_db_prepare_input($value);
            }
        }
        // eof prepare al new data for database input
        $quick_updates_count = array();
        if ($_POST['quick_updates_new']['products_model']) {
            foreach ($_POST['quick_updates_new']['products_model'] as $products_id => $new_value) {
 function delete_category($categories_id)
 {
     global $db, $zc_products;
     // future cat specific deletion
     $delete_linked = 'true';
     if ($_POST['delete_linked'] == 'delete_linked_no') {
         $delete_linked = 'false';
     } else {
         $delete_linked = 'true';
     }
     // delete category and products
     $categories_id = zen_db_prepare_input($categories_id);
     // create list of any subcategories in the selected category,
     $categories = zen_get_category_tree($categories_id, '', '0', '', true);
     zen_set_time_limit(600);
     // loop through this cat and subcats for delete-processing.
     for ($i = 0, $n = sizeof($categories); $i < $n; $i++) {
         $sql = "select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . $categories[$i]['id'] . "'";
         $category_products = $db->Execute($sql);
         while (!$category_products->EOF) {
             // determine product-type-specific override script for this product
             $product_type = zen_get_products_type($category_products->fields['products_id']);
             // now loop thru the delete_product_confirm script for each product in the current category
             if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/delete_product_confirm.php')) {
                 require DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/delete_product_confirm.php';
             } else {
                 require DIR_WS_MODULES . 'delete_product_confirm.php';
             }
             // THIS LINE COMMENTED BECAUSE IT'S DONE ALREADY DURING DELETE_PRODUCT_CONFIRM.PHP:
             //zen_remove_product($category_products->fields['products_id'], $delete_linked);
             $category_products->MoveNext();
         }
         zen_remove_category($categories[$i]['id']);
     }
     // end for loop
 }