<?php
session_start();
include('script/condb.php');



$number = isset($_POST['number']) ? $_POST['number'] : 0;
$choose = isset($_POST['currency']) ? $_POST['currency'] : '';

$sel2 ="select * FROM upline_app_materials ";
	$result2 =mysqli_query($con,$sel2);
	while($row2=mysqli_fetch_assoc($result2)){
		
		$convertfrm=$row2['material_uom'];
		$width=$row2['material_width']; 
		$height=$row2['material_height'];
		
			}

switch ($choose)
{
case 'meter':
    $cm      = $number * 100;
    $foot    = $number * 3.2808;
    $inches  = $number * 39.370;
    $Answer  = 'Meters: '.$number.'<br />'.
               'Cm: '.$cm.'<br />'.
               'Foot: '.$foot.'<br />'.
               'Inches: '.$inches;

break;

case 'cm':
    $meter   = $number / 100;
    $foot    = $number * 0.032808;
    $inches  = $number * 0.39370;
    $Answer  = 'Cm: '.$cm.'<br />'.
               'Meters: '.$number.'<br />'.            
               'Foot: '.$foot.'<br />'.
               'Inches: '.$inches;
break;

case 'foot':
    $meter   = $number / 3.2808;
    $cm      = $number / 0.032808; 
    $inches  = $number * 12.000;
    $Answer  = 'Foot: '.$foot.'<br />'.
               'Meters: '.$number.'<br />'.
               'Cm: '.$cm.'<br />'.            
               'Inches: '.$inches;
break;

case 'inches':
    $meter   = $number / 39.370;
    $cm      = $number / 0.39370;
    $foot    = $number / 12.000;
    $Answer  = 'Inches: '.$inches.'<br />'.
               'Foot: '.$foot.'<br />'.
               'Meters: '.$number.'<br />'.
               'Cm: '.$cm;
break;
default:
    $Answer  = '';
break;
}

echo $Answer; 
//include('script/functions.php');










?>