برنامج مواقيت الصلاة لكل ولايات الوطن ( للجزائر فقط )
#6
السلام عليكم
وجدت برنامج مفتوح المصدر يستخدم الاحداثيات
من يريد ان يستفيد منه
كود :
http://sourceforge.net/projects/prayertimescalc/
لقد قمت بتغيير ملف xml وذلك بوضع ولايات الوطن فقط
واستخدمت هذه الوحدة الجاهزة هنا لحساب الوقت
http://www.delphi4arab.net/forum/showthread.php?p=7912
قاعدة xml مرفقة
كود سورس البرنامج
PHP كود :
unit Unit1;

interface

uses
  Winapi
.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  
Vcl.Controls, Vcl.Forms, Vcl.Dialogs,unit2, Vcl.StdCtrls, Xml.xmldom,
  
Xml.XMLIntf, Xml.Win.msxmldom, Xml.XMLDoc;

type
  TForm1 
= class(TForm)
    
Label1: TLabel;
    
Label2: TLabel;
    
Label3: TLabel;
    
Label4: TLabel;
    
Label5: TLabel;
    
Label6: TLabel;
    
Button1: TButton;
    
ComboBox1: TComboBox;
    
XMLDocument1: TXMLDocument;
    
Label7: TLabel;
    
procedure Button1Click(Sender: TObject);
    
procedure FormCreate(Sender: TObject);

  private
    { Private 
declarations }
  public
    { Public 
declarations }
  
end;

var
  
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);

var 
pray:Tpray;
Node: IXMLNode;
begin
XMLDocument1
.Active:=true;
Node := XMLDocument1.DocumentElement.ChildNodes.First.ChildNodes.FindNode('city') ;
while 
node <>nil do  begin

if  trim(Node.Attributes['name']) = trim(combobox1.Text) then
break;

Node := Node.NextSibling;
end;



pray:=calcpray(strtofloat(node.ChildNodes['longitude'].text),
strtofloat(node.ChildNodes['latitude'].Text),
strtofloat(node.ChildNodes['timezone'].Text),
Date,2,0);
label2.Caption:=timetostr((pray.fajr));
label3.Caption:=timetostr((pray.Shrouk));
label4.Caption:=timetostr(pray.Asr);
label5.Caption:=timetostr(pray.Maghrib);
label6.Caption:=timetostr(pray.Isha);
label1.Caption:=timetostr(pray.zuhr);
XMLDocument1.Active:=false;
end;






procedure TForm1.FormCreate(Sender: TObject);
var
Node: IXMLNode;
begin
XMLDocument1
.Active:=true;
Node := XMLDocument1.DocumentElement.ChildNodes.First.ChildNodes.FindNode('city') ;
while 
node <>nil do  begin
ComboBox1
.Items.Add(Node.Attributes['name']);
Node := Node.NextSibling;
end;
combobox1.ItemIndex:=1;
XMLDocument1.Active:=true;
end;

end. 
تنبيه
اختار مسار xmldoc
من filename مثلا C:\adandz.xml


الملفات المرفقة
.rar   adandz.rar (الحجم : 2.36 ك ب / التحميلات : 283)
الرد


الردود في هذا الموضوع
برنامج مواقيت الصلاة لكل ولايات الوطن ( للجزائر فقط ) - بواسطة onexite - 18-09-2012, 09:11 AM

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم