$user_name = $_POST['username']; $pass_word = $_POST['password']; $user_auth = array('user_auth' => array('user_name' => $user_name, 'password' => md5($pass_word), 'version' => '0.1'), 'application_name' => 'soapleadcapture'); $result_array = $soapclient->call('login', $user_auth); var_dump($result_array); if ($result_array) { if ($result_array['id'] == -1) { header("Location: login.php"); } else { //assigning session values $_SESSION['session_id'] = $result_array['id']; $user_guid = $soapclient->call('get_user_id', $_SESSION['session_id']); $_SESSION['user_id'] = $user_guid; $_SESSION['user_name'] = $user_name; //getting role id of the user $role_id = $cafe_mgmt->getEmUserRoleId($user_guid); //checking role id switch ($role_id) { //if user id is of operational database team case '7b55a841-245f-82fb-7408-4b47157e32f3': header("Location: ../database/index.php"); break; //if user id is of operational maintenance team //if user id is of operational maintenance team case '9dbd3a61-cb96-c0f0-b51f-4b4715a58a0d': header("Location: ../maintenance/index.php"); break; //if user id is of operational installation team //if user id is of operational installation team case '9a4fcb59-0f63-d164-f7c2-4b4715f27072': header("Location: ../installation/index.php");
<div id="bodyPan"> <center> <p>Employees List </p> <p> </p> <table width="764" border="1"> <tr> <td width="90">User Id</td> <td width="87">Name</td> <td width="90">City</td> <td width="134">Department</td> <td width="110">Role</td> <td width="83">View Details</td> </tr> <?php while ($rows = mysql_fetch_array($rs_employee)) { $role_id = $cafe_mgmt->getEmUserRoleId($rows['id']); echo '<tr>'; echo '<td>' . $rows['user_name'] . '</td>'; echo '<td>' . $rows['first_name'] . ' ' . $rows['last_name'] . '</td>'; echo '<td>' . $cafe_details->getCityName($rows['address_city']) . '</td>'; echo '<td>' . $rows['department'] . '</td>'; echo '<td>' . $cafe_mgmt->getEmRoleName($role_id) . '</td>'; echo '<td><a href="emp_details.php?user_id=' . $rows['id'] . '">View Details</a></td>'; echo '</tr>'; } ?> </table> </center> <p class="toptextpadding"><a href="create_employee.php">Create Employee</a> <p class="toptextpadding"><a href="assign_employee.php">Assign Employee</a> </p>