PageRenderTime 45ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/ver-ofertas-para-postular.php

https://bitbucket.org/elulice/gestionar
PHP | 256 lines | 221 code | 34 blank | 1 comment | 13 complexity | cf2cbe09fd0d407999d5651e76c9a475 MD5 | raw file
  1. <?php
  2. session_start();
  3. include("clases/framework-1.0/class.bd.php");
  4. include("includes/funciones.php");
  5. ?>
  6. <?php
  7. $m_lIDRegistro = is_numeric($_REQUEST["idregistro"]) ? $_REQUEST["idregistro"] : 0;
  8. if($m_lIDRegistro > 0)
  9. {
  10. $sSQL = "SELECT p.apellido, p.nombres ";
  11. $sSQL .= "FROM postulantes p ";
  12. $sSQL .= "WHERE p.idpostulante = " . $m_lIDRegistro;
  13. $cBD = new BD();
  14. $aRegistro = $cBD->Seleccionar($sSQL, true);
  15. }
  16. ?>
  17. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  18. <html>
  19. <head>
  20. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  21. <title><?php print SITIO; ?></title>
  22. <script language="JavaScript" type="text/javascript" src="scripts/ajax.php"></script>
  23. <script language="JavaScript" type="text/javascript" src="scripts/general.js"></script>
  24. <link href="estilos/general.css" rel="stylesheet" type="text/css">
  25. </head>
  26. <body>
  27. <table width="760" border="0" cellspacing="0" cellpadding="0" align="center" class="panel">
  28. <tr>
  29. <td width="415%" class="listado-texto"><h3><?php print ReemplazarCaracteres($aRegistro["apellido"].", ".$aRegistro["nombres"]); ?></h3></td>
  30. </tr>
  31. <tr>
  32. <td class="formulario-textbox">Seleccione mediante los filtros la oferta laboral de su inter&eacute;s</td>
  33. </tr>
  34. </table>
  35. <table border="0" align="center" cellpadding="0" cellspacing="0" style="margin-bottom:10px;" class="buscar">
  36. <tr><td>
  37. <form action="?" method="POST" name="frmFiltro" id="frmFiltro">
  38. <input name="filtrar" type="hidden" value="1" />
  39. <?php
  40. $bCliente = ($_POST["cliente"] ? $_POST["cliente"] : "");
  41. $bPuesto = ($_POST["puesto"] ? $_POST["puesto"] : "");
  42. $bFechaDesde = ($_POST["fecha_desde"] ? $_POST["fecha_desde"] : "");
  43. $bFechaHasta = ($_POST["fecha_hasta"] ? $_POST["fecha_hasta"] : date("d-m-Y"));
  44. $bArea = (is_numeric($_POST["idarea"]) ? $_POST["idarea"] : 0);
  45. $bPais = (is_numeric($_POST["idpais"]) ? $_POST["idpais"] : 0);
  46. $bProvincia = (is_numeric($_POST["idprovincia"]) ? $_POST["idprovincia"] : 0);
  47. $bLocalidad = (is_numeric($_POST["idlocalidad"]) ? $_POST["idlocalidad"] : 0);
  48. ?>
  49. <table border="0" cellspacing="0" cellpadding="0" style="margin:5px auto;">
  50. <tr>
  51. <td width="100" class="encabezado-formulario">Usuaria:</td>
  52. <td width="150"><input name="cliente" type="text" id="cliente" style="width: 140px;" value="<?php print $bCliente; ?>" /></td>
  53. <td width="100" class="encabezado-formulario">&Aacute;rea:</td>
  54. <td width="210" ><select name="idarea" id="idarea" style="width: 200px;">
  55. <?php
  56. $sSQL = "SELECT idarea, nombre FROM areas ";
  57. $sSQL .= "ORDER BY nombre ASC ";
  58. print(GenerarOptions($sSQL, $bArea, true, DEFSELECT));
  59. ?>
  60. </select></td>
  61. <td width="80" rowspan="4" align="right" valign="bottom"><input name="btnFiltrar" type="image" id="btnFiltrar" src="images/btn-buscar.jpg" alt="Filtrar" /></td>
  62. </tr>
  63. <tr>
  64. <td width="100" class="encabezado-formulario">Puesto:</td>
  65. <td width="140" ><input name="puesto" type="text" id="puesto" style="width: 140px;" value="<?php print $bPuesto; ?>" /></td>
  66. <td width="100" class="encabezado-formulario">Pa&iacute;s: </td>
  67. <td width="200" ><select name="idpais" id="idpais" style="width: 200px;" onChange="cargarListas(this, 'idprovincia')">
  68. <?php
  69. $sSQL = "SELECT idpais, nombre FROM paises ";
  70. $sSQL .= "ORDER BY nombre ASC ";
  71. print(GenerarOptions($sSQL, $bPais, true, DEFSELECT));
  72. ?>
  73. </select></td>
  74. </tr>
  75. <tr>
  76. <td class="encabezado-formulario">Fecha desde: </td>
  77. <td><input name="fecha_desde" type="text" id="fecha_desde" style="width: 140px;" value="<?php print $bFechaDesde; ?>" /></td>
  78. <td class="encabezado-formulario">Provincia:</td>
  79. <td><select name="idprovincia" id="idprovincia" style="width: 200px;" onChange="cargarListas(this, 'idlocalidad')">
  80. <?php
  81. $sSQL = "SELECT idprovincia, nombre FROM provincias ";
  82. $sSQL .= "ORDER BY nombre ASC ";
  83. print(GenerarOptions($sSQL, $bProvincia, true, DEFSELECT));
  84. ?>
  85. </select></td>
  86. </tr>
  87. <tr>
  88. <td class="encabezado-formulario">Hasta:</td>
  89. <td><input name="fecha_hasta" type="text" id="fecha_hasta" style="width: 140px;" value="<?php print $bFechaHasta; ?>" /></td>
  90. <td class="encabezado-formulario">Localidad:</td>
  91. <td><select name="idlocalidad" id="idlocalidad" style="width: 200px;">
  92. <?php
  93. $sSQL = "SELECT idlocalidad, nombre FROM localidades ";
  94. $sSQL .= "ORDER BY nombre ASC ";
  95. print(GenerarOptions($sSQL, $bLocalidad, true, DEFSELECT));
  96. ?>
  97. </select></td>
  98. </tr>
  99. </table>
  100. </form>
  101. </td></tr>
  102. </table>
  103. <?php
  104. if ($_GET["filtrar"])
  105. {
  106. ?>
  107. <table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  108. <tr>
  109. <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  110. <tr>
  111. <td width="20"><img src="images/listado-encabezado-inicio.jpg" width="20" height="37"></td>
  112. <td class="listado-encabezado-bg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  113. <tr>
  114. <td width="70"><img src="images/espacio.gif" width="1" height="1"></td>
  115. <td width="75" class="listado-encabezado-texto">Fecha</td>
  116. <td width="150" class="listado-encabezado-texto">Cliente</td>
  117. <td width="220" class="listado-encabezado-texto">Puesto</td>
  118. <td width="180" class="listado-encabezado-texto">&Aacute;rea</td>
  119. <td class="listado-encabezado-texto">Estado</td>
  120. </tr>
  121. </table></td>
  122. <td width="20"><img src="images/listado-encabezado-final.jpg" width="20" height="37"></td>
  123. </tr>
  124. </table></td>
  125. </tr>
  126. <tr>
  127. <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  128. <tr>
  129. <td width="5" class="listado-contenido-inicio"><img src="images/espacio.gif" width="1" height="1"></td>
  130. <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  131. <?php
  132. $lRegistros = 0;
  133. $sSQL = "SELECT p.idpropuesta, p.puesto, p.fecha_alta, oe.nombre AS estado, ";
  134. $sSQL .= "a.nombre AS area, e.razon_social AS empresa ";
  135. $sSQL .= "FROM propuestas p ";
  136. $sSQL .= "INNER JOIN areas a ON p.idarea = a.idarea ";
  137. $sSQL .= "INNER JOIN empresas e ON p.idempresa = e. idempresa ";
  138. $sSQL .= "INNER JOIN ofertas_estados oe ON p.estado = oe.idestado ";
  139. $sSQL .= "WHERE 1 ";
  140. if ($bCliente <> "")
  141. $sSQL .= "AND e.razon_social LIKE '%". $bCliente ."%' ";
  142. if ($bPuesto <> "")
  143. $sSQL .= "AND p.puesto LIKE '%". $bPuesto ."%' ";
  144. if ($bFechaDesde <> "")
  145. {
  146. $bFechaDesde = explode("-", $bFechaDesde);
  147. $sFecha = $bFechaDesde[2]."-".$bFechaDesde[1]."-".$bFechaDesde[0];
  148. $sSQL .= "AND p.fecha_alta >= '". date("Y-m-d", strtotime($sFecha)) ."' ";
  149. }
  150. if ($bFechaHasta <> "")
  151. {
  152. $bFechaHasta = explode("-", $bFechaHasta);
  153. $sFecha = $bFechaHasta[2]."-".$bFechaHasta[1]."-".$bFechaHasta[0];
  154. $sSQL .= "AND p.fecha_alta <= '". date("Y-m-d", strtotime($sFecha)) ."' ";
  155. }
  156. if ($bArea > 0)
  157. $sSQL .= "AND p.idarea = ". $bArea ." ";
  158. if ($bPais > 0)
  159. $sSQL .= "AND p.idpais = ". $bPais ." ";
  160. if ($bProvincia > 0)
  161. $sSQL .= "AND p.idprovincia = ". $bProvincia ." ";
  162. if ($bLocalidad > 0)
  163. $sSQL .= "AND p.idlocalidad = ". $bLocalidad ." ";
  164. $sSQL .= "ORDER BY fecha_alta DESC, idpropuesta DESC ";
  165. //print $sSQL;
  166. $cBD = new BD();
  167. $oResultado = $cBD->Seleccionar($sSQL);
  168. while($aRegistro = $cBD->RetornarFila($oResultado))
  169. {
  170. $sPosicion = (($sPosicion == "1") ? "2" : "1");
  171. ?>
  172. <tr>
  173. <td class="listado-fila-bg-<?php print($sPosicion); ?>"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  174. <tr>
  175. <td width="15"><img src="images/espacio.gif" width="1" height="1"></td>
  176. <td width="70"><table width="70" border="0" cellspacing="0" cellpadding="0">
  177. <tr>
  178. <td width="30"><a href="javascript:verPostulados(<?php print($aRegistro["idpropuesta"]); ?>, <?php print($sPosicion); ?>)"><img src="images/btn-ver-mas-<?php print($sPosicion); ?>.jpg" alt="Ver Postulados" width="24" height="23" border="0"></a></td>
  179. <td width="30"><a href="am-ofertas.php?idregistro=<?php print($aRegistro["idpropuesta"]); ?>&url=<?php print($m_sURL); ?>"><img src="images/btn-modificar-<?php print($sPosicion); ?>.jpg" alt="Modificar" width="24" height="23" border="0"></a></td>
  180. <td><a href="abm.php?tabla=propuestas&columna=idpropuesta&idregistro=<?php print($aRegistro["idpropuesta"]); ?>&url=<?php print($m_sURL); ?>" onClick="return confirm('&iquest;Desea eliminar esta Ofertas?')"><img src="images/btn-eliminar-<?php print($sPosicion); ?>.jpg" alt="Eliminar" width="24" height="23" border="0"></a></td>
  181. </tr>
  182. </table></td>
  183. <td width="75" class="listado-texto"><?php print(date("d/m/Y", strtotime($aRegistro["fecha_alta"]))); ?></td>
  184. <td width="150" class="listado-texto"><?php print($aRegistro["empresa"]); ?></td>
  185. <td width="220" class="listado-texto"><?php print($aRegistro["puesto"]); ?></td>
  186. <td width="180" class="listado-texto"><?php print($aRegistro["area"]); ?></td>
  187. <td width="55" class="listado-texto"><?php print($aRegistro["estado"]); ?></td>
  188. </tr>
  189. <tr id="trOferta-<?php print($aRegistro["idpropuesta"]); ?>" class="listado-fila-oculta">
  190. <td colspan="7" id="tdOferta-<?php print($aRegistro["idpropuesta"]); ?>" class="informe-separador" style="padding: 5px 0;">&nbsp;</td>
  191. </tr>
  192. </table></td>
  193. </tr>
  194. <?php
  195. $lRegistros++;
  196. }
  197. if($lRegistros == 0)
  198. {
  199. ?>
  200. <tr>
  201. <td><img src="images/espacio.gif" width="1" height="20"></td>
  202. </tr>
  203. <?php } ?>
  204. </table></td>
  205. <td width="6" class="listado-contenido-final"><img src="images/espacio.gif" width="1" height="1"></td>
  206. </tr>
  207. </table></td>
  208. </tr>
  209. <tr>
  210. <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  211. <tr>
  212. <td width="100"><a href="am-ofertas.php?idregistro=0&url=<?php print($m_sURL); ?>"><img src="images/listado-pie-inicio.jpg" alt="Agregar" width="100" height="40" border="0"></a></td>
  213. <td class="listado-pie-bg">&nbsp;</td>
  214. <td width="20"><img src="images/listado-pie-final.jpg" width="20" height="40"></td>
  215. </tr>
  216. </table></td>
  217. </tr>
  218. </table>
  219. <?php }
  220. ?>
  221. </body>
  222. </html>