Input tags in my project are Making my web pages crash [closed]

Input tags in my project are Making my web pages crash,
I am using Next JS latest and tailwind CSS.

So recently, my SSD died on me but i managed to recover the project (I don’t know if it relates). I was further working go the project and now recently, I have to make it live but when I press on any of the input tags used as search bars or form fields they just cause the website to crash i don’t know what to do. they are simple input tags with no states being handled

<input
  type="text"
  placeholder="Search products..."
  className="border border-gray-300  px-4 py-2 w-[380px]"
/>

Please help me I want the fix quick

I tried adding states, remade them asked AI which just adds states

Laravel HasUuids trait causes conflicts

Laravel 11. I have a model which uses Laravel’s HasUuids trait:

use IlluminateDatabaseEloquentModel;
use IlluminateDatabaseEloquentConcernsHasUuids;

class Foobar extends Model
{
  use HasUuids;
  /* ... */
}

In PhpStorm (2025.1.0.1), the “use HasUuids” line has a red squiggly underline, and hovering over it shows this error:

Trait method ‘uniqueIds’ will not be applied because it collides with ‘HasUuids’

Trait method ‘resolveRouteBindingQuery’ will not be applied because it collides with ‘HasUuids’

Trait method ‘getIncrementing’will not be applied because it collides with ‘HasUuids’

Trait method ‘getKeyType’ will not be applied because it collides with ‘HasUuids’

Trait method ‘uniqueIds’ will not be applied because it collides with ‘HasUniqueStringIds’

Trait method ‘resolveRouteBindingQuery’ will not be applied because it collides with ‘HasUniqueStringIds’

Trait method ‘getIncrementing’ will not be applied because it collides with ‘HasUniqueStringIds’

Trait method ‘getKeyType’ will not be applied because it collides with ‘HasUniqueStringIds’

The collisions, I think, occur between the HasUuids trait (and the HasUniqueStringIds trait it in turn uses), and the Model class which FooBar extends. How can I remove this error report? Is it just a bug in PhpStorm?

PHP copy() function failed to overwrite file even executed as root in Alma linux

I have a PHP script that copies a file from one location to another, the script looks like this:

$success = copy('/tmp/source_test.txt', '/tmp/target_test.txt');
    if (!$success) {
        echo "Copy failed: " . error_get_last()['message'] . "nn";
    } else {
        echo "Copied OKnn";
    }

Both source_test.txt and target_test.txt exist and have the owner and permission set as follows:

  • source_test.txt (Owner: root:root; chmod: 644)
  • target_test.txt (Owner: php:wwwuser; chmod: 644)

I run the script on 2 server instances as ‘root’ by calling php /path/to/script.php, both instances are on Alma linux.

  • On the first instance, it works fine, the target_test.txt gets overwritten.
  • On the second instance, it fails with this message “Failed to open stream: Permission denied”.

It looks like the second is missing something or configuration that the PHP copy() function, even though being executed as root, does not have the permission to overwrite the target file.

Anyone experienced this problem before? Any advice is appreciated.

guide to simple php do not delete [closed]

this is the get based api needed

if($_SERVER['REQUEST_METHOD'] === "GET" && count($_GET) == 0)
{
    require_once "connect.php";
    $connection = connect();
    $sql = "";
    $result=$connection->query($sql)->fetch_all(MYSQLI_ASSOC);
    $connection->close();
    header("Content-type: application/json; charset=utf-8");
    http_response_code(200);
    echo json_encode($result, JSON_UNESCAPED_UNICODE);
}
else
{
    http_response_code(400);
}
?>

connect.php:

<?php
function connect()
{
    return new mysqli("localhost","root","","palyazatok");
}
?>

php, aka the main site where the things are seen:


 <?php
            $url = "full path to api file";
            $sv = file_get_contents($url);
            echo $sv;
        ?>

if needed in table:

<?php
            $url = "full path to api file";
            $sv = file_get_contents($url);
            $data = json_decode($sv);
        ?>

        <table class="table">
            <thead>
                <tr>
                    <th></th>
                    <th></th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                <?php
                    foreach($data as $row)
                    {
                        echo '
                            <tr>
                                <td>'.$row->sql column (ex. id).'</td>
                                <td>'.$row->sql column (ex. id).'</td>
                                <td>'.$row->sql column (ex. id).'</td>
                            </tr>';
                    }
                ?>
            </tbody>
        </table>

some more details details details dw bout it I am adding details to it please I beg you let me post these are all the details needed

the api part: !!NEEDED LATER WITH ADDING NEW!!

   <?php
   if($_SERVER['REQUEST_METHOD'] === "GET" && count($_GET) == 1 && isset($_GET['id']) && (int) $_GET['id'] > 0)
   {
       $id = (int) $_GET['id'];
       require_once "connect.php";
       $connection = connect();
       $sql = "";
       $result = $connection->query($sql)->fetch_all(MYSQLI_ASSOC);
       $connection->close();
       header("Content-type: application/json; charset=utf-8");
       http_response_code(200);
       echo json_encode($result, JSON_UNESCAPED_UNICODE);
   }
   else
   {
       http_response_code(400);
   }
   ?>

