phpBMS

Changeset 450 for branches

Show
Ignore:
Timestamp:
03/05/09 17:32:04 (3 years ago)
Author:
nate
Message:
  • Merged trunk into branch
Location:
branches/nathan
Files:
16 modified

Legend:

Unmodified
Added
Removed
  • branches/nathan/common/javascript/smartsearch.js

    r386 r450  
    3838 
    3939smartSearch = { 
    40          
     40 
    4141        displayValue: Array(), 
    42          
     42 
    4343        triggerLookup: Array(), 
    4444 
     
    4848 
    4949        committedDisplayValue: Array(), 
    50          
    51         changeDisplay: function(e){              
     50 
     51        changeDisplay: function(e){ 
    5252                //this sets the time out to do an ajax lookup when they are done typing their search criteria. 
    53                  
     53 
    5454                var display = e.src(); 
    5555                var ssID = display.id.substr(3); 
     
    5757                if(!smartSearch.displayValue[ssID]) 
    5858                        smartSearch.displayValue[ssID] = ""; 
    59                  
     59 
    6060                var lookupValue = display.value.trim(); 
    61                  
     61 
    6262                if (lookupValue != smartSearch.displayValue[ssID] && lookupValue != ""){ 
    6363 
     
    6666 
    6767                        smartSearch.triggerLookup[ssID] = window.setTimeout("smartSearch.lookup('"+ssID+"')",250); 
    68                          
     68 
    6969                } else { 
    7070                        //it's possible they hit the down, up arrow, or the return button 
     
    7373 
    7474                        switch(key){ 
    75                                  
     75 
    7676                                case 40: 
    7777                                        //move highlight down 
    7878                                        smartSearch.moveSearchHighlight(ssID, "down"); 
    7979                                        break; 
    80                  
     80 
    8181                                case 38: 
    8282                                        //move highlight down 
    8383                                        smartSearch.moveSearchHighlight(ssID, "up"); 
    8484                                        break; 
    85                                  
     85 
    8686                                case 27: 
    8787                                        //cancel 
    8888                                        smartSearch.cancelSearch(null, ssID); 
    89                                  
     89 
    9090                        }//endswitch 
    9191 
    9292                }//endif 
    93                  
     93 
    9494        },//end method 
    9595 
     
    9898 
    9999        lookup: function(ssID, offset){ 
    100                  
     100 
    101101                // We need to do an ajax lookup based on the criteria. 
    102102                // Fisrt we need to see if the holding box is visible. 
    103                 // if not we need to create it           
     103                // if not we need to create it 
    104104                if (!smartSearch.searchBox[ssID]) 
    105105                        smartSearch.createSearchBox(ssID); 
    106                          
     106 
    107107 
    108108                var sbResults = getObjectFromID("SBResults-" + ssID); 
     
    112112                        sbResults.style.height=""; 
    113113                } 
    114                                                  
    115                 var closeButton = getObjectFromID("SBCloseButton-" + ssID);              
     114 
     115                var closeButton = getObjectFromID("SBCloseButton-" + ssID); 
    116116                closeButton.className = "graphicButtons buttonSpinner"; 
    117                  
     117 
    118118                var searchDisplay = getObjectFromID("ds-" + ssID); 
    119119                smartSearch.displayValue[ssID] = searchDisplay.value; 
    120                  
     120 
    121121                var sdbid = getObjectFromID("sdbid-" + ssID); 
    122                          
     122 
    123123 
    124124                var theurl = APP_PATH + "smartsearch.php?sdbid=" + encodeURI(sdbid.value) + "&t=" + encodeURI(searchDisplay.value.trim()); 
    125                  
     125 
    126126                if(offset != 0) 
    127127                        theurl += "&o=" + offset; 
    128                  
     128 
    129129                if(!smartSearch.searchResultsConnects[ssID]) 
    130130                        smartSearch.searchResultsConnects[ssID] = Array(); 
     
    144144 
    145145                var numRecords = response.resultRecords.length 
    146                  
     146 
    147147                var totalRecords = response.totalRecords; 
    148148 
    149                 var newText="";          
     149                var newText=""; 
    150150 
    151151                if(numRecords) { 
    152                         for(var i=0; i<numRecords; i++){                                 
     152                        for(var i=0; i<numRecords; i++){ 
    153153 
    154154                                newText += '\ 
     
    158158                                        </a>'; 
    159159 
    160                                                                  
     160 
    161161                        }//endfor 
    162162 
     
    167167                                <div id="SBMoreDiv-' + ssID + '">\ 
    168168                                        <button type="button" id="SBMoreButton-' + ssID +'" class="smallButtons" name="' + (parseInt(offset) + parseInt(numRecords)) + '">more results...</button>\ 
    169                                 </div>';                                 
     169                                </div>'; 
    170170 
    171171                        }//end if 
    172                          
     172 
    173173                } else { 
    174                          
     174 
    175175                        newText = '<div>No Records Found Matching Criteria</div>'; 
    176                          
     176 
    177177                }//endif 
    178178 
    179179                if(!offset) 
    180                         sbResults.innerHTML =  newText;  
     180                        sbResults.innerHTML =  newText; 
    181181                else 
    182182                        sbResults.innerHTML += newText; 
    183                  
     183 
    184184                var searchItems = getElementsByClassName("SBSI-" + ssID); 
    185185                smartSearch.searchResultsConnects[ssID] = Array(); 
     
    187187                for(i=0; i < searchItems.length; i++) 
    188188                        smartSearch.searchResultsConnects[ssID][smartSearch.searchResultsConnects[ssID].length] = connect(searchItems[i], "onclick", smartSearch.clickSearchResult); 
    189                          
     189 
    190190                var moreButton = getObjectFromID("SBMoreButton-" + ssID); 
    191191                if(moreButton) 
    192                         smartSearch.searchResultsConnects[ssID][smartSearch.searchResultsConnects[ssID].length] = connect(moreButton, "onclick", smartSearch.getMoreResults);                    
     192                        smartSearch.searchResultsConnects[ssID][smartSearch.searchResultsConnects[ssID].length] = connect(moreButton, "onclick", smartSearch.getMoreResults); 
    193193 
    194194                closeButton.className = "graphicButtons buttonX"; 
     
    197197 
    198198        createSearchBox: function(ssID){ 
    199                  
     199 
    200200                //need to grab search box for reference x and ys 
    201201                var searchdisplay = getObjectFromID("ds-"+ssID); 
    202                  
     202 
    203203                if(!smartSearch.searchBoxConnects[ssID]) 
    204204                        smartSearch.searchBoxConnects[ssID] = Array(); 
    205                  
     205 
    206206                if(smartSearch.searchBoxConnects[ssID][0]) 
    207207                        disconnect(smartSearch.searchBoxConnects[ssID][0]); 
     
    227227                newDiv.innerHTML = '<button type="button" id="SBCloseButton-' + ssID + '" class="SBCloseButton graphicButtons buttonSpinner" tabindex="4000"><span>close</span></button>'; 
    228228                smartSearch.searchBox[ssID].appendChild(newDiv) 
    229                  
     229 
    230230                newDiv = document.createElement("div"); 
    231231                newDiv.id = "SBResults-" + ssID; 
     
    237237                newDiv.id = "SBFooter"; 
    238238                smartSearch.searchBox[ssID].appendChild(newDiv) 
    239                  
     239 
    240240                searchdisplay.parentNode.appendChild(smartSearch.searchBox[ssID]); 
    241                  
     241 
    242242                var closeButton = getObjectFromID("SBCloseButton-" + ssID); 
    243                  
     243 
    244244                smartSearch.searchBoxConnects[ssID][0] = connect(smartSearch.searchBox[ssID],"onmousedown", smartSearch.mouseDownDropDown); 
    245245                smartSearch.searchBoxConnects[ssID][1] = connect(closeButton,"onclick",smartSearch.cancelSearch); 
    246                  
     246 
    247247        },//end method 
    248248 
     
    253253                var box = e.src(); 
    254254                var ssID = box.id.substr(10) 
    255                  
     255 
    256256                smartSearch.inDropDown[ssID] = true; 
    257                  
     257 
    258258        },//end method - clickDropDown 
    259259 
     
    261261 
    262262        blurIdent: Array(), 
    263          
     263 
    264264        blurDisplay: function(e){ 
    265265 
    266266                var display = e.src(); 
    267                 var ssID = display.id.substr(3);                 
     267                var ssID = display.id.substr(3); 
    268268 
    269269                if(!smartSearch.inDropDown[ssID]) 
    270270                        smartSearch.blurIdent[ssID] = window.setTimeout("smartSearch._blurDisplay('" + ssID + "')",200); 
    271                  
     271 
    272272                smartSearch.inDropDown[ssID] = false; 
    273                  
    274         },//end method 
    275          
    276          
     273 
     274        },//end method 
     275 
     276 
    277277        _blurDisplay: function(ssID){ 
    278278 
    279279                var searchDisplay = getObjectFromID("ds-" + ssID); 
    280                  
     280 
    281281                if(smartSearch.searchBox[ssID] || searchDisplay.value != smartSearch.committedDisplayValue[ssID]){ 
    282                          
     282 
    283283                        var highlight = getElementsByClassName("SBSel-"+ssID); 
    284284 
    285285                        if(highlight.length !== 0){ 
    286                                  
     286 
    287287                                smartSearch.chooseSearchItem(highlight[0]) 
    288                                  
     288 
    289289                        } else { 
    290290 
     
    293293                                else 
    294294                                        smartSearch.blankSearch(ssID); 
    295                                  
     295 
    296296                        }//end if 
    297                          
     297 
    298298                }//end if 
    299                  
     299 
    300300                smartSearch.blurIdent[ssID] = false; 
    301                                  
     301 
    302302        },//end method 
    303303 
    304304 
    305305        blankSearch: function(ssID){ 
    306                  
    307                 var searchDisplay = getObjectFromID("ds-" + ssID);                               
     306 
     307                var searchDisplay = getObjectFromID("ds-" + ssID); 
    308308                var valueField = getObjectFromID(ssID); 
    309                  
     309 
    310310                valueField.value = "" 
    311311                smartSearch.displayValue[ssID] = ""; 
     
    324324 
    325325        cancelSearch: function(e, ssID){ 
    326                  
     326 
    327327                if(e){ 
    328                          
     328 
    329329                        var thebutton = e.src() 
    330330                        ssID = thebutton.id.substr(14); 
    331                          
     331 
    332332                }//endif - e 
    333                  
    334                 var searchDisplay = getObjectFromID("ds-" + ssID);                               
    335  
    336                 if(smartSearch.searchBox[ssID])          
     333 
     334                var searchDisplay = getObjectFromID("ds-" + ssID); 
     335                var freeForm = getObjectFromID("sff-" + ssID); 
     336 
     337                if(smartSearch.searchBox[ssID]) 
    337338                        searchDisplay.parentNode.removeChild(smartSearch.searchBox[ssID]); 
    338                  
    339                 searchDisplay.value = smartSearch.committedDisplayValue[ssID]; 
    340                 smartSearch.displayValue[ssID] = smartSearch.committedDisplayValue[ssID]; 
     339 
     340                if(freeForm.value == 0){ 
     341 
     342                        searchDisplay.value = smartSearch.committedDisplayValue[ssID]; 
     343                        smartSearch.displayValue[ssID] = smartSearch.committedDisplayValue[ssID]; 
     344 
     345                }//end free forming wipes 
     346 
    341347                smartSearch.searchBox[ssID] = null; 
    342                  
     348 
    343349                smartSearch.inDropDown[ssID] = false; 
    344350                //searchDisplay.blur(); 
     
    349355 
    350356        clickSearchResult: function(e){ 
    351                  
     357 
    352358                var theItem = e.src(); 
    353359                var classes = theItem.className.split(" "); 
    354360                var ssID = classes[1].substr(5); 
    355                  
     361 
    356362                window.clearTimeout(smartSearch.blurIdent[ssID]); 
    357363                smartSearch.blurIdent[ssID] = false; 
    358                  
     364 
    359365                smartSearch.chooseSearchItem(theItem); 
    360366                e.stop(); 
    361                  
     367 
    362368        },//end method 
    363369 
    364370 
    365371        chooseSearchItem: function(atag){ 
    366                  
     372 
    367373                var classes = atag.className.split(" "); 
    368374                var ssID = classes[1].substr(5); 
    369                  
     375 
    370376                var valueField = getObjectFromID(ssID); 
    371377                var searchDisplay = getObjectFromID("ds-"+ssID); 
    372                                  
     378 
    373379                valueField.value = atag.id.substr(3); 
    374                  
     380 
    375381                for(var i=0; i< atag.childNodes.length; i++) 
    376382                        if(atag.childNodes[i].className) 
    377383                                if(atag.childNodes[i].className == "SBMain") 
    378384                                        searchDisplay.value = htmlDecode(atag.childNodes[i].innerHTML); 
    379                                  
     385 
    380386                smartSearch.committedDisplayValue[ssID] = searchDisplay.value; 
    381387                smartSearch.displayValue[ssID] = searchDisplay.value; 
     
    383389                //remove the box 
    384390                searchDisplay.parentNode.removeChild(smartSearch.searchBox[ssID]); 
    385                  
     391 
    386392                smartSearch.searchBox[ssID] = null; 
    387                  
     393 
    388394                //lastly, if the value field has an onchange we need to trgger it 
    389395                //First we check for legacy on changes 
     
    398404 
    399405        moveSearchHighlight: function(ssID, direction){ 
    400                  
     406 
    401407                var sbResults = getObjectFromID("SBResults-" + ssID); 
    402408                var currentItem = 0 
    403409                var classes, newClassName 
    404                  
     410 
    405411                if(direction=="down") 
    406412                        direction = 1; 
    407413                else 
    408414                        direction =-1; 
    409                  
     415 
    410416                for(var i=0; i < sbResults.childNodes.length; i++){ 
    411                          
     417 
    412418                        if(sbResults.childNodes[i].className){ 
    413419                                if(sbResults.childNodes[i].className.indexOf("SBSelected") !== -1){ 
     
    425431                                }//endif - SBSELECTED 
    426432                        }//endif - clasname 
    427                                                          
     433 
    428434                }//endfor 
    429435 
    430436                var newItem = currentItem + direction 
    431                  
     437 
    432438                while(newItem >= 0 && newItem < sbResults.childNodes.length){ 
    433                          
     439 
    434440                        if(sbResults.childNodes[newItem].className){ 
    435                                  
     441 
    436442                                sbResults.childNodes[newItem].className += " SBSelected SBSel-"+ssID; 
    437443                                newItem = -1000; 
    438                                  
    439                         }else  
     444 
     445                        }else 
    440446                                newItem += direction 
    441                                  
     447 
    442448                }//endwhile 
    443                  
     449 
    444450        }, //endif 
    445451 
    446452 
    447453        getMoreResults: function(e){ 
    448                  
     454 
    449455                var button = e.src(); 
    450456                var ssID = button.id.substr(13); 
     
    452458                window.clearTimeout(smartSearch.blurIdent[ssID]); 
    453459                smartSearch.blurIdent[ssID] = false; 
    454                                  
     460 
    455461                var thediv = button.parentNode; 
    456                  
     462 
    457463                thediv.parentNode.removeChild(thediv); 
    458                  
     464 
    459465                var sbResults = getObjectFromID("SBResults-" + ssID); 
    460466                sbResults.style.height = "330px"; 
    461                  
    462                 var offset = button.name  
     467 
     468                var offset = button.name 
    463469                button.id = "invalid-removed"; 
    464                  
    465                 smartSearch.lookup(ssID, offset);        
    466                  
     470 
     471                smartSearch.lookup(ssID, offset); 
     472 
    467473                var searchDisplay = getObjectFromID("ds-" + ssID); 
    468474                searchDisplay.focus(); 
    469                  
     475 
    470476        }//end method 
    471          
     477 
    472478}//end struct 
    473479 
     
    475481/* ------------------------------------------------------- */ 
    476482connect(window,"onload",function() { 
    477                  
     483 
    478484        //grab all smart search boxes 
    479485        var smartSearches = getElementsByClassName("inputSmartSearch"); 
     
    486492 
    487493                var ssID = smartSearches[i].id.substr(3); 
    488                  
     494 
    489495                smartSearch.displayValue[ssID] = smartSearches[i].value; 
    490496                smartSearch.committedDisplayValue[ssID] = smartSearches[i].value; 
    491497 
    492498        }//endfor smartSearches 
    493          
    494                                                                   
     499 
     500 
    495501}) 
  • branches/nathan/common/stylesheet/mozilla/base.css

    r384 r450  
    6969        #MLAddP{float:right;padding-left:0} 
    7070        #MLStatus{clear:both;text-align:center} 
    71          
     71 
    7272 
    7373/* ============================================================================== */ 
     
    8686        #saveButton1,#saveButton2{width:68px;margin-right:3px;} 
    8787        #cancelButton1,#cancelButton2{width:68px;} 
    88          
     88 
    8989/* ============================================================================== */ 
    9090/* Smart Searches                                                                 */ 
     
    101101        background:white; 
    102102        position:absolute; 
     103        z-index: 90; 
    103104} 
    104105 
     
    149150.SBHeader{ 
    150151        background:#EEEEEE; 
    151         text-align:right;        
     152        text-align:right; 
    152153        padding:5px; 
    153154        height:16px; 
  • branches/nathan/common/stylesheet/mozilla/menu.css

    r311 r450  
    4545        border-bottom:1px solid #ACB7C4; 
    4646        margin:0; 
    47         padding:0 0 0 5px;       
     47        padding:0 0 0 5px; 
    4848        height:26px; 
    4949} 
     
    6868} 
    6969 
    70 #menuBar .firstLevel a:hover, #menuBar a.hovered{  
    71         text-decoration:none;  
     70#menuBar .firstLevel a:hover, #menuBar a.hovered{ 
     71        text-decoration:none; 
    7272        background-color:#663366; 
    7373        color:white; 
     
    8282        margin-top:-1px; 
    8383        position:absolute; 
     84        z-index: 100; 
    8485        background-color:white; 
    8586        border:1px solid #999999; 
     
    9192        background-image:none; 
    9293        margin:0px; 
    93         display:block;  
     94        display:block; 
    9495        padding:3px 25px 3px 15px; 
    9596        font-size:11px; 
     
    101102 
    102103#menuBar .submenuitems a:hover{ 
    103         text-decoration:none;  
     104        text-decoration:none; 
    104105        background-color:#663366; 
    105106        color:white; 
     
    116117#SMText{ 
    117118        background:url("image/statusmessage.png") 7px 5px no-repeat; 
    118         color:white;  
    119         font-weight:bold;  
     119        color:white; 
     120        font-weight:bold; 
    120121        font-size:15px; 
    121122        padding: 5px 5px 0px 30px; 
  • branches/nathan/common/stylesheet/mozilla/pages/quickview.css

    r420 r450  
    6363 
    6464.RDNames{ 
    65         float:left;  
     65        float:left; 
    6666        width:100px; 
    6767        text-align:right; 
     
    9191.disabledP{display:none;} 
    9292 
    93 #clientrecord{ 
    94         position:relative; 
    95         z-index:-1; 
    96 } 
    9793#theDetails{margin-top:15px;} 
    9894#rightSideDiv{float:right;width:300px;margin-top:0;} 
  • branches/nathan/common/stylesheet/mozilla/pages/snapshot.css

    r312 r450  
    3030 
    3131h2{ 
    32         margin:3px 0 5px;  
    33         padding:0 0 4px;  
     32        margin:3px 0 5px; 
     33        padding:0 0 4px; 
    3434        border:0; 
    3535        font-size:15px 
     
    4040        cursor:pointer;font-size:13px;background:#EEEEEE url("../image/section-down.png") 99% 3px no-repeat; 
    4141        padding:4px; 
    42         border-bottom:1px solid #BBBBBB;         
     42        border-bottom:1px solid #BBBBBB; 
    4343} 
    4444#invoiceBox h3, #clientBox h3, #arBox h3{ 
     
    5959} 
    6060 
    61 .tasksDivs p{ 
    62         margin:0;  
    63         padding:4px 4px 4px 8px;  
    64         border-bottom:1px solid #EEEEEE;  
    65         font-size:11px; 
     61.tasksDivs div div{ 
     62        clear: both; 
     63        margin:0; 
     64        padding:4px 4px 4px 8px; 
     65        border-bottom:1px solid #EEEEEE; 
     66        font-size:12px; 
    6667} 
    6768 
    68 .tasksDivs a{font-weight:normal} 
     69        .tasksDivs div div:hover{ 
     70                background: #EEEEEE; 
     71        } 
    6972 
    70 .tasksDivs .private a{font-weight:bold} 
     73        .tasksDivs div div.taskSection{ 
     74                font-weight: bold; 
     75                border-bottom-color: #999999; 
     76                padding-top: 16px; 
     77        } 
     78 
     79                .tasksDivs div div.taskSection:hover{ 
     80                        background: #FFF; 
     81                } 
     82 
     83        .taskRight{ 
     84                padding-left: 2px; 
     85                font-size: 10px; 
     86                display: block; 
     87                float: right; 
     88                text-align: right; 
     89        } 
     90 
     91        .tasksDivs div div p{ 
     92                font-style: italic; 
     93                font-size: 11px; 
     94                padding: 2px 20px; 
     95        } 
     96 
     97.tasksDivs a{ 
     98        font-weight:bold; 
     99} 
    71100 
    72101 
    73 .tasksDivs .complete, .tasksDivs .complete a { 
     102.tasksDivs .complete a { 
    74103        text-decoration:line-through; 
    75104        color:#CCCCCC; 
     
    84113 
    85114#eventsBox #eventsList td{ 
    86         padding:10px 5px;  
    87         border-bottom:1px solid #DDDDDD;  
     115        padding:10px 5px; 
     116        border-bottom:1px solid #DDDDDD; 
    88117        font-size:11px; 
    89118} 
     
    104133        float:right; 
    105134        margin:0; 
    106         padding:0;       
     135        padding:0; 
    107136} 
    108137 
     
    110139        list-style-type:none; 
    111140        display:inline; 
    112         padding:0 4px 0 0;       
     141        padding:0 4px 0 0; 
    113142        margin:0; 
    114143} 
     
    118147} 
    119148 
    120 #icalA {  
     149#icalA { 
    121150        float:left; 
    122151        height:16px; 
  • branches/nathan/include/fields.php

    r417 r450  
    1515 |   notice, this list of conditions and the following disclaimer.         | 
    1616 |                                                                         | 
    17  | - Redistributions in binary form must reproduce the above copyright     |             
     17 | - Redistributions in binary form must reproduce the above copyright     | 
    1818 |   notice, this list of conditions and the following disclaimer in the   | 
    1919 |   documentation and/or other materials provided with the distribution.  | 
     
    3939 
    4040class phpbmsForm{ 
    41          
     41 
    4242        var $jsIncludes = array("common/javascript/fields.js"); 
    4343        var $topJS = array( 
     
    5252                                 ); 
    5353        var $bottomJS = array(); 
    54          
     54 
    5555        var $fields = array(); 
    56          
     56 
    5757        var $onload = array(); 
    58          
     58 
    5959        function phpbmsForm($action = NULL, $method="post", $name="record", $onsubmit="return validateForm(this);", $dontSubmit = true){ 
    6060                if ($action == NULL) 
    6161                        $action = $_SERVER["REQUEST_URI"]; 
    62                          
     62 
    6363                $this->action= $action; 
    6464                $this->method = $method; 
    6565                $this->name = $name; 
    6666                $this->onsubmit = $onsubmit; 
    67                  
     67 
    6868                $this->dontSubmit = $dontSubmit; 
    69                  
     69 
    7070        } 
    7171 
    7272        function startForm($pageTitle){ 
    7373 
    74                 ?><form action="<?php echo str_replace("&","&amp;",$this->action) ?>" method="<?php echo $this->method?>" name="<?php echo $this->name?>" onsubmit="<?php echo $this->onsubmit?>" <?php  
     74                ?><form action="<?php echo str_replace("&","&amp;",$this->action) ?>" method="<?php echo $this->method?>" name="<?php echo $this->name?>" onsubmit="<?php echo $this->onsubmit?>" <?php 
    7575                        if(isset($this->enctype)) echo ' enctype="'.$this->enctype.'" '; 
    7676                        if(isset($this->id)) echo ' id="'.$this->id.'" '; 
    77                 ?>><?php  
     77                ?>><?php 
    7878                if($this->dontSubmit){ 
    7979                        ?><div id="dontSubmit"><input type="submit" value=" " onclick="return false;" /></div><?php 
    8080                } ?> 
    8181                <div id="topButtons"><?php showSaveCancel(1); ?></div> 
    82                 <h1 id="h1Title"><span><?php echo $pageTitle ?></span></h1><?php         
    83                  
    84         }//end method 
    85          
    86          
     82                <h1 id="h1Title"><span><?php echo $pageTitle ?></span></h1><?php 
     83 
     84        }//end method 
     85 
     86 
    8787        function showCreateModify($phpbms, $therecord){ 
    8888        ?> 
     
    9494                                <input name="createdby" type="hidden" value="<?php $therecord["createdby"] ?>" /> 
    9595                                <input name="creationdate" type="hidden" value="<?php echo formatFromSQLDatetime($therecord["creationdate"]) ?>"/> 
    96                                 created                  
     96                                created 
    9797                        </td> 
    9898                        <td><?php echo htmlQuotes($phpbms->getUserName($therecord["createdby"]))?></td> 
     
    114114        }//end method 
    115115 
    116          
     116 
    117117        function endForm(){ 
    118118                ?></form><?php 
    119119        } 
    120          
    121          
     120 
     121 
    122122        function addField($inputObject){ 
    123123                if(is_object($inputObject)) 
    124124                        $this->fields[$inputObject->id] = $inputObject; 
    125125        } 
    126          
    127          
     126 
     127 
    128128        function showField($fieldname){ 
    129129                if(isset($this->fields[$fieldname])){ 
     
    138138                        echo "Field Not Defined: ".$fieldname; 
    139139        } 
    140          
    141          
    142         function jsMerge(){              
     140 
     141 
     142        function jsMerge(){ 
    143143                global $phpbms; 
    144                  
     144 
    145145                $phpbms->jsIncludes = array_merge($phpbms->jsIncludes,$this->jsIncludes); 
    146146                $phpbms->topJS = array_merge($this->topJS,$phpbms->topJS); 
    147147                $phpbms->bottomJS = array_merge($this->bottomJS,$phpbms->bottomJS); 
    148148                $phpbms->onload = array_merge($this->onload,$phpbms->onload); 
    149                  
     149 
    150150                //next we go through the list of fields 
    151151                foreach($this->fields as $field){ 
    152152 
    153153                        $toAdd = $field->getJSMods(); 
    154                          
     154 
    155155                        foreach($toAdd["jsIncludes"] as $jsinclude) 
    156156                                if(!in_array($jsinclude,$phpbms->jsIncludes)) 
     
    158158 
    159159                        $phpbms->topJS = array_merge($phpbms->topJS,$toAdd["topJS"]); 
    160                         $phpbms->bottomJS = array_merge($phpbms->bottomJS,$toAdd["bottomJS"]);                   
    161                         $phpbms->onload = array_merge($phpbms->onload,$toAdd["onload"]);                         
     160                        $phpbms->bottomJS = array_merge($phpbms->bottomJS,$toAdd["bottomJS"]); 
     161                        $phpbms->onload = array_merge($phpbms->onload,$toAdd["onload"]); 
    162162 
    163163                }//endforeach 
    164                  
     164 
    165165        }//end method - jsMerge 
    166166}//end class 
     
    174174 
    175175                value =                 Value of input 
    176                 displayName =   Name to displayed in label, and on default messages when not overriden  
     176                displayName =   Name to displayed in label, and on default messages when not overriden 
    177177                required =              true/false wether the field is validated by javascript before submitting for blank values 
    178178                type =                  Type of field (integer, phone, email, wwww, real, date) to validate against 
    179             
     179 
    180180                size =                  size of the input 
    181181                maxlength               max length of the input 
    182             
    183                 displayLabel            (boolean default = true) use this if you want the object to display a label tag above the input  
     182 
     183                displayLabel            (boolean default = true) use this if you want the object to display a label tag above the input 
    184184                                                when displaying 
    185                                                  
     185 
    186186                                                ==overridable variables== 
    187                                                  
     187 
    188188                message =               message displayed if not validated 
    189189                name =                  if your input needs a name different from the id 
    190             
     190 
    191191                                                == variable setting methods == 
    192                                                  
     192 
    193193                setAttribute($name,$values) 
    194                                                  
     194 
    195195                                                Use this method to set an additional HTML property for the input 
    196196                                                e.g. setAttribute("onclick","someJavascriptFunction()") 
    197                                                  
     197 
    198198                                                == methods == 
    199199                getJSMods() 
    200                  
     200 
    201201                                                Typically this get called from the form container object, but 
    202202                                                you can use it to get an array of all the Javascript this input affects (include, top JS, and bottom JS) 
    203                                                  
     203 
    204204                display() 
    205                                                  
    206                                                 Use this method to display the input in your page.                               
     205 
     206                                                Use this method to display the input in your page. 
    207207        */ 
    208208 
     
    210210        var $name; 
    211211        var $value; 
    212          
     212 
    213213        var $displayName =""; 
    214214        var $message = ""; 
    215215        var $displayLabel = true; 
    216          
     216 
    217217        var $_attributes = array(); 
    218          
     218 
    219219        var $required = false; 
    220220        var $type = NULL; 
    221          
     221 
    222222        var $jsIncludes = array(); 
    223          
     223 
    224224        function inputField($id, $value, $displayName = NULL ,$required = false, $type = NULL, $size = 32, $maxlength = 128, $displayLabel = true){ 
    225225                $this->id = $id; 
     
    229229                else 
    230230                        $this->displayName = $displayName; 
    231                          
     231 
    232232                if($size) 
    233233                        $this->_attributes["size"] = $size; 
    234234                if($maxlength) 
    235235                        $this->_attributes["maxlength"] = $maxlength; 
    236                  
     236 
    237237                $this->displayLabel = $displayLabel; 
    238                  
     238 
    239239                $this->value = $value; 
    240240 
     
    242242                $this->type = $type; 
    243243        } 
    244          
    245          
     244 
     245 
    246246        function setAttribute($name,$value){ 
    247247                $this->_attributes[strtolower($name)] = $value; 
    248248        } 
    249249 
    250          
     250 
    251251        function getJSMods(){ 
    252252                $thereturn = array("jsIncludes" => array(), "topJS" => array(), "bottomJS" => array(), "onload" => array()); 
    253                  
     253 
    254254                foreach($this->jsIncludes as $theinclude) 
    255255                        $thereturn["jsIncludes"][] = $theinclude; 
     
    261261                        $thereturn["topJS"][] = "requiredArray[requiredArray.length]=new Array(\"".$this->name."\",\"".$message."\");"; 
    262262                } 
    263                  
     263 
    264264                if($this->type){ 
    265                         $message = $this->message;                       
     265                        $message = $this->message; 
    266266                        if($message == ""){ 
    267267                                switch($this->type){ 
     
    286286                                        case "time": 
    287287                                                $message = $this->displayName." must be a valid time."; 
    288                                         break;                                   
     288                                        break; 
    289289                                } 
    290290                        }//end if 
    291291                        $thereturn["topJS"][] = $this->type."Array[".$this->type."Array.length]=new Array(\"".$this->name."\",\"".$message."\");"; 
    292292                } 
    293                  
     293 
    294294                return $thereturn; 
    295295        }//end if 
    296          
    297          
     296 
     297 
    298298        function displayAttributes(){ 
    299299                foreach($this->_attributes as $key => $value) 
    300                         echo " ".$key."=\"".$value."\"";                 
    301         } 
    302          
    303          
     300                        echo " ".$key."=\"".$value."\""; 
     301        } 
     302 
     303 
    304304        function showLabel(){ 
    305                 ?><label for="<?php echo $this->id?>" <?php  
     305                ?><label for="<?php echo $this->id?>" <?php 
    306306                        if(isset($this->_attributes["class"])) 
    307307                                if(strpos($this->_attributes["class"],"important") !== false) 
     
    309309                ?>><?php echo $this->displayName?></label><br /><?php 
    310310        } 
    311          
    312          
    313         function display(){ 
    314                  
    315                 if($this->displayLabel) 
    316                         $this->showLabel(); 
    317                  
    318                 ?><input type="text" id="<?php echo $this->id?>" name="<?php echo $this->name?>" <?php  
    319                         if($this->value !== "")  
     311 
     312 
     313        function display(){ 
     314 
     315                if($this->displayLabel) 
     316                        $this->showLabel(); 
     317 
     318                ?><input type="text" id="<?php echo $this->id?>" name="<?php echo $this->name?>" <?php 
     319                        if($this->value !== "") 
    320320                                echo " value=\"".htmlQuotes($this->value)."\""; 
    321321                        $this->displayAttributes(); 
    322322                ?> /><?php 
    323                  
     323 
    324324                switch($this->type){ 
    325325                        case "email": 
    326326                                ?><button id="<?php echo $this->id?>Button" type="button" class="graphicButtons buttonEmail" onclick="openEmail('<?php echo $this->id?>')" title="Send E-Mail"><span>send e-mail</span></button><?php 
    327327                        break; 
    328                          
     328 
    329329                        case "www": 
    330330                                ?><button id="<?php echo $this->id?>Button" type="button" class="graphicButtons buttonWWW" onclick="openWebpage('<?php echo $this->id?>')" title="Visit site in new window"><span>visit site</span></button><?php 
    331331                        break; 
    332332                } 
    333                  
     333 
    334334        }//end method 
    335335}//end class 
     
    344344        */ 
    345345        function inputCheckbox($id,$value = false, $displayName = NULL, $disabled = false, $displayLabel = true){ 
    346                  
     346 
    347347                parent::inputField($id, $value, $displayName, false, NULL, NULL, NULL, $displayLabel); 
    348                  
     348 
    349349                if($disabled) 
    350                         $this->_attributes["disabled"] = "disabled";             
    351         }//end method 
    352          
     350                        $this->_attributes["disabled"] = "disabled"; 
     351        }//end method 
     352 
    353353        function showLabel(){ 
    354354                $classText=""; 
     
    363363                if($classText!="") 
    364364                        $classText = ' class="'.$classText.'"'; 
    365                          
     365 
    366366                ?><label id="<?php echo $this->id?>Label" for="<?php echo $this->id?>" <?php echo $classText?>><?php echo $this->displayName?></label><?php 
    367367        } 
     
    369369 
    370370        function display(){ 
    371                 ?><input type="checkbox" id="<?php echo $this->id?>" name="<?php echo $this->name?>" value="1" class="radiochecks" <?php  
     371                ?><input type="checkbox" id="<?php echo $this->id?>" name="<?php echo $this->name?>" value="1" class="radiochecks" <?php 
    372372                        if($this->value) echo "checked=\"checked\" "; 
    373373                        $this->displayAttributes(); 
    374                 ?> /> <?php  
    375                  
     374                ?> /> <?php 
     375 
    376376                if($this->displayLabel) 
    377377                        $this->showLabel(); 
     
    387387        function inputBasicList ($id,$value = "",$list = array(), $displayName = NULL, $displayLabel = true){ 
    388388                parent::inputField($id, $value, $displayName, false, NULL, NULL, NULL, $displayLabel); 
    389                  
     389 
    390390                $this->thelist = $list; 
    391391        } 
    392          
    393         function display(){ 
    394          
    395                 if($this->displayLabel) 
    396                         $this->showLabel(); 
    397          
    398                 ?><select name="<?php echo $this->name?>" id="<?php echo $this->id?>" <?php  
    399                         $this->displayAttributes();              
     392 
     393        function display(){ 
     394 
     395                if($this->displayLabel) 
     396                        $this->showLabel(); 
     397 
     398                ?><select name="<?php echo $this->name?>" id="<?php echo $this->id?>" <?php 
     399                        $this->displayAttributes(); 
    400400                ?> > <?php 
    401401                        foreach($this->thelist as $key => $value){ 
    402                                                                                          
     402 
    403403                                ?><option value="<?php echo htmlQuotes($value)?>" <?php if ($value == $this->value) echo " selected=\"selected\" "?> ><?php echo $key?></option><?php echo "\n"; 
    404404 
     
    421421           hasblank =           boolean, wehterh <none> (0) can be an option 
    422422        */ 
    423          
    424         function inputDataTableList($db, $id, $value, $table, $valuefield, $displayfield,  
     423 
     424        function inputDataTableList($db, $id, $value, $table, $valuefield, $displayfield, 
    425425                                                                $whereclause = "", $orderclause = "", $hasblank = true, $displayName=NULL, $displayLabel = true){ 
    426                                                                  
     426 
    427427                parent::inputField($id, $value, $displayName, false, NULL, NULL, NULL, $displayLabel); 
    428                  
     428 
    429429                $this->hasblank = $hasblank; 
    430430                $this->db = $db; 
     
    435435                if($orderclause) 
    436436                        $querystatement.=" ORDER BY ".$orderclause; 
    437                  
     437 
    438438                $this->queryresult=$this->db->query($querystatement); 
    439439 
    440440        }//end method 
    441          
    442         function display(){ 
    443                  
    444                 if($this->displayLabel) 
    445                         $this->showLabel(); 
    446  
    447                 ?><select name="<?php echo $this->name?>" id="<?php echo $this->id?>" <?php  
     441 
     442        function display(){ 
     443 
     444                if($this->displayLabel) 
     445                        $this->showLabel(); 
     446 
     447                ?><select name="<?php echo $this->name?>" id="<?php echo $this->id?>" <?php 
    448448                        $this->displayAttributes(); 
    449449                ?> ><?php 
     
    460460                        } 
    461461                ?></select> 
    462                 <?php            
    463                  
     462                <?php 
     463 
    464464        } 
    465465}//end class 
     
    474474        function inputChoiceList($db, $id, $value, $listname, $displayName="", $blankvalue="none", $displayLabel = true){ 
    475475                parent::inputField($id, $value, $displayName, false, NULL, NULL, NULL, $displayLabel); 
    476                  
     476 
    477477                $this->db = $db; 
    478478                $this->listname = $listname; 
    479479                $this->blankvalue = $blankvalue; 
    480                  
     480 
    481481                $querystatement="SELECT thevalue FROM choices WHERE listname=\"".$this->listname."\" ORDER BY thevalue;"; 
    482482                $this->queryresult = $this->db->query($querystatement); 
    483                  
     483 
    484484                $this->jsIncludes[] = "common/javascript/choicelist.js"; 
    485485 
     
    490490                if($this->displayLabel) 
    491491                        $this->showLabel(); 
    492                 ?><select name="<?php echo $this->name?>" id="<?php echo $this->id?>" <?php  
     492                ?><select name="<?php echo $this->name?>" id="<?php echo $this->id?>" <?php 
    493493                        $this->displayAttributes(); 
    494494                        ?> onchange="changeChoiceList(this,'<?php echo APP_PATH?>','<?php echo $this->listname?>','<?php echo $this->blankvalue?>');"  onfocus="setInitialML(this)"> 
    495                 <?php  
     495                <?php 
    496496                        $inlist=false; 
    497497                        while($therecord = $this->db->fetchArray($this->queryresult)){ 
     
    520520                                        $theclass=""; 
    521521                                } 
    522                                 ?><option value="<?php echo $this->value?>" <?php echo $theclass?> selected="selected"><?php echo $display?></option><?php                                       
     522                                ?><option value="<?php echo $this->value?>" <?php echo $theclass?> selected="selected"><?php echo $display?></option><?php 
    523523                        }//end if 
    524524                ?> 
    525         <option value="*mL*" class="choiceListModify">modify list...</option></select><?php  
     525        <option value="*mL*" class="choiceListModify">modify list...</option></select><?php 
    526526 
    527527        } 
     
    534534 
    535535        function inputCurrency($id, $value, $displayName = NULL ,$required = false, $size = 10, $maxlength = 12, $displayLabel = true){ 
    536          
     536 
    537537                $type = NULL; 
    538538                parent::inputField($id, $value, $displayName,$required, $type, $size, $maxlength, $displayLabel); 
     
    547547                if(!is_numeric($this->value)) $this->value = 0; 
    548548                $this->value = htmlQuotes(numberToCurrency($this->value)); 
    549                  
     549 
    550550                if(!isset($this->_attributes["onchange"])) $this->_attributes["onchange"] = ""; 
    551551                $this->_attributes["onchange"] = "validateCurrency(this);".$this->_attributes["onchange"]; 
    552552 
    553                 if(!isset($this->_attributes["class"]))  
     553                if(!isset($this->_attributes["class"])) 
    554554                        $this->_attributes["class"] = ""; 
    555555                else 
    556556                        $this->_attributes["class"] = " ".$this->_attributes["class"]; 
    557                  
     557 
    558558                $this->_attributes["class"] = "currency".$this->_attributes["class"]; 
    559559 
    560                  
     560 
    561561                ?><input name="<?php echo $this->name?>" id="<?php echo $this->id?>" type="text" value="<?php echo $this->value?>" <?php 
    562562                        $this->displayAttributes(); 
     
    570570//============================================================================================ 
    571571class inputTextarea extends inputField{ 
    572          
     572 
    573573        function inputTextarea($id, $value, $displayName = NULL ,$required = false, $rows = 5, $cols= 48, $displayLabel = true){ 
    574574                parent::inputField($id, $value, $displayName, $required, NULL, NULL, NULL, $displayLabel); 
     
    578578 
    579579                $this->_attributes["rows"] = $rows; 
    580                 $this->_attributes["cols"] = $cols;              
    581                          
    582         } 
    583          
    584  
    585         function display(){ 
    586  
    587                 if($this->displayLabel) 
    588                         $this->showLabel(); 
    589                  
    590                 ?><textarea id="<?php echo $this->id?>" name="<?php echo $this->name?>" <?php  
     580                $this->_attributes["cols"] = $cols; 
     581 
     582        } 
     583 
     584 
     585        function display(){ 
     586 
     587                if($this->displayLabel) 
     588                        $this->showLabel(); 
     589 
     590                ?><textarea id="<?php echo $this->id?>" name="<?php echo $this->name?>" <?php 
    591591                        $this->displayAttributes(); 
    592592                ?>><?php echo htmlQuotes($this->value)?></textarea><?php 
    593          
     593 
    594594        }//end method 
    595595 
     
    603603        */ 
    604604        function inputPercentage($id, $value, $displayName = NULL , $precision = 1, $required = false, $size = 9, $maxlength = 10, $displayLabel = true){ 
    605                  
     605 
    606606                $this->precision = (int) $precision; 
    607                  
     607 
    608608                $type = NULL; 
    609609                parent::inputField($id, $value, $displayName,$required, $type, $size, $maxlength, $displayLabel); 
     
    613613 
    614614        function display() { 
    615          
    616                 if($this->displayLabel) 
    617                         $this->showLabel(); 
    618  
    619                 if(is_numeric($this->value)) $this->value = $this->value."%";    
    620                  
     615 
     616                if($this->displayLabel) 
     617                        $this->showLabel(); 
     618 
     619                if(is_numeric($this->value)) $this->value = $this->value."%"; 
     620 
    621621                if(!isset($this->_attributes["onchange"])) $this->_attributes["onchange"] = ""; 
    622622                $this->_attributes["onchange"] = "validatePercentage(this,".$this->precision.");".$this->_attributes["onchange"]; 
     
    636636        function inputDatePicker($id, $value, $displayName = NULL ,$required = false, $size = 10, $maxlength = 15, $displayLabel = true){ 
    637637                $type = "date"; 
    638                  
     638 
    639639                parent::inputField($id, $value, $displayName,$required, $type, $size, $maxlength, $displayLabel); 
    640                  
     640 
    641641                $this->jsIncludes[] = "common/javascript/datepicker.js"; 
    642642        } 
    643          
     643 
    644644        function display(){ 
    645645 
     
    648648 
    649649                $value = formatFromSQLDate($this->value); 
    650                  
     650 
    651651                if(!isset($this->_attributes["onchange"])) $this->_attributes["onchange"] = ""; 
    652652                $this->_attributes["onchange"] = "formatDateField(this);".$this->_attributes["onchange"]; 
    653                  
     653 
    654654                ?><input name="<?php echo $this->name?>" id="<?php echo $this->id?>" type="text" value="<?php echo $value?>" <?php 
    655655                        $this->displayAttributes(); 
    656656                ?>/><button id="<?php echo $this->id?>Button" type="button" class="graphicButtons buttonDate" onclick="showDP('<?php echo APP_PATH?>','<?php echo $this->id?>');"><span>pick date</span></button><?php 
    657                  
    658         }//end method 
    659          
     657 
     658        }//end method 
     659 
    660660}//end class 
    661661 
     
    666666        function inputTimePicker($id, $value, $displayName = NULL ,$required = false, $size = 10, $maxlength = 15, $displayLabel = true){ 
    667667                $type = "time"; 
    668                  
     668 
    669669                parent::inputField($id, $value, $displayName,$required, $type, $size, $maxlength, $displayLabel); 
    670                                  
     670 
    671671                $this->jsIncludes[] = "common/javascript/timepicker.js"; 
    672672        } 
     
    678678 
    679679                $value = formatFromSQLTime($this->value); 
    680                                  
     680 
    681681                ?><input name="<?php echo $this->name?>" id="<?php echo $this->id?>" type="text" value="<?php echo $value?>" <?php 
    682682                        $this->displayAttributes(); 
    683683                ?>/><button id="<?php echo $this->id?>Button" type="button" class="graphicButtons buttonTime" onclick="showTP('<?php echo APP_PATH?>','<?php echo $this->id?>');"><span>pick time</span></button><?php 
    684                  
    685         }//end method 
    686  
    687 }//end class 
    688  
    689   
     684 
     685        }//end method 
     686 
     687}//end class 
     688 
     689 
    690690//============================================================================================ 
    691691class inputRolesList extends inputField{ 
    692692 
    693693        function inputRolesList($db,$id,$selected,$displayName = NULL, $required = false, $displayLabel = true){ 
    694                                  
     694 
    695695                parent::inputField($id, $selected, $displayName, $required, NULL, NULL, NULL, $displayLabel); 
    696696 
    697697                $this->db = $db; 
    698                  
     698 
    699699                $querystatement = "SELECT name, id FROM roles WHERE inactive = 0"; 
    700700                $this->queryresult = $this->db->query($querystatement); 
    701                          
    702         } 
    703          
    704          
    705         function display(){ 
    706                 if($this->displayLabel) 
    707                         $this->showLabel(); 
    708                  
     701 
     702        } 
     703 
     704 
     705        function display(){ 
     706                if($this->displayLabel) 
     707                        $this->showLabel(); 
     708 
    709709                        ?><select id="<?php echo $this->id?>" name="<?php echo $this->name?>" <?php $this->displayAttributes();?>> 
    710710                        <option value="0" <?php if($this->value==0) echo "selected=\"selected\""?>>EVERYONE</option> 
    711711                        <?php while($therecord = $this->db->fetchArray($this->queryresult)){ ?> 
    712                         <option value="<?php echo $therecord["id"]?>" <?php if($this->value==$therecord["id"]) echo "selected=\"selected\""?>><?php echo $therecord["name"]?></option>   
     712                        <option value="<?php echo $therecord["id"]?>" <?php if($this->value==$therecord["id"]) echo "selected=\"selected\""?>><?php echo $therecord["name"]?></option> 
    713713                        <?php }?> 
    714714                        <option value="-100" <?php if($this->value == -100) echo "selected=\"selected\""?>>Administrators</option> 
     
    716716 
    717717        } 
    718          
     718 
    719719}//end class 
    720720 
     
    732732                maxlength =             (int)           max length attribute for displayed input tag (255) 
    733733                displayLabel    (boolean)       Show label tag with displayName (true) 
    734                  
    735                 The JS used by this field type requires that the field NOT be implemented inside a p tag,   
    736                 inline element, or any tag that should not contain a div tag.  In IE, if the field placed  
    737                 inside an element that should not be able to handle a DIV tag inside it (standards-wise),  
     734 
     735                The JS used by this field type requires that the field NOT be implemented inside a p tag, 
     736                inline element, or any tag that should not contain a div tag.  In IE, if the field placed 
     737                inside an element that should not be able to handle a DIV tag inside it (standards-wise), 
    738738                IE will report a Javascript error. 
    739739*/ 
    740         function inputSmartSearch($db, $id, $searchName, $initialvalue = "", $displayName = NULL, $required=false,  
    741                                                                                 $size = 32, $maxlength = 255, $displayLabel = true)  { 
     740        function inputSmartSearch($db, $id, $searchName, $initialvalue = "", $displayName = NULL, $required=false, 
     741                                        $size = 32, $maxlength = 255, $displayLabel = true, $allowFreeForm = false)  { 
    742742                $this->db = $db; 
    743                  
     743 
    744744                parent::inputField($id, $initialvalue, $displayName,$required, NULL, $size, $maxlength, $displayLabel); 
    745745 
    746746                $this->searchName = $searchName; 
     747                $this->allowFreeForm = $allowFreeForm; 
     748 
    747749 
    748750                //next I need to initialize and do the correct search 
    749751                $this->searchInfo = $this->getSearchInfo($searchName); 
    750                  
     752 
    751753                $this->displayValue = $this->getInitialDisplay(); 
    752754 
     
    755757 
    756758        function getSearchInfo($searchInfo){ 
    757          
     759 
    758760                $querystatement = " 
    759761                        SELECT 
     
    764766                                name = '".mysql_real_escape_string($searchInfo)."' 
    765767                "; 
    766                  
     768 
    767769                return  $this->db->fetchArray($this->db->query($querystatement)); 
    768770 
    769771        }//end method getInfo 
    770          
     772 
    771773        function getInitialDisplay(){ 
    772          
     774 
    773775                $querystatement = " 
    774776                        SELECT 
     
    779781                                ".$this->searchInfo["valuefield"]." = '".mysql_real_escape_string($this->value)."' 
    780782                "; 
    781                  
     783 
    782784                $queryresult = $this->db->query($querystatement); 
    783785 
     
    786788                        $therecord = $this->db->fetchArray($queryresult); 
    787789                        return $therecord["display"]; 
    788                          
     790 
    789791                } else 
    790792                        return ''; 
    791          
     793 
    792794        }//end method getInitialDisplay 
    793795 
     
    795797        // CLASS OVERIDES ================================================ 
    796798        function getJSMods(){ 
    797          
     799 
    798800                $thereturn = array("jsIncludes" => array(), "topJS" => array(), "bottomJS" => array(), "onload" => array()); 
    799                  
     801 
    800802                $thereturn["jsIncludes"][] = "common/javascript/smartsearch.js"; 
    801803 
    802804                if($this->required){ 
    803                  
     805 
    804806                        $message = $this->message; 
    805                          
     807 
    806808                        if($message == "") 
    807809                                $message = $this->displayName." cannot be blank."; 
    808810                        $thereturn["topJS"][] = "requiredArray[requiredArray.length]= [ '".$this->name."','".$message."' ];"; 
    809                          
     811 
    810812                }//endif - required 
    811                  
     813 
    812814                return $thereturn; 
    813                                  
     815 
    814816        }//end method - getJSMods 
    815          
     817 
    816818 
    817819        function showLabel(){ 
     
    819821        }//end method 
    820822 
    821          
    822         function display(){ 
    823          
    824                 if($this->displayLabel) 
    825                         $this->showLabel(); 
    826  
    827                 if(!isset($this->_attributes["class"]))  
     823 
     824        function display(){ 
     825 
     826                if($this->displayLabel) 
     827                        $this->showLabel(); 
     828 
     829                if(!isset($this->_attributes["class"])) 
    828830                        $this->_attributes["class"] = ""; 
    829831                else 
    830832                        $this->_attributes["class"] = " ".$this->_attributes["class"]; 
    831                  
     833 
    832834                $this->_attributes["class"] = "inputSmartSearch".$this->_attributes["class"]; 
    833835 
    834836                ?><input type="hidden" name="<?php echo $this->id?>" id="<?php echo $this->id?>" value="<?php echo $this->value?>" /> 
     837                <input type="hidden" id="sff-<?php echo $this->id?>" value="<?php echo ((int) $this->allowFreeForm); ?>"/> 
    835838                <input type="hidden" id="sdbid-<?php echo $this->id?>" value="<?php echo $this->searchInfo["id"]?>"/> 
    836                 <input type="text" name="ds-<?php echo $this->id?>" id="ds-<?php echo $this->id?>"  title="Use % for wildcard searches." <?php  
    837                          
     839                <input type="text" name="ds-<?php echo $this->id?>" id="ds-<?php echo $this->id?>"  title="Use % for wildcard searches." <?php 
     840 
    838841                $this->displayAttributes(); 
    839                  
    840                 ?> value="<?php echo htmlQuotes($this->displayValue) ?>"/><?php  
     842 
     843                ?> value="<?php echo htmlQuotes($this->displayValue) ?>"/><?php 
    841844 
    842845        }//end method -display 
    843                  
     846 
    844847}//end class - inputSmartSearch 
    845848?> 
  • branches/nathan/include/jstransport.php

    r349 r450  
    4040 
    4141        ?>LOGIN_REFRESH=<?php echo LOGIN_REFRESH?>;<?php 
    42  
     42         
     43        if(defined("TERM1_DAYS")){ 
    4344        ?>TERM1_DAYS=<?php echo TERM1_DAYS?>;<?php 
     45        }//end if 
    4446         
    4547        ?>MONTH_NAMES_LONG= [ <?php  
  • branches/nathan/install/install_include.php

    r386 r450  
    22function processSQLfile($db,$filename){ 
    33        global $dblink; 
    4                          
     4 
    55        $thefile = @ fopen($filename,"r"); 
    6         if(!$thefile)  
     6        if(!$thefile) 
    77                return "Could not open the file ".$filename.".\n"; 
    88 
     
    2929        else 
    3030                $querystatement="SELECT id FROM users WHERE login=\"".mysql_real_escape_string($user)."\" AND password=encode(\"".mysql_real_escape_string($pass)."\",\"".ENCRYPTION_SEED."\") AND accesslevel>=90"; 
    31          
     31 
    3232        $queryresult=$db->query($querystatement); 
    33                          
     33 
    3434        if(!$queryresult) 
    3535                return false; 
     
    4444 
    4545        $ver=$db->fetchArray($queryresult); 
    46         return $ver["version"];                  
     46        return $ver["version"]; 
    4747} 
    4848 
     
    5252 
    5353        $thedir= @ opendir("../modules/"); 
    54          
     54 
    5555        echo 'modules = Array();'."\n"; 
    56          
     56 
    5757        $modules = array(); 
    5858        while($entry=readdir($thedir)){ 
     
    6060                        if(file_exists("../modules/".$entry."/install/".$type.".php") && file_exists("../modules/".$entry."/install/version.php")){ 
    6161                                include("../modules/".$entry."/install/version.php"); 
    62                         }                                        
     62                        } 
    6363                } 
    64         }                
    65          
     64        } 
     65 
    6666        foreach($modules as $name=>$module) 
    6767                if(is_array($module)){ 
     
    7070                                echo 'modules["'.$name.'"]["'.$key.'"] = "'.$value.'";'."\n"; 
    7171                } 
    72          
     72 
    7373        @ chdir ($currdirectory); 
    74          
     74 
    7575        return $modules; 
    7676}//end function 
    7777 
    78          
     78 
    7979function showModules($modules){ 
    8080        if(is_array($modules)){ 
     
    9292        $sqlstatement=""; 
    9393        $thereturn = ""; 
    94          
     94 
    9595        $createfile = @ fopen("createtables.sql","r"); 
    96         if(!$createfile)  
    97                 return "Could not open SQL file: ".sqlfile; 
     96        if(!$createfile) 
     97                return "Could not open SQL file: ".$sqlfile; 
    9898        else{ 
    9999                while(!feof($createfile)) { 
    100100                        $sqlstatement.= @ fgets($createfile,1024); 
    101101                        if(strpos($sqlstatement,";")){ 
    102                          
    103                                 $theresult = $db->query(trim($sqlstatement));  
    104                                  
     102 
     103                                $theresult = $db->query(trim($sqlstatement)); 
     104 
    105105                                if($db->error){ 
    106106                                        return "Error creating tables: ".$db->error."\n\n".trim($sqlstatement); 
     
    109109                        }//end if; 
    110110                }//end while 
    111                  
    112         }//end if        
     111 
     112        }//end if 
    113113 
    114114        return true; 
     
    117117 
    118118function importData($db,$tablename){ 
    119          
     119 
    120120        $tablefile = @ fopen($tablename.".sql","rb"); 
    121         if(!$tablefile)  
     121        if(!$tablefile) 
    122122                return "Could not open the file ".$tablename.".sql\n"; 
    123123 
     
    125125        $counter=0; 
    126126        $failure = false; 
    127          
     127 
    128128        while(!feof($tablefile)) { 
    129129                $sqlstatement=trim(fgets($tablefile,8184)); 
     
    142142                }//end if; 
    143143        }//end while 
    144          
     144 
    145145        if($failure) 
    146146                $threturn = "Importing of some records in ".$tablename." occured.\n\n"; 
    147147        else 
    148148                $thereturn.="Import of ".$counter." record(s) for '".$tablename."' complete.\n"; 
    149          
     149 
    150150        return $thereturn; 
    151151}//end function 
  • branches/nathan/modules/base/adminsettings.php

    r419 r450  
    1 <?php  
     1<?php 
    22/* 
    33 $Rev$ | $LastChangedBy$ 
     
    5252        goURL(APP_PATH."noaccess.php"); 
    5353 
    54 if (isset($_POST["command"]))  
     54if (isset($_POST["command"])) 
    5555        $statusmessage = $settings->processForm($_POST); 
    5656 
     
    7171        $theform = new phpbmsForm(); 
    7272        $theform->enctype="multiform/form-data"; 
    73          
     73 
    7474        $theinput = new inputField("application_name",$therecord["application_name"],"application name",true); 
    7575        $theform->addField($theinput); 
     
    7777        $theinput = new inputField("record_limit",$therecord["record_limit"],"record display limit",true,"integer",5,3); 
    7878        $theform->addField($theinput); 
    79                  
     79 
    8080        $theinput = new inputField("default_load_page",$therecord["default_load_page"],"default page",true); 
    8181        $theform->addField($theinput); 
    82          
     82 
    8383        $theinput = new inputField("encryption_seed",$therecord["encryption_seed"],"encryption_seed",true); 
    8484        $theinput->setAttribute("readonly","readonly"); 
    85         $theinput->setAttribute("class","uneditable");   
     85        $theinput->setAttribute("class","uneditable"); 
    8686        $theform->addField($theinput); 
    8787 
     
    108108        foreach($phpbms->modules as $module => $moduleinfo) 
    109109                if($module != "base" && class_exists($module."Display")){ 
    110                  
     110 
    111111                        $class = $module."Display"; 
    112112                        $theform->extraModules[$module] = new $class(); 
     
    116116                        foreach($additionalFields as $field) 
    117117                                $theform->addField($field); 
    118                 }                        
    119          
     118                } 
     119 
    120120 
    121121        $theform->jsMerge(); 
    122122        //============================================================== 
    123123        //End Form Elements 
    124                  
     124 
    125125        include("header.php"); 
    126126?> 
    127127<div class="bodyline"> 
    128128        <form action="<?php echo $_SERVER["PHP_SELF"]?>" method="post" enctype="multipart/form-data" name="record" onsubmit="return processForm(this);"> 
    129                  
     129 
    130130        <h1 id="h1Title"><span><?php echo $pageTitle ?></span></h1> 
    131          
     131 
    132132        <div id="phpbmsSplash" class="box"> 
    133133                <div id="phpbmslogo"> 
     
    139139                </div> 
    140140        </div> 
    141          
     141 
    142142        <fieldset> 
    143143                <legend>general</legend> 
    144                  
    145                 <p>              
     144 
     145                <p> 
    146146                        <?php $theform->fields["application_name"]->display();?><br /> 
    147147                        <span class="notes"> 
     
    154154                        <?php $theform->fields["record_limit"]->display();?> 
    155155                </p> 
    156                  
     156 
    157157                <p> 
    158158                        <?php $theform->fields["default_load_page"]->display();?> 
     
    163163                        <select id="stylesheet" name="stylesheet"> 
    164164                                <?php $settings->displayStylesheets($therecord["stylesheet"]);?> 
    165                         </select>                
    166                 </p>             
     165                        </select> 
     166                </p> 
    167167        </fieldset> 
    168168        <p class="updateButtonP"><input name="command" type="submit" class="Buttons" value="update settings" /></p> 
    169                          
     169 
    170170        <fieldset> 
    171171                <legend>company</legend> 
    172                 <p>              
     172                <p> 
    173173                        <label for="company_name">company name</label><br /> 
    174174                        <input id="company_name" name="company_name" type="text" size="40" maxlength="128" value="<?php echo htmlQuotes($therecord["company_name"]) ?>" /> 
     
    179179                        <input id="company_address" name="company_address" type="text" value="<?php echo htmlQuotes($therecord["company_address"]) ?>" size="40" maxlength="128" /> 
    180180                </p> 
    181                  
     181 
    182182                <p> 
    183183                        <label for="company_csz">city, state/province and zip/postal code</label><br /> 
    184184                        <input id="company_csz" name="company_csz" type="text" size="40" maxlength="128"  value="<?php echo htmlQuotes($therecord["company_csz"]) ?>" /> 
    185185                </p> 
    186                  
     186 
    187187                <p> 
    188188                        <label for="company_phone">phone number</label><br /> 
    189189                        <input id="company_phone" name="company_phone" type="text" value="<?php echo htmlQuotes($therecord["company_phone"]) ?>" size="40" maxlength="128" /> 
    190190                </p> 
    191          
    192                 <p> 
     191 
     192                <?php if(isset($therecord["company_taxid"])){?> 
     193                <p> 
    193194                        <label for="company_taxid">company tax id</label><br /> 
    194195                        <input id="company_taxid" name="company_taxid" type="text" value="<?php echo htmlQuotes($therecord["company_taxid"]) ?>" size="40" maxlength="128" /> 
    195196                </p> 
     197                <?php }//endif - tax id?> 
    196198 
    197199                <div class="fauxP"> 
     
    199201                        <div id="graphicHolder"><img alt="logo" src="<?php echo APP_PATH?>dbgraphic.php?t=files&amp;f=file&amp;mf=type&amp;r=1" /></div> 
    200202                </div> 
    201                  
     203 
    202204                <p> 
    203205                        <label for="printedlogo">upload new logo file</label> <span class="notes">(PNG or JPEG format)</span><br /> 
    204206                        <input id="printedlogo" name="printedlogo" type="file" size="64" /><br /> 
    205207                </p> 
    206                  
     208 
    207209                <p class="notes"> 
    208210                        <strong>Note:</strong> This graphic is used on some reports. <br /> 
     
    213215        </fieldset> 
    214216        <p class="updateButtonP"><input name="command" type="submit" class="Buttons" value="update settings" /></p> 
    215                  
     217 
    216218        <fieldset> 
    217219                <legend>Localization</legend> 
     
    256258        </fieldset> 
    257259        <p class="updateButtonP"><input name="command" type="submit" class="Buttons" value="update settings" /></p> 
    258          
     260 
    259261        <fieldset> 
    260262                <legend>encryption seed</legend> 
     
    271273                </p> 
    272274 
    273                 <p>      
     275                <p> 
    274276                        <?php $theform->fields["encryption_seed"]->display();?> 
    275277                </p> 
     
    295297                <p class="notes"><strong>Note:</strong> Does not work with Microsoft Internet Explorer versions less than 7. 
    296298                </p> 
    297         </fieldset>      
     299        </fieldset> 
    298300        <p class="updateButtonP"><input name="command" type="submit" class="Buttons" value="update settings" /></p> 
    299          
    300         <?php    
     301 
     302        <?php 
    301303        foreach($theform->extraModules as $module) 
    302304                if(method_exists($module,"display")){ 
  • branches/nathan/modules/base/include/snapshot_include.php

    r308 r450  
    1 <?php  
     1<?php 
    22/* 
    33 $Rev$ | $LastChangedBy$ 
     
    3737 +-------------------------------------------------------------------------+ 
    3838*/ 
    39 function showSystemMessages($db){ 
    40         $querystatement="SELECT notes.id,subject,content,concat(users.firstname,\" \",users.lastname) as createdby, 
    41                                         notes.creationdate 
    42                                         FROM notes INNER JOIN users ON notes.createdby=users.id 
    43                                         WHERE type=\"SM\" ORDER BY importance DESC,notes.creationdate"; 
    44                                          
    45         $queryresult=$db->query($querystatement); 
    46                  
    47         if($db->numRows($queryresult)){  
    48         ?> 
    49         <div class="box" id="systemMessageContainer">    
    50                 <h2>System Messages</h2> 
    51                 <?php while($therecord=$db->fetchArray($queryresult)) { 
    52                                 $therecord["content"]=str_replace("\n","<br />",htmlQuotes($therecord["content"])); 
     39class baseSnapshot{ 
     40 
     41        function baseSnapshot($db, $phpbms, $userid){ 
     42 
     43                $this->db = $db; 
     44                $this->phpbms = $phpbms; 
     45                $this->userid = $userid; 
     46 
     47        }//endmethod (init) 
     48 
     49 
     50        function showSystemMessages(){ 
     51 
     52                $querystatement = " 
     53                        SELECT 
     54                                notes.id, 
     55                                notes.subject, 
     56                                notes.content, 
     57                                concat(users.firstname,' ',users.lastname) AS createdby, 
     58                                notes.creationdate 
     59                        FROM 
     60                                notes INNER JOIN users ON notes.createdby=users.id 
     61                        WHERE 
     62                                type='SM' 
     63                        ORDER BY 
     64                                importance DESC, 
     65                                notes.creationdate"; 
     66 
     67                $queryresult = $this->db->query($querystatement); 
     68 
     69                if($this->db->numRows($queryresult)){ ?> 
     70 
     71                <div class="box" id="systemMessageContainer"> 
     72                        <h2>System Messages</h2> 
     73                        <?php while($therecord = $this->db->fetchArray($queryresult)) { 
     74 
     75                                        $therecord["content"] = str_replace("\n","<br />",htmlQuotes($therecord["content"])); 
     76 
     77                        ?> 
     78                        <h3 class="systemMessageLinks"><?php echo htmlQuotes($therecord["subject"])?> <span>[ <?php echo htmlQuotes(formatFromSQLDateTime($therecord["creationdate"]))?> <?php echo htmlQuotes($therecord["createdby"])?>]</span></h3> 
     79                        <div class="systemMessages"> 
     80                                <p><?php echo $therecord["content"]?></p> 
     81                        </div> 
     82                        <?php }//end while ?> 
     83                </div> 
     84                <?php }//endif 
     85 
     86        }//end method showSystemMessages 
     87 
     88 
     89        function showTasks($type){ 
     90 
     91                $querystatement=" 
     92                        SELECT 
     93                                id, 
     94                                type, 
     95                                subject, 
     96                                completed, 
     97                                if(enddate < CURDATE(),1,0) AS ispastdue, 
     98                                if(assignedtodate < CURDATE(),1,0) AS ispastassigneddate, 
     99                                startdate, 
     100                                enddate, 
     101                                assignedtodate, 
     102                                private, 
     103                                assignedbyid, 
     104                                assignedtoid, 
     105                                IF(assignedtodate IS NOT NULL, assignedtodate, IF((enddate IS NOT NULL && type = 'TS'), enddate, IF((startdate IS NOT NULL && type = 'EV'), startdate, CURDATE()))) AS xdate 
     106                        FROM 
     107                                notes 
     108                        WHERE"; 
     109 
     110                switch($type){ 
     111 
     112                        case "ReceivedAssignments": 
     113 
     114                                $querystatement.=" 
     115                                        assignedtoid = ".$this->userid." 
     116                                         OR ( 
     117                                                type = 'TS' 
     118                                                AND (assignedtoid = 0 OR assignedtoid IS NULL) 
     119                                                AND createdby = ".$this->userid." 
     120                                        ) AND (completed = 0 
     121                                                OR (completed = 1 AND completeddate >= CURDATE()) 
     122                                        )"; 
     123 
     124                                $title = "Assignments"; 
     125                                $id = "AS"; 
     126                                break; 
     127 
     128                        case "GivenAssignments": 
     129 
     130                                $querystatement.=" 
     131                                        assignedbyid = ".$this->userid." 
     132                                        AND (completed = 0 
     133                                                OR (completed = 1 AND completeddate >= CURDATE()) 
     134                                        )"; 
     135 
     136                                $title = "Delegations"; 
     137                                $id = "DG"; 
     138                                break; 
     139 
     140                }//endswitch 
     141 
     142 
     143                $querystatement.="AND ( 
     144                                        (startdate IS NULL AND enddate IS NULL AND assignedtodate IS NULL) OR 
     145                                        (startdate IS NOT NULL AND startdate <= DATE_ADD(CURDATE(),INTERVAL 30 DAY)) OR 
     146                                        (enddate IS NOT NULL AND enddate <= DATE_ADD(CURDATE(),INTERVAL 30 DAY)) OR 
     147                                        (assignedtodate IS NOT NULL AND assignedtodate <= DATE_ADD(CURDATE(),INTERVAL 30 DAY)) 
     148                                   )"; 
     149 
     150                $querystatement.=" ORDER BY 
     151                                importance DESC, 
     152                                xdate, 
     153                                subject"; 
     154 
     155 
     156                $queryresult = $this->db->query($querystatement); 
     157 
     158                $numRows = $this->db->numRows($queryresult); 
    53159                ?> 
    54                 <h3 class="systemMessageLinks"><?php echo htmlQuotes($therecord["subject"])?> <span>[ <?php echo htmlQuotes(formatFromSQLDateTime($therecord["creationdate"]))?> <?php echo htmlQuotes($therecord["createdby"])?>]</span></h3>                   
    55                 <div class="systemMessages"> 
    56                         <p><?php echo $therecord["content"]?></p> 
    57                 </div>                                           
    58                 <?php }//end while ?> 
    59         </div> 
    60         <?php }  
    61 } 
    62  
    63  
    64 function showTasks($db,$userid,$type="Tasks"){ 
    65  
    66         global $phpbms; 
    67  
    68         $querystatement="SELECT id,type,subject, completed, if(enddate < CURDATE(),1,0) as ispastdue, startdate, enddate, private, assignedbyid, assignedtoid 
    69                                 FROM notes 
    70                                 WHERE "; 
    71         switch($type){ 
    72                 case "Tasks": 
    73                         $querystatement.=" type=\"TS\" AND (private=0 or (private=1 and createdby=".$userid."))  
    74                                                            AND (completed=0 or (completed=1 and completeddate=CURDATE())) 
    75                                                            AND (assignedtoid is null or assignedtoid=0)"; 
    76                         $title="Tasks"; 
    77                         $id = "TS"; 
    78                         break; 
    79                  
    80                 case "ReceivedAssignments": 
    81                         $querystatement.=" assignedtoid=".$userid." AND (completed=0 or (completed=1 and completeddate=CURDATE()))"; 
    82                         $title="Assignments"; 
    83                         $id = "AS"; 
    84                         break; 
    85                  
    86                 case "GivenAssignments": 
    87                         $querystatement.=" assignedbyid=".$userid." AND (completed=0 or (completed=1 and completeddate=CURDATE()))"; 
    88                         $title="Delegations"; 
    89                         $id = "DG"; 
    90                 break; 
    91         } 
    92         $querystatement.="AND ( 
    93                                         (startdate is null AND enddate is null) OR 
    94                                         (startdate is not null AND startdate <= DATE_ADD(CURDATE(),INTERVAL 7 DAY)) OR 
    95                                         (enddate is not null AND enddate <= DATE_ADD(CURDATE(),INTERVAL 7 DAY))  
    96                                    )"; 
    97  
    98         $querystatement.=" ORDER BY importance DESC,notes.enddate,notes.endtime,notes.startdate DESC,notes.starttime DESC,notes.creationdate DESC"; 
    99  
    100  
    101         $queryresult=$db->query($querystatement); 
    102          
    103         ?> 
    104         <h3 class="tasksLinks"><?php echo $title; if($db->numRows($queryresult)) {?> <span class="small">(<?php echo $db->numRows($queryresult)?>)</span><?php } ?></h3> 
    105         <div class="tasksDivs"><div> 
    106         <?php 
    107          
    108         if($db->numRows($queryresult)){          
    109                 while($therecord=$db->fetchArray($queryresult)) { 
    110  
    111                 $className="tasks"; 
    112  
    113                 if($therecord["completed"])  
    114                         $className.=" complete"; 
    115                 else if($therecord["ispastdue"])  
    116                         $className.=" pastDue"; 
    117  
    118                 if($therecord["private"]) $className.=" private"; 
    119          
    120                 $className.=" ".$therecord["type"]; 
    121                  
    122                 $checkBoxID = $id.$therecord["type"]."C".$therecord["id"]; 
    123         ?> 
    124         <p id="<?php echo $id.$therecord["id"]?>" class="<?php echo $className?>"> 
    125                 <input class="radiochecks taskChecks" id="<?php  echo $checkBoxID?>" name="<?php  echo $checkBoxID?>" type="checkbox" value="1" <?php if($therecord["completed"]) echo 'checked="checked"'?>  align="middle" /> 
    126                 <a href="<?php echo getAddEditFile($db,12)."?id=".$therecord["id"]?>&amp;backurl=snapshot.php"><?php echo htmlQuotes($therecord["subject"])?></a> 
    127                 <?php  
    128                         if($type == "Tasks") { 
    129                                 if($therecord["enddate"]) { 
    130                                 ?><em >(<?php echo htmlQuotes(formatFromSQLDate($therecord["enddate"])) ?>)</em><?php  
    131                                 } 
    132                         } else { 
    133                                 ?> <em>(<?php if($type=="ReceivedAssignments") $tid=$therecord["assignedbyid"]; else $tid=$therecord["assignedtoid"]; echo htmlQuotes($phpbms->getUserName($tid))?>)</em><?php  
    134                         } ?> 
    135         </p> 
    136         <?php } } else { 
    137         ?><p class="small disabledtext">no <?php echo strtolower($title)?></p><?php 
    138         }?></div></div> <?php  
    139 } 
    140  
     160 
     161                <h3 class="tasksLinks"><?php echo $title; if($numRows) {?> <span class="small">(<?php echo $numRows?>)</span><?php } ?></h3> 
     162 
     163                <div class="tasksDivs"> 
     164                        <div> 
     165 
     166                        <?php if($numRows){ 
     167 
     168                                $linkStart = getAddEditFile($this->db,12); 
     169                                $section["title"] = "Now"; 
     170                                $section["date"] = mktime(0,0,0,date("m"),date("d")+3,date("Y"));; 
     171 
     172                                while($therecord = $this->db->fetchArray($queryresult)) { 
     173 
     174                                        $className="tasks"; 
     175 
     176                                        if($therecord["completed"]) 
     177                                                $className.=" complete"; 
     178                                        else if($therecord["ispastdue"] || $therecord["ispastassigneddate"]) 
     179                                                $className.=" pastDue"; 
     180 
     181                                        if($therecord["private"]) $className.=" private"; 
     182 
     183                                        $className.=" ".$therecord["type"]; 
     184 
     185                                        $checkBoxID = $id.$therecord["type"]."C".$therecord["id"]; 
     186 
     187                                        $link = $linkStart."?id=".$therecord["id"]."&amp;backurl=snapshot.php"; 
     188 
     189                                        $rightSide = ""; 
     190 
     191                                        if($therecord["assignedtodate"]) 
     192                                                $rightSide .= "FUP: ".formatFromSQLDate($therecord["assignedtodate"])."<br />"; 
     193 
     194                                        switch($therecord["type"] ){ 
     195 
     196                                                case "TS": 
     197                                                        if($therecord["enddate"]) 
     198                                                                $rightSide .= "Due: ".formatFromSQLDate($therecord["enddate"])."<br />"; 
     199                                                        break; 
     200 
     201                                                case "EV": 
     202                                                        $rightSide .= "Start: ".formatFromSQLDate($therecord["startdate"])."<br />"; 
     203                                                        $rightSide .= "End: ".formatFromSQLDate($therecord["enddate"])."<br />"; 
     204                                                        break; 
     205 
     206                                        }//endswitch 
     207 
     208                                        if(!$rightSide) 
     209                                                $rightSide = "&nbsp;"; 
     210 
     211                                        $bottomInfo = ""; 
     212 
     213                                        switch($type){ 
     214 
     215                                                case "ReceivedAssignments": 
     216                                                        if($therecord["assignedbyid"]) 
     217                                                                $bottomInfo = "Assigned By: ".htmlQuotes($this->phpbms->getUserName($therecord["assignedbyid"])); 
     218                                                        break; 
     219 
     220                                                case "GivenAssignments": 
     221                                                        $bottomInfo = "Assigned To: ".htmlQuotes($this->phpbms->getUserName($therecord["assignedtoid"])); 
     222                                                        break; 
     223 
     224                                        }//endswitch 
     225 
     226                                        // Looking for grouping changes in headers (3 days, 4-7 days, > 7 days) 
     227                                        $xdate = stringToDate($therecord["xdate"],"SQL") ; 
     228                                        if($xdate > $section["date"]){ 
     229 
     230                                                while($xdate > $section["date"]){ 
     231 
     232                                                        switch($section["title"]){ 
     233 
     234                                                                case "Now": 
     235                                                                        $section["title"] = "Soon"; 
     236                                                                        $section["date"] = mktime(0,0,0,date("m"),date("d")+7,date("Y"));; 
     237                                                                        break; 
     238 
     239                                                                case "Soon": 
     240                                                                        $section["title"] = "Later"; 
     241                                                                        $section["date"] = mktime(0,0,0,date("m"),date("d")+31,date("Y"));; 
     242                                                                        break; 
     243 
     244                                                        }//end switch 
     245 
     246                                                }//endwhile 
     247 
     248                                                ?><div class="taskSection"><?php echo $section["title"] ?></div><?php 
     249 
     250                                        }//end if 
     251 
     252                                        ?> 
     253 
     254                                        <div id="<?php echo $id.$therecord["id"]?>" class="<?php echo $className?>"> 
     255 
     256                                                <span class="taskRight"><?php echo $rightSide ?></span> 
     257 
     258                                                <input class="radiochecks taskChecks" id="<?php  echo $checkBoxID?>" name="<?php  echo $checkBoxID?>" type="checkbox" value="1" <?php if($therecord["completed"]) echo 'checked="checked"'?>  align="middle" /> 
     259 
     260                                                <a href="<?php echo $link?>"><?php echo htmlQuotes($therecord["subject"])?></a> 
     261 
     262                                                <?php if($bottomInfo){ ?> 
     263 
     264                                                        <p><?php echo $bottomInfo ?></p> 
     265 
     266                                                <? }//endif ?> 
     267                                        </div> 
     268 
     269                                <?php }//endwhile 
     270                                } else { ?> 
     271                                        <p class="small disabledtext">no <?php echo strtolower($title)?></p><?php 
     272                                }?> 
     273                        </div> 
     274                </div> <?php 
     275 
     276        }//end method showTasks 
     277 
     278 
     279}// end class baseSnapshot 
    141280 
    142281?> 
    143  
  • branches/nathan/modules/base/javascript/snapshot.js

    r308 r450  
    3838 
    3939theEvent = { 
    40          
     40 
    4141        idents: Array(), 
    42          
     42 
    4343        getWeek: function(e){ 
    44                  
     44 
    4545                var eventDate; 
    4646 
    4747                if(e){ 
    4848                        var srcObj = e.src(); 
    49                          
     49 
    5050                        for(var i=0; i<theEvent.idents.length; i++) 
    5151                                disconnect(theEvent.idents[i]); 
    52                                          
     52 
    5353                        switch(srcObj.id) { 
    54          
     54 
    5555                                case "eventLastWeek": 
    5656                                        eventDate = getObjectFromID("eventDateLast").value; 
    5757                                        break; 
    58                                          
     58 
    5959                                case "eventToday": 
    6060                                        eventDate = getObjectFromID("eventDateToday").value; 
    6161                                        break; 
    62                                          
     62 
    6363                                case "eventNextWeek": 
    6464                                        eventDate = getObjectFromID("eventDateNext").value; 
     
    6767                        }//endswitch 
    6868                }//endif 
    69                  
     69 
    7070                var theURL = "snapshot_ajax.php?cm=getWeek"; 
    7171                if(eventDate) 
    7272                        theURL += "&d="+eventDate; 
    73                          
     73 
    7474                var weekContainer = getObjectFromID("eventsBox"); 
    7575                loadXMLDoc(theURL,null,false); 
     
    7878                theEvent.idents[theEvent.idents.length] = connect(getObjectFromID("eventLastWeek"),"onclick",theEvent.getWeek); 
    7979                theEvent.idents[theEvent.idents.length] = connect(getObjectFromID("eventToday"),"onclick",theEvent.getWeek); 
    80                 theEvent.idents[theEvent.idents.length] = connect(getObjectFromID("eventNextWeek"),"onclick",theEvent.getWeek);          
    81                  
     80                theEvent.idents[theEvent.idents.length] = connect(getObjectFromID("eventNextWeek"),"onclick",theEvent.getWeek); 
     81 
    8282        }//end method 
    83          
     83 
    8484}//end class 
    8585 
    8686 
    8787task = { 
    88          
     88 
    8989        check: function(e){ 
    9090                var srcObj = e.src(); 
    91                  
     91 
    9292                var id = srcObj.id.substr(5); 
    9393                var type =  srcObj.id.substr(2,2); 
    9494                var section = srcObj.id.substr(0,2); 
    95                  
     95 
    9696                var checkBox = srcObj; 
    9797                var containerP = srcObj.parentNode; 
    98                                  
     98 
    9999                var theURL = "snapshot_ajax.php?id="+id+"&ty="+type+"&cm=updateTask&cp="; 
    100100 
    101101                if(checkBox.checked){ 
    102                          
     102 
    103103                        theURL += 1; 
    104                          
     104 
    105105                        containerP.className += " complete"; 
    106                                                  
     106 
    107107                } else { 
    108                          
     108 
    109109                        theURL += 0; 
    110                          
     110 
    111111                        containerP.className = containerP.className.replace(/complete/g, ""); 
    112                          
     112 
    113113                }//end if 
    114                  
     114 
    115115                loadXMLDoc(theURL,null,false); 
    116                  
     116 
    117117        }//end method 
    118118}//end class 
     
    127127        for(var i=0; i<taskChecks.length; i++) 
    128128                connect(taskChecks[i],"onclick",task.check); 
    129          
     129 
    130130        var systemMessageDivs = getElementsByClassName('systemMessages'); 
    131131        var systemMessageLinks = getElementsByClassName('systemMessageLinks'); 
     
    136136        var systemMessageAccordion = new fx.Accordion(systemMessageLinks, systemMessageDivs, {opacity: true, duration:150}); 
    137137        var taskAccordion = new fx.Accordion(taskLinks, taskDivs, {opacity: true, duration:300}); 
    138         taskAccordion.showThisHideOpen(taskDivs[2]); 
    139          
     138        taskAccordion.showThisHideOpen(taskDivs[1]); 
     139 
    140140        theEvent.getWeek(); 
    141141}); 
  • branches/nathan/modules/base/snapshot.php

    r371 r450  
    3737 +-------------------------------------------------------------------------+ 
    3838*/ 
    39         require_once("../../include/session.php");       
     39        require_once("../../include/session.php"); 
    4040        require_once("include/snapshot_include.php"); 
    41          
     41 
    4242        //Page details; 
    4343        $pageTitle = APPLICATION_NAME; 
    44          
     44 
    4545        $phpbms->cssIncludes[] = "pages/snapshot.css"; 
    46          
     46 
    4747        $phpbms->jsIncludes[] = "modules/base/javascript/snapshot.js"; 
    48          
     48 
    4949        foreach($phpbms->modules as $modulename => $modinfo){ 
    5050                if(file_exists("../".$modulename."/javascript/snapshot.js") && $modulename != "base") 
    5151                        $phpbms->jsIncludes[] = "modules/".$modulename."/javascript/snapshot.js"; 
    52                          
     52 
    5353                if(file_exists("../../common/stylesheet/".STYLESHEET."/pages/".$modulename."/snapshot.css")) 
    5454                        $phpbms->cssIncludes[] = "pages/".$modulename."/snapshot.css"; 
    55                  
     55 
    5656        }//end if 
    57          
     57 
    5858        require("header.php"); 
    59          
     59 
     60        $myBase = new baseSnapshot($db, $phpbms, $_SESSION["userinfo"]["id"]); 
     61 
    6062?> 
    6163<div class="bodyline"> 
    6264        <h1><?php echo $_SESSION["userinfo"]["firstname"]; if($_SESSION["userinfo"]["lastname"]) echo " ".$_SESSION["userinfo"]["lastname"]?>'s Snapshot</h1> 
    63         <?php showSystemMessages($db) ?> 
    64          
     65        <?php $myBase->showSystemMessages() ?> 
     66 
    6567        <div id="notesStuff"> 
    6668        <table cellpadding="0" cellspacing="0" border="0"> 
     
    7072                        <td class="box" id="tasksBox"> 
    7173                                <h2>Workload</h2> 
    72                                 <?php  
    73                                         showTasks($db,$_SESSION["userinfo"]["id"],"GivenAssignments"); 
    74                                         showTasks($db,$_SESSION["userinfo"]["id"],"ReceivedAssignments");  
    75                                         showTasks($db,$_SESSION["userinfo"]["id"],"Tasks"); 
     74                                <?php 
     75                                        $myBase->showTasks("GivenAssignments"); 
     76                                        $myBase->showTasks("ReceivedAssignments"); 
     77                                        //showTasks($db,$_SESSION["userinfo"]["id"],"Tasks"); 
    7678                                ?> 
    7779                        </td> 
     
    7981        </table> 
    8082        </div> 
    81          
     83 
    8284        <div style="clear:both;"></div> 
    8385 
    84         <?php    
    85         foreach($phpbms->modules as $modulename => $modinfo)                             
     86        <?php 
     87        foreach($phpbms->modules as $modulename => $modinfo) 
    8688                if(file_exists("../".$modulename."/snapshot.php") && $modulename != "base") 
    8789                        include("../".$modulename."/snapshot.php"); 
  • branches/nathan/modules/bms/clients_credit.php

    r311 r450  
    1 <?php  
     1<?php 
    22/* 
    33 $Rev: 285 $ | $LastChangedBy: brieb $ 
     
    4646        $clientCredit = new clientCredit($db, $_GET["id"]); 
    4747 
    48         if(isset($_POST["hascredit"])){ 
     48        if(isset($_POST["creditlimit"])){ 
    4949                if($clientCredit->update(addSlashesToArray($_POST) )) 
    50                         $statusMessage = "Credit Updated"; 
     50                        $statusmessage = "Credit Updated"; 
    5151        } 
    52          
     52 
    5353        $therecord = $clientCredit->get(); 
    54          
     54 
    5555        //setting page title 
    5656        $pageTitle="Credit: "; 
     
    7676                        $theinput->setAttribute("readonly","readonly"); 
    7777                $theform->addField($theinput); 
    78                  
     78 
    7979                $theinput = new inputCurrency("creditleft", ($therecord["creditlimit"]-$therecord["outstanding"]), "credit left"); 
    8080                $theinput->setAttribute("readonly","readonly"); 
     
    8686 
    8787 
    88         include("header.php");   
     88        include("header.php"); 
    8989 
    9090        $phpbms->showTabs("clients entry",300,$_GET["id"]);?><div class="bodyline"> 
    91         <form action="<?php echo str_replace("&","&amp;",$_SERVER["REQUEST_URI"]) ?>"  
     91        <form action="<?php echo str_replace("&","&amp;",$_SERVER["REQUEST_URI"]) ?>" 
    9292        method="post" name="record" id="record"> 
    9393                <div id="topButtons"> 
    9494                        <input type="button" class="Buttons" id="update1" name="update" value="save"/> 
    9595                </div> 
    96          
     96 
    9797                <h1 id="h1Title"><span><?php echo $pageTitle ?></span></h1> 
    9898                <input type="hidden" id="type" name="type" value="<?php echo $therecord["type"]?>" /> 
    99                  
     99 
    100100                <fieldset> 
    101101                        <legend>Credit</legend> 
     
    103103                        <p class="notes">Credit can only be set for clients.</p> 
    104104                        <?php }?> 
    105                          
     105 
    106106                        <p><?php $theform->showField("hascredit")?></p> 
    107                          
     107 
    108108                        <p><?php $theform->showField("creditlimit")?></p> 
    109109 
     
    114114 
    115115                <?php  if($therecord["hascredit"]) {?> 
    116                  
     116 
    117117                <fieldset> 
    118118                        <legend>open items</legend> 
    119119                        <div class="fauxP"> 
    120                          
     120 
    121121                                <?php $clientCredit->showHistory($_GET["id"])?> 
    122                                  
     122 
    123123                        </div> 
    124124                </fieldset> 
    125                  
     125 
    126126                <?php  } //end if?> 
    127127 
  • branches/nathan/modules/bms/install/updatev0.96.sql

    r397 r450  
    1818INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('2', 'e-mail', 'clients.email', 'left', '', '3', '', '0', '', NULL, '0'); 
    1919INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('2', 'has credit', 'clients.hascredit', 'center', '', '1', '', '0', '', 'boolean', '80'); 
    20 INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('2', 'name / location', 'CONCAT(\'[b]\',IF(clients.company != \'\', CONCAT(clients.company,IF(clients.lastname != \'\' OR clients.firstname != \'\', CONCAT(\' (\',if(clients.lastname != \'\', clients.lastname, \'{blank}\'),\', \',if(clients.firstname != \'\', clients.firstname, \'{blank}\'),\')\'), \'\')), IF(clients.lastname != \'\' OR clients.firstname != \'\', CONCAT(if(clients.lastname != \'\', clients.lastname, \'{blank}\'),\', \',if(clients.firstname != \'\', clients.firstname, \'{blank}\')), \'\')),\'[/b][br][space]\', IF(addresses.city != \'\' OR addresses.state !=\'\' OR addresses.postalcode != \'\', CONCAT(IF(addresses.city != \'\',addresses.city,\'\'),\', \',IF(addresses.state != \'\', addresses.state, \'\'),\' \',IF(addresses.postalcode != \'\', addresses.postalcode, \'\')),\'(no location)\'))', 'left', '', '2', 'concat(clients.company,cliennts.lastname,clients.firstname)', '0', '100%', 'bbcode', '0'); 
     20INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('2', 'name / location', 'CONCAT(\'[b]\',IF(clients.company != \'\', CONCAT(clients.company,IF(clients.lastname != \'\' OR clients.firstname != \'\', CONCAT(\' (\',if(clients.lastname != \'\', clients.lastname, \'{blank}\'),\', \',if(clients.firstname != \'\', clients.firstname, \'{blank}\'),\')\'), \'\')), IF(clients.lastname != \'\' OR clients.firstname != \'\', CONCAT(if(clients.lastname != \'\', clients.lastname, \'{blank}\'),\', \',if(clients.firstname != \'\', clients.firstname, \'{blank}\')), \'\')),\'[/b][br][space]\', IF(addresses.city != \'\' OR addresses.state !=\'\' OR addresses.postalcode != \'\', CONCAT(IF(addresses.city != \'\',addresses.city,\'\'),\', \',IF(addresses.state != \'\', addresses.state, \'\'),\' \',IF(addresses.postalcode != \'\', addresses.postalcode, \'\')),\'(no location)\'))', 'left', '', '2', 'concat(clients.company,clients.lastname,clients.firstname)', '0', '100%', 'bbcode', '0'); 
    2121INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('2', 'type', 'clients.type', 'left', '', '0', '', '0', '', NULL, '0'); 
    2222INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('2', 'phone', 'IF(clients.workphone != \'\' OR clients.homephone != \'\' OR clients.mobilephone != \'\' OR clients.otherphone != \'\',IF(clients.workphone != \'\', concat(clients.workphone, \' (w)\'), IF(clients.homephone != \'\', concat(clients.homephone, \' (h)\'), IF(clients.mobilephone != \'\', concat(clients.mobilephone, \' (m)\'), IF(clients.otherphone != \'\', concat(clients.otherphone, \' (o)\'), \'\')))) ,\'\')', 'left', '', '4', 'concat(clients.workphone, clients.homephone, clients.mobilephone,clients.otherphone)', '0', '', NULL, '0'); 
  • branches/nathan/report/report_class.php

    r416 r450  
    5858                                $this->sortorder = $_SESSION["printing"]["sortorder"]; 
    5959                                 
    60                         if(isset($_SESSION["printing"]["whereclause"])) 
     60                        if(isset($_SESSION["printing"]["whereclause"])){ 
     61                                 
     62                                if(strpos($_SESSION["printing"]["whereclause"],"WHERE") === 0) 
     63                                        $this->whereclause = substr($this->whereclause, 5); 
     64                                         
    6165                                $this->whereclause = $_SESSION["printing"]["whereclause"]; 
     66                                 
     67                        }//endif 
    6268                         
    6369                        //backwards compatibility 
  • branches/nathan/smartsearch.php

    r384 r450  
    4747 
    4848        function smartSearch($db, $sdbid){ 
    49                  
     49 
    5050                $this->db = $db; 
    51                  
     51 
    5252                $this->getSearchParams($sdbid); 
    53                  
     53 
    5454        }//end method init 
    55          
     55 
    5656 
    5757        function getSearchParams($sdbid){ 
    58          
     58 
    5959                $querystatement = " 
    6060                        SELECT 
     
    6464                        WHERE 
    6565                                id = ".((int) $sdbid); 
    66                  
     66 
    6767                $this->searchParams = $this->db->fetchArray($this->db->query($querystatement)); 
    68          
     68 
    6969        }//end method - getSearchParams 
    7070 
     
    7373 
    7474                $term = trim(mysql_real_escape_string($term)); 
    75                  
     75 
    7676                // first we take the entered text and explode int by words 
    7777                $terms = explode(" ",$term); 
    78                  
     78 
    7979                //next we take the list of fields to search and create an array 
    8080                $searchFields = explode(",", $this->searchParams["searchfields"]); 
    81                          
     81 
    8282                $wheres=""; 
    8383                foreach($terms as $value){ 
    84                          
     84 
    8585                        // this series of foreachs builds a SQL OR clause to search 
    8686                        // the search fields to match things that start with the term 
    8787                        // or has words inside that start with the term. 
    88                                                  
     88 
    8989                        $wheres .="AND ("; 
    90                          
     90 
    9191                        foreach($searchFields as $field) 
    9292                                $wheres .= trim($field)." LIKE '".$value."%' OR ".trim($field)." LIKE '% ".$value."%'\nOR "; 
    93                          
     93 
    9494                        $wheres = substr($wheres,0,strlen($wheres)-3); 
    9595                        $wheres .= ")"; 
    96                          
     96 
    9797                }//endforeach 
    9898 
    9999                if($wheres){ 
    100                  
     100 
    101101                        $finalsearch = ""; 
    102102                        foreach($searchFields as $field) 
    103103                                $finalsearch .= trim($field)." LIKE '".$term."%'\nOR "; 
    104                          
     104 
    105105                        $finalsearch = substr($finalsearch,0,strlen($finalsearch)-3); 
    106                          
     106 
    107107                        $wheres = "AND ( (".$finalsearch.") OR (".substr($wheres,4)."))"; 
    108108 
    109109                }//endif - where 
    110                  
     110 
    111111                $securityWhere = ""; 
    112                  
     112 
    113113                if($this->searchParams["rolefield"]){ 
    114                  
     114 
    115115                        // If the rolefield is present, we need to make sure the rolefield 
    116116                        // of each record matches the logged in users array of roles 
    117                          
     117 
    118118                        if ($_SESSION["userinfo"]["admin"]!=1){ 
    119                          
     119 
    120120                                if(count($_SESSION["userinfo"]["roles"])>0) 
    121121                                        $securityWhere = " AND ".$this->searchParams["rolefield"]." IN (".implode(",",$_SESSION["userinfo"]["roles"]).",0)"; 
    122122                                else 
    123123                                        $securityWhere = " AND ".$this->searchParams["rolefield"]." = 0"; 
    124                                          
     124 
    125125                        }//endif admin 
    126                  
     126 
    127127                }//endif rolefield 
    128          
     128 
    129129                $querystatement = " 
    130130                        SELECT DISTINCT 
     
    136136                                ".$this->searchParams["fromclause"]." 
    137137                        WHERE 
    138                                 (".$this->searchParams["filterclause"].") 
     138                                (".$this->subout($this->searchParams["filterclause"]).") 
    139139                                ".$securityWhere." 
    140140                                ".$wheres." 
     
    145145 
    146146                //need to retireve count of all records so 
    147                 // the JS can know wheher to put the show more results on.               
     147                // the JS can know wheher to put the show more results on. 
    148148                $totalCountStatement = " 
    149149                        SELECT 
     
    155155                                ".$securityWhere." 
    156156                                ".$wheres; 
    157                                  
     157 
    158158                $countrecord = $this->db->fetchArray($this->db->query($totalCountStatement)); 
    159159                $this->totalcount = $countrecord["thecount"]; 
    160160 
    161161                return $this->db->query($querystatement); 
    162          
     162 
    163163        }//end method 
    164164 
    165          
     165 
    166166        function display($result){ 
    167167                // This function will spit out a JSON array of records 
    168                  
     168 
    169169                $output = "{totalRecords: ".$this->totalcount.", resultRecords: ["; 
    170                  
     170 
    171171                while($therecord = $this->db->fetchArray($result)){ 
    172                  
     172 
    173173                        $output .= "{display: '".str_replace("'", "\'", formatVariable($therecord["display"],"bbcode"))."',"; 
    174174                        $output .= "value: '".str_replace("'", "\'", formatVariable($therecord["value"]))."',"; 
    175175                        $output .= "secondary: '".str_replace("'", "\'", formatVariable($therecord["secondary"],"bbcode"))."',"; 
    176176                        $output .= "classname: '".str_replace("'", "\'", formatVariable($therecord["classname"]))."'},"; 
    177                  
     177 
    178178                }//endwhile 
    179                  
     179 
    180180                if($output != "{totalRecords: ".$this->totalcount.", resultRecords: [") 
    181181                        $output = substr($output, 0, strlen($output)-1); 
    182                  
     182 
    183183                $output .= "] }"; 
    184184 
    185185                header("Content-type: text/plain"); 
    186186                echo $output; 
    187                  
     187 
    188188        }//end method - display 
     189 
     190 
     191        // replace variables 
     192        // strings with entrys like " {{$ENTRY}} " 
     193        // get everything in the {{ }} evaluated 
     194        function subout($string){ 
     195 
     196                while(strpos($string,"{{")){ 
     197                        $start=strpos($string,"{{"); 
     198                        $startsubout=$start+2; 
     199                        $endsubout=strpos($string,"}}"); 
     200                        $end=$endsubout+2; 
     201                        $temp=""; 
     202                        eval(stripslashes("\$temp=".substr($string,$startsubout,$endsubout-$startsubout).";")); 
     203                        $string=substr($string,0,$start).$temp.substr($string,$end); 
     204                } 
     205 
     206                return $string; 
     207 
     208        }//end function 
    189209         
    190210}//end class 
     
    196216 
    197217        $smartSearch = new smartSearch($db, $_GET["sdbid"]); 
    198          
     218 
    199219        if(!isset($_GET["o"])) 
    200220                $_GET["o"] = 0; 
     
    202222        $theresult = $smartSearch->find($_GET["t"],((int) $_GET["o"])); 
    203223 
    204         if(isset($theresult))    
     224        if(isset($theresult)) 
    205225                $smartSearch->display($theresult); 
    206          
     226 
    207227}//end if 
    208228?> 
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.