$message_body = $array['message_body'];
     $num_of_sms_pages = $array['pages'];
 } elseif ($type == 'email') {
     $senders_name = $array['senders_name'];
     $reply_to = $array['reply_to'];
     $subject = $array['subject'];
     $message_body = $array['message_body'];
 }
 if (isset($array['send'])) {
     isset($array['groups']) ? $r_groups = $array['groups'] : ($r_groups = array());
     isset($array['contacts']) ? $r_contacts = $array['contacts'] : ($r_contacts = array());
     $contacts_ids = array();
     $contacts_ids = array_merge($r_contacts);
     //compile regno's
     foreach ($r_groups as $g) {
         $c = getByCol('messenger_contacts_groups', 'id', $g);
         $contacts_ids = array_merge(explode(',', $c['group_members']));
     }
     //compile contacts
     $q = "select * from users";
     $result = mysqli_query($link, $q);
     $all_contacts = array();
     while ($row = mysqli_fetch_array($result)) {
         $all_contacts[$row['regno']] = array('sms' => $row['phone'], 'email' => $row['email']);
     }
     //pick-out selected contacts
     $required_contacts = array();
     foreach ($contacts_ids as $c) {
         $required_contacts[] = $all_contacts[$c][$type];
     }
     $recipients = implode(',', $required_contacts);
<?php

//Initializing variables with default values
$defaultPage = "index.php?p=1";
$bills = getByCol('messenger_sms_biller', 'user_id', $admin->getAdminID());
?>
<div>
	<h4>MESSENGER: STATUS</h4>
    <table class="table hovered bordered">
      <thead>
          <tr>
              <th class="text-left" style="width:30%">Item</th>
              <th class="text-left">Status</th>
          </tr>
      </thead>
      <tbody>
          <tr>                            
              <td class="text-left">Total SMS Units</td>
              <td class="text-left"><?php 
echo $bills['units_assigned'];
?>
</td>
          </tr>
          <tr>                            
              <td class="text-left">Total SMS Sent</td>
              <td class="text-left"><?php 
echo $bills['units_used'];
?>
</td>
          </tr>
          <tr>                            
Example #3
0
 public function removeFromGroup($group_id, $del_members)
 {
     $row = getByCol('messenger_contacts_groups', 'id', $group_id);
     if (is_array($row) and is_array($del_members)) {
         if (sizeof($del_members) < 1) {
             throw new Exception("No members selected");
         }
         $old_members = explode(',', $row['group_members']);
         $new_members = array();
         foreach ($old_members as $n) {
             if (!in_array($n, $del_members)) {
                 $new_members[] = $n;
             }
         }
         $query = "update messenger_contacts_groups set group_members = '" . implode(',', $new_members) . "', modified = " . time() . " where id=" . $group_id;
         $link = AdminUtility::getDefaultDBConnection();
         $result = mysqli_query($link, $query);
         if ($result) {
             return true;
         }
         //Log error
         AdminUtility::logMySQLError($link);
         return false;
     } else {
         throw new Exception('invalid input for function removeFromGroup(Integer name, String[] new_members)');
     }
 }