├── version ├── hooks.php ├── hooks ├── clientadd_admin.php ├── AdminLogin.php ├── ticketopen_admin.php ├── ticketuserreply_admin.php ├── afterregistrarrenewal_admin.php ├── afterregistrarregistration_admin.php ├── afterregistrarrenewalfailed_admin.php ├── afterregistrarregistrationfailed_admin.php ├── ClientLogin_admin.php ├── afterregistrarrenewal.php ├── afterregistrarregistration.php ├── clientadd.php ├── acceptorder.php ├── clientchangepassword.php ├── ticketadminreply.php ├── ticketclose.php ├── afterregistrarregistrationfailed.php ├── invoicepaid.php ├── aftermodulesuspend.php ├── aftermoduleunsuspend.php ├── AfterModuleChangePackage.php ├── invoicecreated.php ├── invoicepaymentreminder_reminder.php ├── aftermodulecreate_hosting.php ├── AfterModuleChangePassword.php ├── invoicepaymentreminder_first.php ├── invoicepaymentreminder_third.php ├── invoicepaymentreminder_second.php └── domainrenewalnotice.php ├── senders ├── ucuzsmsal.php ├── hemenposta.php ├── bytehand.php ├── clickatell.php ├── onetouch.php ├── routesms.php ├── evmaksms.php ├── dakiksms.php ├── msg91.php ├── mutlucell.php ├── birsms.php ├── netgsm.php └── smsgateway.php ├── lang ├── turkish.php ├── russian.php └── english.php ├── README.md ├── smsclass.php └── aktuel_sms.php /version: -------------------------------------------------------------------------------- 1 | 1.1.8 2 | -------------------------------------------------------------------------------- /hooks.php: -------------------------------------------------------------------------------- 1 | getHooks(); 16 | 17 | foreach($hooks as $hook){ 18 | add_hook($hook['hook'], 1, $hook['function'], ""); 19 | } -------------------------------------------------------------------------------- /hooks/clientadd_admin.php: -------------------------------------------------------------------------------- 1 | 'ClientAdd', 4 | 'function' => 'ClientAdd_admin', 5 | 'type' => 'admin', 6 | 'extra' => '', 7 | 'defaultmessage' => 'Sitenize yeni musteri kayit oldu.', 8 | 'variables' => '' 9 | ); 10 | if(!function_exists('ClientAdd_admin')){ 11 | function ClientAdd_admin($args){ 12 | $class = new AktuelSms(); 13 | $template = $class->getTemplateDetails(__FUNCTION__); 14 | if($template['active'] == 0){ 15 | return null; 16 | } 17 | $settings = $class->getSettings(); 18 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 19 | return null; 20 | } 21 | $admingsm = explode(",",$template['admingsm']); 22 | 23 | foreach($admingsm as $gsm){ 24 | if(!empty($gsm)){ 25 | $class->setGsmnumber(trim($gsm)); 26 | $class->setUserid(0); 27 | $class->setMessage($template['template']); 28 | $class->send(); 29 | } 30 | } 31 | } 32 | } 33 | return $hook; -------------------------------------------------------------------------------- /hooks/AdminLogin.php: -------------------------------------------------------------------------------- 1 | 'AdminLogin', 4 | 'function' => 'AdminLogin_admin', 5 | 'type' => 'admin', 6 | 'extra' => '', 7 | 'defaultmessage' => '{username}, Yonetici paneline giris yapti.', 8 | 'variables' => '{username}' 9 | ); 10 | if(!function_exists('AdminLogin_admin')){ 11 | function AdminLogin_admin($args){ 12 | $class = new AktuelSms(); 13 | $template = $class->getTemplateDetails(__FUNCTION__); 14 | if($template['active'] == 0){ 15 | return null; 16 | } 17 | $settings = $class->getSettings(); 18 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 19 | return null; 20 | } 21 | $admingsm = explode(",",$template['admingsm']); 22 | 23 | $template['variables'] = str_replace(" ","",$template['variables']); 24 | $replacefrom = explode(",",$template['variables']); 25 | $replaceto = array($args['username']); 26 | $message = str_replace($replacefrom,$replaceto,$template['template']); 27 | 28 | foreach($admingsm as $gsm){ 29 | if(!empty($gsm)){ 30 | $class->setGsmnumber( trim($gsm)); 31 | $class->setUserid(0); 32 | $class->setMessage($message); 33 | $class->send(); 34 | } 35 | } 36 | } 37 | } 38 | 39 | return $hook; 40 | -------------------------------------------------------------------------------- /hooks/ticketopen_admin.php: -------------------------------------------------------------------------------- 1 | 'TicketOpen', 4 | 'function' => 'TicketOpen_admin', 5 | 'type' => 'admin', 6 | 'extra' => '', 7 | 'defaultmessage' => 'Yeni bir ticket acildi. ({subject})', 8 | 'variables' => '{subject}' 9 | ); 10 | 11 | if(!function_exists('TicketOpen_admin')){ 12 | function TicketOpen_admin($args){ 13 | $class = new AktuelSms(); 14 | $template = $class->getTemplateDetails(__FUNCTION__); 15 | if($template['active'] == 0){ 16 | return null; 17 | } 18 | $settings = $class->getSettings(); 19 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 20 | return null; 21 | } 22 | $admingsm = explode(",",$template['admingsm']); 23 | 24 | $template['variables'] = str_replace(" ","",$template['variables']); 25 | $replacefrom = explode(",",$template['variables']); 26 | $replaceto = array($args['subject']); 27 | $message = str_replace($replacefrom,$replaceto,$template['template']); 28 | 29 | foreach($admingsm as $gsm){ 30 | if(!empty($gsm)){ 31 | $class->setGsmnumber(trim($gsm)); 32 | $class->setUserid(0); 33 | $class->setMessage($message); 34 | $class->send(); 35 | } 36 | } 37 | } 38 | } 39 | 40 | return $hook; 41 | -------------------------------------------------------------------------------- /hooks/ticketuserreply_admin.php: -------------------------------------------------------------------------------- 1 | 'TicketUserReply', 4 | 'function' => 'TicketUserReply_admin', 5 | 'type' => 'admin', 6 | 'extra' => '', 7 | 'defaultmessage' => 'Bir ticket musteri tarafindan guncellendi. ({subject})', 8 | 'variables' => '{subject}' 9 | ); 10 | 11 | if(!function_exists('TicketUserReply_admin')){ 12 | function TicketUserReply_admin($args){ 13 | $class = new AktuelSms(); 14 | $template = $class->getTemplateDetails(__FUNCTION__); 15 | if($template['active'] == 0){ 16 | return null; 17 | } 18 | $settings = $class->getSettings(); 19 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 20 | return null; 21 | } 22 | $admingsm = explode(",",$template['admingsm']); 23 | 24 | $template['variables'] = str_replace(" ","",$template['variables']); 25 | $replacefrom = explode(",",$template['variables']); 26 | $replaceto = array($args['subject']); 27 | $message = str_replace($replacefrom,$replaceto,$template['template']); 28 | 29 | foreach($admingsm as $gsm){ 30 | if(!empty($gsm)){ 31 | $class->setGsmnumber( trim($gsm)); 32 | $class->setUserid(0); 33 | $class->setMessage($message); 34 | $class->send(); 35 | } 36 | } 37 | } 38 | } 39 | 40 | return $hook; 41 | -------------------------------------------------------------------------------- /hooks/afterregistrarrenewal_admin.php: -------------------------------------------------------------------------------- 1 | 'AfterRegistrarRenewal', 4 | 'function' => 'AfterRegistrarRenewal_admin', 5 | 'type' => 'admin', 6 | 'extra' => '', 7 | 'defaultmessage' => 'Domain yenilendi. {domain}', 8 | 'variables' => '{domain}' 9 | ); 10 | if(!function_exists('AfterRegistrarRenewal_admin')){ 11 | function AfterRegistrarRenewal_admin($args){ 12 | $class = new AktuelSms(); 13 | $template = $class->getTemplateDetails(__FUNCTION__); 14 | if($template['active'] == 0){ 15 | return null; 16 | } 17 | $settings = $class->getSettings(); 18 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 19 | return null; 20 | } 21 | $admingsm = explode(",",$template['admingsm']); 22 | 23 | $template['variables'] = str_replace(" ","",$template['variables']); 24 | $replacefrom = explode(",",$template['variables']); 25 | $replaceto = array($args['params']['sld'].".".$args['params']['tld']); 26 | $message = str_replace($replacefrom,$replaceto,$template['template']); 27 | 28 | foreach($admingsm as $gsm){ 29 | if(!empty($gsm)){ 30 | $class->setGsmnumber( trim($gsm)); 31 | $class->setUserid(0); 32 | $class->setMessage($message); 33 | $class->send(); 34 | } 35 | } 36 | } 37 | } 38 | 39 | return $hook; -------------------------------------------------------------------------------- /hooks/afterregistrarregistration_admin.php: -------------------------------------------------------------------------------- 1 | 'AfterRegistrarRegistration', 4 | 'function' => 'AfterRegistrarRegistration_admin', 5 | 'type' => 'admin', 6 | 'extra' => '', 7 | 'defaultmessage' => 'Yeni domain kayit edildi. {domain}', 8 | 'variables' => '{domain}' 9 | ); 10 | if(!function_exists('AfterRegistrarRegistration_admin')){ 11 | function AfterRegistrarRegistration_admin($args){ 12 | $class = new AktuelSms(); 13 | $template = $class->getTemplateDetails(__FUNCTION__); 14 | if($template['active'] == 0){ 15 | return null; 16 | } 17 | $settings = $class->getSettings(); 18 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 19 | return null; 20 | } 21 | $admingsm = explode(",",$template['admingsm']); 22 | 23 | $template['variables'] = str_replace(" ","",$template['variables']); 24 | $replacefrom = explode(",",$template['variables']); 25 | $replaceto = array($args['params']['sld'].".".$args['params']['tld']); 26 | $message = str_replace($replacefrom,$replaceto,$template['template']); 27 | 28 | foreach($admingsm as $gsm){ 29 | if(!empty($gsm)){ 30 | $class->setGsmnumber( trim($gsm)); 31 | $class->setUserid(0); 32 | $class->setMessage($message); 33 | $class->send(); 34 | } 35 | } 36 | } 37 | } 38 | 39 | return $hook; -------------------------------------------------------------------------------- /hooks/afterregistrarrenewalfailed_admin.php: -------------------------------------------------------------------------------- 1 | 'AfterRegistrarRenewalFailed', 4 | 'function' => 'AfterRegistrarRenewalFailed_admin', 5 | 'type' => 'admin', 6 | 'extra' => '', 7 | 'defaultmessage' => 'Domain yenilenirken hata olustu. {domain}', 8 | 'variables' => '{domain}' 9 | ); 10 | if(!function_exists('AfterRegistrarRenewalFailed_admin')){ 11 | function AfterRegistrarRenewalFailed_admin($args){ 12 | $class = new AktuelSms(); 13 | $template = $class->getTemplateDetails(__FUNCTION__); 14 | if($template['active'] == 0){ 15 | return null; 16 | } 17 | $settings = $class->getSettings(); 18 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 19 | return null; 20 | } 21 | $admingsm = explode(",",$template['admingsm']); 22 | 23 | $template['variables'] = str_replace(" ","",$template['variables']); 24 | $replacefrom = explode(",",$template['variables']); 25 | $replaceto = array($args['params']['sld'].".".$args['params']['tld']); 26 | $message = str_replace($replacefrom,$replaceto,$template['template']); 27 | 28 | foreach($admingsm as $gsm){ 29 | if(!empty($gsm)){ 30 | $class->setGsmnumber( trim($gsm)); 31 | $class->setUserid(0); 32 | $class->setMessage($message); 33 | $class->send(); 34 | } 35 | } 36 | } 37 | } 38 | 39 | return $hook; -------------------------------------------------------------------------------- /hooks/afterregistrarregistrationfailed_admin.php: -------------------------------------------------------------------------------- 1 | 'AfterRegistrarRegistrationFailed', 4 | 'function' => 'AfterRegistrarRegistrationFailed_admin', 5 | 'type' => 'admin', 6 | 'extra' => '', 7 | 'defaultmessage' => 'Domain kayit edilirken hata olustu. {domain}', 8 | 'variables' => '{domain}' 9 | ); 10 | if(!function_exists('AfterRegistrarRegistrationFailed_admin')){ 11 | function AfterRegistrarRegistrationFailed_admin($args){ 12 | $class = new AktuelSms(); 13 | $template = $class->getTemplateDetails(__FUNCTION__); 14 | if($template['active'] == 0){ 15 | return null; 16 | } 17 | $settings = $class->getSettings(); 18 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 19 | return null; 20 | } 21 | $admingsm = explode(",",$template['admingsm']); 22 | 23 | $template['variables'] = str_replace(" ","",$template['variables']); 24 | $replacefrom = explode(",",$template['variables']); 25 | $replaceto = array($args['params']['sld'].".".$args['params']['tld']); 26 | $message = str_replace($replacefrom,$replaceto,$template['template']); 27 | 28 | foreach($admingsm as $gsm){ 29 | if(!empty($gsm)){ 30 | $class->setGsmnumber( trim($gsm)); 31 | $class->setUserid(0); 32 | $class->setMessage($message); 33 | $class->send(); 34 | } 35 | } 36 | } 37 | } 38 | 39 | return $hook; 40 | -------------------------------------------------------------------------------- /hooks/ClientLogin_admin.php: -------------------------------------------------------------------------------- 1 | 'ClientLogin', 4 | 'function' => 'ClientLogin_admin', 5 | 'type' => 'admin', 6 | 'extra' => '', 7 | 'defaultmessage' => '({firstname} {lastname}), Siteye giris yapti', 8 | 'variables' => '{firstname},{lastname}' 9 | ); 10 | 11 | if(!function_exists('ClientLogin_admin')){ 12 | function ClientLogin_admin($args){ 13 | $class = new AktuelSms(); 14 | $template = $class->getTemplateDetails(__FUNCTION__); 15 | if($template['active'] == 0){ 16 | return null; 17 | } 18 | $settings = $class->getSettings(); 19 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 20 | return null; 21 | } 22 | $admingsm = explode(",",$template['admingsm']); 23 | 24 | $userSql = "SELECT `a`.`id`,`a`.`firstname`, `a`.`lastname`, `b`.`value` as `gsmnumber` 25 | FROM `tblclients` as `a` 26 | JOIN `tblcustomfieldsvalues` as `b` ON `b`.`relid` = `a`.`id` 27 | JOIN `tblcustomfieldsvalues` as `c` ON `c`.`relid` = `a`.`id` 28 | WHERE `a`.`id` = '".$args['userid']."' 29 | AND `b`.`fieldid` = '".$settings['gsmnumberfield']."' 30 | AND `c`.`fieldid` = '".$settings['wantsmsfield']."' 31 | AND `c`.`value` = 'on' 32 | LIMIT 1"; 33 | $result = mysql_query($userSql); 34 | $num_rows = mysql_num_rows($result); 35 | 36 | if($num_rows == 1){ 37 | $UserInformation = mysql_fetch_assoc($result); 38 | 39 | $template['variables'] = str_replace(" ","",$template['variables']); 40 | $replacefrom = explode(",",$template['variables']); 41 | $replaceto = array($UserInformation['firstname'],$UserInformation['lastname']); 42 | $message = str_replace($replacefrom,$replaceto,$template['template']); 43 | 44 | foreach($admingsm as $gsm){ 45 | if(!empty($gsm)){ 46 | $class->setGsmnumber( trim($gsm)); 47 | $class->setUserid(0); 48 | $class->setMessage($message); 49 | } $class->send(); 50 | } 51 | } 52 | } 53 | } 54 | 55 | return $hook; 56 | -------------------------------------------------------------------------------- /hooks/afterregistrarrenewal.php: -------------------------------------------------------------------------------- 1 | 'AfterRegistrarRenewal', 4 | 'function' => 'AfterRegistrarRenewal', 5 | 'description' => array( 6 | 'turkish' => 'Domain yenilendikten sonra mesaj gönderir', 7 | 'english' => 'After domain renewal' 8 | ), 9 | 'type' => 'client', 10 | 'extra' => '', 11 | 'defaultmessage' => 'Sayin {firstname} {lastname}, alan adiniz basariyla yenilendi. ({domain})', 12 | 'variables' => '{firstname},{lastname},{domain}' 13 | ); 14 | if(!function_exists('AfterRegistrarRenewal')){ 15 | function AfterRegistrarRenewal($args){ 16 | $class = new AktuelSms(); 17 | $template = $class->getTemplateDetails(__FUNCTION__); 18 | if($template['active'] == 0){ 19 | return null; 20 | } 21 | $settings = $class->getSettings(); 22 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 23 | return null; 24 | } 25 | 26 | $userSql = "SELECT `a`.`id`,`a`.`firstname`, `a`.`lastname`, `b`.`value` as `gsmnumber` 27 | FROM `tblclients` as `a` 28 | JOIN `tblcustomfieldsvalues` as `b` ON `b`.`relid` = `a`.`id` 29 | JOIN `tblcustomfieldsvalues` as `c` ON `c`.`relid` = `a`.`id` 30 | WHERE `a`.`id` = '".$args['params']['userid']."' 31 | AND `b`.`fieldid` = '".$settings['gsmnumberfield']."' 32 | AND `c`.`fieldid` = '".$settings['wantsmsfield']."' 33 | AND `c`.`value` = 'on' 34 | LIMIT 1"; 35 | $result = mysql_query($userSql); 36 | $num_rows = mysql_num_rows($result); 37 | if($num_rows == 1){ 38 | $UserInformation = mysql_fetch_assoc($result); 39 | 40 | $template['variables'] = str_replace(" ","",$template['variables']); 41 | $replacefrom = explode(",",$template['variables']); 42 | $replaceto = array($UserInformation['firstname'],$UserInformation['lastname'],$args['params']['sld'].".".$args['params']['tld']); 43 | $message = str_replace($replacefrom,$replaceto,$template['template']); 44 | 45 | $class->setGsmnumber($UserInformation['gsmnumber']); 46 | $class->setUserid($args['params']['userid']); 47 | $class->setMessage($message); 48 | $class->send(); 49 | } 50 | 51 | } 52 | } 53 | 54 | return $hook; -------------------------------------------------------------------------------- /hooks/afterregistrarregistration.php: -------------------------------------------------------------------------------- 1 | 'AfterRegistrarRegistration', 4 | 'function' => 'AfterRegistrarRegistration', 5 | 'description' => array( 6 | 'turkish' => 'Bir domain kayıt edildikten sonra mesaj gönderir', 7 | 'english' => 'After domain registration' 8 | ), 9 | 'type' => 'client', 10 | 'extra' => '', 11 | 'defaultmessage' => 'Sayin {firstname} {lastname}, alan adiniz basariyla kayit edildi. ({domain})', 12 | 'variables' => '{firstname},{lastname},{domain}' 13 | ); 14 | if(!function_exists('AfterRegistrarRegistration')){ 15 | function AfterRegistrarRegistration($args){ 16 | $class = new AktuelSms(); 17 | $template = $class->getTemplateDetails(__FUNCTION__); 18 | if($template['active'] == 0){ 19 | return null; 20 | } 21 | $settings = $class->getSettings(); 22 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 23 | return null; 24 | } 25 | 26 | $userSql = "SELECT `a`.`id`,`a`.`firstname`, `a`.`lastname`, `b`.`value` as `gsmnumber` 27 | FROM `tblclients` as `a` 28 | JOIN `tblcustomfieldsvalues` as `b` ON `b`.`relid` = `a`.`id` 29 | JOIN `tblcustomfieldsvalues` as `c` ON `c`.`relid` = `a`.`id` 30 | WHERE `a`.`id` = '".$args['params']['userid']."' 31 | AND `b`.`fieldid` = '".$settings['gsmnumberfield']."' 32 | AND `c`.`fieldid` = '".$settings['wantsmsfield']."' 33 | AND `c`.`value` = 'on' 34 | LIMIT 1"; 35 | $result = mysql_query($userSql); 36 | $num_rows = mysql_num_rows($result); 37 | if($num_rows == 1){ 38 | $UserInformation = mysql_fetch_assoc($result); 39 | 40 | $template['variables'] = str_replace(" ","",$template['variables']); 41 | $replacefrom = explode(",",$template['variables']); 42 | $replaceto = array($UserInformation['firstname'],$UserInformation['lastname'],$args['params']['sld'].".".$args['params']['tld']); 43 | $message = str_replace($replacefrom,$replaceto,$template['template']); 44 | 45 | $class->setGsmnumber($UserInformation['gsmnumber']); 46 | $class->setUserid($args['params']['userid']); 47 | $class->setMessage($message); 48 | $class->send(); 49 | } 50 | 51 | } 52 | } 53 | 54 | return $hook; -------------------------------------------------------------------------------- /hooks/clientadd.php: -------------------------------------------------------------------------------- 1 | 'ClientAdd', 4 | 'function' => 'ClientAdd', 5 | 'description' => array( 6 | 'turkish' => 'Müşteri kayıt olduktan sonra mesaj gönderir', 7 | 'english' => 'After client register' 8 | ), 9 | 'type' => 'client', 10 | 'extra' => '', 11 | 'defaultmessage' => 'Sayin {firstname} {lastname}, AktuelHost a kayit oldugunuz icin tesekkur ederiz. Email: {email} Sifre: {password}', 12 | 'variables' => '{firstname},{lastname},{email},{password}' 13 | ); 14 | if(!function_exists('ClientAdd')){ 15 | function ClientAdd($args){ 16 | $class = new AktuelSms(); 17 | $template = $class->getTemplateDetails(__FUNCTION__); 18 | if($template['active'] == 0){ 19 | return null; 20 | } 21 | $settings = $class->getSettings(); 22 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 23 | return null; 24 | } 25 | 26 | $userSql = "SELECT `a`.`id`,`a`.`firstname`, `a`.`lastname`, `b`.`value` as `gsmnumber` 27 | FROM `tblclients` as `a` 28 | JOIN `tblcustomfieldsvalues` as `b` ON `b`.`relid` = `a`.`id` 29 | JOIN `tblcustomfieldsvalues` as `c` ON `c`.`relid` = `a`.`id` 30 | WHERE `a`.`id` = '".$args['userid']."' 31 | AND `b`.`fieldid` = '".$settings['gsmnumberfield']."' 32 | AND `c`.`fieldid` = '".$settings['wantsmsfield']."' 33 | AND `c`.`value` = 'on' 34 | LIMIT 1"; 35 | $result = mysql_query($userSql); 36 | $num_rows = mysql_num_rows($result); 37 | 38 | if($num_rows == 1){ 39 | $UserInformation = mysql_fetch_assoc($result); 40 | 41 | $template['variables'] = str_replace(" ","",$template['variables']); 42 | $replacefrom = explode(",",$template['variables']); 43 | $replaceto = array($UserInformation['firstname'],$UserInformation['lastname'],$args['email'],$args['password']); 44 | $message = str_replace($replacefrom,$replaceto,$template['template']); 45 | 46 | $class->setGsmnumber($UserInformation['gsmnumber']); 47 | $class->setMessage($message); 48 | $class->setUserid($args['userid']); 49 | $class->send(); 50 | } 51 | } 52 | } 53 | 54 | return $hook; -------------------------------------------------------------------------------- /senders/ucuzsmsal.php: -------------------------------------------------------------------------------- 1 | message = $this->utilmessage($message); 6 | $this->gsmnumber = $this->utilgsmnumber($gsmnumber); 7 | } 8 | 9 | function send(){ 10 | if($this->gsmnumber == "numbererror"){ 11 | $log[] = ("Number format error.".$this->gsmnumber); 12 | $error[] = ("Number format error.".$this->gsmnumber); 13 | return null; 14 | } 15 | $params = json_decode($this->params); 16 | 17 | $url = "http://www.ucuzsmsal.com/api/index.php?act=sendsms&user=".$params->user."&pass=".$params->pass."&orgin=".$params->senderid."&message=".urlencode($this->message)."&numbers=$this->gsmnumber"; 18 | 19 | $result = file_get_contents($url); 20 | $return = $result; 21 | $log[] = ("Sunucudan dönen cevap: ".$result); 22 | 23 | $result = explode("|",$result); 24 | if($result[0]=="OK"){ 25 | $log[] = ("Message sent."); 26 | }else{ 27 | $log[] = ("Mesaj gönderilemedi. Hata: $return"); 28 | $error[] = ("Mesaj gönderilirken hata oluştu. Hata: $return"); 29 | } 30 | 31 | return array( 32 | 'log' => $log, 33 | 'error' => $error, 34 | 'msgid' => $result[1], 35 | ); 36 | } 37 | function balance(){ 38 | return null; 39 | } 40 | function report($msgid){ 41 | return null; 42 | } 43 | 44 | //You can spesifically convert your gsm number. See netgsm for example 45 | function utilgsmnumber($number){ 46 | if (strlen($number) == 10) { 47 | 48 | } elseif (strlen($number) == 11) { 49 | $number = substr($number,1,strlen($number)); 50 | } elseif (strlen($number) == 12) { 51 | $number = substr($number,2,strlen($number)); 52 | } 53 | 54 | if (substr($number, 0, 1) != "5") { 55 | return "numbererror"; 56 | } 57 | return $number; 58 | } 59 | 60 | //You can spesifically convert your message 61 | function utilmessage($message){ 62 | return $message; 63 | } 64 | } 65 | 66 | return array( 67 | 'value' => 'ucuzsmsal', 68 | 'label' => 'Ucuz Sms Al', 69 | 'fields' => array( 70 | 'user','pass' 71 | ) 72 | ); -------------------------------------------------------------------------------- /hooks/acceptorder.php: -------------------------------------------------------------------------------- 1 | 'AcceptOrder', 4 | 'function' => 'AcceptOrder_SMS', 5 | 'description' => array( 6 | 'turkish' => 'Sipariş onaylandığında mesaj gönderir', 7 | 'english' => 'After order accepted' 8 | ), 9 | 'type' => 'client', 10 | 'extra' => '', 11 | 'defaultmessage' => 'Sayin {firstname} {lastname}, {orderid} numarali siparisiniz onaylanmistir. ', 12 | 'variables' => '{firstname},{lastname},{orderid}' 13 | ); 14 | if(!function_exists('AcceptOrder_SMS')){ 15 | function AcceptOrder_SMS($args){ 16 | 17 | $class = new AktuelSms(); 18 | $template = $class->getTemplateDetails(__FUNCTION__); 19 | if($template['active'] == 0){ 20 | return null; 21 | } 22 | $settings = $class->getSettings(); 23 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 24 | return null; 25 | } 26 | 27 | $userSql = "SELECT `a`.`id`,`a`.`firstname`, `a`.`lastname`, `b`.`value` as `gsmnumber` 28 | FROM `tblclients` as `a` 29 | JOIN `tblcustomfieldsvalues` as `b` ON `b`.`relid` = `a`.`id` 30 | JOIN `tblcustomfieldsvalues` as `c` ON `c`.`relid` = `a`.`id` 31 | WHERE `a`.`id` IN (SELECT userid FROM tblorders WHERE id = '".$args['orderid']."') 32 | AND `b`.`fieldid` = '".$settings['gsmnumberfield']."' 33 | AND `c`.`fieldid` = '".$settings['wantsmsfield']."' 34 | AND `c`.`value` = 'on' 35 | LIMIT 1"; 36 | 37 | $result = mysql_query($userSql); 38 | $num_rows = mysql_num_rows($result); 39 | if($num_rows == 1){ 40 | $UserInformation = mysql_fetch_assoc($result); 41 | 42 | $template['variables'] = str_replace(" ","",$template['variables']); 43 | $replacefrom = explode(",",$template['variables']); 44 | $replaceto = array($UserInformation['firstname'],$UserInformation['lastname'],$args['orderid']); 45 | $message = str_replace($replacefrom,$replaceto,$template['template']); 46 | 47 | 48 | $class->setGsmnumber($UserInformation['gsmnumber']); 49 | $class->setUserid($UserInformation['id']); 50 | $class->setMessage($message); 51 | $class->send(); 52 | } 53 | } 54 | } 55 | 56 | return $hook; -------------------------------------------------------------------------------- /hooks/clientchangepassword.php: -------------------------------------------------------------------------------- 1 | 'ClientChangePassword', 4 | 'function' => 'ClientChangePassword', 5 | 'description' => array( 6 | 'turkish' => 'Müşteri şifresini değiştirdiğinde mesaj gönderir', 7 | 'english' => 'After client change password' 8 | ), 9 | 'type' => 'client', 10 | 'extra' => '', 11 | 'variables' => '{firstname},{lastname}', 12 | 'defaultmessage' => 'Sayin {firstname} {lastname}, sifreniz degistirildi. Eger bu islemi siz yapmadiysaniz lutfen bizimle iletisime gecin.', 13 | ); 14 | 15 | if(!function_exists('ClientChangePassword')){ 16 | function ClientChangePassword($args){ 17 | $class = new AktuelSms(); 18 | $template = $class->getTemplateDetails(__FUNCTION__); 19 | if($template['active'] == 0){ 20 | return null; 21 | } 22 | $settings = $class->getSettings(); 23 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 24 | return null; 25 | } 26 | 27 | $userSql = "SELECT `a`.`id`,`a`.`firstname`, `a`.`lastname`, `b`.`value` as `gsmnumber` 28 | FROM `tblclients` as `a` 29 | JOIN `tblcustomfieldsvalues` as `b` ON `b`.`relid` = `a`.`id` 30 | JOIN `tblcustomfieldsvalues` as `c` ON `c`.`relid` = `a`.`id` 31 | WHERE `a`.`id` = '".$args['userid']."' 32 | AND `b`.`fieldid` = '".$settings['gsmnumberfield']."' 33 | AND `c`.`fieldid` = '".$settings['wantsmsfield']."' 34 | AND `c`.`value` = 'on' 35 | LIMIT 1"; 36 | $result = mysql_query($userSql); 37 | $num_rows = mysql_num_rows($result); 38 | if($num_rows == 1){ 39 | $UserInformation = mysql_fetch_assoc($result); 40 | $template['variables'] = str_replace(" ","",$template['variables']); 41 | $replacefrom = explode(",",$template['variables']); 42 | $replaceto = array($UserInformation['firstname'],$UserInformation['lastname']); 43 | $message = str_replace($replacefrom,$replaceto,$template['template']); 44 | 45 | $class->setGsmnumber($UserInformation['gsmnumber']); 46 | $class->setUserid($UserInformation['id']); 47 | $class->setMessage($message); 48 | $class->send(); 49 | } 50 | } 51 | } 52 | 53 | return $hook; -------------------------------------------------------------------------------- /hooks/ticketadminreply.php: -------------------------------------------------------------------------------- 1 | 'TicketAdminReply', 4 | 'function' => 'TicketAdminReply', 5 | 'description' => array( 6 | 'turkish' => 'Bir ticket güncellendiğinde mesaj gönderir', 7 | 'english' => 'After ticket replied by admin' 8 | ), 9 | 'type' => 'client', 10 | 'extra' => '', 11 | 'variables' => '{firstname},{lastname},{ticketsubject}', 12 | 'defaultmessage' => 'Sayin {firstname} {lastname}, ({ticketsubject}) konu baslikli destek talebiniz yanitlandi.', 13 | ); 14 | 15 | if(!function_exists('TicketAdminReply')){ 16 | function TicketAdminReply($args){ 17 | $class = new AktuelSms(); 18 | $template = $class->getTemplateDetails(__FUNCTION__); 19 | 20 | if($template['active'] == 0){ 21 | return null; 22 | } 23 | $settings = $class->getSettings(); 24 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 25 | return null; 26 | } 27 | 28 | $userSql = "SELECT `a`.`id`,`a`.`firstname`, `a`.`lastname`, `b`.`value` as `gsmnumber` 29 | FROM `tblclients` as `a` 30 | JOIN `tblcustomfieldsvalues` as `b` ON `b`.`relid` = `a`.`id` 31 | JOIN `tblcustomfieldsvalues` as `c` ON `c`.`relid` = `a`.`id` 32 | WHERE `a`.`id` IN (SELECT userid FROM tbltickets WHERE id = '".$args['ticketid']."') 33 | AND `b`.`fieldid` = '".$settings['gsmnumberfield']."' 34 | AND `c`.`fieldid` = '".$settings['wantsmsfield']."' 35 | AND `c`.`value` = 'on' 36 | LIMIT 1"; 37 | $result = mysql_query($userSql); 38 | $num_rows = mysql_num_rows($result); 39 | if($num_rows == 1){ 40 | $UserInformation = mysql_fetch_assoc($result); 41 | $template['variables'] = str_replace(" ","",$template['variables']); 42 | $replacefrom = explode(",",$template['variables']); 43 | $replaceto = array($UserInformation['firstname'],$UserInformation['lastname'],$args['subject']); 44 | $message = str_replace($replacefrom,$replaceto,$template['template']); 45 | $class->setGsmnumber($UserInformation['gsmnumber']); 46 | $class->setMessage($message); 47 | $class->setUserid($UserInformation['id']); 48 | $class->send(); 49 | } 50 | } 51 | } 52 | 53 | return $hook; 54 | -------------------------------------------------------------------------------- /hooks/ticketclose.php: -------------------------------------------------------------------------------- 1 | 'TicketClose', 4 | 'function' => 'TicketClose', 5 | 'description' => array( 6 | 'turkish' => 'Ticket kapatıldığında mesaj gönderir.', 7 | 'english' => 'When the ticket is closed it sends a message.' 8 | ), 9 | 'type' => 'client', 10 | 'extra' => '', 11 | 'defaultmessage' => 'Sayin {firstname} {lastname}, ({ticketno}) numarali ticket kapatilmistir.', 12 | 'variables' => '{firstname}, {lastname}, {ticketno}', 13 | ); 14 | 15 | if(!function_exists('TicketClose')){ 16 | function TicketClose($args){ 17 | $class = new AktuelSms(); 18 | $template = $class->getTemplateDetails(__FUNCTION__); 19 | 20 | if($template['active'] == 0){ 21 | return null; 22 | } 23 | $settings = $class->getSettings(); 24 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 25 | return null; 26 | } 27 | 28 | $userSql = " 29 | SELECT a.tid,b.id as userid,b.firstname,b.lastname,`c`.`value` as `gsmnumber` FROM `tbltickets` as `a` 30 | JOIN tblclients as b ON b.id = a.userid 31 | JOIN `tblcustomfieldsvalues` as `c` ON `c`.`relid` = `a`.`userid` 32 | JOIN `tblcustomfieldsvalues` as `d` ON `d`.`relid` = `a`.`userid` 33 | WHERE a.id = '".$args['ticketid']."' 34 | AND `c`.`fieldid` = '".$settings['gsmnumberfield']."' 35 | AND `d`.`fieldid` = '".$settings['wantsmsfield']."' 36 | AND `d`.`value` = 'on' 37 | LIMIT 1 38 | "; 39 | 40 | $result = mysql_query($userSql); 41 | $num_rows = mysql_num_rows($result); 42 | if($num_rows == 1){ 43 | $UserInformation = mysql_fetch_assoc($result); 44 | $template['variables'] = str_replace(" ","",$template['variables']); 45 | $replacefrom = explode(",",$template['variables']); 46 | $replaceto = array($UserInformation['firstname'],$UserInformation['lastname'],$UserInformation['tid']); 47 | $message = str_replace($replacefrom,$replaceto,$template['template']); 48 | $class->setGsmnumber($UserInformation['gsmnumber']); 49 | $class->setMessage($message); 50 | $class->setUserid($UserInformation['userid']); 51 | $class->send(); 52 | } 53 | } 54 | } 55 | 56 | return $hook; 57 | -------------------------------------------------------------------------------- /lang/turkish.php: -------------------------------------------------------------------------------- 1 | Github sayfamızdan indirebilirsiniz.

