<!-- Main content -->
<section class="content">
    <div class="row">
        <div class="col-sm-12">
            <div class="tabbable">
                <div class="tab-content no-border padding-24">
                    <div class="tab-pane fade in active" id="faq-tab-1">
                        <div class="space-8"></div>
                        <div class="panel-group accordion-style1 accordion-style2" id="faq-list-1">
                            <div class="panel panel-default">
                                <div class="panel-headingnew">Vehicle Details</div>
                                <div class="left_panel col-sm-12 padding_margin0 pull-left bg-white" id="add_detail">
                                    <ul class="nav nav-tabs nav-tabs1 tab_ul col-sm-2 paddig-right0 margin-top15px">
                                        <?php echo $this->partial('menu.phtml'); ?>
                                    </ul>

                                    <div class="tab-content tab_editprofile col-sm-10 padding-left0 marginbott10px margintop10px">
                                        <div id="home" class="tab-pane fade in tab_editprofile tab_editprofile1 active">
                                            <div class="change_password tab_editprofile">

                                                <div class="tab-content" id="myTabContent">
                                                    <div id="home" class="tab-pane fade active in">
                                                        <div class="col-sm-col-sm-offset-1 margin-10auto0 paddingRL10px">

                                                            <?php
                                                            $form = $this->form;
                                                            $form->prepare();
                                                            $form->setAttribute('action', $this->url('usermanagement', ['action' => 'vehicle-detail']));
                                                            $form->setAttribute('enctype', 'multipart/form-data');
                                                            echo $this->form()->openTag($form);
                                                            echo $this->formHidden($form->get('user_id'));

                                                            ?>
                                                            <?php if(!empty($msg_class)){?><span class="checkbox_error"><div class="alert alert-<?php echo $msg_class;?> no-border"><button type="button" class="close" data-dismiss="alert"><i class="icon-close2" ></i><span class="sr-only">Close</span></button><span class="text-semibold"><?php echo $msg;?></span></div></span><?php }?>
                                                            <div class="row">
                                                                <div class="col-sm-10">
                                                                    <div class="form-group clearfix margintopbottom20">
                                                                        <label class="col-sm-3 control-label labelalign col-sm-3-new" id="Categorie Name"><?php echo $this->translate($this->formLabel($form->get('vehicle_type'))); ?></label>
                                                                        <div class="col-sm-3 col-sm-4-new">
                                                                            <?php if(isset($vehicleData['vehicle_type_name'])){ echo $vehicleData['vehicle_type_name'];} ?>
                                                                        </div>
                                                                        <label class="col-sm-3 control-label labelalign col-sm-3-new" id="point_airport"><?php echo $this->translate($this->formLabel($form->get('vehicle_name'))); ?></label>
                                                                        <div class="col-sm-3 col-sm-4-new">
                                                                            <?php if(isset($vehicleData['model'])){echo $vehicleData['model'];}; ?>
                                                                        </div>
                                                                    </div>

                                                                    <div class="form-group clearfix margintopbottom20">
                                                                        <label class="col-sm-3 control-label labelalign col-sm-3-new" id="point_airport"><?php echo $this->translate($this->formLabel($form->get('ignition_type'))); ?></label>
                                                                        <div class="col-sm-3 col-sm-4-new">
                                                                            <?php if(isset($vehicleData['ignition_type_name'])){echo $vehicleData['ignition_type_name'];} ?>
                                                                        </div>

                                                                        <label class="col-sm-3 control-label labelalign col-sm-3-new" id="point_airport"><?php echo $this->translate($this->formLabel($form->get('vehicle_color'))); ?></label>
                                                                        <div class="col-sm-4 col-sm-4-new">

                                                                            <?php if(isset($vehicleData['colour_name'])){echo $vehicleData['colour_name'];} ?>
                                                                        </div>

                                                                    </div>

                                                                    <div class="form-group clearfix margintopbottom20">
                                                                        <label class="col-sm-3 control-label labelalign col-sm-3-new" id="point_airport"><?php echo $this->translate('Vehicle Owner'); ?></label>
                                                                        <div class="col-sm-3 col-sm-4-new">
                                                                            <?php if(isset($vehicleData['vehicle_owner_type'])){echo $vehicleData['vehicle_owner_type'];} ?>
                                                                        </div>


                                                                    </div>


