<a href="#item1" onclick="activeList(event,this)" > add class to text 1 </a>
<a href="#item2" onclick="activeList(event,this)"> add class to text 2 </a>
<a href="#item3" onclick="activeList(event,this)" > add class to text 3 </a>
function activeList(e,element) {
e.preventDefault();
let li_id = element.getAttribute('href').substr(1);
document.querySelectorAll('.list li').forEach( (item)=>{
item.classList.toggle("active", item.id == li_id );
});
}
define( 'AD_SERVER_IP', '192.168.7.99' );
define( 'AD_DOMAIN', 'domain' );
$adServer = "ldap://".AD_SERVER_IP;
$ldap = ldap_connect($adServer);
$username = 'username';
$password = 'password';
$ldaprdn = AD_DOMAIN . "\\" . $username;
ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);
ldap_set_option($ldap, LDAP_OPT_SIZELIMIT, 3);
$bind = @ldap_bind($ldap, $ldaprdn, $password);
if($bind){
$filter="(sAMAccountName=$username)";
$params = array('cn','telephonenumber');
$result = ldap_search($ldap,"dc=".AD_DOMAIN.",dc=local",$filter,$params );
$info = ldap_get_entries($ldap, $result);
@ldap_close($ldap);
}
let isMobile = true;
let isTablet = false;
console.log( ( isMobile ? 'Меньше 992' : (isTablet ? 'Меньше 1600, но больше 992' : 'Больше 1600' ) ) );
const blockWidth = () => {
if (isMobile) {
console.log('Меньше 992');
return 100;
}
if (isTablet) {
console.log('Меньше 1600, но больше 992');
return 150;
}
console.log('Больше 1600');
return 200;
};
let b = blockWidth();
console.log(b);