
<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; 
				?>
				
				<script type="text/javascript">
					$(document).ready(function(){
						$("a.usunklient").click(function(){
							var answer = confirm ("Czy na pewno usunąć?")
							if(answer) return true; else return false;
						});
						$("a.blokujklient").click(function(){
							var answer = confirm ("Czy na pewno zablokować/odblokować?")
							if(answer) return true; else return false;
						});
						
					});
				</script>
                <br>
				<p><?php echo $this->pagination->create_links(); ?></p><a href="<?php echo base_url(); ?>administrator/klienci/nowy" id="add_client"></a><br/>
				<form id="mainform" action="">
				<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
				<tr>
					<th class="table-header-repeat line-left "><!--<a id="toggle-all" ></a>--><a href="<?php echo base_url(); ?>administrator">ID</a></th>
					<th class="table-header-repeat line-left minwidth-1"><a href="">Login</a>	</th>
                    <th class="table-header-repeat line-left"><a href="">Domena</a></th>
					<th class="table-header-repeat line-left minwidth-1"><a href="">E-mail</a></th>
					<th class="table-header-repeat line-left"><a href="">Data dodania</a></th>
					<?php ?><th class="table-header-repeat line-left"><a href="">Aktualizacja</a></th><?php ?>
					<th class="table-header-repeat line-left"><a href="">Blokada</a></th>
					<th class="table-header-repeat line-left"><a href="">Blokada stron</a></th>
					<th class="table-header-repeat line-left"><a href="<?php echo base_url(); ?>administrator/index/<?=((int)$this->uri->segment(3)==0 || (int)$this->uri->segment(3)==-1)?1:-1?>">Czas</a></th>
					<th class="table-header-repeat line-left"><a href="">Hasło</a></th>
					<th class="table-header-options line-left"><a href="">Operacje</a></th>
				</tr>
				<?php $lp=0; if($users && $users->num_rows()>0) foreach($users->result() as $user) { 
					if((++$lp%2) == 0) $alt_row = 'alternate-row'; else $alt_row = '';
					if($user->czas < 14) $alt_row = 'termin-alert'; //else $czas_row = '';
				?>
				<tr>
					<td><!--<input  type="checkbox"/>--><?php echo $user->ID_users;?></td>
					<td><?php echo $user->user_login; ?></td>
                    <td><a href=""><?php echo $user->user_pagename; ?></a></td>
					<td><?php echo $user->user_mail; ?></td>
					<td><?php echo substr($user->user_added, 0, 10); ?></td>
					<?php ?><td><?php echo substr($user->user_updated, 0, 10); ?></td><?php ?>
					<td>
					<?php if($user->user_blocked == 1){ ?>
					<a href="<?php echo base_url(); ?>administrator/klient_blokuj/<?php echo $user->ID_users; ?>/<?php echo $user->user_blocked; ?>" style="color:#F00;">&laquo; odblokuj</a>
					<?php }else{ ?>
                    <a href="<?php echo base_url(); ?>administrator/klient_blokuj/<?php echo $user->ID_users; ?>/<?php echo $user->user_blocked; ?>">zablokuj &raquo;</a>
                    <?php } ?>
                     
                     </td>
                    <td>
                    <?php if($user->user_block_adding_pages == 1){ ?>
					<a href="<?php echo base_url(); ?>administrator/klient_blokuj_strony/<?php echo $user->ID_users; ?>/<?php echo $user->user_block_adding_pages; ?>" style="color:#F00;">&laquo; odblokuj</a>
					<?php }else{ ?>
                    <a href="<?php echo base_url(); ?>administrator/klient_blokuj_strony/<?php echo $user->ID_users; ?>/<?php echo $user->user_block_adding_pages; ?>">zablokuj &raquo;</a>
                    <?php } ?>
                    </td>
					<td class="<?php echo $alt_row; ?> <?php /*echo $czas_row; */?>"><?php echo $user->czas; ?> dni</td>
					<td><?php echo $user->user_pass_sent==1?'wysłane':'nie wysłane'?></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>
					<?php /*?>
					<a href="<?php echo base_url(); ?>administrator/klient_usun/<?php echo $user->ID_users; ?>" title="Usuń" class="icon-2 info-tooltip usunklient"></a>
					*/?>
					<a href="<?php echo base_url(); ?>administrator/klient_wybierz_skrypty/<?php echo $user->ID_users; ?>" title="Wybierz skypty js" class="icon-4 info-tooltip"></a>
					<a href="<?php echo base_url(); ?>administrator/dodaj_link/<?php echo $user->ID_users; ?>" title="Dodaj link" class="icon-5 info-tooltip"></a>
					<a href="<?php echo base_url(); ?>administrator/wyslij_haslo/<?php echo $user->ID_users; ?>" title="Wyślij hasło" class="send_pass info-tooltip"></a>
					<a href="<?php echo base_url(); ?>administrator/zaloguj_jako/<?php echo $user->ID_users; ?>" title="Przejdź do panelu klienta" class="go_to_site info-tooltip"></a>
					</td>
				</tr>
				
				<?php } ?>
				
				</table>
				<!--  end product-table................................... --> 
				</form>
				<p><?php echo $this->pagination->create_links(); ?></p><br/>
				</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 /*?><?php echo base_url(); ?><?php */?>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 -->