منتديات أهل الجزائر
هل تريد التفاعل مع هذه المساهمة؟ كل ما عليك هو إنشاء حساب جديد ببضع خطوات أو تسجيل الدخول للمتابعة.

برنامج لتسجيل موظفين أو طلبة النسخة الثالثة

استعرض الموضوع التالي استعرض الموضوع السابق اذهب الى الأسفل

برنامج لتسجيل موظفين أو طلبة النسخة الثالثة Empty برنامج لتسجيل موظفين أو طلبة النسخة الثالثة

مُساهمة  alla23 الأحد يوليو 21, 2013 9:06 pm

بسم الله الرحمن الرحيم
والصلاة والسلام على أشرف المرسلين سيدنا محمد صلى الله عليه وسلم وعلى آله وصحبه أجمعين
الحمد لله نحمده ونستغفره ونعوذ بالله من شرور انفسنا وسيئات اعمالنا
وأشهد أن لا إله إلا الله وحده لا شريك له وأشهد أن محمدا عبده ورسوله
 
 
برنامج لتسجيل موظفين أو طلبة النسخة الثالثة
 
1 اعادة تهيئة السجلات من جديد
2 عرض محتوى السجلات
3 بحث في السجلات
4 اضافة سجل الى السجلات
5 حذف سجل من السجلات
6 تعديل بيانات سجل من السجلات
7 خروج من البرنامج
 
 
{
       ***   REPUBLIQUE ALGERIENNE DEMOCRATIQUE POPULAIRE   ***
}
program project2_de_delfa;
uses crt;
const n1 = 1;
type  date = record
       jour : 01..31;
       mois : 01..12;
       anne : 1980..2200;
      end;
        etudiant = record
          code: integer;
          nom : string[15];
          prenom : string[20];
          date_ne : date;
          lui : string[40];
          adress : string[30];
          date_ent : date;
          date_sor : date;
          fonction : string[20];
        end;
    tableau = array[0..n1] of etudiant;
var E : etudiant;
    etu,etu1 : file of etudiant;
    chois:integer;
    table : tableau;
    rte:boolean;
 
                    {****** Declaration des procedures ******}
procedure alger_ler;
begin
     clrscr;
    gotoxy(15,2);
    write('REPUBLIQUE ALGERIENNE DEMOCRATIQUE POPULAIRE');
end;
                      {Declaration procedure de chois}
procedure chois_aff;
begin
    alger_ler;
    gotoxy(10,5); write('1. Creation du fichier');
    gotoxy(10,7); write('2. Affichage');
    gotoxy(10,9); write('3. Rechercher');
    gotoxy(10,11); write('4. Ajout');
    gotoxy(10,13); write('5. Supprimer');
    gotoxy(10,15); write('6. Modifie');
    gotoxy(10,17); write('7. Quitter');
    gotoxy(5,20); write('Entrez votre chois : '); readln(chois);
end;
                   {Declaration procedure de fenetre1}
procedure fenetre;
begin
      alger_ler;
      gotoxy(2,5); write('Donnez le code : ');
      gotoxy(2,7); write('Donnez le nom : ');
      gotoxy(2,9); write('Donnez le prenom : ');
      gotoxy(2,11);write('Donnez le date nessonce : ');
      gotoxy(30,11);write('/'); gotoxy(33,11);  write('/');
      gotoxy(2,13);writeln('Donnez le lui nessonce : ');
      gotoxy(2,15); writeln('Donnez l"adress : ');
      gotoxy(2,17); write('Donnez la date entree :');
      gotoxy(28,17); write('/'); gotoxy(31,17); write('/');
      gotoxy(2,19);write('Donnez la date sortie :');
      gotoxy(28,19); write('/'); gotoxy(31,19); write('/');
      gotoxy(2,21); write('Donnez la fonction : ');
end;
                    {Declaration procedure de fenetre2}
