0

我有一个带有 2 个选项卡的表单,这 2 个选项卡有 2 个选项来获取结果,所以如果我使用表单打开的选项卡不起作用,那么任何人都可以在不更改 url 的情况下帮助我解决问题如何过滤我的结果以获取不同的选项卡单一形式 这是我的视图文件

<ul id="myTab2" class="nav nav-tabs sidebar-tabs">
<li class="active">
<a href="#myTab2_example1" data-toggle="tab">
All Merchant IDs
</a>
</li>
<li>
<a href="#myTab2_example2" data-toggle="tab">
Single Merchant ID
</a>
</li>
<li>
<div class="tab-content">
<div class="tab-pane fade in active" id="myTab2_example1">
<div class="search_block">
    <div class="form-group mar-b0">
      <div class="section colm colm4">
 <label class="tp-label">Select a year</label>
<select name="transactionYear" id="transactionYear" aria-required="true"   required="required">
<?php $year=$this->livemerchant_model->Year_dropdown();                               
  foreach ($year as $row){
?>
<option value="<?php echo $row->TheYear ?>"><?php echo $row->TheYear ?>   </option>
   <?php }?>
 </select> 
 <input type="submit" name="reqsub" id="reqsub" class="btn btn-primary">
</div>
</div>
 </div>  
 <div class="row">
 <div class="col-lg-4 col-sm-12">
 <table class="table table-bordered">
 <thead>
  <tr>
  <th>Month</th>
  <th>GBP</th>
   </tr>
    </thead>
   <tbody>
    <?php 
  foreach ($monthlyTotals as $row) {?>
  <tr>
  <td><?php echo $row->TheMonthName . PHP_EOL;  ?></td>
  <td><?php echo $row->TotalAmount. PHP_EOL;?></td>
 </tr>
  <?php }?>
 </tbody>
  <tfoot>
  </tfoot>
  </table>
  </div>                                                              
  <?php //echo    form_open_multipart(base_url().'index.php/AdminController/sample');?>
 <div class="search_block">
 <div class="form-group mar-b0">
  <div class="section colm colm4">
  <label class="tp-label">Merchant ID</label>
  <select name="transactionMerchant" id="transactionMerchant" aria-    required="true" required="required">
  <?php $merchanttype = $this->livemerchant_model- >merchant_type_dropdown(); 
 foreach ($merchanttype as $merchant){
  ?>
  <option value="<?php echo $merchant->TRANS_MerchantId ?>"><?php echo   $merchant->TRANS_MerchantId ?></option>
  <?php }?>
 </select>
 <select name="transactionYear" id="transactionYear" aria-required="true" required="required">
 <?php $year=$this->livemerchant_model->Year_dropdown(); 
   foreach ($year as $row){
 ?>
  <option value="<?php echo $row->TheYear ?>"><?php echo $row->TheYear ?></option>
  <?php }?>
  </select>
  <input type="submit" name="tell" id="tell" >
  </div>
  <?php echo form_close();?>
 </div>
 </div>
 <div class="row">
 <div class="col-lg-4 col-sm-12">
  <table class="table table-bordered">                                                              
 <thead>  <tr>                                                              
 <th>Month</th>
 <th>GBP</th>   </tr>                                                                       
 </thead>                                                                                                                                           
 <tbody>                                                                            
 <?php foreach ($monthlyTotals as $row) {?>                                                                     
 <tr>                                                                  
  <td><?php echo $row->TheMonthName . PHP_EOL;  ?> 
   <td><?php echo $row->TotalAmount. PHP_EOL;?></td>                                                                        
  </tr>   
  <?php }?>                                                                       
  </tbody>                                                                      
  <tfoot>  
  </tfoot>
  </table>
  </div>    

这是我的控制器

public function overviews()
{

$data['monthlyTotals'] = $this->livemerchant_model->overviews();
if ($this->input->post('transactionMerchant,transactionYear')) {
    $data['monthlyTotals'] = $this->livemerchant_model->overviews($this->input->post('transactionMerchant'), $this->input->post('transactionYear'));
} else {
    $data['monthlyTotals'] = $this->livemerchant_model->overviews();
}


$this->load->view('overviews', $data);
}                     

谁能帮我解决标签问题

4

0 回答 0