<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">Marketplace - Engines</h3>
                </div>

                <!--Left panel body-->
                <div class="panel-body">
                    <ul class="nav nav-pills nav-stacked">
                        <li class="active"><a href="<?php echo base_url(); ?>epc_listings/market_listings/e_listings">
                                <span class="badge pull-right"><?php echo $total; ?></span>
                                Total Engines</a></li>
                    </ul>

                </div>
            </div>
            
            <?php
                $attributes1 = array(
                    'class' => 'form-horizontal',
                    'id' => 'submit1'
                );
                ?>
            
             <?php echo form_open('epc_listings/market_listings/search_e_listings', $attributes1); ?>
            
            <!--<div class="panel-group" id="accordion">-->
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h4 class="panel-title">
                                    <i class="glyphicon glyphicon-search"></i> Search
                                </h4>
                            </div>
                            <!--<div id="collapseOne" class="panel-collapse collapse">-->
                                <div class="panel-body">
                                    
                                    <?php echo validation_errors('<p class="alert alert-dismissable alert-danger">'); ?>

                                   <div class="form-group">           
                        <!--<label style="font-size: 13px" for="column" class="col-sm-5 control-label">Search By:</label>-->
                        <div class="col-sm-12">

                            <select name="column_dropdown" id="column_dropdown" class="form-control col-sm-12">
                                <option value="--Select Column--" <?php if (!empty($_REQUEST['column_dropdown']) && $_REQUEST['column_dropdown'] == '--Select Column--') echo 'selected'; ?>>--Select Column--</option>
                                <option value="manufacturer" <?php if (!empty($_REQUEST['column_dropdown']) && $_REQUEST['column_dropdown'] == 'manufacturer') echo 'selected'; ?>>Manufacturer</option>
                                <option value="engine_model" <?php if (!empty($_REQUEST['column_dropdown']) && $_REQUEST['column_dropdown'] == 'engine_model') echo 'selected'; ?>>Engine Model</option>
                            </select>
                        </div>
<!--                        <div class="col-sm-1">
                            <span class="error2">*</span>
                        </div>-->

                                </div>
                                    
                                    <div class="form-group">           
                        <!--<label style="font-size: 13px" for="searchfield" class="col-sm-1 control-label">Criteria:</label>-->
                        <div class="col-sm-12">
                            <input type="text" class="form-control" id="search_field" name="search_field" autocomplete="off" value="<?php echo set_value('search_field'); ?>" placeholder="Criteria">
                        </div>
                      

                            </div> 

                                    <div class="form-group">
                                        <div class="col-sm-8">
                                            <button type="submit" class="btn btn-primary btn-xs">Search 
                                                <i class="glyphicon glyphicon-search"></i></button>
                                        </div>
                                    </div>


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

            <!--LEFT COLUMN ADVERTISEMENTS PLACEHOLDER FOR REVISION2 -->            
