Contact Form Email - Version 1.2.61

Version Description

  • Interface and stats section improvements
Download this release

Release Info

Developer codepeople
Plugin Icon 128x128 Contact Form Email
Version 1.2.61
Comparing to
See all releases

Code changes from version 1.2.60 to 1.2.61

README.txt CHANGED
@@ -454,6 +454,8 @@ When you click a field already added into the contact form builder area, you can
454
 
455
  == Changelog ==
456
 
 
 
457
 
458
  = 1.2.60 =
459
  * Gutemberg integration update
@@ -942,5 +944,5 @@ When you click a field already added into the contact form builder area, you can
942
 
943
  == Upgrade Notice ==
944
 
945
- = 1.2.60 =
946
- * Gutemberg integration update
454
 
455
  == Changelog ==
456
 
457
+ = 1.2.61 =
458
+ * Interface and stats section improvements
459
 
460
  = 1.2.60 =
461
  * Gutemberg integration update
944
 
945
  == Upgrade Notice ==
946
 
947
+ = 1.2.61 =
948
+ * Interface and stats section improvements
cp-admin-int-list.inc.php CHANGED
@@ -214,7 +214,7 @@ $nonce = wp_create_nonce( 'cfte_update_actions_plist' );
214
  <div class="inside">
215
 
216
 
217
- <table cellspacing="10">
218
  <tr>
219
  <th align="left">ID</th><th align="left">Form Name</th><th align="left">&nbsp; &nbsp; Options</th><th align="left">Shortcode for Pages and Posts</th>
220
  </tr>
@@ -229,12 +229,12 @@ $nonce = wp_create_nonce( 'cfte_update_actions_plist' );
229
  <td nowrap><input type="text" name="calname_<?php echo $item->id; ?>" id="calname_<?php echo $item->id; ?>" value="<?php echo esc_attr($item->form_name); ?>" /></td>
230
 
231
  <td nowrap>&nbsp; &nbsp;
232
- <input type="button" name="calupdate_<?php echo $item->id; ?>" value="Update" onclick="cp_updateItem(<?php echo $item->id; ?>);" /> &nbsp;
233
- <input type="button" name="calmanage_<?php echo $item->id; ?>" value="Settings" onclick="cp_manageSettings(<?php echo $item->id; ?>);" /> &nbsp;
234
- <input type="button" name="calmessages_<?php echo $item->id; ?>" value="Messages" onclick="cp_viewMessages(<?php echo $item->id; ?>);" /> &nbsp;
235
- <input type="button" name="calreport_<?php echo $item->id; ?>" value="Reports" onclick="cp_viewReport(<?php echo $item->id; ?>);" /> &nbsp;
236
- <input type="button" name="calclone_<?php echo $item->id; ?>" value="Clone" onclick="cp_cloneItem(<?php echo $item->id; ?>);" /> &nbsp;
237
- <input type="button" name="caldelete_<?php echo $item->id; ?>" value="Delete" onclick="cp_deleteItem(<?php echo $item->id; ?>);" />
238
  </td>
239
  <td nowrap>[<?php echo $this->shorttag; ?> id="<?php echo $item->id; ?>"]</td>
240
  </tr>
@@ -250,18 +250,13 @@ $nonce = wp_create_nonce( 'cfte_update_actions_plist' );
250
  </div>
251
 
252
 
253
- <div id="metabox_basic_settings" class="postbox" >
254
- <h3 class='hndle' style="padding:5px;"><span>New Form</span></h3>
255
- <div class="inside">
256
-
257
- <form name="additem" onsubmit="cp_addItem();return false;">
258
- Item Name:<br />
259
- <input type="text" name="cp_itemname" id="cp_itemname" value="" /> <input type="button" onclick="cp_addItem();" name="gobtn" value="Add" />
260
- <br /><br />
261
- </form>
262
-
263
- </div>
264
- </div>
265
 
266
 
267
  <div id="metabox_basic_settings" class="postbox" >
@@ -316,7 +311,7 @@ $nonce = wp_create_nonce( 'cfte_update_actions_plist' );
316
  </tr>
317
  <tr valign="top">
318
  <th scope="row"></th>
319
- <td><input type="submit" name="cftesubbtn" value="Update Report Settings" /></td>
320
  </tr>
321
  </table>
322
  <p>Note: For setting up a report only for a specific form use the setting area available for that when editing each form settings.</p>
@@ -348,7 +343,7 @@ $nonce = wp_create_nonce( 'cfte_update_actions_plist' );
348
  </select><br />
349
  <em>* Update the charset if you are getting problems displaying special/non-latin characters. After updated you need to edit the special characters again.</em>
350
  <br />
351
- <input type="button" onclick="cp_updateConfig();" name="gobtn" value="UPDATE" />
352
  <br /><br />
353
  </form>
354
 
@@ -410,7 +405,8 @@ $nonce = wp_create_nonce( 'cfte_update_actions_plist' );
410
 
411
  <div style="clear:both"></div>
412
 
413
- <div style="margin-top:20px;"><input type="button" style="cursor:pointer;color: #006600;font-weight:bold;" onclick="window.open('https://form2email.dwbooster.com/download?src=activateaddons');" name="activateAddon" value="Activate Addons" /></div>
 
414
  * Add-ons are available in <a href="https://form2email.dwbooster.com/download">upgraded versions</a>.
415
  </div>
416
  </div>
@@ -424,13 +420,16 @@ $nonce = wp_create_nonce( 'cfte_update_actions_plist' );
424
  document.location = 'admin.php?page=<?php echo $this->menu_parameter; ?>&edit=1&cal=1&item='+id+'&r='+Math.random();
425
  }
426
  </script>
 
 
427
  <div id="metabox_basic_settings" class="postbox" >
428
  <h3 class='hndle' style="padding:5px;"><span>Customization Area</span></h3>
429
  <div class="inside">
430
  <p>Use this area to add custom CSS styles or custom scripts. These styles and scripts will be keep safe even after updating the plugin.</p>
