예제 #1
0
 public function actualizar_maes()
 {
     parent::conexion();
     $sql = sprintf("update maestros set\r\n                direccion_maes=%s,\r\n                telefono_maes=%s,\r\n                correo_maes=%s\r\n                where\r\n                cve_maes=%s\r\n                ", parent::comillas_inteligentes($_POST["dire"]), parent::comillas_inteligentes($_POST["tel"]), parent::comillas_inteligentes($_POST["correo"]), parent::comillas_inteligentes($_POST["cve"]));
     mysql_query($sql);
     header("Location: " . Conectar::ruta() . "c-maestros/e-1/v-" . $_POST["cve"] . "/");
     exit;
 }
예제 #2
0
 public function consulta_user_es_for()
 {
     parent::conexion();
     $sql = sprintf("select * from usuarios,cat_user\r\n                     where \r\n                         usuarios.nombre_usu=%s \r\n                         and usuarios.apellidos_usu=%s \r\n                         and usuarios.cve_cat_user=cat_user.cve_cat_user \r\n                         ", parent::comillas_inteligentes($_POST["nombre"]), parent::comillas_inteligentes($_POST["aps"]));
     $res = mysql_query($sql);
     while ($reg = mysql_fetch_assoc($res)) {
         $this->consulta_es_for[] = $reg;
     }
     return $this->consulta_es_for;
 }
예제 #3
0
 public function delete_unidad()
 {
     if (isset($_GET["i"])) {
         parent::con();
         $sql = sprintf("delete from unidad where id_unidad_vehiculo=%s", parent::comillas_inteligentes($_GET["i"]));
         mysql_query($sql);
         echo "<script type='text/javascript'>window.location='view/menu.phtml'</script>";
     } else {
         echo "<script type='text/javascript'>window.location='view/menu.phtml'</script>";
     }
 }
예제 #4
0
 public function npractica()
 {
     parent::conexion();
     $query = sprintf("insert into practicas \r\n                        values\r\n                        (null,%s,%s,0,%s,%s,%s,1);\r\n                        ", parent::comillas_inteligentes($_POST["cv_m"]), parent::comillas_inteligentes($_POST["img"]), parent::comillas_inteligentes($_POST["fcha"]), parent::comillas_inteligentes($_POST["des"]), parent::comillas_inteligentes($_POST["gpo"]));
     mysql_query($query);
     header("Location: " . Conectar::ruta() . "c-mini/e-3/");
     exit;
 }
예제 #5
0
 public function actualizar_alumnos()
 {
     parent::conexion();
     echo $sql = sprintf("update alumnos set\r\n                tel_al=%s,\r\n                obser_al=%s,\r\n\t\tcalle_al=%s,\r\n\t\tnum_al=%s,\r\n\t\tcol_al=%s,\r\n                estado_al=%s,\r\n\t\tmuni_al=%s\r\n                where\r\n                cve_alum=%s\r\n                ", parent::comillas_inteligentes($_POST["tele"]), parent::comillas_inteligentes($_POST["obser"]), parent::comillas_inteligentes($_POST["calle"]), parent::comillas_inteligentes($_POST["numero"]), parent::comillas_inteligentes($_POST["colo"]), parent::comillas_inteligentes($_POST["estado"]), parent::comillas_inteligentes($_POST["muni"]), parent::comillas_inteligentes($_POST["cve_a"]));
     mysql_query($sql);
     header("Location: " . Conectar::ruta() . "c-aini/v-6/");
     exit;
 }
예제 #6
0
 public function alta_grupo()
 {
     parent::conexion();
     $query = sprintf("insert into grupo \r\n                        values\r\n                        (null,%s,%s,%s,%s,%s,%s,%s,1);\r\n                        ", parent::comillas_inteligentes($_POST["nom_gpo"]), parent::comillas_inteligentes($_POST["maestro"]), parent::comillas_inteligentes($_POST["horario"]), parent::comillas_inteligentes($_POST["aula"]), parent::comillas_inteligentes($_POST["Laboratorio"]), parent::comillas_inteligentes($_POST["hl"]), parent::comillas_inteligentes($_POST["dia"]));
     mysql_query($query);
     header("Location: " . Conectar::ruta() . "c-grupos/");
     exit;
 }
