Mini Shell

Direktori : /home/admin/web/mcpv.demarco.ddnsfree.com/public_html/external/prestataires/_include/
Upload File :
Current File : /home/admin/web/mcpv.demarco.ddnsfree.com/public_html/external/prestataires/_include/functions.php

<?php
require "_include/Exception.php";
require "_include/PHPMailer.php";
require "_include/SMTP.php";
require "_include/init.php";

use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
use PHPMailer\PHPMailer\SMTP;

function send_conf_email($to,$date,$periode) {

	set_time_limit(1500); // Gérer timeout SMTP
	
	$smtpserver = $GLOBALS['smtpserver'];
	$smtpproto = $GLOBALS['smtpproto'];        
	$smtpport = $GLOBALS['smtpport'];                    
	$smtpuser = $GLOBALS['smtpuser'];
	$smtppassword = $GLOBALS['smtppassword'];     
	$msgfrom = $GLOBALS['msgfrom'];
	$replyto = $GLOBALS['replyto'];	
	$telreply = $GLOBALS['telreply'];	
	
	$date_de = new DateTime($date . substr($periode,0,5));
	$date_a = new DateTime($date . substr($periode,8));
	$start = $date_de->format('Ymd').'T'.$date_de->format('His');
	$end = $date_a->format('Ymd').'T'.$date_a->format('His');
	$subject = 'Prochain cours informatique ADCN';
	$crlf = "\r\n";
	
	// Préparer attachement iCalendar
	
	$vcal  = 'BEGIN:VCALENDAR' . $crlf;	 
	$vcal .= 'PRODID:-//CompanyName//ProductName//EN' . $crlf;	 
	$vcal .= 'VERSION:2.0' . $crlf;
	$vcal .= 'CALSCALE:GREGORIAN' . $crlf;
	$vcal .= 'METHOD:REQUEST' . $crlf;
	$vcal .= 'BEGIN:VEVENT' . $crlf;
	$vcal .= 'DTSTAMP:'.date('Ymd').'T'.date('His').'Z' . $crlf;
	$vcal .= 'DTSTART:' . $start . $crlf; 	// YYYYMMDDTHHMMSS;
	$vcal .= 'DTEND:' . $end . $crlf; 		// YYYYMMDDTHHMMSS;
	$vcal .= 'UID:'.date('Ymd').'T'.date('His').'-'.rand().'-adcn.ch' . $crlf;
	$vcal .= 'CREATED:'.date('Ymd').'T'.date('His').'Z' . $crlf;
	$vcal .= 'LOCATION:Bureau ADCN - Rue Louis Favre 1 - 2000 Neuchâtel' . $crlf;
	$vcal .= 'SUMMARY:Prochain cours info ADCN' . $crlf;
	$vcal .= 'BEGIN:VALARM' . $crlf;
	$vcal .= 'TRIGGER:-PT1H' . $crlf;
	$vcal .= 'ACTION:DISPLAY' . $crlf;
	$vcal .= 'DESCRIPTION:Prochain cours info ADCN' . $crlf;
	$vcal .= 'END:VALARM' . $crlf;
	$vcal .= 'END:VEVENT' . $crlf;
	$vcal .= 'END:VCALENDAR' . $crlf;

	// Prepare EMail text
	
	$email_text  = '<img src="cid:logo_adcn"></img><br />';
	$email_text .= 'Vous êtes inscrit(e) au cours d\'informatique de l\'ADCN qui aura lieu le :<br /><br />';
	$email_text .= '<b>Mercredi ' . $date . ' de ' . $periode . ' au bureau de l\'ADCN, rue Louis Favre 1 - 2000 Neuchâtel</b><br /><br />';
	$email_text .= 'Merci de bien vouloir nous informer au <b>' . $telreply . '</b> si vous deviez avoir un empêchement<br /><br />';
	$email_text .= 'Salutations cordiales<br />';
	$email_text .= 'ADCN Neuchâtel<br /><br />';
	$email_text .= '<i>Clicker sur la pièce jointe pour ajouter cet évènement à votre calendrier</i>';
	
	$mail = new PHPMailer();

	$mail->IsSMTP();               
	$mail->SMTPDebug = 1; 					// 0 = aucune sortie, 1 = erreurs & messages, 2 = messages seul.                
	$mail->SMTPAuth = true;                	
	$mail->SMTPSecure = $smtpproto;        
	$mail->Host = $smtpserver;  
	$mail->Port = $smtpport;                    
	$mail->Username = $smtpuser;
	$mail->Password = $smtppassword;     
	$mail->CharSet = 'UTF-8';
	$mail->SetFrom($msgfrom);
	$mail->Subject = $subject;
	$mail->ContentType = 'text/plain';
	$mail->IsHTML(true);
	$mail->Body = $email_text; 
	$mail->AddAddress ($to);
	$mail->AddStringAttachment($vcal,'Cours info ADCN.ics');
	$mail->AddEmbeddedImage('_img/adcn-logo.png', 'logo_adcn');

	if(!$mail->Send())
	{
			$error_message = "Erreur : " . $mail->ErrorInfo;
	}
}

