<?php require_once('../Connections/oprmConn.php'); include('check-admin-session.php'); 







if (!function_exists("GetSQLValueString")) {







function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 







{







  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;



  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);



  switch ($theType) {







    case "text":







      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";







      break;    







    case "long":







    case "int":







      $theValue = ($theValue != "") ? intval($theValue) : "NULL";







      break;







    case "double":







      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";







      break;







    case "date":







      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";







      break;







    case "defined":







      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;







      break;







  }







  return $theValue;







}







}



$maxRows_getTimeSheet = 1000000;







$pageNum_getTimeSheet = 0;







if (isset($_GET['pageNum_getTimeSheet'])) {







  $pageNum_getTimeSheet = $_GET['pageNum_getTimeSheet'];







}







$startRow_getTimeSheet = $pageNum_getTimeSheet * $maxRows_getTimeSheet;



$maxRows_getTimeSheet = 10;







$pageNum_getTimeSheet = 0;







if (isset($_GET['pageNum_getTimeSheet'])) {







  $pageNum_getTimeSheet = $_GET['pageNum_getTimeSheet'];







}







$startRow_getTimeSheet = $pageNum_getTimeSheet * $maxRows_getTimeSheet;







$uid = $_GET['created_by'];







mysql_select_db($database_oprmConn, $oprmConn);







if(isset($_GET['created_by'])){







$uid = $_GET['created_by'];



mysql_select_db($database_oprmConn, $oprmConn);











if(($uid != 'ALL')){



	mysql_select_db($database_oprmConn, $oprmConn);



	$query_getTotal = "SELECT * FROM weby_timesheets WHERE user_id = '$uid' and status ='A'";



$getTotal = mysql_query($query_getTotal, $oprmConn) or die(mysql_error());



$row_getTotal = mysql_fetch_assoc($getTotal);



$totalRows_getTotal = mysql_num_rows($getTotal);







mysql_select_db($database_oprmConn, $oprmConn);



$query_getUyear = "SELECT DISTINCT (task_year) FROM weby_timesheets WHERE user_id = '$uid' and status in ('A', 'Q','I') ORDER BY task_year DESC";



$getUyear = mysql_query($query_getUyear, $oprmConn) or die(mysql_error());



$row_getUyear = mysql_fetch_assoc($getUyear);



$totalRows_getUyear = mysql_num_rows($getUyear);











mysql_select_db($database_oprmConn, $oprmConn);



$query_getUwkes = "SELECT DISTINCT (task_week) FROM weby_timesheets WHERE user_id = '$uid' and status in ('A', 'Q','I') ORDER BY task_week DESC";



$getUwkes = mysql_query($query_getUwkes, $oprmConn) or die(mysql_error());



$row_getUwkes = mysql_fetch_assoc($getUwkes);



$totalRows_getUwkes = mysql_num_rows($getUwkes);











	if((!isset($_GET['year'])) && (!isset($_GET['week']))){



$query_getTimeSheet = "SELECT DISTINCT(weby_users.user_id),weby_timesheets.task_week,weby_timesheets.status,weby_timesheets.task_year,weby_profiles.full_name  FROM weby_timesheets, weby_users, weby_profiles where weby_users.user_id=weby_timesheets.user_id AND weby_profiles.user_id=weby_users.user_id AND weby_timesheets.status in ('A','Q','I') AND weby_profiles.status = 'A' AND weby_users.user_id = '$uid' ORDER BY weby_timesheets.task_year DESC, weby_timesheets.task_week DESC";



	}



	if((isset($_GET['year']))){



		if($_GET['year'] != 'ALL'){



$query_getTimeSheet = "SELECT DISTINCT(weby_users.user_id),weby_timesheets.task_week,weby_timesheets.status,weby_timesheets.task_year,weby_profiles.full_name  FROM weby_timesheets, weby_users, weby_profiles where weby_users.user_id=weby_timesheets.user_id AND weby_profiles.user_id=weby_users.user_id AND weby_timesheets.status in ('A','Q','I') AND weby_profiles.status = 'A' AND weby_users.user_id = '$uid' AND weby_timesheets.task_year = '$_GET[year]' ORDER BY weby_timesheets.task_year DESC, weby_timesheets.task_week DESC";



		



		mysql_select_db($database_oprmConn, $oprmConn);



$query_getUwkes = "SELECT DISTINCT (task_week) FROM weby_timesheets WHERE user_id = '$uid' and status in ('A', 'Q','I') and task_year = '$_GET[year]' ORDER BY task_week DESC";



$getUwkes = mysql_query($query_getUwkes, $oprmConn) or die(mysql_error());



$row_getUwkes = mysql_fetch_assoc($getUwkes);



$totalRows_getUwkes = mysql_num_rows($getUwkes);



		}



		if((isset($_GET['week']))){



		if($_GET['week'] != 'ALL'){



$query_getTimeSheet = "SELECT DISTINCT(weby_users.user_id),weby_timesheets.task_week,weby_timesheets.status,weby_timesheets.task_year,weby_profiles.full_name  FROM weby_timesheets, weby_users, weby_profiles where weby_users.user_id=weby_timesheets.user_id AND weby_profiles.user_id=weby_users.user_id AND weby_timesheets.status in ('A','Q','I') AND weby_profiles.status = 'A' AND weby_users.user_id = '$uid' AND weby_timesheets.task_year = '$_GET[year]' AND weby_timesheets.task_week = '$_GET[week]' ORDER BY weby_timesheets.task_year DESC, weby_timesheets.task_week DESC";



		}



		else if($_GET['week'] == 'ALL'){







	$url="timesheet-all.php?created_by=$_GET[created_by]&year=$_GET[year]";







	header("Location:$url");







	}



	}



		else if($_GET['year'] == 'ALL'){



			$url="timesheet-all.php?created_by=$_GET[created_by]";







	header("Location:$url");



		}



	}



	



}







else if(($uid == 'ALL')){







	$url="timesheet-all.php";







	header("Location:$url");







	}



	



}



