Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.64 KB | None | 0 0
  1. <?php include "connection.php";
  2. require('class.phpmailer.php');
  3.  
  4.  
  5.  
  6.  
  7. function getemail_byid($uid)
  8. {
  9.  
  10.  
  11. $res=mysqli_query($connection,"select * from `customer` where `id`='$uid'");
  12.  
  13. $row=mysqli_fetch_array($res);
  14.  
  15. $email = $row['email'];
  16.  
  17.  
  18.  
  19. }
  20. function getname_byid($uid)
  21.  
  22. {
  23. $res=mysqli_query("select * from `customer` where `id`='$uid'");
  24.  
  25. $row=mysqli_fetch_array($res);
  26.  
  27. return $row['name'];
  28.  
  29. }
  30.  
  31. function getcurrent_bal($uid)
  32.  
  33. {
  34.  
  35. $res=mysqli_query("select * from `balance` where `userid`='$uid'");
  36. $row=mysqli_fetch_array($res);
  37.  
  38. return $row['amount'];
  39. }
  40.  
  41.  
  42. ///
  43.  
  44.  
  45. ////
  46. function getcode_byid($id)
  47. {
  48.  
  49. $res=mysqli_query("SELECT * FROM `veryficationcode` WHERE `userid`='$id'");
  50.  
  51. $row=mysqli_fetch_array($res);
  52. return $row['code'];
  53. }
  54. function getid_byemail($email)
  55. {
  56. $res=mysqli_query("select * from `customer` where `email`='$email'");
  57. $row=mysqli_fetch_array($res);
  58. return $row['id'];
  59. }
  60. function getcurr($uid)
  61. {
  62. $res=mysqli_query("select * from `customer` where `id`='$uid'");
  63. $row=mysqli_fetch_array($res);
  64. return $row['currency'];
  65. }
  66. function getacc_byid($uid)
  67. {
  68. $res=mysqli_query("select * from `customer` where `id`='$uid'");
  69. $row=mysqli_fetch_array($res);
  70. return $row['acno'];
  71. }
  72. function show_message($msg)
  73. {
  74. if($msg==1){ echo "Password And Confirm-Password Does Not Match";}
  75. if($msg==2){ echo "Email Already Exists";}
  76. if($msg==3){ echo "Registration Failed";}
  77. if($msg==4){ echo "Password And Confirm-Password Does Not Match";}
  78. if($msg==5){ echo "Success";}
  79. if($msg==6){ echo "Email does not exist. ";}
  80. if($msg==9){ echo "Success. Please wait for the administrator to respond. ";}
  81. }
  82. function get_exist($table,$fild,$value)
  83. {
  84.  
  85. $sql="select * from $table where $fild=$value";
  86. $query=mysqli_query($sql);
  87. $count=mysqli_num_rows($query);
  88.  
  89. if($count>0)
  90. {
  91. return TRUE;
  92. }else
  93. {
  94.  
  95. return FALSE;
  96. }
  97. }
  98.  
  99. function valid_code($userid,$code)
  100. {
  101. $sql="select * from `veryficationcode` where `userid`='$userid' and `code`='$code'";
  102. $query=mysqli_query($sql);
  103. $count=mysqli_num_rows($query);
  104. if($count>0)
  105. {
  106. return TRUE;
  107.  
  108. }else
  109. {
  110. return FALSE;
  111. }
  112.  
  113. }
  114. function valid_code2($userid,$code2)
  115. {
  116. $sql="select * from `veryficationcode` where `userid`='$userid' and `code2`='$code2'";
  117. $query=mysqli_query($sql);
  118.  
  119. $count=mysqli_num_rows($query);
  120. if($count>0)
  121. {
  122. return TRUE;
  123. }else
  124. {
  125.  
  126. return FALSE;
  127. }
  128. }
  129. function send_mail_uid($email,$uid,$code)
  130. {
  131. $str="Your Account Has Been Setup. .. <br/> Your UserId No : ".$uid;
  132. $email=$email;
  133. $mail = new PHPMailer();
  134.  
  135. $mail->IsSMTP(); // send via SMTP
  136.  
  137. $mail->SMTPAuth = true; // turn on SMTP authentication
  138.  
  139. $mail->Username = "mail@scbanestoesb.com"; // SMTP username
  140.  
  141. $mail->Password = "abc123$%^"; // SMTP password
  142.  
  143. $webmaster_email = "mail@scbanestoesb.com"; //Reply to this email ID
  144. $email=$email; // Recipients email ID
  145. $name=$name; // Recipient's name
  146. $mail->From = $webmaster_email;
  147. $mail->FromName = "Online Administrator";
  148. $mail->AddAddress($email,$name);
  149. $mail->AddReplyTo($webmaster_email,"Online Administrator");
  150. $mail->WordWrap = 50; // set word wrap
  151. $mail->IsHTML(true); // send as HTML
  152. $mail->Subject = "Account Activation";
  153. $mail->Body = "$str"; //HTML Body
  154. $mail->AltBody = "This is the body when user views in plain text format"; //Text Body
  155. if(!$mail->Send())
  156. {
  157. echo "Mailer Error: " . $mail->ErrorInfo;
  158. }
  159. else
  160. {
  161. // echo "Mail has been sent";
  162. ?>
  163.  
  164. <!--<script type="text/javascript">window.location="users_details.php";</script>-->
  165.  
  166. <?php
  167.  
  168. //header("Location:".$_SERVER['HTTP_REFERER']."&send=success");
  169. }
  170.  
  171. }
  172.  
  173. function send_mail_reg($email,$uid)
  174.  
  175. {
  176.  
  177. $str="Your Application Has Been Received. Once Account Activation Has Been Completed, Administrator Respond. ";
  178.  
  179. $email=$email;
  180.  
  181. $mail = new PHPMailer();
  182.  
  183. $mail->IsSMTP(); // send via SMTP
  184.  
  185. $mail->SMTPAuth = true; // turn on SMTP authentication
  186. $mail->Username = "mail@scbanestoesb.com"; // SMTP username
  187. $mail->Password = "abc123$%^"; // SMTP password
  188.  
  189. $webmaster_email = "netpin@outlook.com"; //Reply to this email ID
  190. $email=$email; // Recipients email ID
  191. $name=$name; // Recipient's name
  192. $mail->From = $webmaster_email;
  193. $mail->FromName = "Online Administrator";
  194. $mail->AddAddress($email,$name);
  195.  
  196. $mail->AddReplyTo($webmaster_email,"Online Administrator");
  197.  
  198. $mail->WordWrap = 50; // set word wrap
  199.  
  200. $mail->IsHTML(true); // send as HTML
  201.  
  202. $mail->Subject = "Account Activation";
  203.  
  204. $mail->Body = "$str"; //HTML Body
  205. $mail->AltBody = "This is the body when user views in plain text format"; //Text Body
  206.  
  207. if(!$mail->Send())
  208.  
  209. {
  210.  
  211. echo "Mailer Error: " . $mail->ErrorInfo;
  212.  
  213. }
  214.  
  215. else
  216.  
  217. {
  218.  
  219.  
  220. // echo "Mail has been sent";
  221. ?>
  222.  
  223. <!--<script type="text/javascript">window.location="users_details.php";</script>-->
  224.  
  225. <?php
  226. //header("Location:".$_SERVER['HTTP_REFERER']."&send=success");
  227. }
  228.  
  229. }
  230.  
  231. ?>
  232.  
  233. enter code here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement