Commit 449860d3 authored by Bon Lemuel Dela Cruz's avatar Bon Lemuel Dela Cruz

Offer Ride Updates, API Fixes, End Trip Fixes

parent a06529f8
angular.module('blazer.authenticationcontrollers', [])
.controller('AuthCtrl', function($scope, $state, postBlazer, $cordovaDialogs) {
.controller('AuthCtrl', function($scope, $state, postBlazer, $timeout, $ionicPopup, $cordovaDialogs, $cordovaInAppBrowser) {
$scope.user = {
username: "blazetestaccount",
......@@ -20,8 +20,48 @@ angular.module('blazer.authenticationcontrollers', [])
});
}
$scope.showForgotpassword = function(){
/* FORGOT PASSWORD POPUP */
$scope.showForgotPassword = function(){
$scope.data = {};
// An elaborate, custom popup
var myPopup = $ionicPopup.show({
template: '<input type="email" ng-model="data.email">',
title: 'Reset Password',
subTitle: 'Please enter your email address',
scope: $scope,
buttons: [
{
text: 'Reset',
type: 'button-dark button-outline',
onTap: function() {
console.log('Destination to School');
$scope.postforgotpassword($scope.data.email);
}
},
{
text: 'Cancel',
type: 'button-dark button-outline',
onTap: function() {
console.log('Cancel Reset');
}
}
]
});
}
/* FORGOT PASSWORD */
$scope.postforgotpassword = function(email){
console.debug("[ RESET EMAIL ]", email);
var emailaddress = email;
postBlazer.ForgotPassword(emailaddress)
.success(function(response) {
console.log("FORGOT PASSWORD SUCCESS", response);
})
.error(function(response) {
console.error("FORGOT PASSWORD ERROR", response);
});
}
$scope.showAbout = function(){
......
......@@ -12,7 +12,7 @@
<input type="password" ng-model="user.password" placeholder="Password" required>
</label>
</div>
<a class="form-login-link">Forgot Password?</a>
<a class="form-login-link" ng-click="showForgotPassword();">Forgot Password?</a>
<button class="button button-block button-outline button-light login-button" ng-click="loginUser()" ng-disabled="loginForm.$invalid">LOGIN</button>
<!-- <button class="button button-block button-small button-outline button-light login-button" ng-click="showDialog()">SIGN UP</button> -->
</form>
......
......@@ -68,7 +68,7 @@ angular.module('blazer.mapcontrollers', [])
// REMOVE MARKERS
map.removeLayer(markers);
$scope.drawTripMarkers(lat, lon); // DRAW TRIP MARKER ]
$scope.drawMarkers(lat, lon, 'On Trip'); // DRAW TRIP MARKER ]
}
/* EVENT LISTENERS */
......@@ -247,6 +247,7 @@ angular.module('blazer.mapcontrollers', [])
$scope.selectedBarangayData = $scope.data.selectedBarangay +" "+ $scope.data.selectedBarangayTime;
$scope.currentBarangay = $scope.data.selectedBarangay;
$scope.currentBarangayTime = $scope.data.selectedBarangayTime;
$scope.data = {};
}
},
{
......@@ -275,6 +276,10 @@ angular.module('blazer.mapcontrollers', [])
console.log('[ BARANGAY DETAILS ]', JSON.stringify($scope.BarangayData));
$scope.openChart($scope.BarangayData); // LOAD CHART MODAL
$scope.drawMarkers($scope.BarangayData.lat, $scope.BarangayData.lng, $scope.currentBarangay);
// RESET VALUES
$scope.selectedBarangayData = '';
$scope.currentBarangay = '';
$scope.currentBarangayTime = '';
})
.error(function(response) {
console.error("BARANGAY ERROR", response);
......@@ -331,9 +336,10 @@ angular.module('blazer.mapcontrollers', [])
map.removeLayer(geojsonLayer);
$scope.tripStatus = true;
var newDate = new Date();
var newDate = new Date();
startTime = newDate.getTime();
localStorage.setItem("starttime", startTime);
console.log("START TRIP TIME", startTime);
$scope.getUserLocation();
......@@ -344,8 +350,10 @@ angular.module('blazer.mapcontrollers', [])
$scope.tripEnd = function(){
$scope.tripStatus = false;
tripStatusRef = false;
var newDate = new Date();
endTime = newDate.getTime();
var endTime = newDate.getTime();
localStorage.setItem("endtime", endTime);
console.log("END TRIP TIME", endTime);
// TRIGGER CLEAR FUNCTION OF REMOVE LINE -- NEEDS TO DEBUG
......
......@@ -14,7 +14,7 @@
<h3 class="text-light"><center>BLAZE</center></h3>
<ion-item nav-clear menu-close href="#/app/profile" class="item-avatar"><ionic-letter-avatar data="{{ user.username }}" shape="round" charcount="2"></ionic-letter-avatar><h4 class="text-light">{{ user.username }}</h4><h5 class="text-light">Blazer User</h5></ion-item>
<ion-item nav-clear menu-close href="#/app/map" class="item-icon item-icon-left"><i class="icon ion-android-compass"></i>Blaze Network</ion-item>
<ion-item nav-clear menu-close href="#/app/offerride" class="item-icon item-icon-left"><i class="icon ion-android-car"></i>Offer a Ride</ion-item>
<!-- <ion-item nav-clear menu-close href="#/app/offerride" class="item-icon item-icon-left"><i class="icon ion-android-car"></i>Offer a Ride</ion-item> -->
<ion-item nav-clear menu-close href="#/app/sharedride" class="item-icon item-icon-left"><i class="icon ion-android-contacts"></i>Shared Ride</ion-item>
<ion-item nav-clear menu-close href="#/app/status" class="item-icon item-icon-left"><i class="icon ion-android-wifi"></i>My Travel Stats</ion-item>
<ion-item nav-clear menu-close href="#/app/about" class="item-icon item-icon-left"><i class="icon ion-android-bulb"></i>About</ion-item>
......
angular.module('blazer.offerridecontrollers', [])
.controller('OfferRideCtrl', function($scope, getBlazer, postBlazer, LocationService, $cordovaGeolocation) {
.controller('OfferRideCtrl', function($scope, $ionicHistory, getBlazer, postBlazer, LocationService, $cordovaGeolocation) {
/* MAP DEFAULTS */
var destinationMap = L.map('mapdestination');
......@@ -97,9 +97,11 @@ angular.module('blazer.offerridecontrollers', [])
console.log("OFFER RIDE SUCCESS", response);
data = {};
$scope.offer ={};
$ionicHistory.goBack(-1);
})
.error(function(response) {
console.error("OFFER RIDE ERROR", response);
$ionicHistory.goBack(-1);
});
}
......
<ion-view view-title="Take a Shared Ride" ng-init="getSharedRideData();">
<ion-header-bar>
<h1 class="title">Take a Shared Ride</h1>
</ion-header-bar>
<ion-view view-title="Shared Ride" ng-init="getSharedRideData();">
<ion-nav-buttons side="right">
<button class="button button-outline button-icon button-light" ui-sref='app.offerride'>
Offer
</button>
</ion-nav-buttons>
<ion-content>
<ion-tabs class="tabs-clear tabs-icon-top">
<ion-tab title="Available" class="text-light darkblue" badge="availableRide.length" badge-style="badge-assertive" icon-on="light ion-android-car"
icon-off="light ion-android-car">
<ion-content class="background-feed">
......
......@@ -13,7 +13,7 @@
<p class="text-dark">You've just finished a trip. Please take this short survey.</p>
</div>
<div class="item item-light item-text-wrap">
<!-- <div class="item item-light item-text-wrap">
<p class="text-dark">This trip is made as part of tour:</p>
</div>
<label class="item item-input item-select item-text-wrap item-stable">
......@@ -25,12 +25,12 @@
<option value="trip1">Going Home</option>
<option value="trip2">Going to School</option>
</select>
</label>
</label> -->
<div class="item item-light item-text-wrap" ng-if="endtrip.destination">
<div class="item item-light item-text-wrap">
<p class="text-dark">What was the main mode of transport used?</p>
</div>
<label class="item item-input item-select item-text-wrap item-stable" ng-if="endtrip.destination">
<label class="item item-input item-select item-text-wrap item-stable">
&nbsp
<div class="input-label">
</div>
......@@ -50,11 +50,11 @@
</select>
</label>
<div class="item item-light item-text-wrap" ng-if="endtrip.mode && endtrip.mode">
<div class="item item-light item-text-wrap" ng-if="endtrip.mode">
<p class="text-dark">You made this trip by
<u><b> {{endtrip.mode}} </b></u>. Overall, how would you evaluate this experience?</p>
</div>
<label class="item item-input item-select item-text-wrap item-stable" ng-if="endtrip.mode && endtrip.mode">
<label class="item item-input item-select item-text-wrap item-stable" ng-if="endtrip.mode">
&nbsp
<div class="input-label">
</div>
......
......@@ -10,9 +10,7 @@ angular.module('blazer.surveycontrollers', [])
$scope.modalWeeklyTrip.hide();
};
$scope.endtrip = {
destination: localStorage.getItem("currentTrip")
};
$scope.endtrip = {};
$scope.postEndTripSurvey = function(){
var tripID = localStorage.getItem("tripid");
var username = localStorage.getItem("username");
......@@ -20,6 +18,7 @@ angular.module('blazer.surveycontrollers', [])
var endTime = localStorage.getItem("endtime");
var newDate = new Date();
var timeStamp = newDate.getTime();
var currentTrip = localStorage.getItem("currentTrip");
var postdata = {
"trip_id" : tripID,
......@@ -29,7 +28,7 @@ angular.module('blazer.surveycontrollers', [])
"mode": $scope.endtrip.mode,
"exp": $scope.endtrip.overallxp,
"emotion": $scope.endtrip.emotion,
"type": $scope.endtrip.destination
"type": currentTrip
}
console.log("[ POST END TRIP SURVEY ]");
postBlazer.EndTripSurvey(postdata)
......
......@@ -230,6 +230,7 @@ color: #fff;
margin-right: 10%;
margin-left: 25%;
margin-bottom: 5%;
margin-top: 5%;
font-size: 12px !important;
}
......
......@@ -25,7 +25,7 @@
<script src="lib/chart/angular-chart.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="lib/ng-cordova.min.js"></script>
<script src="lib/ngCordova/ng-cordova.min.js"></script>
<script src="cordova.js"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=places&sensor=false"></script>
......@@ -57,7 +57,7 @@
</head>
<body ng-app="blazer">
<body ng-app="blazer" class="platform-android platform-cordova platform-webview">
<ion-nav-view></ion-nav-view>
</body>
</html>
......@@ -38,6 +38,8 @@ angular.module('blazer', [
.config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider) {
$ionicConfigProvider.tabs.position('bottom'); // other values: top
$ionicConfigProvider.tabs.style('standard');
$ionicConfigProvider.spinner.icon('lines');
$stateProvider
/* MENU */
......
......@@ -199,7 +199,7 @@ angular.module('blazer.apiservices', [])
}).error(function(responseData) {
console.error("[ ERROR ]", JSON.stringify(responseData));
deferred.reject('Error');
$ionicLoading.show({ template: "Unexpected Error!", duration: 500});
$ionicLoading.show({ template: "Check your connection!", duration: 500});
});
promise.success = function(fn) {
......@@ -292,7 +292,7 @@ angular.module('blazer.apiservices', [])
console.error("[ ERROR ]", JSON.stringify(responseData));
deferred.reject('Error');
$ionicLoading.show({ template: "Sending Error!", duration: 1000});
$ionicLoading.show({ template: "Try Again!", duration: 1000});
});
promise.success = function(fn) {
......@@ -328,12 +328,12 @@ angular.module('blazer.apiservices', [])
console.log("[ SUCCESS ]", JSON.stringify(responseData));
deferred.resolve('Success');
$ionicLoading.show({ template: "Success!", duration: 1000});
$ionicLoading.show({ template: "Submitted!", duration: 1000});
}).error(function(responseData) {
console.error("[ ERROR ]", JSON.stringify(responseData));
deferred.reject('Error');
$ionicLoading.show({ template: "Sending Error!", duration: 1000});
$ionicLoading.show({ template: "Try Again!", duration: 1000});
});
promise.success = function(fn) {
......@@ -357,7 +357,7 @@ angular.module('blazer.apiservices', [])
$ionicLoading.show({ template: '<ion-spinner icon="crescent"></ion-spinner>', duration: 30000});
var sharedRideData = {
"ride_id": data.ride_id,
"username": data.username
"user": data.username
};
$http({method: 'POST', url: blazerAPI + '/take_shared_ride_post.php',
data: $.param(sharedRideData),
......@@ -506,7 +506,44 @@ angular.module('blazer.apiservices', [])
return promise;
}
return promise;
}
},
ForgotPassword: function(data) {
console.log("****** ON ENTER FORGOT PASSWORD SERVICE ******");
var deferred = $q.defer();
var promise = deferred.promise;
console.log("[ EMAIL DATA ] -> ", JSON.stringify(data));
$ionicLoading.show({ template: '<ion-spinner icon="crescent"></ion-spinner>', duration: 30000});
var emailData = {
"email_address": data.email_address,
};
$http({method: 'POST', url: 'http://blaze.eacomm.com/send_password.php',
data: $.param(emailData),
headers : {'Content-Type': 'application/x-www-form-urlencoded'}
}).success(function(responseData) {
console.log("[ SUCCESS ]", JSON.stringify(responseData));
deferred.resolve('Success');
$ionicLoading.show({ template: "Success!", duration: 1000});
}).error(function(responseData) {
console.error("[ ERROR ]", JSON.stringify(responseData));
deferred.reject('Error');
$ionicLoading.show({ template: "Request Error!", duration: 1000});
});
promise.success = function(fn) {
promise.then(fn);
return promise;
}
promise.error = function(fn) {
promise.then(null, fn);
return promise;
}
return promise;
},
}
})
......
This source diff could not be displayed because it is too large. You can view the blob instead.
angular.module('blazer.authenticationcontrollers', [])
.controller('AuthCtrl', function($scope, $state, postBlazer, $cordovaDialogs, $cordovaInAppBrowser) {
.controller('AuthCtrl', function($scope, $state, postBlazer, $timeout, $ionicPopup, $cordovaDialogs, $cordovaInAppBrowser) {
$scope.user = {
username: "blazetestaccount",
......@@ -20,17 +20,47 @@ angular.module('blazer.authenticationcontrollers', [])
});
}
/* FORGOT PASSWORD POPUP */
$scope.showForgotPassword = function(){
$scope.data = {};
// An elaborate, custom popup
var myPopup = $ionicPopup.show({
template: '<input type="email" ng-model="data.email">',
title: 'Reset Password',
subTitle: 'Please enter your email address',
scope: $scope,
buttons: [
{
text: 'Reset',
type: 'button-dark button-outline',
onTap: function() {
console.log('Destination to School');
$scope.postforgotpassword($scope.data.email);
}
},
{
text: 'Cancel',
type: 'button-dark button-outline',
onTap: function() {
console.log('Cancel Reset');
}
}
]
});
}
/* FORGOT PASSWORD */
$scope.forgotpassword = function(){
var emailaddress = '';
postBlazer.forgotpassword($scope.user)
$scope.postforgotpassword = function(email){
console.debug("[ RESET EMAIL ]", email);
var emailaddress = email;
postBlazer.ForgotPassword(emailaddress)
.success(function(response) {
console.log("LOGIN SUCCESS", response);
$state.go('app.map');
localStorage.setItem("username", $scope.user.username);
console.log("FORGOT PASSWORD SUCCESS", response);
})
.error(function(response) {
console.error("LOGIN ERROR", response);
console.error("FORGOT PASSWORD ERROR", response);
});
}
......
......@@ -12,7 +12,7 @@
<input type="password" ng-model="user.password" placeholder="Password" required>
</label>
</div>
<a class="form-login-link" ng-click="forgotpassword();">Forgot Password?</a>
<a class="form-login-link" ng-click="showForgotPassword();">Forgot Password?</a>
<button class="button button-block button-outline button-light login-button" ng-click="loginUser()" ng-disabled="loginForm.$invalid">LOGIN</button>
<!-- <button class="button button-block button-small button-outline button-light login-button" ng-click="showDialog()">SIGN UP</button> -->
</form>
......
......@@ -68,7 +68,7 @@ angular.module('blazer.mapcontrollers', [])
// REMOVE MARKERS
map.removeLayer(markers);
$scope.drawTripMarkers(lat, lon); // DRAW TRIP MARKER ]
$scope.drawMarkers(lat, lon, 'On Trip'); // DRAW TRIP MARKER ]
}
/* EVENT LISTENERS */
......@@ -247,6 +247,7 @@ angular.module('blazer.mapcontrollers', [])
$scope.selectedBarangayData = $scope.data.selectedBarangay +" "+ $scope.data.selectedBarangayTime;
$scope.currentBarangay = $scope.data.selectedBarangay;
$scope.currentBarangayTime = $scope.data.selectedBarangayTime;
$scope.data = {};
}
},
{
......@@ -275,6 +276,10 @@ angular.module('blazer.mapcontrollers', [])
console.log('[ BARANGAY DETAILS ]', JSON.stringify($scope.BarangayData));
$scope.openChart($scope.BarangayData); // LOAD CHART MODAL
$scope.drawMarkers($scope.BarangayData.lat, $scope.BarangayData.lng, $scope.currentBarangay);
// RESET VALUES
$scope.selectedBarangayData = '';
$scope.currentBarangay = '';
$scope.currentBarangayTime = '';
})
.error(function(response) {
console.error("BARANGAY ERROR", response);
......@@ -331,9 +336,10 @@ angular.module('blazer.mapcontrollers', [])
map.removeLayer(geojsonLayer);
$scope.tripStatus = true;
var newDate = new Date();
var newDate = new Date();
startTime = newDate.getTime();
localStorage.setItem("starttime", startTime);
console.log("START TRIP TIME", startTime);
$scope.getUserLocation();
......@@ -344,8 +350,10 @@ angular.module('blazer.mapcontrollers', [])
$scope.tripEnd = function(){
$scope.tripStatus = false;
tripStatusRef = false;
var newDate = new Date();
endTime = newDate.getTime();
var endTime = newDate.getTime();
localStorage.setItem("endtime", endTime);
console.log("END TRIP TIME", endTime);
// TRIGGER CLEAR FUNCTION OF REMOVE LINE -- NEEDS TO DEBUG
......
......@@ -14,7 +14,7 @@
<h3 class="text-light"><center>BLAZE</center></h3>
<ion-item nav-clear menu-close href="#/app/profile" class="item-avatar"><ionic-letter-avatar data="{{ user.username }}" shape="round" charcount="2"></ionic-letter-avatar><h4 class="text-light">{{ user.username }}</h4><h5 class="text-light">Blazer User</h5></ion-item>
<ion-item nav-clear menu-close href="#/app/map" class="item-icon item-icon-left"><i class="icon ion-android-compass"></i>Blaze Network</ion-item>
<ion-item nav-clear menu-close href="#/app/offerride" class="item-icon item-icon-left"><i class="icon ion-android-car"></i>Offer a Ride</ion-item>
<!-- <ion-item nav-clear menu-close href="#/app/offerride" class="item-icon item-icon-left"><i class="icon ion-android-car"></i>Offer a Ride</ion-item> -->
<ion-item nav-clear menu-close href="#/app/sharedride" class="item-icon item-icon-left"><i class="icon ion-android-contacts"></i>Shared Ride</ion-item>
<ion-item nav-clear menu-close href="#/app/status" class="item-icon item-icon-left"><i class="icon ion-android-wifi"></i>My Travel Stats</ion-item>
<ion-item nav-clear menu-close href="#/app/about" class="item-icon item-icon-left"><i class="icon ion-android-bulb"></i>About</ion-item>
......
angular.module('blazer.offerridecontrollers', [])
.controller('OfferRideCtrl', function($scope, getBlazer, postBlazer, LocationService, $cordovaGeolocation) {
.controller('OfferRideCtrl', function($scope, $ionicHistory, getBlazer, postBlazer, LocationService, $cordovaGeolocation) {
/* MAP DEFAULTS */
var destinationMap = L.map('mapdestination');
......@@ -97,9 +97,11 @@ angular.module('blazer.offerridecontrollers', [])
console.log("OFFER RIDE SUCCESS", response);
data = {};
$scope.offer ={};
$ionicHistory.goBack(-1);
})
.error(function(response) {
console.error("OFFER RIDE ERROR", response);
$ionicHistory.goBack(-1);
});
}
......
<ion-view view-title="Take a Shared Ride" ng-init="getSharedRideData();">
<ion-header-bar>
<h1 class="title">Take a Shared Ride</h1>
</ion-header-bar>
<ion-view view-title="Shared Ride" ng-init="getSharedRideData();">
<ion-nav-buttons side="right">
<button class="button button-outline button-icon button-light" ui-sref='app.offerride'>
Offer
</button>
</ion-nav-buttons>
<ion-content>
<ion-tabs class="tabs-clear tabs-icon-top">
<ion-tab title="Available" class="text-light darkblue" badge="availableRide.length" badge-style="badge-assertive" icon-on="light ion-android-car"
icon-off="light ion-android-car">
<ion-content class="background-feed">
......
......@@ -13,7 +13,7 @@
<p class="text-dark">You've just finished a trip. Please take this short survey.</p>
</div>
<div class="item item-light item-text-wrap">
<!-- <div class="item item-light item-text-wrap">
<p class="text-dark">This trip is made as part of tour:</p>
</div>
<label class="item item-input item-select item-text-wrap item-stable">
......@@ -25,12 +25,12 @@
<option value="trip1">Going Home</option>
<option value="trip2">Going to School</option>
</select>
</label>
</label> -->
<div class="item item-light item-text-wrap" ng-if="endtrip.destination">
<div class="item item-light item-text-wrap">
<p class="text-dark">What was the main mode of transport used?</p>
</div>
<label class="item item-input item-select item-text-wrap item-stable" ng-if="endtrip.destination">
<label class="item item-input item-select item-text-wrap item-stable">
&nbsp
<div class="input-label">
</div>
......@@ -50,11 +50,11 @@
</select>
</label>
<div class="item item-light item-text-wrap" ng-if="endtrip.mode && endtrip.mode">
<div class="item item-light item-text-wrap" ng-if="endtrip.mode">
<p class="text-dark">You made this trip by
<u><b> {{endtrip.mode}} </b></u>. Overall, how would you evaluate this experience?</p>
</div>
<label class="item item-input item-select item-text-wrap item-stable" ng-if="endtrip.mode && endtrip.mode">
<label class="item item-input item-select item-text-wrap item-stable" ng-if="endtrip.mode">
&nbsp
<div class="input-label">
</div>
......
......@@ -10,9 +10,7 @@ angular.module('blazer.surveycontrollers', [])
$scope.modalWeeklyTrip.hide();
};
$scope.endtrip = {
destination: localStorage.getItem("currentTrip")
};
$scope.endtrip = {};
$scope.postEndTripSurvey = function(){
var tripID = localStorage.getItem("tripid");
var username = localStorage.getItem("username");
......@@ -20,6 +18,7 @@ angular.module('blazer.surveycontrollers', [])
var endTime = localStorage.getItem("endtime");
var newDate = new Date();
var timeStamp = newDate.getTime();
var currentTrip = localStorage.getItem("currentTrip");
var postdata = {
"trip_id" : tripID,
......@@ -29,7 +28,7 @@ angular.module('blazer.surveycontrollers', [])
"mode": $scope.endtrip.mode,
"exp": $scope.endtrip.overallxp,
"emotion": $scope.endtrip.emotion,
"type": $scope.endtrip.destination
"type": currentTrip
}
console.log("[ POST END TRIP SURVEY ]");
postBlazer.EndTripSurvey(postdata)
......
......@@ -230,6 +230,7 @@ color: #fff;
margin-right: 10%;
margin-left: 25%;
margin-bottom: 5%;
margin-top: 5%;
font-size: 12px !important;
}
......
......@@ -38,6 +38,8 @@ angular.module('blazer', [
.config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider) {
$ionicConfigProvider.tabs.position('bottom'); // other values: top
$ionicConfigProvider.tabs.style('standard');
$ionicConfigProvider.spinner.icon('lines');
$stateProvider
/* MENU */
......
......@@ -199,7 +199,7 @@ angular.module('blazer.apiservices', [])
}).error(function(responseData) {
console.error("[ ERROR ]", JSON.stringify(responseData));
deferred.reject('Error');
$ionicLoading.show({ template: "Unexpected Error!", duration: 500});
$ionicLoading.show({ template: "Check your connection!", duration: 500});
});
promise.success = function(fn) {
......@@ -292,7 +292,7 @@ angular.module('blazer.apiservices', [])
console.error("[ ERROR ]", JSON.stringify(responseData));
deferred.reject('Error');
$ionicLoading.show({ template: "Sending Error!", duration: 1000});
$ionicLoading.show({ template: "Try Again!", duration: 1000});
});
promise.success = function(fn) {
......@@ -328,12 +328,12 @@ angular.module('blazer.apiservices', [])
console.log("[ SUCCESS ]", JSON.stringify(responseData));
deferred.resolve('Success');
$ionicLoading.show({ template: "Success!", duration: 1000});
$ionicLoading.show({ template: "Submitted!", duration: 1000});
}).error(function(responseData) {
console.error("[ ERROR ]", JSON.stringify(responseData));
deferred.reject('Error');
$ionicLoading.show({ template: "Sending Error!", duration: 1000});
$ionicLoading.show({ template: "Try Again!", duration: 1000});
});
promise.success = function(fn) {
......@@ -357,7 +357,7 @@ angular.module('blazer.apiservices', [])
$ionicLoading.show({ template: '<ion-spinner icon="crescent"></ion-spinner>', duration: 30000});
var sharedRideData = {
"ride_id": data.ride_id,
"username": data.username
"user": data.username
};
$http({method: 'POST', url: blazerAPI + '/take_shared_ride_post.php',
data: $.param(sharedRideData),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment