<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);
$company=($_POST['company']);
$firstname=($_POST['firstname']);
$lastname=($_POST['lastname']);
$street=($_POST['street']);
$plz=($_POST['plz']);
$city=($_POST['city']);
$land=($_POST['land']);
$telefon=($_POST['telefon']);
$telefon2=($_POST['telefon2']);
$telefax=($_POST['telefax']);
$telefax2=($_POST['telefax2']);
$emailL=($_POST['emailL']);
$websiteL=($_POST['websiteL']);
$taxnumber=($_POST['taxnumber']);
$ustid=($_POST['ustid']);
$taxoffice=($_POST['taxoffice']);

if (isset($_POST['save'])) {
if (strlen(@$_POST[company])<=0){@$_POST[company]="";}
if (strlen(@$_POST[firstname])<=0){@$_POST[firstname]="";}
if (strlen(@$_POST[lastname])<=0){@$_POST[lastname]="";}
if (strlen(@$_POST[street])<=0){@$_POST[street]="";}
if (strlen(@$_POST[plz])<=0){@$_POST[plz]="";}
if (strlen(@$_POST[city])<=0){@$_POST[city]="";}
if (strlen(@$_POST[land])<=0){@$_POST[land]="";}
if (strlen(@$_POST[telefon])<=0){@$_POST[telefon]="";}
if (strlen(@$_POST[telefon2])<=0){@$_POST[telefon2]="";}
if (strlen(@$_POST[telefax])<=0){@$_POST[telefax]="";}
if (strlen(@$_POST[telefax2])<=0){@$_POST[telefax2]="";}
if (strlen(@$_POST[emailL])<=0){@$_POST[emailL]="";}
if (strlen(@$_POST[websiteL])<=0){@$_POST[websiteL]="";}
if (strlen(@$_POST[taxnumber])<=0){@$_POST[taxnumber]="";}
if (strlen(@$_POST[ustid])<=0){@$_POST[ustid]="";}
if (strlen(@$_POST[taxoffice])<=0){@$_POST[taxoffice]="";}
$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]='/company=(.+?);/';
$patterns[1]='/firstname=(.+?);/';
$patterns[2]='/lastname=(.+?);/';
$patterns[3]='/street=(.+?);/';
$patterns[4]='/plz=(.+?);/';
$patterns[5]='/city=(.+?);/';
$patterns[6]='/land=(.+?);/';
$patterns[7]='/telefon=(.+?);/';
$patterns[8]='/telefon2=(.+?);/';
$patterns[9]='/telefax=(.+?);/';
$patterns[10]='/telefax2=(.+?);/';
$patterns[11]='/emailL=(.+?);/';
$patterns[12]='/websiteL=(.+?);/';
$patterns[13]='/taxnumber=(.+?);/';
$patterns[14]='/ustid=(.+?);/';
$patterns[15]='/taxoffice=(.+?);/';

@$replacements[0]=sprintf("company=%s%s%s;",$t,$_POST[company],$t);
@$replacements[1]=sprintf("firstname=%s%s%s;",$t,$_POST[firstname],$t);
@$replacements[2]=sprintf("lastname=%s%s%s;",$t,$_POST[lastname],$t);
@$replacements[3]=sprintf("street=%s%s%s;",$t,$_POST[street],$t);
@$replacements[4]=sprintf("plz=%s%s%s;",$t,$_POST[plz],$t);
@$replacements[5]=sprintf("city=%s%s%s;",$t,$_POST[city],$t);
@$replacements[6]=sprintf("land=%s%s%s;",$t,$_POST[land],$t);
@$replacements[7]=sprintf("telefon=%s%s%s;",$t,$_POST[telefon],$t);
@$replacements[8]=sprintf("telefon2=%s%s%s;",$t,$_POST[telefon2],$t);
@$replacements[9]=sprintf("telefax=%s%s%s;",$t,$_POST[telefax],$t);
@$replacements[10]=sprintf("telefax2=%s%s%s;",$t,$_POST[telefax2],$t);
@$replacements[11]=sprintf("emailL=%s%s%s;",$t,$_POST[emailL],$t);
@$replacements[12]=sprintf("websiteL=%s%s%s;",$t,$_POST[websiteL],$t);
@$replacements[13]=sprintf("taxnumber=%s%s%s;",$t,$_POST[taxnumber],$t);
@$replacements[14]=sprintf("ustid=%s%s%s;",$t,$_POST[ustid],$t);
@$replacements[15]=sprintf("taxoffice=%s%s%s;",$t,$_POST[taxoffice],$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);
}
}

include("./../function/forward-s-e.inc.php");
include("./../function/autoX.inc.php");
echo "
<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>
