<?php $__env->startSection('content'); ?>
	<div class="row">
    	<div class="col-lg-12">
    		<h1 class="page-header">Channels</h1>
    	</div>
    </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                    
                    	<?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-heading">
                            Add Network
                        </div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-lg-12">
				                    <form id="theForm" class="form-horizontal" role="form" method="POST" action="<?php echo e(url('admin/networks/add')); ?>">
										<input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
										
										<div class="form-group">
											<label class="col-md-3 control-label">Name</label>
											<div class="col-md-7">
												<input type="text" class="form-control" name="name" value="<?php echo e(old('name')); ?>">	
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-3 control-label">Global</label>
											<div class="col-md-2">
												<input type="checkbox" class="form-control" name="global" value="1" <?php echo e((old('global') == 1)? 'checked' : ''); ?>>	
												
											</div>
											<label class="col-md-3 control-label" id="wtve-label">Watch TV Everywhere</label>
											<div class="col-md-2" id="wtve-container">
												<input type="checkbox" class="form-control" id="wtve" name="wtve" value="1" <?php echo e((old('wtve') == 1)? 'checked' : ''); ?> onchange="wtveClick();">
												<input type="hidden" id="hiddenWTVE" name="hiddenWTVE" value="<?php echo e(old('wtve')); ?>">	
											</div>
										</div>
										<div class="form-group" id="url-group" style="display: none;">
											<label class="col-md-3 control-label">URL</label>
											<div class="col-md-7">
												<input type="text" class="form-control" id="url" name="url" value="<?php echo e(old('url')); ?>">	
											</div>
										</div>
										<div class="form-group" id="logo-group" style="display: none;">
											<label class="col-md-3 control-label">Logo</label>
											<div class="col-md-7">
												<input type="text" class="form-control" id="logo" name="logo" value="<?php echo e(old('logo')); ?>">	
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-3 control-label">Description</label>
											<div class="col-md-7">
												<textarea rows="2" name="description" class="form-control"><?php echo e(old('description')); ?></textarea>
											</div>
										</div>

										<div class="form-group">
											<div class="col-md-8 col-md-offset-4">
												<button type="submit" class="btn btn-primary">
													Add Network
												</button>
											</div>
										</div>
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
<?php $__env->stopSection(); ?>

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

		if(document.getElementById('hiddenWTVE').value == 1)
		{
			
			wtveClick();
		}

		function wtveClick()
		{
			var wtveElement = document.getElementById('wtve');
			var urlContainer = document.getElementById('url-group');
			var logoContainer = document.getElementById('logo-group');
			var urlElement = document.getElementById('url');
			var logoElement = document.getElementById('logo');
			if(wtveElement.checked == true)
			{
				urlContainer.style.display = "";
				logoContainer.style.display = "";
			}
			else
			{
				urlContainer.style.display = "none";
				logoContainer.style.display = "none";
				urlElement.value = "";
				logoElement.value = "";
			}
		}
	</script>
<?php $__env->stopSection(); ?>
			

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