<?
//*********************************************************************************
// Original Website By : Niadesain.com Di Jual melalui http://niadesain.com
// Please Call / SMS : 081384745483 (support@niadesain.com)
// Niadesain.com - Jasa Pembuatan Website Paling Murah dan Paling Lengkap
//*********************************************************************************
?>
<?
$adminemail = $db->config("email");
$domain = $db->config("domain");
if(isset($_POST['submit'])){
$first = $_POST['first'];
$last = $_POST['last'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$message = trim($_POST['message']);
if($first == NULL OR $last == NULL OR $email == NULL OR $subject == NULL OR $message == NULL){
$finish .="  <tr><td colspan='2'>Please make sure all the feilds are complete!</td></tr>";
}else{
if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)){ 
$finish .= "<tr><td colspan='2'>Your email address was not valid.</td></tr>";
}else{
$headers = "From: Kontak dari ".$first." di ".$domain." <".$email.">";
mail("".$adminemail."", "".$subject."", "".$message."", $headers);
$finish .="<tr><td colspan='2'>Terima Kasih, Pesan anda Telah Terkirim Ke Admin!</td></tr>";
}}}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Simple PHP Contact Form Script</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
a:link {
	text-decoration: none;
}
a:visited {
	text-decoration: none;
}
a:hover {
	text-decoration: none;
}
a:active {
	text-decoration: none;
}
.style1 {
	font-size: 14px;
	font-weight: bold;
}
.style6 {font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; }
body,td,th {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 11px;
}
-->
</style>
</head>
<body>
<form method="post" action=""> 
  <p align="center" class="style1"><span class="cc01">
    <?
 
$db->select("title, maintext", "content", "published=1 and catid=41");
$ttl = $db->result(0, "title");	
$te = $db->fetch_array();
$tot = $db->num_rows();
for($i=0;$i<$tot;$i++) {
	//echo "<h3>".$db->result($i, "title")."</h3>";
	echo $db->result($i, "maintext");	
	echo "<p>&nbsp;</p>";
	
}		 	
	
?>
  </span></p>
  <p align="center" class="style1">Form Kontak Admin </p>
  <table width="400" border="0" align="center" cellpadding="0" cellspacing="5"> 
    <? echo "".$finish."";?> 
    <tr> 
      <td width="157"><div align="right"><span class="style6">Nama Depan : </span></div></td> 
      <td width="243"><input name="first" type="text" id="first" size="25"></td> 
    </tr> 
    <tr> 
      <td><div align="right"><span class="style6">Nama Belakang : </span></div></td> 
      <td><input name="last" type="text" id="last" size="25"></td> 
    </tr> 
    <tr> 
      <td><div align="right"><span class="style6">Email :</span></div></td> 
      <td><input name="email" type="text" id="email" size="25"></td> 
    </tr> 
    <tr> 
      <td><div align="right"><span class="style6">Judul :</span></div></td> 
      <td><input name="subject" type="text" id="subject" size="25"></td> 
    </tr> 
    <tr> 
      <td valign="top"><div align="right"><span class="style6">Pesan :</span></div></td> 
      <td><span class="style6">
        <textarea name="message" cols="25" rows="5" id="message"></textarea>
      </span></td>
    </tr> 
    <tr> 
      <td valign="top">&nbsp;</td> 
      <td><input name="submit" type="submit" id="submit" value="Kirimkan E-mail Ke Admin"></td> 
    </tr> 
  </table> 
</form> 
</body>
</html>
