/
abm-adjudicado-moto.php
177 lines (153 loc) · 5.78 KB
/
abm-adjudicado-moto.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
<?php
require_once("class/class.php");
$class_adjudicadosMoto =new AdjudicadosMoto();
$class_TituloAdjudicadosMoto =new TituloAdjudicadosMoto();
switch ($_GET["accion"]) {
case "eliminar":
$class_adjudicadosMoto->eliminar_adjudicado_moto($_GET['id']);
break;
case "editar":
if ((isset($_POST["grabar"])) and $_POST["grabar"]=="si")
{
$class_adjudicadosMoto->edit_reg_adjudicados_moto($_POST["modelo"],$_POST["estado"],$_POST["cuota_plan"],$_POST["precio"],$_POST["cuota"],$_POST["concesion"],$_POST["plan"],$_POST["id"]);
exit;
}
$reg_adjudicado_moto=$class_adjudicadosMoto->get_adjudicado_moto_por_id($_GET["id"]);
?>
<!doctype html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Synergya</title>
<!--<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">-->
<link href="css/spacelab.css" rel="stylesheet">
<link href="css/custom.css" rel="stylesheet">
<script language="javascript" type="text/javascript" src="js/funciones.js"></script>
</head>
<body onload="limpiarConcesion()">
<form name="form" action="abm-adjudicado-moto.php?accion=editar&id=<?php echo $_GET["id"];?>" method="post">
<h2>Modelo</h2>
<textarea name="modelo" cols="35" rows="5"><?php echo $reg_adjudicado_moto[0]["mot_modelo"];?></textarea>
</br>
</br>
<h2>Estado</h2>
<input type="text" name="estado" value="<?php echo $reg_adjudicado_moto[0]["mot_estado"];?>" />
</br>
</br>
<h2>Cuota / Plan</h2>
<textarea name="cuota_plan" cols="35" rows="5"><?php echo $reg_adjudicado_moto[0]["mot_cuota_plan"];?></textarea>
</br>
</br>
<h2>Precio</h2>
<input type="text" name="precio" value="<?php echo $reg_adjudicado_moto[0]["mot_precio"];?>" />
</br>
</br>
<h2>Cuota</h2>
<input type="text" name="cuota" value="<?php echo $reg_adjudicado_moto[0]["mot_cuota"];?>" />
</br>
</br>
<h2>Concesion</h2>
<input type="text" name="concesion" value="<?php echo $reg_adjudicado_moto[0]["mot_concesion"];?>" />
</br>
</br>
<h2>Plan</h2>
<select name="plan">
<?php
$i=0;
$registros_adjudicados_moto=$class_TituloAdjudicadosMoto->get_titulo_adjudicados_moto("titulo");
while ($i<sizeof($registros_adjudicados_moto))
{
echo " <option value='".$registros_adjudicados_moto[$i]["tim_id"]."'";
if ($reg_adjudicado_moto[0]["mot_plan"] == $registros_adjudicados_moto[$i]["tim_id"] )
{ echo " selected";}
echo ">".$registros_adjudicados_moto[$i]["tim_titulo"]."</option>"; //concatenamos el los options para luego ser insertado en el HTML
$i++;
}
?>
</select>
</br>
</br>
<input type="hidden" name="grabar" value="si">
<input type="hidden" name="id" value="<?php echo $_GET["id"];?>">
<input type="button" value="Volver" title="Volver" onClick="window.location='adjudicados-moto.php';">
||
<input type="button" value="Editar" title="Editar" onclick="validarAdjudicado();" />
</form>
<script src="js/jquery-1.11.1-min.js"></script>
<script src="js/bootstrap.js"></script>
</body>
</html>
<?php
break;
case "agregar":
if ((isset($_POST["grabar"])) and $_POST["grabar"]=="si")
{
$class_adjudicadosMoto->agregar_reg_adjudicados_moto($_POST["modelo"],$_POST["estado"],$_POST["cuota_plan"],$_POST["precio"],$_POST["cuota"],$_POST["concesion"],$_POST["plan"],$_POST["id"]);
exit;
}
?>
<!doctype html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Synergya</title>
<!--<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">-->
<link href="css/spacelab.css" rel="stylesheet">
<link href="css/custom.css" rel="stylesheet">
<script language="javascript" type="text/javascript" src="js/funciones.js"></script>
</head>
<body onload="limpiarConcesion()">
<form name="form" action="abm-adjudicado-moto.php?accion=agregar&id=0" method="post">
<h2>Modelo</h2>
<textarea name="modelo" cols="35" rows="5"></textarea>
</br>
</br>
<h2>Estado</h2>
<input type="text" name="estado" value="" />
</br>
</br>
<h2>Cuota / Plan</h2>
<textarea name="cuota_plan" cols="35" rows="5"></textarea>
</br>
</br>
<h2>Precio</h2>
<input type="text" name="precio" value="" />
</br>
</br>
<h2>Cuota</h2>
<input type="text" name="cuota" value="" />
</br>
</br>
<h2>Concesion</h2>
<input type="text" name="concesion" value="" />
</br>
</br>
<h2>Plan</h2>
<select name="plan">
<?php
$i=0;
$registros_adjudicados_moto=$class_TituloAdjudicadosMoto->get_titulo_adjudicados_moto("titulo");
while ($i<sizeof($registros_adjudicados_moto))
{
echo " <option value='".$registros_adjudicados_moto[$i]["tim_id"]."'";
echo ">".$registros_adjudicados_moto[$i]["tim_titulo"]."</option>"; //concatenamos el los options para luego ser insertado en el HTML
$i++;
}
?>
</select>
</br>
</br>
<input type="hidden" name="grabar" value="si">
<input type="hidden" name="id" value="<?php echo $_GET["id"];?>">
<input type="button" value="Volver" title="Volver" onClick="window.location='adjudicados-moto.php';">
||
<input type="button" value="agregar" title="agregar" onclick="validarAdjudicado();" />
</form>
<script src="js/jquery-1.11.1-min.js"></script>
<script src="js/bootstrap.js"></script>
</body>
</html>
<?php
break;
}
?>