if($note == 'cancel'){ $note = 'Customer cancelled order'; }else if($note == 'defect'){ $note = 'Product is defected'; }else if($note == 'unfulfilled'){ $note = 'Order can not be fulfilled'; } $_update->update_status_order($status, $date, $payment, $fulfillment, $note, $order_id); if(isset($_POST['cancel-option-restock']) && $_POST['cancel-option-restock'] == 'restock'){ $get_item = $_get->order_get_size_type($detail->order_id); foreach($get_item as $get_item){ $temp_stock = $_get->get_product_stock($get_item->type_id, $get_item->stock_name); $stock = $temp_stock->stock_quantity + $get_item->item_quantity; $_update->order_update_stock($stock, $temp_stock->stock_id); } } if(isset($_POST['cancel-option-notify']) && $_POST['cancel-option-notify'] == 'notify-cancel'){ //safe_redirect('email-order-details-cancelled/'.$order_number); require dirname(__FILE__).'/../../emails/order_/_cancel/_cancel.php'; }else{ $type = 'success'; $msg = 'Changes successfully saved'; safe_redirect('self');