<?php



require_once("db_conn_class.php");





class app

{

	public $id;

	public $name;

	public $email;

	public $contact;

	public $course;

	public $course1;

	public $course2;

	public $country;

	public $location;

	public $comment;

	public $status;

	public $deleted;



	

	//constructor [initialize the value of the variables]



	function _construct()



	{



		$this->id  				= 0;

		$this->name         	= "";

		$this->email     		= "";

		$this->contact  		= "";

		$this->course	 		= "";

		$this->course1	 		= "";

		$this->course2	 		= "";

		$this->besttime	 		= "";

		$this->location 		= "";

		$this->country	 		= "";

		$this->comment			= "";

		$this->status   		= "";

		$this->deleted  		= 0;



	}



    //generate max resume id

	function GenerateDataID()

	{



		$dbh = new db_conn();

		$dbh->set_conn();		



		$sql_max_id = "select max(data_id) from tbl_data_entry";

		$result_max_id = mysqli_query($dbh->link ,$sql_max_id);

		//$result_max_id = mysql_query($sql_max_id,$dbh->link);



		if($result_max_id)

		{

			$row = mysqli_fetch_row($result_max_id);

			//$row = mysql_fetch_row($result_max_id);

			$this->id = $row[0] + 1;



		}



	}





	//insert function

	function InsertData()

	{

		$dbh = new db_conn();

		$dbh->set_conn();



		$this->GenerateDataID();

		date_default_timezone_set('Asia/Kolkata');

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



		//insert data into tbl_data_entry table				



		$insert_sql = "insert into tbl_data_entry values ( ";

		$insert_sql = $insert_sql . $this->id. ",";

		$insert_sql = $insert_sql . "'".$this->name."', ";

		$insert_sql = $insert_sql . "'".$this->course."-".$this->course1."-".$this->course2."', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'3', ";

		$insert_sql = $insert_sql . "'Special Education-Kolkata - Kolkata - TTK.com', ";

		$insert_sql = $insert_sql . "'".$this->email. "', ";

		$insert_sql = $insert_sql . "'".$this->contact. "', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'13', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'" .date("Y-m-d H:i:s")."',";

		$insert_sql = $insert_sql . "'" .date("Y-m-d H:i:s")."',";

		$insert_sql = $insert_sql . "'1',";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'ACTIVE', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'" .date("Y-m-d h:i:s")."',";

		$insert_sql = $insert_sql . "'0',";

		$insert_sql = $insert_sql . "'0',";

		$insert_sql = $insert_sql . "'0',";

		$insert_sql = $insert_sql . "'".$this->country."-".$this->location."', ";

		$insert_sql = $insert_sql . "'n/a',";

		$insert_sql = $insert_sql . "'".$this->comment."', ";

		$insert_sql = $insert_sql . "'n/a',";

		$insert_sql = $insert_sql . "'n/a')";

		



		//echo "insert_sql = ".$insert_sql;

		//return;



		$insert_result = mysqli_query($dbh->link ,$insert_sql);

		//$insert_result = mysql_query($insert_sql,$dbh->link);



		if (!$insert_result)

		{

			$this->msg = "Error: ".mysqli_error($dbh->link);

			//$this->msg = "Error: ".mysql_error($dbh->link);

			return;

		}

		else

		{

			$this->msg = "Thank you for for filling the application form";

		}		

	}	



	function SendMail()

