<style>
    
.table td, .table th {
    padding: .35rem;
}
</style>


<?php
include('db_connection.php');
$Mainclass=new DB_Controller();
$Order_Id=$_REQUEST['order'];
//$Country1=$Mainclass->Fetch_Active_datas('bank_master','Bank_Name','','','Bank_Name');
?>
<div class="row" style="margin-top:5px;">
<div class="col-sm-12" style="margin-top:10px;">
<div class="table-responsive">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="73%"  valign="top" ><table width="100%" border="1" cellspacing="0" cellpadding="0">
  <tr>    
    <td class="table_header" width="8%">Code</td>
    <td class="table_header" width="8%">Gold Det</td>
	  <td class="table_header" width="8%">Stone Det</td>
    <td class="table_header" width="8%">Diamond Det</td>
    <td class="table_header" width="8%">Solitaire  Det</td>	
    <td class="table_header" width="8%">Price</td>		
    <td class="table_header" width="8%">Making Charge</td>
    <td class="table_header" width="8%">Disc.</td>   
    <td class="table_header" width="8%">GST(3%)</td> 
    <td class="table_header" width="8%">Total</td>    
    <td class="table_header" width="8%">Action</td>
  </tr>
  <?php
  
  $Details=$Mainclass->Fetch_multiple_data('gold_billing_order_details','*',"Order_No='".$Order_Id."' order by SLN");//check if data exists//
if($Details>0)
{	
$i=1;
	foreach($Details as $det)
{
	$Get_Product=$Mainclass->Fetch_individual_data('gold_product_master',"*","Productid='".$det['Product_Code']."' and Active='Yes'");
	$Get_Order_Master=$Mainclass->Fetch_individual_data('gold_billing_order_master',"*","Order_No='".$Order_Id."'");
	$Get_Quantity=$Mainclass->Fetch_individual_data('gold_billing_order_details','sum(Quantity) as qty',"Order_No='".$Order_Id."' and Product_Code='".$det['Product_Code']."'");
	$Product_Total=$det['Total_Price'];
	
	
	if($det['Product_Discount']>0)
	{
	  $Discount=$det['Product_Discount'];
	  
	}
	else{
	   $Discount=$det['Sale_Discount'];
	}
		$Total_Gold_Value=$det['gold_wt']*$det['gold_rate'];
		$Price_Bf_Making_Charge=$Total_Gold_Value+$det['diamond_price']+$det['stone_price']+$det['solitaire_price'];
		
		$Stone_Value=$det['stone_price'];
  ?>
  <tr>    
    <td class="table_body"><?php echo $det['Product_Code'];?></td>

    <td class="table_body" style="text-align: left !important; padding: 2px;">
		<b>Wt.:</b><?php echo $det['gold_wt']." gms";?><br>
		<b>Rate:</b><?php echo $det['gold_rate'];?> <br>
		<b>CT:</b><?php echo $det['gold_purity'];?><br>
    <b>Value:</b><?php echo $det['Total_Gold_Value'];?> <br>
	  </td>

    <td class="table_body"  style="text-align: left !important; padding: 2px;">
    <b><?php echo $det['StoneName'];?></b><br>
    <b>Qty:</b><?php echo $det['No_Stone'];?><br>
    <b>Rate:</b><?php echo $det['StoneValue'];?> <br>
    <b>Value:</b><?php echo $det['stone_price'];?> <br>
    </td>


	 <td class="table_body"  style="text-align: left !important; padding: 2px;">
    <b>Type:</b><?php echo $det['Diamond_Creation_Type'];?> <br>
    <b>CT.:</b><?php echo $det['Diamond_Carat'];?><br>
    <b>Qty:</b><?php echo $det['No_Diamond'];?><br>
    <b>Rate:</b><?php echo $det['DiamondValue'];?> <br>
    <b>Value:</b><?php echo $det['diamond_price'];?> <br>
	  </td>

    <td class="table_body"  style="text-align: left !important; padding: 2px;">
    <b>Type:</b><?php echo $det['Solitaire_Creation_Type'];?> <br>
    <b>CT.:</b><?php echo $det['sollitaire_Carat'];?><br>
    <b>Qty:</b><?php echo $det['No_Solitaire'];?><br>
    <b>Rate:</b><?php echo $det['Solitaire_Value'];?> <br>
    <b>Value:</b><?php echo $det['solitaire_price'];?> <br>
    </td>

    <td class="table_body"><?php echo number_format($Price_Bf_Making_Charge,2);?></td>
    <td class="table_body"><?php echo $det['total_making_charge'];?> (<?php echo $det['making_charge_type'];?>) </td>
    <td class="table_body"><?php if($det['Product_Discount_Percent']!='0'){echo $det['Product_Discount']."(".$det['Product_Discount_Percent']." %)";} else {echo "0.00";}?></td>
    <td class="table_body"><?php echo number_format($det['GST'],2);?></td>
    <td class="table_body"><?php echo number_format($Product_Total,2);?></td>	 
    
    <td class="table_body">	
    
<i class="fa-solid fa-circle-info" style="font-size:16px; color:#000;cursor: pointer;" onclick="breakup_modal('<?php echo $det['SLN'];?>')"></i> &nbsp
    
<i class="fa-solid fa-trash" style="color:#FF0000; cursor:pointer; font-size:16px;" onclick="delete_product('<?php echo $Order_Id;?>','<?php echo $Get_Quantity;?>','<?php echo $det['Product_Code'];?>')"></i>
     
	</td>
  </tr>
  <?php
  $i++;
  	}
  }
  else
	{
	?>
	<tr><td colspan="9" style="text-align:center; font-size:16px; font-weight:bold; color:#FF0000;">No Products Added.</td></tr>
    <?php
	}
    ?>
