#!/usr/bin/perl #perl2exe_include Tk::Pane use Win32::SqlServer; use Tk; use Tk::Scrollbar; require Tk::Pane; my $mw=new MainWindow; # Main Window Elements my $titleBanner=$mw->Label(-text=>"*Text changed to protect the innocent*",-font=>"Arial 12 bold")->pack(); my $testbutton=$mw->Button(-command=>\&destframe, -text=>"Refresh")->pack(); my $statusFrame=$mw->Scrolled('Frame',-scrollbars=>"oe")->pack(); &destframe; $mw->repeat(10000, \&destframe); # Subroutine to get data from the DB sub GetData{ my $sqlsrv=Win32::SqlServer::sql_init('*Deleted*','*Params*','*For*','*Security*'); my $batch=<sql($batch); return $result } sub destframe{ # StatusFrame # Get the data first my $statusboard=&GetData; #create a loop to populate the status frame my $count=1; foreach my $row (@$statusboard) { my $status="$$row{status}"; if ($status=="1") { $status="In"; }elsif ($status=="0"){ $status="Out"; }else{ $status="Not Set" } my $name=$statusFrame->Label(-text=>"$$row{firstname} $$row{lastname}")->grid(-row=>"$count", -column=>"1"); my $status=$statusFrame->Label(-text=>"$status")->grid(-row=>"$count", -column=>"2"); $count++; } } MainLoop;