<?php
function formatMoney($number, $fractional=false) {
						if ($fractional) {
							$number = sprintf('%.2f', $number);
						}
						while (true) {
							$replaced = preg_replace('/(-?\d+)(\d\d\d)/', '$1,$2', $number);
							if ($replaced != $number) {
								$number = $replaced;
							} else {
								break;
							}
						}
						return $number;
					}


?>
 <div class="row">

    <div class="col-md-12">
		<div class="panel panel-primary" data-collapsed="0">
        	<div class="panel-heading">
            	<div class="panel-title" id="redcolor" >
            		<i class="entypo-plus-circled"></i>
		
				
				<h1> <center> WELCOME TO PRODUCTS DASHBOARD</center>  </H1>
				
				<?php
				
				$session_data = $this->session->userdata('logged_in');
	$lasttime = "";
				?>
            	</div>
            </div>
			<div class="panel-body">

			
										
				<div class="container" style="width:100%">
	<div class="row">
	
	
	<?php
	
	

	
 if(is_array($viewproducts)) {
	 foreach ($viewproducts as $c){
 ?>

	
	


  
	
	
	
     

    	<div class="col-sm-3">
    		<div class="tile-progress tile-green">
    			<div class="tile-header">
    		<h3><?php $category = $this->usermodel->populateallarray('productcategory','id',$c->category );
		echo$category[0]["name"];?></h3>
				<i class="fa fa-cubes" style="font-size:30px"></i>

    				<span> QTY:<?php   echo formatMoney($c->qty,true)  ;?></span></br>
						<span>Amount: <?php 
						echo formatMoney($c->buyingprice,true)  ;
						
						?></span>
    			</div>
    		
    		</div>
    	</div>
   
		
	<?php
	 }
	 
 }
 ?>

	
		
		
    </div>
 
</div>				
									



</div>
</div>














































