This commit is contained in:
arzynik 2012-12-04 14:12:01 -05:00
parent f91fcddcd3
commit a55f1f0d55
4 changed files with 28 additions and 1 deletions

View File

@ -35,6 +35,10 @@ class Controller_admin_orders_content extends Crunchbutton_Controller_Account {
if ($_REQUEST['restaurant']) {
$search['restaurant'] = $_REQUEST['restaurant'];
}
if ($_REQUEST['community']) {
$search['community'] = $_REQUEST['community'];
}
c::view()->orders = Order::find($search);

View File

@ -300,6 +300,10 @@ class Crunchbutton_Order extends Cana_Table {
$query .= ' and `order`.id_restaurant="'.$search['restaurant'].'" ';
}
if ($search['community']) {
$query .= ' and `order`.id_community="'.$search['community'].'" ';
}
if ($search['order']) {
$query .= ' and `order`.id_order="'.$search['order'].'" ';
}

View File

@ -53,6 +53,24 @@
</tr>
<tr>
<td class="label-sub"></td>
<td class="content-sub">
</td>
<td style="width: 100%"></td>
<td class="label-sub">COMMUNITY</td>
<td class="content-sub" colspan="2">
<select name="community">
<option value="" selected>[ All ]</option>
<? foreach (Community::q('select * from community order by name') as $community) : ?>
<option value="<?=$community->id_community?>"><?=$community->name?></option>
<? endforeach ; ?>
</select>
</td>
</tr>
<tr>
<td colspan="6">

View File

@ -721,7 +721,8 @@ App.orders = {
processor: $('select[name="processor"]').val(),
limit: $('input[name="limit"]').val(),
dates: $('input[name="date-range"]').val(),
restaurant: $('select[name="restaurant"]').val()
restaurant: $('select[name="restaurant"]').val(),
community: $('select[name="community"]').val()
};
},
load: function() {