while($R_sync = mysql_fetch_assoc($Q)) { $sync[$R_sync['item_id']] = $R_sync; } */ $wsdl = dirname(__FILE__) . '/Services.wsdl'; $client = new NTLMSoapClient($wsdl, array('login' => $login['username'], 'password' => $login['password'], 'trace' => true, 'exceptions' => true)); $cal = new ExchangePHP($client); // $user_id => $primary_emailaddress $users = array('*****@*****.**', '*****@*****.**'); $calendaritems = array(); $items_new = array(); foreach ($users as $user_id => $user_email) { try { printout('New user: '******'Y-m-d') . 'T00:00:00', date('Y-m-d', time() + 61171200) . 'T00:00:00Z', $user_email); } catch (Exception $e) { printout('Exception - getCalendarItems: ' . $e->getMessage()); if ($cal->client->getError() == '401') { // Unauthorized printout('Wrong username and password.'); } exit; } $cal_ids = array(); // Id => ChangeKey if (is_null($calendaritems[$user_id])) { printout('getCalendarItems failed: ' . $cal->getError()); } else { // Going through existing elements foreach ($calendaritems[$user_id] as $item) {
echo mysql_error(); while ($R_item = mysql_fetch_assoc($Q)) { $items[$R_item['id']] = $R_item; } // Getting sync-data $sync = array(); $Q = mysql_query("select * from `sync` where `user` = '" . $login['username'] . "'"); echo mysql_error(); while ($R_sync = mysql_fetch_assoc($Q)) { $sync[$R_sync['item_id']] = $R_sync; } $wsdl = dirname(__FILE__) . '/Services.wsdl'; $client = new NTLMSoapClient($wsdl, array('login' => $login['username'], 'password' => $login['password'], 'trace' => true, 'exceptions' => true)); $cal = new ExchangePHP($client); try { $calendaritems = $cal->getCalendarItems(date('Y-m-d') . 'T00:00:00', date('Y-m-d', time() + 61171200) . 'T00:00:00Z'); } catch (Exception $e) { printout('Exception - getCalendarItems: ' . $e->getMessage()); if ($cal->client->getError() == '401') { // Unauthorized printout('Wrong username and password.'); } exit; } $cal_ids = array(); // Id => ChangeKey if (is_null($calendaritems)) { printout('getCalendarItems failed: ' . $cal->getError()); } else { // Going through existing elements foreach ($calendaritems as $item) {