procedure fenetre_aa;
begin
  alger_ler;
  gotoxy(12,5); write('Code : '); gotoxy(12,7); write('Nom : ');
  gotoxy(12,9); write('Prenom : '); gotoxy(12,11); write('Date de nessonce :');
  gotoxy(33,11); write('/'); gotoxy(36,11); write('/');
  gotoxy(12,13); write('Lui de nessonce :'); gotoxy(12,15); write('Adresse :');
  gotoxy(12,17); write('Date de entree :');
  gotoxy(31,17); write('/'); gotoxy(34,17); write('/');
  gotoxy(12,19); write('Date sortie :');
  gotoxy(28,19); write('/'); gotoxy(31,19); write('/');
  gotoxy(12,21); write('La fonction :');
end;
                     {Declaration procedure ecrir dans le fichier}
procedure ecrir_fiche;
begin
 with E do
 begin
   gotoxy(19,5); readln(code);
   gotoxy(18,7); readln(nom);
   gotoxy(21,9); readln(prenom);
   gotoxy(28,11); read(date_ne.jour);
   gotoxy(31,11); read(date_ne.mois); gotoxy(34,11); readln(date_ne.anne);
   gotoxy(27,13); readln(lui);
   gotoxy(20,15); readln(adress);
   gotoxy(26,17); read(date_ent.jour);
   gotoxy(29,17); read(date_ent.mois); gotoxy(32,17); readln(date_ent.anne);
   gotoxy(26,19); read(date_sor.jour);
   gotoxy(29,19); read(date_sor.mois); gotoxy(32,19); readln(date_sor.anne);
   gotoxy(23,21); readln(fonction);
 end;
end;
                   {Declaration procedure de creation}
procedure creation;
var no : char;
begin
   assign(etu,'delfa1'); rewrite(etu);
   repeat
      fenetre; ecrir_fiche;
      write(etu,E);
   writeln('Autre saisi o/n '); readln(no);
   until no='n';
   close(etu);
   chois_aff;
end;
                    {Declaration procedure de ajout}
procedure ajout_12;
var no1 : char;
    trou : boolean;
begin  trou:=false;
  assign(etu,'delfa1'); reset(etu);
  seek(etu,filesize(etu));
  repeat
     fenetre;
     ecrir_fiche;
     write(etu,E);
     writeln('Autre saisie ? o/n'); readln(no1);
     if no1='n' then trou:=true;
  until (no1='n')and(trou=true);
  close(etu);
  chois_aff;
end;
                     {Declatation procedure de lire}
procedure lire_fiche;
begin
  with E do
   begin
     gotoxy(19,5); write(code);
     gotoxy(18,7); write(nom);
     gotoxy(21,9); write(prenom);
     gotoxy(31,11); write(date_ne.jour);
     gotoxy(34,11); write(date_ne.mois); gotoxy(37,11); write(date_ne.anne);
     gotoxy(30,13); write(lui);
     gotoxy(22,15); write(adress);
     gotoxy(29,17); write(date_ent.jour);
     gotoxy(32,17); write(date_ent.mois); gotoxy(35,17); write(date_ent.anne);
     gotoxy(26,19); write(date_sor.jour);
     gotoxy(29,19); write(date_sor.mois); gotoxy(32,19); write(date_sor.anne);
     gotoxy(26,21); write(fonction);
   end;
end;
                   {declaration procedure affichage}
procedure affichage;
begin
   assign(etu,'delfa1'); reset(etu);
   while not eof(etu) do
   begin
     fenetre_aa;
     read(etu,E); lire_fiche;
     gotoxy(5,25); write('presse key continue : '); readkey;
   end;
   close(etu);
   chois_aff;
end;
                      {Declaration procedure de lire fichier}
procedure lire_fiche1;
begin
 with E do
  begin
     gotoxy(19,5); write(code);
     gotoxy(18,7); write(nom);
     gotoxy(21,9); write(prenom);
     gotoxy(31,11); write(date_ne.jour);
     gotoxy(34,11); write(date_ne.mois); gotoxy(37,11); write(date_ne.anne);
     gotoxy(30,13); write(lui);
     gotoxy(22,15); write(adress);
     gotoxy(29,17); write(date_ent.jour);
     gotoxy(32,17); write(date_ent.mois); gotoxy(35,17); write(date_ent.anne);
     gotoxy(26,19); write(date_sor.jour);
     gotoxy(29,19); write(date_sor.mois); gotoxy(32,19); write(date_sor.anne);
     gotoxy(26,21); write(fonction);
  end;
