

<?php 

session_start();

 if($_SESSION['usuariogrupo_id']!=1){

	 ?>

	 

	 <div class="content-header" >

      <div class="container-fluid">

        <div class="row mb-2">

		 <div class="col-sm-6">

			<h1>

			Impresora

			<small>modulo</small>

			</h1>

		</div>	

		

		<div class="col-sm-6">

            <ol class="breadcrumb float-sm-right">

				<li class="breadcrumb-item" >Inicio</li>

				<li class="breadcrumb-item" >Mantenimiento</li>

				<li class="breadcrumb-item" >General</li>

				<li class="breadcrumb-item active">Impresora</li>

            </ol>

          </div>

		</div>

	</div>

</div>



<section class="content" style="min-height:0px;padding-bottom:0px;margin-bottom:-30px;">

	<div class="row">

	    <div class="col-xs-12">

		    <div class="box">

		        <div class="box-header">

		        </div>

		    </div>

		</div>

	</div>

</section>



<section class="content">

	<div class="container-fluid">

	<div class="row">

	    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">

		    <div class="card">

		        <div class="card-header">

		         <strong>USTED NO TIENE PERMISOS PARA VER ESTA PAGINA</strong>        

		        </div>

		    </div>

		</div>

	</div>

	</div>

</section>





	 <?php 

 }

 else{

?>

	

	<div class="content-header" >

      <div class="container-fluid">

        <div class="row mb-2">

		 <div class="col-sm-6">

			<h1>

			Impresora

			<small>modulo</small>

			</h1>

		</div>	

		

		<div class="col-sm-6">

            <ol class="breadcrumb float-sm-right">

				<li class="breadcrumb-item" >Inicio</li>

				<li class="breadcrumb-item" >Mantenimiento</li>

				<li class="breadcrumb-item" >General</li>

				<li class="breadcrumb-item active">Impresora</li>

            </ol>

          </div>

		</div>

	</div>

</div>

	

	

	

	

	

	

	

	

	

	

<section class="content">

	<div class="container-fluid">

	<div class="row">

	    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">

		    <div class="card">

		        <div class="card-header">

		          <button id="btn_agregar" onClick="impresora_form('insertar')" class="btn btn-primary">Agregar</button>

		          <button id="btn_actualizar" class="btn btn-default">Actualizar</button>		        

		        </div>

		    </div>

		</div>

	</div>

	</div>

</section>

	

		<!-- formulario de registro -->

			<div class="modal fade" id="div_impresora_form_dialog" role="dialog" data-keyboard="true" tabindex="-1"  style="padding:0px;">

			<div class="modal-dialog modal-lg " style="width: 90% !important;" role="document" >



			<div class="modal-content">



			<div class="modal-body div_impresora_form" >



			</div>

			<br />

			<br />

			</div>

			</div>

			</div>

			

		<!-- tabla de registros -->	

		<div id="div_impresora_tabla" class="contenido_tabla"></div>



		

		







<script type="text/javascript">

	function impresora_tabla()

	{	

		$.ajax({

			type: "POST",

			url: "../impresora/impresora_tabla.php",

			async:true,

			dataType: "html",                      

			data: ({

			//pro_est:	$('#cmb_fil_pro_est').val()

		}),

			beforeSend: function() {

				$('#div_impresora_tabla').addClass("ui-state-disabled");

			},

			success: function(html){

				$('#div_impresora_tabla').html(html);

			},

			complete: function(){			

				$('#div_impresora_tabla').removeClass("ui-state-disabled");

			}

		});     

	}



	function impresora_form(act,idf)

	{

		$('#div_impresora_form_dialog').modal();

		

		$.ajax({

			type: "POST",

			url: "../impresora/impresora_form.php",

			async:true,

			dataType: "html",                      

			data: ({

				action: act,

				imp_id:	idf,

				vista:	'impresora_tabla'

			}),

			beforeSend: function() {

			var div = "<center><div class='overlay col-lg-12 col-sm-12 col-xs-12' style='background-color:#fff;padding:0%;font-size:3rem;' >  <i class='fa fa-refresh fa-spin ' ></i> </div>  </center>";	

			$('.div_impresora_form').html(div);

			},

			success: function(html){

				$('.div_impresora_form').html(html);	

			}

		});

	}



	function eliminar_impresora(id)

	{   

		 

		if(confirm("Realmente desea eliminar?")){

			$.ajax({

				type: "POST",

				url: "../impresora/impresora_reg.php",

				async:true,

				dataType: "html",

				data: ({

					action: "eliminar",

					id:		id

				}),

				beforeSend: function() {

					

				},

				success: function(html){

					toastr["success"](html);	



				},

				complete: function(){

					impresora_tabla();

				}

			});

		}

	}







$(function() {

	

	$('#btn_actualizar').click(function() {

		$("#contenido").load("../impresora/impresora_vista.php");

	});



	$("#div_impresora_form_dialog").on('hidden.bs.modal', function(){

          	$("#contenido").load("../impresora/impresora_vista.php");

		});

		

	impresora_tabla();	

	 setTitle("IMPRESORA - "+nombreEmpresa);

});



</script>



 <?php } ?>