Lütfen dosyaları güncelledikten sonra bu sayfaya tekrar bakın.

"; 5 | $_ADDONLANG['uptodate'] = "Kullandığınız eklenti günceldir."; 6 | $_ADDONLANG['apiid'] = "API ID"; 7 | $_ADDONLANG['save'] = "Kaydet"; 8 | $_ADDONLANG['gsmnumberfield'] = "GSM Numara Alanı"; 9 | $_ADDONLANG['wantsmsfield'] = "SMS İsteği"; 10 | $_ADDONLANG['pass'] = "Şifre"; 11 | $_ADDONLANG['user'] = "Kullanıcı Adı"; 12 | $_ADDONLANG['senderid'] = "Başlık"; 13 | $_ADDONLANG['dateformat'] = "Tarih Formatı"; 14 | $_ADDONLANG['sender'] = "Gönderici"; 15 | $_ADDONLANG['settings'] = "Ayarlar"; 16 | $_ADDONLANG['signature'] = "Mesaj imzası"; 17 | $_ADDONLANG['clientsmstemplates'] = "Müşteri Hazır SMS leri"; 18 | $_ADDONLANG['adminsmstemplates'] = "Admin Hazır SMS leri"; 19 | $_ADDONLANG['sendsms'] = "Tek SMS Gönder"; 20 | $_ADDONLANG['messages'] = "Gönderilmiş SMS ler"; 21 | $_ADDONLANG['update'] = "Güncelle"; 22 | $_ADDONLANG['smssent'] = "

