i create the session for login but it reload the login page again and again instead of redirecting the index page

i used this code there is no errors but after logout when i was going back to the welcome page and click on back it was opening webpage again what i have to do?

it is my login code for three users it working successfully but when i add the session code it only redirect the login page instead of Index page. i am not getting that where is the error in login page or session page how to solve it please please someone help me

<?php
include("connectivity.php")
?>

<?php
if(isset($_POST['login']))
{$u=$_POST['Email'];
 $p=$_POST['Password'];
 $c=$_POST['usertype'];

 $sql="select * from registration where Email='$u'";

 $result = $connection->query($sql);
$row = $result->fetch_assoc();
$x=$row['Password'];
$y=$row['usertype'];
if(strcasecmp($x,$p)==0 && !empty($u) && !empty($p))
  {//echo "Login Successful";
   $_SESSION['Email']=$u;
   

  if($y=='Admin'){
   header('location:Admin Portal/AddBooks.php');
   echo "Login Successful";
  }
  elseif($y=='Faculty'){
    header('location:Without Login/Contactus1.php');
    echo "Login Successful";
  }
  elseif($y=='Student'){
    header('location:Student Portal/BorrowBooks1.php');
    echo "Login Successful";
  }
        
  }
else 
 { echo "<script type='text/javascript'>alert('Failed to Login! Incorrect Email or Password')</script>";
}
   

}
?>

this code i write for session:


<?php 
include('../connectivity.php');
//check if the user is already loggedin
session_start();
if($_SESSION["Email"] != true) {
    header('location:../Login.php');
    exit();
}
?>

plz help me

g++: error: unrecognized command line option ‘-std=c++14’

I’m getting the above error when installing with pecl on CentOS 7.9 with WHM/cPanel

if I use the command /opt/cpanel/ea-php80/root/usr/bin/pecl install grpc , I get an issue, but when using /opt/cpanel/ea-php74/root/usr/bin/pecl install grpc it will install, what am I doing wrong?

my development environment is php 8.0, and installing it with the 7.4 pecl wont allow me to use it from 8.0 cli

I’ve got g++ 7.3.1, and installed devtoolset 7.

When building from source using https://github.com/grpc/grpc/tree/master/src/php#build-from-source < this guide, the same issue c++: error: unrecognized command line option ‘-std=c++14’ upon attempting the make command.

I’m trying to use the PHP client library for the Google Ads API.

Can someone please advise/help, I’ve been trying to do this now for the last 3 days.

how override some functions to make desired changes in license plugin

i use woocommerce subscriptions and software license manager master plugin, i combined the software license manager master plugin with woocommerce subscriptions plugin, i want to create a license for subscription products, for this reason, i want to make changes in some functions :

1 – by default, the software license manager master plugin only creates a license for the type of slm_license products, but i want to change it to a simple subscription product type. as soon as the order is paid, a license will be created, the function related to creating a license in the software license manager master plugin is as follows :

function wc_slm_on_complete_purchase($order_id) {
    //SLM_Helper_Class::write_log('loading wc_slm_on_complete_purchase');
    if (SLM_SITE_HOME_URL != '' && WOO_SLM_API_SECRET != '') {
        wc_slm_create_license_keys($order_id);
    }
} add_action('woocommerce_order_status_completed', 'wc_slm_on_complete_purchase', 10);

