| 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 | require("../../include/session.php"); |
|---|
| 41 | require_once("../../include/search_class.php"); |
|---|
| 42 | |
|---|
| 43 | //set the table passing stuff |
|---|
| 44 | $reftableid="tbld:62fe599d-c18f-3674-9e54-b62c2d6b1883"; |
|---|
| 45 | |
|---|
| 46 | if(isset($_GET["refid"])) $_GET["id"]=$_GET["refid"]; |
|---|
| 47 | |
|---|
| 48 | $refid=(integer) $_GET["id"]; |
|---|
| 49 | |
|---|
| 50 | $refquery=" |
|---|
| 51 | SELECT |
|---|
| 52 | invoices.id, |
|---|
| 53 | invoices.uuid, |
|---|
| 54 | if(clients.lastname!=\"\",concat(clients.lastname,\", \",clients.firstname,if(clients.company!=\"\",concat(\" (\",clients.company,\")\"),\"\")),clients.company) as name |
|---|
| 55 | FROM |
|---|
| 56 | invoices INNER JOIN clients ON invoices.clientid=clients.uuid |
|---|
| 57 | WHERE |
|---|
| 58 | invoices.id=".$refid; |
|---|
| 59 | |
|---|
| 60 | $refquery=$db->query($refquery); |
|---|
| 61 | $refrecord=$db->fetchArray($refquery); |
|---|
| 62 | |
|---|
| 63 | $refuuid = $refrecord["uuid"]; |
|---|
| 64 | |
|---|
| 65 | $whereclause="attachedtabledefid = '".$reftableid."' AND attachedid = '".$refuuid."'"; |
|---|
| 66 | $backurl="../bms/invoices_notes.php"; |
|---|
| 67 | $base="../../"; |
|---|
| 68 | |
|---|
| 69 | $pageTitle="Notes/Tasks/Events: ".$refrecord["id"]; |
|---|
| 70 | if($refrecord["name"] !== "") |
|---|
| 71 | $pageTitle .= ", ".$refrecord["name"]; |
|---|
| 72 | |
|---|
| 73 | $tabgroup="invoices entry"; |
|---|
| 74 | $selectedtabid="tab:c4cbfabf-a00e-7b82-b411-0e442205360a"; |
|---|
| 75 | |
|---|
| 76 | include("../base/notes_records.php"); |
|---|
| 77 | //=================================================================================== |
|---|
| 78 | //== THAT's IT == |
|---|
| 79 | //=================================================================================== |
|---|
| 80 | |
|---|
| 81 | ?> |
|---|