431
- <input type="button" onclick="cp_editArea('css');" name="gobtn3" value="Add Custom Styles" />
432
- &nbsp; &nbsp; &nbsp;
433
- <input type="button" onclick="cp_editArea('js');" name="gobtn2" value="Add Custom JavaScript" />
 
434
  </div>
435
  </div>
436
 
214
  <div class="inside">
215
 
216
 
217
+ <table cellspacing="10" cellpadding="6" class="ahb-calendars-list">
218
  <tr>
219
  <th align="left">ID</th><th align="left">Form Name</th><th align="left">&nbsp; &nbsp; Options</th><th align="left">Shortcode for Pages and Posts</th>
220
  </tr>
229
  <td nowrap><input type="text" name="calname_<?php echo $item->id; ?>" id="calname_<?php echo $item->id; ?>" value="<?php echo esc_attr($item->form_name); ?>" /></td>
230
 
231
  <td nowrap>&nbsp; &nbsp;
232
+ <input class="button" type="button" name="calupdate_<?php echo $item->id; ?>" value="Rename" onclick="cp_updateItem(<?php echo $item->id; ?>);" /> &nbsp;
233
+ <input class="button-primary button" type="button" name="calmanage_<?php echo $item->id; ?>" value="Settings" onclick="cp_manageSettings(<?php echo $item->id; ?>);" /> &nbsp;
234
+ <input class="button" type="button" name="calmessages_<?php echo $item->id; ?>" value="Messages" onclick="cp_viewMessages(<?php echo $item->id; ?>);" /> &nbsp;
235
+ <input class="button" type="button" name="calreport_<?php echo $item->id; ?>" value="Stats" onclick="cp_viewReport(<?php echo $item->id; ?>);" /> &nbsp;
236
+ <input class="button" type="button" name="calclone_<?php echo $item->id; ?>" value="Clone" onclick="cp_cloneItem(<?php echo $item->id; ?>);" /> &nbsp;
237
+ <input class="button" type="button" name="caldelete_<?php echo $item->id; ?>" value="Delete" onclick="cp_deleteItem(<?php echo $item->id; ?>);" />
238
  </td>
239
  <td nowrap>[<?php echo $this->shorttag; ?> id="<?php echo $item->id; ?>"]</td>
240
  </tr>
250
  </div>
251
 
252
 
253
+ <div class="ahb-section-container">
254
+ <div class="ahb-section">
255
+ <label>New Form</label>&nbsp;&nbsp;&nbsp;
256
+ <input type="text" name="cp_itemname" id="cp_itemname" placeholder=" - Form Name - " class="ahb-new-calendar" />
257
+ <input type="button" class="button-primary" value="Add New" onclick="cp_addItem();" />
258
+ </div>
259
+ </div>
 
 
 
 
 
260
 
261
 
262
  <div id="metabox_basic_settings" class="postbox" >
311
  </tr>
312
  <tr valign="top">
313
  <th scope="row"></th>
314
+ <td><input class="button-primary button" type="submit" name="cftesubbtn" value="Update Report Settings" /></td>
315
  </tr>
316
  </table>
317
  <p>Note: For setting up a report only for a specific form use the setting area available for that when editing each form settings.</p>
343
  </select><br />
344
  <em>* Update the charset if you are getting problems displaying special/non-latin characters. After updated you need to edit the special characters again.</em>
345
  <br />
346
+ <input class="button-primary button" type="button" onclick="cp_updateConfig();" name="gobtn" value="UPDATE" />
347
  <br /><br />
348
  </form>
349
 
405
 
406
  <div style="clear:both"></div>
407
 
408
+ <div style="margin-top:20px;"><input class="button-primary button" type="button" style="cursor:pointer;color: #FFFFFF;font-weight:bold;" onclick="window.open('https://form2email.dwbooster.com/download?src=activateaddons');" name="activateAddon" value="Activate Addons" /></div>
409
+ <div class="clear"></div>
410
  * Add-ons are available in <a href="https://form2email.dwbooster.com/download">upgraded versions</a>.
411
  </div>
412
  </div>
420
  document.location = 'admin.php?page=<?php echo $this->menu_parameter; ?>&edit=1&cal=1&item='+id+'&r='+Math.random();
421
  }
422
  </script>
423
+
424
+
425
  <div id="metabox_basic_settings" class="postbox" >
426
  <h3 class='hndle' style="padding:5px;"><span>Customization Area</span></h3>
427
  <div class="inside">
428
  <p>Use this area to add custom CSS styles or custom scripts. These styles and scripts will be keep safe even after updating the plugin.</p>
429
+ <input class="button" type="button" onclick="cp_editArea('css');" name="gobtn3" value="Add Custom Styles" />
430
+
431
+ <input class="button" style="margin-left:15px;" type="button" onclick="cp_editArea('js');" name="gobtn2" value="Add Custom JavaScript" />
432
+ <div class="clear">
433
  </div>
434
  </div>
435
 
cp-admin-int-report.inc.php CHANGED
@@ -78,7 +78,7 @@ $daily_messages = substr($daily_messages,1);
78
 
79
  if (!isset($_GET["field"])) $_GET["field"] = 'time';
80
 
81
- $color_array = array(/**'ff0000',*/'ff4500','ff6347','f08080', 'ff7f50', 'ff8c00', 'ffa500', 'ffa07a', 'fa8072', 'e9967a', 'f5deb3', 'ffe4c4', 'ffebcd', 'ffefd5');
82
 
83
 
84
  if ($this->item)
@@ -91,125 +91,133 @@ else
91
 
92
  ?>
93
 
94
- <div class="wrap">
95
- <h1><?php echo $this->plugin_name; ?> - Report</h1>
96
 
97
- <input type="button" name="backbtn" value="Back to items list..." onclick="document.location='admin.php?page=<?php echo $this->menu_parameter; ?>';">
98
 
99
- <div id="normal-sortables" class="meta-box-sortables">
100
- <hr />
101
- <h3>This report is for: <?php if ($this->item != 0) echo $myform[0]->form_name; else echo 'All forms'; ?></h3>
102
- </div>
103
 
 
 
 
 
104
 