function wc_slm_create_license_keys($order_id) {

    // SLM_Helper_Class::write_log('loading wc_slm_create_license_keys');

    $order = wc_get_order($order_id);
    $purchase_id_ = $order->get_id();

    // SLM_Helper_Class::write_log('purchase_id_ -- '.$purchase_id_ );
    // SLM_Helper_Class::write_log('purchase_id_ -- '.$user_id  );

    global $user_id;

    $user_id = $order->get_user_id();
    $user_info = get_userdata($user_id);
    $get_user_meta = get_user_meta($user_id);
    $payment_meta['user_info']['first_name'] = $get_user_meta['billing_first_name'][0];
    $payment_meta['user_info']['last_name'] = $get_user_meta['billing_last_name'][0];
    $payment_meta['user_info']['email'] = $get_user_meta['billing_email'][0];
    $payment_meta['user_info']['company'] = $get_user_meta['billing_company'][0];

    // SLM_Helper_Class::write_log('user_id -- '.$user_id  );

    // Collect license keys
    $licenses = array();
    $items = $order->get_items();


    foreach ($items as $item => $values) {
        $download_id = $product_id = $values['product_id'];
        $product = $values->get_product();
        if ($product->is_type('slm_license')) {
            $download_quantity = absint($values['qty']);
            //Get all existing licence keys of the product
            $order_item_lic_key = $values->get_meta('_slm_lic_key', false);
            $lic_to_add = $download_quantity - count($order_item_lic_key);
            //Create keys only if there are not keys created already
            for ($i = 1; $i <= $lic_to_add; $i++) {
                /**
                 * Calculate Expire date
                 * @since 1.0.3
                 */
                $expiration = '';

                $renewal_period = (int)wc_slm_get_licensing_renewal_period($product_id);
                $renewal_term = wc_slm_get_licensing_renewal_period_term($product_id);

                $slm_billing_length = $renewal_period;
                $slm_billing_interval = $renewal_term;

                if ($renewal_period == 'onetime') {
                    $expiration = '0000-00-00';
                }
                // elseif ($renewal_period == 30) {
                //  $renewal_period = date('Y-m-d', strtotime('+' . 31 . ' days'));
                // }
                else {
                    $expiration = date('Y-m-d', strtotime('+' . $renewal_period . ' ' . $renewal_term));
                }
                // SLM_Helper_Class::write_log('renewal_period -- '.$renewal_period  );
                // SLM_Helper_Class::write_log('exp -- ' . $expiration);
                // SLM_Helper_Class::write_log('term -- ' . $renewal_term);

                // Sites allowed get license meta from variation
                $sites_allowed = wc_slm_get_sites_allowed($product_id);

                if (!$sites_allowed) {
                    $sites_allowed_error = __('License could not be created: Invalid sites allowed number.', 'softwarelicensemanager');
                    $int = wc_insert_payment_note($purchase_id_, $sites_allowed_error);
                    break;
                }

                // Get the custumer ID
                // $user_id = $order->get_user_id();
                $order_data = $order->get_data(); // The Order data

                ## Access Order Items data properties (in an array of values) ##
                $item_data = $values->get_data();
                $product_name = $item_data['name'];
                $product_id = $item_data['product_id'];
                $_license_current_version = get_post_meta($product_id, '_license_current_version', true);
                $_license_until_version = get_post_meta($product_id, '_license_until_version', true);
                $amount_of_licenses_devices = wc_slm_get_devices_allowed($product_id);
                $current_version = (int)get_post_meta($product_id, '_license_current_version', true);
                $license_type = get_post_meta($product_id, '_license_type', true);
                $lic_item_ref = get_post_meta($product_id, '_license_item_reference', true);

                // Transaction id
                $transaction_id = wc_get_payment_transaction_id($product_id);

                // Build item name
                $item_name = $product->get_title();

                // Build parameters
                $api_params = array();
                $api_params['slm_action'] = 'slm_create_new';
                $api_params['secret_key'] = KEY_API;
                $api_params['first_name'] = (isset($payment_meta['user_info']['first_name'])) ? $payment_meta['user_info']['first_name'] : '';
                $api_params['last_name'] = (isset($payment_meta['user_info']['last_name'])) ? $payment_meta['user_info']['last_name'] : '';
                $api_params['email'] = (isset($payment_meta['user_info']['email'])) ? $payment_meta['user_info']['email'] : '';
                $api_params['company_name'] = $payment_meta['user_info']['company'];
                $api_params['purchase_id_'] = $purchase_id_;
                $api_params['product_ref'] = $product_id; // TODO: get product id
                $api_params['txn_id'] = $purchase_id_;
                $api_params['max_allowed_domains'] = $sites_allowed;
                $api_params['max_allowed_devices'] = $amount_of_licenses_devices;
                $api_params['date_created'] = date('Y-m-d');
                $api_params['date_expiry'] = $expiration;
                $api_params['slm_billing_length'] = $slm_billing_length;
                $api_params['slm_billing_interval'] = $slm_billing_interval;
                $api_params['until'] = $_license_until_version;
                $api_params['current_ver'] = $_license_current_version;
                $api_params['subscr_id'] = $order->get_customer_id();
                $api_params['lic_type'] = $license_type;
                $api_params['item_reference'] = $lic_item_ref;

                //access_expires
                //SLM_Helper_Class::write_log('license_type -- ' . $license_type );
                // Send query to the license manager server
                $url = SLM_SITE_HOME_URL . '?' . http_build_query($api_params);
                $url = str_replace(array('http://', 'https://'), '', $url);
                $url = 'http://' . $url;
                $response = wp_remote_get($url, array('timeout' => 20, 'sslverify' => false));
                $license_key = wc_slm_get_license_key($response);

                // Collect license keys
                if ($license_key) {
                    $licenses[] = array(
                        'item' => $item_name,
                        'key' => $license_key,
                        'expires' => $expiration,
                        'type' => $license_type,
                        'item_ref' => $lic_item_ref,
                        'slm_billing_length' => $slm_billing_length,
                        'slm_billing_interval' => $slm_billing_interval,
                        'status' => 'pending',
                        'version' => $_license_current_version,
                        'until' => $_license_until_version
                    );
                    $item_id = $values->get_id();
                    wc_add_order_item_meta($item_id, '_slm_lic_key', $license_key);
                    wc_add_order_item_meta($item_id, '_slm_lic_type', $license_type);
                }
            }
        }
    }

    if (count($licenses) > 0) {
        // Payment note
        wc_slm_payment_note($order_id, $licenses);

        // Assign licenses

        //What does this do? The meta is not used in the plugin anywhere
        //wc_slm_assign_licenses($order_id, $licenses);
    }
}

