Current File : /home/inlingua/www/faridabad/icentex/evaluation/session_shadulemail.php
<?php include_once("include/config/config.php");
include_functions(array('url','paging','file_handling','input')); 

$date=date('Y-m-d');
$sdate = date("Y-m-d", strtotime('+1day',strtotime($date)));
$QueryObjp =new query('session_shadule');
$QueryObjp->Where="where start_date= '".$sdate."' and is_active='0' ";
$QueryObjp->DisplayAll();
$count_sponsored = $QueryObjp->GetNumRows();
if($count_sponsored>0){
while($QueryObj1=$QueryObjp->GetObjectFromRecord()):
	$QueryObj22 =new query('user');
	$QueryObj22->Where="where id='".$QueryObj1->coachee_id."'";
	$user=$QueryObj22->DisplayOne();
	$sendto=$user->username;
	$coachee=$user->first_name;
	$QueryCoachee = new query('assign_project_coachee');
	$QueryCoachee->Where ="where coachee_id ='".$user->id."'";
	$pdata=$QueryCoachee->DisplayOne();
	$QueryCoacheep = new query('project');
	$QueryCoacheep->Where ="where id ='".$pdata->project_id."'";
	$pname=$QueryCoacheep->DisplayOne();
	
	$Querycoach =new query('user');
	$Querycoach->Where="where id='".$QueryObj1->coach_id."'";
	$coach=$Querycoach->DisplayOne();

	$coachname=$coach->first_name;	
	$session=$QueryObj1->session;
	$Projectname=$pname->project_name;
	$url=DIR_WS_SITE.'img/iOwn-logo.png';
	$username=$user->first_name;
	
	
	$originalDate = $QueryObj1->start_date;
	$start_date = date("d-m-Y", strtotime($originalDate));
	$subject=$QueryObj1->session.' Discovery Session Start On '.$start_date;
    session_shadule_mail($url,$subject,$coachname,$Projectname,$coachee,$session,$sendto,$start_date);	
 
    $Data2['is_active']=1;
	$QueryObj->InitilizeSQL();
	$QueryObj->TableName='session_shadule';
	$QueryObj->Data=$Data2;
	$QueryObj->Where="where id='".$QueryObj1->id."'";
	$QueryObj->UpdateCustom();
 endwhile;
}
			
?>