From: <rc...@us...> - 2016-05-08 15:59:09
|
Revision: 7512 http://sourceforge.net/p/web-erp/reponame/7512 Author: rchacon Date: 2016-05-08 15:59:07 +0000 (Sun, 08 May 2016) Log Message: ----------- Clean up code. Modified Paths: -------------- trunk/includes/Login.php trunk/reportwriter/WriteReport.inc Modified: trunk/includes/Login.php =================================================================== --- trunk/includes/Login.php 2016-05-07 22:48:34 UTC (rev 7511) +++ trunk/includes/Login.php 2016-05-08 15:59:07 UTC (rev 7512) @@ -1,16 +1,15 @@ <?php /* $Id$*/ +// Display demo user name and password within login form if $AllowDemoMode is true -// Display demo user name and password within login form if $AllowDemoMode is true //include ('LanguageSetup.php'); if ((isset($AllowDemoMode)) AND ($AllowDemoMode == True) AND (!isset($demo_text))) { $demo_text = _('Login as user') .': <i>' . _('admin') . '</i><br />' ._('with password') . ': <i>' . _('weberp') . '</i>'; } elseif (!isset($demo_text)) { $demo_text = ''; } -echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'; ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>webERP Login screen</title> @@ -19,8 +18,8 @@ <link rel="stylesheet" href="css/<?php echo $Theme;?>/login.css" type="text/css" /> </head> <body> +<?php -<?php if (get_magic_quotes_gpc()){ echo '<p style="background:white">'; echo _('Your webserver is configured to enable Magic Quotes. This may cause problems if you use punctuation (such as quotes) when doing data entry. You should contact your webmaster to disable Magic Quotes'); @@ -28,7 +27,6 @@ } ?> - <div id="container"> <div id="login_logo"></div> <div id="login_box"> @@ -36,7 +34,8 @@ <div> <input type="hidden" name="FormID" value="<?php echo $_SESSION['FormID']; ?>" /> <span> - <?php +<?php + if (isset($CompanyList) AND is_array($CompanyList)) { foreach ($CompanyList as $key => $CompanyEntry){ if ($DefaultDatabase == $CompanyEntry['database']) { @@ -91,7 +90,8 @@ echo '</select>'; } } //end provision for backward compat - ?> + +?> </span> <br /> <span><?php echo _('User name'); ?>:</span><br /> @@ -99,11 +99,13 @@ <span><?php echo _('Password'); ?>:</span><br /> <input type="password" required="required" name="Password" placeholder="<?php echo _('Password'); ?>" /><br /> <div id="demo_text"> - <?php +<?php + if (isset($demo_text)){ echo $demo_text; } - ?> + +?> </div> <input class="button" type="submit" value="<?php echo _('Login'); ?>" name="SubmitUser" /> </div> Modified: trunk/reportwriter/WriteReport.inc =================================================================== --- trunk/reportwriter/WriteReport.inc 2016-05-07 22:48:34 UTC (rev 7511) +++ trunk/reportwriter/WriteReport.inc 2016-05-08 15:59:07 UTC (rev 7512) @@ -301,20 +301,11 @@ // fetch date filter info $df = $Prefs['DateListings']['fieldname']; $Today = date('Y-m-d', time()); - $ThisDay = mb_substr($Today,8,2); - $ThisMonth = mb_substr($Today,5,2); - $ThisYear = mb_substr($Today,0,4); - // find total number of days in this month -/* if ($ThisMonth == '04' or $ThisMonth == '06' or $ThisMonth == '09' or $ThisMonth == '11') { - $TotalDays=30; - } elseif ($ThisMonth=='02' AND date('L', $t)) { // Leap year - $TotalDays=29; - } elseif ($ThisMonth==02 AND !date('L', $t)) { - $TotalDays=28; - } else { - $TotalDays=31; - }//********** To replace. */ - $TotalDays = cal_days_in_month(CAL_GREGORIAN, $ThisMonth, $ThisYear);//********** To test ! + $ThisDay = date('d'); + $ThisMonth = date('m'); + $ThisYear = date('Y'); + // Find total number of days in this month: + $TotalDays = cal_days_in_month(CAL_GREGORIAN, $ThisMonth, $ThisYear); // Calculate date range $DateArray=explode(':',$Prefs['DateListings']['params']); switch ($DateArray[0]) { // based on the date choice selected |