<?php
/**
 * This page Check Language Then include current language Label files
 *
 * PHP version 7.3
 *
 * @package        SMS
 * @version        Release 1.0.0
 * @create_by      Mohammad aljaouni
 * @create_date    10-08-2020
 * @edited_by      Mohammad aljaouni
 * @last_edit_date 10-08-2020
 * @todo           Nothing
 */
//header('Content-Type: text/html; charset=utf-8');
header('Expires: Sun, 01 Jan 2021 00:00:00 GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', FALSE);
header('Pragma: no-cache');
if(empty($chain) || $chain != "AWdrh78y892Djk*^523*%$#ghgHGHia&%$*)AsfdsLJnLaad") {
    header("location: index.php");
    exit;
}
include("../config/config.php");
/**
 * Check if language not 1 or 2 (1: Arabic, 2: English) set lang 1 as default language
 * Note: If change language settings you must edit settings in changeLanguage.php page
 */
if(!isset($_SESSION["language"]) || !in_array($_SESSION["language"], range(1,2))) {
    $_SESSION["language"] = 1;
}
$userAccount = "MARAFIQ";
$applicationType = "18";
$BSValue =""; //this value concat with every msg don't Change It !!
$root = "../";
$spilter = 120;
$tempMsg = "temp_msg";
$category2 = "category";
$userLogin = "user_login";

$languageArray = array();
$languageArray[1] = array('languageName'=>'عربي','languageSymbol'=>'ar', 'languageLabels'=> 'arabicLabels.php');
$languageArray[2] = array('languageName'=>'English','languageSymbol'=>'en', 'languageLabels'=> 'englishLabels.php');

$_SESSION['langSymbol'] = $languageArray[$_SESSION["language"]]['languageSymbol'];
$_SESSION['languageName'] = $languageArray[$_SESSION["language"]]['languageName'];
include($languageArray[$_SESSION["language"]]['languageLabels']);
include("conn.php");
include($root."functions/paging.php");
include($root."functions/checkSendPorts.php");
if(curlTest() == 5)
{
	include($root."functions/curlSMS.php");
	$spilter = 1;
}
elseif(fsockopenTest() == 5)
{
	//include($root."functions/fsockopen.php");
	$spilter = 1;
}
elseif(fopenTest() == 3)
{
	include($root."functions/fopenSMS.php");
	$spilter = 120;
}
else
{
	echo "لا يوجد لديك دوال مفعلة<br>راجع الإستضافة وفعل إحدى البوابات الثلاث fsockopen و curl و fopen";
}
include($root."functions/functionConvert.php");
include($root."functions/functionUnicode.php");

$userNumber = isset($_SESSION["user_number"]) ? $_SESSION["user_number"] : "user_number";
$userCategory = isset($_SESSION["user_category"]) ? $_SESSION["user_category"] : "user_category";
$history = isset($_SESSION["history"]) ? $_SESSION["history"] : "history";

$query = "select * from cpanel ";
$result = mysqli_query($conn, $query);
$num = mysqli_num_rows($result);
$row = mysqli_fetch_array($result);
$defSender = $row["userSender"];
$msgStart = $row["msgStart"];
$openRegC = $row["openReg"];
$activeC = $row["active"];
$changeSenderC = $row["changeSender"];
$passAccount = $row["password"];
