<?php
	include ('includes/bootstrap.inc.php');

	if(empty(Data::getSession('uid'))){
		header('Location: login.php?op=e');
		die();
	}


	$op 	= Data::getGet ( 'op' );
	$msg 	= '';


	/**
	 * Creates a new template for the search form.
	 */

	$search_help = _('Start writing the animal name, tha name of the Pet\'s owner, the visit ID or the animal ID. You can also use a barcode reader. (Press on Ababu logo to return to main page.)');
	$inputSearchButton = BootstrapButton::create( 'search', _('Go') );
	$bso = new BootstrapInput('input-search', '', _('search'), true );
	$bso->helptext = $search_help;
	$bso->placeholder = _( "e.g. Boatswan, Byron, P123456789" );
	$inputSearchText = $bso->output();



	/**
	 * Loads and redefine layout template, settings its title and content.
	 */
	$template = _DEFAULT_THEME_PATH . _DEFAULT_THEME . "/search.tpl";
	$layout = new Template ( $template );

	$layout->set ( "search-logic", '<script type="text/javascript" src="assets/js/search.logic.js"></script>' );

	$layout->set ( "input-search", $inputSearchText );
	// $layout->set ( "input-search-help", $inputSearchHelp );
	$layout->set ( "input-search-button", $inputSearchButton );


	/*
	 * access denied
	 */
	if($op == 'e'){
		$msg = $oBS->message( _('Access denied. Wrong username or password') );
	}

	/**
	 * Outputs the page with the user's profile.
	 */
	$layout->set ( "application-name", _APPLICATION_NAME);
	$layout->set ( "message-box", $msg );
	$layout->set ( "search-help", $search_help );

	echo template_common_header();
	echo $layout->output ();
	echo template_common_footer();

?>



