<?php

require_once("db_conn_class.php");

class app

{

	public $id;

	public $name;

	public $email;

	public $contact;

	public $course;

	public $country;

	public $city;

	public $qualification;

	public $txturl;

	public $workexperience;


	public $comment;
	
	public $location;

	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->country 			= "";

		$this->city 			= "";
		
		$this->location 			= "";

		$this->qualification	= "";

		$this->txturl  	= "";

		$this->workexperience	= "";

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

	{

		$dbh = new db_conn();

		$dbh->set_conn();

		$this->GenerateDataID();

		date_default_timezone_set('Asia/Kolkata');

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

		//insert data into tbl_ebc_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 . "'Apply - Teachingqualification.com', ";

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

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

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

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

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

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

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

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

	{

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

			//sending application entry mail to 

			

			require 'PHPMailerAutoload.php';

			//if(!$_POST) exit;

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

			$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.1and1.com';

				$mail->Host = 'mail.teachingqualification.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 = "contact@teachingqualification.com";

				

				//Password to use for SMTP authentication

				$mail->Password = "QualificationContact$56";  //tjwportal2!

				

				//Set who the message is to be sent from

				$mail->setFrom("contact@teachingqualification.com", "Teachingqualification.com");

				

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

				

				//Set the subject line

				$mail->Subject = "Apply - Teachingqualification.com";

				

				//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 - Teachingqualification.com</title>

				</head>

				<body>

				 <table>

				<tbody>

				<tr>

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

				<td>".$this->name."</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->city."</td>

				</tr>

				<tr>

				<td><b>Contact No </b></td>

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

				</tr>

				<tr>

				<td><b>Educational Qualification  </b></td>

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

				</tr>

				<tr>

				<td><b>Work Experience </b></td>

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

				</tr>

				<tr>

				<td><b>Choose your Program </b></td>

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

				</tr>
				<tr>

				<td><b>Remarks </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 InsertData_newsletter()

		{

			$dbh = new db_conn();

			$dbh->set_conn();

	

			$this->GenerateDataID();

			date_default_timezone_set('Asia/Kolkata');

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

	

			//insert data into tbl_ebc_data_entry table		

			$insert_sql = "insert into tbl_ebc_data_entry values ( ";

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

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

			$insert_sql = $insert_sql . "'Application - East Bridge College', ";

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

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

			$insert_sql = $insert_sql . "'Application - East Bridge College', ";

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

		{

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

			//sending application entry mail to 

			

			require 'PHPMailerAutoload.php';

			//if(!$_POST) exit;

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

			$email = "eastbridgecollege@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.1and1.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 = "contact@ebc.ac";

				

				//Password to use for SMTP authentication

				$mail->Password = "EBCACTac$68(";  //tjwportal2!

				

				//Set who the message is to be sent from

				$mail->setFrom("contact@ebc.ac", "East Bridge College");

				

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

				

				//Set the subject line

				$mail->Subject = "Application - East Bridge College";

				

				//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 - East Bridge College</title>

				</head>

				<body>

				 <table>

				<tbody>

				<tr>

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

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

				</tr>	

				<tr>

				<td><b>Phone No </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>

				

				</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 = '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 = "contact@ebc.ac";

				

				//Password to use for SMTP authentication

				$mail->Password = "EBCACTac$68(";  //tjwportal2!

				

				//Set who the message is to be sent from

				$mail->setFrom("contact@ebc.ac", "East Bridge College");

						

				//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 - East Bridge College";

				

				//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 - East Bridge College</title>

				</head>

				<body>

				<a href='https://www.ebc.ac' target='_blank'><img src='https://www.ebc.ac/images/logo.png' alt='' width='180' style='border:none;' /></a><br />

				Thank you for signing up for East Bridge College Newsletter. Keep up-to-date with the latest information and features on East Bridge College . Learn more about our events, activities and celebrations!<br><br>

	<br>

	Regards,<br />

	East Bridge College

	<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_campaign()

		{

			$dbh = new db_conn();

			$dbh->set_conn();

	

			$this->GenerateDataID();

			date_default_timezone_set('Asia/Kolkata');

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

	

			//insert data into tbl_ebc_data_entry table		

			$insert_sql = "insert into tbl_ebc_data_entry values ( ";

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

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

			$insert_sql = $insert_sql . "'Application - East Bridge College - Professional Doctorate Programs', ";

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

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

			$insert_sql = $insert_sql . "'Application - East Bridge College - Professional Doctorate Programs', ";

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

		{

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

			//sending application entry mail to 

			

			require 'PHPMailerAutoload.php';

			//if(!$_POST) exit;

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

			$email = "eastbridgecollege@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.1and1.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 = "contact@ebc.ac";

				

				//Password to use for SMTP authentication

				$mail->Password = "EBCACTac$68(";  //tjwportal2!

				

				//Set who the message is to be sent from

				$mail->setFrom("contact@ebc.ac", "East Bridge College");

				

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

				

				//Set the subject line

				$mail->Subject = "Application - East Bridge College - Professional Doctorate Programs";

				

				//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 - East Bridge College - Professional Doctorate Programs</title>

				</head>

				<body>

				 <table>

				<tbody>

				<tr>

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

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

				</tr>	

				<tr>

				<td><b>Phone No </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>

				

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

			}	

			

		}


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

//insert function

	function InsertData_contact()

	{

		$dbh = new db_conn();

		$dbh->set_conn();

		$this->GenerateDataID();

		date_default_timezone_set('Asia/Kolkata');

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

		//insert data into tbl_ebc_data_entry table				

		$insert_sql = "insert into tbl_ebc_data_entry values ( ";

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

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

		$insert_sql = $insert_sql . "'Contact - East Bridge College', ";

		$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 . "'Contact - East Bridge College', ";

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

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

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

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

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

	{

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

			//sending application entry mail to 

			

			require 'PHPMailerAutoload.php';

			//if(!$_POST) exit;

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

			$email = "eastbridgecollege@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.1and1.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 = "contact@ebc.ac";

				

				//Password to use for SMTP authentication

				$mail->Password = "EBCACTac$68(";  //tjwportal2!

				

				//Set who the message is to be sent from

				$mail->setFrom("contact@ebc.ac", "East Bridge College");

				

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

				

				//Set the subject line

				$mail->Subject = "Contact - East Bridge College";

				

				//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>Contact - East Bridge College</title>

				</head>

				<body>

				 <table>

				<tbody>

				<tr>

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

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

				</tr>				

				<tr>

				<td><b>Email</b></td>

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

				</tr>				

				<tr>

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

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

				</tr>				

				<tr>

				<td><b>Contact No </b></td>

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

				</tr>

				<tr>

				<td><b>Remarks </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";

			}	

			

		}

	

	

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

	
	// 	COURSE COMMON FORM  
	function InsertData_common_course()
	{	


		$dbh = new db_conn();
		$dbh->set_conn();
		$this->GenerateDataID();
		date_default_timezone_set('Asia/Kolkata');
		
		$page_url = $this->txturl;
		$page_arr = explode("/",$page_url);
		$page_name_arr = explode('.',$page_arr[1]);
		$page_name = $page_name_arr[0];
			
			//============================================================================
		//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 Teachingqualification - ".$page_name."', ";
		$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 . "'".$this->txturl. "', ";
		$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->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')";
			
		
		$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";
		}		
	}
	
	//send mail function for COURSE COMMON FORM  
	function SendMail_common_course()
	{
		//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
		//sending application entry mail to 
		$page_url = $this->txturl;
		$page_arr = explode("/",$page_url);
		$page_name_arr = explode('.',$page_arr[1]);
		$page_name = $page_name_arr[0];
		
		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.1and1.com';

				$mail->Host = 'mail.teachingqualification.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 = "contact@teachingqualification.com";

				

				//Password to use for SMTP authentication

				$mail->Password = "QualificationContact$56";  //tjwportal2!

				

				//Set who the message is to be sent from

				$mail->setFrom("contact@teachingqualification.com", "Teachingqualification.com");

				

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

		//Set the subject line
		$mail->Subject = "Application Teachingqualification - ".$page_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>Application - Teachingqualification</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";
		}	
		
	//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	}

}



?>