[BACK]Return to zstatus.pl CVS log [TXT][DIR] Up to [local] / wpscripts / zstatus

Diff for /wpscripts/zstatus/zstatus.pl between version 1.2 and 1.4

version 1.2, 2011/07/20 07:42:05 version 1.4, 2012/02/02 15:06:19
Line 13 
Line 13 
 my $value;  my $value;
 my @status;  my @status;
   
 if(scalar(@ARGV) != 3 || $ARGV[1] ne "tiff" && $ARGV[1] ne "proba")  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 "Usage:\n";
     print "zstatus <NumCard> <tiff|proba> <value>\n";      print "zstatus <NumCard> <tiff|proba|tt|zjpeg|pjpeg> <value>\n";
     exit(-1);      exit(-1);
 }  }
 $numcard = shift;  $numcard = shift;
Line 33 
Line 33 
   
 $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=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=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 "zjpeg");
   $sth = $dbh->prepare("SELECT ID,status from upload_files WHERE numcard=$numcard AND type_file=4") if($type eq "pjpeg");
 $sth->execute( );  $sth->execute( );
   
 @status = ($sth->fetchrow_array( ));  @status = ($sth->fetchrow_array( ));
Line 44 
Line 47 
   
 $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=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=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 "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");  $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";  print "status changed from $status[1] " . ($status[1] == 0 ? "(NOT SENT)" : "(SENT)") . " to $value " . ($value == 1 ? "(SENT)" : "(NOT SENT)") . "\n";
   

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.4

CVSweb