$list = $_REQUEST['list']; $bhID = $_REQUEST['bhID']; if ($list == "11761") { $entity = "Candidate"; } elseif ($list == "11762") { $entity = "ClientContact"; } else { $entity = NULL; } $findObj = new fromEmt(); $API_currentSession = $findObj->getSESSION(); $client = $API_currentSession->client; $corporationId = $API_currentSession->corporationId; $userId = $API_currentSession->userId; if (empty($bhID)) { $dto = fromEmt::getUser($userEmail, $client, $corporationId, $userId, $entity); } else { $dto = $bhID; } $findID = new SoapVar($dto, XSD_INTEGER, "int", "http://www.w3.org/2001/XMLSchema"); $find_request = array('session' => $API_currentSession, 'entityName' => $entity, 'id' => $findID); $findResult = $findObj->getCLIENT()->find($find_request); $result = $findResult->return->dto; //extract info and populate the form $user = array('entity' => $entity, 'list' => $list, 'firstname' => (string) $result->firstName, 'lastname' => (string) $result->lastName, 'email' => (string) $result->email, 'jobtitle' => (string) $result->occupation, 'city' => (string) $result->address->city, 'state' => (string) $result->address->state, 'zip' => (string) $result->address->zip, 'bullhornuserid' => (int) $result->userID); $_SESSION['email'] = (string) $result->email; // print_r($result); $smarty = new ConfigSmarty(); $smarty->assign('user', $user); $smarty->assign('page', 'form'); $smarty->display('index.html');
session_start(); //print_r($_SESSION); //handling of the form info //##### SMARTY STUFF ######### require_once $_SERVER['DOCUMENT_ROOT'] . '/../inc/config.inc.php'; require_once 'class.configsmarty.php'; $smarty = new ConfigSmarty(); require_once $_SERVER['DOCUMENT_ROOT'] . '/../API/fromEMT/emt/fromEmt.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../API/toEMT/emt/emt.php'; $editObj = new fromEmt(); $API_currentSession = $editObj->getSESSION(); if (isset($_POST['case']) && $_POST['case'] == "edit_user") { $findID = new SoapVar($_POST['userid'], XSD_INTEGER, "int", "http://www.w3.org/2001/XMLSchema"); $find_request = array('session' => $API_currentSession, 'entityName' => $_POST['entity'], 'id' => $findID); $findResult = $editObj->getCLIENT()->find($find_request); $this_entity = $findResult->return->dto; $this_entity->firstName = $_POST['firstname']; $this_entity->lastName = $_POST['lastname']; $this_entity->email = $_POST['email']; if ($_POST['entity'] == "Candidate") { $this_entity->occupation = $_POST['job_title']; } $this_entity->address->city = $_POST['city']; $this_entity->address->state = $_POST['state']; $this_entity->address->zip = $_POST['zip']; $SOAP_this_entity = new SoapVar($this_entity, SOAP_ENC_OBJECT, "candidateDto", "http://candidate.entity.bullhorn.com/"); $request_array = array('session' => $API_currentSession, 'dto' => $SOAP_this_entity); $SOAP_request = new SoapVar($request_array, SOAP_ENC_OBJECT, "save", "http://save.apiservice.bullhorn.com/"); $saveResult = $editObj->getCLIENT()->save($SOAP_request); $emtObj = new EMT($_POST['entity'], "update", $_POST['list']);