I want create a single php product page for all products

I’m trying to create an ordering website and I want to link all products to be ordered to one page where the customer will need to fill in some form for delivery, displays the particular product details which the customer clicked on to order.

 <?php session_start();
 include("menucon.php");

  $result = mysqli_query($conn,'SELECT * FROM appetizers WHERE id = 
  "'.$_GET['appetizers'].'"');

   foreach ($rows as $row) ;

  ?>

this the product details page view

   <section class="sec1">

  <div class="p-img">
  <h2 class=""><?php echo $result['food_name'];?></h2> 
   <img src="../images/<?php echo $result['newImageName'];?>" alt="">
  </div>
  <div class="p-desc">
      <h5>WHAT TO EXPERT</h5>
    <p><?php echo $result['description'];?></p></div>
   </section>

This is for the page for all products to be ordered

             <div class="col">
             <div class="bx">
                <img src="images/<?php echo $row1["newImageName"]; ?>" alt=""> 
                <div>
                    <h3><?php echo $row1["food_name"]; ?></h3>
                    <h3> <s>GHC<?php echo $row1["discount"]; ?></s> GHC<?php echo 
                 $row2["price"]; ?></h3>
                    <p class="desc" >
                        
                For Each
                </p></div>
                <a class="btn1" href="ord.html">ORDER</a>
                
              </div>
            </div>
           <div class="col">
            <div class="bx">
                <img src="images/<?php echo $row2["newImageName"]; ?>" alt=""> 
                <div>
                    <h3><?php echo $row2["food_name"]; ?></h3>
                    <h3> <s>GHC<?php echo $row2["discount"]; ?></s> GHC<?php echo 
                $row2["price"]; ?></h3>
                    <p class="desc" >
                        
                Full Set, Extra Cost For More
                </p></div>
                <a class="btn1" href="ord.html">ORDER</a>
                
            </div>
          </div>

Can’t call public method inside the action of the hook of the cron schedule wordpress

i added the cron job as the following and the action method called from the class which class is a custom payment gateway..

function cronJobSchedule() {
     
            return array(
                'in_per_minute' => array(
                    'interval' =>60,
                    'display' => 'In every custom Mintues'
                )
            );
        }
    
    
    /* Add Cron Job Event */
    register_activation_hook(__FILE__,'registerCronJob');
        
    //Schedule Cron Job Event-in_per_minute-every_minute
    function registerCronJob() {
            
        if ( ! wp_next_scheduled( 'cronPerMinutes' ) ) {
            wp_schedule_event( time(), 'in_per_minute', 'cronPerMinutes' );
        }
    }

    //trigger action based on period in minutes
    add_action( 'cronPerMinutes',array('plugin_name','action')  );

    //remove schedule event on deactivate
    register_deactivation_hook(__FILE__, 'unRegisterCronJob');

    add_filter( 'cron_schedules','cronJobSchedule');
    
    function unRegisterCronJob() {
        wp_clear_scheduled_hook('cronPerMinutes');
    }

and the action method in the class:
public function action()
{
  $orderObj = new WC_Order(50);
  $authenticationToken=$this->getAuthenticationToken();
  $orderObj->add_order_note($authenticationToken);
}

the problem that i can’t call any method ($this->getAuthenticationToken()) in this action hook … it doesn’t work!! when i call any method.

dunglas/symfony-docker : Internal call to same project

I’ve just tried https://github.com/dunglas/symfony-docker/
It seems very cool and work on the road !

But i can’t ping my server sf from sf… i’m trying to call my own api in the same project but the ping localhost from sf does not seem to work.

I’ve put a call.php and a receipt.php in public/, but i don’t know what to do so that call.php ping receipt.php
I can access to https://localhost/call.php but call.php can’t access https://localhost/receipt.php from my php script. i can access https://localhost/receipt.php from my navigator.

if somebody have a clue ?
ty.

Printer raw socket choose cassette

I wrote a php script which sends pdf files over raw socket to a printer.

$fp = pfsockopen("192.168.10.61",9100);     # Drucker IP
fwrite($fp, file_get_contents(__DIR__ . '/test.pdf'));      # Ausdruck 1
fclose($fp);

The printer does it’s job very well and without problems.

Now I’ve got a new printer with two cassettes, both are A4 but one with our letterhead and one without.

I want to print with cassette two, how is that possible?

I already changed the socket ports up to 9103 but that doesn’t help.

Printer-Model: kyocera P-4035i MFP KX

How to translate this grpc call to a native PHP call using grpc pecl extension?

I am using PHP 7.0.10 on Windows Server and I recently installed the PECL grpc extension because I would like to migrate a call like this one:

$output = shell_exec('grpcurl.exe -insecure -proto extranet.proto -d {"Usuario":"user","Senha":"pass"} www.jucerja.rj.gov.br:9443 extranet.v0.BuscaEmpresa/Login 2>&1');
print_r(($output));

to a native one using the grpc extension.

How can I achieve this?

How can we insert multiple texts and paragraphs in google docs using google docs api with php?

I want to insert more the one texts in google docs with multiple paragraph contents and also want to style them. I also followed this link https://developers.google.com/docs/api/reference/rest/v1/documents/request but I am unable to achieve this.

$requests [] = new Google_Service_Docs_Request(
[
    'insertText' => [
        'text' => 'Sample1n',
        'location' => [
            'index' => 1
        ]
    ]
],
  [
    'insertText' => [
      'text' => 'sample2n',
      'location' => [
        'index' => 9
      ]
    ]
  ],
  [
    'updateParagraphStyle' => [
      'range' => [
        'startIndex' => 1,
        'endIndex' => 8
      ],
      'paragraphStyle' => [
        'namedStyleType' => 'HEADING_1'
      ],
      'fields' => 'namedStyleType'
    ]
  ],
  [
    'updateParagraphStyle' => [
      'range' => [
        'startIndex' => 9,
        'endIndex' => 17
      ],
      'paragraphStyle' => [
        'namedStyleType' => 'NORMAL_TEXT'
      ],
      'fields' => 'namedStyleType'
  ]
  ],
  [
    'updateTextStyle' => [
      'range' => [
        'startIndex' => 9,
        'endIndex' => 16
      ],
      'textStyle' => [
        'link' => [
          'url' => 'https://www.google.com'
        ]
      ],
      'fields' => 'link'
    ]
  ]
);
$batchUpdateRequest = new Google_Service_Docs_BatchUpdateDocumentRequest(array(
    'requests' => $requests
));

$response = $service->documents->batchUpdate($documentId, $batchUpdateRequest);

I am doing in this way and getting this error

PHP Fatal error:  Uncaught GoogleServiceException: {
  "error": {
    "code": 400,
    "message": "Invalid requests[0]: No request set.",
    "errors": [
      {
        "message": "Invalid requests[0]: No request set.",
        "domain": "global",
        "reason": "badRequest"
      }
    ],
    "status": "INVALID_ARGUMENT"
  }
}

Can anyone help me out with this. It would be a great help and i need it in PHP code.

convert svg text to image using imagettftext function

I’m trying to convert svg text to image using imagettftext function but it prints the text itself instead of the signature

$signed = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMzM0LjQgMTQ4LjgiIHdpZHRoPSIzMzQuNCIgaGVpZ2h0PSIxNDguOCI+PHBhdGggZD0iTSAyMD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ODYuMDg1IDEzOC4xMzgsODIuMjUwIiBzdHJva2Utd2lkdGg9IjEuNzQ1IiBzdHJva2U9ImJsYWNrIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiPjwvcGF0aD48L3N2Zz4=";

$text5 = $signed; 
    $origin_y5 = 1325;
    $origin_x5 = 250;
    imagettftext($image, $font_size, 0, $origin_x5, $origin_y5, $white, $font, $text5);

Is there a way to convert this into image?

How to print preview and save in one button in laravel

Is there a way how to add two function which is the print and move the data to another table in a one button? In my project where I have table which is the accepted reservation table. Here the admin can let borrow the equipment since it is accepted reservation. So when I click the borrow button how can I print preview the row data and move that row data in borrowed item since it is now a borrowed item. Anyone can help me?

Please refer to this image

Here when I click the borrow button the print preview will display only the row data and move the row data to borroweditem table. While the quantity of that item which is in another table will be deducted by 1.

Here’s my view.blade.php

<div class="card shadow mb-4">
    <div class="card-header py-3">
    <h6 class="m-0 font-weight-bold text-primary">Accepted Reservations</h6>
    </div>
    <div class="card-body">

    <div class="table-responsive">
     <table class="table table-bordered tbl_acceptres display" id="dataTable" width="100%" cellspacing="0">
     <thead>
<tr>
<th hidden>Id</th>
<th>Name</th>
<th>Equipment</th>
<th>Reservation Date</th>
<th>Rooms</th>
<th>Action</th>
</tr>
</thead>
<tbody>
 @foreach ($acc as $accdata)

<tr>
 <td hidden> </td>
<td>{{ $accdata->name }} </td>
<td>{{ $accdata->Name_item }}</td>
<td>{{ $accdata->dt_item }}</td>
<td>{{ $accdata->room_item }} </td>
<td>
<form action="{{route('admin.reservation.borrow',$accdata->id)}}" method="POST">
{{ csrf_field() }}
<button type="submit" class="btn btn-primary btn-sm">Borrow <i class="fas fa-chevron-right"></i></button>
</form>
</td>
</tr>

@endforeach
</tbody>
</table>
</div>
</div>

Here’s my controller

public function borrow(Request $request, $id){

$bor = Reservation::where('id', $id)->first();
$kl=$first->name;
$mn=$first->Name_item;
$op=$first->dt_item;
$qr=$first->room_item;

$bitem = new BorrowedItem();
$bitem->bname= $kl;
$bitem->bdate= $mn;
$bitem->itemb= $op;
$bitem->broom= $qr;

$bitem->save();
$bor->delete();

returned redirect()->back()->with('message','Successfully borrowed item')

}

supervisor , php7.4-fpm entered RUNNING state

I have configured supervisor with php7.4-fpm and I got these logs , it always restart

2022-02-06T10:23:08.501156489Z 2022-02-06 10:23:08,500 INFO success: php7.4-fpm entered 
RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2022-02-06T10:23:08.501390216Z 2022-02-06 10:23:08,501 INFO exited: php7.4-fpm (exit status 0; 
expected)
2022-02-06T10:23:08.985646043Z 2022-02-06 10:23:08,985 INFO spawned: 'php7.4-fpm' with pid 545
2022-02-06T10:23:09.001912738Z 2022-02-06 10:23:09,001 INFO success: php7.4-fpm entered 
RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2022-02-06T10:23:09.002241911Z 2022-02-06 10:23:09,002 INFO exited: php7.4-fpm (exit status 0; 
expected)

this is my supervisor configuration

[supervisord]
nodaemon = true
logfile = /dev/null
logfile_maxbytes = 0
pidfile = /var/run/supervisord.pid
user=root

[program:php7.4-fpm]
command = /etc/init.d/php7.4-fpm start
stdout_logfile = /dev/stdout
stdout_logfile_maxbytes=0
startsecs = 0
exitcodes= 0
autorestart = true
stderr_logfile = /dev/stderr
stderr_logfile_maxbytes=0
user = root
autostart = true
priority = 5

How to set php.ini path

I installed xampp to work on php projects, and I’m sure I installed it the same as in the course, but when I try to run a Development Server by running php -S localhost:8080, it replies with

Fatal error: Uncaught PDOException: could not find driver in C:xampphtdocsphp-crash-course-202014_product_crud2_betterpublicproductsindex.php:3 Stack trace: #0 C:xampphtdocsphp-crash-course-202014_product_crud2_betterpublicproductsindex.php(3): PDO->__construct(‘mysql:host=loca…’, ‘root’, ”) #1 {main} thrown in C:xampphtdocsphp-crash-course-202014_product_crud2_betterpublicproductsindex.php on line 3

I have done a lot of research and I think the problem is that there is no path to php.ini.
In php.ini I uncommented the extension pdo_mysql but that didn’t work, so on the command line, I typed php --ini and it replied with

Configuration File (php.ini) Path:    
Loaded Configuration File: (none)   
Scan for additional .ini files in: (none)   
Additional .ini files parsed: (none)

I have found the php.ini file in C:/xampp/php/php.ini which from my research should be the right place, so I think I need to set a path for xampp to find php.ini, but I can’t find how.
Is there a command to set a path for php.ini?

check if query builder already issued where or like?

I am so convenient using built-in codedigniter query builder.

I have to output searching to an existing page since that page involves multi-table.
Currently, I already have a lot of if there, I am curious how to check if statement db->where() or db->like() have been called or not.

I am already stuck here, and I am aware that the db->get() will erase the data filtering.
Any suggestion?

How to remove the shipping fee from the refund WooCommerce email template [duplicate]

I want to remove the shipping fee from the refund email template from WooCommerce and the total amount to be without the shipping fee.

<?php

defined( 'ABSPATH' ) || exit;

do_action( 'woocommerce_email_header', $email_heading, $email ); ?>

<?php /* translators: %s: Customer first name */ ?>
<p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ); ?></p>

