<?php
session_start();
include "../conexion.php";
require_once('../include/sesiones.php'); 

if(!empty($_GET))
	{
        $id=$_GET['id'];

        $sql=mysqli_query($con, "SELECT * from egresos where id='$id'");
        $row= mysqli_fetch_array($sql);
        $mov_id = $row['mov_id'];
        
         $borrar_sql=mysqli_query($con,"DELETE FROM egresos WHERE id='$id' and empresa='$empresa'") or die(mysqli_error($con));

        $borrar_sql=mysqli_query($con,"DELETE FROM movimientos WHERE mov_id='$mov_id' and empresa='$empresa'") or die(mysqli_error($con));

        echo '<div class="alert alert-danger alert-dismissable">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
        <strong>Egreso!</strong> Eliminado correctamente.
        </div>';
	}
?>