1, 'text' => TEXT_PENDING_APPROVAL); $status_list[] = array('id' => 2, 'text' => TEXT_APPROVED); if (zen_not_null($action)) { switch ($action) { case 'setflag': zen_set_reviews_status($_GET['id'], $_GET['flag']); zen_redirect(zen_href_link(FILENAME_REVIEWS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'rID=' . $_GET['id'], 'NONSSL')); break; case 'update': $reviews_id = zen_db_prepare_input($_GET['rID']); $reviews_rating = zen_db_prepare_input($_POST['reviews_rating']); $reviews_text = zen_db_prepare_input($_POST['reviews_text']); $db->Execute("update " . TABLE_REVIEWS . " set reviews_rating = '" . zen_db_input($reviews_rating) . "', last_modified = now() where reviews_id = '" . (int)$reviews_id . "'"); $db->Execute("update " . TABLE_REVIEWS_DESCRIPTION . " set reviews_text = '" . zen_db_input($reviews_text) . "' where reviews_id = '" . (int)$reviews_id . "'"); zen_redirect(zen_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $reviews_id)); break; case 'deleteconfirm': // demo active test if (zen_admin_demo()) { $_GET['action']= ''; $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution'); zen_redirect(zen_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'])); } $reviews_id = zen_db_prepare_input($_GET['rID']); $db->Execute("delete from " . TABLE_REVIEWS . " where reviews_id = '" . (int)$reviews_id . "'"); $db->Execute("delete from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int)$reviews_id . "'"); zen_redirect(zen_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'])); break; } } ?> > <?php echo TITLE; ?>
Execute("select r.reviews_id, r.products_id, r.customers_name, r.date_added, r.last_modified, r.reviews_read, rd.reviews_text, r.reviews_rating from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.reviews_id = '" . (int)$rID . "' and r.reviews_id = rd.reviews_id"); $products = $db->Execute("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$reviews->fields['products_id'] . "'"); $products_name = $db->Execute("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$reviews->fields['products_id'] . "' and language_id = '" . (int)$_SESSION['languages_id'] . "'"); $rInfo_array = array_merge($reviews->fields, $products->fields, $products_name->fields); $rInfo = new objectInfo($rInfo_array); ?> Execute("select r.reviews_id, r.products_id, r.customers_name, r.date_added, r.last_modified, r.reviews_read, rd.reviews_text, r.reviews_rating from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.reviews_id = '" . (int)$rID . "' and r.reviews_id = rd.reviews_id"); $products = $db->Execute("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$reviews->fields['products_id'] . "'"); $products_name = $db->Execute("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$reviews->fields['products_id'] . "' and language_id = '" . (int)$_SESSION['languages_id'] . "'"); $rInfo_array = array_merge($reviews->fields, $products->fields, $products_name->fields); $rInfo = new objectInfo($rInfo_array); } ?> reviews_id; } ?>
' . zen_image_button('button_reset.gif', IMAGE_RESET) . '  '; } echo HEADING_TITLE_SEARCH_DETAIL . ' ' . zen_draw_input_field('search') . zen_hide_session_id(); if (isset($_GET['search']) && zen_not_null($_GET['search'])) { $keywords = zen_db_input(zen_db_prepare_input($_GET['search'])); echo '
' . TEXT_INFO_SEARCH_DETAIL_FILTER . $keywords; } ?>
'', 'text' => TEXT_ALL_STATUS)), $status_list), $status_filter, 'onChange="this.form.submit();"'); echo zen_hide_session_id(); ?>
products_name; ?>
customers_name; ?>

date_added); ?>
products_image, $rInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"'); ?>


reviews_text)); ?>
  reviews_rating) . ' '; echo TEXT_GOOD; ?>
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) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?>
products_name; ?>
customers_name; ?>

date_added); ?>
products_image, $rInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"'); ?>


reviews_text, 15))); ?>
 reviews_rating . '.gif', sprintf(TEXT_OF_5_STARS, $rInfo->reviews_rating)); ?> [reviews_rating); ?>]