i want to change only one line of code : if ($product->is_type('slm_license')) change to if ( $product->is_type('subscription') && wcs_order_contains_subscription( $order, 'parent' ) && $order->has_status('completed') ), if i put the above 2 functions in the function.php file and apply my changes, it will be ok, is there a way to change just that one line of code without completely rewriting the 2 functions again?

2 – by default, after successful payment and automatic creation of the license, the license is pending, i want to change it to active. it means that after creating the automatic license, it should be activated, not pending. i found its function in software license manager master plugin, it is as follows :

function creation_api_listener() {
        if (isset($_REQUEST['slm_action']) && trim($_REQUEST['slm_action']) == 'slm_create_new') {
            //Handle the licene creation API query
            global $slm_debug_logger, $wpdb;
            $tbl_name = SLM_TBL_LICENSE_KEYS;

            $options        = get_option('slm_plugin_options');
            $lic_key_prefix = $options['lic_prefix'];

            SLM_API_Utility::verify_secret_key_for_creation(); //Verify the secret key first.

            $slm_debug_logger->log_debug("API - license creation (slm_create_new) request received.");

            //Action hook
            do_action('slm_api_listener_slm_create_new');

            $fields = array();

            if (isset($_REQUEST['license_key']) && !empty($_REQUEST['license_key'])) {
                $fields['license_key']  = strip_tags($_REQUEST['license_key']); //Use the key you pass via the request
            } else {
                $fields['license_key']  = slm_get_license($lic_key_prefix);
            }

            $fields['lic_status']       = isset($_REQUEST['lic_status']) ? wp_unslash(strip_tags($_REQUEST['lic_status'])) : 'pending';
            $fields['first_name']       = wp_unslash(strip_tags($_REQUEST['first_name']));
            $fields['last_name']        = wp_unslash(strip_tags($_REQUEST['last_name']));
            $fields['purchase_id_']     = wp_unslash(strip_tags($_REQUEST['purchase_id_']));
            $fields['email']            = strip_tags($_REQUEST['email']);
            $fields['company_name']     = isset($_REQUEST['company_name']) ? wp_unslash(strip_tags($_REQUEST['company_name'])) : '';
            $fields['txn_id']           = strip_tags($_REQUEST['txn_id']);

            if (empty($_REQUEST['max_allowed_domains'])) {
                $fields['max_allowed_domains'] = $options['default_max_domains'];
            } else {
                $fields['max_allowed_domains'] = strip_tags($_REQUEST['max_allowed_domains']);
            }
            if (empty($_REQUEST['max_allowed_devices'])) {
                $fields['max_allowed_devices'] = $options['default_max_devices'];
            } else {
                $fields['max_allowed_devices'] = strip_tags($_REQUEST['max_allowed_devices']);
            }
            $fields['date_created']     = isset($_REQUEST['date_created']) ? strip_tags($_REQUEST['date_created']) : wp_date("Y-m-d");
            $fields['date_expiry']      = isset($_REQUEST['date_expiry']) ? strip_tags($_REQUEST['date_expiry']) : '';
            $fields['product_ref']      = isset($_REQUEST['product_ref']) ? wp_unslash(strip_tags($_REQUEST['product_ref'])) : '';
            $fields['until']            = isset($_REQUEST['until']) ? wp_unslash(strip_tags($_REQUEST['until'])) : '';
            $fields['current_ver']            = isset($_REQUEST['current_ver']) ? wp_unslash(strip_tags($_REQUEST['current_ver'])) : '';
            //current_ver
            $fields['subscr_id']        = isset($_REQUEST['subscr_id']) ? wp_unslash(strip_tags($_REQUEST['subscr_id'])) : '';
            $fields['item_reference']   = isset($_REQUEST['item_reference']) ? wp_unslash(strip_tags($_REQUEST['item_reference'])) : '';

            $fields['lic_type']         = isset($_REQUEST['lic_type']) ? wp_unslash(strip_tags($_REQUEST['lic_type'])) : '';

            $fields['slm_billing_length']   = isset($_REQUEST['slm_billing_length']) ? wp_unslash(strip_tags($_REQUEST['slm_billing_length'])) : '';
            $fields['slm_billing_interval']   = isset($_REQUEST['slm_billing_interval']) ? wp_unslash(strip_tags($_REQUEST['slm_billing_interval'])) : '';

            if ($_REQUEST['lic_type'] == 'subscription' && !isset($_REQUEST['slm_billing_length'])) {
                //error inserting
                $error_args = (array(
                    'result'     => 'error',
                    'message'    => 'License creation failed. Specify license length "slm_billing_length".',
                    'error_code' => SLM_Error_Codes::CREATE_FAILED
                ));
                SLM_API_Utility::output_api_response($error_args);
            }

            if ($_REQUEST['lic_type'] == 'subscription' && !isset($_REQUEST['slm_billing_interval'])) {
                //error inserting
                $error_args = (array(
                    'result'     => 'error',
                    'message'    => 'License creation failed. Specify license length "slm_billing_interval".',
                    'error_code' => SLM_Error_Codes::CREATE_FAILED
                ));
                SLM_API_Utility::output_api_response($error_args);
            }


            $result = $wpdb->insert($tbl_name, $fields);
            if ($result === false) {
                //error inserting
                $args = (array(
                    'result'     => 'error',
                    'message'    => 'License creation failed',
                    'error_code' => SLM_Error_Codes::CREATE_FAILED
                ));
                SLM_API_Utility::output_api_response($args);
            } else {
                $args = (array(
                    'result'    => 'success',
                    'message'   => 'License successfully created',
                    'key'       => $fields['license_key'],
                    'code'      => SLM_Error_Codes::LICENSE_CREATED
                ));

                // log data
                global $wpdb;
                SLM_Utility::create_log($fields['license_key'], 'slm_create_new');
                SLM_API_Utility::output_api_response($args);
            }
        }
    } add_action('slm_api_listener_init', 'creation_api_listener_1', 10);

