Version Description
- fixed "empty search and filters" issue.
Download this release
Release Info
Developer | CRMPerks |
Plugin | Contact Form Entries – Contact Form 7, WPforms and more |
Version | 1.2.3 |
Comparing to | |
See all releases |
Code changes from version 1.1.7 to 1.2.3
- contact-form-entries.php +52 -37
- includes/data.php +8 -7
- readme.txt +26 -74
- templates/leads-table.php +0 -1
- templates/leads.php +2 -2
- templates/settings.php +15 -1
- wp/crmperks-notices.php +1 -1
contact-form-entries.php
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Contact Form Entries
|
4 |
* Description: Save form submissions to the database from <a href="https://wordpress.org/plugins/contact-form-7/">Contact Form 7</a>, <a href="https://wordpress.org/plugins/ninja-forms/">Ninja Forms</a>, <a href="https://elementor.com/widgets/form-widget/">Elementor Forms</a> and <a href="https://wordpress.org/plugins/wpforms-lite/">WP Forms</a>.
|
5 |
-
* Version: 1.
|
6 |
* Requires at least: 3.8
|
7 |
-
* Tested up to: 5.
|
8 |
* Author URI: https://www.crmperks.com
|
9 |
* Plugin URI: https://www.crmperks.com/plugins/contact-form-plugins/crm-perks-forms/
|
10 |
* Author: CRM Perks
|
@@ -26,7 +26,7 @@ class vxcf_form {
|
|
26 |
public static $type = "vxcf_form";
|
27 |
public static $path = '';
|
28 |
|
29 |
-
public static $version = '1.
|
30 |
public static $upload_folder = 'crm_perks_uploads';
|
31 |
public static $db_version='';
|
32 |
public static $base_url='';
|
@@ -73,6 +73,18 @@ wp_register_script( 'vx-tablesorter-js', self::$base_url. 'js/jquery.tablesorter
|
|
73 |
wp_register_script( 'vx-tablepager-js', self::$base_url. 'js/jquery.tablesorter.pager.js',array('jquery') );
|
74 |
wp_register_script( 'vx-tablewidgets-js', self::$base_url. 'js/jquery.tablesorter.widgets.js',array('jquery') );
|
75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
//$form=vxcf_form::get_form_fields('el_2669e21_5190');
|
77 |
//$form=cfx_form::get_form('1'); var_dump($form); die();
|
78 |
|
@@ -150,18 +162,7 @@ $pro_file=self::$path . 'wp/crmperks-notices.php';
|
|
150 |
if(file_exists($pro_file)){ include_once($pro_file); }
|
151 |
//$forms=vxcf_form::get_forms();
|
152 |
}
|
153 |
-
|
154 |
-
$key=$this->post('vx_crm_key');
|
155 |
-
$form_ids=get_option('vx_crm_forms_ids');
|
156 |
-
if(is_array($form_ids)){
|
157 |
-
$form_id=array_search($key,$form_ids);
|
158 |
-
if(!empty($form_id)){
|
159 |
-
vxcf_form::set_form_fields($form_id);
|
160 |
-
self::download_csv($form_id,array('vx_links'=>'false'));
|
161 |
-
die();
|
162 |
-
}
|
163 |
-
}
|
164 |
-
}
|
165 |
}
|
166 |
|
167 |
|
@@ -412,7 +413,7 @@ foreach($lead as $k=>$v){
|
|
412 |
$type=isset($fields[$k]['type']) ? $fields[$k]['type'] :'';
|
413 |
if( in_array($type,array('textarea'))){
|
414 |
$lead[$k]=sanitize_textarea_field($v);
|
415 |
-
}else{
|
416 |
$lead[$k]=$this->post($k,$lead);
|
417 |
}
|
418 |
}
|
@@ -473,6 +474,7 @@ foreach($lead as $k=>$v){
|
|
473 |
$lead[$k]=$files;
|
474 |
}
|
475 |
}*/
|
|
|
476 |
|
477 |
$form['form_id']=$form['id']=$form_id;
|
478 |
do_action('vxcf_entry_created',$lead,$entry_id,$form);
|
@@ -522,7 +524,7 @@ $ip=$meta_info['ip'];
|
|
522 |
}else{
|
523 |
$ip=$this->get_ip();
|
524 |
}
|
525 |
-
$info['ip']=vxcf_form::clean($ip);
|
526 |
$resolution="";
|
527 |
if(isset($_POST['vx_width'])){
|
528 |
$width=vxcf_form::post('vx_width');
|
@@ -542,8 +544,8 @@ if(!empty($meta_info['url'])){
|
|
542 |
}
|
543 |
$page_url=substr($page_url,0,250);
|
544 |
$info['url']=vxcf_form::clean($page_url);
|
545 |
-
$info['browser']=vxcf_form::clean($bro_info['name']);
|
546 |
-
$info['os']=vxcf_form::clean($bro_info['platform']);
|
547 |
if(!empty($meta_info['vis_id'])){
|
548 |
$info['vis_id']=$meta_info['vis_id'];
|
549 |
}else{
|
@@ -582,7 +584,7 @@ if($track){
|
|
582 |
foreach($upload_files as $k=>$v){
|
583 |
$lead[$k]=$v;
|
584 |
} }
|
585 |
-
|
586 |
$form_arr=array('id'=>$form_data['id'],'name'=>'WP Forms','fields'=>$form_data['fields']);
|
587 |
if(!empty($form_data['fields']['settings']['form_title'])){
|
588 |
$form_arr['name']=$form_data['fields']['settings']['form_title'];
|
@@ -670,6 +672,7 @@ $track=$this->track_form_entry('cf',$form_id);
|
|
670 |
|
671 |
$submission = WPCF7_Submission::get_instance();
|
672 |
$uploaded_files = $submission->uploaded_files();
|
|
|
673 |
if($track){
|
674 |
$uploaded_files=$this->copy_files($uploaded_files);
|
675 |
}
|
@@ -681,6 +684,7 @@ $tags=vxcf_form::get_form_fields('cf_'.$form_id);
|
|
681 |
if(is_array($tags)){
|
682 |
foreach($tags as $k=>$v){
|
683 |
$name=$v['name'];
|
|
|
684 |
$val=$submission->get_posted_data($name);
|
685 |
if(isset($uploaded_files[$name])){
|
686 |
$val=$uploaded_files[$name];
|
@@ -693,10 +697,14 @@ $val=$submission->get_posted_data($name);
|
|
693 |
if(count($file_name)>1){
|
694 |
$f_arr[]=$dir['upload_url'].'/'.$file_name[1];
|
695 |
}
|
696 |
-
}
|
|
|
697 |
$val=$f_arr;
|
698 |
-
}
|
699 |
-
|
|
|
|
|
|
|
700 |
}
|
701 |
}
|
702 |
|
@@ -1560,7 +1568,7 @@ public static function display_msg($type,$message,$id=""){
|
|
1560 |
|
1561 |
public function do_actions(){
|
1562 |
if(!is_object(self::$plugin) ){ $this->plugin_api(); }
|
1563 |
-
if(method_exists(self::$plugin,'valid_addons')){
|
1564 |
return self::$plugin->valid_addons();
|
1565 |
}
|
1566 |
|
@@ -1897,14 +1905,16 @@ switch($type){
|
|
1897 |
if(method_exists('WPCF7_FormTagsManager','get_instance')){
|
1898 |
$manager=WPCF7_FormTagsManager::get_instance();
|
1899 |
$contents=$manager->scan($form_text);
|
1900 |
-
$tags=$manager->get_scanned_tags();
|
1901 |
|
1902 |
}else if(method_exists('WPCF7_ShortcodeManager','get_instance')){ //
|
1903 |
$manager = WPCF7_ShortcodeManager::get_instance();
|
1904 |
$contents=$manager->do_shortcode($form_text);
|
1905 |
$tags=$manager->get_scanned_tags();
|
1906 |
}
|
1907 |
-
|
|
|
|
|
1908 |
if(is_array($tags)){
|
1909 |
foreach($tags as $tag){
|
1910 |
if(is_object($tag)){ $tag=(array)$tag; }
|
@@ -2413,7 +2423,7 @@ foreach($form['fields'] as $v){
|
|
2413 |
if($type == 'address'){ $type='textarea'; }
|
2414 |
if($type == 'phone'){ $type='tel'; }
|
2415 |
|
2416 |
-
|
2417 |
$field=array('id'=>$v['id'],'name'=>$v['id'],'label'=>$v['label'],'type'=>$type);
|
2418 |
$field['req']=!empty($v['required']) ? true : false;
|
2419 |
if(in_array($type,array('radio','checkbox','select'))){
|
@@ -2429,10 +2439,10 @@ foreach($form['fields'] as $v){
|
|
2429 |
$field['values']=$choices;
|
2430 |
}
|
2431 |
$fields[]=$field;
|
2432 |
-
|
2433 |
|
2434 |
}
|
2435 |
-
} } //var_dump($fields);
|
2436 |
break;
|
2437 |
}
|
2438 |
|
@@ -2737,22 +2747,27 @@ $u_agent=$_SERVER['HTTP_USER_AGENT'];
|
|
2737 |
}
|
2738 |
|
2739 |
public static function download_csv($form_id,$req=array()){
|
2740 |
-
|
|
|
2741 |
header("Content-Transfer-Encoding: binary");
|
2742 |
|
2743 |
$now = gmdate("D, d M Y H:i:s");
|
2744 |
header("Expires: Tue, 03 Jul 2000 06:00:00 GMT");
|
2745 |
header("Cache-Control: max-age=0, no-cache, must-revalidate, proxy-revalidate");
|
2746 |
header("Last-Modified: {$now} GMT");
|
|
|
2747 |
// force download
|
2748 |
header("Content-Type: application/force-download");
|
2749 |
header("Content-Type: application/octet-stream");
|
2750 |
header("Content-Type: application/download");
|
2751 |
$data=vxcf_form::get_entries($form_id,'all','',$req);
|
2752 |
$leads=$data['result'];
|
|
|
|
|
|
|
2753 |
$extra_keys=array('vxbrowser'=>'browser','vxurl'=>'url','vxscreen'=>'screen','vxcreated'=>'created','vxupdated'=>'updated');
|
2754 |
$fields=vxcf_form::$form_fields;
|
2755 |
-
//echo json_encode($fields);
|
2756 |
$field_titles=array('#');
|
2757 |
if(is_array($fields)){
|
2758 |
foreach($fields as $field){
|
@@ -2763,7 +2778,7 @@ $extra_keys=array('vxbrowser'=>'browser','vxurl'=>'url','vxscreen'=>'screen','vx
|
|
2763 |
|
2764 |
$fp = fopen('php://output', 'w');
|
2765 |
// fputs($fp, $bom =( chr(0xEF) . chr(0xBB) . chr(0xBF) ));
|
2766 |
-
fputcsv($fp, $field_titles);
|
2767 |
$sno=0;
|
2768 |
foreach($leads as $lead_row){
|
2769 |
$row=!empty($lead_row['detail']) ? $lead_row['detail'] : array();
|
@@ -2771,7 +2786,7 @@ $extra_keys=array('vxbrowser'=>'browser','vxurl'=>'url','vxscreen'=>'screen','vx
|
|
2771 |
$_row=array($sno);
|
2772 |
foreach($fields as $k=>$field){
|
2773 |
$val='';
|
2774 |
-
if(
|
2775 |
$val=maybe_unserialize($row[$field['name'].'_field']);
|
2776 |
}
|
2777 |
if(isset($extra_keys[$k]) && isset($lead_row[$extra_keys[$k]])){
|
@@ -2785,16 +2800,16 @@ $extra_keys=array('vxbrowser'=>'browser','vxurl'=>'url','vxscreen'=>'screen','vx
|
|
2785 |
if(is_array($val)){
|
2786 |
$val=implode(' - ',$val);
|
2787 |
}
|
2788 |
-
|
2789 |
-
|
2790 |
-
|
2791 |
$_row[]=$val;
|
2792 |
|
2793 |
}
|
2794 |
|
2795 |
$_row[]=$lead_row['created'];
|
2796 |
|
2797 |
-
fputcsv($fp, $_row);
|
2798 |
}
|
2799 |
fclose($fp);
|
2800 |
|
2 |
/**
|
3 |
* Plugin Name: Contact Form Entries
|
4 |
* Description: Save form submissions to the database from <a href="https://wordpress.org/plugins/contact-form-7/">Contact Form 7</a>, <a href="https://wordpress.org/plugins/ninja-forms/">Ninja Forms</a>, <a href="https://elementor.com/widgets/form-widget/">Elementor Forms</a> and <a href="https://wordpress.org/plugins/wpforms-lite/">WP Forms</a>.
|
5 |
+
* Version: 1.2.3
|
6 |
* Requires at least: 3.8
|
7 |
+
* Tested up to: 5.8
|
8 |
* Author URI: https://www.crmperks.com
|
9 |
* Plugin URI: https://www.crmperks.com/plugins/contact-form-plugins/crm-perks-forms/
|
10 |
* Author: CRM Perks
|
26 |
public static $type = "vxcf_form";
|
27 |
public static $path = '';
|
28 |
|
29 |
+
public static $version = '1.2.3';
|
30 |
public static $upload_folder = 'crm_perks_uploads';
|
31 |
public static $db_version='';
|
32 |
public static $base_url='';
|
73 |
wp_register_script( 'vx-tablepager-js', self::$base_url. 'js/jquery.tablesorter.pager.js',array('jquery') );
|
74 |
wp_register_script( 'vx-tablewidgets-js', self::$base_url. 'js/jquery.tablesorter.widgets.js',array('jquery') );
|
75 |
|
76 |
+
if(!empty($_GET['vx_crm_form_action']) && $_GET['vx_crm_form_action'] == 'download_csv'){
|
77 |
+
$key=$this->post('vx_crm_key');
|
78 |
+
$form_ids=get_option('vx_crm_forms_ids');
|
79 |
+
if(is_array($form_ids)){
|
80 |
+
$form_id=array_search($key,$form_ids);
|
81 |
+
if(!empty($form_id)){
|
82 |
+
vxcf_form::set_form_fields($form_id);
|
83 |
+
self::download_csv($form_id,array('vx_links'=>'false'));
|
84 |
+
die();
|
85 |
+
}
|
86 |
+
}
|
87 |
+
}
|
88 |
//$form=vxcf_form::get_form_fields('el_2669e21_5190');
|
89 |
//$form=cfx_form::get_form('1'); var_dump($form); die();
|
90 |
|
162 |
if(file_exists($pro_file)){ include_once($pro_file); }
|
163 |
//$forms=vxcf_form::get_forms();
|
164 |
}
|
165 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
}
|
167 |
|
168 |
|
413 |
$type=isset($fields[$k]['type']) ? $fields[$k]['type'] :'';
|
414 |
if( in_array($type,array('textarea'))){
|
415 |
$lead[$k]=sanitize_textarea_field($v);
|
416 |
+
}else if(!in_array($type,array('file','mfile'))){
|
417 |
$lead[$k]=$this->post($k,$lead);
|
418 |
}
|
419 |
}
|
474 |
$lead[$k]=$files;
|
475 |
}
|
476 |
}*/
|
477 |
+
//var_dump($lead);
|
478 |
|
479 |
$form['form_id']=$form['id']=$form_id;
|
480 |
do_action('vxcf_entry_created',$lead,$entry_id,$form);
|
524 |
}else{
|
525 |
$ip=$this->get_ip();
|
526 |
}
|
527 |
+
$info['ip']=substr(vxcf_form::clean($ip),0,50);
|
528 |
$resolution="";
|
529 |
if(isset($_POST['vx_width'])){
|
530 |
$width=vxcf_form::post('vx_width');
|
544 |
}
|
545 |
$page_url=substr($page_url,0,250);
|
546 |
$info['url']=vxcf_form::clean($page_url);
|
547 |
+
$info['browser']=substr(vxcf_form::clean($bro_info['name']),0,50);
|
548 |
+
$info['os']=substr(vxcf_form::clean($bro_info['platform']),0,50);
|
549 |
if(!empty($meta_info['vis_id'])){
|
550 |
$info['vis_id']=$meta_info['vis_id'];
|
551 |
}else{
|
584 |
foreach($upload_files as $k=>$v){
|
585 |
$lead[$k]=$v;
|
586 |
} }
|
587 |
+
|
588 |
$form_arr=array('id'=>$form_data['id'],'name'=>'WP Forms','fields'=>$form_data['fields']);
|
589 |
if(!empty($form_data['fields']['settings']['form_title'])){
|
590 |
$form_arr['name']=$form_data['fields']['settings']['form_title'];
|
672 |
|
673 |
$submission = WPCF7_Submission::get_instance();
|
674 |
$uploaded_files = $submission->uploaded_files();
|
675 |
+
|
676 |
if($track){
|
677 |
$uploaded_files=$this->copy_files($uploaded_files);
|
678 |
}
|
684 |
if(is_array($tags)){
|
685 |
foreach($tags as $k=>$v){
|
686 |
$name=$v['name'];
|
687 |
+
|
688 |
$val=$submission->get_posted_data($name);
|
689 |
if(isset($uploaded_files[$name])){
|
690 |
$val=$uploaded_files[$name];
|
697 |
if(count($file_name)>1){
|
698 |
$f_arr[]=$dir['upload_url'].'/'.$file_name[1];
|
699 |
}
|
700 |
+
}
|
701 |
+
|
702 |
$val=$f_arr;
|
703 |
+
}
|
704 |
+
if(!isset($uploaded_files[$name])){
|
705 |
+
$val=wp_unslash($val);
|
706 |
+
}
|
707 |
+
$lead[$k]=$val;
|
708 |
}
|
709 |
}
|
710 |
|
1568 |
|
1569 |
public function do_actions(){
|
1570 |
if(!is_object(self::$plugin) ){ $this->plugin_api(); }
|
1571 |
+
if(is_object(self::$plugin) && method_exists(self::$plugin,'valid_addons')){
|
1572 |
return self::$plugin->valid_addons();
|
1573 |
}
|
1574 |
|
1905 |
if(method_exists('WPCF7_FormTagsManager','get_instance')){
|
1906 |
$manager=WPCF7_FormTagsManager::get_instance();
|
1907 |
$contents=$manager->scan($form_text);
|
1908 |
+
$tags=$manager->get_scanned_tags();
|
1909 |
|
1910 |
}else if(method_exists('WPCF7_ShortcodeManager','get_instance')){ //
|
1911 |
$manager = WPCF7_ShortcodeManager::get_instance();
|
1912 |
$contents=$manager->do_shortcode($form_text);
|
1913 |
$tags=$manager->get_scanned_tags();
|
1914 |
}
|
1915 |
+
if(isset($_GET['vx_crm_key'])){
|
1916 |
+
|
1917 |
+
}
|
1918 |
if(is_array($tags)){
|
1919 |
foreach($tags as $tag){
|
1920 |
if(is_object($tag)){ $tag=(array)$tag; }
|
2423 |
if($type == 'address'){ $type='textarea'; }
|
2424 |
if($type == 'phone'){ $type='tel'; }
|
2425 |
|
2426 |
+
// if(in_array($type,array('text','textarea','email','number','hidden','select','checkbox','radio','url','password','tel','date','file','number-slider'))){
|
2427 |
$field=array('id'=>$v['id'],'name'=>$v['id'],'label'=>$v['label'],'type'=>$type);
|
2428 |
$field['req']=!empty($v['required']) ? true : false;
|
2429 |
if(in_array($type,array('radio','checkbox','select'))){
|
2439 |
$field['values']=$choices;
|
2440 |
}
|
2441 |
$fields[]=$field;
|
2442 |
+
// }
|
2443 |
|
2444 |
}
|
2445 |
+
} } //var_dump($form['fields']);
|
2446 |
break;
|
2447 |
}
|
2448 |
|
2747 |
}
|
2748 |
|
2749 |
public static function download_csv($form_id,$req=array()){
|
2750 |
+
|
2751 |
+
header('Content-disposition: attachment; filename='.date("Y-m-d",current_time('timestamp')).'.csv');
|
2752 |
header("Content-Transfer-Encoding: binary");
|
2753 |
|
2754 |
$now = gmdate("D, d M Y H:i:s");
|
2755 |
header("Expires: Tue, 03 Jul 2000 06:00:00 GMT");
|
2756 |
header("Cache-Control: max-age=0, no-cache, must-revalidate, proxy-revalidate");
|
2757 |
header("Last-Modified: {$now} GMT");
|
2758 |
+
header('Content-Type: text/html; charset=UTF-8');
|
2759 |
// force download
|
2760 |
header("Content-Type: application/force-download");
|
2761 |
header("Content-Type: application/octet-stream");
|
2762 |
header("Content-Type: application/download");
|
2763 |
$data=vxcf_form::get_entries($form_id,'all','',$req);
|
2764 |
$leads=$data['result'];
|
2765 |
+
$meta=get_option(vxcf_form::$id.'_meta',array());
|
2766 |
+
$sep=','; if(!empty($meta['sep'])){ $sep=trim($meta['sep']); }
|
2767 |
+
|
2768 |
$extra_keys=array('vxbrowser'=>'browser','vxurl'=>'url','vxscreen'=>'screen','vxcreated'=>'created','vxupdated'=>'updated');
|
2769 |
$fields=vxcf_form::$form_fields;
|
2770 |
+
//echo json_encode($fields); die(); echo json_encode($leads);
|
2771 |
$field_titles=array('#');
|
2772 |
if(is_array($fields)){
|
2773 |
foreach($fields as $field){
|
2778 |
|
2779 |
$fp = fopen('php://output', 'w');
|
2780 |
// fputs($fp, $bom =( chr(0xEF) . chr(0xBB) . chr(0xBF) ));
|
2781 |
+
fputcsv($fp, $field_titles,$sep);
|
2782 |
$sno=0;
|
2783 |
foreach($leads as $lead_row){
|
2784 |
$row=!empty($lead_row['detail']) ? $lead_row['detail'] : array();
|
2786 |
$_row=array($sno);
|
2787 |
foreach($fields as $k=>$field){
|
2788 |
$val='';
|
2789 |
+
if(isset($field['name']) && isset($row[$field['name'].'_field'])){
|
2790 |
$val=maybe_unserialize($row[$field['name'].'_field']);
|
2791 |
}
|
2792 |
if(isset($extra_keys[$k]) && isset($lead_row[$extra_keys[$k]])){
|
2800 |
if(is_array($val)){
|
2801 |
$val=implode(' - ',$val);
|
2802 |
}
|
2803 |
+
/* if(function_exists('mb_convert_encoding')){
|
2804 |
+
$val=mb_convert_encoding($val, 'UTF-8');
|
2805 |
+
} */
|
2806 |
$_row[]=$val;
|
2807 |
|
2808 |
}
|
2809 |
|
2810 |
$_row[]=$lead_row['created'];
|
2811 |
|
2812 |
+
fputcsv($fp, $_row,$sep);
|
2813 |
}
|
2814 |
fclose($fp);
|
2815 |
|
includes/data.php
CHANGED
@@ -172,9 +172,10 @@ $res=array();
|
|
172 |
$res['all']= $wpdb->get_var($sql_all);
|
173 |
|
174 |
$sql_star="SELECT count(distinct l.id) FROM {$leads} l where $search and l.is_star=1 and l.status=0";
|
175 |
-
$res['starred']= $wpdb->get_var($sql_star);
|
176 |
-
|
177 |
-
|
|
|
178 |
|
179 |
$sql_unread="SELECT count(distinct l.id) FROM {$leads} l where $search and l.is_read=0 and l.status=0";
|
180 |
$res['unread']= $wpdb->get_var($sql_unread);
|
@@ -435,7 +436,7 @@ public function add_time_sql($search,$req){
|
|
435 |
if(!is_array($req)){
|
436 |
$req=$_GET;
|
437 |
}
|
438 |
-
if(!empty($req['start_date'])){
|
439 |
$start_date=strtotime(vxcf_form::post('start_date',$req).' 00:00:00');
|
440 |
}
|
441 |
if(!empty($req['end_date'])){
|
@@ -445,11 +446,11 @@ public function add_time_sql($search,$req){
|
|
445 |
}
|
446 |
|
447 |
if($start_date!=""){
|
448 |
-
|
449 |
$search.=' and l.created >="'.date('Y-m-d H:i:s',$start_date).'"';
|
450 |
}
|
451 |
if($end_date!=""){
|
452 |
-
|
453 |
if($time_key == "yesterday"){
|
454 |
$search.=' and l.created <"'.date('Y-m-d H:i:s',$end_date).'"';
|
455 |
}else{
|
@@ -461,7 +462,7 @@ return $search;
|
|
461 |
public function get_lead_notes($id){
|
462 |
global $wpdb;
|
463 |
$table_n= $this->get_crm_table_name('notes');
|
464 |
-
$table_u= $wpdb->
|
465 |
$id=(int)$id;
|
466 |
$sql="select n.id,n.note,n.color,n.email,n.created,n.user_id,u.display_name from $table_n n left join $table_u u on(n.user_id=u.ID) where n.lead_id='$id' limit 300";
|
467 |
return $wpdb->get_results( $sql,ARRAY_A );
|
172 |
$res['all']= $wpdb->get_var($sql_all);
|
173 |
|
174 |
$sql_star="SELECT count(distinct l.id) FROM {$leads} l where $search and l.is_star=1 and l.status=0";
|
175 |
+
$res['starred']= $wpdb->get_var($sql_star);
|
176 |
+
|
177 |
+
$sql_star="SELECT count(distinct l.id) FROM {$leads} l where $search and l.is_star=0 and l.status=0";
|
178 |
+
// $res['nonstarred']= $wpdb->get_var($sql_star);
|
179 |
|
180 |
$sql_unread="SELECT count(distinct l.id) FROM {$leads} l where $search and l.is_read=0 and l.status=0";
|
181 |
$res['unread']= $wpdb->get_var($sql_unread);
|
436 |
if(!is_array($req)){
|
437 |
$req=$_GET;
|
438 |
}
|
439 |
+
if(!empty($req['start_date'])){
|
440 |
$start_date=strtotime(vxcf_form::post('start_date',$req).' 00:00:00');
|
441 |
}
|
442 |
if(!empty($req['end_date'])){
|
446 |
}
|
447 |
|
448 |
if($start_date!=""){
|
449 |
+
// $start_date-=$offset;
|
450 |
$search.=' and l.created >="'.date('Y-m-d H:i:s',$start_date).'"';
|
451 |
}
|
452 |
if($end_date!=""){
|
453 |
+
// $end_date-=$offset;
|
454 |
if($time_key == "yesterday"){
|
455 |
$search.=' and l.created <"'.date('Y-m-d H:i:s',$end_date).'"';
|
456 |
}else{
|
462 |
public function get_lead_notes($id){
|
463 |
global $wpdb;
|
464 |
$table_n= $this->get_crm_table_name('notes');
|
465 |
+
$table_u= $wpdb->base_prefix . 'users';
|
466 |
$id=(int)$id;
|
467 |
$sql="select n.id,n.note,n.color,n.email,n.created,n.user_id,u.display_name from $table_n n left join $table_u u on(n.user_id=u.ID) where n.lead_id='$id' limit 300";
|
468 |
return $wpdb->get_results( $sql,ARRAY_A );
|
readme.txt
CHANGED
@@ -1,25 +1,25 @@
|
|
1 |
-
=== Contact Form Entries ===
|
2 |
Contributors: crmperks, sbazzi
|
3 |
Tags: contact form 7, contact form 7 database, contact form db, save contact form, wpforms database
|
4 |
Requires at least: 3.8
|
5 |
-
Tested up to: 5.
|
6 |
-
Stable tag: 1.
|
7 |
-
Version: 1.
|
8 |
Requires PHP: 5.3
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
12 |
-
Saves Contact Form 7, CRM Perks Forms and many other contact form submissions to database.
|
13 |
|
14 |
== Description ==
|
15 |
|
16 |
-
Contact Form 7 Entries Plugin automatically saves form submissions from Contact Form 7, CRM Perks Forms and many other popular contact form plugins to wordpress database when anyone submits a form. Learn more our forms builder and entries at [crmperks.com](https://www.crmperks.com/plugins/contact-form-plugins/crm-perks-forms/?utm_source=wordpress&utm_medium=directory&utm_campaign=readme)
|
17 |
|
18 |
== Supported Contact Forms ==
|
19 |
|
20 |
* [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
|
21 |
* [CRM Perks Forms](https://wordpress.org/plugins/crm-perks-forms/)
|
22 |
-
* [
|
23 |
* [Elementor Forms](https://elementor.com/widgets/form-widget/) (Premium feature)
|
24 |
|
25 |
== Contact form 7 entries features ==
|
@@ -112,45 +112,6 @@ Our team provides free support at <a href="https://www.crmperks.com/contact-us/"
|
|
112 |
|
113 |
Simply add a "GDPR Agreement" checkbox in contact form 7 and make it a required field OR stop tracking a contact form in "settings" tab. Additionally you can disable tracking cookies and user details.
|
114 |
|
115 |
-
= Can i install this plugin without contact form 7 =
|
116 |
-
|
117 |
-
Yes, You can install it without Contact Form 7 because this plugin supports many other contact form plugins
|
118 |
-
|
119 |
-
= Which version of contact form 7 is supported by this plugin =
|
120 |
-
|
121 |
-
This plugin supports all versions of Contact Form 7.
|
122 |
-
|
123 |
-
= How can i disable storing contact form 7 entries to database =
|
124 |
-
|
125 |
-
It is simple, See "Track Forms" option in "settings" tab
|
126 |
-
|
127 |
-
= Can i export contact form 7 entries to CSV =
|
128 |
-
|
129 |
-
Yes, you can export entries of any contact form to CSV file by clicking "Export Entries" button.
|
130 |
-
|
131 |
-
= Where this plugin saves contact form submissions =
|
132 |
-
|
133 |
-
This plugin saves submissions from contact form 7 and other forms plugins to local wordpress database. This plugin does NOT save contact form 7 entries to a third party or external server.
|
134 |
-
|
135 |
-
= Can i reply to a lead from wordpress =
|
136 |
-
|
137 |
-
Yes, you can reply to any contact form 7 submission from wordpress. Your reply will be saved as entry notes.
|
138 |
-
|
139 |
-
= Can i send contact form submissions to my CRM =
|
140 |
-
|
141 |
-
Yes, you can send to any CRM through our premium extensions for all popular crms.
|
142 |
-
|
143 |
-
= Can i search contact form 7 submissions =
|
144 |
-
|
145 |
-
Yes, You can search contact form 7 submissions by a specific field or all fields.
|
146 |
-
|
147 |
-
= Contact form 7 to database extension wordpress plugin =
|
148 |
-
|
149 |
-
* install any popular forms plugin like Contact form 7, CRM Perks forms etc.
|
150 |
-
* Add form anywhere in wordpres page or post.
|
151 |
-
* When anyone submits a form, it will be saved in wordpress database.
|
152 |
-
* You can view all form submissions in wordpress from "CRM Entries" menu.
|
153 |
-
|
154 |
|
155 |
= Elementor forms database =
|
156 |
|
@@ -158,9 +119,6 @@ Yes, You can search contact form 7 submissions by a specific field or all fields
|
|
158 |
* Plugin automatically saves all elementor forms entries in wordpress database.
|
159 |
* You can add notes and send emails to elementor forms entries.
|
160 |
|
161 |
-
= How can i restrict plugin storing IP address and User Agent =
|
162 |
-
|
163 |
-
You can select this in plugin settings.
|
164 |
|
165 |
= WP Forms database =
|
166 |
|
@@ -169,18 +127,6 @@ You can select this in plugin settings.
|
|
169 |
* You can view and edit any entry in wordpress.
|
170 |
* Add Notes and send emails to any entry from wordpress.
|
171 |
|
172 |
-
= Contact form advanced database =
|
173 |
-
|
174 |
-
This contact form entries plugin not only saves contact form submissions, it has more advanced features like
|
175 |
-
* You view and edit any entry.
|
176 |
-
* you can dfferent colored notes.
|
177 |
-
* supports multiple file uploads.
|
178 |
-
|
179 |
-
= Store contact form 7 to database =
|
180 |
-
|
181 |
-
* Simply Contact Form Entries Plugin.
|
182 |
-
* It will automatically start saving form submissions from contact form 7 and many others.
|
183 |
-
* You can modify, print, export entries.
|
184 |
|
185 |
= Wordpress plugin contact form database =
|
186 |
|
@@ -188,7 +134,7 @@ This contact form entries plugin not only saves contact form submissions, it has
|
|
188 |
* in wordpress go to "CRM Entries" menu then select your form, plugin will show all entries in table form.
|
189 |
* you can star or Un-star any entry.
|
190 |
|
191 |
-
= WPforms
|
192 |
|
193 |
* Save all WPforms submissions in wordpress database.
|
194 |
* View and edit any entry in wordpress.
|
@@ -208,18 +154,6 @@ from main wordpress menu select "CRM Entries" then you can view any entry.
|
|
208 |
* Install our entries plugin for saving WPforms submissions to database.
|
209 |
* Plugin automatically saves all WPforms entries in wordpress database.
|
210 |
* You can add notes and send emails to WPforms entries.
|
211 |
-
|
212 |
-
|
213 |
-
= CRM Entries Plugin =
|
214 |
-
|
215 |
-
When anyone submits a form on your site, plugin saves it in wordpress data. You can send it to CRM of your choice with our 20+ crm extensions.
|
216 |
-
|
217 |
-
= contact form 7 to database extension wp =
|
218 |
-
|
219 |
-
* Add Contact form 7 form's shorcode on any wordpress page.
|
220 |
-
* Install Contact form Entries Plugin.
|
221 |
-
* When anyone submits a form, it will be saved in wordpress database.
|
222 |
-
* Go to "CRM Entries" menu, all saved form entries will be available in table form.
|
223 |
|
224 |
= Save contact form 7 submissions =
|
225 |
|
@@ -232,6 +166,24 @@ Contact form 7 entries plugin allows you to save contact form 7 entries to local
|
|
232 |
|
233 |
== Changelog ==
|
234 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
235 |
= 1.1.7 =
|
236 |
* fixed xss issue reported by Gaetano Perrone.
|
237 |
|
1 |
+
=== Contact Form Entries - Contact Form 7, WPforms and more ===
|
2 |
Contributors: crmperks, sbazzi
|
3 |
Tags: contact form 7, contact form 7 database, contact form db, save contact form, wpforms database
|
4 |
Requires at least: 3.8
|
5 |
+
Tested up to: 5.8
|
6 |
+
Stable tag: 1.2.3
|
7 |
+
Version: 1.2.3
|
8 |
Requires PHP: 5.3
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
12 |
+
Saves Contact Form 7, WPforms, CRM Perks Forms and many other contact form submissions to database.
|
13 |
|
14 |
== Description ==
|
15 |
|
16 |
+
Contact Form 7 Entries Plugin automatically saves form submissions from Contact Form 7, WPforms, CRM Perks Forms and many other popular contact form plugins to wordpress database when anyone submits a form. Learn more our forms builder and entries at [crmperks.com](https://www.crmperks.com/plugins/contact-form-plugins/crm-perks-forms/?utm_source=wordpress&utm_medium=directory&utm_campaign=readme)
|
17 |
|
18 |
== Supported Contact Forms ==
|
19 |
|
20 |
* [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
|
21 |
* [CRM Perks Forms](https://wordpress.org/plugins/crm-perks-forms/)
|
22 |
+
* [WPForms](https://wordpress.org/plugins/wpforms-lite/)
|
23 |
* [Elementor Forms](https://elementor.com/widgets/form-widget/) (Premium feature)
|
24 |
|
25 |
== Contact form 7 entries features ==
|
112 |
|
113 |
Simply add a "GDPR Agreement" checkbox in contact form 7 and make it a required field OR stop tracking a contact form in "settings" tab. Additionally you can disable tracking cookies and user details.
|
114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
|
116 |
= Elementor forms database =
|
117 |
|
119 |
* Plugin automatically saves all elementor forms entries in wordpress database.
|
120 |
* You can add notes and send emails to elementor forms entries.
|
121 |
|
|
|
|
|
|
|
122 |
|
123 |
= WP Forms database =
|
124 |
|
127 |
* You can view and edit any entry in wordpress.
|
128 |
* Add Notes and send emails to any entry from wordpress.
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
|
131 |
= Wordpress plugin contact form database =
|
132 |
|
134 |
* in wordpress go to "CRM Entries" menu then select your form, plugin will show all entries in table form.
|
135 |
* you can star or Un-star any entry.
|
136 |
|
137 |
+
= WPforms lite entries =
|
138 |
|
139 |
* Save all WPforms submissions in wordpress database.
|
140 |
* View and edit any entry in wordpress.
|
154 |
* Install our entries plugin for saving WPforms submissions to database.
|
155 |
* Plugin automatically saves all WPforms entries in wordpress database.
|
156 |
* You can add notes and send emails to WPforms entries.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
|
158 |
= Save contact form 7 submissions =
|
159 |
|
166 |
|
167 |
== Changelog ==
|
168 |
|
169 |
+
= 1.2.3 =
|
170 |
+
* fixed "empty search and filters" issue.
|
171 |
+
|
172 |
+
= 1.2.2 =
|
173 |
+
* fixed "empty search and filters" issue.
|
174 |
+
|
175 |
+
= 1.2.1 =
|
176 |
+
* fixed "debug xss" issue.
|
177 |
+
|
178 |
+
= 1.2.0 =
|
179 |
+
* fixed search date issue.
|
180 |
+
|
181 |
+
= 1.1.9 =
|
182 |
+
* fixed php8 issues.
|
183 |
+
|
184 |
+
= 1.1.8 =
|
185 |
+
* fixed empty name issue with wpforms.
|
186 |
+
|
187 |
= 1.1.7 =
|
188 |
* fixed xss issue reported by Gaetano Perrone.
|
189 |
|
templates/leads-table.php
CHANGED
@@ -202,7 +202,6 @@ $field_label= date('M-d-Y H:i:s',$field_label);
|
|
202 |
padding: 5px;
|
203 |
}
|
204 |
.vx_entries_table{
|
205 |
-
display: block;
|
206 |
overflow: auto;
|
207 |
}
|
208 |
/* pager navigation arrows */
|
202 |
padding: 5px;
|
203 |
}
|
204 |
.vx_entries_table{
|
|
|
205 |
overflow: auto;
|
206 |
}
|
207 |
/* pager navigation arrows */
|
templates/leads.php
CHANGED
@@ -326,8 +326,8 @@ margin-left: 8px;
|
|
326 |
?>
|
327 |
</select>
|
328 |
<span style="<?php if(vxcf_form::post('time') != "custom"){echo "display:none";} ?>" class="crm_custom_range">
|
329 |
-
<input type="text" name="start_date" placeholder="<?php _e('From Date','contact-form-entries') ?>" value="<?php if(isset($_REQUEST['start_date'])){echo $_REQUEST['start_date'];}?>" class="vxc_date crm_input_inline" style="width: 100px">
|
330 |
-
<input type="text" class="vxc_date crm_input_inline" value="<?php if(isset($_REQUEST['end_date'])){echo $_REQUEST['end_date'];}?>" placeholder="<?php _e('To Date','contact-form-entries') ?>" name="end_date" style="width: 100px">
|
331 |
</span>
|
332 |
|
333 |
<button type="submit" title="<?php _e('Search','contact-form-entries') ?>" class="button-secondary button crm_input_inline"><i class="fa fa-search"></i> <?php _e('Search','contact-form-entries') ?></button>
|
326 |
?>
|
327 |
</select>
|
328 |
<span style="<?php if(vxcf_form::post('time') != "custom"){echo "display:none";} ?>" class="crm_custom_range">
|
329 |
+
<input type="text" name="start_date" placeholder="<?php _e('From Date','contact-form-entries') ?>" value="<?php if(isset($_REQUEST['start_date'])){echo esc_attr($_REQUEST['start_date']);}?>" class="vxc_date crm_input_inline" style="width: 100px">
|
330 |
+
<input type="text" class="vxc_date crm_input_inline" value="<?php if(isset($_REQUEST['end_date'])){echo esc_attr($_REQUEST['end_date']);}?>" placeholder="<?php _e('To Date','contact-form-entries') ?>" name="end_date" style="width: 100px">
|
331 |
</span>
|
332 |
|
333 |
<button type="submit" title="<?php _e('Search','contact-form-entries') ?>" class="button-secondary button crm_input_inline"><i class="fa fa-search"></i> <?php _e('Search','contact-form-entries') ?></button>
|
templates/settings.php
CHANGED
@@ -139,7 +139,10 @@ foreach($forms_arr as $k=>$v){
|
|
139 |
?>
|
140 |
</td>
|
141 |
</tr>
|
142 |
-
<?php } ?>
|
|
|
|
|
|
|
143 |
<tr>
|
144 |
<th scope="row"><label for="vx_cookies">
|
145 |
<?php _e('Disable Cookies', 'contact-form-entries'); ?>
|
@@ -169,6 +172,17 @@ foreach($forms_arr as $k=>$v){
|
|
169 |
<label for="vx_plugin_data"><input type="checkbox" name="meta[plugin_data]" value="yes" <?php if(vxcf_form::post('plugin_data',$meta) == "yes"){echo 'checked="checked"';} ?> id="vx_plugin_data"><?php _e('Remove all plugin data during plugin uninstall','contact-form-entries'); ?></label>
|
170 |
</td>
|
171 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
</table>
|
173 |
<?php
|
174 |
do_action('add_settings_section_'.vxcf_form::$id,$meta,$forms);
|
139 |
?>
|
140 |
</td>
|
141 |
</tr>
|
142 |
+
<?php } ?>
|
143 |
+
|
144 |
+
|
145 |
+
|
146 |
<tr>
|
147 |
<th scope="row"><label for="vx_cookies">
|
148 |
<?php _e('Disable Cookies', 'contact-form-entries'); ?>
|
172 |
<label for="vx_plugin_data"><input type="checkbox" name="meta[plugin_data]" value="yes" <?php if(vxcf_form::post('plugin_data',$meta) == "yes"){echo 'checked="checked"';} ?> id="vx_plugin_data"><?php _e('Remove all plugin data during plugin uninstall','contact-form-entries'); ?></label>
|
173 |
</td>
|
174 |
</tr>
|
175 |
+
|
176 |
+
<tr>
|
177 |
+
<th scope="row"><label for="vx_sep">
|
178 |
+
<?php _e('CSV Separator ', 'contact-form-entries'); ?>
|
179 |
+
</label>
|
180 |
+
</th>
|
181 |
+
<td>
|
182 |
+
<label for="vx_sep"><input type="text" name="meta[sep]" placeholder="<?php _e(',','contact-form-entries'); ?>" value="<?php echo vxcf_form::post('sep',$meta) ?>" id="vx_sep" class="crm_text"></label>
|
183 |
+
</td>
|
184 |
+
</tr>
|
185 |
+
|
186 |
</table>
|
187 |
<?php
|
188 |
do_action('add_settings_section_'.vxcf_form::$id,$meta,$forms);
|
wp/crmperks-notices.php
CHANGED
@@ -105,7 +105,7 @@ public function review_notice() {
|
|
105 |
update_option($this->option."_install_data",$install_time,false);
|
106 |
}
|
107 |
// $install_time['review_closed']='';
|
108 |
-
$time=current_time( 'timestamp' , 1 )-(3600*
|
109 |
if(!empty($install_time) && is_array($install_time) && !empty($install_time['time']) && empty($install_time['review_closed'])){
|
110 |
$time_i=(int)$install_time['time'];
|
111 |
if($time > $time_i){
|
105 |
update_option($this->option."_install_data",$install_time,false);
|
106 |
}
|
107 |
// $install_time['review_closed']='';
|
108 |
+
$time=current_time( 'timestamp' , 1 )-(3600*48);
|
109 |
if(!empty($install_time) && is_array($install_time) && !empty($install_time['time']) && empty($install_time['review_closed'])){
|
110 |
$time_i=(int)$install_time['time'];
|
111 |
if($time > $time_i){
|