var
anaSayfa, girisSayfa, kayitSayfa: TclStyleForm;
girisYap, kayitOl: TClProButton;
database, password : String;
nameK, nameG, surnameK, surnameG passwordK, passwordG, age, weight, height: TclProEdit;
girisButton, kayitButton: TClProButton;
ageK, weightK, heightK: Integer;
Qry : TClSQLiteQuery;
Saglik1: TclUnit;
void KullaniciKontrolEt;
{
Qry = Clomosy.DBSQLiteQueryWith('SELECT user_name , user_surname, user_password FROM Users Where user_name = '+ QuotedStr(nameG.Text)+' And user_surname ='+QuotedStr(surnameG.Text)+' And user_password = '+ QuotedStr(passwordG.Text));
Qry.OpenOrExecute;
if (Qry.Found)
{
ShowMessage('Başarılı bir şekilde giriş yapıldı ✅');
girisSayfa.clShow;
Saglik1.UnitName='Saglik1';
Saglik1.CallerForm=girisSayfa;
Saglik1.Run;
}
else
{
ShowMessage('Kayıt bulunamadı❗ Lütfen Kayıt Olun.');
}
}
void InsertToDatabase;
{
if((Length(nameK.Text)==0) || (Length(surnameK.Text)==0) || (Length(passwordK.Text)==0) || (Length(age.Text)==0) || (Length(weight.Text)==0) || (Length(height.Text)==0)) {
ShowMessage('Bilgiler boş bırakılamaz. Lütfen gerekli bilgileri doldurunuz❗');
}
else{
Clomosy.DBSQLiteQuery.SQL.Text = 'INSERT INTO Users (user_name, user_surname, user_password, user_age, user_weight, user_height) VALUES ('+QuotedStr(nameK.Text)+',
'+QuotedStr(surnameK.Text)+', '+QuotedStr(passwordK.Text)+' , '+QuotedStr(age.Text)+', '+QuotedStr(weight.Text)+', '+QuotedStr(height.Text)+')';
Clomosy.DBSQLiteQuery.OpenOrExecute;
ShowMessage('Başarılı bir şekilde kayıt olundu ✅');
}
}
void GirisYap;
{
girisSayfa=TclStyleForm.Create(self);
girisSayfa.SetFormBGImage(' https://i.hizliresim.com/95hry38.jpg" rel="nofollow - https://i.hizliresim.com/95hry38.jpg ');
Saglik1=TclUnit.Create;
nameG=girisSayfa.AddNewProEdit(girisSayfa, 'nameG', 'İsminiz: ');
clComponent.SetupComponent(nameG,'{
"MarginBottom":200,
"Width" :350,
"Height":45,
"RoundHeight":20,
"RoundWidth":20,
"BorderColor":"#4857b5",
"BackgroundColor":"null",
"TextColor":"#0b202e",
"BorderWidth":2
}');
surnameG=girisSayfa.AddNewProEdit(girisSayfa, 'surnameG', 'Soyisminiz: ');
clComponent.SetupComponent(surnameG,'{
"MarginBottom":50,
"Width" :350,
"Height":45,
"RoundHeight":20,
"RoundWidth":20,
"BorderColor":"#4857b5",
"BackgroundColor":"null",
"TextColor":"#0b202e",
"BorderWidth":2
}');
passwordG=girisSayfa.AddNewProEdit(girisSayfa, 'passwordG', 'Şifreniz: ');
clComponent.SetupComponent(passwordG,'{
"MarginTop":100,
"Width" :350,
"Height":45,
"RoundHeight":20,
"RoundWidth":20,
"BorderColor":"#4857b5",
"BackgroundColor":"null",
"TextColor":"#0b202e",
"BorderWidth":2
}');
passwordG.Password = True;
girisButton = girisSayfa.AddNewProButton(girisSayfa,'girisButton','Giriş Yap');
clComponent.SetupComponent(girisButton,'
{
"MarginTop":500,
"MarginBottom":50,
"Width" :160,
"Height":40,
"BackgroundColor":"#4aadb0",
"TextColor":"#f7fafc",
"TextSize":14,
"RoundWidth":20,
"RoundHeight":20
}
');
girisSayfa.AddNewEvent(girisButton,tbeOnClick,'KullaniciKontrolEt');
girisSayfa.Run;
}
void KayitOl;
{
kayitSayfa=TclStyleForm.Create(self);
kayitSayfa.SetFormBGImage(' https://i.hizliresim.com/95hry38.jpg" rel="nofollow - https://i.hizliresim.com/95hry38.jpg ');
database = Clomosy.AppFilesPath + 'ClomosyDatabase.db3';
password = '';
nameK=kayitSayfa.AddNewProEdit(kayitSayfa, 'nameK', 'İsminiz: ');
clComponent.SetupComponent(nameK,'{
"MarginBottom":400,
"Width" :350,
"Height":45,
"RoundHeight":20,
"RoundWidth":20,
"BorderColor":"#4857b5",
"BackgroundColor":"null",
"TextColor":"#0b202e",
"BorderWidth":2
}');
surnameK=kayitSayfa.AddNewProEdit(kayitSayfa, 'surnameK', 'Soyisminiz: ');
clComponent.SetupComponent(surnameK,'{
"MarginBottom":280,
"Width" :350,
"Height":45,
"RoundHeight":20,
"RoundWidth":20,
"BorderColor":"#4857b5",
"BackgroundColor":"null",
"TextColor":"#0b202e",
"BorderWidth":2
}');
passwordK=kayitSayfa.AddNewProEdit(kayitSayfa, 'passwordK', 'Şifreniz: ');
clComponent.SetupComponent(passwordK,'{
"MarginBottom":160,
"Width" :350,
"Height":45,
"RoundHeight":20,
"RoundWidth":20,
"BorderColor":"#4857b5",
"BackgroundColor":"null",
"TextColor":"#0b202e",
"BorderWidth":2
}');
passwordK.Password = True;
age=kayitSayfa.AddNewProEdit(kayitSayfa, 'age', 'Yaşınız: ');
clComponent.SetupComponent(age,'{
"MarginBottom":40,
"Width" :350,
"Height":45,
"RoundHeight":20,
"RoundWidth":20,
"BorderColor":"#4857b5",
"BackgroundColor":"null",
"TextColor":"#0b202e",
"BorderWidth":2
}');
age.clTypeOfField = taFloat;
weight=kayitSayfa.AddNewProEdit(kayitSayfa, 'weight', 'Kilonuz: ');
clComponent.SetupComponent(weight,'{
"MarginTop":90,
"Width" :350,
"Height":45,
"RoundHeight":20,
"RoundWidth":20,
"BorderColor":"#4857b5",
"BackgroundColor":"null",
"TextColor":"#0b202e",
"BorderWidth":2
}');
weight.clTypeOfField = taFloat;
height=kayitSayfa.AddNewProEdit(kayitSayfa, 'height', 'Boyunuz(cm): ');
clComponent.SetupComponent(height,'{
"MarginTop":220,
"Width" :350,
"Height":45,
"RoundHeight":20,
"RoundWidth":20,
"BorderColor":"#4857b5",
"BackgroundColor":"null",
"TextColor":"#0b202e",
"BorderWidth":2
}');
height.clTypeOfField = taFloat;
kayitButton = kayitSayfa.AddNewProButton(kayitSayfa,'kayitButton','Kayıt Ol');
clComponent.SetupComponent(kayitButton,'
{
"MarginTop":500,
"MarginBottom":50,
"Width" :160,
"Height":40,
"BackgroundColor":"#4aadb0",
"TextColor":"#f7fafc",
"TextSize":14,
"RoundWidth":20,
"RoundHeight":20
}');
kayitSayfa.AddNewEvent(kayitButton, tbeOnClick, 'InsertToDatabase');
Clomosy.DBSQLiteConnect(database , password);
/* try
Clomosy.DBSQLiteQuery.Sql.Text = 'CREATE TABLE Users(user_id INTEGER PRIMARY KEY AUTOINCREMENT, user_name Text, user_surname Text, user_password Text, user_age Int, user_weight Int, user_height Int)';
Clomosy.DBSQLiteQuery.OpenOrExecute;
ShowMessage('Veri tabanına tablo ekleme işlemi başarılı!');
except
ShowMessage('Exception Class: '+LastExceptionClassName+' Exception Message: '+LastExceptionMessage);
} */
/* try
Clomosy.DBSQLiteConnect(database , password);
Clomosy.DBSQLiteQuery.Sql.Text = 'Drop TABLE Users';
Clomosy.DBSQLiteQuery.OpenOrExecute;
ShowMessage('Veri tabanı silindi!');
except
ShowMessage('Exception Class: '+LastExceptionClassName+' Exception Message: '+LastExceptionMessage);
}*/
kayitSayfa.Run;
}
{
anaSayfa=TclStyleForm.Create(self);
anaSayfa.SetFormBGImage(' https://i.hizliresim.com/v3b3xio.png" rel="nofollow - https://i.hizliresim.com/v3b3xio.png ');
girisYap = anaSayfa.AddNewProButton(anaSayfa,'girisYap','Giriş Yap');
clComponent.SetupComponent(girisYap,'
{
"MarginTop":500,
"MarginBottom":50,
"Width" :160,
"Height":40,
"BackgroundColor":"#4aadb0",
"TextColor":"#f7fafc",
"TextSize":14,
"RoundWidth":20,
"RoundHeight":20
}
');
anaSayfa.AddNewEvent(girisYap, tbeOnClick, 'GirisYap');
kayitOl = anaSayfa.AddNewProButton(anaSayfa,'kayitOl','Kayıt Ol');
clComponent.SetupComponent(kayitOl,'
{
"MarginTop":600,
"MarginBottom":50,
"Width" :160,
"Height":40,
"BackgroundColor":"#4aadb0",
"TextColor":"#f7fafc",
"TextSize":14,
"RoundWidth":20,
"RoundHeight":20
}
');
anaSayfa.AddNewEvent(kayitOl,tbeOnClick,'KayitOl');
anaSayfa.Run;
}