<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
</style>
<title>Test Metrics Index</title>
</head>
<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>metrics_index</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
$results = $ca->metrics_index();
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
$args = array('page' => 1);
$results = $ca->metrics_index($args);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
?>
</body>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>Test Users Checkins Index</title>
</head>

<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>users_checkins_index</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
$results = $ca->users_checkins_index(713959);
// Vanessa Carlton test user
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '</div>';
?>

</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>Test Get All Users</title>
</head>

<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>Get All Users</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = false;
/*
echo '<h2>Test: users_count</h2>';
$results = $ca->users_count('ljkd');
echo "<h2>results:</h2>";
echo '<pre>';
echo "Count:" . $results['count'];
echo '</pre>';
*/
// get page 1
$ca->debug = true;
$ca->json = false;
$results = $ca->users_index(array('page' => '1'));
$total_pages = $results['total_pages'];
<?php

/*
** Example Usage
**
**
*/
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<pre>';
$ca = new CityApi();
$results = $ca->groups_count();
// headers are NULL until after the first endpoint call
echo "\n<strong>group_count() results</strong>\n";
var_dump($results);
echo "\n<strong>last_response_start_line</strong>\n";
var_dump($ca->get_last_response_start_line());
echo '</pre>';
?>
 
Verb: <input type="text" name="formVerb" /><br />
URL: <input type="text" name="formURL" width="50" /><br />
<!--JSON Body: <input type="text" name="formJSONBody" width="50" /><br />-->
JSON Body: <textarea rows="4" cols="50" name="formJSONBody"></textarea><br />
<input type="submit" name="formSubmit" value="Submit" />
</form>

