/**
  * constructor de Link y Ajax javascript
  * requiere obligadamente algunos Atributos como el Nombre del Model actual
  * argumentos : db_table 
  */
 protected function AjaxConstruct($field_html)
 {
     $table_this = substr($this->attributes->NameModel, '4', '-6');
     $uri = new Uri();
     $uri_string = $uri->string();
     $uri_string = str_replace($table_this, $this->args->db_table, $uri_string);
     $uri_string_save = $uri_string;
     $uri_string = explode('/edit/', $uri_string);
     $bl = count($uri_string);
     if (count($uri_string) == 1) {
         $uri_string = explode('/add', $uri_string_save);
     }
     $uri_string_ajax = url::base(FALSE) . $uri_string[0] . '/ajax/' . $this->PkID . '/ajaxfield/' . $this->field_name;
     $uri_string_ajax = str_replace(array("mod/" . $this->args->db_table, 'tbl_' . $this->args->db_table), array("mod/" . $table_this, 'tbl_' . $table_this), $uri_string_ajax);
     $_SESSION['PKID'] = $this->PkID;
     $uri_string = $uri_string[0] . '/add';
     $href = fpp::iconify('Agregar', 'plusthick');
     $props = array("class" => 'AjaxOTO', "id" => 'AjaxTBL_' . $this->field_name, "logme" => $bl, 'refresh_to' => $uri_string_ajax, 'field_name' => $this->field_name);
     $href = html::anchor($uri_string, $href, $props);
     $div = "<div class='AjaxTBL_{$this->field_name} DIVJAX' style='display:none;' ></div>";
     return $div . "<table border=0><tr><td>" . $field_html . '</td><td>' . $href . '</td></tr></table>';
 }
?>
</p>
      </div>
      </div>
      <div class="Filtrar"><?php 
echo form::submit("Filtrar", "Filtrar");
?>
</div>
      <div class="EliminarSel"><?php 
echo form::submit("EliminarSel", "Eliminar Seleccionados");
?>
</div>
    </td>
    <td class="borde" width="30%" valign="top">
      <div class="fpp_extra_options">
		<div class="filterbox"><?php 
echo $filterbox;
?>
</div>
        <?php 
echo $add == FALSE ? '' : html::anchor($base . 'add', fpp::iconify('Agregar', 'plusthick') . ' Agregar Nuevo');
?>
      </div>
      <div><?php 
echo $filters;
?>
</div>
    </td>
  </tr>
</table>
</form>
Beispiel #3
0
<?php 
if ($data != null) {
    foreach ($data as $row) {
        ?>
    <tr>
      <td style="padding-left:5px"><?php 
        echo form::checkbox('check_delete[' . $row->{$first_field} . ']', TRUE);
        ?>
</td>
      <?php 
        foreach ($row as $value) {
            ?>
        <td><?php 
            echo $value;
            ?>
 &nbsp;</td>        
      <?php 
        }
        //Edit
        echo $edit == true ? "<td width='35' align='center'>" . html::anchor($base . 'edit/' . $row->{$first_field}, fpp::iconify('Editar', 'pencil')) . "</td>" : "";
        //Delete
        echo $delete == true ? "<td width='35' align='center'>" . html::anchor($base . 'delete/' . $row->{$first_field}, fpp::iconify('Eliminar', 'trash')) . "</td>" : "";
        //Read
        echo $read == true ? "<td width='35' align='center'>" . html::anchor($base . 'read/' . $row->{$first_field}, fpp::iconify('Ver', 'search')) . "</td>" : "";
        ?>
    </tr>
  <?php 
    }
}
?>
</table>