<?php $r="../";
$id=$_GET['id'];
require_once($r."inc/funciones.php");
validNotSession($r);
$mysqli = connectDB($r);
$spe=$_SESSION['perfil'];if($spe!=$pad && $spe!=$psu){exit(header("Location:".$r."dashboard.php?error=Tu No Puedes Ingresar un Gasto"));} 
?>
<!DOCTYPE html>
<html lang="en">
  <?php include $r."inc/head.php"; ?>
<body class="fixed-nav sticky-footer  sidenav-toggled  bg-dark" id="page-top">
  <?php include $r."inc/nav.php"; ?>
  
  <div class="content-wrapper">
    <div class="container-fluid">
      <h2 class="text-center"><i class="fa fa-gift"></i> NUEVO GASTO</h2><hr/>
      <form id="gasto" name="gasto" action="acciones.php" method="post"  enctype="multipart/form-data"><hr/>
        <div class="form-group row">
            <label for="tipo" class="col-sm-2 col-form-label"><span class="text-danger h5">*</span>Tipo de Gasto</label>
            <div class="col-sm-9">
            <select data-placeholder="Seleccionar el tipo" class="form-control chosen-select" name="tipo" id="tipo">
                    <? $resultado = $mysqli->query("SELECT * FROM z_tinversiones");
                  do{echo '<option value="'.$fila["id"].'"> '.$fila["nombre"].'</option>';
                    }while ($fila = $resultado->fetch_assoc()); ?>
              </select>
            </div>
        </div>
        <div class="form-group row">
            <label for="costo" class="col-sm-2 col-form-label"><span class="text-danger h5">*</span>Costo del Gasto</label>
            <div class="col-sm-9">
                <input type="number" class="form-control" id="costo" name="costo" placeholder="Costo del Gasto" autocomplete="off" required>
            </div>
        </div>
        <div class="form-group row">
            <label for="costo" class="col-sm-2 col-form-label"><span class="text-danger h5">*</span>Archivo Adjunto</label>
            <div class="col-sm-9">
                <input type="file" class="form-control" id="archivo" name="archivo" accept=".png, .jpeg, .doc, .docx, .pdf" >
            </div>
        </div>
        <div class="form-group row">
            <label for="nota" class="col-sm-2 col-form-label"><span class="text-danger h5">*</span>Nota Datallada del Gasto</label>
            <div class="col-sm-9">
                <textarea type="text" class="form-control" id="nota" name="nota" placeholder="Nota Detalla del Gasto" autocomplete="off" required></textarea>
            </div>
        </div>
            <input type="hidden" name="gasto" value="gasto">
            <hr/>
          <button type="submit" class="btn btn-primary btn-block">Ingresar Gasto</button>
      </form>
    </div>
  </div>
  <? include $r."inc/foot.php"; ?>
</body>
</html>