<?php $reviews_query_raw = "select reviews_id, products_id, date_added, last_modified, reviews_rating, marked from " . TABLE_REVIEWS . " order by date_added DESC"; $reviews_split = new splitPageResults($_GET['page'], MAX_DISPLAY_ADMIN_PAGE, $reviews_query_raw, $reviews_query_numrows); $reviews_query = vam_db_query($reviews_query_raw); while ($reviews = vam_db_fetch_array($reviews_query)) { if ((!$_GET['rID'] || $_GET['rID'] == $reviews['reviews_id']) && !$rInfo) { $reviews_text_query = vam_db_query("select r.reviews_read, r.customers_name, length(rd.reviews_text) as reviews_text_size from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.reviews_id = '" . $reviews['reviews_id'] . "' and r.reviews_id = rd.reviews_id"); $reviews_text = vam_db_fetch_array($reviews_text_query); $products_image_query = vam_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . $reviews['products_id'] . "'"); $products_image = vam_db_fetch_array($products_image_query); $products_name_query = vam_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $reviews['products_id'] . "' and language_id = '" . $_SESSION['languages_id'] . "'"); $products_name = vam_db_fetch_array($products_name_query); $reviews_average_query = vam_db_query("select (avg(reviews_rating) / 5 * 100) as average_rating from " . TABLE_REVIEWS . " where products_id = '" . $reviews['products_id'] . "'"); $reviews_average = vam_db_fetch_array($reviews_average_query); $review_info = vam_array_merge($reviews_text, $reviews_average, $products_name); $rInfo_array = vam_array_merge($reviews, $review_info, $products_image); $rInfo = new objectInfo($rInfo_array); } if (is_object($rInfo) && $reviews['reviews_id'] == $rInfo->reviews_id) { echo ' <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . vam_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id . '&action=preview') . '\'">' . "\n"; } else { echo ' <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . vam_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $reviews['reviews_id']) . '\'">' . "\n"; } ?> <td class="dataTableContent"><?php echo '<a href="' . vam_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $reviews['reviews_id'] . '&action=preview') . '">' . vam_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . vam_get_products_name($reviews['products_id']); ?> </td> <td class="dataTableContent" align="right"><?php echo vam_image(HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/img/stars_' . $reviews['reviews_rating'] . '.gif'); ?>
/** * @return array array which contains file list starting from the $startdir */ function vam_get_filelist_func($startdir, $file_filter = NULL, $dir_only = false, $subdir = '') { // echo 'Directory: ' . $startdir . ' Subirectory: ' . $subdir . '<br />'; if ($file_filter == null) { $file_filter = new FileFilter_I(); } $dirname = $startdir . $subdir; if ($dir = opendir($dirname)) { while ($file = readdir($dir)) { if (substr($file, 0, 1) != '.') { if (!$dir_only && is_file($dirname . $file)) { if ($file_filter->accept($file)) { $files[] = array('id' => $subdir . $file, 'text' => $subdir . $file); } } elseif (is_dir($dirname . $file)) { if ($dir_only) { $files[] = array('id' => $subdir . $file . '/', 'text' => $subdir . $file . '/'); } $files = vam_array_merge($files, vam_get_filelist_func($startdir, $file_filter, $dir_only, $subdir . $file . '/')); } } } closedir($dir); } return $files; }
?> </td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td> </tr> <?php $blacklist_query_raw = "select blacklist_id, blacklist_card_number, date_added, last_modified from " . TABLE_BLACKLIST . " order by blacklist_id"; $blacklist_split = new splitPageResults($_GET['page'], MAX_DISPLAY_ADMIN_PAGE, $blacklist_query_raw, $blacklist_query_numrows); $blacklist_query = vam_db_query($blacklist_query_raw); while ($blacklist = vam_db_fetch_array($blacklist_query)) { if ((!$_GET['bID'] || @$_GET['bID'] == $blacklist['blacklist_id']) && !$bInfo && substr($_GET['action'], 0, 3) != 'new') { $blacklist_numbers_query = vam_db_query("select count(*) as blacklist_count from " . TABLE_BLACKLIST . " where blacklist_id = '" . $blacklist['blacklist_id'] . "'"); $blacklist_numbers = vam_db_fetch_array($blacklist_numbers_query); $bInfo_array = vam_array_merge($blacklist, $blacklist_numbers); $bInfo = new objectInfo($bInfo_array); } if (is_object($bInfo) && $blacklist['blacklist_id'] == $bInfo->blacklist_id) { echo ' <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . vam_href_link(FILENAME_BLACKLIST, 'page=' . $_GET['page'] . '&bID=' . $blacklist['blacklist_id'] . '&action=edit') . '\'">' . "\n"; } else { echo ' <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . vam_href_link(FILENAME_BLACKLIST, 'page=' . $_GET['page'] . '&bID=' . $blacklist['blacklist_id']) . '\'">' . "\n"; } ?> <td class="dataTableContent"><?php echo $blacklist['blacklist_card_number']; ?> </td> <td class="dataTableContent" align="right"><?php if (is_object($bInfo) && $blacklist['blacklist_id'] == $bInfo->blacklist_id) { echo vam_image(DIR_WS_IMAGES . 'icon_arrow_right.gif');
$class_method = explode('->', $use_function); if (!is_object(${$class_method[0]})) { include DIR_WS_CLASSES . $class_method[0] . '.php'; ${$class_method[0]} = new $class_method[0](); } $cfgValue = vam_call_function($class_method[1], $configuration['configuration_value'], ${$class_method[0]}); } else { $cfgValue = vam_call_function($use_function, $configuration['configuration_value']); } } else { $cfgValue = $configuration['configuration_value']; } if ((!$_GET['cID'] || @$_GET['cID'] == $configuration['configuration_id']) && !$cInfo && substr($_GET['action'], 0, 3) != 'new') { $cfg_extra_query = vam_db_query("select configuration_key,configuration_value, date_added, last_modified, use_function, set_function from " . TABLE_CONFIGURATION . " where configuration_id = '" . $configuration['configuration_id'] . "'"); $cfg_extra = vam_db_fetch_array($cfg_extra_query); $cInfo_array = vam_array_merge($configuration, $cfg_extra); $cInfo = new objectInfo($cInfo_array); } if ($configuration['set_function']) { eval('$value_field = ' . $configuration['set_function'] . '"' . htmlspecialchars($configuration['configuration_value']) . '");'); } else { $value_field = vam_draw_input_field($configuration['configuration_key'], $configuration['configuration_value'], 'size=40'); } // add if (strstr($value_field, 'configuration_value')) { $value_field = str_replace('configuration_value', $configuration['configuration_key'], $value_field); } echo ' <tr> <td width="300" valign="top" class="dataTableContent"><b>' . constant(strtoupper($configuration['configuration_key'] . '_TITLE')) . '</b> <a class="tooltip" title="' . constant(strtoupper($configuration['configuration_key'] . '_DESC')) . '" href="#">' . vam_image(DIR_WS_IMAGES . 'icons/help.jpg') . '</a></td> <td valign="top" class="dataTableContent">
?> </td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td> </tr> <?php $featured_query_raw = "select p.products_id, pd.products_name,p.products_tax_class_id, p.products_price, f.featured_id, f.featured_date_added, f.featured_last_modified, f.expires_date, f.date_status_change, f.status from " . TABLE_PRODUCTS . " p, " . TABLE_FEATURED . " f, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . $_SESSION['languages_id'] . "' and p.products_id = f.products_id order by pd.products_name"; $featured_split = new splitPageResults($_GET['page'], MAX_DISPLAY_ADMIN_PAGE, $featured_query_raw, $featured_query_numrows); $featured_query = vam_db_query($featured_query_raw); while ($featured = vam_db_fetch_array($featured_query)) { if ((!$_GET['fID'] || $_GET['fID'] == $featured['featured_id']) && !$fInfo) { $products_query = vam_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . $featured['products_id'] . "'"); $products = vam_db_fetch_array($products_query); $fInfo_array = vam_array_merge($featured, $products); $fInfo = new objectInfo($fInfo_array); } if (is_object($fInfo) && $featured['featured_id'] == $fInfo->featured_id) { echo ' <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . vam_href_link(FILENAME_FEATURED, 'page=' . $_GET['page'] . '&fID=' . $fInfo->featured_id . '&action=edit') . '\'">' . "\n"; } else { echo ' <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . vam_href_link(FILENAME_FEATURED, 'page=' . $_GET['page'] . '&fID=' . $featured['featured_id']) . '\'">' . "\n"; } ?> <td class="dataTableContent"><?php echo $featured['products_name']; ?> </td> <td class="dataTableContent" align="right"> <?php if ($featured['status'] == '1') {
?> </td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td> </tr> <?php $manufacturers_query_raw = "select manufacturers_id, manufacturers_name, manufacturers_image, date_added, last_modified from " . TABLE_MANUFACTURERS . " order by manufacturers_name"; $manufacturers_split = new splitPageResults($_GET['page'], MAX_DISPLAY_ADMIN_PAGE, $manufacturers_query_raw, $manufacturers_query_numrows); $manufacturers_query = vam_db_query($manufacturers_query_raw); while ($manufacturers = vam_db_fetch_array($manufacturers_query)) { if ((!$_GET['mID'] || @$_GET['mID'] == $manufacturers['manufacturers_id']) && !$mInfo && substr($_GET['action'], 0, 3) != 'new') { $manufacturer_products_query = vam_db_query("select count(*) as products_count from " . TABLE_PRODUCTS . " where manufacturers_id = '" . $manufacturers['manufacturers_id'] . "'"); $manufacturer_products = vam_db_fetch_array($manufacturer_products_query); $mInfo_array = vam_array_merge($manufacturers, $manufacturer_products); $mInfo = new objectInfo($mInfo_array); } if (is_object($mInfo) && $manufacturers['manufacturers_id'] == $mInfo->manufacturers_id) { echo ' <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . vam_href_link(FILENAME_MANUFACTURERS, 'page=' . $_GET['page'] . '&mID=' . $manufacturers['manufacturers_id'] . '&action=edit') . '\'">' . "\n"; } else { echo ' <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . vam_href_link(FILENAME_MANUFACTURERS, 'page=' . $_GET['page'] . '&mID=' . $manufacturers['manufacturers_id']) . '\'">' . "\n"; } ?> <td class="dataTableContent"><?php echo $manufacturers['manufacturers_name']; ?> </td> <td class="dataTableContent" align="right"><?php if (is_object($mInfo) && $manufacturers['manufacturers_id'] == $mInfo->manufacturers_id) { echo vam_image(DIR_WS_IMAGES . 'icon_arrow_right.gif');
?> </td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td> </tr> <?php $banners_query_raw = "select banners_id, banners_title, banners_image, banners_group, status, expires_date, expires_impressions, date_status_change, date_scheduled, date_added from " . TABLE_BANNERS . " order by banners_title, banners_group"; $banners_split = new splitPageResults($_GET['page'], MAX_DISPLAY_ADMIN_PAGE, $banners_query_raw, $banners_query_numrows); $banners_query = vam_db_query($banners_query_raw); while ($banners = vam_db_fetch_array($banners_query)) { $info_query = vam_db_query("select sum(banners_shown) as banners_shown, sum(banners_clicked) as banners_clicked from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . $banners['banners_id'] . "'"); $info = vam_db_fetch_array($info_query); if ((!$_GET['bID'] || $_GET['bID'] == $banners['banners_id']) && !$bInfo && substr($_GET['action'], 0, 3) != 'new') { $bInfo_array = vam_array_merge($banners, $info); $bInfo = new objectInfo($bInfo_array); } $banners_shown = $info['banners_shown'] != '' ? $info['banners_shown'] : '0'; $banners_clicked = $info['banners_clicked'] != '' ? $info['banners_clicked'] : '0'; if (is_object($bInfo) && $banners['banners_id'] == $bInfo->banners_id) { echo ' <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . vam_href_link(FILENAME_BANNER_STATISTICS, 'page=' . $_GET['page'] . '&bID=' . $bInfo->banners_id) . '\'">' . "\n"; } else { echo ' <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . vam_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $banners['banners_id']) . '\'">' . "\n"; } ?> <td class="dataTableContent"><?php echo '<a href="javascript:popupImageWindow(\'' . FILENAME_POPUP_IMAGE . '?banner=' . $banners['banners_id'] . '\')">' . vam_image(DIR_WS_IMAGES . 'icon_popup.gif', 'View Banner') . '</a> ' . $banners['banners_title']; ?> </td> <td class="dataTableContent" align="right"><?php
$contents[] = array('text' => '</form>'); } // multi_delete confirm ENDS // -------------------- // multi_copy confirm // -------------------- if (vam_not_null($_POST['multi_copy'])) { $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_COPY_TO . '</b>'); $contents[] = array('text' => '<table width="100%" border="0">'); if (is_array($_POST['multi_categories'])) { foreach ($_POST['multi_categories'] as $multi_category) { $category_query = vam_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified, c.categories_status from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $multi_category . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int) $_SESSION['languages_id'] . "'"); $category = vam_db_fetch_array($category_query); $category_childs = array('childs_count' => $catfunc->count_category_childs($multi_category)); $category_products = array('products_count' => $catfunc->count_category_products($multi_category, true)); $cInfo_array = vam_array_merge($category, $category_childs, $category_products); $cInfo = new objectInfo($cInfo_array); $contents[] = array('text' => '<tr><td style="border-bottom: 1px solid Black; margin-bottom: 10px;" class="infoBoxContent"><b>' . $cInfo->categories_name . '</b></td></tr>'); if ($cInfo->childs_count > 0) { $contents[] = array('text' => '<tr><td class="infoBoxContent">' . sprintf(TEXT_MOVE_WARNING_CHILDS, $cInfo->childs_count) . '</td></tr>'); } if ($cInfo->products_count > 0) { $contents[] = array('text' => '<tr><td class="infoBoxContent">' . sprintf(TEXT_MOVE_WARNING_PRODUCTS, $cInfo->products_count) . '</td></tr>'); } } } if (is_array($_POST['multi_products'])) { foreach ($_POST['multi_products'] as $multi_product) { $contents[] = array('text' => '<tr><td style="border-bottom: 1px solid Black; margin-bottom: 10px;" class="infoBoxContent"><b>' . vam_get_products_name($multi_product) . '</b></td></tr>'); $product_categories_string = ''; $product_categories = vam_output_generated_category_path($multi_product, 'product');
-------------------------------------------------------------- based on: (c) 2004 xt:Commerce (products_images.php,v 1.2 2003/08/23); www.nextcommerce.org Released under the GNU General Public License --------------------------------------------------------------*/ defined('_VALID_VAM') or die('Direct Access to this location is not allowed.'); //include needed functions require_once DIR_FS_INC . 'vam_get_products_mo_images.inc.php'; // BOF Add existing image require_once DIR_WS_FUNCTIONS . 'trumbnails_add_funcs.php'; // EOF Add existing image // show images if ($_GET['action'] == 'new_product') { // BOF Add existing image $dir_list = vam_array_merge(array('0' => array('id' => '', 'text' => TEXT_SELECT_DIRECTORY)), vam_get_files_in_dir(DIR_FS_CATALOG_ORIGINAL_IMAGES, '', true)); //$file_list = vam_array_merge(array('0' => array('id' => '', 'text' => TEXT_SELECT_IMAGE)),vam_get_files_in_dir(DIR_FS_CATALOG_ORIGINAL_IMAGES)); // EOF Add existing image // display images fields: echo '<tr><td colspan="4">' . vam_draw_separator('pixel_trans.gif', '1', '10') . '</td></tr>'; if ($pInfo->products_image) { echo '<tr><td colspan="4"><table><tr><td align="center" class="main" width="' . (PRODUCT_IMAGE_THUMBNAIL_WIDTH + 15) . '">' . vam_image(DIR_WS_CATALOG_THUMBNAIL_IMAGES . $pInfo->products_image, TEXT_STANDART_IMAGE) . '</td>'; } echo '<td class="main">' . TEXT_PRODUCTS_IMAGE . '<br />' . vam_draw_file_field('products_image') . '<br />' . vam_draw_separator('pixel_trans.gif', '24', '15') . ' ' . $pInfo->products_image . vam_draw_hidden_field('products_previous_image_0', $pInfo->products_image); // BOF Add existing image echo '<br />' . TEXT_PRODUCTS_IMAGE_UPLOAD_DIRECTORY . '<br />' . vam_draw_pull_down_menu('upload_dir_image_0', $dir_list, dirname($pInfo->products_image) . '/'); // echo '<br /><br />' . TEXT_PRODUCTS_IMAGE_GET_FILE . '<br />' . vam_draw_pull_down_menu('get_file_image_0',$file_list,$pInfo->products_image); // EOF Add existing image if ($pInfo->products_image != '') { echo '</tr><tr><td align="center" class="main" valign="middle">' . vam_draw_selection_field('del_pic', 'checkbox', $pInfo->products_image) . ' ' . TEXT_DELETE . '</td></tr></table>'; } else {
if (PRICE_IS_BRUTTO == 'true') { $attribute_value_price_calculate = $vamPrice->Format(vam_round($attribute_value_price * ((100 + vam_get_tax_rate(vam_get_tax_class_id($_POST['current_product_id']))) / 100), PRICE_PRECISION), false); } else { $attribute_value_price_calculate = vam_round($attribute_value_price, PRICE_PRECISION); } echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_price\" value=\"" . $attribute_value_price_calculate . "\" size=\"10\">"; // brutto Admin if (PRICE_IS_BRUTTO == 'true') { echo TEXT_NETTO . '<b>' . $vamPrice->Format(vam_round($attribute_value_price, PRICE_PRECISION), true) . '</b> '; } echo "</TD>"; echo "<TD class=\"main\" align=\"left\"><SELECT name=\"" . $current_value_id . "_prefix\"> <OPTION value=\"+\"" . $posCheck . ">+<OPTION value=\"-\"" . $negCheck . ">-</SELECT></TD>"; echo "</TR>"; // Download function start if (DOWNLOAD_ENABLED == 'true') { $file_list = vam_array_merge(array('0' => array('id' => '', 'text' => SELECT_FILE)), vam_getFiles(DIR_FS_CATALOG . 'download/')); echo "<tr>"; // echo "<td colspan=\"2\">File: <input type=\"file\" name=\"" . $current_value_id . "_download_file\"></td>"; // echo "<td colspan=\"2\" class=\"main\"> " . DL_FILE . "<br>" . vam_draw_pull_down_menu($current_value_id . '_download_file', vam_getDownloads(), $attribute_value_download_filename, '')."</td>"; echo "<td colspan=\"2\" class=\"main\"> " . DL_FILE . "<br>" . vam_draw_pull_down_menu($current_value_id . '_download_file', $file_list, $attribute_value_download_filename) . "</td>"; echo "<td class=\"main\"> " . DL_COUNT . "<br><input type=\"text\" name=\"" . $current_value_id . "_download_count\" value=\"" . $attribute_value_download_count . "\"></td>"; echo "<td class=\"main\"> " . DL_EXPIRE . "<br><input type=\"text\" name=\"" . $current_value_id . "_download_expire\" value=\"" . $attribute_value_download_expire . "\"></td>"; ?> <td class="main" align="left"><?php echo TABLE_TEXT_IS_PIN; ?> <?php echo vam_draw_checkbox_field($current_value_id . '_ispin', '', $products_attributes_is_pin, 1); ?> </td> <?php
$currencies = new currencies(); switch ($_GET['action']) { case 'insert': case 'save': $campaigns_id = vam_db_prepare_input($_GET['cID']); $campaigns_name = vam_db_prepare_input($_POST['campaigns_name']); $campaigns_refID = vam_db_prepare_input($_POST['campaigns_refID']); $sql_data_array = array('campaigns_name' => $campaigns_name, 'campaigns_refID' => $campaigns_refID); if ($_GET['action'] == 'insert') { $insert_sql_data = array('date_added' => 'now()'); $sql_data_array = vam_array_merge($sql_data_array, $insert_sql_data); vam_db_perform(TABLE_CAMPAIGNS, $sql_data_array); $campaigns_id = vam_db_insert_id(); } elseif ($_GET['action'] == 'save') { $update_sql_data = array('last_modified' => 'now()'); $sql_data_array = vam_array_merge($sql_data_array, $update_sql_data); vam_db_perform(TABLE_CAMPAIGNS, $sql_data_array, 'update', "campaigns_id = '" . vam_db_input($campaigns_id) . "'"); } vam_redirect(vam_href_link(FILENAME_CAMPAIGNS, 'page=' . $_GET['page'] . '&cID=' . $campaigns_id)); break; case 'deleteconfirm': $campaigns_id = vam_db_prepare_input($_GET['cID']); vam_db_query("delete from " . TABLE_CAMPAIGNS . " where campaigns_id = '" . vam_db_input($campaigns_id) . "'"); vam_db_query("delete from " . TABLE_CAMPAIGNS_IP . " where campaign = '" . vam_db_input($campaigns_id) . "'"); if ($_POST['delete_refferers'] == 'on') { vam_db_query("update " . TABLE_ORDERS . " set refferers_id = '' where refferers_id = '" . vam_db_input($campaigns_id) . "'"); vam_db_query("update " . TABLE_CUSTOMERS . " set refferers_id = '' where refferers_id = '" . vam_db_input($campaigns_id) . "'"); } vam_redirect(vam_href_link(FILENAME_CAMPAIGNS, 'page=' . $_GET['page'])); break; }
if (is_writable($file_admin)) { $chmod_admin = '<font color="Green">' . TEXT_YES . '</font>'; } else { $chmod_admin = '<font color="Red">' . TEXT_NO . '</font>'; } if (file_exists($file_admin)) { $code_admin = file_get_contents($file_admin); } else { $code_admin = TEXT_FILE_SELECT; } } echo vam_draw_form('select_admin', FILENAME_EMAIL_MANAGER, '', 'get'); ?> <?php $file_list_admin = vam_array_merge(array('0' => array('id' => '', 'text' => SELECT_FILE)), vam_getFiles(DIR_FS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/admin/mail/' . $_SESSION['language'] . '/', array('.txt', '.html'))); echo vam_draw_pull_down_menu('file_admin', $file_list_admin, $_REQUEST['file_admin']); echo ' <span class="button"><button type="submit" value="' . BUTTON_EDIT . '">' . vam_image(DIR_WS_IMAGES . 'icons/buttons/edit.png', '', '12', '12') . ' ' . BUTTON_EDIT . '</button></span>'; ?> <br /><br /> </form> <?php echo vam_draw_form('edit_admin', FILENAME_EMAIL_MANAGER, vam_get_all_get_params(), 'post'); ?> <?php if ($_POST['save'] && is_file($file_admin)) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="0">
$specials_query = vam_db_query($specials_query_raw); while ($specials = vam_db_fetch_array($specials_query)) { $price = $specials['products_price']; $new_price = $specials['specials_new_products_price']; if (PRICE_IS_BRUTTO == 'true') { $price_netto = vam_round($price, PRICE_PRECISION); $new_price_netto = vam_round($new_price, PRICE_PRECISION); $price = $price * (vam_get_tax_rate($specials['products_tax_class_id']) + 100) / 100; $new_price = $new_price * (vam_get_tax_rate($specials['products_tax_class_id']) + 100) / 100; } $specials['products_price'] = vam_round($price, PRICE_PRECISION); $specials['specials_new_products_price'] = vam_round($new_price, PRICE_PRECISION); if ((!$_GET['sID'] || $_GET['sID'] == $specials['specials_id']) && !$sInfo) { $products_query = vam_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . $specials['products_id'] . "'"); $products = vam_db_fetch_array($products_query); $sInfo_array = vam_array_merge($specials, $products); $sInfo = new objectInfo($sInfo_array); $sInfo->specials_new_products_price = $specials['specials_new_products_price']; $sInfo->products_price = $specials['products_price']; } if (is_object($sInfo) && $specials['specials_id'] == $sInfo->specials_id) { echo ' <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . vam_href_link(FILENAME_SPECIALS, 'page=' . $_GET['page'] . '&sID=' . $sInfo->specials_id . '&action=edit') . '\'">' . "\n"; } else { echo ' <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . vam_href_link(FILENAME_SPECIALS, 'page=' . $_GET['page'] . '&sID=' . $specials['specials_id']) . '\'">' . "\n"; } ?> <td class="dataTableContent"><?php echo $specials['products_name']; ?> </td> <td class="dataTableContent" align="right"><span class="oldPrice">
</td> </tr> </td> </tr> <tr> <td> </td> </tr> <?php $select_data = array(); $select_data = array(array('id' => '100', 'text' => TEXT_ALL_CUSTOMERS)); ?> <tr> <td class="smallText" ><?php echo HEADING_TITLE_STATUS . ' ' . vam_draw_pull_down_menu('status', vam_array_merge($select_data, $customers_statuses_array), '100'); ?> <br /><?php echo TEXT_CUSTOMER_EXPORT_SEPARATOR; ?> : <input name="separator" type="text" value="\t" size="3"> <span class="button"><button type="submit" name="submit" value="<?php echo TEXT_CUSTOMER_EXPORT; ?> "><?php echo vam_image(DIR_WS_IMAGES . 'icons/buttons/submit.png', '', '12', '12'); ?> <?php echo TEXT_CUSTOMER_EXPORT; ?> </button></span></td> </tr>
function vam_getFiles($startdir, $ext = array('.zip', '.rar', '.png', '.gif', '.mp3', '.jpg', '.exe', '.pdf', '.tar.gz', '.tar.bz2', '.7z', '.uha'), $dir_only = false, $subdir = '') { // echo 'Directory: ' . $startdir . ' Subirectory: ' . $subdir . '<br />'; if (!is_array($ext)) { $ext = array(); } $dirname = $startdir . $subdir; if ($dir = opendir($dirname)) { while ($file = readdir($dir)) { if (substr($file, 0, 1) != '.') { if (is_file($dirname . $file) && !$dir_only) { if (in_array(substr($file, strrpos($file, '.')), $ext)) { // echo ' File: ' . $subdir.$file . '<br />'; $files[] = array('id' => $subdir . $file, 'text' => $subdir . $file); array_multisort($files, SORT_ASC); } } elseif (is_dir($dirname . $file)) { if ($dir_only) { $files[] = array('id' => $subdir . $file . '/', 'text' => $subdir . $file . '/'); array_multisort($files, SORT_ASC); } $files = vam_array_merge($files, vam_getFiles($startdir, $ext, $dir_only, $subdir . $file . '/')); } } } closedir($dir); } return $files; }
break; } } $customers_query_raw = "select\n\t c.account_type,\n\t c.customers_id,\n\t c.customers_vat_id,\n\t c.customers_vat_id_status,\n\t c.customers_lastname,\n\t c.customers_firstname,\n\t c.customers_secondname,\n\t c.customers_email_address,\n\t a.entry_country_id,\n\t c.customers_status,\n\t c.member_flag,\n\t ci.customers_info_date_account_created\n\t from\n\t " . TABLE_CUSTOMERS . " c ,\n\t " . TABLE_ADDRESS_BOOK . " a,\n\t " . TABLE_CUSTOMERS_INFO . " ci\n\t Where\n\t c.customers_id = a.customers_id\n\t and c.customers_default_address_id = a.address_book_id\n\t and ci.customers_info_id = c.customers_id\n\t " . $search . "\n\t group by c.customers_id\n\t " . $sort; $customers_split = new splitPageResults($_GET['page'], MAX_DISPLAY_ADMIN_PAGE, $customers_query_raw, $customers_query_numrows); $customers_query = vam_db_query($customers_query_raw); while ($customers = vam_db_fetch_array($customers_query)) { $info_query = vam_db_query("select customers_info_date_account_created as date_account_created, customers_info_date_account_last_modified as date_account_last_modified, customers_info_date_of_last_logon as date_last_logon, customers_info_number_of_logons as number_of_logons from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $customers['customers_id'] . "'"); $info = vam_db_fetch_array($info_query); if ((!$_GET['cID'] || @$_GET['cID'] == $customers['customers_id']) && !$cInfo) { $country_query = vam_db_query("select countries_name from " . TABLE_COUNTRIES . " where countries_id = '" . $customers['entry_country_id'] . "'"); $country = vam_db_fetch_array($country_query); $reviews_query = vam_db_query("select count(*) as number_of_reviews from " . TABLE_REVIEWS . " where customers_id = '" . $customers['customers_id'] . "'"); $reviews = vam_db_fetch_array($reviews_query); $customer_info = array_merge((array) $country, (array) $info, (array) $reviews); $cInfo_array = vam_array_merge($customers, $customer_info); $cInfo = new objectInfo($cInfo_array); } if (is_object($cInfo) && $customers['customers_id'] == $cInfo->customers_id) { echo '<tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'">' . "\n"; } else { echo '<tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'">' . "\n"; } ?> <td class="dataTableContent" align="center"><input type="checkbox" name="multi_customers[]" value="<?php echo $customers['customers_id']; ?> "></td> <?php if ($customers['account_type'] == 1) { echo '<td class="dataTableContent">';
case 'insert': case 'save': $shipping_status_id = vam_db_prepare_input($_GET['oID']); $languages = vam_get_languages(); for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { $shipping_status_name_array = $_POST['shipping_status_name']; $language_id = $languages[$i]['id']; $sql_data_array = array('shipping_status_name' => vam_db_prepare_input($shipping_status_name_array[$language_id])); if ($_GET['action'] == 'insert') { if (!vam_not_null($shipping_status_id)) { $next_id_query = vam_db_query("select max(shipping_status_id) as shipping_status_id from " . TABLE_SHIPPING_STATUS . ""); $next_id = vam_db_fetch_array($next_id_query); $shipping_status_id = $next_id['shipping_status_id'] + 1; } $insert_sql_data = array('shipping_status_id' => $shipping_status_id, 'language_id' => $language_id); $sql_data_array = vam_array_merge($sql_data_array, $insert_sql_data); vam_db_perform(TABLE_SHIPPING_STATUS, $sql_data_array); } elseif ($_GET['action'] == 'save') { vam_db_perform(TABLE_SHIPPING_STATUS, $sql_data_array, 'update', "shipping_status_id = '" . vam_db_input($shipping_status_id) . "' and language_id = '" . $language_id . "'"); } } if ($shipping_status_image =& vam_try_upload('shipping_status_image', DIR_WS_ICONS)) { vam_db_query("update " . TABLE_SHIPPING_STATUS . " set shipping_status_image = '" . $shipping_status_image->filename . "' where shipping_status_id = '" . vam_db_input($shipping_status_id) . "'"); } if ($_POST['default'] == 'on') { vam_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . vam_db_input($shipping_status_id) . "' where configuration_key = 'DEFAULT_SHIPPING_STATUS_ID'"); } vam_redirect(vam_href_link(FILENAME_SHIPPING_STATUS, 'page=' . $_GET['page'] . '&oID=' . $shipping_status_id)); break; case 'deleteconfirm': $oID = vam_db_prepare_input($_GET['oID']);
<td width="90%"> <?php //subfolders in media added (Modified by Andreaz) require_once DIR_WS_FUNCTIONS . 'file_system.php'; $files = vam_get_filelist(DIR_FS_CATALOG . 'media/products/', '', array('index.html')); //subfolders in media added (Modified by Andreaz) // set default value in dropdown! unset($default_array); if ($content['content_file'] == '') { $default_array[] = array('id' => 'default', 'text' => TEXT_SELECT); $default_value = 'default'; } else { $default_array[] = array('id' => 'default', 'text' => TEXT_NO_FILE); $default_value = $content['content_file']; } $files = vam_array_merge($default_array, $files); echo '<br />' . TEXT_CHOOSE_FILE_SERVER_PRODUCTS . '</br>'; echo vam_draw_pull_down_menu('select_file', $files, $default_value); if ($content['content_file'] != '') { echo TEXT_CURRENT_FILE . ' <b>' . $content['content_file'] . '</b><br />'; } ?> </td> </td> </tr> <tr> <td width="10%" valign="top"><?php echo TEXT_UPLOAD_FILE; ?> </td> <td width="90%"><?php