<?php 

	//include '../includes/db.php' 

	if($action == 'project')
	{
		/*$pname =$_POST['pname'];
		$location =$_POST['location'];
		$cost =$_POST['cost'];
		$deadline =$_POST['deadline'];
		$sdate =$_POST['sdate'];
		$tid =$_POST['tid'];
		$p_type =$_POST['p_type'];
		$file = "no_image.jpg";
		
		$query = mysqli_query($conn,"INSERT INTO projects (project,location,overall_cost,start_date,deadline,site_pic,tid,date_added,io,proposed_project)
		VALUES('$pname','$location','$cost','$sdate','$deadline','$file','$tid',now(),'1','$p_type')");
		$last_id = mysqli_insert_id($conn);
		
		if(isset($_POST['divs']))
		{

			$divs= $_POST['divs'];
			$cd = count($divs);
			for($i=0; $i < $cd; $i++)
			{
				$query2 = mysqli_query($conn,"INSERT INTO project_partition (project_id,pd_id)
				VALUES('$last_id','$divs[$i]')");
			}
		}
	
		if($query && $query2)
		{
			echo '<script>$("#suc_msg2").show("slidedown");
			var delay = 1500;
                    setTimeout(function(){  window.location = "index.php?page=project_detail&id='. $last_id.'&dattyp=new";   }, delay);
			</script>';
		}
		else
		{
			echo $query;
		}	*/
		
		$myfile = fopen("check_newfile.txt", "w") or die("Unable to open file!");
$txt = "xxxxxxxxxxxxxxxxxxxxxxxJohn Doe\n";
fwrite($myfile, $txt);
$txt = "Jane Doe\n";
fwrite($myfile, $txt);
fclose($myfile);

		
		echo '<script>$("#suc_msg2").show("slidedown");
			var delay = 1500;
                    setTimeout(function(){  window.location = "index.php?page=project_detail&id='. $last_id.'&dattyp=new";   }, delay);
			</script>';
		
	}

?>