 <meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″ />
<?php

date_default_timezone_set("America/New_York");

?>





<script>



  window.addEventListener('popstate', function (event) {

  history.pushState(null, document.title, location.href);

});





var u = localStorage.getItem("usuario");

if(u==""){

	window.location.replace("../loginPage.php");

}





</script>



<html lang="en">

<style type="text/css">



.barra_lateral{

  padding:12px;

  background:#F8F9F9 ;

  width:245px; 

  @border-top:solid 4px green;

  @border-bottom:solid 2px gray;

  

  @box-shadow:1px 2px 1px;

  @border-radius:5px 5px 5px;

  min-height:300px;

  margin-top:-20px;

  margin-left:-20px;

  height:1000px;

  float:left;

}


  .icon{

    width:20px;

    margin-bottom:0px;

  }

  

    .icon2{

    width:20px;

    margin-bottom:-5px;

    

  }

  

.isable{

  color: currentColor;

  cursor: not-allowed;

  opacity: 0.5;

  text-decoration: none;

}



a,li{
font-weight:bolder;
font-size:14px; 
}
.form-control{

  color:#6D6D6D;

  font-size: 13px;

}



.navbar a:hover{

  color:black;

}



.bold{

  font-weight: bolder;

}



th{

  text-align: center;



}

.ml-2{

  margin-left: 8px;

}



.mr-2{

  margin-right: : 8px;

}



.mt-2{

  margin-top: 8px;

}



.mb-2{

  margin-bottom: 8px;

}

td{

  @font-family: Arial;

  font-size: 18px;

  @color:gray;

}



.bold{

  font-weight:bolder;
  font-size:15px;



  

}



.scroll-md{

  max-height: 300px;

  overflow-y: scroll;

}

.icono{

	width:30px;

}



<style>

    th{

        text-align: center;
        border-bottom: solid gray 1px;
		font-size:18px;

    }



table,td{

    

    font-size: 14px;

    @font-weight: bolder;

}

.form-control{

    font-size: 14px;

    font-weight: bolder;

}



@thead th{

    background: #66bb6a;

    color:white;

	

}



</style>

<style>

    td{

        text-align: left;

		font-size:14px;

		

    }

    td{

       @font-weight:100;

    }

    




th{

    @background: green;

    @color:white;

    font-weight:bolder;

    font-size: 18px;
    text-align: center;

}



  @thead th{

    background: #68A466;

    color:white;

  }

    td,.btn, th, a, .form-control, button, label{

    font-family: "Segoe UI";
    @font-weight: light;
    font-size:18px ;
    


  

       

    }
    thead th{
    background: #68A466;
    color:white;
  }
</style>

<head>

  <meta charset="utf-8">



<meta name="viewport" content="width=device-width">

<meta name="mobile-web-app-capable" content="yes">

<link rel="icon" sizes="192x192" href="../img/cloud3.png">






  <meta name="theme-color" content="#563d7c">

  <title>SantanaSoft - POS</title>

  <link rel="icon" sizes="192x192" href="../../imagenes/mon.png">

<!--link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"-->

<link rel="stylesheet" href="../../vendor/fa/css/all.min.css">

<link rel="stylesheet" type="text/css" href="../../src/bootstrap.min.css">





<link rel="stylesheet" type="text/css" href="../../src/datatable.css">

<!--link rel="stylesheet" type="text/css" href="../src/bootstrap-theme.css"-->

 <link href="../../vendor/toastr/toastr.css" rel="stylesheet"/>

<script src="../../src/jquery.js"></script>

<script src="../../src/bootstrap.min.js"></script>



<script src="../../src/datatables.js"></script>

<script src="../../src/bootstrap_datatable.js"></script>



<script type="text/javascript" src="../js/savy.js"></script>

  <script src="../../js/numeral.js"></script>

        <script src="../../js/moment.js"></script>

        <script src="../../js/fechas.js"></script>



<script src="../../vendor/alertify.min.js"></script>

  <script src="../../vendor/toastr/toastr.min.js"></script>

<link rel="stylesheet" href="../../vendor/alertify.min.css" />






</head>



  <body>

    

