Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- header('Content-Type: application/json');
- include("includes/db.php");
- if(isset($_GET['action'])){
- $action = $_GET['action'];
- $orderId = $_GET['orderId'];
- $sql = "UPDATE order_list
- SET status ='$action'
- WHERE order_list.Oid ='$orderId' ";
- $run_iupdate = mysqli_query($conn,$sql) or die("error");
- $query = "SELECT *
- FROM order_list
- WHERE order_list.Oid ='$orderId' ";
- $run_item = mysqli_query($conn,$query);
- while($rows = mysqli_fetch_assoc($run_item)){
- $Order_stats = $rows['status'];
- $orderId = $rows['Oid'];
- }
- }
- if( $Order_stats == 0){
- $status = '<span class="label label-danger flatred" product_id="'.$orderId .'"> Aguardando aprovação</span>';
- }
- elseif ($Order_stats == 1) {
- $status = '<span class="label label-success " product_id="'.$orderId .'"> Confirmado !</span>';
- }
- elseif ($Order_stats == 2) {
- $status = '<span class="label label-warning " product_id="'.$orderId .'"> Em produção !</span>';
- }
- elseif ($Order_stats == 3) {
- $status = '<span class="label label-primary " product_id="'.$orderId .'"> Encaminhando </span>';
- }
- elseif ($Order_stats == 4) {
- $status = '<span class="label label-info " product_id="'.$orderId .'"> Entregue </span>';
- }
- $result['change'] = new stdClass;
- $result['statusChange'] = $status;
- echo json_encode($result);
Advertisement
Add Comment
Please, Sign In to add comment