This is my code:
<form role="form" action="foo.php" method="post">
<p ng-repeat="item in selectedItems | orderBy: 'ora'">
Campo numero: {{item.id}} Orario: {{item.ora}}:00 Prezzo: €{{prezzoOra()}}.00
</p>
<p>
<b>Ore totali:</b> {{selectedItems.length}}<br>
<b>Prezzo Totale:</b> €{{total(selectedItems)}}.00
</p>
<input type="hidden" value="{{total(selectedItems)}}" name="totale" id="totale" />
<button type="button" class="btn btn-default" data-dismiss="modal">Indietro</button>
<input type="submit" value="Procedi con il pagamento" ng-click="prenota(selectedItems)" class="btn btn-primary">
</form>
When i try to get the $_POST['totale'] in the foo.php page the result that i obtain is always 0.
prenota function:
$scope.prenota = function(selectedItems) {
for(var i = 0, len = $scope.selectedItems.length; i < len; i++) {
var id = selectedItems[i].id;
var ora = selectedItems[i].ora;
$http.post(base_path + "prenotazione/campi/prenota", {'id': id, 'ora': ora, 'data': $scope.data}).success(function(data,status,headers,config){
$scope.myPromise = $http.post(base_path + "prenotazione/campi/data", {'data': $scope.data}).success(function(data,status,headers,config){
$scope.disponibilita = data;
});
});
}
$scope.selectedItems = [];
};
What's the problem?