105
- <form action="admin.php" method="get">
106
- <input type="hidden" name="page" value="<?php echo $this->menu_parameter; ?>" />
107
- <input type="hidden" name="cal" value="<?php echo esc_attr($this->item); ?>" />
108
- <input type="hidden" name="report" value="1" />
109
- <input type="hidden" name="field" value="<?php echo esc_attr(strip_tags($_GET["field"])); ?>" />
110
- <nobr>Search for: <input type="text" name="search" value="<?php echo esc_attr(strip_tags($_GET["search"])); ?>" /> &nbsp; &nbsp; &nbsp;</nobr>
111
- <nobr>From: <input type="text" id="dfrom" name="dfrom" value="<?php echo esc_attr(strip_tags($_GET["dfrom"])); ?>" /> &nbsp; &nbsp; &nbsp; </nobr>
112
- <nobr>To: <input type="text" id="dto" name="dto" value="<?php echo esc_attr(strip_tags($_GET["dto"])); ?>" /> &nbsp; &nbsp; &nbsp; </nobr>
113
- <nobr>Item: <select id="cal" name="cal">
114
- <option value="0">[All Items]</option>
 
 
115
  <?php
116
- $myrows = $wpdb->get_results( "SELECT * FROM ".$wpdb->prefix.$this->table_items );
117
- foreach ($myrows as $item)
118
- echo '<option value="'.$item->id.'"'.(intval($item->id)==intval($this->item)?" selected":"").'>'.$item->form_name.'</option>';
119
  ?>
120
  </select></nobr>
121
- <nobr><span class="submit"><input type="submit" name="ds" value="Filter" /></span> &nbsp; &nbsp; &nbsp;
122
- <span class="submit"><input type="submit" name="<?php echo $this->prefix; ?>_csv" value="Export to CSV" /></span></nobr>
123
- </form>
 
 
 
 
124
 
125
- <br />
126
 
127
- <div style="border:1px solid black;width:320px;margin-right:10px;padding:0px;float:left;">
128
- <div style="border-bottom:1px solid black;padding:5px;background:#ECECEC;color:#21759B;font-weight: bold;">
129
- Submissions per day
130
- </div>
131
- <div class="canvas" id="cardiocontainer1" style="margin-left:10px;position:relative;">
132
- <canvas id="cardio1" width="300" height="200" questions='[{"color":"#00f","values":[<?php echo $daily_messages; ?>]}]'></canvas>
133
- </div>
134
- <div style="padding-right:5px;padding-left:5px;color:#888888;">* Submissions per day in the selected date range.<br />&nbsp;&nbsp; Days from <?php echo strip_tags($date_start); ?> to <?php echo strip_tags($date_end); ?>.</div>
135
- </div>
136
-
137
- <div style="border:1px solid black;width:330px;margin:0px;padding:0px;float:left;">
138
- <div style="border-bottom:1px solid black;padding:5px;background:#ECECEC;color:#21759B;font-weight: bold;">
139
- Submissions per hour
140
- </div>
141
- <div class="canvas" id="cardiocontainer2" style="margin-left:10px;position:relative;">
142
- <canvas id="cardio2" width="312" height="200" questions='[{"color":"#00f","values":[<?php echo $hourly_messages; ?>]}]'></canvas>
143
- </div>
144
- <div style="padding-right:5px;padding-left:5px;color:#888888;">* Total submissions per hour in the selected date range.<br />&nbsp;&nbsp; Hours from 0 to 23.</div>
145
- </div>
146
-
147
-
148
- <div style="clear:both"></div>
149
-
150
- <hr />
151
- <br />
152
- <form action="admin.php" name="cfm_formrep" method="get">
153
- <input type="hidden" name="page" value="<?php echo $this->menu_parameter; ?>" />
154
- <input type="hidden" name="cal" value="<?php echo esc_attr(strip_tags($this->item)); ?>" />
155
- <input type="hidden" name="report" value="1" />
156
- <input type="hidden" name="search" value="<?php echo esc_attr(strip_tags($_GET["search"])); ?>" />
157
- <input type="hidden" id="dfrom" name="dfrom" value="<?php echo esc_attr($_GET["dfrom"]); ?>" />
158
- <input type="hidden" id="dto" name="dto" value="<?php echo esc_attr($_GET["dto"]); ?>" />
159
- <strong>Select field for the report:</strong><br />
160
- <select name="field" onchange="document.cfm_formrep.submit();">
161
- <?php
162
- foreach ($fields as $item => $value)
163
- echo '<option value="'.esc_attr($item).'"'.($_GET["field"]==$item?' selected':'').'>'.$this->get_form_field_label($item,$form).'</option>';
164
- ?>
165
- </select>
166
- <br /><br />
167
- </form>
168
-
169
-
170
- <div id="dex_printable_contents">
171
-
172
-
173
- <div style="border:1px solid black;width:650px;margin-right:10px;padding:0px;float:left;">
174
- <div style="border-bottom:1px solid black;padding:5px;background:#ECECEC;color:#21759B;font-weight: bold;">
175
- Report of values for: <em><?php echo $this->get_form_field_label($_GET["field"],$form); ?></em>
176
- </div>
177
-
178
- <div style="padding:10px;">
179
- <?php
180
- $arr = $fields[$_GET["field"]];
181
- arsort($arr, SORT_NUMERIC);
182
- $total = 0;
183
- $totalsize = 600;
184
- foreach ($arr as $item => $value)
185
- $total += $value;
186
- $max = max($arr);
187
- $totalsize = round(600 / ($max/$total) );
188
- $count = 0;
189
- foreach ($arr as $item => $value)
190
- {
191
- $item = htmlentities($item);
192
- echo $value.' times: '.(strlen($item)>50?substr($item,1,50).'...':substr($item,1));
193
- echo '<div style="width:'.round($value/$total*$totalsize).'px;border:1px solid black;margin-bottom:3px;font-size:9px;background-color:#'.$color_array[$count].'">'.round($value/$total*100,2).'%</div>';
194
- $count++;
195
- if ($count >= count($color_array)) $count = count($color_array)-1;
196
- }
197
- ?>
198
  </div>
199
 
200
- <div style="padding-right:5px;padding-left:5px;color:#888888;">&nbsp;&nbsp;* Number of times that appears each value. Percent in relation to the total of submissions.<br />&nbsp;&nbsp;&nbsp;&nbsp; Date range from <?php echo strip_tags($date_start); ?> to <?php echo strip_tags($date_end); ?>.</div>
 
 
 
 
 
 
 
 
 
 
201
  </div>
 
202
 
203
-
204
- <div style="clear:both"></div>
205
 
206
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  </div>
208
 
209
- <p class="submit"><input type="button" name="pbutton" value="Print" onclick="do_dexapp_print();" /></p>
210
 
211
- </div>
212
 
 
 
 
 
 
213
 
214
  <script type="text/javascript">
215
 
@@ -218,59 +226,60 @@ else
218
  w=window.open();
219
  w.document.write("<style>.cpnopr{display:none;};table{border:2px solid black;width:100%;}th{border-bottom:2px solid black;text-align:left}td{padding-left:10px;border-bottom:1px solid black;}</style>"+document.getElementById('dex_printable_contents').innerHTML);
220
  w.print();
221
- w.close();
222
  }
223
-
224
  var $j = jQuery.noConflict();
225
  $j(function() {
226
- $j("#dfrom").datepicker({
227
  dateFormat: 'yy-mm-dd'
228
  });
229
- $j("#dto").datepicker({
230
  dateFormat: 'yy-mm-dd'
231
  });
232
  });
233
-
234
  </script>
235
 
236
 
 
237
  <script type="text/javascript">
238
  var $ = jQuery.noConflict();
