<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 
include($targetedX);

define("DATA_FILE", $exC."/data-sites/".$webX.".inc.php");
extract($_POST);
$catX=($_POST['catX']);

if (isset($_POST['save'])) {
if (strlen(@$_POST[catX])<=0){@$_POST[catX]="";}

$Message=SaveData();}
else{
@die ("
<span class='resF'>".$resultFalse."</span>
<br>
<br>
<a href='$alink?webX=$webX'>
<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]='/catX=(.+?);/';

@$replacements[0]=sprintf("catX=%s%s%s;",$t,$_POST[catX],$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);
if (strlen($check)> 0) $content[$i]=$check;
$line=sprintf('%s',$content[$i]);
fputs($fp,$line,strlen($line));
}
fclose($fp);
}
}

$catX="cat".$catX."F";
$catX=$$catX;

@unlink($exX."/".$webX.".php");
@unlink($exX."/".$cat1F."/".$webX.".php");
@unlink($exX."/".$cat2F."/".$webX.".php");
@unlink($exX."/".$cat3F."/".$webX.".php");
@unlink($exX."/".$cat4F."/".$webX.".php");
@unlink($exX."/".$cat5F."/".$webX.".php");
@unlink($exX."/".$cat6F."/".$webX.".php");
@unlink($exX."/".$cat7F."/".$webX.".php");
@unlink($exX."/".$cat8F."/".$webX.".php");
@unlink($exX."/".$cat9F."/".$webX.".php");

if($catX == "../"){
$catXx=$exC."/newpages/websiteH.inc.php";
$filecheckX=$exX."/".$webX.".php";
}else{
$catXx=$exC."/newpages/website.inc.php";
$filecheckX=$exX."/".$catX."/".$webX.".php";
}

copy($catXx,$filecheckX);
$oldumask = umask(0);
chmod($filecheckX, 0644);
umask($oldumask);

/*
if (file_exists($filecheckX)){
echo "<span class='resT'>".$loadingS."</span>";
}else{
echo "<span class='resF'>".$loadingF."</span>";
}
*/

// SAVEINFO
$savedateX=time();
$savefileX="do";
$saveData="<?PHP 
\$savedateX='$savedateX';
\$savefileX='$savefileX';
?>";
$saveFile="./../tmp/saveinfo-".$filename2."-sites-sites.inc.php";
$handle=fopen($saveFile, "w");
fwrite($handle,$saveData);
fclose($handle);
$oldumask = umask(0);
chmod($saveFile, 0644);
umask($oldumask);

include("./../function/forward-s-d.inc.php");
include("./../function/autoX.inc.php");
echo "
<br>
<br>
<a href='sites-sites-datax.php?webX=$webX'>
<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>
