SHARE
TWEET

Untitled

a guest Jul 18th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     session_start();
  3.     include "../php/conexion.php";
  4.     $conexion=conexion();
  5.  
  6.     $tamanoTabla="450px";
  7.  
  8.     if (!empty($_FILES['csv']['size']) && $_FILES['csv']['size'] > 0) {
  9.         $file = $_FILES['csv']['tmp_name'];
  10.         $handle = fopen($file,"r");
  11.  
  12.         while ($data = fgetcsv ($handle, 1000, ","))
  13.         {
  14.             //si la linea es igual a 1 no guardamos por que serian los títulos de la hoja del excel.
  15.             $numero = count($data);
  16.             $query = sqlsrv_query($conexion,"INSERT INTO archivoHabilitacionRenta values ('$data[0]','$data[1]','$data[0]-$data[1]')");
  17.         }
  18.  
  19.     }else{
  20.         $tamanoTabla="0px";
  21.     }
  22.  
  23.     if (isset($_SESSION['usuario'])) {
  24.  
  25.     ?>
  26.         <!DOCTYPE html>
  27.         <html>
  28.             <head>
  29.                 <meta charset="utf-8">
  30.                 <title>Habilitación Articulos</title>
  31.                 <?php
  32.                  ##Agrego las extenciones y librerias
  33.                  require '../view/ext.html';
  34.                 ?>  
  35.             </head>
  36.         <body>
  37.         <?php include("../view/Menu.php");?>
  38.         <?php require("../view/barra.html");?>
  39.  
  40.          <?php $sql="select distinct t2.razonSocial,t2.nit,t2.cardCode from AlmacenesRenta  t1
  41.                         left join clientes t2
  42.                         on t1.nit=t2.nit";
  43.  
  44.           $ResultadoClientes =sqlsrv_query($conexion,$sql); ?>
  45.           <div class="container">
  46.           <br>
  47.           <br>
  48.  
  49.           <form action="ReglasHabilitacionArticulosRenta.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
  50.               <input name="csv" type="file" id="csv" />  <br />
  51.               <input type="submit" name="Submit" value="Submit" />
  52.           </form>
  53. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top