-
Notifications
You must be signed in to change notification settings - Fork 3
/
editarEmpleadoShowExecute.php
executable file
·46 lines (43 loc) · 1.42 KB
/
editarEmpleadoShowExecute.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
<?php
include('session.php');
include('libreria.php');
include('db/updates.php');
include('db/searchs.php');
require_once('clases/Vendedor.php');
conectarDB();
$vendedor= new Vendedor();
$vendedor->updateDatos($_REQUEST);
if($_SESSION["Nivel"] != 2){
$vendedorExistente = new Vendedor();
$vendedorExistente = buscarVendedorPorCedulaClaveSinCifrar($vendedor->getCedula());
$claveActual = $_REQUEST['ClaveActual'];
if($vendedorExistente->getClave() != $claveActual){
?>
<script type="text/javascript">
alert("Contraseña inválida");
location.href="editarEmpleadoExecute.php?Cedula='<?php echo $vendedor->getCedula();?>'";
</script>
<?php
}
if($_REQUEST['_ClaveNueva'] != $_REQUEST['_ClaveConfirmar']){
?>
<script type="text/javascript">
alert("Contraseña Nueva no coincide");
location.href="editarEmpleadoExecute.php?Cedula='<?php echo $vendedor->getCedula();?>'";
</script>
<?php
}
if($_REQUEST['_ClaveNueva'] != ''){
$vendedor->setClave($_REQUEST['_ClaveNueva']);
}else{
$vendedor->setClave($vendedorExistente->getClave);
}
actualizarVendedorDesdeEmpleado($vendedor);
}else{
actualizarVendedorDesdeAdministrador($vendedor);
}
?>
<script type="text/javascript">
alert('Ya se Actualizo con Exito el Empleado');
location.href='administracion.php';
</script>