</table>
<?php
$Get_Order_Master=$Mainclass->Fetch_individual_data('gold_billing_order_master',"*","Order_No='".$Order_Id."'");
$Get_Order_Details=$Mainclass->Fetch_individual_data('gold_billing_order_details',"*","Order_No='".$Order_Id."'");
$Return=$Get_Order_Master['Return_Adjusted'];
//$Total=$Get_Order_Master['Net_Total'] - $Get_Order_Master['Discount_Amount'] - $Get_Order_Master['Voucher_Discount_Value'] - $Return - $Get_Order_Master['Membership_Discount'];
$Total=$Get_Order_Master['Net_Total'];
$Tot_Af_Return=$Get_Order_Master['Net_Total'] - $Get_Order_Master['Advance_Received'] - $Return+ $Get_Order_Master['Donation'] - $Get_Order_Master['total_dealer_discount'];
$Grand_Total=round($Tot_Af_Return);
$Round=$Grand_Total - $Tot_Af_Return;

$Get_Gst_Sum=$Mainclass->get_sum_field('gold_billing_order_details','GST',"Order_No='".$Order_Id."'");
?>
</td>
    <td width="27%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="73%" class="total_leftdiv">Net Amount : </td>
    <td width="27%" class="total_rightdiv"><?php echo number_format($Get_Order_Master['total_product_price'],2);?></td>
  </tr>
  
<!--   <tr>
    <td width="73%" class="total_leftdiv">Wastage Charge : </td>
    <td width="27%" class="total_rightdiv"><?php echo number_format($Get_Order_Master['total_wastage_price'],2);?></td>
  </tr> -->
  
  <tr>
    <td width="73%" class="total_leftdiv">Making Charge : </td>
    <td width="27%" class="total_rightdiv"><?php echo number_format($Get_Order_Master['total_making_charge'],2);?></td>
  </tr>
  
  <?php  
  