	{

		//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

			//sending application entry mail to 

			

			require 'PHPMailerAutoload.php';

			//if(!$_POST) exit;

			//$email = $this->email;    //$res->email;

			$email = "nikkitefl@gmail.com";

			//$email = "nikita94.act@gmail.com";

			

			$errors = 0;

					

			//Create a new PHPMailer instance

			$mail = new PHPMailer;

			

			//Tell PHPMailer to use SMTP

			$mail->isSMTP();

			

			//Enable SMTP debugging

			// 0 = off (for production use)

			// 1 = client messages

			// 2 = client and server messages

			$mail->SMTPDebug = 0;

			

			//Ask for HTML-friendly debug output

			$mail->Debugoutput = 'html';

			

			//Set the hostname of the mail server

			//$mail->Host = 'smtp.gmail.com';

			$mail->Host = 'box5171.bluehost.com';

			

			//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission

			$mail->Port = 465;

			

			//Set the encryption system to use - ssl (deprecated) or tls

			$mail->SMTPSecure = 'ssl';

			

			//Whether to use SMTP authentication

			$mail->SMTPAuth = true;

			

			//Username to use for SMTP authentication - use full email address for gmail

			$mail->Username = "applications@asiancollegeofteachers.in";

			//$mail->Username = "admin@teachersjobworld.com";

			

			//Password to use for SMTP authentication

			$mail->Password = "ACTApplications$56";

			//$mail->Password = "tjwportal20!";

			

			//Set who the message is to be sent from

			$mail->setFrom("applications@asiancollegeofteachers.in", "Asian College Of Teachers");

			//mail->setFrom("admin@teachersjobworld.com", "Teachers Job World");

			

			//Set an alternative reply-to address

			//$mail->addReplyTo('replyto@example.com', 'First Last');

			

			//Set who the message is to be sent to

			$mail->addAddress($email);

			$mail->addAddress("asiancollegeapplications@gmail.com");

			//$mail->addAddress("sampade.ati@gmail.com");

			//Set the subject line

			$mail->Subject = "Teacher Training Course - Kolkata - TTK.com[#".$this->id."]";

			

			//Read an HTML message body from an external file, convert referenced images to embedded,

			//convert HTML into a basic plain-text alternative body

			

			$body = "";

			$body = "<html>

			<head>

			<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />

			<title>Teacher Training Course - Kolkata - TTK.com</title>

			</head>

			<body>

			 <table>

			<tbody>

			<tr>

			<td><b> Name </b></td>

			<td>".$this->name."</td>

			</tr>

			<tr>

			<td><b>Phone Number</b></td>

			<td>".$this->contact."</td>

			</tr>

			<tr>

			<td><b>E-mail </b></td>

			<td>".$this->email."</td>

			</tr>

			<tr>

			<td><b>Country</b></td>

			<td>".$this->country."</td>

			</tr>

			<tr>

			<td><b>State & City</b></td>

			<td>".$this->location."</td>

			</tr>

			<tr>

			<td><b>Select your Course</b></td>

			<td>".$this->course."</td>

			</tr>

			<tr>

			<td><b>Please select your Online Program</b></td>

			<td>".$this->course1."</td>

			</tr>

			<tr>

			<td><b>Select your Specialized Courses</b></td>

			<td>".$this->course2."</td>

			</tr>

			<tr>

			<td><b>Why do you want to do the course?</b></td>

			<td>".$this->comment."</td>

			</tr>		

			</tbody>

			</table>

			</body>

			</html>";

			$mail->msgHTML($body);

			

			//Replace the plain text body with one created manually

			$mail->AltBody = 'This is a plain-text message body';

			

			//Attach an image file

			//$mail->addAttachment('images/phpmailer_mini.png');

			

			//send the message, check for errors

			if (!$mail->send()) {

				$this->msg = "Sorry! Unable to send Mail";

				return;

			} 

			else

			{

				$this->msg = "Thank you for for filling the application form";

			}	

			

		}

		

		//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
		
		
		//insert function

	function InsertData4()

