1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
| <?
require_once("conn.php");
require_once("access.php");
if(isset($_POST[s1]))
{
$today=date("Y-m-d");
$sql="INSERT into domain_offer
set offeruserid='$_SESSION[MemberID]',
offeruname='$_SESSION[username]',
offerdomainid='$_GET[DomainID]',
offeramount='$_POST[oa]',
offtext='$_POST[m1]',
offdate='$today'";
@mysql_query($sql);
if(mysql_affected_rows()<1)
{
$sql="UPDATE domain_offer
set offeruname='$_SESSION[username]',
offeramount='$_POST[oa]',
offtext='$_POST[m1]',
offdate='$today'
where offeruserid='$_SESSION[MemberID]' and offerdomainid='$_GET[DomainID]'";
@mysql_query($sql);
}
$q1 = "select * from domain_domains, domain_members where domain_domains.domainid = '$_GET[DomainID]' and domain_domains.memberid = domain_members.memberid ";
$r1 = mysql_query($q1) or die(mysql_error());
$a1 = mysql_fetch_array($r1);
$to = $a1[email];
$subject = "Nouvelle offre pour ".$a1[domainname];
$message = "Une nouvelle offre a été posté \n\n";
$message.= "$_POST[m1]\n\nMontant de l'offre: $_POST[oa]";
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "Content-Transfer-Encoding: 8bit\n";
$headers .= "From: $aset[ContactEmail]\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: PHP/" . phpversion()."\n";
mail($to, $subject, $message, $headers);
header("location:offers.php?did=$_GET[DomainID]");
exit();
}
$q1 = "select * from domain_domains where domainid = '$_GET[DomainID]' ";
$r1 = mysql_query($q1) or die(mysql_error());
$a1 = mysql_fetch_array($r1);
$DomainName = $a1[domainname];
$DomainDescription = $a1[domaindescription];
require_once("templates/header.php");
require_once("templates/ContactOwnerTemplate.php");
require_once("templates/footer.php");
?> |
Partager