<p>
<?php
if ( $partial_refund ) {
    /* translators: %s: Site title */
    printf( esc_html__( 'Your order on %s has been partially refunded. There are more details below for your reference:', 'woocommerce' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
} else {
    /* translators: %s: Site title */
    printf( esc_html__( 'Your order on %s has been refunded. There are more details below for your reference:', 'woocommerce' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
}
?>
</p>
<?php


do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );


do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );


do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );


if ( $additional_content ) {
    echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
}


do_action( 'woocommerce_email_footer', $email );

enter image description here

PHP shell_exec – some shell commands not available

before starting – I have seen some SO similar questions, but tbh I got even more lost.

I am trying to run nvm use and nvm -v within the PHP shell_execute, but am constantly getting the following error:

sh: nvm: command not found

It seems like PHP is using Bourne shell where nvm is not available.
I am mostly using Bash in Terminal where everything is fine (in other shells like ZSH I get the same error).

Questions:

How can I make PHP run commands with shell_exec (if there is alternative I am open for considering it) I usually use in Bash?

Extra notes (maybe helpful):

  1. This command is only used on a local environment so changing settings on dev machine is something I am open to consider. (would be good to support Mac/Win and Linux, but Mac is the main focus at the moment).

  2. If I run which nvm in the bash I get nothing in the terminal.

  3. NVM was installed with Brew (don’t know if that has any impact)

The usecase:

I am building a WP CLI toolkit where one of the commands is wp custom install. The command should switch to the right Node.js version of the project, install npm and php dependencies as well as some extra things.

// basic code sample
namespace Custom/CustomCli;

class CustomCli {

    public static function init(){
    
        if( !(defined('WP_CLI') && WP_CLI) ) return;
        WP_CLI::add_command( 'custom', 'CustomCustomCli' );

    }
    
    /*
    * If the Node.js version !== to .nvmrc try 'nvm use'
    * after correct version is selected run 'npm install'
    * also run 'composer install' and 'composer dump-autoload'
    */
    public function install( $args ){
        WP_CLI::log( shell_exec('nvm -v') ); # once I figure out this I guess I'll know how to fully handle installation
    }

}

CustomCli::init();

WordPress website suddenly gives an error

My WordPress website suddenly stopped working.
I suspect that an automatic update went wrong.

I get the following error:

Warning: Undefined array key 0 in /…/wp-includes/plugin.php on line 957
Warning: Undefined array key 0 in /…/wp-includes/plugin.php on line 960

This is the snippet:

function _wp_filter_build_unique_id( $hook_name, $callback, $priority ) {
if ( is_string( $callback ) ) {
    return $callback;
}

if ( is_object( $callback ) ) {
    // Closures are currently implemented as objects.
    $callback = array( $callback, '' );
} else {
    $callback = (array) $callback;
}

if ( is_object( $callback[0] ) ) {
    // Object class calling.
    return spl_object_hash( $callback[0] ) . $callback[1];
} elseif ( is_string( $callback[0] ) ) {
    // Static calling.
    return $callback[0] . '::' . $callback[1];
}

}

Can someone help me?
This website contains an inventory in woo commerce and the auto-back-up failed.