<?php

//require_once("db_conn_class.php");

require_once("webform_class.php");

//creating object of res info class

$app = new app();

/*$dbh = new db_conn();

$dbh->set_conn();*/

//==========================================================================

//retaining the value of the variables

if(isset($_POST['txtname']) && ($_POST['txtname'] != ""))

{

	$app->name =  str_replace("'"," ",$_POST['txtname']);

}

if(isset($_POST['contact']) && ($_POST['contact'] != ""))

{

	$app->contact =  str_replace("'"," ",$_POST['contact']);

}

if(isset($_POST['email']) && ($_POST['email'] != ""))

{

	$app->email =  str_replace("'"," ",$_POST['email']);

}

if(isset($_POST['country']) && ($_POST['country'] != ""))

{

	$app->country =  str_replace("'"," ",$_POST['country']);

}



if(isset($_POST['location']) && ($_POST['location'] != ""))

{

	$app->location =  str_replace("'"," ",$_POST['location']);

}

if(isset($_POST['qualification']) && ($_POST['qualification'] != ""))

{

	$app->qualification =  str_replace("'"," ",$_POST['qualification']);

}

if(isset($_POST['mode']) && ($_POST['mode'] != ""))

{

	$app->mode =  str_replace("'"," ",$_POST['mode']);

}

if(isset($_POST['cmbCourse']) && ($_POST['cmbCourse'] != ""))

{

	$app->course =  str_replace("'"," ",$_POST['cmbCourse']);

}

if(isset($_POST['cmbDate']) && ($_POST['cmbDate'] != ""))

{

	$app->coursedate =  str_replace("'"," ",$_POST['cmbDate']);

}

if(isset($_POST['comment']) && ($_POST['comment'] != ""))

{

	$app->comment =  str_replace("'"," ",$_POST['comment']);

}



//==========================================================================

//when save button is clicked

if(isset($_POST['txtAction']) && ($_POST['txtAction'] == "save_data"))

{	

    		

    //saving data into database

	$app->InsertData();	

	

	//for sending mail

	$app->SendMail();

	//$id = $_GET['id'];

	//echo $id;

	//return;

	@header("Location:thankyou.php");

}



if(isset($_POST['submit_newsletter_teflkolkata']))
{	
    		
    //saving data into database
	$app->InsertData1();	
	
	//for sending mail
	$app->SendMail1();
	
	@header("Location:thankyou-newsletter.php");
	
}



if(isset($_POST['submit_Live-Online-TEFL']))
{	
    		
    //saving data into database
	$app->InsertData2();	
	
	//for sending mail
	$app->SendMail2();
	
	@header("Location:thankyou.php");
	
}



if(isset($_POST['submit_part-time-tefl']))
{	
    		
    //saving data into database
	$app->InsertData3();	
	
	//for sending mail
	$app->SendMail3();
	
	@header("Location:thankyou.php");
	
}



if(isset($_POST['submit_full-time-tefl']))
{	
    		
    //saving data into database
	$app->InsertData4();	
	
	//for sending mail
	$app->SendMail4();
	
	@header("Location:thankyou.php");
	
}



if(isset($_POST['submit_tefl-online-courses']))
{	
    		
    //saving data into database
	$app->InsertData5();	
	
	//for sending mail
	$app->SendMail5();
	
	@header("Location:thankyou.php");
	
}

//==========================================================================



?>