session_start();
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0
require_once('/var/www/config/tpdinterns/version2/Config.php');
//==============================================
// Fonction affiche_erreur
// Pour afficher un message d'erreur
// parametres : $inMessage : le message d'erreur
// retour : rien
// =============================================
function Affiche_Erreur ($inMessage) {
echo "$inMessage";
}
//==============================================
// Fonction check_email
// Vérifie la validité de l'adresse e-mail
// parametres : $var : adresse e-mail
// retour : booléen
// =============================================
function check_email($var) {
$mail_valide = preg_match('`^[[:alnum:]]([-_.]?[[:alnum:]])*@[[:alnum:]]([-_.]?[[:alnum:]])*\.([a-z]{2,4})$`',$var);
if ($mail_valide) return true;
else return false;
}
//==============================================
// Fonction chapeau
// Pour afficher un extrait d'un texte
// parametres : $inTexte : le message d'erreur
// $limit : taille du chapeau
// $param : 0/1 coupe le texte aux espaces ou non
// retour : $inTexte
// =============================================
function chapeau($inTexte, $limit, $param){
if(strlen($inTexte)>$limit){
$Str = substr($inTexte, 0, $limit);
if($param) return $Str = substr($Str,0, strrpos($Str," "))."...";
else return $Str;
}else return $inTexte;
}
//==================================
// fin de la fonction chapeau
//==================================
//=============================================
// Fonction AffichePhoto
// Affiche une image en réduisant si besoin est
// $type: retourne à l'écran ou retourne la chaine
// $inCheminImage: chemin de l'image
// $inLargeurMax : Largeur maximale des photos
// $inHauteurMax : Hauteur maximale des photos
// retour : -1 si erreur
//=============================================
function AffichePhoto ($type,$inCheminImage, $inLargeurMax, $inHauteurMax) {
if ($inCheminImage == "")
return -1;
if ( file_exists($inCheminImage) ) {
$Size = GetImageSize($inCheminImage);
$LargeurOriginale = $Size[0];
$HauteurOriginale = $Size[1];
$Format = $LargeurOriginale / $HauteurOriginale;
if ($LargeurOriginale <= $inLargeurMax && $HauteurOriginale <= $inHauteurMax) {
$Largeur = $LargeurOriginale;
$Hauteur = $HauteurOriginale;
} else {
if ($LargeurOriginale > $HauteurOriginale) {
if($inLargeurMax < $LargeurOriginale){
$Largeur = $inLargeurMax;
$Hauteur = intval($inLargeurMax / $LargeurOriginale * $HauteurOriginale);
if ($Hauteur > $inHauteurMax) {
$Hauteur = $inHauteurMax;
$Largeur = intval($Hauteur / $HauteurOriginale * $LargeurOriginale);
}
}
else{
$Hauteur = $inHauteurMax;
$Largeur = intval($Hauteur / $HauteurOriginale * $LargeurOriginale);
}
} else {
if($inHauteurMax < $HauteurOriginale){
$Largeur = intval($inHauteurMax / $HauteurOriginale * $LargeurOriginale);
$Hauteur = $inHauteurMax;
}
else{
$Largeur = $inLargeurMax;
$Hauteur = intval($Largeur / $LargeurOriginale * $HauteurOriginale);
if ($Hauteur > $inHauteurMax) {
$Hauteur = $inHauteurMax;
$Largeur = intval($Hauteur / $HauteurOriginale * $LargeurOriginale);
}
}
}
}
if($type == "html") echo "
";
if($type == "php") return "
";
} else
return -1;
}
//==================================
// fin de la fonction AffichePhoto
//==================================
// ========================
// Fonction Affiche_Texte
// Affiche un texte formaté
// Parametres : $inTexte : le texte a afficher
// retour : rien
// ========================
function AfficheTexte($inTexte) {
// on remplace les /n par des BR
$inTexte = str_replace("\n", "
", $inTexte);
// on retire les / devant les caracteres speciaux
$inTexte = stripslashes($inTexte);
// on affiche le texte
echo $inTexte;
}
//==================================
// fin de la fonction Affiche_Texte
//==================================
// ============================================================================
// Fonction ArretExecution
// Termine l'exécution de la page, écrit un log et redirige vers une autre page
// Parametres :
// $inMessage : message à inscrire dans les logs
// $inRedirection : page de redirection
// retour : rien
// ============================================================================
function ArretExecution($inMessage, $inRedirection) {
// ouverture du fichier
$file = fopen(INTERN_FRONTEND_LOG, "a");
if (!$file) {
echo "
Impossible d'ouvrir le fichier de log.
\n";
exit;
}
/* Ecriture des données. */
fputs($file, "Date : ".date("d-m-y H:i:s")."\n");
fputs($file, "SCRIPT_NAME : ".$_SERVER['SCRIPT_NAME']."\n");
fputs($file, "QUERY_STRING : ".$_SERVER['QUERY_STRING']."\n");
fputs($file, "REMOTE_ADDR : ".$_SERVER['REMOTE_ADDR']."\n");
fputs($file, "REQUEST_METHOD : ".$_SERVER['REQUEST_METHOD']."\n");
fputs($file, "Message : $inMessage\n");
fputs($file, "===============================================================\n");
fclose($file);
/*if (headers_sent) echo "";
else header("Location: $inRedirection");*/
}
//==================================
// fin de la fonction ArretExecution
//==================================
// ========================
// Fonction Affiche_Date_fr
// Affiche une date au format Francais
// Parametres : $inDate : le texte a afficher
// retour : la date
// ========================
function AfficheDate_fr($inDate) {
return substr($inDate,8,2)."/".substr($inDate,5,2)."/".substr($inDate,0,4);
}
//==================================
// fin de la fonction Affiche_Date_fr
//==================================
// ========================
// Fonction Affiche_Date_en
// Affiche une date au format Anglais
// Parametres :
// $inDate : le texte a afficher
// $val : 1 => SQL, 2 => écran
// retour : la date
// ========================
function AfficheDate_en($inDate,$val) {
if($val==1) $car="-";
else if($val==2) $car="/";
return substr($inDate,6,4).$car.substr($inDate,3,2).$car.substr($inDate,0,2);
}
//==================================
// fin de la fonction Affiche_Date_en
//==================================
//==============================================
// Fonction Table2ArraySimple
// Met dans un tableau les valeurs d'une table
// parametres : $inMessage : le message d'erreur
// retour : tableau
// =============================================
function Table2ArraySimple ($reqsimple) {
global $strConnection;
$strRequete="$reqsimple";
$strConnection->Query($strRequete);
if ($strConnection ->rows != 0) {
// on parcourt la liste
for ($intCompteur=0; $intCompteur <$strConnection ->rows; $intCompteur ++){
$strConnection ->Fetch($intCompteur);
$TABLEAU[$strConnection ->data[0]]=$strConnection ->data[1];
}
return $TABLEAU;
}
}
//==================================
// fin de la fonction Table2ArraySimple
//==================================
//==============================================
// Fonction Table2Array
// Met dans un tableau les valeurs d'une table
// parametres : $inMessage : le message d'erreur
// retour : tableau
// =============================================
function Table2Array ($intable,$inId,$inName,$inWhere="1=1 ") {
global $strConnection;
$strRequete="Select $inId,$inName from $intable where $inWhere";
$strConnection->Query($strRequete);
if ($strConnection ->rows != 0) {
// on parcourt la liste
for ($intCompteur=0; $intCompteur <$strConnection ->rows; $intCompteur ++){
$strConnection ->Fetch($intCompteur);
$TABLEAU[$strConnection ->data[0]]=$strConnection ->data[1];
}
return $TABLEAU;
}
}
//==================================
// fin de la fonction Table2Array
//==================================
// ========================
// Fonction reduit_fichier
// Copie une image réduite en taille et en poids
// Parametres : $fichier_image : image à réduire
// $scale : niveau de qualité (max: 100)
// $max_v : largeur de l'image
// $max_h : hauteur de l'image
// $dest : préfixe du nom de la nouvelle image créée
// retour : nom de la nouvelle image créée
// ========================
function reduit_fichier($fichier_image,$scale,$max_v,$max_h,$dest)
{
// MAX_V = HAUTEUR -- MAX_H = LARGEUR
// le nom de l'image "scalée" commencera par ti_ et le nom du fichier original
$ti_fichier_image=$dest;
global $nomfichier;
//extension du fichier
$ext = strtolower(substr($fichier_image,strrpos($fichier_image,".")+1,strlen($fichier_image)-strrpos($fichier_image,".")-1));
if($ext=="jpg" || $ext=="jpeg") $im = ImageCreateFromjpeg($fichier_image);
if($ext=="gif") $im = ImageCreateFromgif($fichier_image);
if($ext=="png") $im = ImageCreateFrompng($fichier_image);
$v=ImageSY($im); // $v prend la hauteur
$h=ImageSX($im); // $h prend la largeur
//Floor Arrondi à l'entier inférieur
//ON GERE LA HAUTEUR
if ($v > $max_v) // Si la hauteur Img, est plus grand que le max, on reduit
{
$taux_hauteur=$v/$max_v; // On recupere le taux necessaire pour retrecir
$ti_v=(int)floor($max_v); // ti_v = taille final de la hauteur
$ti_h=(int)floor($h/$taux_hauteur); // ti_h = taille final de la largeur
}
else $ti_v=$v; // Sinon on fixe la hauteur
// Si il n'a pas deja subbit une modification de la taille
if ($ti_h!="") $h_comp = $ti_h; else $h_comp = $h;
if ($ti_v!="") $v_comp = $ti_v; else $v_comp = $v;
//ON GERE LA LARGEUR
if ($h_comp > $max_h)
{
$taux_largeur=$h_comp/$max_h;
$ti_h=(int)floor($max_h);
$ti_v=(int)floor($v_comp/$taux_largeur);
}
else $ti_h=$h_comp;
$ti_im = imagecreatetruecolor($ti_h,$ti_v);
if (!$ti_im) { $ti_im = imageCreate($ti_h,$ti_v); }
imagecopyresampled($ti_im,$im,0,0,0,0,$ti_h,$ti_v,$h,$v);
//imagecopyresized($ti_im,$im,0,0,0,0,$ti_h,$ti_v,$h,$v);
if($ext=="jpg" || $ext=="jpeg") imagejpeg($ti_im,$ti_fichier_image,$scale);
if($ext=="gif") imagegif($ti_im,$ti_fichier_image,$scale);
if($ext=="png") imagepng($ti_im,$ti_fichier_image,$scale);
return $ti_fichier_image;
}
//==================================
// fin de la fonction reduit_fichier
//==================================
// ========================
// Fonction writeSelect
// Créé les options d'un select
// Parametres : $inStrConnection : connection utlisé
// $selected : valeur pour la selection
// retour : liste du select
// ========================
function writeSelect($inStrConnection, $selected){
$list_options="";
if ($inStrConnection ->rows != 0) {
// on parcourt la liste
for ($intCompt=0; $intCompt <$inStrConnection ->rows; $intCompt ++){
$inStrConnection ->Fetch($intCompt);
if ($inStrConnection ->data[0]==$selected) $list_options .= "
  |
| |
|
|
|
|
About Interns-Canada
Philosophy & Mission
- Our mission is to assist Canadian employers in hiring the best of foreign talent.
- By diligently screening both applicants and companies, Interns-Canada endeavors to make the best possible match between employers and interns, based on job requirements and skill set.
- Our aim is to provide employers with 21st Century solutions to their HR needs while providing opportunities for foreign professionals to apply their skills to the Canadian market place.
- To raise the international profile of Canada as a world renowned destination for travel, education, employment and opportunity
Company History
Interns-Canada was founded by The Personnel Department®; a recognized provider for quality Human Resource solutions to employers for more than 26 years. By utilizing the same structures and standards of quality, Interns-Canada is building upon an already established standard of excellence.
By partnering with some of Canada’s leading educational institutions, Interns-Canada is able to supply the very best in English trained foreign professionals. In 2006 we had a banner year, not only supplying a record number of interns to employers but also establishing new national networks, which allow our internship program to function upon a national scale. Building new relationships with educational institutions, Canadian employers, and the international market place, ensures that Interns-Canada will continue its track record of success well into the future.
As part of The Personnel Department®, Interns-Canada is ranked in the "Top 25 Best Companies in BC" for 5 consecutive years by BC Business and Watson Wyatt, "Top 100 Best Companies" in 2006 in Oregon Business, and is the "Consumer’s Choice Award for Business Excellence" from 2001-2006. The Personnel Department® can also be found on the Better Business Bureau program and on the Australian Achiever Awards for 2006.
|
|
|
|