本文整理汇总了PHP中CityApi类的典型用法代码示例。如果您正苦于以下问题:PHP CityApi类的具体用法?PHP CityApi怎么用?PHP CityApi使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CityApi类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
<!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>
示例2: dirname
<!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>
示例3: dirname
<!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'];
示例4: dirname
<?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>';
?>
示例5: dirname
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>';
示例6: dirname
<?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>';
示例7: dirname
<!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>
示例8: dirname
<!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>';
?>
示例9: dirname
<!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>';
?>
示例10: dirname
<!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";
示例11: dirname
</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');
示例12: dirname
<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>';
示例13: format_json
$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>
示例14: dirname
<!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>';
?>
示例15: dirname
<!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'));