// This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /* SMS Notifier Block * SMS notifier is a one way SMS messaging block that allows managers, teachers and administrators to * send text messages to their student and teacher. * @package blocks * @author: Azmat Ullah, Talha Noor * @date: 06-Jun-2013 */ $msg = addslashes((string) $_REQUEST['msg']); require_once '../../config.php'; require_once 'sms_form.php'; require_once "lib.php"; $c_id = required_param('c_id', PARAM_INT); $r_id = required_param('r_id', PARAM_INT); $form = new sms_send(); $table = $form->display_report($c_id, $r_id); $a = html_writer::table($table); echo $a . "<input type='hidden' value=\"'{$msg}'\" name='msg' />";
$user = $_GET['user']; if (empty($user)) { echo "You didn't select any user."; } else { $N = count($user); } for ($i = 0; $i <= $N; $i++) { send_sms($user[$i], "SMS sent successfully"); } } } } else { if ($viewpage == 2) { $form = new sms_send(); $form->display(); $table = $form->display_report(); $a = html_writer::table($table); echo "<form action='' method='post' name='tests'><div id='table-change'>" . $a . "</div><input type='submit' style='margin-left:700px;'\n name='submit' id='smssend' value='Send SMS'/><input type='hidden' name='viewpage' id='viewpage' value='{$viewpage}'/></form>"; if (isset($_REQUEST['submit'])) { $msg = $_REQUEST['msg']; // SMS Meassage. $user = $_REQUEST['user']; // User ID. if (empty($user)) { echo "You didn't select any user."; } else { $N = count($user); } global $DB, $CFG; $table = new html_table(); $table->head = array(get_string('serial_no', 'block_sms'), get_string('moodleuser', 'block_sms'), get_string('usernumber', 'block_sms'), get_string('status', 'block_sms'));