<div class="container">
    <div class="row">
        <div class="col-md-2">
            <div class="panel panel-default">

                <!--Left panel heading-->
                <div class="panel-heading">
                    <h3 class="panel-title">My Listings</h3>
                </div>

                <!--Left panel body-->
                <div class="panel-body">
                    <ul class="nav nav-pills nav-stacked">
                        <li class="active"><a>
                                <span class="badge pull-right"><?php echo $total; ?></span>
                                Engines</a></li>
                        <li><a>
                                <span class="badge pull-right"><?php echo $ptotal; ?></span>
                                Parts</a></li>
                    </ul>
                </div>
            </div>
        </div>

        <!--Mid panel heading-->
        <div class="col-md-6">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h2 class="form-signin-heading">Edit Engine Information</h2>

                </div>

                <?php
                $attributes = array(
                    'class' => 'form-horizontal',
                );
                ?>

                <?php echo validation_errors('<p class="alert alert-dismissable alert-danger">'); ?>

                <?php // if($this->session->flashdata('engine_updated')) : ?>
<!--<p class="alert alert-dismissable alert-success"><?php // echo $this->session->flashdata('engine_updated');  ?></p>-->
                <?php // endif; ?>

            <?php echo form_open_multipart('epc_listings/listings/edit_listing/' . $this_listing->list_id . '', $attributes); ?>

                <!--Mid panel body-->        
                <div class="panel-body">

                    <span class="msgF pull-right">* required field.</span>

                    <div class="form-group">           
                        <label for="manufacturer" class="col-sm-3 control-label">Manufacturer:</label>
                        <div class="col-sm-5">

                            <select name="company_dropdown" class="form-control">
                                <option value="--Select Manufacturer--" <?php echo ($this_listing->manufacturer == "--Select Manufacturer--") ? 'selected' : ''; ?>>--Select Manufacturer--</option>
                                <option value="CFM International" <?php echo ($this_listing->manufacturer == "CFM International") ? 'selected' : ''; ?>>CFM International</option>
                                <option value="Engine Alliance" <?php echo ($this_listing->manufacturer == "Engine Alliance") ? 'selected' : ''; ?>>Engine Alliance</option>
                                <option value="GE Aviation" <?php echo ($this_listing->manufacturer == "GE Aviation") ? 'selected' : ''; ?>>GE Aviation</option>
                                <option value="Honeywell Aerospace" <?php echo ($this_listing->manufacturer == "Honeywell Aerospace") ? 'selected' : ''; ?>>Honeywell Aerospace</option>
                                <option value="International Aero Engines" <?php echo ($this_listing->manufacturer == "International Aero Engines") ? 'selected' : ''; ?>>International Aero Engines</option>
                                <option value="Pratt & Whitney" <?php echo ($this_listing->manufacturer == "Pratt & Whitney") ? 'selected' : ''; ?>>Pratt & Whitney</option>
                                <option value="Rolls Royce" <?php echo ($this_listing->manufacturer == "Rolls Royce") ? 'selected' : ''; ?>>Rolls Royce</option>
                                <option value="Williams International" <?php echo ($this_listing->manufacturer == "Williams International") ? 'selected' : ''; ?>>Williams International</option>

                            </select>
                        </div>
                        <div class="col-xs-1">
                            <span class="error2">*</span>
                        </div>
                    </div>

                    <div class="form-group">           
                        <label for="engine_model" class="col-sm-3 control-label">Engine Model:</label>
                        <div class="col-sm-5">
                            <input type="text" class="form-control" name="engine_model" autocomplete="off" value="<?php echo $this_listing->engine_model; ?>">
                        </div>
                        <div class="col-xs-1">
                            <span class="error2">*</span>
                        </div>
                    </div>

                    <div class="form-group">           
                        <label for="esn" class="col-sm-3 control-label">ESN:</label>
                        <div class="col-sm-5">
                            <input type="text" class="form-control" name="esn" autocomplete="off" value="<?php echo $this_listing->esn; ?>">
                        </div>
                        <div class="col-xs-1">
                            <span class="error2">*</span>
                        </div>
                    </div>

                    <div class="form-group">           
                        <label for="tsn" class="col-sm-3 control-label">TSN:</label>
                        <div class="col-sm-5">
                            <input type="text" class="form-control" name="tsn" autocomplete="off" value="<?php echo $this_listing->tsn; ?>">
                        </div>
                    </div>
                    <div class="form-group">           
                        <label for="csn" class="col-sm-3 control-label">CSN:</label>
                        <div class="col-sm-5">
                            <input type="text" class="form-control" name="csn" autocomplete="off" value="<?php echo $this_listing->csn; ?>">
                        </div>
                    </div>
                    <div class="form-group">           
                        <label for="tso" class="col-sm-3 control-label">TSO:</label>
                        <div class="col-sm-5">
                            <input type="text" class="form-control" name="tso" autocomplete="off" value="<?php echo $this_listing->tso; ?>">
                        </div>
                    </div>
                    <div class="form-group">           
                        <label for="cso" class="col-sm-3 control-label">CSO:</label>
                        <div class="col-sm-5">
                            <input type="text" class="form-control" name="cso" autocomplete="off" value="<?php echo $this_listing->cso; ?>">
                        </div>
                    </div>
                    <div class="form-group">           
                        <label for="first_limiter" class="col-sm-3 control-label">First Limiter:</label>
                        <div class="col-sm-5">
                            <input type="text" class="form-control" name="first_limiter" autocomplete="off" value="<?php echo $this_listing->first_limiter; ?>">
                        </div>
                    </div>
                    <div class="form-group">           
                        <label for="limiting_module" class="col-sm-3 control-label">Limiting Module:</label>
                        <div class="col-sm-5">
                            <input type="text" class="form-control" name="limiting_module" autocomplete="off" value="<?php echo $this_listing->limiting_module; ?>">
                        </div>
                    </div>
                    <div class="form-group">           
                        <label for="last_operator" class="col-sm-3 control-label">Last Operator:</label>
                        <div class="col-sm-5">
                            <input type="text" class="form-control" name="last_operator" autocomplete="off" value="<?php echo $this_listing->last_operator; ?>">
                        </div>
                    </div>
                    <div class="form-group">           
                        <label for="location" class="col-sm-3 control-label">Location:</label>
                        <div class="col-sm-5">
                            <input type="text" class="form-control" name="location" autocomplete="off" value="<?php echo $this_listing->location; ?>">
                        </div>
                    </div>         
                    <div class="form-group">
                        <label for="lister" class="radio-inline col-sm-3 control-label"><strong>Lister:</strong></label>
                        <div class="col-sm-5">
                            <label class="radio-inline">
                                <input id="inlineradio1" name="inlineradio" type="radio" value="Buyer" <?php echo ($this_listing->lister == "Buyer") ? "checked" : ""; ?>>
                                Buyer</label>
                            <label class="radio-inline">
                                <input id="inlineradio2" name="inlineradio" type="radio" value="Seller" <?php echo ($this_listing->lister == "Seller") ? "checked" : ""; ?>>
                                Seller</label>
                        </div>
                        <div class="col-xs-1">
                            <span class="error2">*</span>
                        </div>
                    </div> 

                    <div class="form-group">
                        <label for="transaction" class="checkbox-inline col-sm-3 control-label"><strong>Transaction:</strong></label>
                        <div class="col-sm-5">
                            <label class="checkbox-inline">
                                <input type="checkbox" id="inlineCheckbox1" name="inlinecheck[]" class="childC" value="Sale" <?php echo ($this_listing->transaction == "Sale/Lease") || ($this_listing->transaction == "Sale") || ($this_listing->transaction == "Sale/Lease/Exchange") || ($this_listing->transaction == "Sale/Exchange") ? "checked" : "";