SMS Gönderildi"; 23 | $_ADDONLANG['client'] = "Müşteri"; 24 | $_ADDONLANG['selectclient'] = "Müşteri Seç"; 25 | $_ADDONLANG['message'] = "Mesaj"; 26 | $_ADDONLANG['debug'] = "Log Bilgilerini Yazdır"; 27 | $_ADDONLANG['send'] = "Gönder"; 28 | $_ADDONLANG['debugsonuc'] = "Sonuç"; 29 | $_ADDONLANG['gsmnumber'] = "GSM No"; 30 | $_ADDONLANG['datetime'] = "Tarih Saat"; 31 | $_ADDONLANG['status'] = "Durum"; 32 | $_ADDONLANG['delete'] = "Mesajı Sil"; 33 | $_ADDONLANG['parameter'] = "Parametre:"; 34 | $_ADDONLANG['active'] = "Aktifleştir"; 35 | $_ADDONLANG['ekstra'] = "Ekstra {x}"; 36 | $_ADDONLANG['admingsm'] = "Admin GSM Numaraları"; 37 | $_ADDONLANG['admingsmornek'] = "Telefon numaralarının arasına virgül koyun Örn. 5321232525,5331002020"; 38 | $_ADDONLANG['lisans'] = "Plugin by Aktüel Sistem ve Bilgi Teknolojileri"; 39 | $_ADDONLANG['credit'] = "Kalan bakiyeniz"; 40 | 41 | $_ADDONLANG['error'] = "Hata"; 42 | $_ADDONLANG['success'] = "Başarılı"; 43 | 44 | $_ADDONLANG['authkey'] = "Doğrulama Anahtarı"; 45 | $_ADDONLANG['route'] = "SMS Teslimat Güzergahı (e.g: 4)"; 46 | $_ADDONLANG['flash'] = "Flash SMS (Yes=1/No=0)"; 47 | $_ADDONLANG['unicode'] = "Unicode SMS (Yes=1/No=0)"; 48 | $_ADDONLANG['ignoreNdnc'] = "NDNC Numaraları görmezden? (Yes=1/No=0)"; -------------------------------------------------------------------------------- /hooks/afterregistrarregistrationfailed.php: -------------------------------------------------------------------------------- 1 | 'AfterRegistrarRegistrationFailed', 4 | 'function' => 'AfterRegistrarRegistrationFailed', 5 | 'description' => array( 6 | 'turkish' => 'Domain kayıt edilirken hata oluşursa mesaj gönderilir', 7 | 'english' => 'After domain registration failed' 8 | ), 9 | 'type' => 'client', 10 | 'extra' => '', 11 | 'defaultmessage' => 'Sayin {firstname} {lastname}, alan adiniz kayit edilemedi. En kisa surede lutfen bizimle iletisime gecin ({domain})', 12 | 'variables' => '{firstname},{lastname},{domain}' 13 | ); 14 | if(!function_exists('AfterRegistrarRegistrationFailed')){ 15 | function AfterRegistrarRegistrationFailed($args){ 16 | $class = new AktuelSms(); 17 | $template = $class->getTemplateDetails(__FUNCTION__); 18 | if($template['active'] == 0){ 19 | return null; 20 | } 21 | $settings = $class->getSettings(); 22 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 23 | return null; 24 | } 25 | 26 | $userSql = "SELECT `a`.`id`,`a`.`firstname`, `a`.`lastname`, `b`.`value` as `gsmnumber` 27 | FROM `tblclients` as `a` 28 | JOIN `tblcustomfieldsvalues` as `b` ON `b`.`relid` = `a`.`id` 29 | JOIN `tblcustomfieldsvalues` as `c` ON `c`.`relid` = `a`.`id` 30 | WHERE `a`.`id` = '".$args['params']['userid']."' 31 | AND `b`.`fieldid` = '".$settings['gsmnumberfield']."' 32 | AND `c`.`fieldid` = '".$settings['wantsmsfield']."' 33 | AND `c`.`value` = 'on' 34 | LIMIT 1"; 35 | $result = mysql_query($userSql); 36 | $num_rows = mysql_num_rows($result); 37 | if($num_rows == 1){ 38 | $UserInformation = mysql_fetch_assoc($result); 39 | 40 | $template['variables'] = str_replace(" ","",$template['variables']); 41 | $replacefrom = explode(",",$template['variables']); 42 | $replaceto = array($UserInformation['firstname'],$UserInformation['lastname'],$args['params']['sld'].".".$args['params']['tld']); 43 | $message = str_replace($replacefrom,$replaceto,$template['template']); 44 | 45 | $class->setGsmnumber($UserInformation['gsmnumber']); 46 | $class->setUserid($args['params']['userid']); 47 | $class->setMessage($message); 48 | $class->send(); 49 | } 50 | } 51 | } 52 | 53 | return $hook; 54 | -------------------------------------------------------------------------------- /hooks/invoicepaid.php: -------------------------------------------------------------------------------- 1 | 'InvoicePaid', 4 | 'function' => 'InvoicePaid', 5 | 'description' => array( 6 | 'turkish' => 'Faturanız ödendiğinde mesaj gönderir', 7 | 'english' => 'Whenyou have paidthe billsends a message.' 8 | ), 9 | 'type' => 'client', 10 | 'extra' => '', 11 | 'defaultmessage' => 'Sayin {firstname} {lastname}, {duedate} son odeme tarihli faturaniz odenmistir. Odeme icin tesekkur ederiz.', 12 | 'variables' => '{firstname}, {lastname}, {duedate},{invoiceid}' 13 | ); 14 | if(!function_exists('InvoicePaid')){ 15 | function InvoicePaid($args){ 16 | 17 | $class = new AktuelSms(); 18 | $template = $class->getTemplateDetails(__FUNCTION__); 19 | if($template['active'] == 0){ 20 | return null; 21 | } 22 | $settings = $class->getSettings(); 23 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 24 | return null; 25 | } 26 | 27 | $userSql = " 28 | SELECT a.duedate,b.id as userid,b.firstname,b.lastname,`c`.`value` as `gsmnumber` FROM `tblinvoices` as `a` 29 | JOIN tblclients as b ON b.id = a.userid 30 | JOIN `tblcustomfieldsvalues` as `c` ON `c`.`relid` = `a`.`userid` 31 | JOIN `tblcustomfieldsvalues` as `d` ON `d`.`relid` = `a`.`userid` 32 | WHERE a.id = '".$args['invoiceid']."' 33 | AND `c`.`fieldid` = '".$settings['gsmnumberfield']."' 34 | AND `d`.`fieldid` = '".$settings['wantsmsfield']."' 35 | AND `d`.`value` = 'on' 36 | LIMIT 1 37 | "; 38 | 39 | $result = mysql_query($userSql); 40 | $num_rows = mysql_num_rows($result); 41 | if($num_rows == 1){ 42 | $UserInformation = mysql_fetch_assoc($result); 43 | 44 | $template['variables'] = str_replace(" ","",$template['variables']); 45 | $replacefrom = explode(",",$template['variables']); 46 | $replaceto = array($UserInformation['firstname'],$UserInformation['lastname'],$class->changeDateFormat($UserInformation['duedate']),$args['invoiceid']); 47 | $message = str_replace($replacefrom,$replaceto,$template['template']); 48 | 49 | $class->setGsmnumber($UserInformation['gsmnumber']); 50 | $class->setMessage($message); 51 | $class->setUserid($UserInformation['userid']); 52 | $class->send(); 53 | } 54 | } 55 | } 56 | 57 | return $hook; 58 | -------------------------------------------------------------------------------- /hooks/aftermodulesuspend.php: -------------------------------------------------------------------------------- 1 | 'AfterModuleSuspend', 4 | 'function' => 'AfterModuleSuspend', 5 | 'description' => array( 6 | 'turkish' => 'Bir hizmet duraklatıldığında mesaj gönderir', 7 | 'english' => 'After module suspended' 8 | ), 9 | 'type' => 'client', 10 | 'extra' => '', 11 | 'defaultmessage' => 'Sayin {firstname} {lastname}, hizmetiniz duraklatildi. ({domain})', 12 | 'variables' => '{firstname},{lastname},{domain}' 13 | ); 14 | if(!function_exists('AfterModuleSuspend')){ 15 | function AfterModuleSuspend($args){ 16 | 17 | $type = $args['params']['producttype']; 18 | 19 | if($type == "hostingaccount"){ 20 | $class = new AktuelSms(); 21 | $template = $class->getTemplateDetails(__FUNCTION__); 22 | if($template['active'] == 0){ 23 | return null; 24 | } 25 | $settings = $class->getSettings(); 26 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 27 | return null; 28 | } 29 | }else{ 30 | return null; 31 | } 32 | 33 | 34 | $userSql = "SELECT `a`.`id`,`a`.`firstname`, `a`.`lastname`, `b`.`value` as `gsmnumber` 35 | FROM `tblclients` as `a` 36 | JOIN `tblcustomfieldsvalues` as `b` ON `b`.`relid` = `a`.`id` 37 | JOIN `tblcustomfieldsvalues` as `c` ON `c`.`relid` = `a`.`id` 38 | WHERE `a`.`id` = '".$args['params']['clientsdetails']['userid']."' 39 | AND `b`.`fieldid` = '".$settings['gsmnumberfield']."' 40 | AND `c`.`fieldid` = '".$settings['wantsmsfield']."' 41 | AND `c`.`value` = 'on' 42 | LIMIT 1"; 43 | 44 | $result = mysql_query($userSql); 45 | $num_rows = mysql_num_rows($result); 46 | if($num_rows == 1){ 47 | $UserInformation = mysql_fetch_assoc($result); 48 | 49 | $template['variables'] = str_replace(" ","",$template['variables']); 50 | $replacefrom = explode(",",$template['variables']); 51 | $replaceto = array($UserInformation['firstname'],$UserInformation['lastname'],$args['params']['domain']); 52 | $message = str_replace($replacefrom,$replaceto,$template['template']); 53 | 54 | $class->setGsmnumber($UserInformation['gsmnumber']); 55 | $class->setUserid($args['params']['clientsdetails']['userid']); 56 | $class->setMessage($message); 57 | $class->send(); 58 | } 59 | } 60 | } 61 | 62 | return $hook; -------------------------------------------------------------------------------- /hooks/aftermoduleunsuspend.php: -------------------------------------------------------------------------------- 1 | 'AfterModuleUnsuspend', 4 | 'function' => 'AfterModuleUnsuspend', 5 | 'description' => array( 6 | 'turkish' => 'Bir hizmet tekrar başlatıldığında mesaj gönderir', 7 | 'english' => 'After module unsuspend' 8 | ), 9 | 'type' => 'client', 10 | 'extra' => '', 11 | 'defaultmessage' => 'Sayin {firstname} {lastname}, hizmetiniz tekrar aktiflestirildi. ({domain})', 12 | 'variables' => '{firstname},{lastname},{domain}' 13 | ); 14 | if(!function_exists('AfterModuleUnsuspend')){ 15 | function AfterModuleUnsuspend($args){ 16 | $type = $args['params']['producttype']; 17 | 18 | if($type == "hostingaccount"){ 19 | $class = new AktuelSms(); 20 | $template = $class->getTemplateDetails(__FUNCTION__); 21 | if($template['active'] == 0){ 22 | return null; 23 | } 24 | $settings = $class->getSettings(); 25 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 26 | return null; 27 | } 28 | }else{ 29 | return null; 30 | } 31 | 32 | $userSql = "SELECT `a`.`id`,`a`.`firstname`, `a`.`lastname`, `b`.`value` as `gsmnumber` 33 | FROM `tblclients` as `a` 34 | JOIN `tblcustomfieldsvalues` as `b` ON `b`.`relid` = `a`.`id` 35 | JOIN `tblcustomfieldsvalues` as `c` ON `c`.`relid` = `a`.`id` 36 | WHERE `a`.`id` = '".$args['params']['clientsdetails']['userid']."' 37 | AND `b`.`fieldid` = '".$settings['gsmnumberfield']."' 38 | AND `c`.`fieldid` = '".$settings['wantsmsfield']."' 39 | AND `c`.`value` = 'on' 40 | LIMIT 1"; 41 | 42 | $result = mysql_query($userSql); 43 | $num_rows = mysql_num_rows($result); 44 | if($num_rows == 1){ 45 | $UserInformation = mysql_fetch_assoc($result); 46 | 47 | $template['variables'] = str_replace(" ","",$template['variables']); 48 | $replacefrom = explode(",",$template['variables']); 49 | $replaceto = array($UserInformation['firstname'],$UserInformation['lastname'],$args['params']['domain']); 50 | $message = str_replace($replacefrom,$replaceto,$template['template']); 51 | 52 | $class->setGsmnumber($UserInformation['gsmnumber']); 53 | $class->setUserid($args['params']['clientsdetails']['userid']); 54 | $class->setMessage($message); 55 | $class->send(); 56 | } 57 | } 58 | } 59 | return $hook; -------------------------------------------------------------------------------- /hooks/AfterModuleChangePackage.php: -------------------------------------------------------------------------------- 1 | 'AfterModuleChangePackage', 4 | 'function' => 'AfterModuleChangePackage', 5 | 'description' => array( 6 | 'turkish' => 'Paket değişikliğinde mesaj gönderir', 7 | 'english' => 'After module Change Package' 8 | ), 9 | 'type' => 'client', 10 | 'extra' => '', 11 | 'defaultmessage' => 'Sayin {firstname} {lastname}, ürün/hizmet paketiniz degistirildi. ({domain})', 12 | 'variables' => '{firstname},{lastname},{domain}' 13 | ); 14 | if(!function_exists('AfterModuleChangePackage')){ 15 | function AfterModuleChangePackage($args){ 16 | $type = $args['params']['producttype']; 17 | 18 | if($type == "hostingaccount"){ 19 | $class = new AktuelSms(); 20 | $template = $class->getTemplateDetails(__FUNCTION__); 21 | if($template['active'] == 0){ 22 | return null; 23 | } 24 | $settings = $class->getSettings(); 25 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 26 | return null; 27 | } 28 | }else{ 29 | return null; 30 | } 31 | 32 | $userSql = "SELECT `a`.`id`,`a`.`firstname`, `a`.`lastname`, `b`.`value` as `gsmnumber` 33 | FROM `tblclients` as `a` 34 | JOIN `tblcustomfieldsvalues` as `b` ON `b`.`relid` = `a`.`id` 35 | JOIN `tblcustomfieldsvalues` as `c` ON `c`.`relid` = `a`.`id` 36 | WHERE `a`.`id` = '".$args['params']['clientsdetails']['userid']."' 37 | AND `b`.`fieldid` = '".$settings['gsmnumberfield']."' 38 | AND `c`.`fieldid` = '".$settings['wantsmsfield']."' 39 | AND `c`.`value` = 'on' 40 | LIMIT 1"; 41 | 42 | $result = mysql_query($userSql); 43 | $num_rows = mysql_num_rows($result); 44 | if($num_rows == 1){ 45 | $UserInformation = mysql_fetch_assoc($result); 46 | 47 | $template['variables'] = str_replace(" ","",$template['variables']); 48 | $replacefrom = explode(",",$template['variables']); 49 | $replaceto = array($UserInformation['firstname'],$UserInformation['lastname'],$args['params']['domain']); 50 | $message = str_replace($replacefrom,$replaceto,$template['template']); 51 | 52 | $class->setGsmnumber($UserInformation['gsmnumber']); 53 | $class->setUserid($args['params']['clientsdetails']['userid']); 54 | $class->setMessage($message); 55 | $class->send(); 56 | } 57 | } 58 | } 59 | return $hook; 60 | -------------------------------------------------------------------------------- /lang/russian.php: -------------------------------------------------------------------------------- 1 | страничку на Github для загрузки новой версии.

После обновления обязательно зайдите на эту вкладку еще раз.

"; 5 | $_ADDONLANG['uptodate'] = "Ваша версия актуальна."; 6 | $_ADDONLANG['save'] = "Сохранить"; 7 | $_ADDONLANG['gsmnumberfield'] = "GSM/Номер телефона (Доп. поле)"; 8 | $_ADDONLANG['wantsmsfield'] = "Чекбокс на подписку (Доп. поле)"; 9 | $_ADDONLANG['user'] = "Пользователь (ID)"; 10 | $_ADDONLANG['pass'] = "Пароль (ключ)"; 11 | $_ADDONLANG['apiid'] = "API ID (ID приложения)"; 12 | $_ADDONLANG['senderid'] = "Имя отправителя (Sender ID)"; 13 | $_ADDONLANG['dateformat'] = "Формат даты"; 14 | $_ADDONLANG['sender'] = "Сервис"; 15 | $_ADDONLANG['settings'] = "Настройки"; 16 | $_ADDONLANG['signature'] = "Подпись"; 17 | $_ADDONLANG['clientsmstemplates'] = "Шаблоны клиентов"; 18 | $_ADDONLANG['adminsmstemplates'] = "Шаблоны администраторов"; 19 | $_ADDONLANG['sendsms'] = "Отправить SMS"; 20 | $_ADDONLANG['messages'] = "Отправленные сообщения"; 21 | $_ADDONLANG['update'] = "Обновить"; 22 | $_ADDONLANG['smssent'] = "

SMS отправлено"; 23 | $_ADDONLANG['client'] = "Клиент"; 24 | $_ADDONLANG['selectclient'] = "Выбрать клиента"; 25 | $_ADDONLANG['message'] = "Сообщение"; 26 | $_ADDONLANG['debug'] = "Включить логгировние (Debug mode)"; 27 | $_ADDONLANG['send'] = "Отправить"; 28 | $_ADDONLANG['debugsonuc'] = "Результат"; 29 | $_ADDONLANG['gsmnumber'] = "GSM номер"; 30 | $_ADDONLANG['datetime'] = "Время"; 31 | $_ADDONLANG['status'] = "Статус"; 32 | $_ADDONLANG['delete'] = "Удалить"; 33 | $_ADDONLANG['parameter'] = "Параметры:"; 34 | $_ADDONLANG['active'] = "Включить"; 35 | $_ADDONLANG['ekstra'] = "Экстра {x}"; 36 | $_ADDONLANG['admingsm'] = "Номера телефонов администраторов"; 37 | $_ADDONLANG['admingsmornek'] = "Указывать, разделяя запятой. Пример: 5321232525,5331002020"; 38 | $_ADDONLANG['lisans'] = "Разработка инициирована Aktüel Sistem ve Bilgi Teknolojileri - Страничка на Github"; 39 | $_ADDONLANG['credit'] = "Оставшиеся средства"; 40 | 41 | $_ADDONLANG['error'] = "Ошибка"; 42 | $_ADDONLANG['success'] = "Успешно"; 43 | 44 | $_ADDONLANG['authkey'] = "Ключ авторизации"; 45 | $_ADDONLANG['route'] = "Маршрут SMS (напр.: 4)"; 46 | $_ADDONLANG['flash'] = "Flash SMS (Yes=1/No=0)"; 47 | $_ADDONLANG['unicode'] = "Unicode SMS (Yes=1/No=0)"; 48 | $_ADDONLANG['ignoreNdnc'] = "Игнорировать NDNC номера? (Yes=1/No=0)"; -------------------------------------------------------------------------------- /lang/english.php: -------------------------------------------------------------------------------- 1 | Github page for download new version.

Please visit this page after file transfer finished.

"; 5 | $_ADDONLANG['uptodate'] = "Your addon is up to date."; 6 | $_ADDONLANG['save'] = "Save"; 7 | $_ADDONLANG['gsmnumberfield'] = "GSM/Mobile Number Field (Custom client field)"; 8 | $_ADDONLANG['wantsmsfield'] = "Subscribe SMS Field (Custom client field)"; 9 | $_ADDONLANG['user'] = "Username"; 10 | $_ADDONLANG['pass'] = "Password"; 11 | $_ADDONLANG['apiid'] = "API ID"; 12 | $_ADDONLANG['email'] = "Email"; 13 | $_ADDONLANG['countrycode'] = "Country Code Prefix"; 14 | $_ADDONLANG['senderid'] = "SenderID(Title)"; 15 | $_ADDONLANG['dateformat'] = "Date Format"; 16 | $_ADDONLANG['sender'] = "Sender"; 17 | $_ADDONLANG['settings'] = "Settings"; 18 | $_ADDONLANG['signature'] = "Signature"; 19 | $_ADDONLANG['clientsmstemplates'] = "Client Templates"; 20 | $_ADDONLANG['adminsmstemplates'] = "Admin Templates"; 21 | $_ADDONLANG['sendsms'] = "Send SMS"; 22 | $_ADDONLANG['messages'] = "Sent Messages"; 23 | $_ADDONLANG['update'] = "Update"; 24 | $_ADDONLANG['smssent'] = "

