<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title><?= $titulo?></title>
	<?php
		$this->load->view('main/link');
		echo script_tag('js/modulos/xpn.js?'.$_SESSION['app.gxc_sesion_version']);
		echo script_tag('js/modulos/xca.js?'.$_SESSION['app.gxc_sesion_version']);
	?>
	<script type="text/javascript">
		$(function () {
			fn_xpn_combo();
			$('.date').datepicker({
                autoclose   : true,
                format      : 'dd/mm/yyyy'
            });
            $('#cbo_xhc').select2({
            	minimumInputLength : 3,
            	ajax 	: {
    				url 	: ruta + 'maestras/xhc/autocomplete',
    				dataType: 'json',
    				processResults: function (data) {
    					return {
                			results: data
            			};
    				}
  				}
            });
		});
	</script>
</head>
<body>
	<div class="container">
		<div class="panel panel-primary">
			<?= $cabecera?>
			<?= $menu?>
			<div class="panel-body" style="text-align: center;">
				<h3><b>NUEVA CITA</b></h3>
			</div>
			<div class="panel-body">
				<form class="form-horizontal" id="form_xca" method="post" action="javascript:fn_xca_insertar();">
					<div class="form-group">
						<label for="txt_fecha" class="col-sm-3 control-label">Fecha: </label>
						<div class="col-sm-8">
							<div class="input-group date">
								<input type="text" id="txt_fecha" name="txt_fecha" value="<?= date('d/m/Y')?>" onchange="fn_xpn_combo();" readonly class="form-control" autocomplete="off">
								<span class="input-group-addon">
									<span class="glyphicon glyphicon-calendar"></span>
								</span>
							</div>
						</div>
					</div>
					<div class="form-group">
						<label for="cbo_xpn" class="col-sm-3 control-label">Programación: </label>
						<div class="col-sm-8">
							<select name="cbo_xpn" id="cbo_xpn" class="form-control"">
								<option value="0"> - SELECCIONAR PROGRAMACIÓN - </option>
							</select>
						</div>
					</div>
					<div class="form-group">
						<label for="cbo_xhc" class="col-sm-3 control-label">Paciente: </label>
						<div class="col-sm-8">
							<select name="cbo_xhc" id="cbo_xhc" class="form-control" onchange="fn_xpn_listar_nuevo();">
								<option value="0"> - SELECCIONAR PACIENTE - </option>
							</select>
						</div>
					</div>
					<div class="form-group">
    					<div class="col-sm-offset-3 col-sm-10">
      						<button type="submit" class="btn btn-primary">
      							<span class="glyphicon glyphicon-floppy-disk"></span>
      							 <b>Grabar</b>
      						</button>
      						<a href="<?= base_url('movimientos/xca')?>" class="btn btn-default">
      							<span class="glyphicon glyphicon-th-list"></span>
      							 <b>Ir a la lista</b>
      						</a>
    					</div>
  					</div>
				</form>
			</div>
			<div class="panel-body">
				<table id="xpn_data" class="display table table-bordered table-hover table-stripped responsive nowrap">
				</table>
			</div>
			<?= $pie?>
		</div>
	</div>
</body>
</html>