<?php if(isset($vehicleData['vehicle_owner_type']) && $vehicleData['vehicle_owner_type']=='Attached') { ?>
                                                                    <div class="form-group clearfix margintopbottom20 " id="owner-attached-cab">
                                                                        <label class="col-sm-3 control-label labelalign col-sm-3-new" id="owner-name"><?php echo $this->translate($this->formLabel($form->get('owner_name'))); ?></label>
                                                                        <div class="col-sm-3 col-sm-4-new">
                                                                            <?php if(isset($vehicleData['vehicle_owner_name'])){ echo $vehicleData['vehicle_owner_name']; }?>
                                                                        </div>

                                                                        <label class="col-sm-3 control-label labelalign col-sm-3-new" id="mobile-number"><?php echo $this->translate($this->formLabel($form->get('mobile_number'))); ?></label>
                                                                        <div class="col-sm-4 col-sm-4-new">
                                                                            <?php if(isset($vehicleData['vehicle_owner_mobile'])){echo $vehicleData['vehicle_owner_mobile'];} ?>
                                                                        </div>
                                                                    </div>
<?php } ?>

                                                                    <div class="form-group clearfix margintopbottom20">
                                                                        <label class="col-sm-3 control-label labelalign col-sm-3-new" id="point_airport"><?php echo $this->translate($this->formLabel($form->get('permit_expiry_date'))); ?></label>
                                                                        <div class="col-sm-3 col-sm-4-new">
                                                                            <?php if(isset($vehicleData['permit_exp_date'])){echo date('d-m-Y', strtotime($vehicleData['permit_exp_date']));}?>
                                                                        </div>

                                                                        <label class="col-sm-3 control-label labelalign col-sm-3-new" id="point_airport"><?php echo $this->translate($this->formLabel($form->get('model_year'))); ?></label>
                                                                        <div class="col-sm-4 col-sm-4-new">
                                                                            <?php if(isset($vehicleData['model'])){echo $vehicleData['model'];} ?>
                                                                        </div>
                                                                    </div>

                                                                    <div class="form-group clearfix margintopbottom20">
                                                                        <label class="col-sm-3 control-label labelalign col-sm-3-new" id=""><?php echo $this->translate($this->formLabel($form->get('vehicle_number'))); ?></label>
                                                                        <div class="col-sm-3 col-sm-4-new">
                                                                            <?php if(isset($vehicleData['vehicle_no'])){echo $vehicleData['vehicle_no'];} ?>
                                                                        </div>

                                                                        <label class="col-sm-3 control-label labelalign col-sm-3-new" id="point_airport"><?php echo $this->translate($this->formLabel($form->get('insurance_validity'))); ?></label>
                                                                        <div class="col-sm-3 col-sm-4-new">
                                                                            <?php if(isset($vehicleData['insurance_validity'])){echo date('Y-m-d', strtotime($vehicleData['insurance_validity']));}?>
                                                                        </div>
                                                                    </div>

                                                                   

                                                                    <h4>Feature Information</h4>
                                                                    <div class="form-group clearfix margintopbottom20">
                                                                        <label class="col-sm-2 control-label labelalign"><?php echo $this->translate($this->formLabel($form->get('passengers'))); ?></label>
                                                                        <div class="col-sm-2">
                                                                            <?php if(isset($vehicleData['passenger'])){echo $vehicleData['passenger'];} ?>
                                                                        </div>

                                                                        <label class="col-sm-2 control-label labelalign "><?php echo $this->translate($this->formLabel($form->get('large_suitcase'))); ?></label>
                                                                        <div class="col-sm-2">
                                                                            <?php if(isset($vehicleData['large_suitcase'])){echo $vehicleData['large_suitcase'];} ?>
                                                                        </div>

                                                                        <label class="col-sm-2 control-label labelalign "><?php echo $this->translate($this->formLabel($form->get('small_suitcase'))); ?></label>
                                                                        <div class="col-sm-2">
                                                                            <?php if(isset($vehicleData['small_suitcase'])){echo $vehicleData['small_suitcase'];} ?>
                                                                        </div>

                                                                    </div>

                                                                    <div class="form-group clearfix margintopbottom20">
                                                                        <label class="col-sm-2 control-label labelalign" id=""><?php echo $this->translate('Amenities'); ?>  </label>
                                                                        <div class="col-sm-10 no-padding">
                                                                            <div class="col-sm-8" >
                                                                                <?php if(isset($vehicleData['vehicle_amenities'])){echo $vehicleData['vehicle_amenities'];} ?>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>

                                                                <div class="right_panel col-sm-2 padding_margin0 pull-right">
                                                                    <div id="">
                                                                        <div id="crop-vehicle" class="margin-top60px">
                                                                            <!-- Current avatar -->
                                                                            <div class="avatar-view userimg_byratio" title="Upload Vehicle Picture" style="cursor:pointer" data-toggle="modal" data-target="#myModaluploadcar">
                                                                                <img src="../../images/a4.jpg" alt="Avatar" class="crop-image" id="profile_pic_update">
                                                                            </div>

                                                                            <div class="avatar-view userimg_byratio pointer no-border text-center" data-toggle="modal" data-target="#myModaluploadcar">Upload Vehicle Pic</div>
                                                                            <!-- Cropping modal -->
                                                                            <div class="modal fade" id="myModaluploadcar" tabindex="-1" role="dialog" aria-labelledby="avatar-modal-label" aria-hidden="true">
                                                                                <div class="modal-dialog modal-lg">
                                                                                    <div class="modal-content">
                                                                                        <!--<form action="upload.php" enctype="multipart/form-data" method="post" onsubmit="return checkCoords();">-->
                                                                                        <div class="modal-header">
                                                                                            <h4 class="modal-title" id="avatar-modal-label">Vehicle Picture</h4>
                                                                                        </div>
                                                                                        <div class="modal-body">
                                                                                            <p>Image: <input name="image" id="fileInput1" size="30" type="file" /></p>
                                                                                            <!--<input type="hidden" id="x" name="x" />
                                                                                            <input type="hidden" id="y" name="y" />
                                                                                            <input type="hidden" id="w" name="w" />
                                                                                            <input type="hidden" id="h" name="h" />-->

                                                                                            <p><img id="filePreview1" class="display-none"/></p>
                                                                                        </div>
                                                                                        <div class="modal-footer">
                                                                                            <input name="upload" type="submit" class="btn btn-primary pull-right" value="Upload" />
                                                                                            <button class="btn btn-default col-sm-2 pull-right" type="button" data-dismiss="modal">Close</button>

                                                                                        </div>
                                                                                        <!--</form>-->
                                                                                    </div>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>

                                                                <div class="col-sm-12 " align="right">
