<div id="pricebox"><h4>Total Payment:</h4>

	
		<?php 
		include("../db_con.php");
		//var_dump($_POST);
		$totalfee=0;
		$settingfee=0;
		
		//$srs=@mysqli_query($con,"select * from setting_table");
		//$srow=mysqli_fetch_array($srs);
		//$servicefee=$srow["value"];

		if(isset($_POST["ages"])){

			/*$sql = "SELECT * FROM `setting_table` order by s_id";
			$sresult = mysqli_query($con,$sql);
			while($srow = mysqli_fetch_array($sresult)){

				echo "<br/><b>".$srow["setting_name"]." : </b>".$srow["value"]."/- BDT ";
				$settingfee=$settingfee+$srow["value"];	
			}*/

			for($i=0; $i<count($_POST["ages"]); $i++){
				
				$bdate=$_POST["ages"][$i];
				$settingfee=0;

				$vfrs=@mysqli_query($con,"SELECT * FROM `visatype_table` WHERE visatype_id='$bdate'");
				$vfrow=mysqli_fetch_array($vfrs);
				
				//echo "<b> Service Charge:</b> ".$servicefee." BDT<br/>";
				echo "<br/><b> ".$vfrow["visatype_name"]." Fee : </b> ".$vfrow["visatype_fee"]."/- BDT<br/>";

				$sql = "SELECT * FROM `setting_table` order by s_id";				
				$sresult = mysqli_query($con,$sql);
				while($srow = mysqli_fetch_array($sresult)){

					if($vfrow["visatype_fee"]==0){
					    $srow["value"]=0;
					}
					echo "<b>".$srow["setting_name"]." : </b>".$srow["value"]."/- BDT <br/>";
					$settingfee=$settingfee+$srow["value"];	
				}

				$totalfee=$totalfee+$settingfee+$vfrow["visatype_fee"];
				
			}
		}


		if(isset($_POST["name"])){

			for($i=0; $i<count($_POST["qty"]); $i++){

				$dtype=substr($_POST["name"][$i], 0, strpos($_POST["name"][$i], "_"));
				$qty=$_POST["qty"][$i];
				
				$feers=@mysqli_query($con,"select * from vas_table where vas_id='$dtype'");
				$feerow=mysqli_fetch_array($feers);
				echo "<b>".$feerow["vas_name"]." (Qty: ".$qty.") :</b> ".$feerow["vas_fee"]*$qty." BDT<br/>";
				$totalfee=$totalfee+$feerow["vas_fee"]*$qty;
			}
				//$totalfee=$totalfee+$servicefee;
				
		}

				echo "--------------------------------------------------<br/>
		<b>Total :</b> ".number_format($totalfee,2)."/- BDT</b>";

		
		?>
		
		



	</ul>
	<input type="hidden" name="total" value="<?php echo $totalfee; ?>">

</div>