
<?php 
$fid=$this->session->userdata('fir_id');
$sid=$this->session->userdata('sec_id');


$find_curr=$this->db->query("select * from coin_info where coid='".$fid."'")->row();
$ex2=$find_curr->coin_symbol;
$find_curr1=$this->db->query("select * from coin_info where coid='".$sid."'")->row();
$ex1=$find_curr1->coin_symbol;
?>
   
            <div class="col-md-12">
              <div class="col-md-6" style="padding:5px;">
                <h6 class="other-title theme-color">SELL ORDER</h6>
                <div class="table-responsive" style="overflow-x:hidden;">
                  <table>
                    <thead>
                      <tr>
                        <th>Price</th>
                        <th><?php echo $ex2;?></th>
                        <th><?php echo $ex1;?></th>
                      </tr>
                    </thead>
                    <tbody>
                    <ul>
                      <?php
                        $res=$this->db->query("select * from exchange where type in('4') and status='1' and pair='".$fid."' and market_type='".$sid."' and exchange_mode='0' order by date desc limit 15");
                        $row=$res->result();
                        if($row)
                        {
                          $s=0;
                          foreach($row as $row)
                          {
                            $s++;

                          ?>

                          <tr onclick="value_store('<?php echo $row->price?>','<?php echo $row->amount;?>','<?php echo $row->total;?>');">
                            <td><span class="purple"><?php echo $row->price;?></span> </td>
                            <td style='text-align:left;'><?php echo number_format($row->amount,$find_curr->coin_decimal);?></td>
                            <td style='text-align:left;'><?php echo number_format($row->total,$find_curr1->coin_decimal);?></td>
                          </tr>
                          <?php
                          }
                        }
                        else
                        {
                          ?>
                          <tr>
                           <td colspan='4'>No data available in table</td>
                          </tr>
                          <?php

                        }
                        ?>
                        </ul>
                    </tbody>
                  </table>
                </div>
                </div>
                <div class="col-md-6" style="padding:5px;">
                <h6 class="other-title theme-color">BUY ORDER</h6>
                <div class="table-responsive" style="overflow-x:hidden;">
                  <table>
                    <thead>
                      <tr>
                        <th>Price</th>
                        <th style="text-align:left;"><?php echo $ex2;?></th>
                        <th style="text-align:left;"><?php echo $ex1;?></th>
                      </tr>
                    </thead>
                    <tbody>
                     <?php
                        $res=$this->db->query("select * from exchange where type in('3') and status='1' and pair='".$fid."' and market_type='".$sid."' and exchange_mode='0'  order by date desc limit 15");
                        $row=$res->result();
                        if($row)
                        {
                          $s=0;
                          foreach($row as $row)
                          {
                            $s++;

                          ?>

                          <tr onclick="value_store('<?php echo $row->price?>','<?php echo $row->amount;?>','<?php echo $row->total;?>');">
                            <td><span class="green"><?php echo $row->price;?></span> </td>
                            <td style='text-align:left;'><?php echo number_format($row->amount,$find_curr->coin_decimal);?></td>
                            <td style='text-align:left;'><?php echo number_format($row->total,$find_curr1->coin_decimal);?></td>
                          </tr>
                          <?php
                          }
                        }
                        else
                        {
                          ?>
                          <tr>
                           <td colspan='4'>No data available in table</td>
                          </tr>
                          <?php

                        }
                        ?>
                     
                    </tbody>
                  </table>
                </div>
                </div>
                </div>
            
           






