Changeset 191
- Timestamp:
- 02/22/07 10:44:47
- Files:
-
- trunk/phpbms/common/javascript/common.js (modified) (1 diff)
- trunk/phpbms/common/javascript/datepicker.js (modified) (1 diff)
- trunk/phpbms/common/javascript/fields.js (modified) (1 diff)
- trunk/phpbms/common/javascript/timepicker.js (modified) (1 diff)
- trunk/phpbms/common/stylesheet/mozilla/base.css (modified) (1 diff)
- trunk/phpbms/common/stylesheet/mozilla/boxes.css (modified) (3 diffs)
- trunk/phpbms/common/stylesheet/mozilla/sizes.css (modified) (1 diff)
- trunk/phpbms/datepicker.php (modified) (1 diff)
- trunk/phpbms/fpdf/FAQ.htm (deleted)
- trunk/phpbms/include/common_functions.php (modified) (4 diffs)
- trunk/phpbms/include/createmodifiedby.php (modified) (2 diffs)
- trunk/phpbms/include/fields.php (modified) (2 diffs)
- trunk/phpbms/include/jstransport.php (modified) (1 diff)
- trunk/phpbms/install/createtables.sql (modified) (2 diffs)
- trunk/phpbms/install/settings.sql (modified) (1 diff)
- trunk/phpbms/install/updatev0.7.sql (modified) (1 diff)
- trunk/phpbms/modules/base/adminsettings.php (modified) (2 diffs)
- trunk/phpbms/modules/base/files_addedit.php (modified) (1 diff)
- trunk/phpbms/modules/base/include/notes_addedit_include.php (modified) (10 diffs)
- trunk/phpbms/modules/base/include/snapshot_include.php (modified) (5 diffs)
- trunk/phpbms/modules/base/include/users_addedit_include.php (modified) (1 diff)
- trunk/phpbms/modules/base/notes_addedit.php (modified) (1 diff)
- trunk/phpbms/modules/base/notes_ajax.php (modified) (1 diff)
- trunk/phpbms/modules/base/report/notes_summary.php (modified) (3 diffs)
- trunk/phpbms/modules/base/snapshot_ajax.php (modified) (5 diffs)
- trunk/phpbms/modules/base/users_addedit.php (modified) (1 diff)
- trunk/phpbms/modules/bms/clients_addedit.php (modified) (1 diff)
- trunk/phpbms/modules/bms/clients_email_process.php (modified) (1 diff)
- trunk/phpbms/modules/bms/clients_purchasehistory.php (modified) (5 diffs)
- trunk/phpbms/modules/bms/include/clientemailprojects_edit_include.php (modified) (1 diff)
- trunk/phpbms/modules/bms/include/clients_addedit_include.php (modified) (3 diffs)
- trunk/phpbms/modules/bms/include/invoices_addedit_include.php (modified) (10 diffs)
- trunk/phpbms/modules/bms/install/createtables.sql (modified) (2 diffs)
- trunk/phpbms/modules/bms/install/install.php (modified) (1 diff)
- trunk/phpbms/modules/bms/install/invoicestatuses.sql (added)
- trunk/phpbms/modules/bms/install/updatev0.70.sql (modified) (1 diff)
- trunk/phpbms/modules/bms/invoices_statushistory.php (modified) (2 diffs)
- trunk/phpbms/modules/bms/products_saleshistory.php (modified) (4 diffs)
- trunk/phpbms/modules/bms/quickview_ajax.php (modified) (1 diff)
- trunk/phpbms/modules/bms/report/clients_notesummary.php (modified) (3 diffs)
- trunk/phpbms/modules/bms/report/clients_purchasehistory.php (modified) (3 diffs)
- trunk/phpbms/modules/bms/report/invoices_pdfinvoice.php (modified) (2 diffs)
- trunk/phpbms/modules/bms/report/invoices_pdfpackinglist.php (modified) (2 diffs)
- trunk/phpbms/modules/bms/report/invoices_pdfquote.php (modified) (2 diffs)
- trunk/phpbms/modules/bms/report/invoices_pdfworkorder.php (modified) (2 diffs)
- trunk/phpbms/modules/bms/report/invoices_totals.php (modified) (3 diffs)
- trunk/phpbms/modules/bms/report/lineitems_totals.php (modified) (3 diffs)
- trunk/phpbms/modules/bms/report/products_saleshistory.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/phpbms/common/javascript/common.js
r146 r191 215 215 } 216 216 217 /* DATE AND TIME --------------------------------------------------------------- */ 218 /* ----------------------------------------------------------------------------- */ 219 function 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 249 function 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 270 function 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 301 function 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 ----------------------------------------------------------------------- */ 217 333 /* ----------------------------------------------------------------------------- */ 218 334 trunk/phpbms/common/javascript/datepicker.js
r145 r191 116 116 } 117 117 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 }141 118 142 119 function 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)); 149 121 } trunk/phpbms/common/javascript/fields.js
r186 r191 148 148 //validate a time (12 hour) 149 149 function 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))) 155 151 } 156 152 157 153 // validate dates 158 154 function 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))); 191 156 } 192 157 trunk/phpbms/common/javascript/timepicker.js
r145 r191 93 93 function tpClickHour(hour){ 94 94 var timeField=getObjectFromID(showTP.timeField); 95 var ampm;96 if(!validateTime(timeField.value)) timeField.value="12:00 AM";97 95 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 104 100 if(timeField.onchange) timeField.onchange(); 105 101 } 106 102 function tpClickMinute(thetd){ 107 var minutes= thetd.innerHTML;103 var minutes=parseInt(thetd.innerHTML.replace(/:/,"")); 108 104 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 114 110 if(timeField.onchange) timeField.onchange(); 115 111 closeTPBox(); trunk/phpbms/common/stylesheet/mozilla/base.css
r145 r191 25 25 #footerAbout{float:left;} 26 26 #footerTop{float:right;} 27 28 29 /* ============================================================================== */30 /* Query Results */31 /* ============================================================================== */32 27 33 28 /* ============================================================================== */ trunk/phpbms/common/stylesheet/mozilla/boxes.css
r145 r191 14 14 .bodyline{ 15 15 clear:both; 16 border-color:# ABB1B1;16 border-color:#CAD1D1; 17 17 border-style:solid; 18 18 -moz-border-radius:0; … … 21 21 22 22 FIELDSET,.box{ 23 border-color:# 74879C;23 border-color:#ACB7C4; 24 24 border-width:1px; 25 25 border-style:solid; … … 30 30 .box{ 31 31 background-color:#EFF9F9; 32 border:1px solid # 999999;32 border:1px solid #CCCCCC; 33 33 } trunk/phpbms/common/stylesheet/mozilla/sizes.css
r165 r191 20 20 H1 { 21 21 font-family: Arial, Helvitica, sans-serif; 22 border-bottom: 1px solid #ccc;23 22 font-size:20px; 24 23 margin:3px; 25 24 padding-left:24px; 26 margin-bottom: 8px;25 margin-bottom:9px; 27 26 font-weight:normal; 28 27 background: url("image/h1graphic.png") 4px 4px no-repeat;; trunk/phpbms/datepicker.php
r146 r191 47 47 $todayArray=getdate($today); 48 48 if($selectedDate!="0000-00-00"){ 49 $selDate= dateFromSQLDate($selectedDate);49 $selDate=stringToDate($selectedDate,"SQL"); 50 50 $tempDate=getdate($selDate); 51 51 $displayLongDate=$tempDate["month"]." ".$tempDate["mday"].", ".$tempDate["year"]; trunk/phpbms/include/common_functions.php
r184 r191 130 130 } 131 131 132 // This Function prepares a date for insertion/updaing into a SQL statement 132 133 // date/time functions 133 134 // It will add the quotes for you. 134 135 //===================================================================== 135 function formatToSQLDate($thedate,$allownull=true){ 136 if($thedate=="" || $thedate=="0/0/0000"){ 137 if ($allownull) 138 $tempdate="NULL"; 136 define("DATE_FORMAT",$_SESSION["date_format"]); 137 define("TIME_FORMAT",$_SESSION["time_format"]); 138 139 function 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 162 function 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 192 function 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 210 function 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 225 function formatFromSQLDate($sqldate,$format=DATE_FORMAT){ 226 $datestring=""; 227 if($sqldate!="") 228 if($format=="SQL") 229 $datestring=$sqldate; 139 230 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 235 function 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 245 function 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 266 function formatFromSQLTimestamp ($datetime,$dateformat=DATE_FORMAT,$timeformat=TIME_FORMAT) { 189 267 if($datetime=="") 190 268 return mktime(); … … 198 276 eregi('(....)(..)(..)(..)(..)(..)',$datetime,$matches); 199 277 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) { 202 279 $$var = (int) array_shift($matches); 203 280 } 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 288 function 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 299 function 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 //============================================================================ 207 312 function addSlashesToArray($thearray){ 208 313 if(get_magic_quotes_runtime() || get_magic_quotes_gpc()) … … 282 387 } 283 388 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 else312 $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 }324 389 325 390 function formatVariable($value,$format){ … … 332 397 break; 333 398 case "date": 334 $value= dateFormat($value);399 $value=formatFromSQLDate($value); 335 400 break; 336 401 case "time": 337 $value= timeFormat($value);402 $value=formatFromSQLTime($value); 338 403 break; 339 404 case "datetime": 340 $value=format DateTime($value);405 $value=formatFromSQLDatetime($value); 341 406 break; 342 407 case "filelink": trunk/phpbms/include/createmodifiedby.php
r174 r191 5 5 created by<br /> 6 6 <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 format DateTime($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> 8 8 </div> 9 9 <div class="small"> … … 11 11 modified by<br/> 12 12 <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 format DateTime($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> 14 14 </div> 15 15 </div> trunk/phpbms/include/fields.php
r186 r191 278 278 /* 279 279 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); 286 287 ?> <input id="<?php echo $name?>" name="<?php echo $name?>" type="text" value="<?php echo $value?>" <?php 287 288 if ($attributes) … … 298 299 /* 299 300 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); 306 308 ?> <input id="<?php echo $name?>" name="<?php echo $name?>" type="text" value="<?php echo $value?>" <?php 307 309 if ($attributes) foreach($attributes as $attribute => $tvalue) echo " ".$attribute."=\"".$tvalue."\""; trunk/phpbms/include/jstransport.php
r186 r191 16 16 } echo "\n\n"; 17 17 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 18 26 if(isset($_SESSION["include_js"])){ 19 27 echo $_SESSION["include_js"]; trunk/phpbms/install/createtables.sql
r190 r191 115 115 116 116 CREATE TABLE `tabledefs` ( 117 `id` int(11) NOT NULL ,117 `id` int(11) NOT NULL auto_increment, 118 118 `displayname` varchar(64) default NULL, 119 119 `type` varchar(16) NOT NULL default 'table', … … 263 263 PRIMARY KEY(`id`) 264 264 ) TYPE = MYISAM; 265 266 CREATE 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 ) 282 ENGINE = MYISAM; trunk/phpbms/install/settings.sql
r186 r191 9 9 INSERT INTO `settings` (`name`, `value`) VALUES ('stylesheet','mozilla'); 10 10 INSERT INTO `settings` (`name`, `value`) VALUES ('phone_format','US - Loose'); 11 INSERT INTO `settings` (`name`, `value`) VALUES ('date_format','English, US'); 12 INSERT INTO `settings` (`name`, `value`) VALUES ('time_format','12 Hour'); trunk/phpbms/install/updatev0.7.sql