示例#1
0
    <select class='form-control' id='tipo' name='tipo' >
        <option value='1'>Administrador</option>
        <option value='2'>Digitador</option>
    </select>
</div>
<div class='control-group'>
    <p></p>
    <button type='button' class='btn btn-primary' onclick='save()'>Guardar</button>
    <button type='reset' class='btn'>Limpiar</button>
</div>
</form>
<hr/>
<?php 
include_once 'nucleo/usuarios.php';
$obj = new usuarios();
$objs = $obj->listDB();
?>
<div class='contenedor-tabla'>
    <table id='tb' class='display' cellspacing='0' width='100%'>
        <thead>
            <tr>
                <th>Id</th>
                <th>Nombres</th>
                <th>Apellidos</th>
                <th>Usuario</th>
                <th>Clave</th>
                <th>Tipo</th>
                <th>OPC</th>
            </tr>
        </thead>
        <tbody>
示例#2
0
         echo json_encode($objusuarios->updateDB());
         break;
     case 'del':
         $objusuarios->setVar('id', $_POST['id']);
         echo json_encode($objusuarios->deleteDB());
         break;
     case 'get':
         $res = $objusuarios->searchDB($_POST['id'], 'id', 1);
         if (is_array($res)) {
             echo json_encode($res[0]);
         } else {
             echo json_encode(0);
         }
         break;
     case 'list':
         $res = $objusuarios->listDB();
         if (is_array($res)) {
             echo json_encode($res);
         } else {
             echo json_encode(0);
         }
         break;
     case 'search':
         $res = $objusuarios->searchDB($_POST['data'], $_POST['value'], $_POST['type']);
         if (is_array($res)) {
             echo json_encode($res);
         } else {
             echo json_encode(0);
         }
         break;
 }