Spade

Mini Shell

Directory:~$ /proc/self/root/home/lmsyaran/public_html/css/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ //proc/self/root/home/lmsyaran/public_html/css/rsticketspro.tar

farhad_sms/farhad_sms.php000064400000003270151166600000011470
0ustar00<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.36
	@build			11th August, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		farhad_sms.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');


/***[JCBGUI.class_extends.head.1.$$$$]***/

use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Plugin\CMSPlugin;
/***[/JCBGUI$$$$]***/


/***[JCBGUI.class_extends.comment.1.$$$$]***/
/**
 * Rsticketspro - Farhad_sms plugin.
 *
 * @package   Farhad_sms
 * @since     1.0.0
 *//***[/JCBGUI$$$$]***/

class PlgRsticketsproFarhad_sms extends CMSPlugin
{

/***[JCBGUI.joomla_plugin.main_class_code.3.$$$$]***/
function onRsticketsproAfterStoreTicket($data)
	{
   
//	    echo '<pre>';
//	    var_dump($data);
//	    echo '</pre>';
//	    exit();
}/***[/JCBGUI$$$$]***/

}
farhad_sms/farhad_sms.xml000064400000001751151166600000011503
0ustar00<?xml version="1.0" encoding="utf-8"?>
<extension type="plugin" version="3.8"
group="rsticketspro" method="upgrade">
	<name>PLG_RSTICKETSPRO_FARHAD_SMS</name>
	<creationDate>11th August, 2021</creationDate>
	<author>farhad shahbazi</author>
	<authorEmail>farhad.shahbazi0010@gmail.com</authorEmail>
	<authorUrl>http://farhad.com</authorUrl>
	<copyright>Copyright (C) 2015. All Rights Reserved</copyright>
	<license>GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html</license>
	<version>1.0.0</version>
	<description>PLG_RSTICKETSPRO_FARHAD_SMS_XML_DESCRIPTION</description>

	<!-- Language files -->
	<languages folder="language">
		<language
tag="en-GB">en-GB/en-GB.plg_rsticketspro_farhad_sms.ini</language>
		<language
tag="en-GB">en-GB/en-GB.plg_rsticketspro_farhad_sms.sys.ini</language>
	</languages>

	<!-- Plugin files -->
	<files>
		<filename
plugin="farhad_sms">farhad_sms.php</filename>
		<filename>index.html</filename>
		<folder>language</folder>
	</files>
</extension>farhad_sms/index.html000064400000000054151166600000010642
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>farhad_sms/language/en-GB/en-GB.plg_rsticketspro_farhad_sms.ini000064400000000604151166600000020476
0ustar00PLG_RSTICKETSPRO_FARHAD_SMS="Rsticketspro - Farhad_sms"
PLG_RSTICKETSPRO_FARHAD_SMS_DESCRIPTION="farhad_sms"
PLG_RSTICKETSPRO_FARHAD_SMS_XML_DESCRIPTION="<h1>Rsticketspro -
Farhad_sms (v.1.0.0)</h1> <div style='clear:
both;'></div><p>farhad_sms</p><p>Created by
<a href='http://farhad.com'
target='_blank'>farhad shahbazi</a><br
/><small>Development started 11th August,
2021</small></p>"farhad_sms/language/en-GB/en-GB.plg_rsticketspro_farhad_sms.sys.ini000064400000000604151166600010021314
0ustar00PLG_RSTICKETSPRO_FARHAD_SMS="Rsticketspro - Farhad_sms"
PLG_RSTICKETSPRO_FARHAD_SMS_DESCRIPTION="farhad_sms"
PLG_RSTICKETSPRO_FARHAD_SMS_XML_DESCRIPTION="<h1>Rsticketspro -
Farhad_sms (v.1.0.0)</h1> <div style='clear:
both;'></div><p>farhad_sms</p><p>Created by
<a href='http://farhad.com'
target='_blank'>farhad shahbazi</a><br
/><small>Development started 11th August,
2021</small></p>"farhad_sms/language/en-GB/index.html000064400000000054151166600010013316
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>farhad_sms/language/index.html000064400000000054151166600010012426
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>rsticket_bale_sms/classes/bale_webhook.php000064400000001322151166600010015022
0ustar00<?php

require_once __DIR__.'/send.php';

$param= file_get_contents('php://input');
$param= json_decode($param);

