| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | $Rev: 285 $ | $LastChangedBy: brieb $ |
|---|
| 4 | $LastChangedDate: 2007-08-27 14:05:27 -0600 (Mon, 27 Aug 2007) $ |
|---|
| 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 | include("../../include/session.php"); |
|---|
| 40 | include("include/fields.php"); |
|---|
| 41 | include("include/tables.php"); |
|---|
| 42 | include("modules/bms/include/aritems.php"); |
|---|
| 43 | |
|---|
| 44 | $aritems = new aritems($db,"tbld:c595dbe7-6c77-1e02-5e81-c2e215736e9c"); |
|---|
| 45 | $therecord = $aritems->processAddEditPage(); |
|---|
| 46 | |
|---|
| 47 | $payments = new aritemPayments($db, $therecord); |
|---|
| 48 | |
|---|
| 49 | $client = new relatedClient($db, $therecord["clientid"]); |
|---|
| 50 | $clientInfo = $client->getClientInfo(); |
|---|
| 51 | |
|---|
| 52 | $clientName = $clientInfo["name"]; |
|---|
| 53 | |
|---|
| 54 | if(isset($therecord["phpbmsStatus"])) |
|---|
| 55 | $statusmessage = $therecord["phpbmsStatus"]; |
|---|
| 56 | |
|---|
| 57 | $phpbms->cssIncludes[] = "pages/aritems.css"; |
|---|
| 58 | $phpbms->jsIncludes[] = "modules/bms/javascript/aritem.js"; |
|---|
| 59 | |
|---|
| 60 | //Form Elements |
|---|
| 61 | //============================================================== |
|---|
| 62 | $theform = new phpbmsForm(); |
|---|
| 63 | |
|---|
| 64 | $theinput = new inputCheckbox("posted",$therecord["posted"]); |
|---|
| 65 | $theinput->setAttribute("disabled","disabled"); |
|---|
| 66 | $theform->addField($theinput); |
|---|
| 67 | |
|---|
| 68 | $theinput = new inputField("client",$clientName,NULL,true,NULL,60,128); |
|---|
| 69 | $theinput->setAttribute("class","uneditable"); |
|---|
| 70 | $theinput->setAttribute("readonly","readonly"); |
|---|
| 71 | $theform->addField($theinput); |
|---|
| 72 | |
|---|
| 73 | $theinput = new inputField("type",$therecord["type"],NULL,true,NULL,14,64); |
|---|
| 74 | $theinput->setAttribute("class","uneditable"); |
|---|
| 75 | $theinput->setAttribute("readonly","readonly"); |
|---|
| 76 | $theform->addField($theinput); |
|---|
| 77 | |
|---|
| 78 | $theinput = new inputField("status",$therecord["status"],NULL,true,NULL,9,64); |
|---|
| 79 | $theinput->setAttribute("class","uneditable"); |
|---|
| 80 | $theinput->setAttribute("readonly","readonly"); |
|---|
| 81 | $theform->addField($theinput); |
|---|
| 82 | |
|---|
| 83 | $theinput = new inputField("theid",$therecord["id"],"id",true,NULL,9,64); |
|---|
| 84 | $theinput->setAttribute("class","uneditable"); |
|---|
| 85 | $theinput->setAttribute("readonly","readonly"); |
|---|
| 86 | $theform->addField($theinput); |
|---|
| 87 | |
|---|
| 88 | $theinput = new inputField("relatedid",$therecord["relatedid"],"related record id",true,NULL,42,64); |
|---|
| 89 | $theinput->setAttribute("class","uneditable"); |
|---|
| 90 | $theinput->setAttribute("readonly","readonly"); |
|---|
| 91 | $theform->addField($theinput); |
|---|
| 92 | |
|---|
| 93 | $theinput = new inputCurrency("amount", $therecord["amount"]); |
|---|
| 94 | $theinput->setAttribute("class","uneditable"); |
|---|
| 95 | $theinput->setAttribute("readonly","readonly"); |
|---|
| 96 | $theform->addField($theinput); |
|---|
| 97 | |
|---|
| 98 | $theinput = new inputCurrency("due", $therecord["amount"] - $therecord["paid"]); |
|---|
| 99 | $theinput->setAttribute("class","uneditable"); |
|---|
| 100 | $theinput->setAttribute("readonly","readonly"); |
|---|
| 101 | $theform->addField($theinput); |
|---|
| 102 | |
|---|
| 103 | $theform->jsMerge(); |
|---|
| 104 | //============================================================== |
|---|
| 105 | //End Form Elements |
|---|
| 106 | |
|---|
| 107 | |
|---|
| 108 | $pageTitle="AR Item"; |
|---|
| 109 | |
|---|
| 110 | include("header.php"); |
|---|
| 111 | ?><div class="bodyline"> |
|---|
| 112 | <?php $theform->startForm($pageTitle)?> |
|---|
| 113 | <input type="hidden" id="invoiceEdit" value="<?php echo getAddEditFile($db, "tbld:62fe599d-c18f-3674-9e54-b62c2d6b1883") ?>" /> |
|---|
| 114 | <input type="hidden" id="receiptEdit" value="<?php echo getAddEditFile($db, "tbld:43678406-be25-909b-c715-7e2afc7db601") ?>" /> |
|---|
| 115 | <input type="hidden" id="clientEdit" value="<?php echo getAddEditFile($db, "tbld:6d290174-8b73-e199-fe6c-bcf3d4b61083") ?>" /> |
|---|
| 116 | <input type="hidden" id="clientid" value="<?php echo $clientInfo["id"] ?>" /> |
|---|
| 117 | <div id="rightSideDiv"> |
|---|
| 118 | <fieldset id="fsAttributes"> |
|---|
| 119 | <legend>attributes</legend> |
|---|
| 120 | |
|---|
| 121 | <p><?php $theform->showField("theid")?></p> |
|---|
| 122 | |
|---|
| 123 | <p><?php $theform->showField("status")?></p> |
|---|
| 124 | |
|---|
| 125 | <p><?php $theform->showField("posted")?></p> |
|---|
| 126 | |
|---|
| 127 | </fieldset> |
|---|
| 128 | </div> |
|---|
| 129 | |
|---|
| 130 | |
|---|
| 131 | <div id="leftSideDiv"> |
|---|
| 132 | <fieldset > |
|---|
| 133 | <legend>item</legend> |
|---|
| 134 | |
|---|
| 135 | <p><?php $theform->showField("client"); ?> <button type="button" title="view client" class="graphicButtons buttonInfo" id="viewClient"><span>View Record</span></button></p> |
|---|
| 136 | |
|---|
| 137 | <p><?php $theform->showField("type"); ?></p> |
|---|
| 138 | |
|---|
| 139 | <p> |
|---|
| 140 | <input type="hidden" id="editrelatedid" name="editrelatedid" value="<?php echo($therecord["editrelatedid"]); ?>" /> |
|---|
| 141 | <?php $theform->showField("relatedid"); ?> |
|---|
| 142 | <button type="button" title="view related record" class="graphicButtons buttonInfo" id="viewRelatedButton"> |
|---|
| 143 | <span>View Record</span> |
|---|
| 144 | </button> |
|---|
| 145 | </p> |
|---|
| 146 | |
|---|
| 147 | </fieldset> |
|---|
| 148 | |
|---|
| 149 | <fieldset> |
|---|
| 150 | <legend>amount</legend> |
|---|
| 151 | |
|---|
| 152 | <p><?php $theform->showField("amount")?></p> |
|---|
| 153 | |
|---|
| 154 | <p><?php $theform->showField("due")?></p> |
|---|
| 155 | |
|---|
| 156 | </fieldset> |
|---|
| 157 | </div> |
|---|
| 158 | |
|---|
| 159 | <fieldset> |
|---|
| 160 | <legend>payments</legend> |
|---|
| 161 | |
|---|
| 162 | <div class="fauxP"><?php $payments->show()?></div> |
|---|
| 163 | |
|---|
| 164 | </fieldset> |
|---|
| 165 | |
|---|
| 166 | <?php |
|---|
| 167 | $theform->showGeneralInfo($phpbms,$therecord); |
|---|
| 168 | $theform->endForm(); |
|---|
| 169 | ?> |
|---|
| 170 | </div> |
|---|
| 171 | <?php include("footer.php");?> |
|---|