PK

ADDRLIN : /home/anibklip/adhocacademy.com/
FLL :
Current File : //home/anibklip/adhocacademy.com/feed_action.php

<?php 
	include_once('include/connection.php');
	
	/*echo '<pre>';
	print_r($_POST);
	echo '</pre>';*/
	
	
	
	$course = $_POST['course'];
	$name = $_POST['name'];
	$address = $_POST['address'];
	$city = $_POST['city'];
	$pinCode= $_POST['pinCode'];
	$phone = $_POST['phone'];
	$email = $_POST['email'];
	$feed = $_POST['feed'];
	$suggestion = $_POST['suggestion'];
	
	if($_POST['action']=='add') {
		
		$to="mypratyush@gmail.com";
		$from=$_POST['email'];
	
		$subject="STUDENT INQUERY";// Content fill here
		$msg = '<table border="1" cellpadding="10" cellspacing="0" width="300px">
					<tr>
						<td colspan="2">STUDENT INQUERY</td>
					</tr>
					<tr>
						<td>Course</td>
						<td>'.$_POST['course'].'</td>
					</tr>
					<tr>
						<td>Name:</td>
						<td>'.$_POST['name'].'</td>
					</tr>
					<tr>
						<td>Address:</td>
						<td>'.$_POST['address'].'</td>
					</tr>
					<tr>
						<td>City:</td>
						<td>'.$_POST['city'].'</td>
					</tr>
					<tr>
						<td>Pin Code:</td>
						<td>'.$_POST['pinCode'].'</td>
					</tr>
					<tr>
						<td>Phone:</td>
						<td>'.$_POST['phone'].'</td>
					</tr>
					<tr>
						<td>E-mail:</td>
						<td>'.$_POST['email'].'</td>
					</tr>
				
					<tr>
						<td>Query:</td>
						<td>'.$_POST['suggestion'].'</td>
					</tr>
			</table>' . "\r\n";
		$headers  = 'MIME-Version: 1.0' . "\r\n";
		$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
		$headers .= 'From: ' . $from . "\r\n";	
	
		@mail($to,$subject,$msg,$headers);
		
			
		$insertForFeedBack="INSERT INTO enquiry (course,name,address,city,pinCode,phone,email,feed,suggestion) 
											VALUES ('".$course."','".$name."','".$address."','".$city."','".$pinCode."',
													'".$phone."','".$email."','".$feed."','".$suggestion."')";
		$queryForFeedBack=mysql_query($insertForFeedBack);
		header('location:index.php');
																					
	}
	
	if($_POST['action']=='edit') {
		 $updateForFeedBack="UPDATE enquiry SET course='".$course."',
												name='".$name."',
												address='".$address."',
												city='".$city."',
												pinCode='".$pinCode."',
												phone='".$phone."',
												email='".$email."',
												feed='".$feed."',
												suggestion='".$suggestion."'
											WHERE eId='".$_POST['eId']."'";
		$queryForFeedBack=mysql_query($updateForFeedBack);
		if($_GET['action']=='admin'){
			header('location: ../admin/user_detail/list.php');	
		} else{
			header('location: ../admin/admin.php');	
		}
		
																					
	}
?>


PK 99