Magento2 css / js not loding in MacOs With Nginx

Installed Magento2.x in MacOs with Nginx. Setup everything is completed. When I run the website in the frontend, css/ js not loading showing 404.

Actually css/js present in the location but showing 404

Below is the Error Message : 
Refused to apply style from       'http://local.mydomain.com/static/frontend/Vendor/mytheme/en_US/mage/calendar.css'    because its MIME type ('text/plain') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

When I access the css through browser , it showing below error

Requested path /static/frontend/Vendor/mytheme/en_US/mage/calendar.css is wrong.
<pre>#1 MagentoFrameworkAppBootstrap->run() called at [pub/static.php:13]
</pre>

Note : Issue with only CSS/ JS only. If I put the .php file in the same path, able to access it.

Please dd your suggestions to fix it. spend couple of days and tried all options.

Tried, Permission of folder, Cache clear, static-deploy.

Website should load with css and js

How to Print a Web Page (HTML) to a Dot-Matrix Printer (e.g., Epson LQ-2180) in Text Mode? [closed]

I have a web-based application (like an inventory system or a point-of-sale) that generates invoices and reports as HTML pages. I need to print these onto multi-part carbon copy paper using our reliable old Epson LQ-2180 dot-matrix printer.

The Problem:

Printing directly from the browser (e.g., Chrome’s Ctrl+P) is problematic:

It’s slow: The browser tries to render the full graphical page, which is very slow on a dot-matrix printer.
It looks wrong: Fonts, layouts, and margins don’t translate well. The output is often garbled or poorly aligned.
It’s wasteful: It uses a lot of ribbon trying to print graphics and rich formatting.
I don’t want the graphics, colors, or fancy CSS layouts. I just want the core text content (headings, paragraphs, and especially data from tables) printed in the printer’s native, fast “Text Mode” or “Draft Mode”.

If I save the HTML file and try to send it to the printer from the command line, it just prints all the raw HTML tags like <h1>, <table>, <td>, etc.

How can I take a URL, extract its meaningful text content, and send it directly to an LQ-2180 printer in raw text mode, bypassing the graphical print driver?

Open Assessment Technology (TAO) [closed]

Is there any extension available in TAO to save curriculum standard metadata to the database when importing a QTI package?

I am expecting that there is a open source extension available.and laso know about how we can cretae new custom extension for tao.

OpenSSL unsafe legacy renegotiation disabled in xampp server

Hello everyone i am getting error in my laravel(11.9) project on local system using xampp server.
Error is OpenSSL/3.1.3: error:0A000152:SSL routines::unsafe legacy renegotiation disabled.
I have also done some changes in openssl.cnf file like

[ default_conf ]
ssl_conf = ssl_sect

[ssl_sect]
system_default = ssl_default_sect

[ssl_default_sect]
but no resolution i have got.

Options = UnsafeLegacyRenegotiation

What is the most reliable method for raw text printing to a dot-matrix printer (Epson ESC/P) from a PHP web application?

I am developing a web-based application using PHP 7.4 a Point-of-Sale or inventory system. A requirement for this project is to print receipts/invoices to a legacy Epson LQ-2180 dot-matrix printer, which is connected directly to the server via USB.

The goal is to print in text-mode for speed and to use the printer’s built-in fonts and formatting capabilities (like bold, condensed text, and paper cutting) using ESC/P control codes. I do not want to use a graphical driver, as the output must be raw text.

So far, I have identified two primary approaches:

  1. Direct Device Writing: Using PHP’s file functions to write directly to the printer’s device file.
<?php
   define('ESC', "x1B");
   define('BOLD_ON', ESC . 'E');
   $printer = fopen('/dev/usb/lp0', 'w');
   fwrite($printer, BOLD_ON . "Hello Worldn");
   fclose($printer);
?>

My concern here is managing file permissions correctly and securely for the web server user (www-data).

  1. Using Shell Commands: Using shell_exec() to pass the data to the OS printing system (CUPS), which is configured with a raw queue.
<?php
   $text = "Hello Worldn";
   file_put_contents('/tmp/printjob.txt', $text);
   shell_exec("lp -d Epson_LX310_RAW -o raw /tmp/printjob.txt");
?>