//select * from



//(SELECT DISTINCT Name from Names WHERE Haircolor='Red') uniquenames



//INNER JOIN



//(SELECT * FROM Names) allnames



//ON uniquenames.Name = allnames.Name



if(!isset($_GET['created_by']) && ($uid != "ALL")){







$query_getTimeSheet = "SELECT DISTINCT(weby_users.user_id),weby_timesheets.task_week,weby_timesheets.status,weby_timesheets.task_year,weby_profiles.full_name  FROM weby_timesheets, weby_users, weby_profiles where weby_users.user_id=weby_timesheets.user_id AND weby_profiles.user_id=weby_users.user_id AND weby_timesheets.status in ('A','Q','I') AND weby_profiles.status = 'A' ORDER BY weby_timesheets.task_year DESC, weby_timesheets.task_week DESC";}







$query_limit_getTimeSheet = sprintf("%s LIMIT %d, %d", $query_getTimeSheet, $startRow_getTimeSheet, $maxRows_getTimeSheet);



$getTimeSheet = mysql_query($query_limit_getTimeSheet, $oprmConn) or die(mysql_error());



$row_getTimeSheet = mysql_fetch_assoc($getTimeSheet);



if(isset($_GET['created_by']) && ($uid == 'ALL')){







	$url="timesheet-all.php";







	header("Location:$url");







	}











mysql_select_db($database_oprmConn, $oprmConn);







$query_getSelect = "SELECT weby_users.user_id,  weby_users.caeated_date, weby_profiles.full_name, weby_users.status FROM weby_users, weby_profiles WHERE weby_profiles.user_id = weby_users.user_id AND weby_users.status in ('A','P','R') AND weby_profiles.status = 'A' AND weby_users.user_role != '1' ";







$getSelect = mysql_query($query_getSelect, $oprmConn) or die(mysql_error());







$row_getSelect = mysql_fetch_assoc($getSelect);







$totalRows_getSelect = mysql_num_rows($getSelect);







