
<div id="content">

	<!--  start page-heading -->
	<div id="page-heading">
		<!--       <h1>Add product</h1> -->
	</div>
	<!-- end page-heading -->
	<table>
	<tr>
	
	<td>
		<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
		<tr>
			<th rowspan="3" class="sized"><img src="<?php echo base_url(); ?>images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
			<th class="topleft"></th>
			<td id="tbl-border-top">&nbsp;</td>
			<th class="topright"></th>
			<th rowspan="3" class="sized"><img src="<?php echo base_url(); ?>images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
		</tr>
		<tr>
			<td id="tbl-border-left"></td>
			<td>
			<!--  start content-table-inner ...................................................................... START -->
			<div id="content-table-inner">
			
				<!--  start table-content  -->
				<div id="table-content">
				
				
				<?php if(  $this->messages->get_message('yellow', false)  /*get_cookie('yellow')/*$this->session->userdata('yellow')*/) { ?>
					<!--  start message-yellow -->
					<div id="message-yellow">
					<table border="0" width="100%" cellpadding="0" cellspacing="0">
					<tr>
						<td class="yellow-left"><!--You have a new message. <a href="">Go to Inbox.</a>--><?php echo $this->messages->get_message('yellow');
						//echo $this->session->userdata('yellow'); echo get_cookie('yellow');
						?></td>
						<td class="yellow-right"><a class="close-yellow"><img src="<?php echo base_url(); ?>images/table/icon_close_yellow.gif"   alt="" /></a></td>
					</tr>
					</table>
					</div>
					<!--  end message-yellow -->
				<?php } ?>	
					
				<?php if(  $this->messages->get_message('red', false)  /*get_cookie('red')/*$this->session->userdata('red')*/) { ?>
					<!--  start message-red -->
					<div id="message-red">
					<table border="0" width="100%" cellpadding="0" cellspacing="0">
					<tr>
						<td class="red-left"><!--Error. <a href="">Please try again.</a>--><?php echo $this->messages->get_message('red');
						//echo $this->session->userdata('red'); echo get_cookie('red')
						?></td>
						<td class="red-right"><a class="close-red"><img src="<?php echo base_url(); ?>images/table/icon_close_red.gif"   alt="" /></a></td>
					</tr>
					</table>
					</div>
					<!--  end message-red -->
				<?php } ?>	
				
				<?php if(  $this->messages->get_message('blue', false)  /*get_cookie('blue')/*$this->session->userdata('blue')*/) { ?>
					<!--  start message-blue -->
					<div id="message-blue">
					<table border="0" width="100%" cellpadding="0" cellspacing="0">
					<tr>
						<td class="blue-left"><!--Welcome back. <a href="">View my account.</a> --><?php echo $this->messages->get_message('blue');
						//echo $this->session->userdata('blue'); echo get_cookie('blue');
						?></td>
						<td class="blue-right"><a class="close-blue"><img src="<?php echo base_url(); ?>images/table/icon_close_blue.gif"   alt="" /></a></td>
					</tr>
					</table>
					</div>
					<!--  end message-blue -->
				<?php } ?>
				
				<?php if(  $this->messages->get_message('green', false)  /*get_cookie('green')/*$this->session->userdata('green')*/) { ?>
					<!--  start message-green -->
					<div id="message-green">
					<table border="0" width="100%" cellpadding="0" cellspacing="0">
					<tr>
						<td class="green-left"><!--Product added sucessfully. <a href="">Add new one.</a>--><?php echo $this->messages->get_message('green');
						//echo $this->session->userdata('green'); echo get_cookie('green');
						?></td>
						<td class="green-right"><a class="close-green"><img src="<?php echo base_url(); ?>images/table/icon_close_green.gif"   alt="" /></a></td>
					</tr>
					</table>
					</div>
					<!--  end message-green -->
				<?php } ?>
				
				
				<div >
				<?php //echo $mainTree; 
				?>
				<h3>Aktywność użytkowników</h3>
				
				<form action="<?php echo base_url(); ?>administrator/getaktywnosc" method="post">
				<table border="0" cellpadding="0" cellspacing="0"  id="id-form">
				
				<tr>
					<th valign="top">Użytkownik:</th>
					<td>	
					<select  class=" ___styledselect_form_1" name="user" >
						<option <?php if((int)$this->uri->segment(3) == 0) echo 'selected="selected"';?> value="0">Wszyscy</option>
						<?php foreach($users->result() as $user) { 
							echo '<option value="'.$user->ID_users.'" ';
							if((int)$this->uri->segment(3) == $user->ID_users) echo 'selected="selected"';
							echo ' >'.$user->user_login.'</option>';
						} ?>
					</select>
					</td>
					<td></td>
				</tr>
				<tr>
					<th valign="top">Operacje:</th>
					<td>	
					<select  class=" ___styledselect_form_1" name="type" >
						<option value="0" <?php if((int)$this->uri->segment(4) == 0) echo 'selected="selected"'; ?> >Logowanie</option>
						<option value="1" <?php if((int)$this->uri->segment(4) == 1) echo 'selected="selected"'; ?> >Akcje</option>
					</select>
					</td>
					<td></td>
				</tr>
				
				<tr>
					<th> </th>
					<td valign="top">
						<input type="submit" value="" class="form-submit" />
					</td>
					<td></td>
				</tr>
				</table>
				</form>
				<br/>
				<?php echo $this->pagination->create_links(); ?>
				<?php if($stats && $stats->num_rows()>0) { ?>
				<form id="mainform" action="">
				<h3>Logi z logowania</h3>
				<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
				<tr>
					<th class="table-header-check"> </th>
					<th class="table-header-repeat line-left minwidth-1"><a href="">Login</a>	</th>
					<th class="table-header-repeat line-left minwidth-1"><a href="">Adres IP</a></th>
					<th class="table-header-repeat line-left" style="width: 250px;"><a href="">Przeglądarka</a></th>
					<th class="table-header-repeat line-left"><a href="">Data logowania</a></th>
					<th class="table-header-repeat line-left"><a href="">Typ logowania</a></th>
					
					<th class="table-header-options line-left"><a href="">Skutek</a></th>
				</tr>
				<?php $lp=0; foreach($stats->result() as $stat) { 
					if((++$lp%2) == 0) $alt_row = ' class="alternate-row"'; else $alt_row = '';
				?>
				<tr <?php echo $alt_row; ?>>
					<td><?php echo $stat->stats_user_id; ?></td>
					<td> <!-- <a href="<?php echo base_url(); ?>administrator/aktywnosc_uzytkownikow/<?php echo $stat->stats_user_id; ?>">--><?php echo $stat->stats_login; ?><!--</a>--></td>
					<td><?php echo $stat->stats_ip; ?></td>
					<td><?php echo $stat->stats_user_agent; ?></td>
					<?php $czas = explode(" ", $stat->stats_time); ?>
					<td> <!-- <a href="<?php echo base_url(); ?>administrator/aktywnosc_uzytkownikow/dzien/<?php echo $czas[0]; ?>"> --> <?php echo $czas[0]; ?><!-- </a>--> <?php echo $czas[1]; ?></td>
					<td><?php echo $stat->stats_type; ?></td>
					<td><?php echo $stat->stats_result; ?></td>
					
					<!--<td class="options-width">
					<a href="<?php echo base_url(); ?>administrator/klienci/<?php echo $user->ID_users; ?>" title="Edytuj" class="icon-1 info-tooltip"></a>
					<a href="<?php echo base_url(); ?>administrator/klient_usun/<?php echo $user->ID_users; ?>" title="Usuń" class="icon-2 info-tooltip"></a>
					<a href="<?php echo base_url(); ?>administrator/klient_blokuj/<?php echo $user->ID_users; ?>/<?php echo $user->user_blocked; ?>" title="Zablokuj/Odblokuj" class="icon-3 info-tooltip"></a>
					<a href="" title="Edit" class="icon-4 info-tooltip"></a>
					<a href="" title="Edit" class="icon-5 info-tooltip"></a>
					</td>-->
				</tr>
				
				<?php } ?>
				
				</table>
				<!--  end product-table................................... --> 
				</form><br/><br/>
				<?php } ?>
				
				<?php if($log && $log->num_rows() > 0) { 
				$lp=0;
				?>
				<h3>Logi z aktywności</h3>
				<form id="mainform" action="">
				<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
				<tr>
					<th class="table-header-check"> </th>
					<th class="table-header-repeat line-left minwidth-1"><a href="">Login</a>	</th>
					<th class="table-header-repeat line-left minwidth-1"><a href="">Informacja</a></th>
										
					<th class="table-header-options line-left"><a href="">Data operacji</a></th>
				</tr>
				<?php foreach($log->result() as $l) { if((++$lp%2) == 0) $alt_row = ' class="alternate-row"'; else $alt_row = ''; ?>
				<tr <?php echo $alt_row; ?>>
					<td><?php echo $l->action_log_user_id; ?></td>
					<td><!--<a href="<?php echo base_url(); ?>administrator/aktywnosc_uzytkownikow/<?php echo $l->action_log_user_id; ?>">--><?php echo $l->action_log_login; ?><!--</a>--></td>
					<td><?php echo $l->action_log_info; ?></td>
					
					<?php $czas = explode(" ", $l->action_log_time); ?>
					<td><a href="<?php echo base_url(); ?>administrator/aktywnosc_uzytkownikow/<?php echo $l->action_log_user_id; ?>/<?php echo $czas[0]; ?>"><?php echo $czas[0]; ?></a> <?php echo $czas[1]; ?></td>
					
					
				
				</tr>
				
				<?php } ?>
				</table>
				<!--  end product-table................................... --> 
				</form>				
					
				<?php } ?>
				<?php echo $this->pagination->create_links(); ?>
				</div>
				
				
				</div>
				<!--  end table-content  -->
				<!--  start actions-box ............................................... -->
			
			<!--
			<div id="actions-box">
				<a href="" class="action-slider"></a>
				<div id="actions-box-slider">
					<a href="<?php echo base_url(); ?>administrator/klienci/nowy" class="action-add">Nowy</a>
					<a href="" class="action-edit">Edit</a>
					<a href="" class="action-delete">Delete</a>
				</div>
				<div class="clear"></div>
			</div>
			-->
			
			<!-- end actions-box........... -->
			
			<!--  start paging..................................................... -->
			
			<!-- 
			<table border="0" cellpadding="0" cellspacing="0" id="paging-table">
			<tr>
			<td>
				<a href="" class="page-far-left"></a>
				<a href="" class="page-left"></a>
				<div id="page-info">Page <strong>1</strong> / 15</div>
				<a href="" class="page-right"></a>
				<a href="" class="page-far-right"></a>
			</td>
			<td>
			<select  class="styledselect_pages">
				<option value="">Number of rows</option>
				<option value="">1</option>
				<option value="">2</option>
				<option value="">3</option>
			</select>
			</td>
			</tr>
			</table>
			-->
			
			<!--  end paging................ -->
			
			<div class="clear"></div>
				<div class="clear"></div>
			
			</div>
			<!--  end content-table-inner ............................................END  -->
			</td>
			<td id="tbl-border-right"></td>
		</tr>
		<tr>
			<th class="sized bottomleft"></th>
			<td id="tbl-border-bottom">&nbsp;</td>
			<th class="sized bottomright"></th>
		</tr>
		</table>
	</td>
	</tr>
	</table>
	<div class="clear">&nbsp;</div>

</div>
<!--  end content -->