未定义的属性:AngularJS CRUD中的stdClass ::

时间:2017-03-22 15:46:50

标签: php angularjs

形式:

<!-- Form used for updation of data into database -->
<form class="form-horizontal alert alert-warning" id="editForm" ng-submit="ProcessClient(currentUser)" hidden style="margin-top: 3%;">
<h3 class="text-center">Client preluat</h3>
    <div class="form-group">
        <label for="Name">Nume client:</label>
        <input type="text" class="form-control" ng-model="currentUser.nume_client" value="{{currentUser.nume_client}}">
    </div>

    <div class="form-group">
    <label for="Motive">Motivul prezentării la recepție:</label>
    <select class="form-control" name="motive">
        <option>Ridicare produs</option>
        <option>Predare produs</option>
        <option>Factura storno</option>
        <option>Reclamatie</option>
        <option>Informare</option>
    </select>
    </div>

    <div class="form-group">
        <label for="Email">Fișă service:</label>
        <input type="text" class="form-control" />
    </div>

    <div class="form-group">
        <label for="fise_cu_probleme" style="float: left; margin-left: 2%;">Observație:</label>
        <input type="checkbox" name="fise_cu_probleme" class="checkbox" value="DA" id="checkbox" ng-model="currentUser.fise_cu_probleme" />
    </div>

    <div class="form-group" id="observatii" style="display: none;">
        <label for="observatii">Observații:</label>
        <textarea class="form-control" name="observatii" value=""></textarea>
    </div>

    <div class="form-group">
        <button class="btn btn-warning" ng-disabled="empList.$invalid" ng-click="updateMsg(currentUser.id)">Client soluționat</button>
    </div>
</form>

AngularJS:

$scope.ProcessClient = function(info){

$http.post('includes/assets/receptie_clienti/databaseFiles/processing_client.php',{"id":info.id,"name":info.nume_client,"gender":info.motiv,"email":info.fisa_service,"observatii":info.observatii,"fise_cu_probleme":info.fise_cu_probleme}).success(function(data){
$scope.show_form = true;
if (data == true) {
getInfo();
}
});
}

执行查询的php代码:

<?php session_start();
// Including database connections
require_once 'database_connections.php';
// Fetching the updated data & storin in new variables
$data = json_decode(file_get_contents("php://input")); 
// Escaping special characters from updated data
$id = mysqli_real_escape_string($connection, $data->id);
$name = mysqli_real_escape_string($connection, $data->name);
$email = mysqli_real_escape_string($connection, $data->email);
$gender = mysqli_real_escape_string($connection, $data->gender);
$fise_cu_probleme = mysqli_real_escape_string($connection, $data->fise_cu_probleme);
$observatii = mysqli_real_escape_string($connection, $data->observatii);
$date = date_create('');
$ora_rezolvare = date_format($date, 'H:i');
$client_rezolvat = 'REZOLVAT';
$operator = $_SESSION['username'];
// mysqli query to insert the updated data
mysqli_begin_transaction($connection);
$query = mysqli_query($connection,"UPDATE flux_zilnic SET motiv='$gender',nume_client='$name',status_rezolvare='$client_rezolvat',ora_rezolvare='$ora_rezolvare',fisa_service='$email',fise_cu_probleme='$fise_cu_probleme',observatii='$observatii' WHERE id='$id'") or die("NU AM ACTUALIZAT FLUXUL ZILNIC DEOARECE: <br>".mysqli_error($connection));
$queryTwo = mysqli_query($connection,"UPDATE birouri SET disponibilitate = 'LIBER' WHERE username = '$operator'") or die("NU AM ACTUALIZAT DISPONIBILITATEA DEOARECE: <br>".mysqli_error($connection));
mysqli_commit($connection);
?>

它让我回答错误:

  

PHP注意:未定义的属性:stdClass :: $ fise_cu_probleme in   C:\ wamp64 \ WWW \包括\资产\ receptie_clienti \ databaseFiles \ processing_client.php

     

PHP注意:未定义的属性:stdClass :: $ observatii in   C:\ wamp64 \ WWW \包括\资产\ receptie_clienti \ databaseFiles \ processing_client.php

这可能是什么问题?

0 个答案:

没有答案