i want to change only one line of code : $fields['lic_status'] = isset($_REQUEST['lic_status']) ? wp_unslash(strip_tags($_REQUEST['lic_status'])) : 'pending'; change to $fields['lic_status'] = isset($_REQUEST['lic_status']) ? wp_unslash(strip_tags($_REQUEST['lic_status'])) : 'active';, if i put the above function in the function.php file and apply my changes, it will be ok, is there a way to change just that one line of code without completely rewriting the function again?

any answer from you brings my gratitude

Database design for multi region application with regional data

How to design a database such as monster.com or jobstreet.com, each domain specific for one country and has its own regional data (e.g. jobstreet.com.sg showing Singapore jobs), but user details are shared between the domains (e.g. registered account in jobstreet.com.sg can login into jobstreet.com.my).

What I want to achieve:

  • User details are shared between different website (User doesn’t need to register in different region website)
  • Regional data (SG data only showing in SG)
  • Cross multi region data (SG data can show in MY if the user specific it)

Solution 1:

  1. One database for all the regions and specific where the data should show. E.g.
    • Job (id)
    • job_region (id, job_id, region)
  2. In application, filter job where region in (SG)

Problems for solution 1:

  1. If the application go popular, then will need to filter more data and performance might be affected
  2. Require large amount storage for every database instances in each availability zones

