コード例 #1
0
ファイル: liste_options.php プロジェクト: rhertzog/lcs
		//==========================================
		$ecriture=fwrite($fichier_content_xml,'<table:table-row table:style-name="ro1">');
		$ecriture=fwrite($fichier_content_xml,'<table:table-cell table:number-columns-repeated="'.$nb_col_vides.'"/>');
		$ecriture=fwrite($fichier_content_xml,'</table:table-row>');
		//==========================================
		$ecriture=fwrite($fichier_content_xml,'</table:table>');
		$ecriture=fwrite($fichier_content_xml,'</office:spreadsheet>');
		$ecriture=fwrite($fichier_content_xml,'</office:body>');
		$ecriture=fwrite($fichier_content_xml,'</office:document-content>');
		//==========================================

		$fermeture=fclose($fichier_content_xml);
		
		set_time_limit(3000);

		$fichier_liste="options_eleves_gepi_".suppr_accents(preg_replace("/'/","&apos;",preg_replace('/[" ]/','',$projet)))."_".date("Ymd_Hi");

		if(file_exists("../lib/ss_zip.class.php")){
			//require_once("ss_zip.class.php");
			require_once("../lib/ss_zip.class.php");

			$zip= new ss_zip('',6);
			$zip->add_file("../temp/".$user_temp_directory."/content.xml",'content.xml');
			$zip->add_file('liste_options_ods/meta.xml','meta.xml');
			$zip->add_file('liste_options_ods/mimetype','mimetype');
			$zip->add_file('liste_options_ods/settings.xml','settings.xml');
			$zip->add_file('liste_options_ods/styles.xml','styles.xml');
			$zip->add_file('liste_options_ods/META-INF/manifest.xml','META-INF/manifest.xml');
			$zip->save("../temp/".$user_temp_directory."/$fichier_liste.zip");

			rename("../temp/".$user_temp_directory."/$fichier_liste.zip","../temp/".$user_temp_directory."/".$fichier_liste.".ods");
コード例 #2
0
ファイル: adresseParis.php プロジェクト: rebe100x/YAKREP
 $num = count($data);
 if ($row == 0) {
     $csvHead = $data;
 } else {
     if ($row < 500 && $row >= 0) {
         sleep(1);
         $tab[$row - 1] = $data;
         //$line = str_replace("\r\n", "", $line);
         $streetName = trim($data[3]);
         $streetHisto = !empty($data[6]) ? $data[6] : "";
         $streetArr = !empty($data[29]) ? $data[29] : "";
         $streetArr = getZipCodeFromParisArr($streetArr);
         if (empty($streetName)) {
             echo '<br> Check Name line ' . $row;
         } else {
             $streetNameClean = suppr_accents($streetName);
         }
         //echo '<br><b>Name :</b>'.utf8_decode($streetName);
         //echo '<br><b>Name :</b>'.utf8_decode($streetNameClean);
         /*
         // CREATE ONTOLOGY
         $entry = $ontolgyXML->Pkg[0]->addChild('Entry');
         $entry->addAttribute('display', $streetName);
         $form = $entry->addChild('Form');
         $form->addAttribute('level','exact');
         */
         // CREATE INSERT IN DB
         $currentPlace = new Place();
         $currentPlace->title = $streetName;
         $currentPlace->content = $streetHisto;
         $currentPlace->origin = $origin;
コード例 #3
0
ファイル: genere_ods.php プロジェクト: rhertzog/lcs
		$ecriture=fwrite($fichier_content_xml,'<table:table table:name="'.$nom_feuillet.'" table:style-name="ta1" table:print="false">');
	
		$ecriture=fwrite($fichier_content_xml,'<office:forms form:automatic-focus="false" form:apply-design-mode="false"/><table:table-column table:style-name="co1" table:default-cell-style-name="Default"/><table:table-column table:style-name="co2" table:default-cell-style-name="ce9"/><table:table-column table:style-name="co3" table:default-cell-style-name="ce9"/><table:table-column table:style-name="co4" table:default-cell-style-name="ce9"/><table:table-column table:style-name="co2" table:default-cell-style-name="ce9"/><table:table-column table:style-name="co5" table:default-cell-style-name="Default"/>');
	
		$cpt=0;
		//$fich_source_csv=fopen("csv/$fichier_csv","r");
		$fich_source_csv=fopen("../temp/".$user_temp_directory."/$fichier_csv","r");
		if($fich_source_csv) {
			while(!feof($fich_source_csv)){
				$ligne=fgets($fich_source_csv,4096);
	
				// Bricolage pas chouette pour changer le séparateur du CSV
				$ligne_tmp=preg_replace("/°/"," ",preg_replace("/;/",",",preg_replace('/,/',' ',$ligne)));
	
				//$ligne_corrigee=trim(suppr_accents(preg_replace("/'/","&apos;",preg_replace('/"/','',$ligne_tmp))));
				$ligne_corrigee=trim(suppr_accents(preg_replace("/'/","&apos;",preg_replace('/"/','',preg_replace('/°/','°',$ligne_tmp)))));
				//echo "<p>\$ligne=$ligne<br>\n";
				//echo "\$ligne_corrigee=$ligne_corrigee</p>\n";
	
				//$tabligne=explode(',',$ligne_corrigee);
				$tabligne=explode(',',$ligne_corrigee);
	
				if($ligne_corrigee=='') {
					// Ligne vide entre deux requetes
					$ecriture=fwrite($fichier_content_xml,'<table:table-row table:style-name="ro1">');
					$ecriture=fwrite($fichier_content_xml,'<table:table-cell table:style-name="ce5"/>');
					$ecriture=fwrite($fichier_content_xml,'<table:table-cell table:style-name="ce6" table:number-columns-repeated="4"/><table:table-cell/>');
					$ecriture=fwrite($fichier_content_xml,'</table:table-row>');
				}
				elseif(!isset($tabligne[1])) {
					if(mb_substr($tabligne[0],0,9)=="Requete n") {
コード例 #4
0
     $status = 1;
     $geolocGMAP = array((double) $geolocationInput[0], (double) $geolocationInput[1]);
     $addressGMAP = array("street" => "", "arr" => "", "city" => "", "state" => "", "area" => "", "country" => "", "zip" => "");
     $print = 1;
     $formatted_addressGMAP = $addressInput;
 } else {
     // FROM GMAP
     echo "<br> Call to GMAP: " . $loc . ', ' . $defaultPlaceTitle . ', ' . $defaultPlace['address']['country'];
     $logCallToGMap++;
     echo '<br>loc' . $loc;
     echo '<br>laville' . $laville;
     echo '<br>$defaultPlace title' . $defaultPlaceTitle;
     echo '<br>$defaultPlace country' . $defaultPlace['address']['country'];
     echo '<br>$lieu' . $lieu;
     //$gQuery = urlencode(utf8_decode(suppr_accents($loc.( (strlen($laville)> 0 && $laville != $defaultPlaceTitle && !in_array($loc,$ville) ) ? ', '.$laville:'').', '.$defaultPlaceTitle.'. '.$defaultPlace['address']['country'])));
     $gQuery = urlencode(utf8_decode(suppr_accents($loc . (strlen($laville) > 0 && $laville != $defaultPlaceTitle && preg_match('/^' . $loc . '$/', $laville) === FALSE ? ', ' . $laville : '') . ', ' . $defaultPlaceTitle . ' ' . $defaultPlace['address']['country'])));
     //echo 'LIEU'.sizeof($lieu);
     if (sizeof($lieu) == 0) {
         $resGMap = getLocationGMap($gQuery, 'PHP', 1, $conf);
     } else {
         $resGMap = getPlaceGMap($gQuery, 'PHP', 1, $conf);
     }
     echo '___<br>';
     if (!empty($resGMap) && $resGMap['formatted_address'] != $defaultPlaceTitle . ', ' . $defaultPlace['address']['country']) {
         echo "<br> GMAP found the coordinates of this location ! ";
         // check if the result is in the zone
         $zoneObj = new Zone();
         $zoneNums = $zoneObj->findNumByLocation(array('lat' => $resGMap['location'][0], 'lng' => $resGMap['location'][1]));
         if (!in_array($feed['zone'], $zoneNums)) {
             echo "<br><b>Err:</b>Location found is not in the feed zone ( " . $feed['zone'] . " )";
             $status = 12;
コード例 #5
0
ファイル: info.php プロジェクト: rebe100x/YAKREP
 public function setYakCatOuest($catPathArray)
 {
     $this->yakCat = array();
     $this->humanCat = array();
     //var_dump($this);
     $yakCatArray = iterator_to_array($this->yakCatColl->find());
     foreach ($catPathArray as $catPath) {
         foreach ($yakCatArray as $cat) {
             if (substr($cat['pathN'], -strlen(strtoupper(suppr_accents(utf8_encode($catPath))))) == strtoupper(suppr_accents(utf8_encode($catPath)))) {
                 $this->yakCat[] = $cat['_id'];
                 $this->yakCatName[] = $cat['title'];
                 echo $cat['_id'];
                 echo $cat['title'];
             }
         }
     }
 }
コード例 #6
0
ファイル: inscription.php プロジェクト: Pyozer/Interminale
     setFlash($error, "danger");
 } else {
     if ($password != $repeatpassword) {
         $error = erreur('USER_SAME_PASSWORD');
         setFlash($error, "danger");
     } else {
         if (strlen(utf8_decode($password)) < 6) {
             $error = erreur('USER_PASSWORD_CARACT');
             setFlash($error, "danger");
         } else {
             /* Met en majuscule la 1ere lettre du prenom et nom */
             $prenom = ucname($prenom);
             $nom = ucname($nom);
             /* Supprime accent etc.. pour le pseudo */
             $nom_min = suppr_accents($nom);
             $prenom_min = suppr_accents($prenom);
             $pseudo = $prenom_min . "." . $nom_min;
             $prenomplusnom = $prenom . " " . $nom;
             try {
                 /* On vérifie si pas déjà adresse mail */
                 $checkemail = $DB_con->prepare("SELECT * FROM users WHERE email=:email");
                 $checkemail->execute(array('email' => $email));
                 $row = $checkemail->fetch(PDO::FETCH_ASSOC);
                 /* On vérifie si pas le même nom / prenom */
                 $checkuser = $DB_con->prepare("SELECT * FROM users WHERE prenomplusnom=:prenomplusnom");
                 $checkuser->execute(array('prenomplusnom' => $prenomplusnom));
                 $datedenaissance = $dobannee . "-" . $dobmois . "-" . $dobjour;
                 $emailexist = $checkemail->rowCount();
                 $userexist = $checkuser->rowCount();
                 if ($emailexist > 0) {
                     $error = erreur('USER_EMAIL_TAKE');
コード例 #7
0
ファイル: ontology2DB.php プロジェクト: rebe100x/YAKREP
$placeColl = $db->place;
$batchlogColl = $db->batchlog;
$yakdicoYakCatId = "5056b7aafa9a95180b000000";
$countInsert = 0;
$row = 0;
$countGMap = 0;
foreach ($ontolgyXML as $key0 => $value) {
    foreach ($value as $key => $value2) {
        foreach ($value2->attributes() as $attributeskey => $streetNameArray) {
            $streetName = (string) $streetNameArray;
            echo "<br>" . $attributeskey . "=" . $streetName;
            // CHECK IF DATA EXISTS IN DB
            $res = $placeColl->findOne(array('title' => $streetName));
            if (empty($res)) {
                echo "<br>Location not found in DB, we start inserting...";
                $resGMap = getLocationGMap(urlencode(utf8_decode(suppr_accents($streetName . ', Paris, France'))), 'PHP', 1);
                $geolocGMAP = $resGMap['location'];
                $addressGMAP = $resGMap['address'];
                $statusGMAP = $resGMap['status'];
                echo 'STATUS' . $statusGMAP;
                $countGMap++;
                if (!empty($geolocGMAP) && $statusGMAP == "OK") {
                    $status = 1;
                    echo "<br>Found location with GMap<br>";
                } else {
                    echo "<br>GMap failed to find location. The place is stored in status 10.<br>GMAP STATUS = " . $statusGMAP;
                    $status = 10;
                }
                $countInsert++;
                var_dump($streetName);
                $place = array("title" => $streetName, "content" => "", "thumb" => "", "origin" => "ontology yakdico", "access" => 2, "licence" => "Yakwala", "outGoingLink" => "", "yakCat" => array(new MongoId($yakdicoYakCatId)), "creationDate" => new MongoDate(gmmktime()), "lastModifDate" => new MongoDate(gmmktime()), "location" => array("lat" => $geolocGMAP[0], "lng" => $geolocGMAP[1]), "status" => 1, "user" => 0, "zone" => 1, "address" => $addressGMAP);
コード例 #8
0
ファイル: place.php プロジェクト: rebe100x/YAKREP
 public function setYakCat($catPathArray)
 {
     //var_dump($this);
     $yakCatArray = iterator_to_array($this->yakCatColl->find());
     foreach ($catPathArray as $catPath) {
         foreach ($yakCatArray as $cat) {
             if ($cat['pathN'] == strtoupper(suppr_accents(utf8_encode($catPath))) || "#" . $cat['pathN'] == strtoupper(suppr_accents(utf8_encode($catPath)))) {
                 $this->yakCat[] = $cat['_id'];
                 $this->humanCat[] = $cat['title'];
             }
         }
     }
 }
コード例 #9
0
ファイル: fetchPAPI.php プロジェクト: rebe100x/YAKREP
 echo '<br>$defaultPlace title : ';
 var_dump($defaultPlaceTitle);
 echo '<br>$defaultPlace country : ' . $defaultPlace['address']['country'];
 echo '<br>$lieu : ';
 var_dump($lieu);
 $gQuery = $loc;
 if (strlen($laville) > 0 && $laville != $defaultPlaceTitle && !preg_match('/\\b' . $laville . '\\b/', $gQuery)) {
     $gQuery .= ', ' . $laville;
 }
 if (!preg_match('/\\b' . $defaultPlaceTitle . '\\b/', $gQuery)) {
     $gQuery .= ', ' . $defaultPlaceTitle;
 }
 if (!preg_match('/\\b' . $defaultPlace['address']['country'] . '\\b/', $gQuery) && !empty($defaultPlace['address']['country'])) {
     $gQuery .= ', ' . $defaultPlace['address']['country'];
 }
 $gQuery = urlencode(utf8_decode(suppr_accents($gQuery)));
 //$gQuery = urlencode(utf8_decode(suppr_accents($loc.( (strlen($laville)> 0 && $laville != $defaultPlaceTitle && preg_match('/^'.$loc.'$/',$laville) === FALSE ) ? ', '.$laville:'').', '.((preg_match('/^'.$loc.'$/',$defaultPlaceTitle) === FALSE)?$defaultPlaceTitle:'').' '. ( (preg_match('/^'.$loc.'$/',$defaultPlace['address']['country'] ) === FALSE) ? $defaultPlace['address']['country']:'')  )));
 echo '<br> QUERY = ' . $gQuery;
 if (sizeof($loc) > 0) {
     $resGMap = getLocationGMap($gQuery, 'PHP', 1, $conf);
 } elseif (sizeof($lieu) > 0) {
     $resGMap = getPlaceGMap($gQuery, 'PHP', 1, $conf);
 } else {
     $resGMap = '';
 }
 if (!empty($resGMap['gQuery'])) {
     $fullgQuery = $resGMap['gQuery'];
 }
 echo '<br>';
 if (!empty($resGMap) && !empty($resGMap['formatted_address']) && !empty($resGMap['location']) && $resGMap['formatted_address'] != $defaultPlace['address']['country'] && $resGMap['formatted_address'] != $defaultPlaceTitle && $resGMap['formatted_address'] != $defaultPlaceTitle . ', ' . $defaultPlace['address']['country']) {
     echo "<br> GMAP found the coordinates of this location ! ";
コード例 #10
0
ファイル: batch.php プロジェクト: rebe100x/YAKREP
 // Heat set to 1 for new infos
 $info->heat = 1;
 // Default yakCat
 $cat = array("CULTURE", "AGENDA");
 $catName = array("Culture", "Agenda");
 /* Begin regex to find yakCats */
 $freeTag = array();
 $cibulTags = array();
 if (isset($result->data->tags->fr)) {
     $cibulTags = explode(",", $result->data->tags->fr);
 } else {
     $cibulTags = explode(",", $result->data->tags->en);
 }
 foreach ($cibulTags as $tag) {
     $freeTag[] = $tag;
     $temp_tag = suppr_accents($tag);
     if (preg_match("/THEATRE/i", $temp_tag)) {
         $cat[] = "CULTURE#THEATRE";
         $catName[] = "Théatre";
     } else {
         if (preg_match("/CONCERT/i", $temp_tag)) {
             $cat[] = "CULTURE#MUSIQUE";
             $catName[] = "Musique";
         } else {
             if (preg_match("/OPERA/i", $temp_tag)) {
                 $cat[] = "CULTURE#MUSIQUE";
                 $catName[] = "Musique";
                 $info->freeTag[] = "Classique";
                 $info->freeTag[] = "Opéra";
             }
         }
コード例 #11
0
ファイル: accessfilter.php プロジェクト: rhertzog/lcs
 $nom_propre1[$indecs] = strip_tags(stripslashes($nom_propre1[$indecs]));
 $nom_propre2[$indecs] = strip_tags(stripslashes($nom_propre2[$indecs]));
 if (get_magic_quotes_gpc()) {
     $prenom_propre[$indecs] = utf8_decode($_POST['prenom' . $indecs]);
     $oMyFilter = new InputFilter($aAllowedTags, $aAllowedAttr, 0, 0, 1);
     $prenom_propre[$indecs] = $oMyFilter->process($prenom_propre[$indecs]);
 } else {
     $prenom_propre[$indecs] = $_POST['prenom' . $indecs];
     // htlmpurifier
     $config = HTMLPurifier_Config::createDefault();
     //$config->set('Core.Encoding', 'ISO-8859-15');
     $config->set('HTML.Doctype', 'XHTML 1.0 Strict');
     $purifier = new HTMLPurifier($config);
     $prenom_propre[$indecs] = $purifier->purify($prenom_propre[$indecs]);
 }
 $prenom_propre[$indecs] = suppr_accents($prenom_propre[$indecs]);
 $prenom_propre[$indecs] = mb_ereg_replace("^[[:blank:]]", "", $prenom_propre[$indecs]);
 $prenom_propre[$indecs] = mb_ereg_replace("[[:blank:]]\$", "", $prenom_propre[$indecs]);
 $prenom_propre[$indecs] = mb_ereg_replace("'|[[:blank:]]", "_", $prenom_propre[$indecs]);
 $prenom_propre[$indecs] = StrToLower($prenom_propre[$indecs]);
 $prenom_propre[$indecs] = strip_tags(stripslashes($prenom_propre[$indecs]));
 //verifier la presence des eleves dans les classes
 //1.recherche de la classe dans le ldap
 $groups = search_groups('cn=classe*');
 if (count($groups)) {
     for ($loup = 0; $loup < count($groups); $loup++) {
         $cla = $_POST['division' . $indecs];
         if (mb_ereg("(_{$cla})\$", $groups[$loup]["cn"]) || $cla == $groups[$loup]["cn"]) {
             $full_classe = $groups[$loup]["cn"];
             break;
         }
コード例 #12
0
ファイル: mp2013.php プロジェクト: rebe100x/YAKREP
    header("Content-Type: application/rss+xml; charset=utf-8");
}
$header = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><items>";
foreach ($data['rdf:Description'] as $item) {
    $address = '';
    $place = '';
    $geolocation = '';
    $thumb = "";
    $freeTag = array();
    $yakcats = array();
    if (!empty($item['name']) && $item['canceled'] == 'False' && !empty($item['startDate']) && (!empty($item['event:location']['place:geo']['geo:latitude']) && !empty($item['event:location']['place:geo']['geo:longitude']) || !empty($item['event:location']['place:address']['address:addressLocality']) && !empty($item['event:location']['place:address']['address:name']))) {
        //var_dump($item);
        $itemId = substr($item['@attributes']['rdf:about'], strpos($item['@attributes']['rdf:about'], '#') + 1);
        $startYear = substr($item['startDate'], 0, 4);
        $startMonth = substr($item['startDate'], 5, 2);
        $normalizedName = str_replace("'", "", str_replace(" ", "-", strtolower(suppr_accents($item['name']))));
        $freeTag = array('MP2013');
        $yakcats = array('50923b9afa9a95d409000000', '504d89cffa9a957004000001');
        $description = substr($item['description'], 0, strpos($item['description'], '==='));
        if (!empty($item['event:location']['place:address']['address:name'])) {
            $place = $item['event:location']['place:address']['address:name'];
        }
        if (!empty($item['image']) && sizeof($item['image']) > 0) {
            $thumb = $item['image'];
        }
        if (!empty($item['event:location']['place:address']['address:name'])) {
            $address .= $item['event:location']['place:address']['address:name'] . ", ";
        }
        if (!empty($item['event:location']['place:address']['address:streetAddress'])) {
            $address .= $item['event:location']['place:address']['address:streetAddress'] . ", ";
        }
コード例 #13
0
ファイル: offreCulturelle.php プロジェクト: rebe100x/YAKREP
 $currentPlace->origin = $origin;
 $currentPlace->filesourceTitle = $fileTitle;
 $currentPlace->licence = $licence;
 $queryGMAP = $street;
 if (!empty($data[13])) {
     $queryGMAP .= ', ' . $data[13];
 }
 if (!empty($data[14])) {
     $queryGMAP .= ', ' . $data[14];
 }
 $queryGMAP .= ", France";
 // Useful for regex matches
 $softTitle = suppr_accents($currentPlace->title);
 $cat = array("CULTURE", "GEOLOCALISATION", "GEOLOCALISATION#YAKDICO");
 // Finding yakcats
 if ($data[2] == "Musées" || preg_match("/musee/i", $softTitle) || preg_match("/musee/i", suppr_accents($data[20]))) {
     $cat[] = "CULTURE#MUSEE";
 } else {
     if (preg_match("/aquarium/i", $softTitle)) {
         $cat[] = "CULTURE#AQUARIUM";
     } else {
         if (preg_match("/opera/i", $softTitle)) {
             $cat[] = "CULTURE#MUSIQUE";
             $currentPlace->yakTag[] = "Classique";
         } else {
             if (preg_match("/jardin/i", $softTitle)) {
                 $cat[] = "LOISIR";
                 $cat[] = "LOISIR#ESPACEVERT";
                 $cat[] = "CULTURE#EXPOSITION";
                 $currentPlace->yakTag[] = "Plein air";
             } else {