<?php $__env->startSection('content'); ?>
	<div class="row">
    	<div class="col-lg-12">
    		<h1 class="page-header">Budget</h1>
    	</div>
    </div>
    <div class="row">
    	<?php if(session('status')): ?>
			<div class="alert alert-success">
				<?php echo e(session('status')); ?>

			</div>
		<?php endif; ?>

		<?php if(count($errors) > 0): ?>
			<div class="alert alert-danger">
				<strong>Whoops!</strong> There were some problems with your input.<br><br>
				<ul>
					<?php foreach($errors->all() as $error): ?>
						<li><?php echo e($error); ?></li>
					<?php endforeach; ?>
				</ul>
			</div>
		<?php endif; ?>
        <div class="col-lg-6">
	        <div class="panel panel-default">
	        	
		        <div class="panel-heading">
	              Initiate Year
	            </div>
	            <!-- /.panel-heading -->
	            <div class="panel-body">
	            	<form id="theForm" class="form-horizontal" role="form" method="POST" action="<?php echo e(url('admin/budget/year')); ?>">
						<input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">

						<div class="form-group">
							<div class="col-sm-12 col-md-5 morePadding morePadding2" onclick="inputFocus('year')">
								<input type="text" class="form-control" id="year" name="year" value="<?php echo e(old('year')); ?>" title="Year">
								<span id="year-label" class="label-text">Year</span>	
							</div>
							<div class="col-sm-12 col-md-7 morePadding morePadding2">
								<button type="submit" class="btn btn-primary" style="float: right;">
									Save
								</button>
							</div>
						</div>

					</form>	
	            </div>
		    </div>
	    </div>
        <div class="col-lg-6">
	        <div class="panel panel-default">
		        <div class="panel-heading">
	              Process CSV
	            </div>
	            <!-- /.panel-heading -->
	            <div class="panel-body"> 
	            	<form id="theForm" class="form-horizontal" role="form" method="POST" action="<?php echo e(url('admin/budget/csv')); ?>" enctype="multipart/form-data">
						<input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">

						<div class="form-group">
							<div class="col-sm-12 col-md-4 morePadding morePadding2" onclick="inputFocus('year2')">
								<input type="text" class="form-control" id="year2" name="year" value="<?php echo e(old('year')); ?>" title="Year">
								<span id="year2-label" class="label-text">Year</span>	
							</div>
							<div class="col-sm-12 col-md-5 morePadding morePadding2" onclick="inputFocus('file')">
								<input type="file" class="form-control" id="file" name="file" value="<?php echo e(old('file')); ?>" title="File">
								<span id="file-label" class="hasValue">File</span>	
							</div>
							<div class="col-sm-12 col-md-3 morePadding morePadding2">
								<button type="submit" class="btn btn-primary" style="float: right;">
									Upload
								</button>
							</div>
						</div>

					</form>	
	            </div>
		    </div>
	    </div>
	</div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('extras'); ?>
	<style>
		input:focus+.label-text, input:not([value=""])+.label-text, select+.label-text
		    		{
		    font-weight: normal;
		    padding: 0;
		    padding-left: 20px;
		    -webkit-transform: translateY(-2rem) scale(.7);
		    transform: translateY(-2rem) scale(.7);
		}
		input+.label-text, select+.label-text, .hasValue{
		    font-size: 1.5rem;
		    font-weight: 400;
		    position: absolute;
		    top: 0;
		    left: 0;
		    display: block;

		    padding-left: 20px;
		    padding-top: 5px;
		    padding-bottom: 5px;
		    opacity: .8;
		    transition: all .3s ease-out,opacity 150ms ease .3s;
		    -webkit-transform: translateY(0) scale(1);
		    transform: translateY(0) scale(1);
		    -webkit-transform-origin: left top;
		    transform-origin: left top;
		}
		span {
		    font-size: 1rem;
		    font-weight: 600;
		    display: block;
		    padding-top: .25rem;
		    padding-bottom: .25rem;
		    margin-left: 1rem;
		    color: #317aba;
		}
		.hasValue
		{
		    font-weight: normal;
		    padding: 0;
		    padding-left: 20px;
		    -webkit-transform: translateY(-2rem) scale(.7);
		    transform: translateY(-2rem) scale(.7);
		}
		

		@media (max-width: 959px)
		{
			.morePadding {
			    margin-top: 1.5em;
			}
		}

		@media (min-width: 960px)
		{
			.morePadding {
			    margin-top: 1em;
			}
		}
		
	</style>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('bottom'); ?>
    <script>
		$('.form-control').each(function() {
		   var elem = $(this);

		   // Save current value of element
		   elem.data('oldVal', elem.val());

		   // Look for changes in the value
		   elem.bind("propertychange change click keyup input paste", function(event){
		      // If value has changed...
		      if (elem.data('oldVal') != elem.val()) {
		       // Updated stored value
		       elem.data('oldVal', elem.val());
		       var elem2 = $('#'+elem.attr('id')+"-label");
		       elem2.addClass('hasValue');
		       elem2.removeClass('label-text');
		       if(elem.val() == "")
		       {
			       
		    	   elem2.addClass('label-text');
			       elem2.removeClass('hasValue');
		       }
		     }
		   });
		 });

		function inputFocus(id)
		{
			document.getElementById(id).focus();
		}
	</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('residential.templates.uadmin', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>