$first_name= $param->message->from->first_name;
$chat_id= $param->message->chat->id;
$message_id= $param->message->message_id;
$message= $param->message->text;
$type= $param->message->chat->type;

if ($message!= '###id###')
    exit();

if ($type== 'group')
    $text= "سلام  {$first_name}  شناسه عددی گروه
{$chat_id} میباشد ";
elseif ($type== 'private')
    $text= "سلام  {$first_name}  شناسه عددی شما
{$chat_id} میباشد ";

$data= [[
    'chat_id'=> $chat_id,
    'text'=> $text
]];


$send= new send;
$send->send_bale_message($data);rsticket_bale_sms/classes/send.php000064400000005741151166600010013343
0ustar00<?php
class send{

    public function __construct($bot_token)
    {
        $this->bot_token= $bot_token;
        $this->getupdates_url=
"https://tapi.bale.ai/bot{$this->bot_token}/getupdates";
        $this->sendmessage_url=
"https://tapi.bale.ai/bot{$this->bot_token}/sendMessage";
    }

    public function send_bale_message($data=[])
    {
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, $this->sendmessage_url);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_POST, 1);
        foreach ($data as $item)
        {
            curl_setopt($curl, CURLOPT_POSTFIELDS, $item);
            $response = curl_exec($curl);
        }

        $response = json_decode($response);
