<nav> <?php nav_html(); ?> </nav> <? if ($per[0]['crear']==1) { button_add_modal("#new"); ?> <div id="new" class="modal"> <h4>Ingresar Proveedor</h4> <div class="row"> <form action="?op=insert" method="POST" class="col s12"> <div class="input-field col s3" > <select class='tableInput' name='id_doc' id='id_doc' required> <option value='0' disabled selected>Tipo de Documento</option> <?php foreach ($tipo_doc->findAll() as $td) { ?> <option value='<? echo $td['id']; ?>'><? echo $td['abr']; ?></option> <?php } ?> </select> <label for='id_rol'>Tipo de Documento:</label> </div> <div class="input-field col s9" > <input type="text" name="doc" id='doc' class='validate' required> <label for='doc'>Documento de Identidad:</label> </div> <div class="input-field col s6" > <input type="text" name="nom" id='nom' class='validate' required> <label for='nom'>Nombres:</label>
<input class='btn' type="submit" value="Guardar"> <input class='btn modal-close' type="button" value="Cancelar"> </div> </form> </div> </div> <? } ?> <div class='content'> <h4>Tipo de Documentos</h4> <table class="bordered hoverable"> <th>Tipo Documento</th> <th>Abreviatura</th> <th></th> <? if ($lista=$tipo_doc->findAll()) foreach ($lista as $value) { ?> <tr> <td><input class='tableInput' type='text' name='nom' id='<? echo $value['id']; ?>' value='<? echo $value['nom']; ?>' onchange='javascript:updateField(this.name,this.id,this.value);' <? if ($per[0]['editar']==0) echo "disabled"; ?>></td> <td><input class='tableInput' type='text' name='abr' id='<? echo $value['id']; ?>' value='<? echo $value['abr']; ?>' onchange='javascript:updateField(this.name,this.id,this.value);' <? if ($per[0]['editar']==0) echo "disabled"; ?>></td> <td><?php if ($per[0]['eliminar'] == 1) { echo "<a onclick=\"toast('<span>¿Seguro Desea Borrar Tipo de Documento?</span><a class="btn-flat yellow-text" href="?op=delete&id=" . $value['id'] . "">Confirmar<a>', 5000)\"><i class='large mdi-content-clear'></i></a>"; } ?> </td> </tr> <? } ?> </table>