﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>

<style>
	.tbl{
	direction:rtl;
	font-family:Tahoma;
	font-size:12px
}
	table{
	border:0px black solid;
	

}
	.right{
	background-color:#;
	width:150px;
	line-height:25px;
	font-size:12px;
	color:#444
}
input,select,option,textarea{
	font-family:Tahoma;
	font-size:11px;
	
}
#sent{
	display:block;
	background-color:#F2F8FF;
	border:1px #147BB3 dashed;
	font-family:Tahoma;
	width:580px;
	margin:20px auto 20px auto;
	font-size:12px;
	text-align:center;
	padding:10px;
	border-radius: 5px;
}
#err{
	display:block;
	background-color:#FFF8F4;
	border:1px #147BB3 dashed;
	font-family:Tahoma;
	width:580px;
	margin:20px auto 20px auto;
	font-size:12px;
	text-align:center;
	padding:10px
	
}
</style>
</head>

<body>
<form method="post" action="?send">
	<table width="600" align="center" class="tbl" >
		<tr>
			<td class="right">نام و نام خانوادگی: </td>
			<td class="left"><input type="text" name="data[نام و نام خانوادگی]"/></td>
		</tr>
				<tr>
			<td class="right">آدرس ایمیل معتبر: </td>
			<td class="left"><input type="text" name="data[ایمیل]"/></td>
		</tr>
		<tr>
			<td class="right">محصول خریداری شده: </td>
			<td class="left"><input type="text" name="data[محصول]"/></td>
		</tr>
		<tr>
			<td class="right">مبلغ واریزی: </td>
			<td class="left"><input type="text" name="data[مبلغ واریزی]"/> تومان</td>
		</tr>
		<tr>
			<td class="right">نام بانک: </td>
			<td class="left">
				<select name="data[نام بانک]">
				<option>ملی</option>
				<option>ملت</option>
				<option>سامان</option>
					
				</select>
			</td>
		</tr>
		<tr>
			<td class="right">شماره فیش / پیگیری/ سند: </td>
			<td class="left"><input type="text" name="data[شماره فیش]"/></td>
		</tr>
		<tr>
			<td class="right">تاریخ واریز: </td>
			<td class="left"><input type="text" name="data[تاریخ واریز]"/></td>
		</tr>
		<tr>
			<td class="right" style="width: 150px" valign="top">توضیحات: </td>
			<td class="left">
			<textarea name="data[توضیحات]" style="width: 254px; height: 117px"></textarea></td>
		</tr>
		<tr>
			<td class="right" style="width: 150px" valign="top"></td>
			<td class="left"><input type="submit" value="ارسال" /><input type="reset" value="پاک کردن" /></td>
		</tr>
	</table>
</form>
<?php
if(isset($_GET[send])){
	extract($_POST);
	$to = "irprojeh@gmail.com";
	$subject = "ثبت فیش بانکی";
	$from = "IRProjeh.ir | ایران پروژه";
    //begin of HTML message
    $message = '
<html>
<body>
	<table width="600" align="center" class="tbl" >
	' ;
foreach ($data as $key=>$val)	{
	
	$message .= '	
		<tr>
			<td style="font-family:tahoma;width:200px">'.$key.'</td><br>
			<td style="font-family:tahoma;font-weight:bold">'.$val.'</td>
		</tr> ';
	}
	$message .= '

	</table>

  </body>
</html>
' ;
   //end of message
    $headers  = "From: $from\r\n";
    $headers .= 'Content-type: text/html; charset="utf-8"\r\n';

    
    // now lets send the email.
    if(mail($to, $subject, $message, $headers)){
    ?>
    
<span id="sent">
فیش شما با موفقیت ثبت شد، به زودی پرداخت شما در سیستم تایید خواهد شد و محصول موردنظرتان به صورت خودکار برایتان ارسال خواهد شد.
</span>
    
    <?php
    
    } else {
    ?>
    
<span id="err">در ثبت فیش مشکلی رخ داده است، لطفا دوباره امتحان کنید.</span>
    
    <?php
    
    
    
    }

}	

?>
</body>

</html>
