<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">Search for Members</h3>
                </div>

                <!--Left panel body-->
                <div class="panel-body">
                    <ul class="nav nav-pills nav-stacked">
                        <li><span class="badge pull-right"><?php echo $num_results; ?></span>Members</li>
                    </ul>
                </div>
            </div>
        </div>

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

                    BOX FOR MENTOR

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

        <div class="col-md-9">
            <div class="panel panel-default">
                <div class="panel-heading">Members

                </div>

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

<?php echo form_open('search/search', $attributes); ?>

                <!--Mid panel body-->        
                <div class="panel-body">
<!--
                    <?php echo validation_errors('<p class="alert alert-dismissable alert-danger">'); ?>

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

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

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

                    <div class="form-group">           
                        <label for="column" class="col-sm-1 control-label">Search By:</label>
                        <div class="col-sm-3">

                            <select name="category" id="column_dropdown" class="form-control">
                                <option value="0" <?php if (!empty($_REQUEST['column_dropdown']) && $_REQUEST['column_dropdown'] == '--Select Column--') echo 'selected'; ?>>First Name</option>
                                <option value="1" <?php if (!empty($_REQUEST['column_dropdown']) && $_REQUEST['column_dropdown'] == 'part_number') echo 'selected'; ?>>Last Name</option>
                                <option value="2" <?php if (!empty($_REQUEST['column_dropdown']) && $_REQUEST['column_dropdown'] == 'part_description') echo 'selected'; ?>>Company</option>
                                <option value="3" <?php if (!empty($_REQUEST['column_dropdown']) && $_REQUEST['column_dropdown'] == 'part_description') echo 'selected'; ?>>Position</option>
                                <option value="4" <?php if (!empty($_REQUEST['column_dropdown']) && $_REQUEST['column_dropdown'] == 'part_description') echo 'selected'; ?>>City</option>
                                <option value="5" <?php if (!empty($_REQUEST['column_dropdown']) && $_REQUEST['column_dropdown'] == 'part_description') echo 'selected'; ?>>State</option>
                                <option value="6" <?php if (!empty($_REQUEST['column_dropdown']) && $_REQUEST['column_dropdown'] == 'part_description') echo 'selected'; ?>>Country</option>
                                
                            </select>
                            
                            <!--<?php echo form_dropdown('category', $category_options,  
                    set_value('category'), 'id = "category"'); ?>-->
                            
                        </div>
                        <div class="col-sm-1">
                            <span class="error2">*</span>
                        </div>

                    </div>

                    <div class="form-group">           
                        <label for="searchfield" class="col-sm-1 control-label">Criteria:</label>
                        <div class="col-sm-3">
                            <input type="text" class="form-control" id="searchinfo" name="searchinfo" autocomplete="off" value="<?php echo set_value('searchinfo'); ?>" placeholder="Criteria">
                        </div>
                        <div class="col-sm-1">
                            <span class="error2">*</span>
                        </div>

                    </div> 


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



                    <table style="font-size: 13px;" class="table table-bordered table-hover table-condensed">
                      <thead>
                    <tr>
			<?php foreach($fields as $field_name => $field_display): ?>
			<th <?php if ($sort_by == $field_name) echo "class=\"sort_$sort_order\"" ?>>
				<?php echo anchor("search/display/$query_id/$field_name/" .
					(($sort_order == 'asc' && $sort_by == $field_name) ? 'desc' : 'asc') ,
					$field_display); ?>
			</th>
			<?php endforeach; ?>
                        <th></th>
                    </tr>
		     </thead>
                        <tbody>
			<?php foreach($membersforview as $user): ?>
			<tr>
				
                                    <!-- get id to use for link -->
                                       <?php $id = $user->id; ?>
                                       <?php $function = array('auth/view_other_user', $id);?>
                                 
                                        <td class="hidden-xs"><?php echo $user->first_name; ?></td>
                                        <td class="hidden-xs"><?php echo $user->last_name; ?></td>
                                        <td class="hidden-xs"><?php echo $user->company; ?></td>
                                        <td class="hidden-xs"><?php echo $user->position; ?></td>
                                        <td class="hidden-xs"><?php echo $user->email; ?></td>
                                        <td class="hidden-xs"><?php echo $user->phone ?></td>
                                        <td class="hidden-xs"><?php echo $user->city; ?></td>
                                        <td class="hidden-xs"><?php echo $user->state; ?></td>
                                        <td class="hidden-xs"><?php echo $user->country; ?></td>
                                <td>
                                    <a href="<?php echo base_url($function) ?>"><i class="glyphicon glyphicon-user"></i></a>
                                </td>
				
			</tr>
			<?php endforeach; ?>			
		</tbody>
                    </table>         
                </div>

<?php echo form_close(); ?>


                <div class="panel-footer">
                    <div class="row">
                        <div class="col-md-7 pull-right">
                            <div id ="pgcol" class="pgPaginate" id="paginateInfo">
                                <?php if (strlen($pagination)): ?>
	                      Pages: <?php echo $pagination; ?>
	
	                   <?php endif; ?>

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

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