if (isset($_GET['totalRows_getTimeSheet'])) {







  $totalRows_getTimeSheet = $_GET['totalRows_getTimeSheet'];







} else {







  $all_getTimeSheet = mysql_query($query_getTimeSheet);







  $totalRows_getTimeSheet = mysql_num_rows($all_getTimeSheet);







}







$totalPages_getTimeSheet = ceil($totalRows_getTimeSheet/$maxRows_getTimeSheet)-1;



$queryString_getTimeSheet = "";







if (!empty($_SERVER['QUERY_STRING'])) {







  $params = explode("&", $_SERVER['QUERY_STRING']);







  $newParams = array();







  foreach ($params as $param) {







    if (stristr($param, "pageNum_getTimeSheet") == false && 







        stristr($param, "totalRows_getTimeSheet") == false) {







      array_push($newParams, $param);







    }







  }







}







/*







mysql_select_db($database_oprmConn, $oprmConn);







$query_getTimeSheet = "SELECT weby_timesheets.timesheet_id, weby_timesheets.user_id, weby_timesheets.total_hrs, weby_timesheets.hr_rate, weby_timesheets.total_amount, weby_profiles.full_name, weby_projects.project_name, weby_timesheets.created_date, weby_timesheetstatus.status_label FROM weby_timesheets, weby_profiles, weby_projects, weby_timesheetstatus WHERE weby_timesheets.created_by = weby_profiles.user_id  AND weby_projects.projetc_id = weby_timesheets.project_id AND weby_timesheetstatus.status = 'A'  AND weby_timesheetstatus.status_key = weby_timesheets.status";







$query_limit_getTimeSheet = sprintf("%s LIMIT %d, %d", $query_getTimeSheet, $startRow_getTimeSheet, $maxRows_getTimeSheet);







$getTimeSheet = mysql_query($query_limit_getTimeSheet, $oprmConn) or die(mysql_error());







$row_getTimeSheet = mysql_fetch_assoc($getTimeSheet);



if (isset($_GET['totalRows_getTimeSheet'])) {







  $totalRows_getTimeSheet = $_GET['totalRows_getTimeSheet'];







} else {







  $all_getTimeSheet = mysql_query($query_getTimeSheet);







  $totalRows_getTimeSheet = mysql_num_rows($all_getTimeSheet);







}







$totalPages_getTimeSheet = ceil($totalRows_getTimeSheet/$maxRows_getTimeSheet)-1;











*/











$maxRows_getRes = 2;







$pageNum_getRes = 0;







if (isset($_GET['pageNum_getRes'])) {







  $pageNum_getRes = $_GET['pageNum_getRes'];







}







$startRow_getRes = $pageNum_getRes * $maxRows_getRes;



mysql_select_db($database_oprmConn, $oprmConn);







$query_getRes = "SELECT weby_users.user_id, weby_users.email_address, weby_users.caeated_date, weby_profiles.profile_id, weby_profiles.full_name, weby_profiles.job_title, weby_profiles.skill_set, weby_profiles.profile_pic FROM weby_users, weby_profiles WHERE weby_users.status = 'P' AND weby_profiles.user_id = weby_users.user_id";







$query_limit_getRes = sprintf("%s LIMIT %d, %d", $query_getRes, $startRow_getRes, $maxRows_getRes);







$getRes = mysql_query($query_limit_getRes, $oprmConn) or die(mysql_error());







$row_getRes = mysql_fetch_assoc($getRes);



if (isset($_GET['totalRows_getRes'])) {







  $totalRows_getRes = $_GET['totalRows_getRes'];







} else {







  $all_getRes = mysql_query($query_getRes);







  $totalRows_getRes = mysql_num_rows($all_getRes);







}







$totalPages_getRes = ceil($totalRows_getRes/$maxRows_getRes)-1;



$maxRows_getRes1 = 2;







$pageNum_getRes1 = 0;







if (isset($_GET['pageNum_getRes1'])) {







  $pageNum_getRes1 = $_GET['pageNum_getRes1'];







}







$startRow_getRes1 = $pageNum_getRes1 * $maxRows_getRes1;



mysql_select_db($database_oprmConn, $oprmConn);







