* Provides contact search in transaction_log
* future: may improve calendar search with PickMeUp?
This commit is contained in:
Jonathan Rosenbaum
2018-05-13 00:03:01 +00:00
parent 46be9fa887
commit 305ebee833
3 changed files with 31 additions and 5 deletions
+19 -4
View File
@@ -78,6 +78,17 @@ if($_GET['trans_type']=='all_types'){
$trans_type_state = 'all_types';
}
if($_GET['contact_id_search']=='everyone'){
$contact_id = '';
$contact_id_state = 'everyone';
} elseif(isset($_GET['contact_id_search'])) {
$contact_id = "AND contact_id = '" . $_GET['contact_id_search'] . "'";
$contact_id_state = $_GET['contact_id_search'];
} else {
$contact_id = '';
$contact_id_state = 'everyone';
}
//record_count (SQL or state)
if($_GET['record_count']>0){
$record_count = $_GET['record_count'];
@@ -88,6 +99,7 @@ if($_GET['record_count']>0){
// create a string to remember state
$search_state_array = array(
"contact_id_search" => $contact_id_state,
"trans_date" => $trans_date_state,
"trans_type" => $trans_type_state,
"shop_dayname" => $shop_dayname_state,
@@ -120,7 +132,7 @@ LEFT(IF(show_startdate, CONCAT(' [',
FROM transaction_log
LEFT JOIN contacts ON transaction_log.sold_to=contacts.contact_id
LEFT JOIN transaction_types ON transaction_log.transaction_type=transaction_types.transaction_type_id
WHERE 1=1 {$trans_date} {$shop_dayname} {$trans_type} ORDER BY transaction_id DESC LIMIT 0, $record_count;";
WHERE 1=1 {$trans_date} {$shop_dayname} {$trans_type} {$contact_id} ORDER BY transaction_id DESC LIMIT 0, $record_count;";
$Recordset1 = mysql_query($query_Recordset1, $YBDB) or die(mysql_error());
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
@@ -318,9 +330,9 @@ if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ConfirmDelete") &&
header(sprintf("Location: %s", PAGE_SALE_LOG . "?trans_id={$delete_trans_id}&" . $search_state )); //$editFormAction
}
//Change Date isset($_POST["MM_update"]) =========================================================
//Change Date & Search isset($_POST["MM_update"]) =========================================================
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ChangeDate")) {
$editFormAction = "?trans_date={$_POST['trans_date']}&trans_type={$_POST['trans_type']}&shop_dayname={$_POST['dayname']}&record_count={$_POST['record_count']}";
$editFormAction = "?trans_date={$_POST['trans_date']}&trans_type={$_POST['trans_type']}&shop_dayname={$_POST['dayname']}&record_count={$_POST['record_count']}&contact_id_search={$_POST['contact_id_search']}";
header(sprintf("Location: %s",$editFormAction )); //$editFormAction
}
@@ -818,7 +830,10 @@ if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ChangeDate")) {
<option value="Sunday">Sunday</option>
</select>
transaction type <?php list_transaction_types_withheader('trans_type', 'all_types'); ?>
transaction type <?php list_transaction_types_withheader('trans_type', 'all_types'); ?> by
<?php list_contacts_select_contact(contact_id_search, $_GET['contact_id_search']);?>
<input type="submit" name="Submit" value="Submit" />
<input type="hidden" name="MM_insert" value="ChangeDate" />