Exemple #1
0
function materias($clave)
{
    $maestro = $clave;
    $periodo = periodoActual();
    $materias = array();
    $conexion = conectaBDSIE();
    $consulta = sprintf("select m.MATCVE, m.MATNCO from DMATER m inner join DGRUPO g on m.MATCVE = g.MATCVE where g.PERCVE =%d and g.PDOCVE =%s and g.GRUBAS = ' ' and g.INSNUM > 0", $maestro, $periodo);
    $res = mysql_query($consulta);
    if ($res) {
        while ($row = mysql_fetch_array($res)) {
            $materias[$row["MATCVE"]] = $row["MATNCO"];
        }
        return $materias;
    } else {
        return " ";
    }
}
Exemple #2
0
function nuevaSol()
{
    //insertar en lbsolicitudes
    session_start();
    $respuesta = false;
    $cveDep = GetSQLValueString("0000", "text");
    //preparado para cuando se
    $periodo = GetSQLValueString(periodoActual(), "text");
    $fe = GetSQLValueString($_POST['fe'], "text");
    $fs = GetSQLValueString($_POST['fs'], "text");
    $hs = GetSQLValueString($_POST['hs'], "text");
    $lab = GetSQLValueString($_POST['lab'], "text");
    $uso = GetSQLValueString($_POST['uso'], "text");
    $prac = GetSQLValueString($_POST['prac'], "int");
    $clave = GetSQLValueString($_SESSION['nombre'], "int");
    $firma = GetSQLValueString("123456", "text");
    $mat = GetSQLValueString($_POST['mat'], "text");
    $gpo = GetSQLValueString($_POST['gpo'], "int");
    $gp = GetSQLValueString(grupo($mat, $clave, $periodo, $gpo), "text");
    //insertar
    $cant = GetSQLValueString($_POST['cant'], "int");
    $estatus = GetSQLValueString("V", "text");
    $b = GetSQLValueString(" ", "text");
    $conexion = conectaBDSICLAB();
    $consulta = sprintf("insert into lbsolicitudlaboratorios values(%s,%s,%s,%s,%s,%s,%s,%s,%d,%d,%s,%s,%s,%s,%s)", $cveDep, $periodo, $b, $fe, $fs, $hs, $lab, $uso, $prac, $clave, $firma, $mat, $gp, $cant, $estatus);
    $res = mysql_query($consulta);
    if (mysql_affected_rows() > 0) {
        $respuesta = true;
    }
    $arrayJSON = array('respuesta' => $respuesta);
    print json_encode($arrayJSON);
}