$query_getRes1 = "SELECT weby_users.user_id, weby_users.email_address, weby_users.caeated_date, weby_profiles.profile_id, weby_profiles.full_name, weby_profiles.job_title, weby_profiles.skill_set, weby_profiles.profile_pic FROM weby_users, weby_profiles WHERE weby_profiles.status = 'A' AND weby_users.status in ('A','P','R') AND weby_users.user_role <> 1 AND weby_profiles.user_id = weby_users.user_id order by weby_profiles.profile_id desc";







$query_limit_getRes1 = sprintf("%s LIMIT %d, %d", $query_getRes1, $startRow_getRes1, $maxRows_getRes1);







$getRes1 = mysql_query($query_limit_getRes1, $oprmConn) or die(mysql_error());







$row_getRes1 = mysql_fetch_assoc($getRes1);



if (isset($_GET['totalRows_getRes1'])) {







  $totalRows_getRes1 = $_GET['totalRows_getRes1'];







} else {







  $all_getRes1 = mysql_query($query_getRes1);







  $totalRows_getRes1 = mysql_num_rows($all_getRes1);







}







$totalPages_getRes1 = ceil($totalRows_getRes1/$maxRows_getRes1)-1;



?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



<html xmlns="http://www.w3.org/1999/xhtml">



<head>



<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />



<title>SS WEB TECHNOLOGIES - Tool-Admin-DashBoard</title>



<link rel="stylesheet" href="../css/style.css" type="text/css">



    <!-- IE Fix for HTML5 Tags -->



    <!--[if IE]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> 



	<![endif]-->



     <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">











<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>







<script src="//code.jquery.com/jquery-1.10.2.js"></script>







<script src="//code.jquery.com/ui/1.9.1/jquery-ui.js"></script>







<script src="../js/jquery.flexslider.js"></script>







<script language="JavaScript">







function setVisibility(id, visibility) {







document.getElementById(id).style.display = visibility;







}







</script>







<script type='text/javascript'>







function redirect(){







var created_by = document.getElementById('created_by').options[document.getElementById('created_by').selectedIndex].value;







window.location = "timesheet-all.php?created_by="+created_by+"";







}



function redirect1(){







var created_by = document.getElementById('created_by').options[document.getElementById('created_by').selectedIndex].value;



var year = document.getElementById('year').options[document.getElementById('year').selectedIndex].value;







window.location = "timesheet-all.php?created_by="+created_by+"&year="+year+"";







}







function redirect2(){







var created_by = document.getElementById('created_by').options[document.getElementById('created_by').selectedIndex].value;







var week = document.getElementById('week').options[document.getElementById('week').selectedIndex].value;







var year = document.getElementById('year').options[document.getElementById('year').selectedIndex].value;







var noyer = <?php echo date('Y'); ?>;







var nomnt = <?php echo date('W'); ?>;







if((year == noyer) && (week > nomnt)){



	alert("Selected Mont is greater than present month");



	return false;



}







window.location = "timesheet-all.php?created_by="+created_by+"&year="+year+"&week="+week+"";







}







</script>

