case 'add': $message = 'Successfully saved the user profile: ' . $_SESSION['title']; break; } unset($_SESSION['task']); } $db = new database(); $sql = " select * from content_users cu "; $sql .= " where cu.userID=" . $userID; if (!($result = $db->query($sql))) { die('Error:' . $db->error()); } // saved the user profile into an array.. $my_profile = array(); while ($row = $db->fetcharray()) { $my_profile[] = $row; } $_SESSION['clickuserID'] = $my_profile[0]->userID; $db->freeresult(); // Log the activity $action = new activity(); $action->track_activity($userID, $action->viewing_user_profile, $my_profile[0]->username); // Get the position of this user $group_name = getGroup_name($my_profile[0]->usertypeID); // Get his last visit date $lastvisitDate = $my_profile[0]->lastvisitDate ? friendlyDate($my_profile[0]->lastvisitDate) : '0000-00-00 00:00:00'; // ok baby, let start compiling the page now..go! go! go! {mh} $tpl = new template_parser('../templates/my_profile.tpl.php'); $tags = array('{FULLNAME}' => $my_profile[0]->fullname, '{USERNAME}' => $my_profile[0]->username, '{EMAIL}' => $my_profile[0]->email, '{HOMEADDRESS}' => $my_profile[0]->homeaddress, '{INTERESTS}' => $my_profile[0]->interest, '{CELNO}' => $my_profile[0]->celno, '{PHONENO}' => $my_profile[0]->phoneno, '{MESSAGE}' => $message, '{LIST_USERTYPEID}' => ' ' . $group_name, '{IS_ENABLED}' => $my_profile[0]->is_enabled, '{REGISTER_DATE}' => friendlydate($my_profile[0]->registerDate), '{LAST_VISIT_DATE}' => $lastvisitDate, '{SITENAME}' => 'CMS Adminss', '{HEADER}' => ' ', '{TOPNAV}' => 'top_menu.php', '{SIDENAV}' => 'user_menu2.php', '{FOOTER}' => 'footer.php'); $tpl->parse_template($tags); print $tpl->display();
session_start(); // if user is not login..redirect him to login page if (!isset($_SESSION['login'])) { header('Location: login.php'); } if (isset($_SESSION['login'])) { $userID = $_SESSION['userID']; $username = $_SESSION['username']; // Log the activity $action = new activity(); $action->track_activity($userID, $action->loggedin, '--'); } $x = new online_tracker(); $x->tracker(); $usertypeID = getUser_info($userID, 'usertypeID'); $position = getGroup_name($usertypeID); $message = ' Welcome ' . $username . '!'; switch ($position) { case 'Administrator': $message .= ', you logged in as ' . $position . '.'; $_SESSION['stageID'] = 6; break; case 'Writer': $x = checkUserAccessRights($userID, 2); if (!$x) { $message .= ' Sorry, the admin restrict you to act as a Writer.'; } else { $message .= ', you logged in as ' . $position . '.'; } $_SESSION['stageID'] = 1; break;
$usertypes .= $data->usertype_name; $usertypes .= '</option>'; } else { $usertypes .= '<option value="' . $data->usertypeID . '">'; $usertypes .= $data->usertype_name; $usertypes .= '</option>'; } } if (!$my_profile[0]->is_enabled) { $block .= '<input name="enabled" type="radio" value="1" >Yes'; $block .= '<input name="enabled" type="radio" value="0" checked>No'; } else { $block .= '<input name="enabled" type="radio" value="1" checked>Yes'; $block .= '<input name="enabled" type="radio" value="0" >No'; } $set_template = '../templates/edit_user_profile_manager.tpl.php'; break; default: $current_usertype = getGroup_name($my_profile[0]->usertypeID); $usertypes .= '<option value="' . $my_profile[0]->usertypeID . '" selected >'; $usertypes .= $current_usertype; $usertypes .= '</option>'; $set_template = '../templates/edit_user_profile.tpl.php'; break; } //echo $set_template; // ok baby, let start compiling the page now..go! go! go! {mh} $tpl = new template_parser($set_template); $tags = array('{FULLNAME}' => $my_profile[0]->fullname, '{USERNAME}' => $my_profile[0]->username, '{EMAIL}' => $my_profile[0]->email, '{HOMEADDRESS}' => $my_profile[0]->homeaddress, '{INTERESTS}' => $my_profile[0]->interest, '{CELNO}' => $my_profile[0]->celno, '{PHONENO}' => $my_profile[0]->phoneno, '{MESSAGE}' => $message, '{GROUP}' => $usertypes, '{CATEGORY}' => ' ' . $category_names, '{IS_ENABLED}' => $block, '{REGISTER_DATE}' => friendlyDate($my_profile[0]->registerDate), '{LAST_VISIT_DATE}' => friendlydate($my_profile[0]->lastvisitDate), '{SITENAME}' => 'CMS Adminss', '{HEADER}' => ' ', '{TOPNAV}' => 'top_menu.php', '{FOOTER}' => 'footer.php'); $tpl->parse_template($tags); print $tpl->display();
$row_data2 .= '</td>'; $row_data2 .= '<td align="left">'; $row_data2 .= ' ' . $content_users[$i]->fullname; $row_data2 .= '</td>'; $row_data2 .= '<td align="left">'; $row_data2 .= ' ' . $content_users[$i]->username; $row_data2 .= '</td>'; $row_data2 .= '<td align="left">'; if (!$content_users[$i]->is_enabled) { $row_data2 .= '<img src="images/publish_x.png" width="12" height="12" border="0" alt="disabled" />'; } else { $row_data2 .= '<img src="images/tick.png" width="12" height="12" border="0" alt="enabled" />'; } $row_data2 .= '</td>'; $row_data2 .= '<td align="left">'; $group_name = getGroup_name($content_users[$i]->usertypeID); $row_data2 .= ' ' . $group_name; $row_data2 .= '</td>'; $row_data2 .= '<td>'; $row_data2 .= ' ' . $content_users[$i]->email; $row_data2 .= '</td>'; $row_data2 .= '<td>'; if ($content_users[$i]->phoneno) { $contactno = $content_users[$i]->phoneno; } else { if ($content_users[$i]->celno) { $contactno = $content_users[$i]->celno; } else { $contactno = '--'; } }