	{

		$dbh = new db_conn();

		$dbh->set_conn();



		$this->GenerateDataID();

		date_default_timezone_set('Asia/Kolkata');

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



		//insert data into tbl_data_entry table				



		$insert_sql = "insert into tbl_data_entry values ( ";

		$insert_sql = $insert_sql . $this->id. ",";

		$insert_sql = $insert_sql . "'".$this->name."', ";

		$insert_sql = $insert_sql . "'Teacher Training Kolkata', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'3', ";

		$insert_sql = $insert_sql . "'Teacher Training Kolkata', ";

		$insert_sql = $insert_sql . "'".$this->email. "', ";

		$insert_sql = $insert_sql . "'".$this->contact. "', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'266', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'" .date("Y-m-d H:i:s")."',";

		$insert_sql = $insert_sql . "'" .date("Y-m-d H:i:s")."',";

		$insert_sql = $insert_sql . "'1',";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'ACTIVE', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'" .date("Y-m-d h:i:s")."',";

		$insert_sql = $insert_sql . "'0',";

		$insert_sql = $insert_sql . "'0',";

		$insert_sql = $insert_sql . "'0',";

		$insert_sql = $insert_sql . "'".$this->location."', ";

		$insert_sql = $insert_sql . "'n/a',";

		$insert_sql = $insert_sql . "'".$this->comment."', ";

		$insert_sql = $insert_sql . "'n/a',";

		$insert_sql = $insert_sql . "'n/a')";

		



		//echo "insert_sql = ".$insert_sql;

		//return;



		$insert_result = mysqli_query($dbh->link ,$insert_sql);

		//$insert_result = mysql_query($insert_sql,$dbh->link);



		if (!$insert_result)

		{

			$this->msg = "Error: ".mysqli_error($dbh->link);

			//$this->msg = "Error: ".mysql_error($dbh->link);

			return;

		}

		else

		{

			$this->msg = "Thank you for for filling the application form";

		}		

	}	



	function SendMail4()

	{

		//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

			//sending application entry mail to 

			

			require 'PHPMailerAutoload.php';

			//if(!$_POST) exit;

			//$email = $this->email;    //$res->email;

			$email = "nikkitefl@gmail.com";

			//$email = "sulagna.act@gmail.com";

			

			$errors = 0;

					

			//Create a new PHPMailer instance

			$mail = new PHPMailer;

			

			//Tell PHPMailer to use SMTP

			$mail->isSMTP();

			

			//Enable SMTP debugging

			// 0 = off (for production use)

			// 1 = client messages

			// 2 = client and server messages

			$mail->SMTPDebug = 0;

			

			//Ask for HTML-friendly debug output

			$mail->Debugoutput = 'html';

			

			//Set the hostname of the mail server

			//$mail->Host = 'smtp.gmail.com';

			$mail->Host = 'box5171.bluehost.com';

			

			//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission

			$mail->Port = 465;

			

			//Set the encryption system to use - ssl (deprecated) or tls

			$mail->SMTPSecure = 'ssl';

			

			//Whether to use SMTP authentication

			$mail->SMTPAuth = true;

			

			//Username to use for SMTP authentication - use full email address for gmail

			$mail->Username = "applications@asiancollegeofteachers.in";

			//$mail->Username = "admin@teachersjobworld.com";

			

			//Password to use for SMTP authentication

			$mail->Password = "ACTApplications$56";

			//$mail->Password = "tjwportal20!";

			

			//Set who the message is to be sent from

			$mail->setFrom("applications@asiancollegeofteachers.in", "Asian College Of Teachers");

			//mail->setFrom("admin@teachersjobworld.com", "Teachers Job World");

			

			//Set an alternative reply-to address

			//$mail->addReplyTo('replyto@example.com', 'First Last');

			

			//Set who the message is to be sent to

			$mail->addAddress($email);

			$mail->addAddress("asiancollegeapplications@gmail.com");

			//$mail->addAddress("sampade.ati@gmail.com");

			//Set the subject line

			$mail->Subject = "Teacher Training Kolkata[#".$this->id."]";

			

			//Read an HTML message body from an external file, convert referenced images to embedded,

			//convert HTML into a basic plain-text alternative body

			

			$body = "";

			$body = "<html>

			<head>

			<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />

			<title>Teacher Training Kolkata</title>

			</head>

			<body>

			 <table>

			<tbody>

			<tr>

			<td><b> Name </b></td>

			<td>".$this->name."</td>

			</tr>

			<tr>

			<td><b>Phone Number</b></td>

			<td>".$this->contact."</td>

			</tr>

			<tr>

			<td><b>E-mail </b></td>

			<td>".$this->email."</td>

			</tr>

			
			<tr>

			<td><b>State & City</b></td>

			<td>".$this->location."</td>

			</tr>

			
			</tbody>

			</table>

			</body>

			</html>";

			$mail->msgHTML($body);

			

			//Replace the plain text body with one created manually

			$mail->AltBody = 'This is a plain-text message body';

			

			//Attach an image file

			//$mail->addAttachment('images/phpmailer_mini.png');

			

			//send the message, check for errors

			if (!$mail->send()) {

				$this->msg = "Sorry! Unable to send Mail";

				return;

			} 

			else

			{

				$this->msg = "Thank you for for filling the application form";

			}	

			

		}

		

