function saveUserData($imageName) { $json = new Services_JSON(); $filefield = 'custom4upload'; $debug = ''; foreach ($_POST as $key => $value) { $debug .= "{$key}: {$value}<br />"; } //Save User Data $userupdate = new AMP_User_Profile(AMP_Registry::getDbcon(), $_POST['Id']); $userdata = array('custom4' => $imageName); $userupdate->mergeData($userdata); $success = $userupdate->save(); }
function getEsts($gtdProj){ #get all the est logged to a pooject that have a basecamp id and returns array with basecamp as key and id as value $finder = new AMP_User_Profile(AMP_Registry::getDbcon()); $items = $finder->find(array('modin'=>'63','custom1'=>$gtdProj)); $out = array(); foreach ($items as $item) { if ($item->getData('custom8')){ $out[$item->getData('custom8')] = $item->getData('id'); } } return $out; }
function getUserData($id) { $user = new AMP_User_Profile(AMP_registry::getDbcon(), $id); if ($user) { $data = array(); $data['Email'] = $user->getData('Email'); $data['First_Name'] = $user->getData('First_Name'); $data['Last_Name'] = $user->getData('Last_Name'); $data['Phone'] = $user->getData('Phone'); $data['Company'] = $user->getData('Company'); $data['City'] = $user->getData('City'); $data['Country'] = $user->getData('Country'); $data['custom1'] = $user->getData('custom1'); $data['custom3'] = $user->getData('custom3'); $data['custom4'] = $user->getData('custom4'); $message = array(); $message['type'] = 'good'; $message['text'] = 'Success'; $json = new Services_JSON(); $json_data = array('data' => $data, 'message' => $message, 'success' => true); $output = $json->encode($json_data); return $output; } else { $message = array(); $message['type'] = 'bad'; $message['text'] = 'Unrecognized User ID'; $json_data = array('message' => $message); $output = $json->encode($json_data); return $output; } }