<?php

if (!isset($_SESSION)) {
    session_start();
}
if (isset($_POST['postvalue'])) {
    $portfolioid = $_POST['postvalue'];
}
if (empty($vendor)) {
    include_once $_SERVER['DOCUMENT_ROOT'] . "/eventconfig.php";
    include_once CLASSFOLDER . "/dbconnection.php";
    include_once CLASSFOLDER . "/vendor.php";
    $vendor = new vendorclass($dbconnection->dbconnector);
    include_once CLASSFOLDER . "/catalogs.php";
    $catalog = new catalogclass($dbconnection->dbconnector);
    $catalogArray = $catalog->GetAllCatalogValuesByMasterNames("PortfolioType");
}
if (empty($portfolio)) {
    $portfolio = !empty($portfolioid) ? $vendor->getportfoliobyid($portfolioid) : array();
}
?>
<li class="li-edit" style="display:none" id="<?php 
echo $portfolio['id'];
?>
-edit">
          <div class="box box-primary">

            <div class="box-body"> 
              <form id="<?php 
echo $portfolio['id'];
?>
 		<div class="col-xs-12">
 			<div class="box">
 				<div class="box-header">
 					<h3 class="box-title">Community List</h3>
 					<a title="Create Community" class="btn btn-default pull-right btn-sm " href="javascript:void(0)" 
 					onclick="getcontents('pages/events/updatecommunities.php','content');" > <i class="glyphicon  glyphicon-plus-sign"></i>Add new community</a>
 				</div>	
 				<div class="box-body">
 					<div id="example2_wrapper" class="dataTables_wrapper form-inline" role="grid">
 						<?php 
