-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsigesp_catdinamic_bene.php
executable file
·190 lines (182 loc) · 5.45 KB
/
sigesp_catdinamic_bene.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<?php
//session_id('8675309');
session_start();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Catalogo Beneficiarios</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
a:link {
color: #006699;
}
a:visited {
color: #006699;
}
a:active {
color: #006699;
}
-->
</style>
<link href="../shared/css/ventanas.css" rel="stylesheet" type="text/css">
<link href="../shared/css/general.css" rel="stylesheet" type="text/css">
<link href="../shared/css/tablas.css" rel="stylesheet" type="text/css">
</head>
<body>
<form name="form1" method="post" action="">
<p align="center">
<input name="operacion" type="hidden" id="operacion">
</p>
<br>
<table width="500" border="0" cellpadding="0" cellspacing="0" class="formato-blanco" align="center">
<tr class="titulo-celda">
<td height="22" colspan="2">Catálogo de Beneficiarios</td>
</tr>
<tr>
<td height="13"> </td>
<td height="13"> </td>
</tr>
<tr>
<td width="67" height="22"><div align="right">Codigo</div></td>
<td width="431" height="22"><div align="left">
<input name="codigo" type="text" id="codigo" size="20" maxlength="10" style="text-align:center">
</div></td>
</tr>
<tr>
<td height="22"><div align="right">Nombre</div></td>
<td height="22"><div align="left">
<input name="nombre" type="text" id="nombre" size="70" maxlength="254" style="text-align:left">
</div></td>
</tr>
<tr>
<td height="22"><div align="right">Apellido</div></td>
<td height="22"><div align="left">
<input name="apellido" type="text" id="apellido" size="70" maxlength="254">
</div></td>
</tr>
<tr>
<td height="22"> </td>
<td height="22"><div align="left"></div></td>
</tr>
<tr>
<td height="22"> </td>
<td height="22"><div align="right"><a href="javascript: ue_search();"><img src="../shared/imagebank/tools20/buscar.gif" alt="Buscar" width="20" height="20" border="0"> Buscar</a></div></td>
</tr>
</table>
<br>
<?php
require_once("../shared/class_folder/sigesp_include.php");
require_once("../shared/class_folder/class_sql.php");
$in = new sigesp_include();
$con = $in->uf_conectar();
$io_sql = new class_sql($con);
$arr = $_SESSION["la_empresa"];
if(array_key_exists("operacion",$_POST))
{
$ls_operacion=$_POST["operacion"];
$ls_codigo="%".$_POST["codigo"]."%";
$ls_nombre="%".$_POST["nombre"]."%";
$ls_destino=$_POST["destino"];
$ls_apellido="%".$_POST["apellido"]."%";
}
else
{
$ls_operacion="";
$ls_destino="";
}
if(array_key_exists("destino",$_GET))
{
$ls_destino=$_GET["destino"];
}
print "<table width=500 border=0 cellpadding=1 cellspacing=1 class=fondo-tabla align=center>";
print "<tr class=titulo-celda>";
print "<td style=text-align:center width=100>Cedula</td>";
print "<td style=text-align:center width=400>Nombre del Beneficiario</td>";
print "</tr>";
if($ls_operacion=="BUSCAR")
{
$ls_sql ="SELECT ced_bene,nombene, apebene ".
"FROM rpc_beneficiario where ced_bene like '".$ls_codigo."' ".
" AND nombene like '".$ls_nombre."' ".
" AND apebene like '".$ls_apellido."'".
" AND ced_bene <>'----------'".
" ORDER BY ced_bene ASC";
$rs_data = $io_sql->select($ls_sql);
$li_numrows = $io_sql->num_rows($rs_data);
if ($li_numrows>0)
{
while ($row=$io_sql->fetch_row($rs_data))
{
if($ls_destino == "")
{
print "<tr class=celdas-blancas>";
$ls_cedben = $row["ced_bene"];
$ls_nomben = $row["nombene"];
$ls_apellido= $row["apebene"];
if (($ls_apellido!="")&&($ls_apellido!="."))
{
$ls_nomben=$ls_apellido.", ".$ls_nomben;
}
print "<td style=text-align:center width=100><a href=\"javascript: aceptar('$ls_cedben','$ls_nomben');\">".$ls_cedben."</a></td>";
print "<td style=text-align:left width=400>".$ls_nomben."</td>";
print "</tr>";
}
else
{
print "<tr class=celdas-blancas>";
$ls_cedben = $row["ced_bene"];
$ls_nomben = $row["nombene"];
$ls_apellido= $row["apebene"];
if (($ls_apellido!="")&&($ls_apellido!="."))
{
$ls_nomben=$ls_apellido.", ".$ls_nomben;
}
print "<td style=text-align:center width=100><a href=\"javascript: aceptar_rep('$ls_cedben','$ls_destino');\">".$ls_cedben."</a></td>";
print "<td style=text-align:left width=400>".$ls_nomben."</td>";
print "</tr>";
}
}
}
else
{ ?>
<script language="javascript">
alert("No se han creado Beneficiarios !!!");
close();
</script>
<?php
}
}
print "</table>";
?>
</div>
<input name="destino" type="hidden" id="destino" value= "<?php print $ls_destino; ?>">
</form>
<p> </p>
<p> </p>
</body>
<script language="JavaScript">
function aceptar(prov,d)
{
opener.document.form1.txtprovbene.value=prov;
opener.document.form1.txtdesproben.value=d;
//opener.buscar();
close();
}
function aceptar_rep(ls_cedben,ls_destino)
{
obj=eval("opener.document.form1."+ls_destino+"");
obj.value=ls_cedben;
close();
}
function ue_search()
{
f=document.form1;
f.operacion.value="BUSCAR";
f.action="sigesp_catdinamic_bene.php";
f.submit();
}
</script>
</html>