//        $err = curl_error($curl);
        curl_close($curl);
        return $response;
    }

    public function send_sms($mobilenumber, $smsService_input_data,
$smsService_pattern_code, $smsService_username, $smsService_password)
    {

        $SoapClient = new
SoapClient("http://panel.smsema.com/class/sms/wsdlservice/server.php?wsdl");
        $smsService_from = "+983000505";
        
        for($i=0; $i< 3; $i++)
        {
            $result= $SoapClient->sendPatternSms($smsService_from,
(array)$mobilenumber, $smsService_username, $smsService_password,
$smsService_pattern_code, $smsService_input_data);
            if ($result)
                return $result;
        }

    }

    public function getMobile($mobile_number_source,
$mobile_number_source_field, $user_id)
    {

        $db = JFactory::getDbo();
        $query = $db->getQuery(true);


        if ($mobile_number_source == 'additional') {
            $query->select('value');
            $query->from($db->quoteName('#__fields',
'f'));
            $query->join('inner',
$db->quoteName('#__fields_values', 'fv') .
'on' . $db->quoteName('f.id') . '=' .
$db->quoteName('fv.field_id'));
            $query->where($db->quoteName('context') .
'=' . $db->quote('com_users.user'));
            $query->where($db->quoteName('item_id') .
'=' . $user_id);
            $query->where($db->quoteName('f.name') .
'=' . $db->quote($mobile_number_source_field));

            $db->setQuery($query);
            $result = $db->loadResult();


        } elseif ($mobile_number_source == 'community_builder')
{
            $query->select($mobile_number_source_field);
            $query->from($db->quoteName('#__comprofiler',
'cp'));
            $query->where($db->quoteName('user_id') .
'=' . $user_id);


            $db->setQuery($query);
            $result = $db->loadResult();

        }
        elseif ($mobile_number_source == 'username')
        {
            $query->select('username');
            $query->from($db->quoteName('#__users',
'u'));
            $query->where($db->quoteName('id') .
'=' . $user_id);


            $db->setQuery($query);
            $result = $db->loadResult();

        }
        
        return $result;
    }


}rsticket_bale_sms/index.html000064400000000054151166600010012231
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>rsticket_bale_sms/language/en-GB/en-GB.plg_rsticketspro_rsticket_bale_sms.ini000064400000006736151166600010023467
0ustar00PLG_RSTICKETSPRO_RSTICKET_BALE_SMS="Rsticketspro -
Rsticket_bale_sms"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_DESCRIPTION="connect Rsticket to
bale social network and sms panel"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_XML_DESCRIPTION="<h1>Rsticketspro
- Rsticket_bale_sms (v.1.0.0)</h1> <div style='clear:
both;'></div><p>connect Rsticket to bale social network
and sms panel </p><p>Created by <a
href='http://farhad.com' target='_blank'>farhad
shahbazi</a><br /><small>Development started 14th August,
2021</small></p>"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_MOBILE_NUMBER="Mobile Number"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_PANEL_SETTING="Panel Setting"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_MOBILE_NUMBER_SOURCE_LABEL="Mobile
Number Source"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_MOBILE_NUMBER_SOURCE_DESCRIPTION="the
source from which the mobile number is read. If you select the Joomla
option, the user username will be used as the phone number"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_JOOMLA_UESRS_ADDITIONAL_FIELD="joomla
uesrs additional field"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_COMMUNITY_BUILDER="community
builder"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_JOOMLA_USERNAME_FIELD="joomla
username field"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_MOBILE_NUMBER_SOURCE_FIELD_LABEL="Mobile
Number Source Field"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_MOBILE_NUMBER_SOURCE_FIELD_DESCRIPTION="the
name of the column in which the mobile number is stored"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_MOBILE_NUMBER_SOURCE_FIELD_MESSAGE="Error!
Please add some text here."
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_USERNAME_LABEL="Username"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_USERNAME_DESCRIPTION="sms panel
username. If the username is empty, the SMS system will remain
inactive"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_USERNAME_MESSAGE="Error! Please
add some text here."
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_PASSWORD_LABEL="Password"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_PASSWORD_DESCRIPTION="sms panel
password.If the password is empty, the SMS system will remain
inactive"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_PASSWORD_MESSAGE="Error! Please
add some text here."
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_SUBMIT_PATTERN_LABEL="Sms
Submit Pattern"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_SUBMIT_PATTERN_DESCRIPTION="Sms
Submit Pattern.If the submission pattern is blank, no message will be sent
to the user after submitting the ticket"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_SUBMIT_PATTERN_MESSAGE="Error!
Please add some text here."
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_REPLY_PATTERN_LABEL="Sms Reply
Pattern"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_REPLY_PATTERN_DESCRIPTION="Sms
Reply Pattern. If the replay pattern is blank, no message will be sent to
the user after the admin response to the ticket"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_REPLY_PATTERN_MESSAGE="Error!
Please add some text here."
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_BALE_ID_LABEL="Bale ID"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_BALE_ID_DESCRIPTION="You can get
help from Bale @isnullbot to get the group ID.
To get the channel ID, refer to the channel information section in Bale.
To send messages to multiple groups and channels, just separate their
identifiers with (,)"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_BALE_ID_MESSAGE="Error! Please add
some text here."
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_BOT_TOKEN_LABEL="bot token"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_BOT_TOKEN_DESCRIPTION="Visit
@botfather in Bale to create and get the Bot Token"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_BOT_TOKEN_MESSAGE="Error! Please
add some text
here."rsticket_bale_sms/language/en-GB/en-GB.plg_rsticketspro_rsticket_bale_sms.sys.ini000064400000006736151166600010024304
0ustar00PLG_RSTICKETSPRO_RSTICKET_BALE_SMS="Rsticketspro -
Rsticket_bale_sms"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_DESCRIPTION="connect Rsticket to
bale social network and sms panel"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_XML_DESCRIPTION="<h1>Rsticketspro
- Rsticket_bale_sms (v.1.0.0)</h1> <div style='clear:
both;'></div><p>connect Rsticket to bale social network
and sms panel </p><p>Created by <a
href='http://farhad.com' target='_blank'>farhad
shahbazi</a><br /><small>Development started 14th August,
2021</small></p>"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_MOBILE_NUMBER="Mobile Number"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_PANEL_SETTING="Panel Setting"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_MOBILE_NUMBER_SOURCE_LABEL="Mobile
Number Source"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_MOBILE_NUMBER_SOURCE_DESCRIPTION="the
source from which the mobile number is read. If you select the Joomla
option, the user username will be used as the phone number"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_JOOMLA_UESRS_ADDITIONAL_FIELD="joomla
uesrs additional field"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_COMMUNITY_BUILDER="community
builder"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_JOOMLA_USERNAME_FIELD="joomla
username field"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_MOBILE_NUMBER_SOURCE_FIELD_LABEL="Mobile
Number Source Field"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_MOBILE_NUMBER_SOURCE_FIELD_DESCRIPTION="the
name of the column in which the mobile number is stored"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_MOBILE_NUMBER_SOURCE_FIELD_MESSAGE="Error!
Please add some text here."
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_USERNAME_LABEL="Username"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_USERNAME_DESCRIPTION="sms panel
username. If the username is empty, the SMS system will remain
inactive"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_USERNAME_MESSAGE="Error! Please
add some text here."
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_PASSWORD_LABEL="Password"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_PASSWORD_DESCRIPTION="sms panel
password.If the password is empty, the SMS system will remain
inactive"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_PASSWORD_MESSAGE="Error! Please
add some text here."
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_SUBMIT_PATTERN_LABEL="Sms
Submit Pattern"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_SUBMIT_PATTERN_DESCRIPTION="Sms
Submit Pattern.If the submission pattern is blank, no message will be sent
to the user after submitting the ticket"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_SUBMIT_PATTERN_MESSAGE="Error!
Please add some text here."
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_REPLY_PATTERN_LABEL="Sms Reply
Pattern"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_REPLY_PATTERN_DESCRIPTION="Sms
Reply Pattern. If the replay pattern is blank, no message will be sent to
the user after the admin response to the ticket"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_REPLY_PATTERN_MESSAGE="Error!
Please add some text here."
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_BALE_ID_LABEL="Bale ID"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_BALE_ID_DESCRIPTION="You can get
help from Bale @isnullbot to get the group ID.
To get the channel ID, refer to the channel information section in Bale.
To send messages to multiple groups and channels, just separate their
identifiers with (,)"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_BALE_ID_MESSAGE="Error! Please add
some text here."
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_BOT_TOKEN_LABEL="bot token"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_BOT_TOKEN_DESCRIPTION="Visit
@botfather in Bale to create and get the Bot Token"
PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_BOT_TOKEN_MESSAGE="Error! Please
add some text
here."rsticket_bale_sms/language/en-GB/index.html000064400000000054151166600010014704
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>rsticket_bale_sms/language/index.html000064400000000054151166600010014014
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>rsticket_bale_sms/rsticket_bale_sms.php000064400000015216151166600010014450
0ustar00<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.36
	@build			28th March, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		rsticket_bale_sms.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');


