Beispiel #1
0
function claveUsuario1()
{
    $usu = GetSQLValueString($_POST["usuario"], "text");
    $respuesta = false;
    $claveUsuario = -1;
    $conexion = conectaBDSICLAB();
    $consulta = sprintf("select * from lbusuarios where usuario=%s limit 1", $usu);
    $res = mysql_query($consulta);
    if ($row = mysql_fetch_array($res)) {
        $respuesta = true;
        $claveUsuario = $row["claveUsuario"];
    }
    $arrayJSON = array('respuesta' => $respuesta, 'claveUsuario' => $claveUsuario);
    print json_encode($arrayJSON);
}
Beispiel #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);
}
Beispiel #3
0
							<option value="2">01:00</option>
							<option value="3">15:00</option>
						</select>
						<label>Hora de la práctica</label>
					</div>
					<div class="input-field col s2">
						<input id="txtCantAlumnos" type="number" class="validate">
						<label for="txtCantAlumnos">Cant. de alumnos</label>
					</div>
				</div>
				<div class="row">
					<div class="input-field col s8">
						<select id="cmbLaboratorio">
							<option value="" disabled selected>Seleccione el laboratorio</option>
							<?php 
$conexion = conectaBDSICLAB();
$consulta = sprintf("select claveLaboratorio, nombreLaboratorio from lblaboratorios");
$res = mysql_query($consulta);
while ($row = mysql_fetch_array($res)) {
    echo '<option value="' . $row["claveLaboratorio"] . '">' . $row["nombreLaboratorio"] . '</option>';
}
?>
						</select>
						<label>Laboratorio</label>
					</div>
				</div>
				<div class="row">
					<div class="input-field col s6">
						<textarea id="textarea1" class="materialize-textarea"></textarea>
						<label for="textarea1">Motivo de uso</label>
					</div>
Beispiel #4
0
function guardaPeticionArticulos()
{
    $respuesta = false;
    session_start();
    if (!empty($_SESSION['nombre'])) {
        $responsable = $_SESSION['nombre'];
        $nombreArticulo = GetSQLValueString($_POST["nombreArticulo"], "text");
        $cantidad = GetSQLValueString($_POST["cantidad"], "text");
        $marca = GetSQLValueString($_POST["marca"], "text");
        $modelo = GetSQLValueString($_POST["modelo"], "text");
        $motivo = GetSQLValueString($_POST["motivo"], "text");
        $fecha = GetSQLValueString($_POST["fecha"], "text");
        $depto = "1234";
        $firma = "0000";
        $periodo = "9898";
        $conexion = conectaBDSICLAB();
        $consulta = sprintf("insert into lbpedidos values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)", $periodo, '""', $fecha, $depto, $firma, $responsable, $nombreArticulo, $cantidad, $motivo, $marca, $modelo, '"P"');
        $res = mysql_query($consulta);
        if (mysql_affected_rows() > 0) {
            $respuesta = true;
        }
    } else {
        //salir();
    }
    $arrayJSON = array('respuesta' => $respuesta);
    print json_encode($arrayJSON);
}
Beispiel #5
0
function claveMaestro($clave)
{
    $claveUsuario = $clave;
    $conexion = conectaBDSICLAB();
    $consulta = sprintf("select PERCVE from lbusuarios where claveUsuario = %d", $claveUsuario);
    $res = mysql_query($consulta);
    if ($row = mysql_fetch_array($res)) {
        return (int) $row["PERCVE"];
    } else {
        return 0;
    }
}