<--html Template started--> <TMPL_VAR name=TITLE>
<--html template finish--> <--perl code--> #!/grid/common/pkgs/perl/v5.8.0/bin/perl -w use CGI; use DBI qw(:sql_types); use HTML::Template; my $cgi = CGI->new; #my @tmpl_opts = (cache => 1, die_on_bad_params => 0, associate => $cgi); my $template = HTML::Template->new(filename => 'addmodify.tpl'); my $dbh = DBI->connect('dbi:mysql:mentorship', 'pmweb', ''); ################################################################# ########## FETCHING THE DEPARTMENT NAMES ################################################################# my $sth = $dbh->prepare('select distinct departmentName from tbl_department_names'); my($departmentName); $sth->execute; $sth->bind_columns(\($departmentName)); my @rows; while($sth->fetch) { push @rows, {DepartmentName => $departmentName}; } ###################################################### ########## DEPARTMENT NAMES FETCHING ENDED ## ###################################################### my $sth1 = $dbh->prepare('select mentee_login , date_of_join from tbl_mentee_details where mentee_login="urmil"'); my ($login,$joindate); $sth1->execute; $sth1->bind_columns(\($login,$joindate)); my @rows1; while($sth1->fetch) { push @rows1, {Login => $login,JoinDate => $joindate,ROWSk=>\@rows }; } ###################################################### ####Selecting the Status of mentee for the Template ###################################################### $template->param({ TITLE=>'Mentorship System', ROWSk=>\@rows, ROWS1=>\@rows1}); print "Content-Type: text/html\n\n", $template->output;