示例#1
0
echo $obj->idperfil;
?>
" readonly />
                <label for="descripcion" class="labels">Descripcion:</label>
                <input id="descripcion" maxlength="100" name="descripcion" class="text ui-widget-content ui-corner-all" style=" width: 200px; text-align: left;" value="<?php 
echo $obj->descripcion;
?>
" />
                <br>
                <label for="estado" class="labels">Activo:</label>
                <?php 
if ($obj->estado == true || $obj->estado == false) {
    if ($obj->estado == true) {
        $rep = 1;
    } else {
        $rep = 0;
    }
} else {
    $rep = 1;
}
activo('activo', $rep);
?>
                    
                <div  style="clear: both; padding: 10px; width: auto;text-align: center">
                    <a href="#" id="save" class="button">GRABAR</a>
                    <a href="index.php?controller=Perfil" class="button">ATRAS</a>
                </div>
        </div>
    </div>
</form>
</div>
<?php

include 'gestionDB.php';
include 'funciones_comunes.php';
$GLOBALS['activo'] = true;
$query = "\n\t\tSELECT \n\t\t\tID, \n\t\t\tNOMBRE, \n\t\t\tACTIVO\n\t\tFROM\n\t\t\tTIPO_TRABAJO\t\t\n\t";
conectar();
$resultado = ejecutarConsulta($query);
$tabla = "";
while ($linea = mysql_fetch_array($resultado, MYSQL_ASSOC)) {
    $tabla .= "<tr>";
    $tabla .= "<td>" . $linea["NOMBRE"] . "</td>";
    $tabla .= "<td class='activo'>" . activo($linea["ACTIVO"]) . "</td>";
    $tabla .= "<td class='editar'><a class'editar' href='ficha_nueva_clientes.php?nif=" . $linea["ID"] . "&opciones=editar'><img src='/conexionDB/images/doc.png' alt='Editar el contacto'  style='width:32px;height:32px;' /></a></td>";
    $tabla .= "<td class ='borrar'>";
    if ($GLOBALS['activo'] == true) {
        $tabla .= "<a class='borrar'><img class='borrar' src='/conexionDB/images/delete.png' alt='Borrar el contacto'  style='width:32px;height:32px;' /></a>";
    }
    $tabla .= "</td>";
    $tabla .= "</tr>";
}
echo $tabla;
示例#3
0
    ?>
</td>
    <td><?php 
    echo $curso->anio;
    ?>
</td>
    <td><?php 
    echo $curso->alumnos;
    ?>
</td>
    <td><?php 
    echo $curso->materias;
    ?>
</td>
    <td><?php 
    echo activo($curso->activo);
    ?>
</td>
    <td>
      <?php 
    echo link_to('Asignar alumnos', 'asignar/curso/' . $curso->id, array('class' => 'curso'));
    ?>
<br/>
      <?php 
    echo link_to('editar', 'cursos/edit/' . $curso->id);
    ?>
      <?php 
    echo link_to('borrar', 'cursos/destroy/' . $curso->id, array('delete' => $this->session->userdata('token')));
    ?>
    </td>
  </tr>
