<?php
session_start();
include_once '../classes/db.class.php';
include_once '../classes/fc.class.php';

	
if ($_SERVER['REQUEST_METHOD'] === 'POST'){

	//array_shift($_POST);
    $id=$_POST['id'];
    $qtde=$_POST['qtde'];
    $total=$_POST['total'];   
    $tabela='pecasserv'; 

    $sql = "UPDATE ".$tabela." SET QUANTIDADE=".$qtde.", TOTAL=".$total." WHERE idprods=".$id;
    
    $con=DB::conecta();
    $upd = $con->prepare($sql);
    $st=$upd->execute();
    if($st){
        FC::somapedido($_SESSION['CODIGO'],$_SESSION['uids']);
        echo "ok";
    }else{
        echo 'erro';
    }

   


}