<?php include 'sets.php';?>
<?php
$title1="$pagepayment $sitecompany - $siteactivity";
$description1="$sitecompany $pagepayment - $siteactivity";
$keywords1="$pagepayment $sitecompany $siteactivity";
$pid="1";
$catimage="0";

if($ppayment==0) {
header ("Location: .");
exit;
}
?>
<!DOCTYPE html>
<html lang="<?php echo $langname ?>">
<head>
<meta charset="utf-8">
<title><?php echo $title1 ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="<?php echo $description1 ?>">
<meta name="keywords" content="<?php echo $keywords1 ?>">
<?php include 'codes.php';?>
</head>
<body>
<?php include 'menunav.php';?>
<div class="container">
<?php if ($menu1==1) { ?><?php include 'menu1.php';?><?php }?>
<div class="contentstyle">
<div class="pages"><div class="content"><h1><?php echo $pagepayment ?> - <?php echo $sitecompany1 ?></h1></div></div>
<div class="content">

<!--payform -->
<div>
<?php
if (isset($_POST['submit'])) {
$name = $mysqli->real_escape_string(strip_tags($_REQUEST['name']));
$name = mb_convert_case($name, MB_CASE_TITLE, "UTF-8");
$name = preg_replace('/\s+/', ' ',$name);
$telephone = $mysqli->real_escape_string(strip_tags($_REQUEST['telephone']));
$email = $mysqli->real_escape_string(strip_tags($_REQUEST['email']));
$email = strtolower($email);
$email = preg_replace('/\s+/', '',$email);
$item = $mysqli->real_escape_string(strip_tags($_REQUEST['item']));
$amount = $mysqli->real_escape_string(strip_tags($_REQUEST['amount']));
$comments = $mysqli->real_escape_string(strip_tags($_REQUEST['comments']));
$comments = str_replace('\r\n', ' ',$comments);
$comments = preg_replace('/\s+/', ' ',$comments);

if ($_REQUEST['notes']=='' AND $name!=' ' AND $name!='' AND (filter_var($email, FILTER_VALIDATE_EMAIL)) AND $_REQUEST['data']==$_POST['code1']) {

$to="$email";
$bcc="$sitemail";
$from="$email";
$reply="$email";
$headers="MIME-Version: 1.0\r\n";
$headers .="Content-type: text/plain; charset=utf-8\r\n";
$headers .="Bcc: $bcc\r\nFrom: $from\r\nReply-To: $reply";
$subject="Payment request $domain";

$message="Payment request $domain
______________________________________________________________________________________

$fieldname: $name
Tel: $telephone
Email: $email
$fieldsubject: $item
$fieldcomments: $comments
______________________________________________________________________________________
$amount Euro

www.$domain
";
mail ($to, $subject, $message, $headers);
?>

<?php echo $textorder ?>
<hr>
 
<div>
<?php echo $fieldname ?>: <?php echo $name ?> <br>
<?php echo $fieldtel ?>: <?php echo $telephone ?> <br>
Email: <?php echo $email ?> <br>
<?php echo $fieldsubject ?>: <?php echo $item ?> <br>
<?php echo $fieldmessage ?>: <?php echo $comments ?>
<hr>
<span class="titles"><?php echo $textamount ?></span> <span class="price"><?php echo $amount ?> &#8364;</span><br>
</div>

<?php include 'includes/payment.php';?>
<?php } ?>

<?php } else { ?>

<form name="forma" method="post">
<div><label for="name" class="hlabel"><?php echo $fieldname ?>*</label> <input type="text" name="name" id="name" placeholder="<?php echo $fieldname ?>*" size="30" maxlength="50" required></div>
<div><label for="telephone" class="hlabel"><?php echo $fieldtel ?></label> <input type="text" name="telephone" id="telephone" placeholder="<?php echo $fieldtel ?>" size="30" maxlength="50"></div>
<div><label for="email" class="hlabel">Email*</label> <input type="email" name="email" id="email" placeholder="Email*" size="30" maxlength="60" required></div>
<div><label for="item"><?php echo $textitem ?></label> <input type="text" name="item" id="item" size="30" maxlength="60"> <label for="amount"><?php echo $textamount ?></label> <input type="text" name="amount" id="amount" size="12" maxlength="10" class="inputauto"> &#8364;</div>
<div><label for="comments" class="hlabel"><?php echo $fieldmessage ?></label> <textarea name="comments" id="comments" placeholder="<?php echo $fieldmessage ?>" rows="8" cols="30"></textarea></div>
<div>
<?
global $data;
$data = mt_rand(100000,1000000);
?>
<label for="code1" class="hlabel"><?php echo $fieldcode ?></label>
<input type="hidden" name="code1" value="<?php echo $code1 ?>">
<input type="hidden" name="data" value="<?php echo $data ?>"> 
<img src="<?php echo $codepath ?>includes/dynamicimage.php?dt=<? global $data; echo base64_encode($data);?>" alt="">
<input type="text" name="code1" id="code1" placeholder="<?php echo $fieldcode ?>" size="16" maxlength="6" class="inputcode" required>
<label class="hide">note<input type="text" name="notes" id="notes" size="1" maxlength="20" class="formsn"></label>
</div>

<div class="divsubmit"><input type="submit" name="submit" class="button buttonsubmit" value="<?php echo $button1 ?>"></div>
<div class="divrequired color2">* <?php echo $fieldrequired ?></div>
</form>

<?php } ?>
</div>
<!--end payform -->

</div></div>
<?php if ($menu2==1) { ?><?php include 'menu2.php';?><?php }?>
</div>
<?php include 'menudown.php';?>
</body>
</html>