Solution 2:

  1. One schema for user profile related data. E.g.
    • database_user
      • User_profile (id, name, email)
      • Working History (id, user_profile_id, position)
  2. And one schema for each region
    • database_sg
      • job
    • database_my
      • job

Problems for solution 2:

  1. If the job ad is posted in both SG and MY, then it will need duplicate the data and insert into two different schema
  2. Extra configuration to change database connection to retrieve data

Comparing solution 1 and 2, seems like solution 2 is much more acceptable but is there any others solution for these kind of scenarios?

How to upload multiple files using dropzone with inside sweetalert2

I want to upload multiple files using Dropzone html in sweetalert2.
Problem is when i run query dropzone not working in sweetalert2.

$(document).on('click', '.smt_attachment', function (e) {
        e.preventDefault();
        var itemId = $(this).data('id');
        swal({
            title: 'Dropzone File Upload',
            html:''+
                '<form action="#" class="dropzone" id="dropzone">'+
                    '<div class="fallback">'+
                        '<input name="file" type="file" multiple />'+
                    '</div>'+
                '</form>',
            confirmButtonText: "Upload",
            allowOutsideClick: true
        })
    });

screenshot for popup

Unknown Property – ActiveDataProvider::WmProducts in yii2

I am trying to send a data from the model but in view page datas are not coming its showing error (Setting unknown property: yiidataActiveDataProvider::WmProducts). Unknown Property – yiibaseUnknownPropertyException

This is my code:-
Controller:-

<?php

namespace frontendcontrollers; 
use yiiwebController;
use yiidataPagination;
use frontendmodelsWmProducts; 
use yiidataActiveDataProvider;

class ProductsController extends yiiwebController
{
    public function actionIndex()
    {
        return $this->render('index');  
    }

    public function actionView()
    {
        
        // $WmProducts = WmProducts::find()->all(); // Calling Model
        $WmProducts = WmProducts::find()->select('id,name,is_retail,is_wholesale')->all();
      // echo "<pre>";print_r($WmProducts);
      // exit;

        $dataProvider = new ActiveDataProvider ([
            'WmProducts' =>$WmProducts,
            'pagination' => false,

        
        ]);
               // echo "ABC";
        // exit;
        return $this->render('view', ['dataProvider' =>$dataProvider]);
         // return $this->render('view', ['dataProvider' =>$WmProducts]);
    }

}

Model:-

<?php

namespace frontendmodels;

use Yii;
use yiibaseModel;
use yiidbActiveRecord;
use yiidataActiveDataProvider;

/**
 * This is the model class for table "{{%wm_products}}".
 *
 * @property int $id
 * @property int $manufacturer_id
 * @property string $sku
 * @property string $manufacturer_sku
 * @property string $cola
 * @property string $bidcola
 * @property string $name
 * @property string $slug
 * @property float $price
 * @property float $price_suggested
 * @property float $direct_import_price
 * @property float $di_price
 * @property float $wholesale_price
 * @property float $wholesale_price_suggested
 * @property float $distributor_price
 * @property float $distributor_price_suggested
 * @property int $on_hand
 * @property int $default_retail_warehouse_id
 * @property int $default_wholesale_warehouse_id
 * @property int $default_tax_code_id
 * @property float $weight
 * @property int $is_bundle
 * @property int $items_per_unit
 * @property int $items_per_case
 * @property string $date_available
 * @property int $is_new
 * @property string $date_created
 * @property string $mod_dt
 * @property string $edit_status
 * @property string $inventory_status
 * @property int $product_type_id
 * @property int $is_retail
 * @property int $is_wholesale
 * @property int $is_distributor
 * @property int $sales_target_overwrite
 * @property int $special_sales_percentage
 * @property int $excluded_from_sales_volume
 * @property int|null $is_archived
 * @property string $shopify_product_id
 */
class WmProducts extends yiidbActiveRecord
{
    