<style>
.act_tsheet { background: #373938;
  color: #fff;}
  
  .main_content .timesheet_table .x_item_wide {
  display: inline-table;
  width: 105px;
}
.main_content .timesheet_table .item_small {
    display: inline-table;
    width: 60px;
}
</style>

</head>



<body>



<!-- Wrapper Starts -->

<div class="wrapper">

    <?php  require_once('../includes/header.php'); ?>
    
<?php  require_once('../includes/tools-menu.php'); ?>
  <!-- Content Goes here -->



    <article class="inside_wrapper clear_fix">



    



    	<!-- Main Content Goes here -->



     <section class="main_content">







    	 <h1>Current Timesheets</h1>







       







<div class="welcome_box1 welcome_2box">



<div class="welcome_txt"><strong>Select Resource: </strong>



	<select name="created_by" id="created_by" onChange="redirect();"><option value="ALL">ALL</option>



		<?php do { ?>



		<option value="<?php echo $row_getSelect['user_id']; ?>"  <?php if($row_getSelect['user_id'] == $_GET['created_by']){ ?> selected="selected" <?php } ?> > <?php echo $row_getSelect['full_name']; ?> </option>



		<?php } while ($row_getSelect = mysql_fetch_assoc($getSelect)); ?>



	</select>



</div> 



</div>



<?php if(isset($_GET['created_by'])){ 



if($totalRows_getTotal > 0){ ?> 



<div class="welcome_box1">



<div class="welcome_txt"><strong>Select Year: </strong>



	<select name="year" id="year" onChange="redirect1();" style="width:100px; background:url(../images/drop-arrow-bg.png) 70px 10px no-repeat #fff;"><option value="ALL">ALL</option>



		<?php do { ?>



		<option value="<?php echo $row_getUyear['task_year']; ?>"  <?php if($row_getUyear['task_year'] == $_GET['year']){  ?> selected="selected" <?php } ?> > 



		<?php echo $row_getUyear['task_year']; ?> </option>



		<?php } while ($row_getUyear = mysql_fetch_assoc($getUyear)); ?>



	</select>



</div>



<?php if(isset($_GET['year'])){ ?> 







<div class="welcome_txt"><strong>Select Week: </strong>



	<select name="week" id="week" onChange="redirect2();" style="width:100px; background:url(../images/dropbutton.png) 70px 10px no-repeat #fff;">



		<option value="ALL">ALL</option><?php do { ?>



		<option value="<?php echo $row_getUwkes['task_week']; ?>"  <?php if($row_getUwkes['task_week'] == $_GET['week']){  ?> selected="selected" <?php } ?> > <?php echo $row_getUwkes['task_week']; ?> </option>



		<?php } while ($row_getUwkes = mysql_fetch_assoc($getUwkes)); ?></select>







</div> 



<?php } ?>  </div>



<p>&nbsp;</p>



<p>&nbsp;</p> <?php  } ?> <?php } ?>



 <div class="clear-fix"></div>
<div class="timesheet_table clear_fix"  style="width:600px;">
<div class="column_title">
<span class="item_small" style="width:50px;">Week#</span>
<span class="item_wide" style="width:100px;">WE Date</span>
<span class="x_item_wide" style="width:200px;">Resource</span>
<!--<span class="item_wide" style="width:100px;">IP Address</span>-->
<span class="item_small" style="width:65px;">Status</span>
<span class="item_small" style="width:60px;">Total Hours</span>
<span class="item_small" style="width:50px;">Action</span>
</div>
<?php if($totalRows_getTimeSheet > 0 ) { do{
mysql_select_db($database_oprmConn, $oprmConn);
$query_getDetks = "SELECT * FROM weby_timesheets WHERE user_id = '$row_getTimeSheet[user_id]' AND task_week = '$row_getTimeSheet[task_week]' AND task_year = '$row_getTimeSheet[task_year]' AND status in ('A', 'Q','I') ORDER BY created_date DESC";
$getDetks = mysql_query($query_getDetks, $oprmConn) or die(mysql_error());
$row_getDetks = mysql_fetch_assoc($getDetks);
$totalRows_getDetks = mysql_num_rows($getDetks); ?>
<div class="row <?php if($n==0) { echo "yellow"; $n=1; } else $n=0; ?>">
<span class="item_small" style="width:50px;"><?php echo $row_getTimeSheet['task_week']; ?></span>
<span class="item_wide" style="width:100px;"><?php echo date('d/M/Y',strtotime($row_getDetks['created_date'])); ?></span>
<span class="x_item_wide" style="width:200px;"><?php echo $row_getTimeSheet['full_name']; ?></span>
<!--<span class="item_wide" style="width:100px;"><?php #echo $row_getDetks['ip_address']; ?></span>-->
<span class="item_small" style="width:65px;"><?php if($row_getTimeSheet['status'] == 'Q'){ echo 'Approved';} else if($row_getTimeSheet['status'] == 'A'){ echo 'Pending'; }  else if($row_getTimeSheet['status'] == 'I'){ echo 'In Draft';} ?></span>
<span class="item_small" style="width:60px;"><?php mysql_select_db($database_oprmConn, $oprmConn);
$query_getHrs = "SELECT  SUM(`total_hrs`) FROM weby_timesheets WHERE task_week = '$row_getTimeSheet[task_week]' and task_year = '$row_getTimeSheet[task_year]' and user_id = '$row_getTimeSheet[user_id]' and status in ('A', 'Q', 'I')";
$getHrs = mysql_query($query_getHrs, $oprmConn) or die(mysql_error());
$row_getHrs = mysql_fetch_assoc($getHrs);
$totalRows_getHrs = mysql_num_rows($getHrs);
echo $row_getHrs['SUM(`total_hrs`)']; ?></span>
</span>
<span class="item_small" style="width:50px;"><a href="timesheet-view.php?week=<?php if($row_getTimeSheet['task_week'] < 10){ echo '0'.$row_getTimeSheet['task_week'];} else {echo $row_getTimeSheet['task_week'];} ?>&year=<?php echo $row_getTimeSheet['task_year']; ?>&uid=<?php echo $row_getTimeSheet['user_id']; ?>"><b>View</b></a></span>
</div>
<?php } while ($row_getTimeSheet = mysql_fetch_assoc($getTimeSheet));  ?>


<div class="h-line"></div>

<div class="nav-right">

<table border="0" align="center" cellpadding="2" style="clear:both">

 <tr>



            <td colspan="4" align="center"><?php echo ($startRow_getTimeSheet + 1) ?> to <?php echo min($startRow_getTimeSheet + $maxRows_getTimeSheet, $totalRows_getTimeSheet) ?> of <?php echo $totalRows_getTimeSheet ?></td>



          </tr>


				<tr>







				<td align="center"><?php if ($pageNum_getTimeSheet > 0) { // Show if not first page ?>







				<a href="<?php printf("%s?pageNum_getTimeSheet=%d%s", $currentPage, 0, $queryString_getTimeSheet); ?><?php if(isset($_GET['created_by'])){ echo "&created_by=".$_GET['created_by'];}?><?php if(isset($_GET['year'])){ echo "&year=".$_GET['year'];}?>">&lt;&lt; First</a>







				<?php } // Show if not first page ?></td>







				<td align="center"><?php if ($pageNum_getTimeSheet > 0) { // Show if not first page ?>







					<a href="<?php printf("%s?pageNum_getTimeSheet=%d%s", $currentPage, max(0, $pageNum_getTimeSheet - 1), $queryString_getTimeSheet); ?><?php if(isset($_GET['created_by'])){ echo "&created_by=".$_GET['created_by'];}?><?php if(isset($_GET['year'])){ echo "&year=".$_GET['year'];}?>">&lt; Previous</a>







					<?php } // Show if not first page ?></td>







				<td align="center"><?php if ($pageNum_getTimeSheet < $totalPages_getTimeSheet) { // Show if not last page ?>







					<a href="<?php printf("%s?pageNum_getTimeSheet=%d%s", $currentPage, min($totalPages_getTimeSheet, $pageNum_getTimeSheet + 1), $queryString_getTimeSheet); ?><?php if(isset($_GET['created_by'])){ echo "&created_by=".$_GET['created_by'];}?><?php if(isset($_GET['year'])){ echo "&year=".$_GET['year'];}?>">Next &gt;</a>







					<?php } // Show if not last page ?></td>







				<td align="center"><?php if ($pageNum_getTimeSheet < $totalPages_getTimeSheet) { // Show if not last page ?>







					<a href="<?php printf("%s?pageNum_getTimeSheet=%d%s", $currentPage, $totalPages_getTimeSheet, $queryString_getTimeSheet); ?><?php if(isset($_GET['created_by'])){ echo "&created_by=".$_GET['created_by'];}?><?php if(isset($_GET['year'])){ echo "&year=".$_GET['year'];}?>">Last &gt;&gt;</a>







					<?php } // Show if not last page ?></td>







				</tr>







				</table></div>














				<?php  



				} else 



				{  



				echo '<div class="no-rows"> No records found</div>'; } 



				



				 



mysql_select_db($database_oprmConn, $oprmConn);







$query_getNext = "SELECT * FROM weby_timesheets WHERE status = 'A'";



$getNext = mysql_query($query_getNext, $oprmConn) or die(mysql_error());



$row_getNext = mysql_fetch_assoc($getNext);



$totalRows_getNext = mysql_num_rows($getNext);



if($totalRows_getNext == 0){



echo '<div class="timesheet-link"><!-- No records found --></div>'; } 



?>                  







						   <h4>&nbsp;</h4>







        </div>







		







    </section>



    



    	<!-- Sidebar Goes here -->



        <aside class="sidebar"> 
<?php /*?> <div class="featured clear_fix">
  	<h2 class="white_txt">PENDING RESOURCES</h2>

                <?php if($totalRows_getRes>0) { do { ?>
                <div class="profile_box">
   <a href="resources-view.php?user_id=<?php echo $row_getRes['user_id']; ?>"><img src="/RM/images/<?php if(!empty($row_getRes['profile_pic'])) echo $row_getRes['profile_pic']; else echo "black-img.jpg";?>" width="68" /></a>

 <p class="profile_title"><a href="resources-view.php?user_id=<?php echo $row_getRes['user_id']; ?>"><?php echo $row_getRes['full_name']; ?></a><span class="desig"><br />
                    <?php echo $row_getRes['job_title']; ?></span></p>



                <p class="profile_desc"><?php echo $row_getRes['skill_set']; ?></p>



                  <div class="clear-fix">&nbsp;</div>



            </div>



          <?php } while ($row_getRes = mysql_fetch_assoc($getRes)); } else { echo "<div class='no-rows'>No Pending Resources</div>";}?></div><?php */?>



       	  <h2>ACTIVE RESOURCES</h2>



         <form action="resources-list.php" method="post" id="act_resource_search">



         <input name="search" class="search" type="text" size="30" />



         <input name="submit" type="submit" class="search-sub" value="Search" />



         </form>



         



         



                <?php if($totalRows_getRes1>0) { do { ?>



                  <div class="profile_box">



                    <a href="resources-view.php?user_id=<?php echo $row_getRes1['user_id']; ?><?php ?>"><img src="/RM/images/<?php if(!empty($row_getRes1['profile_pic'])) echo $row_getRes1['profile_pic']; else echo "black-img.jpg";?>" width="68" /></a>



                    <p class="profile_title"><a href="resources-view.php?user_id=<?php echo $row_getRes1['user_id']; ?>"><?php echo $row_getRes1['full_name']; ?></a><span class="desig"><br />



                    <?php echo $row_getRes1['job_title']; ?></span></p>



                  <p class="profile_desc"><?php echo $row_getRes1['skill_set']; ?></p>



                    <div class="clear-fix">&nbsp;</div>



                        </div>



                  <?php } while ($row_getRes1 = mysql_fetch_assoc($getRes1)); } else { echo "<div>No Active Resources</div>";} ?>



                  



                  <!-- <div class="profile_box"> <a href="resources-view.php?user_id=1234"><img src="/RM/images/black-img.jpg" /></a>



                    <p class="profile_title"><a href="resources-view.php?user_id=1234">David Masciana</a><span class="desig"><br />



				  IT Business Analyst</span></p>



                    <p class="profile_desc">Cisco IP knowledge is preferred to Cisco CCNA/Juniper JNCIA and similar level 		



                    ....</p>



                <div class="clear-fix">&nbsp;</div>



          </div> -->



          



          <p><a href="resources-list.php">View all >></a></p>



   	  </aside>



    



    	 



    



     	<div class="clear-fix">&nbsp;</div> 



        



  </article>



    



     	<div class="clear-fix">&nbsp;</div>


   <!-- Footer Goes here -->

     <?php  require_once('../includes/footer.php'); ?>
    




    



</div>



</body>



</html>



<?php



mysql_free_result($getTimeSheet);



mysql_free_result($getRes);



mysql_free_result($getRes1);



?>