<?php
session_start();
require_once('conexion.php');

if (isset($_SESSION['usu_nombre']))
{
    require_once('include/sesiones.php');
    $regis=mysqli_query($con,"SELECT * from permiso where modulo_mod_id='13' and usuario_usu_id='$usu_id'") or die(mysqli_error($con));
    $reg=mysqli_fetch_array($regis);
    if($reg['per_visualizar']=="Activo")
    {
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php  include ('head.php'); ?>
</head>
<body>
<?php
    $inicio="";
    $M_inventario="";
    $M_contactos="active";
    $M_compras="";
    $M_ventas="";
    $M_pedidos="";
    $M_pos="";
    $R_reportes="";

    $proveedores="";
    $clientes="active";
    $m_usuarios="";
    $m_distribuidor="";
    include ('menu.php');
?> 
<div class="main">
    <div class="col-md-2">        
        <?php include ('include/menu_contactos.php');?>
    </div> <!-- /span3 -->
    <div class="col-md-10">  
        <div class="widget stacked">
            <div class="widget-content">
                <div class="widget stacked">
                    <div class="widget-content">
                        <section id="buttons">
                            <div class="col-md-6">
                                <a class="btn btn-success" data-toggle="modal" href="#nuevocliente"><i class="icon-plus"></i> Nuevo</a>
                            </div>
                            <div class="col-md-2">
                                <select name="busc_tarifa" id="busc_tarifa" class="form-control name_list" onchange='load(1);'>
                                    <option value="">TODOS</option>
                                    <?php
                                        $datos = mysqli_query($con,"SELECT * FROM tarifas where empresa='$empresa' ") ;
                                        while( $fila = mysqli_fetch_array( $datos ) )
                                        {
                                        echo' <option value="'.$fila['tar_id'].'">'.$fila['tar_nombre'].'</option>';
                                        }
                                    ?>
                                </select>
                            </div>
                            <div class="col-md-4">
                                <input type="text" class="form-control" placeholder="Buscar Cliente" id="q" onKeyUp='load(1);' autofocus>
                            </div>
                        </section>
                    </div>
                </div>
                <center> <span id="loader"></span></center>
                    <div id="resultado_modificar"></div><!-- Carga los datos ajax -->
                    <div class='outer_div'></div><!-- Carga los datos ajax -->
                    <?php include ('include/pie_de_pagina.php'); ?>
            </div> <!-- /widget-content -->
        </div> <!-- /widget --> 
    </div> <!-- /span6 -->
</div><!-- /main -->
<?php 
  include ('php_clientes/form_nuevo_cliente.php');
  include ('php_caja/caja_abrir.php');
  include ('script.php');
?>
<script type="text/javascript" src="php_clientes/ajax.js"></script>
</body>
</html>
<?php
}
else
{
   echo '<script>alert("No tienes permiso para ver esta pagina")</script>';
   echo '<script> setTimeout("history.back(1)", 0); </script>';
}
}
else
{
    echo '<script>location.href = "index.php";</script>';
}
?>