here is the frontend part, the forms is the dropdown:

<?php
           $url = "entire path to api file";
           $sv = file_get_contents($url);
           $data = json_decode($sv);

           if(isset($_GET['id']) && trim($_GET['id']) !== "")
           {
               $id = (int) $_GET['id'];
               $url = "path to api?id=".$id;
               $sv = file_get_contents($url);
               $result = json_decode($sv);
           }
           else
           {
               $result = [];
           }
       ?>

       <form action="file.php" method="get">
           <select name="id" onchange="submit()">
               <option value="">--- choose ... ---</option>
               <?php
                   foreach($data as $d)
                   {
                       $s = isset($_GET['id']) && $_GET['id'] == $d->id ? "selected" : "";
                       $text = $d->id."sql fields you want to appear" ;
                       echo '<option value="'.$d->id.'" '.$s.'>'.$text.'</option>';
                   }
               ?>
           </select>
       </form>

       <?php
       if(count($result) == 0)
       {
           echo '<h3>womp</h3>';
           return;
       }
       ?>

       <table class="table table-bordered table-hover table-stripped table-success mt-3">
           <thead>
               <tr>
                   <th>Számlaszám</th>
                   <th>Dátum</th>
                   <th>Érték</th>
                   <th>Költség megnevezése</th>
               </tr>
           </thead>
           <tbody>
               <?php
                   foreach($result as $row)
                   {
                       echo '
                           <tr>
                               <td>'.$row->id.'</td>
                           </tr>
                       ';
                   }
               ?>
           </tbody>
       </table>

!$text = $d->id.”sql fields you want to appear” ;! in php adding values and string works with . so it will look like: $d->id.”Id “.name.” this data”; or smth like that the $s is referring to selected

deleting through api:

    <?php
