<?php set_time_limit(0); ini_set('max_file_uploads', 1000); ini_set('max_execution_time',0); ini_set( "display_errors", 0); set_time_limit(0); session_start(); error_reporting(0);  
require_once("../j_conn/url.php");
require_once("../j_conn/dbc.php");
require_once("../j_incs/functions.php");
if(isset($_SESSION['j_admin'])){  
$ppk = RMC($_POST["ppk"]); 
$psk = RMC($_POST["psk"]); 
$fpk = RMC($_POST["fpk"]); 
$fsk = RMC($_POST["fsk"]); 
$sms_sender = RMC($_POST["sms_sender"]); 
$sms_username = RMC($_POST["sms_username"]); 
$sms_password = RMC($_POST["sms_password"]); 
$acr = RMC($_POST["acr"]); 
$watermark = RMC($_POST["watermark"]);
$reg_fee = RMC($_POST["reg_fee"]);
//
$company = RMC($_POST["company"]);
$motto = RMC($_POST["motto"]);
$desc = RMC($_POST["desc"]);
$country = RMC($_POST["country"]);
$phone = RMC($_POST["phone"]);
$email = RMC($_POST["email"]);
$address = RMC_MSG($_POST["address"]);
$website = RMC($_POST["website"]);
$ntat = RMC($_POST["ntat"]);
$bank_info = RMC_MSG($_POST["bank_info"]); //
$currency = RMC($_POST["currency"]);
$currency_code = RMC($_POST["currency_code"]); $currency_code = htmlspecialchars($currency_code);
$bg_color = RMC($_POST["bg_color"]);
$text_color = RMC($_POST["text_color"]);
$facebook = RMC($_POST["facebook"]);
$twitter = RMC($_POST["twitter"]);
$instagram = RMC($_POST["instagram"]);
$whatsapp = RMC($_POST["whatsapp"]);
$telegram = RMC($_POST["telegram"]);
$youtube = RMC($_POST["youtube"]);
$btc = RMC($_POST["btc"]);
$eth = RMC($_POST["eth"]);
$referral_bonus = RMC($_POST["referral_bonus"]);
$item_order_name = RMC($_POST["item_order_name"]);
$delivery_note = RMC_MSG($_POST["delivery_note"]);
$livechat = RMC_MSG($_POST["livechat"]);

//check country
$sql4="SELECT count(*) as sum from j_countries where j_country='".$country."'"; //check 
$result4 = runSQL($sql4);
$data4 = mysqli_fetch_array($result4);
$sum4 = $data4['sum'];
if($sum4 > 0){
}else{
    //die("<div class='alert alert-danger'> Invalid Country. Try again.</div>
    //<script> $('[name=country]').css({'border-color': 'brown', 'border-width':'1px', 'border-style':'solid'});</script>
    //");
}
//
//j_ppk='".$ppk."', j_psk='".$psk."', j_fpk='".$fpk."', j_fsk='".$fsk."',
$sql4="UPDATE j_company SET 
j_sms_sender='".$sms_sender."', 
j_sms_username='".$sms_username."', 
j_sms_password='".$sms_password."', 
j_acr='".$acr."', 
j_watermark='".$watermark."',
j_name='".$company."',
j_motto='".$motto."',
j_desc='".$desc."',
j_country='".$country."',
j_phone='".$phone."',
j_email='".$email."',
j_address='".$address."',
j_website='".$website."',
j_ntat='".$ntat."',
j_bank_info='".$bank_info."',
j_currency='".$currency."',
j_currency_code='".$currency_code."',
j_bg_color='".$bg_color."',
j_text_color='".$text_color."',
j_facebook='".$facebook."',
j_twitter='".$twitter."',
j_instagram='".$instagram."',
j_whatsapp='".$whatsapp."',
j_telegram='".$telegram."',
j_youtube='".$youtube."',
j_btc_address='".$btc."',
j_eth_address='".$eth."',
j_referral_bonus='".$referral_bonus."',
j_reg_fee='".$reg_fee."',
j_item_order_name='".$item_order_name."',
j_delivery_note='".$delivery_note."',
j_livechat='".$livechat."'
"; // 
$result4 = runSQL($sql4);   
//process files
require_once("file1.php"); 
require_once("file2.php"); 
require_once("file3.php"); 
require_once("file4.php"); 
//
echo "<div class='alert alert-success'> Settings has been updated successfully. <br>
<a href=''>Check Now </a>
</div>";
?>
<script>
//$("#form").trigger('reset');
//document.getElementById("form").reset();
</script>
<?php 
} //not in
?>