Notes
Notes - notes.io |
# nobet_tutmayan.pl
use strict;
use warnings;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
use Win32::OLE;
use Win32::OLE::Const 'Microsoft Excel';
require "isim_listesi.pl";
#sabitler
#dosya isimleri
my $nobet_listesi = "C:\Bilmemne Cart curt\Nöbet Listesi.xls";
#burası pek mühim değil geriye bir tüm isimleri içeren bir list dönüyor.
my @isim_listesi = isim_listesi(); #isim_listesi.pl
#gun hucresi
my $gun = "";
#gece nobetleri
my $gece = "C5:G21";
#gunduz nobetleri
my $gunduz = "C23:G39";
print header(-charset => 'ISO-8859-9');
print start_html(-title=>'Nöbet tutmayanlar',-meta=>{'Content-Type'=>'text/html;charset=iso-8859-9'});
my $sayfa = param("sayfa");
$sayfa = $sayfa || 5;
print start_form(-method=>'GET');
sayfalar($nobet_listesi, $sayfa);
print submit("Gönder");
print end_form;
my $gece_nobeti = undef;
my $gunduz_nobeti = undef;
($gece_nobeti, $gunduz_nobeti) = listeler($nobet_listesi, $gece, $gunduz, $sayfa);
my @gece_tutanlar = nobet_listesi_dokumu($gece_nobeti);
my @gunduz_tutanlar = nobet_listesi_dokumu($gunduz_nobeti);
@gece_tutanlar = sort @gece_tutanlar;
@gunduz_tutanlar = sort @gunduz_tutanlar;
my @gece_tutmayanlar = ();
my @gunduz_tutmayanlar = ();
foreach (@isim_listesi) {
push @gece_tutmayanlar, $_ unless nobeti_var_mi($_, @gece_tutanlar);
push @gunduz_tutmayanlar, $_ unless nobeti_var_mi($_, @gunduz_tutanlar);
}
print h2("gece tutmayan:");
print "<ol>";
print li($_) . "n" foreach (@gece_tutmayanlar);
print "</ol>";
print h2("gunduz tutmayan:");
print "<ol>";
print li($_) . "n" foreach (@gunduz_tutmayanlar);
print "</ol>";
print end_html;
#-----------------------------------------------------------------------
# (@gece_aoa, @gunduz_aoa) = listeler($dosya, $gece_hucre_araligi, $gunduz_hucre_araligi)
sub listeler {
my $dosya;
my $gece_hucre_araligi;
my $gunduz_hucre_araligi;
my $sayfa;
($dosya, $gece_hucre_araligi, $gunduz_hucre_araligi, $sayfa) = @_;
$sayfa = $sayfa * 1;
my $excel = Win32::OLE->new('Excel.Application', 'Quit');
my $wb = $excel->Workbooks->Open($dosya);
my $s = $wb->Worksheets($sayfa);
my $gece = $s->Range($gece_hucre_araligi)->{'Value'};
my $gunduz = $s->Range($gunduz_hucre_araligi)->{'Value'};
$wb->Close(0);
return ($gece, $gunduz);
}
sub sayfalar {
my $dosya = shift;
my $sayfa = shift;
my $e = Win32::OLE->new('Excel.Application', 'Quit');
my $b = $e->Workbooks->Open($dosya);
print "<select name='sayfa'>";
for(my $i=1; $i<=$b->Worksheets->{'Count'};$i++) {
unless ($b->Worksheets($i)->{'Name'} =~ /Arka/) {
print "<option value='$i'";
print " selected " if $i eq $sayfa;
print ">" . $b->Worksheets->Item($i)->{'Name'} . "</option>";
}
}
print "</select>";
$b->Close(0);
}
sub nobet_listesi_dokumu {
my $nobet_listesi = shift;
my @isim_listesi = ();
foreach my $i(@{$nobet_listesi}) {
foreach (@{$i}) {
#sadece isimler $1 $2
push @isim_listesi, $1 if /(D+)s*(d+)/;
#isim------------------------^ ^
#silah numarası----------------------|
#print td($i);
}
}
return @isim_listesi;
}
sub nobeti_var_mi {
my $isim = undef;
my @liste = ();
($isim, @liste) = @_;
foreach (@liste) {
return 1 if /$isim/;
}
return 0;
}
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team