The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Calculating time Difference with Submission Pre-Parser - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Modules / Other (https://forums.formtools.org/forumdisplay.php?fid=8)
+--- Forum: Modules (https://forums.formtools.org/forumdisplay.php?fid=16)
+--- Thread: Calculating time Difference with Submission Pre-Parser (/showthread.php?tid=27460)



Calculating time Difference with Submission Pre-Parser - ramonbps - Aug 25th, 2017

So i been trying to get this going calculating time difference of my for form.

Below is my code.

if (isset($_POST["checkin"]) && $_POST["checkout"]) {
$tcheckin = $_post['checkin']; $tcheckout = $_post['checkout'];
 $tdiff = date_diff("$tcheckin","$tcheckout")->format("%H:%I:%S");
$_POST["inandout"]=["$tdiff"];
exit;

I am not sure what i am doing wrong.


RE: Calculating time Difference with Submission Pre-Parser - ramonbps - Aug 28th, 2017

(Aug 25th, 2017, 11:10 AM)ramonbps Wrote: So i been trying to get this going calculating time difference of my for form.

Below is my code.

if (isset($_POST["checkin"]) && $_POST["checkout"]) {
$tcheckin = $_post['checkin']; $tcheckout = $_post['checkout'];
 $tdiff = date_diff("$tcheckin","$tcheckout")->format("%H:%I:%S");
$_POST["inandout"]=["$tdiff"];
exit;

I am not sure what i am doing wrong.

 this is my actually code[Image: 6rLM05J]

PHP Code:
$tcheckin=$_POST["checkin"];
$tcheckout=$_POST["checkout"];
$tdiff date_diff($tcheckin,$tcheckout)->format("%H:%I:%S");
$_POST["inandout"]=["$tdiff"];

When i remove ->format("%H:%i:%s"the blank page goes away
[Image: Kv8OT]
[Image: Kv8OT][Image: 6rLM05J]Attach is the blank page i get.


RE: Calculating time Difference with Submission Pre-Parser - nelsondcosta - Aug 30th, 2017

Im trying something like that... but I fail like the new Death Note movie :S


RE: Calculating time Difference with Submission Pre-Parser - ramonbps - Aug 30th, 2017

What have you tried maybe we can, come with a solution.


RE: Calculating time Difference with Submission Pre-Parser - ramonbps - Sep 11th, 2017

So i got it working, this is what i did below. I hope this helps!.

PHP Code:
// Set Time Zone
date_default_timezone_set('America/Los_Angeles');
//Get Checkin
$tcheckin $_POST["checkin"];
//Get Checkout
$tcheckout $_POST["checkout"];
//Create Time Variable from checkin
$dteStart = new DateTime($tcheckin);
//Create Time Variable from checkout
$dteEnd   = new DateTime($tcheckout);
// Calculate Time Difference
$dteDiff  $dteStart->diff($dteEnd);
//Format Time
$ttdiff $dteDiff->format("%H:%I");
//Insert Time Differance to Total
$_POST["inandout"]=["$ttdiff"];