<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><a>
                                <span class="badge pull-right"><?php echo $total; ?></span>
                                Engines</a></li>
                        <li class="active"><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 Part 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_plisting/' . $this_plisting->list_id . '', $attributes); ?>

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

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

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

                    <div class="form-group">
                        <label for="part_description" class="col-sm-3 control-label">Part Description:</label>
                        <div class="col-sm-5">
                            <textarea type="text" class="form-control" rows="7" id="part_description" name="part_description" placeholder="Part Description"><?php echo $this_plisting->part_description; ?></textarea>
                        </div>
                    </div>

                    <div class="form-group">           
                        <label for="part_condition" class="col-sm-3 control-label">Part Condition:</label>
                        <div class="col-sm-5">

                            <select name="part_condition_dropdown" class="form-control">
                                <option value="--Select Part Condition--" <?php echo ($this_plisting->part_condition == "--Select Part Condition--") ? 'selected' : ''; ?>>--Select Part Condition--</option>
                                <option value="AR" <?php echo ($this_plisting->part_condition == "AR") ? 'selected' : ''; ?>>AR</option>
                                <option value="NE" <?php echo ($this_plisting->part_condition == "NE") ? 'selected' : ''; ?>>NE</option>
                                <option value="NS" <?php echo ($this_plisting->part_condition == "NS") ? 'selected' : ''; ?>>NS</option>
                                <option value="OH" <?php echo ($this_plisting->part_condition == "OH") ? 'selected' : ''; ?>>OH</option>
                                <option value="SV" <?php echo ($this_plisting->part_condition == "SV") ? 'selected' : ''; ?>>SV</option>
                            </select>
                        </div>
                        <div class="col-xs-1">
                            <span class="error2">*</span>
                        </div>
                    </div>

                    <div class="form-group">           
                        <label for="enginep_model" class="col-sm-3 control-label">Engine Model:</label>
                        <div class="col-sm-5">
                            <input type="text" class="form-control" id="enginep_model" name="enginep_model" autocomplete="off" value="<?php echo $this_plisting->enginep_model; ?>" placeholder="Engine Model">
                        </div>
                    </div>

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

                            <select name="tag_dropdown" class="form-control">
                                <option value="--Select Tag--" <?php echo ($this_plisting->tag == "--Select Tag--") ? 'selected' : ''; ?>>--Select Tag--</option>
                                <option value="AR" <?php echo ($this_plisting->tag == "AR") ? 'selected' : ''; ?>>AR</option>
                                <option value="DUAL" <?php echo ($this_plisting->tag == "DUAL") ? 'selected' : ''; ?>>DUAL</option>
                                <option value="EASA" <?php echo ($this_plisting->tag == "EASA") ? 'selected' : ''; ?>>EASA</option>
                                <option value="FAA" <?php echo ($this_plisting->tag == "FAA") ? 'selected' : ''; ?>>FAA</option>
                            </select>
                        </div>
                        <div class="col-xs-1">
                            <span class="error2">*</span>
                        </div>
                    </div>

                    <div class="form-group">           
                        <label for="quantity" class="col-sm-3 control-label">Quantity:</label>
                        <div class="col-sm-5">
                            <input type="text" class="form-control" name="quantity" autocomplete="off" value="<?php echo $this_plisting->quantity; ?>">
                        </div>
                        <div class="col-xs-1">
                            <span class="error2">*</span>
                        </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 type="radio" id="inlineRadio1" name="inlineradio" value="Buyer" <?php echo ($this_plisting->lister == "Buyer") ? "checked" : ""; ?>>Buyer
                            </label>
                            <label class="radio-inline">
                                <input type="radio" id="inlineRadio2" name="inlineradio" value="Seller" <?php echo ($this_plisting->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_plisting->transaction == "Sale/Lease") || ($this_plisting->transaction == "Sale") || ($this_plisting->transaction == "Sale/Lease/Exchange") || ($this_plisting->transaction == "Sale/Exchange") ? "checked" : "";
?>>Sale
                            </label>
                            <label class="checkbox-inline">
                                <input type="checkbox" id="inlineCheckbox2" name="inlinecheck[]" class="childC" value="Lease" <?php echo ($this_plisting->transaction == "Sale/Lease") || ($this_plisting->transaction == "Lease") || ($this_plisting->transaction == "Sale/Lease/Exchange") || ($this_plisting->transaction == "Lease/Exchange") ? "checked" : "";
?>>Lease
                            </label>
                            <label class="checkbox-inline">
                                <input type="checkbox" id="inlineCheckbox3" name="inlinecheck[]" class="childC" value="Exchange" <?php echo ($this_plisting->transaction == "Sale/Exchange") || ($this_plisting->transaction == "Sale/Lease/Exchange") || ($this_plisting->transaction == "Lease/Exchange") || ($this_plisting->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" id="asking_price" name="asking_price" autocomplete="off" value="<?php echo $this_plisting->asking_price; ?>" placeholder="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" id="monthly_rent" name="monthly_rent" autocomplete="off" value="<?php echo $this_plisting->monthly_rent; ?>" placeholder="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_plisting->available_date; ?>" placeholder="DD-MM-YYYY">
                        
                        </div>
                        <div class="col-xs-1">
                            <span class="error2">*</span>
                        </div>
                    </div>
                    
                    <div class="form-group">           
                        <label for="record" class="col-sm-3 control-label">Record:</label>
                        <div class="col-sm-5">
                            <input type="file" id="uf" class="form-control" 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 Record:</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">Save 
                                <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>
