Ejemplo n.º 1
0
 public function select()
 {
     $pagination = $this->_config['pagination'];
     $search = $this->_config['search'];
     $whereList = '';
     if (ake('whereList', $this->_config)) {
         $whereList = $this->_config['whereList'];
     }
     $order = !strlen($this->_request->getCrudOrder()) ? $this->_config['defaultOrder'] : $this->_request->getCrudOrder();
     $orderDirection = !strlen($this->_request->getCrudOrderDirection()) ? $this->_config['defaultOrderDirection'] : $this->_request->getCrudOrderDirection();
     $export = !strlen($this->_request->getCrudTypeExport()) ? null : $this->_request->getCrudTypeExport();
     $offset = !strlen($this->_request->getCrudNumPage()) ? 0 : $this->_request->getCrudNumPage() * $this->_config['itemsByPage'];
     $limit = $this->_config['itemsByPage'];
     $where = !strlen($this->_request->getCrudWhere()) ? '' : Project::makeQuery($this->_request->getCrudWhere(), $this->_type);
     $data = Project::query($this->_type, $where, 0, 0, $order, $orderDirection);
     $count = count($data);
     if (true === $pagination) {
         $pageNumber = $offset / $limit < 1 ? 1 : $offset / $limit;
         $paginator = Paginator::make($data, $count, $limit);
         $this->_items = $paginator->getItemsByPage($pageNumber);
         $this->_pagination = Crud::pagination($paginator);
     } else {
         $this->_items = $data;
     }
     if (0 < $count && null !== $export) {
         $method = 'export' . ucfirst(Inflector::lower($export));
         return Crud::$method($data, $this->_em);
     }
     if (true === $search) {
         $this->makeSearch();
     }
     return $this;
 }
Ejemplo n.º 2
0
    echo _SPPATH;
    echo $webClass;
    ?>
/<?php 
    echo $c;
    ?>
?cmd=edit&id=<?php 
    echo $obj->{$main_id};
    ?>
&parent_page=' + window.selected_page, 'fade');
                });
            </script>
        <?php 
}
?>

    </table>
</div>
<div class="row hidden-print">
    <div class="col-md-12">
        <?php 
Crud::pagination($arr, $webClass);
?>
    </div>
</div>
<?php 
/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
    public function bankDiscountModel()
    {
        //create the model object
        $cal = new BankDiscountModel();
        //send the webclass
        $webClass = __CLASS__;
        //run the crud utility
        Crud::run($cal, $webClass);
        ?>
<h1><?php 
        echo Lang::t($webClass);
        ?>
</h1>
<div class="row hidden-print" style="margin-bottom: 10px;">
    <?php 
        if ($obj->crud_setting['search']) {
            Crud::searchBox($arr, $webClass);
        }
        ?>
    <div class="col-md-8 col-xs-12">
        <div class="btn-group">
            <?php 
        if ($obj->crud_setting['viewall']) {
            Crud::viewAll($arr, $webClass);
        }
        ?>
            <?php 
        if ($obj->crud_setting['export']) {
            Crud::exportExcel($arr, $webClass);
        }
        ?>
            <?php 
        if ($obj->crud_setting['import']) {
            Crud::importExcel($arr, $webClass);
        }
        ?>
            <?php 
        if ($obj->crud_setting['add']) {
            Crud::AddButton($arr, $webClass);
        }
        ?>
            <?php 
        if ($obj->crud_setting['toggle']) {
            Crud::filter($arr, $webClass, $t);
        }
        ?>
            <?php 
        if ($obj->crud_setting['webservice']) {
            Crud::listWebService($arr, $webClass);
        }
        ?>
        </div>
    </div>
    <?php 
        if ($obj->crud_setting['toggle']) {
            Crud::filterButton($arr, $webClass, $t);
        }
        ?>
</div>
<div class="table-responsive">
    <table class="table table-bordered table-striped table-hover crud-table" style="background-color: white;">

        <tr>
            <?php 
        if (isset($objs[0])) {
            foreach ($objs[0] as $colom => $isi) {
                if ($colom == "removeAutoCrudClick") {
                    continue;
                }
                ?>
                <th id="sort_<?php 
                echo $colom;
                echo $t;
                ?>
"><?php 
                echo Lang::t($colom);
                ?>
</th>

                <?php 
                Crud::sortBy($arr, $webClass, "sort_" . $colom . $t, $colom);
            }
        }
        ?>
        </tr>

        <?php 
        foreach ($objs as $num => $obj) {
            ?>
            <tr id="<?php 
            echo $c;
            ?>
_<?php 
            echo $obj->{$main_id};
            ?>
">

                <?php 
            foreach ($obj as $colom => $isi) {
                if ($colom == "removeAutoCrudClick") {
                    continue;
                }
                ?>
                    <td id="<?php 
                echo $colom;
                ?>
_<?php 
                echo $obj->{$main_id};
                ?>
">
                        <?php 
                echo stripslashes($isi);
                ?>
                    </td>
                    <?php 
                if (!in_array($colom, $obj->removeAutoCrudClick)) {
                    ?>
                    <script type="text/javascript">
                        $("#<?php 
                    echo $colom;
                    ?>
_<?php 
                    echo $obj->{$main_id};
                    ?>
").click(function () {
                            openLw('<?php 
                    echo $webClass;
                    ?>
View', '<?php 
                    echo _SPPATH;
                    echo $webClass;
                    ?>
/<?php 
                    echo $c;
                    ?>
?cmd=edit&id=<?php 
                    echo $obj->{$main_id};
                    ?>
&parent_page=' + window.selected_page+'&loadagain='+$.now(), 'fade');
                        });
                    </script>
                    <?php 
                }
                ?>
                <?php 
            }
            ?>
            </tr>


        <?php 
        }
        ?>

    </table>
</div>
<div class="row hidden-print">
    <div class="col-md-12">
        <?php 
        Crud::pagination($arr, $webClass);
        ?>
    </div>
</div>
<?php 
        //        pr($mps);
    }