Confused Newb
Confused Newb
As the title says I'm completely new at any form of development, but decided to try my hand at developing a php app that ties into active directory.
Up to now, this is what I have;
[code]
x
google.load("jquery", "1.7.1");
google.load("jqueryui", "1.8.16");
<!---->
$(document).ready(function() {
oTable = $('table').dataTable(
{
"bJQueryUI": true,
//"sPaginationType": "full_numbers",
//"bFilter": true,
//"bAutoWidth": true,
//"bScrollAutoCss": true
//"bPaginate": true,
//"bInfo": true,
//"iDisplayLength": 4
}
);
} );
<?php
require_once ('functions.php');
try{
$attributes = array( "displayname" =>"Name",
"mail" =>"Email",
"title" =>"Title",
"telephonenumber" =>"Phone",
"department" =>"Department" );
$filter = "(&(objectCategory=person)(&(!(description=locked))))";
$result = ldap_search($ds, $ldap_dn, $filter, array_keys($attributes));
ldap_sort ($ds, $result, 'displayname');
if($result){
$entries = ldap_get_entries($ds, $result);
echo "returned ".$entries["count"]." results
";
//echo "".print_r($entries,true)."";
if($entries["count"] >0 ){
echo "";
echo "";
echo "";
//echo "";
foreach ($attributes as $attribute) {
echo "".$attribute."";
}
echo "";
echo "";
echo "";
for ($i=0; $i < $entries["count"]; $i++ ){
echo "";
foreach ($attributes as $key=>$attribute) {
echo "";
if (array_key_exists($key,$entries[$i])) { echo $entries[$i][$key][0]; }
echo "";
}
echo "";
//echo "User Information:
";
/*echo "displayname: ".$entries[$i]['displayname'][0]. "
";
echo "mail: ".$entries[$i]['mail'][0]. "
";
if (array_key_exists("title",$entries[$i])) {echo "title: ".$entries[$i]['title'][0]. "
"; }
*/
}
echo "";
echo "";
}
}
}
catch(Exception $e){
ldap_unbind($ds);
echo 'Caught exception: ', $e->getMessage(), "\n";
die();
}
ldap_unbind($ds);
echo 'Logged Out...
';
?>
[/code]
Up to now, this grabs my Active directory users and shoves them in a table, all this works fine, even putting it into datatables works fine. The problem comes when trying to use anything other than the datables css. The positioning is completely screwed up if I try and use something else, and if I attempt to turn on full pagination, then the numbers are all just layed one on top of the other, no matter which browser I try. Alternate rows are also no longer coloured.
I guess all I'm asking, is am I missing a trick here, or is it simply that I need to sort things out manually within the css?
As I said, I'm new to all of this, so I apologise if it's a stupidly obvious answer.
Up to now, this is what I have;
[code]
x
google.load("jquery", "1.7.1");
google.load("jqueryui", "1.8.16");
<!---->
$(document).ready(function() {
oTable = $('table').dataTable(
{
"bJQueryUI": true,
//"sPaginationType": "full_numbers",
//"bFilter": true,
//"bAutoWidth": true,
//"bScrollAutoCss": true
//"bPaginate": true,
//"bInfo": true,
//"iDisplayLength": 4
}
);
} );
<?php
require_once ('functions.php');
try{
$attributes = array( "displayname" =>"Name",
"mail" =>"Email",
"title" =>"Title",
"telephonenumber" =>"Phone",
"department" =>"Department" );
$filter = "(&(objectCategory=person)(&(!(description=locked))))";
$result = ldap_search($ds, $ldap_dn, $filter, array_keys($attributes));
ldap_sort ($ds, $result, 'displayname');
if($result){
$entries = ldap_get_entries($ds, $result);
echo "returned ".$entries["count"]." results
";
//echo "".print_r($entries,true)."";
if($entries["count"] >0 ){
echo "";
echo "";
echo "";
//echo "";
foreach ($attributes as $attribute) {
echo "".$attribute."";
}
echo "";
echo "";
echo "";
for ($i=0; $i < $entries["count"]; $i++ ){
echo "";
foreach ($attributes as $key=>$attribute) {
echo "";
if (array_key_exists($key,$entries[$i])) { echo $entries[$i][$key][0]; }
echo "";
}
echo "";
//echo "User Information:
";
/*echo "displayname: ".$entries[$i]['displayname'][0]. "
";
echo "mail: ".$entries[$i]['mail'][0]. "
";
if (array_key_exists("title",$entries[$i])) {echo "title: ".$entries[$i]['title'][0]. "
"; }
*/
}
echo "";
echo "";
}
}
}
catch(Exception $e){
ldap_unbind($ds);
echo 'Caught exception: ', $e->getMessage(), "\n";
die();
}
ldap_unbind($ds);
echo 'Logged Out...
';
?>
[/code]
Up to now, this grabs my Active directory users and shoves them in a table, all this works fine, even putting it into datatables works fine. The problem comes when trying to use anything other than the datables css. The positioning is completely screwed up if I try and use something else, and if I attempt to turn on full pagination, then the numbers are all just layed one on top of the other, no matter which browser I try. Alternate rows are also no longer coloured.
I guess all I'm asking, is am I missing a trick here, or is it simply that I need to sort things out manually within the css?
As I said, I'm new to all of this, so I apologise if it's a stupidly obvious answer.
This discussion has been closed.
Replies
Allan
I have it loading a reset.css, then the jquery.dataTables.css, and then the jquery-ui.css all from cdns
Allan
Thanks for your help allan, and for a great bit of kit.