PHP - Php Code For Customer Transaction History
Customers can view transaction history for
approved and declined transactions (the reason for the decline should be included). Transactions are logged with their transaction reference numbers and status. Similar TutorialsSo I need to build into a PHP/MYSQL system I currently have a way for admins to see a list of things done through the CMS by all users. Any ideas? I am looking to see if I could use one of the paypal features to pay two diffierent account from a single transaction and does paypal does that automatically?.. I was checking the immediate payment for a third party from the express checkout but I don't know that much about it. Does anyone knows how to achieve this? Ok, so I am kind of just looking for some experience on this one. I am building a billing / referral system that works on a hierarchy. Now the hierarchy is simple and straight forward. However, I am trying to figure out the easiest / least error prone way of handling the payments. I have an IPN with paypal set up and working successfully. Here is how the system works: User signs up and refers several users. Each user pays $8 a month (paypal subscription). The system pays $1 7 levels deep. So The payment scheme would look like this: User 8 pays $1 to User 7, 6, 5, 4, 3, 2, and user 1. Then, the site keeps the remaining $1. I have the Paypal IPN saving the $8 payment transaction to the database. Now I need to divy it up, but I am split on when the best time to do this would be and how. There is a possibility that the user could pay a different amount less than or more than the $8 and they also pay a setup fee which should not be divided. It should only divide the shares when the current account is paid in full. Another thing to keep in mind, is that the $8 subscription, 7 levels deep, and the setup fee are variable numbers. (The admin may change it at any time.) I see multiple solutions, but not sure which would be best as all have possibility for errors in handling. Any advice would be helpful. Thanks, Tom I'm using a php video web script which includes this buy_video.php file, which calculates the video uploader's earned amount, and insert's that amount in the 'u_paid_videos' table column named 'earned_amount', which appears in this file on line 73: <?php ob_start(); if (IS_LOGGED == false) { $data = array('status' => 400, 'error' => 'Not logged in'); echo json_encode($data); exit(); } if (!empty($_POST['id'])) { if (!is_array($_POST['id'])) { $id_array[] = $_POST['id']; } else { $id_array = $_POST['id']; } // get cost video // get the default video price, to use if there is no per video play price $db->where('name', 'video_play_price'); $db_cost = $db->getOne('config'); $video_cost = (float)$db_cost->value; // the number of submitted videos - used to determine if all records were inserted $count_video = count($id_array); $user_id = $user->id; $wallet = (float)str_replace(',', '', $user->wallet); $balance = (float)str_replace(',', '', $user->balance); // add up the video prices $amount = 0; foreach ($id_array as $id) { $video_id = (int)PT_Secure($id); // get video data $video = $db->where('id', $id)->getOne(T_VIDEOS); // add the video play price if any, or the default price $amount += $video->video_play_price?$video->video_play_price:$video_cost; } // determine if the user has enough credits if( ($wallet >= $amount) OR ($balance + $wallet >= $amount) ) { //if( ($wallet >= $amount) OR ($balance >= $amount) ) { $db->startTransaction(); $inserted_records = 0; foreach ($id_array as $id){ $video_id = (int)PT_Secure($id); // get video data $video = $db->where('id', $id)->getOne(T_VIDEOS); // use the video play price if any, or the default price $video_cost_new = $video->video_play_price?$video->video_play_price:$video_cost; // credit the user 50% of the video cost $uploader_amount = $video_cost_new *0.50; // add data to paid table $insert_buy = $db->insert('u_paid_videos', [ 'id_user' => $user_id, 'id_video' => $video_id, 'session_key' => $_SESSION['session_key'], 'video_play_price' => (string)$video_cost, // the cost at the time of purchase // this is the default video cost not the $video_cost_new 'video_title' => $video->title, // storing the title 'user_id_uploaded' => $video->user_id, // the user who uploaded the video 'earned_amount' => $uploader_amount, ]); // count successful inserted records if ($insert_buy) { $inserted_records++; } //update the 'balance' of the user who uploaded the video // get the user's record $userwallet = $db->where('id', $video->user_id)->getOne(T_USERS); // add to the balance $videouserwallet = $userwallet->balance+$uploader_amount; // update the record $db->where('id', $video->user_id); $update_balance = $db->update(T_USERS, [ 'balance' => number_format($videouserwallet, 1, '.', ''), ]); } $update_wallet = null; $update_user_balance = null; ETC ..................................................... Ultimately, I’m trying to integrate the buy_video.php file’s ‘$earned_amount’ into a web script’s existing transaction file. Here are a couple of lines from that transaction file: $this_day_video_earn = $db->rawQuery("SELECT SUM(amount - admin_com) AS sum FROM ".T_VIDEOS_TRSNS." c WHERE `time` >= ".$day_start." AND `time` <= ".$day_end." AND user_id = ".$pt->user->id); $today_earn = $this_day_ads_earn[0]->sum + $this_day_video_earn[0]->sum ; and $trans = $db->where('user_id',$user->id)->orderBy('id','DESC')->get(T_VIDEOS_TRSNS); That may not be enough info, but I’d like assistance changing those lines to: $this_day_video_earn = $db->rawQuery("SELECT SUM(earned_amount) AS sum FROM “.T_VIDEOS.” c WHERE time >= “.$day_start.” AND time <= “.$day_end.” AND user_id = ".$pt->user->id); $trans = $db->where('user_id',$user->id)->orderBy('id','DESC')->get(T_VIDEOS);
I tried those changes without success.
Edited March 15, 2019 by Chrisj Hey guys...I have a php that loads when the user is being taken after making a purchase. On that php file, echo and print are disabled...and I need to send a variable from that php file to flash, doesnt matter is flash, could be other php file, html, anyway... <param name="movie" value="retorno.swf?userId=<?php echo $Referencia; ?>" /> On the example above I am using echo $Referencia...I need some function to substitue echo/print... Any ideas??? Thanks in advance! I need some advice on how to implement, if possible, the following scenario: I would like start a MySQL transaction to process database changes through Ajax requests and commit the changes on request of the user. The web application needs to allow multiple users, but can be limited. If persistent connections must be used, any persistent connections must be terminated after a length of time, or on session time to avoid hogging the limited number of persistent users available. Is there any good way of doing this? And were should I begin my research. Much thanks! Hi there.... I am facing problem regarding credit card transaction ....an error i am keep on getting "Security header is not valid"....i searched for that but all are saying that its because of using "wrong credentials"...but i have gone through all my docs....i think i am using the right one......anyone there to help me out please....i really need it to get done.........thanxx..... How can I do the following: 1. Upon successful login, generate a random 8-digit customer number and assign it to that customer and writes that data to mYsQl. 2. Screen then refreshes and reads, "Welcome Mr Smith". Hi Guys, Basically, I have a long php script to calculate the nearest branch dependant on there postcode hence why $to = $branchemail at the end. It will send it to HQ if anything goes wrong as a safeguard. Here is a small piece of my php code: if (strlen($branchemail) == 0){ // Default Address if anything goes wrong $to = "hq@example.com"; } else { // The address of the branch to send to $to = $branchemail; } What I can't seem to do is also send the customer filling in the php form a copy of the email sent. The variable for the customers email is $email I have tried this and it doesn't seem to work either... // The address of the branch to send to $to = $branchemail; $to .= $email; } At the bottom of the script, there is this code to physically send the email. This also always sends a copy to hq aswell. echo "Thank you for contacting us, we have received your message and we aim to respond your very shortly."; mail($to, $subject, $body, $mailheader); // THIS LINE TO CC Email mail("hq@example.com", $subject, $body, $mailheader); } else { echo "There has been an error code 1. Please try again."; So basically I just can't get it to send a copy to the customer filling it in ($email) Any idea's because my mind has gone blank. Cheers, S I built a address book for customers and i realize now im not sure the best way to allow the customer to edit/delete their addresses, but stopping them from pulling/editing other customers info. Even if i use post data only they could still view the page source and see the address ID being posted to the next page and change it, to see or edit someone elses data... Should i encrypt the ID? Is that even good enough? Im using PHP/MYSQL Help! I'm stuck! This is the feedback form file I made. Code: [Select] <html> <head><title>Bob's Auto Parts - Customer Feedback</title></head> <body> <h1>Customer Feedback</h1> <p>Please tell us what you think.</p> <form action="processfeedback.php" method="post"> <p>Your name:<br/> <input type="text" name="name" size="40" /></p> <p>Your email address:<br/> <input type="text" name="email" size="40" /></p> <p>Your feedback:<br/> <textarea name="feedback" rows="8" cols="40" wrap="virtual" /></textarea></p> <p><input type="submit" value="Send feedback" /></p> </form> </body> </html> And this is the process feedback file I made. Code: [Select] <?php //create short variable names $name = trim($_POST['name']); $email = trim($_POST['email']); $feedback = trim($_POST['feedback']); //set up some static information $toaddress = "wolocaw@localhost"; $subject = "Feedback from web site"; $mailcontent = "Customer name: ".$name."\n". "Customer email: ".$email."\n". "Customer comments:\n".$feedback."\n"; $fromaddress = "From: webserver@example.com"; //invoke mail() function to send mail mail($toaddress, $subject, $mailcontent, $fromaddress); ?> <html> <head> <title>Bob's Auto Parts - Feedback Submitted</title> </head> <body> <h1>Feedback submitted</h1> <p>Your feedback (shown below) has been sent.</p> <p><?php echo nl2br($mailcontent); ?> </p> </body> </html> After I fill out the form, it brings me to a page that says "Feedback submitted" at the top and "Your feedback (shown below) has been sent." below it. And that's it. nl2br($mailcontent) doesn't do anything. What am I doing wrong? I don't understand! Hi all, I want some help regarding my banking project. I have a customer registration form in my project.After successfully completion of the form users have to click on the "Open Account" button.Thereafter a customer id(Auto increment value) should be generated.It was stored in the database where other form details are also being stored. How can i call to this one by one customer id's?? Heshan, Hi everyone,
I have an application that makes use of a transaction, inserting and updating values in different tables. One of the first tables it inserts into has an auto increment ID field. This ID values is used / updated in some other tables. Everything works fine. If however the transaction fails then the auto_increment values are upset - meaning that the sequence is jumped.
For ex. if I had auto_increment values from 1 to 6 in this table and then the insert query fails for an auto_increment value of ID=7, then this value of ID = 7 is lost because the next time the query is run the auto_increment ID value will be equal to 8 and accordingly updated in the tables. ID value = 7 is lost. Is there any way to prevent this ? Please know that this is a multi - user application.
Thanks.
Good morning, I'm writing a php script on a transaction creation/initiation. Only a registered user can initiate a transaction but if the second party to the transaction is not a registered user, the system will send a mail to the user informing him/her to accept and create an account. The whole idea is i have four conditional statement and each condition needs to send mail to the transaction initiator and the second party. so i am sending 8 mails but 2 at a time if and only if the condition is met. below is my code if ($mode==1){ //echo "Mode 1: ".$mode; $mode2 = 2; $sql = "SELECT * FROM reg WHERE email='$email'"; $query = mysqli_query($con,$sql); $rowreg = mysqli_fetch_row($query); $dbid = $rowreg[0]; $dbemail = $rowreg[1]; if (mysqli_num_rows($query)>0){ /* Create a new PHPMailer object. Passing TRUE to the constructor enables exceptions. */ $mail = new PHPMailer(TRUE); /* Open the try/catch block. */ try { /* Set the mail sender. */ $mail->setFrom('no-reply@me.com', 'Mecom'); /* Add a recipient. */ $mail->addAddress("$email", "$full_name"); /* Set the subject. */ $mail->Subject = 'Transaction Created Successfully'; $mail->isHTML(TRUE); /* Set the mail message body. */ $mail->Body = '<div class="email-background" style="background: #eee;padding: 10px;"> <a href=""><center><img src="" style="padding-top:30px;padding-bottom:30px;max-width:100px;height:100px;margin: 0 auto;"></center><a> <div class="email-container" style="max-width: 500px;background: white;font-family: san-serif;margin: 0 auto;overflow: hidden;border-radius: 5px;text-align: center;"> <p style="margin: 20px;font-size: 12px;font-weight: 300;color: #666;line-height: 1.5;text-align:left"> Dear <b>' . $full_name . '</b>;<br/>We believe there is an agreement between you and <b>'. $fullname .' </b>for a transaction. Please see the details of the transaction below</p> <div class="table table-responsive" style="margin-left: 10px;margin-right: 10px;"> <table class="table table-striped table-bordered" style="max-width: 100%;background-color: transparent;border-collapse: collapse;border-spacing: 0;display: table;width: 100%;margin-bottom: 20px;border: 1px solid #ddd;"> <tbody style="display: table-row-group;vertical-align: middle;border-color: inherit;"> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="2" width="100%" style="text-align: center;background: #00bf6f;color: white;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;font-size:20px">Transaction Details <b>'.$transact_no.'</b></td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 12px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Transaction Title</td> <td colspan="" width="80%" style="text-align: right;font-size: 12px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$db_cat_category.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 12px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Transaction Description</td> <td colspan="" width="80%" style="text-align: right;font-size: 12px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$description.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Transaction Link</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$tran_link.'</td> </tr> '.$customerMail.' <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Item Worth/Price</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">₦'.$price_format.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Charges bearer</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$charges.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Total Charges</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">₦'.$chrg.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Who pay the charges?</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$chrgs.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Buyer Pays</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$buyer_t_pay.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Seller Receives</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$seller_t_receives.'</td> </tr> </tbody> </table> </div> </div> <div class="footer-junk" style="background: none;padding: 20px;font-size: 12px;text-align: center;"> Copyright © Mecom'. $year .' All Rights Reserved </div> </div>'; /* Finally send the mail. */ //$mail->send(); if (!$mail->send()){ /* PHPMailer error. */ echo $mail->ErrorInfo; }else{ $output ="<div class=\"alert alert-success\">Transaction has been created successfully</div>"; } catch (Exception $e) { /* PHPMailer exception. */ echo $e->errorMessage(); } catch (\Exception $e) { /* PHP exception (note the backslash to select the global namespace Exception class). */ echo $e->getMessage(); } // //End of First User //Second User // $fullname = $user["firstname"] . " " . $user["lastname"]; $full_name = $fname . " ". $lname; /* Create a new PHPMailer object. Passing TRUE to the constructor enables exceptions. */ $mail = new PHPMailer(TRUE); /* Open the try/catch block. */ try { /* Set the mail sender. */ $mail->setFrom('no-reply@me.com', 'Mecom'); /* Add a recipient. */ $mail->addAddress("$dbemail", "$fullname"); /* Set the subject. */ $mail->Subject = 'Transaction Created Successfully'; $mail->isHTML(TRUE); /* Set the mail message body. */ $mail->Body = '<div class="email-background" style="background: #eee;padding: 10px;"> <a href=""><center><img src="" style="padding-top:30px;padding-bottom:30px;max-width:100px;height:100px;margin: 0 auto;"></center><a> <div class="email-container" style="max-width: 500px;background: white;font-family: san-serif;margin: 0 auto;overflow: hidden;border-radius: 5px;text-align: center;"> <p style="margin: 20px;font-size: 12px;font-weight: 300;color: #666;line-height: 1.5;text-align:left"> Dear ' . $fullname . ',<br/>You just initiated a transaction with title <b>'. $cat_category .'</b> and description <b> '. $description .' </b>to <b>'. $full_name .' </b>. Below is the details of the transaction</p> <div class="table table-responsive" style="margin-left: 10px;margin-right: 10px;"> <table class="table table-striped table-bordered" style="max-width: 100%;background-color: transparent;border-collapse: collapse;border-spacing: 0;display: table;width: 100%;margin-bottom: 20px;border: 1px solid #ddd;"> <tbody style="display: table-row-group;vertical-align: middle;border-color: inherit;"> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="2" width="100%" style="text-align: center;background: #00bf6f;color: white;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;font-size:20px">Transaction Details <b>'.$transact_no.'</b></td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 12px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Transaction Title</td> <td colspan="" width="80%" style="text-align: right;font-size: 12px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$db_cat_category.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 12px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Transaction Description</td> <td colspan="" width="80%" style="text-align: right;font-size: 12px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$description.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Transaction Link</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$tran_link.'</td> </tr> '.$customerMail.' <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Item Worth/Price</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">₦'.$price_format.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Charges bearer</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$charges.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Total Charges</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">₦'.$chrg.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Who pay the charges?</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$chrgs.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Buyer Pays</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$buyer_t_pay.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Seller Receives</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$seller_t_receives.'</td> </tr> </tbody> </table> </div> </div> <div class="footer-junk" style="background: none;padding: 20px;font-size: 12px;text-align: center;"> Copyright © Mecom'. $year .' All Rights Reserved </div> </div>'; /* Finally send the mail. */ //$mail->send(); if (!$mail->send()){ /* PHPMailer error. */ echo $mail->ErrorInfo; }else{ // $output ="<div class=\"alert alert-success\">Transaction has been created successfully</div>"; echo "<script> window.onload = function() { sweetAlert({ title: 'Congratulations', text: 'Your transaction has been created successfully', type: 'success', confirmButtonColor: '#B6EA36' }, function () { window.location.href = './'; }); }; </script>"; } } catch (Exception $e) { /* PHPMailer exception. */ echo $e->errorMessage(); } catch (\Exception $e) { /* PHP exception (note the backslash to select the global namespace Exception class). */ echo $e->getMessage(); } // //End of Second User }else{ //if the second user that is not the initiator is not a registered user //Add user info into the database table for the main site table //include ('includes/randStrGen.php'); $reg_no = randStrGen(4); $check_ID_query = mysqli_query($con, "SELECT regNo FROM reg WHERE regNo='$reg_no'"); $i = 0; //if username exists add number to username while(mysqli_num_rows($check_ID_query) != 0) { $i++; //Add 1 to i $reg_no = $reg_no + $i; $check_ID_query = mysqli_query($con, "SELECT regNo FROM reg WHERE regNo='$reg_no'"); } /* echo "First Name ". $fname . "<br>"; echo "Last Name ". $lname . "<br>"; echo "Address ". $address . "<br>"; echo "Phone Number ". $phonenumber . "<br>"; echo "Registration Number ". $reg_gen . "<br>"; exit();*/ $sql_reg = "INSERT INTO reg(email,password,firstname,lastname,marital_status,phone_number,IDmeans,passportID,lastlogin,regNo,address,bank_acct_number,bank_acct_name,bank_name,real_pass,activation,regDate) VALUES('$email','0','$fname','$lname','0','$phonenumber','0','0',now(),'$reg_no','$address','0','0','0','0','0',now())"; $query_reg = mysqli_query($con,$sql_reg); $regid = mysqli_insert_id($con); $sql_reg_verify = "INSERT INTO account_verify(token_email,refno) VALUES('$email','$reg_no')"; $query_reg_verify = mysqli_query($con,$sql_reg_verify); //$regid = mysqli_insert_id($link); $sql_description = "INSERT INTO description(item_description,transactID) VALUES('$description','$transact_no')"; $query_description = mysqli_query($con,$sql_description); $descid = mysqli_insert_id($con); //$r_tran= $_SESSION['transID'] .$descid ; $sql = "INSERT INTO trans_tbl(transact_no,transact_date,agreement_status,mode_transactID,transact_catID,regID,descID,amount,shipcost,status,transaction_period,inspection_length,charges,amt_pay,comp_charges,transaction_link,payment_status,shipment_status,confirm_shipment,address,refno) VALUES('$transact_no',now(),'1','$mode','$cat','$user[id]','$descid','$price','0','0','0','0','$charges','0','$chrg','0','0','0','0','$address','0'), ('$transact_no',now(),'1','$mode2','$cat','$regid','$descid','$price','0','0','0','0','$charges','0','$chrg','0','0','0','0','$address','0')"; $query = mysqli_query($con,$sql); /* Sending mail to new user to update his/her password */ $encode_email = base64_encode(base64_encode($email)); $encode_reg = base64_encode(base64_encode($reg_no)); //$encode_transactiinID = base64_encode(base64_encode($_SESSION['transID'])); //$encode_parnterID = base64_encode(base64_encode($_SESSION['id'])); //$encode_modeID = base64_encode(base64_encode($mode)); $link_url="<a href=\"https://www.safetranzact.com/verify-account?token=$encode_reg\" style=\"text-decoration: none;display: inline-block;background: #00bf6f;color: white;padding: 10px 20px;border-radius: 5px;\">Review and Sign up</a>"; $year = date('Y'); //send email to the receiver //First user for non register // $full_name = $fname . " " . $lname; $fullname = $user["firstname"] . " ". $user["lastname"]; /* Create a new PHPMailer object. Passing TRUE to the constructor enables exceptions. */ $mail = new PHPMailer(TRUE); /* Open the try/catch block. */ try { /* Set the mail sender. */ $mail->setFrom('no-reply@me.com', 'Mecom'); /* Add a recipient. */ $mail->addAddress("$email", "$full_name"); /* Set the subject. */ $mail->Subject = 'Account/Transaction Verification'; $mail->isHTML(TRUE); /* Set the mail message body. */ $mail->Body = '<div class="email-background" style="background: #eee;padding: 10px;"> <a href=""><center><img src="" style="padding-top:30px;padding-bottom:30px;max-width:100px;height:100px;margin: 0 auto;"></center><a> <div class="email-container" style="max-width: 500px;background: white;font-family: san-serif;margin: 0 auto;overflow: hidden;border-radius: 5px;text-align: center;"> <p style="margin: 20px;font-size: 12px;font-weight: 300;color: #666;line-height: 1.5;text-align:left"> Dear ' . $full_name. ',<br/>We believe there is an agreement between you and <b>'. $fullname .' </b> for a transaction. And we noticed that you have not yet signed up; Please Sign up and see the details of the transaction below</p> <div class="table table-responsive" style="margin-left: 10px;margin-right: 10px;"> <table class="table table-striped table-bordered" style="max-width: 100%;background-color: transparent;border-collapse: collapse;border-spacing: 0;display: table;width: 100%;margin-bottom: 20px;border: 1px solid #ddd;"> <tbody style="display: table-row-group;vertical-align: middle;border-color: inherit;"> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="2" width="100%" style="text-align: center;background: #00bf6f;color: white;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;font-size:20px">Transaction Details <b>'.$transact_no.'</b></td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 12px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Transaction Title</td> <td colspan="" width="80%" style="text-align: right;font-size: 12px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$db_cat_category.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 12px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Transaction Description</td> <td colspan="" width="80%" style="text-align: right;font-size: 12px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$description.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Transaction Link</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$tran_link.'</td> </tr> '.$customerMail.' <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Item Worth/Price</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">₦'.$price_format.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Charges bearer</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$charges.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Total Charges</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">₦'.$chrg.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Who pay the charges?</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$chrgs.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Buyer Pays</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$buyer_t_pay.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Seller Receives</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$seller_t_receives.'</td> </tr> </tbody> <tfoot> <tr> <td colspan="2">'.$link_url.'</td> </tr> </tfoot> </table> </div> </div> <div class="footer-junk" style="background: none;padding: 20px;font-size: 12px;text-align: center;"> Copyright © Mecom'. $year .' All Rights Reserved </div> </div>'; /* Finally send the mail. */ //$mail->send(); if (!$mail->send()){ /* PHPMailer error. */ echo $mail->ErrorInfo; }else{ $output ="<div class=\"alert alert-success\">Transaction has been created successfully</div>"; } } catch (Exception $e) { /* PHPMailer exception. */ echo $e->errorMessage(); } catch (\Exception $e) { /* PHP exception (note the backslash to select the global namespace Exception class). */ echo $e->getMessage(); } // // //End of First user for non register //Second user for register // $full_name = $fname . " " . $lname; $fullname = $user["firstname"] . " ". $user["lastname"]; $year = date('Y'); /* Create a new PHPMailer object. Passing TRUE to the constructor enables exceptions. */ $mail = new PHPMailer(TRUE); /* Open the try/catch block. */ try { /* Set the mail sender. */ $mail->setFrom('no-reply@me.com', 'Mecom'); /* Add a recipient. */ $mail->addAddress("$dbemail", "$fullname"); /* Set the subject. */ $mail->Subject = 'Transaction Created Successfully'; $mail->isHTML(TRUE); /* Set the mail message body. */ $mail->Body = '<div class="email-background" style="background: #eee;padding: 10px;"> <a href=""><center><img src="" style="padding-top:30px;padding-bottom:30px;max-width:100px;height:100px;margin: 0 auto;"></center><a> <div class="email-container" style="max-width: 500px;background: white;font-family: san-serif;margin: 0 auto;overflow: hidden;border-radius: 5px;text-align: center;"> <p style="margin: 20px;font-size: 12px;font-weight: 300;color: #666;line-height: 1.5;text-align:left"> Dear ' . $fullname . ',<br/>You just initiated a transaction with title <b>'. $cat_category .'</b> and description <b>'. $description .' </b> to <b>'. $full_name .' </b> Below is the details of the transaction</p> <div class="table table-responsive" style="margin-left: 10px;margin-right: 10px;"> <table class="table table-striped table-bordered" style="max-width: 100%;background-color: transparent;border-collapse: collapse;border-spacing: 0;display: table;width: 100%;margin-bottom: 20px;border: 1px solid #ddd;"> <tbody style="display: table-row-group;vertical-align: middle;border-color: inherit;"> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="2" width="100%" style="text-align: center;background: #00bf6f;color: white;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;font-size:20px">Transaction Details <b>'.$transact_no.'</b></td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 12px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Transaction Title</td> <td colspan="" width="80%" style="text-align: right;font-size: 12px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$db_cat_category.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 12px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Transaction Description</td> <td colspan="" width="80%" style="text-align: right;font-size: 12px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$description.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Transaction Link</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$tran_link.'</td> </tr> '.$customerMail.' <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Item Worth/Price</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">₦'.$price_format.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Charges bearer</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$charges.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Total Charges</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">₦'.$chrg.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Who pay the charges?</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$chrgs.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Buyer Pays</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$buyer_t_pay.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Seller Receives</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$seller_t_receives.'</td> </tr> </tbody> </table> </div> </div> <div class="footer-junk" style="background: none;padding: 20px;font-size: 12px;text-align: center;"> Copyright © Mecom'. $year .' All Rights Reserved </div> </div>'; /* Finally send the mail. */ //$mail->send(); if (!$mail->send()){ /* PHPMailer error. */ echo $mail->ErrorInfo; }else{ echo "<script> window.onload = function() { sweetAlert({ title: 'Congratulations', text: 'Your transaction has been created successfully', type: 'success', confirmButtonColor: '#B6EA36' }, function () { window.location.href = './'; }); }; </script>"; } } catch (Exception $e) { /* PHPMailer exception. */ echo $e->errorMessage(); } catch (\Exception $e) { /* PHP exception (note the backslash to select the global namespace Exception class). */ echo $e->getMessage(); } //$mail4->ClearAllRecipients(); // //End of Second user for register } }else{ ///////////////////////Second condition with //echo "Mode 2: ".$mode; $mode2 = 1; $sql = "SELECT * FROM reg WHERE email='$email' LIMIT 1"; $query = mysqli_query($con,$sql); $rowreg = mysqli_fetch_row($query); $dbid = $rowreg[0]; $dbemail = $rowreg[1]; if (mysqli_num_rows($query)>0){ //Add user info into the database table for the main site table $sql_description = "INSERT INTO description(item_description,transactID) VALUES('$description','$transact_no')"; $query_description = mysqli_query($con,$sql_description); $desc_id = mysqli_insert_id($con); //$r_tran= $_SESSION['transID'] .$descid ; $sql = "INSERT INTO trans_tbl(transact_no,transact_date,agreement_status,mode_transactID,transact_catID,regID,descID,amount,shipcost,status,transaction_period,inspection_length,charges,amt_pay,comp_charges,transaction_link,payment_status,shipment_status,confirm_shipment,address,refno) VALUES('$transact_no',now(),'1','$mode','$cat','$user[id]','$desc_id','$price','0','0','0','0','$charges','0','$chrg','$tran_link','0','0','0','$address','0'), ('$transact_no',now(),'1','$mode2','$cat','$dbid','$desc_id','$price','0','0','0','0','$charges','0','$chrg','$tran_link','0','0','0','$address','0')"; $query = mysqli_query($con,$sql); //First user to received email // $full_name = $fname . " ". $lname; $fullname = $user["firstname"] . " ". $user["lastname"]; $year = date('Y'); /* Create a new PHPMailer object. Passing TRUE to the constructor enables exceptions. */ $mail = new PHPMailer(TRUE); /* Open the try/catch block. */ try { /* Set the mail sender. */ $mail->setFrom('no-reply@me.com', 'Mecom'); /* Add a recipient. */ $mail->addAddress("$email", "$full_name"); /* Set the subject. */ $mail->Subject = 'Transaction Created Successfully'; $mail->isHTML(TRUE); /* Set the mail message body. */ $mail->Body = '<div class="email-background" style="background: #eee;padding: 10px;"> <a href="https://www.safetranzact.com"><center><img src="https://www.safetranzact.com/assets/images/fav.png" style="padding-top:30px;padding-bottom:30px;max-width:100px;height:100px;margin: 0 auto;"></center><a> <div class="email-container" style="max-width: 500px;background: white;font-family: san-serif;margin: 0 auto;overflow: hidden;border-radius: 5px;text-align: center;"> <p style="margin: 20px;font-size: 12px;font-weight: 300;color: #666;line-height: 1.5;text-align:left"> Dear <b>' . $full_name . '</b>,<br/>We believe there is an agreement between you and <b> '. $fullname .' </b>for a transaction. Please see the details of the transaction below</p> <div class="table table-responsive" style="margin-left: 10px;margin-right: 10px;"> <table class="table table-striped table-bordered" style="max-width: 100%;background-color: transparent;border-collapse: collapse;border-spacing: 0;display: table;width: 100%;margin-bottom: 20px;border: 1px solid #ddd;"> <tbody style="display: table-row-group;vertical-align: middle;border-color: inherit;"> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="2" width="100%" style="text-align: center;background: #00bf6f;color: white;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;font-size:20px">Transaction Details <b>'.$transact_no.'</b></td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 12px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Transaction Title</td> <td colspan="" width="80%" style="text-align: right;font-size: 12px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$db_cat_category.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 12px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Transaction Description</td> <td colspan="" width="80%" style="text-align: right;font-size: 12px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$description.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Transaction Link</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$tran_link.'</td> </tr> '.$customerMail.' <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Item Worth/Price</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">₦'.$price_format.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Charges bearer</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$charges.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Total Charges</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">₦'.$chrg.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Who pay the charges?</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$chrgs.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Buyer Pays</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$buyer_t_pay.'</td> </tr> <tr style="display: table-row;vertical-align: inherit;border-color: inherit;"> <td colspan="" width="20%" style="text-align: left;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">Seller Receives</td> <td colspan="" width="80%" style="text-align: right;font-size: 14px;border: 1px solid #ddd;padding: 8px;line-height: 1.428571429;vertical-align: top;border-top: 1px solid #ddd;">'.$seller_t_receives.'</td> </tr> </tbody> </table> </div> </div> <div class="footer-junk" style="background: none;padding: 20px;font-size: 12px;text-align: center;"> Copyright © Safetranzact '. $year .' All Rights Reserved </div> </div>'; /* Finally send the mail. */ //$mail->send(); if (!$mail->send()){ /* PHPMailer error. */ echo $mail->ErrorInfo; }else{ $output ="<div class=\"alert alert-success\">Transaction has been created successfully</div>"; } //$mail->ClearAllRecipients(); } catch (Exception $e) { /* PHPMailer exception. */ echo $e->errorMessage(); } catch (\Exception $e) { /* PHP exception (note the backslash to select the global namespace Exception class). */ echo $e->getMessage(); } //$mail->ClearAllRecipients(); // //End of First user to received email //Second user to received email // $fullname = $user["firstname"] . " " . $user["lastname"]; $full_name = $fname . " " . $lname; $year = date('Y'); /* Create a new PHPMailer object. Passing TRUE to the constructor enables exceptions. */ $mail = new PHPMailer(TRUE); /* Open the try/catch block. */ try { /* Set the mail sender. */ $mail->setFrom('no-reply@safetranzact.com', 'Safetranzact'); /* Add a recipient. */ $mail->addAddress("$dbemail", "$fullname"); /* Set the subject. */ $mail->Subject = 'Transaction Created Successfully'; $mail->isHTML(TRUE); /* Set the mail message body. */ $mail->Body = '<div class="email-background" style="background: #eee;padding: 10px;"> <a href=""><center><img src="" style="padding-top:30px;padding-bottom:30px;max-width:100px;height:100px;margin: 0 auto;"></center><a> <div class="email-container" style="max-width: 500px;background: white;font-family: san-serif;margin: 0 auto;overflow: hidden;border-radius: 5px;text-align: center;"> <p style="margin: 20px;font-size: 12px;font-weight: 300;color: #666;line-height: 1.5;text-align:left"> Dear ' . $fullname . ',<br/>You just initiated a transaction with title <b>'. $cat_category .'</b> and description <b>'. $description .' to <b>'. $full_name .' </b>Below is the details of the transaction</p> <div class="table table-responsive" style="margin-left: 10px;margin-right: 10px;"> <table class="table table-striped table-bordered" style=" Hi guys.
Having been around here a little while, this is my first post, so please be gentle!
I have a question regarding creating an installer file. For years I've developed web based PHP apps for customers, ranging from simple stock systems to customer databases and booking systems. I've always used XAMPP to install the necessary modules, and then manually created the databases and copied the files into the htdocs folder.
I'm now looking at possibly branching out and offering products as standalone purchases, and obviously don't want to have to attend the customer's property each time to set up and install everything. Ideally, I would like to create a standalone Windows based installer that would install PHP, MySQL, create the databases and put the web app into the htdocs folder. In essence, allow a customer to download the application's "installer", which the run through in a standard wizard based format, and then at the end everything is ready to go.
Does anyone know if this is possible?
Many thanks,
MR
Hi guys, I want something to be clarified. The supervisor of my system is responsible for approving accounts. When he logged into the system he should be able to view the customer records based on customer ID. That is when he types the relevant customer ID and clicks on search button the relevant record is displayed in a form. That part is OK. Thereafter he should approve the account by clicking on "Approve Account" button. I want to know how can he make sure relevant customer_id is approved or not. customer table includes fields of, customer_id, nic, full_name, name_with_initials, address, contact_number, gender. I want to whether i have add an extra field to my customer table saying "approves status" or whatever. Can anyone give me a suggestion?? Thanks, Heshan I just signed up for an affiliate network (commission junction) to help me drive traffic to my donation generation website for Charities. My Software uses CAKE PHP on an Apache Server with MySql. I had to put a pixel on the order confirmation page passing the Transaction ID and The Purchase Amount from the database. The Transactions are located in the transaction table but the code that was written is passing EVERY Transaction in the database every time something is purchased. The Columns for the transaction table are ID CREATED MODIFIED USERID CLASS TRANSACTION_TYPE_ID and AMOUNT I have 32 types of Transactions in my Transaction_Type Table, the only transaction_types that are sales generated by the affiliate network are transaction_type 2. The code I have now which isn't working correctly is. <?php // Make a MySQL Connection mysql_connect("localhost", "frankgth", "andrew2011!") or die(mysql_error()); mysql_select_db("frankgth_groupon5") or die(mysql_error()); // Get all the data from the "example" table $result = mysql_query("SELECT * FROM `transactions` ") or die(mysql_error()); // keeps getting the next row until there are no more to get - while($row = mysql_fetch_array( $result )) { ?> <img src="https://www.emjcd.com/u?CID=1521593&OID=<?php echo $row['id'];?>&TYPE=349217&ITEM1=PURCHASE&AMT1=<?php echo $row['amount'];?>&QTY1=1&CURRENCY=USD&METHOD=IMG" height="1" width="20"> <?php } ?> How Do I only show this pixel if the action is Transaction_Type_ID is equal to number 2,with the Amount and Transaction ID. Thanks in advaced. This site helps charity so i really want to get it working! Hi My website is a Wordpress WooCommerce. I modified the PHP function that worked well before I added the multiple customer roles. I have regular customers and regular and tier-level wholesalers. I live in Canada and with have two taxes to apply (GST & PST). We also have customers/wholesalers that get exempted from one tax (PST) only or both taxes. I have one regular wholesale role with two tax exemption roles: 'wholesale_customer', 'wholesale_pst_exempt', 'wholesale_tax_exempt'. I have 4 tier levels wholesale roles with each their own tax exemption roles: 'wholesale_silvia_silver', 'wholesale_silvia_gold', 'wholesale_silvia_premium', 'wholesale_silvia_union' 'wholesale_silvia_silver_pst_exempt', 'wholesale_silvia_gold_pst_exempt', 'wholesale_silvia_premium_pst_exempt', 'wholesale_silvia_union_pst_exempt' 'wholesale_silvia_silver_tax_exempt', 'wholesale_silvia_gold_tax_exempt', 'wholesale_silvia_premium_tax_exempt', 'wholesale_silvia_union_tax_exempt' The tier levels are new and I'm trying to update my existing function that applies different tax rates based on customer user roles. I also have filters to alter the shipping tax for the different tax class based on the customer role. Here are the function and filter that I have updated to add the additional tier level wholesale roles. The changes I've made are not working because I don't see the tax exemptions. Both taxes are always being applied. Can someone help me figure out what I've done wrong to the code that stopped it from working? I'm not proficient in PHP, so was trying my best to make this work. /* * APPLY DIFFERENT TAX RATE BASED ON CUSTOMER USER ROLE * (Code compacted in one unique hook instead of 5 functions with the same hook) */ function all_custom_tax_classes( $tax_class, $product ) { global $current_user; // Getting the current user $curr_user = wp_get_current_user(); $curr_user_data = get_userdata($current_user->ID); // 1 customer_tax_exempt /* special tax rate: zero if role: Customer Tax Exempt */ /*if ( in_array( 'customer_tax_exempt', $curr_user_data->roles ) ) $tax_class = 'CustomerTaxExemptClass'; // 2 customer_pst_exempt // special tax rate: charge only GST if role: Customer PST Exempt if ( in_array( 'customer_pst_exempt', $curr_user_data->roles ) ) $tax_class = 'CustomerPSTExemptClass'; */ // 3, 4 & 5 WHOLESLE SUITE SPECIAL WHOLESALE TAX RATES if (isset($current_user) && class_exists('WWP_Wholesale_Roles')) { $wwp_wholesale_roles = WWP_Wholesale_Roles::getInstance(); $wwp_wholesale_role = $wwp_wholesale_roles->getUserWholesaleRole(); // special tax rate: charge both PST and GST if roles: Wholesale Customer, Wholesale Silvia Silver, Wholesale Silvia Gold, Wholesale Silvia Premium, Wholesale Silvia Union if (!empty($wwp_wholesale_role) && in_array('wholesale_customer', $wwp_wholesale_role) && in_array('wholesale_silvia_silver', $wwp_wholesale_role) && in_array('wholesale_silvia_gold', $wwp_wholesale_role) && in_array('wholesale_silvia_premimum', $wwp_wholesale_role) && in_array('wholesale_silvia_union', $wwp_wholesale_role)) { // Where 'wholesale_customer, wholesale_silvia_silver, wholesale_silvia_gold, wholesale_silvia_premium, wholesale_silvia_union' are the names of the wholesale roles to target $tax_class = 'WholesalePSTGST'; } // special tax rate: charge only GST if roles: Wholesale PST Exempt, Wholesale Silvia Silver PST Exempt, Wholesale Silvia Gold PST Exempt, Wholesale Silvia Premium PST Exempt, Wholesale Silvia Union PST Exempt if (!empty($wwp_wholesale_role) && in_array('wholesale_pst_exempt', $wwp_wholesale_role) && in_array('wholesale_silvia_silver_pst_exempt', $wwp_wholesale_role) && in_array('wholesale_silvia_gold_pst_exempt', $wwp_wholesale_role) && in_array('wholesale_silvia_premium_pst_exempt', $wwp_wholesale_role) && in_array('wholesale_silvia_union_pst_exempt', $wwp_wholesale_role)) { // Where 'wholesale_pst_exempt, wholesale_silvia_silver_pst_exempt, wholesale_silvia_gold_pst_exempt, wholesale_silvia_premium_pst_exempt, wholesale_silvia_union_pst_exempt' are the names of the wholesale roles to target $tax_class = 'WholesalePSTExempt'; } // special tax rate: zero if roles: Wholesale Tax Exempt, Wholesale Silvia Silver Tax Exempt, Wholesale Silvia Gold Tax Exempt, Wholesale Silvia Premium Tax Exempt, Wholesale Silvia Union Tax Exempt if (!empty($wwp_wholesale_role) && in_array('wholesale_tax_exempt', $wwp_wholesale_role) && in_array('wholesale_silvia_silver_tax_exempt', $wwp_wholesale_role)&& in_array('wholesale_silvia_gold_tax_exempt', $wwp_wholesale_role) && in_array('wholesale_silvia_premium_tax_exempt', $wwp_wholesale_role) && in_array('wholesale_silvia_union_tax_exempt', $wwp_wholesale_role)) { // Where 'wholesale_tax_exempt, wholesale_silvia_silver_tax_exempt, wholesale_silvia_gold_tax_exempt, wholesale_silvia_premium_tax_exempt, wholesale_silvia_union_tax_exempt' are the names of the wholesale role to target $tax_class = 'WholesaleZeroTax'; } } return $tax_class; } /* ADDITIONAL FILTERS TO ALTER THE SHIPPING TAX FOR DIFFERENT TAX CLASSES BASED ON CUSTOMER USER ROLE */ add_filter( 'woocommerce_product_get_tax_class', 'all_custom_tax_classes', 1, 2 ); add_filter( 'woocommerce_product_variation_get_tax_class', 'all_custom_tax_classes', 1, 2 ); add_filter( 'option_woocommerce_shipping_tax_class' , function( $option_value ) { global $wc_wholesale_prices; if ( $wc_wholesale_prices && is_a( $wc_wholesale_prices , 'WooCommerceWholeSalePrices' ) ) { $current_user_wholesale_roles = $wc_wholesale_prices->wwp_wholesale_roles->getUserWholesaleRole(); if ( in_array( 'wholesale_customer', $current_user_wholesale_roles ) ){ return 'wholesalepstgst'; } elseif (in_array( 'wholesale_silvia_silver', $current_user_wholesale_roles) ){ return 'wholesalepstgst'; } elseif (in_array( 'wholesale_silvia_gold', $current_user_wholesale_roles) ){ return 'wholesalepstgst'; } elseif (in_array( 'wholesale_silvia_premium', $current_user_wholesale_roles) ){ return 'wholesalepstgst'; } elseif (in_array( 'wholesale_silvia_union', $current_user_wholesale_roles) ){ return 'wholesalepstgst'; } elseif (in_array( 'wholesale_pst_exempt', $current_user_wholesale_roles) ){ return 'wholesalepstexempt'; } elseif (in_array( 'wholesale_silvia_silver_pst_exempt', $current_user_wholesale_roles) ){ return 'wholesalepstexempt'; } elseif (in_array( 'wholesale_silvia_gold_pst_exempt', $current_user_wholesale_roles) ){ return 'wholesalepstexempt'; } elseif (in_array( 'wholesale_silvia_premium_pst_exempt', $current_user_wholesale_roles) ){ return 'wholesalepstexempt'; } elseif (in_array( 'wholesale_silvia_union_pst_exempt', $current_user_wholesale_roles) ){ return 'wholesalepstexempt'; } elseif (in_array( 'wholesale_tax_exempt', $current_user_wholesale_roles) ){ return 'wholesalezerotax'; } elseif (in_array( 'wholesale_silvia_silver_tax_exempt', $current_user_wholesale_roles) ){ return 'wholesalezerotax'; } elseif (in_array( 'wholesale_silvia_gold_tax_exempt', $current_user_wholesale_roles) ){ return 'wholesalezerotax'; } elseif (in_array( 'wholesale_silvia_premium_tax_exempt', $current_user_wholesale_roles) ){ return 'wholesalezerotax'; } elseif (in_array( 'wholesale_silvia_union_tax_exempt', $current_user_wholesale_roles) ){ return 'wholesalezerotax'; } } return $option_value; } , 10 , 1 );
Thank you Lyse Edited June 18, 2019 by LyseSpecify website platforms Forgot Your Password Not working at the customer end, how to solve this error? Reset Password Email not sending to the customer mail account. Edited June 13, 2019 by aveeva |