Location: PHPKode > projects > Business Customer and Lead Management > ILMS_Beta_Release1/home.php
<?
/*
**************************** Creation Log *******************************
	    File Name                   -  home.php
	    Module Name                 -  
	    Project Name                -  ILMS
	    Description                 -  Used as Main Page
	    Version                     -
	    Created by                  -  Ashutosh Upadhyay
	    Created on                  -  07 May 2008
******************************** Update Log *****************************
      SNo		Version		Updated by			Updated on			Description
*************************************************************************
*/


session_start();

if(!$_SESSION["sessionUserId"])
{
	header("Location: index.php");
}
$SID=$_SESSION["sessionUserId"];
//print "SID=".$SID;

require("libs/Smarty.class.php");
include "class/common/cls_dbintereaction.inc";
include "class/admin/cls_leadsEntry.inc";
include "common.php";
include "class/Leads/cls_calender.inc.php";
//include "class/common/cls_dbintereaction.inc";
$smarty = new smarty();
$objclsLeadsEntry = new cls_leadsEntry();

//Fetching All Profiles assigned To a Particular User*********  

$objclsLeadsEntry->SID = $SID;
$objRSPrrofiles = $objclsLeadsEntry->fnc_GetAllUserProfiles();

	if(mysql_num_rows($objRSPrrofiles) > 0)
		{
			$ProfilesID   = Array();
			$j = 0;
   		while($resRow = mysql_fetch_object($objRSPrrofiles))
			{ 
		    $ProfilesID[$j]    =  $resRow->ProfileID;
       	$j++;
			}//End of while	


		}


//Getting Screen Object Rights.

$arrLeadsRight       = ObjectRights($ProfilesID,1);
$arrUploadLeadsRight = ObjectRights($ProfilesID,2);
$arrUserMgmtRights   = ObjectRights($ProfilesID,3);
$arrMastersRights    = ObjectRights($ProfilesID,4);

$arrAddLeadRight       = ObjectRights($ProfilesID,10);
if($arrAddLeadRight[0]=='1' || $arrAddLeadRight[1]=='1' || $arrAddLeadRight[3]=='1' || $arrAddLeadRight[4]=='1')
{
	$addLeadRight = '1';	
}
else
{
	$addLeadRight = '0';
}

$arrNewLeadRight       = ObjectRights($ProfilesID,5);

if($arrNewLeadRight[0]=='1' || $arrNewLeadRight[1]=='1' || $arrNewLeadRight[3]=='1' || $arrNewLeadRight[4]=='1')
{
	$addNewLeadRight = '1';	
}
else
{
	$addNewLeadRight = '0';
}

$arrDisposedLeadRight       = ObjectRights($ProfilesID,6);

if($arrDisposedLeadRight[0]=='1' || $arrDisposedLeadRight[1]=='1' || $arrDisposedLeadRight[3]=='1' || $arrDisposedLeadRight[4]=='1')
{
	$addDispostedLeadRight = '1';	
}
else
{
	$addDispostedLeadRight = '0';
}

$arrAppointmentRight       = ObjectRights($ProfilesID,7);

if($arrAppointmentRight[0]=='1' || $arrAppointmentRight[1]=='1' || $arrAppointmentRight[3]=='1' || $arrAppointmentRight[4]=='1')
{
	$addAppointmentLeadRight = '1';	
}
else
{
	$addAppointmentLeadRight = '0';
}

$arrUnloadLeadsRight       = ObjectRights($ProfilesID,20);

if($arrUnloadLeadsRight[0]=='1' || $arrUnloadLeadsRight[1]=='1' || $arrUnloadLeadsRight[3]=='1' || $arrUnloadLeadsRight[4]=='1')
{
	$addUnloadLeadRight = '1';	
}
else
{
	$addUnloadLeadRight = '0';
}

$arrCustomerRight       = ObjectRights($ProfilesID,9);

if($arrCustomerRight[0]=='1' || $arrCustomerRight[1]=='1' || $arrCustomerRight[3]=='1' || $arrCustomerRight[4]=='1')
{
	$addCustomerLeadRight = '1';	
}
else
{
	$addCustomerLeadRight = '0';
}

