public function obtenerElemento($idElemento) { $elemento = ""; if (isset($idElemento)) { $conector = new DatabaseConectorStat(); $conexion = $conector->openConexion(); $query = "SELECT * FROM elemento_control where id={$idElemento}"; $resultado = $conector->executeQueryDefine($query, $conexion); $filas = pg_fetch_all($resultado); $conector->closeConexionDef($conexion); $sizeElement = sizeof($filas); $tipo = $filas[0]["tipo"]; $contenido = $filas[0]["contenido"]; //$referencia=$filas["referencia"]; switch ($tipo) { case 1: $elemento = "<div class='redips-drag blue moved' id='blue' name='blue'></div>"; break; case 2: $elemento = "<div class='white redips-drag moved' id='whitec' name='white'{$num} style='border-style: none; cursor: move;'>{$contenido}</div>"; break; case 3: $elemento = "<div class='yellow redips-drag moved' id='yellow' name='yellow' style='border-style: none; cursor: move;'>{$contenido}</div>"; break; case 4: $elemento = "<div class='redips-drag red moved' id='red' name='red' height='40px' width='40px'>{$contenido}</div>"; break; case 5: $elemento = "<div class='redips-drag birthday moved' id='birthdayc'{$num} name='birthday'{$num} style='border-style: none; cursor: move;'>" . "<img src='../../../static/images/admin/birthday.jpg' alt='' height='40px' width='40px'>" . "</div>"; break; case 6: $elemento = "<div class=' redips-drag food moved' id='foodc'{$num} name='food'{$num} style='border-style: none; cursor: move;'>" . "<img src='../../../static/images/admin/comida.jpg' alt='' height='40px' width='40px'>" . "</div>"; break; default: # code... break; } } return $elemento; }
function checarElemento($elemento, $num) { $result = ""; if (isset($elemento) || !is_null($elemento)) { $conector = new DatabaseConectorStat(); $conexion = $conector->openConexion(); $query = "SELECT * FROM elemento_control where id={$elemento} "; $resultado = $conector->executeQueryDefine($query, $conexion); $filas = pg_fetch_all($resultado); $conector->closeConexionDef($conexion); $tipo = $filas[0]["tipo"]; $contenido = $filas[0]["contenido"]; $referencia = $filas[0]["referencia"]; switch ($tipo) { case 1: $result = "<div class='blue' id='bluec'{$num} name='blue'{$num} style='border-style: none; cursor: move;'>{$contenido}</div>"; break; case 2: $result = "<div class='white' id='whitec'{$num} name='white'{$num} style='border-style: none; cursor: move;'>{$contenido}</div>"; break; case 3: $result = "<div class='yellow' id='yellow'{$num} name='yellow'{$num} style='border-style: none; cursor: move;'>{$contenido}</div>"; break; case 4: $result = "<div class='redips-drag redips-clone red' id='red' name='red' height='40px' width='40px'>{$contenido}</div>"; break; case 5: $result = "<div class='birthday' id='birthdayc'{$num} name='birthday'{$num} style='border-style: none; cursor: move;'>" . "<img src='../../../static/images/admin/birthday.jpg' alt='' height='40px' width='40px'>" . "</div>"; break; case 6: $result = "<div class='food' id='foodc'{$num} name='food'{$num} style='border-style: none; cursor: move;'>" . "<img src='../../../static/images/admin/comida.jpg' alt='' height='40px' width='40px'>" . "</div>"; break; default: break; } return $result; } else { return $result; } }
<?php include "../model/DatabaseConectorStatic.php"; $conector = new DatabaseConectorStat(); $conexion = $conector->openConexion(); $idTecnico = $_REQUEST["id"]; if (isset($idTecnico)) { var_dump($_REQUEST); $planeado = $_REQUEST["planeado"]; $trabajando = $_REQUEST["trabajando"]; //var_dump($id); //var_dump($planeado); //var_dump($trabajando); $query = "UPDATE tablero_control SET h0800=null, h0830=null, h0900=null, h0930=null," . "h1000=null, h1030=null, h1100=null, h1130=null, h1200=null, h1230=null, h1300=null," . "h1330=null, h1400=null, h1430=null, h1500=null, h1530=null, h1600=null, h1630=null," . "h1700=null, h1730=null, h1800=null, h1830=null, h1900=null, h1930=null, h2000=null," . "lavado=null, control_calidad=null, terminado=null, tot=null, partes=null, " . "aut=null WHERE status=1 OR status=2"; $resultado = $conector->executeQueryDefine($query, $conexion); foreach ($planeado as $plan => $value) { if ($value != "-") { $tipoElemento = $value["id"]; $texto = $value["text"]; echo "{$plan} {$tipoElemento} {$texto} \n "; switch ($tipoElemento) { case 'blue': $tipoElemento = 1; break; case "white": $tipoElemento = 2; break; case "yellow": $tipoElemento = 3; break; case "red":