예제 #7
0
 public function login()
 {
     if (!empty($_POST["user"]) and !empty($_POST["pass"])) {
         parent::conexion();
         $sql = sprintf("select * from admin where login_dire='%s' and pass_dire='%s'", parent::comillas_inteligentes($_POST["user"]), parent::comillas_inteligentes($_POST["pass"]));
         $res = mysql_query($sql);
         if (mysql_num_rows($res) != 0) {
             while ($reg = mysql_fetch_array($res)) {
                 $_SESSION["admin"] = $reg["nombre_dire"] . " " . $reg["apellidos_dire"];
                 header("Location: " . Conectar::ruta() . "c-admin/");
                 exit;
             }
         } else {
             /////////////////////////
             parent::conexion();
             $sql = sprintf("select * from alumnos where login_al='%s' and pass_al='%s' and status_al!=0", parent::comillas_inteligentes($_POST["user"]), parent::comillas_inteligentes($_POST["pass"]));
             $res = mysql_query($sql);
             if (mysql_num_rows($res) != 0) {
                 while ($reg = mysql_fetch_array($res)) {
                     $_SESSION["nom_alumn"] = $reg["nombre_alum"] . " " . $reg["apellidos_al"];
                     $_SESSION["cve_alum"] = $reg["cve_alum"];
                     header("Location: " . Conectar::ruta() . "c-aini/");
                     exit;
                 }
             } else {
                 /////////////////////////
                 parent::conexion();
                 $sql = sprintf("select * from maestros where login_maes='%s' and pass_maes='%s' and status_maes!=0", parent::comillas_inteligentes($_POST["user"]), parent::comillas_inteligentes($_POST["pass"]));
                 $res = mysql_query($sql);
                 if (mysql_num_rows($res) != 0) {
                     while ($reg = mysql_fetch_array($res)) {
                         $_SESSION["nom_maes"] = $reg["nombre_maes"] . " " . $reg["apellido_maes"];
                         $_SESSION["cve_maes"] = $reg["cve_maes"];
                         header("Location: " . Conectar::ruta() . "c-mini/");
                         exit;
                     }
                 } else {
                     /////////////////////////
                     parent::conexion();
                     $sql = sprintf("select * from usuarios where login_usu='%s' and pass_usu='%s' and cve_cat_user=1 and status!=0", parent::comillas_inteligentes($_POST["user"]), parent::comillas_inteligentes($_POST["pass"]));
                     $res = mysql_query($sql);
                     if (mysql_num_rows($res) != 0) {
                         while ($reg = mysql_fetch_array($res)) {
                             $_SESSION["nom_se"] = $reg["nombre_usu"] . " " . $reg["apellidos_usu"];
                             $_SESSION["cve_se"] = $reg["cve_usu"];
                             header("Location: " . Conectar::ruta() . "c-sini/");
                             exit;
                         }
                     } else {
                         header("Location: " . Conectar::ruta() . "c-login/v-2/");
                         exit;
                     }
                     ////////////////////////
                 }
                 ////////////////////////
             }
             ////////////////////////
         }
     } else {
         header("Location: " . Conectar::ruta() . "c-login/v-1/");
         exit;
     }
 }
예제 #8
0
 public function desactivar_gpo()
 {
     if ($_POST["dia"] == "Lunes") {
         $d = 1;
     }
     if ($_POST["dia"] == "Martes") {
         $d = 2;
     }
     if ($_POST["dia"] == "Miercoles") {
         $d = 3;
     }
     if ($_POST["dia"] == "Jueves") {
         $d = 4;
     }
     if ($_POST["dia"] == "Viernes") {
         $d = 5;
     }
     if ($_POST["dia"] == "Sabado") {
         $d = 6;
     }
     if ($_POST["dia"] == "Domingo") {
         $d = 7;
     }
     parent::conexion();
     $sql = sprintf("update grupo set\r\n                    status_gpo=%s\r\n                    where\r\n                    cve_grupo=%s\r\n                    ", parent::comillas_inteligentes($_POST["es"]), parent::comillas_inteligentes($_POST["cve_grupo"]));
     mysql_query($sql);
     header("Location: " . Conectar::ruta() . "c-grupos/d2-{$d}/");
     exit;
 }