<!DOCTYPE html>
<?php 
// instanciate the smstxt class
include 'class/smstext.class.php';
$smstext = new smstext();
$total = $smstext->countSentSMS();
// declare the variable
$warning = FALSE;
// Save the sms into sentsms table
// send the sms to the recipient
if (isset($_POST['submit-sms'])) {
    // get the field data
    $recipients = trim($_POST['recipient-phone']);
    $message = trim($_POST['smstext']);
    //  send to recipients in the group
    //  get the phone numebrs associated with the groups
    // merge with the phone numbers passed with the groups
    $groups = $smstext->explodePostGetGroups($_POST['recipient-phone']);
    // check if groups reurned sth
    // $sent=array();
    if ($groups) {
        $draft = 0;
        foreach ($groups as $key => $value) {
            $sent = $smstext->sendSms($value, $message);
            // save the data
            $saved = $smstext->create($value, $message, $draft);
        }
        // exit();
    } else {
        // if nothing , give an warning message
        $warning = "No numbers or groups were recognized. Please try again or contact your administrator";
<!DOCTYPE html>
<?php 
include 'class/smstext.class.php';
$smstext = new smstext();
$total_sent = $smstext->countSentSMS();
// total sent SMSs
$total_draft = $smstext->countDraftSMS();
// total SMSs
$data = $smstext->getSentSms();
// return send SMS no drafts
?>
<html>
  <head>
    <title>SMSAPP | Mailbox</title>
    <?php 
include "includes/_metaheader.php";
?>
    <?php 
include "includes/_csslinks.php";
?>
    <!-- DataTables -->
    <link rel="stylesheet" href="plugins/datatables/dataTables.bootstrap.css">
    <!-- fullCalendar 2.2.5-->
    <link rel="stylesheet" href="plugins/fullcalendar/fullcalendar.min.css">
    <link rel="stylesheet" href="plugins/fullcalendar/fullcalendar.print.css" media="print">
    <!-- iCheck -->
    <link rel="stylesheet" href="plugins/iCheck/flat/blue.css">
   
  </head>
  <body class="hold-transition skin-blue sidebar-mini">
    <div class="wrapper">