<?
$r = "../";
require_once($r."inc/funciones.php");
validNotSession($r);
$code=$_GET['id'];
$mysqli = connectDB($r);
$row1 = $mysqli->query("SELECT * FROM z_pedidos WHERE codigopedido='$code'");
?>
<!DOCTYPE html>
<html lang="en">
  <?php include $r."inc/head.php"; ?>
<body class="fixed-nav sidenav-toggled sticky-footer bg-dark" id="page-top">
  <?php include $r."inc/nav.php"; ?>
  
  <div class="content-wrapper">
    <div class="container-fluid">
      <div class="card mb-3">
        <div class="h3 card-header">
          <i class="fa fa-table"></i> ASSIGNAR NUMERO DE FACTURA</div>
        <div class="card-body">
          <div class="table-responsive">
            <table class="table table-bordered" width="100%" cellspacing="0">
              <thead>
                <tr>
                  <th>Cliente</th>
                  <th>Fecha</th>
                  <th>Codigo</th>
                  <th>tipo</th>
                </tr>
              </thead>
              <tbody>
                    <?php
                    while($row2 = $row1->fetch_assoc()) {
                    ?>
                      <tr>
                          <td><? $cliente=sclien($row2[idcliente]); echo $cliente[nombre]; ?></td>
                          <td><? echo substr($row2[fecha], 0, 10); ?></td>
                          <td><b><? echo $row2[codigopedido]; ?></b></td>
                          <td><? echo $row2[tipopedido]; ?></td>
                      </tr>
                    <?php
                    }
                    ?>
              <tbody>
            </table>
          </div>
        </div>
      </div>
      <form id="formulario" name="form-soporte" action="acciones.php" method="post"  enctype="multipart/form-data">
          <input type="hidden" name="codigo" value="<?php echo $code; ?>">
        <div class="form-group row">
            <label for="telefono" class="col-sm-2 col-form-label"><span class="text-danger h5">*</span>Número de contacto</label>
            <div class="col-sm-10">
                <input type="file" class="form-control" id="soporte" name="soporte" placeholder="Numero de Factura" required>
            </div>
        </div>
        <div class="text-center">
            <input type="button" class="btn btn-primary" value="Atras" name="Back2" onclick="history.back()" />
            <input type="submit" class="btn btn-success" name="soportes" value="Cargar Soporte">
        </div>
      </form>
    </div>
  </div>
  <?php include $r."inc/foot.php"; ?>
</body>
</html>   