/***[JCBGUI.class_extends.head.1.$$$$]***/

use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Plugin\CMSPlugin;
/***[/JCBGUI$$$$]***/


/***[JCBGUI.class_extends.comment.1.$$$$]***/
/**
 * Rsticketspro - Rsticket_bale_sms plugin.
 *
 * @package   Rsticket_bale_sms
 * @since     1.0.0
 *//***[/JCBGUI$$$$]***/

class PlgRsticketsproRsticket_bale_sms extends CMSPlugin
{

/***[JCBGUI.joomla_plugin.main_class_code.4.$$$$]***/
public function onRsticketsproAfterStoreTicket($row)
{

    $row= (object)$row;
    require_once __DIR__.'/classes/send.php';
    $bale_id= $this->params->get('bale_id',0);
    $params= [
        'bale_id'=> $bale_id,
        'id'=> $row->ticket_id,
        'code'=> $row->code,
        'subject'=> $row->subject,
        'message'=> $row->message,
        'created_date'=> $row->date,
        'status_id'=> $row->status_id,
        'priority_id'=> $row->priority_id,
        'department_id'=> $row->department_id,
        'user_id'=> $row->user_id,
        'customer_id'=> $row->customer_id
    ];


    $user= JFactory::getUser();
    $name= $user->get('name', 'guest');
    $db = JFactory::getDbo();

    $query = $db->getQuery(true);
    $query->select('name');
   
$query->from($db->quoteName('#__rsticketspro_statuses'));
   
$query->where($db->quoteName('id').'='.$db->quote($params['status_id']));
    $db->setQuery($query);
    $params['status_title'] = $db->loadResult();


    $query = $db->getQuery(true);
    $query->select('name');
   
$query->from($db->quoteName('#__rsticketspro_priorities'));
   
$query->where($db->quoteName('id').'='.$db->quote($params['priority_id']));
    $db->setQuery($query);
    $params['priority_title'] = $db->loadResult();


    $query = $db->getQuery(true);
    $query->select('name');
   
$query->from($db->quoteName('#__rsticketspro_departments'));
   
$query->where($db->quoteName('id').'='.$db->quote($params['department_id']));
    $db->setQuery($query);
    $params['department_title'] = $db->loadResult();


    $text= "
    شناسه تیکت : {$params['id']}
    کد تیکت : {$params['code']}
    نام فرستنده : {$name}
    دپارتمان : {$params['department_title']}
    وضعیت : {$params['status_title']}
    اولویت : {$params['priority_title']}
    تاریخ ایجاد : {$params['created_date']}
    موضوع : {$params['subject']}
    متن : {$params['message']} ";


    $send= new send($this->params->get('bot_token'));

    foreach (explode(',',$params['bale_id']) as $item)
{
        $data[]= ['chat_id'=> $item,
'text'=>$text];
    }

    $send->send_bale_message($data);
    
    $mobile_number_source =
$this->params->get('mobile_number_source');
    $mobile_number_source_field =
$this->params->get('mobile_number_source_field');
    $smsService_input_data = array(
//        "name" => $name,
        "website_link" => 'https://www.daneh.ir'
    );
    $smsService_pattern_code =
$this->params->get('sms_submit_pattern', 0);
    $smsService_username = 
$this->params->get('sms_username', 0);
    $smsService_password = 
$this->params->get('sms_password', 0);

    if ($smsService_username && $smsService_password &&
$smsService_pattern_code)
    {
        $mobile= $send->getMobile($mobile_number_source,
$mobile_number_source_field, $params['customer_id']);
        if ($mobile)
        {
            $res = $send->send_sms($mobile, $smsService_input_data,
$smsService_pattern_code, $smsService_username, $smsService_password);
        }
    }



}


public function onRsticketsproAfterStoreTicketReply($row, $table= null)
{
    if ($table)
    {
        $row= (object)$row;
        require_once __DIR__.'/classes/send.php';
        $bale_id= $this->params->get('bale_id',0);
        $params= [
            'bale_id'=> $bale_id,
            'id'=> $row->ticket_id,
            'message'=> $row->message,
            'created_date'=> $row->date,
            'user_id'=> $row->user_id
        ];

        $user= JFactory::getUser();
        $name= $user->get('name', 'guest');
        $text= "
        #پاسخ
        شناسه تیکت : {$params['id']}
        نام پاسخ دهنده : {$name}
        تاریخ ایجاد : {$params['created_date']}
        متن : {$params['message']} ";

        $send= new send($this->params->get('bot_token'));

        foreach (explode(',',$params['bale_id']) as
$item) {
            $data[]= ['chat_id'=> $item,
'text'=>$text];
        }

        $send->send_bale_message($data);


        $mobile_number_source =
$this->params->get('mobile_number_source');
        $mobile_number_source_field =
$this->params->get('mobile_number_source_field');
        
        $smsService_input_data = array(
            "Name" => $name,
            "website_link" =>
'https://www.daneh.ir'
        );
        $smsService_pattern_code =
$this->params->get('sms_reply_pattern', 0);
        $smsService_username = 
$this->params->get('sms_username', 0);
        $smsService_password = 
$this->params->get('sms_password', 0);

        if ($smsService_username && $smsService_password &&
$smsService_pattern_code)
        {
            if (isset($row->customer_id))
            {
                $mobile= $send->getMobile($mobile_number_source,
$mobile_number_source_field, $row->customer_id);
                if ($mobile)
                    $send->send_sms($mobile, $smsService_input_data,
$smsService_pattern_code, $smsService_username, $smsService_password);

            }
        }

    }
    
}/***[/JCBGUI$$$$]***/

}
rsticket_bale_sms/rsticket_bale_sms.xml000064400000015417151166600010014464
0ustar00<?xml version="1.0" encoding="utf-8"?>
<extension type="plugin" version="3.8"
group="rsticketspro" method="upgrade">
	<name>PLG_RSTICKETSPRO_RSTICKET_BALE_SMS</name>
	<creationDate>28th March, 2023</creationDate>
	<author>farhad shahbazi</author>
	<authorEmail>farhad.shahbazi0010@gmail.com</authorEmail>
	<authorUrl>http://farhad.com</authorUrl>
	<copyright>Copyright (C) 2015. All Rights Reserved</copyright>
	<license>GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html</license>
	<version>1.0.0</version>
	<description>PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_XML_DESCRIPTION</description>

	<!-- Language files -->
	<languages folder="language">
		<language
