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
Dernière révision
entreprises-ng2 [2014/09/18 15:20] athimel
Ligne 1: Ligne 1:
 +<php>
  
 +echo "<script src=\"https://code.jquery.com/jquery-1.11.1.min.js\"></script>";
 +echo "<style type=\"text/css\">";
 +echo "select.filter { margin-right: 5px; float: right; }";
 +echo "img.map { width: auto; height: 60px; margin-right: 5px; float: right; }";
 +echo ".company-card {  display: inline-block;  width: 400px;  min-height: 100px;  margin: 1em; padding: 1em; border: 1px solid #AAA; text-align: left; box-shadow: 1px 1px 12px #aaa; vertical-align: text-top; }";
 +echo ".company-card h1 { margin:0px !important; padding:0px; border-bottom: 0px !important; text-transform: none !important; font-size: 18px !important; display: inline-block;  }";
 +echo ".company-card img.logo { width: auto; height: auto; max-width: 150px; max-height: 60px; margin-right: 5px; margin-left: 5px; float: right; margin-top: -5px; }";
 +echo ".company-card img.icon { width: 8px; height: auto; margin-right: 5px;  }";
 +echo ".company-card p { overflow: hidden;  }";
 +echo ".company-card span.comp { background: #dddddd; color: #666; font-size: 0.85em; padding: 2px 3px 2px 3px; margin-left: 5px; }";
 +echo "</style>";
 +
 +echo "<img class=\"map\" src=\"http://www.openstreetmap.org/assets/osm_logo-22e0795e896eaaa60c12e013715004f1.png\" title=\"Visualiser sur une carte\"/>";
 +
 +echo "<select class=\"filter\"><option>-- sélectionnez une compétence --</option><option>java</option><option>xml</option><option>erp</option></select>";
 +
 +</php>
 +
 +====== Les entreprises du réseau ======
 +
 +
 +<php>
 +
 +
 +require "Net/LDAP2.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) {
 +
 +    $activity = $entry -> getValue('leWorkingCategory');
 +    $name = $entry -> getValue('cn');
 +    $www = $entry -> getValue('labeledURI');
 +    $city = $entry -> getValue('l');
 +    $activity = $entry -> getValue('leWorkingCategory');
 +    $logo = $entry -> getValue('jpegPhoto');
 +    
 +    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 href=\"".$www."\">".$www."</a>";
 +    echo "<div class=\"comps\">";
 +      echo "<span class=\"comp\">java</span>";
 +      echo "<span class=\"comp\">xml</span>";
 +      echo "<span class=\"comp\">erp</span>";
 +    echo "</div>";
 +    echo "<p style=\"height: 40px;\" onclick=\"$(this).removeAttr('style');\">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat.</p>";
 +    echo "</div>";
 +}
 +
 +
 +
 +$ldap -> done();
 +</php>