%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(); } $new_time = time(); $sql = "SELECT quid, gids, quiz_name FROM savsoft_quiz WHERE quiz_type='1' AND FROM_UNIXTIME(end_date) between now() AND now() + INTERVAL 10 HOUR"; $result = mysqli_query($conn, $sql); if (mysqli_num_rows($result) > 0) { echo ("total count - " . mysqli_num_rows($result) . "<br/>"); $k = 0; while ($row = mysqli_fetch_assoc($result)) { $listGids = $row['gids']; $quid = $row['quid']; $quiz_name = $row['quiz_name']; $tsql = mysqli_query($conn,"SELECT uid from savsoft_result Where quid=$quid"); $totalRegistration = mysqli_num_rows($tsql); $sql = "SELECT su.*, group_name from savsoft_users as su JOIN savsoft_group as sg ON su.gid= sg.gid WHERE su.gid IN(".$listGids.") AND su.status='1' AND verify_code='0' AND su.uid NOT IN( SELECT uid from savsoft_result Where quid='".$quid."') limit 500"; $query=mysqli_query($conn,$sql); while($resp = mysqli_fetch_assoc($query)){ if($resp['email']) { $token = ''; $token = base64_encode(serialize(array('email'=>$resp['email'],'password'=>$resp['user_key']))); $url = "https://quizbyte.sharda.ac.in/login/autologin?token=$token"; $template = emailTemplate($resp, $quiz_name,$totalRegistration,$url); echo $to_email = $resp['email']; $subject = "Quizbyte - Last few hours left for $quiz_name. Participate Now!!"; send_email_pepipost($to_email,$subject,$template); if($k%50==0){ send_email_pepipost('quizbyte@sharda.ac.in',$subject,$template); } $k++; } } } echo "<br/> $k end<br/>"; } else { echo "no record found"; } /* * Function : send_email_pepipost * Description : Send Email */ function send_email_pepipost($to_emails, $subject, $message, $fromname='', $fromemail='', $replyto=''){ $fromname=$fromname?$fromname:'Quizbyte'; $fromemail=$fromemail?$fromemail:'quizbyte@shardauniversity.com'; //Change This Email ID; $replyto=$replyto?$replyto:'noreply@sharda.ac.in'; //Change the Email ID; if(!$to_emails){ return; } if(is_string($to_emails)){ $to_emails=explode(",", $to_emails); } foreach($to_emails as $to){ $d=array ( 'personalizations' => array (0 => array ('recipient' => $to)), 'from' => array ('fromEmail' => $fromemail, 'fromName' => $fromname), 'replyToId'=>$replyto, 'subject' => $subject, 'content' => $message, ); $email_jason_data=json_encode($d); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://api.pepipost.com/v2/sendEmail", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => $email_jason_data, CURLOPT_HTTPHEADER => array( "api_key: c77184012dcf9bd5cd1886b4e0a2bb89", // "api_key: aab3f77715e90569034f0c6e5d912714", "content-type: application/json" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } // else { // echo $response; // } // die; } //EOF //EOF } /* * Function : emailTemplate * * */ function emailTemplate($userDetails, $quiz_name, $totalRegistration, $url){ $full_name = $userDetails["first_name"].' '.$userDetails["list_name"]; $template = ''; $template = ' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Participate Now - Quizbyte An Ultimate Quizzing Platform</title> </head> <body> <table style="width:600px; margin:0px auto;" cellpadding="0" border="0" cellspacing="0"> <tr> <td colspan="2"> <a href="'.$url.'"><img src="https://quizbyte.sharda.ac.in/images/participate_now.png" width="100%" /></a> </td> </tr> <tr> <td colspan="2" style="font-family:Tahoma, Geneva, sans-serif; padding:20px 50px 20px 20px; border-right:1px solid #ccc;border-left:1px solid #ccc;"> <p style="font-size:16px; font-family:Tahoma, Geneva, sans-serif; color:#444;">Dear '.trim($full_name).',</p> <p style="font-size:14px; font-family:Tahoma, Geneva, sans-serif; color:#444;padding-top:20px;">The due time for the <strong>'.$quiz_name.'</strong> quiz /assignment will expire in a few hours.</p> <p style="font-size:14px; font-family:Tahoma, Geneva, sans-serif; color:#444;padding-top:5px;">If you want to appear/ submit it now, click on the Participate Now button given below.</p> <p style="padding:0; text-align:center;margin:0px;font-size:14px; font-family:Tahoma, Geneva, sans-serif; color:#444;"> <a href="'.$url.'" style="display:inline-block; text-decoration:none; margin:12px auto; padding:12px 30px; border-radius:30px; color:#fff; background:#ed5b7a;">Participate Now</a><br /> <small>('.$totalRegistration.'+ already registered)</small </p> <br/><br/> <p style="padding:0; margin:0px;font-size:12px; font-family:Tahoma, Geneva, sans-serif; color:#444; font-style:italic;">Note: If you have any questions, please let us know by sending an email to quizbyte@sharda.ac.in</p><br /> </td> </tr> <tr bgcolor="#220038"></tr> <tr bgcolor="#220038"> <td colspan="2"> <table width="100%"> <tr> <td align="center" colspan="2" valign="middle" style="padding:30px 10px 30px 10px; "> <a href="https://quizbyte.sharda.ac.in" style="color:#fff; font-size:16px; font-family:Tahoma, Geneva, sans-serif; text-decoration:none; padding:2px 0; line-height:20px;"> quizbyte.sharda.ac.in</a> </td> </tr> </table> </td> </tr> </table> </body> </html>'; return $template; }