tag="en-GB">en-GB/en-GB.plg_rsticketspro_rsticket_bale_sms.ini</language>
		<language
tag="en-GB">en-GB/en-GB.plg_rsticketspro_rsticket_bale_sms.sys.ini</language>
	</languages>

	<!-- Plugin files -->
	<files>
		<filename
plugin="rsticket_bale_sms">rsticket_bale_sms.php</filename>
		<filename>index.html</filename>
		<folder>language</folder>
		<folder>classes</folder>
	</files>

	<!-- Config parameter -->
	<config
		addrulepath="/administrator/components/com_reservation/models/rules"
		addfieldpath="/administrator/components/com_reservation/models/fields"
	>
	<fields name="params">
	<fieldset name="mobilenumber"
label="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_MOBILE_NUMBER">
		<!--  Mobile_number_source Field. Type: List. (joomla) -->
	<field type="list"
               name="mobile_number_source"
              
label="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_MOBILE_NUMBER_SOURCE_LABEL"
              
description="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_MOBILE_NUMBER_SOURCE_DESCRIPTION"
               class="list_class"
               multiple="false"
               default="">
                <!-- Option Set.-->
                <option
value="additional">PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_JOOMLA_UESRS_ADDITIONAL_FIELD</option>
                <option
value="community_builder">PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_COMMUNITY_BUILDER</option>
                <option
