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

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

version 1.3, 2011/12/21 09:25:22 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" && $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 "Usage:\n";
     print "zstatus <NumCard> <tiff|proba|tt|jpeg> <value>\n";      print "zstatus <NumCard> <tiff|proba|tt|zjpeg|pjpeg> <value>\n";
     exit(-1);      exit(-1);
 }  }
 $numcard = shift;  $numcard = shift;
Line 34 
Line 34 
 $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=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( );  $sth->execute( );
   
 @status = ($sth->fetchrow_array( ));  @status = ($sth->fetchrow_array( ));
Line 47 
Line 48 
 $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=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");  $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.3  
changed lines
  Added in v.1.4

CVSweb