Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php include "connection.php";
- require('class.phpmailer.php');
- function getemail_byid($uid)
- {
- $res=mysqli_query($connection,"select * from `customer` where `id`='$uid'");
- $row=mysqli_fetch_array($res);
- $email = $row['email'];
- }
- function getname_byid($uid)
- {
- $res=mysqli_query("select * from `customer` where `id`='$uid'");
- $row=mysqli_fetch_array($res);
- return $row['name'];
- }
- function getcurrent_bal($uid)
- {
- $res=mysqli_query("select * from `balance` where `userid`='$uid'");
- $row=mysqli_fetch_array($res);
- return $row['amount'];
- }
- ///
- ////
- function getcode_byid($id)
- {
- $res=mysqli_query("SELECT * FROM `veryficationcode` WHERE `userid`='$id'");
- $row=mysqli_fetch_array($res);
- return $row['code'];
- }
- function getid_byemail($email)
- {
- $res=mysqli_query("select * from `customer` where `email`='$email'");
- $row=mysqli_fetch_array($res);
- return $row['id'];
- }
- function getcurr($uid)
- {
- $res=mysqli_query("select * from `customer` where `id`='$uid'");
- $row=mysqli_fetch_array($res);
- return $row['currency'];
- }
- function getacc_byid($uid)
- {
- $res=mysqli_query("select * from `customer` where `id`='$uid'");
- $row=mysqli_fetch_array($res);
- return $row['acno'];
- }
- function show_message($msg)
- {
- if($msg==1){ echo "Password And Confirm-Password Does Not Match";}
- if($msg==2){ echo "Email Already Exists";}
- if($msg==3){ echo "Registration Failed";}
- if($msg==4){ echo "Password And Confirm-Password Does Not Match";}
- if($msg==5){ echo "Success";}
- if($msg==6){ echo "Email does not exist. ";}
- if($msg==9){ echo "Success. Please wait for the administrator to respond. ";}
- }
- function get_exist($table,$fild,$value)
- {
- $sql="select * from $table where $fild=$value";
- $query=mysqli_query($sql);
- $count=mysqli_num_rows($query);
- if($count>0)
- {
- return TRUE;
- }else
- {
- return FALSE;
- }
- }
- function valid_code($userid,$code)
- {
- $sql="select * from `veryficationcode` where `userid`='$userid' and `code`='$code'";
- $query=mysqli_query($sql);
- $count=mysqli_num_rows($query);
- if($count>0)
- {
- return TRUE;
- }else
- {
- return FALSE;
- }
- }
- function valid_code2($userid,$code2)
- {
- $sql="select * from `veryficationcode` where `userid`='$userid' and `code2`='$code2'";
- $query=mysqli_query($sql);
- $count=mysqli_num_rows($query);
- if($count>0)
- {
- return TRUE;
- }else
- {
- return FALSE;
- }
- }
- function send_mail_uid($email,$uid,$code)
- {
- $str="Your Account Has Been Setup. .. <br/> Your UserId No : ".$uid;
- $email=$email;
- $mail = new PHPMailer();
- $mail->IsSMTP(); // send via SMTP
- $mail->SMTPAuth = true; // turn on SMTP authentication
- $mail->Username = "mail@scbanestoesb.com"; // SMTP username
- $mail->Password = "abc123$%^"; // SMTP password
- $webmaster_email = "mail@scbanestoesb.com"; //Reply to this email ID
- $email=$email; // Recipients email ID
- $name=$name; // Recipient's name
- $mail->From = $webmaster_email;
- $mail->FromName = "Online Administrator";
- $mail->AddAddress($email,$name);
- $mail->AddReplyTo($webmaster_email,"Online Administrator");
- $mail->WordWrap = 50; // set word wrap
- $mail->IsHTML(true); // send as HTML
- $mail->Subject = "Account Activation";
- $mail->Body = "$str"; //HTML Body
- $mail->AltBody = "This is the body when user views in plain text format"; //Text Body
- if(!$mail->Send())
- {
- echo "Mailer Error: " . $mail->ErrorInfo;
- }
- else
- {
- // echo "Mail has been sent";
- ?>
- <!--<script type="text/javascript">window.location="users_details.php";</script>-->
- <?php
- //header("Location:".$_SERVER['HTTP_REFERER']."&send=success");
- }
- }
- function send_mail_reg($email,$uid)
- {
- $str="Your Application Has Been Received. Once Account Activation Has Been Completed, Administrator Respond. ";
- $email=$email;
- $mail = new PHPMailer();
- $mail->IsSMTP(); // send via SMTP
- $mail->SMTPAuth = true; // turn on SMTP authentication
- $mail->Username = "mail@scbanestoesb.com"; // SMTP username
- $mail->Password = "abc123$%^"; // SMTP password
- $webmaster_email = "netpin@outlook.com"; //Reply to this email ID
- $email=$email; // Recipients email ID
- $name=$name; // Recipient's name
- $mail->From = $webmaster_email;
- $mail->FromName = "Online Administrator";
- $mail->AddAddress($email,$name);
- $mail->AddReplyTo($webmaster_email,"Online Administrator");
- $mail->WordWrap = 50; // set word wrap
- $mail->IsHTML(true); // send as HTML
- $mail->Subject = "Account Activation";
- $mail->Body = "$str"; //HTML Body
- $mail->AltBody = "This is the body when user views in plain text format"; //Text Body
- if(!$mail->Send())
- {
- echo "Mailer Error: " . $mail->ErrorInfo;
- }
- else
- {
- // echo "Mail has been sent";
- ?>
- <!--<script type="text/javascript">window.location="users_details.php";</script>-->
- <?php
- //header("Location:".$_SERVER['HTTP_REFERER']."&send=success");
- }
- }
- ?>
- enter code here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement