From: <ex...@us...> - 2014-11-03 02:30:27
|
Revision: 6957 http://sourceforge.net/p/web-erp/reponame/6957 Author: exsonqu Date: 2014-11-03 02:30:16 +0000 (Mon, 03 Nov 2014) Log Message: ----------- 3/11/14 Exson: Make Dashboard.php workable in php which version is lower than 5.3. Report by Craig Craven. Modified Paths: -------------- trunk/Dashboard.php Modified: trunk/Dashboard.php =================================================================== --- trunk/Dashboard.php 2014-11-02 01:56:43 UTC (rev 6956) +++ trunk/Dashboard.php 2014-11-03 02:30:16 UTC (rev 6957) @@ -273,15 +273,29 @@ if ($DetailTrans['daysbeforedue'] > 0) { $AddDays=$DetailTrans['daysbeforedue'] . ' days'; - $DisplayDueDate = date_add(date_create($DetailTrans['trandate']), date_interval_create_from_date_string($AddDays)); + if (function_exists(date_add)) { + $DisplayDueDate = date_add(date_create($DetailTrans['trandate']), date_interval_create_from_date_string($AddDays)); + } else { + $DisplayDueDate = strtotime($AddDays,strtotime($DetailTrans['trandate'])); + } + } else { $AddDays=(intval($DetailTrans['dayinfollowingmonth']) - 1) . ' days'; - $DisplayDueDate= date_create($DetailTrans['trandate']); - $DisplayDueDate->modify('first day of next month'); - $DisplayDueDate=date_add($DisplayDueDate, date_interval_create_from_date_string($AddDays)); + if (function_exists(date_add)){ + $DisplayDueDate = date_create($DetailTrans['trandate']); + $DisplayDueDate->modify('first day of next month'); + $DisplayDueDate = date_add($DisplayDueDate, date_interval_create_from_date_string($AddDays)); + } else { + $DisplayDueDate = strtotime('first day of next month',strtotime($DetailTrans['trandate'])); + $DisplayDueDate = strtotime($DisplayDueDate,strtotime($AddDays)); + } } - $DisplayDueDate=date_format($DisplayDueDate,$_SESSION['DefaultDateFormat']); + if (function_exists(date_add)) { + $DisplayDueDate=date_format($DisplayDueDate,$_SESSION['DefaultDateFormat']); + } else { + $DisplayDueDate = Date($_SESSION['DefaultDateFormat'],$DisplayDueDate); + } if ($k==1){ echo '<tr class="EvenTableRows">'; $k=0; @@ -735,4 +749,4 @@ } //rows > 0 } //OrderSecurity include('includes/footer.inc'); -?> \ No newline at end of file +?> |