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

Annotation of wpscripts/zlist/zlist.pl, Revision 1.1

1.1     ! yason       1: #!/usr/bin/perl
        !             2: # $Id: zlist.pl,v 1.3 2005/12/12 12:57:05 init Exp $
        !             3: use DBI;
        !             4:
        !             5: $| = 1;
        !             6:
        !             7: my $server = "MSSQL";
        !             8: my $user = "it_men";
        !             9: my $pass = "itmen712";
        !            10: my $dsn = "DBI:Sybase:server=$server";
        !            11: my $sth;
        !            12:
        !            13: my @zayavki;
        !            14: my @zayavki_times;
        !            15: my @zayavki_pri;
        !            16: my @jpegs;
        !            17: my @jpegs_times;
        !            18: my @jpegs_pri;
        !            19: my @probas;
        !            20: my @probas_times;
        !            21: my @probas_pri;
        !            22: my $i;
        !            23: $dbh = DBI->connect($dsn, $user, $pass) or die "unable to connect to server $DBI::errstr";
        !            24: $dbh->do("use Manager");
        !            25:
        !            26: $sth = $dbh->prepare ("SELECT NumCard,time_file,file_priority FROM upload_files WHERE Status=0 AND type_file=0") or die "SQL prepare failed\n";
        !            27: $sth->execute( ) or die "unable to execute query $query   error $DBI::errstr";
        !            28:
        !            29: $i=0;
        !            30: print "*** Zayavki ***\n";
        !            31: while( ($zayavki[$i], $zayavki_times[$i], $zayavki_pri[$i]) = $sth->fetchrow_array())
        !            32: {
        !            33:     print "$zayavki[$i] - $zayavki_times[$i] [priority $zayavki_pri[$i]]\n";
        !            34:     $i++;
        !            35: }
        !            36: $sth->finish();
        !            37:
        !            38: $sth = $dbh->prepare ("SELECT NumCard,time_file,file_priority FROM upload_files WHERE Status=0 AND type_file=1") or die "SQL prepare failed\n";
        !            39: $sth->execute( ) or die "unable to execute query $query   error $DBI::errstr";
        !            40:
        !            41: $i=0;
        !            42: print "\n*** Jpegs ***\n";
        !            43: while( ($jpegs[$i], $jpegs_times[$i], $jpegs_pri[$i]) = $sth->fetchrow_array())
        !            44: {
        !            45:     print "$jpegs[$i] - $jpegs_times[$i] [priority $jpegs_pri[$i]]\n";
        !            46:     $i++;
        !            47: }
        !            48: $sth->finish();
        !            49:
        !            50: $sth = $dbh->prepare ("SELECT NumCard,time_file,file_priority FROM upload_files WHERE Status=0 AND type_file=2") or die "SQL prepare failed\n";
        !            51: $sth->execute( ) or die "unable to execute query $query   error $DBI::errstr";
        !            52:
        !            53: $i=0;
        !            54: print "\n*** Probas ***\n";
        !            55: while( ($probas[$i], $probas_times[$i], $probas_pri[$i]) = $sth->fetchrow_array())
        !            56: {
        !            57:     print "$probas[$i] - $probas_times[$i] [priority $probas_pri[$i]]\n";
        !            58:     $i++;
        !            59: }
        !            60: $sth->finish();
        !            61:
        !            62:
        !            63:

CVSweb