<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope, $http)
{
$http.get("http://www.adhr.adnacgroup.com/ADHRM/companyJson.php")
.then(function(response)
{$scope.names = $scope.names = response.data.service;});
function getInfo(){
$http.post('getTask1.php').success(function(data){
$scope.details = data;
})
}
});
</script>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope, $http)
{
$http.get("http://www.adhr.adnacgroup.com/ADHRM/companyJson.php")
.then(function(response)
{$scope.names = $scope.names = response.data.service;});
function getInfo(){
$http.post('getTask2.php').success(function(data){
$scope.details = data;
})
}
});
</script>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope, $http)
{
$http.get("http://www.adhr.adnacgroup.com/ADHRM/companyJson.php")
.then(function(response)
{$scope.names = $scope.names = response.data.service;});
function getInfo(){
$http.post('getTask3.php').success(function(data){
$scope.details = data;
})
}
});
</script>
I have 3 scripts on 3 different pages with same ng-app and ng-controller.
Below code is my gettask1.php for script1 and similar pages i have created for all scripts to fetch records from diffrent tables. but problem is i can only retrive only last scripts data in all tabs.Im new in angularjs please help me with the same thanks in advance.
<?php
ob_start();
session_start();
include"includes/dbconfig.php";
$org_id=$_SESSION['org_id'];
if(!isset($_SESSION['org_id'])){
header("Location:index.php");
}
getInfo();
$query = "SELECT * from `offer_letter` ORDER BY `offer_id` ASC";
$result = mysql_query($query);
$arr = array();
if(mysql_num_rows($result) != 0) {
while($row = mysql_fetch_assoc($result)) {
$arr[] = $row;
}
}
echo $json_info = json_encode($arr);
?>