<?php 
//print_r($auctions);exit;
if(!empty($auctions)){
	foreach($auctions as $live){$i=1000+$live->apid;
    $dd= date("Y-m-d H:i:s",$live->start_time);
    $timeFirst  = strtotime(date("Y-m-d H:i:s"));
    $timeSecond = strtotime($dd);
    $differenceInSeconds = $timeSecond - $timeFirst;?>
    
    <tr id="trr<?php echo $i;?>">
    <input type="hidden" name="prebid" id="prebid<?php echo $live->apid;?>" value="0">
    <td><?php echo $i;?></td>
	<td><img width="50px" src="<?php echo base_url();?>assets/images/products/<?php echo $live->img;?>" class="img img-responsive"></td>
    <td><h4><?php echo $live->title;?></h4><label class="label label-default">AUC<?php echo $live->apid;?></label></td><td>
 <h5>Max Auction Price : <?php echo $live->max_price;?><br/>
 (<b class="text-danger">MaxBidCoins - <?php echo ceil($live->max_price/$this->session->userdata("bidrate"));?></b>)<br/>
 (<b class="text-success">MaxBids - <?php echo ceil(ceil($live->max_price/$this->session->userdata("bidrate"))/$live->req_credit);?></b>)</h5></td>
 <td><h5>Min Auction Price : <?php echo $live->min_price;?><br/>
(<b class="text-danger">MinBidCoins - <?php echo ceil($live->min_price/$this->session->userdata("bidrate"));?></b>)<br/>
(<b class="text-success">MinBids - <?php echo ceil(ceil($live->min_price/$this->session->userdata("bidrate"))/$live->req_credit);?></b>)<br/></h5></td>
 <td>
Total Bids - <b id="prebidd<?php echo $live->apid;?>"><?php echo $this->db->get_where("auctions",array("auc_dayid"=>$live->apid))->num_rows();?></b><br/>
Actual Bids - <b id="actual<?php echo $live->apid;?>"><?php echo $this->db->get_where("auctions",array("auc_dayid"=>$live->apid,"bid_type"=>""))->num_rows();?></b><br/>
Virtual Bids -<b id="virtual<?php echo $live->apid;?>"><?php echo $this->db->get_where("auctions",array("auc_dayid"=>$live->apid,"bid_type"=>"robot"))->num_rows();?></b></td>
<td><h3 id="timer<?php echo $live->apid;?>" title="<?php echo $live->apid.'-'.$live->pid.'-'.$live->duration;?>" class="timer_running text-warning" secc="<?php echo rand(5,10);?>"><?php if($differenceInSeconds>0){echo $differenceInSeconds;}else{echo $live->duration;}?></h3></td></tr>
<?php }}?>