<div class="list-group">
  <?php foreach($pros as $c){?>
  	<a class="media selectedp" href="#" warranty="<?php echo $c->wr_month;?>" image='<?php echo base_url().'assets/images/products/'.$c->img;?>' id="<?php echo $c->pid;?>" price="<?php echo $c->oprice;?>" title="<?php echo $c->title;?>">
      <div class="media-left">
        <img src="<?php echo base_url().'assets/images/products/'.$c->img;?>" class="media-object" style="width:60px">
      </div>
      <div class="media-body">
        <h6><b class="text-danger"><?php echo $c->title;?></b><br/>
        <?php echo $c->oprice;?></h6>
      </div>
    </a>
  <?php }?>
</div>
<script>
$(".selectedp").click(function(){
	var id=$(this).attr("id");
	var pimg=$(this).attr("image");
	var title=$(this).attr("title");
	var price=$(this).attr("price");
	var wrt=$(this).attr("warranty");
	$("#wrt").val(wrt);
	$("#psearch").val(title);
	$("#pimg").val(pimg);
	$("#pid").val(id);
	$("#subtotal").text(price);
	$("#subtotal_input").val(price);
	$("#discount_input").text(price);
	$("#prod_div").html('');
});
</script>