#!/usr/bin/perl

#use utf8;
use strict;
use CGI;
use Text::CSV_XS;
use Digest::SHA qw(
    sha1_base64
    sha1_hex
);

use Opals::Context;
use Opals::Template_ajax qw(
    tmpl_read
    tmpl_write
);

use Opals::Ebook qw(
    eb_bookShelves_get
);


my $dbh = Opals::Context->dbh();
END { $dbh->disconnect(); }

my $cgi          = CGI->new;
my $input        = $cgi->Vars();

my ($permission, $cookie, $template) = tmpl_read(
        {
            dbh             => $dbh,
            cgi             => $cgi,
            tmplFile        => 'ajax/util/getBookshelvesList.tmpl',
            reqPermission   => 'ebook_mgmt',
        }
    );

  
    my $uid = $template->param('curUserId');
  ###  my $bsList =eb_bookShelves_get($dbh,$uid); ####  add this line later
    my $bsList =eb_bookShelves_get($dbh,1);  ####  this line for testing
  
    $template->param(
        bsList => $bsList
    );

tmpl_write($dbh, $cgi, $cookie, $template);
#------------------------------------------------------------------------------