239
- $j(document).ready(function(){
240
- /////////////////////////canvas//////////////////////////
241
- //$(window).on('load',function(){
242
- drawGraph($("#cardio1"), $("#cardiocontainer1"));
243
  drawGraph($("#cardio2"), $("#cardiocontainer2"));
244
  function drawGraph(canvas, canvasContainer)
245
  {
246
  if( typeof(G_vmlCanvasManager) != 'undefined' ){ G_vmlCanvasManager.init(); G_vmlCanvasManager.initElement(canvas[0]); }
247
- ctx = canvas[0].getContext("2d");
248
  var data = jQuery.parseJSON(canvas.attr("questions"));
249
  var height = canvas.attr("height");
250
  var width = canvas.attr("width");
251
  var maxquestions = 0,maxpos = 0,minpos = 0,interval = 5;
252
-
253
  jQuery.each(data,function(index,v){
254
- maxquestions = (maxquestions<v.values.length)?v.values.length:maxquestions;
255
  postmp = 0;
256
  jQuery.each(v.values,function(index1,v1){
257
- maxpos = (maxpos<v1)?v1:maxpos;
258
- minpos = (minpos>v1)?v1:minpos;
259
- });
260
-
261
- });
262
  maxpos = maxpos;//Math.ceil(maxpos/interval)*interval;
263
- minpos = 0; //Math.floor(minpos/interval)*interval;
264
  interval = Math.ceil(maxpos / 10);
265
- total = maxpos - minpos + interval;
266
- h = Math.round(height/total);
267
  var start = 10;
268
  var radius = 2;
269
  if (maxquestions>1)
270
  w = Math.round((width-start-radius)/(maxquestions-1));
271
  else
272
- w = width/2;
273
-
274
  if(ctx)
275
  {
276
  for (i=0;i<total/interval;i++)
@@ -278,42 +287,44 @@ $j(document).ready(function(){
278
  if ((maxpos-i*interval) >= 0) canvasContainer.append('<div class="legend" style="position:absolute;left:-10px;top:'+(parseInt((i*interval+interval/2)*h-5))+'px">'+(maxpos-i*interval)+'</div>');
279
  ctx.beginPath();
280
  ctx.moveTo(start,Math.round((i*interval+interval/2)*h) );
281
- ctx.lineTo(width,Math.round((i*interval+interval/2)*h) );
 
 
282
  ctx.stroke();
283
  }
284
  jQuery.each(data,function(index,v){
285
  ctx.beginPath();
286
  ctx.strokeStyle = v.color;
287
  ctx.fillStyle = v.color;
288
-
289
  //ctx.moveTo(start,Math.round((maxpos+interval/2)*h) );
290
  var i = 0,j = 0;
291
  jQuery.each(v.values,function(index1,v1){
292
- j=-v1;
293
- if (i!=0)
294
- ctx.lineTo(i*w+start,Math.round((maxpos+interval/2)*h+j*h));
295
  else
296
- ctx.moveTo(i*w+start,Math.round((maxpos+interval/2)*h+j*h));
297
- i++;
298
  });
299
-
300
  ctx.stroke();
301
  var i = 0,j = 0;
302
  jQuery.each(v.values,function(index1,v1){
303
- j=-v1;
304
  ctx.beginPath();
305
- ctx.arc(i*w+start,Math.round((maxpos+interval/2)*h+j*h), radius, 0, 2 * Math.PI, true);
306
- ctx.fill();
307
- i++;
308
  });
309
  });
310
  }
311
  }
312
- //});
313
-
314
- ////////////////////////end canvas///////////////////////
315
- });
316
- </script>
317
 
318
 
319
 
78
 
79
  if (!isset($_GET["field"])) $_GET["field"] = 'time';
80
 
81
+ $color_array = array('ffb3ba','ffdfba','ffffba', 'baffc9', 'bae1ff', 'a8e6cf', 'dcedc1', 'ffd3b6', 'ffaaa5', 'ff8b94', 'eea990', 'adcbe3', 'e2f4c7');
82
 
83
 
84
  if ($this->item)
91
 
92
  ?>
93
 
94
+ <h1><?php echo $this->plugin_name; ?> Stats - <?php echo $this->get_option("form_name"); ?></h1>
 
95
 
 
96
 
 
 
 
 
97
 
98
+ <div class="ahb-buttons-container">
99
+ <a href="<?php print esc_attr(admin_url('admin.php?page='.$this->menu_parameter));?>" class="ahb-return-link">&larr;Return to the items list</a>
100
+ <div class="clear"></div>
101
+ </div>
102
 
103
+ <div class="ahb-section-container">
104
+ <div class="ahb-section">
105
+ <form action="admin.php" method="get">
106
+ <input type="hidden" name="page" value="<?php echo $this->menu_parameter; ?>" />
107
+ <input type="hidden" name="cal" value="<?php echo $this->item; ?>" />
108
+ <input type="hidden" name="report" value="1" />
109
+ <input type="hidden" name="field" value="<?php echo esc_attr($_GET["field"]); ?>" />
110
+ <nobr><label>Search for:</label> <input type="text" name="search" value="<?php echo esc_attr($_GET["search"]); ?>">&nbsp;&nbsp;</nobr>
111
+ <nobr><label>From:</label> <input type="text" id="dfrom" name="dfrom" value="<?php echo esc_attr($_GET["dfrom"]); ?>" >&nbsp;&nbsp;</nobr>
112
+ <nobr><label>To:</label> <input type="text" id="dto" name="dto" value="<?php echo esc_attr($_GET["dto"]); ?>" >&nbsp;&nbsp;</nobr>
113
+ <nobr><label>Item:</label> <select id="cal" name="cal">
114
+ <option value="0">[<?php _e('All Items','cpappb'); ?>]</option>
115
  <?php
116
+ $myrows = $wpdb->get_results( "SELECT * FROM ".$wpdb->prefix.$this->table_items );
117
+ foreach ($myrows as $item)
118
+ echo '<option value="'.$item->id.'"'.(intval($item->id)==intval($this->item)?" selected":"").'>'.$item->form_name.'</option>';
119
  ?>
120
  </select></nobr>
121
+ <nobr>
122
+ <input type="submit" name="<?php echo $this->prefix; ?>_csv" value="<?php _e('Export to CSV','cpappb'); ?>" class="button" style="float:right;margin-left:10px;">
123
+ <input type="submit" name="ds" value="<?php _e('Filter','cpappb'); ?>" class="button-primary button" style="float:right;">
124
+ </nobr>
125
+ </form>
126
+ </div>
127
+ </div>
128
 
 
129
 
130
+ <div class="ahb-statssection-container" style="background:#f6f6f6;float:left;width:48%;">
131
+ <div class="ahb-statssection-header">
132
+ <h3>Submissions per day</h3>
133
+ </div>
134
+ <div class="ahb-statssection">
135
+ <div class="canvas" id="cardiocontainer1" style="margin-left:10px;position:relative;">
136
+ <canvas id="cardio1" width="300" height="200" questions='[{"color":"#008ec2","values":[<?php echo $daily_messages; ?>]}]'></canvas>
137
+ </div>
138
+ <div style="padding-right:5px;padding-left:5px;color:#888888;">* <?php _e('Submissions per day in the selected date range.','cpappb'); ?><br />&nbsp;&nbsp; <?php _e('Days from','cpappb'); ?> <?php echo $date_start; ?> to <?php echo $date_end; ?>.</div>
139
+ <div class="clear"></div>
140
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  </div>
142
 
143
+ <div class="ahb-statssection-container" style="background:#f6f6f6;float:right;width:48%;">
144
+ <div class="ahb-statssection-header">
145
+ <h3>Submissions per hour</h3>
146
+ </div>
147
+ <div class="ahb-statssection" >
148
+ <div class="canvas" id="cardiocontainer2" style="margin-left:10px;position:relative;">
149
+ <canvas id="cardio2" width="312" height="200" questions='[{"color":"#008ec2","values":[<?php echo $hourly_messages; ?>]}]'></canvas>
150
+ </div>
151
+ <div style="padding-right:5px;padding-left:5px;color:#888888;">* <?php _e('Total submissions per hour in the selected date range.','cpappb'); ?><br />&nbsp;&nbsp; <?php _e('Hours from 0 to 23','cpappb'); ?>.</div>
152
+ <div class="clear"></div>
153
+ </div>
154
  </div>
155
+ <div class="clear"></div>
156
 
157
+ <br />
 
158
 
159
 
160
+ <div class="ahb-statssection-container" style="background:#f6f6f6;">
161
+ <div class="ahb-statssection-header">
162
+ <form action="admin.php" name="cfm_formrep" method="get">
163
+ <input type="hidden" name="page" value="<?php echo $this->menu_parameter; ?>" />
164
+ <input type="hidden" name="cal" value="<?php echo $this->item; ?>" />
165
+ <input type="hidden" name="report" value="1" />
166
+ <input type="hidden" name="search" value="<?php echo esc_attr($_GET["search"]); ?>" />
167
+ <input type="hidden" name="dfrom" value="<?php echo esc_attr($_GET["dfrom"]); ?>" />
168
+ <input type="hidden" name="dto" value="<?php echo esc_attr($_GET["dto"]); ?>" />
169
+ <h3><?php _e('Select field for the report','cpappb'); ?>: <select name="field" onchange="document.cfm_formrep.submit();">
170
+ <?php
171
+ foreach ($fields as $item => $value)
172
+ echo '<option value="'.esc_attr($item).'"'.($_GET["field"]==$item?' selected':'').'>'.$this->get_form_field_label($item,$form).'</option>';
173
+ ?>
174
+ </select></h3>
175
+ </form>
176
+ </div>
177
+ <div class="ahb-statssection">
178
+ <div id="dex_printable_contents">
179
+
180
+ <div style="width:100%;padding:0;background:white;border:1px solid #e6e6e6;">
181
+ <div style="padding:10px;background:#ECECEC;color:#21759B;font-weight: bold;">
182
+ <?php _e('Report of values for','cpappb'); ?>: <em><?php echo $this->get_form_field_label($_GET["field"],$form); ?></em>
183
+ </div>
184
+
185
+ <div style="padding:10px;">
186
+ <?php
187
+ $arr = $fields[$_GET["field"]];
188
+ arsort($arr, SORT_NUMERIC);
189
+ $total = 0;
190
+ /* $totalsize = 600; */
191
+ foreach ($arr as $item => $value)
192
+ $total += $value;
193
+ /* $max = max($arr);
194
+ $totalsize = round(600 / ($max/$total) ); */
195
+ $count = 0;
196
+ foreach ($arr as $item => $value)
197
+ {
198
+ echo $value.' times: '.(strlen($item)>50?substr($item,1,50).'...':substr($item,1));
199
+ echo '<div style="width:'.round($value/$total*100).'%;border:1px solid white;margin-bottom:3px;font-size:9px;text-align:center;font-weight:bold;background-color:#'.$color_array[$count].'">'.round($value/$total*100,2).'%</div>';
200
+ $count++;
201
+ if ($count >= count($color_array)) $count = count($color_array)-1;
202
+ }
203
+ ?>
204
+ </div>
205
+
206
+ <div style="padding-right:5px;padding-left:5px;margin-bottom:20px;color:#888888;">&nbsp;&nbsp;* <?php _e('Number of times that appears each value. Percent in relation to the total of submissions.','cpappb'); ?><br />&nbsp;&nbsp;&nbsp;&nbsp; <?php _e('Date range from','cpappb'); ?> <?php echo $date_start; ?> <?php _e('to','cpappb'); ?> <?php echo $date_end; ?>.</div>
207
+ </div>
208
+
209
+ <div style="clear:both"></div>
210
+ </div>
211
+ </div>
212
  </div>
213
 
 
214
 
 
215
 
216
+ <div class="ahb-buttons-container">
217
+ <input type="button" value="<?php _e('Print Stats','cpappb'); ?>" onclick="do_dexapp_print();" class="button button-primary" />
218
+ <a href="<?php print esc_attr(admin_url('admin.php?page='.$this->menu_parameter));?>" class="ahb-return-link">&larr;Return to the calendars list</a>
219
+ <div class="clear"></div>
220
+ </div>
221
 
222
  <script type="text/javascript">
223
 
226
  w=window.open();
227
  w.document.write("<style>.cpnopr{display:none;};table{border:2px solid black;width:100%;}th{border-bottom:2px solid black;text-align:left}td{padding-left:10px;border-bottom:1px solid black;}</style>"+document.getElementById('dex_printable_contents').innerHTML);
228
  w.print();
229
+ w.close();
230
  }
