HEX
Server: Apache
System: Linux v38079.2is.nl 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: democfellows (10015)
PHP: 8.1.34
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/creativefellows.nl/okaycolor.creativefellows.nl/views/admin/units.php
<?php
	

	/*
 	 * Header
	 */
	require_once __DIR__ . '/inc/header.inc.php';
	
	
	/*
 	 *  Sidebar
	 */
	require_once __DIR__ . '/inc/sidebar.inc.php';
	
	
	/*
 	 *  Content
	 */
	echo '<div class="cell auto content">';
	
		echo '<div class="grid-x">';
			echo '<div class="cell small-12">';
				
				echo '<h2>'. ucfirst($data["current"]) .'<a href="'. $router->pathFor("admin.section",["section" => $data["current"]]) .'" class="button primary align-right">Nieuw</a></h2>';
				
				echo '<div class="grid-x grid-padding-x block-white">';
					echo '<div class="cell ssmall-12 medium-3">';
						
						echo '<ul class="vertical menu">';
						foreach($data["items"] as $item)
						{								
							echo '<li><a href="'. $router->pathFor("admin.section.view",["section" => $data["current"], "id" => $item->getId() ]) .'" class="'. $current .'">'.  $item->getName() .'</a></li>';
					
						}
						echo '</ul>';
						
					
					echo '</div>';
					
					echo '<div class="cell small-12 medium-9">';
						
						/*
						 * view selected
						 */
						if($active_item !== null)
						{
							echo '<form class="default-form" action="'. $router->pathFor("admin.section.patch",["section" => $data["current"], "id" => $active_item->getId() ]) .'" method="post" enctype="multipart/form-data">';
							echo '<h3>'. $active_item->getName() .'</h3>';
						
							foreach($data["fields"] as $field)
							{	
								$value = $active_item->getValue( $field->getName() );
								$field->setValue( $value ); 
							
								echo $field->getInput();
							
							}
						
							echo '<input type="hidden" name="_METHOD" value="PATCH"/>';
							echo '<button type="submit" class="button hollow primary">Opslaan</button> <a href="'. $router->pathFor("admin.section.delete",["section" => $data["current"], "id" => $active_item->getId() ]) .'" class="button delete align-right"><i class="fal fa-trash-alt"></i> </a>';
						
							echo '</form>';
						}
						/*
						 * New item
						 */
						else
						{
							
							echo '<form class="default-form" action="'. $router->pathFor("admin.section.post",["section" => $data["current"]]) .'" method="post" enctype="multipart/form-data">';
								echo '<h3>Nieuw</h3>';
						
								foreach($data["fields"] as $field)
								{	
									echo $field->getInput();
								}
						
								echo '<button type="submit" class="button hollow primary">Toevoegen</button>';
							echo '</form>';
							
						}
						
						
					echo '</div>';
				echo '</div>';
				

				
				
			echo '</div>';
		echo '</div>';
	
	echo '</div>';
	// End of content
	

	
	
	/*
 	 * Footer
	 */
	require_once __DIR__ . '/inc/footer.inc.php';

	
?>