phpBMS

Changeset 706 for trunk/phpbms/modules

Show
Ignore:
Timestamp:
01/03/10 21:33:53 (2 years ago)
Author:
brieb
Message:
  • Tweaked some UI sizing and border issues
  • Fixed client purchase history type updating (mispelling)
  • Added ability to consolidate client records (for duplicates)
Location:
trunk/phpbms/modules
Files:
1 added
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/modules/base/reports_addedit.php

    r703 r706  
    142142                <fieldset> 
    143143                    <legend>settings</legend> 
     144                    <div class="fauxP"> 
    144145                    <?php if(!$therecord["id"]) { 
    145146                        ?><p class="notes">Report settings are available after initial record creation.</p><?php 
     
    186187                    }//endif 
    187188                    ?> 
     189                    </div> 
    188190                </fieldset> 
    189191 
  • trunk/phpbms/modules/bms/clients_purchasehistory.php

    r704 r706  
    7171 
    7272        $thestatus="(invoices.type =\""; 
     73 
    7374        switch($_POST["status"]){ 
    7475                case "Orders and Invoices": 
     
    142143                           <label for="status">type</label><br /> 
    143144                           <select name="status" id="status"> 
    144                                         <option value="Orders abd Invoices" <?php if($_POST["status"]=="Orders and Invoices") echo "selected=\"selected\""?>>Orders and Invoices</option> 
     145                                        <option value="Orders and Invoices" <?php if($_POST["status"]=="Orders and Invoices") echo "selected=\"selected\""?>>Orders and Invoices</option> 
    145146                                        <option value="Invoices" <?php if($_POST["status"]=="Invoices") echo "selected=\"selected\""?>>Invoices</option> 
    146147                                        <option value="Orders" <?php if($_POST["status"]=="Orders") echo "selected=\"selected\""?>>Orders</option> 
  • trunk/phpbms/modules/bms/include/clients.php

    r703 r706  
    434434 
    435435                }//end method - insertRecord 
    436                  
     436 
    437437                /* 
    438438                 * function api_searchByEmail 
     
    446446                 * were encountered, or the original $requestData if there was an error 
    447447                 */ 
    448                  
     448 
    449449                function api_searchByEmail($requestData, $returnUuid = true) { 
    450                          
     450 
    451451                        /** 
    452452                          *  Check for required fields and return error if not there. 
     
    458458                                return $response; 
    459459                        }//end if 
    460                          
     460 
    461461                        /** 
    462                           *  Do sql search  
     462                          *  Do sql search 
    463463                          */ 
    464464                        $querystatement = " 
     
    471471                                        `email` = '".mysql_real_escape_string($requestData["email"])."' 
    472472                        "; 
    473                          
     473 
    474474                        $queryresult = $this->db->query($querystatement); 
    475                          
     475 
    476476                        /** 
    477                           *  Construct return array  
     477                          *  Construct return array 
    478478                          */ 
    479479                        $thereturn["type"] = "result"; 
     
    481481                        $thereturn["details"] = array(); 
    482482                        while($therecord = $this->db->fetchArray($queryresult)){ 
    483                                  
     483 
    484484                                if($returnUuid) 
    485485                                        $thereturn["details"][] = $therecord["uuid"]; 
    486486                                else 
    487487                                        $thereturn["details"][] = $therecord["id"]; 
    488                                  
     488 
    489489                        }//end while 
    490                          
     490 
    491491                        return $thereturn; 
    492                          
     492 
    493493                }//end function --api_serchByEmail-- 
    494                  
     494 
    495495                /* 
    496496                 * function api_searchByNameAndPostalcode 
     
    505505                 * were encountered, or the original $requestData if there was an error 
    506506                 */ 
    507                  
     507 
    508508                function api_searchByNameAndPostalcode($requestData, $returnUuid = true) { 
    509                          
     509 
    510510                        /** 
    511                           *  check for required fields  
     511                          *  check for required fields 
    512512                          */ 
    513513                        $requiredArray = array( 
     
    516516                                "lastname" 
    517517                        ); 
    518                          
     518 
    519519                        $missingArray = array(); 
    520                          
     520 
    521521                        foreach($requiredArray as $requiredField) 
    522522                                if(!isset($requestData[$requiredField])) 
    523523                                        $missingArray[] = $requiredField; 
    524                          
     524 
    525525                        $count = count($missingArray); 
    526526                        if($count){ 
    527                                  
     527 
    528528                                $response["type"] = "error"; 
    529529                                $response["details"] = $requestData; 
    530530                                $response["message"] = ""; 
    531                                  
     531 
    532532                                $i=0; 
    533533                                foreach($missingArray as $missingField){ 
    534                                          
     534 
    535535                                        if(++$i == $count){ 
    536536                                                if($response["message"]) 
     
    540540                                        }else 
    541541                                                $response["message"] .= "'".$missingField."', "; 
    542                                          
     542 
    543543                                }//end foreach 
    544                                  
     544 
    545545                                $response["messsage"] = "Data does not contain the key(s): ".$response["message"]; 
    546                                  
     546 
    547547                                return $response; 
    548                          
     548 
    549549                        }//end if 
    550                          
     550 
    551551                        /** 
    552                           *  do sql search  
     552                          *  do sql search 
    553553                          */ 
    554554                        $querystatement = " 
     
    568568                                        `addresses`.`postalcode` = '".mysql_real_escape_string($requestData["postalcode"])."' 
    569569                        "; 
    570                          
     570 
    571571                        $queryresult = $this->db->query($querystatement); 
    572                          
     572 
    573573                        /** 
    574                           *  report findings  
     574                          *  report findings 
    575575                          */ 
    576576                        $thereturn["details"] = array(); 
     
    578578                        $thereturn["message"] = "The function api_searchByNameAndPostalcode has been run successfully."; 
    579579                        while($therecord = $this->db->fetchArray($queryresult)){ 
    580                                  
     580 
    581581                                if($returnUuid) 
    582582                                        $thereturn["details"][] = $therecord["uuid"]; 
    583583                                else 
    584584                                        $thereturn["details"][] = $therecord["id"]; 
    585                                  
     585 
    586586                        }//end while 
    587                          
     587 
    588588                        return $thereturn; 
    589                          
     589 
    590590                }//end function --api_searchByNameAndPostalcode 
    591                  
     591 
    592592                /* 
    593593                 * function api_searchByUsernameAndPassword 
     
    602602                 * were encountered, or the original $requestData if there was an error 
    603603                 */ 
    604                  
     604 
    605605                function api_searchByUsernameAndPassword($requestData, $returnUuid = true) { 
    606                          
     606 
    607607                        /** 
    608                           *  check for required fields  
     608                          *  check for required fields 
    609609                          */ 
    610610                        $requiredArray = array( 
     
    612612                                "password" 
    613613                        ); 
    614                          
     614 
    615615                        $missingArray = array(); 
    616                          
     616 
    617617                        foreach($requiredArray as $requiredField) 
    618618                                if(!isset($requestData[$requiredField])) 
    619619                                        $missingArray[] = $requiredField; 
    620                          
     620 
    621621                        $count = count($missingArray); 
    622622                        if($count){ 
    623                                  
     623 
    624624                                $response["type"] = "error"; 
    625625                                $response["details"] = $requestData; 
    626626                                $response["message"] = ""; 
    627                                  
     627 
    628628                                $i=0; 
    629629                                foreach($missingArray as $missingField){ 
    630                                          
     630 
    631631                                        if(++$i == $count){ 
    632632                                                if($response["message"]) 
     
    636636                                        }else 
    637637                                                $response["message"] .= "'".$missingField."', "; 
    638                                          
     638 
    639639                                }//end foreach 
    640                                  
     640 
    641641                                $response["messsage"] = "Data does not contain the key(s): ".$response["message"]; 
    642                                  
     642 
    643643                                return $response; 
    644                          
     644 
    645645                        }//end if 
    646                          
     646 
    647647                        /** 
    648                           *  do sql search  
     648                          *  do sql search 
    649649                          */ 
    650650                        $querystatement = " 
     
    659659                                        `password` = '".mysql_real_escape_string($requestData["password"])."' 
    660660                        "; 
    661                          
     661 
    662662                        $queryresult = $this->db->query($querystatement); 
    663                          
     663 
    664664                        /** 
    665                           *  report findings  
     665                          *  report findings 
    666666                          */ 
    667667                        $thereturn["details"] = array(); 
     
    669669                        $thereturn["message"] = "The function api_searchByUsernameAndPassword has been run successfully."; 
    670670                        while($therecord = $this->db->fetchArray($queryresult)){ 
    671                                  
     671 
    672672                                if($returnUuid) 
    673673                                        $thereturn["details"][] = $therecord["uuid"]; 
    674674                                else 
    675675                                        $thereturn["details"][] = $threturn["id"]; 
    676                                  
     676 
    677677                        }//end while 
    678                          
     678 
    679679                        return $thereturn; 
    680                          
     680 
    681681                }//end function --api_searchByUsernameAndPassword-- 
    682682 
     
    688688if(class_exists("searchFunctions")){ 
    689689        class clientsSearchFunctions extends searchFunctions{ 
     690 
     691                function consolidate_clients($useUuid = false){ 
     692 
     693                    $noOutput = true; 
     694                    include("modules/bms/clients_consolidate.php"); 
     695 
     696                    $consolidator = new clientConsolidator($this->db); 
     697 
     698                    $consolidator->showPicker($this->idsArray, $useUuid); 
     699                    exit(); 
     700 
     701 
     702                }//end function consolidate_clients 
    690703 
    691704                function mark_asclient($useUuid = false){ 
     
    941954        }//end class 
    942955}//end if 
     956 
    943957if(class_exists("phpbmsImport")){ 
    944958        class clientsImport extends phpbmsImport{ 
  • trunk/phpbms/modules/bms/invoices_addedit.php

    r704 r706  
    461461                                <th nowrap="nowrap" class="queryheader" align="left" id="memoHeader">memo</th> 
    462462                                <th align="right" nowrap="nowrap" class="queryheader">price</th> 
    463                                 <th align="center" nowrap="nowrap" class="queryheader">qty.</th> 
    464                                 <th align="right" nowrap="nowrap" class="queryheader">extended</th> 
    465                                 <th nowrap="nowrap" class="queryheader">&nbsp;</th> 
     463                                <th align="right" nowrap="nowrap" class="queryheader">qty.</th> 
     464                                <th align="right" nowrap="nowrap" class="queryheader" colspan="2" id="liHeaderExtendedTd">extended</th> 
    466465                        </tr> 
    467466                </thead> 
     
    474473                        <td align="right" nowrap="nowrap"><input name="price" type="text" id="price" value="<?php echo htmlQuotes(numberToCurrency(0))?>" size="10" maxlength="16" class="fieldCurrency" /></td> 
    475474                        <td align="center" nowrap="nowrap"><input name="qty" type="text" id="qty" value="1" size="5" maxlength="16" /></td> 
    476                         <td align="right" nowrap="nowrap"><input name="extended" type="text" id="extended" class="uneditable fieldCurrency" value="<?php echo htmlQuotes(numberToCurrency(0))?>" size="12" maxlength="16" readonly="readonly" /></td> 
    477                         <td nowrap="nowrap" align="left"><button type="button" id="lineitemAddButton" class="graphicButtons buttonPlus" title="Add Line Item"><span>+</span></button></td> 
     475                        <td align="right" nowrap="nowrap"id="liAddExtendedTD"><input name="extended" type="text" id="extended" class="uneditable fieldCurrency" value="<?php echo htmlQuotes(numberToCurrency(0))?>" size="12" maxlength="16" readonly="readonly" /></td> 
     476                        <td nowrap="nowrap" align="left" id="liAddButtonTd"><button type="button" id="lineitemAddButton" class="graphicButtons buttonPlus" title="Add Line Item"><span>+</span></button></td> 
    478477                </tr><?php }//end if 
    479478 
     
    671670                <td class="totalItems">&nbsp;</td> 
    672671        </tr> 
    673         <tr> 
     672        <tr id="totalDisplayTr"> 
    674673                <td colspan="2" class="invoiceTotalLabels important"><div>total</div></td> 
    675674                <td class="totalItems"> 
     
    688687                <td class="totalItems"><button id="payinfull" type="button" onclick="payInFull()" class="graphicButtons buttonCheck" title="Pay in full"><span>pay in full</span></button></td> 
    689688        </tr> 
    690         <tr> 
     689        <tr id="lastTotalsTr"> 
    691690                <td colspan="2" class="invoiceTotalLabels" nowrap="nowrap"><div>amount due</div></td> 
    692691                <td class="totalItems"><input id="amountdue" name="amountdue" type="text" value="<?php echo numberToCurrency($therecord["amountdue"]) ?>" size="12" maxlength="15" onchange="calculatePaidDue();" class="important fieldCurrency fieldTotal" /></td> 
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.