<?php
include("../../db.php");
header("Access-Control-Allow-Origin: * ");

	$teacher_id=$_REQUEST['teacher_id'];
	$student_id=$_REQUEST['student_id'];
	$session=$_REQUEST['session'];
	$school_id=$_REQUEST['school_id'];
	$detail=$_REQUEST['detail'];
	$idno=mysql_real_escape_string($idno);
	$session=mysql_real_escape_string($session);
	$school_id=mysql_real_escape_string($school_id);
	$detail=mysql_real_escape_string($detail);
 
        // $class=$db->getVal("Select class FROM student where idno='".$idno."'");
 
	$msg="";

	if($detail==""){
		
		$msg="Please enter Details ";
	 }
 	else{
	 
	 $aryData=array(
		 "detail"=>$detail,
		 "teacher_id"=>$teacher_id,
		 "student_id"=>$student_id,
		 "school_id"=>$school_id,
		 "send_by"=>2,
		 "session"=>$session
	 );
 
  		$insert_complain=$db->insertAry("teacher_complain",$aryData);
	}
	

  if($insert_complain>0){ $msg="Complain registered successfully.!";
  
  
 
  }
	
	
	if($msg!="")
	{  
		echo json_encode(array('status' => 1, 'msg'=>'Done', "data"=>$msg));    
			
	}
	else
	{		
	 	echo json_encode(array('status' => 0, 'msg'=>'Complain not registerd. Please try again later..!'));
	}
