<?php
require_once('CeloxisAPI.php');
$api =
new CeloxisAPI("http://localhost:8888/psa/api.do");
try
{
//
// login
//
$api->login('mark', 'xxxxxxx', '12193391');
//
// Get all projects where percent complete is > 0 and manager_id is 29863
//
$rows =
$api->query(array('table'=>
'db_project', 'db_project.percent_complete.>' =>
0, 'manager_id' =>
29863));
foreach ($rows as $row)
{
echo 'id=' . $row['id'];
echo 'summary=' . $row['summary'];
echo '<br/>';
}
//
// Perform a custom query: get count of all projects by phases
// ONLY FOR INSTALLABLE CUSTOMERS
//
$api->query(array('table'=>
'generic', 'sql'=>
'select db_project_phase.name, count(*) from db_project,db_project_phase where db_project.phase_id=db_project_phase.id group by db_project_phase.name'));
//
// create a couple of users
//
array('first_name'=>'api fn 1', 'last_name'=>'api ln 1'),
array('first_name'=>'api fn 2', 'last_name'=>'api ln 2')
)
);
//
// create a project
//
$api->create("projects", array(
array('project_category_id'=> 7864,
'summary'=>'create by api 2',
'manager_id' => 29863,
'client_id' => 29862)
)
);
}
{
}
?>