<?php   
    require "commonincludefiles.php";
	
	$objProjectMgmt = new ProjectMgmt();
	
	     
	if ($_SESSION['cCompany_id']!="" && isset($_SESSION['cCompany_id'])) {
	
		$objProjectMgmt->project_id 	=	$_REQUEST["project_id"];
		$objProjectMgmt->project_name 	=	$_REQUEST['project_name'];	
				
		if($_REQUEST["project_id"] > 0 && isset($_REQUEST["project_id"])){
			if($_REQUEST["mode"] =="delete"){
				$objProjectMgmt -> delete();
				
			} else{
				$objProjectMgmt -> edit();
			}
			echo '{"success":"true","msg":""}';
		} else{	
			$objProjectMgmt->add();
			if(	$objProjectMgmt->project_id	>0) {
				echo '{"success":"true","msg":""}';			
			} else{
				echo '{"success":"false","msg":""}';	
			}
		}
   	} else {
		echo '{"success":"false","msg":"session expiry"}';
	}	
 ?>