<div class="box-body">

<div class="padd-lr10">
<div class="box boxStyle2 infoBox margin-b15">
<div class="padd10t">

<table id="tableN" class="col-md-12">
<tr class='tabTop'>
<td colspan="2">

<?PHP 
define("DATA_FILE", $targetedX);
extract($_POST);
@$Canonical=($_POST['Canonical']);
if($Canonical == ""){@$_POST['Canonical']="off";}else{@$_POST['Canonical']="on";}
$Canonical=($_POST['Canonical']);
$lpCansite=($_POST['lpCansite']);
$lpRouting=($_POST['lpRouting']);

if (isset($_POST['save'])) {
if (strlen(@$_POST[Canonical])<=0){@$_POST[Canonical]="";}
if (strlen(@$_POST[lpCansite])<=0){@$_POST[lpCansite]="";}
if (strlen(@$_POST[lpRouting])<=0){@$_POST[lpRouting]="";}
$Message=SaveData();}
else{
@die ("
<span class='resF'>".$resultFalse."</span>
<br>
<br>
<a href='$elink'>
<div class='vlinkS'>
<i class='hvL fa fa-arrow-circle-right padd-right5'></i>
<span class='hvS'>".$back1."</span>
</div>
</a>
");
return ($tag);
}

function SaveData(){
$tag='';
$patterns=array();
$replacements=array();
$content=file(DATA_FILE);
$t=chr(34);

$patterns[0]='/Canonical=(.+?);/';
$patterns[1]='/lpCansite=(.+?);/';
$patterns[2]='/lpRouting=(.+?);/';

@$replacements[0]=sprintf("Canonical=%s%s%s;",$t,$_POST[Canonical],$t);
@$replacements[1]=sprintf("lpCansite=%s%s%s;",$t,$_POST[lpCansite],$t);
@$replacements[2]=sprintf("lpRouting=%s%s%s;",$t,$_POST[lpRouting],$t);

if ($fp=fopen(DATA_FILE,"w")){
$tag="<?PHP \n";
include("./../languages/$_COOKIE[xlanguage]/general.inc.php");
@print_r("<span class='resT'>".$resultTrue."</span>");
fputs($fp,$tag,strlen($tag));
for ($i=1;$i < count($content);$i++){
$check=$content[$i];
$check=(preg_replace($patterns,$replacements,$check));
$check=preg_replace("/\r|\r/s", "\r", $check);
include("./../function/savecheck.inc.php");
if (strlen($check)> 0) $content[$i]=$check;
$line=sprintf('%s',$content[$i]);
fputs($fp,$line,strlen($line));
}
fclose($fp);
}
}

if($lpRouting == ""){
$CanonicalX=$lpCansite;
}else{
$CanonicalX=$lpRouting;
}

if($Canonical == "on"){
$canCheck="<span class='resT'>".$seocaninfo0.": ".$onX."</span>";
}else{
$canCheck="<span class='resF'>".$seocaninfo0.": ".$offX."</span>";
}

if($lpRouting == ""){
$lpRouting=$lpCansite;
}else{
$lpRouting=$lpRouting;
}
include("./../".$SYSP."/functions/htaccess-routing.inc.php");
$savefile=$exX."/.htaccess";
$handle=fopen($savefile, "w");
fwrite($handle,$htaccessR);
fclose($handle);
$oldumask = umask(0);
chmod($savefile, 0644);
umask($oldumask);

$htaccessC=file_get_contents("./../".$SYSD."/".$filename2."-htaccess-webdata.inc.php");
$savefile=$exX."/.htaccess";
$handle=fopen($savefile, "a+");
fwrite($handle,$htaccessC);
fclose($handle);
$oldumask = umask(0);
chmod($savefile, 0644);
umask($oldumask);

include("./../".$SYSP."/functions/htaccess-web.inc.php");
$savefile=$exX."/.htaccess";
$handle=fopen($savefile, "a+");
fwrite($handle,$htaccessX);
fclose($handle);
$oldumask = umask(0);
chmod($savefile, 0644);
umask($oldumask);

echo "
<br>
<br>
".$canCheck."
<br>
<br>
<b>".$seocaninfo4."</b>
<b><a href='".$CanonicalX."' target='blank' class='vlink1'>".$CanonicalX."</a></b>
<br>
<span class='font12'>[".$seocaninfo5."]</span>
<br>
<br>
<a href='$elink'>
<div class='vlinkS'>
<i class='hvL fa fa-arrow-circle-right padd-right5'></i>
<span class='hvS'>".$back1."</span>
</div>
</a>
";
?>
</td>
</tr>

</table>
<div class="clearX box-footer"></div>
</div>
</div>
</div>
</div>