end;
                 {Procedure rechercher }
procedure rechercher;
const n1=1; m1=15;
var tab1 : array[0..n1] of string[m1];
    trouve:boolean;
begin
  trouve:=false; alger_ler;
  gotoxy(7,15); write('Donnez le nom de rechercher :');
  gotoxy(37,15); readln(tab1[n1]);
  assign(etu,'delfa1'); reset(etu);
  while not eof(etu) do
  begin
   with E do
   begin
    read(etu,E);
    if tab1[n1]=nom then
    begin
     fenetre_aa;
     lire_fiche1;
     trouve:=true;
    end;
   end;
  end;
  close(etu);
  if trouve=false then begin gotoxy(5,20);
                       write(' Nom ne est pas trouve de la liste'); end;
  readln;
  chois_aff;
end;
 
         {***** Declaration procedure supprimation nom de fichier  *****}
procedure supprimer;
const n2 = 1; m2 = 15;
var tab2 : array[0..n2] of string[m2];
    etu1 : file of etudiant;
    trou1,trou2 : boolean;
 
begin
  trou1:=false; alger_ler;
  gotoxy(8,14); write('Donnez le nom a suprimer :');
  gotoxy(35,14); readln(tab2[n2]);
  assign(etu,'delfa1'); reset(etu);
  assign(etu1,'delfa2'); rewrite(etu1);
  while not eof(etu) do
  begin
    read(etu,E);
    if tab2[n2]<>E.nom then
    begin
       write(etu1,E);
       trou1:=true;
    end else trou2:=true;
  end;
  close(etu1);
 
  if (trou1=true)and(trou2=true) then
  begin
    reset(etu1); rewrite(etu);
    while not eof(etu1) do
    begin
      read(etu1,E);
      write(etu,E);
    end;
    rewrite(etu1);
    close(etu); close(etu1);
  end else
  begin
      gotoxy(5,15); write('Le nom non trouve');
      readln;
  end;
  chois_aff;
end;
        {*********************************************************}
 
procedure fente;  {************ 1 ***********}
begin
   clrscr;
   gotoxy(10,4);  write('1. Code................. :');
   gotoxy(10,5);  write('2. Nom.................. :');
   gotoxy(10,6);  write('3. Prenom............... :');
   gotoxy(10,7);  write('4. Date de nucence. Jour :');
   gotoxy(10,8);  write('5.................. Mois :');
   gotoxy(10,9);  write('6.................. Anne :');
   gotoxy(10,10); write('7. Leui................. :');
   gotoxy(10,11); write('8. Adresse.............. :');
   gotoxy(10,12); write('9. Date entree..... Jour :');
   gotoxy(10,13); write('10................. Mois :');
   gotoxy(10,14); write('11................. Anne :');
   gotoxy(10,15); write('12. Date sortie.... Jour :');
   gotoxy(10,16); write('13................. Mois :');
   gotoxy(10,17); write('14................. Anne :');
   gotoxy(10,18); write('15. La fonction......... :');
   gotoxy(10,20); write('16. Quitter')
end;
 
