<?php
session_start();
// ============
include("../../php_crud/my_class.php");
$obj=new my_class();
$branch_id = $_SESSION['LOGIN_BRANCH'];
$current_session = $_SESSION['ADMISSION_SESSION'];
//extract($_REQUEST);
$selected_class_id_from_form=addslashes(trim($_POST['selected_class_id_from_form']));
$mod_id = $_SESSION['module_id'];
$institute_id=$_SESSION["LOGIN_INSTITUTE"];
//$exam_session;

$table = "_students_admission_form f LEFT JOIN _students_admission_mark_entry e ON f.admission_id = e.admission_id";

$column = "f._candidate_name,f.admission_form_id,
f._mobile_number, 
'Congratulations, your candidate has been selected in the admission test. To get details information contact us in the office.
Headmaster,
Nababidhan Girls` High School, Natore.' AS _sms_body";

$where = "f._session='".$current_session."' AND f.branch_id=".$branch_id." AND f._class=".$selected_class_id_from_form." AND  e.list_type='merit' ORDER BY e.exam_mark DESC";


foreach($obj->View_colmn_By_Cond($table,$column,$where)as $v1){
		echo "mod_id=".$mod_id."institute_id=".$institute_id.
			"mobile_number=".$v1['_mobile_number'].
			"sms_body=".$v1['_sms_body']."<br>";
 //$send = $obj->Sms_Send($v1['institute_id'],$mod_id,"A",$v1['_mobile_number'],$v1['_sms_body'],"H",$_SESSION['LOGIN_USERID'],date("Y:m:d h:i:s"));
 
 
}

echo 'Result SMS Send Successful';
?>