1
0
mirror of https://github.com/fspc/Yellow-Bike-Database.git synced 2025-02-22 17:03:22 -05:00

Provides error correction for no current shop.

This commit is contained in:
Jonathan Rosenbaum 2015-01-07 07:59:33 +00:00
parent b5be74863d
commit 33b4d29417
3 changed files with 25 additions and 11 deletions

View File

@ -10,6 +10,22 @@ $(function() {
$("select[name='transaction_type']").attr("tabindex",1); $("select[name='transaction_type']").attr("tabindex",1);
$("select[name='transaction_type']").focus(); $("select[name='transaction_type']").focus();
$("input[value='Create Transaction']").attr("tabindex",2); $("input[value='Create Transaction']").attr("tabindex",2);
$("#trans_date").mask("0000-00-00", {placeholder: "yyyy-mm-dd" });
// Does a current shop exist?
$.post("json/transaction.php", {shop_exist: 1}, function(data) {
if (data == "no_shop") {
$("input[name='Submit43']").click(function(){
$("#current_shop").html("&nbsp<a style='color:red' href='shop_log.php'>Start New Shop</a>");
event.preventDefault();
});
$('[href*="trans_id="]').click(function(){
$("#current_shop").html("&nbsp<a style='color:red' href='shop_log.php'>Start New Shop</a>");
event.preventDefault();
});
}
} );
// paid or not? // paid or not?
$(":checked").parent("td").prev().children().hide(); $(":checked").parent("td").prev().children().hide();

View File

@ -1,9 +1,15 @@
<?php <?php
require_once('../Connections/database_functions.php');
require_once('../Connections/YBDB.php'); require_once('../Connections/YBDB.php');
mysql_select_db($database_YBDB, $YBDB); mysql_select_db($database_YBDB, $YBDB);
// Is there a current shop?
if(isset($_POST['shop_exist'])) {
if(current_shop_by_ip()>=1) echo "current_shop"; else echo "no_shop";
}
// update whether paid or not // update whether paid or not
if(isset($_POST['paid'])) { if(isset($_POST['paid'])) {
if ($_POST['paid'] == 1) { if ($_POST['paid'] == 1) {

View File

@ -89,14 +89,7 @@ $Recordset1 = mysql_query($query_Recordset1, $YBDB) or die(mysql_error());
$totalRows_Recordset1 = mysql_num_rows($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1);
//Action on form update //Action on form update
$editFormAction = "";
if (isset($_GET[record_count])) {
//$editFormAction = $_SERVER['PHP_SELF'];
$editFormAction = "";
} else {
//$editFormAction = $_SERVER['PHP_SELF'];
$editFormAction = "";
}
//$editFormAction = $_SERVER['PHP_SELF']; //$editFormAction = $_SERVER['PHP_SELF'];
@ -447,7 +440,7 @@ if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ChangeDate")) {
<form method="post" name="FormNew" action="<?php echo $editFormAction; ?>"> <form method="post" name="FormNew" action="<?php echo $editFormAction; ?>">
<tr bordercolor="#CCCCCC" bgcolor="#CCCC33"> <tr bordercolor="#CCCCCC" bgcolor="#CCCC33">
<td colspan="9"><p><strong>Start New Transaction:</strong><br />&nbsp;&nbsp;&nbsp;&nbsp;Select Type: <?php list_transaction_types('transaction_type',$default_transaction_type); ?> <td colspan="9"><p><strong>Start New Transaction:</strong><br />&nbsp;&nbsp;&nbsp;&nbsp;Select Type: <?php list_transaction_types('transaction_type',$default_transaction_type); ?>
<input type="submit" name="Submit43" value="Create Transaction" /> <input type="submit" name="Submit43" value="Create Transaction" /><span id="current_shop"></span>
</p> </td> </p> </td>
</tr> </tr>
<input type="hidden" name="MM_insert" value="FormNew"> <input type="hidden" name="MM_insert" value="FormNew">
@ -522,10 +515,9 @@ if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ChangeDate")) {
<td height="40" valign="bottom"><form id="form1" name="form1" method="post" action=""> <td height="40" valign="bottom"><form id="form1" name="form1" method="post" action="">
<p><br /> <p><br />
Show Show
<input name="record_count" type="text" value="<?php echo $number_of_transactions; ?>" size="3" <input name="record_count" type="text" value="<?php echo $number_of_transactions; ?>" size="3">
transactions on or before: transactions on or before:
<input name="trans_date" type="text" id="trans_date" value="<?php echo current_date(); ?>" size="10" maxlength="10" /> <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"> <select name="dayname">
<option value="alldays" selected="selected">All Days</option> <option value="alldays" selected="selected">All Days</option>
<option value="Monday">Monday</option> <option value="Monday">Monday</option>