<? 
 if($_SESSION['page'] == '4' and $_SESSION['section'] == '2') 
 	{ 
		if ($_GET['stat'] == 'changestatdb' )
		   {
						$status_id				=$_POST['status_id'];
						$id						= $_SESSION['4_1_case_id'];
				  mysql_query("update ".$dcm_table_start."case set status_id = ".$status_id." where case_id = '$id'");	
				header("Location: index.php"); 
			}
		if ($_GET['stat'] == 'savecall') { 
			
					//$note				= $_POST[''];
					//$reminder
					$call_type			= $_POST['call_type'];
					$call_result_id		= $_POST['call_result_id'];
					$call_date			= $_POST['call_date'];
					$call_time			= $_POST['call_time'];
					$note 				= $_POST['note'];
					$reminder_type 		= $_POST['reminder_type'];
					$reminder			=	$_POST['reminder'];
					$case_id			= $_SESSION['4_1_case_id'];
					$telephone			= $_POST['telephone'];
					if ($_POST['reminder_date'] <> "" ) {
						$reminder_date		= $_POST['reminder_date'];
					}
					if ($_POST['reminder_time'] <> "" ) {
						$reminder_time		= $_POST['reminder_time'];
					}
					$uid = $_SESSION['Login_user_id'];
				if ($reminder == 1 ) 	
				 {
				 	 mysql_query("INSERT INTO ".$dcm_table_start."call (call_type,telephone,case_id,call_result_id,call_date,call_time,note,reminder_type,reminder,reminder_date,reminder_time,uid ) VALUES ($call_type,'$telephone',$case_id,$call_result_id,'$call_date','$call_time','$note',$reminder_type,$reminder,'$reminder_date','$reminder_time',$uid) ");
				 }else{
				 	 mysql_query("INSERT INTO ".$dcm_table_start."call (call_type,telephone,case_id,call_result_id,call_date,call_time,note,reminder,uid ) VALUES ($call_type,'$telephone',$case_id,$call_result_id,'$call_date','$call_time','$note',$reminder,$uid) ");
				 }
				header("Location: index.php"); 
			
			}
			
			
			if ($_GET['stat'] == 'savepayment') { 
					$case_id			= $_SESSION['4_1_case_id'];
					$payment_date		= $_POST['payment_date'];
					$payment_time		= date("H").':'.date("i");
					$payment_where		= $_POST['payment_where'];
					$receipt			= $_POST['receipt'];
					$invoice 			= $_POST['invoice'];
					$amount 			= $_POST['amount'];
					$note		   		= $_POST['note'];
					$uid 				= $_SESSION['Login_user_id'];
					$payment_type 		= $_POST['payment_type'];
				
				 	 mysql_query("INSERT INTO ".$dcm_table_start."call_payment (case_id,payment_date,payment_time,payment_where,receipt,invoice,amount,note,uid,payment_type ) VALUES ($case_id,'$payment_date','$payment_time',$payment_where,'$receipt','$invoice',$amount,'$note',$uid,$payment_type) ");
				 
				header("Location: index.php"); 
			
			}
			
			
	}
?>