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/invoices_attachments.php

    r285 r485  
    1 <?php  
     1<?php 
    22/* 
    33 $Rev$ | $LastChangedBy$ 
     
    3939 
    4040        include("../../include/session.php"); 
    41          
     41 
    4242 
    4343        require_once("../../include/search_class.php"); 
    44                  
     44 
    4545 
    4646        //set the table passing stuff 
     
    4949        $refid=(integer) $_GET["id"]; 
    5050        $securitywhere=""; 
    51         if ($_SESSION["userinfo"]["admin"]!=1 && count($_SESSION["userinfo"]["roles"])>0)                
    52                 $securitywhere=" AND files.roleid IN (".implode(",",$_SESSION["userinfo"]["roles"]).",0)";       
     51        if ($_SESSION["userinfo"]["admin"]!=1 && count($_SESSION["userinfo"]["roles"])>0) 
     52                $securitywhere=" AND files.roleid IN (".implode(",",$_SESSION["userinfo"]["roles"]).",0)"; 
    5353        $whereclause="attachments.tabledefid=".$tabledefid." AND attachments.recordid=".$refid.$securitywhere; 
    5454        $backurl="../bms/invoices_attachments.php"; 
     
    6060 
    6161        $refquery="SELECT 
    62                            invoices.id, if(clients.lastname!=\"\",concat(clients.lastname,\", \",clients.firstname,if(clients.company!=\"\",concat(\" (\",clients.company,\")\"),\"\")),clients.company) as name  
    63                            FROM invoices INNER JOIN clients ON invoices.clientid=clients.id  
     62                           invoices.id, if(clients.lastname!=\"\",concat(clients.lastname,\", \",clients.firstname,if(clients.company!=\"\",concat(\" (\",clients.company,\")\"),\"\")),clients.company) as name 
     63                           FROM invoices INNER JOIN clients ON invoices.clientid=clients.id 
    6464                           WHERE invoices.id=".$refid; 
    6565        $refquery=$db->query($refquery); 
    66         $refrecord=$db->fetchArray($refquery);   
    67          
    68         $pageTitle="Attachments: ".$refrecord["id"].", ".$refrecord["name"]; 
     66        $refrecord=$db->fetchArray($refquery); 
     67 
     68        $pageTitle="Attachments: ".$refrecord["id"]; 
     69        if($refrecord["name"] !== "") 
     70                $pageTitle .= ", ".$refrecord["name"]; 
    6971 
    7072        $tabgroup="invoices entry"; 
    7173        $selectedtabid=17; 
    72          
     74 
    7375        include("../base/attachments_records.php"); 
    74          
     76 
    7577?> 
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.