This seems more robust, but I am not sure if it’s the standard way to handle this.

Considering reliability, security, and performance, what is the modern best practice for sending raw ESC/P jobs to a dot-matrix printer from a server-side PHP application? Are there any libraries that simplify this process, or is one of the above methods clearly superior?

Laravel zip file not downloading

I have a function to download a zip file with or without folders based on the file_type_id. However when file_type_id is 1 my server is returning a empty 200 response. When i look at the temp folder i created the zip file is there and all the files are in it when i unzip it in the command line. So my question would be why this behaviour exists and if someone got a solution? The there is also nothing in the laravel.log or nginx/apache logs.

    public function downloadZip($file_type, $resId)
    {
        $reservation = Reservation::with('contact.insurer')->where('id', $resId)->first();

        if (Auth::user()->hasRole('verzekeraar')) {
            $contact = Auth::user()->userable;

            if ($contact->insurer_id != $reservation->contact->insurer_id) {
                return AppJsonResponse::UnAuthorized('U heeft geen rechten voor dit dossier.');
            }
        }
        $files = [];
        $dirs = [];
        if ($file_type == 2) {
            $files = $reservation->files;
        } else {
            $dirs = Folder::whereNull('parent_id')->where('reservation_id', $reservation->id)->get();
            $files = File::whereNull('parent_id')->where('reservation_id', $reservation->id)->where('file_type_id', 1)->get();
        }

        $zip_file = storage_path('app/tmp/wrapper.zip');

        // Ensure tmp directory exists
        if (!file_exists(storage_path('app/tmp'))) {
            mkdir(storage_path('app/tmp'), 0755, true);
        }

        // Initializing PHP class
        $zip = new ZipArchive();
        if ($zip->open($zip_file, ZipArchive::CREATE | ZipArchive::OVERWRITE) !== TRUE) {
            Log::error("Cannot open <$zipPath>n");
            return AppJsonResponse::Error('ZIP creation failed.');
        }

        if ($file_type == 2) {
            foreach ($files as $file) {
                if ($file->file_type_id == $file_type) {
                    $zip->addFile(Storage::disk('private')->getDriver()->getAdapter()->applyPathPrefix($file->path), 'storage/' . $file->name . '.' . strtolower($file->ext));
                }
            }
        } else {
            $ultPath = 'storage/';
            $this->zipDocuments($dirs, $files, $ultPath, $reservation->id, $zip);
        }
       if (!$zip->close()) {
            Log::error("Failed to close the zip file.");
        } else {
            Log::debug("Successfully closed zip file: $zip_file");
        }

        if (file_exists($zip_file)) {
            Log::info("File size of ZIP: " . filesize($zip_file));
        return response()->download($zip_file, 'wrapper.zip', [
    'Content-Type' => 'application/zip',
        ]);

        } else{
            Log::error('ZIP file is missing or too small: ' . $zip_file);
            return AppJsonResponse::Error('ZIP creation failed.');
        }
    }

And this is the zipdocuments function

public function zipDocuments($dirs, $files, $ultPath, $resId, $zip)
{
    foreach ($dirs as $dir) {
        $currentPath = $ultPath . $dir->name . '/';

        // Log current directory
        Log::debug("Entering directory: $currentPath");

        // Add all files in current directory
        $filesInDir = File::where('parent_id', $dir->id)
            ->where('reservation_id', $resId)
            ->where('file_type_id', 1)
            ->get();

        foreach ($filesInDir as $file) {
            $fullPath = Storage::disk('private')->getDriver()->getAdapter()->applyPathPrefix($file->path);
            if (!file_exists($fullPath)) {
                Log::warning("File not found: $fullPath");
                continue;
            }

            if($zip->addFile($fullPath, $currentPath . $file->name . '.' . strtolower($file->ext)) === true){

            }

        }

        // Recursively process subfolders
        $subDirs = Folder::where('parent_id', $dir->id)->where('reservation_id', $resId)->get();
        $this->zipDocuments($subDirs, [], $currentPath, $resId, $zip);
    }

    // Add top-level files (only for first call)
    foreach ($files as $file) {
        $fullPath = Storage::disk('private')->getDriver()->getAdapter()->applyPathPrefix($file->path);
        if (!file_exists($fullPath)) {
            Log::warning("Top-level file not found: $fullPath");
            continue;
        }

        $zip->addFile($fullPath, $ultPath . $file->name . '.' . strtolower($file->ext));
    }

    return $zip;
}