   public  $WmProducts;
   public $dataProvider;


    
    public static function tableName()
    {
        return '{{%wm_products}}';
    }

public function rules()
    {
        return [['id', 'name', 'di_price', 'is_retail', 'is_wholesale']];
    }
    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'manufacturer_id' => 'Manufacturer ID',
            'sku' => 'Sku',
            'manufacturer_sku' => 'Manufacturer Sku',
            'cola' => 'Cola',
            'bidcola' => 'Bidcola',
            'name' => 'Name',
            'slug' => 'Slug',
            'price' => 'Price',
            'price_suggested' => 'Price Suggested',
            'direct_import_price' => 'Direct Import Price',
            'di_price' => 'Di Price',
            'wholesale_price' => 'Wholesale Price',
            'wholesale_price_suggested' => 'Wholesale Price Suggested',
            'distributor_price' => 'Distributor Price',
            'distributor_price_suggested' => 'Distributor Price Suggested',
            'on_hand' => 'On Hand',
            'default_retail_warehouse_id' => 'Default Retail Warehouse ID',
            'default_wholesale_warehouse_id' => 'Default Wholesale Warehouse ID',
            'default_tax_code_id' => 'Default Tax Code ID',
            'weight' => 'Weight',
            'is_bundle' => 'Is Bundle',
            'items_per_unit' => 'Items Per Unit',
            'items_per_case' => 'Items Per Case',
            'date_available' => 'Date Available',
            'is_new' => 'Is New',
            'date_created' => 'Date Created',
            'mod_dt' => 'Mod Dt',
            'edit_status' => 'Edit Status',
            'inventory_status' => 'Inventory Status',
            'product_type_id' => 'Product Type ID',
            'is_retail' => 'Is Retail',
            'is_wholesale' => 'Is Wholesale',
            'is_distributor' => 'Is Distributor',
            'sales_target_overwrite' => 'Sales Target Overwrite',
            'special_sales_percentage' => 'Special Sales Percentage',
            'excluded_from_sales_volume' => 'Excluded From Sales Volume',
            'is_archived' => 'Is Archived',
            'shopify_product_id' => 'Shopify Product ID',
        ];
    }
}

View:-

<?php
use yiigridGridView;
use yiidataActiveDataProvider;
use yiiwidgetsActiveForm;
use yiihelpersHtml;


$dataProvider = new ActiveDataProvider([
    'query' => Post::find(),
    'pagination' => [
        'pageSize' => 20,
    ],
]);


// get the posts in the current page
// $dataProvider = $dataProvider->getModels();

echo GridView::widget([
    'dataProvider' => $dataProvider,


    'columns' => [
        'id',
         [
            'attribute' => 'name',
            'format' => 'text'
         ],

         [
            'attribute' => 'wholesale_price',
            'format' => 'text'
         ],
         [
            'attribute' => 'is_retail',
            'format' => 'text'
         ],
         [
            'attribute' => 'distributor_price',
            'format' => 'Text'
         ]

        ]
]);

?>

Please let me know what is the issue and how to solve.

Laravel GuzzleHttp: http_ca.crt file given but got error “SSL certificate problem: self-signed certificate in certificate chain”

In my Laravel 9 project, I use the Guzzle HTTP client to send requests like this:

    private function getFromElasticsearch($request_uri, $data = NULL, $delegated_function = NULL) {
        $result = Http::withOptions([
            'debug' => true,
            'crt' => '/home/XYZ/Documents/projets/elasticsearch_tests/http_ca.crt',
        ])->withBasicAuth(config('elasticsearch.authentication.client_id'), config('elasticsearch.authentication.secret'))->post(config('elasticsearch.connections.rest_api.endpoint') . '/customer/_search')->throw();
        var_dump($result);
    }

However, the .crt file doesn’t seem to be given to Elasticsearch, the service I try to call with Guzzle:

GuzzleHttpExceptionRequestException: cURL error 60: SSL certificate problem: self-signed certificate in certificate chain (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://172.18.0.9:9200/customer/_search in file /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 211

When I use Postman to query Elasticsearch (giving it the CRT file), it works well. So I guess the problem comes from the use I make of GuzzleHttp. Maybe I don’t give the .crt file in the right way.

How could I pass the .crt file without having to use verify=>FALSE please? (indeed I’ve seen this solution in several sites, but I think it’s not the good one)

img src is correct but does not work in my index.php already tried different methods

my img src is correct the path is also correct i also tried the absolute and relative path but i still can’t insert the img in the index.php i also tried these method “file.jpg ” and i also tried the ” width=700 /> with the $imgloc = “filepath”; and other method but it is still not inserting the image the image address is “C:xampphtdocsRestaurantMS_CIapplicationviewsimglogo.png”

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>Login</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
    <!-- Bootstrap 3.3.7 -->


    <link rel="stylesheet" href="<?php echo base_url('assets/bower_components/bootstrap/dist/css/bootstrap.min.css') ?>" />
    <!-- Font Awesome -->
    <link rel="stylesheet" href="<?php echo base_url('assets/bower_components/font-awesome/css/font-awesome.min.css') ?>" />
    <!-- Ionicons -->
    <link rel="stylesheet" href="<?php echo base_url('assets/bower_components/Ionicons/css/ionicons.min.css') ?>" />
    <!-- Theme style -->
    <link rel="stylesheet" href="<?php echo base_url('assets/dist/css/AdminLTE.min.css') ?>" />
    <!-- iCheck -->
    <link rel="stylesheet" href="<?php echo base_url('assets/plugins/iCheck/square/blue.css') ?>" />
    <style><?php include 'style.css'; ?></style>



    <!-- Google Font -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic" />

</head>
<body class="hold-transition login-page">
    <img class="wave" src="img/wave1.png" />
    <div class="container">
        <div class="img">
            <img src="img/bg1.svg" />
   
        </div>
        <?php echo validation_errors(); ?>

        <?php if(!empty($errors)) {
                  echo $errors;
              } ?>
        <div class="login-content">
            <form action="<?php echo base_url('auth/login') ?>" method="post">
                <img src="img/logo.png" />
                <h2 class="title">Welcome Back</h2><hr /><br />
                <p>Please, provide login credentials to proceed.</p>
                <div class="input-div one">
                    <div class="i">
                        <i class="fas fa-user"></i>
                    </div>
                    <div class="div">
                        <input type="text" class="form-control" name="email" id="email" placeholder="Email" autocomplete="off" />
                    </div>
                </div>
                <div class="input-div pass">
                    <div class="i">
                        <i class="fas fa-lock"></i>
                    </div>
                    <div class="div">
                        <input type="password" class="form-control" name="password" id="password" placeholder="Password" autocomplete="off" />
                    </div>
                </div>
                <input type="submit" class="btn" value="Login" name="btnLogin" />
            </form>
        </div>
    </div>

    <!-- jQuery 3 -->

    <style>
  .icon {
    font-size: 70px;
    text-align: center;
  }
    </style>

    <script src="<?php echo base_url('assets/bower_components/jquery/dist/jquery.min.js') ?>"></script>
    <!-- Bootstrap 3.3.7 -->
    <script src="<?php echo base_url('assets/bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
    <!-- iCheck -->
    <script src="<?php echo base_url('assets/plugins/iCheck/icheck.min.js') ?>"></script>
    <script>
  $(function () {
    $('input').iCheck({
      checkboxClass: 'icheckbox_square-blue',
      radioClass: 'iradio_square-blue',
      increaseArea: '20%' // optional
    });
  });
    </script>
</body>
</html>

enter image description here

output value of json array and then sent another get request

i am really new to stackoverflow and actually dont have any clue about php.

I have a json array which looks like

[{"betreff":"h"},{"betreff":"VS Code fehlt"}]

i´ve created (copied :D) a foreach loop
to output the “h” and “VS Code fehlt”

function display_array_recursive($json_rec){

if($json_rec){
    foreach($json_rec as $key=> $value){
        if(is_array($value)){
            display_array_recursive($value);
        }else{
            echo '<a href="#"  onClick="test("'.$value.'")">';
        }
    }
}

As we can see now the “h” and “VS Code fehlt” parts are being outputted as links. I want to make it so that whenever I click on the link a new get requests should be sent out with the giving value.

function test($value){when pressed = send new file_get_contents request to localhost/api/ticket/{$value}}

i hope i could describe good enough what i want.
Thanks in advance, please inform me if anything is unclear

When i clone a bar chart using php and it is created with morris js data is not showing in the second chart

I need same graph to be used in same page twice, graph is duplicated using php but data is showing only in the first one and when i reload the second is adding the data in the first one like i will show in photos

<div class="inbox-widget scrollbar-track-widgets scrollbar-track-gray nicescroll total_inspections-scrollbar">
<div id="total_inspections_comparison_content_chart"></div>
<script type="text/javascript">

var data = <?php echo json_encode($chart_data);?>;
var data_colors = <?php echo json_encode($data_colors);?>;
var data_labels = <?php echo json_encode($data_labels);?>;
var widget_parms = <?php echo json_encode($widget_parms);?>;

function createBarChart(element, data, xkey, ykeys, labels, lineColors, hoverCallBack)
{
    hoverCallBack = (typeof hoverCallBack == 'undefined') ? function (index, options, content, row)
    {
        return content;
    } : hoverCallBack;
    if ($('#total_inspections_comparison_content_chart').length > 0)
    Morris.Bar({
        element: element,
        data: data,
        xkey: xkey,
        ykeys: ykeys,
        labels: labels,
        hideHover: 'auto',
        resize: true, //defaulted to true
        xLabelFormat: function (x) {
            return x.src.period;
        },
        gridLineColor: '#eeeeee',
        barSizeRatio: 1.3,
        barColors: lineColors,
        hoverCallback: hoverCallBack,
        preUnits: "",
        barSize: 10
    });
}

createBarChart(
    'total_inspections_comparison_content_chart',
    data,
    'date',
    ['three_years_back', 'two_years_back', 'last_year', 'this_year'],
    data_labels,
    function (row, series, type) {
        var now = new Date();
        var now_year = now.getFullYear();
        if(row.label.indexOf(now_year) >= 0 || (row.label === `Dec 31, ${now_year-1}` && (widget_parms == 'this_month' ||  widget_parms == 'year_to_date' || widget_parms == 'last_three_months')))
            color = data_colors[differenceYear(series.label)];
        else if (typeof data_colors[differenceYear(series.label - 1)]  != 'undefined') color = data_colors[differenceYear(series.label - 1)];
        else color = data_colors[differenceYear(series.label)];
        return color;
    },
    function (index, options, content, row)
    {
        $tooltip_info_obj = generateTooltip(options, content, row);
        return $tooltip_info_obj;
    }
);

function generateTooltip(options, content, row){
    var $jQueryObject = $($.parseHTML('<div>' + content + '</div>'));
    $jQueryObject.find('.morris-hover-row-label').addClass('hover-label-style');
    var tooltipInfo = '';
    tooltipInfo = '<strong>' + row.period + '</strong><br>';

    if(row.three_years_back !== 0){
        tooltipInfo += row.three_years_back_label + ': ' + row.three_years_back + '<br>';
    }
    if(row.two_years_back !== 0){
        tooltipInfo += row.two_years_back_label + ': ' + row.two_years_back + '<br>';
    }
    if(row.last_year !== 0){
        tooltipInfo += row.last_year_label + ': ' + row.last_year + '<br>';
    }
    if(row.this_year !== 0){
        tooltipInfo += row.this_year_label + ': ' + row.this_year + '<br>';
    }

    $jQueryObject.find('.morris-hover-row-label').html(tooltipInfo);
    $jQueryObject.find('.morris-hover-point').remove();
    return $jQueryObject.contents();
}

function differenceYear (year) {
    var previous_year_date = new Date(year,1,1);
    var previous_year = previous_year_date.getFullYear();
    var this_year_date =  new Date();
    var this_year = this_year_date.getFullYear();
    difference = this_year - previous_year;
    return difference;
}

function generateChartLegend(data_colors, data_labels){
    data_colors_rev = data_colors;
    data_colors_rev = data_colors_rev.reverse();
    for(let elem  in data_labels){
        var wrapper = document.createElement('div');
        var label_div = document.createElement('div');
        var color_box_div = document.createElement('div');
        wrapper.style.float = 'left';
        wrapper.style.margin = '0px 0px 0px 15px';
        label_div.innerHTML = data_labels[elem];
        label_div.style.display = 'inline';
        color_box_div.style.background = data_colors_rev[elem];
        color_box_div.style.float = 'left';
        color_box_div.style.width = '10px';
        color_box_div.style.height = '10px';
        color_box_div.style.margin = '4px 10px 0px 0px';
        wrapper.append(color_box_div);
        wrapper.append(label_div);
        $('#total_inspections_graph_legend').append(wrapper);
    }
}
generateChartLegend(data_colors, data_labels);

As you can see in the photo the first graph is taking data of the second and the second graph is not showing anything

<style>
#total_inspections_comparison_content_chart {
    min-width: 500px !important;
}
.total_inspections-scrollbar {
    max-height: 500px !important;
}

here is migration file

public function up()
{

$this->addWidget(12, ‘Total Inspections Comparison’, ‘total_inspections_comparison’, 1);
}
enter image description here