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.16.212.203


Current Path : /var/www/html/collportal/custom_src/
Upload File :
Current File : //var/www/html/collportal/custom_src/saveAbstractForm.php

<?php
	function saveAbstractForm($aobj_context){
		
		$data = json_decode($aobj_context->mobj_data['data'], true);
	
		$id=$aobj_context->mobj_data['id'];
		
		$cnd  = ($data['gender'] == "Select")   ? "" : $data['gender'];
		$cnd1 = ($data['category'] == "Select") ? "" : $data['category'];
		$cnd2 = ($data['hkcand'] == "Select")   ? "" : $data['hkcand'];
	
			// if($data['type'] =='update'){
			// 	$qry="UPDATE abstract 
			// 			SET fname='{$data['name']}',fmobile='{$data['mobile']}',fmail='{$data['email']}',faddr='{$data['area']}',
			// 			fdob='{$data['dates']}',fgender='{$cnd}',fcategory='{$cnd1}',fhkcand='{$cnd2}',fsslcmar='{$data['sslc']}',fsslcyear='{$data['yearsslc']}',fsslcuniv='{$data['univsslc']}',
			// 			fdegmar='{$data['degreem']}',fdegyear='{$data['yeardegreem']}',fdeguniv='{$data['univdegreem']}',fmastermar='{$data['masterm']}',fmasteryear='{$data['yearmasterm']}',
			// 			fmasteruniv='{$data['univdyearmasterm']}',
			// 			fnetmar='{$data['netmarks']}',fnetyear='{$data['yearnetmarks']}',fnetuniv='{$data['univnetmarks']}',fsetmar='{$data['sletmarks']}',
			// 			fsetyear='{$data['sletyear']}',fsetuniv='{$data['sletuniv']}',
			// 			fmphilmar='{$data['phils']}',fmphilyear='{$data['philsyear']}',fmphiluniv='{$data['philsuniv']}',fphdmar='{$data['phdmarks']}',fphdyear='{$data['phdyear']}',
			// 			fphduniv='{$data['phduniv']}',fug='{$data['ug']}',
			// 			fpg='{$data['pg']}',freseachExp='{$data['expres']}',finternational='{$data['internat']}',fnational='{$data['nation']}',fother='{$data['other']}',
			// 			fseminarno='{$data['seminar']}',fguidphdno='{$data['successcand']}',fsource='{$data['project']}',fcost='{$data['cost']}',fabroad='{$data['abroad']}',faward='{$data['awards']}',
			// 			fkannada='{$data['kannada']}',fremarks='{$data['kannada']}'
			// 			where fid='{$id}'";
						
			// 	$result = $aobj_context->mobj_db->Execute($qry);
				
			// }else{

			
                 $qry="INSERT INTO abs_personal(fappno ,fname,faddr ,fmobile,fmail,
						fdob ,fgender,fcaste,fhkcand ,fseminar ,fsucesscand ,fpsource ,
						fpcost ,fkannada ,fremarks)values('{$data['app']}','{$data['name']}','{$data['area']}','{$data['mobile']}','{$data['email']}',
						'{$data['dates']}','{$cnd}','{$cnd1}','{$cnd2}','{$data['seminar']}','{$data['successcand']}','{$data['project']}','{$data['cost']}',
						'{$data['kannada']}','{$data['remarks']}')";

             $query="INSERT INTO abs_educate(fsslcmark ,fsslcyear ,fsslcuniv,
		                         fdegmark ,fdegyear ,fdeguniv ,
		                         fmasmark ,fmasyear ,fmasuniv ,
		                         fnetmark ,fnetyear ,fnetuniv ,fnetpnt ,
		                         fsetmark ,fsetyear ,fsetuniv ,fsetpnt ,
		                         fmphilmark ,fmphilyear , fmphiluniv ,fmphilpnt ,
		                         fphdmark ,fphdyear ,fphduniv ,fphdpnt )
								 values('{$data['sslc']}','{$data['yearsslc']}','{$data['univsslc']}',
								 '{$data['degreem']}','{$data['yeardegreem']}','{$data['univdegreem']}',
								 '{$data['masterm']}','{$data['yearmasterm']}','{$data['univdyearmasterm']}',
								 '{$data['netmarks']}','{$data['yearnetmarks']}','{$data['univnetmarks']}','{$data['netremarks']}'
								 '{$data['sletmarks']}','{$data['sletyear']}','{$data['sletuniv']}','{$data['sletremarks']}'
								 '{$data['phils']}','{$data['philsyear']}','{$data['philsuniv']}','{$data['philsmarks']}'
								 '{$data['phdmarks']}','{$data['phdyear']}','{$data['phduniv']}','{$data['phdremarks']}')";
					var_dump($query);die();		

				// $qry="INSERT INTO abstract(fid,fname,fmobile,fmail,faddr,
				// 	fdob,fgender,fcategory,fhkcand,fsslcmar,fsslcyear,fsslcuniv,
				// 	fdegmar,fdegyear,fdeguniv,fmastermar,fmasteryear,fmasteruniv,fnetmar,fnetyear,fnetuniv,fsetmar,fsetyear,fsetuniv,
				// 	fmphilmar,fmphilyear,fmphiluniv,fphdmar,fphdyear,fphduniv,fug,fpg,freseachExp,finternational,fnational,fother,
				// 	fseminarno,fguidphdno,fsource,fcost,fabroad,faward,fkannada,fremarks)VALUE('','{$data['name']}','{$data['mobile']}','{$data['email']}','{$data['area']}',
				// 	'{$data['dates']}','{$cnd}','{$cnd1}','{$cnd2}','{$data['sslc']}','{$data['yearsslc']}','{$data['univsslc']}','{$data['degreem']}',
				// 	'{$data['yeardegreem']}','{$data['univdegreem']}',
				// 	'{$data['masterm']}','{$data['yearmasterm']}','{$data['univdyearmasterm']}','{$data['netmarks']}','{$data['yearnetmarks']}','{$data['univnetmarks']}','{$data['sletmarks']}',
				// 	'{$data['sletyear']}','{$data['sletuniv']}','{$data['phils']}','{$data['philsyear']}','{$data['philsuniv']}','{$data['phdmarks']}','{$data['phdyear']}','{$data['phduniv']}','{$data['ug']}',
				// 	'{$data['pg']}','{$data['expres']}','{$data['internat']}','{$data['nation']}','{$data['other']}','{$data['seminar']}','{$data['successcand']}','{$data['project']}','{$data['cost']}','{$data['abroad']}',
				// 	'{$data['awards']}','{$data['kannada']}','{$data['kannada']}')";
				
			$result = $aobj_context->mobj_db->Execute($qry);
			$res = $aobj_context->mobj_db->Execute($query);
			// }
        if($result)
		{ 
			$arr['msg'] = 'Abstract Form Updated';
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr, 0, "success"); 
		
        }else{
            $arr['msg'] = 'Failed to update abstract form';
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure");
            return;
        }
	}

	function viewAbstractData($aobj_context){
	  $qry="SELECT *FROM abstract";
	  $res=$aobj_context->mobj_db->GetAll($qry);
      if($res)
	  {
		echo $aobj_context->mobj_output->ToJSONEnvelope($res, 0, "success"); 
     }else{
		 $arr['msg']="Data Not Found";
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "success"); 
	 }

	}

	function deleteAbstractformData($aobj_context){
		$id=$aobj_context->mobj_data['id'];
		$qry=" DELETE FROM abstract WHERE fid='{$id}'";
		$res = $aobj_context->mobj_db->Execute($qry);
		if($res)
		{
			$arr['msg']="Successsfully Deleted";
			echo $aobj_context->mobj_output->ToJSONEnvelope($arr, 0, "success"); 
		 }else{
			$arr['msg']="Data Not Found";
			echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "success"); 
		 }
	}

	function updateAbstractformData($aobj_context){
		 $id=$aobj_context->mobj_data['id'];
		 $qry=" SELECT *FROM abstract WHERE fid='{$id}'";
		 $res = $aobj_context->mobj_db->GetRow($qry);
		 if($res)
		 {
			echo $aobj_context->mobj_output->ToJSONEnvelope($res, 0, "success"); 
		 }else{
			$arr['msg']="Data Not Found";
			echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "success"); 
		 }
	}

	function loadCategoryAbstract($aobj_context){
          $qry="SELECT fcategory AS `key`, fcategory AS `value`, CONCAT(fcategory,' - ','[',fdescpn,']') AS label FROM `category`";
		  $res= $aobj_context->mobj_db->GetAll($qry);

		if($res){
			echo $aobj_context->mobj_output->ToJSONEnvelope($res, 0, "success");
		}else{
			echo $aobj_context->mobj_output->ToJSONEnvelope($res, -1, "falied");
		}
	}
	?>