<?php
require_once("webform_class.php");
@session_start();

//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['dob']) && ($_POST['dob'] != ""))

{

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

}

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

{

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

}

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['occupation']) && ($_POST['occupation'] != ""))

{

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

}

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

{

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

}

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");

}



//TEFLINDIA.com > In Class > Kolkata

if(isset($_POST['submit_newsletter']))

{	

   	

    //saving data into database

	$app->InsertData1();	

	

	//for sending mail

	$app->SendMail1();

	

	$app->SendMailToCandidate1();

	

	$msg ="Thank you for registering for the ACT's newsletter.";

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

	//echo $id;

	//return;

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

}



//TEFLINDIA.com > In Class > Kolkata

if(isset($_POST['submit_application_Home']))

{	

   	if($_SESSION['tb_captcha_key']!=$_POST['tb_captcha'])  

	//check whether stored in session value with the user submitted values

	{

		$_SESSION['CAPTCHA_ERROR'] = "Invalid Captcha Code.";

				

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

	

	}else{


    //saving data into database

	$app->InsertData2();	

	

	//for sending mail

	$app->SendMail2();

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

	//echo $id;

	//return;

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

}





if(isset($_POST['submit_120_hrs_International_tefl_certification_course']))

{	

 if($_SESSION['tb_captcha_key']!=$_POST['tb_captcha'])  

	//check whether stored in session value with the user submitted values

	{

		$_SESSION['CAPTCHA_ERROR'] = "Invalid Captcha Code.";

				

		@header("Location:120-hrs-International-tefl-certification-course.php");

	

	}else{


    //saving data into database

	$app->InsertData3();	

	

	//for sending mail

	$app->SendMail3();

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

	//echo $id;

	//return;

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

}




if(isset($_POST['submit_ofqual_qualification']))

{	

   	if($_SESSION['tb_captcha_key']!=$_POST['tb_captcha'])  

	//check whether stored in session value with the user submitted values

	{

		$_SESSION['CAPTCHA_ERROR'] = "Invalid Captcha Code.";

				

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

	

	}else{

    //saving data into database

	$app->InsertData14();	

	

	//for sending mail

	$app->SendMail14();

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

	//echo $id;

	//return;

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

}








if(isset($_POST['submit_220_hour_tefl_diploma']))

{	

   	if($_SESSION['tb_captcha_key']!=$_POST['tb_captcha'])  

	//check whether stored in session value with the user submitted values

	{

		$_SESSION['CAPTCHA_ERROR'] = "Invalid Captcha Code.";

		@header("Location:220-hour-tefl-diploma.php");

	}else{

		//saving data into database
	
		$app->InsertData4();	
	
		
	
		//for sending mail
	
		$app->SendMail4();
	
		//$id = $_GET['id'];
	
		//echo $id;
	
		//return;
	
		@header("Location:thankyou.php");
	}

}



if(isset($_POST['submit_280_hrs_International_tefl_advanced_diploma_course']))

{	

   	

    //saving data into database

	$app->InsertData5();	

	

	//for sending mail

	$app->SendMail5();

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

	//echo $id;

	//return;

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

}



if(isset($_POST['submit_400_hrs_International_tefl_pg_diploma_course']))

{	

   	if($_SESSION['tb_captcha_key']!=$_POST['tb_captcha'])  

	//check whether stored in session value with the user submitted values

	{

		$_SESSION['CAPTCHA_ERROR'] = "Invalid Captcha Code.";

		@header("Location:400-hrs-International-tefl-pg-diploma-course.php");

	

	}else{

    //saving data into database

	$app->InsertData6();	

	

	//for sending mail

	$app->SendMail6();

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

	//echo $id;

	//return;

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

}



if(isset($_POST['submit_tefl_live_online']))

{	

   	

    //saving data into database

	$app->InsertData7();	

	

	//for sending mail

	$app->SendMail7();

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

	//echo $id;

	//return;

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

}



if(isset($_POST['submit-diploma-in-teaching']))

{	

   	

    //saving data into database

	$app->InsertData8();	

	

	//for sending mail

	$app->SendMail8();

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

	//echo $id;

	//return;

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

}



if(isset($_POST['submit-bachelor-of-education-in-tesol']))

{	

   	

    //saving data into database

	$app->InsertData9();	

	

	//for sending mail

	$app->SendMail9();

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

	//echo $id;

	//return;

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

}



if(isset($_POST['submit-masters-of-arts-in-education-with-tesol']))

{	

   	

    //saving data into database

	$app->InsertData10();	

	

	//for sending mail

	$app->SendMail10();

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

	//echo $id;

	//return;

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

}


if(isset($_POST['phd-in-education']))

{	

   	

    //saving data into database

	$app->InsertData15();	

	

	//for sending mail

	$app->SendMail15();

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

	//echo $id;

	//return;

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

}



if(isset($_POST['submit_500_hrs_International_tefl_pg_diploma_course']))

{	

   	

    //saving data into database

	$app->InsertData11();	

	

	//for sending mail

	$app->SendMail11();

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

	//echo $id;

	//return;

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

}


if(isset($_POST['submit-master-of-education-with-tesol']))

{	

   	

    //saving data into database

	$app->InsertData13();	

	

	//for sending mail

	$app->SendMail13();

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

	//echo $id;

	//return;

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

}



if(isset($_POST['submit_pd_course']))

{	

   	if($_SESSION['tb_captcha_key']!=$_POST['tb_captcha'])  

	//check whether stored in session value with the user submitted values

	{

		$_SESSION['CAPTCHA_ERROR'] = "Invalid Captcha Code.";

				

		@header("Location:professional-doctorate-in-education.php");

	

	}else{

    //saving data into database

	$app->InsertData12();	

	

	//for sending mail

	$app->SendMail12();

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

	//echo $id;

	//return;

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

}



if(isset($_POST['submit_apply']))

{	

   	

    //saving data into database

	$app->InsertData_apply();	

	

	//for sending mail

	$app->SendMail_apply();

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

	//echo $id;

	//return;

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

}

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



?>