function send_conf_email_instructeur($email_instructeur, $fulldate, $fullname_utilisateur, $fullname_apprenant, $tel, $email_apprenant) {
	
	set_time_limit(1500); // Gérer timeout SMTP
	
	$smtpserver = $GLOBALS['smtpserver'];
	$smtpproto = $GLOBALS['smtpproto'];        
	$smtpport = $GLOBALS['smtpport'];                    
	$smtpuser = $GLOBALS['smtpuser'];
	$smtppassword = $GLOBALS['smtppassword'];     
	$msgfrom = $GLOBALS['msgfrom'];
	$replyto = $GLOBALS['replyto'];	
	$telreply = $GLOBALS['telreply'];
	$subject = 'ADCN - Annonce d\'inscription au cours d\'informatique';
	
	// Prepare EMail text
	
	$email_text  = '<img src="cid:logo_adcn"></img><br />';
	$email_text .= 'L\'inscription de l\'apprenant <b>' . $fullname_apprenant . ' </b> au cours d\'informatique de l\'ADCN du <b>' 
					. $fulldate . '</b> a été confirmée ce jour par <b>' . $fullname_utilisateur . '</b><br /><br />';
	$email_text .= 'Il est joignable par email <a href="mailto:' . $email_apprenant . '">' . $email_apprenant . 
					'</a> ou par téléphone au <b>' . $tel . '</b><br /><br />';
	$email_text .= 'ADCN Neuchâtel<br /><br />';
	
	$mail = new PHPMailer();

	$mail->IsSMTP();               
	$mail->SMTPDebug = 0; 					// 0 = aucune sortie, 1 = erreurs & messages, 2 = messages seul.                
	$mail->SMTPAuth = true;                	
	$mail->SMTPSecure = $smtpproto;        
	$mail->Host = $smtpserver;  
	$mail->Port = $smtpport;                    
	$mail->Username = $smtpuser;
	$mail->Password = $smtppassword;     
	$mail->CharSet = 'UTF-8';
	$mail->SetFrom($msgfrom);
	$mail->Subject = $subject;
	$mail->ContentType = 'text/plain';
	$mail->IsHTML(true);
	$mail->Body = $email_text; 
	$mail->AddAddress ($email_instructeur);
	$mail->AddEmbeddedImage('_img/adcn-logo.png', 'logo_adcn');

	if(!$mail->Send())
	{
			$error_message = "Erreur : " . $mail->ErrorInfo;
	} 
}

function nbDays($thedate) {
	return cal_days_in_month(CAL_GREGORIAN, $thedate->format("m"),$thedate->format("Y"));
}

function moisFrancais($nomMois) {
	$translate = str_replace("January","Janvier",$nomMois);
	$translate = str_replace("February","Février",$translate);
	$translate = str_replace("March","Mars",$translate);
	$translate = str_replace("April","Avril",$translate);
	$translate = str_replace("May","Mai",$translate);
	$translate = str_replace("June","Juin",$translate);
	$translate = str_replace("July","Juillet",$translate);
	$translate = str_replace("August","Août",$translate);
	$translate = str_replace("September","Septembre",$translate);
	$translate = str_replace("October","Octobre",$translate);
	$translate = str_replace("November","Novembre",$translate);
	$translate = str_replace("December","Décembre",$translate);
	return $translate;
}

