

<?php $__env->startSection('content'); ?>
<div class="container">
    <section class="content">
        <div class="row">
        	<div class="col-md-12 col-sm-offset-0">
            	<div class="box box-success">
                	<div class="box-header with-border">
                    	<h3 class="box-title">Ticket </h3> 
                	</div>
                	<div class="box-body">

                		<div class="col-sm-12">
    						
    						<div class="card">
    							<div class="card-header">
    								<h3 class="text-center"><i class="fa fa-edit"></i> Update Form of <code><b>Ticket</b></code> </h3>
    							</div>
                                
    							<div class="card-body">
    						  		
                                    <?php echo Form::model($ticket, ['url' => "ticket/$ticket->id", 'method' => 'put', 'class' => 'form-horizontal']); ?>

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

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

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

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

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

                                                <div class="col-xs-9 col-sm-9">
                                                    <?php echo Form::textarea('remarks_update', null, ['class' => 'form-control', 'placeholder' => 'Enter Verbatim or Issue', 'autocomplete' => 'off', 'rows' => 3]); ?>

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

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

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

                                    </div>

                                    <div class="modal modal-warning fade" id="ticket_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?</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</button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

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

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



                	</div>
          		</div>



                <div class="panel panel-primary">
                            <div class="panel-heading text-center"><code>Ticket ID: <b><?php echo e($ticket->id); ?></b></code> <code>Customer Number: <b><?php echo e($ticket->phone_number); ?></b></code></div>
                                <div class="panel-body">
                            
                                    <h4><code>Ticket ID: <b><a href="<?php echo e(url('/ticket/' . $ticket->id)); ?>"><?php echo e($ticket->id); ?></a></b></code></h4> 
                                    <div class="table-responsive">          
                                        <table class="table">
                                            <tbody>
                                                <tr>
                                                    <td><b>Customer Number</b></td>
                                                    <td><?php echo e($ticket->phone_number); ?></td>
                                                    <td><b>Customer Name</b></td>
                                                    <td><?php echo e($ticket->customer_name); ?></td>
                                                </tr>
                                                <tr>
                                                    <td><b>Subject</b></td>
                                                    <td><?php echo e($ticket->subject); ?></td>
                                                    <td><b>Assigned Person</b></td>
                                                    <?php if(isset($ticket->assigned->name)): ?>
                                                        <td><?php echo e($ticket->assigned->name); ?></td>
                                                    <?php else: ?>
                                                        <td></td>
                                                    <?php endif; ?>
                                                </tr>
                                                <tr>
                                                    <td><b>Ticket Type</b></td>
                                                    <?php if(isset($ticket->ticketType->name)): ?>
                                                        <td><?php echo e($ticket->ticketType->name); ?></td>
                                                    <?php else: ?>
                                                        <td></td>
                                                    <?php endif; ?>
                                                    <td><b>Ticket Status</b></td>
                                                    <?php if(isset($ticket->ticketStatus->name)): ?>
                                                        <td><?php echo e($ticket->ticketStatus->name); ?></td>
                                                    <?php else: ?>
                                                        <td></td>
                                                    <?php endif; ?>
                                                </tr>
                                                <tr>
                                                    <td><b>Customer Name</b></td>
                                                    <td><?php echo e($ticket->customer_name); ?></td>
                                                    <td><b>Customer Address</b></td>
                                                    <td><?php echo e($ticket->customer_address); ?></td>
                                                </tr>
                                                <!-- <tr>
                                                    <td><b>District</b></td>
                                                    <?php if(isset($ticket->district->name)): ?>
                                                        <td><?php echo e($ticket->district->name); ?></td>
                                                    <?php else: ?>
                                                        <td></td>
                                                    <?php endif; ?>
                                                    <td><b>Division</b></td>
                                                    <?php if(isset($ticket->division->name)): ?>
                                                        <td><?php echo e($ticket->division->name); ?></td>
                                                    <?php else: ?>
                                                        <td></td>
                                                    <?php endif; ?>
                                                </tr> -->
                                                <tr>
                                                    <td><b>Product Detail</b></td>
                                                    <td><?php echo e($ticket->product_model); ?></td>
                                                    <td><b>Area Assigned</b></td>
                                                    <td><?php echo e($ticket->area_assigned); ?></td>
                                                </tr>
                                                <tr>
                                                    <td><b>Product Price</b></td>
                                                    <td><?php echo e($ticket->product_price); ?></td>
                                                    <td><b>Client & Discount</b></td>
                                                    <td><?php echo e($ticket->client_discount); ?></td>
                                                </tr>
                                                <tr>
                                                    <td><b>Created At</b></td>
                                                    <td><?php echo e($ticket->created_at); ?></td>
                                                    <td><b>Updated At</b></td>
                                                    <td><?php echo e($ticket->updated_at); ?></td>
                                                </tr>
                                                <tr>
                                                    <td><b>Created By</b></td>
                                                    <td><?php echo e($ticket->createdBy->name); ?></td>
                                                    <td><b>Updated By</b></td>
                                                    <?php if(isset($ticket->updatedBy->name)): ?>
                                                        <td><?php echo e($ticket->updatedBy->name); ?></td>
                                                    <?php else: ?>
                                                        <td></td>
                                                    <?php endif; ?>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </div>

                                   

                                    <h4><code>Ticket Details</code></h4> 
                                    <div class="table-responsive"> 
                                        <table id="" class="table table-bordered table-striped table-condensed">
                                            <thead>
                                                <tr>
                                                    <th>Ticket Status</th>
                                                    <th>Remarks</th>
                                                    <th>Created By</th>
                                                    <th>Created At</th>
                                                </tr>
                                            </thead>
                                            <tbody>

                                            <?php foreach($ticket->ticketDetails as $ticketDetail): ?>
                                            <tr>
                                                <?php if(isset($ticketDetail->ticketStatus->name)): ?>
                                                    <td><?php echo e($ticketDetail->ticketStatus->name); ?></td>
                                                <?php else: ?>
                                                    <td></td>
                                                <?php endif; ?>
                                                
                                                <td><?php echo e($ticketDetail->remarks); ?></td>

                                                <?php if(isset($ticketDetail->createdBy->name)): ?>
                                                    <td><?php echo e($ticketDetail->createdBy->name); ?></td>
                                                <?php else: ?>
                                                    <td></td>
                                                <?php endif; ?>
                                                <td><?php echo e($ticketDetail->created_at); ?></td>

                                            </tr>
                                            <?php endforeach; ?>
                                            </tbody>
                                        </table>
                                    </div>

                                    
                                </div>
                            </div>


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

<?php $__env->startSection('style'); ?>
    <!-- <link rel="stylesheet" href="<?php echo e(asset('assets/css/dataTables.bootstrap.min.css')); ?>"> -->
    <style type="text/css">
       
        .panel-heading {
            padding: 0px 15px;
        }
    </style>
<?php $__env->stopSection(); ?>

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