コード例 #1
0
ファイル: acople.php プロジェクト: phpjava91/mamut_peru
 case 'del':
     $objacople->setVar('id', $_POST['id']);
     echo json_encode($objacople->deleteDB());
     break;
 case 'get':
     $res = $objacople->searchDB($_POST['id'], 'id', 1);
     if (is_array($res)) {
         $res[0]['id_tipo_acople'] = $objtipo_acople->searchDB($res[0]['id_tipo_acople'], 'id', 1);
         $res[0]['id_tipo_acople'] = $res[0]['id_tipo_acople'][0];
         echo json_encode($res[0]);
     } else {
         echo json_encode(0);
     }
     break;
 case 'list':
     $res = $objacople->listDB();
     if (is_array($res)) {
         foreach ($res as &$act) {
             $act['id_tipo_acople'] = $objtipo_acople->searchDB($act['id_tipo_acople'], 'id', 1);
             $act['id_tipo_acople'] = $act['id_tipo_acople'][0];
         }
         echo json_encode($res);
     } else {
         echo json_encode(0);
     }
     break;
 case 'search':
     $res = $objacople->searchDB($_POST['data'], $_POST['value'], $_POST['type']);
     if (is_array($res)) {
         foreach ($res as &$act) {
             $act['id_tipo_acople'] = $objtipo_acople->searchDB($act['id_tipo_acople'], 'id', 1);
コード例 #2
0
ファイル: acople.php プロジェクト: phpjava91/mamut_peru
    <label>Tipo Acople</label>
    <label class='form-control' id='txt_id_tipo_acople'>...</label>
    <p class='help-block'><a href='#modal_id_tipo_acople' data-toggle='modal'>Seleccionar</a></p>
    <input type='hidden' name='id_tipo_acople' id='id_tipo_acople' value=''/>
</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/acople.php';
$obj = new acople();
$objs = $obj->listDB();
include_once 'nucleo/tipo_acople.php';
?>
<div class='contenedor-tabla'>
    <table id='tb' class='display' cellspacing='0' width='100%'>
        <thead>
            <tr>
                <th>Id</th><th>Tipo Acople</th><th>Placa</th>
                <th>OPC</th>
            </tr>
        </thead>
        <tbody>
            <?php 
if (is_array($objs)) {
    foreach ($objs as $o) {
        ?>