		//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

	function InsertData_sf()

	{

		$dbh = new db_conn();

		$dbh->set_conn();



		$this->GenerateDataID();

		date_default_timezone_set('Asia/Kolkata');

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



		//insert data into tbl_data_entry table				



		$insert_sql = "insert into tbl_data_entry values ( ";

		$insert_sql = $insert_sql . $this->id. ",";

		$insert_sql = $insert_sql . "'".$this->name."', ";

		$insert_sql = $insert_sql . "'Special Education- Kolkata', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'3', ";

		$insert_sql = $insert_sql . "'Special Education- Kolkata', ";

		$insert_sql = $insert_sql . "'".$this->email. "', ";

		$insert_sql = $insert_sql . "'".$this->contact. "', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'199', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'" .date("Y-m-d H:i:s")."',";

		$insert_sql = $insert_sql . "'" .date("Y-m-d H:i:s")."',";

		$insert_sql = $insert_sql . "'1',";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'ACTIVE', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'" .date("Y-m-d h:i:s")."',";

		$insert_sql = $insert_sql . "'0',";

		$insert_sql = $insert_sql . "'0',";

		$insert_sql = $insert_sql . "'0',";

		$insert_sql = $insert_sql . "'".$this->location."', ";

		$insert_sql = $insert_sql . "'',";

		$insert_sql = $insert_sql . "'".$this->comment."', ";

		$insert_sql = $insert_sql . "'n/a',";

		$insert_sql = $insert_sql . "'n/a')";

		



		//echo "insert_sql = ".$insert_sql;

		//return;



		$insert_result = mysqli_query($dbh->link ,$insert_sql);

		//$insert_result = mysql_query($insert_sql,$dbh->link);



		if (!$insert_result)

		{

			$this->msg = "Error: ".mysqli_error($dbh->link);

			//$this->msg = "Error: ".mysql_error($dbh->link);

			return;

		}

		else

		{

			$this->msg = "Thank you for for filling the application form";

		}		

	}	



	function SendMail_sf()