procedure affiche_table(var tab1:tableau); {************ 2 ***********}
label L;
var i:integer;
begin
  fente;
  with tab1[n1] do
  begin
    gotoxy(37,4); write(code);
    gotoxy(37,5); write(nom); gotoxy(37,6); write(prenom);
    with date_ne do
     begin gotoxy(37,7); write(jour); gotoxy(37,8); write(mois);
           gotoxy(37,9); write(anne); end;
     gotoxy(37,10); write (lui); gotoxy(37,11); write(adress);
    with date_ent do
     begin gotoxy(37,12); write(jour); gotoxy(37,13); write(mois);
           gotoxy(37,14); write(anne); end;
    with date_sor do
     begin gotoxy(37,15); write(jour); gotoxy(37,16); write(mois);
           gotoxy(37,17); write(anne); end;
    gotoxy(37,18);  write(fonction);
  end;
 
  L: begin gotoxy(38,22); write('          ');
     gotoxy(5,22); write('Donnez est votre chois modifie : '); readln(i); end;
 
  if i=1 then              {***}
         begin
             gotoxy(37,4); write('                     ');
             gotoxy(37,4); readln(tab1[n1].code); goto L;
 
  end else
 
  if i=2 then
         begin
             gotoxy(37,5); write('                     ');
             gotoxy(37,5); readln(tab1[n1].nom); goto L;
 
  end else
 
  if i=3 then
         begin
             gotoxy(37,6); write('                     ');
             gotoxy(37,6); readln(tab1[n1].prenom); goto L;
  end else
 
  if i=4 then
         begin
             gotoxy(37,7); write('                     ');
             gotoxy(37,7); readln(tab1[n1].date_ne.jour); goto L;
  end else
 
  if i=5 then
         begin
             gotoxy(37,8); write('                     ');
             gotoxy(37,8); readln(tab1[n1].date_ne.mois); goto L;
  end else
 
  if i=6 then
         begin
             gotoxy(37,9); write('                     ');
             gotoxy(37,9); readln(tab1[n1].date_ne.anne); goto L;
  end else
 
  if i=7 then
         begin
             gotoxy(37,10); write('                    ');
             gotoxy(37,10); readln(tab1[n1].lui); goto L;
  end else
 
  if i=8 then
         begin
             gotoxy(37,11); write('                    ');
             gotoxy(37,11); readln(tab1[n1].adress); goto L;
  end else
 
  if i=9 then
         begin
             gotoxy(37,12); write('                    ');
             gotoxy(37,12); readln(tab1[n1].date_ent.jour); goto L;
  end else
 
  if i=10 then
         begin
             gotoxy(37,13); write('                    ');
             gotoxy(37,13); readln(tab1[n1].date_ent.mois); goto L;
  end else
 
  if i=11 then
         begin
             gotoxy(37,14); write('                    ');
             gotoxy(37,14); readln(tab1[n1].date_ent.anne); goto L;
  end else
 
  if i=12 then
         begin
             gotoxy(37,15); write('                    ');
             gotoxy(37,15); readln(tab1[n1].date_sor.jour); goto L;
  end else
 
  if i=13 then
         begin
             gotoxy(37,16); write('                    ');
             gotoxy(37,16); readln(tab1[n1].date_sor.mois); goto L;
  end else
 
  if i=14 then
         begin
             gotoxy(37,17); write('                    ');
             gotoxy(37,17); readln(tab1[n1].date_sor.anne); goto L;
  end else
 
  if i=15 then
         begin
             gotoxy(37,18); write('                    ');
             gotoxy(37,18); readln(tab1[n1].fonction); goto L;
  end else
 
  if i>=16 then       {***}
  begin
   fente;
   with tab1[n1] do
   begin
    gotoxy(37,4); write(code);
    gotoxy(37,5); write(nom); gotoxy(37,6); write(prenom);
    with date_ne do
     begin gotoxy(37,7); write(jour); gotoxy(37,8); write(mois);
           gotoxy(37,9); write(anne); end;
     gotoxy(37,10); write (lui); gotoxy(37,11); write(adress);
    with date_ent do
     begin gotoxy(37,12); write(jour); gotoxy(37,13); write(mois);
           gotoxy(37,14); write(anne); end;
    with date_sor do
     begin gotoxy(37,15); write(jour); gotoxy(37,16); write(mois);
           gotoxy(37,17); write(anne); end;
    gotoxy(37,18);  write(fonction);
   end;
  end;      {*** ***}
 
end;
 
