<?php

include '../../conexion/session.php';
include '../../conexion/conn.php';
//comprobamos que sea una petición ajax



$folio_planilla = $_REQUEST['folio_planilla'];
$id_estiba = $_REQUEST['id_estiba'];



$sql6 = "DELETE FROM `contenedor_estiba` WHERE id_estiba='" . $id_estiba . "'";
$result6 = @mysql_query($sql6);

$rs = mysql_query("SELECT COUNT(*) as cont FROM contenedor_estiba WHERE folio_planilla='$folio_planilla'");
if ($row = mysql_fetch_array($rs)) {
    $cont = $row['cont'];
}

$sql7 = "UPDATE contenedor_planilla 
SET cant_pallet='$cont'
WHERE folio_planilla='$folio_planilla'";
$result7 = @mysql_query($sql7);


if ($result7) {
    echo json_encode(array('success' => true));
} else {
    echo json_encode(array('success' => false));
}