if($_SERVER['REQUEST_METHOD'] === "POST" && count($_POST) == 1 && isset($_POST['id']) && (int) $_POST['id'] > 0)
{
    $id = (int) $_POST['id'];
    require_once "connect.php";
    $connection = connect();
    $sql = "DELETE FROM ... WHERE Id = '$id'";
    $result=$connection->query($sql)-> fetch_all(MYSQLI_ASSOC); ;
(if needed just repeat these two lines (if it needs to delete from multiple tables)
    $connection->close();
    header("Content-type: application/json; charset=utf-8");
    http_response_code(200);
    $result=[];
    echo json_encode($tomb, JSON_UNESCAPED_UNICODE);
}
else
{
    http_response_code(400);
}
?>

the php part to this:

<?php
        if ($_SERVER['REQUEST_METHOD'] === "POST" && isset($_POST['id']) && (int) $_POST['id'] > 0)
{
    $id = (int) $_POST['id'];
    $data = http_build_query(['id' => $id]);

    $context = stream_context_create([
        'http' => [
            'method'  => 'POST',
            'header'  => 'Content-type: application/x-www-form-urlencoded',
            'content' => $data
        ]
    ]);

    file_get_contents("full path again");

    header("Location: file.php", false, $context);
    exit;
}
    ?>

adding inserting into database (this is only one php file):

<?php
        if($_SERVER['REQUEST_METHOD'] === "POST" && isset($_POST['p_id'],$_POST['k_id'],$_POST['szszam'],$_POST['datum'],$_POST['ertek']))
        {
            $p_id = $_POST['p_id'];
            $k_id = $_POST['k_id'];
            $szszam = $_POST['szszam'];
            $datum = $_POST['datum'];
            $ertek = $_POST['ertek'];
            $sql = "INSERT INTO ... VALUES ('$szszam', '$datum', '$ertek', '$p_id', '$k_id')";
            require_once "connect.php";
            $kapcs = connect();
            $kapcs->query($sql);
            header("location:previous_file.php?id=$p_id");
            return;
        }
    ?>

        <?php
        //might need this multiple times
            $url = "api where it gave back json.php";
            $sv = file_get_contents($url);
            $data = json_decode($sv);
        ?>

        <form method="post" action="file.php">
            <select name="d_id" required>
                <option value="">--- choose ---</option>
                <?php
                    foreach($data as $d)
                    {
                        $txt = $d->id.' - '.......;
                        echo '<option value="'.$d->id.'">'.$txt.'</option>';
                    }
                ?>

body of the question, I do not need any more explaining, I can see through this just fine. please details details details details details

PHP Automatically Get GPS Coordinates Latitude, Longitude and Altitude Without $_POST[”]; and Insert Into Database [duplicate]

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

P.H.P. Automatically Get G.P.S. Coordinates Latitude, Longitude and Altitude Without $_POST[”]; and Insert Into Database.

So far I can get the G.P.S. coordinates through $_POST[”] and send the coordinates by variable execution into the database as well as by an fwrite(); into a file.

I can’t seem to figure out how to get the coordinates without $_POST[”]; and write something to automatically put the coordinates into the database upon every reload of the web page document.

I have already tried $_GET[”]; methods and it does not work.

/*
============================================================================================================
 +
 + IF: Internal Application: Display :: Location :: Log Global-Positioning-System Coordinates :: Manual
 +
 ============================================================================================================
*/

if ($_GET["Display"] == "LogGPS_Manual") {

echo ("
<FORM ACTION="?$_INTERNAL_APPLICATION_MODULE_MEMBER&#61;Control_Panel&amp;Display&#61;LogGPS_Manual" METHOD="POST">
      <INPUT TYPE="hidden" NAME="latitude" ID="latitude">
      <INPUT TYPE="hidden" NAME="longitude" ID="longitude">
      <INPUT TYPE="submit" NAME="submit" VALUE="Display and Log Current G.P.S. Coordinates">
</FORM>
 
<SCRIPT TYPE="text/javascript">
    function getLocation() {
        navigator.geolocation.getCurrentPosition(showPosition);
}
 
function showPosition(position) {
    document.querySelector('#latitude').value = position.coords.latitude;
    document.querySelector('#longitude').value = position.coords.longitude;
}
 
getLocation();
</SCRIPT>
");

/*
 ============================================================================================================
 + IF: Internal Application: Device Test :: Global-Positioning-System Coordinates :: Chip :: Input Form :: Variables HAVE Executed, Display: G.P.S. Chip Location
 ============================================================================================================
*/
 
if (isset($_POST['submit'])) {

$_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LATITUDE                  = $_POST['latitude'];
$_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LONGITUDE                 = $_POST['longitude'];

echo ("
        <BR><HR WIDTH="25%" ALIGN="LEFT">
            Global-Positioning-System Coordinates :: Current
        <HR WIDTH="25%" ALIGN="LEFT">
            *&nbsp;Global-Positioning-System Coordinates :: Device :: Chip: Latitude: $_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LATITUDE<BR>
            *&nbsp;Global-Positioning-System Coordinates :: Device :: Chip: Longitude: $_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LONGITUDE<BR>
            *&nbsp;Global-Positioning-System Coordinates :: Device :: Chip: Altitude To Sea-Level: $_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_ALTITUDE<BR>
            *&nbsp;Highlight and Copy Together: $_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LATITUDE, $_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LONGITUDE<BR>
");

/*
 ============================================================================================================
 + Database Management System Server :: Database :: Query :: Update :: Registered Member Account :: Global-Positioning-System :: Coordinates :: From :: Hyper-Text-Markup-Language :: Get Location
 ============================================================================================================
*/

$_Application_Module_Member_Control_Panel_DB_Query_UPDATE_MEMBER_ACCOUNT_GPS_HTML_XYZ           = $_GLOBAL_DATABASE_MANAGEMENT_SYSTEM_SERVER_DATABASE_CONNECTION->query("UPDATE {$_ACCESS_DATABASE_SERVER_DATABASE_TABLE_PREFIX}_members SET
member_location_device_html_gps_x='$_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LATITUDE',
member_location_device_html_gps_y='$_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LONGITUDE'
WHERE member_username='$_GLOBAL_COOKIE_MEMBER_USERNAME'");

/*
 ============================================================================================================
 + IF: Database Management System Server :: Database :: Query :: Update :: Registered Member Account :: Global-Positioning-System :: Coordinates :: From :: Hyper-Text-Markup-Language :: Get Location
 ============================================================================================================
*/

if ($_Application_Module_Member_Control_Panel_DB_Query_UPDATE_MEMBER_ACCOUNT_GPS_HTML_XYZ) {

echo ("*&nbsp;The Current Global-Posititioning-System Coordinates Were Inserted Into This Registered Member Account Database Entry.<BR>");

} // [ + ] IF: Database Management System Server :: Database :: Query :: Update :: Registered Member Account :: Global-Positioning-System :: Coordinates :: From :: Hyper-Text-Markup-Language :: Get Location

/*
 ============================================================================================================
 + Write To File :: Registered Member Account :: Activity Log :: Raw Log :: Global-Positioning-System :: Coordinates :: H.T.M.L. :: Manual
 ============================================================================================================
*/

$_Application_Module_Control_Panel_Log_Member_GPS_Coordinates_HTML_Manual_FIND_FILE_NAME        = "./Member/$_GLOBAL_COOKIE_MEMBER_USERNAME/Files/Document/Activity_Logging/$_GLOBAL_LOCAL_SERVER_DATE_NUMERICAL_YEAR_FULL/$_GLOBAL_LOCAL_SERVER_DATE_NUMERICAL_MONTH_FULL/$_GLOBAL_LOCAL_SERVER_DATE_NUMERICAL_MONTH_DAY_FULL/Log_Member_GPS_Coordinates_HTML_Manual.html";
$_Application_Module_Control_Panel_Log_Member_GPS_Coordinates_HTML_Manual_OPEN_FILE_NAME        = fopen("$_Application_Module_Control_Panel_Log_Member_GPS_Coordinates_HTML_Manual_FIND_FILE_NAME", "a");

$_Application_Module_Control_Panel_Log_Member_GPS_Coordinates_HTML_Manual_RAW_FIND_FILE_NAME        = "./Member/$_GLOBAL_COOKIE_MEMBER_USERNAME/Files/Document/Activity_Logging/Log_Member_GPS_Coordinates_Raw_Manual.php";
$_Application_Module_Control_Panel_Log_Member_GPS_Coordinates_HTML_Manual_RAW_OPEN_FILE_NAME        = fopen("$_Application_Module_Control_Panel_Log_Member_GPS_Coordinates_HTML_Manual_RAW_FIND_FILE_NAME", "a");

/*
 ============================================================================================================
 + IF: Write To File :: Registered Member Account :: Activity Log :: Raw Log :: Global-Positioning-System :: Coordinates :: H.T.M.L. :: Manual
 ============================================================================================================
*/

if (fwrite($_Application_Module_Control_Panel_Log_Member_GPS_Coordinates_HTML_Manual_OPEN_FILE_NAME, "
-----------------------------------------------------------------------------------------------<BR>
- Global-Positioning-System Coordinates Log Entry<BR>
-----------------------------------------------------------------------------------------------<BR>
* Global-Positioning-System Coordinates :: Timestamp :: Device :: This Web Server: $_GLOBAL_LOCAL_SERVER_DATE_STANDARD<BR>
* Global-Positioning-System Coordinates :: Timestamp :: Device :: Connected Device: <A HREF="$_SYSTEM_SERVER_NETWORKING_RESOLVER_TIMESTAMP_UNIX_EPOCH" TITLE=":: Open & Display :: The Official :: Unix-Epoch Timestamp Resolver :: For This Unix-Epoch Timestamp ::" TARGET="_NEW">$_GLOBAL_LOCAL_SERVER_TIME_UNIX</A><BR>
* Global-Positioning-System Coordinates :: Longitude: $_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LATITUDE<BR>
* Global-Positioning-System Coordinates :: Latitude: $_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LONGITUDE<BR>
* Global-Positioning-System Coordinates :: Altitude: $_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_ALTITUDE<BR>
* Internet Protocol Address :: Device :: This Web Server :: <A HREF="$_SYSTEM_SERVER_NETWORKING_RESOLVER_WHOIS/$_GLOBAL_REMOTE_SERVER_ADDRESS" TITLE=":: Open & Display :: The Who-Is Data :: For :: $_GLOBAL_LOCAL_SERVER_ADDRESS ::" TARGET="_NEW">$_GLOBAL_LOCAL_SERVER_ADDRESS :: Port Number: $_GLOBAL_LOCAL_SERVER_PORT</A><BR>
* Internet Protocol Address :: Device :: Connected Device :: <A HREF="$_SYSTEM_SERVER_NETWORKING_RESOLVER_WHOIS/$_GLOBAL_LOCAL_SERVER_ADDRESS" TITLE=":: Open & Display :: The Who-Is Data :: For :: $_GLOBAL_REMOTE_SERVER_ADDRESS ::" TARGET="_NEW">$_GLOBAL_REMOTE_SERVER_ADDRESS :: Port Number: $_GLOBAL_REMOTE_SERVER_PORT</A><BR>
* Highlight and Copy Together: $_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LATITUDE, $_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LONGITUDE<BR>
* Google Maps: <A HREF="https://www.Google.com/maps/place/$_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LATITUDE, $_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LONGITUDE" TITLE=":: Open & Display :: Google Maps :: Global-Positioning-System Coordinates :: For :: $_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LATITUDE, $_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LONGITUDE" TARGET="_NEW">$_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LATITUDE, $_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LONGITUDE</A><BR><BR>
")) {

echo ("*&nbsp;The Current Global-Posititioning-System Coordinates Were Manually Inserted Into This Registered Member Account Log File.<BR>");

} // [ + ] IF: Write To File :: Registered Member Account :: Activity Log :: Raw Log :: Global-Positioning-System :: Coordinates :: H.T.M.L. :: Manual

/*
 ============================================================================================================
 + Close File :: Registered Member Account :: Activity Log :: Raw Log :: Global-Positioning-System :: Coordinates :: H.T.M.L. :: Manual
 ============================================================================================================
*/

fclose($_Application_Module_Control_Panel_Log_Member_GPS_Coordinates_HTML_Manual_OPEN_FILE_NAME);

/*
 ============================================================================================================
 + IF: Write To File :: Registered Member Account :: Activity Log :: Raw Log :: Global-Positioning-System :: Coordinates :: P.H.P. :: Manual
 ============================================================================================================
*/

if (fwrite($_Application_Module_Control_Panel_Log_Member_GPS_Coordinates_HTML_Manual_RAW_OPEN_FILE_NAME, "
-----------------------------------------------------------------------------------------------
- Global-Positioning-System Coordinates Log Entry
-----------------------------------------------------------------------------------------------
* Global-Positioning-System Coordinates :: Timestamp :: Device :: This Web Server: $_GLOBAL_LOCAL_SERVER_DATE_STANDARD
* Global-Positioning-System Coordinates :: Timestamp :: Device :: Connected Device: $_GLOBAL_LOCAL_SERVER_TIME_UNIX
* Global-Positioning-System Coordinates :: Longitude: $_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LATITUDE
* Global-Positioning-System Coordinates :: Latitude: $_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LONGITUDE
* Global-Positioning-System Coordinates :: Altitude: $_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_ALTITUDE
* Internet Protocol Address :: Device :: This Web Server :: $_GLOBAL_LOCAL_SERVER_ADDRESS :: Port Number: $_GLOBAL_LOCAL_SERVER_PORT
* Internet Protocol Address :: Device :: Connected Device :: $_GLOBAL_REMOTE_SERVER_ADDRESS :: Port Number: $_GLOBAL_REMOTE_SERVER_PORT
* Highlight and Copy Together: $_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LATITUDE, $_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LONGITUDE
* Google Maps: https://www.Google.com/maps/place/$_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LATITUDE, $_Application_Module_Member_Devices_POST_DEVICE_TEST_GPS_CHIP_LONGITUDE
")) {

echo ("*&nbsp;The Current Global-Posititioning-System Coordinates Were Manually Inserted Into This Registered Member Account Log File.<BR>");

} // [ + ] IF: Write To File :: Registered Member Account :: Activity Log :: Raw Log :: Global-Positioning-System :: Coordinates :: H.T.M.L. :: Manual

/*
 ============================================================================================================
 + Close File :: Registered Member Account :: Activity Log :: Raw Log :: Global-Positioning-System :: Coordinates :: P.H.P. :: Manual
 ============================================================================================================
*/

fclose($_Application_Module_Control_Panel_Log_Member_GPS_Coordinates_HTML_Manual_RAW_OPEN_FILE_NAME);

} // [ + ] IF: Internal Application: Device Test :: Global-Positioning-System Coordinates :: Chip :: Input Form :: Variables HAVE Executed, Display: G.P.S. Chip Location

} // [ + ] IF: Internal Application: Control Panel :: Registered Member Account :: Display :: Log Global-Positioning-System-Coordinates :: Manual :: Is: Activated

Elementor form and Tera wallet: Display an error message if the balance is insufficient

In my WordPress website, I’m using WooCommerce and Tera Wallet plugins. An Elementor form debits the customer wallet based on the option they choose. I would like to display an error message when the customer balance is insufficient.

Screenshots:

enter image description here

enter image description here

  • Small – 1000 Words. (0.80$)|0.80
  • Medium – 2000 Words. (0.90$)|0.90
  • Large – 3000 Words. (1.00$)|1.00

Current code that makes the discount in the user’s Tera wallet:

add_action( 'elementor_pro/forms/new_record', function( $record, $handler ) {
    // Nome do formulário (configure no Elementor, aba Avançado > Nome do formulário)
    $form_name = $record->get_form_settings( 'form_name' );
    if ( 'artigo_saldo' !== $form_name ) {
        return; // Evita interferir em outros formulários
    }

    // Captura os campos do formulário
    $fields = $record->get( 'fields' );

    // Verifica se o campo saldo_artigo foi preenchido
    if ( empty( $fields['saldo_artigo']['value'] ) ) {
        return;
    }

    // Converte o valor para float
    $valor = floatval( $fields['saldo_artigo']['value'] );

    // Pega o usuário logado
    $user_id = get_current_user_id();

    if ( $user_id && $valor > 0 ) {
        $descricao = 'Débito automático após envio do formulário de artigo';

        // Realiza o débito da carteira
        woo_wallet()->wallet->debit( $user_id, $valor, $descricao );
    }

}, 10, 2 );

how to prevent overlapping on the same workstation in a gantt schedule?

I m making a gantt scheduler app web dev .. I m a noob
the app is now generating schedules following the sequence order and the parallel scheduling but i failed to prevent it from making 2 operations on the same workstation overlap , i want to make the 2nd operation to start when the other operation ends in case they overlap .. also failed to use react drag and drop properly but i can just do toggle buttons .. it is the overlap that i want to deal with

i tried libraries, asynch calculators , new files for the purpose of dealing with overlap but nothing seemed to work for me

Create a background effect with css and js [closed]

I have been inspired by a website background effect and I really want to create it for my html website, the website is built on wordpress and it uses owl-carousel as per my knowledge. How can I achieve this same effect in html css code or if there is any library i could use? following is the website used. However, I have done some coding stuff but I am nowhere close to it.

Reference website : https://demo.artureanec.com/themes/agencium/

My code :

    <div class="abc"> 
  <div class="container">
    <div class="row">
      <div class="col-lg-12">
       <!-- Add your content for this section here -->
       <h1>Animated Background Section</h1>
       <p>This section has an animated gradient background.</p>
      </div>
    </div>
  </div>
</div>

    
.technology-item {
  padding: 20px;
  border: 1px solid #eeeeee; /* Light grey border */
  border-radius: 8px; /* Rounded corners */
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 160px; /* Ensure consistent height */
  box-sizing: border-box;
}

.tech-icon {
  margin-bottom: 15px;
  overflow: hidden; 
}

.tech-icon img {
  max-width: 50px;  /* Smaller icon size */
  max-height: 50px; /* Smaller icon size */
  transition: transform 0.3s ease-in-out;
  display: block;
  margin: 0 auto;
}

.technology-item:hover {
  box-shadow: 0 4px 15px rgba(0,0,0,0.1); /* Subtle shadow on hover */
}

.technology-item:hover .tech-icon img {
  transform: scale(1.15); /* Zoom effect on icon */
}

.tech-name {
  font-size: 14px;
  color: #333333;
  margin-top: auto; /* Pushes name to bottom */
  text-align: center;
}

/* Designing Success Section Styles */
.designing-success-area {
  position: relative; /* Needed for pseudo-element background */
  background-color: #f8f9fa; /* Light grey background as fallback or base */
}

.designing-success-area::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 40%; /* Adjust width of the map background */
  background-image: url('../img/bg/world-map-dots.png'); /* Path to your dotted world map image */
  background-repeat: no-repeat;
  background-position: center right;
  background-size: contain; /* Or cover, depending on the map image */
  opacity: 0.5; /* Adjust opacity as needed */
  z-index: 1;
}

.designing-success-area .container {
  position: relative; /* Ensure container content is above the pseudo-element */
  z-index: 2;
}

.stat-item {
  background-color: #ffffff;
  padding: 30px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease-in-out;
  height: 100%; /* Ensure all items have the same height */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stat-item .stat-icon-wrapper {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-color: #e9f5ff; /* Light blue background for icon */
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: #007bff; /* Icon color */
}

.stat-item .stat-number {
  font-size: 36px;
  font-weight: 700;
  color: #1a294d;
  margin-bottom: 5px;
}

.stat-item .stat-label {
  font-size: 16px;
  color: #555;
  margin-bottom: 0;
}

.stat-item:hover,
.stat-item.highlighted { /* Added .highlighted for the specific item */
  background-color: #ffffff;
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid #dee2e6; /* Border for hover/highlighted state */
}

.stat-item.highlighted .stat-icon-wrapper {
    background-color: #d4ebff; /* Slightly darker blue for highlighted icon wrapper */
}

/* Ensure FontAwesome is linked in your HTML or imported if using a framework */

/* Temporary Debug Styles for .abc */
.abc {
  position: relative;
  overflow: hidden; /* Keep overflow hidden */
  background-color: red; /* Brightly visible background */
  color: lime; /* Brightly visible text */
  padding: 50px;
  text-align: center;
  min-height: 300px; /* Ensure it has some height */

  /* Simple mask: left half transparent, right half opaque (black mask = opaque element) */
  mask-image: linear-gradient(to right, 
    transparent 0%, 
    transparent 49.9%, 
    black 50%, 
    black 100%);
  /* Forcing rgba for full clarity */
  /* mask-image: linear-gradient(to right, 
    rgba(0,0,0,0) 0%, 
    rgba(0,0,0,0) 49.9%, 
    rgba(0,0,0,1) 50%, 
    rgba(0,0,0,1) 100%); */
  
  /* Ensure no old mask properties interfere */
  mask-repeat: no-repeat; /* Default is fine, but explicit */
  mask-position: initial; /* Default is fine */
  
  z-index: 1; /* Stays above pseudo-elements */
}

.abc::before,
.abc::after {
  content: '';
  position: absolute;
  top: 50%; /* Centered vertically */
  width: 80px; /* Smaller, fixed size */
  height: 80px;
  opacity: 1;
  filter: none; /* No blur */
  z-index: 0; /* Behind .abc content if mask fails, part of .abc for masking */
  transform: translateY(-50%); /* Align center vertically */
  /* Remove any animations for this test */
  animation: none; 
}

.abc::before {
  background: blue;
  left: 25%; /* Positioned in the left part */
}

.abc::after {
  background: yellow;
  left: 75%; /* Positioned in the right part */
  transform: translate(-100%, -50%); /* Adjust because left: 75% is its starting point */
}

/* Remove old keyframes if they exist, or they'll be unused */
@keyframes flowLights1 {}
@keyframes flowLights2 {}
@keyframes rotateLights1 {}
@keyframes rotateLights2 {}

System Bug Fixes [closed]

Developing a system using HTML, PHP, MYSQL, CSS, Java Script.

Have encountered a few errors while testing it on localhost and not sure where the errors are thats not making it function

System files are CLICK HERE

a few areas to rectify
In the My Profile Section

  1. profile photo, guide on how to make a photo visible on the profile.
  2. country is not showing
  3. CV not uploading
  4. when i click “save changes” nothing is happening.
  5. on my profile add a place where users can enter their “hospital/institution”
  6. SFS Password data is missing and SFS username and SFS password should not be edited by users

in the Examiner Section

  1. Users Examiner number is not showing but is on the myqsl database
  2. the Role should not be selectable by user but set by the admin
  3. when confirming availability for the 2025 exams, and clicking save changes, nothing happens after that.

in the fellows section

  1. category, number, and year is not showing though it is on the mysql database.
  2. category, Fellow number, Year – these shouldnt be changed by the user, only admin can change.
  3. in this section users should only see their data and not make changes.

in brief the system is used for users to confirm participation for 2025 and if confirm either mcs or fcs or both, the marking sheets will be available (upon upload my my(admin) side)
once confirmed admin can toggle to generate a QR name tag for the user who confirm FCS which when scanned will add a check for attended FCS 2025

Fellows to see their annual subscription status and admin can toggle to confirm is paid for 2025

any assistance will be helpful to rectify the errors

Create a background effect with css and js

I have been inspired by a website background effect and I really want to create it for my html website, the website is built on wordpress and it uses owl-carousel as per my knowledge. How can I achieve this same effect in html css code or if there is any library i could use? following is the website used. However, I have done some coding stuff but I am nowhere close to it.

Reference website : https://demo.artureanec.com/themes/agencium/

My code :

    <div class="abc"> 
  <div class="container">
    <div class="row">
      <div class="col-lg-12">
       <!-- Add your content for this section here -->
       <h1>Animated Background Section</h1>
       <p>This section has an animated gradient background.</p>
      </div>
    </div>
  </div>
</div>

    
.technology-item {
  padding: 20px;
  border: 1px solid #eeeeee; /* Light grey border */
  border-radius: 8px; /* Rounded corners */
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 160px; /* Ensure consistent height */
  box-sizing: border-box;
}

.tech-icon {
  margin-bottom: 15px;
  overflow: hidden; 
}

.tech-icon img {
  max-width: 50px;  /* Smaller icon size */
  max-height: 50px; /* Smaller icon size */
  transition: transform 0.3s ease-in-out;
  display: block;
  margin: 0 auto;
}

.technology-item:hover {
  box-shadow: 0 4px 15px rgba(0,0,0,0.1); /* Subtle shadow on hover */
}

.technology-item:hover .tech-icon img {
  transform: scale(1.15); /* Zoom effect on icon */
}

.tech-name {
  font-size: 14px;
  color: #333333;
  margin-top: auto; /* Pushes name to bottom */
  text-align: center;
}

/* Designing Success Section Styles */
.designing-success-area {
  position: relative; /* Needed for pseudo-element background */
  background-color: #f8f9fa; /* Light grey background as fallback or base */
}

.designing-success-area::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 40%; /* Adjust width of the map background */
  background-image: url('../img/bg/world-map-dots.png'); /* Path to your dotted world map image */
  background-repeat: no-repeat;
  background-position: center right;
  background-size: contain; /* Or cover, depending on the map image */
  opacity: 0.5; /* Adjust opacity as needed */
  z-index: 1;
}

.designing-success-area .container {
  position: relative; /* Ensure container content is above the pseudo-element */
  z-index: 2;
}

.stat-item {
  background-color: #ffffff;
  padding: 30px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease-in-out;
  height: 100%; /* Ensure all items have the same height */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stat-item .stat-icon-wrapper {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-color: #e9f5ff; /* Light blue background for icon */
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: #007bff; /* Icon color */
}

.stat-item .stat-number {
  font-size: 36px;
  font-weight: 700;
  color: #1a294d;
  margin-bottom: 5px;
}

.stat-item .stat-label {
  font-size: 16px;
  color: #555;
  margin-bottom: 0;
}

.stat-item:hover,
.stat-item.highlighted { /* Added .highlighted for the specific item */
  background-color: #ffffff;
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid #dee2e6; /* Border for hover/highlighted state */
}

.stat-item.highlighted .stat-icon-wrapper {
    background-color: #d4ebff; /* Slightly darker blue for highlighted icon wrapper */
}

/* Ensure FontAwesome is linked in your HTML or imported if using a framework */

/* Temporary Debug Styles for .abc */
.abc {
  position: relative;
  overflow: hidden; /* Keep overflow hidden */
  background-color: red; /* Brightly visible background */
  color: lime; /* Brightly visible text */
  padding: 50px;
  text-align: center;
  min-height: 300px; /* Ensure it has some height */

  /* Simple mask: left half transparent, right half opaque (black mask = opaque element) */
  mask-image: linear-gradient(to right, 
    transparent 0%, 
    transparent 49.9%, 
    black 50%, 
    black 100%);
  /* Forcing rgba for full clarity */
  /* mask-image: linear-gradient(to right, 
    rgba(0,0,0,0) 0%, 
    rgba(0,0,0,0) 49.9%, 
    rgba(0,0,0,1) 50%, 
    rgba(0,0,0,1) 100%); */
  
  /* Ensure no old mask properties interfere */
  mask-repeat: no-repeat; /* Default is fine, but explicit */
  mask-position: initial; /* Default is fine */
  
  z-index: 1; /* Stays above pseudo-elements */
}

.abc::before,
.abc::after {
  content: '';
  position: absolute;
  top: 50%; /* Centered vertically */
  width: 80px; /* Smaller, fixed size */
  height: 80px;
  opacity: 1;
  filter: none; /* No blur */
  z-index: 0; /* Behind .abc content if mask fails, part of .abc for masking */
  transform: translateY(-50%); /* Align center vertically */
  /* Remove any animations for this test */
  animation: none; 
}

.abc::before {
  background: blue;
  left: 25%; /* Positioned in the left part */
}

.abc::after {
  background: yellow;
  left: 75%; /* Positioned in the right part */
  transform: translate(-100%, -50%); /* Adjust because left: 75% is its starting point */
}

/* Remove old keyframes if they exist, or they'll be unused */
@keyframes flowLights1 {}
@keyframes flowLights2 {}
@keyframes rotateLights1 {}
@keyframes rotateLights2 {}

C# Kendo Grid – cascading combo box with pre-loaded values

I have a .NET MVC app where I’m using Kendo grid. I have a form that a user can fill out and save it as a draft, then come back later and finish it. When I go to edit the form I saved as a draft, I want all of the combo boxes (including cascading ones) to auto-fill with the previously selected values. I’m able to do this fine with non-cascading combo boxes, and somewhat with cascading combo boxes, but the problem I’m having is that the displayed value in my cascading combo box is the value (an int ID) when I want it to display the text value (a string).

@(Html.Kendo().ComboBox()
    .Name("ChildId") // Matches the column name
    .DataTextField("Text")
    .DataValueField("Value")
    .CascadeFrom("ParentId") // Cascades based on ParentId
    .CascadeOnPageLoadIfThereBeAValueInTheOtherCombo() // I'm looking for something like this
    .DataSource(source => source
        .Read(read => read.Action("GetChildData", "Home"))
    )
    .OptionLabel("Select Child")
)

I understand that the data does not get pulled into the cascading combo box normally until a selection is made from the dropdown box it cascades from, and if I’m just basing the Kendo combobox on an ID attribute it won’t know what text to display without getting the list items, but in this case a selection was already made previously so I want it to get that data immediately (on page load). Is there a way I can do it in JavaScript or call some Kendo method in C# that tells it to populate with the data immediately without waiting for the initial user interaction?

If I can at a minimum set the display text to what I want then that might be enough.

Managing window closing in a PWA

Is there anything other than beforeunload available to PWAs when the user closes an installed PWA application’s window? I’m building a desktop application that may have unsaved edits across multiple files and the flow would currently be:

  • User clicks the close button
  • beforeunload shows “You have unsaved changes. Click Cancel to choose what to save or OK to quit.”
  • If the user chooses cancel, an HTML-based dialogue is shown in the web application for each file with the standard <Yes> <No> <Cancel> <No to All> buttons

When the user clicks close, ideally I’d like only my HTML dialogue to be shown, but I’m curious to learn about what options exist.

How to preserve cursor-based infinite scroll data with Next.js Link component like tags?

Question
I’m facing an issue with Next.js Link component and cursor-based infinite scroll data preservation.
When using regular tags, the browser perfectly maintains the previous page state including all loaded infinite scroll data when clicking the back button. However, with Next.js Link component, it refetches the initial data instead of preserving the previously loaded data.

Current Behavior:
Using :

User loads Page A and scrolls down (loading items 1-60)
User clicks link to Page B
User clicks back button to Page A
Page A reloads and shows only initial items (1-20), losing previously loaded items

Using :

User loads Page A and scrolls down (loading items 1-60)
User clicks link to Page B
User clicks back button to Page A
Page A shows all previously loaded items (1-60) perfectly

What I’ve tried:

  1. Following Next.js official documentation recommendations:
    According to Next.js Documentation, these props should help maintain page state:

shallow: Updates the path without running data fetching methods
scroll: Controls scrolling behavior to the top of the page

But it wasn’t implemented the way I wanted it to be.

Conclusition

  • Next.js recommends using the Link tag, but there will be no problem using the tag in this case, right?
  • If I use Link components, what do I do if I do what I want to implement?

Thank you