Browse Source

Closes #77. Currently search capability specific to report(s);

Could be integrated into transaction_log page search.
devel
Jonathan Rosenbaum 6 years ago
parent
commit
da1a063a0a
  1. 2
      stats/stats_shoptransactiontotals.php
  2. 11
      transaction_log.php

2
stats/stats_shoptransactiontotals.php

@ -65,7 +65,7 @@ $totalRows_Recordset1 = mysql_num_rows($Recordset1);
<?php } else { // end if EDIT RECORD ?> <?php } else { // end if EDIT RECORD ?>
<tr> <tr>
<td><?php echo $row_Recordset1['ShopDate']; ?></td> <td><?php echo $row_Recordset1['ShopDate']; ?></td>
<td><?php echo $row_Recordset1['ShopID']; ?></td> <td><?php echo '<a href="/transaction_log.php?shop_id_search=' . $row_Recordset1['ShopID'] . '&record_count=' . $row_Recordset1['CountOfTrans'] . '">' . $row_Recordset1['ShopID'] . '</a>'; ?></td>
<td valign="middle"><?php echo $row_Recordset1['Day']; ?></td> <td valign="middle"><?php echo $row_Recordset1['Day']; ?></td>
<td valign="middle"><?php echo $row_Recordset1['ShopType']; ?></td> <td valign="middle"><?php echo $row_Recordset1['ShopType']; ?></td>
<td class="yb_standardRIGHT"><?php currency_format($row_Recordset1['Total'],2);?></td> <td class="yb_standardRIGHT"><?php currency_format($row_Recordset1['Total'],2);?></td>

11
transaction_log.php

@ -101,6 +101,15 @@ if($_GET['search']==''){
$search_state = ''; $search_state = '';
} }
// currently used for links in reports, and not for transaction_log page search mechanism
if($_GET['shop_id_search']==''){
$shop_id_search = '';
} elseif(isset($_GET['shop_id_search'])) {
$shop_id_search = "AND shop_id = '" . $_GET['shop_id_search'] . "'";
} else {
$shop_id_search = '';
}
//record_count (SQL or state) //record_count (SQL or state)
if($_GET['record_count']>0){ if($_GET['record_count']>0){
@ -146,7 +155,7 @@ LEFT(IF(show_startdate, CONCAT(' [',
FROM transaction_log FROM transaction_log
LEFT JOIN contacts ON transaction_log.sold_to=contacts.contact_id 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 LEFT JOIN transaction_types ON transaction_log.transaction_type=transaction_types.transaction_type_id
WHERE 1=1 {$trans_date} {$shop_dayname} {$trans_type} {$contact_id} {$search} ORDER BY transaction_id DESC LIMIT 0, $record_count;"; WHERE 1=1 {$trans_date} {$shop_dayname} {$trans_type} {$contact_id} {$search} {$shop_id_search} ORDER BY transaction_id DESC LIMIT 0, $record_count;";
$Recordset1 = mysql_query($query_Recordset1, $YBDB) or die(mysql_error()); $Recordset1 = mysql_query($query_Recordset1, $YBDB) or die(mysql_error());
$totalRows_Recordset1 = mysql_num_rows($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1);

Loading…
Cancel
Save