Get Hourly Wage by User ID

Discussion for TimeTrex open source community developers.
Post Reply
xiomai
Posts: 13
Joined: Wed Nov 18, 2015 1:36 am

Get Hourly Wage by User ID

Post by xiomai » Tue Feb 16, 2016 8:57 pm

Hi,

I cannot seem to get the result in acquiring a User's Wage Hourly Rate.

Code: Select all

require_once('../classes/modules/api/client/TimeTrexClientAPI.class.php');
/*
 Global variables
*/
$TIMETREX_URL = 'http://localhost/timetrex/api/soap/api.php';
$TIMETREX_USERNAME = 'username';
$TIMETREX_PASSWORD = 'password';

$api_session = new TimeTrexClientAPI();
$api_session->Login( $TIMETREX_USERNAME, $TIMETREX_PASSWORD );
if ( $TIMETREX_SESSION_ID == FALSE ) {
	echo "Login Failed!<br>\n";
	exit;
}

$user_obj = new TimeTrexClientAPI( 'User' );
$result = $user_obj->getUser(
									array('filter_data' => array(
																'user_name' => '1002',
															)
									)
								);

$user_data = $result->getResult();
$user_id = $user_data[0]['id'];

$wage_obj = new TimeTrexClientAPI( 'UserWage' );
/*$resultw = $wage_obj->getCommonUserWageData();*/
$resultw = $wage_obj->getUserWage(
									array('filter_data' => array(
																'user_id' => $user_id
															)
									
									)
								);

$wage_data = $resultw->getResult();

var_dump($wage_data);

Using the code above I only get this dump result:

Code: Select all

boolean true
Any parameters I missed in here?

Thanks.

xiomai
Posts: 13
Joined: Wed Nov 18, 2015 1:36 am

Re: Get Hourly Wage by User ID

Post by xiomai » Tue Feb 16, 2016 10:17 pm

All good..

I just f*d up the timetrex_url since i have a test and live environment.

wasted my whole morning looking for the issue. smh :lol:

Post Reply