if($Get_Order_Master['Product_Discount']>0 || $Get_Order_Master['Sale_Discount']>0)
	     {
	       $Discount=$Get_Order_Master['Product_Discount']+$Get_Order_Master['Sale_Discount'];
	
	     }
		  else
		 {
			$Discount="0.00"; 
		 }
  
  if($Discount!=0.00)
  {
	  ?>     
  <tr>   
  <td class="total_leftdiv">Disc : </td>    
  <td class="total_rightdiv"><?php echo number_format($Discount,2);?></td>  
  </tr> 
  <?php
  
  }
  ?>      
  <tr>
  
  <?php
  if($Get_Order_Master['Membership_Discount']!=0.00)
  {
	  ?>     
  <!--<tr>   
  <td class="total_leftdiv">M.Disc : </td>    
  <td class="total_rightdiv"><?php echo number_format($Get_Order_Master['Membership_Discount'],2);?></td>  
  </tr>--> 
  <?php
  
  }
  ?> 
  
  
  <?php
  if($Get_Order_Master['Birthday_Discount']!=0.00)
  {
	  ?>     
  <!--<tr>   
  <td class="total_leftdiv">BDay.Disc : </td>    
  <td class="total_rightdiv"><?php echo number_format($Get_Order_Master['Birthday_Discount'],2);?></td>  
  </tr>--> 
  <?php
  
  }
  ?>
  
  
  <?php
  if($Get_Order_Master['Aniversary_Discount']!=0.00)
  {
	  ?>     
  <!--<tr>   
  <td class="total_leftdiv">Anv.Disc : </td>    
  <td class="total_rightdiv"><?php echo number_format($Get_Order_Master['Aniversary_Discount'],2);?></td>  
  </tr>--> 
  <?php
  
  }
  ?>
  
		<?php
  if($Get_Order_Master['Additional_Discount']!=0.00)
  {
	  ?>     
  <!--<tr>   
  <td class="total_leftdiv">Addl.Disc : </td>    
  <td class="total_rightdiv"><?php echo number_format($Get_Order_Master['Additional_Discount'],2);?></td>  
  </tr>--> 
  <?php
  
  }
  ?>
       
  <!--<tr>    
  <td class="total_leftdiv"> D.Disc :<?php if($Get_Order_Master['Dealer_Discount']==0.00){ ?> <a class="various" href="dealer-discount-fancy-new.php?o=<?php echo base64_encode($Order_Id);?>" data-fancybox-type="iframe"><i class="feather icon-plus-circle" style="color:#47a712;"></i></a> <?php } else{ ?><i class="feather icon-x-circle" style=" color:#FF0000; cursor:pointer;" onclick="remove_dealer_discount();"><?php } ?></i>           </td>    
  <td class="total_rightdiv"><?php echo number_format($Get_Order_Master['Dealer_Discount'],2);?></td> 
   </tr>-->   

<tr>

<!--  <td class="total_leftdiv">Dealer Discount : -->

<!--<?php  -->


<!--if($Get_Order_Master['total_dealer_discount']=="0.00"){-->

<!--?>-->

<!--<a class="various1" href="dealer-discount-fancy.php?o=<?php echo base64_encode($Order_Id);?>" data-fancybox  data-type="iframe"  data-width="500"  data-height="500"  ><i class="fa-solid fa-circle-plus" style="color:#47a712;"></i></a>-->

<!--<?php } -->


<!--if($Get_Order_Master['total_dealer_discount']>"0.00"){-->

<!--?>-->

<!--<i class="fa-solid fa-circle-xmark" style="color:red;cursor: pointer;" onclick="cancel_discount('<?php echo $Order_Id;?>')" title="Cancle Discount"></i>-->

<!--<?php-->

<!--}-->


<!--?>-->


