HEX
Server: LiteSpeed
System: Linux sv4.hami.host 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64
User: armgroup (1008)
PHP: 8.2.32
Disabled: show_source, system, shell_exec, passthru, exec, popen, proc_open, mail, socket_create, socket_create_listen, socket_create_pair, link, dl, openlog, syslog, stream_socket_server, curl_multi_init
Upload Files
File: /home/armgroup/libs/vendor/melipayamak/php/src/Contacts.php
<?php

namespace Melipayamak;


class Contacts
{
	
	protected $username;
	
	protected $password;
	
	protected $client;
	
	const PATH = 'http://api.payamak-panel.com/post/contacts.asmx?wsdl';
	
	public function __construct($username,$password)
	{
		
		
		if (is_null($username)||is_null($password)) {
			
			die('username/password is empty');
			
			exit;
			
		}
		
		ini_set("soap.wsdl_cache_enabled", "0");
		
		$this->username = $username;
		
		$this->password = $password;
		
		$this->client = new \SoapClient(self::PATH);
		
	}
	
	public function addGroup($groupName,$Descriptions,$showToChilds)
	{
		
		$result = $this->client->AddGroup([
		'username'=> $this->username,
		'password' => $this->password,
		'groupName'=> $groupName,
		'Descriptions'=> $Descriptions,
		'showToChilds'=> $showToChilds
		])->AddGroupResult;
		
		return $result;
		
	}
	
	public function add($options)
	{
		
		$result = $this->client->AddContact($options+[
		'username'=> $this->username,
		'password' => $this->password
		])->AddContactResult;
		
		return $result;
		
	}
	
	public function checkMobileExist($mobileNumber)
	{
		
		$result = $this->client->CheckMobileExistInContact([
		'username'=> $this->username,
		'password' => $this->password,
		'mobileNumber'=> $mobileNumber
		])->CheckMobileExistInContactResult;
		
		return $result;
		
	}
	
	public function get($groupId,$keyword,$from,$count)
	{
		
		$result = $this->client->GetContacts([
		'username'=> $this->username,
		'password' => $this->password,
		'groupId'=> $groupId,
		'keyword'=> $keyword,
		'from'=> $from,
		'count'=> $count
		
		])->GetContactsResult;
		
		return $result;
		
	}
	
	public function getGroups()
	{
		
		$result = $this->client->GetGroups([
		'username'=> $this->username,
		'password' => $this->password
		])->GetGroupsResult;
		
		return $result;
		
	}
	
	public function change($options)
	{
		
		$result = $this->client->ChangeContact($options+[
		'username'=> $this->username,
		'password' => $this->password
		])->ChangeContactResult;
		
		return $result;
		
	}
	
	public function remove($mobilenumber)
	{
		
		$result = $this->client->RemoveContact([
		'username'=> $this->username,
		'password' => $this->password,
		'mobilenumber'=> $mobilenumber
		])->RemoveContactResult;
		
		return $result;
		
	}
	
	public function getEvents($contactId)
	{
		
		$result = $this->client->GetContactEvents([
		'username'=> $this->username,
		'password' => $this->password,
		'contactId'=> $contactId
		])->GetContactEventsResult;
		
		return $result;
		
	}
	
	
}