Changeset 2263980
- Timestamp:
- 03/19/2020 03:43:40 PM (6 years ago)
- Location:
- cf7-db-tool/trunk
- Files:
-
- 6 edited
-
assets/js/cf7-db-bulkmail.js (modified) (1 diff)
-
cf7-db-tool.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
src/BulkMail.php (modified) (5 diffs)
-
src/ListEntries.php (modified) (1 diff)
-
src/Plugin.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cf7-db-tool/trunk/assets/js/cf7-db-bulkmail.js
r2261940 r2263980 6 6 cf7form : 0, 7 7 } 8 // $('#select-department_list').on('change', function() {9 // OBJ.department = $(this).find(":selected").val() ;10 // callFromDB();11 // });12 8 13 9 $('#select-session_list').on('change', function() { 14 10 OBJ.cf7form = $(this).find(":selected").val() ; 11 alert(OBJ.cf7form) 15 12 callFromDB(); 16 13 }); 17 14 function callFromDB() { 18 15 if(OBJ.cf7form != 0 ){ 16 19 17 $.post(ajax_object.ajax_url,{ 20 18 'action':'bulkMailAjaxDataAction', 21 ' department': OBJ.cf7form,19 'cf7form': OBJ.cf7form, 22 20 },function(data){ 23 21 if(data == 0){ 24 22 alert('No Data Found'); 25 23 }else{ 26 //console.log(data);27 24 $('#dbtool-user-list').html(data); 28 25 } -
cf7-db-tool/trunk/cf7-db-tool.php
r2261940 r2263980 8 8 * Text Domain: cf7-db-tool 9 9 * Tags: contact, cf7, contact form 7, db, export, save, wpcf7, contact form 7 db, contact form 7 database, contact form 7 data export, contact form 7 database addon 10 * Version: 3. 0.110 * Version: 3.1.1 11 11 */ 12 12 -
cf7-db-tool/trunk/readme.txt
r2261940 r2263980 4 4 Requires at least: 4.8 5 5 Tested up to: 5.3 6 Stable tag: 3. 0.16 Stable tag: 3.1.1 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 31 31 Upcoming features: 32 32 33 * Choose bulk mail contacts from cf7 forms34 33 * Email integration with bulk mail 35 34 … … 98 97 = 3.0.1 = 99 98 *Release Date - March 16, 2020* 100 *Bulk email validation complete, design changed & Reset button issue fixed99 *Bulk email validation complete, design updated & Reset button issue fixed 101 100 101 = 3.1.1 = 102 *Release Date - March 19, 2020* 103 *Choose users mail form specefic form 104 -
cf7-db-tool/trunk/src/BulkMail.php
r2261940 r2263980 11 11 12 12 $this->cf7DBBulkMail(); 13 add_action('wp_ajax_bulkMailAjaxDataAction',[$this,'bulkMailAjaxDataAction']); 13 add_action('wp_ajax_nopriv_bulkMailAjaxDataAction', array( $this, 'bulkMailAjaxDataAction' )); 14 add_action('wp_ajax_bulkMailAjaxDataAction', array( $this, 'bulkMailAjaxDataAction' )); 14 15 15 16 } … … 174 175 </div> 175 176 176 <!-- <div class="select-department">--> 177 <!-- <select id="select-department_list">--> 178 <!-- <option value="">-- --><?php //_e( 'Select Department', 'dumhall' ); ?><!-- --</option>--> 179 <!-- --><?php 180 // 181 // $users = get_users( array( 'fields' => array( 'ID' ) ) ); 182 // foreach($users as $user_id){ 183 // $data = get_user_meta ( $user_id->ID); 184 // if(!empty($data['department'][0])){ 185 // echo '<option value="' . esc_html( $data['department'][0]) . '">' . esc_html( $data['department'][0] ) . '</option>'; 186 // } 187 // } 188 // ?> 189 <!-- </select>--> 190 <!-- </div>--> 191 <!-- <div class="select-session">--> 192 <!-- <select id="select-session_list">--> 193 <!-- <option value="">-- --><?php //_e( 'Select Form', 'dumhall' ); ?><!-- --</option>--> 194 <!-- <option value="1">hell</option>--> 195 <!-- <option value="2">hell2</option>--> 196 <!-- <option value="3">hell3</option>--> 197 <!-- <option value="4">hell4</option>--> 198 <!-- --><?php 199 // 200 // 201 // ?><!-- $users = get_users( array( 'fields' => array( 'ID' ) ) );--> 202 <!-- foreach($users as $user_id){--> 203 <!-- $data = get_user_meta ( $user_id->ID);--> 204 <!-- if(isset($data['session'][0])){--> 205 <!-- echo '<option value="' . esc_html( $data['session'][0]) . '">' . esc_html( $data['session'][0] ) . '</option>';--> 206 <!-- }--> 207 <!-- }--> 208 <!-- </select>--> 209 <!-- </div>--> 177 178 <div class="select-session"> 179 <select id="select-session_list"> 180 <option value="">-- <?php _e( 'Select Form', 'dumhall' ); ?> --</option> 181 <?php 182 183 $allForms = $this->get_prepare_forms_list(); 184 foreach ($allForms as $form){ 185 echo ' <option value="'.$form->form_id.'">'.$form->title.'</option>'; 186 } 187 188 189 ?> 190 </select> 191 192 193 </div> 210 194 211 195 <div class="reset-entery-data"> … … 278 262 279 263 // Ajax request for load targeted form users 280 public function bulkMailAjaxDataAction (){281 echo "<script>alert('hello');</script>"; 282 283 // //this is required to terminate immediately and return a proper response284 // $department = '';285 // $session= '';286 // if(isset($_POST['department'])){287 // $department = sanitize_text_field($_POST['department']);288 //}264 public function bulkMailAjaxDataActionss(){ 265 266 267 // this is required to terminate immediately and return a proper response 268 echo "test"; 269 $cf7form = ''; 270 if(isset($_POST['cf7form'])){ 271 $cf7form = sanitize_text_field($_POST['cf7form']); 272 } 289 273 // if(isset($_POST['session'])){ 290 274 // $session = sanitize_text_field($_POST['session']); … … 306 290 // ); 307 291 // $users = get_users( $args ); 308 // 292 309 293 // foreach ( $users as $user ) { 310 294 // //var_dump($user->user_email); … … 318 302 // 319 303 // }; 304 echo '<option value="maruf@gmail.com">'.$cf7form.'</option>'; 320 305 wp_die(); 321 306 } -
cf7-db-tool/trunk/src/ListEntries.php
r2245565 r2263980 73 73 } 74 74 75 75 // get form list from database 76 public function get_prepare_forms_list() 77 { 78 global $wpdb; 79 $result = $wpdb->get_results("SELECT * FROM " .$wpdb->prefix. "cf7_dbt_forms"); 80 return $result; 81 } 82 83 // get mail list from database 76 84 public function get_prepare_mail_items() 77 85 { 78 86 global $wpdb; 79 87 $result = $wpdb->get_results("SELECT fields FROM " .$wpdb->prefix. "cf7_dbt_entries"); 80 //var_dump($result);81 82 88 return $result; 83 84 85 89 } 90 91 // get mail list from specific form 92 public function get_prepare_mail_items_from_target_form() 93 { 94 global $wpdb; 95 $results = $wpdb->get_results("SELECT fields FROM " .$wpdb->prefix. "cf7_dbt_entries where form_id=6" ); 96 return $results; 97 } 98 86 99 87 100 -
cf7-db-tool/trunk/src/Plugin.php
r2245565 r2263980 60 60 $this->report = new Report($this->config); 61 61 $this->formEntries = new FormEntries($this->config); 62 63 } 62 add_action('wp_ajax_bulkMailAjaxDataAction', [$this,'bulkMailAjaxDataAction']); 63 64 } 65 64 66 65 67 /** … … 215 217 return ob_get_flush(); 216 218 } 219 220 221 /** 222 * Load users mail from target form 223 */ 224 public function bulkMailAjaxDataAction(){ 225 226 $cf7form = ''; 227 if(isset($_POST['cf7form'])){ 228 $cf7form = sanitize_text_field($_POST['cf7form']); 229 } 230 global $wpdb; 231 $results = $wpdb->get_results("SELECT fields FROM " .$wpdb->prefix. "cf7_dbt_entries where form_id=" .$cf7form ); 232 $usersEmail=[]; 233 foreach ($results as $mail){ 234 $fields = unserialize($mail->fields); 235 236 if(!in_array($fields["your-email"],$usersEmail)){ 237 array_push($usersEmail,$fields["your-email"]); 238 } 239 240 } 241 foreach ($usersEmail as $email){ 242 echo '<option value='.$email.'>'.$email.'</option>'; 243 } 244 245 wp_die(); 246 } 217 247 } 218 248
Note: See TracChangeset
for help on using the changeset viewer.