no way to compare when less than two revisions

Différences

Ci-dessous, les différences entre deux révisions de la page.


Révision précédente
Prochaine révision
entreprises-ng3 [2014/10/29 18:21] athimel
Ligne 1: Ligne 1:
  
 +<php>
 +include "entreprises-ng-header.php";
 +</php>
 +
 +====== Les entreprises du réseau ======
 +
 +
 +<php>
 +
 +$config = array (
 +    'binddn'    => 'uid=web,ou=sysaccounts,o=code-lutin,ou=companies,o=libre-entreprise ',
 +    'bindpw'    => 'ne6vdAbD',
 +    'basedn'    => 'o=libre-entreprise',
 +    'host'      => 'ldaps://ldap.libre-entreprise.org',
 +    'port'      => '636',
 +);
 +
 +$ldap = Net_LDAP2::connect($config);
 +
 +if (PEAR::isError($ldap)) {
 +    die('Could not connect to LDAP-server: '.$ldap->getMessage());
 +}
 +
 +$search = $ldap->search(
 +        'ou=companies,o=libre-entreprise',
 +        '(&(objectClass=leorganization)(userClass=Libre-entreprise))'
 +);
 +if (PEAR::isError($search)) {
 +    die($search->getMessage() . "\n");
 +}
 +
 +foreach($entry = $search->entries() as $entry) {
 +
 +    $name = $entry -> getValue('cn');
 +    $www = $entry -> getValue('labeledURI');
 +    $city = $entry -> getValue('l');
 +    $activity = $entry -> getValue('leWorkingCategory');
 +    $logo = $entry -> getValue('jpegPhoto');
 +    $description = $entry -> getValue('description');
 +    $skills = $entry -> getValue('leSkills');
 +    
 +    echo "<div class=\"company-card\">";
 +    if ($logo) {
 +        echo "<img class=\"logo\" src=\"data:image/png;base64,". base64_encode($logo)."\"/>";
 +    }
 +    echo "<h1>".$name."</h1>";
 +    echo "<img class=\"icon\" src=\"http://zoumbox.org/Gear-icon.png\"/>";
 +    echo "<span class=\"company-category\">".$activity."</span><br/>";
 +    echo "<img class=\"icon\" src=\"http://cdn.leafletjs.com/leaflet-0.7.3/images/marker-icon.png\"/>";
 +    echo "<span class=\"company-city\">".$city."</span><br/>";
 +    echo "<img class=\"icon\" src=\"http://zoumbox.org/browser-icon.png\"/>";
 +    echo "<a target=\"_blank\" href=\"".$www."\">".$www."</a>";
 +    echo "<div class=\"comps\">";
 +    foreach($skill = $skills as $skill) {
 +      echo "<span class=\"comp\">".$skill."</span>";
 +    }
 +    echo "</div>";
 +    echo "<p style=\"height: 40px;\" onclick=\"$(this).removeAttr('style');\">".$description."</p>";
 +    echo "</div>";
 +}
 +
 +
 +
 +$ldap -> done();
 +</php>