|
ZenCart_Documentation
1.5.0
http://www.collinsharper.com
|
00001 <?php 00010 require('includes/application_top.php'); 00011 00012 $action = (isset($_GET['action']) ? $_GET['action'] : ''); 00013 $status_filter = (isset($_GET['status']) ? $_GET['status'] : ''); 00014 $status_list[] = array('id' => 1, 'text' => TEXT_PENDING_APPROVAL); 00015 $status_list[] = array('id' => 2, 'text' => TEXT_APPROVED); 00016 00017 if (zen_not_null($action)) { 00018 switch ($action) { 00019 case 'setflag': 00020 if (isset($_POST['flag']) && ($_POST['flag'] == 1 || $_POST['flag'] == 0)) 00021 { 00022 zen_set_reviews_status($_GET['rID'], $_POST['flag']); 00023 } 00024 zen_redirect(zen_href_link(FILENAME_REVIEWS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['status']) ? 'status=' . $_GET['status'] . '&' : '') . 'rID=' . $_GET['rID'], 'NONSSL')); 00025 break; 00026 case 'update': 00027 $reviews_id = zen_db_prepare_input($_GET['rID']); 00028 $reviews_rating = zen_db_prepare_input($_POST['reviews_rating']); 00029 $reviews_text = zen_db_prepare_input($_POST['reviews_text']); 00030 00031 $db->Execute("update " . TABLE_REVIEWS . " 00032 set reviews_rating = '" . zen_db_input($reviews_rating) . "', 00033 last_modified = now() where reviews_id = '" . (int)$reviews_id . "'"); 00034 00035 $db->Execute("update " . TABLE_REVIEWS_DESCRIPTION . " 00036 set reviews_text = '" . zen_db_input($reviews_text) . "' 00037 where reviews_id = '" . (int)$reviews_id . "'"); 00038 00039 zen_redirect(zen_href_link(FILENAME_REVIEWS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['status']) ? 'status=' . $_GET['status'] . '&' : '') . 'rID=' . $_GET['rID'])); 00040 break; 00041 case 'deleteconfirm': 00042 // demo active test 00043 if (zen_admin_demo()) { 00044 $_GET['action']= ''; 00045 $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution'); 00046 zen_redirect(zen_href_link(FILENAME_REVIEWS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['status']) ? 'status=' . $_GET['status'] : ''))); 00047 } 00048 $reviews_id = zen_db_prepare_input($_POST['rID']); 00049 00050 $db->Execute("delete from " . TABLE_REVIEWS . " 00051 where reviews_id = '" . (int)$reviews_id . "'"); 00052 00053 $db->Execute("delete from " . TABLE_REVIEWS_DESCRIPTION . " 00054 where reviews_id = '" . (int)$reviews_id . "'"); 00055 00056 00057 zen_redirect(zen_href_link(FILENAME_REVIEWS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['status']) ? 'status=' . $_GET['status'] : ''))); 00058 break; 00059 } 00060 } 00061 ?> 00062 <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> 00063 <html <?php echo HTML_PARAMS; ?>> 00064 <head> 00065 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> 00066 <title><?php echo TITLE; ?></title> 00067 <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> 00068 <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS"> 00069 <script language="javascript" src="includes/menu.js"></script> 00070 <script language="javascript" src="includes/general.js"></script> 00071 <script type="text/javascript"> 00072 <!-- 00073 function init() 00074 { 00075 cssjsmenu('navbar'); 00076 if (document.getElementById) 00077 { 00078 var kill = document.getElementById('hoverJS'); 00079 kill.disabled = true; 00080 } 00081 } 00082 // --> 00083 </script> 00084 </head> 00085 <body onLoad="init()"> 00086 <!-- header //--> 00087 <?php require(DIR_WS_INCLUDES . 'header.php'); ?> 00088 <!-- header_eof //--> 00089 00090 <!-- body //--> 00091 <table border="0" width="100%" cellspacing="2" cellpadding="2"> 00092 <tr> 00093 <!-- body_text //--> 00094 <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> 00095 <tr> 00096 <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> 00097 <tr><?php echo zen_draw_form('search', FILENAME_REVIEWS, '', 'get'); ?> 00098 <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> 00099 <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td> 00100 <td class="smallText" align="right"> 00101 <?php 00102 // show reset search 00103 if (isset($_GET['search']) && zen_not_null($_GET['search'])) { 00104 echo '<a href="' . zen_href_link(FILENAME_REVIEWS) . '">' . zen_image_button('button_reset.gif', IMAGE_RESET) . '</a> '; 00105 } 00106 echo HEADING_TITLE_SEARCH_DETAIL . ' ' . zen_draw_input_field('search') . zen_hide_session_id(); 00107 if (isset($_GET['search']) && zen_not_null($_GET['search'])) { 00108 $keywords = zen_db_input(zen_db_prepare_input($_GET['search'])); 00109 echo '<br/ >' . TEXT_INFO_SEARCH_DETAIL_FILTER . $keywords; 00110 } 00111 ?> 00112 </td> 00113 </form></tr> 00114 <tr><?php echo zen_draw_form('status', FILENAME_REVIEWS, '', 'get', '', true); ?> 00115 <td class="smallText" colspan="3" align="right"> 00116 <?php 00117 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();"'); 00118 echo zen_hide_session_id(); 00119 ?> 00120 </td> 00121 </form></tr> 00122 </table></td> 00123 </tr> 00124 <?php 00125 if ($action == 'edit') { 00126 $rID = zen_db_prepare_input($_GET['rID']); 00127 00128 $reviews = $db->Execute("select r.reviews_id, r.products_id, r.customers_name, r.date_added, 00129 r.last_modified, r.reviews_read, rd.reviews_text, r.reviews_rating 00130 from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd 00131 where r.reviews_id = '" . (int)$rID . "' and r.reviews_id = rd.reviews_id"); 00132 00133 $products = $db->Execute("select products_image 00134 from " . TABLE_PRODUCTS . " 00135 where products_id = '" . (int)$reviews->fields['products_id'] . "'"); 00136 00137 $products_name = $db->Execute("select products_name 00138 from " . TABLE_PRODUCTS_DESCRIPTION . " 00139 where products_id = '" . (int)$reviews->fields['products_id'] . "' 00140 and language_id = '" . (int)$_SESSION['languages_id'] . "'"); 00141 00142 $rInfo_array = array_merge($reviews->fields, $products->fields, $products_name->fields); 00143 $rInfo = new objectInfo($rInfo_array); 00144 ?> 00145 <tr><?php echo zen_draw_form('review', FILENAME_REVIEWS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['status']) ? 'status=' . $_GET['status'] . '&' : '') . 'rID=' . $_GET['rID'] . '&action=preview'); ?> 00146 <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> 00147 <tr> 00148 <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> 00149 <td class="main" align="right" valign="top"><?php echo zen_info_image($rInfo->products_image, $rInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); ?></td> 00150 </tr> 00151 </table></td> 00152 </tr> 00153 <tr> 00154 <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> 00155 <tr> 00156 <td class="main" valign="top"><b><?php echo ENTRY_REVIEW; ?></b><br><br><?php echo zen_draw_textarea_field('reviews_text', 'soft', '70', '15', htmlspecialchars(stripslashes($rInfo->reviews_text), ENT_COMPAT, CHARSET, TRUE)); ?></td> 00157 </tr> 00158 <tr> 00159 <td class="smallText" align="right"><?php echo ENTRY_REVIEW_TEXT; ?></td> 00160 </tr> 00161 </table></td> 00162 </tr> 00163 <tr> 00164 <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 00165 </tr> 00166 <tr> 00167 <td class="main"><b><?php echo ENTRY_RATING; ?></b> <?php echo TEXT_BAD; ?> <?php for ($i=1; $i<=5; $i++) echo zen_draw_radio_field('reviews_rating', $i, '', $rInfo->reviews_rating) . ' '; echo TEXT_GOOD; ?></td> 00168 </tr> 00169 <tr> 00170 <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 00171 </tr> 00172 <tr> 00173 <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, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['status']) ? 'status=' . $_GET['status'] . '&' : '') . 'rID=' . $_GET['rID']) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td> 00174 </form></tr> 00175 <?php 00176 } elseif ($action == 'preview') { 00177 if (zen_not_null($_POST)) { 00178 $rInfo = new objectInfo($_POST); 00179 } else { 00180 $rID = zen_db_prepare_input($_GET['rID']); 00181 00182 $reviews = $db->Execute("select r.reviews_id, r.products_id, r.customers_name, r.date_added, 00183 r.last_modified, r.reviews_read, rd.reviews_text, 00184 r.reviews_rating 00185 from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd 00186 where r.reviews_id = '" . (int)$rID . "' 00187 and r.reviews_id = rd.reviews_id"); 00188 00189 $products = $db->Execute("select products_image 00190 from " . TABLE_PRODUCTS . " 00191 where products_id = '" . (int)$reviews->fields['products_id'] . "'"); 00192 00193 $products_name = $db->Execute("select products_name 00194 from " . TABLE_PRODUCTS_DESCRIPTION . " 00195 where products_id = '" . (int)$reviews->fields['products_id'] . "' 00196 and language_id = '" . (int)$_SESSION['languages_id'] . "'"); 00197 00198 $rInfo_array = array_merge($reviews->fields, $products->fields, $products_name->fields); 00199 $rInfo = new objectInfo($rInfo_array); 00200 } 00201 ?> 00202 <tr><?php echo zen_draw_form('update', FILENAME_REVIEWS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['status']) ? 'status=' . $_GET['status'] . '&' : '') . 'rID=' . $_GET['rID'] . '&action=update', 'post', 'enctype="multipart/form-data"'); ?> 00203 <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> 00204 <tr> 00205 <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> 00206 <td class="main" align="right" valign="top"><?php echo zen_info_image($rInfo->products_image, $rInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); ?></td> 00207 </tr> 00208 </table> 00209 </tr> 00210 <tr> 00211 <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> 00212 <tr> 00213 <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> 00214 </tr> 00215 </table></td> 00216 </tr> 00217 <tr> 00218 <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 00219 </tr> 00220 <tr> 00221 <td class="main"><b><?php echo ENTRY_RATING; ?></b> <?php echo zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $rInfo->reviews_rating . '.gif', sprintf(TEXT_OF_5_STARS, $rInfo->reviews_rating)); ?> <small>[<?php echo sprintf(TEXT_OF_5_STARS, $rInfo->reviews_rating); ?>]</small></td> 00222 </tr> 00223 <tr> 00224 <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 00225 </tr> 00226 <?php 00227 if (zen_not_null($_POST)) { 00228 /* Re-Post all POST'ed variables */ 00229 reset($_POST); 00230 while(list($key, $value) = each($_POST)) echo zen_draw_hidden_field($key, $value); 00231 ?> 00232 <tr> 00233 <td align="right" class="smallText"><?php echo '<a href="' . zen_href_link(FILENAME_REVIEWS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['status']) ? 'status=' . $_GET['status'] . '&' : '') . '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, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['status']) ? 'status=' . $_GET['status'] . '&' : '') . 'rID=' . $rInfo->reviews_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td> 00234 </form></tr> 00235 <?php 00236 } else { 00237 if (isset($_GET['origin'])) { 00238 $back_url = $_GET['origin']; 00239 $back_url_params = ''; 00240 } else { 00241 $back_url = FILENAME_REVIEWS; 00242 $back_url_params = (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['status']) ? 'status=' . $_GET['status'] . '&' : '') . 'rID=' . $rInfo->reviews_id; 00243 } 00244 ?> 00245 <tr> 00246 <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> 00247 </tr> 00248 <?php 00249 } 00250 } else { 00251 ?> 00252 <tr> 00253 <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> 00254 <tr> 00255 <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> 00256 <tr class="dataTableHeadingRow"> 00257 <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td> 00258 <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMER_NAME; ?></td> 00259 <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_RATING; ?></td> 00260 <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_DATE_ADDED; ?></td> 00261 <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td> 00262 <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td> 00263 </tr> 00264 <?php 00265 00266 // create search filter 00267 $search = ''; 00268 if (isset($_GET['search']) && zen_not_null($_GET['search'])) { 00269 $keywords = zen_db_input(zen_db_prepare_input($_GET['search'])); 00270 $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 . "%'"; 00271 } 00272 00273 if ($status_filter !='' && $status_filter >0) $search .= " and r.status=" . ((int)$status_filter-1) . " "; 00274 00275 $order_by = " order by pd.products_name"; 00276 00277 $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); 00278 00279 // reset page when page is unknown 00280 if (($_GET['page'] == '' or $_GET['page'] == '1') and $_GET['rID'] != '') { 00281 $check_page = $db->Execute($reviews_query_raw); 00282 $check_count=1; 00283 if ($check_page->RecordCount() > MAX_DISPLAY_SEARCH_RESULTS) { 00284 while (!$check_page->EOF) { 00285 if ($check_page->fields['reviews_id'] == $_GET['rID']) { 00286 break; 00287 } 00288 $check_count++; 00289 $check_page->MoveNext(); 00290 } 00291 $_GET['page'] = round((($check_count/MAX_DISPLAY_SEARCH_RESULTS)+(fmod_round($check_count,MAX_DISPLAY_SEARCH_RESULTS) !=0 ? .5 : 0)),0); 00292 } else { 00293 $_GET['page'] = 1; 00294 } 00295 } 00296 00297 // $reviews_query_raw = "select reviews_id, products_id, date_added, last_modified, reviews_rating, status from " . TABLE_REVIEWS . " order by date_added DESC"; 00298 $reviews_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $reviews_query_raw, $reviews_query_numrows); 00299 $reviews = $db->Execute($reviews_query_raw); 00300 while (!$reviews->EOF) { 00301 if ((!isset($_GET['rID']) || (isset($_GET['rID']) && ($_GET['rID'] == $reviews->fields['reviews_id']))) && !isset($rInfo)) { 00302 $reviews_text = $db->Execute("select r.reviews_read, r.customers_name, 00303 length(rd.reviews_text) as reviews_text_size 00304 from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd 00305 where r.reviews_id = '" . (int)$reviews->fields['reviews_id'] . "' 00306 and r.reviews_id = rd.reviews_id"); 00307 00308 $products_image = $db->Execute("select products_image 00309 from " . TABLE_PRODUCTS . " 00310 where products_id = '" . (int)$reviews->fields['products_id'] . "'"); 00311 00312 00313 $products_name = $db->Execute("select products_name 00314 from " . TABLE_PRODUCTS_DESCRIPTION . " 00315 where products_id = '" . (int)$reviews->fields['products_id'] . "' 00316 and language_id = '" . (int)$_SESSION['languages_id'] . "'"); 00317 00318 $reviews_average = $db->Execute("select (avg(reviews_rating) / 5 * 100) as average_rating 00319 from " . TABLE_REVIEWS . " 00320 where products_id = '" . (int)$reviews->fields['products_id'] . "'"); 00321 00322 $review_info = array_merge($reviews_text->fields, $reviews_average->fields, $products_name->fields); 00323 $rInfo_array = array_merge($reviews->fields, $review_info, $products_image->fields); 00324 $rInfo = new objectInfo($rInfo_array); 00325 } 00326 00327 if (isset($rInfo) && is_object($rInfo) && ($reviews->fields['reviews_id'] == $rInfo->reviews_id) ) { 00328 echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_REVIEWS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['status']) ? 'status=' . $_GET['status'] . '&' : '') . 'rID=' . $rInfo->reviews_id . '&action=preview') . '\'">' . "\n"; 00329 } else { 00330 echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_REVIEWS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['status']) ? 'status=' . $_GET['status'] . '&' : '') . 'rID=' . $reviews->fields['reviews_id']) . '\'">' . "\n"; 00331 } 00332 ?> 00333 <td class="dataTableContent"><?php echo '<a href="' . zen_href_link(FILENAME_REVIEWS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['status']) ? 'status=' . $_GET['status'] . '&' : '') . 'rID=' . $reviews->fields['reviews_id'] . '&action=preview') . '">' . zen_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . zen_get_products_name($reviews->fields['products_id']); ?></td> 00334 <td class="dataTableContent"><?php echo $reviews->fields['customers_name']; ?></td> 00335 <td class="dataTableContent" align="right"><?php echo zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $reviews->fields['reviews_rating'] . '.gif'); ?></td> 00336 <td class="dataTableContent" align="right"><?php echo zen_date_short($reviews->fields['date_added']); ?></td> 00337 <td class="dataTableContent" align="center"> 00338 <?php 00339 if ($reviews->fields['status'] == '1') { 00340 echo zen_draw_form('setflag_products', FILENAME_REVIEWS, 'action=setflag&rID=' . $reviews->fields['reviews_id'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''));?> 00341 <input type="image" src="<?php echo DIR_WS_IMAGES ?>icon_green_on.gif" title="<?php echo IMAGE_ICON_STATUS_ON; ?>" /> 00342 <input type="hidden" name="flag" value="0" /> 00343 </form> 00344 <?php 00345 } else { 00346 echo zen_draw_form('setflag_products', FILENAME_REVIEWS, 'action=setflag&rID=' . $reviews->fields['reviews_id'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''));?> 00347 <input type="image" src="<?php echo DIR_WS_IMAGES ?>icon_red_on.gif" title="<?php echo IMAGE_ICON_STATUS_OFF; ?>" /> 00348 <input type="hidden" name="flag" value="1" /> 00349 </form> 00350 <?php 00351 } 00352 ?> 00353 </td> 00354 <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, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['status']) ? 'status=' . $_GET['status'] . '&' : '') . 'rID=' . $reviews->fields['reviews_id']) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td> 00355 </tr> 00356 <?php 00357 $reviews->MoveNext(); 00358 } 00359 ?> 00360 <tr> 00361 <td colspan="6"><table border="0" width="100%" cellspacing="0" cellpadding="2"> 00362 <tr> 00363 <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> 00364 <td class="smallText" align="right"><?php echo $reviews_split->display_links($reviews_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], zen_get_all_get_params( array( 'page', 'rID' ))); ?></td> 00365 </tr> 00366 </table></td> 00367 </tr> 00368 </table></td> 00369 <?php 00370 $heading = array(); 00371 $contents = array(); 00372 00373 switch ($action) { 00374 case 'delete': 00375 $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_REVIEW . '</b>'); 00376 00377 $contents = array('form' => zen_draw_form('reviews', FILENAME_REVIEWS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['status']) ? 'status=' . $_GET['status'] . '&' : '') . 'action=deleteconfirm') . zen_draw_hidden_field('rID', $rInfo->reviews_id)); 00378 $contents[] = array('text' => TEXT_INFO_DELETE_REVIEW_INTRO); 00379 $contents[] = array('text' => '<br><b>' . $rInfo->products_name . '</b>'); 00380 $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . zen_href_link(FILENAME_REVIEWS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['status']) ? 'status=' . $_GET['status'] . '&' : '') . 'rID=' . $rInfo->reviews_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); 00381 break; 00382 default: 00383 if (isset($rInfo) && is_object($rInfo)) { 00384 $heading[] = array('text' => '<b>' . $rInfo->products_name . '</b>'); 00385 00386 $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_REVIEWS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['status']) ? 'status=' . $_GET['status'] . '&' : '') . 'rID=' . $rInfo->reviews_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_REVIEWS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['status']) ? 'status=' . $_GET['status'] . '&' : '') . '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>'); 00387 $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . zen_date_short($rInfo->date_added)); 00388 if (zen_not_null($rInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . zen_date_short($rInfo->last_modified)); 00389 $contents[] = array('text' => '<br>' . zen_info_image($rInfo->products_image, $rInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)); 00390 $contents[] = array('text' => '<br>' . TEXT_INFO_REVIEW_AUTHOR . ' ' . $rInfo->customers_name); 00391 $contents[] = array('text' => TEXT_INFO_REVIEW_RATING . ' ' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $rInfo->reviews_rating . '.gif')); 00392 $contents[] = array('text' => TEXT_INFO_REVIEW_READ . ' ' . $rInfo->reviews_read); 00393 $contents[] = array('text' => '<br>' . TEXT_INFO_REVIEW_SIZE . ' ' . $rInfo->reviews_text_size . ' bytes'); 00394 $contents[] = array('text' => '<br>' . TEXT_INFO_PRODUCTS_AVERAGE_RATING . ' ' . number_format($rInfo->average_rating, 2) . '%'); 00395 } 00396 break; 00397 } 00398 00399 if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) { 00400 echo ' <td width="25%" valign="top">' . "\n"; 00401 00402 $box = new box; 00403 echo $box->infoBox($heading, $contents); 00404 00405 echo ' </td>' . "\n"; 00406 } 00407 ?> 00408 </tr> 00409 </table></td> 00410 </tr> 00411 <?php 00412 } 00413 ?> 00414 </table></td> 00415 <!-- body_text_eof //--> 00416 </tr> 00417 </table> 00418 <!-- body_eof //--> 00419 00420 <!-- footer //--> 00421 <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> 00422 <!-- footer_eof //--> 00423 <br> 00424 </body> 00425 </html> 00426 <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>