How to set options to an object

In an JS web application (OpenLayers) I have implemented a search function in a map:

var selectCtrl = new Select({

source: vectorSource,
caseLabel:'Test',
property: $(".options select").val()
});
map.addControl (selectCtrl);

That works fine as you can see:
Implemented Search

The documentation says that one can add Conditions to that search.
It says the following:
Documentation

But I don’t get how to use the syntax.
I try e.g.

selectCtrl.addCondition("attr:fid","op:=","val:9");

…but that has no influence. No entries are made then in the search.
A new condition is implemented then, but without attributes (like “fid=9”).
How do I have to set the addCondition(options) function?

Javascript: How to set options to an object

In an JS-web-application (OpenLayers) I have implemented a search-function in a map:

var selectCtrl = new Select({

source: vectorSource,
caseLabel:'Test',
property: $(".options select").val()
});
map.addControl (selectCtrl);

That works fine as you can see:
Implemented Search

The documentation says that one can add Conditions to that search.
It says the following:
Documentation

But I don`t get how to use the syntax.
I try e.g.

selectCtrl.addCondition("attr:fid","op:=","val:9");

…but that has no influence. No entries are made then in the search.
A new condition is implemented then, but without attributes (like “fid=9”).
Could anybody help me and give me a hint how I have to set the addCondition(options) function?

Dimensions.get(‘window’).height doesn’t include StatusBar.currentHeight when the Status Bar is translucent

I set the StatusBar to translucent in order to draw the app’s content under the status bar (on Android 14 and earlier — Android 15 enforces edge-to-edge design by default).

According to the React Native documentation:

For Android, the window dimensions will exclude the size used by the status bar (if not translucent) and bottom navigation bar.

https://reactnative.dev/docs/dimensions#get

However, in my tests, the window height still excludes the status bar area, even though the status bar is set to translucent using the translucent prop of StatusBar.

Is this a bug, or is there something I’m missing?

My test was using this App.tsx file on a dummy react native project and run on an Android device.

To test, please install react-native-safe-area-context.

App.tsx

import React from 'react';
import { Dimensions, StatusBar, StyleSheet, Text, useColorScheme, View, } from 'react-native';
import { SafeAreaProvider, SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';

const ContentView = () => {

  const insets = useSafeAreaInsets();

  const heightPercentage = (percentage: number) => (Dimensions.get('window').height - insets.top - insets.bottom) * percentage / 100;

  const widthPercentage = (percentage: number) => (Dimensions.get('window').width - insets.left - insets.right) * percentage / 100;

  const CustomStatusBar = (): React.JSX.Element => {
    return <View style={{ height: insets.top, width: widthPercentage(100), backgroundColor: 'red' }}>
      <SafeAreaView>
        <StatusBar barStyle='dark-content' translucent backgroundColor='transparent' />
      </SafeAreaView>
    </View>
  };

  const BottomBar = (): React.JSX.Element => {
    return <View style={{ height: insets.bottom, width: widthPercentage(100), backgroundColor: 'red' }} />
  }

  const LeftBar = (): React.JSX.Element => {
    return <View style={{ height: heightPercentage(100), width: insets.left, backgroundColor: 'red' }} />
  }

  const RightBar = (): React.JSX.Element => {
    return <View style={{ height: heightPercentage(100), width: insets.right, backgroundColor: 'red' }} />
  }

  return (
    <View style={{ flex: 1, backgroundColor: 'red' }}>
      <CustomStatusBar />

      {/* content */}
      <View style={{ flexDirection: 'row', height: heightPercentage(100), width: widthPercentage(100) }}>
        <LeftBar />

        {/* content */}
        <View style={{
          backgroundColor: 'green',
          height: heightPercentage(100),
          width: widthPercentage(70),
          justifyContent: 'center',
          paddingLeft: widthPercentage(2)
        }}>
          <Text style={{ color: 'white', fontSize: heightPercentage(2) }}>top: {insets.top}</Text>
          <Text style={{ color: 'white', fontSize: heightPercentage(2) }}>right: {insets.right}</Text>
          <Text style={{ color: 'white', fontSize: heightPercentage(2) }}>bottom: {insets.bottom}</Text>
          <Text style={{ color: 'white', fontSize: heightPercentage(2) }}>left: {insets.left}</Text>
          <Text style={{ color: 'white', fontSize: heightPercentage(2) }}>StatusBar's height: {StatusBar.currentHeight}</Text>
          <Text style={{ color: 'white', fontSize: heightPercentage(2) }}>window's heihgt: {Dimensions.get('window').height}</Text>
          <Text style={{ color: 'white', fontSize: heightPercentage(2) }}>screen's heihgt: {Dimensions.get('screen').height}</Text>
          <Text style={{ color: 'white', fontSize: heightPercentage(2) }}>heightPercentage(100): {heightPercentage(100)}</Text>
        </View>

        <RightBar />
      </View>

      <BottomBar />
    </View>
  );
}

function App(): React.JSX.Element {
  return (
    <SafeAreaProvider style={{ flex: 1 }}>
      <ContentView />
    </SafeAreaProvider>
  );
}



export default App;

How to stream Twilio media audio into n8n webhook for real-time transcription?

I am working on a workflow to transcribe live audio from a Twilio call using Deepgram via n8n. What I’ve done so far:

1.Set up Twilio to stream call audio using <Stream> with a WebSocket proxy.

2. My proxy forwards media.payload as base64 audio to my n8n webhook.

3. Using a Function node in n8n to decode base64 and send to Deepgram for transcription.
The problem:
My Decode Caller Audio node in n8n does not output any data, and Deepgram receives nothing.

Question:

• Is there something wrong with how I decode the Twilio media.payload in n8n?

• How should I properly decode and forward Twilio’s streamed base64 audio to Deepgram in a way it accepts for transcription?

Here is the relevant code in my n8n Function node:

const base64Audio = $json.base64Audio;
if (!base64Audio) {
  throw new Error('base64Audio missing');
}
const buffer = Buffer.from(base64Audio, 'base64');
return [{
  binary: {
    audio: {
      data: buffer,
      mimeType: 'audio/mulaw',
      fileName: 'caller.wav'
    }
  }
}];

When adding an item to the cart, in 10% of cases, my item is undefined [closed]

I’m doing a project using Vite and JS. I have a homepage component where I have code to add a product to the cart. This code works, but in 10% of cases, in the Chrome console, my product is undefined and not added to the cart. What could be the problem? Thanks!

Chrome console

export class HomePage extends Component {
  constructor() {
    super();
    this.template = template();
    this.state = {
      
      orderCart: [],
    };
  }

  addToCard = (e) => {
    if (e.target.closest(".add-to-cart")) {
      let price = e.target.parentElement.parentElement.dataset.price;
      let name = e.target.parentElement.parentElement.parentElement.dataset.name;
      let img = e.target.parentElement.parentElement.parentElement.dataset.img;
      
      const cartItems = { price, name, img };
      apiService.post("/order", cartItems).then(() => {
        this.setState({
          ...this.state,
          orderCart: this.state.orderCart?.concat(cartItems),
        });
        console.log(cartItems);
      })
    }
  };

  componentDidMount() {
    this.addEventListener("click", this.addToCard);
    
  }

  componentWillUnmount() {
    this.removeEventListener("click", this.addToCard);
  }
}

customElements.define('home-page', HomePage);

For network query i use Axios Api.
For data storage I use Firebase(Realtime Database and Storage).
Product(I’m using Handlebars for HTML):

{{#each products}}
          <div class="w-full md:w-1/3 xl:w-1/4 p-6 flex flex-col" data-id="{{this.id}}">
            
            <div
              data-img="{{this.img}}"
              data-name="{{this.name}}"
              
            >
              <img class="hover:grow hover:shadow-lg" src="{{this.img}}" alt="product" />
              <p data-name="{{this.name}}">{{this.name}}</p>
              <div data-price="{{this.price}}" class="pt-3 flex items-center justify-between">
                <p data-price="{{this.price}}" class="pt-1 text-gray-900">{{this.price}}</p>

                <button class="add-to-cart">
                 <svg class="h-6 w-6 fill-current text-gray-500 hover:text-black" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
                   <path d="M12,4.595c-1.104-1.006-2.512-1.558-3.996-1.558c-1.578,0-3.072,0.623-4.213,1.758c-2.353,2.363-2.352,6.059,0.002,8.412 l7.332,7.332c0.17,0.299,0.498,0.492,0.875,0.492c0.322,0,0.609-0.163,0.792-0.409l7.415-7.415 c2.354-2.354,2.354-6.049-0.002-8.416c-1.137-1.131-2.631-1.754-4.209-1.754C14.513,3.037,13.104,3.589,12,4.595z M18.791,6.205 c1.563,1.571,1.564,4.025,0.002,5.588L12,18.586l-6.793-6.793C3.645,10.23,3.646,7.776,5.205,6.209 c0.76-0.756,1.754-1.172,2.799-1.172s2.035,0.416,2.789,1.17l0.5,0.5c0.391,0.391,1.023,0.391,1.414,0l0.5-0.5 C14.719,4.698,17.281,4.702,18.791,6.205z" />
                 </svg>
                </button>
              </div>
            </div>
          </div>
        {{/each}}

I thought the problem might be with the add to cart button. I tried it by id, but the product was still undefined after several attempts.

How to add HTML legend to simple line graph?

How would I add an HTML legend to this very simple line graph? The documentation is not very straight forward about this…

import React from "react";
import {
  Chart as ChartJS,
  CategoryScale,
  LinearScale,
  PointElement,
  LineElement,
  Title,
  Tooltip,
  Legend,
} from "chart.js";
import { Line } from "react-chartjs-2";
import faker from "faker";

ChartJS.register(
  CategoryScale,
  LinearScale,
  PointElement,
  LineElement,
  Title,
  Tooltip,
  Legend
);

export const options = {
  responsive: true,
  plugins: {
    htmlLegend: {
      containerID: "legend-container",
    },
    legend: {
      display: false,
    },
    title: {
      display: true,
      text: "HTML Legend",
    },
  },
};

const labels = ["January", "February", "March", "April", "May", "June", "July"];

export const data = {
  labels,
  datasets: [
    {
      label: "Dataset 1",
      data: labels.map(() => faker.datatype.number({ min: -1000, max: 1000 })),
      borderColor: "rgb(255, 99, 132)",
      backgroundColor: "rgba(255, 99, 132, 0.5)",
    },
    {
      label: "Dataset 2",
      data: labels.map(() => faker.datatype.number({ min: -1000, max: 1000 })),
      borderColor: "rgb(53, 162, 235)",
      backgroundColor: "rgba(53, 162, 235, 0.5)",
    },
  ],
};

export function App() {
  return (
    <div>
      <Line options={options} data={data} />
      <div id="legend-container" />
    </div>
  );
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-chartjs-2/5.3.0/index.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/18.3.1/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/18.3.1/umd/react-dom.production.min.js"></script>


<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script type="module" defer src="./index.tsx"></script>
  </head>
  <body>
    <div id="root"></div>
  </body>
</html>

React Native Webview Pull to refresh is not working on android

In my React Native app, I’m using react-native-webview to display web content. I’d like to add a pull-to-refresh feature to the WebView. I’ve set:

<WebView
  source={{ uri: 'https://example.com' }}
  pullToRefreshEnabled={true}
/>

but it only works on iOS. According to the documentation, pullToRefreshEnabled is iOS‑only. Does Android have an equivalent? I also tried wrapping the WebView in a ScrollView with a RefreshControl, but sometimes the native scroll view takes over and sometimes the WebView does, causing pull-to-refresh to trigger even when I’m not at the top. How can I implement pull-to-refresh on Android with react-native-webview?

Here is complete webview component

import React, { useRef } from 'react';
import { WebView } from 'react-native-webview';
import { StyleSheet } from 'react-native';
import { BASE_URL } from '../constants/global.constants';
import { injectedJavaScript } from '../utils/injectJavascript';
import { handleWebViewMessage } from '../utils/messageHandler';
import { shouldStartLoadWithRequest } from '../utils/navigationHandler';
import { webViewConfig } from '../config/webviewConfig';

const Webview = () => {
  const webviewRef = useRef<WebView>(null);

  const handleHttpError = (error: any) => {
    console.log('WebView HTTP error:', error);
  };

  return (
    <WebView
      ref={webviewRef}
      source={{ uri: BASE_URL }}
      style={styles.webview}
      onHttpError={handleHttpError}
      domStorageEnabled={true}
      injectedJavaScript={injectedJavaScript}
      pullToRefreshEnabled={true}
      onMessage={handleWebViewMessage}
      onShouldStartLoadWithRequest={request =>
        shouldStartLoadWithRequest(request, webviewRef)
      }
      {...webViewConfig}
      mixedContentMode="always"
    />
  );
};

export default Webview;

const styles = StyleSheet.create({
  webview: {
    flex: 1,
  },
});

Chrome DevTools – Memory Tab

After getting a snapshot I see something like this:
enter image description here

While I was able to identify the first entry, I can’t do it with the second entry. Any idea how to find the actual name of that object used in the code? Interesting that both entries have a similar content.

Add Imagick to Xampp on linux

I am on linux mint and probably do not have the best setup but I currently have imagick installed in my global version of php8.4 and it shows in when I grep for it and in phpinfo.

I have a php application setup with xampp using its own php version 8.0 (it starts to have problems after php8.0) but this php doesnt have the imagick added. I have added the extension.so for it to the ini but it doesnt show in the phpinfo

How do I add imagick to the xampp php or have it see the imagick that the global php is seeing

Etag Implementation in Magento2

this code I am using to set etag in header, I am able to set etag in response header but If-None-Match always coming empty. 1. Nginx Server 2. Magento Version – 2.4.8-P1

 $etag = md5($category->getId();

 $etagHeader = 'W/"' . $etag . '"';

 $this->response->setHeader('Etag', $etagHeader, true);
 $this->response->setHeader('Cache-Control', 'public, max-age=3600', true);
 $this->response->setHeader('Pragma', 'cache', true);

 if (trim($this->request->getHeader('If-None-Match')) === $etag) {
       $logger->info('ETag matches, returning 304');
       $this->response->setHttpResponseCode(304);
       $this->response->clearBody();
 }

Opening website on localhost show black page [closed]

This is the black page shown when I open it on the localhost server.

I have three websites on the localhost XAMPP server. Two of them are on WordPress, which works fine, but when I open the third website, which is a non-WordPress site, it shows a black page. whereas the website from the previous two weeks is working fine. It suddenly began to show a black page. I don’t know what is the reason behind this.

This is the index page code

<?php 
include "admin/param.php";
include "admin/func.php";
include "live.php";
?>
<!DOCTYPE html>
<html>
<head>
    <title><?=$web_title?></title>
      <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <!-- <link rel="icon" href="im/favicon.png" type="image/x-icon"> -->
    <link href="bootstrap-4.3.1/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="bootstrap-4.3.1/css/bootstrap-grid.css" rel="stylesheet" type="text/css" />
    <link href="custom.css" rel="stylesheet" type="text/css" />
    <link href="css/owl.carousel.min.css" rel="stylesheet" type="text/css" />
    <link href="css/owl.theme.default.min.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="css/fontawesome.css">
    <link rel="stylesheet" type="text/css" href="css/all.css">
    <link href="fonts/style.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="css/animate.min.css">
    <link rel="stylesheet" type="text/css" href="css/wow-animate.css">
    <link rel="stylesheet" type="text/css" href="css/left-menu.css">
    <link href="css/swiper.min.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css"/>
    <link href='https://unpkg.com/[email protected]/css/boxicons.min.css' rel='stylesheet'>
</head>
<body>




<?php 
    include "top.php";
    include "slider.php"; 
    include "achievement.php"; 
    include "catagoury.php"; 
    // include "feature.php";
    include "instagram.php";
    include "btm.php";
?>



<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="bootstrap-4.3.1/js/bootstrap.js"></script>
<script type="text/javascript" src="bootstrap-4.3.1/js/bootstrap.bundle.js"></script>
<script type="text/javascript" src="js/swiper.min.js"></script>
<script type="text/javascript" src="js/owl.carousel.min.js"></script>
<script type="text/javascript" src="js/fontawesome.js"></script>
<script type="text/javascript" src="js/all.js"></script>
<script type="text/javascript" src="js/custom.js"></script>
<script type="text/javascript" src="js/wow.min.js"></script>

  <script>
    var swiper = new Swiper('.swiper-container', {
      slidesPerView: 'auto',
      spaceBetween: 2,
      loop: true,
      loopFillGroupWithBlank: true,
       navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
      },
    });
  </script>
<script> 
$(document).ready(function(){
    $("#search").click(function(){
        $("#searchshow").slideToggle("slow");
    });
});
</script>
<script type="text/javascript">
$(document).ready(function () {
    $('#sidebarCollapse').on('click', function () {
        $('#sidebar').toggleClass('active');
        $(this).toggleClass('active');
    });
});
</script>
<script type="text/javascript">
$(document).ready(function(){
    $(".dropdown").hover(            
        function() {
            $('.dropdown-menu', this).not('.in .dropdown-menu').stop(true,true).fadeIn("400");
            $(this).toggleClass('open');        
        },
        function() {
            $('.dropdown-menu', this).not('.in .dropdown-menu').stop(true,true).fadeOut("400");
            $(this).toggleClass('open');       
        }
    );
});
</script>
<script>
  wow = new WOW(
    {
      animateClass: 'animated',
      offset:       100,
      callback:     function(box) {
        console.log("WOW: animating <" + box.tagName.toLowerCase() + ">")
      }
    }
  );
  wow.init();
</script>
</body>
</html>

This is the top bar code:

<style>
    .top1-f-main{
        background-color: #709f00;
        padding: 3px 0px;
        color: white;
    }
    
    .tp1 p{
        text-align: center;
        font-size: 12px;
    }
    
    .top-f-main {
    background-color: #000000;
    padding: 10px 15px;
    font-size: 12px;
}
    
.top-main ul li {
    display: inline-block;
    margin-left: -21px;
}
    
.header-fluid {
    position: unset;
    z-index: 999;
    background-color: #1e1e1e !important;
}
    
.b {
    
     border: thin solid #709f00;
    padding: 9px 10px;
    border-radius: 30px;
    background-color: #709f00;
    color: white;
    margin-top: -8px;
    margin-right: 2px;
    margin-left: 5px;
}

    #mobile-menu-open1{
        margin-top: 5px;
    }   
    
    #navbar {
    box-sizing: border-box;
    transition: background-color 0.4s ease-out;
    transition: all 0.5s ease;
    padding: 0px 1px;
}
    
nav.scroll {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #1e1e1e;
    color: #eef;
    box-shadow: 0px 2px 8px #000;
    z-index: 99999999;
    height: auto;
}
    
    nav{
        position: relative;
        z-index: 1000;
    }   
    
    
.navbar-dark .navbar-nav .nav-link:hover{
    color: #709f00 !important;
}
    
.nav-link:after {
    content: "";
    position: absolute;
    left: 26px;
    bottom: 27%;
    width: 0px;
    height: 4px;
    background-color: #709f00;
    transition: all 0.5s ease;
}
    
    .Dropdown:hover .fa-chevron-down{
        transform: rotate(180deg);
    }
    
    .navbar-nav{
        position: relative;
    }
    
    .Dropdown{
        position: relative;
    }
    
    .dropdown-content{
        
        position: absolute;
        min-width: 150px;
        border: 3px solid #709f00;
        background-color: #709f00;
        color: white;
        border-radius: 0 0  3px 3px;
        list-style: none;
        display: none;
    }
    
    .dropdown-content li{
        padding: 20px;
    }
    
    .sub-dropdown-content{
        position:absolute;
        top:5%;
        left: 100%;
        border: 3px solid #709f00;
        background-color: #709f00;
        min-width: 120px;
        list-style: none;
    }
    
    .sub-dropdown-content li{
        padding: 20px;
        border-bottom: 1px solid white;
    }
    
    .Dropdown:hover .dropdown-content{
        display: block;
    }
    
    .top-main ul li a {
    display: block;
    color: #ffffff;
    padding: 0 20px;
}
    
.searchTerm {
    background-color: transparent;
    border: 0;
    border-bottom: solid 7px #709f00;
    color: #709f00;
    height: 100px;
    padding-left: 15px;
    width: 100%;
    font-family: Myriad Pro Regular;
    font-size: 25px;
    max-width: 800px;
    margin-top: 43vh;
}
    
    .fa-w-11{
        color: #709f00;
    }
    
    
@media screen and (max-width: 767px) {
    .nav-link div {
        background-color: #fff;
        margin-top: -40px;
    }
}
    
    
@media screen and (max-width: 550px) {
    .nav-link div {
        background-color: #fff;
        margin-top: -40px;
    }
}   
    
@media (max-width: 767px) {
    .logo img {
        max-width: 112px !important;
        padding-top: 0 !important;
        margin-top: 13px;
    }
}
    
    
@media (max-width: 550px) {
    .logo {
    position: relative;
    top: 0px;
    left: -190px;
    padding-left: 0px;
    margin-left: 0px;
    }
    
    @media (max-width: 520px) {
    .logo {
    position: relative;
    top: 0px;
    left: -180px;
    padding-left: 0px;
    margin-left: 0px;
    }
}
    
        
    
    @media (max-width: 492px) {
    .logo {
    position: relative;
    top: 0px;
    left: -165px;
    padding-left: 0px;
    margin-left: 0px;
    }
}
    
.gtranslate_wrapper .gt_switcher-popup{
        color: #fff;
    }
    nav.scroll .gtranslate_wrapper {
          margin-right: 20px !important;
    }   
</style>



<script>window.gtranslateSettings = {"default_language":"en","wrapper_selector":".gtranslate_wrapper","flag_size":24,"flag_style":"3d"}</script>
<script src="https://cdn.gtranslate.net/widgets/latest/popup.js" defer></script>


<a href="https://api.whatsapp.com/send?phone=+923096030541&amp;text=Hi" target="_blank" id="wa">
<img src="im/whatsapp.png" style="position: fixed;bottom: 55px;z-index: 9999;max-width: 60px;right: 15px;">
</a>



<div id="mobile-menu-show">
    <button id="mobile-menu-close"><i class="fas fa-times"></i></button>
<ul class="list-unstyled components">
                <ul class="navbar-nav visiable-xs">
                        <li class="nav-item">
                            <a class="nav-link" href="index.php">Home</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="content.php?p=3">ABOUT</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="products.php?live=12_49_0_0" id="click">PRODUCTS<span class="dropdown-toggle"></span></a>
                            <ul id="show" style="display: none !important;padding-top: 0;padding-left: 20px;">
                                          <?php
$QRY = qry_run("Select * from tbl_main where pshow = 'Yes' order by ranking");
if (num_rec($QRY) > 0)
{
while($rs = fetch_rec($QRY))
{
$secid = 0;
?>
<?php
$QRYs = qry_run("select * from tbl_section where mainid = ".$rs['mainid']." order by ranking");
if (num_rec($QRYs) > 0)
{
$rss = fetch_rec($QRYs);
$secid = $rss['secid'];
}
?>
<!---------  ------>
                            <li><a href="products.php?live=<?=$rs['mainid']?>_<?=$rss['secid']?>_0_0"><?=$rs['pname']?></a></li>
     <?php
      }
}
      ?> 
                            </ul>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="content.php?p=5">contact</a>
                        </li> 
                        <div class="">
                          <form action="search.php" method="post">
                              <input type="text" name="search" placeholder="Search" style="width: 100%;
height: 50px;
padding-left: 15px;">
                          </form>
                        </div>  
                    </ul>
                </ul>
    
</div>








<div id="mobile-menu-show1" >
<ul class="list-unstyled components">
  <div class="laptop-menu">
    <h3>Social</h3>
    <ul>
      <li><a href="#">Facebook</a></li>
      <li><a href="#">Instagram</a></li>
      
      
      <p> Airport Road Gohadpur Sialkot _51310  51310, Pakistan.</p>
      <p>[email protected]</p>
      <p>+92 370 9236904</p>
    
    </ul>
  </div>
                </ul>
    
</div>




<div class="container-fluid top1-f-main">
  <div class="row">
  <div class="col-md-12 col-12">
     <div class="tp1">
      <p>Manufacturers and Exporterts off all kinds of sports clothing.</p>  
     </div>
</div> 
</div>
</div>

<div class="container-fluid top-f-main">
  <div class="row">
    <div class="col-md-6 col-6">
      
    </div>
    <div class="col-md-6 col-6">
    <div class="top-main">
      <ul>
        <li><a href="#">Need Help?</a></li>  
        <li><a href="#"><i class="fab fa-facebook-f"></i></a></li>
        <li><a href="#"><i class="fab fa-twitter"></i></a></li>
        <li><a href="#"><i class="fab fa-instagram"></i></a></li>
      </ul>

    </div>
  
    </div>
  </div>

</div>






<!--------------------- Header Start ---------------------------->
<div class="container-fluid header-fluid" style="position: inherit;">
  <nav id="navbar">

    <div class="row align-items-center">
        


        <div class="col-md-2 animatable bounceIn">
            
      <div class="logo">
                <a href="index.php"><img src="img/logo.png"/></a>
            </div>

        </div>
        
        <div class="col-md-8 animatable bounceInRight">
      <navbar class="navbar navbar-expand-md bg-dark navbar-dark">
                <a class="navbar-brand" href="index.php"><img src="img/logo.png" /></a>
                
                 <a href="#0" id="mobile-menu-open" class="nav-link icon-ico visiable-xs"><div></div></a>
                
                <div class="collapse navbar-collapse nav-hidden" id="navbar">
                    <ul class="navbar-nav pt-0">
                        <!-- <li class="nav-item">
                            <a class="nav-link" href="index.php">Home</a>
                        </li> -->
                        <li class="nav-item">
                            <a class="nav-link" href="content.php?p=3">ABOUT US</a>
                        </li>
                        
                         <li class="nav-item">
                            <a class="nav-link" href="sustainability.php">Sustainability</a>
                        </li>
                        
                        <li class="nav-item Dropdown">
                            <!--href="products.php?live=12_49_0_0"-->
                            <a class="nav-link">Products <i class="fa fa-chevron-down"></i></a>
                            <ul class="dropdown-content">
                              <li><a href="products.php?live=9_33_0_0#collapse1">Sports Wear</a></li>
                              <li><a href="products.php?live=10_40_0_0#collapse2">Fitness wear</a></li>
                              <li><a href="products.php?live=12_49_0_0#collapse3">Boxing Gear</a></li>
                              <li><a href="products.php?live=11_44_0_0#collapse4">Martial Arts</a></li>
                            </ul>
                        </li>
                        
                        <li class="nav-item Dropdown">
                            <a class="nav-link">Help/Guide <i class="fa fa-chevron-down"></i></a>
                            <ul class="dropdown-content">
                              <li class="sub-dropdown">
                                  <a href="#">Fabric Guide<!--<i class="fa fa-chevron-right"></i>--></a>
                                  <!---<ul class="sub-dropdown-content">
                                      <li><a href="#">Fabric 1</a></li>
                                      <li><a href="#">Fabric 1</a></li>
                                      <li><a href="#">Fabric 1</a></li>
                                  </ul>--->
                              </li>
                              <li><a href="#">Order Guide</a></li>
                              <li><a href="#">Size Chart</a></li>
                            </ul>
                        </li>
                        
                        
                        <li class="nav-item">
                            <a class="nav-link" href="production.php">Production</a>
                        </li>
                        <!-- <li class="nav-item">
                            <a class="nav-link" href="#">Catalogues</a>
                        </li> -->
                        <li class="nav-item">
                            <a class="nav-link" href="content.php?p=5">Contact Us</a>
                        </li>
                       
  
                    </ul>
                </div>  
            </navbar>
            
        </div>
        


   <div class="col-md-2" style="position: unset;">
     <ul class="icon-alls">
       <!-- <div class="gtranslate_wrapper">
          
        </div>-->

     
                        <li class="nav-item " id="flip">
                          <a href="#" class="nav-link icon-ico icn"><i class="fas fa-search" style="font-size: 24px; color: white;"></i></a>
                        </li> 

                       <!--- <a class="cart" href="basket.php"><i class="fas fa-shopping-cart"></i></a>---!>



                       <!--<form action="search.php" method="post">-->
                       <!--   <input type="text" name="search">-->
                       <!-- </form>-->
         
                        <li class="nav-item " id="flip">
                            <a href="#" class="b">Let's Talk <i class="far fa-comments"></i></a>
                        </li> 

                        

                        <li class="nav-item pt-0">
                          <a href="#" id="mobile-menu-open1" class="nav-link icon-ico"><div></div></a>
                        </li> 
                      </ul>
   </div>


    </div>

<div class="menu-button">
  <a href="#0" id="mobile-menu-open1" class="nav-link icon-ico"><div></div></a>
</div>




<div id="searchshow" class="search-show">
    <form action="search.php" method="post">
        <input type="text" name="search" placeholder="Search">
    </form>
</div>
</nav>

</div>



<div id="panel" style="text-align: center;">
<button id="close" style="float: right;
background-color: transparent;
border: 0;
color: #d71921;
font-size: 35px;
padding: 11px 25px;"><i class="fa fa-times" aria-hidden="true"></i>
</button>
<!-- <img src="im/logo.png" style="position: absolute;top: 50px;left: 0;margin: 0 auto;right: 0;max-width: 165px;
width: 100%;" /> -->
<form action="search.php" method="post" style="margin: 0;" >
    <input type="text" name="search" class="searchTerm" placeholder="Search">
</form>
</div>
<!--------------------- Header End ---------------------------->

number_format only works up to 999,99 [closed]

We’ve created a comprehensive table that retrieves currency amounts from a database.

With

number_format($mlz_s_us, 2,'.','')

amounts up to 999.99 are correctly displayed as 999.99.

However, if the amount is higher than 1000, then, for example, the amount 3,113.75 is displayed as “3.11.”

What’s wrong here?

This is Alma Linux 8.10.0 / MariaDB 10.11.13 (latin1_swedish_ci – German) PHP 8.4

How to reference current property value in class property attribute in PHP 8.4?

I’ve done a lot of Googling and may have missed this, there’s so many examples of using the new Attribute feature in PHP but none of them show if this is possible. What I would like to be able to do is use the current value of the class property in the constructor arguments for the attribute. Basically something like

<?php

#[Attribute]
class MyAttr {
    public function __construct ($propValue, $otherArg) { }
}

class Test {
    #[MyAttr(__PROPERTY__, 'other')]
    public string $prop = 'MyProp';
}

So that when using ReflectionAttribute::newInstance from within the class it effectively does new Attr('MyProp', 'other'). Obviously __PROPERTY__ is wrong here, that just gives me the property name rather than its current value. Is it possible to get the property value in that context?

Efficient way to partially match stringified JSON in a string column using Prisma (without full JSON match)

I’m trying to find a record where a column (payload) stores a stringified JSON object. The column type is string (as defined in Prisma schema) — so it’s not a JSON or JSONB type.

I want to check if a subset of the JSON content exists in the string, without matching the entire object.

Here’s a sample value stored in the payload column:

{
  "triggerEvent": "RESERVATION_EXPIRED",
  "id": 16,
  "eventTypeId": 3,
  "userId": 4,
  "slotUtcStartDate": "2025-07-25T03:30:00.000Z",
  "slotUtcEndDate": "2025-07-25T04:00:00.000Z",
  "uid": "014cbb69-fa4b-421b-8c6d-af0ac7f4184e",
  "releaseAt": "2025-07-24T20:56:33.000Z",
  "isSeat": false
}

I’m only interested in this part of the object:

"eventTypeId": 3,
"userId": 4,
"slotUtcStartDate": "2025-07-25T03:30:00.000Z",
"slotUtcEndDate": "2025-07-25T04:00:00.000Z",
"uid": "014cbb69-fa4b-421b-8c6d-af0ac7f4184e"

Here’s my current Prisma-based query:

const { id, releaseAt, isSeat, ...rest } = slot;
const restString = JSON.stringify(rest);
const searchString = restString.slice(1, -1); // remove outer {}

const isWebhookScheduledTriggerExists = await prisma.webhookScheduledTriggers.findFirst({
  where: {
    payload: {
      contains: searchString,
    },
  },
});

The Problem:

I was told this approach is inefficient and not production-safe.

Constraint:

I cannot convert the column to JSON/JSONB or change its type — it must remain a string.

My Question:

Is there a more efficient or reliable way to match a partial stringified JSON object in a string column using Prisma or raw SQL?

Code fullscreen element responsive by clicking fullscreen button? Simulate a mouse click?

I’m trying to get fullscreen for iframe element immediately responsive to user input (e.g., keyboard input) without having to manually click when fullscreen to get the fullscreen responsive (think of it as a youtube video or a browser game where fullscreening the iframe element will not cut off user input, they don’t have to click the fullscreen just to resume playing iframe)

Here I still can’t get fullscreened iframe to still be responsive to user inputs without clicking on fullscreen. How do I simulate a click whenever fullscreen element is clicked on, so that fullscreen is responsive immediately without user clicking?

let elem = document.getElementById("gamescreen");

function fullscreen() {
  if (elem.requestFullscreen) {
    elem.requestFullscreen();
  } else if (elem.webkitRequestFullscreen) {
    /* Safari */
    elem.webkitRequestFullscreen();
  } else if (elem.msRequestFullscreen) {
    /* IE11 */
    elem.msRequestFullscreen();
  }
}

let fse = document.getElementById("fullscreen");
fse.onclick = fullscreen;
fse.click()
document.onclick = fullscreen;
<div class="gamescreen">
  <iframe width="100%" height="100%"  controls id="gamescreen" frameborder="0" src=""></iframe>
</div>

<div id="fullscreen" title="Fullscreen" onclick="fullscreen();">
  <img src="https://i.postimg.cc/0ykypt59/gameplayerfullscreen.png" style="width:22px;height:20px;">
</div>