231
+
232
  var $j = jQuery.noConflict();
233
  $j(function() {
234
+ $j("#dfrom").datepicker({
235
  dateFormat: 'yy-mm-dd'
236
  });
237
+ $j("#dto").datepicker({
238
  dateFormat: 'yy-mm-dd'
239
  });
240
  });
241
+
242
  </script>
243
 
244
 
245
+ <script type='text/javascript' src='<?php echo plugins_url('js/excanvas.min.js', __FILE__); ?>'></script>
246
  <script type="text/javascript">
247
  var $ = jQuery.noConflict();
248
+ $(document).ready(function(){ });
249
+ /////////////////////////canvas//////////////////////////
250
+ $(window).on('load',function(){
251
+ drawGraph($("#cardio1"), $("#cardiocontainer1"));
252
  drawGraph($("#cardio2"), $("#cardiocontainer2"));
253
  function drawGraph(canvas, canvasContainer)
254
  {
255
  if( typeof(G_vmlCanvasManager) != 'undefined' ){ G_vmlCanvasManager.init(); G_vmlCanvasManager.initElement(canvas[0]); }
256
+ ctx = canvas[0].getContext("2d");
257
  var data = jQuery.parseJSON(canvas.attr("questions"));
258
  var height = canvas.attr("height");
259
  var width = canvas.attr("width");
260
  var maxquestions = 0,maxpos = 0,minpos = 0,interval = 5;
261
+
262
  jQuery.each(data,function(index,v){
263
+ maxquestions = (maxquestions<v.values.length)?v.values.length:maxquestions;
264
  postmp = 0;
265
  jQuery.each(v.values,function(index1,v1){
266
+ maxpos = (maxpos<v1)?v1:maxpos;
267
+ minpos = (minpos>v1)?v1:minpos;
268
+ });
269
+
270
+ });
271
  maxpos = maxpos;//Math.ceil(maxpos/interval)*interval;
272
+ minpos = 0; //Math.floor(minpos/interval)*interval;
273
  interval = Math.ceil(maxpos / 10);
274
+ total = maxpos - minpos + interval;
275
+ h = Math.round(height/total);
276
  var start = 10;
277
  var radius = 2;
278
  if (maxquestions>1)
279
  w = Math.round((width-start-radius)/(maxquestions-1));
280
  else
281
+ w = width/2;
282
+
283
  if(ctx)
284
  {
285
  for (i=0;i<total/interval;i++)
287
  if ((maxpos-i*interval) >= 0) canvasContainer.append('<div class="legend" style="position:absolute;left:-10px;top:'+(parseInt((i*interval+interval/2)*h-5))+'px">'+(maxpos-i*interval)+'</div>');
288
  ctx.beginPath();
289
  ctx.moveTo(start,Math.round((i*interval+interval/2)*h) );
290
+ ctx.lineTo(width,Math.round((i*interval+interval/2)*h) );
291
+ ctx.lineWidth=1;
292
+ ctx.strokeStyle='#d0d0d0';
293
  ctx.stroke();
294
  }
295
  jQuery.each(data,function(index,v){
296
  ctx.beginPath();
297
  ctx.strokeStyle = v.color;
298
  ctx.fillStyle = v.color;
299
+
300
  //ctx.moveTo(start,Math.round((maxpos+interval/2)*h) );
301
  var i = 0,j = 0;
302
  jQuery.each(v.values,function(index1,v1){
303
+ j=-v1;
304
+ if (i!=0)
305
+ ctx.lineTo(i*w+start,Math.round((maxpos+interval/2)*h+j*h));
306
  else
307
+ ctx.moveTo(i*w+start,Math.round((maxpos+interval/2)*h+j*h));
308
+ i++;
309
  });
310
+
311
  ctx.stroke();
312
  var i = 0,j = 0;
313
  jQuery.each(v.values,function(index1,v1){
314
+ j=-v1;
315
  ctx.beginPath();
316
+ ctx.arc(i*w+start,Math.round((maxpos+interval/2)*h+j*h), radius, 0, 2 * Math.PI, true);
317
+ ctx.fill();
318
+ i++;
319
  });
320
  });
321
  }
322
  }
323
+ });
324
+
325
+ ////////////////////////end canvas///////////////////////
326
+
327
+ </script>
328
 