?>>Sale
                            </label>
                            <label class="checkbox-inline">
                                <input type="checkbox" id="inlineCheckbox2" name="inlinecheck[]" class="childC" value="Lease" <?php echo ($this_listing->transaction == "Sale/Lease") || ($this_listing->transaction == "Lease") || ($this_listing->transaction == "Sale/Lease/Exchange") || ($this_listing->transaction == "Lease/Exchange") ? "checked" : "";
?>>Lease
                            </label>
                            <label class="checkbox-inline">
                                <input type="checkbox" id="inlineCheckbox3" name="inlinecheck[]" class="childC" value="Exchange" <?php echo ($this_listing->transaction == "Sale/Exchange") || ($this_listing->transaction == "Sale/Lease/Exchange") || ($this_listing->transaction == "Lease/Exchange") || ($this_listing->transaction == "Exchange") ? "checked" : "";
?>>Exchange
                            </label>
                        </div>
                        <div class="col-xs-1">
                            <span class="error2">*</span>
                        </div>
                    </div>

                    <div class="form-group">           
                        <label for="asking_price" class="col-sm-3 control-label">Asking Price:</label>
                        <div class="col-sm-5">
                            <input type="text" class="form-control" name="asking_price" autocomplete="off" value="<?php echo $this_listing->asking_price; ?>">
                        </div>
                    </div>

                    <div class="form-group">           
                        <label for="monthly_rent" class="col-sm-3 control-label">Monthly Rent:</label>
                        <div class="col-sm-5">
                            <input type="text" class="form-control" name="monthly_rent" autocomplete="off" value="<?php echo $this_listing->monthly_rent; ?>">
                        </div>
                    </div>


                    <div class="form-group">           
                        <label for="available_date" class="col-sm-3 control-label">Available Date:</label>
                        <div class="col-sm-5">
                            <input type="text" class="form-control datepicker" name="available_date" data-date-format="mm-dd-yyyy" autocomplete="off" value="<?php echo $this_listing->available_date; ?>" placeholder="DD-MM-YYYY">
                        </div>
                        <div class="col-xs-1">
                            <span class="error2">*</span>
                        </div>
                    </div>
                    <div class="form-group">           
                        <label for="mini_pack" class="col-sm-3 control-label">Mini Pack:</label>
                        <div class="col-sm-5">
                            <input type="file" class="form-control" id="uf" name="userfile" size="20" onchange="if (document.getElementById('uf').value !== '') document.getElementById('inlineCheckbox4').disabled=true;">
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <label for="transaction" class="checkbox-inline col-sm-3 control-label"><strong>Delete Minipack:</strong></label>
                        <div class="col-sm-5">
                            <label class="checkbox-inline">
                                <input type="checkbox" id="inlineCheckbox4" name="inlinecheck1" class="childC" value="1" onclick="if (this.checked) document.getElementById('uf').disabled=true; else document.getElementById('uf').disabled = false;">
                            </label>
                           
                        </div>
                    </div>


                    <div class="form-group">
                        <div class="col-sm-offset-3 col-sm-10">
                            <button type="submit" class="btn btn-primary btn-xs">Edit 
                                <i class="glyphicon glyphicon-check"></i></button>
                            <a href="javascript:window.history.go(-1);">


                                <button type="button" class="btn btn-default btn-xs">Close</button></a>
                        </div>
                    </div>


                </div>
<?php echo form_close(); ?>



            </div>
        </div>

    </div>
</div>