0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.143.239.63


Current Path : /var/www/oasis/src_old/
Upload File :
Current File : /var/www/oasis/src_old/message_board.php

<?php
function GetCollegeCodeDetails($aobj_context)
 { 
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
	$system_date=date("d/m/Y");	
    $get_details="select FCOLLCODE as internal_code,FCOLLCODE as College_code from college ";
             //echo $get_details; die();
			$lobj_details = $aobj_context->mobj_db->getAll($get_details); 
			$arr['col']=$lobj_details;						
			$arr['today_date']=$system_date;						
		 if( $lobj_details)
		 echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
 }
 
 function SaveMessageBoard( $aobj_context)
 {
	 $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
	 $internal_code=$aobj_context->mobj_data["internal_code"];	 
	 $message_board_from_date=$aobj_context->mobj_data["message_board_from_date"];
	 $message_board_to_date=$aobj_context->mobj_data["message_board_to_date"];
	 $message_board_college_code=$aobj_context->mobj_data["message_board_college_code"];
	 //echo $message_board_college_code;
	 $message_board_message=addslashes($aobj_context->mobj_data["message_board_message"]);
 
		if($internal_code==0)
		{			
		
				  $insert_qry="insert into message_board
										  (										
										   college_code,
										   display_from,
										   display_to,
										   message
										   )					   
										   values (										   
										   '{$message_board_college_code}',
										   '{$message_board_from_date}',
										   '{$message_board_to_date}',										   
										   \"{$message_board_message}\"										   
											)";	
			//echo $insert_qry;  die();	
			var_dump( $insert_qry);						
				$lobj_rs = $aobj_context->mobj_db->Execute($insert_qry);  	 							
				if($lobj_rs)
				    {
				        $rdata = "Inserted Successfully.";
				        print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"));
				        return $rdata;
				     }
				    else
				    {
				        $rdata = "Insertion Failed.";
				        print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));  
						return $rdata;			
                	}
					
	    }
		
        else
		{ 
			 $update_qry = "update message_board
							set							
							college_code='{$message_board_college_code}',
							display_from='{$message_board_from_date}',
							display_to='{$message_board_to_date}',
							message='{$message_board_message}'
							where internal_code ={$internal_code}";
	//echo $update_qry; die();				
			$lobj_rs = $aobj_context->mobj_db->Execute($update_qry);
			
					if($lobj_rs)
					{
						$rdata = "Updated  Successfully.";
						print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"));
						return;
					 }
					else
					{
						$rdata = "Updation Failed.";
						print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));      
					 }
			
		}
		
	
 }
 
function ViewMessageBoard($aobj_context)
{	
	session_start();
	$college_Code = $_SESSION['collcode'];	
	$usr_type = $_SESSION['user_type'];	
	//echo $usr_type; die();
	$degree_code = ($aobj_context->mobj_data["DegCode"]);
	$exam_no = ($aobj_context->mobj_data["Examno"]);
	$cond='';
    if($usr_type=='Admin' || $usr_type=='User')	
	{
	  $cond=" and college_code={$college_Code}"; 
	} 
	
	include_once($aobj_context->main_src.'/src/display_details_in_grid_custom.php');
		$display_obj=new display_details_in_grid($aobj_context);
		$display_obj->table_cols=array('grid_from_date','grid_to_date','grid_college_code','grid_message');
		 $display_obj->display_qry ="select internal_code as id, college_code, display_from, display_to, message
                            		 from message_board where 1=1 {$cond}";					
	//echo $display_obj->display_qry; die();							 
		$display_obj->DisplayDetailsInGrid();	 
}

 
function getMessageBoardDetails($aobj_context)
{
$internal_code = $aobj_context->mobj_data["internal_code"];	 
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$lstr_qry = "select internal_code,
						college_code,
						DATE_FORMAT(display_from,'%d/%m/%Y') as display_from,  
					    DATE_FORMAT(display_to,'%d/%m/%Y') as display_to ,	
						message
						from message_board
						where internal_code ={$internal_code}"; 
	//echo 	$lstr_qry ;die();				
   $lobj_qry= $aobj_context->mobj_db->GetRow($lstr_qry); 
   
 	if(count($lobj_qry) > 0)
      print_r($aobj_context->mobj_output->ToJSONEnvelope($lobj_qry,0,"success")); 
    else
      print_r($aobj_context->mobj_output->ToJSONEnvelope($lobj_qry,-1,"Failure"));
    return;  
}

function DeleteMessageBoard($aobj_context)
{
 $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
 $lstr_ids = $aobj_context->mobj_data["id"];	 
 	    $lstr_qry = "delete  
			from message_board 
			 where internal_code in (".$lstr_ids.")"; 
	//	echo $lstr_qry 
 $lobj_rs = $aobj_context->mobj_db->Execute($lstr_qry);
}
 
 ?>