Location: PHPKode > projects > Opensheet > opensheet/classes/drawPage.class.php
<?php 
#ini_set('display_errors',1);
#error_reporting(E_ALL);
#echo HI;
class drawPage extends Base{
	#private $queue;
  	#	private $login;
  	#var  $id;
	#private $permission;
	
		function set_login($login){
		$this->login = $login;
		return $this;		
		}
	
		function set_id($id){
		$this->id = $id;
		return $this;		
		}
		
		function set_permission($permission){
		$this->permssion = $permission;
		return $this;		
		}
	
				public function __construct(){
		   		}

				public function __destruct(){
				unset($this->queue);
				}
	


 

 			function drawTSheader($login,$user_index,$year,$month,$permission) {

 				echo '<table class="ts_adm" cellpadding="0" cellspacing="0"><tr>';
 				if ($permission['admin'] == '1' ) {
 					?><td class="tsadmin_uswitch" scope="col"><a href="#" id="u_switch" ><img src="images/kuser.png"></a><?php
					$project = new drawPage;
					$project->drawUserSwitch($_SESSION['id'],$_SESSION['permissions']);
 					
 					?></td><?php
 				} else {
 					?><td class="tsadmin_uswitch" scope="col"></td><?php
 				}
 				?>
 				
			  		<td class="tsadmin_uswitch" scope="col"><form action="" method="POST" >
                     <input type="hidden" name="timestamp" value=" <?php echo mktime(01,01,01,$month-1,01,$year);  ?>">
                     <input type="hidden" name="user_index" value="<?php echo $user_index; ?>" />
                     <input class="month" type="submit" value="<?php echo gettext(date(F,mktime(01,01,01,$month-1,01,$year))); ?>" >
					 </form> 
         			 </td>
        			 <td class="tsadmin_uswitch" scope="col">
 					 <form action="" method="POST" >
                     <input type="hidden" name="timestamp" value=" <?php echo mktime(01,01,01,$month+1,01,$year);  ?>">
                      <input type="hidden" name="user_index" value="<?php echo $user_index; ?>" />
                     <input class="month" type="submit" value="<?php echo gettext(date(F,mktime(01,01,01,$month+1,01,$year))); ?>" >
					 </form>         
					</td>
 				 <td class="tsadmin_block"  scope="col"><a id="print" href="#print" ><img src="images/printer.png"></a>
           	    								  <a href="#" id="comment" ><img src="images/notes.png"></a>
           	    								  <?php 
           	    								  if ($permission['fd'] == '1') {
           	    								  ?>
           										  <a href="functions/export.xls.php?month=<?php echo $month; ?>&year=<?php echo $year; ?>" ><img src="images/xls.png"></a></td>
           										   <td class="tsadmin_summ" scope="col"><A HREF="reports.php?year=<?php echo $year; ?>&month=<?php echo $month; ?>"><?php echo gettext('reports'); ?></A></td>
           										     										  
 												 <?php } else { echo "</td><td class='tsadmin_summ' scope='col'></td>"; }
 				if ($permission['pm'] == '1') {
 					?>
 					<td class="tsadmin_summ" scope="col"><a href="pm_reports.php?user_index=<?php echo $user_index; ?>" ><?php echo gettext('my_projects');?></a></td>												
 				<?php
 				} else {
 				echo '<td class="tsadmin_summ" scope="col"></td>';
 				
 				}
 				if ($permission['dm'] == '1') {
 					?>
 					<td class="tsadmin_summ" scope="col"><a href="dm_reports.php?user_index=<?php echo $user_index; ?>" ><?php echo gettext('my_depatment');?></a></td>												
 				<?php
 				} else {
 				echo '<td class="tsadmin_summ" scope="col"></td>';
 				
 				}
 				if ($permission['admin'] == '1') {
 					?>
 								
 				 <td class="tsadmin_setup" scope="col"><A HREF="users_setup.php"><?php echo gettext('settings'); ?></A></td>
 				
 				<?php
 				
 				} else {
 				echo '<td class="tsadmin_summ" scope="col"></td>';
 				}
 				
 				
 				
 				
 			 ?> <td class="tsadmin_exit" scope="col"><A HREF="logout.php"><?php echo gettext('exit'); ?></A></td></tr></table><?php 
			}
			
			function drawUserSwitch($user_id,$permissions){
				$users= new Users;
				
				if ($permissions['admin'] == '1'){
					?>
				<div class="u_switch " style="opacity:.8;filter: alpha(opacity=80);width:300px;	min-height: 100%;position:absolute; z-index:250;display: none;background: #F1F7D4;">
				<ul style="text-align:left;"><?php 
				foreach ($users->getUsersArray('active') as $key=>$value){
					?>
				<li><a style="color: black;" href="timesheet.php?user_index=<?php echo $key; ?>">
				<?php echo $value['real_name']; ?>
				</a></li>

				<?php 
					}
					?>

				</ul>	
				<?php 				
					
				
					
					
					
					}else {
				
				}
			}
}	
?>
Return current item: Opensheet