%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
<?php //error_reporting(E_ALL); define('DB_SERVER', "shardauniversitywriter.cluster-custom-c8m5zlhotfbm.ap-south-1.rds.amazonaws.com"); define('DB_USERNAME', "quizbyte_user"); define('DB_PASSWORD', "quiz@byte121!"); define('DB_DATABASE', "shardaac_quizbyte_db"); define('COMPANY', "ShardaTech pvt ltd."); /* Connect to MySQL and select the database. */ $conn = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_DATABASE); if (!$conn) { mysqli_connect_error(); } $sql = "select * from `savsoft_result` WHERE result_status!='Open' order by rid desc limit 0,1000"; $result = mysqli_query($conn, $sql); return false; if (mysqli_num_rows($result) > 0) { echo ("total count - " . mysqli_num_rows($result) . "<br/>"); while ($row = mysqli_fetch_assoc($result)) { $rid = $row['rid']; $quid = $row['quid']; $uid = $row['uid']; $score_obtained = $row['score_obtained']; $percentage_obtained = $row['percentage_obtained']; $total_time = $row['total_time']; $end_time = date('Y-m-d H:i:s',$row['end_time']); $queryn = mysqli_query($conn, "select * from savsoft_leaderboard where uid='$uid' AND quid = '$quid'"); $results = mysqli_fetch_assoc($queryn); $userdata=''; if(empty($results)) { if($uid>0){ $sqlIns = "INSERT INTO `savsoft_leaderboard` SET uid='".$uid."', quid='".$quid."',rid='".$rid."', score_obtained='".$score_obtained."',total_time='".$total_time."',percentage_obtained='".$percentage_obtained."',profile_image='".$logged_in['profie_image']."',attempted_ip='".$_SERVER['REMOTE_ADDR']."',createdon='".$end_time."'" ; mysqli_query($conn, $sqlIns); } } else { if($score_obtained>$result['score_obtained'] && $percentage_obtained>$result['percentage_obtained']){ if($uid>0 && $quid>0){ $lid = $results['lid']; $sqlUpdate = "UPDATE `savsoft_leaderboard` SET rid='".$rid."', score_obtained='".$score_obtained."',total_time='".$total_time."',percentage_obtained='".$percentage_obtained."',profile_image='".$logged_in['profie_image']."', attempted_ip='".$_SERVER['REMOTE_ADDR']."', createdon='".$end_time."', modifiedon='".date('Y-m-d H:i:s')."' WHERE lid = $lid" ; mysqli_query($conn, $sqlUpdate); } } } } echo "<br/> end<br/>"; } else { echo "no record found"; }