// Start module login
include('config.php');
include('settings.php');
print "";
if ($_GET['action'] == 'bedankt'){
Die ("Je account is aangemaakt.
Controleer je mail om je account te activeren");
}
$username = $_POST['username'];
$wacht1 = $_POST['wacht1'];
$option = $_GET['option'];
$action = $_GET['action'];
$username = $_POST['username'];
$wacht1 = $_POST['wacht1'];
$company = $_POST['company'];
$btwnr = $_POST['btwnr'];
$initials = $_POST['initials'];
$name = $_POST['name'];
$adress = $_POST['adress'];
$nr = $_POST['nr'];
$zipcode = $_POST['zipcode'];
$city = $_POST['city'];
$country = $_POST['country'];
$phone = $_POST['phone'];
$mobile = $_POST['mobile'];
$email = $_POST['email'];
$code = $_POST['code'];
if ($_GET['action'] == 'delcart'){
$newquery = "DELETE FROM basket WHERE clientid='".$_SESSION['usr_id']."'";
$newresult = mysql_query($newquery);
print "
";
}
if ($_GET['action'] == 'reguser'){
$timestamp=time();
$testquery = "SELECT * FROM users WHERE username = '$username'";
$testresult = mysql_query($testquery);
$testcount = mysql_num_rows($testresult);
if ($testcount == '0'){
$newquery = "INSERT INTO users SET username = '$username', password = '$wacht1', company = '$company', btwnr = '$btwnr', initials = '$initials', name = '$name', adress = '$adress', nr = '$nr', zipcode = '$zipcode', city = '$city', country = '$country', phone = '$phone', mobile = '$mobile', email = '$email', checkcode = '$code', timestamp = '$timestamp'";
$newresult = mysql_query($newquery);
$query = "SELECT * FROM pages WHERE name = 'rmail'";
$result = mysql_query($query);
$obj = mysql_fetch_object($result);
// email naar nieuwe user sturen.
$site_name = $site.".nl";
$datum = date(" l d-m-Y H:i");
$to = "$email";
$body = str_replace("\n", "
", $body);
$subject = "Registratie Atelier Jan Stallen";
$message = "
Beste $initials $name
U heeft zich aangemeld voor de Jan Stallen webshop.
Hierbij ontvangt u de activatie code.
Klik op de onderstaande link om u account te activeren.
http://www.jan-stallen.com/?code=$code>
Mocht de link niet werken, ga dan naar http://www.jan-stallen.com/activate.php en
voer u code in.
Uw code is: $code.
Het is niet mogelijk op deze mail terug te reageren.
Met vriendelijke groet.
Jan Stallen.
";
$hders = "MIME-Version: 1.0\n";
$hders .= "Content-type: text/html; charset=iso-8859-1\n";
$hders .= "From: \"Atelier Jan Stallen\" \r\n";
mail($to, $subject, $message, $hders) or die("ERROR: Email could not be sent.
");
Die ("Je account is aangemaakt.
Controleer je mail om je account te activeren");
print "
";
} else {
print " Deze gebruikersnaam bestaat al, kies een andere.!";
}
}
if ($_GET['option'] == '') { // check to display login form or shopingcart
if (session_is_registered("usr_loginname")) { // Display login screen or user data
$aantalquery = "SELECT * FROM basket where clientid ='".$_SESSION['usr_id']."'";
$aantalresult = mysql_query($aantalquery) or die(mysql_error());
while ($aantalobj = mysql_fetch_array($aantalresult)){
$aantal = $aantal+$aantalobj[aantal];
$pricequery = "SELECT * FROM shopitems where id = $aantalobj[itemid]";
$priceresult = mysql_query($pricequery);
$priceobj = mysql_fetch_array($priceresult);
$totalprice = $totalprice+($aantalobj[aantal]*$priceobj[price]);
}
$totalprice1 = rtrim($totalprice,'0..9');
$totalprice1 = rtrim($totalprice1,'.');
$totalprice2 = ltrim($totalprice,'0..9');
if ($totalprice1 == '') { $totalprice1 = $totalprice; }
if ($totalprice1 >= '1'){
if ($totalprice2 == '') { $totalprice2 = '.00'; }
if ($totalprice2 == '.1'){ $totalprice2 = '.10'; }
if ($totalprice2 == '.2'){ $totalprice2 = '.20'; }
if ($totalprice2 == '.3'){ $totalprice2 = '.30'; }
if ($totalprice2 == '.4'){ $totalprice2 = '.40'; }
if ($totalprice2 == '.5'){ $totalprice2 = '.50'; }
if ($totalprice2 == '.6'){ $totalprice2 = '.60'; }
if ($totalprice2 == '.7'){ $totalprice2 = '.70'; }
if ($totalprice2 == '.8'){ $totalprice2 = '.80'; }
if ($totalprice2 == '.9'){ $totalprice2 = '.90'; }
}
// print "
";
print "