Changeset 3234240
- Timestamp:
- 02/03/2025 08:11:12 PM (14 months ago)
- Location:
- cwsl-lotto-1049
- Files:
-
- 52 added
- 16 edited
-
tags/1.1 (added)
-
tags/1.1/README.txt (added)
-
tags/1.1/admin (added)
-
tags/1.1/admin/_notes (added)
-
tags/1.1/admin/_notes/dwsync.xml (added)
-
tags/1.1/admin/class-cwsl-lotto-1049-admin.php (added)
-
tags/1.1/admin/css (added)
-
tags/1.1/admin/css/_notes (added)
-
tags/1.1/admin/css/_notes/dwsync.xml (added)
-
tags/1.1/admin/css/cwsl-lotto-1049-admin.css (added)
-
tags/1.1/admin/index.php (added)
-
tags/1.1/admin/js (added)
-
tags/1.1/admin/js/_notes (added)
-
tags/1.1/admin/js/_notes/dwsync.xml (added)
-
tags/1.1/admin/js/cwsl-lotto-1049-admin.js (added)
-
tags/1.1/admin/partials (added)
-
tags/1.1/admin/partials/_notes (added)
-
tags/1.1/admin/partials/_notes/dwsync.xml (added)
-
tags/1.1/admin/partials/cwsl-lotto-1049-admin-display.php (added)
-
tags/1.1/cwsl-lotto-1049.php (added)
-
tags/1.1/includes (added)
-
tags/1.1/includes/_notes (added)
-
tags/1.1/includes/_notes/dwsync.xml (added)
-
tags/1.1/includes/class-cwsl-lotto-1049-activator.php (added)
-
tags/1.1/includes/class-cwsl-lotto-1049-deactivator.php (added)
-
tags/1.1/includes/class-cwsl-lotto-1049-i18n.php (added)
-
tags/1.1/includes/class-cwsl-lotto-1049-loader.php (added)
-
tags/1.1/includes/class-cwsl-lotto-1049.php (added)
-
tags/1.1/includes/index.php (added)
-
tags/1.1/index.php (added)
-
tags/1.1/languages (added)
-
tags/1.1/languages/_notes (added)
-
tags/1.1/languages/_notes/dwsync.xml (added)
-
tags/1.1/languages/cwsl-lotto-1049.pot (added)
-
tags/1.1/public (added)
-
tags/1.1/public/_notes (added)
-
tags/1.1/public/_notes/dwsync.xml (added)
-
tags/1.1/public/class-cwsl-lotto-1049-public.php (added)
-
tags/1.1/public/css (added)
-
tags/1.1/public/css/_notes (added)
-
tags/1.1/public/css/_notes/dwsync.xml (added)
-
tags/1.1/public/css/cwsl-lotto-1049-public.css (added)
-
tags/1.1/public/index.php (added)
-
tags/1.1/public/js (added)
-
tags/1.1/public/js/_notes (added)
-
tags/1.1/public/js/_notes/dwsync.xml (added)
-
tags/1.1/public/js/cwsl-lotto-1049-public.js (added)
-
tags/1.1/public/partials (added)
-
tags/1.1/public/partials/_notes (added)
-
tags/1.1/public/partials/_notes/dwsync.xml (added)
-
tags/1.1/public/partials/cwsl-lotto-1049-public-display.php (added)
-
tags/1.1/uninstall.php (added)
-
trunk/README.txt (modified) (3 diffs)
-
trunk/admin/_notes/dwsync.xml (modified) (1 diff)
-
trunk/admin/css/_notes/dwsync.xml (modified) (1 diff)
-
trunk/admin/js/_notes/dwsync.xml (modified) (1 diff)
-
trunk/admin/partials/_notes/dwsync.xml (modified) (1 diff)
-
trunk/admin/partials/cwsl-lotto-1049-admin-display.php (modified) (1 diff)
-
trunk/cwsl-lotto-1049.php (modified) (2 diffs)
-
trunk/includes/_notes/dwsync.xml (modified) (1 diff)
-
trunk/includes/class-cwsl-lotto-1049.php (modified) (1 diff)
-
trunk/languages/_notes/dwsync.xml (modified) (1 diff)
-
trunk/public/_notes/dwsync.xml (modified) (1 diff)
-
trunk/public/class-cwsl-lotto-1049-public.php (modified) (9 diffs)
-
trunk/public/css/_notes/dwsync.xml (modified) (1 diff)
-
trunk/public/js/_notes/dwsync.xml (modified) (1 diff)
-
trunk/public/partials/_notes/dwsync.xml (modified) (1 diff)
-
trunk/public/partials/cwsl-lotto-1049-public-display.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cwsl-lotto-1049/trunk/README.txt
r3218453 r3234240 3 3 Tags: lotto 649, lotto 1049, lotto1049 4 4 Tested up to: 6.7.1 5 Stable tag: 1. 0.45 Stable tag: 1.1 6 6 License: GPLv2 7 7 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 43 43 44 44 == Changelog == 45 = 1.1 = 46 * Change the messaging on the confirmation page so that if a player has already paid, and they are just changing their numbers, it will show the amount owed as $0. Update when convenient. 47 45 48 = 1.0.4 = 46 49 * Fix contributors, paths. Update when convenient. … … 56 59 57 60 == Upgrade Notice == 61 = 1.1 = 62 * Functionality enhancements. Update when convenient. 63 58 64 = 1.0.4 = 59 65 * Minor changes. Update when convenient. -
cwsl-lotto-1049/trunk/admin/_notes/dwsync.xml
r3218453 r3234240 1 1 <?xml version="1.0" encoding="utf-8" ?> 2 2 <dwsync> 3 <file name="index.php" server="35.183.237.133" local="133652174400000000" remote="133652174400000000" /> 4 <file name="index.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133652174400000000" remote="133803366000000000" /> 5 <file name="class-cwsl-lotto-1049-admin.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133805638682411460" remote="133807515000000000" /> 3 <file name="class-cwsl-lotto-1049-admin.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133807515000000000" remote="133807515000000000" /> 4 <file name="index.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133805171400000000" remote="133805171400000000" /> 6 5 </dwsync> -
cwsl-lotto-1049/trunk/admin/css/_notes/dwsync.xml
r3218453 r3234240 1 1 <?xml version="1.0" encoding="utf-8" ?> 2 2 <dwsync> 3 <file name="cwsl-lotto-1049-admin.css" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133 793599145432747" remote="133803366000000000" />3 <file name="cwsl-lotto-1049-admin.css" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133805171400000000" remote="133805171400000000" /> 4 4 </dwsync> -
cwsl-lotto-1049/trunk/admin/js/_notes/dwsync.xml
r3218453 r3234240 1 1 <?xml version="1.0" encoding="utf-8" ?> 2 2 <dwsync> 3 <file name="cwsl-lotto-1049-admin.js" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133 793827553143544" remote="133803381600000000" />3 <file name="cwsl-lotto-1049-admin.js" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133805171400000000" remote="133805171400000000" /> 4 4 </dwsync> -
cwsl-lotto-1049/trunk/admin/partials/_notes/dwsync.xml
r3218453 r3234240 1 1 <?xml version="1.0" encoding="utf-8" ?> 2 2 <dwsync> 3 <file name="cwsl-lotto-1049-admin-display.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133 793826842975136" remote="133803366000000000" />3 <file name="cwsl-lotto-1049-admin-display.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133830898200000000" remote="133830898200000000" /> 4 4 </dwsync> -
cwsl-lotto-1049/trunk/admin/partials/cwsl-lotto-1049-admin-display.php
r3218453 r3234240 1356 1356 </tr> 1357 1357 <tr> 1358 <td valign="top">Email Body<br /><span class="cwsl_small">Use placeholders such as: <ul><li>[player_name] - full player name</li><li>[display_name] - the name they have requested be displayed on any results</li><li>[draws] - includes the total number of draws they have entered followed by a list of the draws</li><li>[numbers] - list of all of their entries</li> <li>[amount] - amount they owe for their entries </li></ul></td>1358 <td valign="top">Email Body<br /><span class="cwsl_small">Use placeholders such as: <ul><li>[player_name] - full player name</li><li>[display_name] - the name they have requested be displayed on any results</li><li>[draws] - includes the total number of draws they have entered followed by a list of the draws</li><li>[numbers] - list of all of their entries</li> <li>[amount] - amount they owe for their entries. If they have already paid for the Lotto and are just changing their numbers, then it will display as paid. </li></ul></td> 1359 1359 <td>'; 1360 1360 if (isset($settings->confirm_email_body) && $settings->confirm_email_body != "") { -
cwsl-lotto-1049/trunk/cwsl-lotto-1049.php
r3218453 r3234240 16 16 * Plugin Name: CWSL Lotto 1049 17 17 * Description: Set up a Lotto 1049 18 * Requires at least: 6.3 19 * Requires PHP: 8.0 20 * Version: 1.0.4 18 * Version: 1.1 21 19 * Author: Charlene's Web Services 22 20 * Author URI: https://charlenesweb.ca … … 35 33 * First release 1.0.0 and then using SemVer - https://semver.org X.Y.Z (Major.Minor.Patch) 36 34 */ 37 define( 'CWSL_LOTTO_VERSION', '1. 0.4' );35 define( 'CWSL_LOTTO_VERSION', '1.1' ); 38 36 define('CWSL_LOTTO_SRC_DIR', dirname(__FILE__) ); 39 37 /** -
cwsl-lotto-1049/trunk/includes/_notes/dwsync.xml
r3218453 r3234240 1 1 <?xml version="1.0" encoding="utf-8" ?> 2 2 <dwsync> 3 <file name="index.php" server="35.183.237.133" local="133652174400000000" remote="133652174400000000" /> 4 <file name="index.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133652174400000000" remote="133803366000000000" /> 5 <file name="class-cwsl-lotto-1049-activator.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133794460618453678" remote="133803366000000000" /> 6 <file name="class-cwsl-lotto-1049-deactivator.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133794460125951823" remote="133803366000000000" /> 7 <file name="class-cwsl-lotto-1049-i18n.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133794457189577044" remote="133803366000000000" /> 8 <file name="class-cwsl-lotto-1049-loader.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133794456630971694" remote="133803366000000000" /> 9 <file name="class-cwsl-lotto-1049.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133805637898648339" remote="133807515000000000" /> 3 <file name="class-cwsl-lotto-1049-activator.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133805171400000000" remote="133805171400000000" /> 4 <file name="class-cwsl-lotto-1049-deactivator.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133805171400000000" remote="133805171400000000" /> 5 <file name="class-cwsl-lotto-1049-i18n.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133805171400000000" remote="133805171400000000" /> 6 <file name="class-cwsl-lotto-1049-loader.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133805171400000000" remote="133805171400000000" /> 7 <file name="class-cwsl-lotto-1049.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133830756064099140" remote="133830900000000000" /> 8 <file name="index.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133805171400000000" remote="133805171400000000" /> 10 9 </dwsync> -
cwsl-lotto-1049/trunk/includes/class-cwsl-lotto-1049.php
r3218453 r3234240 73 73 $this->version = PLUGIN_NAME_VERSION; 74 74 } else { 75 $this->version = '1. 0.4';75 $this->version = '1.1'; 76 76 } 77 77 $this->plugin_name = 'cwsl-lotto-1049'; -
cwsl-lotto-1049/trunk/languages/_notes/dwsync.xml
r3218453 r3234240 1 1 <?xml version="1.0" encoding="utf-8" ?> 2 2 <dwsync> 3 <file name="cwsl-lotto-1049.pot" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133 652174400000000" remote="133803366000000000" />3 <file name="cwsl-lotto-1049.pot" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133805171400000000" remote="133805171400000000" /> 4 4 </dwsync> -
cwsl-lotto-1049/trunk/public/_notes/dwsync.xml
r3218453 r3234240 1 1 <?xml version="1.0" encoding="utf-8" ?> 2 2 <dwsync> 3 <file name="index.php" server="35.183.237.133" local="133652175000000000" remote="133652175000000000" /> 4 <file name="index.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133652175000000000" remote="133803366000000000" /> 5 <file name="class-cwsl-lotto-1049-public.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133805638849349298" remote="133807518600000000" /> 3 <file name="class-cwsl-lotto-1049-public.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133830832668546932" remote="133830976200000000" /> 4 <file name="index.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133805171400000000" remote="133805171400000000" /> 6 5 </dwsync> -
cwsl-lotto-1049/trunk/public/class-cwsl-lotto-1049-public.php
r3218453 r3234240 129 129 $results_lookup = cwslPubLookupEmail($_POST); 130 130 $results_lookup['email_lookup'] = sanitize_text_field(wp_unslash($_POST['email_lookup'])); 131 131 132 // any matches? 132 133 if (isset($results_lookup['status']) && $results_lookup['status'] == 1 && isset($results_lookup['data'])) { … … 180 181 } 181 182 } 182 183 $results_draws = cwslPubGetCurrentLotto1049Draws(); 183 if (isset($results_add['formvalues']['player_id'])) { 184 $results_draws = cwslPubGetCurrentLotto1049DrawsWithPmt($results_add['formvalues']['player_id']); 185 } else { 186 $results_draws = cwslPubGetCurrentLotto1049Draws(); 187 } 184 188 $results_draws['new_player'] = $new_player; 185 189 // Display functions … … 250 254 } 251 255 256 // Retrieve all active current and future draws and include what if any pmts the player has made 257 function cwslPubGetCurrentLotto1049DrawsWithPmt($player_id) { 258 global $wpdb; 259 $wpdb->hide_errors(); 260 $now = current_datetime()->format('Y-m-d'); 261 262 $values = $wpdb->get_results($wpdb->prepare( 'SELECT a.*, b.player_id, b.amount_sales, b.paid, b.method_of_payment FROM `'.$wpdb->prefix.'cws_lotto1049draw` as a LEFT JOIN '.$wpdb->prefix.'cws_lotto_payment as b ON a.ID=b.lotto1049draw_id AND (b.player_id=%d OR b.player_id IS NULL) WHERE active=1 AND date_start>= %s ORDER BY date_start ASC', array($player_id, $now))); // phpcs:ignore WordPress.DB.DirectDatabaseQuery 263 if (!is_object($values) && !is_array($values)) { 264 $results = array("status"=>0, "message"=>'Failed to find lotto 1049 draws. Error is '.$wpdb->last_error.'. '); 265 } else { 266 $results = array("status"=>1, "message"=>"Success", "data"=>$values); 267 } 268 269 return $results; 270 } 271 252 272 // Retrieve all current and future draws by ID 253 273 function cwslPubGetLotto1049DrawByID($lotto1049draw_id) { … … 289 309 if (!isset($values['lotto1049draw_id']) || $values['lotto1049draw_id'] == "") { 290 310 $msg .= "Select which lotto. "; 291 }292 if (!isset($values['how_heard']) || $values['how_heard'] == "") {293 $msg .= "Select how you heard about us. ";294 311 } 295 312 for ($i=1; $i<=$numEntries; $i++) { … … 451 468 $sent = wp_mail($to, $subject, esc_html($results['message']), $headers); 452 469 } 453 // If all is still good then send an email 454 470 // have they already paid anything? 471 if (isset($results['amount_paid'])) { 472 $values['amount_paid'] = $results['amount_paid']; 473 } 455 474 $results = cwslPubSendEmail($values, $settings); 456 475 … … 701 720 function cwslPubEnterPayment($player_id, $baseAmt, $draws) { 702 721 global $wpdb; 722 $amount_paid = 0; 703 723 if (!isset($player_id) || $player_id < 0 || !isset($baseAmt) || $baseAmt <= 0 || !is_array($draws) || count($draws) <= 0) { 704 724 $results = array("status"=>0, "message"=>'Could not enter the sales amount because correct values were not passed. '); … … 707 727 foreach ($draws as $i => $draw) { 708 728 $lotto1049draw_id = $draw->ID; 729 $payments = $wpdb->get_results( $wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'cws_lotto_payment WHERE player_id=%d AND lotto1049draw_id=%d AND paid=1 AND amount_sales>0 ', array($player_id,$lotto1049draw_id))); // phpcs:ignore WordPress.DB.DirectDatabaseQuery 730 if (is_object($payments) || is_array($payments)) { 731 if (isset($payments[0]->amount_sales)) { 732 $amount_paid += $payments[0]->amount_sales; 733 } 734 } 709 735 $query = $wpdb->query($wpdb->prepare("INSERT INTO {$wpdb->prefix}cws_lotto_payment (player_id, lotto1049draw_id, amount_sales) VALUES (%d,%d, %d) ON DUPLICATE KEY UPDATE amount_sales = %d",array($player_id,$lotto1049draw_id,$baseAmt, $baseAmt))); // phpcs:ignore WordPress.DB.DirectDatabaseQuery 710 736 // error handling … … 716 742 $results = array("status"=>1, "message"=>"Amount owed updated. "); 717 743 } 744 } 745 if ($amount_paid > 0) { 746 $results['amount_paid'] = $amount_paid; 718 747 } 719 748 return $results; … … 819 848 $body = str_replace("[numbers]", $number_text, $body); 820 849 // amount owed 821 $amt_text = " Amount Owed";850 $amt_text = ""; 822 851 if (isset($values['amt_sales']) && $values['amt_sales'] > 0) { 823 $amt_text = '$'.number_format($values['amt_sales'],0); 824 $message .= "Amount owed: $".number_format($values['amt_sales'],0)."<br /><br />"; 825 } 852 if (isset($values['amount_paid']) && $values['amount_paid'] > 0) { 853 $amount_owed = $values['amt_sales'] - $values['amount_paid']; 854 } else { 855 $amount_owed = $values['amt_sales']; 856 } 857 $amt_text .= '$'.$amount_owed; 858 $message .= 'Amount owed: $'.$amt_text; 859 } 860 826 861 $body = str_replace("[amount]", $amt_text, $body); 827 862 $body = $start.$body.$end; -
cwsl-lotto-1049/trunk/public/css/_notes/dwsync.xml
r3218453 r3234240 1 1 <?xml version="1.0" encoding="utf-8" ?> 2 2 <dwsync> 3 <file name="cwsl-lotto-1049-public.css" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133 793818261873098" remote="133803372600000000" />3 <file name="cwsl-lotto-1049-public.css" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133805171400000000" remote="133805171400000000" /> 4 4 </dwsync> -
cwsl-lotto-1049/trunk/public/js/_notes/dwsync.xml
r3218453 r3234240 1 1 <?xml version="1.0" encoding="utf-8" ?> 2 2 <dwsync> 3 <file name="cwsl-lotto-1049-public.js" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133 793827637380897" remote="133803374400000000" />3 <file name="cwsl-lotto-1049-public.js" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133805171400000000" remote="133805171400000000" /> 4 4 </dwsync> -
cwsl-lotto-1049/trunk/public/partials/_notes/dwsync.xml
r3218453 r3234240 1 1 <?xml version="1.0" encoding="utf-8" ?> 2 2 <dwsync> 3 <file name="cwsl-lotto-1049-public-display.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="1338 03232358647109" remote="133803376200000000" />3 <file name="cwsl-lotto-1049-public-display.php" server="ftp.charlenesweb.ca/charlenesweb.ca/" local="133830792581935452" remote="133830937800000000" /> 4 4 </dwsync> -
cwsl-lotto-1049/trunk/public/partials/cwsl-lotto-1049-public-display.php
r3218453 r3234240 143 143 <p> 144 144 <label>How Did You Hear About Us? 145 <select name="how_heard" required>145 <select name="how_heard"> 146 146 <option value="">Choose ...</option>'; 147 147 foreach ($how_heards as $val => $long) { … … 212 212 $ct .= ' selected '; 213 213 } 214 $ct .= '>'.esc_html($draw->title).'</option>'; 214 $ct .= '>'.esc_html($draw->title); 215 if (isset($draw->paid) && $draw->paid == 1 && isset($draw->amount_sales) && $draw->amount_sales>0) { 216 $ct .= ' (You have paid $'.$draw->amount_sales.' for this lotto)'; 217 } 218 $ct .= '</option>'; 215 219 } 216 220 $fee20 = 20 * count($draws);
Note: See TracChangeset
for help on using the changeset viewer.