%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
<?php
/**
* Description of Admin
*
* @author Aman
*/
class Admin extends Dbop {
private $dbConn;
public $dbCon;
//put your code here
public function __construct($test) {
//$this->dbConn = $db;
$this->dbConn = $test;
session_start();
}
public function __deconstruct() {
}
public function userExit($email) {
$query = "select Email from internalusermaster where Email='$email' ";
$valArr = $this->select($query, array(), $this->dbConn);
return $valArr;
}
public function setemailinfo() {
$query = "select * from internalusermaster";
$valArr = $this->select($query, array(), $this->dbConn);
return $valArr;
}
public function getalluser($User_ID) {
$query = "SELECT * from productInfo where User_ID ='$User_ID'";
$valArr = $this->select($query, array($User_ID), $this->dbConn);
return $valArr;
}
public function getallproduct() {
$query = "SELECT * from productInfo";
$valArr = $this->select($query, array(), $this->dbConn);
return $valArr;
}
public function checkUserExist($userName) {
$test = unserialize(DATABASE_ARRAY);
foreach ($test as $x => $x_value) {
// switch($x) {
// case "DB1" :
// $this->dbConn = $x_value ;
// break;
// case "DB2":
// $this->dbConn = $x_value ;
// break;
// default :
// $this->dbConn = 1;
// break;
// }
error_log("dbconn value ::;" . $x_value);
$query = "select count(1) as count from internalusermaster where Email = ?";
$valArr = $this->select($query, array($userName), $this->dbConn);
error_log("test val ue dod ayyaru" . $valArr[0]['count']);
if ($valArr[0]['count'] == 1) {
// session_start();
//$this->dbConn = $ter;
$_SESSION['databasess']['database'][] = $x_value;
$this->dbCon = $x_value;
$_SESSION['data'] = $x_value;
}
}
return $this->dbCon;
}
public function checkEmail($emailId) {
$query = "SELECT * FROM events WHERE eventName LIKE '" . $emailId . "'";
$valArr = $this->select($query, array(), $this->dbConn);
return $valArr;
}
public function sendMail($subject, $body, $to) {
$this->mail = new PHPMailer();
$this->mail->isSMTP(); // Set mailer to use SMTP
$this->mail->Host = SMTP_HOST; // Specify main and backup SMTP servers
$this->mail->SMTPAuth = SMTP_AUTH; // Enable SMTP authentication
$this->mail->Username = SMTP_USERNAME; // SMTP username
$this->mail->Password = SMTP_PASSWORD; // SMTP password
$this->mail->SMTPSecure = SMTP_SECURE; // Enable TLS encryption, `ssl` also accepted
$this->mail->Port = SMTP_PORT; // TCP port to connect to
$this->mail->From = FROM_EMAIL_ID;
$this->mail->FromName = FROM_EMAIL_NAME;
$this->mail->addReplyTo(SMTP_REPLY_EMAIL_ID, SMTP_REPLY_NAME);
$this->mail->mailCC = explode(",", MAIL_CC);
foreach ($this->mail->mailCC as $cc) {
error_log(trim($cc));
$this->mail->addCC(trim($cc));
}
$this->mail->isHTML(true);
$this->mail->Subject = $subject;
$this->mail->Body = $body;
$this->mail->addAddress($to); // Add a recipient
$this->mail->send();
}
public function sendMail2($subject2, $body2, $to2) {
$this->mail = new PHPMailer();
$this->mail->isSMTP(); // Set mailer to use SMTP
$this->mail->Host = SMTP_HOST; // Specify main and backup SMTP servers
$this->mail->SMTPAuth = SMTP_AUTH; // Enable SMTP authentication
$this->mail->Username = SMTP_USERNAME; // SMTP username
$this->mail->Password = SMTP_PASSWORD; // SMTP password
$this->mail->SMTPSecure = SMTP_SECURE; // Enable TLS encryption, `ssl` also accepted
$this->mail->Port = SMTP_PORT; // TCP port to connect to
$this->mail->From = FROM_EMAIL_ID;
$this->mail->FromName = FROM_EMAIL_NAME;
$this->mail->addReplyTo(SMTP_REPLY_EMAIL_ID, SMTP_REPLY_NAME);
$this->mail->mailCC = explode(",", MAIL_CC2);
foreach ($this->mail->mailCC as $cc2) {
error_log(trim($cc2));
$this->mail->addCC(trim($cc2));
}
$this->mail->isHTML(true);
$this->mail->Subject = $subject2;
$this->mail->Body = $body2;
$this->mail->addAddress($to2); // Add a recipient
$this->mail->send();
}
}