"; $indexation = "Noindex, Nofollow"; } else $nocache = ""; ?> Soins Infirmiers | Cégep de Jonquière<? echo $titrepage; ?> = $width_orig || $height >= $height_orig ) { $width = $width_orig; $height = $height_orig; } if ( $width_orig < $height_orig ) $width = ($height / $height_orig) * $width_orig; if ( $height_orig < $width_orig ) $height = ($width / $width_orig) * $height_orig; switch ( $type ) // Redimensionnement { case "bmp" : $image_p = imagecreatetruecolor($width, $height); $image = imagecreatefromwbmp($filename); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); // Creation de l'image redimensionner dans le repertoire img_icn $nomfichier = $x.basename($filename); imagewbmp($image_p, $nouveaudossier.$nomfichier); break; case "png" : $image_p = imagecreatetruecolor($width, $height); $image = imagecreatefrompng($filename); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); // Creation de l'image redimensionner dans le repertoire img_icn $nomfichier = $x.basename($filename); imagepng($image_p, $nouveaudossier.$nomfichier); break; case "gif" : $image_p = imagecreatetruecolor($width, $height); $image = imagecreatefromgif($filename); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); // Creation de l'image redimensionner dans le repertoire img_icn $nomfichier = $x.basename($filename); imagegif($image_p, $nouveaudossier.$nomfichier); break; default : $image_p = imagecreatetruecolor($width, $height); $image = imagecreatefromjpeg($filename); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); // Creation de l'image redimensionner dans le repertoire img_icn $nomfichier = $x.basename($filename); imagejpeg($image_p, $nouveaudossier.$nomfichier, 90); break; } return $nomfichier; } function Supimgtemp($image) { unlink ("images/".$image); } // FIN DES FONCTIONS /* **************************************************************************** */ //echo "ref = ".$ref; $vectype = array('ti' =>'titre', 'st' =>'sous-titre', 'pg' =>'paragraphe avec image alignée à gauche', 'pn' =>'paragraphe', 'pd' =>'paragraphe avec image alignée à droite', 'im' =>'image', 'lp' =>'liste à puce', 'ld' =>'définition', 'ci' =>'citation', 'rp' =>'paragraphe en retrait', 'lh' =>'lien hypertexte', 'li' =>'lien hypertexte interne'); $message = ""; $action = ""; @$action = $_REQUEST["action"]; $action2 = ""; @$action2 = $_REQUEST["action2"]; $action3 = ""; @$action3 = $_REQUEST["action3"]; $action4 = ""; @$action4 = $_REQUEST["action4"]; $refelement = ""; @$refelement = $_REQUEST["refelement"]; $type = ""; @$type = $_REQUEST["type"]; /* ************* SUPPRIMER DE LA BASE DE DONNÉES ************ */ if ( $admin == true && $editctn == true && $action == "supprime" ) { $idelement = ""; @$idelement = $_REQUEST["idelement"]; include("connect.php"); $querytype = "select * from telements where id='$idelement'"; $resulttype = mysql_query($querytype); $restype = mysql_fetch_array($resulttype); if ( $restype["type"] == "im" || $restype["type"] == "pg" || $restype["type"] == "pd" ) { $queryoldimg = "select txt from tctn where idelement='$idelement'"; if ( $restype["type"] == "pg" || $restype["type"] == "pd" ) { $queryoldimg = "select txt from tctn where idelement='$idelement' and special='img'"; } $resultoldimg = mysql_query($queryoldimg); $resoldimg = mysql_fetch_array($resultoldimg); $oldimage = $resoldimg["txt"]; //echo $oldimage; @unlink ("images_ctn/".$oldimage); } $query = "delete telements.*,tctn.* from telements,tctn where telements.id='$idelement' && tctn.idelement='$idelement'"; mysql_query($query); $query = "update telements set noelement=noelement-1 where noelement > '$refelement' and ref='$ref'"; mysql_query($query); mysql_close(); $message = "L'élément a été supprimé"; } /* ************* AJOUTER ET MODIFIER ************ */ if ( $admin == true && $editctn == true && $action3 == "Confirmer" ) { include ("connect.php"); if ( $action == "modif2" ) { $idelement = ""; @$idelement = $_REQUEST["idelement"]; $txt = ""; @$txt = $_REQUEST["txt_".$type]; $txt = addslashes($txt); if ( $type == "ti" || $type == "st" || $type == "pn" || $type == "ci" || $type == "rp" ) { $align = ""; @$align = $_REQUEST["lst_align"]; $align = addslashes($align); $queryvalid = "select * from telements,tctn where telements.ref='$ref' and telements.noelement='$refelement' and tctn.txt='$txt' and tctn.align='$align'"; $resultvalid = mysql_query($queryvalid); if ( mysql_num_rows($resultvalid)>=1 ) { $message = "L'élément est déjà modifié"; } else { $queryupdate = "update tctn set txt='$txt', align='$align' where idelement='$idelement'"; if (mysql_query($queryupdate)) $message = "Votre ".$vectype[$type]." a été modifié"; } } elseif ( $type == "ld" ) { $txtti = ""; @$txtti = $_REQUEST["txt_ld_ti"]; $txtti = addslashes($txtti); $queryupdate = "update tctn set txt='$txt' where idelement='$idelement' and special=''"; $queryupdate2 = "update tctn set txt='$txtti' where idelement='$idelement' and special='titre'"; if ( mysql_query($queryupdate) && mysql_query($queryupdate2) ) $message = "Votre ".$vectype[$type]." a été modifié"; } elseif ( $type == "lh" || $type == "li" ) { $txt = ""; @$txt = $_REQUEST["txt_lh"]; $txt = addslashes($txt); $txtli = ""; @$txtli = $_REQUEST["txt_li"]; $txtli = addslashes($txtli); $align = ""; @$align = $_REQUEST["lst_align"]; $align = addslashes($align); $queryupdate = "update tctn set txt='$txt', align='$align' where idelement='$idelement' and special=''"; $queryupdate2 = "update tctn set txt='$txtli' where idelement='$idelement' and special='lien'"; if ( mysql_query($queryupdate) && mysql_query($queryupdate2) ) $message = "Votre ".$vectype[$type]." a été modifié"; } elseif ( $type == "im" ) { $align = ""; @$align = $_REQUEST["lst_align"]; $align = addslashes($align); $image = ""; @$image = $_FILES["image_file"]["name"]; $queryverifimg = "select * from tctn where idelement='$idelement'"; $resverifimg = mysql_query($queryverifimg); $resverifimg = mysql_fetch_array($resverifimg); $verifimg = $resverifimg["txt"]; $verifimg = substr($verifimg,4); $queryvalid = "select * from telements,tctn where telements.ref='$ref' and tctn.idelement='$idelement' and tctn.txt='$verifimg'"; $resultvalid = mysql_query($queryvalid); if ( mysql_num_rows($resultvalid)>=1 ) { $message = "L'élément est déjà inscrit"; } else { if ( !empty($image) ) { $queryoldimg = "select txt from tctn where idelement='$idelement'"; $resultoldimg = mysql_query($queryoldimg); $resoldimg = mysql_fetch_array($resultoldimg); $oldimage = $resoldimg["txt"]; @unlink ("images_ctn/".$oldimage); $path_parts = pathinfo($image); $extension = $path_parts['extension']; if ( $extension == "jpg" || $extension == "jpeg" || $extension == "gif" || $extension == "png" || $extension == "bmp" ) { $align = addslashes ($align); $imagefile = Telecharge(); $image = $imagefile; // ajoute des 0 pour etre sur d'avoir 3 chiffre $imgcode = rand(1,999); $imgcode = sprintf("%003s", $imgcode); $imgcode .= "_"; $nouveaufichier = AjoutIcone($image, $extension, 450, 450, "images_ctn/", $imgcode); Supimgtemp($image); $queryupdate = "update tctn set txt='$nouveaufichier', align='$align' where idelement='$idelement'"; if (mysql_query($queryupdate)) $message = "Votre ".$vectype[$type]." a été modifié"; } } else { $queryupdate = "update tctn set align='$align' where idelement='$idelement'"; if (mysql_query($queryupdate)) $message = "Votre ".$vectype[$type]." a été modifié"; } } } elseif ( $type == "pg" || $type == "pd" ) { $align = ""; @$align = $_REQUEST["lst_align"]; $align = addslashes($align); $image = ""; @$image = $_FILES["image_file"]["name"]; $txt = ""; @$txt = $_REQUEST["txt_".$type]; $txt = addslashes($txt); $queryverifimg = "select * from tctn where idelement='$idelement' and special='img'"; $resverifimg = mysql_query($queryverifimg); $resverifimg = mysql_fetch_array($resverifimg); $verifimg = $resverifimg["txt"]; $verifimg = substr($verifimg,4); $queryvalid = "select * from telements,tctn where telements.ref='$ref' and tctn.idelement='$idelement' and tctn.txt='$verifimg' and tctn.special='img'"; $resultvalid = mysql_query($queryvalid); if ( mysql_num_rows($resultvalid)>=1 ) { $message = "L'élément est déjà inscrit"; } else { if ( !empty($image) && !empty($txt) ) { $queryoldimg = "select txt from tctn where idelement='$idelement' and special='img'"; $resultoldimg = mysql_query($queryoldimg); $resoldimg = mysql_fetch_array($resultoldimg); $oldimage = $resoldimg["txt"]; @unlink ("images_ctn/".$oldimage); $path_parts = pathinfo($image); $extension = $path_parts['extension']; if ( $extension == "jpg" || $extension == "jpeg" || $extension == "gif" || $extension == "png" || $extension == "bmp" ) { $align = addslashes ($align); $imagefile = Telecharge(); $image = $imagefile; // ajoute des 0 pour etre sur d'avoir 3 chiffre $imgcode = rand(1,999); $imgcode = sprintf("%003s", $imgcode); $imgcode .= "_"; $nouveaufichier = AjoutIcone($image, $extension, 250, 250, "images_ctn/", $imgcode); Supimgtemp($image); $queryupdate1 = "update tctn set txt='$nouveaufichier' where idelement='$idelement' and special='img'"; $queryupdate2 = "update tctn set txt='$txt', align='$align' where idelement='$idelement' and special=''"; if ( mysql_query($queryupdate1) && mysql_query($queryupdate2) ) $message = "Votre ".$vectype[$type]." a été modifié"; } } elseif ( !empty($txt) ) { $queryupdate = "update tctn set txt='$txt', align='$align' where idelement='$idelement' and special=''"; if ( mysql_query($queryupdate) ) $message = "Votre ".$vectype[$type]." a été modifié"; } } } mysql_close(); } else { $noelement = $refelement + 1; $align = ""; @$align = $_REQUEST["lst_align"]; //echo $align; if ( $type == "ti" || $type == "st" || $type == "pn" || $type == "ci" || $type == "rp" ) { $txt = ""; @$txt = $_REQUEST["txt_".$type]; $txt = addslashes ($txt); $align = addslashes ($align); include ("connect.php"); if ( !empty($txt) ) { $query = "insert into telements values ('','$ref','$noelement','$type')"; $queryvalid = "select * from telements,tctn where telements.ref='$ref' and telements.noelement='$noelement' and tctn.txt='$txt' and tctn.align='$align'"; $resultvalid = mysql_query($queryvalid); if ( mysql_num_rows($resultvalid)>=1 && $txt != " " ) { $message = "L'élément est déjà inscrit"; } else { $queryajustno = "update telements set noelement=noelement+1 where noelement > '$refelement' and ref='$ref'"; mysql_query($queryajustno); //------------------------------> insertion if ( mysql_query ($query) ) { $idelement = mysql_insert_id (); $query = "insert into tctn values ('','$txt','$align','','','$idelement')"; if ( mysql_query ($query) ) { $message = "Votre ".$vectype[$type]." est ajouté
"; } } } mysql_close(); } else { $message = "Le texte n'a pas été inscrit"; } } elseif ( $type == "pg" || $type == "pd" ) { $image = ""; @$image = $_FILES["image_file"]["name"]; $txt = ""; @$txt = $_REQUEST["txt_".$type]; if ( !empty($image) && !empty($txt) ) { $txt = addslashes ($txt); $align = addslashes ($align); $queryvalid = "select * from telements,tctn where telements.ref='$ref' and telements.noelement='$noelement' and tctn.txt='$txt' and align='$align' and tctn.special=''"; $resultvalid = mysql_query($queryvalid); if ( mysql_num_rows($resultvalid)>=1 ) { $message = "L'élément est déjà inscrit"; } else { $path_parts = pathinfo($image); $extension = $path_parts['extension']; if ( $extension == "jpg" || $extension == "jpeg" || $extension == "gif" || $extension == "png" || $extension == "bmp" ) { $align = addslashes ($align); $query = "insert into telements values ('','$ref','$noelement','$type')"; $imagefile = Telecharge(); $image = $imagefile; // ajoute des 0 pour etre sur d'avoir 3 chiffre $imgcode = rand(1,999); $imgcode = sprintf("%003s", $imgcode); $imgcode .= "_"; $nouveaufichier = AjoutIcone($image, $extension, 250, 250, "images_ctn/", $imgcode); Supimgtemp($image); $queryajustno = "update telements set noelement=noelement+1 where noelement > '$refelement' and ref='$ref'"; mysql_query($queryajustno); //------------------------------> insertion if ( mysql_query ($query) ) { $idelement = mysql_insert_id (); $query1 = "insert into tctn values ('','$nouveaufichier','','img','','$idelement')"; $query2 = "insert into tctn values ('','$txt','$align','','','$idelement')"; if ( mysql_query ($query1) && mysql_query ($query2) ) { $message = "Votre ".$vectype[$type]." est ajouté
"; } } } else { $message = "Le format de l'image n'est pas géré ou le paragraphe a été laissé vide"; } } } } elseif ( $type == "im" ) { $image = ""; @$image = $_FILES["image_file"]["name"]; if ( !empty($image) ) { $align = addslashes ($align); $path_parts = pathinfo($image); $extension = $path_parts['extension']; $queryvalid = "select * from telements,tctn where telements.ref='$ref' and telements.noelement='$noelement' and tctn.txt like '%$image'"; $resultvalid = mysql_query($queryvalid); if ( mysql_num_rows($resultvalid)>=1 ) { $message = "L'élément est déjà inscrit"; } else { if ( $extension == "jpg" || $extension == "jpeg" || $extension == "gif" || $extension == "png" || $extension == "bmp" ) { $align = addslashes ($align); $query = "insert into telements values ('','$ref','$noelement','$type')"; $imagefile = Telecharge(); $image = $imagefile; // ajoute des 0 pour etre sur d'avoir 3 chiffre $imgcode = rand(1,999); $imgcode = sprintf("%003s", $imgcode); $imgcode .= "_"; $nouveaufichier = AjoutIcone($image, $extension, 450, 450, "images_ctn/", $imgcode); Supimgtemp($image); $queryajustno = "update telements set noelement=noelement+1 where noelement > '$refelement' and ref='$ref'"; mysql_query($queryajustno); //------------------------------> insertion if ( mysql_query ($query) ) { $idelement = mysql_insert_id (); $query = "insert into tctn values ('','$nouveaufichier','$align','','','$idelement')"; if ( mysql_query ($query) ) { $message = "Votre ".$vectype[$type]." est ajouté
"; } } } else { $message = "Le format de l'image n'est pas géré. Veuillez utiliser des images JPG, JPEG, GIF ou PNG"; } } } } elseif ( $type == "lp" ) { $guidepuce = ""; $nbpucestot = ""; @$nbpucestot = $_REQUEST["nbpucestot"]; @include("connect.php"); $queryvalid = "select * from telements,tctn where"; $guidevalid = "pareil"; for ( $i=1; $i<=$nbpucestot; $i++ ) { $txt = ""; @$txt = $_REQUEST["txt_lp".$i]; if ( !empty($txt) ) { $guidepuce = "ok"; $txt = addslashes ($txt); } $queryvalid = "select * from telements,tctn where telements.ref='$ref' and telements.noelement='$noelement' and tctn.txt='$txt' and tctn.intalign='$i'"; $resultvalid = mysql_query($queryvalid); if ( mysql_num_rows($resultvalid)>=1 && $guidevalid == "pareil" ) $guidevalid = "pareil"; else $guidevalid = "ok"; } if ( $guidepuce == "ok" ) { $query = "insert into telements values ('','$ref','$noelement','$type')"; if ( $guidevalid == "ok" ) { if ( $action4 == "modif" ) { $idelement = ""; @$idelement = $_REQUEST["idelement"]; $querydel = "delete telements.*,tctn.* from telements,tctn where telements.id='$idelement' && tctn.idelement='$idelement'"; $noelement = $noelement - 1; $query = "insert into telements values ('','$ref','$noelement','$type')"; mysql_query($querydel); } else { $queryajustno = "update telements set noelement=noelement+1 where noelement > '$refelement' and ref='$ref'"; mysql_query($queryajustno); } if ( mysql_query($query) ) { $idelement = mysql_insert_id (); for ( $i=1; $i<=$nbpucestot; $i++ ) { $txt = ""; @$txt = $_REQUEST["txt_lp".$i]; if ( !empty($txt) ) { $txt = addslashes ($txt); $query = "insert into tctn values ('','$txt','','','$i','$idelement')"; if ( mysql_query ($query) ) { $message = "Votre ".$vectype[$type]." est ajouté
"; } } } } } else $message = "L'élément est déjà inscrit"; } else { $message = "La liste n'a pas été inscrit"; } mysql_close(); } elseif ( $type == "ld" ) { $txt = ""; @$txt = $_REQUEST["txt_".$type]; $txt = addslashes ($txt); $txtti = ""; @$txtti = $_REQUEST["txt_ld_ti"]; $txtti = addslashes ($txtti); include("connect.php"); if ( !empty($txt) && !empty($txtti) ) { $query = "insert into telements values ('','$ref','$noelement','$type')"; $queryvalid = "select * from telements,tctn where telements.ref='$ref' and telements.noelement='$noelement' and tctn.txt='$txt'"; $resultvalid = mysql_query($queryvalid); if ( mysql_num_rows($resultvalid)>=1 ) { $message = "L'élément est déjà inscrit"; } else { $queryajustno = "update telements set noelement=noelement+1 where noelement > '$refelement' and ref='$ref'"; mysql_query($queryajustno); //------------------------------> insertion if ( mysql_query ($query) ) { $idelement = mysql_insert_id (); $query = "insert into tctn values ('','$txt','','','','$idelement')"; $query2 = "insert into tctn values ('','$txtti','','titre','','$idelement')"; if ( mysql_query ($query) && mysql_query($query2) ) { $message = "Votre ".$vectype[$type]." est ajouté
"; } } } mysql_close(); } else { $message = "Le texte n'a pas été inscrit"; } } elseif ( $type == "lh" || $type == "li" ) { $txt = ""; @$txt = $_REQUEST["txt_lh"]; $txt = addslashes ($txt); $txtli = ""; @$txtli = $_REQUEST["txt_li"]; $txtli = addslashes ($txtli); $align = ""; @$align = $_REQUEST["lst_align"]; $align = addslashes ($align); include("connect.php"); if ( !empty($txt) && !empty($txtli) ) { $query = "insert into telements values ('','$ref','$noelement','$type')"; $queryvalid = "select * from telements,tctn where telements.ref='$ref' and telements.noelement='$noelement' and tctn.txt='$txt' and tctn.special=''"; $resultvalid = mysql_query($queryvalid); if ( mysql_num_rows($resultvalid) >=1 && $txt != "haut" ) { $message = "L'élément est déjà inscrit"; } else { $queryajustno = "update telements set noelement=noelement+1 where noelement > '$refelement' and ref='$ref'"; mysql_query($queryajustno); //------------------------------> insertion if ( mysql_query ($query) ) { $idelement = mysql_insert_id (); $query = "insert into tctn values ('','$txt','$align','','','$idelement')"; $query2 = "insert into tctn values ('','$txtli','','lien','','$idelement')"; if ( mysql_query ($query) && mysql_query($query2) ) { $message = "Votre ".$vectype[$type]." est ajouté
"; } } } mysql_close(); } else { $message = "Le texte n'a pas été inscrit"; } } } } elseif ( $admin == true && $editctn == true && $action3 == "Ajouter un element" && $action == "aj" ) { $action = "ajout"; $action2 = "select"; } /* ************* PREPARATION DE L'AFFICHAGE ************ */ @include("date.php"); // MENU UTILITAIRE -> Boutons et rollover @include("mutil.php"); // MENU PRINCIPALE -> Boutons et rollover @include ("mprin.php"); // MENU SECONDAIRE -> Boutons et rollover // ET TITRE DE SECTION if ( substr($ref,0,4) == "std_" ) { if ( substr($ref,0,8) != "std_mut_" ) { @include ("msec_".substr($ref,4,3).".php"); $titrechem = "\"\"\"\""; } else { @include ("msec_defaut.php"); $titrechem = "\"\""; } } else { @include ("msec_defaut.php"); if ( !empty($ref) ) { $querytitre = "select * from tref where ref='$ref'"; include("connect.php"); $restitre = mysql_query ($querytitre); $restitre = mysql_fetch_array($restitre); @$titrechem = $restitre["titre"]; $titrechem = "$titrechem"; mysql_close(); } else { $titrechem = "\"Accueil\""; } } // ************************ MESSAGE ************************** if ( !empty($message) ) { $message = "
$message
"; } // **************************************************************************** ?>
Soins Infirmiers
" />
".$date.""; ?>
 

"; ?>
logo cégep de Jonquière
Crédits "; if ( $ref == "std_mut_cre" ) { $liencredits = "Crédits "; } echo "

 
$liencredits

"; ?>
Technique d'Intégration Multimédia

© 2006 Soins Infirmiers  |  Cégep de Jonquière  •  Tous droits réservés

Cégep de Jonquière