<?php
include('../../../configuracion.php');
include('inc/formulario.php');
include('config.php');
?>
<?php $resultados = $db->results(TABLA,"*","","orden desc");?>
<!doctype html>
<html class="fixed">
	<head>
		<?php include("../../inc/head.php")?>
		<!-- ESPACIO HEAD ADICIONALES -->

		<!-- FIN ESPACIO HEAD ADICIONALES -->
	</head>
	<body>
		<section class="body">
			<!-- start: header -->
			<?php include("../../inc/header.php")?>
			<!-- end: header -->
			<div class="inner-wrapper">
				<!-- start: sidebar -->
				<?php include("../../inc/side-left.php")?>
				<!-- end: sidebar -->
				
                    

                <?php 
                    
                    set_include_path(get_include_path() . PATH_SEPARATOR . 'mago/lib/');
                    include '../../lib/PHPExcel/IOFactory.php';

                    $inputFileName = 'documento/cargar-listado.xlsx';

                    try {
                        $objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
                    } catch(Exception $e) {
                        die('Error loading file "'.pathinfo($inputFileName,PATHINFO_BASENAME).'": '.$e->getMessage());
                    }

                    $allDataInSheet = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
                    $arrayCount = count($allDataInSheet);

                    $datos_base = array();
                    echo "sadasds";
                    
                    ?>



			



					<!-- start: page -->
					<div class="row">
							<div class="col">
                            <?php	if(count($arrayCount)){ ?>

								<section class="card">
									<div class="card-body">
										
										<table class="table table-bordered table-striped mb-none" id="datatable-default-no">
											<thead>
                                                <tr>
                                                    <th>N°Socio</th>
                                                    <th>Nombre</th>
                                                    <th>DNI</th>
                                                    <th>Nacionalidad</th>
                                                    <th>Tipo Socio</th>
                                                </tr>
											</thead>
											<tbody>
                                                <?php for($i=2;$i<=$arrayCount;$i++){?>
                                                <?php
                                                $nsocio = trim($allDataInSheet[$i]["A"]);
                                                $apellido	  = trim($allDataInSheet[$i]["B"]);
                                                $nombre = trim($allDataInSheet[$i]["C"]);
                                                $rut = trim($allDataInSheet[$i]["D"]);
                                                $nacionalidad = trim($allDataInSheet[$i]["E"]);
                                                $tipo = trim($allDataInSheet[$i]["F"]);
                                                ?>
                                                <tr class="gradeX ">
                                                    <td><?php echo $nsocio?></td>
                                                    <td><?php echo $nombre." ".$apellido?></td>
                                                    <td><?php echo $rut?></td>
                                                    <td><?php echo $nacionalidad?></td>
                                                    <td><?php echo $tipo?></td>
                                                </tr>
                                                <?php }?>
												
											</tbody>
										</table>

                                        <footer class="panel-footer">
										<div class="row">
											<div class="col-sm-12 text-right">
												<a href="<?php echo MAGO?>c/<?php echo MODULO?>" type="reset" class="btn btn-default">Cancelar</a>
                                                <a href="<?php echo MAGO?>c/<?php echo MODULO?>/carga-excel-finalizar.php" class="btn btn-primary">Realizar Carga</a>
											</div>
										</div>
									</footer>


									</div>
                                    

								</section>
                                
                                <?php }?>
							</div>
						</div>







		
					

		<!-- NO TOCAR -->
		<?php include("../../inc/side-right.php")?>
		<?php include("../../inc/bottom.php")?>
		<!-- NO TOCAR -->

		
		<!-- ESPACIO JS ADICIONALES -->

	

    </body>
</html>