Hello I am trying to fetch data of specific user using php and AngularJS but the AngularJS is not adding Params in my code I tried all the ways but nothing works for me, I dont know what wrong in it I am using HTTP.GET procedure
Here is my JS code
var app = angular.module('myApp', ['ui.bootstrap']);
app.filter('startFrom', function() {
return function(input, start) {
if(input) {
start = +start; //parse to int
return input.slice(start);
}
return [];
}
});
app.controller('customersCrtl', function ($scope, $http, $timeout) {
$http.get('pages/modVehiclePayments/getPendingPO.php', {
params: {
source: link,
getvendornumber: user.phonenum
}
}).success(function(data){
$scope.list = data;
$scope.currentPage = 1; //current page
$scope.entryLimit = 50; //max no of items to display in a page
$scope.filteredItems = $scope.list.length; //Initially for no filter
$scope.totalItems = $scope.list.length;
});
$scope.setPage = function(pageNo) {
$scope.currentPage = pageNo;
};
$scope.filter = function() {
$timeout(function() {
$scope.filteredItems = $scope.filtered.length;
}, 10);
};
$scope.sort_by = function(predicate) {
$scope.predicate = predicate;
$scope.reverse = !$scope.reverse;
};
});
Here is my PHP
$VendorNum = $_GET['getvendornumber'];
$query="SELECT * FROM tblvendors WHERE VendorNo='$VendorNum' AND statuscode='2'";
$result = $conn->query($query) or die($conn->error.__LINE__);
$arr = array();
if($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$arr[] = $row;
}
}
# JSON-encode the response
$json_response = json_encode($arr);
// # Return the response
echo $json_response;