<?php
session_name('CAKEPHP'); session_start();
$PageSecurity = 11;
//echo $_SERVER['QUERY_STRING'];exit;
include('includes/SQL_CommonFunctions.inc');
include('includes/function_lib.php');
include('includes/Class_www_users.php');
include('includes/Class_Emp.php');
include('includes/session.inc');
$q=$_SESSION['ACGCompanyId'];
date_default_timezone_set ("Asia/Kolkata");


$sql=DB_query("insert into tsk_taskassignment_remarks (task_id,remarks,remarks_by,remarks_date,remarks_time) value ('".$_REQUEST['task_id']."','".$_REQUEST['remark']."','".$_SESSION['UserID']."','".date('Y-m-d')."','".date('H:i:s')."')",$db);
$remark_count=DB_query("select * from tsk_taskassignment_remarks where task_id='".$_REQUEST['task_id']."' ",$db);
//echo "select * from tsk_taskassignment_remarks where task_id='".$_REQUEST['task_id']."' ";
//echo DB_num_rows($remark_count);

        if(DB_num_rows($remark_count)==1)
        {
            $close_task=DB_query("Update tsk_taskassignment set status='progress' where id='".$_REQUEST['task_id']."'",$db);
        }

//$lastid=DB_Last_Insert_ID($db,'tsk_taskassignment_remarks','id');
$query= "select * from tsk_taskassignment_remarks where task_id='".$_REQUEST['task_id']."' ";
$data='';
$result = DB_query($query,$db);
//build html format as you need it..
while($remarks_row = DB_fetch_assoc($result)){
$username=$s->getField('www_users','id',$remarks_row['remarks_by'],'realname');
 $data.='<tr class="row1"><td class="tabledata1">
		   <textarea name="" readonly style="width:100%; height:50px;">'.$remarks_row['remarks'].'</textarea>
		   <br />
		   <strong>
		   By'.$username.' - '.ConvertSQLDate($remarks_row['remarks_date']).' at '.$remarks_row['remarks_time'].'</strong>
		   </td> </tr> <tr height="5px"><td>&nbsp;</td></tr>';
}
echo $data;
?>

            
		
		
		
	 
		
		


  
	

            
		
		
		
	 
		
		


  
	