Skip to content

Commit

Permalink
restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
jankom committed Sep 20, 2010
1 parent a15dd4b commit 08a210f
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ Plans
- Rebol
- Libs
- Example of client

- Bash
- Examples of client with curl
70 changes: 70 additions & 0 deletions python/lib.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<html>
<body>
<style>
body {
font-size: 12px;
font-family: Trebuchet MS, Arial, Tahoma;
padding: 0px;
margin: 0px;
}
div.type {
float: right;
color: gray;
font-weight: bold;
padding-right: 10px;
}
h1 {
margin: 0px;
padding 20px;
background-color: #444444;
color: white;
}
pre.req {
padding: 20px;
background-color: #f1f1f1;
}
pre.resp {
padding: 20px;
background-color: #f1f1f1;
}
form {
padding: 20px;
background-color: #f1f1ff;
}
</style>
<h1>InvoiceFox API explorer</h1>
<?php
require_once "pulp/Format.php";
require_once "strpcapi.php";
require_once "invfoxapi.php";


$apidef = array(
'invoice-sent' => array('select-all'),
'invoice-recv' => array('select-all'),
'partner' => array('select-all'),
'preinvoice' => array('select-all')
);

$RESOURCE = isset($_POST['resource']) ? $_POST['resource'] : '';
$METHOD = isset($_POST['method']) ? $_POST['method'] : '';
$ARGS = isset($_POST['args']) ? $_POST['args'] : '';


if (isset($_POST['call'])) {
$strpc = new StrpcAPI('vr64g6891lgatnf83dmxticsc10ashr2f4s9ye7w');
$response = $strpc->call($RESOURCE, $METHOD, $ARGS);
echo "<br/><div class='type'>response</div><pre class='resp'>"; print_r($response->res); echo "</pre>";
}
?>
<form method="post">
resource:<br/><input name="resource" value="<?php echo $RESOURCE ?>" />
<small><?php foreach ( $apidef as $res => $meths ) { echo $res . " &nbsp; "; } ?></small>
<br/>
method: <br/><input name="method" value="<?php echo $METHOD ?>"/><br/>
<br/>
arguments: <br/><textarea name="args" cols="100" rows="5"></textarea><br/>
<input type="submit" name="call" value="Call" />
</body>
</html>
name=asdasd&street=asdasds&postal=12312&city=asdasd&vatid=&phone=&website=&email=&notes=&vatbound=0&custaddr=&payment_period=14&street2=asdsad

0 comments on commit 08a210f

Please sign in to comment.