Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
Badguy13 Badguy13 is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 399
Rep Power: 15
Badguy13 mempunyai hidup yang Normal
Default [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>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


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