Current File : /home/users/barii/public_html/finansenl.com.pl/wodki/application/views/admin/category.php
<script type="text/javascript">
	function remove(id) {
		jConfirm('Czy na pewno chcesz usunać ?', 'Potwierdzenie', function(r) {
		if( r == true ) {
			$.ajax({
					type:"GET",
					url:"/admin/category/delete/"+id,
					cache:false,
					success:function(rsponse)
					{
						
							jAlert('Kategoria została usunięta!', 'Podsumowanie', function() {
								location.href = '/admin/category';
							});
										
						
					}
					});
			}
		});
	}	

function remove2(id) {
		jConfirm('Czy na pewno chcesz usunać ?', 'Potwierdzenie', function(r) {
		if( r == true ) {
			$.ajax({
					type:"GET",
					url:"/admin/category/delete2/"+id,
					cache:false,
					success:function(rsponse)
					{
						
							jAlert('Kategoria została usunięta!', 'Podsumowanie', function() {
								location.href = '/admin/category';
							});
										
						
					}
					});
			}
		});
	}	
</script>
	<div id="page">
		
		<!--  start message-blue -->
			<?php if (isset($message_ok)):?>
			<div id="message-blue">
					<table border="0" width="100%" cellpadding="0" cellspacing="0">
						<tr>
							<td class="blue-left"><?php echo $message_ok; ?>  </td>
							<td class="blue-right"><a class="close-blue"><?php echo HTML::image('static/images/table/icon_close_blue.gif');?></a></td>
						</tr>
					</table>
				</div>
			<!--  end message-blue -->
			<?php endif;?>	
			<!--  start message-red -->
			<?php if (isset($message)):?>
			<div id="message-red">
				<table border="0" width="100%" cellpadding="0" cellspacing="0">
					<tr>
						<td class="red-left">
							<?php echo $message;?>
						</td>
						<td class="red-right"><a class="close-red"><?php echo HTML::image('static_back/images/table/icon_close_red.gif');?></a></td>
					</tr>
				</table>
			</div>
			<?php endif;?>
	
			<div id="content">

			
				<div class="main">
				
				<div class="full_w">
				<div class="h_title">Zarządzaj</div>
				<h2>Dyscypliny</h2>
				
				
				<div class="entry">
					<div class="sep"></div>
				</div>
				<table>
					<thead>
						<tr>
							
							<th scope="col">Tytuł</th>
					
							<th scope="col" style="width: 65px;">Zmień</th>
						</tr>
					</thead>
						
					<tbody>
					
					<?php $n=0; foreach( $articles as $article ) : $n++; ?>
					
				
					
						<tr>
							<td class="title" ><?php if( $article->parent ==0 ) echo 'Nadrzędna=>'; else echo ORM::Factory('discipline', $article->parent)->title."=>"; ?><?php echo $article->title; ?></a></td>
							<td>
						
								<a href="/admin/category/edit/<?php echo $article->id; ?>"><img src="./static/images/edit.png" alt=""/></a>
								<a href="/admin/category/delete/<?php echo $article->id; ?>" class="confirm_button"><img src="./static/images/medialni_402.jpg" alt=""/></a>
							
							</td>
						</tr>
						
					
					
					<?php endforeach; ?>
					
					</tbody>
					</table>
					</div>
					<br style="clear: both;"/><br style="clear: both;"/>
					<form method="post" action="" enctype="multipart/form-data">
					<fieldset class="register">
						<label>Nazwa dyscypliny </label> <input style="border: 1px solid #ddd; width: 650px; padding: 4px;" type="text" name="name_category_c"/>
						<label>Kategoria główna</label> <select style="border: 1px solid #ddd; width: 650px; padding: 4px;" type="text" name="parent_category_c">
						<option value="0">Kategoria Nadrzędna</option>
						<?php foreach( ORM::Factory('discipline')->where('parent','=', 0)->find_all() as $d ) : ?>
						<option value="<?php echo $d->id; ?>"><?php echo $d->title; ?></option>
						<?php endforeach; ?>
						</select>
						<input style="" type="checkbox" name="seen_by_coach" value="1" CHECKED />
						<label>Pokaż dla trenera </label> 
						<label>Ikona </label> <input type="file" name="attach">
						<br style="clear: both;"/>
						<input type="submit" class="button add" value="Dodaj"/>
					</fieldset>
					</form>
					
					<br style="clear: both;"/><br style="clear: both;"/>
					
						
					
				
				</div>
				
			

			</div>
			
		</div>