phpBMS

root/trunk/phpbms/modules/api/push_records_addedit.php

Revision 703, 11.5 KB (checked in by brieb, 2 years ago)
  • Rearranged payment processing routine to be more flexible. It now needs to save the sales order first
  • Added payment processing template so developers have a guide when putting together their payment scripts
  • It seems their might be some unintentional touching of other files in this commit;
Line 
1<?php
2/*
3 $Rev: 643 $ | $LastChangedBy: nate $
4 $LastChangedDate: 2009-09-02 14:00:56 -0600 (Wed, 02 Sep 2009) $
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        include("include/fields.php");
42        include("include/tables.php");
43    include("include/pushrecords.php");
44
45        $thetable = new pushrecords($db,"tbld:73adc80f-7f0e-e340-937e-41194c5bda29");
46        $therecord = $thetable->processAddEditPage();
47
48
49        if(isset($therecord["phpbmsStatus"]))
50                $statusmessage = $therecord["phpbmsStatus"];
51
52    $phpbms->jsIncludes[] = "modules/api/javascript/pushrecords.js";
53    $phpbms->cssIncludes[] = "pages/api/pushrecords.css";
54
55                //Form Elements
56                //==============================================================
57                $theform = new phpbmsForm(NULL, "post", "record", NULL);
58        $theform->id = $theform->name;
59
60        /**
61          *  Attributes
62          */
63       
64        $theinput = new inputDataTableList($db, "originuuid", $therecord["originuuid"], "`tabledefs`",
65                                           "`uuid`", "`displayname`", "", "`displayname` ASC",
66                                           false, "origin table definition");
67        $theform->addField($theinput);
68
69        $theinput = new inputDataTableList($db, "destuuid", $therecord["destuuid"], "`tabledefs`",
70                                           "`uuid`", "`displayname`", "", "`displayname` ASC",
71                                           false, "destination table definition");
72        $theform->addField($theinput);
73
74        $theinput = new inputCheckbox("usecustomdestuuid", $therecord["usecustomdestuuid"], "override destination tabledef uuid");
75        $theform->addField($theinput);
76
77        $theinput = new inputField("customdestuuid", $therecord["customdestuuid"], "custom destination tabledef uuid");
78        $theform->addField($theinput);
79
80        $thelist = array("Insert / Replace" => "insert", "Update" => "update", "Custom..." => "custom");
81        $theinput = new inputBasicList("apicommand", $therecord["apicommand"], $thelist, "command");
82        $theform->addField($theinput);
83
84        $theinput = new inputField("customcommand", $therecord["customcommand"], "custom command");
85        $theform->addField($theinput);
86       
87        /**
88          *  API Options
89          */
90       
91        $theinput = new inputCheckbox("keepdestid", $therecord["keepdestid"], "keep destination record id");
92        $theform->addField($theinput);
93       
94        $theinput = new inputCheckbox("useuuid", $therecord["useuuid"], "uuid id field is primary");
95        $theform->addField($theinput);
96       
97        $list = array(
98            "SQL"=>"SQL",
99            "English, US" => "English, US",
100            "English, UK" => "English, UK",
101            "Dutch, NL" => "Dutch, NL"
102        );
103        $theinput = new inputBasicList("dateformat", $therecord["dateformat"], $list, "data date format");
104        $theform->addField($theinput);
105       
106        $list = array(
107            "24 Hour"=>"24 Hour",
108            "12 Hour" => "12 Hour"
109        );
110        $theinput = new inputBasicList("timeformat", $therecord["timeformat"], $list, "data time format");
111        $theform->addField($theinput);
112       
113        $theinput = new inputTextarea("extraoptions", $therecord["extraoptions"], "additonal options");
114        $theform->addField($theinput);
115       
116
117                /**
118          *  Script Information
119          */
120       
121        $theinput = new inputField("name",$therecord["name"], "name",true,NULL,28,64);
122                $theinput->setAttribute("class","important");
123                $theform->addField($theinput);
124
125        $thelist = array("All" => "all", "Selected Records" => "select", "Saved Search" => "custom");
126        $theinput = new inputBasicList("whereselection", $therecord["whereselection"], $thelist, "which records");
127        $theform->addField($theinput);
128       
129        $theinput = new inputDataTableList($db, "customwhere", $therecord["customwhere"], "usersearches", "uuid", "name",
130                                           "`tabledefid`='".mysql_real_escape_string($therecord["originuuid"])."' AND `type` = 'SCH'", "name ASC", true,
131                                           "Saved Search", true, "");
132        $theform->addField($theinput);
133
134        /**
135          *  Server Information
136          */
137       
138        $thelist = array("POST" => "POST", "GET" => "GET");
139        $theinput = new inputBasicList("httpformat", $therecord["httpformat"], $thelist, "http format");
140        $theform->addField($theinput);
141
142        $thelist = array("JSON" => "json");
143        $theinput = new inputBasicList("dataformat", $therecord["dataformat"], $thelist, "api data format");
144        $theform->addField($theinput);
145
146        $theinput = new inputCheckbox("ssl", $therecord["ssl"], "ssl");
147        $theform->addField($theinput);
148
149        $theinput = new inputField("server", $therecord["server"], "server", true);
150        $theform->addField($theinput);
151
152        $theinput = new inputField("destscript",$therecord["destscript"], "script path from the server", true);
153                $theform->addField($theinput);
154
155        $theinput = new inputField("port", $therecord["port"], "port (if different from 80 or 443)", false, "integer", 12, 12);
156        $theform->addField($theinput);
157
158        $theinput = new inputField("apiusername",$therecord["apiusername"], "api username", true);
159                $theform->addField($theinput);
160
161        $theinput = new inputField("apipassword",$therecord["apipassword"], "api password", false);
162                $theform->addField($theinput);
163
164        $thetable->getCustomFieldInfo();
165                $theform->prepCustomFields($db, $thetable->customFieldsQueryResult, $therecord);
166                $theform->jsMerge();
167                //==============================================================
168                //End Form Elements
169
170
171        $pageTitle = "Push Record";
172
173        include("header.php");
174?><div class="bodyline">
175        <?php $theform->startForm($pageTitle)?>
176
177    <div id="fsAttributes">
178        <fieldset>
179            <legend>attributes</legend>
180                <p><?php $theform->showfield("originuuid"); ?></p>
181               
182                <p>
183                    <?php $theform->showfield("usecustomdestuuid"); ?>
184                </p>
185                <p>
186                    <span id="destuuidspan">
187                        <?php $theform->showfield("destuuid"); ?>
188                    </span>
189                    <span id="customdestuuidspan">
190                        <?php $theform->showfield("customdestuuid"); ?>
191                    </span>
192                </p>
193               
194                <p><?php $theform->showfield("apicommand"); ?></p>
195                <p>
196                    <span id="customcommandspan">
197                        <?php $theform->showfield("customcommand"); ?>
198                    </span>
199                </p>
200        </fieldset>
201    </div>
202        <div id="nameDiv">
203                <fieldset>
204                        <legend>Script Information &amp; Options</legend>
205
206                        <p class="big"><?php $theform->showField("name"); ?></p>
207
208            <p>
209                <?php $theform->showfield("whereselection"); ?>
210                <span id="customwherespan">
211                    <br/>
212                <?php $theform->showfield("customwhere"); ?>
213                </span>
214            </p>
215            <p><button type="button" class="graphicButtons buttonDown" id="showoptions"><span>advanced options</span></button></p>
216            <div id="moreoptions">
217                <p class="notes">
218                    Option defaults are recommended for phpbms to phpbms pushes.
219                </p>
220                <p><?php $theform->showField("keepdestid"); ?></p>
221                <p><?php $theform->showField("useuuid"); ?></p>
222                <p><?php $theform->showField("dateformat"); ?></p>
223                <p><?php $theform->showField("timeformat"); ?></p>
224                <p>
225                    <span class="notes">
226                        Extra options can be added in a json object format of
227                        option:value. Example: { "var0":"value0", "var1":"value1",...}
228                    </span>
229                    <br/>
230                    <?php $theform->showField("extraoptions"); ?>
231                </p>
232            </div>
233                </fieldset>
234        <fieldset>
235            <legend>Server Information</legend>
236           
237            <p>
238                <span class="notes">
239                    POST http format is hightly recommended, especially for
240                    large pushes and for bms to bms pushes.
241                </span>
242                <br/>
243                <?php $theform->showfield("httpformat"); ?>
244                <?php $theform->showfield("ssl"); ?>
245            </p>
246            <p id="portP"><?php $theform->showfield("port"); ?></p>
247           
248            <p><?php $theform->showfield("server"); ?></p>
249            <p><?php $theform->showField("destscript"); ?></p>
250           
251            <p><?php $theform->showfield("apiusername"); ?></p>
252            <p><?php $theform->showfield("apipassword"); ?></p>
253           
254           
255            <p><?php $theform->showfield("dataformat"); ?></p>
256
257        </fieldset>
258                <?php $theform->showCustomFields($db, $thetable->customFieldsQueryResult) ?>
259        </div>
260        <?php
261                $theform->showGeneralInfo($phpbms,$therecord);
262                $theform->endForm();
263        ?>
264</div>
265<?php include("footer.php");?>
Note: See TracBrowser for help on using the browser.
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.