329
 
330
 
cp-main-class.inc.php CHANGED
@@ -469,6 +469,7 @@ class CP_ContactFormToEmail extends CP_CFTEMAIL_BaseClass {
469
  wp_enqueue_script( $this->prefix.'_builder_script', plugins_url('/js/fbuilderf.jquery.js', __FILE__),array("jquery","jquery-ui-core","jquery-ui-sortable","jquery-ui-tabs","jquery-ui-droppable","jquery-ui-button","query-stringify","jquery-ui-datepicker") );
470
  wp_enqueue_style('cfte-adminstyles', plugins_url('css/style.css', __FILE__) );
471
  wp_enqueue_style('cfte-admincalendarstyles', plugins_url('css/cupertino/jquery-ui-1.8.20.custom.css', __FILE__) );
 
472
  //wp_enqueue_style('jquery-style', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css');
473
  if ($this->get_param("report") == '1')
474
  wp_enqueue_script( $this->prefix.'_excanvas', plugins_url('/js/excanvas.min.js', __FILE__));
469
  wp_enqueue_script( $this->prefix.'_builder_script', plugins_url('/js/fbuilderf.jquery.js', __FILE__),array("jquery","jquery-ui-core","jquery-ui-sortable","jquery-ui-tabs","jquery-ui-droppable","jquery-ui-button","query-stringify","jquery-ui-datepicker") );
470
  wp_enqueue_style('cfte-adminstyles', plugins_url('css/style.css', __FILE__) );
471
  wp_enqueue_style('cfte-admincalendarstyles', plugins_url('css/cupertino/jquery-ui-1.8.20.custom.css', __FILE__) );
472
+ wp_enqueue_style('cfte-newadminstyle', plugins_url('/css/newadminlayout.css', __FILE__));
473
  //wp_enqueue_style('jquery-style', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css');
474
  if ($this->get_param("report") == '1')
475
  wp_enqueue_script( $this->prefix.'_excanvas', plugins_url('/js/excanvas.min.js', __FILE__));
css/newadminlayout.css ADDED
@@ -0,0 +1,231 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .width60{width:57%}
2
+
3
+ /* main - lists page */
4
+ .clear{clear:both;}
5
+ label {font-weight:600;}
6
+ .ahb-new-calendar{width:50%;}
7
+ .ahb-section-container {
8
+ border: 1px solid #e6e6e6;
9
+ padding: 20px;
10
+ border-radius: 3px;
11
+ -webkit-box-flex: 1;
12
+ flex: 1;
13
+ margin: 1em 1em 1em 0;
14
+ min-width: 200px;
15
+ background: white;
16
+ position:relative;
17
+ }
18
+ .ahb-section{}
19
+ .ahb-section label{font-weight:600;}
20
+
21
+ .ahb-calendars-list{border-collapse: collapse;}
22
+ .ahb-calendars-list thead tr,
23
+ .ahb-calendars-list tbody tr:not(:last-child){border-bottom:1px solid #efefef;}
24
+
25
+ .ahb-calendars-list td .button{margin-right:5px;}
26
+ .ahb-calendars-list td .button:last-child{margin-right:0;}
27
+
28
+ .ahb-mssg{margin-left:0 !important; display:none;}
29
+
30
+ @media screen and (max-width: 710px)
31
+ {
32
+ table, thead, tbody, th, td, tr {
33
+ display: block;
34
+ width:100%;
35
+ text-align:left;
36
+ }
37
+ .ahb-calendars-list thead,
38
+ .ahb-calendars-list th{display:none}
39
+ .ahb-calendars-list td .button{width:48%; margin:5px 0;}
40
+ .ahb-calendars-list td .button:nth-child(3),
41
+ .ahb-calendars-list td .button:nth-child(5){float:right;}
42
+ .ahb-calendars-list td .button:nth-child(1),
43
+ .ahb-calendars-list td .button:nth-child(6),
44
+ .ahb-calendars-list td .button:nth-child(7),
45
+ .ahb-calendars-list td .button:nth-child(8){display:none;}
46
+ .ahb-new-calendar,
47
+ .ahb-calendars-list input[type="text"]{width:100%;}
48
+ }
49
+
50
+
51
+ /* stats - reports page */
52
+
53
+ .ahb-statssection-container {
54
+ border: 1px solid #e6e6e6;
55
+ padding:0px;
56
+ border-radius: 3px;
57
+ -webkit-box-flex: 1;
58
+ flex: 1;
59
+ margin: 1em 1em 1em 0;
60
+ min-width: 200px;
61
+ background: #ffffff;
62
+ position:relative;
63
+ }
64
+ .ahb-buttons-container{margin:1em 1em 1em 0;}
65
+ .ahb-return-link{float:right;}
66
+
67
+ .ahb-statssection{padding:20px;}
68
+ .ahb-statssection-header{
69
+ background:white;
70
+ padding:10px 20px;
71
+ -webkit-box-shadow: 0px 2px 2px 0px rgba(100, 100, 100, 0.1);
72
+ -moz-box-shadow: 0px 2px 2px 0px rgba(100, 100, 100, 0.1);
73
+ box-shadow: 0px 2px 2px 0px rgba(100, 100, 100, 0.1);
74
+ }
75
+
76
+ @media screen and (max-width: 710px)
77
+ {
78
+ .ahb-statssection-container{width:100% !important;}
79
+ }
80
+
81
+ /* booking orders page */
82
+
83
+ .ahb-orderssection-container {
84
+ border: 1px solid #e6e6e6;
85
+ padding:0;
86
+ border-radius: 3px;
87
+ -webkit-box-flex: 1;
88
+ flex: 1;
89
+ margin: 1em 1em 1em 0;
90
+ min-width: 200px;
91
+ background: #ffffff;
92
+ position:relative;
93
+ }
94
+
95
+ .ahb-orders-list{border-collapse: collapse;}
96
+ .ahb-orders-list tbody tr:not(:last-child){border-bottom:2px solid #ffffff;}
97
+
98
+ .ahb-orders-list td .button{margin-right:5px;float:none;}
99
+ .ahb-orders-list td .button:last-child{margin-right:0;}
100
+
101
+ .ahb-orders-list thead{
102
+ background:white;
103
+ padding:10px 20px;
104
+ -webkit-box-shadow: 0px 2px 2px 0px rgba(100, 100, 100, 0.1);
105
+ -moz-box-shadow: 0px 2px 2px 0px rgba(100, 100, 100, 0.1);
106
+ box-shadow: 0px 2px 2px 0px rgba(100, 100, 100, 0.1);
107
+ }
108
+
109
+
110
+ /* admin int */
111
+ #dex_printable_contents,
112
+ .ahb-adintsection-container {
113
+ border: 1px solid #e6e6e6;
114
+ padding:0px;
115
+ border-radius: 3px;
116
+ -webkit-box-flex: 1;
117
+ flex: 1;
118
+ margin: 1em 1em 1em 0;
119
+ min-width: 200px;
120
+ background: #f6f6f6;
121
+ position:relative;
122
+ }
123
+ .ahb-adintsection{padding:20px;display:none;}
124
+ .ahb-adintsection label{font-weight:600;}
125
+ .ahb-adintsection-active{display:block;}
126
+ .ahb-breadcrumb{
127
+ background:white;
128
+ padding:10px 20px;
129
+ -webkit-box-shadow: 0px 2px 2px 0px rgba(100, 100, 100, 0.1);
130
+ -moz-box-shadow: 0px 2px 2px 0px rgba(100, 100, 100, 0.1);
131
+ box-shadow: 0px 2px 2px 0px rgba(100, 100, 100, 0.1);
132
+ }
133
+ .ahb-step{display:inline-block; cursor:pointer;}
134
+ .ahb-step:not(:last-child){margin-right:50px;}
135
+ .ahb-step *{
136
+ color:#8c8c8c;
137
+ line-height:28px;
138
+ font-weight:600;
139
+ font-style:normal;
140
+ text-decoration:none;
141
+ }
142
+ .ahb-step i{
143
+ display:inline-block;
144
+ width: 28px;
145
+ height: 28px;
146
+ background:#e2e2e2;
147
+ border-radius:20px;
148
+ text-align:center;
149
+ }
150
+ .ahb-step:hover i,
151
+ .ahb-step.ahb-step-active i{background:#006799;color:#ffffff;}
152
+ .ahb-step:hover label,
153
+ .ahb-step.ahb-step-active label{color:#006799;}
154
+
155
+ .form-builder{
156
+ width: 100% !important;
157
+ background: white !important;
158
+ border-radius: 6px !important;
159
+ border: 1px solid #e6e6e6 !important;
160
+ height:620px !important;
161
+ }
162
+
163
+ .form-builder #tabs{
164
+ height:615px !important;
165
+ border-right: 1px solid #e6e6e6;
166
+ border-left:0;
167
+ border-top:0;
168
+ border-bottom:0;
169
+ }
170
+
171
+ .working_dates input[type='checkbox'] { width: auto !important; margin-left: 10px; }
172
+ #sWD0 { margin-left: 0px; }
173
+
174
+ #dex_printable_contents{overflow:auto;}
175
+ .cpapp_no_wrap{
176
+ width: 100%;
177
+ display:flex;
178
+ border-bottom:1px solid #e6e6e6;
179
+ }
180
+ .cpapp_no_wrap:first-child,
181
+ .cpapp_no_wrap:last-child{
182
+ border-bottom:0;
183
+ }
184
+ .cpappb_field_0,
185
+ .cpappb_field_1,
186
+ .cpappb_field_2,
187
+ .cpappb_field_3,
188
+ .cpappb_field_4,
189
+ .cpappb_field_5,
190
+ .cpappb_field_6,
191
+ .cpappb_field_7,
192
+ .cpappb_field_8,
193
+ .cpappb_field_9,
194
+ .cpappb_field_10,
195
+ .cpappb_field_11{
196
+ flex-grow:1;
197
+ margin:0;
198
+ padding:10px 0 10px 10px;
199
+ border-bottom:0;
200
+ }
201
+ .cpappb_field_header{
202
+ background:white;
203
+ border-bottom:0;
204
+ -webkit-box-shadow: 0px 2px 2px 0px rgba(100, 100, 100, 0.1);
205
+ -moz-box-shadow: 0px 2px 2px 0px rgba(100, 100, 100, 0.1);
206
+ box-shadow: 0px 2px 2px 0px rgba(100, 100, 100, 0.1);
207
+ }
208
+
209
+ .ahb-statssection{
210
+ text-align:center;
211
+ }
212
+ .ahb-statssection .canvas{
213
+ margin-left: auto !important;
214
+ margin-right: auto !important;
215
+ width: 310px;
216
+ }
217
+ .ahb-statssection #dex_printable_contents{
218
+ border: 0;
219
+ text-align:left;
220
+ overflow:unset;
221
+ }
222
+
223
+ .button.n{pointer-events: none !important;}
224
+ /*
225
+ #facceptance{
226
+ background: url("cupertino/images/ui-bg_glass_80_eebd4dc_1x400.png") repeat-x scroll 50% 50% #619218;
227
+ border: 1px solid #619218;
228
+ color: #25530F;
229
+ }
230
+ #facceptance span{padding-left: 0; padding-right:0;}
231
+ */
form-to-email.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Contact Form Email
4
  Plugin URI: https://form2email.dwbooster.com/download
5
  Description: Contact form that sends the data to email and also to a database list and CSV file.
6
- Version: 1.2.60
7
  Author: CodePeople
8
  Author URI: https://form2email.dwbooster.com
9
  Text Domain: contact-form-to-email
3
  Plugin Name: Contact Form Email
4
  Plugin URI: https://form2email.dwbooster.com/download
5
  Description: Contact form that sends the data to email and also to a database list and CSV file.
6
+ Version: 1.2.61
7
  Author: CodePeople
8
  Author URI: https://form2email.dwbooster.com
9
  Text Domain: contact-form-to-email