function afficheDate($jour, $start_of_month, $DB) {
	$fulldate = $start_of_month->format("Y-m") . "-" . substr(str_repeat(0, 2).$jour, - 2);
	$today = (date("Y-m-d") == $fulldate) ? "true" : false;

	$html = "<td class=' " . ($today == true ? "text-light bg-info" : "text-primary") . "'>
			<div class='row'>
				<div class='col text-center'>
					<b>" . $jour . "</b>
				</div>
			</row>";
	if(date_create($fulldate)->format("N") == $GLOBALS["jour_cours"]) { // Si jour du cours 
		$req = $DB->prepare("select id from cours_sessions where date = STR_TO_DATE(:date, '%Y-%m-%d')");
		$req->bindParam(":date",$fulldate); 
		$req->execute();
		if($req->rowCount() <> 0) { // Si sessions existent pour le mercredi 
			$req = $DB->prepare("select id from cours_inscriptions where session_id in 
								(select id from cours_sessions where date = STR_TO_DATE(:date, '%Y-%m-%d'))");
			$req->bindParam(":date",$fulldate); 
			$req->execute();
			if($req->rowCount() == 0) // Si sessions existent le mercredi et aucune inscription -> Afficher suppression
			{
				$html = '<td hidden class="fulldate">' . $fulldate . '</td>
						<td class=" ' . ($today == true ? "text-light bg-info" : "text-primary") .'">
							<div class="row">
								<div class="col  text-center">
									<b>' . $jour . '</b>
								</div>
								<div class="col">
									<button type="button" title="Supprimer sessions" class="del_btn btn btn-outline-danger btn-sm" role="button">
									<i class="fa fa-xs fa-trash"></i></button>
								</div>
							</div>
						</td>'; 
			}
			else {
				$html = "<td class=' " . ($today == true ? "text-light bg-info" : "text-primary") . "'>
				<div class='row'>
					<div class='col text-center'>
						<b>" . $jour . "</b>
					</div>
					<div class='col'>
						<i title='" . $req->rowCount() . " inscriptions enregistrées' class='fa fa-xs fa-users'></i>
					</div>
				</row>";
			}
		}
		else  { // Aucune session pour le mercredi -> Afficher création
			$html = '<td hidden class="fulldate">' . $fulldate . '</td>
					<td class= "' . ($today == true ? "text-light bg-info" : "text-primary") .'">
						<div class="row">
						<div class="col text-center">
							<b>' . $jour . '</b>
						</div>
						<div class="col">
							<button type="button" title="Ajouter sessions" class="add_btn btn btn-outline-primary btn-sm" role="button">
							<i class="fa fa-xs fa-calendar-plus-o"></i></button>
						</div>
						</div>
					</td>'; 
		}
	} 
	return $html;          
}
?>







Online casinos additionally provide a extensive variety of – Base de données MCPV "Prestataires"

Online casinos additionally provide a extensive variety of

On-line Casino For Actual Cash: Up To $8000 Bonus

Each one has years of expertise in the online on line casino world and knows how to create content that’s useful, trustworthy, and straightforward to grasp. Thanks to their hard work, we’re capable of convey you the site you see at present. Real money casinos typically offer a wider range of fee choices than sweepstakes casinos, But speed issues simply as a lot as alternative. Another great benefit of free play is the actual fact you won’t have to enroll and share any of your personal details or download any software. Of course, you possibly can make sure that all particulars are secure and safe when signing up with a high on line casino we’ve beneficial. Players predict the ball’s touchdown spot on the wheel, with a wide selection of betting choices such as inside and outside bets providing different odds and payouts.

We aim to offer fun & excitement so that you just can look ahead to daily. The great thing about Slotomania is that you could play it wherever.You can play free slots from your desktop at residence or your cellular gadgets (smartphones and tablets) while you’re on the go! Slotomania is super-quick and handy to entry and play, anywhere, anytime. Each country has different laws and regulations relating to playing.

Popular options embody credit/debit cards like VISA, e-wallets such as PayPal, financial institution transfers, or even cryptocurrencies like Bitcoin. Just for logging in day by day, casinos will reward you with a bundle of GCs, and sometimes, when you’re fortunate, a couple of SCs too. Casinos participating in these practices will obtain a decrease Safety Index to assist players avoid disagreeable experiences. We assess complaints throughout various platforms, considering elements such as the nature of the grievance, the on line casino’s license, and whether the problem has been resolved.

From traditional methods like credit/debit cards to e-wallets and cryptocurrencies, online casinos offer a variety of choices to accommodate completely different participant needs. Online casinos additionally provide a extensive variety of online on line casino video games, together with numerous slot video games and poker variations, catering to different player preferences and play types. To play online casino games ベラ ジョン カジノ, merely select from the obtainable options and benefit from the excitement of the digital on line casino world. You’ll discover every thing from classic fruit and joker themes to fantasy and mythology slots. One of one of the best parts of enjoying at sweepstakes or real-money on-line casinos is how easy it is to discover all these themes with only a click on.

While these are essentially the most attractive games if you play at real cash online casinos ベラジョン, you should keep in thoughts that progressive jackpots are expensive and can eat your bankroll very quickly. Whether you play from the US or the United Kingdom, all the highest on line casino websites on this record let you play top-of-the-line video slots and mobile slots for real money. Our greatest US slots on line casino for actual money games is FanDuel Casino ベラジョン, whereas within the UK, look in the direction of bet365 Casino in your finest subsequent spin. When playing on the BetRivers casino desktop website, gamers can navigate to the usual on line casino sections, together with table games and various other slots libraries. You can also examine the various regular promotions and the Rush Rewards loyalty scheme, which is a points-based tier system offering more rewards and perks. We analyzed the software program ベラジョン, the games & slots, the bonuses, the shopper help service, and the withdrawal processes of every of the top online casinos you’ll have the ability to see below.

On-line Casino For Actual Cash: Up To $8000 Bonus Each one has years of expertise in the online on line casino world and knows how to create content that’s useful, trustworthy, and straightforward to grasp. Thanks to their hard work, we’re capable of convey you the site you see at present. Real money casinos typically…

Leave a Reply

Your email address will not be published. Required fields are marked *