log($page,'page'); if($page['code']!=400) { $body = $page['body']; $fp = fopen(PATH_LOGOS.$siren.'.'.$ext, 'a'); fwrite($fp, $body); fclose($fp); $img = $siren.'.'.$ext; } } return $img; } function logo_exist($siren, $isin = '', $web = '') { global $firephp; $img_ext = array('gif', 'png', 'jpg', 'jpeg'); $urlImg = ''; $ext = ''; // Recherche le logo avec le siren $locImg = PATH_LOGOS.$siren; foreach($img_ext as $extension) { if( file_exists($locImg.'.'.$extension) ) { $urlImg = './logos/'.$siren.'.'.$extension; $ext = '.'.$extension; break; } } // Recherche de logos avec le code isin if($urlImg=='' && $isin!='') { $locImg=PATH_LOGOS.$isin; foreach($img_ext as $extension) { if( file_exists($locImg.'.'.$extension) ) { $urlImg = './logos/'.$isin.'.'.$extension; $ext = '.'.$extension; break; } } } if( trim($web)!='' && $urlImg=='' ) { $login = array('ylenaour', 'mpurcarin', 'mcochet', 'aegasse', 'jmartory', 'mricois'); $locImg = ''; if (substr($web,0,7)!='http://') $siteWeb = 'http://'.$web; else $siteWeb = $web; if ( in_array($_SESSION['tabInfo']['login'], $login) ) { $img = getLogo($siteWeb, $siren); $firephp->log($img, 'image'); if($img!==false) { $urlImg = './logos/'.$img; list($locImg, $ext) = explode('.', $img); $ext = '.'.$ext; } } } return array($urlImg, $locImg.$ext); }