Changeset 485 for trunk/phpbms/modules/bms/invoices_attachments.php
- Timestamp:
- 04/07/09 11:44:18 (3 years ago)
- Files:
-
- 1 modified
-
trunk/phpbms/modules/bms/invoices_attachments.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpbms/modules/bms/invoices_attachments.php
r285 r485 1 <?php 1 <?php 2 2 /* 3 3 $Rev$ | $LastChangedBy$ … … 39 39 40 40 include("../../include/session.php"); 41 41 42 42 43 43 require_once("../../include/search_class.php"); 44 44 45 45 46 46 //set the table passing stuff … … 49 49 $refid=(integer) $_GET["id"]; 50 50 $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)"; 53 53 $whereclause="attachments.tabledefid=".$tabledefid." AND attachments.recordid=".$refid.$securitywhere; 54 54 $backurl="../bms/invoices_attachments.php"; … … 60 60 61 61 $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 64 64 WHERE invoices.id=".$refid; 65 65 $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"]; 69 71 70 72 $tabgroup="invoices entry"; 71 73 $selectedtabid=17; 72 74 73 75 include("../base/attachments_records.php"); 74 76 75 77 ?>