I get these errors when I go the Reports.php page:
A PHP Error was encountered
Severity: Notice
Message: Undefined offset: 0
Filename: controllers/Reports.php
Line Number: 73
Backtrace:
File: C:\xampp\htdocs\restaurant\application\controllers\Reports.php
Line: 73
Function: _error_handler
File: C:\xampp\htdocs\restaurant\index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: controllers/Reports.php
Line Number: 88
Backtrace:
File: C:\xampp\htdocs\restaurant\application\controllers\Reports.php
Line: 88
Function: _error_handler
File: C:\xampp\htdocs\restaurant\index.php
Line: 315
Function: require_once
This is line 73 in Reports.php:
$store_id = $store_data[0]['id'];
This is line 88 in Reports.php:
foreach ($order_data as $k => $v) {
This is line 315 in index.php:
require_once BASEPATH.'core/CodeIgniter.php';
Related
public function reporting_page()
{
$res=array();
if ($this->input->post()) {
$date1=$this->input->post('date1');
$date2= $this->input->post('date2');
$this->load->model('Investor_model');
$res['idata']= $this->Investor_model->fetch_tranaction_report($date1, $date2);
$this->load->view('investor/report', $res, true);
echo '<h2>Test</h2>';
$html = $this->output->get_output();
// Load pdf library
$this->load->library('pdf');
$this->dompdf->loadHtml($html);
$this->dompdf->set_option('isRemoteEnabled', true);
$this->dompdf->setPaper('A4', 'portrait');
$this->dompdf->render();
$output=$this->dompdf->stream("html_contents.pdf", array("Attachment"=> 0));
} else {
$this->load->view('investor/report', $res);
}
}
It is giving errorA PHP Error was encountered
Severity: 8192
Message: Required parameter $dompdf follows optional parameter $paper
Filename: Adapter/CPDF.php
Line Number: 182
Backtrace:
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Autoloader.php
Line: 38
Function: _error_handler
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Autoloader.php
Line: 38
Function: require_once
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\CanvasFactory.php
Line: 57
Function: autoload
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Dompdf.php
Line: 299
Function: get_instance
File: C:\custom\htdocs\iapp\application\libraries\Pdf.php
Line: 23
Function: __construct
File: C:\custom\htdocs\iapp\application\controllers\Investor_controller.php
Line: 871
Function: library
File: C:\custom\htdocs\iapp\index.php
Line: 291
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Required parameter $dompdf follows optional parameter $paper
Filename: src/Canvas.php
Line Number: 27
Backtrace:
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Autoloader.php
Line: 38
Function: _error_handler
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Autoloader.php
Line: 38
Function: require_once
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Adapter\CPDF.php
Line: 37
Function: autoload
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Autoloader.php
Line: 38
Function: require_once
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\CanvasFactory.php
Line: 57
Function: autoload
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Dompdf.php
Line: 299
Function: get_instance
File: C:\custom\htdocs\iapp\application\libraries\Pdf.php
Line: 23
Function: __construct
File: C:\custom\htdocs\iapp\application\controllers\Investor_controller.php
Line: 871
Function: library
File: C:\custom\htdocs\iapp\index.php
Line: 291
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Required parameter $img follows optional parameter $w
Filename: lib/Cpdf.php
Line Number: 4728
Backtrace:
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Autoloader.php
Line: 29
Function: _error_handler
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Autoloader.php
Line: 29
Function: require_once
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Adapter\CPDF.php
Line: 198
Function: autoload
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\CanvasFactory.php
Line: 57
Function: __construct
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Dompdf.php
Line: 299
Function: get_instance
File: C:\custom\htdocs\iapp\application\libraries\Pdf.php
Line: 23
Function: __construct
File: C:\custom\htdocs\iapp\application\controllers\Investor_controller.php
Line: 871
Function: library
File: C:\custom\htdocs\iapp\index.php
Line: 291
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Required parameter $data follows optional parameter $w
Filename: lib/Cpdf.php
Line Number: 5071
Backtrace:
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Autoloader.php
Line: 29
Function: _error_handler
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Autoloader.php
Line: 29
Function: require_once
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Adapter\CPDF.php
Line: 198
Function: autoload
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\CanvasFactory.php
Line: 57
Function: __construct
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Dompdf.php
Line: 299
Function: get_instance
File: C:\custom\htdocs\iapp\application\libraries\Pdf.php
Line: 23
Function: __construct
File: C:\custom\htdocs\iapp\application\controllers\Investor_controller.php
Line: 871
Function: library
File: C:\custom\htdocs\iapp\index.php
Line: 291
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Required parameter $imageWidth follows optional parameter $w
Filename: lib/Cpdf.php
Line Number: 5415
Backtrace:
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Autoloader.php
Line: 29
Function: _error_handler
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Autoloader.php
Line: 29
Function: require_once
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Adapter\CPDF.php
Line: 198
Function: autoload
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\CanvasFactory.php
Line: 57
Function: __construct
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Dompdf.php
Line: 299
Function: get_instance
File: C:\custom\htdocs\iapp\application\libraries\Pdf.php
Line: 23
Function: __construct
File: C:\custom\htdocs\iapp\application\controllers\Investor_controller.php
Line: 871
Function: library
File: C:\custom\htdocs\iapp\index.php
Line: 291
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Required parameter $imageHeight follows optional parameter $w
Filename: lib/Cpdf.php
Line Number: 0
Backtrace:
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Autoloader.php
Line: 29
Function: _error_handler
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Autoloader.php
Line: 29
Function: require_once
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Adapter\CPDF.php
Line: 198
Function: autoload
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\CanvasFactory.php
Line: 57
Function: __construct
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Dompdf.php
Line: 299
Function: get_instance
File: C:\custom\htdocs\iapp\application\libraries\Pdf.php
Line: 23
Function: __construct
File: C:\custom\htdocs\iapp\application\controllers\Investor_controller.php
Line: 871
Function: library
File: C:\custom\htdocs\iapp\index.php
Line: 291
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Required parameter $imgname follows optional parameter $w
Filename: lib/Cpdf.php
Line Number: 0
Backtrace:
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Autoloader.php
Line: 29
Function: _error_handler
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Autoloader.php
Line: 29
Function: require_once
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Adapter\CPDF.php
Line: 198
Function: autoload
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\CanvasFactory.php
Line: 57
Function: __construct
File: C:\custom\htdocs\iapp\application\libraries\dompdf\src\Dompdf.php
Line: 299
Function: get_instance
File: C:\custom\htdocs\iapp\application\libraries\Pdf.php
Line: 23
Function: __construct
File: C:\custom\htdocs\iapp\application\controllers\Investor_controller.php
Line: 871
Function: library
File: C:\custom\htdocs\iapp\index.php
Line: 291
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: require_once(dompdf/dompdf_config.inc.php): Failed to open stream: No such file or directory
Filename: controllers/Investor_controller.php
Line Number: 876
Backtrace:
File: C:\custom\htdocs\iapp\application\controllers\Investor_controller.php
Line: 876
Function: _error_handler
File: C:\custom\htdocs\iapp\application\controllers\Investor_controller.php
Line: 876
Function: require_once
File: C:\custom\htdocs\iapp\index.php
Line: 291
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at C:\custom\htdocs\iapp\system\core\Exceptions.php:271)
Filename: core/Common.php
Line Number: 570
Backtrace:
An uncaught Exception was encountered
Type: Error
Message: Failed opening required 'dompdf/dompdf_config.inc.php' (include_path='C:\custom\php\PEAR')
Filename: C:\custom\htdocs\iapp\application\controllers\Investor_controller.php
Line Number: 876
Backtrace:
File: C:\custom\htdocs\iapp\index.php
Line: 291
Function: require_once
I also tried to install composer to resolve this error but not worked. please help. Thanks in advance.
It is because you are using old version of Dompdf. Upgrade your Dompdf as it has been fixed.
See commit about this fixed on Adapter/CPDF.php.
See all releases https://github.com/dompdf/dompdf/releases
i'm stuck in this message error warning, i have doing some solutions but not solved.
here like message error i face:
A PHP Error was encountered
Severity: Warning
Message:
require_once(C:\xampp\htdocs\pustaka-booking\application\third_party/dompdf/dompdf_config.inc.php/):
failed to open stream: No such file or directory
Filename: libraries/dompdf_gen.php
Line Number: 25
Backtrace:
File:
C:\xampp\htdocs\pustaka-booking\application\libraries\dompdf_gen.php
Line: 25 Function: _error_handler
File:
C:\xampp\htdocs\pustaka-booking\application\libraries\dompdf_gen.php
Line: 25 Function: __construct
File: C:\xampp\htdocs\pustaka-booking\application\controllers\Home.php
Line: 7 Function: __construct
File: C:\xampp\htdocs\pustaka-booking\index.php Line: 315 Function:
require_once Fatal error: require_once(): Failed opening required
'C:\xampp\htdocs\pustaka-booking\application\third_party/dompdf/dompdf_config.inc.php/'
(include_path='C:\xampp\php\PEAR') in
C:\xampp\htdocs\pustaka-booking\application\libraries\dompdf_gen.php
on line 25 A PHP Error was encountered
Severity: Compile Error
Message: require_once(): Failed opening required
'C:\xampp\htdocs\pustaka-booking\application\third_party/dompdf/dompdf_config.inc.php/'
(include_path='C:\xampp\php\PEAR')
Filename: libraries/dompdf_gen.php
Line Number: 25
Backtrace: and here are the code:
/**
* Name: DOMPDF
*
* Author: Jd Fiscus
* jdfiscus#gmail.com
* #iamfiscus
*
*
* Origin API Class: http://code.google.com/p/dompdf/
*
* Location: http://github.com/iamfiscus/Codeigniter-DOMPDF/
*
* Created: 06.22.2010
*
* Description: This is a Codeigniter library which allows you to convert HTML to PDF with the DOMPDF library
*
*/
class Dompdf_gen {
public function __construct() {
require_once APPPATH.'third_party/dompdf/dompdf_config.inc.php';
$pdf = new DOMPDF();
$CI =& get_instance();
$CI->dompdf = $pdf;
}
}
This question already has answers here:
How to load a controller from another controller in codeigniter?
(10 answers)
Closed 4 years ago.
I have the Login_controller:
if ($query->num_rows() == 1){
$usuario = $query->row();
$this->load->library('../controllers/Dashboard_controller');
}
And I have the Dashboard_Controller:
public function index(){
$this->load->view("dashboard/Dashboard_view");
}
}
But, I got a message error:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Dashboard_controller::$load
Filename: libraries/Form_validation.php
Line Number: 147
Backtrace:
File: C:\xampp\htdocs\local\acjum1\application\controllers\Login_controller.php
Line: 34
Function: library
File: C:\xampp\htdocs\local\acjum1\index.php
Line: 315
Function: require_once
An uncaught Exception was encountered
Type: Error
Message: Call to a member function helper() on null
Filename: C:\xampp\htdocs\local\acjum1\system\libraries\Form_validation.php
Line Number: 147
Backtrace:
File: C:\xampp\htdocs\local\acjum1\application\controllers\Login_controller.php
Line: 34
Function: library
File: C:\xampp\htdocs\local\acjum1\index.php
Line: 315
Function: require_once
What am I doing wrong?
Try this one
redirect('/dashboard/index');
This question was asked before.
Basically you are calling the controller but not the index function.
Please refer to : How to load a controller from another controller in codeigniter?
[29-Jul-2018 21:05:03 UTC] PHP Notice: Undefined variable: statusCode in /home2/postgram/public_html/app/vendor/mgp25/instagram-php/src/Utils.php on line 361
[29-Jul-2018 21:05:04 UTC] PHP Notice: Undefined variable: statusCode in /home2/postgram/public_html/app/vendor/mgp25/instagram-php/src/Utils.php on line 361
[29-Jul-2018 21:07:23 UTC] PHP Notice: Undefined variable: statusCode in /home2/postgram/public_html/app/vendor/mgp25/instagram-php/src/Utils.php on line 361
[29-Jul-2018 21:07:24 UTC] PHP Notice: Undefined variable: statusCode in /home2/postgram/public_html/app/vendor/mgp25/instagram-php/src/Utils.php on line 361
how to fix it?
this sc
https://raw.githubusercontent.com/mgp25/Instagram-API/master/src/Utils.php
Code of function is:
public static function checkFFPROBE()
{
// We only resolve this once per session and then cache the result.
if (self::$ffprobeBin === null) {
#exec('ffprobe -version 2>&1', $output, $statusCode);
if ($statusCode === 0) { // <-- line nr 361
self::$ffprobeBin = 'ffprobe';
} else {
self::$ffprobeBin = false; // Nothing found!
}
}
return self::$ffprobeBin;
}
You dont get error, it is just a php notice.
exec() as 3rd argument return status of the executed command (see more exec )
I think, you can resolve it in 3 ways:
Declare $statusCode just before 361 line ( e.g. $statusCode = null; )
Change exec() to shell_exec() ( see more shell_exec )
You can ignore php notices by setting error reporting level error_reporting( E_ALL & ~E_NOTICE );
i have method for uploading image, but i get multiple error messages if i run this method with error:
Severity: Warning
Message: pathinfo() expects parameter 1 to be string, array given
Filename: core/Loader.php
Line Number: 759
Severity: Notice
Message: Array to string conversion
Filename: core/Loader.php
Line Number: 760
An Error Was Encountered
Unable to load the requested file: Array.php
how do I fix the code so as not to get an error ? where is the problem ?
thanks
function upload_image()
{
$config = array(
'file_name'=> 'hallo.jpg',
'upload_path'=>'./application/views/photo',
'allowed_types'=>'gif|jpg|png',
'max_size'=>'1024',
'max_width'=>'1600',
'max_height'=>'1200'
);
$this->load->library('upload', $config);
if($this->upload->do_upload())
{
$data['breadcrumb1'] = "Member";
$data['breadcrumb'] = "Add Member";
$data['content']='admin-cms/member/add';
$this->load->view('admin-cms/index', $data);
}else
{
$data['content']= array('error' => $this->upload->display_errors('<span class="error">','</span>'));
$this->load->view('admin-cms/index', $data);
}
}