Location: PHPKode > projects > PHPauction > auction_confirmation.inc.php
<?#//v.2.5.0

/*

Copyright (c), 1999, 2003 - phpauction.org

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation (version 2 or later).

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*/
//require("./config.inc.php");
require("./includes/messages.inc.php");

#// Check if the e-mail has to be sent or not
$emailmode = @mysql_result(@mysql_query("SELECT startemailmode FROM PHPAUCTION_users WHERE id='".$_SESSION['PHPAUCTION_LOGGED_IN']."'"),0,"startemailmode");
if($emailmode != 'yes') return;

#// Retrieve user's prefered language
$USERLANG = @mysql_result(@mysql_query("SELECT language FROM PHPAUCTION_userslanguage WHERE user='".$_SESSION['PHPAUCTION_LOGGED_IN']."'"),0,"language");
if(!isset($USERLANG)) $USERLANG = $SETTINGS['defaultlanguage'];

$buffer = file("./includes/auctionmail.".$USERLANG.".inc.php");

$i = 0;
$j = 0;
while($i < count($buffer)) {
	if(!ereg("^#(.)*$",$buffer[$i])){
		$skipped_buffer[$j] = $buffer[$i];
		$j++;
	}
	$i++;
}


#// Handle time correction

$a_ends = $time+$sessionVars["SELL_duration"]*24*60*60;
$a_ends = date("m-d-Y H:i:s", $a_ends);
$ENDS = explode(" ",$a_ends);
$DATE = explode("-",$ENDS[0]);
$HOUR = explode(":",$ENDS[1]);
$ENDS_DATE = ArrangeDateNoCorrection($DATE[2],$DATE[1],$DATE[0],$HOUR[0],$HOUR[1]);
$pic1 = "nopic.gif";
$pic2 = "nopicture.gif";
copy($image_upload_path.$pic1,$image_upload_path.$pic2);


$message = implode($skipped_buffer,"");


#// #######################################################################
if($FEE > 0)
{
	$query = "SELECT * FROM PHPAUCTION_altpayments";
	$RRR = @mysql_query($query);
	if(@mysql_num_rows($RRR) > 0)
	{
		$ALTPAYMENTS = $MSG_5465.print_money($FEE)."\n".$MSG_5466."\n\n";
		while($row = mysql_fetch_array($RRR))
		{
			$ALTPAYMENTS .= $row["title"]."\n".str_replace("<BR>","\n",$row["description"])."\n\n";
		}
	}
	$message = ereg_replace("<#a_altfeedue#>",$ALTPAYMENTS,$message);
}
else
{
	$message = ereg_replace("<#a_altfeedue#>","",$message);
}
#// #######################################################################


//--Change TAGS with variables content

$message = ereg_replace("<#c_name#>",$userrec["name"],$message);
$message = ereg_replace("<#c_nick#>",$userrec["nick"],$message);
$message = ereg_replace("<#c_address#>",$userrec["address"],$message);
$message = ereg_replace("<#c_city#>",$userrec["city"],$message);
$message = ereg_replace("<#c_country#>",$userrec["country"],$message);
$message = ereg_replace("<#c_zip#>",$userrec["zip"],$message);
$message = ereg_replace("<#c_email#>",$userrec["email"],$message);

if($sessionVars["SELL_atype"] == 1)
{
	$message = ereg_replace("<#a_type#>",$MSG_642,$message);
}
else
{
	$message = ereg_replace("<#a_type#>",$MSG_641,$message);
}

$message = ereg_replace("<#a_buyitnow#>",print_money($buy_now_price),$message);
$message = ereg_replace("<#a_qty#>",$sessionVars["SELL_iquantity"],$message);
$message = ereg_replace("<#a_title#>",$sessionVars["SELL_title"],$message);
$message = ereg_replace("<#a_id#>","'".$auction_id."'",$message);
$message = ereg_replace("<#a_description#>",strip_tags($sessionVars["SELL_description"]),$message);
$message = ereg_replace("<#a_picturl#>",$pcURL,$message);
$message = ereg_replace("<#a_minbid#>",print_money($sessionVars["SELL_minimum_bid"]),$message);
$message = ereg_replace("<#a_resprice#>",print_money($sessionVars["SELL_reserve_price"]),$message);
$message = ereg_replace("<#a_duration#>",$sessionVars["SELL_duration"],$message);
$message = ereg_replace("<#a_location#>","$location",$message);
$message = ereg_replace("<#a_zip#>",$sessionVars["SELL_location_zip"],$message);
$message = ereg_replace("<#a_url#>","$auction_url",$message);
$message = ereg_replace("<#c_sitename#>",$SETTINGS["sitename"],$message);
$message = ereg_replace("<#c_siteurl#>",$SETTINGS["siteurl"],$message);
$message = ereg_replace("<#c_adminemail#>",$SETTINGS["adminmail"],$message);


if($customincrement > 0)
{
	$message = ereg_replace("<#a_customincrement#>",print_money($sessionVars["SELL_customincrement"]),$message);
}
else
{
	$message = ereg_replace("<#a_customincrement#>",$MSG_614,$message);
}



if($shipping == '1'){

	$shipping_string = $MSG_038;

}else{

	$shipping_string = $MSG_032;

}

$message = ereg_replace("<#a_shipping#>","$shipping_string",$message);



if($international){

	$int_string = $MSG_033;

}else{

	$int_string = $MSG_043;

}

$message = ereg_replace("<#a_intern#>","$int_string",$message);

$message = ereg_replace("<#a_payment#>","$payment_text",$message);

$message = ereg_replace("<#a_category#>",$sessionVars["categoriesList"],$message);

$message = ereg_replace("<#a_ends#>",$a_ends,$message);
$message = ereg_replace("&nbsp;"," ",$message);

//--Send to Seller
mail($userrec["email"],"$MSG_099",$message,"From:".$SETTINGS["sitename"]." <".$SETTINGS["adminmail"].">\nReplyTo:".$SETTINGS["adminmail"]);

#// Send Copy to Administrator- ( uncomment next line for copy)
mail($SETTINGS[adminmail],"$MSG_099",$message,"From:".$SETTINGS["sitename"]." <".$SETTINGS["adminmail"].">\nReplyTo:".$SETTINGS["adminmail"]);

?>
Return current item: PHPauction