phpBMS

Show
Ignore:
Timestamp:
04/07/09 11:44:18 (3 years ago)
Author:
nate
Message:
  • Merged Nathan branch back into trunk.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/modules/bms/include/addresses.php

    r384 r485  
    4141        class addresses extends phpbmsTable{ 
    4242 
     43                function getName($tabledefid, $recordid){ 
    4344 
    44                 function getName($tabledefid, $recordid){ 
    45                  
    4645                        switch($tabledefid){ 
    47                          
     46 
    4847                                case 2: 
    4948                                default: 
    5049                                        $querystatement = " 
    51                                                 SELECT  
     50                                                SELECT 
    5251                                                        if(clients.lastname!='',concat(clients.lastname,', ',clients.firstname,if(clients.company!='',concat(' (',clients.company,')'),'')),clients.company) AS thename 
    5352                                                FROM 
     
    5655                                                        id = ".$recordid; 
    5756                                        break; 
    58                                                          
     57 
    5958                        }//endswitch tabledefid 
    60                  
     59 
    6160                        $queryresult = $this->db->query($querystatement); 
    62                          
     61 
    6362                        if($this->db->numRows($queryresult)){ 
    64                          
     63 
    6564                                $therecord = $this->db->fetchArray($queryresult); 
    6665                                return htmlQuotes($therecord["thename"]); 
    67                                  
     66 
    6867                        } else 
    6968                                return "orphaned record: tableDefinitionID=".$tabledefid.", RecordID:".$recordid; 
    70                  
     69 
    7170                }//end method - getName 
    72                  
     71 
    7372 
    7473                function showAssociations($addressid){ 
    75                         // This function generates a table listing all the records  
     74                        // This function generates a table listing all the records 
    7675                        // associated with the address record. 
    77                          
     76 
    7877                        $querystatement = " 
    7978                                SELECT 
     
    8180                                        addresstorecord.recordid, 
    8281                                        addresstorecord.primary, 
    83                                         addresstorecord.defaultshipto                                    
    84                                 FROM  
     82                                        addresstorecord.defaultshipto 
     83                                FROM 
    8584                                        addresstorecord 
    8685                                WHERE 
     
    8988                                        addresstorecord.tabledefid 
    9089                        "; 
    91                          
     90 
    9291                        $queryresult = $this->db->query($querystatement); 
    93                          
     92 
    9493                        ?> 
    9594                        <table class="querytable" cellspacing="0" cellpadding="0" border="0"> 
     
    108107                                </tfoot> 
    109108                                <tbody> 
    110                                 <?php  
     109                                <?php 
    111110                                        $row =1; 
    112111                                        while($therecord = $this->db->fetchArray($queryresult)) { 
    113                                          
     112 
    114113                                                $row = ($row==1)? 2:1; 
    115                                                  
     114 
    116115                                                ?><tr class="qr<?php echo $row?>"> 
    117116                                                        <td><?php echo $therecord["recordid"]?></td> 
     
    121120                                                </tr> 
    122121                                                <?php 
    123                                                  
    124                                         }//endwhile - therecord                                  
     122 
     123                                        }//endwhile - therecord 
    125124                                ?> 
    126125                                </tbody> 
    127126                        </table> 
    128127                        <?php 
    129                  
     128 
    130129                }//end method - showAssociation 
    131130 
     131        }//end class 
    132132 
    133                 // CLASS OVERRIDES ================================================= 
    134                          
    135                 function formatVariables($variables){ 
    136                                                  
    137                         return $variables;                       
    138                  
    139                 }//end function 
    140          
    141          
    142                 function updateRecord($variables, $modifiedby = NULL){ 
    143          
    144                         $variables = $this->formatVariables($variables); 
    145  
    146                         $thereturn = parent::updateRecord($variables, $modifiedby); 
    147                                                  
    148                         return $thereturn; 
    149                          
    150                 }//end method 
    151                  
    152                  
    153                 function insertRecord($variables, $createdby = NULL){ 
    154                  
    155                         $variables = $this->formatVariables($variables); 
    156          
    157                         $newid = parent::insertRecord($variables, $createdby); 
    158                                                                          
    159                         return $newid; 
    160                          
    161                 }//end method 
    162                          
    163         }//end class 
    164          
    165133}//end if 
    166134 
    167135if(class_exists("searchFunctions")){ 
    168136        class filesSearchFunctions extends searchFunctions{ 
    169          
     137 
    170138                function delete_record(){ 
    171                  
     139 
    172140                        $whereclause = $this->buildWhereClause(); 
    173141                        $attachmentwhereclause = $this->buildWhereClause("attachments.fileid"); 
    174                  
     142 
    175143                        $querystatement = "DELETE FROM attachments WHERE ".$attachmentwhereclause." AND attachments.fileid!=1;"; 
    176144                        $queryresult = $this->db->query($querystatement); 
    177                  
     145 
    178146                        $querystatement = "DELETE FROM files WHERE ".$whereclause." AND files.id!=1;"; 
    179147                        $queryresult = $this->db->query($querystatement); 
    180                          
     148 
    181149                        $message = $this->buildStatusMessage(); 
    182150                        $message.=" deleted"; 
    183151                        return $message; 
    184152                } 
    185          
     153 
    186154        }//end class 
    187155}//end if 
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.