<?php  ob_start(); session_start(); 
include 'xyz.php';
$results=get_user();



//Change Course
if(isset($_POST['selected_course'])){echo  get_course_price(collect('selected_course'));}




if(isset($_POST['item_selected'])){echo  getCost(collect('item_selected'));}

if(isset($_POST['item_id'])){
	QueryDB("UPDATE courses set crs_title ='".collect('val_enteered')."' where id='".collect('item_id')."' ");
}



//update Course or Add New One
if(isset($_POST['where'])){
	if(is_numeric($_POST['where'])){
		$pr = getCost($_POST['where']);
		$time = get_duration($_POST['where']);
		$name = get_course_name($_POST['where']);
		$desc =get_desc($_POST['where']);
		$regCost =crs_Reg($_POST['where']);
		$crsSort =sort_code($_POST['where']);
		$crsCert =sort_Cert($_POST['where']);

		


	}

	echo $pr.'-'.$time.'-'.$name.'-'.$desc.'-'.$regCost.'-'.$crsSort.'-'.$crsCert;
}




?>
 <?php
if(isset($_POST['stateIdN'])){
    foreach(QueryDB("SELECT * FROM states WHERE country_id ='".$_POST['stateIdN']."' ")as $st){?>
        <option value="<?php  echo $st['name']; ?>" id="<?php echo $st['name']; ?>"><?php  echo $st['name']; ?></option>
<?php  } }

if(isset($_POST['storedID'])){ //echo tabRes($_SESSION['destination']);
	echo $linkr->getProductCost($_POST['storedID'],'item_cost');
// myprice
}

// if(isset($_POST['storedID'])){ //echo tabRes($_SESSION['destination']);
// 	echo $linkr->getProductCost($_POST['storedID'],tabRest($_POST['myprice']));
// // myprice
// }

if(isset($_POST['sel_customer'])){
$getIt = QueryDB("SELECT * FROM customers where id='".$_POST['sel_customer']."' ");
$rows = $getIt->fetch(PDO::FETCH_ASSOC);
echo $rows['frm_name'].'-'.$rows['frm_phone'].'-'.$rows['gender'].'-'.$rows['frm_email'].'-'.$rows['cus_type'].'-'.$rows['address'].','.$rows['state'].','.$rows['country'];

}

?>