	{

		//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

			//sending application entry mail to 

			

			require 'PHPMailerAutoload.php';

			//if(!$_POST) exit;

			//$email = $this->email;    //$res->email;

			$email = "nikkitefl@gmail.com";
			
			//$email = "sulagna.act@gmail.com";

			//$email = "nikita94.act@gmail.com";

			

			$errors = 0;

					

			//Create a new PHPMailer instance

			$mail = new PHPMailer;

			

			//Tell PHPMailer to use SMTP

			$mail->isSMTP();

			

			//Enable SMTP debugging

			// 0 = off (for production use)

			// 1 = client messages

			// 2 = client and server messages

			$mail->SMTPDebug = 0;

			

			//Ask for HTML-friendly debug output

			$mail->Debugoutput = 'html';

			

			//Set the hostname of the mail server

			//$mail->Host = 'smtp.gmail.com';

			$mail->Host = 'box5171.bluehost.com';

			

			//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission

			$mail->Port = 465;

			

			//Set the encryption system to use - ssl (deprecated) or tls

			$mail->SMTPSecure = 'ssl';

			

			//Whether to use SMTP authentication

			$mail->SMTPAuth = true;

			

			//Username to use for SMTP authentication - use full email address for gmail

			$mail->Username = "applications@asiancollegeofteachers.in";

			//$mail->Username = "admin@teachersjobworld.com";

			

			//Password to use for SMTP authentication

			$mail->Password = "ACTApplications$56";

			//$mail->Password = "tjwportal20!";

			

			//Set who the message is to be sent from

			$mail->setFrom("applications@asiancollegeofteachers.in", "Asian College Of Teachers");

			//mail->setFrom("admin@teachersjobworld.com", "Teachers Job World");

			

			//Set an alternative reply-to address

			//$mail->addReplyTo('replyto@example.com', 'First Last');

			

			//Set who the message is to be sent to

			$mail->addAddress($email);

			$mail->addAddress("asiancollegeapplications@gmail.com");

			//$mail->addAddress("sampade.ati@gmail.com");

			//Set the subject line

			$mail->Subject = "Special Education- Kolkata[#".$this->id."]";

			

			//Read an HTML message body from an external file, convert referenced images to embedded,

			//convert HTML into a basic plain-text alternative body

			

			$body = "";

			$body = "<html>

			<head>

			<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />

			<title>Special Education- Kolkata</title>

			</head>

			<body>

			 <table>

			<tbody>

			<tr>

			<td><b> Name </b></td>

			<td>".$this->name."</td>

			</tr>

			<tr>

			<td><b>Phone Number</b></td>

			<td>".$this->contact."</td>

			</tr>

			<tr>

			<td><b>E-mail </b></td>

			<td>".$this->email."</td>

			</tr>

			<tr>

			<td><b>State & City</b></td>

			<td>".$this->location."</td>

			</tr>

			
			<tr>

			<td><b>Why do you want to do the course?</b></td>

			<td>".$this->comment."</td>

			</tr>

					

			</tbody>

			</table>

			</body>

			</html>";

			$mail->msgHTML($body);

			

			//Replace the plain text body with one created manually

			$mail->AltBody = 'This is a plain-text message body';

			

			//Attach an image file

			//$mail->addAttachment('images/phpmailer_mini.png');

			

			//send the message, check for errors

			if (!$mail->send()) {

				$this->msg = "Sorry! Unable to send Mail";

				return;

			} 

			else

			{

				$this->msg = "Thank you for for filling the application form";

			}	

			

		}

		

		//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


		//insert function for Subscribe to our Newsletter! (ACT)

	function InsertData1()

	{

		$dbh = new db_conn();

		$dbh->set_conn();



		$this->GenerateDataID();

		date_default_timezone_set('Asia/Kolkata');

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



		//insert data into tbl_data_entry table		

		$insert_sql = "insert into tbl_data_entry values ( ";

		$insert_sql = $insert_sql . $this->id. ",";

		$insert_sql = $insert_sql . "'".$this->name. "', ";

		$insert_sql = $insert_sql . "'Subscribe to our Newsletter! (ACT)', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'31', ";

		$insert_sql = $insert_sql . "'Subscribe to our Newsletter! (ACT)', ";

		$insert_sql = $insert_sql . "'".$this->email. "', ";

		$insert_sql = $insert_sql . "'".$this->contact. "', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'13', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'".date("Y-m-d H:i:s")."',";

		$insert_sql = $insert_sql . "'".date("Y-m-d H:i:s")."',";

		$insert_sql = $insert_sql . "'1',";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'ACTIVE', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'".date("Y-m-d h:i:s")."',";

		$insert_sql = $insert_sql . "'0',";

		$insert_sql = $insert_sql . "'0',";

		$insert_sql = $insert_sql . "'0',";

		$insert_sql = $insert_sql . "'".$this->location. "', ";

		$insert_sql = $insert_sql . "'n/a',";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a',";

		$insert_sql = $insert_sql . "'n/a')";

		



		//echo "insert_sql = ".$insert_sql;

		//return;



		$insert_result = mysqli_query($dbh->link,$insert_sql);

		//$insert_result = mysql_query($insert_sql,$dbh->link);



		if (!$insert_result)

		{

			$this->msg = "Error: ".mysqli_error($dbh->link);

			//$this->msg = "Error: ".mysql_error($dbh->link);

			return;

		}

		else

		{

			$this->msg = "Thank you for filling the application form";

		}		

	}	



	//for Subscribe to our Newsletter! (ACT)

	function SendMail1()

