コード例 #1
0
<?php

session_start();
var_dump($_POST['markasdone_button']);
?>

<?php 
session_start();
include_once 'apicaller.php';
$apicaller = new ApiCaller('APP001', '28e336ac6c9423d946ba02d19c6a2632', 'http://localhost/simpletodo_api/');
$mark_as_done = isset($_POST['markasdone_button']) ? 'true' : $_POST['is_done'];
$new_item = $apicaller->sendRequest(array('controller' => 'todo', 'action' => 'update', 'todo_id' => $_POST['todo_id'], 'title' => $_POST['title'], 'due_date' => $_POST['due_date'], 'description' => $_POST['description'], 'is_done' => $mark_as_done, 'username' => $_SESSION['username'], 'userpass' => $_SESSION['userpass']));
header('Location: todo.php');
exit;
コード例 #2
0
ファイル: getAddressesById.php プロジェクト: martinsv/phpipam
<?php

/**
 * Sample API php client application
 *
 * In this example we will fetch ip by its id
 *
 *	http://phpipam/api/client/getSubnetById.php?id=3
 */
# config
include_once '../apiConfig.php';
# API caller class
include_once '../apiClient.php';
# commands
$req['controller'] = "addresses";
$req['action'] = "read";
$req['format'] = "decimal";
$req['id'] = 1;
# wrap in try to catch exceptions
try {
    # initialize API caller
    $apicaller = new ApiCaller($app['id'], $app['enc'], $url, $format);
    # send request
    $response = $apicaller->sendRequest($req);
    print "<pre>";
    print_r($response);
} catch (Exception $e) {
    //catch any exceptions and report the problem
    print "Error: " . $e->getMessage();
}
コード例 #3
0
ファイル: testmember.php プロジェクト: arbuuuud/aops-test
<?php

session_start();
include_once 'apicaller.php';
$apicaller = new ApiCaller('APP001', '28e336ac6c9423d946ba02d19c6a2632', 'http://localhost/aops-server/');
$todo_items = $apicaller->sendRequest(array('controller' => 'member', 'action' => 'getmemberchilds', 'username' => 'aops', 'userpass' => 'password', 'member_id' => 4));
echo var_dump($todo_items);
コード例 #4
0
ファイル: login.php プロジェクト: arbuuuud/aops-client
                                <button class="btn btn-default" type="button">
                                    <i class="fa fa-search"></i>
                                </button>
                            </span>
                            </div>
                            <!-- /input-group -->
                        </li>
                        <li>
                            <a href="index.html"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
                        </li>
                        <li>
								<?php 
include_once 'apicaller.php';
// $apicaller = new ApiCaller('APP001', '28e336ac6c9423d946ba02d19c6a2632','http://localhost:8000/api');
$apicaller = new ApiCaller('APP001', '28e336ac6c9423d946ba02d19c6a2632', 'http://localhost/gnt-aops/public/api');
$data = $apicaller->sendRequest(array('action' => 'login', 'apiname' => 'aops', 'apipass' => 'password', 'member_id' => 2, 'username' => 'natalius', 'name' => 'Natalius Sen', 'tgllahir' => '09101987', 'tglaplikasi' => '09101987', 'sponsor_id' => 0, 'introducer_id' => 0));
echo '<a href="http://localhost/gnt-aops/public/loginapi/' . $data . '"><i class="fa fa-edit fa-fw"></i>Prospecting System</a>';
// echo '<a href="http://localhost:8000/loginapi/'.$data.'"><i class="fa fa-edit fa-fw"></i>Prospecting System</a>';
?>

                        </li>
                    </ul>
                </div>
                <!-- /.sidebar-collapse -->
            </div>
            <!-- /.navbar-static-side -->
        </nav>

        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
コード例 #5
0
<?php

session_start();
include_once 'apicaller.php';
$apicaller = new ApiCaller('APP001', '28e336ac6c9423d946ba02d19c6a2632', 'http://localhost/simpletodo_api/');
$new_item = $apicaller->sendRequest(array('controller' => 'todo', 'action' => 'delete', 'todo_id' => $_GET['todo_id'], 'username' => $_SESSION['username'], 'userpass' => $_SESSION['userpass']));
header('Location: todo.php');
exit;
コード例 #6
0
ファイル: logout.php プロジェクト: arbuuuud/aops-client
<?php

session_start();
include_once 'apicaller.php';
/*ApiCaller(<API NAME>,<API KEY>,<URL SERVER>)*/
$apicaller = new ApiCaller('APP001', '28e336ac6c9423d946ba02d19c6a2632', 'http://localhost/gnt-aops/public/api');
$data = $apicaller->sendRequest(array('action' => 'logout', 'apiname' => 'aops', 'apipass' => 'password', 'member_id' => 3));
コード例 #7
0
ファイル: getBills.php プロジェクト: Radmation/Projects
<?php