reviews_id . '&action=edit') . '">' . zen_image_button('button_back.gif', IMAGE_BACK) . ' ' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?>
' . zen_image_button('button_back.gif', IMAGE_BACK) . ''; ?>
'' . TEXT_INFO_HEADING_DELETE_REVIEW . ''); $contents = array('form' => zen_draw_form('reviews', FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_INFO_DELETE_REVIEW_INTRO); $contents[] = array('text' => '
' . $rInfo->products_name . ''); $contents[] = array('align' => 'center', 'text' => '
' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''); break; default: if (isset($rInfo) && is_object($rInfo)) { $heading[] = array('text' => '' . $rInfo->products_name . ''); $contents[] = array('align' => 'center', 'text' => '' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '' . zen_image_button('button_delete.gif', IMAGE_DELETE) . ' ' . ' ' . zen_image_button('button_details.gif', IMAGE_DETAILS) . ''); $contents[] = array('text' => '
' . TEXT_INFO_DATE_ADDED . ' ' . zen_date_short($rInfo->date_added)); if (zen_not_null($rInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . zen_date_short($rInfo->last_modified)); $contents[] = array('text' => '
' . zen_info_image($rInfo->products_image, $rInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)); $contents[] = array('text' => '
' . TEXT_INFO_REVIEW_AUTHOR . ' ' . $rInfo->customers_name); $contents[] = array('text' => TEXT_INFO_REVIEW_RATING . ' ' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $rInfo->reviews_rating . '.gif')); $contents[] = array('text' => TEXT_INFO_REVIEW_READ . ' ' . $rInfo->reviews_read); $contents[] = array('text' => '
' . TEXT_INFO_REVIEW_SIZE . ' ' . $rInfo->reviews_text_size . ' bytes'); $contents[] = array('text' => '
' . TEXT_INFO_PRODUCTS_AVERAGE_RATING . ' ' . number_format($rInfo->average_rating, 2) . '%'); } break; } if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) { echo ' ' . "\n"; } ?>
0) $search .= " and r.status=" . ((int)$status_filter-1) . " "; $order_by = " order by pd.products_name"; $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); // $reviews_query_raw = "select reviews_id, products_id, date_added, last_modified, reviews_rating, status from " . TABLE_REVIEWS . " order by date_added DESC"; $reviews_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $reviews_query_raw, $reviews_query_numrows); $reviews = $db->Execute($reviews_query_raw); while (!$reviews->EOF) { if ((!isset($_GET['rID']) || (isset($_GET['rID']) && ($_GET['rID'] == $reviews->fields['reviews_id']))) && !isset($rInfo)) { $reviews_text = $db->Execute("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 = '" . (int)$reviews->fields['reviews_id'] . "' and r.reviews_id = rd.reviews_id"); $products_image = $db->Execute("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$reviews->fields['products_id'] . "'"); $products_name = $db->Execute("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$reviews->fields['products_id'] . "' and language_id = '" . (int)$_SESSION['languages_id'] . "'"); $reviews_average = $db->Execute("select (avg(reviews_rating) / 5 * 100) as average_rating from " . TABLE_REVIEWS . " where products_id = '" . (int)$reviews->fields['products_id'] . "'"); $review_info = array_merge($reviews_text->fields, $reviews_average->fields, $products_name->fields); $rInfo_array = array_merge($reviews->fields, $review_info, $products_image->fields); $rInfo = new objectInfo($rInfo_array); } if (isset($rInfo) && is_object($rInfo) && ($reviews->fields['reviews_id'] == $rInfo->reviews_id) ) { echo ' ' . "\n"; } else { echo ' ' . "\n"; } ?> MoveNext(); } ?>
 
fields['reviews_id'] . '&action=preview') . '">' . zen_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . ' ' . zen_get_products_name($reviews->fields['products_id']); ?> fields['customers_name']; ?> fields['reviews_rating'] . '.gif'); ?> fields['date_added']); ?> fields['status'] == '1') { echo '' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . ''; } else { echo '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . ''; } ?> fields['reviews_id'] == $rInfo->reviews_id) ) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> 
display_count($reviews_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?> display_links($reviews_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?>
' . "\n"; $box = new box; echo $box->infoBox($heading, $contents); echo '