<!--            <div class="panel panel-default">       
                <div class="panel-body">
                    ADD PLACEHOLDER
                </div>                
            </div>  -->
        </div>

        <!--Mid panel heading-->
        <div class="col-md-10">
            <div class="well panel panel-default">
                <div class="panel-heading">

                    <p>Traditionally, current engine listings in the market have been mostly placeholders for buyers to inform their line of engine models they are investing and may not address immediate source to fulfill an inquiry.  For the first time, IAEA is introducing a more meaningful engine listing where one can actually see the engine’s mini pack along with asking price in one location. The Cloud Admin will actively monitor the validity of the availabilities to reduce unnecessary contact. Meanwhile for the first time buyers and lessees can list their requirement also in order to have a comprehensive marketplace. The intent is to evolve the marketplace to a medium where active bidding can take place. The IAEA’s Engine Marketplace will eliminate 100s of phone calls and email communications for engine transactions to take place and provide visibility to market pricing like a stock market. The engine listing will be communicated to members through a regular newsletter.</p>

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

        <div class="col-md-10">
            <div class="panel panel-default">
                <div class="panel-heading">Engines


                </div>

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

                    <div id="response"></div>



                    <table style="font-size: 13px;" class="table table-bordered table-hover table-condensed">
                        <thead>
                            <tr>
                                <th <?php if ($sort_by == 'manufacturer') echo "id=\"sort_$sort_order\"" ?>><?php
                                    echo anchor("epc_listings/market_listings/e_listings/manufacturer/" .
                                            (($sort_order == 'asc' && $sort_by == 'manufacturer') ? 'desc' : 'asc'), 'Manufacturer: ');
                                    ?></th>
                                <th class="hidden-xs"  <?php if ($sort_by == 'engine_model') echo "id=\"sort_$sort_order\"" ?>><?php
                                    echo anchor("epc_listings/market_listings/e_listings/engine_model/" .
                                            (($sort_order == 'asc' && $sort_by == 'engine_model') ? 'desc' : 'asc'), 'Engine Model: ');
                                    ?></th>
                                <th class="col-md-1" <?php if ($sort_by == 'esn') echo "id=\"sort_$sort_order\"" ?>><?php
                                    echo anchor("epc_listings/market_listings/e_listings/esn/" .
                                            (($sort_order == 'asc' && $sort_by == 'esn') ? 'desc' : 'asc'), 'ESN: ');
                                    ?></th>
                                <th class="hidden-xs" <?php if ($sort_by == 'lister') echo "id=\"sort_$sort_order\"" ?>><?php
                                    echo anchor("epc_listings/market_listings/e_listings/lister/" .
                                            (($sort_order == 'asc' && $sort_by == 'lister') ? 'desc' : 'asc'), 'Lister: ');
                                    ?></th>
                                <th class="hidden-xs" <?php if ($sort_by == 'transaction') echo "id=\"sort_$sort_order\"" ?>><?php
                                    echo anchor("epc_listings/market_listings/e_listings/transaction/" .
                                            (($sort_order == 'asc' && $sort_by == 'transaction') ? 'desc' : 'asc'), 'Transaction: ');
                                    ?></th>
                                <th class="hidden-xs" <?php if ($sort_by == 'location') echo "id=\"sort_$sort_order\"" ?>><?php
                                    echo anchor("epc_listings/market_listings/e_listings/location/" .
                                            (($sort_order == 'asc' && $sort_by == 'location') ? 'desc' : 'asc'), 'Location: ');
                                    ?></th>
                                <th class="hidden-xs" <?php if ($sort_by == 'asking_price') echo "id=\"sort_$sort_order\"" ?>><?php
                                    echo anchor("epc_listings/market_listings/e_listings/asking_price/" .
                                            (($sort_order == 'asc' && $sort_by == 'asking_price') ? 'desc' : 'asc'), 'Asking Price: ');
                                    ?></th>
                                <th class="hidden-xs" <?php if ($sort_by == 'monthly_rent') echo "id=\"sort_$sort_order\"" ?>><?php
                                    echo anchor("epc_listings/market_listings/e_listings/monthly_rent/" .
                                            (($sort_order == 'asc' && $sort_by == 'monthly_rent') ? 'desc' : 'asc'), 'Monthly Rent: ');
                                    ?></th>
                                <th class="hidden-xs" <?php if ($sort_by == 'available_date') echo "id=\"sort_$sort_order\"" ?>><?php
                                    echo anchor("epc_listings/market_listings/e_listings/available_date/" .
                                            (($sort_order == 'asc' && $sort_by == 'available_date') ? 'desc' : 'asc'), 'Available Date: ');
                                    ?></th>
                                <th class="hidden-xs" <?php if ($sort_by == 'contact_name') echo "id=\"sort_$sort_order\"" ?>><?php
                                    echo anchor("epc_listings/market_listings/e_listings/contact_name/" .
                                            (($sort_order == 'asc' && $sort_by == 'contact_name') ? 'desc' : 'asc'), 'Contact Name: ');
                                    ?></th>
                                <th class="hidden-xs" <?php if ($sort_by == 'email') echo "id=\"sort_$sort_order\"" ?>><?php
                                    echo anchor("epc_listings/market_listings/e_listings/email/" .
                                            (($sort_order == 'asc' && $sort_by == 'email') ? 'desc' : 'asc'), 'Email: ');
                                    ?></th>
                                <th class="hidden-xs" <?php if ($sort_by == 'phone') echo "id=\"sort_$sort_order\"" ?>><?php
                                    echo anchor("epc_listings/market_listings/e_listings/phone/" .
                                            (($sort_order == 'asc' && $sort_by == 'phone') ? 'desc' : 'asc'), 'Phone: ');
                                    ?></th>
                                <th></th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php if (!empty($elistings)) { ?> 
                                <?php foreach ($elistings as $list) : ?>
                            
                       
                                
                                    <tr>
                                        <td><a href="<?php echo base_url(); ?>epc_listings/market_listings/display_elisting/<?php echo $list->list_id; ?>"><?php echo $list->manufacturer; ?></a></td>
                                        <td class="hidden-xs"><?php echo $list->engine_model; ?></td>
                                        <td><?php echo $list->esn; ?></td>
                                        <td class="hidden-xs"><?php echo $list->lister; ?></td>
                                        <td class="hidden-xs"><?php echo $list->transaction; ?></td>
                                        <td class="hidden-xs"><?php echo $list->location; ?></td>
                                        <td class="hidden-xs"><?php echo $list->asking_price; ?></td>
                                        <td class="hidden-xs"><?php echo $list->monthly_rent; ?></td>
                                        <td class="hidden-xs"><?php echo $list->available_date; ?></td>
                                        <td class="hidden-xs"><?php echo $list->first_name ." ".$list->last_name ?></td>
                                        <td class="hidden-xs"><?php echo $list->email; ?></td>
                                        <td class="hidden-xs"><?php echo $list->phone; ?></td>

                                        <td>

                                            <a href="<?php echo $list->list_id; ?>" data-va="<?php echo $list->email; ?>" data-id="<?php echo $list->list_id; ?>"><i class="glyphicon glyphicon-envelope"></i></a>
                                        </td>

                                    </tr>


                                <?php endforeach; ?>
                            <?php } ?>
                        </tbody>
                    </table>


                </div>

                <!--Mid panel footer-->
                <div class="panel-footer">
                    <div class="row">
                        <div class="col-md-4">

                            <?php if (!empty($start) && !empty($end)) { ?>

                                Showing: <span id="label" class="label"><?php echo $start; ?> to <?php echo $end; ?> of <?php echo $total; ?> entries</span>

                            <?php } ?>
                        </div> 
                        <div class="col-md-7 pull-right">
                            <div id ="pgcol" class="pgPaginate" id="paginateInfo"> 
                                <?php echo $elinks; ?>
                            </div>
                        </div>
                    </div>  
                </div>
            </div>
        </div>
    </div>
</div>