phpBMS

root/trunk/phpbms/modules/bms/products_attachments.php

Revision 702, 3.8 KB (checked in by brieb, 2 years ago)

Updated copyrights to 2010

  • Property svn:keywords set to LastChangedBy LastChangedDate LastChangedRevision
Line 
1<?php
2/*
3 $Rev$ | $LastChangedBy$
4 $LastChangedDate$
5 +-------------------------------------------------------------------------+
6 | Copyright (c) 2004 - 2010, Kreotek LLC                                  |
7 | All rights reserved.                                                    |
8 +-------------------------------------------------------------------------+
9 |                                                                         |
10 | Redistribution and use in source and binary forms, with or without      |
11 | modification, are permitted provided that the following conditions are  |
12 | met:                                                                    |
13 |                                                                         |
14 | - Redistributions of source code must retain the above copyright        |
15 |   notice, this list of conditions and the following disclaimer.         |
16 |                                                                         |
17 | - Redistributions in binary form must reproduce the above copyright     |
18 |   notice, this list of conditions and the following disclaimer in the   |
19 |   documentation and/or other materials provided with the distribution.  |
20 |                                                                         |
21 | - Neither the name of Kreotek LLC nor the names of its contributore may |
22 |   be used to endorse or promote products derived from this software     |
23 |   without specific prior written permission.                            |
24 |                                                                         |
25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS     |
26 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT       |
27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A |
28 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT      |
29 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,   |
30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT        |
31 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,   |
32 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY   |
33 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT     |
34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE   |
35 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.    |
36 |                                                                         |
37 +-------------------------------------------------------------------------+
38*/
39
40        include("../../include/session.php");
41
42
43        require_once("../../include/search_class.php");
44
45
46        //set the table passing stuff
47        $tabledefuuid = "tbld:7a9e87ed-d165-c4a4-d9b9-0a4adc3c5a34";
48
49        if(isset($_GET["refid"])) $_GET["id"]=$_GET["refid"];
50        $refid=(integer) $_GET["id"];
51
52    $querystatement = "
53        SELECT
54            `uuid`
55        FROM
56            `products`
57        WHERE
58            `id` = '".$refid."'
59        ";
60
61    $queryresult = $db->query($querystatement);
62    $therecord = $db->fetchArray($queryresult);
63    $refuuid = $therecord["uuid"];
64
65    $securitywhere="";
66    if ($_SESSION["userinfo"]["admin"]!=1 && count($_SESSION["userinfo"]["roles"])>0){
67        $securitywhere = "''";
68        foreach($_SESSION["userinfo"]["roles"] as $roleuuid)
69            $securitywhere .= ",'".$roleuuid."'";
70    }//end if
71
72    $whereclause="attachments.tabledefid='".$tabledefuuid."' AND attachments.recordid='".$refuuid."'".$securitywhere;
73        $backurl="../bms/products_attachments.php";
74        $base="../../";
75
76        $refquery="select partnumber,partname from products where id=".$refid;
77        $refquery=$db->query($refquery);
78        $refrecord=$db->fetchArray($refquery);
79
80        $pageTitle="Attachments: ".$refrecord["partname"];
81
82        $tabgroup="products entry";
83        $selectedtabid="tab:4c853d8b-8895-a8c5-8ff6-1128e6e1a798";
84
85        include("../base/attachments_records.php");
86
87?>
Note: See TracBrowser for help on using the browser.
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.