<?php
require_once "../../../config/database.php";
    $alerta = 0;
	//var_dump($_POST); die();
    if (isset($_POST['id']) && isset($_POST['comentario'])) {
      $id = $_POST['id'];
	  $comentario = $_POST['comentario'];
	  
      $queryDel = mysqli_query($mysqli, "UPDATE remision_encabezado SET status = 'C', observacion_enc = '".$comentario."' WHERE id = $id")
                or die('error '.mysqli_error($mysqli));
      if($queryDel)
        $alerta = 1;
    }  

    if ($alerta == 1) {
      echo "<div class='alert alert-success alert-dismissable'>
              <button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>
              <h4>  <i class='icon fa fa-check-circle'></i> Exito!</h4>
              Remision cancelada correctamente.
            </div>";
    }else{
		echo "";
	}    
    ?>