public function index()
 {
     $querystring = $_SERVER['REQUEST_URI'];
     $uppercasestring = strtoupper($querystring);
     if (strpos($querystring, '&LIST=') > 1) {
         $listId = substr($querystring, strpos($uppercasestring, '&LIST=') + 6, strlen($uppercasestring));
     } else {
         $listId = substr($querystring, strpos($uppercasestring, '?LIST=') + 6, strlen($uppercasestring));
     }
     if ((int) $listId > 0) {
         $subscribers = Subscriber::getSubscribersInList($this->paginate, $this->orderBy, $listId);
     } else {
         $subscribers = Subscriber::getSubscribers($this->paginate, $this->orderBy);
     }
     $subscribersHtml = Jamesy\Subscribers::getSubscribersHtml($subscribers);
     $orderBy = 1;
     switch ($this->orderBy) {
         case ['id', 'desc']:
             $orderBy = 2;
             break;
         case ['first_name', 'asc']:
             $orderBy = 3;
             break;
         case ['first_name', 'desc']:
             $orderBy = 4;
             break;
         case ['last_name', 'asc']:
             $orderBy = 5;
             break;
         case ['last_name', 'desc']:
             $orderBy = 6;
             break;
         case ['email', 'asc']:
             $orderBy = 7;
             break;
         case ['email', 'desc']:
             $orderBy = 8;
             break;
     }
     return View::make('backend.subscribers.index', ['user' => $this->user, 'isAdmin' => $this->isAdmin, 'configs' => $this->configs, 'subscribersHtml' => $subscribersHtml, 'logged_in_for' => $this->logged_in_for, 'activeParent' => $this->activeParent, 'active' => 'allsubscribers', 'records' => $this->paginate, 'orderBy' => $orderBy, 'links' => $subscribers->links('backend.pagination.nifty')]);
 }
Exemple #2
0
        </label>
    </form>

    <div id="message"></div>

    <table id="subscribers_list" border="1" width="100%">
        <thead>
            <tr>
                <th width="10%">ID</th>
                <th>Email</th>
            </tr>
        </thead>
        <tbody>
        <?php 
$subscriber = new Subscriber();
$list = $subscriber->getSubscribers();
foreach ($list as $value) {
    ?>
            <tr>
                <td><?php 
    echo $value[0];
    ?>
</td>
                <td><?php 
    echo $value[1];
    ?>
</td>
            </tr>
        <?php 
}
?>