<?php if(isset($ticketStatus)): ?>
    <?php echo Form::model($ticketStatus, ['url' => "ticket-status/$ticketStatus->id", 'method' => 'put', 'class' => 'form-horizontal']); ?>

<?php else: ?>
    <?php echo Form::open(['url' => 'ticket-status', 'method' => 'post', 'class' => 'form-horizontal']); ?>

<?php endif; ?>

<div class="form-group <?php echo e($errors->has('name') ? 'has-error' : ''); ?>">
    <?php echo Form::label('name', 'Ticket Status', ['class' => 'required col-3 col-sm-3 control-label']); ?>

    <div class="col-xs-9 col-sm-9">
        <?php echo Form::text('name', null, ['class' => 'form-control', 'placeholder' => 'Enter Ticket Status', 'autocomplete' => 'off']); ?>

        <span class="text-danger">
		    <?php echo e($errors->first('name')); ?>

	    </span>
    </div>
</div>

<?php if(isset($ticketStatus)): ?>
<div class="form-group <?php echo e($errors->has('status') ? 'has-error' : ''); ?>">
    <?php echo Form::label('status', 'Status', ['class' => 'required col-3 col-sm-3 control-label']); ?>

    <div class="col-xs-9 col-sm-9">
        <?php echo Form::select('status', ['Active' => 'Active', 'Inactive' => 'Inactive'], null, ['class' => 'form-control', 'placeholder' => 'Select Status']); ?>

        <span class="text-danger">
		    <?php echo e($errors->first('status')); ?>

	    </span>
    </div>
</div>
<?php endif; ?>

<div class="box-footer">
	<!-- <button type="button" class="btn btn-default">Cancel</button> -->
	<a href="<?php echo e(url('/ticket-status')); ?>" class="btn btn-default">Cancel</a>
	<?php if(isset($ticketStatus)): ?>
	    <?php echo Form::button('Submit', ['class' => 'btn btn-success pull-right', 'data-toggle' => 'modal', 'data-target' => '#ticket_status_update']); ?>

	<?php else: ?>
	    <?php echo Form::button('Submit', ['class' => 'btn btn-primary pull-right', 'data-toggle' => 'modal', 'data-target' => '#ticket_status_create']); ?>

	<?php endif; ?>
	
</div>

<div class="modal modal-info fade" id="ticket_status_create">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
				<h4 class="modal-title">Confirmation Message</h4>
			</div>
			<div class="modal-body">
				<h3>Want to Create Ticket Status?</h3>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-outline pull-left" data-dismiss="modal">Close</button>
				<button type="submit" class="btn btn-outline">Create Ticket Status</button>
			</div>
		</div>
	</div>
</div>


<div class="modal modal-warning fade" id="ticket_status_update">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
				<h4 class="modal-title">Confirmation Message</h4>
			</div>
			<div class="modal-body">
				<h3>Want to Update Ticket Status?</h3>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-outline pull-left" data-dismiss="modal">Close</button>
				<button type="submit" class="btn btn-outline">Update Ticket Status</button>
			</div>
		</div>
	</div>
</div>

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