tieneAcceso()){ $objSesion->terminaSesion(); //print_r($objSesion->getError()); } if(!$objSesion->puedeEditar()){ header("Location: ".$pag); exit(); } unset($objValida); if(!isset($_POST["id"]) || !isset($_POST["edo"]) ){ header("Location: ".$pag."?error=0"); exit(); } $id_repo = filter_input(INPUT_POST, "id", FILTER_SANITIZE_NUMBER_INT);//limpia texto $id_cronos = filter_input(INPUT_POST, "id_cronos", FILTER_SANITIZE_NUMBER_INT);//limpia texto $edo = filter_input(INPUT_POST, "edo", FILTER_SANITIZE_NUMBER_INT);//limpia texto if(isset($_POST["salon"]) && $_POST["salon"] != "") $salon = trim(filter_input(INPUT_POST, "salon", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));//limpia texto $salon_desc = trim(filter_input(INPUT_POST, "salon_desc", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));//limpia texto if(!empty($id_cronos) && $edo>=3){//sincronoza reposiciones $client = new nusoap_client('http://200.13.89.27/checador_otros/admin_checador/webservice/reposiciones_service.php?wsdl', 'wsdl'); $error = $client->getError(); if ($error) { header("Location:".$pag."?error=12"); exit(); } $token = password_hash("W3bS3rv1c3.R3p0##", PASSWORD_DEFAULT); if(isset($salon)) $result = $client->call("reposicion_actualiza_estado", array($token, $id_cronos, $edo, $salon_desc, "")); else $result = $client->call("reposicion_actualiza_estado", array($token, $id_cronos, $edo, "", "")); //print_r($result); //exit(); if ($client->fault) { header("Location:".$pag."?error=12"); exit(); } else { $error = $client->getError(); if ($error) { header("Location:".$pag."?error=12"); exit(); } else { $ok = $result["result"]; if(!$ok){ header("Location:".$pag."?error=12"); exit(); } } } } //Valida que tenga clase en la fecha de falta if(!empty($salon)) $stmt = $pdo->prepare('SELECT fu_reposicion(:id, NULL, NULL, :sal, :edo, NULL, NULL, NULL, NULL, NULL)'); else $stmt = $pdo->prepare('SELECT fu_reposicion(:id, NULL, NULL, NULL, :edo, NULL, NULL, NULL, NULL, NULL)'); $stmt->bindParam(":id", $id_repo); $stmt->bindParam(":edo", $edo); if(!empty($salon)) $stmt->bindParam(":sal", $salon); if(!$stmt->execute()){ //print_r($stmt->errorInfo()); header("Location:".$pag."?error=1"); exit(); } $stmt->closeCursor(); $stmt = null; $stmt = $pdo->prepare('Select * from fs_reposicion(:id, :periodo, NULL, NULL, NULL, NULL, NULL, 0, 1)'); $stmt->bindParam(":id", $id_repo); $stmt->bindParam(":periodo", $_SESSION["periodo_id"]); if(!$stmt->execute()){ header("Location:".$pag."?error=1"); exit(); } $rs = $stmt->fetch(); $stmt->closeCursor(); $stmt = null; $stmt = $pdo->prepare('Select * from fs_contacto(:usr, 3, NULL)');//3 = correo $stmt->bindParam(":usr", $rs["Usuario_id"]); if(!$stmt->execute()){ header("Location:".$pag."?error=1"); exit(); } $correos_rs = $stmt->fetchAll(); $stmt->closeCursor(); $stmt = null; $correoList = ""; foreach($correos_rs as $c){ if($c.substr("lasallistas.org,mx",0) || $c.substr("lasalle.mx",0)){ $correoList .= $c.";"; } } //$correoHTML = "

Se aprobó la reposición para el a las en el salón .

"; $log = new LogActividad(); if($edo == 4){ $desc_log = "Cancela reposición ID[".$id_repo."] edo[".$edo."]"; $ok = 2; }else{ $desc_log = "Autoriza reposición ID[".$id_repo."] edo[".$edo."] Salon[".(empty($salon)?"":$salon)."]"; $ok = 0; if($edo == 5){ $ok = 1; /*if($correoList!= "") Mailer::enviarCorreo($correoList , "Reposición autorizada", $correoHTML);*/ } if($edo == 3){ $ok = 3; /*if($correoList!= "") Mailer::enviarCorreo($correoList , "Reposición autorizada", $correoHTML);*/ } } $log->appendLog($_SESSION["usuario_id"], $_SESSION["usuario_nombre"]." ".$_SESSION["usuario_apellidos"], $desc_log); header("Location: ".$pag."?ok=".$ok); exit(); ?>