SMS Sent"; 25 | $_ADDONLANG['client'] = "Client"; 26 | $_ADDONLANG['selectclient'] = "Select client"; 27 | $_ADDONLANG['message'] = "Message"; 28 | $_ADDONLANG['debug'] = "Print log"; 29 | $_ADDONLANG['send'] = "Send"; 30 | $_ADDONLANG['debugsonuc'] = "Result"; 31 | $_ADDONLANG['gsmnumber'] = "GSM Number"; 32 | $_ADDONLANG['datetime'] = "Date Time"; 33 | $_ADDONLANG['status'] = "Status"; 34 | $_ADDONLANG['delete'] = "Delete"; 35 | $_ADDONLANG['parameter'] = "Parameter:"; 36 | $_ADDONLANG['active'] = "Activate"; 37 | $_ADDONLANG['ekstra'] = "Extra {x}"; 38 | $_ADDONLANG['admingsm'] = "Admin GSM Numbers"; 39 | $_ADDONLANG['admingsmornek'] = "Seperate numbers with comma Etc. 5321232525,5331002020"; 40 | $_ADDONLANG['lisans'] = "Developed By EvMak Tanzania Thanks to Aktüel - Github Page"; 41 | $_ADDONLANG['credit'] = "Remaining Credit"; 42 | 43 | $_ADDONLANG['error'] = "Error"; 44 | $_ADDONLANG['pending'] = "Pending"; 45 | $_ADDONLANG['sent'] = "Sent"; 46 | $_ADDONLANG['success'] = "Success"; 47 | 48 | $_ADDONLANG['authkey'] = "Authentication Key"; 49 | $_ADDONLANG['route'] = "SMS Delivery Route (e.g: 4)"; 50 | $_ADDONLANG['flash'] = "Flash SMS (Yes=1/No=0)"; 51 | $_ADDONLANG['unicode'] = "Unicode SMS (Yes=1/No=0)"; 52 | $_ADDONLANG['ignoreNdnc'] = "Ignore NDNC Numbers? (Yes=1/No=0)"; -------------------------------------------------------------------------------- /hooks/invoicecreated.php: -------------------------------------------------------------------------------- 1 | 'InvoiceCreated', 4 | 'function' => 'InvoiceCreated', 5 | 'description' => array( 6 | 'turkish' => 'Yeni bir fatura oluşturulduğunda mesaj gönderir', 7 | 'english' => 'After invoice created' 8 | ), 9 | 'type' => 'client', 10 | 'extra' => '', 11 | 'defaultmessage' => 'Sayin {firstname} {lastname}, {duedate} son odeme tarihli {total} TL tutarinda bir fatura olusturulmustur. Fatura Numarasi: {invoiceid}. Detayli bilgi icin sitemizi ziyaret edin.', 12 | 'variables' => '{firstname}, {lastname}, {duedate}, {total}, {invoiceid}' 13 | ); 14 | if(!function_exists('InvoiceCreated')){ 15 | function InvoiceCreated($args){ 16 | 17 | $class = new AktuelSms(); 18 | $template = $class->getTemplateDetails(__FUNCTION__); 19 | if($template['active'] == 0){ 20 | return null; 21 | } 22 | $settings = $class->getSettings(); 23 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 24 | return null; 25 | } 26 | 27 | $userSql = " 28 | SELECT a.total,a.duedate,b.id as userid,b.firstname,b.lastname,`c`.`value` as `gsmnumber` FROM `tblinvoices` as `a` 29 | JOIN tblclients as b ON b.id = a.userid 30 | JOIN `tblcustomfieldsvalues` as `c` ON `c`.`relid` = `a`.`userid` 31 | JOIN `tblcustomfieldsvalues` as `d` ON `d`.`relid` = `a`.`userid` 32 | WHERE a.id = '".$args['invoiceid']."' 33 | AND `c`.`fieldid` = '".$settings['gsmnumberfield']."' 34 | AND `d`.`fieldid` = '".$settings['wantsmsfield']."' 35 | AND `d`.`value` = 'on' 36 | LIMIT 1 37 | "; 38 | 39 | $result = mysql_query($userSql); 40 | $num_rows = mysql_num_rows($result); 41 | if($num_rows == 1){ 42 | $UserInformation = mysql_fetch_assoc($result); 43 | $template['variables'] = str_replace(" ","",$template['variables']); 44 | $replacefrom = explode(",",$template['variables']); 45 | $replaceto = array($UserInformation['firstname'],$UserInformation['lastname'],$class->changeDateFormat($UserInformation['duedate']),$UserInformation['total'],$args['invoiceid']); 46 | $message = str_replace($replacefrom,$replaceto,$template['template']); 47 | 48 | $class->setGsmnumber($UserInformation['gsmnumber']); 49 | $class->setMessage($message); 50 | $class->setUserid($UserInformation['userid']); 51 | $class->send(); 52 | } 53 | } 54 | } 55 | 56 | return $hook; 57 | -------------------------------------------------------------------------------- /hooks/invoicepaymentreminder_reminder.php: -------------------------------------------------------------------------------- 1 | 'InvoicePaymentReminder', 4 | 'function' => 'InvoicePaymentReminder_Reminder', 5 | 'description' => array( 6 | 'turkish' => 'Ödenmemiş fatura için bilgi mesajı gönderir', 7 | 'english' => 'Invoice payment reminder' 8 | ), 9 | 'type' => 'client', 10 | 'extra' => '', 11 | 'defaultmessage' => 'Sayin {firstname} {lastname}, {duedate} son odeme tarihli bir faturaniz bulunmaktadir. Detayli bilgi icin sitemizi ziyaret edin. www.aktuelhost.com', 12 | 'variables' => '{firstname}, {lastname}, {duedate}' 13 | ); 14 | 15 | if(!function_exists('InvoicePaymentReminder_Reminder')){ 16 | function InvoicePaymentReminder_Reminder($args){ 17 | 18 | if($args['type'] == "reminder"){ 19 | $class = new AktuelSms(); 20 | $template = $class->getTemplateDetails(__FUNCTION__); 21 | if($template['active'] == 0){ 22 | return null; 23 | } 24 | $settings = $class->getSettings(); 25 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 26 | return null; 27 | } 28 | }else{ 29 | return false; 30 | } 31 | 32 | $userSql = " 33 | SELECT a.duedate,b.id as userid,b.firstname,b.lastname,`c`.`value` as `gsmnumber` FROM `tblinvoices` as `a` 34 | JOIN tblclients as b ON b.id = a.userid 35 | JOIN `tblcustomfieldsvalues` as `c` ON `c`.`relid` = `a`.`userid` 36 | JOIN `tblcustomfieldsvalues` as `d` ON `d`.`relid` = `a`.`userid` 37 | WHERE a.id = '".$args['invoiceid']."' 38 | AND `c`.`fieldid` = '".$settings['gsmnumberfield']."' 39 | AND `d`.`fieldid` = '".$settings['wantsmsfield']."' 40 | AND `d`.`value` = 'on' 41 | LIMIT 1 42 | "; 43 | 44 | $result = mysql_query($userSql); 45 | $num_rows = mysql_num_rows($result); 46 | if($num_rows == 1){ 47 | $UserInformation = mysql_fetch_assoc($result); 48 | $template['variables'] = str_replace(" ","",$template['variables']); 49 | $replacefrom = explode(",",$template['variables']); 50 | $replaceto = array($UserInformation['firstname'],$UserInformation['lastname'],$class->changeDateFormat($UserInformation['duedate'])); 51 | $message = str_replace($replacefrom,$replaceto,$template['template']); 52 | 53 | $class->setGsmnumber($UserInformation['gsmnumber']); 54 | $class->setMessage($message); 55 | $class->setUserid($UserInformation['userid']); 56 | $class->send(); 57 | } 58 | } 59 | } 60 | 61 | return $hook; -------------------------------------------------------------------------------- /hooks/aftermodulecreate_hosting.php: -------------------------------------------------------------------------------- 1 | 'AfterModuleCreate', 4 | 'function' => 'AfterModuleCreate_Hosting', 5 | 'description' => array( 6 | 'turkish' => 'Hosting hesabı oluşturulduktan sonra mesaj gönderir', 7 | 'english' => 'After hosting create' 8 | ), 9 | 'type' => 'client', 10 | 'extra' => '', 11 | 'defaultmessage' => 'Sayin {firstname} {lastname}, {domain} icin hosting hizmeti aktif hale getirilmistir. KullaniciAdi: {username} Sifre: {password}', 12 | 'variables' => '{firstname}, {lastname}, {domain}, {username}, {password}' 13 | ); 14 | if(!function_exists('AfterModuleCreate_Hosting')){ 15 | function AfterModuleCreate_Hosting($args){ 16 | 17 | $type = $args['params']['producttype']; 18 | 19 | if($type == "hostingaccount"){ 20 | $class = new AktuelSms(); 21 | $template = $class->getTemplateDetails(__FUNCTION__); 22 | if($template['active'] == 0){ 23 | return null; 24 | } 25 | $settings = $class->getSettings(); 26 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 27 | return null; 28 | } 29 | }else{ 30 | return null; 31 | } 32 | 33 | $userSql = "SELECT `a`.`id`,`a`.`firstname`, `a`.`lastname`, `b`.`value` as `gsmnumber` 34 | FROM `tblclients` as `a` 35 | JOIN `tblcustomfieldsvalues` as `b` ON `b`.`relid` = `a`.`id` 36 | JOIN `tblcustomfieldsvalues` as `c` ON `c`.`relid` = `a`.`id` 37 | WHERE `a`.`id` = '".$args['params']['clientsdetails']['userid']."' 38 | AND `b`.`fieldid` = '".$settings['gsmnumberfield']."' 39 | AND `c`.`fieldid` = '".$settings['wantsmsfield']."' 40 | AND `c`.`value` = 'on' 41 | LIMIT 1"; 42 | 43 | $result = mysql_query($userSql); 44 | $num_rows = mysql_num_rows($result); 45 | if($num_rows == 1){ 46 | $UserInformation = mysql_fetch_assoc($result); 47 | 48 | $template['variables'] = str_replace(" ","",$template['variables']); 49 | $replacefrom = explode(",",$template['variables']); 50 | $replaceto = array($UserInformation['firstname'],$UserInformation['lastname'],$args['params']['domain'],$args['params']['username'],$args['params']['password']); 51 | $message = str_replace($replacefrom,$replaceto,$template['template']); 52 | 53 | 54 | $class->setGsmnumber($UserInformation['gsmnumber']); 55 | $class->setUserid($args['params']['clientsdetails']['userid']); 56 | $class->setMessage($message); 57 | $class->send(); 58 | } 59 | } 60 | } 61 | return $hook; 62 | -------------------------------------------------------------------------------- /hooks/AfterModuleChangePassword.php: -------------------------------------------------------------------------------- 1 | 'AfterModuleChangePassword', 4 | 'function' => 'AfterModuleChangePassword', 5 | 'description' => array( 6 | 'turkish' => 'Hosting hesabı şifresi değiştiğinde gönderir', 7 | 'english' => 'After module change password' 8 | ), 9 | 'type' => 'client', 10 | 'extra' => '', 11 | 'defaultmessage' => 'Sayin {firstname} {lastname}, {domain} hizmetinin hosting sifresi basariyla degisti. KullaniciAdi: {username} Sifre: {password}', 12 | 'variables' => '{firstname}, {lastname}, {domain}, {username}, {password}' 13 | ); 14 | if(!function_exists('AfterModuleChangePassword')){ 15 | function AfterModuleChangePassword($args){ 16 | 17 | $type = $args['params']['producttype']; 18 | 19 | if($type == "hostingaccount"){ 20 | $class = new AktuelSms(); 21 | $template = $class->getTemplateDetails(__FUNCTION__); 22 | if($template['active'] == 0){ 23 | return null; 24 | } 25 | $settings = $class->getSettings(); 26 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 27 | return null; 28 | } 29 | }else{ 30 | return null; 31 | } 32 | 33 | $userSql = "SELECT `a`.`id`,`a`.`firstname`, `a`.`lastname`, `b`.`value` as `gsmnumber` 34 | FROM `tblclients` as `a` 35 | JOIN `tblcustomfieldsvalues` as `b` ON `b`.`relid` = `a`.`id` 36 | JOIN `tblcustomfieldsvalues` as `c` ON `c`.`relid` = `a`.`id` 37 | WHERE `a`.`id` = '".$args['params']['clientsdetails']['userid']."' 38 | AND `b`.`fieldid` = '".$settings['gsmnumberfield']."' 39 | AND `c`.`fieldid` = '".$settings['wantsmsfield']."' 40 | AND `c`.`value` = 'on' 41 | LIMIT 1"; 42 | 43 | $result = mysql_query($userSql); 44 | $num_rows = mysql_num_rows($result); 45 | if($num_rows == 1){ 46 | $UserInformation = mysql_fetch_assoc($result); 47 | 48 | $template['variables'] = str_replace(" ","",$template['variables']); 49 | $replacefrom = explode(",",$template['variables']); 50 | $replaceto = array($UserInformation['firstname'],$UserInformation['lastname'],$args['params']['domain'],$args['params']['username'],$args['params']['password']); 51 | $message = str_replace($replacefrom,$replaceto,$template['template']); 52 | 53 | 54 | $class->setGsmnumber($UserInformation['gsmnumber']); 55 | $class->setUserid($args['params']['clientsdetails']['userid']); 56 | $class->setMessage($message); 57 | $class->send(); 58 | } 59 | } 60 | } 61 | return $hook; 62 | -------------------------------------------------------------------------------- /hooks/invoicepaymentreminder_first.php: -------------------------------------------------------------------------------- 1 | 'InvoicePaymentReminder', 4 | 'function' => 'InvoicePaymentReminder_Firstoverdue', 5 | 'description' => array( 6 | 'turkish' => 'Ödenmemiş faturanın ilk zaman aşımında mesaj gönderir', 7 | 'english' => 'Invoice payment reminder for first overdue' 8 | ), 9 | 'type' => 'client', 10 | 'extra' => '', 11 | 'defaultmessage' => 'Sayin {firstname} {lastname}, {duedate} son odeme tarihli bir faturaniz bulunmaktadir. Detayli bilgi icin sitemizi ziyaret edin. www.aktuelhost.com', 12 | 'variables' => '{firstname}, {lastname}, {duedate}' 13 | ); 14 | 15 | if(!function_exists('InvoicePaymentReminder_Firstoverdue')){ 16 | function InvoicePaymentReminder_Firstoverdue($args){ 17 | 18 | if($args['type'] == "firstoverdue"){ 19 | $class = new AktuelSms(); 20 | $template = $class->getTemplateDetails(__FUNCTION__); 21 | if($template['active'] == 0){ 22 | return null; 23 | } 24 | $settings = $class->getSettings(); 25 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 26 | return null; 27 | } 28 | }else{ 29 | return false; 30 | } 31 | 32 | $userSql = " 33 | SELECT a.duedate,b.id as userid,b.firstname,b.lastname,`c`.`value` as `gsmnumber` FROM `tblinvoices` as `a` 34 | JOIN tblclients as b ON b.id = a.userid 35 | JOIN `tblcustomfieldsvalues` as `c` ON `c`.`relid` = `a`.`userid` 36 | JOIN `tblcustomfieldsvalues` as `d` ON `d`.`relid` = `a`.`userid` 37 | WHERE a.id = '".$args['invoiceid']."' 38 | AND `c`.`fieldid` = '".$settings['gsmnumberfield']."' 39 | AND `d`.`fieldid` = '".$settings['wantsmsfield']."' 40 | AND `d`.`value` = 'on' 41 | LIMIT 1 42 | "; 43 | 44 | $result = mysql_query($userSql); 45 | $num_rows = mysql_num_rows($result); 46 | if($num_rows == 1){ 47 | $UserInformation = mysql_fetch_assoc($result); 48 | $template['variables'] = str_replace(" ","",$template['variables']); 49 | $replacefrom = explode(",",$template['variables']); 50 | $replaceto = array($UserInformation['firstname'],$UserInformation['lastname'],$class->changeDateFormat($UserInformation['duedate'])); 51 | 52 | $message = str_replace($replacefrom,$replaceto,$template['template']); 53 | 54 | $class->setGsmnumber($UserInformation['gsmnumber']); 55 | $class->setMessage($message); 56 | $class->setUserid($UserInformation['userid']); 57 | $class->send(); 58 | } 59 | } 60 | } 61 | 62 | return $hook; -------------------------------------------------------------------------------- /hooks/invoicepaymentreminder_third.php: -------------------------------------------------------------------------------- 1 | 'InvoicePaymentReminder', 4 | 'function' => 'InvoicePaymentReminder_thirdoverdue', 5 | 'description' => array( 6 | 'turkish' => 'Ödenmemiş faturanın üçüncü zaman aşımında mesaj gönderir', 7 | 'english' => 'Invoice payment third for first overdue' 8 | ), 9 | 'type' => 'client', 10 | 'extra' => '', 11 | 'defaultmessage' => 'Sayin {firstname} {lastname}, {duedate} son odeme tarihli gecikmis bir faturaniz bulunmaktadir. Detayli bilgi icin sitemizi ziyaret edin.', 12 | 'variables' => '{firstname}, {lastname}, {duedate}' 13 | ); 14 | 15 | if(!function_exists('InvoicePaymentReminder_thirdoverdue')){ 16 | function InvoicePaymentReminder_thirdoverdue($args){ 17 | 18 | if($args['type'] == "thirdoverdue"){ 19 | $class = new AktuelSms(); 20 | $template = $class->getTemplateDetails(__FUNCTION__); 21 | if($template['active'] == 0){ 22 | return null; 23 | } 24 | $settings = $class->getSettings(); 25 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 26 | return null; 27 | } 28 | }else{ 29 | return false; 30 | } 31 | 32 | $userSql = " 33 | SELECT a.duedate,b.id as userid,b.firstname,b.lastname,`c`.`value` as `gsmnumber` FROM `tblinvoices` as `a` 34 | JOIN tblclients as b ON b.id = a.userid 35 | JOIN `tblcustomfieldsvalues` as `c` ON `c`.`relid` = `a`.`userid` 36 | JOIN `tblcustomfieldsvalues` as `d` ON `d`.`relid` = `a`.`userid` 37 | WHERE a.id = '".$args['invoiceid']."' 38 | AND `c`.`fieldid` = '".$settings['gsmnumberfield']."' 39 | AND `d`.`fieldid` = '".$settings['wantsmsfield']."' 40 | AND `d`.`value` = 'on' 41 | LIMIT 1 42 | "; 43 | 44 | $result = mysql_query($userSql); 45 | $num_rows = mysql_num_rows($result); 46 | if($num_rows == 1){ 47 | $UserInformation = mysql_fetch_assoc($result); 48 | 49 | $template['variables'] = str_replace(" ","",$template['variables']); 50 | $replacefrom = explode(",",$template['variables']); 51 | $replaceto = array($UserInformation['firstname'],$UserInformation['lastname'],$class->changeDateFormat($UserInformation['duedate'])); 52 | $message = str_replace($replacefrom,$replaceto,$template['template']); 53 | 54 | $class->setGsmnumber($UserInformation['gsmnumber']); 55 | $class->setMessage($message); 56 | $class->setUserid($UserInformation['userid']); 57 | $class->send(); 58 | } 59 | } 60 | } 61 | 62 | return $hook; 63 | -------------------------------------------------------------------------------- /hooks/invoicepaymentreminder_second.php: -------------------------------------------------------------------------------- 1 | 'InvoicePaymentReminder', 4 | 'function' => 'InvoicePaymentReminder_secondoverdue', 5 | 'description' => array( 6 | 'turkish' => 'Ödenmemiş faturanın ikinci zaman aşımında mesaj gönderir', 7 | 'english' => 'Invoice payment second for first overdue' 8 | ), 9 | 'type' => 'client', 10 | 'extra' => '', 11 | 'defaultmessage' => 'Sayin {firstname} {lastname}, {duedate} son odeme tarihli gecikmis bir faturaniz bulunmaktadir. Detayli bilgi icin sitemizi ziyaret edin.', 12 | 'variables' => '{firstname}, {lastname}, {duedate}' 13 | ); 14 | 15 | if(!function_exists('InvoicePaymentReminder_secondoverdue')){ 16 | function InvoicePaymentReminder_secondoverdue($args){ 17 | 18 | if($args['type'] == "secondoverdue"){ 19 | $class = new AktuelSms(); 20 | $template = $class->getTemplateDetails(__FUNCTION__); 21 | if($template['active'] == 0){ 22 | return null; 23 | } 24 | $settings = $class->getSettings(); 25 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 26 | return null; 27 | } 28 | }else{ 29 | return false; 30 | } 31 | 32 | $userSql = " 33 | SELECT a.duedate,b.id as userid,b.firstname,b.lastname,`c`.`value` as `gsmnumber` FROM `tblinvoices` as `a` 34 | JOIN tblclients as b ON b.id = a.userid 35 | JOIN `tblcustomfieldsvalues` as `c` ON `c`.`relid` = `a`.`userid` 36 | JOIN `tblcustomfieldsvalues` as `d` ON `d`.`relid` = `a`.`userid` 37 | WHERE a.id = '".$args['invoiceid']."' 38 | AND `c`.`fieldid` = '".$settings['gsmnumberfield']."' 39 | AND `d`.`fieldid` = '".$settings['wantsmsfield']."' 40 | AND `d`.`value` = 'on' 41 | LIMIT 1 42 | "; 43 | 44 | $result = mysql_query($userSql); 45 | $num_rows = mysql_num_rows($result); 46 | if($num_rows == 1){ 47 | $UserInformation = mysql_fetch_assoc($result); 48 | 49 | $template['variables'] = str_replace(" ","",$template['variables']); 50 | $replacefrom = explode(",",$template['variables']); 51 | $replaceto = array($UserInformation['firstname'],$UserInformation['lastname'],$class->changeDateFormat($UserInformation['duedate'])); 52 | $message = str_replace($replacefrom,$replaceto,$template['template']); 53 | 54 | $class->setGsmnumber($UserInformation['gsmnumber']); 55 | $class->setMessage($message); 56 | $class->setUserid($UserInformation['userid']); 57 | $class->send(); 58 | } 59 | } 60 | } 61 | 62 | return $hook; 63 | -------------------------------------------------------------------------------- /senders/hemenposta.php: -------------------------------------------------------------------------------- 1 | message = $this->utilmessage($message); 6 | $this->gsmnumber = $this->utilgsmnumber($gsmnumber); 7 | } 8 | 9 | function send(){ 10 | if($this->gsmnumber == "numbererror"){ 11 | $log[] = ("Number format error.".$this->gsmnumber); 12 | $error[] = ("Number format error.".$this->gsmnumber); 13 | return null; 14 | } 15 | 16 | $params = $this->getParams(); 17 | 18 | $postUrl = "http://sms.modexi.com/service/sendxml"; 19 | $xmlString="$params->user$params->pass$params->senderid$this->message$this->gsmnumber"; 20 | 21 | $fields = $xmlString; 22 | $ch = curl_init(); 23 | curl_setopt($ch, CURLOPT_URL, $postUrl); 24 | curl_setopt($ch, CURLOPT_POST, 1); 25 | curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); 26 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 27 | 28 | $result = curl_exec($ch); 29 | curl_close($ch); 30 | 31 | $return = $result; 32 | $log[] = ("Sunucudan dönen cevap: ".$result); 33 | 34 | if(preg_match('/(.*?)<\/status>(.*?)(.*?)<\/DESC>(.*?)(.*?)<\/package>/si', $result, $result_matches)) { 35 | $status_code = $result_matches[1]; 36 | $status_message = $result_matches[3]; 37 | $order_id = $result_matches[5]; 38 | 39 | if($status_code > 0) { 40 | $log[] = ("Message sent."); 41 | } else { 42 | $log[] = ("Mesaj gönderilemedi. Hata: $status_message"); 43 | $error[] = ("Mesaj gönderilirken hata oluştu. Hata: $status_code"); 44 | } 45 | } else { 46 | $log[] = ("Mesaj gönderilemedi. Hata: $return"); 47 | $error[] = ("Mesaj gönderilirken hata oluştu. Hata: $return"); 48 | } 49 | 50 | return array( 51 | 'log' => $log, 52 | 'error' => $error, 53 | 'msgid' => $order_id, 54 | ); 55 | } 56 | 57 | function balance(){ 58 | return null; 59 | } 60 | 61 | function report($msgid){ 62 | return null; 63 | } 64 | 65 | //You can spesifically convert your gsm number. See netgsm for example 66 | function utilgsmnumber($number){ 67 | return $number; 68 | } 69 | //You can spesifically convert your message 70 | function utilmessage($message){ 71 | return $message; 72 | } 73 | 74 | } 75 | 76 | return array( 77 | 'value' => 'hemenposta', 78 | 'label' => 'HemenPosta', 79 | 'fields' => array( 80 | 'user','pass' 81 | ) 82 | ); 83 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # whmcs-sms 2 | SMS Module for WHMCS 3 | 4 | - Added infobip suport 5 | - working well with WHMCS 6.3 6 | - Minor bug fixes 7 | 8 | This module is folked from https://github.com/shibby/WHMCS-SmsModule 9 | 10 | 11 | Open Source SMS Module for WHMCS Automation. 12 | Installation 13 | 14 | Upload files to your WHMCS root. 15 | Go to Admin Area. Enter Menu->Setup->Addon Modules and Activate Aktuel Sms 16 | After saving changes, give privigle to admin groups that you want at same page. 17 | Go to Menu->Setup->Custom Client Fields 18 | Add a field: name=Send Sms, type= Tick box, Show on Order Form=check. (This field will be shown at register page. If user do not check this field, SMS will not send to this user) 19 | 20 | Add a field: name=GSM Number, type=Text Box, Show on Order Form=check. (This field will be shown at register page. Sms will send to this value that user fills.) 21 | 22 | Enter Menu->Addons->Aktuel Sms 23 | Write WHMCS Path and Select SMS Gateway. Write your api details. 24 | 25 | Supported SMS Gateways 26 | 27 | ClickAtell (Global) 28 | NetGsm (Turkey) 29 | UcuzSmsAl (Turkey) 30 | Mutlucell (Turkey) 31 | Dakik SMS (Turkey) 32 | msg91.com (India) 33 | bytehand.com (Global, Russian) 34 | 1sms.com.tr (Türkiye) 35 | smsGateway.me (Global -> use your own android device to send SMS via API call) 36 | SendSms.ro (Romania, Global) 37 | Infobip (see evmaksms) 38 | 39 | Supported Hooks 40 | 41 | ClientChangePassword: Send sms to user if changes account password 42 | TicketAdminReply: Send sms to user if admin replies user's ticket 43 | ClientAdd: Send sms when user register 44 | AfterRegistrarRegistration: Send sms to user when domain registred succesfully 45 | AfterRegistrarRenewal: Send sms to user when domain renewed succesfully 46 | AfterModuleCreate_SharedAccount: Send sms to user when hosting account created. 47 | AfterModuleCreate_ResellerAccount: Send sms to user when reseller account created. 48 | AcceptOrder: Send sms to user when order accepted manually or automatically. 49 | DomainRenewalNotice: Remaining to the end of {x} days prior to the domain's end time, user will be get a message. 50 | InvoicePaymentReminder: If there is a payment that not paid, user will be get a information message. 51 | InvoicePaymentReminder_FirstOverdue: Invoice payment first for seconds overdue. 52 | InvoicePaymentReminder_secondoverdue: Invoice payment second for seconds overdue. 53 | InvoicePaymentReminder_thirdoverdue: Invoice payment third for seconds overdue. 54 | AfterModuleSuspend: Send sms after hosting account suspended. 55 | AfterModuleUnsuspend: Send sms after hosting account unsuspended. 56 | InvoiceCreated: Send sms every invoice creation. 57 | AfterModuleChangePassword: After module change password. 58 | InvoicePaid: Whenyou have paidthe billsends a message. 59 | -------------------------------------------------------------------------------- /senders/bytehand.php: -------------------------------------------------------------------------------- 1 | message = $this->utilmessage($message); 6 | $this->gsmnumber = $this->utilgsmnumber($gsmnumber); 7 | } 8 | 9 | function send(){ 10 | if($this->gsmnumber == "numbererror"){ 11 | $log[] = ("Number format error.".$this->gsmnumber); 12 | $error[] = ("Number format error.".$this->gsmnumber); 13 | return null; 14 | } 15 | 16 | $params = $this->getParams(); 17 | 18 | 19 | $result = @file_get_contents('http://bytehand.com:3800/send?id='.$params->user.'&key='.$params->pass.'&to='.urlencode($this->gsmnumber).'&from='.urlencode($params->senderid).'&text='.urlencode($this->message)); 20 | $result = json_decode($result); 21 | 22 | if($result->status == 0) { 23 | $log[] = ("Message sent."); 24 | } else { 25 | $log[] = ("Error."); 26 | $error[] = ("Check status, looks like problem with a connection or credentials."); 27 | } 28 | 29 | return array( 30 | 'log' => $log, 31 | 'error' => $error, 32 | 'msgid' => $result->description, 33 | ); 34 | } 35 | 36 | function balance(){ 37 | $params = $this->getParams(); 38 | if($params->user && $params->pass) { 39 | $result = @file_get_contents('http://bytehand.com:3800/balance?id='.$params->user.'&key='.$params->pass); 40 | $result = json_decode($result); 41 | 42 | if ($result->status == 0) { 43 | return $result->description; 44 | } else { 45 | return null; 46 | } 47 | } else { 48 | return null; 49 | } 50 | } 51 | 52 | function report($msgid){ 53 | $params = $this->getParams(); 54 | if($params->user && $params->pass && $msgid){ 55 | $result = @file_get_contents('http://bytehand.com:3800/status?id='.$params->user.'&key='.$params->pass.'&message='.$msgid); 56 | $result = json_decode($result); 57 | if ($result->status == 0) { 58 | if ($result->description == 'DELIVERED' || $result->description == 'ACCEPTED') { 59 | return "success"; 60 | } else { 61 | return "error"; 62 | } 63 | } else { 64 | null; // Problem with a connection, not with SMS. 65 | } 66 | } else { 67 | return null; 68 | } 69 | 70 | } 71 | 72 | //You can spesifically convert your gsm number. See netgsm for example 73 | function utilgsmnumber($number){ 74 | return $number; 75 | } 76 | //You can spesifically convert your message 77 | function utilmessage($message){ 78 | return $message; 79 | } 80 | } 81 | 82 | return array( 83 | 'value' => 'bytehand', 84 | 'label' => 'ByteHand', 85 | 'fields' => array( 86 | 'user','pass' 87 | ) 88 | ); 89 | -------------------------------------------------------------------------------- /hooks/domainrenewalnotice.php: -------------------------------------------------------------------------------- 1 | 'DailyCronJob', 4 | 'function' => 'DomainRenewalNotice', 5 | 'description' => array( 6 | 'turkish' => 'Domainin yenilenmesine {x} gün kala mesaj gönderir', 7 | 'english' => 'Donmain renewal notice before {x} days ago' 8 | ), 9 | 'type' => 'client', 10 | 'extra' => '15', 11 | 'defaultmessage' => 'Sayin {firstname} {lastname}, {domain} alanadiniz {expirydate}({x} gun sonra) tarihinde sona erecektir. Yenilemek icin sitemizi ziyaret edin. www.aktuelhost.com', 12 | 'variables' => '{firstname}, {lastname}, {domain},{expirydate},{x}' 13 | ); 14 | if(!function_exists('DomainRenewalNotice')){ 15 | function DomainRenewalNotice($args){ 16 | 17 | $class = new AktuelSms(); 18 | $template = $class->getTemplateDetails(__FUNCTION__); 19 | if($template['active'] == 0){ 20 | return null; 21 | } 22 | $settings = $class->getSettings(); 23 | if(!$settings['api'] || !$settings['apiparams'] || !$settings['gsmnumberfield'] || !$settings['wantsmsfield']){ 24 | return null; 25 | } 26 | 27 | $extra = $template['extra']; 28 | $sqlDomain = "SELECT `userid` , `domain` , `expirydate` 29 | FROM `tbldomains` 30 | WHERE `status` = 'Active'"; 31 | $resultDomain = mysql_query($sqlDomain); 32 | while ($data = mysql_fetch_array($resultDomain)) { 33 | $tarih = explode("-",$data['expirydate']); 34 | $yesterday = mktime (0, 0, 0, $tarih[1], $tarih[2] - $extra, $tarih[0]); 35 | $today = date("Y-m-d"); 36 | if (date('Y-m-d', $yesterday) == $today){ 37 | $userSql = "SELECT `a`.`id` as userid,`a`.`firstname`, `a`.`lastname`, `b`.`value` as `gsmnumber` 38 | FROM `tblclients` as `a` 39 | JOIN `tblcustomfieldsvalues` as `b` ON `b`.`relid` = `a`.`id` 40 | JOIN `tblcustomfieldsvalues` as `c` ON `c`.`relid` = `a`.`id` 41 | WHERE `a`.`id` = '".$data['userid']."' 42 | AND `b`.`fieldid` = '".$settings['gsmnumberfield']."' 43 | AND `c`.`fieldid` = '".$settings['wantsmsfield']."' 44 | AND `c`.`value` = 'on' 45 | LIMIT 1"; 46 | 47 | $result = mysql_query($userSql); 48 | $num_rows = mysql_num_rows($result); 49 | if($num_rows == 1){ 50 | $UserInformation = mysql_fetch_assoc($result); 51 | $template['variables'] = str_replace(" ","",$template['variables']); 52 | $replacefrom = explode(",",$template['variables']); 53 | $replaceto = array($UserInformation['firstname'],$UserInformation['lastname'],$data['domain'],$data['expirydate'],$extra); 54 | $message = str_replace($replacefrom,$replaceto,$template['template']); 55 | 56 | $class->setGsmnumber($UserInformation['gsmnumber']); 57 | $class->setMessage($message); 58 | $class->setUserid($UserInformation['userid']); 59 | $class->send(); 60 | } 61 | } 62 | } 63 | } 64 | } 65 | return $hook; -------------------------------------------------------------------------------- /senders/clickatell.php: -------------------------------------------------------------------------------- 1 | message = $this->utilmessage($message); 6 | $this->gsmnumber = $this->utilgsmnumber($gsmnumber); 7 | } 8 | 9 | function send(){ 10 | if($this->gsmnumber == "numbererror"){ 11 | $log[] = ("Number format error.".$this->gsmnumber); 12 | $error[] = ("Number format error.".$this->gsmnumber); 13 | return null; 14 | } 15 | 16 | $params = $this->getParams(); 17 | 18 | $baseurl = "http://api.clickatell.com"; 19 | 20 | $text = urlencode($this->message); 21 | $to = $this->gsmnumber; 22 | 23 | $url = "$baseurl/http/auth?user=$params->user&password=$params->pass&api_id=$params->apiid&from=$params->senderid"; 24 | $ret = file($url); 25 | $answer = is_array($ret)?json_encode($ret):$ret; 26 | $log[] = ("Answer from Clickatell: ".$answer); 27 | 28 | $sess = explode(":", $ret[0]); 29 | if ($sess[0] == "OK") { 30 | 31 | $sess_id = trim($sess[1]); // remove any whitespace 32 | $url = "$baseurl/http/sendmsg?session_id=$sess_id&to=$to&text=$text&from=$params->senderid"; 33 | 34 | $ret = file($url); 35 | $send = explode(":", $ret[0]); 36 | 37 | if ($send[0] == "ID") { 38 | $log[] = ("Message Sent."); 39 | } else { 40 | $answer = is_array($ret)?json_encode($ret):$ret; 41 | $log[] = ("Message could not sent. Error: $answer"); 42 | $error[] = ("Message could not sent. Error: $answer"); 43 | } 44 | } else { 45 | $answer = is_array($ret)?json_encode($ret):$ret; 46 | $log[] = ("Message could not sent. Error: $answer"); 47 | $error[] = ("Message could not sent. Error: $answer"); 48 | } 49 | 50 | return array( 51 | 'log' => $log, 52 | 'error' => $error, 53 | 'msgid' => $send[1], 54 | ); 55 | } 56 | 57 | function balance(){ 58 | $params = $this->getParams(); 59 | if($params->user && $params->pass && $params->apiid){ 60 | $url = "http://api.clickatell.com/http/getbalance?api_id=$params->apiid&user=$params->user&password=$params->pass"; 61 | $result = file_get_contents($url); 62 | $result = explode(" ",$result); 63 | $cvp = $result[1]; 64 | if ($cvp == 001){ 65 | return null; 66 | }else{ 67 | return $result[1]; 68 | } 69 | }else{ 70 | return null; 71 | } 72 | } 73 | 74 | function report($msgid){ 75 | $params = $this->getParams(); 76 | if($params->user && $params->pass && $params->apiid && $msgid){ 77 | $url = "http://api.clickatell.com/http/querymsg?user=$params->user&password=$params->pass&api_id=$params->apiid&apimsgid=$msgid"; 78 | $result = file_get_contents($url); 79 | $result = explode(" ",$result); 80 | $cvp = $result[1]; 81 | if ($cvp == 001){ 82 | return "error"; 83 | }else{ 84 | return "success"; 85 | } 86 | }else{ 87 | return null; 88 | } 89 | } 90 | 91 | //You can spesifically convert your gsm number. See netgsm for example 92 | function utilgsmnumber($number){ 93 | return $number; 94 | } 95 | //You can spesifically convert your message 96 | function utilmessage($message){ 97 | return $message; 98 | } 99 | } 100 | 101 | return array( 102 | 'value' => 'clickatell', 103 | 'label' => 'ClickAtell', 104 | 'fields' => array( 105 | 'user','pass','apiid' 106 | ) 107 | ); 108 | -------------------------------------------------------------------------------- /senders/onetouch.php: -------------------------------------------------------------------------------- 1 | message = $this->utilmessage($message); 6 | $this->gsmnumber = $this->utilgsmnumber($gsmnumber); 7 | } 8 | 9 | function send(){ 10 | if($this->gsmnumber == "numbererror"){ 11 | $log[] = ("Number format error.".$this->gsmnumber); 12 | $error[] = ("Number format error.".$this->gsmnumber); 13 | return null; 14 | } 15 | $params = $this->getParams(); 16 | 17 | $url = "http://api.ottbd.org/api/v3/sendsms/plain?user=$params->user&password=$params->pass&GSM=$this->gsmnumber&sender=$params->senderid&messagetext=".urlencode($this->message).""; 18 | 19 | $log[] = "Request url: ".$url; 20 | $result = simplexml_load_file($url); 21 | 22 | $return = $result; 23 | $log[] = "server response returned: ".$result; 24 | 25 | 26 | if ($result->result[0]->status == "0") { 27 | $this->addLog("Message sent."); 28 | $log[] = "Message sent"; 29 | $msgid = $result->result[0]->messageid; 30 | $log[] = "Message id: ".$msgid; 31 | 32 | }elseif($result->result[0]->status == "-1"){ 33 | $log[] = "Error in processing the request "; 34 | $error[] = "Error in processing the request "; 35 | 36 | }elseif($result->result[0]->status == "-2"){ 37 | $log[] = "Not enough credit on a specific account "; 38 | $error[] = "Not enough credit on a specific account "; 39 | 40 | }elseif($result->result[0]->status == "-3"){ 41 | $log[] = "Targeted network is not covered on this account "; 42 | $error[] = "Targeted network is not covered on this account "; 43 | 44 | }elseif($result->result[0]->status == "-5"){ 45 | $log[] = "Invalid username or password "; 46 | $error[] = "Invalid username or password "; 47 | 48 | }elseif($result->result[0]->status == "-6"){ 49 | $log[] = "Destination address is missing "; 50 | $error[] = "Destination address is missing "; 51 | 52 | }elseif($result->result[0]->status == "-10"){ 53 | $log[] = "Username is missing "; 54 | $error[] = "Username is missing "; 55 | 56 | }elseif($result->result[0]->status == "-11"){ 57 | $log[] = "Password is missing "; 58 | $error[] = "Password is missing "; 59 | 60 | }elseif($result->result[0]->status == "-13"){ 61 | $log[] = "Number is not recognized by OneTouch platform "; 62 | $error[] = "Number is not recognized by OneTouch platform "; 63 | 64 | }elseif($result->result[0]->status == "-33"){ 65 | $log[] = "Duplicated MessageID "; 66 | $error[] = "Duplicated MessageID "; 67 | 68 | }elseif($result->result[0]->status == "-34"){ 69 | $log[] = "Sender name not allowed "; 70 | $error[] = "Sender name not allowed "; 71 | 72 | }else{ 73 | $log[] = "Unable to send message. error : $return"; 74 | $error[] = "An error occurred while sending messages. error: $return"; 75 | } 76 | 77 | 78 | return array( 79 | 'log' => $log, 80 | 'error' => $error, 81 | 'msgid' => $msgid, 82 | ); 83 | } 84 | 85 | function balance(){ 86 | return null; 87 | } 88 | 89 | function report($msgid){ 90 | return null; 91 | } 92 | 93 | 94 | function utilgsmnumber($number){ 95 | return $number; 96 | } 97 | 98 | function utilmessage($message){ 99 | return $message; 100 | } 101 | } 102 | 103 | return array( 104 | 'value' => 'onetouch', 105 | 'label' => 'OneTouchSMS', 106 | 'fields' => array( 107 | 'user','pass' 108 | ) 109 | ); 110 | -------------------------------------------------------------------------------- /senders/routesms.php: -------------------------------------------------------------------------------- 1 | message = $this->utilmessage($message); 6 | $this->gsmnumber = $this->utilgsmnumber($gsmnumber); 7 | } 8 | 9 | function send(){ 10 | if($this->gsmnumber == "numbererror"){ 11 | $log[] = ("Number format error.".$this->gsmnumber); 12 | $error[] = ("Number format error.".$this->gsmnumber); 13 | return null; 14 | } 15 | $params = $this->getParams(); 16 | 17 | $url = "https://api.sendsms.co.tz/api/sendsms/plain?user=$params->user&password=$params->pass&sender=$params->senderid&SMSText=".urlencode($this->message)."&GSM=$this->gsmnumber"; 18 | 19 | 20 | //"http://121.241.242.114:8080/bulksms/bulksms?username=$params->user&password=$params->pass&type=1&dlr=0&destination=$this->gsmnumber&source=$params->senderid&message=".urlencode($this->message)."" 21 | 22 | $log[] = "Request url: ".$url; 23 | $result = file_get_contents($url); 24 | 25 | $return = $result; 26 | $log[] = "Sunucudan dönen cevap: ".$result; 27 | 28 | $result = explode("|", $result); 29 | if ($result[0] > "1") { 30 | $this->addLog("Message sent."); 31 | $log[] = "Message sent"; 32 | $msgid = $result[2]; 33 | $log[] = "Message id: ".$msgid; 34 | }elseif($result[0] == "-1"){ 35 | $log[] = "SEND_ERROR - Currently not in use "; 36 | $error[] = "SEND_ERROR - Currently not in use "; 37 | }elseif($result[0] == "-2"){ 38 | $log[] = "NOT_ENOUGHCREDITS"; 39 | $error[] = "NOT_ENOUGHCREDITS"; 40 | }elseif($result[0] == "-3"){ 41 | $log[] = "NETWORK_NOTCOVERED"; 42 | $error[] = "NETWORK_NOTCOVERED"; 43 | }elseif($result[0] == "-4"){ 44 | $log[] = "SOCKET_EXCEPTION - Currently not in use "; 45 | $error[] = "SOCKET_EXCEPTION - Currently not in use "; 46 | }elseif($result[0] == "-5"){ 47 | $log[] = "INVALID_USER_OR_PASS "; 48 | $error[] = "INVALID_USER_OR_PASS "; 49 | }elseif($result[0] == "-6"){ 50 | $log[] = "MISSING_DESTINATION_ADDRESS "; 51 | $error[] = "MISSING_DESTINATION_ADDRESS "; 52 | }elseif($result[0] == "-7"){ 53 | $log[] = "MISSING_SMSTEXT "; 54 | $error[] = "MISSING_SMSTEXT "; 55 | }elseif($result[0] == "-8"){ 56 | $log[] = "MISSING_SENDERNAME "; 57 | $error[] = "MISSING_SENDERNAME "; 58 | }elseif($result[0] == "-9"){ 59 | $log[] = "DESTADDR_INVALIDFORMAT "; 60 | $error[] = "DESTADDR_INVALIDFORMAT "; 61 | }elseif($result[0] == "-10"){ 62 | $log[] = "MISSING_USERNAME "; 63 | $error[] = "MISSING_USERNAME "; 64 | }elseif($result[0] == "-11"){ 65 | $log[] = "MISSING_PASS "; 66 | $error[] = "MISSING_PASS "; 67 | }elseif($result[0] == "-12"){ 68 | $log[] = "MISSING_USERNAME "; 69 | $error[] = "MISSING_USERNAME "; 70 | }elseif($result[0] == "-13"){ 71 | $log[] = "INVALID_DESTINATION_ADDRESS "; 72 | $error[] = "INVALID_DESTINATION_ADDRESS "; 73 | }else{ 74 | $log[] = "Message Not Sent Other Error. Error: $return"; 75 | //echo $result[0]; 76 | //$error[] = echo $result[0]; 77 | 78 | $error[] = "Message Not sent Other Error, Show this to the admin-->. Error:" .$result[0]. ""; 79 | //echo $result[0]; 80 | } 81 | 82 | return array( 83 | 'log' => $log, 84 | 'error' => $error, 85 | 'msgid' => $msgid, 86 | ); 87 | } 88 | 89 | function balance(){ 90 | return null; 91 | } 92 | 93 | function report($msgid){ 94 | return null; 95 | } 96 | 97 | //You can spesifically convert your gsm number. See netgsm for example 98 | function utilgsmnumber($number){ 99 | return $number; 100 | } 101 | //You can spesifically convert your message 102 | function utilmessage($message){ 103 | return $message; 104 | } 105 | } 106 | 107 | return array( 108 | 'value' => 'routesms', 109 | 'label' => 'Route Sms', 110 | 'fields' => array( 111 | 'user','pass' 112 | ) 113 | ); -------------------------------------------------------------------------------- /senders/evmaksms.php: -------------------------------------------------------------------------------- 1 | message = $this->utilmessage($message); 6 | $this->gsmnumber = $this->utilgsmnumber($gsmnumber); 7 | } 8 | 9 | function send(){ 10 | if($this->gsmnumber == "numbererror"){ 11 | $log[] = ("Number format error.".$this->gsmnumber); 12 | $error[] = ("Number format error.".$this->gsmnumber); 13 | return null; 14 | } 15 | $params = $this->getParams(); 16 | 17 | $url = "https://api.sendsms.co.tz/api/sendsms/plain?user=$params->user&password=$params->pass&sender=$params->senderid&SMSText=".urlencode($this->message)."&GSM=$this->gsmnumber"; 18 | 19 | 20 | //"http://121.241.242.114:8080/bulksms/bulksms?username=$params->user&password=$params->pass&type=1&dlr=0&destination=$this->gsmnumber&source=$params->senderid&message=".urlencode($this->message)."" 21 | 22 | $log[] = "Request url: ".$url; 23 | $result = file_get_contents($url); 24 | 25 | $return = $result; 26 | $log[] = "response from the server: ".$result; 27 | 28 | $result = explode("|", $result); 29 | if ($result[0] > "1") { 30 | $this->addLog("Message sent."); 31 | $log[] = "Message sent"; 32 | $msgid = $result[2]; 33 | $log[] = "Message id: ".$msgid; 34 | }elseif($result[0] == "-1"){ 35 | $log[] = "SEND_ERROR - Currently not in use "; 36 | $error[] = "SEND_ERROR - Currently not in use "; 37 | }elseif($result[0] == "-2"){ 38 | $log[] = "NOT_ENOUGHCREDITS"; 39 | $error[] = "NOT_ENOUGHCREDITS"; 40 | }elseif($result[0] == "-3"){ 41 | $log[] = "NETWORK_NOTCOVERED"; 42 | $error[] = "NETWORK_NOTCOVERED"; 43 | }elseif($result[0] == "-4"){ 44 | $log[] = "SOCKET_EXCEPTION - Currently not in use "; 45 | $error[] = "SOCKET_EXCEPTION - Currently not in use "; 46 | }elseif($result[0] == "-5"){ 47 | $log[] = "INVALID_USER_OR_PASS "; 48 | $error[] = "INVALID_USER_OR_PASS "; 49 | }elseif($result[0] == "-6"){ 50 | $log[] = "MISSING_DESTINATION_ADDRESS "; 51 | $error[] = "MISSING_DESTINATION_ADDRESS "; 52 | }elseif($result[0] == "-7"){ 53 | $log[] = "MISSING_SMSTEXT "; 54 | $error[] = "MISSING_SMSTEXT "; 55 | }elseif($result[0] == "-8"){ 56 | $log[] = "MISSING_SENDERNAME "; 57 | $error[] = "MISSING_SENDERNAME "; 58 | }elseif($result[0] == "-9"){ 59 | $log[] = "DESTADDR_INVALIDFORMAT "; 60 | $error[] = "DESTADDR_INVALIDFORMAT "; 61 | }elseif($result[0] == "-10"){ 62 | $log[] = "MISSING_USERNAME "; 63 | $error[] = "MISSING_USERNAME "; 64 | }elseif($result[0] == "-11"){ 65 | $log[] = "MISSING_PASS "; 66 | $error[] = "MISSING_PASS "; 67 | }elseif($result[0] == "-12"){ 68 | $log[] = "MISSING_USERNAME "; 69 | $error[] = "MISSING_USERNAME "; 70 | }elseif($result[0] == "-13"){ 71 | $log[] = "INVALID_DESTINATION_ADDRESS "; 72 | $error[] = "INVALID_DESTINATION_ADDRESS "; 73 | }else{ 74 | $log[] = "Message Not Sent Other Error. Error: $return"; 75 | //echo $result[0]; 76 | //$error[] = echo $result[0]; 77 | 78 | $error[] = "Message Not sent Other Error, Show this to the admin-->. Error:" .$result[0]. ""; 79 | //echo $result[0]; 80 | } 81 | 82 | return array( 83 | 'log' => $log, 84 | 'error' => $error, 85 | 'msgid' => $msgid, 86 | ); 87 | } 88 | 89 | function balance(){ 90 | return null; 91 | } 92 | 93 | function report($msgid){ 94 | return null; 95 | } 96 | 97 | //You can spesifically convert your gsm number. See netgsm for example 98 | function utilgsmnumber($number){ 99 | return $number; 100 | } 101 | //You can spesifically convert your message 102 | function utilmessage($message){ 103 | return $message; 104 | } 105 | } 106 | 107 | return array( 108 | 'value' => 'evmaksms', 109 | 'label' => 'EvMak SMS', 110 | 'fields' => array( 111 | 'user','pass' 112 | ) 113 | ); -------------------------------------------------------------------------------- /senders/dakiksms.php: -------------------------------------------------------------------------------- 1 | message = $this->utilmessage($message); 6 | $this->gsmnumber = $this->utilgsmnumber($gsmnumber); 7 | } 8 | function send(){ 9 | if($this->gsmnumber == "numbererror"){ 10 | $log[] = ("Number format error.".$this->gsmnumber); 11 | $error[] = ("Number format error.".$this->gsmnumber); 12 | return null; 13 | } 14 | 15 | $params = $this->getParams(); 16 | $xml_data =''. 17 | ''. 18 | ''. 19 | ''.$params->user.''. 20 | ''.$params->pass.''. 21 | ''. 22 | ''. 23 | ''.$params->senderid.''. 24 | ''.$this->message.''. 25 | ''.$this->gsmnumber.''. 26 | ''. 27 | ''; 28 | $URL = "http://www.dakiksms.com//api/xml_api.php"; 29 | $ch = curl_init($URL); 30 | curl_setopt($ch, CURLOPT_MUTE, 1); 31 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 32 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 33 | curl_setopt($ch, CURLOPT_POST, 1); 34 | curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml')); 35 | curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data"); 36 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 37 | $result = curl_exec($ch); 38 | curl_close($ch); 39 | 40 | $return = $result; 41 | $log[] = ("Sunucudan dönen cevap: ".$result); 42 | 43 | $result = explode("|",$result); 44 | if($result[0]=="OK"){ 45 | $log[] = ("Mesaj Gönderildi."); 46 | }else{ 47 | $log[] = ("Mesaj gönderilemedi. Hata: $return"); 48 | $error[] = ("Mesaj gönderilirken hata oluştu. Hata: $return"); 49 | } 50 | 51 | return array( 52 | 'log' => $log, 53 | 'error' => $error, 54 | 'msgid' => $result[1], 55 | ); 56 | } 57 | function balance(){ 58 | $params = $this->getParams(); 59 | if($params->user && $params->pass){ 60 | $xml_data =''. 61 | ''. 62 | ''. 63 | ''.$params->user.''. 64 | ''.$params->pass.''. 65 | ''. 66 | ''; 67 | 68 | $URL = "http://www.dakiksms.com/api/xml_bakiye.php"; 69 | $ch = curl_init($URL); 70 | curl_setopt($ch, CURLOPT_MUTE, 1); 71 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 72 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 73 | curl_setopt($ch, CURLOPT_POST, 1); 74 | curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml')); 75 | curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data"); 76 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 77 | $output = curl_exec($ch); 78 | curl_close($ch); 79 | 80 | if(!$output){ 81 | return null; 82 | }else{ 83 | return substr($output, 24, -1); 84 | } 85 | }else{ 86 | return null; 87 | } 88 | } 89 | 90 | function report($msgid){ 91 | $params = $this->getParams(); 92 | if($params->user && $params->pass && $msgid){ 93 | $xml_data =''. 94 | ''. 95 | ''. 96 | ''.$params->user.''. 97 | ''.$params->pass.''. 98 | ''. 99 | ''. 100 | ''.$msgid.''. 101 | ''. 102 | ''; 103 | $URL = "http://www.dakiksms.com/api/xml_rapor.php"; 104 | $ch = curl_init($URL); 105 | curl_setopt($ch, CURLOPT_MUTE, 1); 106 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 107 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 108 | curl_setopt($ch, CURLOPT_POST, 1); 109 | curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml')); 110 | curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data"); 111 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 112 | $output = curl_exec($ch); 113 | curl_close($ch); 114 | 115 | if($output){ 116 | return "success"; 117 | }else{ 118 | return "error"; 119 | } 120 | }else{ 121 | return null; 122 | } 123 | } 124 | 125 | //You can spesifically convert your gsm number. See netgsm for example 126 | function utilgsmnumber($number){ 127 | return $number; 128 | } 129 | //You can spesifically convert your message 130 | function utilmessage($message){ 131 | return $message; 132 | } 133 | } 134 | 135 | return array( 136 | 'value' => 'dakiksms', 137 | 'label' => 'Dakik SMS', 138 | 'fields' => array( 139 | 'user','pass' 140 | ) 141 | ); 142 | -------------------------------------------------------------------------------- /senders/msg91.php: -------------------------------------------------------------------------------- 1 | message = $this->utilmessage($message); 6 | $this->gsmnumber = $this->utilgsmnumber($gsmnumber); 7 | } 8 | 9 | function send(){ 10 | if($this->gsmnumber == "numbererror"){ 11 | $log[] = ("Number format error.".$this->gsmnumber); 12 | $error[] = ("Number format error.".$this->gsmnumber); 13 | return null; 14 | } 15 | $params = $this->getParams(); 16 | 17 | //Your authentication key (Go to https://control.msg91.com/apidoc/) 18 | $authKey = $params->authkey; 19 | 20 | //Base URL 21 | //Composed of initial common portion of URL of SMS Gateway Provider 22 | $baseurl = "https://control.msg91.com"; 23 | 24 | //Sender ID, While using route 4 sender id should be 6 characters long. 25 | $senderId = trim($params->senderid); 26 | $senderId = substr($senderId, 0, 6); 27 | 28 | //Define route (SMS Delivery) 29 | //If route = 1 (Route 1 is Normal Route does not send sms to National Do Not Call registry(NDNC) Numbers and only before 9PM IST) 30 | //If route = 4 (Route 4 is Informative Route - 24 hours open) 31 | if(ctype_digit($params->route)){ 32 | $smsRoute = $params->route; 33 | }else{ 34 | $smsRoute = 1; //Using Default route 1 if undefined in settings 35 | } 36 | 37 | //Define Message Type 38 | // Send Unicode Message 39 | // Yes = 1 / No = 0 (if No, Default is English) 40 | if(ctype_digit($params->unicode)){ 41 | $unicodeSupport = $params->unicode; 42 | }else{ 43 | $unicodeSupport = 0; //Unicode support is disbaled if not defined in settings 44 | } 45 | 46 | // Send Flash Message (Dispay SMS directly on mobile screen) 47 | // Yes = 1 / No = 0 48 | if(ctype_digit($params->flash)){ 49 | $flashSupport = $params->flash; 50 | }else{ 51 | $flashSupport = 0; //Flash SMS support is disabled by default if undefined in settings 52 | } 53 | 54 | // Ignore NDNC 55 | // Yes = 1 / No = 0 56 | // ignoreNdnc=1 (if you want system to ignore all NDNC Numbers, useful while using route 4) 57 | if(ctype_digit($params->ignoreNdnc)){ 58 | $ignoreNdnc = $params->ignoreNdnc; 59 | }else{ 60 | $ignoreNdnc = 1; 61 | } 62 | 63 | $text = urlencode($this->message); 64 | $to = $this->gsmnumber; 65 | 66 | // Validation of connection to SMS Gateway Server 67 | $url = "$baseurl/api/validate.php?authkey=$authKey&type=$smsRoute"; //verify connetion to gateway server 68 | $ret = file($url); 69 | $log[] = ("Response returned from the server: ".$ret); 70 | 71 | $sess = explode(",", $ret[0]); 72 | if ($sess[0] == "Valid") { 73 | 74 | $url = "$baseurl/api/sendhttp.php?authkey=$authKey&mobiles=$to&message=$text&sender=$senderId&route=$smsRoute&unicode=$unicodeSupport&flash=$flashSupport"; 75 | echo $url; 76 | $ret = file($url); 77 | $send = array_map('trim',explode(":", $ret[0])); 78 | 79 | if ($send[0] != "CODE" && $send[0] != "Please") { 80 | $log[] = ("Message sent!"); 81 | } else { 82 | $log[] = ("Message could not be sent. Error: $ret"); 83 | $error[] = ("An error occurred while sending the message. Error: $ret"); 84 | } 85 | } else { 86 | $log[] = ("Message could not be sent. Authentication Error: $ret[0]"); 87 | $error[] = ("Authentication failed. $ret[0] "); 88 | } 89 | 90 | return array( 91 | 'log' => $log, 92 | 'error' => $error, 93 | 'msgid' => $send[0], 94 | ); 95 | } 96 | 97 | function balance(){ 98 | $params = $this->getParams(); 99 | if($params->authkey && $params->route){ 100 | $baseurl = "https://control.msg91.com"; 101 | $url = "$baseurl/api/balance.php?authkey=$params->authkey&type=$params->route"; 102 | $result = file_get_contents($url); 103 | $result = array_map('trim',explode(":",$result)); 104 | $cvp = $result[1]; 105 | if ($cvp == 001 || $cvp == 002){ 106 | return null; 107 | }else{ 108 | return $result[0]; 109 | } 110 | }else{ 111 | return null; 112 | } 113 | } 114 | 115 | function report($msgid){ 116 | $params = $this->getParams(); 117 | if($params->authkey && $msgid){ 118 | $baseurl = "https://control.msg91.com"; 119 | $url = "$baseurl/api/check_delivery.php?authkey=$params->authkey&requestid=$msgid"; 120 | $result = file_get_contents($url); 121 | $result = array_map('trim',explode(":",$result)); 122 | $cvp = $result[1]; 123 | if ($cvp == 001 || $cvp == 002){ 124 | return "error"; 125 | }else{ 126 | return "success"; 127 | } 128 | }else{ 129 | return null; 130 | } 131 | } 132 | 133 | //You can spesifically convert your gsm number. See netgsm for example 134 | function utilgsmnumber($number){ 135 | if (strlen($number) == 10){ 136 | $number = '91' . $number; 137 | } 138 | 139 | if (substr($number, 0, 2) != "91"){ 140 | return "numbererror"; 141 | } 142 | 143 | return $number; 144 | } 145 | //You can spesifically convert your message 146 | function utilmessage($message){ 147 | return $message; 148 | } 149 | } 150 | 151 | return array( 152 | 'value' => 'msg91', 153 | 'label' => 'msg91.com (India)', 154 | 'fields' => array( 155 | 'authkey','route','flash','unicode','ignoreNdnc' 156 | ) 157 | ); 158 | -------------------------------------------------------------------------------- /senders/mutlucell.php: -------------------------------------------------------------------------------- 1 | message = $this->utilmessage($message); 7 | $this->gsmnumber = $this->utilgsmnumber($gsmnumber); 8 | } 9 | 10 | function send(){ 11 | if($this->gsmnumber == "numbererror"){ 12 | $log[] = ("Number format error.".$this->gsmnumber); 13 | $error[] = ("Number format error.".$this->gsmnumber); 14 | return null; 15 | } 16 | 17 | $params = $this->getParams(); 18 | 19 | $xml_data =''. 20 | ''. 21 | ''. 22 | ''.$this->message.''. 23 | ''.$this->gsmnumber.''. 24 | ''. 25 | ''; 26 | $URL = "https://smsgw.mutlucell.com/smsgw-ws/sndblkex"; 27 | 28 | $ch = curl_init($URL); 29 | curl_setopt($ch, CURLOPT_MUTE, 1); 30 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 31 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 32 | curl_setopt($ch, CURLOPT_POST, 1); 33 | curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml')); 34 | curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data"); 35 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 36 | $result = curl_exec($ch); 37 | curl_close($ch); 38 | $return = $result; 39 | $log[] = ("Geri Dönüş Kodu: ".$result); 40 | 41 | $result = explode(" ", $result); 42 | if($result[0] == 20){ 43 | $log[]= ("Post edilen xml eksik veya hatalı."); 44 | $error[] = ("Post edilen xml eksik veya hatalı."); 45 | }elseif($result[0] == 21){ 46 | $log[] = ("Kullanılan originatöre sahip değilsiniz."); 47 | $error[] = ("Kullanılan originatöre sahip değilsiniz."); 48 | }elseif($result[0] == 22){ 49 | $log[] = ("Kontörünüz yetersiz."); 50 | $error[] = ("Kontörünüz yetersiz."); 51 | }elseif($result[0] == 23){ 52 | $log[] = ("Kullanıcı adı ya da parolanız hatalı."); 53 | $error[] = ("Kullanıcı adı ya da parolanız hatalı."); 54 | }elseif($result[0] == 24){ 55 | $log[] = ("Şu anda size ait başka bir işlem aktif."); 56 | $error[] = ("Şu anda size ait başka bir işlem aktif."); 57 | }elseif($result[0] == 25){ 58 | $log[] = ("Bu hatayı alırsanız, işlemi 1-2 dk sonra tekrar deneyin."); 59 | $error[] = ("Bu hatayı alırsanız, işlemi 1-2 dk sonra tekrar deneyin."); 60 | }elseif($result[0] == 30){ 61 | $log[] = ("Hesap Aktivasyonu sağlanmamış."); 62 | $error[] = ("Hesap Aktivasyonu sağlanmamış."); 63 | }else{ 64 | $log[] = ("Mesaj Başarıyla Gönderildi."); 65 | } 66 | 67 | return array( 68 | 'log' => $log, 69 | 'error' => $error, 70 | 'msgid' => substr($result[0], 1, -4), 71 | ); 72 | } 73 | function balance(){ 74 | $params = $this->getParams(); 75 | if($params->user && $params->pass){ 76 | $xml_data =''. 77 | ''; 78 | $URL = "https://smsgw.mutlucell.com/smsgw-ws/gtcrdtex"; 79 | $ch = curl_init($URL); 80 | curl_setopt($ch, CURLOPT_MUTE, 1); 81 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 82 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 83 | curl_setopt($ch, CURLOPT_POST, 1); 84 | curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml')); 85 | curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data"); 86 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 87 | $output = curl_exec($ch); 88 | curl_close($ch); 89 | 90 | $result = explode(" ", $output); 91 | if($result[0] == 20){ 92 | return null; 93 | }elseif($result[0] == 23){ 94 | return null; 95 | }else{ 96 | return substr($output, 1, -2); 97 | } 98 | }else{ 99 | return null; 100 | } 101 | } 102 | 103 | function report($msgid){ 104 | $params = $this->getParams(); 105 | if($params->user && $params->pass && $msgid){ 106 | $xml_data =''. 107 | ''; 108 | $URL = "https://smsgw.mutlucell.com/smsgw-ws/gtblkrprtex"; 109 | $ch = curl_init($URL); 110 | curl_setopt($ch, CURLOPT_MUTE, 1); 111 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 112 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 113 | curl_setopt($ch, CURLOPT_POST, 1); 114 | curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml')); 115 | curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data"); 116 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 117 | $output = curl_exec($ch); 118 | curl_close($ch); 119 | if($output != 20 && $output != 23 && $output != 30){ 120 | return "success"; 121 | }else{ 122 | return "error"; 123 | } 124 | }else{ 125 | return null; 126 | } 127 | } 128 | 129 | //You can spesifically convert your gsm number. See netgsm for example 130 | function utilgsmnumber($number){ 131 | return $number; 132 | } 133 | //You can spesifically convert your message 134 | function utilmessage($message){ 135 | return $message; 136 | } 137 | } 138 | 139 | return array( 140 | 'value' => 'mutlucell', 141 | 'label' => 'MutluCell', 142 | 'fields' => array( 143 | 'user','pass' 144 | ) 145 | ); 146 | 147 | -------------------------------------------------------------------------------- /senders/birsms.php: -------------------------------------------------------------------------------- 1 | message = $this->utilmessage($message); 7 | $this->gsmnumber = $this->utilgsmnumber($gsmnumber); 8 | } 9 | 10 | function send(){ 11 | if($this->gsmnumber == "numbererror"){ 12 | $log[] = ("Number format error.".$this->gsmnumber); 13 | $error[] = ("Number format error.".$this->gsmnumber); 14 | return null; 15 | } 16 | $params = $this->getParams(); 17 | 18 | $xml_data =''. 19 | ''. 20 | ''. 21 | ''.$params->pass.''. 22 | ''.$params->user.''. 23 | ''. 24 | 'Default'. 25 | '
'. 26 | ''.$params->senderid.''. 27 | '
'. 28 | ''.$this->message.''. 29 | ''. 30 | ''.$this->gsmnumber.''. 31 | ''. 32 | '
'; 33 | 34 | $URL = "http://api.1sms.com.tr/v1/xml/syncreply/Submit"; 35 | $ch = curl_init($URL); 36 | curl_setopt($ch, CURLOPT_MUTE, 1); 37 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 38 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 39 | curl_setopt($ch, CURLOPT_POST, 1); 40 | curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml')); 41 | curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data"); 42 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 43 | $result = curl_exec($ch); 44 | curl_close($ch); 45 | 46 | $simple = XMLToArray($result); 47 | $cvp = $simple["SUBMITRESPONSE"]["RESPONSE"]["STATUS"]["CODE"]; 48 | $msgID = $simple["SUBMITRESPONSE"]["RESPONSE"]["MESSAGEID"]; 49 | 50 | $log[] = ("Geri Dönüş Kodu: ".$cvp); 51 | 52 | if($cvp != 200){ 53 | $log[]= ("Hata..Mesaj Gönderilemedi."); 54 | $error[] = ("Hata..Mesaj Gönderilemedi."); 55 | }else{ 56 | $log[] = ("Mesaj Başarıyla Gönderildi."); 57 | } 58 | 59 | return array( 60 | 'log' => $log, 61 | 'error' => $error, 62 | 'msgid' => $msgID, 63 | ); 64 | } 65 | function balance(){ 66 | $params = $this->getParams(); 67 | if($params->user && $params->pass){ 68 | $xml_data = 69 | ''. 70 | ''. 71 | ''.$params->pass.''. 72 | ''.$params->user.''. 73 | ''. 74 | ''; 75 | 76 | $URL = "http://api.1sms.com.tr/v1/xml/syncreply/GetBalance"; 77 | 78 | $ch = curl_init($URL); 79 | curl_setopt($ch, CURLOPT_MUTE, 1); 80 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 81 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 82 | curl_setopt($ch, CURLOPT_POST, 1); 83 | curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml')); 84 | curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data"); 85 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 86 | $output = curl_exec($ch); 87 | curl_close($ch); 88 | 89 | $simple = XMLToArray($output); 90 | return substr($simple["GETBALANCERESPONSE"]["RESPONSE"]["BALANCE"]["MAIN"], 0, -5); 91 | }else{ 92 | return null; 93 | } 94 | } 95 | 96 | function report($msgid){ 97 | $params = $this->getParams(); 98 | if($params->user && $params->pass && $msgid){ 99 | $xml_data = 100 | ''. 101 | ''. 102 | ''.$params->pass.''. 103 | ''.$params->user.''. 104 | ''. 105 | ''.$msgid.''. 106 | ''; 107 | 108 | $URL = "http://api.1sms.com.tr/v1/xml/syncreply/Query"; 109 | 110 | $ch = curl_init($URL); 111 | curl_setopt($ch, CURLOPT_MUTE, 1); 112 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 113 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 114 | curl_setopt($ch, CURLOPT_POST, 1); 115 | curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml')); 116 | curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data"); 117 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 118 | $output = curl_exec($ch); 119 | curl_close($ch); 120 | $simple = XMLToArray($output); 121 | $cvp = $simple["QUERYRESPONSE"]["RESPONSE"]["STATUS"]["CODE"]; 122 | if($cvp == 200){ 123 | return "success"; 124 | }else{ 125 | return "error"; 126 | } 127 | }else{ 128 | return null; 129 | } 130 | } 131 | 132 | //You can spesifically convert your gsm number. See netgsm for example 133 | function utilgsmnumber($number){ 134 | if (strlen($number) == 10) { 135 | $number = '90' . $number; 136 | } elseif (strlen($number) == 11) { 137 | $number = '9' . $number; 138 | } 139 | if (substr($number, 0, 3) != "905") { 140 | return "error"; 141 | } 142 | return $number; 143 | } 144 | //You can spesifically convert your message 145 | function utilmessage($message){ 146 | return $message; 147 | } 148 | } 149 | 150 | return array( 151 | 'value' => 'birsms', 152 | 'label' => 'BirSMS', 153 | 'fields' => array( 154 | 'user','pass' 155 | ) 156 | ); 157 | 158 | -------------------------------------------------------------------------------- /senders/netgsm.php: -------------------------------------------------------------------------------- 1 | message = $this->utilmessage($message); 6 | $this->gsmnumber = $this->utilgsmnumber($gsmnumber); 7 | } 8 | 9 | function send(){ 10 | if($this->gsmnumber == "numbererror"){ 11 | $log[] = ("Number format error.".$this->gsmnumber); 12 | $error[] = ("Number format error.".$this->gsmnumber); 13 | return null; 14 | } 15 | $params = $this->getParams(); 16 | 17 | $url = "http://api.netgsm.com.tr/bulkhttppost.asp?usercode=$params->user&password=$params->pass&gsmno=$this->gsmnumber&message=".urlencode($this->message)."&msgheader=$params->senderid"; 18 | $log[] = "Request url: ".$url; 19 | $result = file_get_contents($url); 20 | 21 | $return = $result; 22 | $log[] = "Sunucudan dönen cevap: ".$result; 23 | 24 | $result = explode(" ", $result); 25 | if ($result[0] == "00" || $result[0] == "01" || $result[0] == "02") { 26 | $this->addLog("Message sent."); 27 | $log[] = "Message sent"; 28 | $msgid = $result[1]; 29 | $log[] = "Message id: ".$msgid; 30 | }elseif($result[0] == "10"){ 31 | $log[] = "Mesaj gönderilemedi. Hata: Telefon numarası hatalı"; 32 | $error[] = "Mesaj gönderilemedi. Hata: Telefon numarası hatalı"; 33 | }elseif($result[0] == "20"){ 34 | $log[] = "Mesaj gönderilemedi. Hata: mesaj metni boş veya çok uzun"; 35 | $error[] = "Mesaj gönderilemedi. Hata: mesaj metni boş veya çok uzun"; 36 | }elseif($result[0] == "30"){ 37 | $log[] = "Mesaj gönderilemedi. Hata: Kullanıcı bilgisi bulunamadı"; 38 | $error[] = "Mesaj gönderilemedi. Hata: Kullanıcı bilgisi bulunamadı"; 39 | }elseif($result[0] == "40"){ 40 | $log[] = "Mesaj gönderilemedi. Hata: Geçersiz mesaj başlığı"; 41 | $error[] = "Mesaj gönderilemedi. Hata: Geçersiz mesaj başlığı"; 42 | }elseif($result[0] == "50"){ 43 | $log[] = "Mesaj gönderilemedi. Hata: Kullanıcının kredisi yok"; 44 | $error[] = "Mesaj gönderilemedi. Hata: Kullanıcının kredisi yok"; 45 | }elseif($result[0] == "60"){ 46 | $log[] = "Mesaj gönderilemedi. Hata: Telefon numarası hiç tanımlanmamış"; 47 | $error[] = "Mesaj gönderilemedi. Hata: Telefon numarası hiç tanımlanmamış"; 48 | }elseif($result[0] == "70"){ 49 | $log[] = "Mesaj gönderilemedi. Hata: Mesaj başlığı hatalı"; 50 | $error[] = "Mesaj gönderilemedi. Hata: Mesaj başlığı hatalı"; 51 | }else{ 52 | $log[] = "Mesaj gönderilemedi. Hata: $return"; 53 | $error[] = "Mesaj gönderilirken hata oluştu. Hata: $return"; 54 | } 55 | 56 | return array( 57 | 'log' => $log, 58 | 'error' => $error, 59 | 'msgid' => $msgid, 60 | ); 61 | } 62 | 63 | function balance(){ 64 | $params = $this->getParams(); 65 | 66 | if($params->user && $params->pass){ 67 | $postUrl = "https://api.netgsm.com.tr/xmlpaketkampanya.asp"; 68 | $xmlString="
Netgsm$params->user$params->pass1
"; 69 | // Kalan SMS Adedi Sorgula 70 | $fields = $xmlString; 71 | $ch = curl_init(); 72 | curl_setopt($ch, CURLOPT_URL, $postUrl); 73 | curl_setopt($ch, CURLOPT_POST, 1); 74 | curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); 75 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 76 | $result = curl_exec($ch); 77 | curl_close($ch); 78 | 79 | $url = "http://api.netgsm.com.tr/get_kredi.asp?usercode=$params->user&password=$params->pass"; 80 | // Kalan TL Miktarı Sorgula 81 | $result2 = file_get_contents($url); 82 | $result2 = explode(" ",$result2); 83 | 84 | $result = str_replace("|", " ", $result); 85 | $result = str_replace("
", " ", $result); 86 | $result = "$result | $result2[1] TL"; 87 | 88 | return $result; 89 | }else{ 90 | return null; 91 | } 92 | } 93 | 94 | function report($msgid){ 95 | $params = $this->getParams(); 96 | 97 | if($params->user && $params->pass && $msgid){ 98 | $url = "http://api.netgsm.com.tr/httpbulkrapor.asp?usercode=$params->user&password=$params->pass&bulkid=$msgid&type=0&status="; 99 | //status değiştiriliyor 100 | $url1 = $url."1"; 101 | $result = file_get_contents($url1); 102 | if($result != "30" && $result != "60"){ 103 | return "success"; 104 | }else{ 105 | return "error"; 106 | } 107 | }else{ 108 | return null; 109 | } 110 | } 111 | 112 | function utilgsmnumber($number){ 113 | if (strlen($number) == 10) { 114 | $number = '90' . $number; 115 | } elseif (strlen($number) == 11) { 116 | $number = '9' . $number; 117 | } 118 | 119 | if (substr($number, 0, 3) != "905") { 120 | return "error"; 121 | } 122 | 123 | return $number; 124 | } 125 | 126 | //You can spesifically convert your message 127 | function utilmessage($message){ 128 | $changefrom = array('ı', 'İ', 'ü', 'Ü', 'ö', 'Ö', 'ğ', 'Ğ', 'ç', 'Ç','ş','Ş'); 129 | $changeto = array('i', 'I', 'u', 'U', 'o', 'O', 'g', 'G', 'c', 'C','s','S'); 130 | $message = str_replace($changefrom, $changeto, $message); 131 | return $message; 132 | } 133 | } 134 | 135 | return array( 136 | 'value' => 'netgsm', 137 | 'label' => 'NetGsm', 138 | 'fields' => array( 139 | 'user','pass' 140 | ) 141 | ); 142 | -------------------------------------------------------------------------------- /senders/smsgateway.php: -------------------------------------------------------------------------------- 1 | message = $this->utilmessage($message); 10 | $this->gsmnumber = $this->utilgsmnumber($gsmnumber); 11 | } 12 | 13 | function createContact ($name,$number) { 14 | return $this->makeRequest('/api/v3/contacts/create','POST',['name' => $name, 'number' => $number]); 15 | } 16 | 17 | function getContacts ($page=1) { 18 | return $this->makeRequest('/api/v3/contacts','GET',['page' => $page]); 19 | } 20 | 21 | function getContact ($id) { 22 | return $this->makeRequest('/api/v3/contacts/view/'.$id,'GET'); 23 | } 24 | 25 | 26 | function getDevices ($page=1) 27 | { 28 | return $this->makeRequest('/api/v3/devices','GET',['page' => $page]); 29 | } 30 | 31 | function getDevice ($id) 32 | { 33 | return $this->makeRequest('/api/v3/devices/view/'.$id,'GET'); 34 | } 35 | 36 | function getMessages($page=1) 37 | { 38 | return $this->makeRequest('/api/v3/messages','GET',['page' => $page]); 39 | } 40 | 41 | function getSingleMessage($id) 42 | { 43 | return $this->makeRequest('/api/v3/messages/view/'.$id,'GET'); 44 | } 45 | 46 | function sendMessageToNumber($to, $message, $device, $options=[]) { 47 | $query = array_merge(['number'=>$to, 'message'=>$message, 'device' => $device], $options); 48 | return $this->makeRequest('/api/v3/messages/send','POST',$query); 49 | } 50 | 51 | function sendMessageToManyNumbers ($to, $message, $device, $options=[]) { 52 | $query = array_merge(['number'=>$to, 'message'=>$message, 'device' => $device], $options); 53 | return $this->makeRequest('/api/v3/messages/send','POST', $query); 54 | } 55 | 56 | function sendMessageToContact ($to, $message, $device, $options=[]) { 57 | $query = array_merge(['contact'=>$to, 'message'=>$message, 'device' => $device], $options); 58 | return $this->makeRequest('/api/v3/messages/send','POST', $query); 59 | } 60 | 61 | function sendMessageToManyContacts ($to, $message, $device, $options=[]) { 62 | $query = array_merge(['contact'=>$to, 'message'=>$message, 'device' => $device], $options); 63 | return $this->makeRequest('/api/v3/messages/send','POST', $query); 64 | } 65 | 66 | function sendManyMessages ($data) { 67 | $query['data'] = $data; 68 | return $this->makeRequest('/api/v3/messages/send','POST', $query); 69 | } 70 | 71 | private function makeRequest ($url, $method, $fields=[]) { 72 | $params = $this->getParams(); 73 | 74 | $fields['email'] = $params->email; 75 | $fields['password'] = $params->pass; 76 | 77 | $url = smsGateway::$baseUrl.$url; 78 | 79 | $fieldsString = http_build_query($fields); 80 | 81 | 82 | $ch = curl_init(); 83 | 84 | if($method == 'POST') 85 | { 86 | curl_setopt($ch,CURLOPT_POST, count($fields)); 87 | curl_setopt($ch,CURLOPT_POSTFIELDS, $fieldsString); 88 | } 89 | else 90 | { 91 | $url .= '?'.$fieldsString; 92 | } 93 | 94 | curl_setopt($ch, CURLOPT_URL,$url); 95 | curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); 96 | curl_setopt($ch, CURLOPT_HEADER , false); // we want headers 97 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 98 | 99 | $result = curl_exec ($ch); 100 | 101 | $return['response'] = json_decode($result,true); 102 | 103 | if($return['response'] == false) 104 | $return['response'] = $result; 105 | 106 | $return['status'] = curl_getinfo($ch, CURLINFO_HTTP_CODE); 107 | 108 | curl_close ($ch); 109 | 110 | return $return; 111 | } 112 | 113 | 114 | function send(){ 115 | 116 | if($this->gsmnumber == "numbererror"){ 117 | $log[] = ("Number format error.".$this->gsmnumber); 118 | $error[] = ("Number format error.".$this->gsmnumber); 119 | return null; 120 | } 121 | $params = $this->getParams(); 122 | 123 | // check list of devices and get the first one: 124 | $getDevicesresult = $this->getDevices(); 125 | $json_string = json_encode($getDevicesresult, JSON_PRETTY_PRINT); 126 | $deviceID = $getDevicesresult['response']['result']['data'][0]['id']; 127 | if (!$deviceID) { 128 | $log[] = "Can not get deviceID. error : ".$json_string; 129 | $error[] = "Can not get deviceID. error: ".$json_string; 130 | } 131 | 132 | // the mess number and content: 133 | $number = $this->gsmnumber; 134 | $message = $this->message; 135 | $options = [ 136 | 'expires_at' => strtotime('+20 minutes') // Cancel the message in 1 hour if the message is not yet sent 137 | ]; 138 | 139 | // call API to send message: 140 | $result = $this->sendMessageToNumber($number, $message, $deviceID, $options); 141 | $json_string = json_encode($result, JSON_PRETTY_PRINT); 142 | 143 | $log[] = "Request send message: ".$message . 'to number: '.$number; 144 | 145 | $return = $result; 146 | $log[] = "smsGateway server response returned: ".$json_string; 147 | 148 | 149 | if ($result['response']['success']) { 150 | $this->addLog("Call API success."); 151 | $log[] = "Call API success."; 152 | $Status = $result['response']['result']['success'][0]['status']; 153 | $send_at = date('Y-m-d h:i:s',$result['response']['result']['success'][0]['send_at']); 154 | 155 | if ($result['response']['result']['success']['error']=="") { 156 | $messid = $result['response']['result']['success'][0]['id']; 157 | $this->addLog("Message id: " . $messid . " was sent at" . $send_at . " Status: ".$Status); 158 | $log[] = "Message id: " . $messid . " sent at: " . $send_at . " Status: ".$Status; 159 | }elseif($result['response']['result']['fails']['errors']) { 160 | $error = json_encode($result['response']['result']['fails']['errors'], JSON_PRETTY_PRINT); 161 | $log[] = "Error when sending message. error : ".$error; 162 | $error[] = "An error occurred while sending messages. error: ".$error; 163 | }else{ 164 | $log[] = "Unable to send message. error : ".$json_string; 165 | $error[] = "An error occurred while sending messages. error: ".$json_string; 166 | } 167 | }else{ 168 | $log[] = "Unable to send message. error : ".$json_string; 169 | $error[] = "An error occurred while sending messages. error: ".$json_string; 170 | } 171 | return array( 172 | 'log' => $log, 173 | 'error' => $error, 174 | 'msgid' => $messid, 175 | ); 176 | } 177 | 178 | function balance(){ 179 | // check list of devices and get the first one: 180 | $getDevicesresult = $this->getDevices(); 181 | $DeviceID = $getDevicesresult['response']['result']['data'][0]['id']; 182 | $Devicename = $getDevicesresult['response']['result']['data'][0]['name']; 183 | $Devicemake = $getDevicesresult['response']['result']['data'][0]['make']; 184 | $Devicemodel = $getDevicesresult['response']['result']['data'][0]['model']; 185 | $Devicenumber = $getDevicesresult['response']['result']['data'][0]['number']; 186 | $battery = $getDevicesresult['response']['result']['data'][0]['battery']; 187 | $Devicesignal = $getDevicesresult['response']['result']['data'][0]['signal']; 188 | $Devicewifi = $getDevicesresult['response']['result']['data'][0]['wifi']; 189 | $device_info = 'ID: '.$DeviceID.' | '.'Name: '.$Devicename. ' '.$Devicemake.' '.$Devicemodel.' | '.'Number: '.$Devicenumber.' | '.'Battery: '.$battery.' | '.'Devicesignal: '.$Devicesignal.' | '.'Devicewifi: '.$Devicewifi; 190 | 191 | if ($device_info) { 192 | return $device_info; 193 | }else { 194 | return 'Can not get Device\'s info'; 195 | } 196 | } 197 | 198 | function report($msgid){ 199 | $id = $msgid; 200 | $result = $this->getSingleMessage($id); 201 | 202 | if ($result['response']['success']) { 203 | $status = $result['response']['result']['status']; 204 | // $report = 'Status: ' . $status . '. Error' . $result['response']['result']['error']; 205 | return $status; 206 | }else { 207 | return 'Unknown'; 208 | } 209 | } 210 | 211 | function utilgsmnumber($number){ 212 | $params = $this->getParams(); 213 | $countrycode = $params->countrycode; 214 | $Cnumber = $countrycode . substr($number, 1); 215 | return $Cnumber; 216 | } 217 | 218 | function utilmessage($message){ 219 | // $params = $this->getParams(); 220 | // $sign = $params->sign 221 | // $message = $message . ' ' . $sign 222 | return $message; 223 | } 224 | } 225 | 226 | return array( 227 | 'value' => 'smsgateway', 228 | 'label' => 'SMS Gateway', 229 | 'fields' => array( 230 | 'email','pass','countrycode' 231 | ) 232 | ); 233 | -------------------------------------------------------------------------------- /smsclass.php: -------------------------------------------------------------------------------- 1 | gsmnumber = $this->util_gsmnumber($gsmnumber); 27 | } 28 | 29 | /** 30 | * @return mixed 31 | */ 32 | public function getGsmnumber(){ 33 | return $this->gsmnumber; 34 | } 35 | 36 | /** 37 | * @param mixed $message 38 | */ 39 | public function setMessage($message){ 40 | $this->message = $this->util_convert($message); 41 | } 42 | 43 | /** 44 | * @return mixed 45 | */ 46 | public function getMessage(){ 47 | return $this->message; 48 | } 49 | 50 | /** 51 | * @param int $userid 52 | */ 53 | public function setUserid($userid){ 54 | $this->userid = $userid; 55 | } 56 | 57 | /** 58 | * @return int 59 | */ 60 | public function getUserid(){ 61 | return $this->userid; 62 | } 63 | 64 | /** 65 | * @return array 66 | */ 67 | public function getParams(){ 68 | $settings = $this->getSettings(); 69 | $params = json_decode($settings['apiparams']); 70 | return $params; 71 | } 72 | 73 | /** 74 | * @return mixed 75 | */ 76 | public function getSender(){ 77 | $settings = $this->getSettings(); 78 | if(!$settings['api']){ 79 | $this->addError("Geçerli bir api seçilmedi"); 80 | $this->addLog("Geçerli bir api seçilmedi"); 81 | return false; 82 | }else{ 83 | return $settings['api']; 84 | } 85 | } 86 | 87 | /** 88 | * @return array 89 | */ 90 | public function getSettings(){ 91 | $result = select_query("mod_aktuelsms_settings", "*"); 92 | return mysql_fetch_array($result); 93 | } 94 | 95 | function send(){ 96 | $sender_function = strtolower($this->getSender()); 97 | if($sender_function == false){ 98 | return false; 99 | }else{ 100 | $params = $this->getParams(); 101 | $message = $this->message; 102 | $message .= " ".$params->signature; 103 | 104 | $this->addLog("Params: ".json_encode($params)); 105 | $this->addLog("To: ".$this->getGsmnumber()); 106 | $this->addLog("Message: ".$message); 107 | $this->addLog("SenderClass: ".$sender_function); 108 | 109 | include_once("senders/".$sender_function.".php"); 110 | $sender = new $sender_function(trim($message),$this->getGsmnumber()); 111 | $result = $sender->send(); 112 | 113 | foreach($result['log'] as $log){ 114 | $this->addLog($log); 115 | } 116 | if($result['error']){ 117 | foreach($result['error'] as $error){ 118 | $this->addError($error); 119 | } 120 | 121 | $this->saveToDb($result['msgid'],'error',$this->getErrors(),$this->getLogs()); 122 | return false; 123 | }else{ 124 | $this->saveToDb($result['msgid'],'',null,$this->getLogs()); 125 | return true; 126 | } 127 | } 128 | } 129 | 130 | function getBalance(){ 131 | $sender_function = strtolower($this->getSender()); 132 | if($sender_function == false){ 133 | return false; 134 | }else{ 135 | include_once("senders/".$sender_function.".php"); 136 | $sender = new $sender_function("",""); 137 | return $sender->balance(); 138 | } 139 | } 140 | 141 | function getReport($msgid){ 142 | $result = mysql_query("SELECT sender FROM mod_aktuelsms_messages WHERE msgid = '$msgid' LIMIT 1"); 143 | $result = mysql_fetch_array($result); 144 | 145 | $sender_function = strtolower($result['sender']); 146 | if($sender_function == false){ 147 | return false; 148 | }else{ 149 | include_once("senders/".$sender_function.".php"); 150 | $sender = new $sender_function("",""); 151 | return $sender->report($msgid); 152 | } 153 | } 154 | 155 | function getSenders(){ 156 | if ($handle = opendir(dirname(__FILE__).'/senders')) { 157 | while (false !== ($entry = readdir($handle))) { 158 | if(substr($entry,strlen($entry)-4,strlen($entry)) == ".php"){ 159 | $file[] = require_once('senders/'.$entry); 160 | } 161 | } 162 | closedir($handle); 163 | } 164 | return $file; 165 | } 166 | 167 | function getHooks(){ 168 | if ($handle = opendir(dirname(__FILE__).'/hooks')) { 169 | while (false !== ($entry = readdir($handle))) { 170 | if(substr($entry,strlen($entry)-4,strlen($entry)) == ".php"){ 171 | $file[] = require_once('hooks/'.$entry); 172 | } 173 | } 174 | closedir($handle); 175 | } 176 | return $file; 177 | } 178 | 179 | function saveToDb($msgid,$status,$errors = null,$logs = null){ 180 | $now = date("Y-m-d H:i:s"); 181 | $table = "mod_aktuelsms_messages"; 182 | $values = array( 183 | "sender" => $this->getSender(), 184 | "to" => $this->getGsmnumber(), 185 | "text" => $this->getMessage(), 186 | "msgid" => $msgid, 187 | "status" => $status, 188 | "errors" => $errors, 189 | "logs" => $logs, 190 | "user" => $this->getUserid(), 191 | "datetime" => $now 192 | ); 193 | insert_query($table, $values); 194 | 195 | $this->addLog("Mesaj veritabanına kaydedildi"); 196 | } 197 | 198 | /* Main message convert function. Will be removed next release */ 199 | function util_convert($message){ 200 | $changefrom = array('ı', 'İ', 'ü', 'Ü', 'ö', 'Ö', 'ğ', 'Ğ', 'ç', 'Ç','ş','Ş'); 201 | $changeto = array('i', 'I', 'u', 'U', 'o', 'O', 'g', 'G', 'c', 'C','s','S'); 202 | return str_replace($changefrom, $changeto, $message); 203 | } 204 | 205 | /* Default number format */ 206 | function util_gsmnumber($number){ 207 | $replacefrom = array('-', '(',')', '.', ',', '+', ' '); 208 | $number = str_replace($replacefrom, '', $number); 209 | 210 | return $number; 211 | } 212 | 213 | public function addError($error){ 214 | $this->errors[] = $error; 215 | } 216 | 217 | public function addLog($log){ 218 | $this->logs[] = $log; 219 | } 220 | 221 | /** 222 | * @return array 223 | */ 224 | public function getErrors() 225 | { 226 | $res = '

    '; 227 | foreach($this->errors as $d){ 228 | $res .= "
  • $d
  • "; 229 | } 230 | $res .= '