if($addLeadRight=='1' || $addNewLeadRight=='1' || $addDispostedLeadRight=='1' || $addAppointmentLeadRight=='1' || $addUnloadLeadRight=='1' || $addCustomerLeadRight=='1')
{
	$LeadsRight ='1';
}
else
{
	$LeadsRight ='0';
}

////////////////////////////Upload Leads

$arrUploadLeadsRight       = ObjectRights($ProfilesID,11);

if($arrUploadLeadsRight[0]=='1' || $arrUploadLeadsRight[1]=='1' || $arrUploadLeadsRight[3]=='1' || $arrUploadLeadsRight[4]=='1')
{
	$addUploadLeadLeadRight = '1';	
}
else
{
	$addUploadLeadLeadRight = '0';
}

$arrAssignedLeadsRight       = ObjectRights($ProfilesID,12);

if($arrAssignedLeadsRight[0]=='1' || $arrAssignedLeadsRight[1]=='1' || $arrAssignedLeadsRight[3]=='1' || $arrAssignedLeadsRight[4]=='1')
{
	$addAssignedLeadLeadRight = '1';	
}
else
{
	$addAssignedLeadLeadRight = '0';
}

if($addUploadLeadLeadRight=='1' || $addAssignedLeadLeadRight=='1')
{
	$UploadLeadsRight ='1';
}
else
{
	$UploadLeadsRight ='0';
}

////////////////////////////User Management

$arrProfileRight       = ObjectRights($ProfilesID,13);

if($arrProfileRight[0]=='1' || $arrProfileRight[1]=='1' || $arrProfileRight[3]=='1' || $arrProfileRight[4]=='1')
{
	$addProfileRight = '1';	
}
else
{
	$addProfileRight = '0';
}

$arrCallCenterRight       = ObjectRights($ProfilesID,14);

if($arrCallCenterRight[0]=='1' || $arrCallCenterRight[1]=='1' || $arrCallCenterRight[3]=='1' || $arrCallCenterRight[4]=='1')
{
	$addCallCenterURight = '1';	
}
else
{
	$addCallCenterURight = '0';
}

$arrRoleRight       = ObjectRights($ProfilesID,15);

if($arrRoleRight[0]=='1' || $arrRoleRight[1]=='1' || $arrRoleRight[3]=='1' || $arrRoleRight[4]=='1')
{
	$addRoleURight = '1';	
}
else
{
	$addRoleURight = '0';
}

$arrUserRight       = ObjectRights($ProfilesID,16);

if($arrUserRight[0]=='1' || $arrUserRight[1]=='1' || $arrUserRight[3]=='1' || $arrUserRight[4]=='1')
{
	$addUserURight = '1';	
}
else
{
	$addUserURight = '0';
}

if($addProfileRight=='1' || $addCallCenterURight=='1' || $addRoleURight=='1' || $addUserURight=='1')
{
	$UserMgmtRights ='1';
}
else
{
	$UserMgmtRights ='0';
}


////////////////////////////Master

$arrProductRight       = ObjectRights($ProfilesID,18);

if($arrProductRight[0]=='1' || $arrProductRight[1]=='1' || $arrProductRight[3]=='1' || $arrProductRight[4]=='1')
{
	$addProductMRight = '1';	
}
else
{
	$addProductMRight = '0';
}

$arrProductTypeRight       = ObjectRights($ProfilesID,17);

if($arrProductTypeRight[0]=='1' || $arrProductTypeRight[1]=='1' || $arrProductTypeRight[3]=='1' || $arrProductTypeRight[4]=='1')
{
	$addProductTypeRight = '1';	
}
else
{
	$addProductTypeRight = '0';
}

if($addProductMRight=='1' || $addProductTypeRight=='1')
{
	$MastersRights ='1';
}
else
{
	$MastersRights ='0';
}

//Assigning To The Templates
$smarty->assign("LeadsRight",$LeadsRight);
$smarty->assign("UploadLeadsRight",$UploadLeadsRight);
$smarty->assign("UserMgmtRights",$UserMgmtRights);
$smarty->assign("MastersRights",$MastersRights);

$smarty->assign("ProfilesID",   $ProfilesID);
$smarty->assign("site",$site);
$smarty->display("mainheader.tpl"); //complie and render the output
$smarty->display("home.tpl"); //complie and render the output
?> 
Return current item: Business Customer and Lead Management