	{

		//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

		//sending application entry mail to 

		

		require 'PHPMailerAutoload.php';

		//if(!$_POST) exit;

		//$email = $this->email;    //$res->email;

		$email = "nikkitefl@gmail.com";

		//$email = "nikita94.act@gmail.com";

		

		$errors = 0;

				

		//Create a new PHPMailer instance

		$mail = new PHPMailer;

		

		//Tell PHPMailer to use SMTP

		$mail->isSMTP();

		

		//Enable SMTP debugging

		// 0 = off (for production use)

		// 1 = client messages

		// 2 = client and server messages

		$mail->SMTPDebug = 0;

		

		//Ask for HTML-friendly debug output

		$mail->Debugoutput = 'html';

		

		//Set the hostname of the mail server

		//$mail->Host = 'smtp.gmail.com';

		$mail->Host = 'box5171.bluehost.com';

		

		//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission

		$mail->Port = 465;

		

		//Set the encryption system to use - ssl (deprecated) or tls

		$mail->SMTPSecure = 'ssl';

		

		//Whether to use SMTP authentication

		$mail->SMTPAuth = true;

		

		//Username to use for SMTP authentication - use full email address for gmail

		$mail->Username = "applications@asiancollegeofteachers.in";

		//$mail->Username = "admin@teachersjobworld.com";

		

		//Password to use for SMTP authentication

		$mail->Password = "ACTApplications$56";

		//$mail->Password = "tjwportal20!";

		

		//Set who the message is to be sent from

		$mail->setFrom("applications@asiancollegeofteachers.in", "Asian College Of Teachers");

		

		//Set an alternative reply-to address

		//$mail->addReplyTo('replyto@example.com', 'First Last');

		

		//Set who the message is to be sent to

		$mail->addAddress($email);

		$mail->addAddress("asiancollegeapplications@gmail.com");

		//$mail->addAddress("sampade.ati@gmail.com");

		//Set the subject line

		$mail->Subject = "Subscribe to our Newsletter! (Teachertrainingkolkata) [#".$this->id."]";

		

		//Read an HTML message body from an external file, convert referenced images to embedded,

		//convert HTML into a basic plain-text alternative body

		

		$body = "";

		$body = "<html>

		<head>

		<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />

		<title>Subscribe to our Newsletter! (Teachertrainingkolkata)</title>

		</head>

		<body>

		 <table>

		<tbody>

		<tr>

		<td><b>Please mention your Name</b></td>

		<td>".$this->name."</td>

		</tr>

		<tr>

		<td><b>Please mention your Email</b></td>

		<td>".$this->email."</td>

		</tr>

		<tr>

		<td><b>Please mention your Phone Number</b></td>

		<td>".$this->contact."</td>

		</tr>

		<tr>

		<td><b>Location </b></td>

		<td>".$this->location."</td>

		</tr>

		

		</tbody>

		</table>

		</body>

		</html>";

		$mail->msgHTML($body);

		

		//Replace the plain text body with one created manually

		$mail->AltBody = 'This is a plain-text message body';

		

		//Attach an image file

		//$mail->addAttachment('images/phpmailer_mini.png');

		

		//send the message, check for errors

		if (!$mail->send()) {

			$this->msg = "Sorry! Unable to send Mail";

			return;

		} 

		else

		{

			$this->msg = "Thank you for filling the application form";

		}	

		

	}

	

	//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

	

			

	//for Subscribe to our Newsletter! (ACT)

	function SendMailToCandidate()

