 
<?php $__env->startSection('content'); ?>

	<div class="row">
    	<div class="col-lg-12">
    		<h1 class="page-header">Switches</h1>
    	</div>
    </div>
        <div class="row">
            <div class="col-lg-12">
                <?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="panel panel-default">
				<div class="panel-heading">
                    <?php echo e(ucfirst($action)); ?> Cisco Switch
                </div>
                <div class="panel-body">
                    <div class="col-lg-12">
	                    <form id="theForm" class="form-horizontal" role="form" method="POST" enctype="multipart/form-data" action="<?php echo e(url('admin/switches/'.$action)); ?>" 
	                    	onsubmit="return confirm('Adding and editing switches requires a manual update that can take a few minutes. Please do not close browser window or click back. Proceed?')">
							<input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
							
							<div class="form-group">
								<div class="col-sm-12 col-md-3 morePadding morePadding2" onclick="inputFocus('address')">
									<input type="text" class="form-control" id="address" name="address" value="<?php echo e(old('address') ? old('address') : (isset($switch) ? $switch->address : '')); ?>" title="Address">
									<span id="address-label" class="label-text">Address</span>	
								</div>
								<div class="col-sm-12 col-md-3 morePadding morePadding2" onclick="inputFocus('name')">
									<input type="text" class="form-control" id="name" name="name" value="<?php echo e(old('name') ? old('name') : (isset($switch) ? $switch->name : '')); ?>" title="Name">
									<span id="name-label" class="label-text">Name</span>	
								</div>
								<div class="col-sm-12 col-md-4 morePadding morePadding2" onclick="inputFocus('description')">
									<input type="text" class="form-control" id="description" name="description" value="<?php echo e(old('description') ? old('description') : (isset($switch) ? $switch->description : '')); ?>" title="Description">
									<span id="description-label" class="label-text">Description</span>	
								</div>
								<div class="col-sm-12 col-md-2 morePadding morePadding2" onclick="inputFocus('type')">
									<input type="text" class="form-control" id="type" name="type" value="<?php echo e(old('type') ? old('type') : (isset($switch) ? $switch->type : '')); ?>" title="Type">
									<span id="type-label" class="label-text">Type</span>	
								</div>
							</div>
							<div class="form-group">
								<div class="col-sm-12 col-md-12 morePadding">
									<button type="submit" class="btn btn-primary" style="float: right;">
										Save
									</button>
								</div>
							</div>
						</form>
					</div>		
				</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(); ?>