Ceriwis

Ceriwis (https://forum.ceriwis.com/forum.php)
-   Programming (https://forum.ceriwis.com/forumdisplay.php?f=63)
-   -   [PHP] nanya ttg paging dr result search di array. (https://forum.ceriwis.com/showthread.php?t=573157)

Badguy13 20th November 2011 01:21 AM

[PHP] nanya ttg paging dr result search di array.
 
agan2, gw mao nanya dunk, ini kalo misalnya gw mao bwat paging dr gw punya searching result di array gmn yah? gw udah coba bikin jdnya cuma ke duplicate 2 page.

ini code nya


Spoiler for CODE:






[code]

$rCount =0;

foreach ($articleArray as $value)

{

$Type = $value->getType();

$Key = $value->getKey();

$Author = $value->getAuthor();

$Title = $value->getTitle();

$Journal = $value->getJournal();

$Year = $value->getYear();

$Volume = $value->getVolume();

$Number = $value->getNumber();

$Pages = $value->getPages();

$Month = $value->getMonth();

$Note = $value->getNote();



$authorCount = substr_count($value->getAuthor(), $_SESSION['K_K']);

$keyCount = substr_count($value->getKey(), $_SESSION['K_K']);

$journalCount = substr_count($value->getJournal(), $_SESSION['K_K']);

$yearCount = substr_count($value->getYear(), $_SESSION['K_K']);



if($authorCount > 0 || $keyCount > 0 || $journalCount >0 || $yearCount >0 )

{



if($Author !== Null)

{

print $value->getAuthor();

echo("");

echo(' Click for details');echo("
");

echo "";



}



if($Type !== Null)

{

print('Type : '.$value->getType().'
');

}



if($Key !== Null)

{

print('Key : '.$value->getKey().'
');

}



if($Author !== Null)

{

print('Author : '.$value->getAuthor().'
');

}



if($Title !== Null)

{

print('Title : '.$value->getTitle().'
');

}



if($Journal !== Null)

{

$checkWebsite = strstr($Journal,$Website);

if($checkWebsite == true)

{

if($Permission == true)

{

print('Journal : Hidden,please login to see the link
');

}

else

{

print('Journal : '.$value->getJournal().'
');

}



}



}



if($Year !== Null)

{

print('Year : '.$value->getYear().'
');

}



if($Volume !== Null)

{

print('Volume : '.$value->getVolume().'
');

}



if($Number !== Null)

{

print('Number : '.$value->getNumber().'
');

}



if($Pages !== Null)

{

print('Pages : '.$value->getPages().'
');

}



if($Month !== Null)

{

print('Month : '.$value->getMonth().'
');

}



if($Note !== Null)

{

$checkWebsite = strstr($Note,$Website);

if($checkWebsite == true)

{

if($Permission == true)

{

print('Note : Hidden,please login to see the link
');

}

else

{

print('Note : '.$value->getNote().'
');

}

}

}

$rCount++;

// $indexCounter++;



}



print("

");



}

//}









$max_results = 5;

$page = $_GET['page'];



if(!isset($_GET['page'])){

$page = 1;

} else {

$page = $_GET['page'];



}



$indexCounter;

$indexLimit;

if($page == 1)

{

$indexCounter = 0;

$indexLimit = $max_results;

}

else

{

$indexCounter = ($page-1) * $max_results;

$indexLimit = $page * $max_results;

}



if($indexCounter 1){

$prev = ($page - 1);

echo "";

}

echo "
Select a Page";









</div>


All times are GMT +7. The time now is 01:48 AM.