<!--  </i></td>-->
  <td class="total_rightdiv"><?php echo number_format($Get_Order_Master['total_dealer_discount'],2);?></td> 
  </tr> 

   <tr>    
   <td class="total_leftdiv">GST : </td> 
   <td class="total_rightdiv"><?php echo number_format($Get_Gst_Sum,2);?></td> 
   </tr>
  
  
  <tr>
    <td class="total_leftdiv">Total : </td>
    <td class="total_rightdiv"><?php echo number_format($Total,2);?></td>
  </tr>      
  <!--<tr>
  <td class="total_leftdiv">Ret. Adjustment :<?php if($Return=='0.00'){ ?> <a class="various" href="return-adjusment-fancy-new.php?o=<?php echo base64_encode($Order_Id);?>&p=<?php echo base64_encode($Get_Order_Master['Customer_Contact']);?>" data-fancybox-type="iframe"><i class="feather icon-plus-circle" style="color:#47a712;"></i></a> <?php } else{ ?><i class="feather icon-x-circle" style=" color:#FF0000; cursor:pointer;" onclick="remove_return();"><?php } ?></i>   </td>    
  <td class="total_rightdiv"><?php echo number_format($Return,2);?></td>
  </tr>-->
  <!--<tr>
  <td class="total_leftdiv">Gift Voucher : <?php if($Get_Order_Master['Voucher_Code']==''){?><a class="various1" href="gift-voucher-fancy-new.php?o=<?php echo base64_encode($Order_Id);?>" data-fancybox-type="iframe"><i class="feather icon-plus-circle" style="color:#47a712;"></i></a><?php } else{?><i class="feather icon-x-circle" style=" color:#FF0000; cursor:pointer;" onclick="remove_voucher();"><?php } ?></i></td>
  <td class="total_rightdiv"><?php echo number_format($Get_Order_Master['Voucher_Discount_Value'],2);?></td> 
  </tr>-->
  
  <?php
  if($Get_Order_Master['Advance_Received']!=0.00)
  {
	  ?>
  <!--<tr>
    <td width="73%" class="total_leftdiv">Adv. : </td>
    <td width="27%" class="total_rightdiv"><?php echo number_format($Get_Order_Master['Advance_Received'],2);?></td>
  </tr>-->
  <?php
  }
  ?>
  
  <tr>
    <td class="total_leftdiv">Round off : </td>
    <td class="total_rightdiv"><?php echo number_format($Round,2);?></td>
  </tr>
		
	<tr>
	<td class="total_leftdiv">Donation : <a class="various1" href="donation-fancy.php?o=<?php echo base64_encode($Order_Id);?>" data-fancybox  data-type="iframe"  data-width="500"  data-height="500"  ><i class="fa-solid fa-circle-plus" style="color:#47a712;"></i></a></i></td>
  <td class="total_rightdiv"><?php echo number_format($Get_Order_Master['Donation'],2);?></td> 
  </tr>
  
  

		
  <tr>
    <td class="total_leftdiv">Grand Total : </td>
    <td class="total_rightdiv"><?php echo number_format($Grand_Total,2);?></td>
    <input type="hidden" id="grand_total" name="grand_total" value="<?php echo $Grand_Total;?>" />
    
  </tr>
</table></td>
  </tr>
  
</table>
</div>
</div>
<!--<div class="form-group row" style="margin-top:15px; width:100%;">
<div class="col-sm-12" style="padding:0px;">
<input name="order_complete" type="BUTTON" class="btn btn-primary m-b-0" value="SUBMIT" style="float:right;" onclick="complete_order()">
</div>
</div>-->
</div>
<div class="row" style="margin-top:5px;">
<div class="card-header" style="padding-top:0px; padding-bottom:10px; float:left; width:100%; padding-left:14px;">
<h5 style="font-size:20px; float:left;"> Payment Options :</h5>
<div class="col-sm-3" style="float:left; margin-left:310px;"><div class="form-group row">
<!--<label class="col-sm-12 col-form-label">Sale Made By</label>-->
<div class="col-sm-12">
<!--<input type="text" class="form-control" name="sale-made" id="sale-made" placeholder="Sale Made By" autocomplete="off" onKeyDown="empty_scan_border()">-->
<select class="form-control" name="sale-made" id="sale-made" onchange="empty_scan_border()">
<option value="">Select Sale Made By </option>
<?php
$con=" Dealer_Code='".$_COOKIE['O_Code']."' and User_Type!='Admin' and Active='Yes' order by Employee_Name";
$Dealers=$Mainclass->Fetch_multiple_data('dealer_login_master','Employee_Name',$con);
foreach($Dealers as $get_dealer)
{
?>
<option value="<?php echo $get_dealer['Employee_Name'];?>"><?php echo $get_dealer['Employee_Name'];?></option>
<?php
}
?>
</select>
</div>
</div></div>
</div>
<div class="col-sm-12" style="margin-top:10px;">
<div class="row" style="padding-left:15px; padding-right:15px;">
<div class="col-sm-4" style="padding-left:0px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="table_header">CASH</td>
  </tr>
  <tr>
    <td class="table_body"  valign="top"><div class="col-sm-12"><div class="form-group row">
