echo json_encode($objsupervisor->updateDB()); break; case 'del': $objsupervisor->setVar('id', $_POST['id']); echo json_encode($objsupervisor->deleteDB()); break; case 'get': $res = $objsupervisor->searchDB($_POST['id'], 'id', 1); if (is_array($res)) { echo json_encode($res[0]); } else { echo json_encode(0); } break; case 'list': $res = $objsupervisor->listDB(); if (is_array($res)) { echo json_encode($res); } else { echo json_encode(0); } break; case 'search': $res = $objsupervisor->searchDB($_POST['data'], $_POST['value'], $_POST['type']); if (is_array($res)) { echo json_encode($res); } else { echo json_encode(0); } break; }
</div> <div class='control-group'> <label>Dni</label> <input class='form-control' placeholder='Dni' id='dni' name='dni' type="number"/> </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/supervisor.php'; $obj = new supervisor(); $objs = $obj->listDB(); ?> <div class='contenedor-tabla'> <table id='tb' class='display' cellspacing='0' width='100%'> <thead> <tr> <th>Id</th><th>Codigo</th><th>Nombres</th><th>Apellidos</th><th>Dni</th> <th>OPC</th> </tr> </thead> <tbody> <?php if (is_array($objs)) { foreach ($objs as $o) { ?> <tr><td><?php