Example #1
0
function viewTable($data, $count)
{
    $offers = new Offers();
    $paginations = new Paginations();
    $paginations->setLimit(10);
    $paginations->setPage($_REQUEST['page']);
    $paginations->setJSCallback("view");
    $paginations->setTotalPages($count);
    $paginations->makePagination();
    ?>
        <div class="mws-panel-header">
            <span class="mws-i-24 i-table-1">View Offers</span>
        </div>
        <table cellpadding="0" cellspacing="0" border="0" class="mws-datatable-fn mws-table">
            <colgroup>
                <col class="con0"/>
                <col class="con1"/>
            </colgroup>
            <thead>
            <tr>
                <th class="head1">Title</th>
                <th class="head0">From Date</th>
                <th class="head0">To Date</th>
                <th class="head0">Status</th>
                <th class="head1">Action</th>
            </tr>
            </thead>
            <tbody>
            <?php 
    if (count($data) > 0) {
        ?>

                <?php 
        for ($i = 0; $i < count($data); $i++) {
            $offers->extractor($data, $i);
            $status = Libs::get("all_status");
            ?>
                    <tr id="row_<?php 
            echo $offers->id();
            ?>
">
                        <td class="con1"><?php 
            echo $offers->title();
            ?>
</td>
                        <td class="con1"><?php 
            echo $offers->fromDate();
            ?>
</td>
                        <td class="con1"><?php 
            echo $offers->toDate();
            ?>
</td>
                        <td class="con0"><?php 
            echo $status[$offers->status()];
            ?>
</td>
                        <td class="center">
                            <a onclick="loadGUIContent('offers','edit','<?php 
            echo $offers->id();
            ?>
')">Edit</a>
                            <a onclick="_delete(<?php 
            echo $offers->id();
            ?>
)" class="toggle">Delete</a>
                            <!--                                <a href="offers.php?id=-->
                            <?php 
            //echo $offers->id();
            ?>
<!--" >Edit</a> | <a href="javascript:;" onclick="_delete(-->
                            <?php 
            //echo $offers->id();
            ?>
<!--)" class="toggle">Delete</a>-->
                        </td>
                    </tr>
                <?php 
        }
        ?>

            <?php 
    }
    ?>
            </tbody>
        </table>

        <?php 
    $paginations->drawPagination();
}