<!--<label class="col-sm-12 col-form-label" style="text-align:left;">Amount</label>-->
<div class="col-sm-12">
<input type="text" class="form-control" name="cash_amount" id="cash_amount" placeholder="Enter Amount" autocomplete="off" value="" onKeyPress="return isNumberKey(event)" style="margin-top:5px; margin-bottom:5px;" onkeyup="check_amount()">
</div>
</div></div></td>
  </tr>
  <tr>
  <td class="table_header">OTHER PAYMENT MODE <span style="font-size:11px;">(PAYTM, GOOGLE PAY ETC)</span></td>
  </tr>
  <tr>
    <td class="table_body"  valign="top"><div class="col-sm-12"><div class="form-group row">
<div class="col-sm-12">
<input class="form-control" list="browsers" name="Other_Payment_Name" id="Other_Payment_Name" autocomplete="Item_Name" placeholder="Payment Mode 1" onblur="Other_Pay()" style="margin-top:5px; margin-bottom:5px; width:50%; float:left;">
<datalist id="browsers">
<?php
$Country=$Mainclass->Fetch_multiple_data("other_payment_master","distinct(Pay_Name) as pname","Active='Yes' order by Pay_Name");
foreach($Country as $get_country)
{
?>
<option value="<?php echo $get_country['pname'];?>"></option>
<?php
}
?>
</datalist>
<input type="text" class="form-control" name="other_amount" id="other_amount" placeholder="Enter Amount" autocomplete="off" value="" onKeyPress="return isNumberKey(event)" style="margin-bottom:5px; width:45%; float:left; margin-left:5%; margin-top:5px;" onkeyup="check_amount()" onblur="Other_Pay()" onKeyDown="empty_scan_border()">
</div>
</div></div></td>
  </tr>
  
  <tr>
    <td class="table_body"  valign="top"><div class="col-sm-12"><div class="form-group row">
<div class="col-sm-12">
<input class="form-control" list="browsers" name="Other_Payment_Name1" id="Other_Payment_Name1" autocomplete="Item_Name" placeholder="Payment Mode 2" onblur="Other_Pay()" style="margin-top:5px; margin-bottom:48px; width:50%; float:left;">
<datalist id="browsers">
<?php
$Country=$Mainclass->Fetch_multiple_data("other_payment_master","distinct(Pay_Name) as pname","Active='Yes' order by Pay_Name");
foreach($Country as $get_country)
{
?>
<option value="<?php echo $get_country['pname'];?>"></option>
<?php
}
?>
</datalist>
<input type="text" class="form-control" name="other_amount1" id="other_amount1" placeholder="Enter Amount" autocomplete="off" value="" onKeyPress="return isNumberKey(event)" style="margin-bottom:20px; width:45%; float:left; margin-left:5%; margin-top:5px;" onkeyup="check_amount()" onblur="Other_Pay()" onKeyDown="empty_scan_border()">
</div>
</div></div></td>
  </tr>
  
