<?php

session_start();

if($_SESSION["sistema"]!= "1"){ header("location: ../../index.php"); exit();}

require_once ("../../config/Cado.php");



require_once ("../contenido/contenido.php");

$oContenido = new cContenido();



?>

<!DOCTYPE html>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>Tipo de Nota de Almacén</title>

<link href="../../css/Estilo/miestilo.css" rel="stylesheet" type="text/css">

<!--[if lt IE 9]>

<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>

<![endif]-->

<link href="../../css/Estilo/menu_estilo.css" rel="stylesheet" type="text/css">



<link rel="stylesheet" href="../../js/jquery-ui/development-bundle/themes/start/jquery.ui.all.css">

<script src="../../js/jquery-ui/development-bundle/jquery-1.6.2.js"></script>

<script src="../../js/jquery-ui/development-bundle/external/jquery.bgiframe-2.1.2.js"></script>

<script src="../../js/jquery-ui/development-bundle/ui/jquery.ui.core.js"></script>

<script src="../../js/jquery-ui/development-bundle/ui/jquery.ui.widget.js"></script>

<script src="../../js/jquery-ui/development-bundle/ui/jquery.ui.mouse.js"></script>

<script src="../../js/jquery-ui/development-bundle/ui/jquery.ui.button.js"></script>

<script src="../../js/jquery-ui/development-bundle/ui/jquery.ui.draggable.js"></script>

<script src="../../js/jquery-ui/development-bundle/ui/jquery.ui.position.js"></script>

<script src="../../js/jquery-ui/development-bundle/ui/jquery.ui.resizable.js"></script>

<script src="../../js/jquery-ui/development-bundle/ui/jquery.ui.dialog.js"></script>

<script src="../../js/jquery-ui/development-bundle/ui/jquery.effects.core.js"></script>



<script src="../../js/jquery-validation/jquery.validate.js" type="text/javascript"></script>

<script src="../../js/jquery-validation/additional-methods.js" type="text/javascript"></script>

<script src="../../js/jquery-validation/localization/messages_es.js" type="text/javascript"></script>



<link rel="stylesheet" href="../../js/tablesorter/themes/blue/style.css" type="text/css" media="print, projection, screen" />

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



<script type="text/javascript">

function notaalmacentipo_tabla()

{	

	$.ajax({

		type: "POST",

		url: "notaalmacentipo_tabla.php",

		async:true,

		dataType: "html",                      

		data: ({

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

		}),

		beforeSend: function() {

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

        },

		success: function(html){

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

		},

		complete: function(){			

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

		}

	});     

}



function notaalmacentipo_form(act,idf)

{

	$.ajax({

		type: "POST",

		url: "notaalmacentipo_form.php",

		async:true,

		dataType: "html",                      

		data: ({

			action: act,

			tipope_id:	idf,

			vista:	'notaalmacentipo_tabla'

		}),

		beforeSend: function() {

			$('#msj_notaalmacentipo').hide();

			$('#div_notaalmacentipo_form').dialog("open");

			$('#div_notaalmacentipo_form').html('Cargando <img src="../../images/loadingf11.gif" align="absmiddle"/>');

        },

		success: function(html){

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

		}

	});

}



function eliminar_notaalmacentipo(id)

{   

	$('#msj_notaalmacentipo').hide();   

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

		$.ajax({

			type: "POST",

			url: "notaalmacentipo_reg.php",

			async:true,

			dataType: "html",

			data: ({

				action: "eliminar",

				tipope_id:		id

			}),

			beforeSend: function() {

				$('#msj_notaalmacentipo').html("Cargando...");

				$('#msj_notaalmacentipo').show(100);

			},

			success: function(html){

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

			},

			complete: function(){

				notaalmacentipo_tabla();

			}

		});

	}

}





//

$(function() {

	

	$('#btn_actualizar').button({

		icons: {primary: "ui-icon-arrowrefresh-1-e"},

		text: true

		}).click(function() {

		location.reload();

	});

	

	$('#btn_agregar').button({

		icons: {primary: "ui-icon-plus"},

		text: true

	});



	notaalmacentipo_tabla();

	

	$( "#div_notaalmacentipo_form" ).dialog({

		title:'Información de Tipo de Operación',

		autoOpen: false,

		resizable: false,

		height: 180,

		width: 500,

		position:'top',

		modal: true,

		buttons: [

			{

				text: 'Guardar',

				id: 'btn_for_tipope_guardar',

				click: function(){

					$("#for_tipope").submit();

				}

			},

			{

				text: 'Cancelar',

				id: 'btn_for_tipope_cancelar',

				click: function(){

					$('#for_tipope').each (function(){this.reset();});

					$( this ).dialog( "close" );

				}

			}

		],

	});

	

});



</script>

</head>



<body>

<div class="container">

	<header>

    	<?php echo $oContenido->print_header()?>

	</header>

    <article class="content">

    	<div class="contenido">

            <div class="contenido_des">

            <table align="center" class="tabla_cont">

                  <tr>

                    <td class="caption_cont">TIPO DE NOTA DE ALMACÉN</td>

                  </tr>

                  <tr>

                    <td align="right" class="cont_emp"><?php echo $_SESSION['empresa_nombre']?></td>

                  </tr>

                  <tr>

                    <td>

                    <table width="100%" border="0" cellspacing="0" cellpadding="0">

                    <tr>

                      <td width="25" align="left" valign="middle"><a id="btn_agregar" href="#" onClick="notaalmacentipo_form('insertar')">Agregar</a></td>

                      <td width="25" align="left" valign="middle"><a id="btn_actualizar" href="#">Actualizar</a></td>

                      <td align="left" valign="middle">&nbsp;</td>

                      <td align="right"><div id="msj_notaalmacentipo" class="ui-state-highlight ui-corner-all" style="width:auto; float:right; padding:2px; display:none"></div></td>

                    </tr>

                  </table>

                    </td>

                  </tr>

                  <tr>

                    <td>

                    </td>

                  </tr>

              </table>

			</div>

        	<div id="div_notaalmacentipo_form">

			</div>

        	<div id="div_notaalmacentipo_tabla" class="contenido_tabla">

      		</div>

      	</div>

    </article>

</div>

<footer>

    <?php echo $oContenido->print_footer()?>

</footer>

</body>

</html>