PluginProbe
ShiftController Employee Shift Scheduling / trunk
ShiftController Employee Shift Scheduling vtrunk
4.9.97 4.9.96 4.9.95 4.9.74 4.9.75 4.9.76 4.9.77 4.9.78 4.9.84 4.9.85 4.9.87 4.9.91 4.9.92 trunk 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 3.2.4 All 38 releases
shiftcontroller / sh4 / reminders / sms.php

sms.php in ShiftController Employee Shift Scheduling trunk, at sh4/reminders/sms.php

54 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
2 class SH4_Reminders_Sms
3 {
4 public $self, $settings;
5
6 public function __construct(
7 HC3_Settings $settings,
8 HC3_Hooks $hooks
9 )
10 {
11 $this->settings = $hooks->wrap( $settings );
12 $this->self = $hooks->wrap( $this );
13 }
14
15 public function isEnabled()
16 {
17 $ret = function_exists( 'wp_sms_send' ) ? true : false;
18 return $ret;
19 }
20
21 public function send( $to, $msg )
22 {
23 if( ! is_array($to) ) $to = [ $to ];
24 wp_sms_send( $to, $msg );
25 }
26
27 public function setUserPhone( $userId, $phoneNo )
28 {
29 $pname = 'sms_user_phone_' . $userId;
30 $this->settings->set( $pname, $phoneNo );
31 return $this;
32 }
33
34 public function getUserPhone( $userId )
35 {
36 $pname = 'sms_user_phone_' . $userId;
37 $ret = $this->settings->get( $pname );
38 return $ret;
39 }
40
41 public function setEmployeePhone( $employeeId, $phoneNo )
42 {
43 $pname = 'sms_employee_phone_' . $employeeId;
44 $this->settings->set( $pname, $phoneNo );
45 return $this;
46 }
47
48 public function getEmployeePhone( $employeeId )
49 {
50 $pname = 'sms_employee_phone_' . $employeeId;
51 $ret = $this->settings->get( $pname );
52 return $ret;
53 }
54 }