'; 231 | return $res; 232 | } 233 | 234 | /** 235 | * @return array 236 | */ 237 | public function getLogs() 238 | { 239 | $res = '

Debug Result

    '; 240 | foreach($this->logs as $d){ 241 | $res .= "
  • $d
  • "; 242 | } 243 | $res .= '

'; 244 | return $res; 245 | } 246 | 247 | /* 248 | * Runs at addon install/update 249 | * This function controls that if there is any change at hooks files. Such as new hook, variable changes at hooks. 250 | */ 251 | function checkHooks($hooks = null){ 252 | if($hooks == null){ 253 | $hooks = $this->getHooks(); 254 | } 255 | 256 | $i=0; 257 | foreach($hooks as $hook){ 258 | $sql = "SELECT `id` FROM `mod_aktuelsms_templates` WHERE `name` = '".$hook['function']."' AND `type` = '".$hook['type']."' LIMIT 1"; 259 | $result = mysql_query($sql); 260 | $num_rows = mysql_num_rows($result); 261 | if($num_rows == 0){ 262 | if($hook['type']){ 263 | $values = array( 264 | "name" => $hook['function'], 265 | "type" => $hook['type'], 266 | "template" => $hook['defaultmessage'], 267 | "variables" => $hook['variables'], 268 | "extra" => $hook['extra'], 269 | "description" => json_encode(@$hook['description']), 270 | "active" => 1 271 | ); 272 | insert_query("mod_aktuelsms_templates", $values); 273 | $i++; 274 | } 275 | }else{ 276 | $values = array( 277 | "variables" => $hook['variables'] 278 | ); 279 | update_query("mod_aktuelsms_templates", $values, "name = '" . $hook['name']."'"); 280 | } 281 | } 282 | return $i; 283 | } 284 | 285 | function getTemplateDetails($template = null){ 286 | $where = array("name" => $template); 287 | $result = select_query("mod_aktuelsms_templates", "*", $where); 288 | $data = mysql_fetch_assoc($result); 289 | 290 | return $data; 291 | } 292 | 293 | function changeDateFormat($date = null){ 294 | $settings = $this->getSettings(); 295 | $dateformat = $settings['dateformat']; 296 | if(!$dateformat){ 297 | return $date; 298 | } 299 | 300 | $date = explode("-",$date); 301 | $year = $date[0]; 302 | $month = $date[1]; 303 | $day = $date[2]; 304 | 305 | $dateformat = str_replace(array("%d","%m","%y"),array($day,$month,$year),$dateformat); 306 | return $dateformat; 307 | } 308 | 309 | } 310 | -------------------------------------------------------------------------------- /aktuel_sms.php: -------------------------------------------------------------------------------- 1 | "Aktuel Sms", 16 | "description" => "WHMCS Sms Addon. You can see details from: https://github.com/AktuelSistem/WHMCS-SmsModule", 17 | "version" => "1.1.8", 18 | "author" => "Aktüel Sistem ve Bilgi Teknolojileri", 19 | "language" => "turkish", 20 | ); 21 | return $configarray; 22 | } 23 | 24 | function aktuel_sms_activate() { 25 | 26 | $query = "CREATE TABLE IF NOT EXISTS `mod_aktuelsms_messages` (`id` int(11) NOT NULL AUTO_INCREMENT,`sender` varchar(40) NOT NULL,`to` varchar(15) DEFAULT NULL,`text` text,`msgid` varchar(50) DEFAULT NULL,`status` varchar(10) DEFAULT NULL,`errors` text,`logs` text,`user` int(11) DEFAULT NULL,`datetime` datetime NOT NULL,PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;"; 27 | mysql_query($query); 28 | 29 | $query = "CREATE TABLE IF NOT EXISTS `mod_aktuelsms_settings` (`id` int(11) NOT NULL AUTO_INCREMENT,`api` varchar(40) CHARACTER SET utf8 NOT NULL,`apiparams` varchar(500) CHARACTER SET utf8 NOT NULL,`wantsmsfield` int(11) DEFAULT NULL,`gsmnumberfield` int(11) DEFAULT NULL,`dateformat` varchar(12) CHARACTER SET utf8 DEFAULT NULL,`version` varchar(6) CHARACTER SET utf8 DEFAULT NULL,PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;"; 30 | mysql_query($query); 31 | 32 | $query = "INSERT INTO `mod_aktuelsms_settings` (`api`, `apiparams`, `wantsmsfield`, `gsmnumberfield`,`dateformat`, `version`) VALUES ('', '', 0, 0,'%d.%m.%y','1.1.3');"; 33 | mysql_query($query); 34 | 35 | $query = "CREATE TABLE IF NOT EXISTS `mod_aktuelsms_templates` (`id` int(11) NOT NULL AUTO_INCREMENT,`name` varchar(50) CHARACTER SET utf8 NOT NULL,`type` enum('client','admin') CHARACTER SET utf8 NOT NULL,`admingsm` varchar(255) CHARACTER SET utf8 NOT NULL,`template` varchar(240) CHARACTER SET utf8 NOT NULL,`variables` varchar(500) CHARACTER SET utf8 NOT NULL,`active` tinyint(1) NOT NULL,`extra` varchar(3) CHARACTER SET utf8 NOT NULL,`description` text CHARACTER SET utf8,PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;"; 36 | mysql_query($query); 37 | 38 | //Creating hooks 39 | require("smsclass.php"); 40 | $class = new AktuelSms(); 41 | $class->checkHooks(); 42 | 43 | return array('status'=>'success','description'=>'Aktuel Sms succesfully activated :)'); 44 | } 45 | 46 | function aktuel_sms_deactivate() { 47 | 48 | $query = "DROP TABLE `mod_aktuelsms_templates`"; 49 | mysql_query($query); 50 | $query = "DROP TABLE `mod_aktuelsms_settings`"; 51 | mysql_query($query); 52 | $query = "DROP TABLE `mod_aktuelsms_messages`"; 53 | mysql_query($query); 54 | 55 | return array('status'=>'success','description'=>'Aktuel Sms succesfully deactivated :('); 56 | } 57 | 58 | function aktuel_sms_upgrade($vars) { 59 | $version = $vars['version']; 60 | 61 | switch($version){ 62 | case "1": 63 | case "1.0.1": 64 | $sql = "ALTER TABLE `mod_aktuelsms_messages` ADD `errors` TEXT NULL AFTER `status` ;ALTER TABLE `mod_aktuelsms_templates` ADD `description` TEXT NULL ;ALTER TABLE `mod_aktuelsms_messages` ADD `logs` TEXT NULL AFTER `errors` ;"; 65 | mysql_query($sql); 66 | case "1.1": 67 | $sql = "ALTER TABLE `mod_aktuelsms_settings` CHANGE `apiparams` `apiparams` VARCHAR( 500 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ;"; 68 | mysql_query($sql); 69 | case "1.1.1": 70 | case "1.1.2": 71 | $sql = "ALTER TABLE `mod_aktuelsms_settings` ADD `dateformat` VARCHAR(12) NULL AFTER `gsmnumberfield`;UPDATE `mod_aktuelsms_settings` SET dateformat = '%d.%m.%y';"; 72 | mysql_query($sql); 73 | case "1.1.3": 74 | case "1.1.4": 75 | $sql = "ALTER TABLE `mod_aktuelsms_templates` CHANGE `name` `name` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,CHANGE `type` `type` ENUM( 'client', 'admin' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,CHANGE `admingsm` `admingsm` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,CHANGE `template` `template` VARCHAR( 240 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,CHANGE `variables` `variables` VARCHAR( 500 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,CHANGE `extra` `extra` VARCHAR( 3 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,CHANGE `description` `description` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ;"; 76 | mysql_query($sql); 77 | $sql = "ALTER TABLE `mod_aktuelsms_settings` CHANGE `api` `api` VARCHAR( 40 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,CHANGE `apiparams` `apiparams` VARCHAR( 500 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,CHANGE `dateformat` `dateformat` VARCHAR( 12 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,CHANGE `version` `version` VARCHAR( 6 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ;"; 78 | mysql_query($sql); 79 | $sql = "ALTER TABLE `mod_aktuelsms_messages` CHANGE `sender` `sender` VARCHAR( 40 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,CHANGE `to` `to` VARCHAR( 15 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,CHANGE `text` `text` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,CHANGE `msgid` `msgid` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,CHANGE `status` `status` VARCHAR( 10 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,CHANGE `errors` `errors` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,CHANGE `logs` `logs` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ;"; 80 | mysql_query($sql); 81 | 82 | $sql = "ALTER TABLE `mod_aktuelsms_templates` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;"; 83 | mysql_query($sql); 84 | $sql = "ALTER TABLE `mod_aktuelsms_settings` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;"; 85 | mysql_query($sql); 86 | $sql = "ALTER TABLE `mod_aktuelsms_messages` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;"; 87 | mysql_query($sql); 88 | case "1.1.5": 89 | case "1.1.6": 90 | case "1.1.7": 91 | break; 92 | 93 | } 94 | 95 | $class = new AktuelSms(); 96 | $class->checkHooks(); 97 | } 98 | 99 | function aktuel_sms_output($vars){ 100 | $modulelink = $vars['modulelink']; 101 | $version = $vars['version']; 102 | $LANG = $vars['_lang']; 103 | putenv("TZ=Europe/Istanbul"); 104 | 105 | $class = new AktuelSms(); 106 | 107 | $tab = $_GET['tab']; 108 | echo ' 109 | 119 | '; 120 | if (!isset($tab) || $tab == "settings") 121 | { 122 | /* UPDATE SETTINGS */ 123 | if ($_POST['params']) { 124 | $update = array( 125 | "api" => $_POST['api'], 126 | "apiparams" => json_encode($_POST['params']), 127 | 'wantsmsfield' => $_POST['wantsmsfield'], 128 | 'gsmnumberfield' => $_POST['gsmnumberfield'], 129 | 'dateformat' => $_POST['dateformat'] 130 | ); 131 | update_query("mod_aktuelsms_settings", $update, ""); 132 | } 133 | /* UPDATE SETTINGS */ 134 | 135 | $settings = $class->getSettings(); 136 | $apiparams = json_decode($settings['apiparams']); 137 | 138 | /* CUSTOM FIELDS START */ 139 | $where = array( 140 | "fieldtype" => array("sqltype" => "LIKE", "value" => "tickbox"), 141 | "showorder" => array("sqltype" => "LIKE", "value" => "on") 142 | ); 143 | $result = select_query("tblcustomfields", "id,fieldname", $where); 144 | $wantsms = ''; 145 | while ($data = mysql_fetch_array($result)) { 146 | if ($data['id'] == $settings['wantsmsfield']) { 147 | $selected = 'selected="selected"'; 148 | } else { 149 | $selected = ""; 150 | } 151 | $wantsms .= ''; 152 | } 153 | 154 | $where = array( 155 | "fieldtype" => array("sqltype" => "LIKE", "value" => "text"), 156 | "showorder" => array("sqltype" => "LIKE", "value" => "on") 157 | ); 158 | $result = select_query("tblcustomfields", "id,fieldname", $where); 159 | $gsmnumber = ''; 160 | while ($data = mysql_fetch_array($result)) { 161 | if ($data['id'] == $settings['gsmnumberfield']) { 162 | $selected = 'selected="selected"'; 163 | } else { 164 | $selected = ""; 165 | } 166 | $gsmnumber .= ''; 167 | } 168 | /* CUSTOM FIELDS FINISH HIM */ 169 | 170 | $classers = $class->getSenders(); 171 | $classersoption = ''; 172 | $classersfields = ''; 173 | foreach($classers as $classer){ 174 | $classersoption .= ''; 175 | if($settings['api'] == $classer['value']){ 176 | foreach($classer['fields'] as $field){ 177 | $classersfields .= 178 | ' 179 | '.$LANG[$field].' 180 | 181 | '; 182 | } 183 | } 184 | } 185 | 186 | echo ' 187 | 194 |
195 | 196 |
197 | 198 | 199 | 200 | 201 | 206 | 207 | 208 | 209 | 210 | 211 | '.$classersfields.' 212 | 213 | 214 | 215 | 216 | 217 | 218 | 223 | 224 | 225 | 226 | 227 | 232 | 233 | 234 | 235 | 236 | 237 | 238 |
'.$LANG['sender'].' 202 | 205 |
'.$LANG['senderid'].' e.g: AktuelHost
'.$LANG['signature'].' e.g: www.aktuelsistem.com
'.$LANG['wantsmsfield'].' 219 | 222 |
'.$LANG['gsmnumberfield'].' 228 | 231 |
'.$LANG['dateformat'].' e.g: %d.%m.%y (27.01.2014)
239 |
240 |

241 |
242 | '; 243 | } 244 | elseif ($tab == "templates") 245 | { 246 | if ($_POST['submit']) { 247 | $where = array("type" => array("sqltype" => "LIKE", "value" => $_GET['type'])); 248 | $result = select_query("mod_aktuelsms_templates", "*", $where); 249 | while ($data = mysql_fetch_array($result)) { 250 | if ($_POST[$data['id'] . '_active'] == "on") { 251 | $tmp_active = 1; 252 | } else { 253 | $tmp_active = 0; 254 | } 255 | $update = array( 256 | "template" => $_POST[$data['id'] . '_template'], 257 | "active" => $tmp_active 258 | ); 259 | 260 | if(isset($_POST[$data['id'] . '_extra'])){ 261 | $update['extra']= trim($_POST[$data['id'] . '_extra']); 262 | } 263 | if(isset($_POST[$data['id'] . '_admingsm'])){ 264 | $update['admingsm']= $_POST[$data['id'] . '_admingsm']; 265 | $update['admingsm'] = str_replace(" ","",$update['admingsm']); 266 | } 267 | update_query("mod_aktuelsms_templates", $update, "id = " . $data['id']); 268 | } 269 | } 270 | 271 | echo '
272 | 273 |
274 | 275 | '; 276 | $where = array("type" => array("sqltype" => "LIKE", "value" => $_GET['type'])); 277 | $result = select_query("mod_aktuelsms_templates", "*", $where); 278 | 279 | while ($data = mysql_fetch_array($result)) { 280 | if ($data['active'] == 1) { 281 | $active = 'checked = "checked"'; 282 | } else { 283 | $active = ''; 284 | } 285 | $desc = json_decode($data['description']); 286 | if(isset($desc->$LANG['lang'])){ 287 | $name = $desc->$LANG['lang']; 288 | }else{ 289 | $name = $data['name']; 290 | } 291 | echo ' 292 | 293 | 294 | 297 | '; 298 | echo ' 299 | 300 | 301 | 302 | 303 | '; 304 | echo ' 305 | 306 | 307 | 308 | 309 | '; 310 | 311 | if(!empty($data['extra'])){ 312 | echo ' 313 | 314 | 315 | 318 | 319 | '; 320 | } 321 | if($_GET['type'] == "admin"){ 322 | echo ' 323 | 324 | 325 | 329 | 330 | '; 331 | } 332 | echo ' 333 | 334 | '; 335 | } 336 | echo ' 337 | 338 |
' . $name . ' 295 | 296 |
'.$LANG['active'].'
'.$LANG['parameter'].'' . $data['variables'] . '
'.$LANG['ekstra'].' 316 | 317 |
'.$LANG['admingsm'].' 326 | 327 | '.$LANG['admingsmornek'].' 328 |

339 |
340 |

341 |
'; 342 | 343 | } 344 | elseif ($tab == "messages") 345 | { 346 | if(!empty($_GET['deletesms'])){ 347 | $smsid = (int) $_GET['deletesms']; 348 | $sql = "DELETE FROM mod_aktuelsms_messages WHERE id = '$smsid'"; 349 | mysql_query($sql); 350 | } 351 | echo ' 352 | 360 | 361 |
362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | '; 376 | 377 | // Getting pagination values. 378 | $page = isset($_GET['page']) ? (int)$_GET['page'] : 1; 379 | $limit = (isset($_GET['limit']) && $_GET['limit']<=50) ? (int)$_GET['limit'] : 10; 380 | $start = ($page > 1) ? ($page*$limit)-$limit : 0; 381 | $order = isset($_GET['order']) ? $_GET['order'] : 'DESC'; 382 | /* Getting messages order by date desc */ 383 | $sql = "SELECT `m`.*,`user`.`firstname`,`user`.`lastname` 384 | FROM `mod_aktuelsms_messages` as `m` 385 | JOIN `tblclients` as `user` ON `m`.`user` = `user`.`id` 386 | ORDER BY `m`.`datetime` {$order} limit {$start},{$limit}"; 387 | $result = mysql_query($sql); 388 | $i = 0; 389 | 390 | //Getting total records 391 | $total = "SELECT count(id) as toplam FROM `mod_aktuelsms_messages`"; 392 | $sonuc = mysql_query($total); 393 | $sonuc = mysql_fetch_array($sonuc); 394 | $toplam = $sonuc['toplam']; 395 | 396 | //Page calculation 397 | $sayfa = ceil($toplam/$limit); 398 | 399 | while ($data = mysql_fetch_array($result)) { 400 | if($data['msgid'] && $data['status'] == ""){ 401 | $status = $class->getReport($data['msgid']); 402 | mysql_query("UPDATE mod_aktuelsms_messages SET status = '$status' WHERE id = ".$data['id'].""); 403 | }else{ 404 | $status = $data['status']; 405 | } 406 | 407 | $i++; 408 | echo ' 409 | 410 | 411 | 412 | 413 | 414 | 415 | '; 416 | } 417 | /* Getting messages order by date desc */ 418 | 419 | echo ' 420 | 421 |
#'.$LANG['client'].''.$LANG['gsmnumber'].''.$LANG['message'].''.$LANG['datetime'].''.$LANG['status'].'
'.$data['id'].''.$data['firstname'].' '.$data['lastname'].''.$data['to'].''.$data['text'].''.$data['datetime'].''.$LANG[$status].'Delete
422 | 423 | '; 424 | $list=""; 425 | for($a=1;$a<=$sayfa;$a++) 426 | { 427 | $selected = ($page==$a) ? 'selected="selected"' : ''; 428 | $list.=""; 429 | } 430 | echo "
"; 431 | 432 | } 433 | elseif($tab=="sendbulk") 434 | { 435 | $settings = $class->getSettings(); 436 | 437 | if(!empty($_POST['client'])){ 438 | $userinf = explode("_",$_POST['client']); 439 | $userid = $userinf[0]; 440 | $gsmnumber = $userinf[1]; 441 | 442 | $class->setGsmnumber($gsmnumber); 443 | $class->setMessage($_POST['message']); 444 | $class->setUserid($userid); 445 | 446 | $result = $class->send(); 447 | if($result == false){ 448 | echo $class->getErrors(); 449 | }else{ 450 | echo $LANG['smssent'].' '.$gsmnumber; 451 | } 452 | 453 | if($_POST["debug"] == "ON"){ 454 | $debug = 1; 455 | } 456 | } 457 | 458 | $userSql = "SELECT `a`.`id`,`a`.`firstname`, `a`.`lastname`, `b`.`value` as `gsmnumber` 459 | FROM `tblclients` as `a` 460 | JOIN `tblcustomfieldsvalues` as `b` ON `b`.`relid` = `a`.`id` 461 | JOIN `tblcustomfieldsvalues` as `c` ON `c`.`relid` = `a`.`id` 462 | WHERE `b`.`fieldid` = '".$settings['gsmnumberfield']."' 463 | AND `c`.`fieldid` = '".$settings['wantsmsfield']."' 464 | AND `c`.`value` = 'on' order by `a`.`firstname`"; 465 | $clients = ''; 466 | $result = mysql_query($userSql); 467 | while ($data = mysql_fetch_array($result)) { 468 | $clients .= ''; 469 | } 470 | echo ' 471 | '; 504 | echo '
505 | 506 |
507 | 508 | 509 | 510 | 511 | 518 | 519 | 520 | 521 | 524 | 525 | 526 | 527 | 528 | 529 | 530 |
'.$LANG['client'].' 512 |
513 | 517 |
'.$LANG['mesaj'].' 522 | 523 |
'.$LANG['debug'].'
531 |
532 |

533 |
'; 534 | 535 | if(isset($debug)){ 536 | echo $class->getLogs(); 537 | } 538 | } 539 | elseif($tab == "update"){ 540 | $currentversion = file_get_contents("https://raw.github.com/AktuelSistem/WHMCS-SmsModule/master/version.txt"); 541 | echo '
'; 542 | if($version != $currentversion){ 543 | echo $LANG['newversion']; 544 | }else{ 545 | echo $LANG['uptodate'].'

'; 546 | } 547 | echo '
'; 548 | } 549 | 550 | $credit = $class->getBalance(); 551 | if($credit){ 552 | echo ' 553 |
554 | '.$LANG['credit'].': '.$credit.' 555 |
'; 556 | } 557 | 558 | echo $LANG['lisans']; 559 | } 560 | --------------------------------------------------------------------------------