procedure charge_fich(tab1:tableau); {************ 3 ***********}
const n1=1;
begin
   assign(etu1,'delfa2'); reset(etu1);
   seek(etu1,filesize(etu1));
      E.code:=tab1[n1].code;
      E.nom:=tab1[n1].nom;
      E.prenom:=tab1[n1].prenom;
      E.date_ne.jour:=tab1[n1].date_ne.jour;
      E.date_ne.mois:=tab1[n1].date_ne.mois;
      E.date_ne.anne:=tab1[n1].date_ne.anne;
      E.lui:=tab1[n1].lui;
      E.adress:=tab1[n1].adress;
      E.date_ent.jour:=tab1[n1].date_ent.jour;
      E.date_ent.mois:=tab1[n1].date_ent.mois;
      E.date_ent.anne:=tab1[n1].date_ent.anne;
      E.date_sor.jour:=tab1[n1].date_sor.jour;
      E.date_sor.mois:=tab1[n1].date_sor.mois;
      E.date_sor.anne:=tab1[n1].date_sor.anne;
      E.fonction:=tab1[n1].fonction;
      write(etu1,E);
   close(etu1);
 
   assign(etu,'delfa1'); rewrite(etu);
   assign(etu1,'delfa2'); reset(etu1);
   while not eof(etu1) do
   begin
      read(etu1,E);
      write(etu,E);
   end;
   close(etu); close(etu1);
 
end;
 
procedure modifi_fiche(var tab1:tableau);  {************ 4 ***********}
const n1 = 1; m1 =15;
type tableaux = array[0..n1] of string[m1];
var trou2,trou3 : boolean;
     tab3 : tableaux;
 
begin
  clrscr; trou2 := false;
  gotoxy(8,14); write('Donnez le nom a modifie  :');
  gotoxy(35,14);readln(tab3[n1]);
  assign(etu,'delfa1'); reset(etu);
  assign(etu1,'delfa2'); rewrite(etu1);
  while not eof(etu) do
  begin
    read(etu,E);
    if tab3[n1]=E.nom then
     begin
        tab1[n1].code:=E.code;
        tab1[n1].nom:=E.nom;
        tab1[n1].prenom:=E.prenom;
        tab1[n1].date_ne.jour:=E.date_ne.jour;
        tab1[n1].date_ne.mois:=E.date_ne.mois;
        tab1[n1].date_ne.anne:=E.date_ne.anne;
        tab1[n1].lui:=E.lui;
        tab1[n1].adress:=E.adress;
        tab1[n1].date_ent.jour:=E.date_ent.jour;
        tab1[n1].date_ent.mois:=E.date_ent.mois;
        tab1[n1].date_ent.anne:=E.date_ent.anne;
        tab1[n1].date_sor.jour:=E.date_sor.jour;
        tab1[n1].date_sor.mois:=E.date_sor.mois;
        tab1[n1].date_sor.anne:=E.date_sor.anne;
        tab1[n1].fonction:=E.fonction; trou2:=true;
     end else write(etu1,E);
  end;
  close(etu); close(etu1);
 
  if trou2=true then
  begin
    affiche_table(table);
    charge_fich(table);
  end else writeln('Nom non trouve de la liste');
end;
 
        {*********************************************************}
 
begin             {***** Programmer principal *****}
  rte:=false; chois_aff;       {PROGRAMME PRINCIPALE}
  repeat
    case chois of
       1:creation;
       2:affichage;
       3:rechercher;
       4:ajout_12;
       5:supprimer;
       6:begin modifi_fiche(table); chois_aff; end;
       7:begin gotoxy(7,25); write('Fin de programmer');
               rte:=true; readln; end;
       else chois_aff;
    end;
  until (chois=7)and(rte=true);
 
end.
 

زوروني على المنتدى دلفي تعليم
delph.forumalgerie.net

alla23
alla23
عضو ماسي
عضو ماسي

عدد المساهمات : 82
نقاط : 212
تاريخ التسجيل : 26/05/2013
الموقع : http://delph.forumalgerie.net

http://delph.forumalgerie.net

الرجوع الى أعلى الصفحة اذهب الى الأسفل

استعرض الموضوع التالي استعرض الموضوع السابق الرجوع الى أعلى الصفحة

- مواضيع مماثلة

صلاحيات هذا المنتدى:
لاتستطيع الرد على المواضيع في هذا المنتدى