value="username">PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_JOOMLA_USERNAME_FIELD</option>
        </field>
		<!--  Mobile_number_source_field Field. Type: Text. (joomla) -->
	<field type="text"
               name="mobile_number_source_field"
              
label="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_MOBILE_NUMBER_SOURCE_FIELD_LABEL"
               size="10"
               maxlength="50"
               default=""
              
description="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_MOBILE_NUMBER_SOURCE_FIELD_DESCRIPTION"
               class="text_area"
               readonly="false"
               disabled="false"
               required="false"
               filter="STRING"
              
message="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_MOBILE_NUMBER_SOURCE_FIELD_MESSAGE"
               autocomplete="on"
              
showon="mobile_number_source:additional,community_builder" />
	</fieldset>
	<fieldset name="panelsetting"
label="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_PANEL_SETTING">
		<!--  Sms_username Field. Type: Text. (joomla) -->
	<field type="text"
               name="sms_username"
              
label="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_USERNAME_LABEL"
               size="10"
               maxlength="50"
               default=""
              
description="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_USERNAME_DESCRIPTION"
               class="text_area"
               readonly="false"
               disabled="false"
               required="false"
               filter="STRING"
              
message="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_USERNAME_MESSAGE"
               autocomplete="on" />
		<!--  Sms_password Field. Type: Text. (joomla) -->
	<field type="text"
               name="sms_password"
              
label="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_PASSWORD_LABEL"
               size="10"
               maxlength="50"
               default=""
              
description="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_PASSWORD_DESCRIPTION"
               class="text_area"
               readonly="false"
               disabled="false"
               required="false"
               filter="STRING"
              
message="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_PASSWORD_MESSAGE"
               autocomplete="on" />
		<!--  Sms_submit_pattern Field. Type: Text. (joomla) -->
	<field type="text"
               name="sms_submit_pattern"
              
label="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_SUBMIT_PATTERN_LABEL"
               size="10"
               maxlength="50"
               default=""
              
description="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_SUBMIT_PATTERN_DESCRIPTION"
               class="text_area"
               readonly="false"
               disabled="false"
               required="false"
               filter="STRING"
              
message="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_SUBMIT_PATTERN_MESSAGE"
               autocomplete="on" />
		<!--  Sms_reply_pattern Field. Type: Text. (joomla) -->
	<field type="text"
               name="sms_reply_pattern"
              
label="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_REPLY_PATTERN_LABEL"
               size="10"
               maxlength="50"
               default=""
              
description="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_REPLY_PATTERN_DESCRIPTION"
               class="text_area"
               readonly="false"
               disabled="false"
               required="false"
               filter="STRING"
              
message="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_SMS_REPLY_PATTERN_MESSAGE"
               autocomplete="on" />
	</fieldset>
	<fieldset name="basic" label="basic">
		<!--  Bale_id Field. Type: Text. (joomla) -->
	<field type="text"
               name="bale_id"
              
label="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_BALE_ID_LABEL"
               size="10"
               maxlength="50"
               default=""
              
description="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_BALE_ID_DESCRIPTION"
               class="text_area"
               readonly="false"
               disabled="false"
               required="false"
               filter="STRING"
              
message="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_BALE_ID_MESSAGE"
               autocomplete="on" />
		<!--  Bot_token Field. Type: Text. (joomla) -->
	<field type="text"
               name="bot_token"
              
label="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_BOT_TOKEN_LABEL"
               size="10"
               maxlength="400"
               default=""
              
description="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_BOT_TOKEN_DESCRIPTION"
               class="text_area"
               readonly="false"
               disabled="false"
               required="false"
               filter="STRING"
              
message="PLG_RSTICKETSPRO_RSTICKET_BALE_SMS_BOT_TOKEN_MESSAGE"
               autocomplete="on" />
	</fieldset>
	</fields>
	</config>
</extension>