<?php  $this->load->view('master/common/header.php',$data);
$base_name = $data['base_name'];
?>

    <div class="content">
        
        <!-- Start Content-->
        <div class="container-fluid">
            
            <!-- start page title -->
            <div class="row">
                <div class="col-12">
                    <div class="page-title-box">
                        <div class="page-title-right">
                            <ol class="breadcrumb m-0">
                                <li class="breadcrumb-item"><a href="javascript: void(0);"><?= $base_name;?></a></li>
                                <li class="breadcrumb-item active text-capitalize"><?= $page;?></li>
                            </ol>
                        </div>
                        <h4 class="page-title text-uppercase"><?= $page;?></h4>
                    </div>
                </div>
            </div>     
            <!-- end page title --> 
<?php
if(!empty($product_size)){
    $p_id = $product_size['p_id'];
	$size_id = $product_size['size_id'];
	$p_old_price = $product_size['p_old_price'];
	$p_current_price = $product_size['p_current_price'];
	$p_pv = $product_size['p_pv'];
	$p_qty = $product_size['p_qty'];
	$p_min_qty = $product_size['p_min_qty'];
}

if(!empty($product)){
    foreach($product as $row){
        if($row['p_id']==$p_id){
            $p_name = $row['p_name'];
        }
    }
}

if(!empty($size)){
    foreach($size as $row2){
        if($row2['size_id']==$size_id){
            $size_name = $row2['size_name'];
        }
    }
}
?>

            <div class="row">
                <div class="col-md-12 col-xl-12">
                    <div class="card-box">
                        <div class="row">
                            <div class="col-sm-12">
                                <form class="form-horizontal" action="<?= base_url('master/product_stock/edit_content/'.$product_size['id']);?>" method="post" enctype="multipart/form-data">
                                    <input type="hidden" name="table" value="tbl_product_size" />
                                    <input type="hidden" name="page" value="product_stock/edit/<?=$product_size['id'];?>" />
                                    <input type="hidden" name="column" value="id" />
                                    
                                    <h4 class="header-title mb-4">Product Size</h4>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for="" class="control-label">Product Name <span>*</span></label>
                                                <div class="col-sm-12">
                                                    <input type="text"  class="form-control" value="<?php echo $p_name; ?>" readonly>
                                                </div>
                                            </div>
                                        </div>
                                        
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for="" class="control-label">Product Size <span>*</span></label>
                                                <div class="col-sm-12">
                                                <input type="text"  class="form-control" value="<?php echo $size_name; ?>" readonly>
                                                </div>
                                            </div>
                                        </div>
                                        
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for="" class="control-label">Product Old Price <span>*</span></label>
                                                <div class="col-sm-12">
                                                    <input type="number" min="0" name="p_old_price" class="form-control" value="<?php echo $p_old_price; ?>" required>
                                                </div>
                                            </div>
                                        </div>
                                        
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for="" class="control-label">Product Current Price <span>*</span></label>
                                                <div class="col-sm-12">
                                                    <input type="number" min="0" name="p_current_price" class="form-control" value="<?php echo $p_current_price; ?>" required>
                                                </div>
                                            </div>
                                        </div>
                                        
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for="" class="control-label">Product PV <span>*</span></label>
                                                <div class="col-sm-12">
                                                    <input type="number" min="0"  step=".10" name="p_pv" class="form-control" value="<?php echo $p_pv; ?>" required>
                                                </div>
                                            </div>
                                        </div>
                                        
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for="" class="control-label">Product Stock <span>*</span></label>
                                                <div class="col-sm-12">
                                                    <input type="number" min="0" name="p_qty" class="form-control" value="<?php echo $p_qty; ?>" required>
                                                </div>
                                            </div>
                                        </div>
                                        
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for="" class="control-label">Product Min. Stock <span>*</span></label>
                                                <div class="col-sm-12">
                                                    <input type="number" min="0" name="p_min_qty" class="form-control" value="<?php echo $p_min_qty; ?>" required>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    
                                    <div class="form-group">
                                        <button type="submit" class="btn btn-success float-right m-2">Submit</button>
                                        <a href="<?php echo base_url().'master/product_stock'?>" class="btn float-right m-2 btn-secondary" title="">Go To Product Stock</a>
                                        <a href="<?php echo base_url().'master/product_stock/all'?>" class="btn float-right m-2 btn-secondary" title="">Go To Product Management</a>
                                    </div>
                                
                                </form>
				            </div>
					    </div>
					</div>
				</div>
				<!-- /.col-md-6 -->
			</div>
			<!-- /.row -->
		</div>
		<!-- /.container-fluid -->
	</div>
	<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php $this->load->view('master/common/footer.php'); ?>