<nav class="navbar navbar-default fixed-top" id="barra">

  <div class="container-fluid">

    <!-- Brand and toggle get grouped for better mobile display -->

    <div class="navbar-header">

      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">

        <span class="sr-only">Toggle navigation</span>

        <span class="icon-bar"></span>

        <span class="icon-bar"></span>

        <span class="icon-bar"></span>

      </button>

    

    </div>



    <!-- Collect the nav links, forms, and other content for toggling -->

    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">

      <ul class="nav navbar-nav">

	 <li><a href="menu.php"><img src="../../img/home.png" class="icono">

	 Inicio</a></li>





       

        <li class="dropdown">

          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><img src="../../img/caja.png" class="icono"> Caja<span class="caret"></span></a>

          <ul class="dropdown-menu">

            <li><a href="prestamos.php"> <i class="fa fa-cash-register text-success"></i>  Prestamos</a></li>

            <li><a href="cobros_prestamos.php"> <i class="fa fa-clock text-danger"></i> Cobros del dia</a></li>

            <li><a href="menu.php"> <i class="fa fa-chart-bar text-success"></i> MENU</a></li>

              <li><a href="../../php/logout.php"><i class="fa fa-file text-success"></i>  Cerrar sesion</a></li>

              
			

			  <li role="separator" class="divider"></li>

            
            

          </ul>

        </li>





          



       


        



     

     

	

	 
    </div><!-- /.navbar-collapse -->

  </div><!-- /.container-fluid -->

</nav>







<script>



function salir(){

    var usuario="<?php echo $usuario?>";

    var nivel="<?php echo $nivel?>";

    

    if(confirm("SEGURO(A) QUE DESEA SALIR DEL SISTEMA")){

       localStorage.setItem("usuario",""); 

       localStorage.setItem("nivel",""); 

       localStorage.setItem("pas",""); 

       window.location.href="../php/logout.php";

    }

}





var toggler = document.getElementsByClassName("caret");

var i;



for (i = 0; i < toggler.length; i++) {

  toggler[i].addEventListener("click", function() {

    this.parentElement.querySelector(".nested").classList.toggle("active");

    this.classList.toggle("caret-down");

  });

}

</script>

</div >





  <!--Modal load-->



<div class="modal" id="loading" style="opacity:3px"  tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" data-backdrop="">

  <div class="modal-dialog modal-sm"  role="document" >

    <div class="modal-content">



      <div class="modal-body">

       <div id="ld">

         <center>

         <img src="../load.gif" width="100"><br>

         <small>Aplicando, espere...</small>

         </center>

       </div>

      </div>

      

    </div>

  </div>

</div>  

<!--/Modal load-->













<script>





function _enviar(url,data){

	

	var ajax = $.ajax({

		"method": "POST",

		"url":url,

		"data":data,

		"success":function(){

			    ///$(".form-control").prop("disabled",false)

    			$("button").prop("disabled",false)

    			///$("a").css("pointer-event","click");

         

		}

		

	});

	return ajax;

}



      

    function cargando(msg){

    ////$(".form-control").prop("disabled",true)

    $("button").prop("disabled",true)

    ///$("a").css("pointer-event","none");



     	

	}

function bno(){

  $(".btn").prop("disabled",true);

}



function bsi(){

  $(".btn").prop("disabled",false);

}







var myAlmacen = localStorage.getItem("almacen");

var myAlmacen2 = localStorage.getItem("almacen2");

var myDB = localStorage.getItem("db");

var myUser = localStorage.getItem("usuario");

var myPass = localStorage.getItem("pass");

var myLevel = localStorage.getItem("nivel");

var myCaja = localStorage.getItem("caja");

var hoySql = moment().format('YYYY-MM-DD')

var estadoCaja = "";





$("#lb-usuario").html(myUser);

$("#lb-caja").html(localStorage.getItem("caja"));

//$(".form-control").addClass("font-weight-light");

$("td").addClass("font-weight-light");

$("table").addClass("table-bordered");



$(".form-control").addClass("text-secundary");



              cashState(myCaja)

              function cashState(caja){

                var sql = "select * from apertura_caja where caja='"+caja+"' order by id desc limit 1";

                _enviar("../php/traer_datos.php",{sql:sql})

                .done( function( data ){

                  var rs = JSON.parse(data);

                  estadoCaja = rs.data[0].estado;



                   $("#lb-caja2").html(myCaja+"("+estadoCaja+")");

                })

              }



 var hoy_sql = moment().format('YYYY-MM-DD')

 var hoy_normal = moment().format('DD-MM-YYYY')

  </script>



  <?php

    $hoy = @date('Y-m-d');

  ?>

  

  <script>



	if(myLevel!="Master"){

		$("#li-empresa").hide()

		$("#li-reportes").hide()

		$("#li-administrar").hide()

	}



  function _nueva_venta(){

    window.location.href="../pos/_nueva_venta.php?usuario="+myUser+"&caja="+myCaja;

  }



    setDefaultTicketName()



  function setDefaultTicketName(){

        var sql = "update ventas set ticket = CONCAT('Venta: ',id_venta, ' - Ticket-->N/A') where ticket=''";

      _enviar("../php/update.php", {

        sql: sql

      })



      .done(function(data) {

        if (data != "1") {

          alert(data);

          return;

        }

      })

    

  }



var validAuth="";



</script>