<!--                                                                    <a class="reset_btn btn btn-success reset_btn" href="#">
                                                                        <i class="fa fa-retweet"></i>
                                                                        Reset
                                                                    </a>-->
                                                                    <?php //echo $this->FormElement($form->get('add_new_vehicle')); ?>
                                                                </div>
                                                            </div>
                                                            <?php echo $this->form()->closeTag(); ?>
                                                        </div>
                                                    </div>
                                                    
                                                    <div class="col-sm-12 col-md-8 col-lg-12 clearfix userprofileimg">
                                                        <div id="crop-avatar">

                                                            <!-- Current avatar -->
                                                            <?php
                                                            if (count($vehicleData['vehicleimages']) > 0) {

                                                                for ($docid = 0; $docid < count($vehicleData['vehicleimages']); $docid++) {
                                                                    $image_name = isset($vehicleData['vehicleimages'][$docid]['doc_file_upload']) ? $vehicleData['vehicleimages'][$docid]['doc_file_upload'] : '';
                                                                    $image_title = isset($vehicleData['vehicleimages'][$docid]['document_name']) ? $vehicleData['vehicleimages'][$docid]['document_name'] : '';

                                                                    $filepath = getcwd() . "/public/upload/$id/" . $image_name;
                                                                    $imagepath = "/upload/$id/" . $image_name;
                                                                    if (file_exists($filepath)) {
                                                                        ?>
                                                                        <div class="avatar-view userimg_byratio preview_img" title="<?php echo $image_title; ?>">
                                                                            <img src="<?php echo $imagepath; ?>"
                                                                                 id="residential_proof" alt="<?php echo $image_title; ?>" style="height: 84px;width:150px;">
                                                                            <h6><center><b><a download href="<?php echo $imagepath; ?>"><?php echo $image_title; ?></a></b></center></h6><br/>
                                                                            <a download href="<?php echo $imagepath; ?>">Download</a>
                                                                        </div>

                                                                    <?php }
                                                                }
                                                            }
                                                            ?>

                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <br>
            <!-- /.widget-box -->
        </div>
        <!-- /.col -->
    </div>
</section>
<!-- /.row -->