<?php

require_once("db_conn_class.php");

class app

{

	public $id;

	public $name;

	public $email;

	public $contact;

	public $location;

	public $country;

	public $dob;

	public $qualification;

	public $course;

	public $comment;
	
	public $form_name;
	
	public $form_id;

	public $status;

	public $deleted;

	

	//constructor [initialize the value of the variables]

	function _construct()

	{

		$this->id  				= 0;

		$this->name         	= "";

		$this->email     		= "";

		$this->contact  		= "";

		$this->country	 		= "";

		$this->location 		= "";

		$this->dob		 		= "";

		$this->qualification	= "";

		$this->course 			= "";

		$this->comment	 		= "";
		
		$this->form_name	 	= "";
		
		$this->form_id	 		= "";

		$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."', ";

		$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 . "'52', ";

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

		$insert_sql = $insert_sql . "'APPLY - SEN COURSE International', ";

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

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

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

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

		$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';

			$mail->Host = 'vps.teflindia.in';



			

			//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 = "APPLY - SEN COURSE International[#".$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>APPLY - SEN COURSE International</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>Email </b></td>

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

			</tr>

			<tr>

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

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

			</tr>

			<tr>

			<td><b>City</b></td>

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

			</tr>

			<tr>

			<td><b>Choose Your Program</b></td>

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

			</tr>

			<tr>

			<td><b>Why are you interested in this 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 InsertData2()

	{

		$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 . "'0', ";

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

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

		$insert_sql = $insert_sql . "'APPLICATION - SEN COURSE International', ";

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

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

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

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

		$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 SendMail2()

	{

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

			//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';

			$mail->Host = 'vps.teflindia.in';



			

			//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 = "APPLICATION - SEN COURSE International[#".$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>APPLICATION - SEN COURSE International</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>Email </b></td>

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

			</tr>

			<tr>

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

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

			</tr>

			<tr>

			<td><b>City</b></td>

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

			</tr>

			<tr>

			<td><b>Please select your course</b></td>

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

			</tr>

			<tr>

			<td><b>Why are you interested in this 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 InsertData8()

	{

		$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 . "'APPLICATION for One Day Seminar', ";

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

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

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

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

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

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

		$insert_sql = $insert_sql . "'APPLICATION for One Day Seminar', ";

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

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

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

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

		$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 SendMail8()

	{

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

			//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';

			$mail->Host = 'vps.teflindia.in';



			

			//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 = "APPLICATION for One Day Seminar[#".$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>APPLICATION for One Day Seminar</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>Email </b></td>

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

			</tr>

			

			<tr>

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

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

			</tr>

			<tr>

			<td><b>Why are you interested in this 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 InsertData3()

		{

			$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 . "'94', ";

			$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 for filling the application form";

			}		

		}	

	

		//for Subscribe to our Newsletter! (ACT)

		function SendMail3()

		{

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

				//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';

				$mail->Host = 'vps.teflindia.in';



				

				//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 = "Subscribe to our Newsletter! (SEN)[#".$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! (SEN)</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 for filling the application form";

				}	

				

			}

			

			//for Subscribe to our Newsletter! (ACT)

			function SendMailToCandidate()

			{

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

				//sending application entry mail to 

			

				$email = $this->email;  

				

				//$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';

				$mail->Host = 'vps.teflindia.in';



				

				//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 = "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='220' height='75' 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";

				}	

				

			}

	function InsertData_sen_all()

	{

		$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->form_name. "', ";

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

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

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

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

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

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

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

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

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

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

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

		$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 SendMail_sen_all()

	{

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

			//sending application entry mail to 

			

			require 'PHPMailerAutoload.php';

			//if(!$_POST) exit;

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

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

			$email = "nikkitefl@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';

			$mail->Host = 'vps.teflindia.in';



			

			//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 = $this->form_name."[#".$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>".$this->form_name."</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>Email </b></td>

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

			</tr>
			

			<tr>

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

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

			</tr>			

			<tr>

			<td><b>Why are you interested in this 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";

			}	

			

		}

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

}

?>