diff --git a/android/app/src/main/java/com/example/egonzalezh94/testproject/AppointmentFragment.java b/android/app/src/main/java/com/example/egonzalezh94/testproject/AppointmentFragment.java index 72fcfd8..822ccad 100644 --- a/android/app/src/main/java/com/example/egonzalezh94/testproject/AppointmentFragment.java +++ b/android/app/src/main/java/com/example/egonzalezh94/testproject/AppointmentFragment.java @@ -45,7 +45,7 @@ public class AppointmentFragment extends Fragment { /** * This URL needs to be configured to wherever the API and SQL are, local or remote. */ - static final String API_URL = "http://10.1.25.213/api.php/"; + static final String API_URL = "https://mars.enriquegh.com/api.php/"; //static final String API_URL = "http://[INSERT SERVER ADDRESS]/api.php/"; static final String APPOINTMENT_URL = "appointments"; diff --git a/android/app/src/main/java/com/example/egonzalezh94/testproject/LoginActivity.java b/android/app/src/main/java/com/example/egonzalezh94/testproject/LoginActivity.java index 10be3ed..59e99c6 100644 --- a/android/app/src/main/java/com/example/egonzalezh94/testproject/LoginActivity.java +++ b/android/app/src/main/java/com/example/egonzalezh94/testproject/LoginActivity.java @@ -22,6 +22,7 @@ import org.json.JSONTokener; import java.io.BufferedReader; +import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; @@ -31,7 +32,7 @@ public class LoginActivity extends AppCompatActivity { /** * This URL needs to be configured to wherever the API and SQL are, local or remote. */ - static final String API_URL = "http://10.1.25.213/api.php/"; + static final String API_URL = "https://mars.enriquegh.com/api.php/"; //static final String API_URL = "http://[INSERT SERVER ADDRESS]/api.php/"; static final String CLIENT_URL = "clients"; EditText email; @@ -61,6 +62,12 @@ protected void onCreate(Bundle savedInstanceState) { startService(serviceIntent); finish(); } + String base_url = ""; + try { + base_url = Util.getProperty("BASE_URL", getApplicationContext()); + } catch (IOException e) { + e.printStackTrace(); + } FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); diff --git a/android/app/src/main/java/com/example/egonzalezh94/testproject/MessagesFragment.java b/android/app/src/main/java/com/example/egonzalezh94/testproject/MessagesFragment.java index 2de3e38..f2caf21 100644 --- a/android/app/src/main/java/com/example/egonzalezh94/testproject/MessagesFragment.java +++ b/android/app/src/main/java/com/example/egonzalezh94/testproject/MessagesFragment.java @@ -56,7 +56,7 @@ public class MessagesFragment extends Fragment { /** * This URL needs to be configured to wherever the API and SQL are, local or remote. */ - static final String API_URL = "http://10.1.25.213/api.php/"; + static final String API_URL = "https://mars.enriquegh.com/api.php/"; //static final String API_URL = "http://[INSERT SERVER ADDRESS]/api.php/"; static final String STAFF_URL = "staff"; diff --git a/web/js/appointment.js b/web/js/appointment.js index 361b1d3..0ed3612 100644 --- a/web/js/appointment.js +++ b/web/js/appointment.js @@ -13,7 +13,7 @@ function getAppointment() { var filter = document.getElementById("dropdown").value; // Creates URL using startDate,endDate, and filter - var url = "../api.php/appointments?"; + var url = "http://mars.health.com/api.php/appointments?"; url += "filter[]=" + scheduleStartDate + "&"; url += "filter[]=" + scheduleEndDate + "&"; url += "filter[]=status,eq," + filter; @@ -37,7 +37,7 @@ function getAppointment() { // If there's a patient for an appointment slot, grab their name if (records[i][4] != undefined) { - var patientURL = "../api.php/clients?filter=client_id,eq," + records[i][4]; + var patientURL = "http://mars.enriquegh.com/api.php/clients?filter=client_id,eq," + records[i][4]; name; $.getJSON(patientURL, function(patientData) { @@ -65,7 +65,7 @@ function scheduleAppointment() { var firstName = document.getElementById("first_name").value; var lastName = document.getElementById("last_name").value; - var url = "../api.php/clients?" + var url = "http://mars.enriquegh.com/api.php/clients?" url += "filter[]=name,eq," + firstName + "&"; url += "filter[]=l_name,eq," + lastName; @@ -89,7 +89,7 @@ function scheduleAppointment() { var start = convertTime(startTime); var end = convertTime(endTime); - var timeUrl = "../api.php/appointments?" + var timeUrl = "http://mars.enriquegh.com/api.php/appointments?" timeUrl += "filter[]=date,eq," + appointmentDate + "&"; timeUrl += "filter[]=timeStart,ge," + start + "&"; timeUrl += "filter[]=timeEnd,le," + end; @@ -110,7 +110,7 @@ function scheduleAppointment() { console.log(appts); for(var t = 0; t < appts.length; t++) { - var apptURL = "../api.php/appointments/" + appts[t] + var apptURL = "http://mars.enriquegh.com/api.php/appointments/" + appts[t] $.ajax({ url: apptURL, diff --git a/web/js/login.js b/web/js/login.js index 8cef122..36db807 100644 --- a/web/js/login.js +++ b/web/js/login.js @@ -5,7 +5,7 @@ function validateLogin() { var user_name = document.getElementById("username").value; var password = document.getElementById("pwd").value; - var url = "../api.php/staff?" + var url = "http://mars.enriquegh.com/api.php/staff?" url += "filter[]=username,eq," + user_name + "&"; url += "filter[]=pwd,eq," + password; diff --git a/web/js/registration.js b/web/js/registration.js index a5ba678..bb59360 100644 --- a/web/js/registration.js +++ b/web/js/registration.js @@ -5,7 +5,7 @@ function registerUser() { var password = document.getElementById("password").value; var emailAddress = document.getElementById("email").value; - $.post("../api.php/clients", + $.post("http://mars.health.com/api.php/clients", { name: firstName, l_name: lastName, email: emailAddress, pwd: password, status: 1 }, function() { Materialize.toast('New user registered!', 4000); diff --git a/web/js/schedule.js b/web/js/schedule.js index cf6f557..50b3b93 100644 --- a/web/js/schedule.js +++ b/web/js/schedule.js @@ -2,7 +2,7 @@ function getSchedule() { $(".scheduleTable").remove(); - $.getJSON("../api.php/schedule", function(data) { + $.getJSON("http://mars.enriquegh.com/api.php/schedule", function(data) { console.log(data); var table = "" @@ -32,7 +32,7 @@ function setSchedule() { var open = convertTime(openTime); var close = convertTime(closeTime); - $.post("../api.php/schedule", + $.post("http://mars.enriquegh.com/api.php/schedule", { date: scheduleDate, timeOpen: open, timeClose: close }, function() { Materialize.toast('Schedule created!', 4000);
DateOpen TimeClose Time