<!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->getDraftSms();
// return draft SMSs
?>
<html>
  <head>
    <title>SMSAPP | Drafts</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">

      <!-- header -->
<!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">
<!DOCTYPE html>
<?php 
if (isset($_GET['id'])) {
    $id = $_GET['id'];
    include 'class/smstext.class.php';
    $smstext = new smstext();
    $total = $smstext->countSentSMS();
    $data = $smstext->getSingle($id);
}
?>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>SMSAPP | Read Sms</title>
    <?php 
include "includes/_metaheader.php";
?>
    <?php 
include "includes/_csslinks.php";
?>
    <!-- fullCalendar 2.2.5-->
  <body class="hold-transition skin-blue sidebar-mini">
    <div class="wrapper">

      <!-- header -->
      <?php 
include "includes/_header.php";
?>

      <!-- Left side column. contains the logo and sidebar -->
Example #5
0
<!DOCTYPE html>
<?php 
// echo "string";
include 'class/smstext.class.php';
$smstext = new smstext();
// Get the id given
$draft_id = $_GET['id'];
// delete draft
if (isset($_GET['delete'])) {
    $smstext->delete($_GET['delete']);
    header('Location:draftsms.php?delete=1');
    exit;
}
if (isset($_POST['submit-sms'])) {
    // get the field data
    $recipients = trim($_POST['recipient-phone']);
    $message = trim($_POST['smstext']);
    // $sent = $smstext->sendSms($recipients,$message);
    $sent = 'Success';
    // if there is an error stay on page and show error
    // only if the sms is sent
    // then save the da
    if ($sent == 'Success') {
        //save the data
        $is_draft = 0;
        $saved = $smstext->update($draft_id, $recipients, $message, $is_draft);
        // redirect to inbox and show sucess message
        header("Location: sentsms.php?sent=sucess");
        exit;
        // prevent the est of page from showing accidentaly
    }