Forum Moderators: coopster
<?php
include_once ("dbase/mysql_connect.php");
require_once ("includes/functions/fn.data.php");
?>
<?php
// Get stuff for the forms
//function get_multi ($table, $id_name, $where, $del_field, $orderby, $asc_desc) {
//$groups = get_multi ("groups", "group_id", "group_id!= 1", "y", "groupname", "ASC");
$Rb_wines = get_multi ('Rb_wines', 'wine_id', "", "y", "wine_name", "ASC");
$Rb_wine_cat = get_multi ('Rb_wine_cat', 'category_id', "", "y" , "category", "ASC");
foreach ($Rb_wine_cat as $k => $v) {
$categories[$v['category_id']] = $v['category'];
//echo $v['category_id'] . "--" . $v['category'] . "<BR>";
}
?>
<form style="margin: 0px; method="post" action="test.php">
<p align="center" style="margin: 0px;"><b>Search talent:</b>
Keyword:
<input type="text" name="search_phrase" style="font-size: 8pt; font-family: Arial; font-weight: bold" size="25">
Category:
<select name="category_filter" style="font-family: Arial; font-size: 8pt; font-weight: normal " size="1">
<option value="all" selected>All</option>
<?php foreach ($Rb_wine_cat as $k => $v) {?>
<option value="<?=$v['category_id']?>">
<?=$v['category']?>
</option>
<?php }?>
</select>
<input type="submit" name="submit" value="GO" style="font-family: Arial; font-size: 8pt; font-weight: bold; border: 1px solid #800000">
</p>
</form>
<p align="center"><B>Click on the selected talent for detailed information:</B><BR />
(Showing talents from
<?
if (($category_filter == "all") ¦¦ ($category_filter == "")) {
echo ("all categories");
} else {
echo ("category '" . $categories[$category_filter] . "'");
}
if ($search_phrase!= "") {
echo (" filtered by keyword '" . $search_phrase . "'");
}
?>)
</p>
<table width="100%" border="0" align="center" cellpadding="2">
<tr>
<td class="adminNotificationTitle"><b>Talent</b></td>
<td class="adminNotificationTitle"><b>Category</b></td>
<td class="adminNotificationTitle"><b>City, CA</b> </td>
<td class="adminNotificationTitle"><b>Phone</b></td>
</tr>
<?php
foreach ($Rb_wines as $k => $v) {
if (((preg_match("/$search_phrase/i",$v['wine_name'])) ¦¦ (preg_match("/$search_phrase/i",$v['wine_desc'])) ¦¦ (preg_match("/$search_phrase/i",$v['wine_price'])) ¦¦ (preg_match("/$search_phrase/i",$v['buy_it_now']))) &&
($v['approval_status'] == "2") &&
($v['account_status'] == "1") &&
(($category_filter == "") ¦¦ ($category_filter == "all") ¦¦ ($category_filter == $v['category_id']))) {
?>
<tr>
<td class="adminNotificationDataB" align="left"><a href="talents_detail.php?wine_id=<?=$v['wine_id']?>"><?=$v['wine_name']?></a></td>
<td class="adminNotificationDataB" align="left"><?=$categories[$v['category_id']]?></td>
<td class="adminNotificationDataB" align="left"><?=$v['wine_desc']?></td>
<td class="adminNotificationDataB" align="left"><?=$v['buy_it_now']?></td>
</tr>
<?php
} // End if prereg
} // End foreach
?>
</table>