Thursday 17 November 2011

init


<?php
require_once(ADMIN_LIB_PATH."user/userManager.php");
require_once(COMM_PATH."Paging.php");
$userDetail = new userManager();

$paging = new Paging();
$defNum = 10; // records per page
$page = 1;


if(isset($_REQUEST['page']) && $_REQUEST['page']!=''){
$page = $_REQUEST['page'];
} else {
$page = 1;
}
$limitDown = MG_RECORDS_PER_PAGE;
$limitUp = ($page-1)*$limitDown;


if(isset($_GET['msg']) && $_GET['msg']!=''){
if($_GET['msg']=='1'){
$message = 'User has been added successfully';
}
if($_GET['msg']=='2'){
$message = 'User has been updated successfully';
}

if($_GET['msg']=='3'){
$message = 'User has been deleted successfully';
}

if($_GET['msg']=='4'){
$errorUser = 'User Name already in use';
}
}

if(isset($_REQUEST['act']) && $_REQUEST['act']=='addUser')
{
$insertUser= $userDetail->addUser($_REQUEST,$_FILES);
if(isset($_REQUEST['uId']) && $_REQUEST['uId']!=''){
echo '<script>document.location.href="manageUser.php?msg=2";</script>';
exit();
} else {
echo '<script>document.location.href="manageUser.php?msg=1";</script>';
exit();
}
}

if(isset($pg_Name) && $pg_Name=='User List'){
$userList= $userDetail->getUserList($_REQUEST,$limitUp, $limitDown);
$pageCount= $userDetail->getCountOfPages();
$paging->setpagingparameters($pageCount);
}


$name=$userType=$userName=$email=$alternateEmail1=$alternateEmail2=$alternateEmail3=$address=$phoneNo=$cellPhone=$businessPhone=$barNo=$billingInformation=$billingPlan=$password=$isActive='';
if(isset($_REQUEST['uId']) && $_REQUEST['uId']!=''){
$editList= $userDetail->getUserForEdit($_REQUEST['uId']);

if(count($editList)>0){
$name=$editList[0]['name'];
$userType=$editList[0]['userType'];
$userName=$editList[0]['userName'];
$email=$editList[0]['email'];
$alternateEmail1=$editList[0]['alternateEmail1'];
$alternateEmail2=$editList[0]['alternateEmail2'];
$alternateEmail3=$editList[0]['alternateEmail3'];
$address=$editList[0]['address'];
$phoneNo=$editList[0]['phoneNo'];
$cellPhone=$editList[0]['cellPhone'];
$businessPhone=$editList[0]['businessPhone'];
$barNo=$editList[0]['barNo'];
$billingInformation=$editList[0]['billingInformation'];
$billingPlan=$editList[0]['billingPlan'];
$password=$editList[0]['password'];
$isActive=$editList[0]['isActive'];
}
}

?>

No comments:

Post a Comment