[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/admin/ -> affiliate_banners.php (source)

   1  <?php
   2  /*

   3  $Id: affiliate_banners.php 14 2006-07-28 17:42:07Z user $

   4  

   5    OSC-Affiliate

   6  

   7    Contribution based on:

   8  

   9    osCMax Power E-Commerce

  10    http://oscdox.com

  11  

  12    Copyright 2006 osCMax

  13  

  14    Released under the GNU General Public License

  15  */
  16  
  17    require ('includes/application_top.php');
  18  
  19    $affiliate_banner_extension = tep_banner_image_extension();
  20  
  21    if ($HTTP_GET_VARS['action']) {
  22      switch ($HTTP_GET_VARS['action']) {
  23        case 'setaffiliate_flag':
  24          if ( ($HTTP_GET_VARS['affiliate_flag'] == '0') || ($HTTP_GET_VARS['affiliate_flag'] == '1') ) {
  25            tep_set_banner_status($HTTP_GET_VARS['abID'], $HTTP_GET_VARS['affiliate_flag']);
  26            $messageStack->add_session(SUCCESS_BANNER_STATUS_UPDATED, 'success');
  27          } else {
  28            $messageStack->add_session(ERROR_UNKNOWN_STATUS_FLAG, 'error');
  29          }
  30  
  31          tep_redirect(tep_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'selected_box=affiliate&page=' . $HTTP_GET_VARS['page'] . '&abID=' . $HTTP_GET_VARS['abID']));
  32          break;
  33        case 'insert':
  34        case 'update':
  35          $affiliate_banners_id = tep_db_prepare_input($HTTP_POST_VARS['affiliate_banners_id']);
  36          $affiliate_banners_title = tep_db_prepare_input($HTTP_POST_VARS['affiliate_banners_title']);
  37          $affiliate_products_id  = tep_db_prepare_input($HTTP_POST_VARS['affiliate_products_id']);
  38  // Added Category Banners

  39          $affiliate_category_id  = tep_db_prepare_input($HTTP_POST_VARS['affiliate_category_id']);
  40  // End Category Banners

  41          $new_affiliate_banners_group = tep_db_prepare_input($HTTP_POST_VARS['new_affiliate_banners_group']);
  42          $affiliate_banners_group = (empty($new_affiliate_banners_group)) ? tep_db_prepare_input($HTTP_POST_VARS['affiliate_banners_group']) : $new_affiliate_banners_group;
  43          $affiliate_banners_image_target = tep_db_prepare_input($HTTP_POST_VARS['affiliate_banners_image_target']);
  44          $affiliate_html_text = tep_db_prepare_input($HTTP_POST_VARS['affiliate_html_text']);
  45          $affiliate_banners_image_local = tep_db_prepare_input($HTTP_POST_VARS['affiliate_banners_image_local']);
  46          $affiliate_banners_image_target = tep_db_prepare_input($HTTP_POST_VARS['affiliate_banners_image_target']);
  47          $db_image_location = '';
  48  
  49          $affiliate_banner_error = false;
  50          if (empty($affiliate_banners_title)) {
  51            $messageStack->add(ERROR_BANNER_TITLE_REQUIRED, 'error');
  52            $affiliate_banner_error = true;
  53          }
  54  /*      if (empty($affiliate_banners_group)) {

  55            $messageStack->add(ERROR_BANNER_GROUP_REQUIRED, 'error');

  56            $affiliate_banner_error = true;

  57          }

  58  */
  59          if ( ($affiliate_banners_image) && ($affiliate_banners_image != 'none') && (is_uploaded_file($affiliate_banners_image)) ) {
  60            if (!is_writeable(DIR_FS_CATALOG_IMAGES . $affiliate_banners_image_target)) {
  61              if (is_dir(DIR_FS_CATALOG_IMAGES . $affiliate_banners_image_target)) {
  62                $messageStack->add(ERROR_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');
  63              } else {
  64                $messageStack->add(ERROR_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');
  65              }
  66              $affiliate_banner_error = true;
  67            }
  68          }
  69  
  70          if (!$affiliate_banner_error) {
  71            if (empty($affiliate_html_text)) {
  72              if ( ($affiliate_banners_image) && ($affiliate_banners_image != 'none') && (is_uploaded_file($affiliate_banners_image)) ) {
  73                $image_location = DIR_FS_CATALOG_IMAGES . $affiliate_banners_image_target . $affiliate_banners_image_name;
  74                copy($affiliate_banners_image, $image_location);
  75              }
  76              $db_image_location = (!empty($affiliate_banners_image_local)) ? $affiliate_banners_image_local : $affiliate_banners_image_target . $affiliate_banners_image_name;
  77            }
  78  
  79            if (!$affiliate_products_id) $affiliate_products_id="0";
  80  // Added Category Banners

  81            if (!$affiliate_category_id) $affiliate_category_id="0";
  82  // End Category Banners

  83              $sql_data_array = array('affiliate_banners_title' => $affiliate_banners_title,
  84                                      'affiliate_products_id' => $affiliate_products_id,
  85  // Added Category Banners

  86                                      'affiliate_category_id' => $affiliate_category_id,
  87  // End Category Banners

  88                                      'affiliate_banners_image' => $db_image_location,
  89                                      'affiliate_banners_group' => $affiliate_banners_group);
  90  
  91            if ($HTTP_GET_VARS['action'] == 'insert') {
  92              $insert_sql_data = array('affiliate_date_added' => 'now()',
  93                                       'affiliate_status' => '1');
  94              $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
  95              tep_db_perform(TABLE_AFFILIATE_BANNERS, $sql_data_array);
  96              $affiliate_banners_id = tep_db_insert_id();
  97  
  98            // Banner ID 1 is generic Product Banner

  99              if ($affiliate_banners_id==1) tep_db_query("update " . TABLE_AFFILIATE_BANNERS . " set affiliate_banners_id = affiliate_banners_id + 1");
 100              $messageStack->add_session(SUCCESS_BANNER_INSERTED, 'success');
 101            } elseif ($HTTP_GET_VARS['action'] == 'update') {
 102              $insert_sql_data = array('affiliate_date_status_change' => 'now()');
 103              $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
 104              tep_db_perform(TABLE_AFFILIATE_BANNERS, $sql_data_array, 'update', 'affiliate_banners_id = \'' . $affiliate_banners_id . '\'');
 105              $messageStack->add_session(SUCCESS_BANNER_UPDATED, 'success');
 106            }
 107  
 108            tep_redirect(tep_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'selected_box=affiliate&page=' . $HTTP_GET_VARS['page'] . '&abID=' . $affiliate_banners_id));
 109          } else {
 110            $HTTP_GET_VARS['action'] = 'new';
 111          }
 112          break;
 113        case 'deleteconfirm':
 114          $affiliate_banners_id = tep_db_prepare_input($HTTP_GET_VARS['abID']);
 115          $delete_image = tep_db_prepare_input($HTTP_POST_VARS['delete_image']);
 116  
 117          if ($delete_image == 'on') {
 118            $affiliate_banner_query = tep_db_query("select affiliate_banners_image from " . TABLE_AFFILIATE_BANNERS . " where affiliate_banners_id = '" . tep_db_input($affiliate_banners_id) . "'");
 119            $affiliate_banner = tep_db_fetch_array($affiliate_banner_query);
 120            if (is_file(DIR_FS_CATALOG_IMAGES . $affiliate_banner['affiliate_banners_image'])) {
 121              if (is_writeable(DIR_FS_CATALOG_IMAGES . $affiliate_banner['affiliate_banners_image'])) {
 122                unlink(DIR_FS_CATALOG_IMAGES . $affiliate_banner['affiliate_banners_image']);
 123              } else {
 124                $messageStack->add_session(ERROR_IMAGE_IS_NOT_WRITEABLE, 'error');
 125              }
 126            } else {
 127              $messageStack->add_session(ERROR_IMAGE_DOES_NOT_EXIST, 'error');
 128            }
 129          }
 130  
 131          tep_db_query("delete from " . TABLE_AFFILIATE_BANNERS . " where affiliate_banners_id = '" . tep_db_input($affiliate_banners_id) . "'");
 132          tep_db_query("delete from " . TABLE_AFFILIATE_BANNERS_HISTORY . " where affiliate_banners_id = '" . tep_db_input($affiliate_banners_id) . "'");
 133  
 134          $messageStack->add_session(SUCCESS_BANNER_REMOVED, 'success');
 135  
 136          tep_redirect(tep_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'selected_box=affiliate&page=' . $HTTP_GET_VARS['page']));
 137          break;
 138      }
 139    }
 140  ?>
 141  <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
 142  <html <?php echo HTML_PARAMS; ?>>
 143  <head>
 144  <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
 145  <title><?php echo TITLE; ?></title>
 146  <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
 147  <script language="javascript"><!--
 148  function popupImageWindow(url) {
 149    window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=300,screenX=150,screenY=150,top=150,left=150')
 150  }
 151  //--></script>

 152  <script language="javascript"><!--
 153  function popupWindow(url) {
 154    window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=300,screenX=150,screenY=150,top=150,left=150')
 155  }
 156  //--></script>

 157  </head>
 158  <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
 159  <div id="spiffycalendar" class="text"></div>
 160  <!-- header //-->
 161  <?php require (DIR_WS_INCLUDES . 'header.php'); ?>
 162  <!-- header_eof //-->
 163  
 164  <!-- body //-->
 165  <table border="0" width="100%" cellspacing="2" cellpadding="2">
 166    <tr>
 167      <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
 168  <!-- left_navigation //-->
 169  <?php require (DIR_WS_INCLUDES . 'column_left.php'); ?>
 170  <!-- left_navigation_eof //-->
 171      </table></td>
 172  <!-- body_text //-->
 173      <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
 174        <tr>
 175          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
 176            <tr>
 177              <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
 178              <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
 179            </tr>
 180          </table></td>
 181        </tr>
 182  <?php
 183    if ($HTTP_GET_VARS['action'] == 'new') {
 184      $form_action = 'insert';
 185      if ($HTTP_GET_VARS['abID']) {
 186        $abID = tep_db_prepare_input($HTTP_GET_VARS['abID']);
 187        $form_action = 'update';
 188  
 189        $affiliate_banner_query = tep_db_query("select * from " . TABLE_AFFILIATE_BANNERS . " where affiliate_banners_id = '" . tep_db_input($abID) . "'");
 190        $affiliate_banner = tep_db_fetch_array($affiliate_banner_query);
 191  
 192        $abInfo = new objectInfo($affiliate_banner);
 193      } elseif ($HTTP_POST_VARS) {
 194        $abInfo = new objectInfo($HTTP_POST_VARS);
 195      } else {
 196        $abInfo = new objectInfo(array());
 197      }
 198  
 199      $groups_array = array();
 200      $groups_query = tep_db_query("select distinct affiliate_banners_group from " . TABLE_AFFILIATE_BANNERS . " order by affiliate_banners_group");
 201      while ($groups = tep_db_fetch_array($groups_query)) {
 202        $groups_array[] = array('id' => $groups['affiliate_banners_group'], 'text' => $groups['affiliate_banners_group']);
 203      }
 204  ?>
 205        <tr>
 206          <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 207        </tr>
 208        <tr><?php echo tep_draw_form('new_banner', FILENAME_AFFILIATE_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&action=' . $form_action, 'post', 'enctype="multipart/form-data"'); if ($form_action == 'update') echo tep_draw_hidden_field('affiliate_banners_id', $abID); ?>
 209          <td><table border="0" cellspacing="2" cellpadding="2">
 210            <tr>
 211              <td class="main"><?php echo TEXT_BANNERS_TITLE; ?></td>
 212              <td class="main"><?php echo tep_draw_input_field('affiliate_banners_title', $abInfo->affiliate_banners_title, '', true); ?></td>
 213            </tr>
 214            <tr>
 215              <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 216            </tr>
 217            <tr>
 218              <td class="main"><?php echo TEXT_BANNERS_LINKED_PRODUCT; ?></td>
 219              <td class="main"><?php echo tep_draw_input_field('affiliate_products_id', $abInfo->affiliate_products_id, '', false); ?></td>
 220            </tr>
 221            <tr>
 222              <td class="main" colspan=2><?php echo TEXT_BANNERS_LINKED_PRODUCT_NOTE ?></td>
 223            </tr>
 224            <tr>
 225              <td class="main" colspan=2>&nbsp;&nbsp;</b><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_AFFILIATE_VALIDPRODUCTS) . '\')"><b>' . TEXT_AFFILIATE_VALIDPRODUCTS . '</b></a>'; ?>&nbsp;&nbsp;<?php echo TEXT_AFFILIATE_INDIVIDUAL_BANNER_VIEW;?></td>
 226            </tr>
 227            <tr>
 228              <td class="main" colspan=2><?php echo TEXT_AFFILIATE_INDIVIDUAL_BANNER_HELP;?>
 229            </tr>
 230  <?php  // Added Category Banners 
 231  ?>
 232            <tr>
 233              <td class="main"><?php echo TEXT_BANNERS_LINKED_CATEGORY; ?></td>
 234              <td class="main"><?php echo tep_draw_input_field('affiliate_category_id', $abInfo->affiliate_category_id, '', false); ?></td>
 235            </tr>
 236            <tr>
 237              <td class="main" colspan=2><?php echo TEXT_BANNERS_LINKED_CATEGORY_NOTE ?></td>
 238            </tr>
 239            <tr>
 240              <td class="main" colspan=2>&nbsp;&nbsp;</b><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_AFFILIATE_VALIDCATS) . '\')"><b>' . TEXT_AFFILIATE_VALIDPRODUCTS . '</b></a>'; ?>&nbsp;&nbsp;<?php echo TEXT_AFFILIATE_CATEGORY_BANNER_VIEW;?></td>
 241            </tr>
 242  <?php // End Category Banners
 243  ?>
 244            <tr>
 245              <td class="main" colspan=2><?php echo TEXT_AFFILIATE_CATEGORY_BANNER_HELP;?>
 246            </tr>
 247            <tr>
 248              <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 249            </tr>
 250  <?php
 251  /*

 252            <tr>

 253              <td class="main" valign="top"><?php echo TEXT_BANNERS_GROUP; ?></td>

 254              <td class="main"><?php echo tep_draw_pull_down_menu('affiliate_banners_group', $groups_array, $abInfo->affiliate_banners_group) . TEXT_BANNERS_NEW_GROUP . '<br>' . tep_draw_input_field('new_affiliate_banners_group', '', '', ((sizeof($groups_array) > 0) ? false : true)); ?></td>

 255            </tr>

 256            <tr>

 257              <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

 258            </tr>

 259  */
 260  ?>
 261            <tr>
 262              <td class="main" valign="top"><?php echo TEXT_BANNERS_IMAGE; ?></td>
 263              <td class="main"><?php echo tep_draw_file_field('affiliate_banners_image') . ' ' . TEXT_BANNERS_IMAGE_LOCAL . '<br>' . DIR_FS_CATALOG_IMAGES . tep_draw_input_field('affiliate_banners_image_local', $abInfo->affiliate_banners_image); ?></td>
 264            </tr>
 265            <tr>
 266              <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 267            </tr>
 268            <tr>
 269              <td class="main"><?php echo TEXT_BANNERS_IMAGE_TARGET; ?></td>
 270              <td class="main"><?php echo DIR_FS_CATALOG_IMAGES . tep_draw_input_field('affiliate_banners_image_target'); ?></td>
 271            </tr>
 272          </table></td>
 273        </tr>
 274        <tr>
 275          <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 276        </tr>
 277        <tr>
 278          <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
 279            <tr>
 280              <td class="main" align="right" valign="top" nowrap><?php echo (($form_action == 'insert') ? tep_image_submit('button_insert.gif', IMAGE_INSERT) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'selected_box=affiliate&page=' . $HTTP_GET_VARS['page'] . '&abID=' . $HTTP_GET_VARS['abID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
 281            </tr>
 282          </table></td>
 283        </form></tr>
 284  <?php
 285    } else {
 286  ?>
 287        <tr>
 288          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
 289            <tr>
 290              <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
 291                <tr class="dataTableHeadingRow">
 292                  <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_BANNERS; ?></td>
 293  <?php // Added Category Banners
 294  ?>
 295                  <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_CATEGORY_ID; ?></td>
 296  <?php // End Category Banners
 297  ?>
 298                  <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRODUCT_ID; ?></td>
 299                  <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATISTICS; ?></td>
 300                  <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
 301                </tr>
 302  <?php
 303      $affiliate_banners_query_raw = "select * from " . TABLE_AFFILIATE_BANNERS . " order by affiliate_banners_title, affiliate_banners_group";
 304      $affiliate_banners_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $affiliate_banners_query_raw, $affiliate_banners_query_numrows);
 305      $affiliate_banners_query = tep_db_query($affiliate_banners_query_raw);
 306      while ($affiliate_banners = tep_db_fetch_array($affiliate_banners_query)) {
 307        $info_query = tep_db_query("select sum(affiliate_banners_shown) as affiliate_banners_shown, sum(affiliate_banners_clicks) as affiliate_banners_clicks from " . TABLE_AFFILIATE_BANNERS_HISTORY . " where affiliate_banners_id = '" . $affiliate_banners['affiliate_banners_id'] . "'");
 308        $info = tep_db_fetch_array($info_query);
 309  
 310        if (((!$HTTP_GET_VARS['abID']) || ($HTTP_GET_VARS['abID'] == $affiliate_banners['affiliate_banners_id'])) && (!$abInfo) && (substr($HTTP_GET_VARS['action'], 0, 3) != 'new')) {
 311          $abInfo_array = array_merge($affiliate_banners, $info);
 312          $abInfo = new objectInfo($abInfo_array);
 313        }
 314  
 315        $affiliate_banners_shown = ($info['affiliate_banners_shown'] != '') ? $info['affiliate_banners_shown'] : '0';
 316        $affiliate_banners_clicked = ($info['affiliate_banners_clicks'] != '') ? $info['affiliate_banners_clicks'] : '0';
 317  
 318        if ( (is_object($abInfo)) && ($affiliate_banners['affiliate_banners_id'] == $abInfo->affiliate_banners_id) ) {
 319          echo '              <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_AFFILIATE_BANNERS,'abID=' . $abInfo->affiliate_banners_id . '&action=new')  . '\'">' . "\n";
 320        } else {
 321          echo '              <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_AFFILIATE_BANNERS, 'abID=' . $affiliate_banners['affiliate_banners_id']) . '\'">' . "\n";
 322        }
 323  ?>
 324                  <td class="dataTableContent"><?php echo '<a href="javascript:popupImageWindow(\'' . FILENAME_AFFILIATE_POPUP_IMAGE . '?banner=' . $affiliate_banners['affiliate_banners_id'] . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_popup.gif', ICON_PREVIEW) . '</a>&nbsp;' . $affiliate_banners['affiliate_banners_title']; ?></td>
 325  <?php // Added Category Banners
 326  ?>
 327                  <td class="dataTableContent" align="right"><?php if ($affiliate_banners['affiliate_category_id']>0) echo $affiliate_banners['affiliate_category_id']; else echo '&nbsp;'; ?></td>
 328  <?php // End Category Banners
 329  ?>
 330                  <td class="dataTableContent" align="right"><?php if ($affiliate_banners['affiliate_products_id']>0) echo $affiliate_banners['affiliate_products_id']; else echo '&nbsp;'; ?></td>
 331                  <td class="dataTableContent" align="right"><?php echo $affiliate_banners_shown . ' / ' . $affiliate_banners_clicked; ?></td>
 332                  <td class="dataTableContent" align="right"><?php if ( (is_object($abInfo)) && ($affiliate_banners['affiliate_banners_id'] == $abInfo->affiliate_banners_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'selected_box=affiliate&page=' . $HTTP_GET_VARS['page'] . '&abID=' . $affiliate_banners['affiliate_banners_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
 333                </tr>
 334  <?php
 335      }
 336  ?>
 337                <tr>
 338                  <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
 339                    <tr>
 340                      <td class="smallText" valign="top"><?php echo $affiliate_banners_split->display_count($affiliate_banners_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_BANNERS); ?></td>
 341                      <td class="smallText" align="right"><?php echo $affiliate_banners_split->display_links($affiliate_banners_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
 342                    </tr>
 343                    <tr>
 344                      <td align="right" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'selected_box=affiliate&action=new') . '">' . tep_image_button('button_new_banner.gif', IMAGE_NEW_BANNER) . '</a>'; ?></td>
 345                    </tr>
 346                  </table></td>
 347                </tr>
 348              </table></td>
 349  <?php
 350    $heading = array();
 351    $contents = array();
 352    switch ($HTTP_GET_VARS['action']) {
 353      case 'delete':
 354        $heading[] = array('text' => '<b>' . $abInfo->affiliate_banners_title . '</b>');
 355  
 356        $contents = array('form' => tep_draw_form('affiliate_banners', FILENAME_AFFILIATE_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&abID=' . $abInfo->affiliate_banners_id . '&action=deleteconfirm'));
 357        $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
 358        $contents[] = array('text' => '<br><b>' . $abInfo->affiliate_banners_title . '</b>');
 359        if ($abInfo->affiliate_banners_image) $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('delete_image', 'on', true) . ' ' . TEXT_INFO_DELETE_IMAGE);
 360        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'selected_box=affiliate&page=' . $HTTP_GET_VARS['page'] . '&abID=' . $HTTP_GET_VARS['abID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
 361        break;
 362      default:
 363        if (is_object($abInfo)) {
 364          $sql = "select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $abInfo->affiliate_products_id . "' and language_id = '" . $languages_id . "'"; 
 365          $product_description_query = tep_db_query($sql);
 366          $product_description = tep_db_fetch_array($product_description_query);
 367          $heading[] = array('text' => '<b>' . $abInfo->affiliate_banners_title . '</b>');
 368  
 369          $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'selected_box=affiliate&page=' . $HTTP_GET_VARS['page'] . '&abID=' . $abInfo->affiliate_banners_id . '&action=new') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'selected_box=affiliate&page=' . $HTTP_GET_VARS['page'] . '&abID=' . $abInfo->affiliate_banners_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
 370          $contents[] = array('text' => $product_description['products_name']);
 371          $contents[] = array('text' => '<br>' . TEXT_BANNERS_DATE_ADDED . ' ' . tep_date_short($abInfo->affiliate_date_added));
 372          $contents[] = array('text' => '' . sprintf(TEXT_BANNERS_STATUS_CHANGE, tep_date_short($abInfo->affiliate_date_status_change)));
 373        }
 374        break;
 375    }
 376  
 377    if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
 378      echo '            <td width="25%" valign="top">' . "\n";
 379  
 380      $box = new box;
 381      echo $box->infoBox($heading, $contents);
 382  
 383      echo '            </td>' . "\n";
 384    }
 385  ?>
 386            </tr>
 387          </table></td>
 388        </tr>
 389  <?php
 390    }
 391  ?>
 392      </table></td>
 393  <!-- body_text_eof //-->
 394    </tr>
 395  </table>
 396  <!-- body_eof //-->
 397  
 398  <!-- footer //-->
 399  <?php require (DIR_WS_INCLUDES . 'footer.php'); ?>
 400  <!-- footer_eof //-->
 401  <br>
 402  </body>
 403  </html>
 404  <?php require (DIR_WS_INCLUDES . 'application_bottom.php'); ?>


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7