<?php
session_start();
      if( (isset($_SESSION['IdAdmin'])) &&($_SESSION['IdAdmin']>0))
   {  
?>
<!DOCTYPE html>
<html>
<head>
<title>e-Class-Docente</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<link rel="icon" href="assets/images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="bower_components/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/pages/waves/css/waves.min.css" media="all">
<link rel="stylesheet" href="assets/icon/feather/css/feather.css">

<link rel="stylesheet" href="assets/icon/icofont/css/icofont.css">
<link rel="stylesheet" href="assets/icon/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="bower_components/animate/css/animate.css">
<link rel="stylesheet" href="assets/pages/notification/notification.css">
<link rel="stylesheet" href="assets/css/style.css">
<link rel="stylesheet" href="assets/css/wysihtml5.css">
<?php
include("script_funciones.php");
include('db___cn.php');
$mysqli=conex_db_mysql();
$administrador="SELECT IdAdministrador,Apellidos,Nombres,UrlFoto
              FROM tb_administrador 
              WHERE IdAdministrador='".$_SESSION['IdAdmin']."'";
$rs=$mysqli->query($administrador);
$fila_administrador=mysqli_fetch_array($rs);

$listar_entidades="SELECT IdRazonSocial,RazonSocial FROM tb_entidades";
$rs_entidades=$mysqli->query($listar_entidades);

$programas_estudio="SELECT IdCarrera,CarreraProfesional FROM tb_carrera";
$rs_programa_estudio=$mysqli->query($programas_estudio);

$departamentos="SELECT IdDepartamento,Departamento 
          FROM tb_departamentos ORDER BY Departamento ASC";
$rs_departamentos=$mysqli->query($departamentos);

mysqli_close($mysqli);
?>
</head>
<body>

<div class="loader-bg">
     <div class="loader-bar"></div>
</div>

<div id="pcoded" class="pcoded">
     <div class="pcoded-overlay-box"></div>
<div class="pcoded-container navbar-wrapper">
	
	<nav class="navbar header-navbar pcoded-header">
		<div class="navbar-wrapper">
			<div class="navbar-logo">
				<?php logo(); ?>	
			</div>
			<div class="navbar-container container-fluid">
			    <?php menuSuperior($fila_administrador['Nombres'],$fila_administrador['UrlFoto']); ?>
			</div>
		</div>
	</nav>

<div class="pcoded-main-container"><!-- inicio pcoded-main-container -->
  <div class="pcoded-wrapper"><!-- inicio pcoded-wrapper -->

	<nav class="pcoded-navbar">
	  <div class="nav-list">
	     <div class="pcoded-inner-navbar main-menu">
	        <div class="pcoded-navigation-label">Panel Navegaci&#243;n</div>
	          <?php  MenuPrincipal(); ?>
	     </div>
	  </div>
	</nav>

<div class="pcoded-content"><!-- inicio pcoded-content -->

	<div class="page-header card"> <!-- inicio page-header card - encabezado -->
		<div class="row align-items-end">
				<div class="col-lg-4">
				  
				</div>
				<div class="col-lg-8">
					<div class="page-header-breadcrumb">
							<ul class=" breadcrumb breadcrumb-title">
								<li class="breadcrumb-item">
								<a href="principal.php"><i class="feather icon-home"></i></a>
								</li>
								<li class="breadcrumb-item">
								<a href="#">Gestor Bolsa Laboral</a>
								</li>
								<li class="breadcrumb-item">
								<a href="#">Convocatorias</a>
								</li>
								<li class="breadcrumb-item">
								<a href="#">Registrar convocatoria</a>
								</li>
							</ul>
					</div>
				</div>
		</div>
	</div><!-- fin page-header card - encabezado -->

	<div class="pcoded-inner-content"><!-- inicio pcoded-inner-content - contenido dinamico -->
		<div class="main-body">
			<div class="page-wrapper">
				<div class="page-body">
					<div class="card">
							<div class="card-header bg-primary">
							    <h5>Registrar nueva convocatoria</h5>
							</div>
						    <div class="card-block">
						    <form name="formConvocatoria" method="post" action="" onsubmit="registrarConvocatoria(); return false" > 
							    <div class="form-group row">
									<div class="col-sm-12">
								       <label class="f-14 f-w-600 f-s-italic" for="txt_titulo">T&#237;tulo (Max. 150 caracteres) :</label>
								       <input type="text" id="txt_titulo" class="form-control color-class" placeholder="Ingrese t&#237;tulo ..." maxlength="150" required>
                                      <!-- <textarea class="form-control color-class" id="txt_titulo" rows="3" required maxlength="150"></textarea> -->
									</div>
							    </div>
							    <div class="form-group row">
									<div class="col-sm-6">
								       <label class="f-14 f-w-600 f-s-italic" for="cb_entidades">Entidad :</label>
                                       <select class="form-control fill" id="cb_entidades" name="cb_entidades">
										<?php 
										  while($fila_entidad=mysqli_fetch_array($rs_entidades))
						                {
										   echo '<option value="'.$fila_entidad['IdRazonSocial'].'">'.$fila_entidad['RazonSocial'].'</option>';
									     }
										?>
										</select>
									</div>
									<div class="col-sm-6">
								       <label class="f-14 f-w-600 f-s-italic" for="cb_programa_estudio">Convocatoria para :</label>
                                       <select class="form-control fill" id="cb_programa_estudio" name="cb_programa_estudio">
										<?php 
											while($fila_programa_estudio=mysqli_fetch_array($rs_programa_estudio))
							                {
											   echo '<option  value="'.$fila_programa_estudio['IdCarrera'].'">'.$fila_programa_estudio['CarreraProfesional'].'</option>';
										     }
									    ?>
										</select>
									</div>
							    </div>
							    <div class="form-group row">
										<div class="col-sm-12">
										   <label class="f-14 f-w-600 f-s-italic" for="textarea">Detalles:</label>
										   <div class="richText">
									        <div id="toolbar" class="richText-toolbar">
                                              <ul>
											    <li><a class="richText-btn" data-wysihtml5-command="bold" title="CTRL+B"><span class="fa fa-bold"> </span></a></li>
											    <li><a class="richText-btn" data-wysihtml5-command="italic" title="CTRL+I"><span class="fa fa-italic"></span></a></li>
											    <!--
											    <li><a class="richText-btn" data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h1">H1</a></li>
											    <li><a class="richText-btn" data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h2">H2</a></li>
											    -->
											   <li><a class="richText-btn" data-wysihtml5-command="insertUnorderedList"><span class="fa fa-list-ul"></span></a></li>
											   <li><a class="richText-btn" data-wysihtml5-command="insertOrderedList"><span class="fa fa-list-ol"></span></a></li>
											    <li><a data-wysihtml5-command="foreColor" data-wysihtml5-command-value="red">Red</a></li>
											    <li><a data-wysihtml5-command="foreColor" data-wysihtml5-command-value="green">Green</a></li>
											    <li><a data-wysihtml5-command="foreColor" data-wysihtml5-command-value="blue">Blue</a></li>
											   <li><a data-wysihtml5-action="change_view"><span class="fa fa-code"></span></a></li>
                                             </ul>
											</div>
											  <textarea id="textarea" class="content richText-initial" placeholder="Ingrese detalles...">
											  	
											  </textarea>
                                                
                                              </div>                             
										</div>
							    </div>

							    <div class="form-group row">
							         <div class="col-sm-3">
									  <label class="f-14 f-w-600 f-s-italic" for="cb_departamentos">Ciudad/Localidad :</label>
                                        <select class="form-control fill" id="cb_departamentos" name="cb_departamentos">
                                         <?php 
											while($fila_departamento=mysqli_fetch_array($rs_departamentos))
							                {
											   echo '<option  value="'.$fila_departamento['IdDepartamento'].'">'.$fila_departamento['Departamento'].'</option>';
										     }
									       ?>
									    </select>
									</div>
									<div class="col-sm-3">
									  <label class="f-14 f-w-600 f-s-italic" for="txt_num_vacantes"># Vacantes:</label>
                                      <input type="number" id="txt_num_vacantes" class="form-control" required maxlength="3">
									</div>
									<div class="col-sm-3">
									  <label class="f-14 f-w-600 f-s-italic" for="txt_remuneracion">Sueldo S/. :</label>
                                      <input type="text" id="txt_remuneracion" class="form-control color-class" required placeholder="Ingrese sueldo..." maxlength="30">
									</div>
									<div class="col-sm-3">
										<label class="f-14 f-w-600 f-s-italic" for="cb_tipo_convocatoria">Tipo de Horario :</label>
                                        <select class="form-control fill" id="cb_tipo_horario" name="cb_tipo_horario">
											<option value="TC">Tiempo Completo</option>
											<option value="TP">Tiempo Parcial</option>
										</select>
									</div>
							   </div>
							    <div class="form-group row">
							        <div class="col-sm-6">
									  <label class="f-14 f-w-600 f-s-italic" for="txt_horario_trabajo">Horario Trabajo :</label>
                                      <input type="text" id="txt_horario_trabajo" class="form-control color-class" required placeholder="Ingrese horario..." maxlength="60">
									</div>
									<div class="col-sm-3">
									  <label class="f-14 f-w-600 f-s-italic" for="txt_fecha_publicacion">Fecha Publicaci&#243;n :</label>
                                      <input type="date" id="txt_fecha_publicacion" class="form-control ">
									</div>
									<div class="col-sm-3">
									  <label class="f-14 f-w-600 f-s-italic" for="txt_fecha_limite">Fecha L&#237;mite</label>
                                      <input type="date" id="txt_fecha_limite" class="form-control " >
									</div>
							    </div> 									    
						    <div class="form-group row">
								<div class="col-sm-12">
									<input type="submit" class="btn waves-effect waves-light btn-success" id="bt_registrar" name="bt_registrar" value="Registrar"> 
									<a href="convocatorias.php" class="btn btn-primary"><i class="fa fa-mail-reply"></i>Volver</a>
								</div>
						    </div>
                          </form>
					    </div>
					</div>
				</div>
			</div>
		</div>
	</div><!-- fin pcoded-inner-content - contenido dinamico -->
</div> <!-- fin pcoded-content -->

</div><!-- fin pcoded-wrapper -->

</div> <!-- fin pcoded-main-container -->

</div>
</div>

<script src="bower_components/jquery/js/jquery.min.js"></script>
<script src="bower_components/popper/js/popper.min.js"></script>
<script src="bower_components/bootstrap/js/bootstrap.min.js"></script>
<script  src="bower_components/jquery-slimscroll/js/jquery.slimscroll.js"></script>
<script src="assets/pages/waves/js/waves.min.js"></script>

<script  src="bower_components/switchery/js/switchery.min.js"></script>
<script  src="bower_components/bootstrap-tagsinput/js/bootstrap-tagsinput.js"></script>
<script  src="bower_components/bootstrap-maxlength/js/bootstrap-maxlength.js"></script>
<script  src="assets/pages/advance-elements/typeahead.bundle.min.js" ></script>
<script src="assets/js/pcoded.min.js"></script>
<script src="assets/js/vertical/vertical-layout.min.js"></script>
<script  src="assets/js/bootstrap-growl.min.js"></script>
<script src="assets/js/script.js"></script>

<script src="js/ajax.js"></script>
<script src="js/advanced.js"></script>
<script src="js/wysihtml5-0.4.0pre.js"></script>
<script>
$(document).ready(function() {
    $('input.color-class').maxlength({
        alwaysShow: true,
        threshold: 10,
        warningClass: "label label-success",
        limitReachedClass: "label label-danger"
    }); 
    $('.content').richText();    
});
</script>
<script>
  var editor = new wysihtml5.Editor("textarea", {
    toolbar:        "toolbar",
    stylesheets:    "./assets/css/wysihtml5.css",
    parserRules:    wysihtml5ParserRules
  });
</script>

</body>
</html>
<?php
}
else
{ 
header("Location: index.php");
}
?>
