Tessa
Member
Hi!
I have a List that I need to add a functionality to update a fields value if a condition is met.
Here is the screenshot:
http://awesomescreenshot.com/04b38azj3e
That "Days Pending" column is created from this script within the custom default_row.php:
I need to find a way to take this script from the default_row and calculate when a record is 14 days or older to automatically change an approval from " " to "Yes".
May I get a little guidance on how to do an UPDATE query in a form php script?
Pseudo Script:
If created date is greater than 14 days (pending) and approval == "", then UPDATE approval == "Yes"
I have a List that I need to add a functionality to update a fields value if a condition is met.
Here is the screenshot:
http://awesomescreenshot.com/04b38azj3e
That "Days Pending" column is created from this script within the custom default_row.php:
Code:
if ($heading == 'tblecn___pending') { // Days Pending: Days Open Since Date Initiated NOW() - $date_iniated = Pending Date
//now!
$now = time();
// Pull the Date Initiated, which doesn't change after ECN is edited
$date_initiated = $val[0]->date_time;
// Turn the variable for date into a date string
$date_initiated = strtotime($date_initiated);
// Create a variable to show the difference between the two
$datediff = abs($now - $date_initiated);
// Show how many days the ECN has been up!
echo floor($datediff/(60*60*24)) . ' Days';
}
I need to find a way to take this script from the default_row and calculate when a record is 14 days or older to automatically change an approval from " " to "Yes".
May I get a little guidance on how to do an UPDATE query in a form php script?
Pseudo Script:
If created date is greater than 14 days (pending) and approval == "", then UPDATE approval == "Yes"