navigation  interaction  search

 other resources

Changeset 191

Show
Ignore:
Timestamp:
02/22/07 10:44:47
Author:
brieb
Message:

Implemented #46. Started coding for #46. Fixed several SQL install errors with invoices, tabledefs, and invoicestatuses.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/phpbms/common/javascript/common.js

    r146 r191  
    215215} 
    216216 
     217/* DATE AND TIME --------------------------------------------------------------- */ 
     218/* ----------------------------------------------------------------------------- */ 
     219function stringToDate(sDate,format){ 
     220        if (!format) format=DATE_FORMAT; 
     221        var thedate=""; 
     222 
     223        if(sDate){ 
     224                var sep; 
     225                var month; 
     226                var day; 
     227                var year; 
     228                switch(format){ 
     229                        case "SQL": 
     230                                sep="-"; 
     231                                year=parseInt(sDate.substring(0,sDate.indexOf(sep)),10); 
     232                                month=parseInt(sDate.substring(sDate.indexOf(sep)+1,sDate.indexOf(sep,sDate.indexOf(sep)+1)),10)-1; 
     233                                day=parseInt(sDate.substring(sDate.lastIndexOf(sep)+1),10); 
     234                        break; 
     235                        case "English, US": 
     236                                sep="/"; 
     237                                month=parseInt(sDate.substring(0,sDate.indexOf(sep)),10)-1; 
     238                                day=parseInt(sDate.substring(sDate.indexOf(sep)+1,sDate.indexOf(sep,sDate.indexOf(sep)+1)),10); 
     239                                year=parseInt(sDate.substring(sDate.lastIndexOf(sep)+1),10); 
     240                                if(year<100) year+=2000; 
     241                        break; 
     242                } 
     243                thedate=new Date(year,month,day); 
     244        } 
     245        return thedate 
     246} 
     247 
     248 
     249function dateToString(thedate,format){ 
     250        if(!format) format=DATE_FORMAT; 
     251        var sdate=""; 
     252         
     253        if(thedate){ 
     254                var sep; 
     255                switch(format){ 
     256                        case "SQL": 
     257                                sep="-"; 
     258                                sdate= thedate.getFullYear()+sep+(thedate.getMonth()+1)+sep+thedate.getDate(); 
     259                        break; 
     260                         
     261                        case "English, US": 
     262                                sep="/"; 
     263                                sdate= (thedate.getMonth()+1)+sep+thedate.getDate()+sep+thedate.getFullYear(); 
     264                        break; 
     265                } 
     266        } 
     267        return sdate; 
     268} 
     269 
     270function stringToTime(sTime,format){ 
     271        if(!format) format=TIME_FORMAT; 
     272        var thetime=""; 
     273        if(sTime){ 
     274                var timeArray; 
     275                switch(format){ 
     276                        case "24 Hour": 
     277                                timeArray=sTime.split(":"); 
     278                                if(timeArray.length=3) 
     279                                        thetime=new Date(0,0,0,parseInt(timeArray[0],10),parseInt(timeArray[1],10),parseInt(timeArray[2],10)); 
     280                        break; 
     281                         
     282                        case "12 Hour": 
     283                                timeadd=0; 
     284                                if(sTime.indexOf(" PM")) 
     285                                        timeadd=12; 
     286                                sTime=sTime.replace(/ AM/,""); 
     287                                sTime=sTime.replace(/ PM/,""); 
     288                                timeArray=sTime.split(":"); 
     289                                if(timeArray.length=2){ 
     290                                        var hour=parseInt(timeArray[0],10); 
     291                                        if (hour!=12) 
     292                                                hour=hour+timeadd; 
     293                                                thetime=new Date(0,0,0,hour,parseInt(timeArray[1],10));                                          
     294                                } 
     295                        break; 
     296                } 
     297        } 
     298        return thetime; 
     299} 
     300 
     301function timeToString(thetime,format){ 
     302        sTime=""; 
     303        if(!format) format=TIME_FORMAT; 
     304        if(thetime){ 
     305                var hours=thetime.getHours(); 
     306                var minutes=thetime.getMinutes(); 
     307                var seconds=thetime.getSeconds(); 
     308                var sep=":" 
     309                switch(format){ 
     310                        case "24 Hour": 
     311                                if(hours<10) hours="0"+hours; 
     312                                if(minutes<10) minutes="0"+minutes; 
     313                                if(seconds<10) seconds="0"+seconds; 
     314                                sTime=hours+sep+minutes+sep+seconds; 
     315                        break; 
     316                         
     317                        case "12 Hour": 
     318                                var ampm=" AM"; 
     319                                if(hours>12) 
     320                                        hours=hours-12; 
     321                                if(hours>11) 
     322                                        ampm=" PM"; 
     323                                if (hours=0) hours=12; 
     324                                if(minutes<10) minutes="0"+minutes;                              
     325                                sTime=hours+sep+minutes+ampm; 
     326                        break; 
     327                } 
     328        } 
     329        return sTime; 
     330} 
     331 
     332/* MODAL ----------------------------------------------------------------------- */ 
    217333/* ----------------------------------------------------------------------------- */ 
    218334 
  • trunk/phpbms/common/javascript/datepicker.js

    r145 r191  
    116116} 
    117117 
    118 function stringToDate(sDate){ 
    119         var sep="/"; 
    120         var month=sDate.substring(0,sDate.indexOf(sep)) 
    121         var day=sDate.substring(sDate.indexOf(sep)+1,sDate.indexOf(sep,sDate.indexOf(sep)+1)) 
    122         var year=sDate.substring(sDate.lastIndexOf(sep)+1); 
    123         year=parseInt(year,10); 
    124         if(year<100) year+=2000; 
    125         return new Date(year,parseInt(month,10)-1,parseInt(day,10)); 
    126 } 
    127  
    128 function mysqlstringToDate(sDate){ 
    129         var sep="-"; 
    130         var year=sDate.substring(0,sDate.indexOf(sep)) 
    131         var month=sDate.substring(sDate.indexOf(sep)+1,sDate.indexOf(sep,sDate.indexOf(sep)+1)) 
    132         var day=sDate.substring(sDate.lastIndexOf(sep)+1); 
    133          
    134         return Date(year,month,day); 
    135 } 
    136  
    137 function dateToString(thedate){ 
    138         var sep="/"; 
    139         return (thedate.getMonth()+1)+sep+thedate.getDate()+sep+thedate.getFullYear(); 
    140 } 
    141118 
    142119function formatDateField(thefield){ 
    143         if(validateDate(thefield.value)){ 
    144                 thefield.value=thefield.value.replace(/\-/g,"/"); 
    145                 var thedate=stringToDate(thefield.value); 
    146                 thefield.value=dateToString(thedate); 
    147         } else 
    148         thefield.value=""; 
     120        thefield.value=dateToString(stringToDate(thefield.value)); 
    149121} 
  • trunk/phpbms/common/javascript/fields.js

    r186 r191  
    148148//validate a time (12 hour) 
    149149function validateTime(strValue){ 
    150         var objRegExp= /^([1-9]|1[0-2]|0[1-9]){1}(:[0-5][0-9]\ [aApP][mM]){1}$/; 
    151         if(!objRegExp.test(strValue)) 
    152                 return false; 
    153         else 
    154                 return true; 
     150        return (strValue == timeToString(stringToTime(strValue))) 
    155151} 
    156152 
    157153// validate dates 
    158154function validateDate(strValue) { 
    159   var objRegExp = /^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{2,4}$/ 
    160  
    161   //check to see if in correct format 
    162   if(!objRegExp.test(strValue)) 
    163     return false; //doesn't match pattern, bad date 
    164   else{ 
    165    
    166         for (var i=1;i<strValue.length;i++){ 
    167                 if (strValue.charAt(i)=="." || strValue.charAt(i)=="/" || strValue.charAt(i)=="-"){ 
    168                     var strSeparator = strValue.substring(i,i+1) //find date separator 
    169                         break; 
    170                 } 
    171         } 
    172     var arrayDate = strValue.split(strSeparator); //split date into month, day, year 
    173     //create a lookup for months not equal to Feb. 
    174     var arrayLookup = { 1 : 31, 3 : 31, 4 : 30, 5 : 31, 6 : 30, 7 : 31, 
    175                         8 : 31, 9 : 30, 10 : 31, 11 : 30, 12 : 31} 
    176     var intDay = parseInt(arrayDate[1],10); 
    177     //check if month value and day value agree 
    178     var intMonth = parseInt(arrayDate[0],10); 
    179     if(arrayLookup[intMonth] != null) {    
    180       if(intDay <= arrayLookup[intMonth] && intDay != 0) 
    181         return true; //found in lookup table, good date 
    182     } 
    183  
    184     //check for February 
    185     var intYear = parseInt(arrayDate[2],10); 
    186         if (intYear <1000) intYear=intYear+2000; 
    187     if( ((intYear % 4 == 0 && intDay <= 29) || (intYear % 4 != 0 && intDay <=28)) && intDay !=0 && intMonth==2) 
    188       return true; //Feb. had valid number of days 
    189   } 
    190   return false; //any other values, bad date 
     155  return (strValue == dateToString(stringToDate(strValue))); 
    191156} 
    192157 
  • trunk/phpbms/common/javascript/timepicker.js

    r145 r191  
    9393function tpClickHour(hour){ 
    9494        var timeField=getObjectFromID(showTP.timeField); 
    95         var ampm; 
    96         if(!validateTime(timeField.value)) timeField.value="12:00 AM"; 
    9795         
    98         var minutes=timeField.value.substr(timeField.value.indexOf(":")+1,2) 
    99          
    100         if(hour>11) {ampm=" PM"; hour=hour-12}else ampm=" AM"; 
    101         if (hour==0) hour=12; 
    102          
    103         timeField.value=hour+":"+minutes+ampm; 
     96        var thetime=stringToTime(timeField.value); 
     97        thetime.setHours(hour); 
     98        timeField.value=timeToString(thetime); 
     99 
    104100        if(timeField.onchange) timeField.onchange(); 
    105101} 
    106102function tpClickMinute(thetd){ 
    107         var minutes=thetd.innerHTML
     103        var minutes=parseInt(thetd.innerHTML.replace(/:/,""))
    108104        var timeField=getObjectFromID(showTP.timeField); 
    109         if(!validateTime(timeField.value)) timeField.value="12:00 AM"; 
    110  
    111         var hours=timeField.value.substring(0,timeField.value.indexOf(":")); 
    112         var ampm=timeField.value.substr(timeField.value.indexOf(" ")); 
    113         timeField.value=hours+minutes+ampm; 
     105         
     106        var thetime=stringToTime(timeField.value); 
     107        thetime.setMinutes(minutes); 
     108        timeField.value=timeToString(thetime); 
     109         
    114110        if(timeField.onchange) timeField.onchange(); 
    115111        closeTPBox(); 
  • trunk/phpbms/common/stylesheet/mozilla/base.css

    r145 r191  
    2525#footerAbout{float:left;} 
    2626#footerTop{float:right;} 
    27  
    28  
    29 /* ============================================================================== */ 
    30 /* Query Results                                                                  */ 
    31 /* ============================================================================== */ 
    3227 
    3328/* ============================================================================== */ 
  • trunk/phpbms/common/stylesheet/mozilla/boxes.css

    r145 r191  
    1414.bodyline{ 
    1515        clear:both; 
    16         border-color:#ABB1B1; 
     16        border-color:#CAD1D1; 
    1717        border-style:solid; 
    1818        -moz-border-radius:0; 
     
    2121 
    2222FIELDSET,.box{ 
    23         border-color:#74879C
     23        border-color:#ACB7C4
    2424        border-width:1px; 
    2525        border-style:solid; 
     
    3030.box{ 
    3131        background-color:#EFF9F9; 
    32         border:1px solid #999999;      
     32        border:1px solid #CCCCCC;      
    3333} 
  • trunk/phpbms/common/stylesheet/mozilla/sizes.css

    r165 r191  
    2020H1 { 
    2121        font-family: Arial, Helvitica, sans-serif; 
    22         border-bottom: 1px solid #ccc; 
    2322        font-size:20px; 
    2423        margin:3px; 
    2524        padding-left:24px; 
    26         margin-bottom:8px; 
     25        margin-bottom:9px; 
    2726        font-weight:normal; 
    2827        background: url("image/h1graphic.png") 4px 4px no-repeat;; 
  • trunk/phpbms/datepicker.php

    r146 r191  
    4747                $todayArray=getdate($today); 
    4848                if($selectedDate!="0000-00-00"){ 
    49                         $selDate=dateFromSQLDate($selectedDate); 
     49                        $selDate=stringToDate($selectedDate,"SQL"); 
    5050                        $tempDate=getdate($selDate); 
    5151                        $displayLongDate=$tempDate["month"]." ".$tempDate["mday"].", ".$tempDate["year"]; 
  • trunk/phpbms/include/common_functions.php

    r184 r191  
    130130} 
    131131 
    132 // This Function prepares a date for insertion/updaing into a SQL statement 
     132 
     133// date/time functions 
    133134// It will add the quotes for you. 
    134135//===================================================================== 
    135 function formatToSQLDate($thedate,$allownull=true){ 
    136         if($thedate=="" || $thedate=="0/0/0000"){ 
    137                 if ($allownull) 
    138                         $tempdate="NULL"; 
     136define("DATE_FORMAT",$_SESSION["date_format"]); 
     137define("TIME_FORMAT",$_SESSION["time_format"]); 
     138 
     139function stringToDate($datestring,$format=DATE_FORMAT){ 
     140        $thedate=NULL; 
     141        if($datestring){ 
     142                switch($format){ 
     143 
     144                        case "SQL": 
     145                                $temparray=explode("-",$datestring); 
     146                                if(count($temparray)>1) 
     147                                        $thedate=mktime(0,0,0,(int) $temparray[1],(int) $temparray[2],(int) $temparray[0]); 
     148                        break; 
     149 
     150                        case "English, US": 
     151                                $datestring="/".ereg_replace(",.","/",$datestring); 
     152                                $temparray=explode("/",$datestring); 
     153                                if(count($temparray)>1) 
     154                                        $thedate=mktime(0,0,0,(int) $temparray[1],(int) $temparray[2],(int) $temparray[3]); 
     155                        break; 
     156 
     157                } 
     158        } 
     159        return $thedate; 
     160
     161 
     162function stringToTime($timestring,$format=TIME_FORMAT){ 
     163        $thetime=NULL; 
     164        if($timestring){ 
     165                switch($format){ 
     166 
     167                        case "24 Hour": 
     168                                $temparray=explode(":",$timestring); 
     169                                if(count($temparray)>1) 
     170                                        $thetime=mktime($temparray[0],$temparray[1],$temparray[2]); 
     171                        break; 
     172 
     173                        case "12 Hour": 
     174                                if(strpos($timestring,"AM")!==false){ 
     175                                        $timestring=str_replace(" AM","",$timestring); 
     176                                        $addtime=0; 
     177                                } 
     178                                else { 
     179                                        $timestring=str_replace(" PM","",$timestring); 
     180                                        $addtime=12; 
     181                                } 
     182                                $timearray=explode(":",$timestring); 
     183                                if($timearray[0]!="12") 
     184                                        $timearray[0]= ((integer) $timearray[0]) + $addtime; 
     185                                $thetime=mktime($timearray[0],$timearray[1],0); 
     186                        break; 
     187                } 
     188        } 
     189        return $thetime; 
     190
     191 
     192function dateToString($thedate,$format=DATE_FORMAT){ 
     193        $datestring=""; 
     194        if($thedate){ 
     195                switch($format){ 
     196 
     197                        case "SQL": 
     198                                $datestring=strftime("%Y-%m-%d",$thedate); 
     199                        break; 
     200                         
     201                        case "English, US": 
     202                                $datestring=strftime("%m/%d/%Y",$thedate); 
     203                        break; 
     204 
     205                } 
     206        } 
     207        return $datestring; 
     208
     209 
     210function timeToString($thetime,$format=TIME_FORMAT){ 
     211        $timestring=""; 
     212        if($thetime){ 
     213                switch($format){ 
     214                        case "24 Hour": 
     215                                $timestring=strftime("%H:%M:%S",$thetime); 
     216                        break; 
     217                        case "12 Hour": 
     218                                $timestring=trim(strftime(HOUR_FORMAT.":%M %p",$thetime)); 
     219                        break; 
     220                } 
     221        } 
     222        return $timestring; 
     223
     224 
     225function formatFromSQLDate($sqldate,$format=DATE_FORMAT){ 
     226        $datestring=""; 
     227        if($sqldate!="") 
     228                if($format=="SQL") 
     229                        $datestring=$sqldate; 
    139230                else 
    140                         $tempdate="\"0000-00-00\""; 
    141         } else{ 
    142                 $thedate="/".ereg_replace(",.","/",$thedate); 
    143                 $temparray=explode("/",$thedate); 
    144                 $tempdate="\"".$temparray[3]."-".$temparray[1]."-".$temparray[2]."\""; 
    145         }//end if 
    146         return $tempdate; 
    147 }//end function 
    148  
    149 function formatToSQLTime($thetime,$allownull=true){ 
    150         if($thetime=="" || $thetime=="0:00"){ 
    151                 if ($allownull) 
    152                         $temptime="NULL"; 
    153                 else 
    154                         $temptime="\"00:00:00\""; 
    155         } else{ 
    156                 if(strpos($thetime,"AM")!==false){ 
    157                         $thetime=str_replace(" AM","",$thetime); 
    158                         $addtime=0; 
    159                 } 
    160                 else { 
    161                         $thetime=str_replace(" PM","",$thetime); 
    162                         $addtime=12; 
    163                 } 
    164                 $timearray=explode(":",$thetime); 
    165                 if($timearray[0]!="12") 
    166                         $timearray[0]= ((integer) $timearray[0]) + $addtime; 
    167                 $temptime="\"".$timearray[0].":".$timearray[1].":00\""; 
    168         }        
    169         return $temptime; 
    170 
    171  
    172 function dateFromSQLDate($sqlDate){ 
    173         $thedate=""; 
    174         $temparray=explode("-",$sqlDate); 
    175         if(count($temparray)>1) 
    176                 $thedate=mktime(0,0,0,(int) $temparray[1],(int) $temparray[2],(int) $temparray[0]); 
    177         return $thedate; 
    178 
    179  
    180 function timeFromSQLTime($sqlTime){ 
    181         $thetime=""; 
    182         $temparray=explode(":",$sqlTime); 
    183         if(count($temparray)>1) 
    184                 $thetime=mktime($temparray[0],$temparray[1],$temparray[2]); 
    185         return $thetime; 
    186 
    187  
    188 function dateFromSQLTimestamp ($datetime) { 
     231                        $datestring=dateToString(stringToDate($sqldate,"SQL"),$format); 
     232        return $datestring; 
     233
     234 
     235function formatFromSQLTime($sqltime,$format=TIME_FORMAT){ 
     236        $timestring=""; 
     237        if($sqltime!="") 
     238                if($format=="24 Hour") 
     239                        $timestring=$sqltime; 
     240                else  
     241                        $timestring=timeToString(timeToDate($sqltime,"24 Hour"),$format); 
     242        return $timestring; 
     243
     244 
     245function formatFromSQLDatetime($sqldatetime,$dateformat=DATE_FORMAT,$timeformat=TIME_FORMAT){ 
     246        $datetimestring=""; 
     247        if($sqldatetime!=""){ 
     248                $datetimearray=explode(" ",$sqldatetime); 
     249 
     250                $datestring=$datetimearray[0]; 
     251                if($dateformat=="SQL") 
     252                        $datestring=$datestring; 
     253                else  
     254                        $datestring=dateToString(stringToDate($datestring,"SQL"),$dateformat); 
     255 
     256                $timestring=$datetimearray[1]; 
     257                if($timeformat=="24 Hour") 
     258                        $timestring=$timestring; 
     259                else  
     260                        $timestring=timeToString(stringToTime($timestring,"24 Hour"),$timeformat); 
     261                $datetimestring=trim($datestring." ".$timestring); 
     262        } 
     263        return $datetimestring; 
     264
     265 
     266function formatFromSQLTimestamp ($datetime,$dateformat=DATE_FORMAT,$timeformat=TIME_FORMAT) { 
    189267        if($datetime=="") 
    190268                return mktime(); 
     
    198276        eregi('(....)(..)(..)(..)(..)(..)',$datetime,$matches); 
    199277        array_shift ($matches);  
    200         foreach (array('year','month','day','hour','minute','second') as 
    201 $var) { 
     278        foreach (array('year','month','day','hour','minute','second') as $var) { 
    202279                $$var = (int) array_shift($matches); 
    203280        } 
    204         return mktime($hour,$minute,$second,$month,$day,$year); 
    205 
    206  
     281         
     282         
     283        $thedatetime=mktime($hour,$minute,$second,$month,$day,$year); 
     284         
     285        return trim(dateToString($thedatetime,$dateformat)." ".timeToString($thedatetime,$timeformat)); 
     286
     287 
     288function sqlDateFromString($datestring,$format=DATE_FORMAT){ 
     289        $sqldate="0000-00-00"; 
     290        if($datestring){ 
     291                if($format=="SQL") 
     292                        $sqldate=$datestring; 
     293                else 
     294                        $sqldate=dateToString(stringToDate($datestring,$format),"SQL"); 
     295        } 
     296        return $sqldate; 
     297
     298 
     299function sqlTimeFromString($timestring,$format=TIME_FORMAT){ 
     300        $sqltime="0000-00-00"; 
     301        if($timestring){ 
     302                if($format=="24 Hour") 
     303                        $sqltime=$timestring; 
     304                else 
     305                        $sqltime=timeToString(stringToTime($timestring,$format),"24 Hour"); 
     306        } 
     307        return $sqltime; 
     308
     309 
     310 
     311//============================================================================ 
    207312function addSlashesToArray($thearray){ 
    208313        if(get_magic_quotes_runtime() || get_magic_quotes_gpc()) 
     
    282387} 
    283388 
    284 function dateFormat($thedate){ 
    285         if($thedate) { 
    286                 $phpdate=dateFromSQLDate($thedate); 
    287                 return strftime("%m/%d/%Y",$phpdate); 
    288         } else return ""; 
    289 } 
    290  
    291 function timeFormat($thetime){ 
    292         if($thetime) { 
    293                 $phptime=timeFromSQLTime($thetime); 
    294                 return strftime(HOUR_FORMAT.":%M %p",$phptime); 
    295         } else return ""; 
    296 } 
    297  
    298 function formatDateTime($thedatetime,$secs=false){ 
    299         $temparray=explode(" ",$thedatetime); 
    300         $thereturn=""; 
    301         if (isset($temparray[0])){ 
    302                 if($temparray[0]){ 
    303                         $phpdate=dateFromSQLDate($temparray[0]); 
    304                         $thereturn.=strftime("%m/%d/%Y",$phpdate); 
    305                 } 
    306         } 
    307         if (isset($temparray[1])){ 
    308                 $phptime=timeFromSQLTime($temparray[1]);                 
    309                 if($secs) 
    310                         $thereturn.=" ".strftime(HOUR_FORMAT.":%M:%S %p",$phptime); 
    311                 else 
    312                         $thereturn.=" ".strftime(HOUR_FORMAT.":%M %p",$phptime); 
    313         } 
    314         return $thereturn; 
    315 } 
    316  
    317  
    318 function formatTimestamp($timestamp){ 
    319         if($timestamp){ 
    320                 $phptimestamp=dateFromSQLTimestamp($timestamp); 
    321                 return strftime("%m/%d/%Y ".HOUR_FORMAT.":%M:%S %p",$phptimestamp); 
    322         } 
    323 } 
    324389 
    325390function formatVariable($value,$format){ 
     
    332397                break; 
    333398                case "date": 
    334                         $value=dateFormat($value); 
     399                        $value=formatFromSQLDate($value); 
    335400                break; 
    336401                case "time": 
    337                         $value=timeFormat($value); 
     402                        $value=formatFromSQLTime($value); 
    338403                break; 
    339404                case "datetime": 
    340                         $value=formatDateTime($value); 
     405                        $value=formatFromSQLDatetime($value); 
    341406                break; 
    342407                case "filelink": 
  • trunk/phpbms/include/createmodifiedby.php

    r174 r191  
    55                created by<br />                 
    66                <div><input name="createdbydisplay" type="text" value="<?php echo $createdby?>" size="20" maxlength="164" readonly="true" class="uneditable fieldCreateModify" tabindex="0" /></div> 
    7                 <div><input name="creationdate" type="text" value="<?php echo formatDateTime($therecord["creationdate"]) ?>" size="20" maxlength="164" readonly="true" class="uneditable fieldCreateModify" tabindex="0" /></div> 
     7                <div><input name="creationdate" type="text" value="<?php echo formatFromSQLDatetime($therecord["creationdate"]) ?>" size="20" maxlength="164" readonly="true" class="uneditable fieldCreateModify" tabindex="0" /></div> 
    88        </div> 
    99        <div class="small"> 
     
    1111                modified by<br/> 
    1212                <div><input name="modifiedbydisplay" type="text" value="<?php echo $modifiedby?>" size="20" maxlength="164" readonly="true" class="uneditable fieldCreateModify" tabindex="0" /></div> 
    13                 <div><input name="modifieddate" type="text" value="<?php echo formatDateTime($therecord["modifieddate"]) ?>" size="20" maxlength="164" readonly="true" class="uneditable fieldCreateModify" tabindex="0" /></div>                      
     13                <div><input name="modifieddate" type="text" value="<?php echo formatFromSQLDatetime($therecord["modifieddate"]) ?>" size="20" maxlength="164" readonly="true" class="uneditable fieldCreateModify" tabindex="0" /></div>                       
    1414        </div>   
    1515</div> 
  • trunk/phpbms/include/fields.php

    r186 r191  
    278278        /* 
    279279           name =                       Name of the field 
    280            value =                      Value for field  
    281            required =           true/false wether the field is validated by javascript before submitting for blank values 
    282            message =            message displayed if not validate                                                
    283            attribute =          Associateive array for extra tag properties.  the key is the attribute and the value is the 
    284                                                 attribute value. 
    285         */ 
     280           value =                      Value for field (SQL formatted date) 
     281           required =           true/false wether the field is validated by javascript before submitting for blank values 
     282           message =            message displayed if not validate                                                
     283           attribute =          Associateive array for extra tag properties.  the key is the attribute and the value is the 
     284                                                attribute value. 
     285        */ 
     286        $value=formatFromSQLDate($value); 
    286287        ?> <input id="<?php echo $name?>" name="<?php echo $name?>" type="text" value="<?php echo $value?>" <?php 
    287288        if ($attributes)  
     
    298299        /* 
    299300           name =                       Name of the field 
    300            value =                      Value for field  
    301            required =           true/false wether the field is validated by javascript before submitting for blank values 
    302            message =            message displayed if not validate                                                
    303            attribute =          Associateive array for extra tag properties.  the key is the attribute and the value is the 
    304                                                 attribute value. 
    305         */ 
     301           value =                      Value for field (SQL formatted time) 
     302           required =           true/false wether the field is validated by javascript before submitting for blank values 
     303           message =            message displayed if not validate                                                
     304           attribute =          Associateive array for extra tag properties.  the key is the attribute and the value is the 
     305                                                attribute value. 
     306        */ 
     307        $value=formatFromSQLTime($value); 
    306308        ?> <input id="<?php echo $name?>" name="<?php echo $name?>" type="text" value="<?php echo $value?>" <?php 
    307309        if ($attributes) foreach($attributes as $attribute => $tvalue) echo " ".$attribute."=\"".$tvalue."\"";                           
  • trunk/phpbms/include/jstransport.php

    r186 r191  
    1616        } echo "\n\n";   
    1717         
     18        //date formating 
     19        ?>DATE_FORMAT="<?php echo $_SESSION["date_format"]?>";<?php 
     20        echo "\n\n"; 
     21         
     22        //time formating 
     23        ?>TIME_FORMAT="<?php echo $_SESSION["time_format"]?>";<?php 
     24        echo "\n\n"; 
     25         
    1826        if(isset($_SESSION["include_js"])){ 
    1927                echo $_SESSION["include_js"]; 
  • trunk/phpbms/install/createtables.sql

    r190 r191  
    115115 
    116116CREATE TABLE `tabledefs` ( 
    117   `id` int(11) NOT NULL
     117  `id` int(11) NOT NULL auto_increment
    118118  `displayname` varchar(64) default NULL, 
    119119  `type` varchar(16) NOT NULL default 'table', 
     
    263263  PRIMARY KEY(`id`) 
    264264) TYPE = MYISAM; 
     265 
     266CREATE TABLE `scheduler` ( 
     267  `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, 
     268  `name` VARCHAR(45), 
     269  `job` VARCHAR(128), 
     270  `crontab` VARCHAR(64), 
     271  `lastrun` DATETIME, 
     272  `startdatetime` DATETIME, 
     273  `enddatetime` DATETIME, 
     274  `description` TEXT, 
     275  `inactive` TINYINT UNSIGNED NOT NULL DEFAULT 0, 
     276  `createdby` INTEGER UNSIGNED, 
     277  `creationdate` DATETIME, 
     278  `modifiedby` INTEGER UNSIGNED, 
     279  `modifieddate` TIMESTAMP, 
     280  PRIMARY KEY(`id`) 
     281) 
     282ENGINE = MYISAM; 
  • trunk/phpbms/install/settings.sql

    r186 r191  
    99INSERT INTO `settings` (`name`, `value`) VALUES ('stylesheet','mozilla'); 
    1010INSERT INTO `settings` (`name`, `value`) VALUES ('phone_format','US - Loose'); 
     11INSERT INTO `settings` (`name`, `value`) VALUES ('date_format','English, US'); 
     12INSERT INTO `settings` (`name`, `value`) VALUES ('time_format','12 Hour'); 
  • trunk/phpbms/install/updatev0.7.sql