mirror of
https://github.com/fspc/Yellow-Bike-Database.git
synced 2026-09-03 10:21:38 -04:00
This resolves the issue with contacts created on multiple terminals.
0) concurrency issue, one contact_id was edited by 2 or more terminals 1) Better than having a new contact_id created everytime the contact_add_edit page is opened which was the behavior of the original program. 2) Still need to clean-up the code a little, and do a little bit more testing, but appears to be working nicely. 3) Still uses GET for initial setup, a todo to change. 4) Glad the bug was found, and now is fixed.
This commit is contained in:
@@ -126,6 +126,10 @@ $(function(){
|
||||
if (success === "Success") {
|
||||
|
||||
var email_list = $("#email_list_toggle").val();
|
||||
|
||||
// send email_list val to $_POST
|
||||
$("#email_list").val(email_list);
|
||||
|
||||
var waiver = waiver_checkbox.prop("checked");
|
||||
if (!email_list) {
|
||||
email_list = 0;
|
||||
@@ -137,6 +141,9 @@ $(function(){
|
||||
} else if (waiver === false) {
|
||||
waiver = 0;
|
||||
}
|
||||
|
||||
$.post("json/contact.php", {most_recent_contact_id: 1});
|
||||
|
||||
// update receive_newsletter and waiver in the database
|
||||
$.post("json/contact.php", {contact_id: contact_id, email_list: email_list, waiver: waiver });
|
||||
|
||||
@@ -253,6 +260,10 @@ $(function(){
|
||||
|
||||
// beginning or stored state
|
||||
$.post("json/contact.php", {contact_id: contact_id, email_list_value: 1 }, function(data) {
|
||||
|
||||
if (data === "") {
|
||||
data = 1;
|
||||
}
|
||||
|
||||
$("#email_list_toggle").noUiSlider({
|
||||
orientation: "horizontal",
|
||||
|
||||
Reference in New Issue
Block a user