mirror of
https://github.com/fspc/Yellow-Bike-Database.git
synced 2026-09-03 02:11:38 -04:00
Spiffs up contact_and_edit, adding error correction and required waiver.
1). Next step will be an opt-in/out to mailman. 2). Originally this program was using google lists, but there are too many steps for users involved.
This commit is contained in:
+110
-108
@@ -14,7 +14,8 @@ case 'new_error_message': //this is a sample error message. insert error case h
|
||||
$error_message = '';
|
||||
break;
|
||||
default:
|
||||
$error_message = 'Enter or Update Contact Information - </span><span class="yb_standard"> Yellow Bike uses this information soely to support the project and it is kept entirely private. When we apply for grants it helps us to know a little bit about our shop users. Thanks for supporting The Yellow Bike Project. </p> </span><span class="yb_heading3red">';
|
||||
$error_message = 'Enter or Update Contact Information - </span><span class="yb_standard">
|
||||
Thank-you for supporting Positive Spin. </p> </span><span class="yb_heading3red">';
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -45,40 +46,37 @@ if($_GET['contact_id'] == 'new_contact'){
|
||||
$contact_id_entry = -1;
|
||||
}
|
||||
|
||||
$editFormAction = $_SERVER['PHP_SELF'] . "?contact_id={$contact_id}&shop_id={$shop_id}";
|
||||
$editFormAction = "?contact_id={$contact_id}&shop_id={$shop_id}";
|
||||
|
||||
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
|
||||
$updateSQL = sprintf("UPDATE contacts SET first_name=%s, middle_initial=%s, last_name=%s, email=%s, DOB=%s, receive_newsletter=%s, phone=%s, address1=%s, address2=%s, city=%s, `state`=%s, zip=%s, pass=ENCODE(%s,'yblcatx') WHERE contact_id=%s",
|
||||
GetSQLValueString($_POST['first_name'], "text"),
|
||||
GetSQLValueString($_POST['middle_initial'], "text"),
|
||||
GetSQLValueString($_POST['last_name'], "text"),
|
||||
GetSQLValueString($_POST['email'], "text"),
|
||||
GetSQLValueString($_POST['DOB'], "date"),
|
||||
GetSQLValueString($_POST['list_yes_no'], "int"),
|
||||
GetSQLValueString($_POST['phone'], "text"),
|
||||
GetSQLValueString($_POST['address1'], "text"),
|
||||
GetSQLValueString($_POST['address2'], "text"),
|
||||
GetSQLValueString($_POST['city'], "text"),
|
||||
GetSQLValueString($_POST['state'], "text"),
|
||||
GetSQLValueString($_POST['zip'], "text"),
|
||||
GetSQLValueString($_POST['password'], "text"),
|
||||
GetSQLValueString($_POST['contact_id'], "int"));
|
||||
|
||||
mysql_select_db($database_YBDB, $YBDB);
|
||||
$Result1 = mysql_query($updateSQL, $YBDB) or die(mysql_error());
|
||||
$updateSQL = sprintf("UPDATE contacts SET first_name=%s, middle_initial=%s, last_name=%s, email=%s,
|
||||
DOB=%s, receive_newsletter=%s, phone=%s, address1=%s, address2=%s, city=%s,
|
||||
`state`=%s, zip=%s, pass=ENCODE(%s,'yblcatx') WHERE contact_id=%s",
|
||||
GetSQLValueString($_POST['first_name'], "text"),
|
||||
GetSQLValueString($_POST['middle_initial'], "text"),
|
||||
GetSQLValueString($_POST['last_name'], "text"),
|
||||
GetSQLValueString($_POST['email'], "text"),
|
||||
GetSQLValueString($_POST['DOB'], "date"),
|
||||
GetSQLValueString($_POST['list_yes_no'], "int"),
|
||||
GetSQLValueString($_POST['phone'], "text"),
|
||||
GetSQLValueString($_POST['address1'], "text"),
|
||||
GetSQLValueString($_POST['address2'], "text"),
|
||||
GetSQLValueString($_POST['city'], "text"),
|
||||
GetSQLValueString($_POST['state'], "text"),
|
||||
GetSQLValueString($_POST['zip'], "text"),
|
||||
GetSQLValueString($_POST['password'], "text"),
|
||||
GetSQLValueString($_POST['contact_id'], "int"));
|
||||
|
||||
mysql_select_db($database_YBDB, $YBDB);
|
||||
$Result1 = mysql_query($updateSQL, $YBDB) or die(mysql_error());
|
||||
|
||||
if ($_POST['contact_id_entry'] == 'new_contact'){
|
||||
|
||||
//navigate back to shop that it came from
|
||||
|
||||
//if there is an email address submitted pass this to google groups signup. Otherwise redirect to shop log.
|
||||
if ((strpos($_POST['email'], '@') > 0) && ($_POST['list_yes_no'] == 1)) {
|
||||
$email = $_POST['email'];
|
||||
$pagegoto = "contact_add_edit_confirmation_iframe.php" . "?shop_id={$shop_id}&new_user_id={$contact_id}&email=$email";
|
||||
} else {
|
||||
$pagegoto = PAGE_SHOP_LOG . "?shop_id={$shop_id}&new_user_id={$contact_id}";
|
||||
}
|
||||
|
||||
$pagegoto = PAGE_SHOP_LOG . "?shop_id={$shop_id}&new_user_id={$contact_id}";
|
||||
header(sprintf("Location: %s", $pagegoto));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,100 +94,104 @@ $totalRows_Recordset1 = mysql_num_rows($Recordset1);
|
||||
<td align="left"><span class="yb_heading3red"><?php echo $error_message; ?></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
|
||||
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
|
||||
<table width="500" border="1" cellpadding="1" cellspacing="0" bordercolor="#CCCCCC">
|
||||
<tr valign="baseline">
|
||||
<td width="200" align="right" nowrap>Contact_id:</td>
|
||||
<table border="0" cellpadding="1" cellspacing="0" bordercolor="#CCCCCC">
|
||||
<tr>
|
||||
<td><label>Contact_id:</label></td>
|
||||
<td><?php echo $row_Recordset1['contact_id']; ?></td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td><label>Name:</label></td>
|
||||
<td><input id="first_name" type="text" name="first_name" value="<?php echo $row_Recordset1['first_name']; ?>" size="32">
|
||||
<span id="first_name_error"></span>
|
||||
<input name="middle_initial" type="text" value="<?php echo $row_Recordset1['middle_initial']; ?>" size="1" maxlength="1">
|
||||
<input id="last_name" type="text" name="last_name" value="<?php echo $row_Recordset1['last_name']; ?>" size="32">
|
||||
<span id="last_name_error"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="baseline">
|
||||
<td nowrap align="right">First_name:</td>
|
||||
<td><input type="text" name="first_name" value="<?php echo $row_Recordset1['first_name']; ?>" size="32"></td>
|
||||
</tr>
|
||||
<tr valign="baseline">
|
||||
<td nowrap align="right">Middle_initial:</td>
|
||||
<td><input name="middle_initial" type="text" value="<?php echo $row_Recordset1['middle_initial']; ?>" size="1" maxlength="1"></td>
|
||||
</tr>
|
||||
<tr valign="baseline">
|
||||
<td nowrap align="right">Last_name:</td>
|
||||
<td><input type="text" name="last_name" value="<?php echo $row_Recordset1['last_name']; ?>" size="32"></td>
|
||||
</tr>
|
||||
<tr valign="baseline">
|
||||
<td nowrap align="right">Email:</td>
|
||||
<td><input type="text" name="email" value="<?php echo $row_Recordset1['email']; ?>" size="32"></td>
|
||||
</tr>
|
||||
<tr valign="baseline">
|
||||
<td nowrap align="right">Date of Birth: </td>
|
||||
<td><input type="text" name="DOB" value="<?php echo $row_Recordset1['DOB']; ?>" size="10" />
|
||||
(YYYY-MM-DD) </td>
|
||||
</tr>
|
||||
<tr valign="baseline">
|
||||
<td nowrap align="right">Phone:</td>
|
||||
<td><input type="text" name="phone" value="<?php echo $row_Recordset1['phone']; ?>" size="32"></td>
|
||||
</tr>
|
||||
<tr valign="baseline">
|
||||
<td nowrap align="right">Address1:</td>
|
||||
<tr>
|
||||
<td><label>Date of Birth:</label></td>
|
||||
<td><input id="birth_date" type="text" name="DOB" value="<?php echo $row_Recordset1['DOB']; ?>" size="10" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>Email:</label></td>
|
||||
<td><input id="email" type="text" name="email" value="<?php echo $row_Recordset1['email']; ?>" size="32">
|
||||
<span id="email_error"></span></td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td ><label>Phone:</label></td>
|
||||
<td><input id="phone" type="text" name="phone" value="<?php echo $row_Recordset1['phone']; ?>" size="32">
|
||||
<span id="phone_error"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>Address1:</label></td>
|
||||
<td><input type="text" name="address1" value="<?php echo $row_Recordset1['address1']; ?>" size="32"></td>
|
||||
</tr>
|
||||
<tr valign="baseline">
|
||||
<td nowrap align="right">Address2:</td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td><label>Address2:</label></td>
|
||||
<td><input type="text" name="address2" value="<?php echo $row_Recordset1['address2']; ?>" size="32"></td>
|
||||
</tr>
|
||||
<tr valign="baseline">
|
||||
<td nowrap align="right">City:</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>City:</label></td>
|
||||
<td><input type="text" name="city" value="<?php echo $row_Recordset1['city']; ?>" size="32"></td>
|
||||
</tr>
|
||||
<tr valign="baseline">
|
||||
<td nowrap align="right">State:</td>
|
||||
<td><input name="state" type="text" value="<?php echo $row_Recordset1['state']; ?>" size="2" maxlength="2"></td>
|
||||
</tr>
|
||||
<tr valign="baseline">
|
||||
<td nowrap align="right">ZIP:</td>
|
||||
<td><input type="text" name="zip" value="<?php echo $row_Recordset1['zip']; ?>" size="5"></td>
|
||||
</tr>
|
||||
<tr valign="baseline">
|
||||
<td nowrap align="right">New Password:</td>
|
||||
<td><input name="password" type="password" id="password" value="<?php echo $row_Recordset1['passdecode']; ?>" size="32">
|
||||
<br />
|
||||
Your password keeps others from viewing your personal information. </td>
|
||||
</tr>
|
||||
<tr valign="baseline">
|
||||
<td nowrap align="right"> </td>
|
||||
<td><input type="submit" value="Update Contact Info"></td>
|
||||
</tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>State:</label></td>
|
||||
<td><input id="state_abbreviation" name="state" type="text" value="<?php echo $row_Recordset1['state']; ?>" size="2" maxlength="2"></td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td><label>zip:</label></td>
|
||||
<td><input id="zip" type="text" name="zip" value="<?php echo $row_Recordset1['zip']; ?>" size="10"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>New Password:</label></td>
|
||||
<td>
|
||||
<input name="password" type="password" id="password" value="<?php echo $row_Recordset1['passdecode']; ?>" size="32">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>Waiver of Liability:</label></td>
|
||||
<td> <div id="waiver">
|
||||
<p>
|
||||
I, and my heirs, in consideration of my participation in the Positive Spin Community
|
||||
Bike Project's Open Workshop hereby release Positive Spin,
|
||||
its officers, employees and agents, and any other people officially connected with this
|
||||
organization, from any and all liability for damage to or loss of personal
|
||||
property, sickness, or injury from whatever source, legal entanglements, imprisonment,
|
||||
death, or loss of money, which might occur while participating in said event/activity/class.
|
||||
Specifically, I release Positive Spin from any liability or
|
||||
responsibility for my personal well-being, condition of tools and equipment provided
|
||||
and produced thereof, including, but not limited to, bicycles and modes of transportation
|
||||
produced by participants. The Positive Spin Community Bike Project is a working,
|
||||
mechanical environment and I am aware of the risks of participation. I hereby state
|
||||
that I am in sufficient physical condition to accept a rigorous level of physical
|
||||
activity and exertion, as is sometimes the case when working in a mechanical environment.
|
||||
I understand that participation in this program is strickly voluntary and I
|
||||
freely chose to participate. I understand Positive Spin does not provide medical coverage for me.
|
||||
I verify that I will be responsible for any medical costs I incur as a result of my participation.
|
||||
</p>
|
||||
</div><input id="waiver_checkbox" type="checkbox"> I agree <span id="waiver_error"></span>
|
||||
<input type="submit" id="waiver_button" value="Show Waiver" \>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><br /><input id="submit_contact" type="submit" value="Submit"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="list_yes_no" value="1"> <!--This overides the option not to be invited to the newsletter list.-->
|
||||
<input type="hidden" name="MM_insert" value="form1">
|
||||
<input type="hidden" name="contact_id" value="<?php echo $row_Recordset1['contact_id']; ?>">
|
||||
<input type="hidden" name="contact_id_entry" value="<?php echo $contact_id_entry; ?>">
|
||||
</form> </td>
|
||||
</form>
|
||||
</tr>
|
||||
</table>
|
||||
<p> </p>
|
||||
<div class="well">
|
||||
<span class="yb_heading3red">Waiver of Liability</span>
|
||||
<br />
|
||||
<br />
|
||||
<p>I, and my heirs, in consideration of my participation in the New Orleans Community
|
||||
Bike Project's Open Workshop hereby release the New Orleans Community Bike Project,
|
||||
its officers, employees and agents, and any other people officially connected with this
|
||||
organization, from any and all liability for damage to or loss of personal
|
||||
property, sickness, or injury from whatever source, legal entanglements, imprisonment,
|
||||
death, or loss of money, which might occur while participating in said event/activity/class.
|
||||
Specifically, I release The New Orleans Community Bike Project from any liability or
|
||||
responsibility for my personal well-being, condition of tools and equipment provided
|
||||
and produced thereof, including, but not limited to, bicycles and modes of transportation
|
||||
produced by participants. The New Orleans Community Bike Project is a working,
|
||||
mechanical environment and I am aware of the risks of participation. I hereby state
|
||||
that I am in sufficient physical condition to accept a rigorous level of physical
|
||||
activity and exertion, as is sometimes the case when working in a mechanical environment.
|
||||
I understand that participation in this program is strickly voluntary and I
|
||||
freely chose to participate. I understand that The New Orleans Community Bike Project
|
||||
does not provide medical coverage for me. I verify that I will be responsible
|
||||
for any medical costs I incur as a result of my participation.</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php include("include_footer.html"); ?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user