#!/usr/bin/perl

use strict;
use CGI;
use JSON;

use Opals::Context;

my $dbh = Opals::Context->dbh();
my $cgi = CGI->new;
my $input = $cgi->Vars();
deleteGenre($dbh,$input->{'gid'});

print "Content-type: text/plain\n\n";

my $rs={status=>1};
print   to_json($rs);


#====================================================================================
sub deleteGenre{
    my($dbh,$gId)=@_;
    $dbh->do("delete from opl_genre          where gId=$gId ");
    $dbh->do("delete from opl_genreGroup     where gId=$gId ");
    $dbh->do("delete from opl_opl_genreItems where gId=$gId ");

  }

