<?php $__env->startSection('styles'); ?>
	<link rel="stylesheet" type="text/css" href="<?php echo e(asset('admin/css/awesome-bootstrap-checkbox.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('/admin/css/bootstrap-timepicker.min.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('/admin/css/bootstrap-toggle.min.css')); ?>">
<?php $__env->stopSection(); ?>

<?php $__env->startSection('pagetitle'); ?>
	Classes <small>new entry</small>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('crumbs'); ?>
	<li><a href="<?php echo e(url('admin/pages')); ?>"><i class="fa fa-book"></i> Classes</a></li>
	<li class="active"><i class="fa fa-pencil"></i> New Class</li>
<?php $__env->stopSection(); ?>

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

    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title pull-left"><i class="fa fa-th fa-fw"></i> Create New Class</h3>
                    <p class="pull-right">
                    	<a href="<?php echo e(url('admin/classes')); ?>" class="btn btn-default btn-sm"><i class="fa fa-reply"></i> Cancel</a>
                    </p>
                    <div class="clearfix"></div>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <?php echo Form::model($class, ['url' => '/admin/classes/'. $class->id, 'method' => 'PATCH']); ?>

                			<div class="col-md-6">
                				
            					<div class="form-group">
            						<?php echo Form::label('title', 'Class Title', ['class' => 'control-label']); ?>

									<?php echo Form::text('title', null, ['class' => 'form-control', 'required']); ?>

            					</div>

                                <div class="form-group">
                                    <?php echo Form::label('tutor_id', 'Tutor', ['class' => 'control-label']); ?>

                                    <select name="tutor_id" class="form-control">
                                        <?php foreach($tutors as $t): ?>
                                            <option value="<?php echo e($t->id); ?>"><?php echo e($t->firstname); ?> <?php echo e($t->lastname); ?></option>
                                        <?php endforeach; ?>
                                    </select>
                                </div>
    								
                			</div>
                            <div class="col-md-6">
                                <label>Days</label>
                                <p>
                                    <em>Turn on days where this class will be available.</em>
                                </p>
                                <div class="col-md-12">
                                    <?php foreach($daylist as $d): ?>
                                        <input type="checkbox" data-toggle="toggle" <?php if(in_array($d, $classdays)): ?> checked <?php endif; ?> name="days[]" data-on="<?php echo e(ucfirst($d)); ?>" data-off="<?php echo e(ucfirst($d)); ?>" value="<?php echo e($d); ?>">
                                    <?php endforeach; ?>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                            <div class="col-md-6">
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label>Time Starts</label>
                                            <div class="input-group bootstrap-timepicker timepicker">
                                                <input type="text" class="form-control input-small timepicker1" name="starts" value="<?php echo e(date('h:i', strtotime($class->starts))); ?>">
                                                <span class="input-group-addon"><i class="glyphicon glyphicon-time"></i></span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label>Time Ends</label>
                                            <div class="input-group bootstrap-timepicker timepicker">
                                                <input type="text" class="form-control input-small timepicker1" name="ends" value="<?php echo e(date('h:i', strtotime($class->ends))); ?>">
                                                <span class="input-group-addon"><i class="glyphicon glyphicon-time"></i></span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="col-md-12">
                                <div class="form-group">
                                    <?php echo Form::label('description', 'Description', ['class' => 'control-label']); ?>

                                    <?php echo Form::textarea('description', null, ['class' => 'form-control', 'rows' => '12', 'id' => 'editor1']); ?>

                                </div>

                                <div class="form-group text-right">
                                    <?php echo Form::submit('Submit', ['class' => 'btn btn-primary btn-lg']); ?>

                                </div>
                            </div>
                        <?php echo Form::close(); ?>

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

<?php $__env->startSection('scripts'); ?>
    <script src="<?php echo e(asset('/admin/js/bootstrap-timepicker.min.js')); ?>"></script>
    <script src="<?php echo e(asset('/admin/js/bootstrap-toggle.min.js')); ?>"></script>
    <script type="text/javascript" src="<?php echo e(asset('/admin/js/ckeditor/ckeditor.js')); ?>"></script>
    <script>
        CKEDITOR.replace( 'editor1' );
        
        $('.timepicker1').timepicker();
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.masters.base', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>