[ Index ]
 

Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/admin/ -> reviews.php (source)

   1  <?php
   2  /**

   3   * @package admin

   4   * @copyright Copyright 2003-2006 Zen Cart Development Team

   5   * @copyright Portions Copyright 2003 osCommerce

   6   * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0

   7   * @version $Id: reviews.php 4737 2006-10-13 07:13:11Z drbyte $

   8   */
   9  
  10    require ('includes/application_top.php');
  11  
  12    $action = (isset($_GET['action']) ? $_GET['action'] : '');
  13    $status_filter = (isset($_GET['status']) ? $_GET['status'] : '');
  14    $status_list[] = array('id' => 1, 'text' => TEXT_PENDING_APPROVAL);
  15    $status_list[] = array('id' => 2, 'text' => TEXT_APPROVED);
  16  
  17    if (zen_not_null($action)) {
  18      switch ($action) {
  19        case 'setflag':
  20          zen_set_reviews_status($_GET['id'], $_GET['flag']);
  21  
  22          zen_redirect(zen_href_link(FILENAME_REVIEWS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'rID=' . $_GET['id'], 'NONSSL'));
  23          break;
  24        case 'update':
  25          $reviews_id = zen_db_prepare_input($_GET['rID']);
  26          $reviews_rating = zen_db_prepare_input($_POST['reviews_rating']);
  27          $reviews_text = zen_db_prepare_input($_POST['reviews_text']);
  28  
  29          $db->Execute("update " . TABLE_REVIEWS . "
  30                        set reviews_rating = '" . zen_db_input($reviews_rating) . "',
  31                        last_modified = now() where reviews_id = '" . (int)$reviews_id . "'");
  32  
  33          $db->Execute("update " . TABLE_REVIEWS_DESCRIPTION . "
  34                        set reviews_text = '" . zen_db_input($reviews_text) . "'
  35                        where reviews_id = '" . (int)$reviews_id . "'");
  36  
  37          zen_redirect(zen_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $reviews_id));
  38          break;
  39        case 'deleteconfirm':
  40          // demo active test

  41          if (zen_admin_demo()) {
  42            $_GET['action']= '';
  43            $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
  44            zen_redirect(zen_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page']));
  45          }
  46          $reviews_id = zen_db_prepare_input($_GET['rID']);
  47  
  48          $db->Execute("delete from " . TABLE_REVIEWS . "
  49                        where reviews_id = '" . (int)$reviews_id . "'");
  50  
  51          $db->Execute("delete from " . TABLE_REVIEWS_DESCRIPTION . "
  52                        where reviews_id = '" . (int)$reviews_id . "'");
  53  
  54  
  55          zen_redirect(zen_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page']));
  56          break;
  57      }
  58    }
  59  ?>
  60  <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
  61  <html <?php echo HTML_PARAMS; ?>>
  62  <head>
  63  <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
  64  <title><?php echo TITLE; ?></title>
  65  <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
  66  <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
  67  <script language="javascript" src="includes/menu.js"></script>
  68  <script language="javascript" src="includes/general.js"></script>
  69  <script type="text/javascript">
  70    <!--
  71    function init()
  72    {
  73      cssjsmenu('navbar');
  74      if (document.getElementById)
  75      {
  76        var kill = document.getElementById('hoverJS');
  77        kill.disabled = true;
  78      }
  79    }
  80    // -->

  81  </script>
  82  </head>
  83  <body onLoad="init()">
  84  <!-- header //-->
  85  <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
  86  <!-- header_eof //-->
  87  
  88  <!-- body //-->
  89  <table border="0" width="100%" cellspacing="2" cellpadding="2">
  90    <tr>
  91  <!-- body_text //-->
  92      <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  93        <tr>
  94          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  95           <tr><?php echo zen_draw_form('search', FILENAME_REVIEWS, '', 'get'); ?>
  96              <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
  97              <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
  98              <td class="smallText" align="right">
  99  <?php
 100  // show reset search

 101    if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
 102      echo '<a href="' . zen_href_link(FILENAME_REVIEWS) . '">' . zen_image_button('button_reset.gif', IMAGE_RESET) . '</a>&nbsp;&nbsp;';
 103    }
 104    echo HEADING_TITLE_SEARCH_DETAIL . ' ' . zen_draw_input_field('search') . zen_hide_session_id();
 105    if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
 106      $keywords = zen_db_input(zen_db_prepare_input($_GET['search']));
 107      echo '<br/ >' . TEXT_INFO_SEARCH_DETAIL_FILTER . $keywords;
 108    }
 109  ?>
 110              </td>
 111            </form></tr>
 112                <tr><?php echo zen_draw_form('status', FILENAME_REVIEWS, '', 'get', '', true); ?>
 113                  <td class="smallText" colspan="3" align="right">
 114                    <?php
 115                      echo HEADING_TITLE_STATUS . ' ' . zen_draw_pull_down_menu('status', array_merge(array(array('id' => '', 'text' => TEXT_ALL_STATUS)), $status_list), $status_filter, 'onChange="this.form.submit();"');
 116                      echo zen_hide_session_id();
 117                   ?>
 118                  </td>
 119                </form></tr>
 120          </table></td>
 121        </tr>
 122  <?php
 123    if ($action == 'edit') {
 124      $rID = zen_db_prepare_input($_GET['rID']);
 125  
 126      $reviews = $db->Execute("select r.reviews_id, r.products_id, r.customers_name, r.date_added,
 127                                      r.last_modified, r.reviews_read, rd.reviews_text, r.reviews_rating
 128                               from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd
 129                               where r.reviews_id = '" . (int)$rID . "' and r.reviews_id = rd.reviews_id");
 130  
 131      $products = $db->Execute("select products_image
 132                                from " . TABLE_PRODUCTS . "
 133                                where products_id = '" . (int)$reviews->fields['products_id'] . "'");
 134  
 135      $products_name = $db->Execute("select products_name
 136                                     from " . TABLE_PRODUCTS_DESCRIPTION . "
 137                                     where products_id = '" . (int)$reviews->fields['products_id'] . "'
 138                                     and language_id = '" . (int)$_SESSION['languages_id'] . "'");
 139  
 140      $rInfo_array = array_merge($reviews->fields, $products->fields, $products_name->fields);
 141      $rInfo = new objectInfo($rInfo_array);
 142  ?>
 143        <tr><?php echo zen_draw_form('review', FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $_GET['rID'] . '&action=preview'); ?>
 144          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
 145            <tr>
 146              <td class="main" valign="top"><b><?php echo ENTRY_PRODUCT; ?></b> <?php echo $rInfo->products_name; ?><br><b><?php echo ENTRY_FROM; ?></b> <?php echo $rInfo->customers_name; ?><br><br><b><?php echo ENTRY_DATE; ?></b> <?php echo zen_date_short($rInfo->date_added); ?></td>
 147              <td class="main" align="right" valign="top"><?php echo zen_image(DIR_WS_CATALOG_IMAGES . $rInfo->products_image, $rInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"'); ?></td>
 148            </tr>
 149          </table></td>
 150        </tr>
 151        <tr>
 152          <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
 153            <tr>
 154              <td class="main" valign="top"><b><?php echo ENTRY_REVIEW; ?></b><br><br><?php echo zen_draw_textarea_field('reviews_text', 'soft', '70', '15', stripslashes($rInfo->reviews_text)); ?></td>
 155            </tr>
 156            <tr>
 157              <td class="smallText" align="right"><?php echo ENTRY_REVIEW_TEXT; ?></td>
 158            </tr>
 159          </table></td>
 160        </tr>
 161        <tr>
 162          <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 163        </tr>
 164        <tr>
 165          <td class="main"><b><?php echo ENTRY_RATING; ?></b>&nbsp;<?php echo TEXT_BAD; ?>&nbsp;<?php for ($i=1; $i<=5; $i++) echo zen_draw_radio_field('reviews_rating', $i, '', $rInfo->reviews_rating) . '&nbsp;'; echo TEXT_GOOD; ?></td>
 166        </tr>
 167        <tr>
 168          <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 169        </tr>
 170        <tr>
 171          <td align="right" class="main"><?php echo zen_draw_hidden_field('reviews_id', $rInfo->reviews_id) . zen_draw_hidden_field('products_id', $rInfo->products_id) . zen_draw_hidden_field('customers_name', $rInfo->customers_name) . zen_draw_hidden_field('products_name', $rInfo->products_name) . zen_draw_hidden_field('products_image', $rInfo->products_image) . zen_draw_hidden_field('date_added', $rInfo->date_added) . zen_image_submit('button_preview.gif', IMAGE_PREVIEW) . ' <a href="' . zen_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $_GET['rID']) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
 172        </form></tr>
 173  <?php
 174    } elseif ($action == 'preview') {
 175      if (zen_not_null($_POST)) {
 176        $rInfo = new objectInfo($_POST);
 177      } else {
 178        $rID = zen_db_prepare_input($_GET['rID']);
 179  
 180        $reviews = $db->Execute("select r.reviews_id, r.products_id, r.customers_name, r.date_added,
 181                                        r.last_modified, r.reviews_read, rd.reviews_text,
 182                                        r.reviews_rating
 183                                 from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd
 184                                 where r.reviews_id = '" . (int)$rID . "'
 185                                 and r.reviews_id = rd.reviews_id");
 186  
 187        $products = $db->Execute("select products_image
 188                                  from " . TABLE_PRODUCTS . "
 189                                  where products_id = '" . (int)$reviews->fields['products_id'] . "'");
 190  
 191        $products_name = $db->Execute("select products_name
 192                                       from " . TABLE_PRODUCTS_DESCRIPTION . "
 193                                       where products_id = '" . (int)$reviews->fields['products_id'] . "'
 194                                       and language_id = '" . (int)$_SESSION['languages_id'] . "'");
 195  
 196        $rInfo_array = array_merge($reviews->fields, $products->fields, $products_name->fields);
 197        $rInfo = new objectInfo($rInfo_array);
 198      }
 199  ?>
 200        <tr><?php echo zen_draw_form('update', FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $_GET['rID'] . '&action=update', 'post', 'enctype="multipart/form-data"'); ?>
 201          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
 202            <tr>
 203              <td class="main" valign="top"><b><?php echo ENTRY_PRODUCT; ?></b> <?php echo $rInfo->products_name; ?><br><b><?php echo ENTRY_FROM; ?></b> <?php echo $rInfo->customers_name; ?><br><br><b><?php echo ENTRY_DATE; ?></b> <?php echo zen_date_short($rInfo->date_added); ?></td>
 204              <td class="main" align="right" valign="top"><?php echo zen_image(DIR_WS_CATALOG_IMAGES . $rInfo->products_image, $rInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"'); ?></td>
 205            </tr>
 206          </table>
 207        </tr>
 208        <tr>
 209          <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
 210            <tr>
 211              <td valign="top" class="main"><b><?php echo ENTRY_REVIEW; ?></b><br><br><?php echo nl2br(zen_db_output(zen_break_string($rInfo->reviews_text, 15))); ?></td>
 212            </tr>
 213          </table></td>
 214        </tr>
 215        <tr>
 216          <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 217        </tr>
 218        <tr>
 219          <td class="main"><b><?php echo ENTRY_RATING; ?></b>&nbsp;<?php echo zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $rInfo->reviews_rating . '.gif', sprintf(TEXT_OF_5_STARS, $rInfo->reviews_rating)); ?>&nbsp;<small>[<?php echo sprintf(TEXT_OF_5_STARS, $rInfo->reviews_rating); ?>]</small></td>
 220        </tr>
 221        <tr>
 222          <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 223        </tr>
 224  <?php
 225      if (zen_not_null($_POST)) {
 226  /* Re-Post all POST'ed variables */

 227        reset($_POST);
 228        while(list($key, $value) = each($_POST)) echo zen_draw_hidden_field($key, $value);
 229  ?>
 230        <tr>
 231          <td align="right" class="smallText"><?php echo '<a href="' . zen_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id . '&action=edit') . '">' . zen_image_button('button_back.gif', IMAGE_BACK) . '</a> ' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . zen_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
 232        </form></tr>
 233  <?php
 234      } else {
 235        if (isset($_GET['origin'])) {
 236          $back_url = $_GET['origin'];
 237          $back_url_params = '';
 238        } else {
 239          $back_url = FILENAME_REVIEWS;
 240          $back_url_params = 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id;
 241        }
 242  ?>
 243        <tr>
 244          <td align="right"><?php echo '<a href="' . zen_href_link($back_url, $back_url_params, 'NONSSL') . '">' . zen_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
 245        </tr>
 246  <?php
 247      }
 248    } else {
 249  ?>
 250        <tr>
 251          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
 252            <tr>
 253              <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
 254                <tr class="dataTableHeadingRow">
 255                  <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
 256                  <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMER_NAME; ?></td>
 257                  <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_RATING; ?></td>
 258                  <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_DATE_ADDED; ?></td>
 259                  <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>
 260                  <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
 261                </tr>
 262  <?php
 263  
 264  // create search filter

 265      $search = '';
 266      if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
 267        $keywords = zen_db_input(zen_db_prepare_input($_GET['search']));
 268        $search = " and r.customers_name like '%" . $keywords . "%' or rd.reviews_text like '%" . $keywords . "%' or pd.products_name like '%" . $keywords . "%' or pd.products_description like '%" . $keywords . "%' or p.products_model like '%" . $keywords . "%'";
 269      }
 270  
 271      if ($status_filter !='' && $status_filter >0) $search .= " and r.status=" . ((int)$status_filter-1) . " ";
 272  
 273      $order_by = " order by pd.products_name";
 274  
 275      $reviews_query_raw = ("select r.*, rd.*, pd.*, p.* from (" . TABLE_REVIEWS . " r left join " . TABLE_REVIEWS_DESCRIPTION . " rd on r.reviews_id = rd.reviews_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on r.products_id = pd.products_id and pd.language_id ='" . (int)$_SESSION['languages_id'] . "' left join " . TABLE_PRODUCTS . " p on p.products_id= r.products_id) " . " where r.products_id = p.products_id " . $search . $order_by);
 276  
 277  //    $reviews_query_raw = "select reviews_id, products_id, date_added, last_modified, reviews_rating, status from " . TABLE_REVIEWS . " order by date_added DESC";

 278      $reviews_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $reviews_query_raw, $reviews_query_numrows);
 279      $reviews = $db->Execute($reviews_query_raw);
 280      while (!$reviews->EOF) {
 281        if ((!isset($_GET['rID']) || (isset($_GET['rID']) && ($_GET['rID'] == $reviews->fields['reviews_id']))) && !isset($rInfo)) {
 282          $reviews_text = $db->Execute("select r.reviews_read, r.customers_name,
 283                                               length(rd.reviews_text) as reviews_text_size
 284                                        from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd
 285                                        where r.reviews_id = '" . (int)$reviews->fields['reviews_id'] . "'
 286                                        and r.reviews_id = rd.reviews_id");
 287  
 288          $products_image = $db->Execute("select products_image
 289                                          from " . TABLE_PRODUCTS . "
 290                                          where products_id = '" . (int)$reviews->fields['products_id'] . "'");
 291  
 292  
 293          $products_name = $db->Execute("select products_name
 294                                         from " . TABLE_PRODUCTS_DESCRIPTION . "
 295                                         where products_id = '" . (int)$reviews->fields['products_id'] . "'
 296                                         and language_id = '" . (int)$_SESSION['languages_id'] . "'");
 297  
 298          $reviews_average = $db->Execute("select (avg(reviews_rating) / 5 * 100) as average_rating
 299                                           from " . TABLE_REVIEWS . "
 300                                           where products_id = '" . (int)$reviews->fields['products_id'] . "'");
 301  
 302          $review_info = array_merge($reviews_text->fields, $reviews_average->fields, $products_name->fields);
 303          $rInfo_array = array_merge($reviews->fields, $review_info, $products_image->fields);
 304          $rInfo = new objectInfo($rInfo_array);
 305        }
 306  
 307        if (isset($rInfo) && is_object($rInfo) && ($reviews->fields['reviews_id'] == $rInfo->reviews_id) ) {
 308          echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id . '&action=preview') . '\'">' . "\n";
 309        } else {
 310          echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $reviews->fields['reviews_id']) . '\'">' . "\n";
 311        }
 312  ?>
 313                  <td class="dataTableContent"><?php echo '<a href="' . zen_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $reviews->fields['reviews_id'] . '&action=preview') . '">' . zen_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;' . zen_get_products_name($reviews->fields['products_id']); ?></td>
 314                  <td class="dataTableContent"><?php echo $reviews->fields['customers_name']; ?></td>
 315                  <td class="dataTableContent" align="right"><?php echo zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $reviews->fields['reviews_rating'] . '.gif'); ?></td>
 316                  <td class="dataTableContent" align="right"><?php echo zen_date_short($reviews->fields['date_added']); ?></td>
 317                  <td  class="dataTableContent" align="center">
 318  <?php
 319        if ($reviews->fields['status'] == '1') {
 320          echo '<a href="' . zen_href_link(FILENAME_REVIEWS, 'action=setflag&flag=0&id=' . $reviews->fields['reviews_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '</a>';
 321        } else {
 322          echo '<a href="' . zen_href_link(FILENAME_REVIEWS, 'action=setflag&flag=1&id=' . $reviews->fields['reviews_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . '</a>';
 323        }
 324  ?>
 325                  </td>
 326                  <td class="dataTableContent" align="right"><?php if ( (is_object($rInfo)) && ($reviews->fields['reviews_id'] == $rInfo->reviews_id) ) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . zen_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $reviews->fields['reviews_id']) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
 327                </tr>
 328  <?php
 329        $reviews->MoveNext();
 330      }
 331  ?>
 332                <tr>
 333                  <td colspan="6"><table border="0" width="100%" cellspacing="0" cellpadding="2">
 334                    <tr>
 335                      <td class="smallText" valign="top"><?php echo $reviews_split->display_count($reviews_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></td>
 336                      <td class="smallText" align="right"><?php echo $reviews_split->display_links($reviews_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?></td>
 337                    </tr>
 338                  </table></td>
 339                </tr>
 340              </table></td>
 341  <?php
 342      $heading = array();
 343      $contents = array();
 344  
 345      switch ($action) {
 346        case 'delete':
 347          $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_REVIEW . '</b>');
 348  
 349          $contents = array('form' => zen_draw_form('reviews', FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id . '&action=deleteconfirm'));
 350          $contents[] = array('text' => TEXT_INFO_DELETE_REVIEW_INTRO);
 351          $contents[] = array('text' => '<br><b>' . $rInfo->products_name . '</b>');
 352          $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . zen_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
 353          break;
 354        default:
 355        if (isset($rInfo) && is_object($rInfo)) {
 356          $heading[] = array('text' => '<b>' . $rInfo->products_name . '</b>');
 357  
 358          $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id . '&action=delete') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a> ' . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . zen_get_products_category_id($rInfo->products_id) . '&pID=' . $rInfo->products_id) . '">' . zen_image_button('button_details.gif', IMAGE_DETAILS) . '</a>');
 359          $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . zen_date_short($rInfo->date_added));
 360          if (zen_not_null($rInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . zen_date_short($rInfo->last_modified));
 361          $contents[] = array('text' => '<br>' . zen_info_image($rInfo->products_image, $rInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT));
 362          $contents[] = array('text' => '<br>' . TEXT_INFO_REVIEW_AUTHOR . ' ' . $rInfo->customers_name);
 363          $contents[] = array('text' => TEXT_INFO_REVIEW_RATING . ' ' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $rInfo->reviews_rating . '.gif'));
 364          $contents[] = array('text' => TEXT_INFO_REVIEW_READ . ' ' . $rInfo->reviews_read);
 365          $contents[] = array('text' => '<br>' . TEXT_INFO_REVIEW_SIZE . ' ' . $rInfo->reviews_text_size . ' bytes');
 366          $contents[] = array('text' => '<br>' . TEXT_INFO_PRODUCTS_AVERAGE_RATING . ' ' . number_format($rInfo->average_rating, 2) . '%');
 367        }
 368          break;
 369      }
 370  
 371      if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
 372        echo '            <td width="25%" valign="top">' . "\n";
 373  
 374        $box = new box;
 375        echo $box->infoBox($heading, $contents);
 376  
 377        echo '            </td>' . "\n";
 378      }
 379  ?>
 380            </tr>
 381          </table></td>
 382        </tr>
 383  <?php
 384    }
 385  ?>
 386      </table></td>
 387  <!-- body_text_eof //-->
 388    </tr>
 389  </table>
 390  <!-- body_eof //-->
 391  
 392  <!-- footer //-->
 393  <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
 394  <!-- footer_eof //-->
 395  <br>
 396  </body>
 397  </html>
 398  <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>


Généré le : Mon Nov 26 16:45:43 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics