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 : 18.118.1.63


Current Path : /var/www/html/gcg/adm/admin/src/pg/
Upload File :
Current File : /var/www/html/gcg/adm/admin/src/pg/savepgstudadm.php

<?php
	
	include ("../database.php");
	$appno = $_POST['appno'];
	$user = $_SESSION['USERTYPE'];
	$remarks = $_POST['fremarks'];
    $status = $_POST['fapprstatus'];

    $category = $_POST['category'];
    $fgender = $_POST['fgender'];
    $sttype = $_POST['sttype'];
    $f371j = $_POST['f371j'];
    $fpwd = $_POST['fpwd'];
	$caste = $_POST['caste'];
	$fdegree = $_POST['fdegree'];
    $rgMultiMarks = $_POST['rgMultiMarks'];
    $rgMultiMarks = json_decode($rgMultiMarks,true);

  

	$query  = "update pgstudadm set FAPPSTATUS = '{$status}',
    FACKDATE = now(), FAPPREMARKS = '{$remarks}',FACKUSER = '{$user}', 
    FCASTE = '{$category}', FGENDER = '{$fgender}', FSTUTYPE = '{$sttype}',fpwd = '{$fpwd}',f371j = '{$f371j}',
    FCATBIRTH = '{$caste}'
    where fappno = '{$appno}'";
	$result = mysqli_query($conn,$query);
	

    $sub_marks = array();
	
	for($i=0; $i<count($rgMultiMarks); $i++)
	{	
		for($j=0;$j<count($rgMultiMarks[$i]);$j++)
		{
			$sub_marks[$i][$rgMultiMarks[$i][$j]['name']] = $rgMultiMarks[$i][$j]['value']; 	
		}	
	}
               
	$sql = array();
	$j=0;
	for($i=0; $i<count($sub_marks);$i++)
	{
		if($sub_marks[$j]["subsem1_$i"] != '' || $sub_marks[$j]["subsem1_$i"] != NULL)
		{
			$sql[] = "('{$appno}' ,'1001' ,'{$fdegree}',
			'{$sub_marks[$j]["subcode_$i"]}','{$sub_marks[$j]["subsem1_$i"]}', '{$sub_marks[$j]["subsem1mo_$i"]}',
			'{$sub_marks[$j]["subsem1mm_$i"]}' ,'{$sub_marks[$j]["subsem2mo_$i"]}' ,'{$sub_marks[$j]["subsem2mm_$i"]}',
			'{$sub_marks[$j]["subsem3mo_$i"]}', '{$sub_marks[$j]["subsem3mm_$i"]}', '{$sub_marks[$j]["subsem4mo_$i"]}',
			'{$sub_marks[$j]["subsem4mm_$i"]}', '{$sub_marks[$j]["subsem5mo_$i"]}', '{$sub_marks[$j]["subsem5mm_$i"]}', 
			'{$sub_marks[$j]["subsem6mo_$i"]}', '{$sub_marks[$j]["subsem6mm_$i"]}', '{$sub_marks[$j]["subtotalmo_$i"]}',
			'{$sub_marks[$j]["subtotalmm_$i"]}', '{$sub_marks[$j]["subpercentagemm_$i"]}')";
		
		}
		$j++;
	}
	
	if(count($sub_marks) >0)
	{
		$query = "delete from qualsubdet where fappno = '{$appno}'";
		$result = mysqli_query($conn,$query);
	}

	$query1 = 'INSERT INTO qualsubdet(fappno,
	fcollcode, fdegree, fsubcode,
	fsubname, fsecmarksa, fmaxmarksa, 
	fsecmarksb, fmaxmarksb,
	fsecmarksc, fmaxmarksc,
	fsecmarksd, fmaxmarksd,
	fsecmarkse, fmaxmarkse,
	fsecmarksf, fmaxmarksf,
	ftotsecmarks, ftotmaxmarks,
	fsubpercent
	) VALUES '.implode(',', $sql);
				
	$result1 = mysqli_query($conn,$query1);
                
	if($result1)
	{	
		$row['status'] = 'success'; 
		$row['msg'] = 'Updated';
		echo json_encode($row);
	}
	else
	{
		$row['status'] = 'failure'; 
		$row['msg'] = 'Updation Failed';
		echo json_encode($row);
	}	

?>