i need help for my arduino project

i have problem with my code

“kirimdata was not declared in this scope”

#include <Wire.h>
#include <Ethernet.h>
#include <SPI.h>

//Definisi Pin
const int smokePin = A0;
const int buzzerPin = 13;
int sensitivity_smoke;
int status_sensitivity_smoke;
int last_status_sensitivity_smoke;

//Definisi Ethernet
byte mac = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
byte ip = {192, 168, 1, 177}; //ip
byte server = {192, 168, 3, 10}; //localhost
byte gateway = {192, 168, 3, 100}; //gateway
EthernetClient client;

void setup() {
Ethernet.begin(mac, ip, gateway);
Serial.begin(9600);
pinMode(smokePin, INPUT);
pinMode(buzzerPin, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
}

void loop() {
sensitivity_smoke = analogRead(smokePin);
Serial.begin(9600);
delay(100);
Serial.println(sensitivity_smoke);
if(sensitivity_smoke > 15){
digitalWrite(buzzerPin, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, LOW);
status_sensitivity_smoke = 0;
last_status_sensitivity_smoke = 0;
}

else{
digitalWrite(buzzerPin, LOW);
digitalWrite(7, LOW);
digitalWrite(8, HIGH);
status_sensitivity_smoke = 0;
kirimdata(); //*** here is where arduino says error ****
last_status_sensitivity_smoke = status_sensitivity_smoke;
}

void kirimdata(){
int sensitivity_smoke;
if (client.connect(server, 80)) {
Serial.println(“Connected”);
client.print(“GET /whatsapp/send_pesan_whatsapp.php?sensitivity_smoke=”);
client.print(sensitivity_smoke);
client.println(" HTTP/1.1");
client.println(“Host: 192.168.3.10”);
client.println(“Connection: close”);
client.println();
Serial.println();
while(client.connected()) {
while(client.available()) {
Serial.write(client.read());
}
}
} else {
Serial.println(“Connection unsuccesful”);
}
client.stop();
while(client.status() != 0){
delay(5);
}
}

so would I, try and indent your code properly and you will find that loop() is missing it completing closing curly-brace, hence kirimdata() never gets declared, and therefore it is out of scope within loop()

Well, the compiler is not wrong.

You are calling the kirimdata() function but where is it ? Answer, inside the loop() function. Where should the loop() function end in your code ?

Auto formatting the code in the IDE may help you see the problem. All function definitions should start on the left margin. Is that the case for the kirimdata() function in your code ?

You've got your braces messed up so that kirimdata is defined inside the loop function. That's not allowed. IT must be outside on it's own. If you will properly format your code, then you will be able to see errors like this. Press control-T in the IDE and it will format the code for you so the blocks are all lined up and you can see what is inside which block.

Please edit your post and add code tags ([code]and [/code] ) around the code.

Use tools -> autoformat in the IDE to properly format you code; if you do that you will see

void loop() {
  ...
  ...

  void kirimdata() {

The fact that void kirimdata() { does not start at the beginning of a line after an auto-format indicates that your missing a } somewhere.

Can you now figure out the place where you are missing the closing (}) curly brace?

#include <Wire.h>
#include <Ethernet.h>
#include <SPI.h>

//Definisi Pin
const int smokePin = A0;
const int buzzerPin = 13;
int sensitivity_smoke;
int status_sensitivity_smoke;
int last_status_sensitivity_smoke;

//Definisi Ethernet
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
byte ip [] = {192, 168, 1, 177}; //ip
byte server [] = {192, 168, 3, 10}; //localhost
byte gateway [] = {192, 168, 3, 100}; //gateway
EthernetClient client;

void setup()
{
  Ethernet.begin(mac, ip, gateway);
  Serial.begin(9600);
  pinMode(smokePin, INPUT);
  pinMode(buzzerPin, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);
}

void loop()
{
  sensitivity_smoke = analogRead(smokePin);
  Serial.begin(9600);
  delay(100);
  Serial.println(sensitivity_smoke);
  if (sensitivity_smoke > 15)
  {
    digitalWrite(buzzerPin, HIGH);
    digitalWrite(7, HIGH);
    digitalWrite(8, LOW);
    status_sensitivity_smoke = 0;
    last_status_sensitivity_smoke = 0;
  }

  else
  {
    digitalWrite(buzzerPin, LOW);
    digitalWrite(7, LOW);
    digitalWrite(8, HIGH);
    status_sensitivity_smoke = 0;
    kirimdata(); //*** here is where arduino says error ****
    last_status_sensitivity_smoke = status_sensitivity_smoke;
  }

  void kirimdata()
  {
    int sensitivity_smoke;
    if (client.connect(server, 80))
    {
      Serial.println("Connected");
      client.print("GET /whatsapp/send_pesan_whatsapp.php?sensitivity_smoke=");
      client.print(sensitivity_smoke);
      client.println(" HTTP/1.1");
      client.println("Host: 192.168.3.10");
      client.println("Connection: close");
      client.println();
      Serial.println();
      while (client.connected())
      {
        while (client.available())
        {
          Serial.write(client.read());
        }
      }
    }
    else
    {
      Serial.println("Connection unsuccesful");
    }
    client.stop();
    while (client.status() != 0)
    {
      delay(5);
    }
  }