</table>
</div>
<div class="col-sm-5" style="padding-left:0px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="table_header">CREDIT CARD / DEBIT CARD</td>
  </tr>
  <tr>
    <td class="table_body"><div class="col-sm-12"><div class="form-group row">
<div class="col-sm-12">
<input class="form-control" list="browsers1" name="bank_name" id="bank_name" autocomplete="Item_Name" placeholder="Enter Bank Name "  style="margin-top:5px; margin-bottom:5px; width:50%; float:left;">
<datalist id="browsers1">
<?php
$Country1=$Mainclass->Fetch_multiple_data("bank_master","distinct(Bank_Name) as bname","Active='Yes' order by Bank_Name");
foreach($Country1 as $get_country1)
{
?>
<option value="<?php echo $get_country1['bname'];?>"></option>
<?php
}
?>
</datalist>
<input type="text" class="form-control" name="bank_details" id="bank_details" placeholder="Last 4 Digit of Card" autocomplete="off" value="" style="margin-bottom:5px; width:45%; float:left; margin-left:5%; margin-top:5px;" maxlength="4" onKeyPress="return isNumberKey(event)" onKeyDown="empty_scan_border()">
</div>
</div></div></td>
  </tr>
  
  <tr>
    <td class="table_body"><div class="col-sm-12"><div class="form-group row">
<div class="col-sm-12"> 
<input class="form-control" list="browsers2" name="pos_name" id="pos_name" autocomplete="Item_Name" placeholder="POS Name "  style="margin-bottom:5px; width:50%;  float:left;">
<datalist id="browsers2">
<?php
$Country2=$Mainclass->Fetch_multiple_data('pos_name_master','distinct(Pos_Name) as pos',"Active='Yes' order by Pos_Name");
foreach($Country2 as $get_country2)
{
?>
<option value="<?php echo $get_country2['pos'];?>"></option>
<?php
}
?>
</datalist>
<input type="text" class="form-control" name="bank_amount" id="bank_amount" placeholder="Enter Amount" autocomplete="off" value=""  onKeyPress="return isNumberKey(event)" style="width:45%; margin-left:5%; float:left;" onkeyup="check_amount()" onKeyDown="empty_scan_border()">
</div>
</div></div></td>
  </tr>
  
  <tr>
    <td class="table_header"> GIFT CARD</td>
  </tr>
  <?php
 //$GiftCard=$Mainclass->Giftcard_List($Order_Id);
?>
   <tr>
    <td class="table_body"><div class="col-sm-12"><div class="form-group row">
<div class="col-sm-12">
<select class="form-control" name="giftcard" id="giftcard" style="float:left; width:50%; margin-top:5px; margin-bottom:53px;" onchange="get_giftcard_value(this.value)">
<option value="">Please Select</option>
<?php
/*foreach($GiftCard as $Giftcard_List)
{*/
?>
<option value="<?php //echo $Giftcard_List['Coupon_Code'];?>"><?php //echo $Giftcard_List['Coupon_Code'];?></option>
<?php
//}
?>
</select>
<input type="text" class="form-control" name="gift_amount" id="gift_amount" placeholder="Amount to be used" autocomplete="off" value="" style="margin-bottom:5px; width:45%; float:left; margin-left:5%; margin-top:5px; margin-bottom:53px;" maxlength="4" onKeyPress="return isNumberKey(event)" onkeyup="check_amount()" >
</div>
</div></div> </td>
  </tr>
</table>
</div>
<div class="col-sm-3"  style="padding-left:0px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  
  <tr>
    <td class="table_body" style="padding-top:23px;"><div class="col-sm-12"><div class="form-group row">
<!--<label class="col-sm-12 col-form-label" style="text-align:left;">Amount Paid </label>-->
<div class="col-sm-12">
<input type="text" class="form-control" name="amount_paid" id="amount_paid" placeholder="Amount Paid" autocomplete="off" value=""  onKeyPress="return isNumberKey(event)" readonly>
</div>
</div></div></td>
  </tr>
  
  <tr>
    <td class="table_body"  valign="top"><div class="col-sm-12"><div class="form-group row">
