Skip to content

Commit

Permalink
Change URL to current prod API endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
enriquegh committed Feb 21, 2019
1 parent b79e24a commit c08282e
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 12 deletions.
Expand Up @@ -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";

Expand Down
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Expand Up @@ -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";
Expand Down
10 changes: 5 additions & 5 deletions web/js/appointment.js
Expand Up @@ -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;
Expand All @@ -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) {
Expand Down Expand Up @@ -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;

Expand All @@ -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;
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion web/js/login.js
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion web/js/registration.js
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions web/js/schedule.js
Expand Up @@ -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 = "<table class='scheduleTable centered'><thead><tr><th data-field='date'>Date</th><th data-field='openTime'>Open Time</th><th data-field='closeTime'>Close Time</th></tr></thead><tbody>"

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c08282e

Please sign in to comment.