	{

		//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

			//sending application entry mail to 

			

			//require 'PHPMailerAutoload.php';

			//if(!$_POST) exit;

			$email = $this->email;  

			//$email = "nikkitefl@gmail.com";

			//$email = "nikita94.act@gmail.com";

			

			//Create a new PHPMailer instance

			$mail = new PHPMailer;

			

			//Tell PHPMailer to use SMTP

			$mail->isSMTP();

			

			//Enable SMTP debugging

			// 0 = off (for production use)

			// 1 = client messages

			// 2 = client and server messages

			$mail->SMTPDebug = 0;

			

			//Ask for HTML-friendly debug output

			$mail->Debugoutput = 'html';

			

			//Set the hostname of the mail server

			//$mail->Host = 'smtp.gmail.com';

			$mail->Host = 'box5171.bluehost.com';

			

			//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission

			$mail->Port = 465;

			

			//Set the encryption system to use - ssl (deprecated) or tls

			$mail->SMTPSecure = 'ssl';

			

			//Whether to use SMTP authentication

			$mail->SMTPAuth = true;

			

			//Username to use for SMTP authentication - use full email address for gmail

			$mail->Username = "applications@asiancollegeofteachers.in";

			//$mail->Username = "admin@teachersjobworld.com";

			

			//Password to use for SMTP authentication

			$mail->Password = "ACTApplications$56";

			//$mail->Password = "tjwportal20!";

			

			//Set who the message is to be sent from

			$mail->setFrom("applications@asiancollegeofteachers.in", "Asian College Of Teachers");

					

			//Set an alternative reply-to address

			//$mail->addReplyTo('replyto@example.com', 'First Last');

			

			//Set who the message is to be sent to

			$mail->addAddress($email);

			//$mail->addAddress("asiancollegeapplications@gmail.com");

			//$mail->addAddress("sampade.ati@gmail.com");

			//Set the subject line

			$mail->Subject = "Subscribe to our Newsletter! (ACT)";

			

			//Read an HTML message body from an external file, convert referenced images to embedded,

			//convert HTML into a basic plain-text alternative body

			

			$body = "";

			$body = "<html>

			<head>

			<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />

			<title>Subscribe to our Newsletter! (ACT)</title>

			</head>

			<body>

			<a href='http://asiancollegeofteachers.education/' target='_blank'>

			<img src='http://asiancollegeofteachers.education/admin_act/design/dist/img/logo.png' alt='' width='180' style='border:none;' /></a><br />

			Thank you for signing up for ACT newsletter. Keep up-to-date with the latest information and features on Asian College of Teachers. Learn more about our events, activities and celebrations!<br><br>


Regards,<br />

Asian College of Teachers

<br />



 

			</body>

			</html>";

			$mail->msgHTML($body);

			

			//Replace the plain text body with one created manually

			$mail->AltBody = 'This is a plain-text message body';

			

			//Attach an image file

			//$mail->addAttachment('images/phpmailer_mini.png');

			

			//send the message, check for errors

			if (!$mail->send()) {

				$this->msg = "Sorry! Unable to send Mail";

				return;

			} 

			else

			{

				$this->msg = "Thank you for filling the application form";

			}	

			

		}

	//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	
	//insert function

	function InsertData_rightpanel()

	{

		$dbh = new db_conn();

		$dbh->set_conn();



		$this->GenerateDataID();

		date_default_timezone_set('Asia/Kolkata');

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



		//insert data into tbl_data_entry table				



		$insert_sql = "insert into tbl_data_entry values ( ";

		$insert_sql = $insert_sql . $this->id. ",";

		$insert_sql = $insert_sql . "'".$this->name."', ";

		$insert_sql = $insert_sql . "'".$this->course."', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'3', ";

		$insert_sql = $insert_sql . "'Special Education-Kolkata', ";

		$insert_sql = $insert_sql . "'".$this->email. "', ";

		$insert_sql = $insert_sql . "'".$this->contact. "', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'199', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'" .date("Y-m-d H:i:s")."',";

		$insert_sql = $insert_sql . "'" .date("Y-m-d H:i:s")."',";

		$insert_sql = $insert_sql . "'1',";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'ACTIVE', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'0', ";

		$insert_sql = $insert_sql . "'n/a', ";

		$insert_sql = $insert_sql . "'" .date("Y-m-d h:i:s")."',";

		$insert_sql = $insert_sql . "'0',";

		$insert_sql = $insert_sql . "'0',";

		$insert_sql = $insert_sql . "'0',";

		$insert_sql = $insert_sql . "'".$this->country."-".$this->location."', ";

		$insert_sql = $insert_sql . "'n/a',";

		$insert_sql = $insert_sql . "'".$this->comment."', ";

		$insert_sql = $insert_sql . "'n/a',";

		$insert_sql = $insert_sql . "'n/a')";

		



		//echo "insert_sql = ".$insert_sql;

		//return;



		$insert_result = mysqli_query($dbh->link ,$insert_sql);

		//$insert_result = mysql_query($insert_sql,$dbh->link);



		if (!$insert_result)

		{

			$this->msg = "Error: ".mysqli_error($dbh->link);

			//$this->msg = "Error: ".mysql_error($dbh->link);

			return;

		}

		else

		{

			$this->msg = "Thank you for for filling the application form";

		}		

	}	