Need to modify all URLs in an m3u8 file with PHP [closed]

I have an m3u8 file which goes something like this:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:15084
#EXT-X-TARGETDURATION:4
#EXTINF:4.004,
radio002live-15084.ts
#EXTINF:4.004,
radio002live-15085.ts
(and so on)

What I ideally want to happen is to have all of those file names prefixed with a URL, but only if they don’t start with HTTP(S) already. Then URL encode those, add another thing in front of them, and then return that so ideally the file looks like this:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:15084
#EXT-X-TARGETDURATION:4
#EXTINF:4.004,
proxy.php?http%3A%2F%2Fsomeurl.tld%2Fpath%2Fradio002live-15084.ts
#EXTINF:4.004,
proxy.php?http%3A%2F%2Fsomeurl.tld%2Fpath%2Fradio002live-15085.ts
(and so on)

So far, I’ve tried turning the thing into an array (one line = one key) but I realized this might not cover every m3u8 I need to parse (what if one has the URL on the same line?) and I can’t seem to get past detecting what doesn’t start with what regardless.

Ideally, this should work in PHP 5-ish.

How to insert page breaks when creating docx with pandoc and php?

I’ve searched several posts here, but none of the solutions worked. Or I’m doing something wrong somewhere else lol.

I’m creating a report in docx (originally, an html) with Pandoc (currently I’m using version 3.2 on the server), but the page breaks don’t work at all.

I’ve already tested the following:

A docx template with a paragraph formatting called “break”, where I use in the html sent as <p class="break"></p>

<div style="page-break-after:always"></div> or <div style="page-break-before:always"></div>

<w:softHyphen/> or <w:p><w:r><w:br w:type="page"/></w:r></w:p>

I’ve even tested PHPWord and other libraries, but when they accept html they don’t accept style, or vice versa, or they don’t accept both.

Does anyone have an idea of what can I look into?

Shopify API from PHP: problem with linked metafields in a productCreate call

I’m trying to create a productCreate mutation which specifies the available colours for the product, but I’m getting the error ‘The ‘shopify.color-pattern’ metafield has no values and none were passed in for this linked option’.

I’m passing in variables as follows (closing brackets elided) which are then json-encoded.

