I am using the TimeTrex Community (v11.2.1). PHP 5.6.33. Windows Server 2008R2 / IIS7. We are running Timetrex from your cloud. We created a web front-end for user punch-in/out. All has worked fine, including calling getPunch(), until yesterday.
Here's what getPunch() used to return:
Array ( [0] => Array ( [id] => 11e83c40-b4c5-b5e0-ade4-6b5d06ebb0d9 [user_id] => 11e80c21-6cce-4ac0-af79-6b5d06ebb0d9 [transfer] => [type_id] => 10 [type] => Normal [status_id] => 10 [status] => In [time_stamp] => 04-08-18 2:37 PM [punch_date] => 04-08-18 [punch_time] => 2:37 PM [punch_control_id] => 11e83c40-b4c3-43c0-b28f-6b5d06ebb0d9 [actual_time_stamp] => 04-08-18 2:37 PM [original_time_stamp] => 04-08-18 2:37 PM [schedule_id] => [station_id] => [station_station_id] => [station_type_id] => [station_type] => [station_source] => [station_description] => [longitude] => [latitude] => [position_accuracy] => [first_name] => Brian [last_name] => ONeal [user_status_id] => 10 [group_id] => 00000000-0000-0000-0000-000000000000 [group] => [title_id] => 11e83116-b3b4-95e0-8862-6b5d06ebb0d9 [title] => Information Technology [default_branch_id] => 11e832a3-e540-24a0-827b-6b5d06ebb0d9 [default_branch] => AdminHQ [default_department_id] => 11e832a3-18a1-b020-bfd0-6b5d06ebb0d9 [default_department] => AdminHQAdmin [date_stamp] => 04-08-18 [user_date_id] => [pay_period_id] => 11e83968-2dd2-6290-80ae-6b5d06ebb0d9 [branch_id] => 11e832a3-e540-24a0-827b-6b5d06ebb0d9 [branch] => AdminHQ [department_id] => 11e832a3-18a1-b020-bfd0-6b5d06ebb0d9 [department] => AdminHQAdmin [job_id] => 00000000-0000-0000-0000-000000000000 [job] => [job_item_id] => 00000000-0000-0000-0000-000000000000 [job_item] => [quantity] => 0 [bad_quantity] => 0 [meal_policy_id] => [note] => [other_id1] => [other_id2] => [other_id3] => [other_id4] => [other_id5] => [tainted] => [has_image] => [deleted] => [is_owner] => 1 [is_child] => [created_by_id] => 11e80c21-6cce-4ac0-af79-6b5d06ebb0d9 [created_by] => Brian C. ONeal [created_date] => 04-09-18 5:55 PM [updated_by_id] => 11e80c21-6cce-4ac0-af79-6b5d06ebb0d9 [updated_by] => Brian C. ONeal [updated_date] => 04-09-18 5:55 PM )
Now it only returns:
1
Code that we've been using for weeks that always returned the array shown above (and stopped as of yesterday):
$TIMETREX_URL = '
https://ondemand2002.timetrex.com/api/json/api.php';
$TIMETREX_USERNAME = "boneal";
$TIMETREX_PASSWORD = "password";
$arguments = array('user_name' => $TIMETREX_USERNAME, 'password' => $TIMETREX_PASSWORD );
$TIMETREX_SESSION_ID = postToURL( buildURL( 'APIAuthentication', 'Login' ), $arguments );
if ( $TIMETREX_SESSION_ID == FALSE ) {
echo "Login Failed!<br>";
exit;
}
//GET EMPLOYEE NUMBER FROM LOGIN FORM.
$arguments = array( 'filter_data' => array('employee_number' => 4499) //Use $_POST["empnumber"] from form
);
// GET ALL EMPLOYEE PUNCH DATA // WORKS FINE
$user_data = postToURL( buildURL( 'APIUser', 'getUser' ), array( $arguments ) );
echo "User ID is<b>: ".$user_data[0]['id']."</b> Name: <b>".$user_data[0]['last_name']."</b><br>";
// GET/DISPLAY USER TIMESHEET DATA for the date range based on todays date // WORKS FINE
echo "<br>----------getTimeSheetDates() data is below this line------------<br>";
$arguments = array( 'filter_data' => array('id' => $user_data[0]['id']));
$timesheetdata = postToURL( buildURL( 'APIPunch', 'getTimeSheetDates' ), '4-8-18' ); //Change hardcoded date to current system date
echo "Timesheet for Week of <b> ".$timesheetdata['start_display_date']."</b> to <b>".$timesheetdata['end_display_date']."</b><br>";
print_r($timesheetdata);
// THIS NEXT API CALL BELOW ALWAYS WORKED IN THE PAST. IT STOPPED WORKING AS OF YESTERDAY AND THERE WERE NO CHANGES MADE TO ANYTHING ANYWHERE. VERY STRANGE!!!
echo "<br><br>----------getPunch() data is below this line-------------------<br>";
$rx_punchdata = postToURL( buildURL( 'APIPunch', 'getPunch' ), array( $theUser ), array('filter_data' => array('date_stamp' => '4-8-18')) );
echo "Employee: <b>".$rx_punchdata[0]['last_name']."</b> Punch: <b>".$rx_punchdata[0]['status']." @ ".$rx_punchdata[0]['punch_time']."</b><br>";
print_r($rx_punchdata);