$totlaCommunities = $community->getTotalCommunities(null);
if ($totlaCommunities > 0) {
    if ($totlaCommunities >= ($page - 1) * $rows) {
        include_once CLASSFOLDER . "/catalogs.php";
        $catalog = new catalogclass($dbconnection->dbconnector);
        $catalogArray = $catalog->GetAllCatalogValuesByMasterNames("State,Zone");
        $communitylist = $community->getallcommunityLists($page, $rows, null);
        ?>
	
 								<table id="communitytable" class="table table-bordered table-hover dataTable" aria-describedby="example2_info">
 									<thead><tr >
 										<th>Community Id</th>
 										<th>Name</th>
 										<th >States</th>
 										<th >Zones</th>
 										<th >Created On</th>											
 									</tr></thead> 
 									<?php 
        foreach ($communitylist as $rowdata) {
            ?>
 									<tr >
    session_start();
}
/*if(!isset($_SESSION['hpadminloginstatus']) || $_SESSION['hpadminloginstatus']!="HPAdminLoggedIn")
{
	include_once("login_again.php");
	exit();
}
$navactive="createuser";*/
//$access=$_SESSION['action_list'];
include_once $_SERVER['DOCUMENT_ROOT'] . "/eventconfig.php";
include_once CLASSFOLDER . "/dbconnection.php";
include_once CLASSFOLDER . "/vendor.php";
$vendor = new vendorclass($dbconnection->dbconnector);
include_once CLASSFOLDER . "/catalogs.php";
$catalog = new catalogclass($dbconnection->dbconnector);
$catalogArray = $catalog->GetAllCatalogValuesByMasterNames('City');
$searchObject = isset($_POST['postvalue']) ? $_POST['postvalue'] : null;
if (!empty($searchObject)) {
    $rows = $searchObject['rows'];
    $page = $searchObject['page'];
} else {
    $rows = 20;
    $page = 1;
}
?>

</script>
<div id="gridcontent" class ="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
<?php

$serviceid = isset($_POST['postvalue']) ? $_POST['postvalue'] : null;
if (empty($vendor)) {
    include_once $_SERVER['DOCUMENT_ROOT'] . "/eventconfig.php";
    include_once CLASSFOLDER . "/dbconnection.php";
    include_once CLASSFOLDER . "/vendor.php";
    $vendor = new vendorclass($dbconnection->dbconnector);
    include_once CLASSFOLDER . "/catalogs.php";
    $catalog = new catalogclass($dbconnection->dbconnector);
    $catalogArray = $catalog->GetAllCatalogValuesByMasterNames("State,Zone,City,Services,Service Category");
}
if (empty($service)) {
    $service = !empty($serviceid) ? $vendor->getvendorservicebyid($serviceid) : array();
}
if (empty($attachments)) {
    $attachments = !empty($serviceid) ? $vendor->getAllAttachmentsByEntityId($serviceid, VENDORSERVICE) : null;
}
?>
<div class="box box-primary">
  <div class="box-header">
    <h3 class="box-title"><?php 
echo !empty($service['title']) ? $service['title'] : '';
?>
</h3>
    <a href="javascript:void(0);"  onclick="deletelist('<?php 
echo $service['id'];
?>
')" class="btn btn-box-tool pull-right"><i class="fa fa-times"></i></a>  
    <a href="javascript:void(0);"  onclick="editlist('<?php 
echo $service['id'];
if (!isset($_SESSION)) {
    session_start();
}
if (isset($_POST['postvalue'])) {
    $contactid = $_POST['postvalue'];
}
if (empty($vendor)) {
    include_once $_SERVER['DOCUMENT_ROOT'] . "/eventconfig.php";
    include_once CLASSFOLDER . "/dbconnection.php";
    include_once CLASSFOLDER . "/vendor.php";
    $vendor = new vendorclass($dbconnection->dbconnector);
    include_once CLASSFOLDER . "/catalogs.php";
    $catalog = new catalogclass($dbconnection->dbconnector);
    $statecatalogs = $catalog->GetAllCatalogValues('State');
    $citycatalogs = $catalog->GetAllCatalogValues('City');
    $catalogArray = $catalog->GetAllCatalogValuesByMasterNames("City,State");
}
if (empty($contact)) {
    $contact = !empty($contactid) ? $vendor->getcontactsbyid($contactid) : array();
}
?>
<li class="li-edit" style="display:none" id="<?php 
echo $contact['id'];
?>
-edit">
          <div class="box box-primary">

            <div class="box-body"> 
              <form id="<?php 
echo $contact['id'];
?>
<?php

if (!isset($_SESSION)) {
    session_start();
}
if (isset($_POST['postvalue'])) {
    $attachmentid = $_POST['postvalue'];
}
if (empty($vendorclass)) {
    include_once $_SERVER['DOCUMENT_ROOT'] . "/eventconfig.php";
    include_once CLASSFOLDER . "/dbconnection.php";
    include_once CLASSFOLDER . "/vendor.php";
    $vendorclass = new vendorclass($dbconnection->dbconnector);
    include_once CLASSFOLDER . "/catalogs.php";
    $catalog = new catalogclass($dbconnection->dbconnector);
    $catalogArray = $catalog->GetAllCatalogValuesByMasterNames("Services");
    $typeList = $vendorclass->AttachmentType->getlists();
}
if (empty($attachment)) {
    $attachment = !empty($attachmentid) ? $vendorclass->getvendorattachment($attachmentid) : array();
}
?>
<li class="li-edit" style="display:none" id="<?php 
echo $attachment['id'];
?>
-edit">
  <div class="box box-primary">

    <div class="box-body"> 
      <form id="<?php 
echo $attachment['id'];
 		<div class="col-xs-12">
 			<div class="box">
 				<div class="box-header">
 					<h3 class="box-title">Community List</h3>
 					<a title="Create Community" class="btn btn-default pull-right btn-sm " href="javascript:void(0)" 
 					onclick="getcontents('pages/events/updatecommunities.php','content');" > <i class="glyphicon  glyphicon-plus-sign"></i>Add new community</a>
 				</div>	
 				<div class="box-body">
 					<div id="example2_wrapper" class="dataTables_wrapper form-inline" role="grid">
 						<?php 
$totlaCommunities = $community->getTotalCommunities(null);
if ($totlaCommunities > 0) {
    if ($totlaCommunities >= ($page - 1) * $rows) {
        include_once CLASSFOLDER . "/catalogs.php";
        $catalog = new catalogclass($dbconnection->dbconnector);
        $catalogArray = $catalog->GetAllCatalogValuesByMasterNames("'State','Zone'");
        $communitylist = $community->getallcommunityLists($page, $rows, null);
        ?>
	
 								<table id="communitytable" class="table table-bordered table-hover dataTable" aria-describedby="example2_info">
 									<thead><tr >
 										<th>Community Id</th>
 										<th>Name</th>
 										<th >States</th>
 										<th >Zones</th>
 										<th >Created On</th>											
 									</tr></thead> 
 									<?php 
        foreach ($communitylist as $rowdata) {
            ?>
 									<tr >
 function GetAllCatalogValuesByMasterNames($masternames)
 {
     include_once CLASSFOLDER . "/catalogs.php";
     $catalog = new catalogclass($this->internalDB);
     return $catalog->GetAllCatalogValuesByMasterNames($masternames);
 }