JezK
Edit File: ajax.php
<?php session_start(); include('main.php'); $type = $_REQUEST['type']; if($type == 1) { $userID = $_SESSION['bcUserID']; $reportMonth = $_REQUEST['reportMonth']; $reportYear = Date('Y'); echo $bc->isValidMonthReport($userID,$reportMonth,$reportYear); } if($type == 2) { $userID = $_REQUEST['userID']; $email = $_REQUEST['email']; $formSubmissionID = $_REQUEST['formSubmissionID']; $bcCode = $_REQUEST['bcCode']; $expiryDate = $_REQUEST['expiryDate']; $applicationType = $_REQUEST['applicationType']; $password = time(); $result = $bc->registerUser($userID,$applicationType,$email,$formSubmissionID,$expiryDate,$bcCode,$password); if($result == 1) { $details = $bc->getBCUserDetails($userID); $userDetails = $details['userDetails']; $applicationName = $userDetails['name']; //sending registration details to mail $headers = "From: Nabfins<noreply@nabfins.com>" . "\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $subject="BC Registration details"; //$message = "Hi,<br><br>Your Email to login is:<b>".$email."</b><br><br><br>Your password is:<b>".$password."</b><br> Best Regards,<br><br>Nabfins Team.<br>"; $message = '<html> <head> </head> <body style="margin:0px;background: #eeeee0;"> <div style="text-align:center;background: #eeeee0;float: left;width: 100%;border-bottom: 1px solid #352f2f;"><img src="http://nabfins.org/wp-content/themes/rocketboard-v1-04/images/logo.png" alt="default-logo" style="float:left;padding: 8px 10px;"><div style="padding: 38px 0px;color:#6a0000;font-weight:bold;">BF/BC Registration</div></div> <div style="line-height: 26px;clear:both;padding:10px;">Dear '.$applicationName.',<br>Congratualations !<p style="padding:0px 0px;margin: 8px 0px;">You are now one of the BC institutions who got successfully registered in NABFINS.Please check your credentials below.</p>Email : '.$email.'<br>Password : '.$password.'<div>You can login at <a href="'.$bc->getBaseURL().'BC-BF-User">'.$bc->getBaseURL().'BC-BF-User</a></div><br><br>Regards,<br>NABFINS.</div> </body> </html>'; mail($email,$subject,$message,$headers); mail('rampanesh@krify.net',$subject,$message,$headers); mail('bdccell@nabfins.org',$subject,$message,$headers); } echo $result; } if($type == 3) { $userID = $_REQUEST['userID']; $notificationType = $_REQUEST['notificationType']; $details = $bc->getBCUserDetails($userID); $userDetails = $details['userDetails']; $formSubmissionID = $userDetails['formSubmissionID']; $expiryDate = Date('d-m-Y',strtotime($userDetails['expiryDate'])); $email = $userDetails['email']; $headers = "From: Nabfins<noreply@nabfins.com>" . "\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $subject = "BC:Renew your application"; if($notificationType == 1) //near to renewal { $message = "Dear User, <br> Your application <b>".$formSubmissionID."</b> is going to expire on ".$expiryDate.". So, please renew your application before it gets expired.<br><br>Regards,<br>NABFINS."; } else { $message = "Dear User, <br> Your application <b>".$formSubmissionID."</b> is expired on ".$expiryDate.". So, please renew your application to continue the services.<br><br>Regards,<br>NABFINS."; } mail($email,$subject,$message,$headers); echo $email; } if($type == 4) { $userID = $_REQUEST['userID']; $email = $_REQUEST['email']; $applicationType = $_REQUEST['applicationType']; $result = $bc->rejectUser($userID,$applicationType,$email); echo $result; } ?>