Kumara - predecessor to Koha
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
4.7 KiB

  1. #!/usr/bin/perl
  2. #script to display detailed information
  3. #written 8/11/99
  4. use strict;
  5. #use DBI;
  6. use C4::Search;
  7. use CGI;
  8. use C4::Output;
  9. my $input = new CGI;
  10. print $input->header;
  11. my $type=$input->param('type');
  12. print startpage();
  13. print startmenu($type);
  14. my $blah;
  15. my $env;
  16. my $subject=$input->param('subject');
  17. #my $title=$input->param('title');
  18. my $main;
  19. my $secondary;
  20. if ($type eq 'opac'){
  21. $main='#99cccc';
  22. $secondary='#efe5ef';
  23. } else {
  24. $main='#99cc33';
  25. $secondary='#ffffcc';
  26. }
  27. my @items=subsearch(\$blah,$subject);
  28. #print @items;
  29. my $count=@items;
  30. my $i=0;
  31. print center();
  32. print mktablehdr;
  33. if ($type ne 'opac'){
  34. print mktablerow(4,$main,bold('TITLE'),bold('AUTHOR'),bold('COUNT'),bold('LOCATION'),"/images/background-mem.gif");
  35. } else {
  36. print mktablerow(4,$main,bold('TITLE'),bold('AUTHOR'),bold('COUNT'),bold('LOCATION'));
  37. }
  38. my $colour=1;
  39. while ($i < $count){
  40. my @results=split('\t',$items[$i]);
  41. $results[0]=mklink("/cgi-bin/kumara/detail.pl?bib=$results[2]&type=$type",$results[0]);
  42. my $word=$results[1];
  43. $word=~ s/ //g;
  44. $word=~ s/\,/\,%20/;
  45. $results[1]=mklink("/cgi-bin/kumara/search.pl?author=$word&type=$type",$results[1]);
  46. my ($count,$lcount,$nacount,$fcount,$scount)=itemcount($env,$results[2]);
  47. $results[3]=$count;
  48. if ($nacount > 0){
  49. $results[4]=$results[4]."On Loan 1";
  50. }
  51. if ($lcount > 0){
  52. $results[4]=$results[4]." L$lcount";
  53. }
  54. if ($fcount > 0){
  55. $results[4]=$results[4]." F$fcount";
  56. }
  57. if ($scount > 0){
  58. $results[4]=$results[4]." S$scount";
  59. }
  60. if ($type ne 'opac'){
  61. $results[6]=mklink("/cgi-bin/koha/request.pl?bib=$results[2]","Request");
  62. }
  63. if ($colour == 1){
  64. print mktablerow(5,'#ffffcc',$results[0],$results[1],$results[3],$results[4],$results[6]);
  65. $colour=0;
  66. } else{
  67. print mktablerow(5,'white',$results[0],$results[1],$results[3],$results[4],$results[6]);
  68. $colour=1;
  69. }
  70. $i++;
  71. }
  72. print endcenter();
  73. print mktableft();
  74. print endmenu($type);
  75. print endpage();