$consulta = "\n\tSELECT \n\t\tT.ID AS Id_Trabajo, \n\t\tT.NOMBRE AS Nombre_Trabajo, \n\t\tDATE_FORMAT(T.FECHA, '%d/%m/%Y') AS Fecha_Trabajo, \n\t\tT.ACTIVO as Activo_Trabajo,\n\t\tP.NOMBRE AS Proveedor_Trabajo,\n\t\tTT.NOMBRE AS Tipo_Trabajo,\n\t\tT.PRECIO AS Precio_Trabajo\n\tFROM TRABAJOS T \n\t\tLEFT JOIN CLIENTES C ON (T.ID_CLIENTE = C.ID)\n\t\tLEFT JOIN PROVEEDORES P ON (T.ID_PROVEEDOR = P.ID)\n\t\tLEFT JOIN TIPO_TRABAJO TT ON (T.ID_TIPO_TRABAJO = TT.ID)\n\tWHERE\n\t\tC.ID = " . $_GET['id'] . " AND\n\t\tT.ACTIVO = 1 \n\tORDER BY\n\t\tT.ID ASC, T.FECHA ASC";
//echo $consulta;
$result = ejecutarConsulta($consulta);
$tabla = "";
if (mysql_num_rows($result) > 0) {
    while ($rowC = mysql_fetch_array($result, MYSQL_ASSOC)) {
        $rowsC[] = $rowC;
    }
    foreach ($rowsC as $row) {
        $tabla .= "<tr>";
        $tabla .= "<td style='text-align:left' class='nombre'>" . $row["Nombre_Trabajo"] . "</td>";
        $tabla .= "<td style='text-align:left' class='nombre'>" . $row["Proveedor_Trabajo"] . "</td>";
        $tabla .= "<td style='text-align:left'>" . $row["Fecha_Trabajo"] . "</td>";
        $tabla .= "<td style='text-align:left'>" . $row["Tipo_Trabajo"] . "</td>";
        $tabla .= "<td style='text-align:right'>" . number_format($row["Precio_Trabajo"], 2, ",", ".") . "&#8364" . "</td>";
        $tabla .= "<td style='text-align:right'>" . activo($row["Activo_Trabajo"]) . "</td>";
        $tabla .= "<td style='text-align:right'><a class'editar' href='editar_trabajo.php?id=" . $row["Id_Trabajo"] . "&opciones=editar'><img src='images/doc.png' alt='Editar el contacto'  style='width:32px;height:32px;' /></a></td>";
        $tabla .= "<td style='text-align:right'>";
        if ($GLOBALS['activo'] == true) {
            $tabla .= "<a><img class='borrar' src='images/delete.png' alt='Borrar el trabajo'  style='width:32px;height:32px;' /></a>";
        }
        $tabla .= "</td>";
        $tabla .= "</tr>";
    }
    echo $tabla;
} else {
    echo "<span style='color: red; font-weight: bold;'>El cliente actual no tiene trabajos activos</span>";
}
desconectar();
function activo($activo)
{
示例#5
0
    ?>
</td>
    <td><?php 
    echo $alumno->tipo;
    ?>
</td>
    <td><?php 
    echo $alumno->sexo;
    ?>
</td>
    <td><?php 
    echo $alumno->codrude;
    ?>
</td>
    <td><?php 
    echo activo($alumno->activo);
    ?>
</td>

    <td>
      <?php 
    echo link_to('editar', 'alumnos/edit/' . $alumno->id);
    ?>
      <?php 
    echo link_to('borrar', 'alumnos/destroy/' . $alumno->id, array('delete' => $this->session->userdata('token')));
    ?>
    </td>
  </tr>
  <?php 
}
?>
$colorLinea = "";
foreach ($rows as $rowF) {
    if ($rowF['NUM_TRABAJO'] == 0) {
        $colorLinea = "class='rojo'";
    } elseif ($rowF["NUM_TRABAJO"] > 1) {
        $colorLinea = "class='verde'";
    } else {
        $colorLinea = "class='blanco'";
    }
    $tabla .= "<tr " . $colorLinea . ">";
    $tabla .= "<td class='id'>" . $rowF["ID"] . "</td>";
    $tabla .= "<td class='nombre'>" . $rowF["NOMBRE"] . "</td>";
    $tabla .= "<td class = 'direccion'>" . $rowF["DIRECCION"] . "</td>";
    $tabla .= "<td class = 'localidad'>" . $rowF["LOCALIDAD"] . "</td>";
    $tabla .= "<td class='trabajo'>" . $rowF["NUM_TRABAJO"] . "</td>";
    $tabla .= "<td class='activo'>" . activo($rowF["ACTIVO"]) . "</td>";
    $tabla .= "<td class='editar'><a class'editar' href='consultar.php?id=" . $rowF["ID"] . "&opciones=editar'><img src='images/doc.png' alt='Editar el contacto'  style='width:32px;height:32px;' /></a></td>";
    $tabla .= "<td class ='borrar'>";
    if ($GLOBALS['activo'] == true) {
        $tabla .= "<a class='borrar'><img class='borrar' src='images/delete.png' alt='Borrar el contacto'  style='width:32px;height:32px;' /></a>";
    }
    $tabla .= "</td>";
    $tabla .= "</tr>";
}
/*$tabla .= "</tbody>";
	$tabla .= "<tfoot>";
	$tabla .= "<th style='text-align:left; display:none;'>ID</th>";
	$tabla .= "<th class='nombre'>Nombre</th>";
	$tabla .= "<th class = 'direccion'>Direccion</th>";
	$tabla .= "<th class = 'localidad'>Localidad</th>";
	$tabla .= "<th class= 'ctrabajos'>Trabajos</th>";