<?php  

require_once("../lib/db_functions.php");
//header('Content-type: application/json');
$response = array();  
$preparation_date=date('Y-m-d');

$section          = $obj->data_filter($_POST['section']);
$company          = $obj->data_filter($_POST['company']); 
 $maker           = $obj->data_filter($_POST['maker']); 
$checker          = $obj->data_filter($_POST['checker']);


    	$section_arr = $obj_dba_func->set_proceed($section,$company,$maker,$checker,$preparation_date);
    //print_r($section_arr);
	     if($section_arr['n'] == 1)
		{
            
			 // $_SESSION['company_detail_id'] = $section_arr['id'];

			$cookie_name="company_detail_id";  
			$cookie_value=$section_arr['id'];
            // $_SESSION['company_detail_id'] = $section_arr['id'];
			 setcookie($cookie_name, $cookie_value, time() + (60 * 60), "/");
             // setcookie($cookie_name, $cookie_value, 1);

            // $_SESSION["company_detail_id"] = $section_arr['id'];
            
			$response['n']   = 1;
			$response['msg'] ="proceed success";
			$response['section_id']=$section;
		}
		else
		{
			$response['n']   = 0;
			$response['msg'] = " proceed insert error";
		}

echo json_encode($response);
?>