%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); date_default_timezone_set('Asia/Kolkata'); define('DB_SERVER', "admissions.cluster-custom-c8m5zlhotfbm.ap-south-1.rds.amazonaws.com"); define('DB_USERNAME', "shardezone_user"); define('DB_PASSWORD', "7se%;pr*/A24AyTw"); define('DB_DATABASE', "shardaac_ezone_2022_db"); define('COMPANY', "ShardaTech pvt ltd."); //exit('Sorry Try Again!!!!!'); //return true; /* Connect to MySQL and select the database. */ $conn = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_DATABASE); if (!$conn) { mysqli_connect_error(); } mysqli_set_charset($conn, "utf8"); $resultsArray = getEnrollmentDetails($conn); // Total Enrollment $totalEnrollment = getTotalEnrollmentDetails($conn); //echo count($resultsArray); //die; if(!empty($resultsArray)) { $finalArray = array(); foreach ($resultsArray as $row) { $system_id = $row['system_id']; $sqlRec = "SELECT * from student_details WHERE system_id = '".$system_id."' AND status='1'"; $result = mysqli_query($conn, $sqlRec); $numrow = mysqli_fetch_row($result); $program_code = $numrow['11']; $program_plan_code = $numrow['12']; $school_name = $numrow['5']; $deptname = $numrow['7']; //Validate Special $sqlCRec = "SELECT * from tbl_specializationprogramme WHERE program_plan_code like '%".$program_plan_code."%' AND status='1'"; $cresult = mysqli_query($conn, $sqlCRec); $scrows = mysqli_fetch_row($cresult); $program_type='2'; $program_id = $scrows[0]; $program_name = $scrows[7]; if(empty($scrows)){ $program_type='1'; $sqlPRec = "SELECT * from tbl_programme_master WHERE program_code = '".$program_code."' AND status='1'"; $presult = mysqli_query($conn, $sqlPRec); $prows = mysqli_fetch_row($presult); $program_id = $prows[0]; $program_name = $prows[3]; } // Get School Name $total = $row["total"]; try { $finalArray[$school_name][] = array('school_name'=>$school_name,'deptname'=>$deptname,'program_name'=>$program_name,'total'=>$total); } catch (TableAException $e) { print_r($e); die; } } $sqlQPRec = "select count(distinct system_id) as total, program_id, program_type,term, system_id, semester from stu_enrollment where level='1' AND status='1' AND term='2501' group by semester order by total desc"; $qpresult = mysqli_query($conn, $sqlQPRec); //print_r($finalArray); die; $t=1; $k=1; $template = ""; $template .= ' <table style="border-color:#dadada; " border="1" width="100%" cellpadding="0"> <th style="font-size:13px; background:#fafafa; padding:5px; border-color:#dadada; ">Sr.No.</th> <th style="font-size:13px; background:#fafafa; padding:5px; border-color:#dadada;">Term</th> <th style="font-size:13px; background:#fafafa; padding:5px; border-color:#dadada;">Semester</th> <th style="font-size:13px; background:#fafafa; padding:5px; border-color:#dadada;">Total Ezone Registration</th> <tbody>'; while($resultts = mysqli_fetch_assoc($qpresult)) { $template .= '<tr> <td style="font-size:13px; background:#fff; padding:5px; border-color:#dadada;">'.$k.'</td> <td style="font-size:13px; background:#fff; padding:5px; border-color:#dadada;"v>'.$resultts["term"].'</td> <td style="font-size:13px; background:#fff; padding:5px; border-color:#dadada;"v>'.$resultts["semester"].'</td> <td style="font-size:13px; background:#fff; padding:5px; border-color:#dadada;">'.$resultts["total"].'</td> </tr>'; $k++; } $template .= ' </tbody> </table> <br/><br/> <table style="border-color:#dadada; " border="1" width="100%" cellpadding="0"> <th style="font-size:13px; background:#fafafa; padding:5px; border-color:#dadada; ">Sr.No.</th> <th style="font-size:13px; background:#fafafa; padding:5px; border-color:#dadada;">School Name</th> <th style="font-size:13px; background:#fafafa; padding:5px; border-color:#dadada;">Department Name</th> <th style="font-size:13px; background:#fafafa; padding:5px; border-color:#dadada;">Program Name</th> <th style="font-size:13px; background:#fafafa; padding:5px; border-color:#dadada;">Ezone Registration</th> <tbody>'; foreach($finalArray as $key=>$rowArray){ foreach($finalArray[$key] as $row) { $template .= ' <tr> <td style="font-size:13px; background:#fff; padding:5px; border-color:#dadada;">'.$t.'</td> <td style="font-size:13px; background:#fff; padding:5px; border-color:#dadada;"v>'.$row["school_name"].'</td> <td style="font-size:13px; background:#fff; padding:5px; border-color:#dadada;">'.$row["deptname"].'</td> <td style="font-size:13px; background:#fff; padding:5px; border-color:#dadada;">'.$row["program_name"].'</td> <td align="center" style="font-size:14px; font-weight:bold; background:#fff; padding:5px; border-color:#dadada;">'.$row["total"].'</td> </tr>'; $t++; } } $template .= ' </tbody> </table>'; // Get Total Enrollment sendAlertEmail($template, $totalEnrollment); echo 'Email Send Successfully to all email ids<br/>'; exit(); } else { echo '<br> No Record Found'; exit(); } /* * Function : getDepartmentID * Description : send request and get response in JSON format * Date: 19 Oct 2020 * Created By: Amit Verma */ function getEnrollmentDetails($conn) { $sql = "select count(distinct system_id) as total, program_id, program_type,term, system_id from stu_enrollment where status='1' AND level='1' AND term='2501' group by program_id,program_type order by program_id"; $result = mysqli_query($conn, $sql); $resp = array(); while($results = mysqli_fetch_assoc($result)) { $resp[] = $results; } return $resp; } /* * Function : getTotalEnrollmentDetails * Description : send request and get response in JSON format * Date: 19 Oct 2020 * Created By: Amit Verma */ function getTotalEnrollmentDetails($conn) { $sql = "select count(distinct system_id) as total, program_id, program_type,term, system_id from stu_enrollment where status='1' AND level='1' AND term='2501'"; $result = mysqli_query($conn, $sql); $row = mysqli_fetch_row($result); return $row['0']; } /* * Function : sendAlertEmail */ function sendAlertEmail($totalrecords, $totalEnrollment) { //$to_emails = 'amit.verma@sharda.ac.in'; $to_emails = 'rashmi.priyadarshini@sharda.ac.in,sap.support@sharda.ac.in,rahul.jha@sharda.ac.in,bijendar.1@sharda.ac.in'; $title = 'E-Zone Student Registration Report 2501'; $subject = 'E-Zone Student Registration Report -'.date('Y-m-d H:i:s'); $message = emailTemplate($title, $totalrecords,$totalEnrollment); $resp = send_email_pepipost($to_emails, $subject, $message); return $resp; } /* * Function : send_email_pepipost * Description : Send Email */ function send_email_pepipost($to_emails, $subject, $message, $fromname='', $fromemail='', $replyto=''){ $fromname=$fromname?$fromname:'Ezone Cronjob Alert'; $fromemail=$fromemail?$fromemail:'ezone@shardauniversity.com'; //Change This Email ID; $replyto=$replyto?$replyto:'noreply@sharda.ac.in'; //Change the Email ID; //$to_emails = 'amit.verma@shardatech.org'; 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($title='E-Zone Student Registration Report',$rectemp='',$totalEnrollment='0') { $template=''; $template.='<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <title>Sharda E-Zone</title> <style type="text/css"> #outlook a {padding:0;} body{width:100% !important; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%; margin:0; padding:0;} .ExternalClass {width:100%;} .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {line-height: 100%;} #backgroundTable {margin:0; padding:0; width:100% !important; line-height: 100% !important;} img {outline:none; text-decoration:none;border:none; -ms-interpolation-mode: bicubic;} a img {border:none;} .image_fix {display:block;} p {margin: 0px 0px !important;} table td {border-collapse: collapse;} table { border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt; } a {color: #1d83aa;text-decoration: none;text-decoration:none!important;} /*STYLES*/ table[class=full] { width: 100%; clear: both; } /*IPAD STYLES*/ @media only screen and (max-width: 640px) { a[href^="tel"], a[href^="sms"] { text-decoration: none; color: #33b9ff; pointer-events: none; cursor: default; } .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] { text-decoration: default; color: #33b9ff !important; pointer-events: auto; cursor: default; } table[class=devicewidth] {width: 440px!important;text-align:center!important;} table[class=devicewidth] td{text-align:center!important;} table[class=devicewidth] td.left{text-align:left!important;} table[class=devicewidthinner] {width: 420px!important;text-align:center!important;} img[class=banner] {width: 440px!important;height:177px!important;} img[class=colimg2] {width: 440px!important;height:177px!important;} } /*IPHONE STYLES*/ @media only screen and (max-width: 480px) { a[href^="tel"], a[href^="sms"] { text-decoration: none; color: #ffffff; /* or whatever your want */ pointer-events: none; cursor: default; } .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] { text-decoration: default; color: #ffffff !important; pointer-events: auto; cursor: default; } table[class=devicewidth] {width: 350px!important;text-align:center!important;} table[class=devicewidthinner] {width: 350px!important;text-align:center!important;} img[class=banner] {width: 350px!important;height:140px!important;} img[class=colimg2] {width: 350px!important;height:140px!important;} td[class="padding-top15"]{padding-top:15px!important;} .full-width{ width:100% !important; text-align:center !important; } .full-width img{ margin:0 auto !important; } } @media only screen and (min-width:481px) and (max-width:599px) { table[class=wrapper] { width: 100% !important; } table[class=main_table] { width: 100% !important; } td[class=pad_side] { padding-left: 14px !important; padding-right: 14px !important; } td[class=hide], br[class=hide] { display: none !important; } img[class=full_img] { width: 100% !important; height: auto !important; } td[class=text], td[class=black], td[class=black2], td[class=red], td[class=white], td[class=white1], td[class=white2], td[class=grey] { text-align: center !important; } td[class=pad_bottom] { padding-bottom: 20px !important; } td[class=pad_top] { padding-top: 20px !important; } td[class=fix_height] { height: 20px !important; } td[class=video] img { width: 100% !important; height: auto !important; } } @media only screen and (max-width:480px) { table[class=wrapper] { width: 100% !important; } table[class=main_table] { width: 100% !important; } td[class=pad_side] { padding-left: 14px !important; padding-right: 14px !important; } td[class=hide], br[class=hide] { display: none !important; } img[class=full_img] { width: 100% !important; height: auto !important; } td[class=text], td[class=black], td[class=black2], td[class=red], td[class=white], td[class=white1], td[class=white2], td[class=grey] { text-align: center !important; } td[class=pad_bottom] { padding-bottom: 20px !important; } td[class=pad_top] { padding-top: 20px !important; } td[class=fix_height] { height: 20px !important; } td[class=video] img { width: 100% !important; height: auto !important; } } </style> </head> <body> <!-- Start of header --> <table width="650" bgcolor="#fff" border="0" cellspacing="0" cellpadding="0" class="wrapper" align="center" mc:repeatable mc:variant="Right IMAGE + Left(TITLE + DESC + READ MORE)" style="table-layout:fixed;font-family:Arial, sans-serif; border-top: 1px solid #e1e1e1; border-left: 1px solid #e1e1e1; border-right: 1px solid #e1e1e1; border-bottom: 1px solid #e1e1e1"> <tr> <td height="15" style="line-height:1px;font-size:1px;"> </td> </tr> <tr> <td class="pad_side"> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="left" class="wrapper"> <tr> <td align="center" valign="top"> <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td> <br /> <div class="imgpop" align="left"><a target="_blank" href="http://ezone.sharda.ac.in/" title="Sharda E-Zone"><img src="https://www.sharda.ac.in/attachments/site_logo/logo22.png" alt="Sharda E-Zone" border="0" height="50" style="display:block; border:none; outline:none; text-decoration:none;" /></a></div> <br /> </td> </tr> <tr> <td height="1" style="line-height:1px;font-size:1px;" class="fix_height"> </td> </tr> <tr> <td valign="top"> <div class="padding" style="padding: 0 0 20px;font-size:14px;color:#414141;text-align:left;line-height:22px;"> <p style="font-size:18px;padding:5px 0 15px 0;font-weight:bold;">Dear All,</p> <p>I hope this email finds you well. As per your request, we are providing you with the latest update on the total E-zone student registration. <br/><br/>The following is the report generated by the automated cron job:</p> <br/><br/> <p style="font-size:16px;color:#414141;text-align:center;font-weight:bold;">Total Ezone Registrations: '.$totalEnrollment.'</p> </div> <div class="padding" style="font-size:14px;color:#000000;text-align:left;line-height:22px;"> '.$rectemp.' </div> <div class="padding" style="font-size:14px;color:#414141;text-align:left;line-height:22px;"><p style="padding: 10px 0">Please note that the numbers provided above are based on the latest data available at the time of the cron job execution.</p></div> <div class="padding" style="font-size:14px;color:#414141;text-align:left;line-height:22px;"><p style="padding: 10px 0">If you have any questions or need further assistance, please don\'t hesitate to reach out to us.</p></div> <div class="padding" style="font-size:14px;color:#414141;text-align:left;line-height:22px;padding-top:20px;"> <p>Best regards,<br/> Team Ezone </p> </div> </td> </tr> <tr> <td height="30"></td> </tr> <tr> <td align="center" style="font-weight: bold; border: 1px solid #ebebeb; padding: 4px 10px;font-size: 16px;">Visit Website to Explore <a href="https://ezone.sharda.ac.in/ezone-2022/"><span style="color: #00a3e4">https://ezone.sharda.ac.in</span></a></td> </tr> <tr> <td height="15" style="line-height:1px;font-size:1px;" class="fix_height"> </td> </tr> </table> </td> <td width="0" class="hide"> </td> </tr> </table> </td> </tr> </table> <!-- end of footer --> </body> </html>'; return $template; } ?>