Confused Newb

Confused Newb

VagsVags Posts: 3Questions: 0Answers: 0
edited February 2012 in General
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.

Replies

  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin
    What are you trying to use other than the default DataTables CSS? This blog post ( http://datatables.net/blog/Creating_beautiful_and_functional_tables_with_DataTables ) and this file ( https://github.com/DataTables/DataTables/blob/master/media/css/jquery.dataTables.css ) will give you what you need to get started with styling a table.

    Allan
  • VagsVags Posts: 3Questions: 0Answers: 0
    I was attempting to use one of the themeroller themes (dark-hive).
    I have it loading a reset.css, then the jquery.dataTables.css, and then the jquery-ui.css all from cdns
  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin
    If you are using ThemeRoller, then you'll want to use the jquery.dataTables_themeroller.css file rather than the jquery.dataTables.css since, since the former has a number of customisations in it for ThemeRoller.

    Allan
  • VagsVags Posts: 3Questions: 0Answers: 0
    That's excellent, knew I'd be missing something simple. Now it's just showing the page numbers in a black box, but, I'm sure I can figure that one out, it was just the spacing that was bugging me.

    Thanks for your help allan, and for a great bit of kit.
This discussion has been closed.