<!--<label class="col-sm-12 col-form-label" style="text-align:left;">Due Amount</label>-->
<div class="col-sm-12">
<input type="text" class="form-control" name="due_amount" id="due_amount" placeholder="Due Amount" autocomplete="off" value=""  onKeyPress="return isNumberKey(event)" readonly>
</div>
</div></div></td>
  </tr>
  <tr>
    <td class="table_body"  valign="top"><div class="col-sm-12"><div class="form-group row">
<!--<label class="col-sm-12 col-form-label" style="text-align:left;">Due Amount</label>-->
<div class="col-sm-12">
<input type="text" class="form-control" name="return_amount" id="return_amount" placeholder="Amount to be Returned" autocomplete="off" value=""  onKeyPress="return isNumberKey(event)" style="font-weight:bold;" readonly>
</div>
</div></div></td>
  </tr>
  
  <tr>
    <td class="table_body" valign="top"><div class="col-sm-12"><div class="form-group row">
<div class="col-sm-12">
<!--<a class="various3" href="invoice.php" data-fancybox-type="iframe"><input name="saveandsubmit" type="BUTTON" class="btn btn-primary m-b-0" value="COMPLETE" style="float:left; padding: 2px 14px; font-size:13px; width:100%; margin-top:10px; margin-bottom:5px;" onclick="complete_order()"></a>-->
<input name="saveandsubmit" type="BUTTON" class="btn btn-success waves-effect waves-light" value="COMPLETE" style="float:left; padding: 2px 14px; font-size:13px; width:100%; margin-top:10px; margin-bottom:5px;" id="complete_original"  onclick="complete_order()">
<input name="saveandsubmit" type="BUTTON" class="btn waves-effect waves-light" value="COMPLETE" style="float:left; padding: 2px 14px; font-size:13px; width:100%; margin-top:10px; margin-bottom:5px; display:none;" id="complete_disabled">
<input name="pause" type="BUTTON" class="btn waves-effect waves-light btn-warning btn-square" value="PAUSE" style="float:left; padding: 2px 14px; font-size:13px; width:100%; margin-bottom:5px;" onclick="pause_order()">
<input name="cancel" type="BUTTON" class="btn waves-effect waves-light btn-danger btn-square" value="CANCEL" style="float:left; padding: 2px 14px; font-size:13px; width:100%; margin-bottom:5px;" onclick="cancel_order()">
</div>
</div></div></td>
  </tr>
</table>
</div>
</div>
</div>
</div>





<!-- Modal -->
<div class="modal fade bd-example-modal-lg" id="informationModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">GOLD PRICE BREAKUP</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body bg-white" >
        <p class="text-primary "></p>
        
        <div id="breakup_data"></div>

        
      </div>
   
    </div>
  </div>
</div>




<script type="text/javascript">
  

function breakup_modal(per){

$('#informationModal').modal('show');
  

$.ajax({
url:'breakup_modal.php',
type:'POST',
data:{per:per},
success:function(f){

$('#breakup_data').html(f);

}
});


}


function cancel_discount(per){


var order = per;


var making_charge_percent = "0";
var stone_percent = "0";
var diamond_percent = "0";
var solitaire_percent = "0";


$('#vou_err').html('');


$.ajax({
url:'ajax-dealer-discount.php',
type:'POST',
data:{making_charge_percent:making_charge_percent,stone_percent:stone_percent,diamond_percent:diamond_percent,solitaire_percent:solitaire_percent,order:order},
success:function(f){


$.ajax({
url:'ajax_get_gold_discounts.php',
type:'POST',
data:{Order:order},
success:function(f){

window.parent.location.href='billing.php?o='+btoa(order);


}
});



}
});







}

</script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css"/>
<script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.umd.js"></script>