• הרשמה
    • התחברות
    • חיפוש
    • דף הבית
    • אינדקס קישורים
    • פוסטים אחרונים
    • קבלת התראות מהדפדפן
    • משתמשים
    • חיפוש בהגדרות המתקדמות
    • חיפוש גוגל בפורום
    • ניהול המערכת
    • ניהול המערכת - שרת private
    1. דף הבית
    2. לעיתים נדירות
    ל
    • פרופיל
    • עוקב אחרי 0
    • עוקבים 0
    • נושאים 5
    • פוסטים 15
    • הגבוה ביותר 2
    • שנוי במחלוקת 0
    • קבוצות 0

    לעיתים נדירות

    @לעיתים נדירות

    2
    מוניטין
    20
    צפיות בפרופיל
    15
    פוסטים
    0
    עוקבים
    0
    עוקב אחרי
    הצטרף ב- התחבר לאחרונה

    לעיתים נדירות הפסק לעקוב עקוב

    הפוסטים הטובים ביותר שנוצרו על ידי לעיתים נדירות

    • RE: שלוחת API שמשום מה מריץ את הקוד פעמיים.

      @צדיק-תמים
      נכון מאוד

      הסתדר!

      פורסם בעזרה הדדית למשתמשים מתקדמים
      ל
      לעיתים נדירות
    • שלוחת API שמשום מה מריץ את הקוד פעמיים.

      עשיתי קוד להזנת מונה חשמל וחישוב לדאטה בייס;

      <?php
      
      // Sanitize and validate input
      $ApiPhone = filter_input(INPUT_GET, 'ApiPhone', FILTER_SANITIZE_STRING);
      if (!$ApiPhone) {
           die("Invalid input");
      }
      $new_counter = filter_input(INPUT_GET, 'a', FILTER_VALIDATE_INT);
      if (!$new_counter) {
           die("Invalid input");
      }
      
      // Connect to the database
      $db = new mysqli('localhost', '?', '?!', '?');
      
      // Check for errors
      if ($db->connect_error) {
           die("Connection failed: " . $db->connect_error);
      }
      //the table name
      $table = 'Electricity_meter';
      
      // Prepare and execute the SQL query using a prepared statement
      $sql = "SELECT `sum_counter`, `prev_data` FROM `$table` WHERE `ApiPhone` = ? ORDER BY `prev_data` DESC LIMIT 1";
      $stmt = $db->prepare($sql);
      if (!$stmt) {
           die("Error preparing query: " . $db->error);
      }
      $stmt->bind_param("s", $ApiPhone); // bind the ApiPhone variable to the prepared statement
      $stmt->execute();
      $result = $stmt->get_result();
      
      // Check for errors
      if (!$result) {
           die("Error executing query: " . $db->error);
      }
      
      // Fetch the results
      $row = $result->fetch_assoc();
      if (!$row) {
           die("No results found");
      }
      
      // Perform the calculation
      $result1 = 0;
      if ($new_counter >= $row['sum_counter']) {
           $result1 = ($new_counter - $row['sum_counter']) * 0.6155;
      }
      if ($result1 < 0) {
           $result1 = 0;
      }
      
      // Calculate the number of days between the two dates
      $prev_date = strtotime($row['prev_data']);
      if (!$prev_date) {
           die("Invalid date format");
      }
      $today = strtotime(date('Y-m-d'));
      if (!$today) {
           die("Invalid date format");
      }
      $num_days = floor(($today - $prev_date) / 86400);
      
      // Calculate the result
      $result2 = $num_days * 3.6;
      $result3 = round($result1 + $result2, 2);
      
      // Insert the new data into the table
      $insert_sql = "INSERT INTO `$table` (`sum_counter`, `prev_data`, `sum_payment`, `ApiPhone` ) VALUES ('$new_counter', NOW(), '$result3', '$ApiPhone')";
      $insert_result = $db->query($insert_sql);
      if (!$insert_result) {
           die("Error inserting data: " . $db->error);
      }
      
      // Close the database connection
      $stmt->close();
      $db->close();
      
      // Print the result
      echo "id_list_message=t-סך הכל שעליך לשלם.n-" . str_replace(".", ".t-נקודה.d-", $result3);
      ?>
      
      

      אולם כאשר אני מפעיל את הקוד בשלוחת API, משום מה השרת מקבל פעמיים את ההפעלה, ומוזן לDB פעמיים נתונים (מה שמבלבל את הנתונים לפעם הבאה).

      מישהו מכיר או למאןדהו פתרונים?

      פורסם בעזרה הדדית למשתמשים מתקדמים
      ל
      לעיתים נדירות

    פוסטים אחרונים שנוצרו על ידי לעיתים נדירות

    • RE: שיתוף שלוחת ראוטינג ממספר אמריקאי

      @8503524 פשוט אני כרגע בארה"ב וזה חינם לי שיחות בארה"ב.

      פורסם בשאלות ועזרה הדדית
      ל
      לעיתים נדירות
    • שיתוף שלוחת ראוטינג ממספר אמריקאי

      מחפש בעל מערכת קו אמריקאי שמוכן לעשות למערכת שלי הפניית ראוטינג ימות, והפנייה לפי מספר מחייג לשלוחת הראוטינג.

      תודה מראש!!!

      פורסם בשאלות ועזרה הדדית
      ל
      לעיתים נדירות
    • RE: אני מחפש מתנדב שיחזיק עבורי בשרת שלו שני קבצי PHP פשוטים. וטבלת QSL אחד קטן.

      @ivrפון בחינם זה לא תומך API וחיבור שרתים אחרים לQSL

      פורסם בשאלות ועזרה הדדית
      ל
      לעיתים נדירות
    • RE: אני מחפש מתנדב שיחזיק עבורי בשרת שלו שני קבצי PHP פשוטים. וטבלת QSL אחד קטן.

      @שולי מייל לאן? יש דרך בפורום לשלוח הודעות פרטיות?

      פורסם בשאלות ועזרה הדדית
      ל
      לעיתים נדירות
    • RE: אני מחפש מתנדב שיחזיק עבורי בשרת שלו שני קבצי PHP פשוטים. וטבלת QSL אחד קטן.

      טוב בינתיים הסתדרתי עם פתיחת פרוייקט בrender והעלאת מסד נתונים לfreemysqlhosting.net.
      אבל אולי ניתן לפתוח שרת מהיר וגדול להרבה אנשים [מי שמעוניין ואין לו קודים וDB שמעוניין להסתירם.‏]

      פורסם בשאלות ועזרה הדדית
      ל
      לעיתים נדירות
    • אני מחפש מתנדב שיחזיק עבורי בשרת שלו שני קבצי PHP פשוטים. וטבלת QSL אחד קטן.

      אני מחפש מתנדב שיחזיק עבורי בשרת שלו שני קבצי PHP פשוטים. וטבלת QSL אחד קטן.
      ויחזיר לי את כתובת הקישור לקבצים.
      פשוט 000website סגרו לי השבוע את שרת החינמי.
      תודה

      פורסם בשאלות ועזרה הדדית
      ל
      לעיתים נדירות
    • האם ניתן לחבר שלוחה כתכנת SIP חיצוני?

      יש לי קו SIP בלגי, שממנה אני יכול לחייג חינם לבלגיה כאשר אני מגדיר אותו בmicroSIP וכדו'.
      השאלה שלי האם ניתן להגדיר שלוחה במערכת כאילו שזה תכנת SIP עם שם משתמש ודומיין הsip, ולהוציא שיחות הימנה. [ולחלופין שהשלוחה תוציא אוטומטית שיחה למס' X דרך הSIP]

      פורסם בטלפונים ומערכות SIP
      ל
      לעיתים נדירות
    • RE: מנוע דיבור TTS באנגלית

      @צדיק-תמים

      המרות ללא הגבלה, פלא א"כ מדוע ימות המשיח עצמם לא מספקים את השירות הזה,
      וכי אין לזה צורך [לטקסטים באנגלית] ?!

      פורסם בעזרה הדדית למשתמשים מתקדמים
      ל
      לעיתים נדירות
    • RE: שלוחת API שמשום מה מריץ את הקוד פעמיים.

      @צדיק-תמים
      נכון מאוד

      הסתדר!

      פורסם בעזרה הדדית למשתמשים מתקדמים
      ל
      לעיתים נדירות
    • שלוחת API שמשום מה מריץ את הקוד פעמיים.

      עשיתי קוד להזנת מונה חשמל וחישוב לדאטה בייס;

      <?php
      
      // Sanitize and validate input
      $ApiPhone = filter_input(INPUT_GET, 'ApiPhone', FILTER_SANITIZE_STRING);
      if (!$ApiPhone) {
           die("Invalid input");
      }
      $new_counter = filter_input(INPUT_GET, 'a', FILTER_VALIDATE_INT);
      if (!$new_counter) {
           die("Invalid input");
      }
      
      // Connect to the database
      $db = new mysqli('localhost', '?', '?!', '?');
      
      // Check for errors
      if ($db->connect_error) {
           die("Connection failed: " . $db->connect_error);
      }
      //the table name
      $table = 'Electricity_meter';
      
      // Prepare and execute the SQL query using a prepared statement
      $sql = "SELECT `sum_counter`, `prev_data` FROM `$table` WHERE `ApiPhone` = ? ORDER BY `prev_data` DESC LIMIT 1";
      $stmt = $db->prepare($sql);
      if (!$stmt) {
           die("Error preparing query: " . $db->error);
      }
      $stmt->bind_param("s", $ApiPhone); // bind the ApiPhone variable to the prepared statement
      $stmt->execute();
      $result = $stmt->get_result();
      
      // Check for errors
      if (!$result) {
           die("Error executing query: " . $db->error);
      }
      
      // Fetch the results
      $row = $result->fetch_assoc();
      if (!$row) {
           die("No results found");
      }
      
      // Perform the calculation
      $result1 = 0;
      if ($new_counter >= $row['sum_counter']) {
           $result1 = ($new_counter - $row['sum_counter']) * 0.6155;
      }
      if ($result1 < 0) {
           $result1 = 0;
      }
      
      // Calculate the number of days between the two dates
      $prev_date = strtotime($row['prev_data']);
      if (!$prev_date) {
           die("Invalid date format");
      }
      $today = strtotime(date('Y-m-d'));
      if (!$today) {
           die("Invalid date format");
      }
      $num_days = floor(($today - $prev_date) / 86400);
      
      // Calculate the result
      $result2 = $num_days * 3.6;
      $result3 = round($result1 + $result2, 2);
      
      // Insert the new data into the table
      $insert_sql = "INSERT INTO `$table` (`sum_counter`, `prev_data`, `sum_payment`, `ApiPhone` ) VALUES ('$new_counter', NOW(), '$result3', '$ApiPhone')";
      $insert_result = $db->query($insert_sql);
      if (!$insert_result) {
           die("Error inserting data: " . $db->error);
      }
      
      // Close the database connection
      $stmt->close();
      $db->close();
      
      // Print the result
      echo "id_list_message=t-סך הכל שעליך לשלם.n-" . str_replace(".", ".t-נקודה.d-", $result3);
      ?>
      
      

      אולם כאשר אני מפעיל את הקוד בשלוחת API, משום מה השרת מקבל פעמיים את ההפעלה, ומוזן לDB פעמיים נתונים (מה שמבלבל את הנתונים לפעם הבאה).

      מישהו מכיר או למאןדהו פתרונים?

      פורסם בעזרה הדדית למשתמשים מתקדמים
      ל
      לעיתים נדירות