<?php
include_once('sambung.php');
// *** You only need to configure this ***
//$db_server      = 'localhost';
//$db_username    = 'mrbs';
//$db_password    = 'maytrade84';
//$db_name        = 'mrbs';
// ***************************************

//mysql_connect($db_server, $db_username, $db_password) or die("Could not connect: " . mysql_error());
//mysql_select_db($db_name);


function getCreativePagerLite($id,$page,$total_items,$items_per_page,$info1=true){

    include_once('creativePagerLite.php');

    $cp=new CreativePager();

    // Data Gathering
    $params['selected_page']    = $page;
    $params['total_items']      = $total_items;
    $params['items_per_page']   = $items_per_page=='all' ? $total_items : $items_per_page;
    $params['url']              = 'javascript: ctPager(\''.$id.'\',\'#NUM_PAGE#\');';

    // Layout Configurations
    $params['id']               = $id.'_pager';
    $params['type']             = 'centered';
    $params['nav_pages']        = 5;
    $params['info1']            = $info1;

    $cp->pager($params);
    $out_pager=$cp->display();

    return $out_pager;
}


// function to check if an array as any value - for the real example and complex example
function filled_array($arr){

    for($i=0; $i<count($arr); $i++){
        if($arr[$i]!='')
            return true;
    }

    return false;

}

?>