<?php
include("db_connection.php");
$Mainclass = new DB_Controller();

$new_id = $_REQUEST['new_id'];

$result = $Mainclass->Fetch_individual_data("design_code_master","*","SLN='".$new_id."'");

if($new_id!=""){

?>


 <div class="card-body">

<div class="bg-light border">

<div id="product_div">
	
	

<h3 class="text-uppercase fw-bolder text-primary">Product 1 Details  </h3>



<div class="row mt-4 ">
<div class="col-3" id="form_select">
<div class="form-group">
<label>Gold Weight <span style="color:crimson;font-weight:bold;">*</span></label>
<input type="text" name="g_weight<?php echo $c ; ?>" id="g_weight<?php echo $c ; ?>" placeholder=" Enter Gold Weight " class="form-control err" onkeypress="remove_error()" oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');" autocomplete="off">
</div>
</div>

<div class="col-3" id="form_select">
<div class="form-group">
<label>Gold Purity <span style="color:crimson;font-weight:bold;">*</span></label>
<select class="form-control err" id="g_purity" name="g_purity" onchange="remove_error()">
<option value="">--- please select---</option>
<?php
$fetch_p_cate=$Mainclass->Fetch_multiple_data("gold_karat_master","*","Active='Yes'");
foreach ($fetch_p_cate as $get_p_cate)
{
?>
<option value="<?php echo $get_p_cate['Karat']?>" <?php if($get_p_cate['Karat']==$result['GoldPurity']) echo "selected"; ?>><?php echo $get_p_cate['Karat']?></option>
<?php
}
?>
</select>
</div>
</div>



<div class="col-3">
<div class="form-group">
<label>Has Stone ?</label><span style="color:red;font-weight: bold;margin: 5px;">*</span><span id="stone_span" style="font-weight: bold;margin: 5px;cursor: pointer;display: none;" onclick="stone_modal()"><i class="fa-solid fa-fire-burner"></i> Details</span>
<select class="form-control err" id="stone_q" name="stone_q" onchange="stone_div(),stone_erase()">
<option value="No"   <?php if($result['has_stone']=="No") echo "selected"; ?>>No</option>
<option value="Yes"  <?php if($result['has_stone']=="Yes") echo "selected"; ?>>Yes</option>
</select>     
</div>
</div>



<div class="col-3">
<div class="form-group">
<label>Has Diamond ?</label><span style="color:red;font-weight: bold;margin: 5px;">*</span><span id="diamond_span" style="font-weight: bold;margin: 5px;cursor: pointer;display: none;" onclick="diamond_modal()"><i class="fa-solid fa-gem"></i> Details</span>
<select class="form-control err" id="diamont_q" name="diamont_q" onchange="diamon_div(),diamond_erase()">
<option value="No"  <?php if($result['has_diamond']=="No") echo "selected"; ?>>No</option>
<option value="Yes" <?php if($result['has_diamond']=="Yes") echo "selected";?>>Yes</option>
</select>     
</div>
</div>



<div class="col-3">
<div class="form-group">
<label>Has Solitaire ?</label><span style="color:red;font-weight: bold;margin: 5px;">*</span><span id="solitaire_span" style="font-weight: bold;margin: 5px;cursor: pointer;display: none;" onclick="solitaire_modal()"><i class="fa-solid fa-gem"></i> Details</span>
<select class="form-control err" id="solitaire_q" name="solitaire_q" onchange="solitaire_div(),solitaire_erase()">
<option value="No"  <?php if($result['has_solitaire']=="No") echo "selected"; ?>>No</option>
<option value="Yes" <?php if($result['has_solitaire']=="Yes") echo "selected";?>>Yes</option>
</select>     
</div>
</div>



<div class="col-3" id="form_select">
<div class="form-group">
<label>Making Charges Type <span style="color:crimson;font-weight:bold;">*</span></label>
<select class="form-control err" id="mk_ch" name="mk_ch" onchange="remove_error()">
<option value="">--- please select---</option>
<option value="Flat" <?php if($result['MakingChargesType']=='Flat') echo "selected"; ?>>Flat</option>
<option value="Percentage" <?php if($result['MakingChargesType']=='Percentage') echo "selected"; ?>>Percentage</option>
</select>
</div>
</div>


<div class="col-3" id="form_select">
<div class="form-group">
<label>Making Charges Value <span style="color:crimson;font-weight:bold;">*</span></label>
<input type="text" name="mk_ch_val" id="mk_ch_val" placeholder=" Enter Making Charges Value " class="form-control err" onkeypress="remove_error()" oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');"  autocomplete="off" value="<?php echo $result['MakingChargesValue'] ?>">
</div>
</div>

<div class="col-3" id="form_select">
<div class="form-group">
<label>Wastage Cost </label>
<input type="text" name="wc" id="wc" placeholder=" Enter Wastage Cost " class="form-control err" onkeypress="remove_error()" oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');"  autocomplete="off" value="<?php echo $result['WastageCost'] ?>">
</div>
</div>





 
</div>

</div>


<div class="row">

<div class="col-12">
<div class="form-group d-flex align-items-center justify-content-end" style="gap:30px;">
<div class="" role="alert" id="con-alrt" style="color: #e85c5c;text-align: center;font-size: 15px;display: none;">* Please provide information in all the required fields</div>
<input type="button" class="btn btn-primary" value="Next"  style="width:100px;background-color:#0979d8;border: none;" onclick="Product_Val()">  
</div>
</div>


</div>


</div>

</div>

<?php } ?>