	function SendMail_rightpanel()

	{

		//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

			//sending application entry mail to 

			

			require 'PHPMailerAutoload.php';

			//if(!$_POST) exit;

			//$email = $this->email;    //$res->email;

			$email = "nikkitefl@gmail.com";

			//$email = "sulagna.act@gmail.com";

			

			$errors = 0;

					

			//Create a new PHPMailer instance

			$mail = new PHPMailer;

			

			//Tell PHPMailer to use SMTP

			$mail->isSMTP();

			

			//Enable SMTP debugging

			// 0 = off (for production use)

			// 1 = client messages

			// 2 = client and server messages

			$mail->SMTPDebug = 0;

			

			//Ask for HTML-friendly debug output

			$mail->Debugoutput = 'html';

			

			//Set the hostname of the mail server

			//$mail->Host = 'smtp.gmail.com';

			$mail->Host = 'box5171.bluehost.com';

			

			//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission

			$mail->Port = 465;

			

			//Set the encryption system to use - ssl (deprecated) or tls

			$mail->SMTPSecure = 'ssl';

			

			//Whether to use SMTP authentication

			$mail->SMTPAuth = true;

			

			//Username to use for SMTP authentication - use full email address for gmail

			$mail->Username = "applications@asiancollegeofteachers.in";

			//$mail->Username = "admin@teachersjobworld.com";

			

			//Password to use for SMTP authentication

			$mail->Password = "ACTApplications$56";

			//$mail->Password = "tjwportal20!";

			

			//Set who the message is to be sent from

			$mail->setFrom("applications@asiancollegeofteachers.in", "Asian College Of Teachers");

			//mail->setFrom("admin@teachersjobworld.com", "Teachers Job World");

			

			//Set an alternative reply-to address

			//$mail->addReplyTo('replyto@example.com', 'First Last');

			

			//Set who the message is to be sent to

			$mail->addAddress($email);

			$mail->addAddress("asiancollegeapplications@gmail.com");

			//$mail->addAddress("sampade.ati@gmail.com");

			//Set the subject line

			$mail->Subject = "Special Education-Kolkata[#".$this->id."]";

			

			//Read an HTML message body from an external file, convert referenced images to embedded,

			//convert HTML into a basic plain-text alternative body

			

			$body = "";

			$body = "<html>

			<head>

			<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />

			<title>Special Education-Kolkata</title>

			</head>

			<body>

			 <table>

			<tbody>

			<tr>

			<td><b> Name </b></td>

			<td>".$this->name."</td>

			</tr>

			<tr>

			<td><b>Phone Number</b></td>

			<td>".$this->contact."</td>

			</tr>

			<tr>

			<td><b>E-mail </b></td>

			<td>".$this->email."</td>

			</tr>

			<tr>

			<td><b>Country</b></td>

			<td>".$this->country."</td>

			</tr>

			<tr>

			<td><b>State & City</b></td>

			<td>".$this->location."</td>

			</tr>

			<tr>

			<td><b>Course Type</b></td>

			<td>".$this->course."</td>

			</tr>

			<tr>

			<td><b>Why do you want to do the course?</b></td>

			<td>".$this->comment."</td>

			</tr>		

			</tbody>

			</table>

			</body>

			</html>";

			$mail->msgHTML($body);

			

			//Replace the plain text body with one created manually

			$mail->AltBody = 'This is a plain-text message body';

			

			//Attach an image file

			//$mail->addAttachment('images/phpmailer_mini.png');

			

			//send the message, check for errors

			if (!$mail->send()) {

				$this->msg = "Sorry! Unable to send Mail";

				return;

			} 

			else

			{

				$this->msg = "Thank you for for filling the application form";

			}	

			

		}

		

		//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


}



?>