[variables] => stdClass Object
(
[product] => stdClass Object
(
[title] => Herring Sittaford Chelsea boots
[productOptions] => Array
(
[0] => stdClass Object
(
[name] => Color
[position] => 1
[linkedMetafield] => stdClass Object
(
[key] => color-pattern
[namespace] => shopify
)

[values] => Array
(
[0] => stdClass Object
(
[linkedMetafieldValue] => gid://shopify/Metaobject/169330016585
[name] => Caramel Suede
)

[1] => stdClass Object
(
[linkedMetafieldValue] => gid://shopify/Metaobject/169330049353
[name] => Honey Suede
)

[2] => stdClass Object
(
[linkedMetafieldValue] => gid://shopify/Metaobject/169330114889
[name] => Ocean Suede
)

[3] => stdClass Object
(
[linkedMetafieldValue] => gid://shopify/Metaobject/169330606409
[name] => Olive Suede
)

[4] => stdClass Object
(
[linkedMetafieldValue] => gid://shopify/Metaobject/169330639177
[name] => Sand Suede
)

[5] => stdClass Object
(
[linkedMetafieldValue] => gid://shopify/Metaobject/169330671945
[name] => Wheat Nubuck
)

The shopify dox are not helpful on this. I’ve tried various tweaks on this and nothing helps. Pass in values as an array on the linkedMetafieldobject and I get ‘Cannot specify ‘values’ for an option linked to a metafield’.

This works if I don’t use linked metafields, but I want this to be nailed down to the defined colours we’ve set up programmatically, I don’t want duplicates.

Anyone got any suggestions?

Thanks in advance,

G

Database Connection Hostinger [closed]

Does anyone know how to live host a website on Hostinger? I’m having trouble connecting my database to my system—it’s preventing user registration and login from working. Can someone please share an example of a login and registration system (with database connection) that works on Hostinger?

Why does WooCommerce still show the old review count after deleting reviews in the WordPress admin?

I’m working on a WooCommerce store, and I’ve deleted all product reviews from the WordPress admin (including emptying the trash). However, the product page still displays the old review count and average rating.

rating.php

<?php
/**
 * Single Product Rating
 *
 * This template can be overridden by copying it to yourtheme/woocommerce/single-product/rating.php.
 *
 * HOWEVER, on occasion WooCommerce will need to update template files and you
 * (the theme developer) will need to copy the new files to your theme to
 * maintain compatibility. We try to do this as little as possible, but it does
 * happen. When this occurs the version of the template file will be bumped and
 * the readme will list any important changes.
 *
 * @see     https://woocommerce.com/document/template-structure/
 * @package WooCommerceTemplates
 * @version 3.6.0
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly.
}

global $product;

if ( ! wc_review_ratings_enabled() ) {
    return;
}

$rating_count = $product->get_rating_count();
$review_count = $product->get_review_count();
$average      = $product->get_average_rating();

if ( $rating_count > 0 ) : ?>
    <div class="woocommerce-rating-debug">
        <p>Rating Count: <?php echo esc_html( $rating_count ); ?></p>
        <p>Review Count: <?php echo esc_html( $review_count ); ?></p>
        <p>Average Rating: <?php echo esc_html( $average ); ?></p>
    </div>

    <div class="woocommerce-product-rating">
        <?php echo wc_get_rating_html( $average, $rating_count ); // WPCS: XSS ok. ?>
        <?php if ( comments_open() ) : ?>
            <?php //phpcs:disable ?>
            <a href="#reviews" class="woocommerce-review-link" rel="nofollow">(<?php printf( _n( '%s customer review', '%s customer reviews', $review_count, 'woocommerce' ), '<span class="count">' . esc_html( $review_count ) . '</span>' ); ?>)</a>
            <?php // phpcs:enable ?>
        <?php endif ?>
    </div>

<?php endif; ?>

Getting results like this even after deleting all reviews and ratings.

enter image description here

Even the product detail page in the admin shows “No comments yet.”

enter image description here

How can I force WooCommerce to fully refresh the product review data to reflect zero reviews?

Any help or insight is appreciated.

WordPress sorting filter brings me back to the homepage

I´m making a WordPress website and I want to have a filter on mine search.php file. But whenever I select an option, he brings me back to my homepage instead of being on the same file. I think it has something to do with my url. On the page with the filter, I already have a ?s= in my url. I don’t know how I can fix this in my code that my url has after the ?s= also /?sort=. I don’t if this is even possible, I’m still new to coding.
This is my code (sorry for the ducth words 😉 )

<form method="get" action="<?php echo esc_url(home_url('/')); ?>" class="sortering-form">
   <label for="sortering">Sorteer op:</label>
   <select name="sort" id="sortering" onchange="this.form.submit()">
      <option value="nieuw" <?php selected($_GET['sort'] ?? '', 'nieuw'); ?>>Nieuw → Oud</option>
      <option value="oud" <?php selected($_GET['sort'] ?? '', 'oud'); ?>>Oud → Nieuw</option>
      <option value="titel" <?php selected($_GET['sort'] ?? '', 'titel'); ?>>Titel A → Z</option>
      <option value="random" <?php selected($_GET['sort'] ?? '', 'random'); ?>>Willekeurig</option>
   </select>
</form>

How to use php to calculate the cost of an order? [closed]

I am trying to create a canteen order calculator without using MySQL (project spec, not in my control). The idea is that a user enters some values into the html table and then receives the calculated total cost of their order. Most other ways I’ve tried resulted in fatal errors. This solution is only marginally better, always outputting a cost of $0. Does anyone know why it’s doing that, and how I could fix it? (also new user here, hope I’m asking this right).

<?php
if
(   
    isset($_POST['rolls']) 
    or isset($_POST['pies']) 
    or isset($_POST['crosses']) 
    or isset($_POST['chickens']) 
    or isset($_POST['pastas']) 
    or isset($_POST['milks']) 
    or isset($_POST['juices']) 
    or isset($_POST['waters']) 
)
{
    $finalcost=floatval(0);
    $rolls=0.00;
    $pies=0.00;
    $crosses=0.00;
    $pastas=0.00;
    $chickens=0.00;
    $milks=0.00;
    $juices=0.00;
    $waters=0.00;
    
    function pricefixer ($a,$b)
    {
        switch($b) # find which post to look at. 
        {
            case 'rolls':
            $c=$_POST['rolls'];
            break;
            case 'crosses':
            $c=$_POST['crosses'];
            break;
            case 'chickens':
            $c=$_POST['chickens'];
            break;
            case 'pastas':
            $c=$_POST['pastas'];
            break;
            case 'juices':
            $c=$_POST['juices'];
            break;
            case 'pies':
            $c=$_POST['pies'];
            break;
            case 'milks':
            $c=$_POST['milks'];
            break;
            case 'waters':
            $c=$_POST['waters'];
            break;
            default:
            $c=0;
            break;
            
        }
        
        if($c>0)
        {   
            $a+=$c;
            $a==floatval($a); #Decimal/float prices need decimal/float multipliers. 
        }
    }
    
    function priceadder ($a, $b)
    {
        
        for ($x=0; $x<$a; $x++)
        {
            $finalcost+=$b;
        }
    }
    #simplifes calculation code later

    $order=1; #used to check if user has ordered
    
    #See function pricefixer above
    pricefixer($rolls, 'rolls');
    pricefixer($pies, 'pies');
    pricefixer($chickens, 'chickens');
    pricefixer($pastas, 'pastas');
    pricefixer($crosses, 'crosses');
    pricefixer($milks, 'milks');
    pricefixer($waters, 'waters');
    pricefixer($juices, 'juices');
    
    #Calculate cost
    priceadder($rolls, 4.50);
    priceadder($pies, 2.50);
    priceadder($crosses, 5.00);
    priceadder($chickens, 7.00);
    priceadder($pastas, 6.30);
    priceadder($milks, 3.50);
    priceadder($juices, 3.00);
    priceadder($waters, 2.50);
}
else
{
    $order=0;
}
?>
<html>
<head>
<!-- For when stylehseet is made: <link rel="stylesheet" href="[stylesheet_name_here].css" -->
<meta charset="utf-8">
<title>Canteen Menu</title>
</head>
<body>
<table width=<?php echo $wide; ?> height=<?php echo $tall; ?> border="1" align="center">
    <tr>
        <td colspan="6" align="center" height="15%"> <h2> <b> Hello <?php echo "$given"." "."$surname" ?>, welcome to Narrabundah College online shop. </h2> </b> 
        <br> You are signed in as:<?php echo "$user" ?>. <br> Today's date is <?php echo"$date"; ?>. </td>
    </tr>
    <tr>
        <td rowspan="4" align="center" width="15%"> 
        <a href="canteen_menu.php"> Canteen Data </a> <br>
        <a href="customers_menu.php"> Customer Data </a> <br>
        <a href="stationery_menu.php"> Stationery Data </a> <br>
        <a href="logout.php"> Log Out </a> <br>
        </td>
    </tr>
    <tr>
        <td rowspan="4" colspan="4" align="center"> 
        <!-- Table for easy fo alignment and readability for user -->
        <?php
        if ($order==0)
        {
        ?>
        <table border="1">
        <tr>
        <td colspan="2">
        <h3> Welcome To The Canteen </h3>
        </td>
        </tr>
        <tr>
        <td>
        Items Currentely Avalible:
        <ul align="left">
            <li> Sausage Roll ($4.50) </li>
            <li> Beef and Mushroom Pie ($6.50) </li>
            <li> Almond Crossaint ($5.00) </li>
            <li> Satay Chicken and Rice [conatins peanuts] ($7.00)</li>
            <li> Spaghetti Bolognese ($6.30) </li>
            <li> Chocolate Milk ($3.50) </li>
            <li> Sparkling Raspberry Juice ($3.00) </li>
            <li> PUMP Water ($2.50) </li>
        </ul>
        </td>
        <td>
        Order Quantities: <br> <br>
        <form action="<?php $self ?>" method="post">
        <ul style="list-style-type:none;"> <!-- Removes bullets, list assists in formatting -->
        <li> <input type="number" name="rolls">  </li>
        <li> <input type="number" name="pies">  </li>
        <li> <input type="number" name="crosses">  </li>
        <li> <input type="number" name="chickens">  </li>
        <li> <input type="number" name="pastas">  </li>
        <li><input type="number"  name="milks"> </li>
        <li> <input type="number" name="juices"> </li>
        <li> <input type="number" name="waters"> </li>
        </ul>
        <input type="submit" value="Submit" align="center">
        </form>
        </tr>
        </table>
        </td>
        <?php
        }
        if ($order==1)
        {
            echo 'That order comes to $'.$finalcost.'.';
        }
        ?>
    </tr>
</table>
</body>
</html>

PDF FOLDER NOT STORE IN PLESK

I created a simple Laravel application on Plesk.

I tried to store some PDF files in public/storage/pdf, and I saved the file path in the database as a VARCHAR.

However, the PDF file is not being stored in that folder.
Please help me — I am new to web hosting and Laravel.

    //ivocontorller
    <?php

    namespace AppHttpControllers;

    use IlluminateHttpRequest;
    use AppModelsivo_input;
    use IlluminateSupportFacadesStorage; // Import Storage facade for file handling

    class IvoController extends Controller
    {
        public function index()
        
        {
             $ivo=ivo_input::all();
             return view('IVO.bootstaps',['ivo'=>$ivo]);  // Assuming you have a view named 'ivo.index'
            // Retrieve all records from the ivo_input tableS
        }

        public function show()
        
        {
             $ivo=ivo_input::all();
             return view('IVO.show',['ivo'=>$ivo]);  // Assuming you have a view named 'ivo.index'
            // Retrieve all records from the ivo_input tableS
        }

        public function create(){return view('IVO.create');  // Assuming you have a view named 'ivo.create'
        }

        public function store(Request $request)
    {
        // Validate the request inputs
        $data = $request->validate([
            'description' => 'required',
            'type' => 'required',
            'job_title' => 'required',
            'department' => 'required',
            'Jd_pdf' => 'required', // PDF only, max 2MB
        ]);

        // Store the PDF and get its path
        $path = $request->file('Jd_pdf')->store('storage/pdf', 'public');

        //dd($path); // Debugging line to check the file path

        // Add the file path to the data array
        $data['Jd_pdf'] = $path;

        // Create the new record in the database
        ivo_input::create($data);

        // Redirect to index route
        return redirect(route('ivo.index'));
    }


        public function edit( ivo_input $ivo)//kena letak model sama dengan dia punya variable yang di pass
        {
         //return view('ivo.edit', ['ivo' => $ivo]); //ivo edit ada value pass the value

          return view('IVO.edit', ['ivo' => $ivo]); //ivo edit ada value pass the value
         
        }

        public function update(Request $request, ivo_input $ivo)
        {
                 $data= $request->validate([
                'description' => 'required',
                'type' => 'required',
                'job_title' => 'required',
                'department' => 'required',
                 ]);

            $ivo->update($data); // Update the record in the ivo_input table
            return redirect(route('ivo.index'))->with('success','Vacancy Updated Successffully'); // Redirect to the index route
        }

        public function destroy(ivo_input $ivo)
        {
            // Delete the file from storage if it exists

        if ($ivo->Jd_pdf && Storage::disk('public')->exists($ivo->Jd_pdf)) {
            Storage::disk('public')->delete($ivo->Jd_pdf);
        }
            $ivo->delete(); // Delete the record from the ivo_input table
            return redirect(route('ivo.index'))->with('success', 'Vacancy Deleted Successfully'); // Redirect to the index route
        }

    }

<ivo_input>(model controller)

<?php

namespace AppModels;

use IlluminateDatabaseEloquentModel;
use IlluminateDatabaseEloquentFactoriesHasFactory;
class ivo_input extends Model //nama kena sama dengan nama table dalam database, kalau tak sama kena guna protected $table
{
use HasFactory;

protected $table = 'ivo_tables'; // guna ni kalau nama model lain dengan nama table
protected $fillable = [
'description',
'type',
'job_title',
'department',
'Jd_pdf',
];
}
viewer

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round|Open+Sans">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">

<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>

<link rel="stylesheet" href="{{ asset('/resources/css/bootsrap.css') }}">
{{-- Rasa tak perlu import pun sebab bootstrap tu dah siap ada --}}
{{-- nanti nak letak js atau css masuk dalam public folder --}}
{{-- ni tak boleh odan, rasa sebab bukan dalam file public tu dia tak boleh nak access, simpan dalam public okay ? --}}

{{-- <link rel="stylesheet" href="../resources/css/bootsrap.css"> --}}

{{-- <div class="btn btn-primary">asdasdasd</div> --}}
<script src="{{ url('/resources/js/template.js') }}"></script>
</head>
<body>
<div class="container-lg">
<div class="table-responsive">
<div class="table-wrapper">
<div class="table-title">
<div class="row">
<div class="col-sm-8"><h2>VACANCY OPENING <b>Details</b></h2></div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new" onclick="window.location.href='{{ route('ivo.create') }}'">
<i class="fa fa-plus"></i> Add New
</button>

</div>
</div>
</div>
<table class="table table-bordered">
<thead>
<tr>
<th>Job Title</th>
<th>Job Description</th>
<th>Job Position</th>
<th>Status</th>
<th>Department</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
<tbody>

@foreach($ivo as $ivos)
<tr>
<td>{{ $ivos->job_title }}</td>
<td> <a href="{{ asset($ivos->Jd_pdf) }}" target="_blank">View PDF</a></td>
<td>{{ $ivos->description }}</td>
<td>{{ $ivos->type }}</td>
<td>{{ $ivos->department }}</td>
<td>
<a href='{{ route('ivo.create') }}'class="add" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>

<a href="{{ route('ivo.edit', $ivos->id) }}" class="edit" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>
{{-- <a class="add" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
<a class="edit" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a> --}}
</td>
<td>
<form method="post" action="{{ route('ivo.destroy', $ivos->id) }}">
@csrf
@method('delete')
<button type="submit" class="delete" title="Delete" data-toggle="tooltip" style="background: none; border: none; margin: 0%;">
<i class="material-icons">&#xE872;</i>
</button>
</form>

</td>

</tr>
@endforeach
{{-- <tr>
<td>John Doe</td>
<td>Administration</td>
<td>(171) 555-2222</td>
<td></td>
<td>
<a class="add" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
<a class="edit" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>
<a class="delete" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>
</td>
</tr> --}}

</tbody>
</table>
</div>
</div>
</div>
</body>
</html>

i managed to insert data into database but not able to store in pdf file.

Wocommerce PHP – MYSQL Get sets of values of products and variations variation exists

I am having a nightmare with getting data in the format I need using mysql/php. I have a query which gives me all the details I need for a product, but this also feeds me the main product details for a variable product.

I have tried and tried to make a simple query to just get variation details but for some reason getting no luck.

My aim is to get a the details for each product, and then all the same details for the variation IF the product has a variation – and if it has a variation, I do not need the main product for it, just the variations details.

Below is my query to get the details I want for a product but, I can not get the variations details no matter what I do. Can anyone help?

    SELECT ID, post_title, guid, post_type, sku_meta.meta_value AS `SKU`, 
stock_meta.meta_value AS 'QTY', 
salesprice_meta.meta_value AS 'SALEPRICE', 
ean_meta.meta_value AS 'EAN',
regularprice_meta.meta_value AS 'RRP'
FROM wp_posts
LEFT JOIN wp_postmeta sku_meta on wp_posts.ID = sku_meta.post_id
  AND sku_meta.meta_key = '_sku'
  LEFT JOIN wp_postmeta stock_meta on wp_posts.ID = stock_meta.post_id
  AND stock_meta.meta_key = '_stock'
  LEFT JOIN wp_postmeta salesprice_meta on wp_posts.ID = salesprice_meta.post_id
  AND salesprice_meta.meta_key = '_price'
  LEFT JOIN wp_postmeta ean_meta on wp_posts.ID = ean_meta.post_id
  AND ean_meta.meta_key = '_global_unique_id'
  LEFT JOIN wp_postmeta regularprice_meta on wp_posts.ID = regularprice_meta.post_id
  AND regularprice_meta.meta_key = '_regular_price'
WHERE post_type = 'product'