#!/usr/bin/perl -w ############################################################################### # Author: Srikanth. S. # Title: homepage.pl # Date : 6 AUG 2005 # Purpose: Script displays the available categories. # Required Modules: CGI,DBI use strict; use CGI qw(fatalsToBrowser); # send fatal error messages to the browser use DBI; print "Content-type: text/html \n\n"; print ""; print " Intermodel.net "; print ""; print "
ALL ADVERTISEMENTS ARE DISPLAYED FOR 60 DAYS



"; my $q = new CGI; # create new CGI object and store it in $q my $script = $q->script_name; my $dbh = DBI->connect("DBI:mysql:intermod_intermod:localhost", "intermod_class", "model"); my $sth1 = $dbh->prepare(qq{ select ADCategoryID,ADCategoryName,ADCategoryParentID from ADCATEGORIES where ADCategoryParentID = 1001 and ADCategoryDeleted=0 order by ADCategoryIndex}); my $sth2 = $dbh->prepare(qq{ select ADCategoryID,ADCategoryName,ADCategoryParentID from ADCATEGORIES where ADCategoryParentID = 1002 and ADCategoryDeleted=0 order by ADCategoryIndex}); my $sth3 = $dbh->prepare(qq{ select ADCategoryID,ADCategoryName,ADCategoryParentID from ADCATEGORIES where ADCategoryParentID = 1003 and ADCategoryDeleted=0 order by ADCategoryIndex}); my $sth4 = $dbh->prepare(qq{ select ADCategoryID,ADCategoryName,ADCategoryParentID from ADCATEGORIES where ADCategoryParentID = 1004 and ADCategoryDeleted=0 order by ADCategoryIndex}); $sth1->execute or die $DBI::errstr; $sth2->execute or die $DBI::errstr; $sth3->execute or die $DBI::errstr; $sth4->execute or die $DBI::errstr; my @row1 ; my @row2; my @row3; my @row4; my $picture="orange.gif"; my $noofrecords=0; my $i=1; my $count=5; my $va=1; my $accomodation=0; my $jobs=0; my $entertainment=0; my $general=0; print ""; #accomodation; print ""; #jobs; print ""; #entertainment; print ""; print ""; print "
"; print ""; print ""; while ( @row1 = $sth1->fetchrow_array() ) { print ""; } print "
ACCOMODATION
" ; print " "; print " $row1[1]
"; print "
"; print ""; print ""; while ( @row2 = $sth2->fetchrow_array() ) { print ""; } print "
JOBS
" ; print " "; print " $row2[1]
"; print "
"; print ""; print ""; while ( @row3 = $sth3->fetchrow_array() ) { print ""; } print "
ENTERTAINMENT
" ; print " "; print " $row3[1]
"; print "
"; print ""; print ""; while ( @row4 = $sth4->fetchrow_array() ) { print ""; } print "
GENERAL
" ; print " "; print " $row4[1]
"; print "
"; $dbh->disconnect; print ""; print "";