header('Content-type: application/json');
// its json
include_once 'apicaller.php';
session_start();
$apicaller = new ApiCaller('APP001', '28e336ac6c9423d946ba02d19c6a2632', 'http://radmation.com/budget/');
$bill_items = $apicaller->sendRequest(array('controller' => 'bill', 'action' => 'read', 'username' => $_SESSION['username'], 'userpass' => $_SESSION['userpass']));
//echo '';
echo $bill_items;
コード例 #8
0
ファイル: editBill.php プロジェクト: Radmation/Projects
<?php 
include_once 'apicaller.php';
session_start();
$apicaller = new ApiCaller('APP001', '28e336ac6c9423d946ba02d19c6a2632', 'http://radmation.com/budget/');
//$bill->is_gain = $this->_params['is_gain']; // bill name/type todo add me
//$bill->bill_name = $this->_params['bill_name']; // bill name/type todo change me from bill type
//$bill->frequency = $this->_params['frequency']; // how often todo SINGLE WEEKLY BI-WEEKLY MONTHLY
//$bill->due_period = $this->_params['due_period']; // how often todo enum('eom','bom')
//$bill->every_x_days = $this->_params['every_x_days']; // how often todo int add me
//$bill->on_the_x = $this->_params['on_the_x']; // how often todo int add me
//$bill->amount = $this->_params['amount']; // dollar amount
$updated_bill = $apicaller->sendRequest(array('controller' => 'bill', 'action' => 'update', 'username' => $_SESSION['username'], 'userpass' => $_SESSION['userpass'], 'bill_id' => '112', 'is_gain' => '0', 'bill_name' => 'Radleys Bill', 'frequency' => 'weekly', 'every_x_days' => '15', 'amount' => '1000.50'));
//echo '';
echo $updated_bill;
コード例 #9
0
ファイル: deleteBill.php プロジェクト: Radmation/Projects
<?php

/**
 * Created by PhpStorm.
 * User: Radley
 * Date: 12/13/2015
 * Time: 3:45 PM
 */
header('Content-type: application/json');
// its json
include_once 'apicaller.php';
session_start();
$apicaller = new ApiCaller('APP001', '28e336ac6c9423d946ba02d19c6a2632', 'http://radmation.com/budget/');
$bill_items = $apicaller->sendRequest(array('controller' => 'bill', 'action' => 'delete', 'username' => $_SESSION['username'], 'userpass' => $_SESSION['userpass'], 'bill_id' => '111'));
//echo '';
echo $bill_items;
コード例 #10
0
ファイル: MemberAPI.php プロジェクト: arbuuuud/gnt-aops
 public static function getmemberchilds($member_id)
 {
     try {
         $apicaller = new ApiCaller(MemberAPI::API_KEY, MemberAPI::API_SECRET, MemberAPI::API_TARGET);
         $todo_items = $apicaller->sendRequest(array('controller' => 'member', 'action' => 'getmemberchilds', 'username' => MemberAPI::API_USERNAME, 'userpass' => MemberAPI::API_PASSWORD, 'member_id' => $member_id));
         return $todo_items;
     } catch (Exception $e) {
         return 'Trouble Connection';
     }
 }
コード例 #11
0
ファイル: addBill.php プロジェクト: Radmation/Projects
<?php 
include_once 'apicaller.php';
session_start();
$apicaller = new ApiCaller('APP001', '28e336ac6c9423d946ba02d19c6a2632', 'http://radmation.com/budget/');
//$bill->is_gain = $this->_params['is_gain']; // bill name/type todo add me
//$bill->bill_name = $this->_params['bill_name']; // bill name/type todo change me from bill type
//$bill->frequency = $this->_params['frequency']; // how often todo SINGLE WEEKLY BI-WEEKLY MONTHLY
//$bill->due_period = $this->_params['due_period']; // how often todo enum('eom','bom')
//$bill->every_x_days = $this->_params['every_x_days']; // how often todo int add me
//$bill->on_the_x = $this->_params['on_the_x']; // how often todo int add me
//$bill->amount = $this->_params['amount']; // dollar amount
$added_bill = $apicaller->sendRequest(array('controller' => 'bill', 'action' => 'create', 'username' => $_SESSION['username'], 'userpass' => $_SESSION['userpass'], 'is_gain' => '1', 'bill_name' => 'Amandas Bill', 'frequency' => 'weekly', 'due_period' => '', 'every_x_days' => '10', 'amount' => '500.50'));
//echo '';
$added_bill;
//echo  $enc_request = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, '28e336ac6c9423d946ba02d19c6a2632', json_encode($added_bill), MCRYPT_MODE_ECB));