<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
try {
    if ($_POST['formSubmit'] == "Submit") {
        $verb = $_POST['formVerb'];
        $url = $_POST['formURL'];
        $body = $_POST['formJSONBody'];
        $ca = new CityApi();
        $ca->debug = true;
        $results = $ca->call_city($verb, $url, $body);
        echo "<h1>{$verb}{$url}{$body}</h1>";
        echo '<h2>Results</h2>';
        echo '<h3>HTTP Status</h3>';
        echo $ca->get_last_status_code();
        echo '<h3>HTTP Response Start Line</h3>';
        echo $ca->get_last_response_start_line();
        echo '<h3>HTTP Headers</h3>';
        var_dump($ca->get_last_headers());
        echo '<h3>City Results</h3>';
        echo $results;
        echo '<pre>';
        echo format_json($results);
        echo '</pre>';
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>Test Skills</h1>
<p>Tests:</p>
<ul>
<li>Skills Index</li>
<li>Skills Show</li>
<li>Skills Create</li>
<li>Skills Destroy</li>
<li>Skills Users Index</li>
<li>Skills Users Index Ids</li>
<li>Skills Users Count</li>
</ul>';
$ca = new CityApi();
$ca->debug = true;
echo '<h1>skills_index</h1>';
$ca->json = false;
$results = $ca->skills_index();
$skillid = $results['skills'][0]['id'];
echo '<pre>skillid: ' . $skillid . '</pre>';
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json(json_encode($results));
echo '</pre>';
echo '<hr>';
echo '<h1>skills_show</h1>';
$ca->json = true;
$results = $ca->skills_show($skillid);
echo '<h2>Formatted JSON results: </h2>';
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>Test Custom Fields Index</title>
</head>

<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>custom_fields_index</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
$args = NULL;
$results = $ca->custom_fields_index($args);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '</div>';
?>

</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>Test Users Notes Show</title>
</head>

<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>users_notes_show</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
$userid = 238801;
$noteid = 44999;
$results = $ca->users_notes_show($userid, $noteid);
echo "<h2>results:</h2>{$results}";
echo '<h2>var_dump results:</h2>';
var_dump($results);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '</div>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>Test Groups Addresses Create</title>
</head>

<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>groups_addresses_create()</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
echo '<h2>Test: </h2>';
$groupid = 43681;
$results = $ca->groups_addresses_create($groupid, array('street' => '123 Any Way', 'city' => 'Fulton', 'state' => 'MD', 'zipcode' => '20759', 'location_type' => 'Home'));
//echo "<h2>results:</h2>$results";
//echo '<h2>var_dump results:</h2>';
//var_dump($results);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '</div>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>Test Groups Index</title>
</head>

<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>groups_index()</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
$page = 1;
$results = $ca->groups_index(array('page' => $page));
//echo "<h2>results:</h2>$results";
//echo '<h2>var_dump results:</h2>';
//var_dump($results);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '<h1>groups_index("Test")</h1>';
$search = 'Test';
$results = $ca->groups_index(array('search' => $search));
//echo "<h2>results:</h2>$results";
</style>
<title>Test Funds Create Update Destroy</title>
</head>
<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>Test Funds Create Update Destroy</h1>
<p>Tests:</p>
<ul>
<li>Funds Create</li>
<li>Funds Update</li>
<li>Funds Destroy</li>
</ul>';
$ca = new CityApi();
$ca->debug = true;
echo '<hr>';
echo '<h1>funds_create</h1>';
$ca->json = false;
$args = array('name' => 'My Test Fund', 'external_id' => 'TF101', 'group_id' => '33150', 'campus_name' => 'My Campus', 'givable' => 'true');
$results = $ca->funds_create($args);
$fund_id = $results['id'];
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json(json_encode($results));
echo '</pre>';
echo '<hr>';
echo '<h1>funds_update</h1>';
$ca->json = true;
$args = array('name' => 'My Test Fund new name', 'external_id' => 'TF101a', 'group_id' => '33150', 'campus_name' => 'My Campus new name', 'givable' => 'false');
<link rel="stylesheet" type="text/css" href="css/style.css" />
</style>
<title>Test Campuses</title>
</head>
<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>Test Campuses</h1>
<p>Tests:</p>
<ul>
<li>Campuses Index</li>
<li>Campuses Show</li>
</ul>';
$ca = new CityApi();
$ca->debug = true;
echo '<h1>campuses_index</h1>';
$ca->json = false;
$results = $ca->campuses_index();
$campusid = $results['campuses'][0]['id'];
echo '<pre>campusid: ' . $campusid . '</pre>';
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json(json_encode($results));
echo '</pre>';
echo '<hr>';
echo '<h1>campuses_show</h1>';
$ca->json = true;
$results = $ca->campuses_show($campusid);
echo '<h2>Formatted JSON results: </h2>';
$results = $ca->checkins_by_callboard_number($callboard_number);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '<h1>checkins_by_pager_number</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
$pager_number = '103';
$results = $ca->checkins_by_pager_number($pager_number);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '<h1>checkins_by_parent_receipt_barcode</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
$parent_receipt_barcode = '103';
$results = $ca->checkins_by_parent_receipt_barcode($parent_receipt_barcode);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '</div>';
?>

</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>Test Groups Undo Scheduled Archive</title>
</head>

<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>groups_undo_scheduled_archive()</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
echo '<h2>Test: </h2>';
$groupid = 43682;
//$groupid = 33150;
$results = $ca->groups_undo_scheduled_archive($groupid);
//echo "<h2>results:</h2>$results";
//echo '<h2>var_dump results:</h2>';
//var_dump($results);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '</div>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>Test Groups Index</title>
</head>

<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>groups_index()</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = false;
$page = 1;
// args array can include
/*
page = [1,2,3,4,...]
search = ["downtown" | etc] <- optional group name search
under_group_id = [ 1234 | etc ] <- defaults to church group's ID
group_types = ["CG" | "Service" | "Campus" | etc] <- defaults to all group types
include_inactive = [ true | false ] <- defaults to false
include_addresses = [ true | false ]
include_composition = [ true | false ]
include_user_ids = [ true | false ]
*/
$results = $ca->groups_index(array('group_types' => 'Hope', 'include_addresses' => 'true'));
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>Test Web Hooks Destroy</title>
</head>

<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<h1>web_hooks_destroy</h1>';
echo '<div class="apitest">';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
$id = 24;
$results = $ca->web_hooks_destroy($id);
echo "<h2>results:</h2>{$results}";
echo '<h2>var_dump results:</h2>';
var_dump($results);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '<h2>HTTP Response Info</h2>';
echo '<pre>';
var_dump($ca->get_last_status_code());
var_dump($ca->get_last_response_start_line());
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
</style>
<title>Test Invitations Index</title>
</head>
<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>invitations_index</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
//$args = null;
$args = array('page' => 1, 'filter' => 'without_external_id_2');
$results = $ca->invitations_index($args);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
?>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>Test Barcodes Show</title>
</head>

<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>barcodes_show()</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
echo '<h2>Test: </h2>';
$barcode = '7055';
// actual barcode
//$barcode = '033E73B673'; // 404 not found
//$barcode = 'DEE97714A2'; // 404 not found
$results = $ca->barcodes_show($barcode);
//echo "<h2>results:</h2>$results";
//echo '<h2>var_dump results:</h2>';
//var_dump($results);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>Test Users Invitations Index</title>
</head>

<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>users_invitations_index</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
$userid = 238801;
$page = 1;
$results = $ca->users_invitations_index($userid, array('page' => $page));
echo "<h2>results:</h2>{$results}";
echo '<h2>var_dump results:</h2>';
var_dump($results);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '</div>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>Test Groups Create</title>
</head>

<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>groups_create()</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
echo '<h2>Test: </h2>';
$args = array('name' => 'Test Service Group 3', 'parent_id' => '43681', 'group_type' => 'Service', 'description' => 'A great group to serve in!', 'hide_albums' => 'true', 'target_size' => '20', 'secure' => 'true');
$results = $ca->groups_create($args);
//echo "<h2>results:</h2>$results";
//echo '<h2>var_dump results:</h2>';
//var_dump($results);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '<h2>HTTP Response Info</h2>';
echo '<pre>';
var_dump($ca->get_last_status_code());
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>Test Users Barcodes Destory</title>
</head>

<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>users_barcodes_destroy</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
$results = $ca->users_barcodes_destroy(238801, 55992);
echo "<h2>results:</h2>{$results}";
echo '<h2>var_dump results:</h2>';
var_dump($results);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '</div>';
?>

</body>
</html>
}
.debug {
margin: 0;
background-color:#E0EEEE;
}
</style>
<title>Test Users Skills Destroy</title>
</head>

<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<h1>users_skills_destroy</h1>';
echo '<div class="apitest">';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
$userid = 238801;
$name = 'Computer-Wordpress';
$results = $ca->users_skills_destroy($userid, $name);
// 2nd arg can be name or skill id
echo "<h2>results:</h2>{$results}";
echo '<h2>var_dump results:</h2>';
var_dump($results);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '<h2>HTTP Response Info</h2>';
echo '<pre>';
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>Test Users Create</title>
</head>

<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>users_create</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
echo "<h2>Test with no parameters - fail</h2>{$results}";
$results = $ca->users_create();
// fail test, no parameters
echo "<h2>results:</h2>{$results}";
$results = $ca->users_create(array('first' => 'Chew', 'last' => 'Bacca', 'primary_phone' => '(301) 555-1212', 'primary_phone_type' => 'Mobile'));
echo "<h2>results:</h2>{$results}";
echo '<h2>var_dump results:</h2>';
var_dump($results);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '</div>';
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>Test Groups Roles Index</title>
</head>

<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>groups_roles_index()</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
echo '<h2>Test: </h2>';
$groupid = 43682;
//$groupid = 33150;
$results = $ca->groups_roles_index($groupid, array('title' => 'Participants'));
//echo "<h2>results:</h2>$results";
//echo '<h2>var_dump results:</h2>';
//var_dump($results);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '</div>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>Test Addresses Show</title>
</head>

<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>addresses_show()</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
echo '<h2>Test: </h2>';
$addressid = 659146;
$results = $ca->addresses_show($addressid);
//echo "<h2>results:</h2>$results";
//echo '<h2>var_dump results:</h2>';
//var_dump($results);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '</div>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>Test Users Event Attendances Dates</title>
</head>

<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>users_event_attendances_dates</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
$results = $ca->users_event_attendances_dates(713959);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '</div>';
?>

</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>Test Roles Index</title>
</head>

<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>roles_index()</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
//$args = array('group_types' => 'Band', 'titles' => 'Leader,Manager'); // find leaders and managers of band groups
$args = array('group_types' => 'CG', 'titles' => 'Leader');
// find all leaders of small groups
$results = $ca->roles_index($args);
//$results = $ca->roles_index(); // find all roles!
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '</div>';
?>

</body>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>Test Users Addresses Destroy</title>
</head>

<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>users_addresses_destroy</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
$userid = 837592;
$addressid = 700884;
$results = $ca->users_addresses_destroy($userid, $addressid);
echo "<h2>results:</h2>{$results}";
echo '<h2>var_dump results:</h2>';
var_dump($results);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '</div>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>Test Users Processes Notes Index</title>
</head>

<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>users_processes_notes_index</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
echo "<h2>Test:</h2>";
$userid = 238801;
$processid = 12343;
$results = $ca->users_processes_notes_index($userid, $processid, array('page' => 1));
echo "<h2>results:</h2>{$results}";
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '<h2>HTTP Response Info</h2>';
echo '<pre>';
var_dump($ca->get_last_status_code());
var_dump($ca->get_last_response_start_line());
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>Test Groups Addresses Index</title>
</head>

<body>
<?php 
require_once 'test-util.php';
require_once dirname(__FILE__) . '/../lib/ca-main.php';
echo '<div class="apitest">';
echo '<h1>groups_addresses_index()</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
echo '<h2>Test: </h2>';
$groupid = 43681;
$page = 1;
$results = $ca->groups_addresses_index($groupid, array('page' => $page));
//echo "<h2>results:</h2>$results";
//echo '<h2>var_dump results:</h2>';
//var_dump($results);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '</div>';
?>