=================================================================== RCS file: /cvs/wpscripts/zstatus/zstatus.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- wpscripts/zstatus/zstatus.pl 2011/12/21 09:25:22 1.3 +++ wpscripts/zstatus/zstatus.pl 2012/02/02 15:06:19 1.4 @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $Id: zstatus.pl,v 1.3 2011/12/21 09:25:22 yason Exp $ +# $Id: zstatus.pl,v 1.4 2012/02/02 15:06:19 yason Exp $ use DBI; my $DB_SERVER = "pdc"; # from /usr/local/etc/freetds.conf @@ -13,10 +13,10 @@ my $value; my @status; -if(scalar(@ARGV) != 3 || $ARGV[1] ne "tiff" && $ARGV[1] ne "proba" && $ARGV[1] ne "tt" && $ARGV[1] ne "jpeg") +if(scalar(@ARGV) != 3 || $ARGV[1] ne "tiff" && $ARGV[1] ne "proba" && $ARGV[1] ne "tt" && $ARGV[1] ne "zjpeg" && $ARGV[1] ne "pjpeg") { print "Usage:\n"; - print "zstatus \n"; + print "zstatus \n"; exit(-1); } $numcard = shift; @@ -34,7 +34,8 @@ $sth = $dbh->prepare("SELECT ID,status from upload_files WHERE numcard=$numcard AND type_file=0") if($type eq "tiff"); $sth = $dbh->prepare("SELECT ID,status from upload_files WHERE numcard=$numcard AND type_file=1") if($type eq "proba"); $sth = $dbh->prepare("SELECT ID,status from upload_files WHERE numcard=$numcard AND type_file=2") if($type eq "tt"); -$sth = $dbh->prepare("SELECT ID,status from upload_files WHERE numcard=$numcard AND type_file=3") if($type eq "jpeg"); +$sth = $dbh->prepare("SELECT ID,status from upload_files WHERE numcard=$numcard AND type_file=3") if($type eq "zjpeg"); +$sth = $dbh->prepare("SELECT ID,status from upload_files WHERE numcard=$numcard AND type_file=4") if($type eq "pjpeg"); $sth->execute( ); @status = ($sth->fetchrow_array( )); @@ -47,7 +48,8 @@ $sth = $dbh->prepare("UPDATE upload_files SET status=$value WHERE numcard=$numcard AND type_file=0") if($type eq "tiff"); $sth = $dbh->prepare("UPDATE upload_files SET status=$value WHERE numcard=$numcard AND type_file=1") if($type eq "proba"); $sth = $dbh->prepare("UPDATE upload_files SET status=$value WHERE numcard=$numcard AND type_file=2") if($type eq "tt"); -$sth = $dbh->prepare("UPDATE upload_files SET status=$value WHERE numcard=$numcard AND type_file=3") if($type eq "jpeg"); +$sth = $dbh->prepare("UPDATE upload_files SET status=$value WHERE numcard=$numcard AND type_file=3") if($type eq "zjpeg"); +$sth = $dbh->prepare("UPDATE upload_files SET status=$value WHERE numcard=$numcard AND type_file=4") if($type eq "pjpeg"); $sth->execute( ) or die("Can not execute SQL"); print "status changed from $status[1] " . ($status[1] == 0 ? "(NOT SENT)" : "(SENT)") . " to $value " . ($value == 1 ? "(SENT)" : "(NOT SENT)") . "\n";