long numOfDaysBetween = ChronoUnit.DAYS.between(dan.getValue(), gacha.getValue());
newLocal = IntStream.iterate(0, i -> i + 1)
.limit(numOfDaysBetween)
.mapToObj(i -> dan.getValue().plusDays(i))
.collect(Collectors.toList());
newLocal.add(gacha.getValue());
categoryAxisList.clear();
qiyamatAxisList.clear();
for (int a = 0; a < newLocal.size(); a++) {
categoryAxisList.add(newLocal.get(a).toString());
int sonaq = 0;
for (int b = 0; b < listBemorlar.size(); b++) {
if (newLocal.get(a).toString().equals(listBemorlar.get(b).getSana().split(" ")[0])) {
sonaq++;
}
}
qiyamatAxisList.add(Double.parseDouble(String.valueOf(sonaq)));
}
axis_x.setCategories(categoryAxisList);
XYChart.Series series1 = new XYChart.Series<>();
for (int i = 0; i < newLocal.size(); i++) {
series1.getData().add(new XYChart.Data<>(categoryAxisList.get(i), qiyamatAxisList.get(i)));
}
barchart.getData().clear();
barchart.getData().add(series1);
//Defining the y axis
NumberAxis yAxis = new NumberAxis();
yAxis.setLabel("score");
}
}
package sample.Controllers;
import com.jfoenix.controls.JFXCheckBox;
import com.jfoenix.controls.JFXComboBox;
import com.jfoenix.controls.JFXDatePicker;
import com.jfoenix.controls.JFXTextField;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.control.*;
import javafx.scene.input.MouseEvent;
import javafx.stage.Stage;
import javafx.stage.Window;
import javafx.stage.WindowEvent;
import javafx.util.Callback;
import sample.Connections.DBTransaction;
import sample.DataAccsesObject.DataAccsessObject;
import sample.DataAccsesObject.DataAccsessTransaction;
import sample.Funksiyalar.Belgilar;
import sample.Funksiyalar.NumericChangeListenerDecimal;
import sample.Modellar.Bolimlar;
import sample.utils.Util;
import java.io.IOException;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Calendar;
public class AddHodimController {
DataAccsessObject dao;
String sql;
Boolean check = false;
String id;
String fish;
String lavozimi;
String manzili;
String tel;
String ulush;
String sana;
public String getSana() {
return sana;
}
public void setSana(String sana) {
this.sana = sana;
}
@FXML
private JFXTextField edt_fish;
@FXML
private JFXComboBox com_lavozimi;
@FXML
private JFXTextField edt_manzili;
@FXML
private JFXTextField edt_tel;
@FXML
private JFXTextField edt_ulush;
@FXML
private JFXTextField edt_data;
@FXML
private JFXTextField edt_lavozim;
@FXML
private JFXTextField edt_oylik;
@FXML
private JFXDatePicker date_picker;
@FXML
private Label txt_ulush_date;
@FXML
private JFXCheckBox id_checkbox;
@FXML
void handle_checkbox(ActionEvent event) {
if (id_checkbox.isSelected()) {
vrach = "0";
} else {
vrach = "1";
}
System.out.println(id_checkbox.isSelected());
}
String vrach = "1";
String date;
@FXML
void handleDatePicker(ActionEvent event) {
// date = date_picker.getValue().minusDays(date_picker.getValue().getDayOfMonth()-1).toString();
}
public Boolean getCheck() {
return check;
}
public void setCheck(Boolean check) {
this.check = check;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getFish() {
return fish;
}
public void setFish(String fish) {
this.fish = fish;
}
public String getLavozimi() {
return lavozimi;
}
public void setLavozimi(String lavozimi) {
this.lavozimi = lavozimi;
}
public String getManzili() {
return manzili;
}
public void setManzili(String manzili) {
this.manzili = manzili;
}
public String getTel() {
return tel;
}
public void setTel(String tel) {
this.tel = tel;
}
public String getUlush() {
return ulush;
}
public void setUlush(String ulush) {
this.ulush = ulush;
}
ObservableList listBemorlar = FXCollections.observableArrayList();
protected DataAccsessTransaction dat;
@FXML
void handle_Bekor(ActionEvent event) {
Node node = (Node) event.getSource();
Stage stage = (Stage) node.getScene().getWindow();
stage.close();
}
@FXML
void handle_Saqlash(ActionEvent event) throws IOException {
date = LocalDate.now().minusDays(LocalDateTime.now().getDayOfMonth()-1).toString();
if (!edt_fish.getText().isEmpty()) {
if (!edt_tel.getText().isEmpty()) {
if (!com_lavozimi.getSelectionModel().isEmpty()) {
if (!edt_manzili.getText().isEmpty()) {
if (!edt_ulush.getText().isEmpty()) {
if (!edt_oylik.getText().isEmpty()) {
DBTransaction transaction = new DBTransaction() {
@Override
public void doDBTransaction() throws Exception {
sql =
"insert into `hodim` (`bol_id`, `fish`, `tel`, `lavozim`,`manzil`, `vrach` , `ulush`) values " +
" ('" + com_lavozimi.getSelectionModel().getSelectedItem().getId() + "','" + edt_fish.getText().replace("'", "\\'") + "','" + edt_tel.getText().replace("'", "\\'") + "','" + edt_lavozim.getText().replace("'", "\\'") + "','" + edt_manzili.getText().replace("'", "\\'") + "','" + vrach + "','" + edt_ulush.getText() + "')";
int x_id = dat.insertReturnId(sql);
sql = "INSERT INTO `xodim_ulush`(`xodim_id`, `ulush`, `oylik` , `sana`) VALUES ('" + x_id + "','" + edt_ulush.getText() + "','" + Util.decimalFormatterToDouble(edt_oylik.getText()) + "','" + date + "')";
int u_id = dat.insertReturnId(sql);
sql = "UPDATE `hodim` SET `ulush` = '" + u_id + "' WHERE (`id` = '" + x_id + "');";
dat.umumiySorov(sql);
}
};
if (transaction.isSaved()) {
Util.getNotification("Amaliyot muvaffaqiyatli amalga oshirildi");
Node node = (Node) event.getSource();
Stage stage = (Stage) node.getScene().getWindow();
Window window = stage.getScene().getWindow();
window.fireEvent(new WindowEvent(window, WindowEvent.WINDOW_CLOSE_REQUEST));
} else {
showAlert("Iltimos qaytadan urinib ko`ring");
}
} else {
showAlert("Oylik maydoni bo`sh");
}
} else {
setText(item.getNomi());
Hulosa
Bu loyiha yaratish orqali mamlakatimizdagi klinika tizimini yaratib klinika hodimlariga yengillik yaratdik hamda xo’zimizga kerakli bilimlarni oldik.Va bu loyihani tuzish davomida texnik topshiriqlarni o’z vaqtida bajarishni o’rgandik va qo’shimcha bilimlarni o’zlashtirdik.
Foydalanilgan adabiyotlar.
https://www.coursera.org/articles/what-is-python-used-for-a-beginners-guide-to-using-python
https://www.mohirdev.uz
https://www.aiogram.org
King D. Samarali dasturiy ta'minotni yaratish: Per. ingliz tilidan. - M.: Mir, 2003 yil.
Kouts R.I. Vleymink. Inson-kompyuter interfeysi. - M.: Mir, 2000 yil.
Delphi rasmiy sayti // www.delphiworld.ru
Strukturaviy dasturlash nazariyasi va amaliyoti / R. Linger, X. Mills, B. Vitt, - M.: Mir, 2005 y. Faronov V.V. Delphi 4. Trening kursi. - M.: Bilim, 1998 yil.