$cnn = new conexion();
    $coment = "";
    $id_user = $_POST["id_userUnsigned"];
    $user_name = $_SESSION["usuario"];
    $coment = $_POST['coment'];
    $U = new Usuario();
    $N = new Notificacion();
    $M = new Mail();
    $body = "";
    //if($U->Load_empleado($id_user)>0 || $id_user==0){
    if ($U->Load_Usuario_By_ID($id_user) > 0 || $id_user == 0) {
        //$query="update empleado set delegado=0 where numempleado='".$_SESSION["empleado"]."'";
        $query = "update empleado set delegado=0 where idempleado='" . $_SESSION["idusuario"] . "'";
        $rst = $cnn->insertar($query);
        $cad = "Se te a removido la delagación del usuario <strong>" . $user_name . "</strong>";
        $N->Add(utf8_encode($cad), 0, $id_user, $coment, 0);
        //$U->Load_usuario($id_user);
        $U->Load_Usuario_By_ID($id_user);
        $body = "<p>\n\t\t\t\t<strong>Estimado {$U->Get_dato("u_nombre")} {$U->Get_dato("u_paterno")} {$U->Get_dato("u_materno")}</strong><br>\n\t\t\t\tLe informamos que el usuario: <strong>{$user_name}</strong> le ha removido la delegación que le solicito.\n\t\t\t\t<br>\n\t\t\t\tGracias\n\t\t\t\t<br><br><br>\n\t\t\t\t<strong>Observaciones:</strong>{$coment}\n\t\t\t\t<br><br>\n\t\t\t\t\tPara Ingresar al sistema presione:<a href='http://201.159.131.127/eexpenses_danone'><strong>aqu&iacute;</strong></a>.\n\t\t\t\t</p>";
        $N->set_contenido($body);
        $N->set_destinatario($U->Get_dato("u_email"));
        //$query=sprintf("update notificaciones set nt_activo=0 where nt_creador ='%s' and nt_asignado_a='%s' and nt_activo =1",$_SESSION["idusuario"],$id_user);
        $query = sprintf("update notificaciones set nt_activo=0 where nt_remitente ='%s' and nt_asignado_a='%s' and nt_activo =1", $_SESSION["idusuario"], $id_user);
        $rst = $cnn->insertar($query);
        //$N->notificaUsu();
    } else {
        echo "No";
    }
}
if (isset($_POST["recoveryUser"]) && $_POST["recoveryUser"] != "") {
    $cnn = new conexion();
示例#2
0
    $completeUrl = "";
    if (isset($_GET['ltotal']) && isset($_GET['lactual'])) {
        $completeUrl = "ltotal=" . $_GET['ltotal'] . "&lactual=" . $_GET['lactual'];
    }
    header("Location: ./index.php?activo=yes&" . $completeUrl);
} else {
    if (isset($_GET['action']) && $_GET['action'] == "aceptar" && isset($_GET['id']) && $_GET['id'] != "") {
        $asignadoa = $Usu->SetAceptaDelegado($_GET['id']);
        $N = new Notificacion();
        $U = new Usuario();
        //$U->Load_empleado($asignadoa);
        $U->Load_usuario($asignadoa);
        //$cad="Estimado <strong>".$U->Get_dato_Empleado('nombre')."</strong>  el usuario <strong> {$_SESSION["usuario"]}</strong> ha aceptado la delegacion que le solicito.";
        $cad = "Estimado <strong>" . $U->Get_dato('nombre') . "</strong>  el usuario <strong> {$_SESSION["usuario"]}</strong> ha <strong>ACEPTADO</strong> la delegaci&oacute;n que le solicito.";
        //$N->Add(utf8_encode($cad),0,$asignadoa,$coment="Ninguno",0);
        $N->Add(utf8_encode($cad), 0, $U->Get_dato('idempleado'), $coment = "Ninguno", 0);
        $cad .= "<br><br>\n\t\t\t\t\tPara Ingresar al sistema presione:<a href='http://201.159.131.127/eexpenses_danone'><strong>aqu&iacute;</strong></a>.";
        $N->set_contenido($cad);
        $N->set_destinatario($U->Get_dato("u_email"));
        //$N->notificaUsu();
        $cnn = new conexion();
        $query = sprintf("update notificaciones set nt_activo=0,  nt_aceptado=1 where nt_id ='%s'", $_GET['id']);
        $cnn->insertar($query);
        $completeUrl = "";
        if (isset($_GET['ltotal']) && isset($_GET['lactual'])) {
            $completeUrl = "ltotal=" . $_GET['ltotal'] . "&lactual=" . $_GET['lactual'];
        }
        header("Location: ./index.php?activo=yes&" . $completeUrl);
    }
}
?>
示例#3
0
    $query = sprintf("update notificaciones set nt_activo=0 where nt_id ='%s'", $_GET['id']);
    $cnn->insertar($query);
    $completeUrl = "";
    if (isset($_GET['ltotal']) && isset($_GET['lactual'])) {
        $completeUrl = "ltotal=" . $_GET['ltotal'] . "&lactual=" . $_GET['lactual'];
    }
    header("Location: ./index.php?activo=yes&" . $completeUrl);
} else {
    if (isset($_GET['action']) && $_GET['action'] == "aceptar" && isset($_GET['id']) && $_GET['id'] != "") {
        $asignadoa = $Usu->SetAceptaDelegado($_GET['id']);
        $N = new Notificacion();
        $U = new Usuario();
        $U->Load_empleado($asignadoa);
        $U->Load_usuario($asignadoa);
        $cad = "Estimado <strong>" . $U->Get_dato_Empleado('nombre') . "</strong>  el usuario <strong> {$_SESSION["usuario"]}</strong> ha aceptado la delegación que le solicito.";
        $N->Add(utf8_encode($cad), 0, $asignadoa, $coment = "Ninguno", 0);
        $cad .= "<br><br>\n\t\t\t\t\tPara Ingresar al sistema presione:<a href='http://201.159.131.127/eexpenses_danone'><strong>aqu&iacute;</strong></a>.";
        $N->set_contenido($cad);
        $N->set_destinatario($U->Get_dato("u_email"));
        $N->notificaUsu();
        $cnn = new conexion();
        $query = sprintf("update notificaciones set nt_activo=0 where nt_id ='%s'", $_GET['id']);
        $cnn->insertar($query);
        $completeUrl = "";
        if (isset($_GET['ltotal']) && isset($_GET['lactual'])) {
            $completeUrl = "ltotal=" . $_GET['ltotal'] . "&lactual=" . $_GET['lactual'];
        }
        header("Location: ./index.php?activo=yes&" . $completeUrl);
    }
}
?>