<?php
session_start();
?>
<html>
<head><meta charset="UTF-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<base href="../" target="_self">
<script src="js/panel_de_busquedas_verify_input_data.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">

</head>

<?php include "../panel_de_busquedas_head.php";
                                                     /* vista/panel_de_busquedas_vista_una_busqueda.php */
    $busqueda = htmlentities($_GET['cod']);

    foreach($resultBusq as $busq){
        if($busqueda == $busq['referencia'] ){
            $busq_uno = $busq;
        }
    }
?>

<tr>
<td>
<div class="container panel-group " style="width: 640px;">
    <div class="panel panel-default" id="<?php echo "".$busq_uno['referencia'];?>">
      <div class="panel-heading"><h2><?php echo "".$busq_uno['titulo'];?></h2></div>
      <div class="panel-body"><?php echo "".$busq_uno['referencia'];?></div><br>
      <div class="panel-body"><?php $tmp=str_replace('{','<b>'  , $busq_uno['requisitos'] );
                                    $tm1=str_replace('}','</b>' , $tmp );
                                 echo "".str_replace('.','.<br>', $tm1 ) ;?></div><br>
      <div class="panel-body"><u>Zona de trabajo:</u> <?php echo "".$busq_uno['zonaTrabajo'];?></div><br>
      <?php 
        if ( strlen($busq_uno['tecnologiasExcluyentes'] ) > 0 ) {
      ?>
      <div class="panel-body"><u>Tecnologias excluyentes:</u> <?php echo "".$busq_uno['tecnologiasExcluyentes'];?></div>
      <?php
        }
        if ( strlen($busq_uno['tecnologiasDeseables'] ) > 0 ) {
      ?>
      <div class="panel-body"><u>Tecnologias deseables:</u> <?php echo "".$busq_uno['tecnologiasDeseables'];?></div>
      <?php
        }
        if ( strlen($busq_uno['beneficiosOfrecidos'] ) > 0 ) {
      ?>	  
      <div class="panel-body"><u>Beneficios:</u> <?php echo "".$busq_uno['beneficiosOfrecidos'];?></div>
      <?php
        }
      ?>      
    </div>
    <hr/>
  
  
  
    
    <div id="apply_form" class="form-group ">
      <h2>Postular a este trabajo</h2>
      
      
      <form action="modelo/panel_de_busquedas_postulacion.php" method="post" autocomplete="off" class="main_form" enctype="multipart/form-data" onsubmit="document.getElementById('myButton').value='Procesando, por favor espere...';">
      <table>
        <tr>
        <td>
        <p><label for="your_name" class="txt11px-000000">Nombre y Apellido <span title="required"><sup>*</sup></span></label> </td>
        <td> <div><input type="text" name="your_name" id="your_name" value="" required="required" class="inpadd" onblur="verifyname()" /> </td>
        <td> <span id="your_name_ok">&nbsp;&nbsp;</span> 
        </td></p>
        </tr>
        <tr>
        <td>
      	<p><label for="your_email" class="txt11px-000000">Email <span title="required"><sup>*</sup></span></label> </td>
      	<td> <input type="email" name="your_email" id="your_email" value=""  required="required" class="inpadd" onblur="verifyemail()" /></td>
      	<td><span id="your_email_ok"></span></td></p>
      	</td>
      	</tr>
        <tr>
        <td>
	<p><label for="your_message" class="txt11px-000000">Mensaje <span title="required"><sup>*</sup></span></label> </td>
	<td> <textarea rows="5" cols="40" name="your_message" id="your_message" required="required" onblur="verifymessage()" class="inpadd" ></textarea></td><td><span id="your_message_ok"></span></td></p>
        </td>
        </tr>
        <tr>
        <td>
        <p><label for="your_name" class="txt11px-000000">Ingrese el Codigo de Seguridad <span title="required"><sup>*</sup></span></label> </td>
        <?php 
           //require_once("../modelo/calcular_captcha.php");
           include "../modelo/simple_captcha.php";
        ?>
        <td>
          <img src="<?php echo $_SESSION['captcha']['image_src']; ?>" alt="captcha code"> 
         <input type="text" size="6" maxlength="6" name="your_code" id="your_code" value="" required="required" onblur="verifycaptcha(this)" onfocus="document.getElementById("aviso").value = ''" style="width: 120px; padding: 5; margin: 5;"/></td>          
        </td>

        <td><span id="your_code_ok"></span></td>
    

    
        </p>
        </td>
        </tr>
        <tr>
        <td>
        <p class="required"><label for="your_cv" class="txt11px-000000">Subir CV (utilizar formato pdf)</label> </td><td> <input type="file" accept=".pdf,.doc,.docx,.txt" name="your_cv" id="your_cv"  required="required" /> </p>
        </td>
        </tr>
        <tr>


        <td>
        
        <input type="hidden" name="userinfo" id="userinfo" value= "h4Z/bQ==" />
        <input type="hidden" name="referencia" id="referencia" value= "<?php echo $busqueda;?>" />
        <p><input type="submit" class="submit" id="myButton"  name="apply_to_job" value="Confirmar Postulacion " hidden /></p>
        <div id="aviso" class="txt11px-000000"></div>
        </td>
        </tr>
      </table>
      </form>
    </div>
    <ul class="section_footer" style="display:none;">
     <li class="apply"><a href="#apply_form" class="apply_online">Postularte a este trabajo</a></li>
     <li class="print"><a href="javascript:window.print();">Imprimir trabajo</a></li>
     <li class="volver"><a href="javascript:history.go(-1)">Volver</a></li>
    </ul>


</div>
</td>
<td>
  <div class="container"   style="width: 80px;"><a href="mailto:cv-web@kaver-consulting.com?subject=<?php echo "".$busq_uno['referencia'];?>-<?php echo "".$busq_uno['titulo'];?>" target="_self">Aplica por mail adjuntando tu CV</a></div>
</td>
</tr>
<tr>
</tr>
</table>
<?php include "../panel_de_busquedas_foot.php";?>