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
Related
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;
}
}
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';
why ??
A PHP Error was encountered Severity: Notice
Message: Undefined property: stdClass::$users
Filename: views/user_view.php
Line Number: 10
Backtrace:
File: C:\xampp\htdocs\ci\application\views\user_view.php Line: 10
Function: _error_handler
File: C:\xampp\htdocs\ci\application\controllers\users.php Line: 7
Function: view
File: C:\xampp\htdocs\ci\index.php Line: 315 Function: require_once
You try to access a variable without it first being defined. If you define it first, you won't get an error.
<?php
$x = new stdClass();
$y = $x->z; // gererates Notice in error_log
$x = new stdClass();
$x->z = 'assigned'; // now it is assigned
$y = $x->z; // no error
// or you could make your own class
class Whatever
{
public $z;
}
$x = new Whatever();
$y = $x->z; // it's there whether a value has been assigned or not
Check it out here https://3v4l.org/hOThV
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?
I am trying to take db backup in codeigniter using function dbutil. It is working fine in local but in live server i am getting some php error. Please help me where i did wrong.
below is my code and error
Controller
function db_backup()
{
$this->load->dbutil();
$prefs = array(
'format' => 'zip',
'filename' => 'industry_speak.sql'
);
$backup =& $this->dbutil->backup($prefs);
$db_name = 'is-backup-on-'. date("Y-m-d-H-i-s") .'.zip';
$save = './assets/db_backup/'.$db_name;
$this->load->helper('file');
write_file($save, $backup);
$this->load->helper('download');
force_download($db_name, $backup);
}
Error
In line No. 3775 below code is present.
$backup =& $this->dbutil->backup($prefs);
A PHP Error was encountered
Severity: Runtime Notice
Message: Only variables should be assigned by reference
Filename: controllers/Admin.php
Line Number: 3775
Backtrace:
File: /home/acetronsma/public_html/application/controllers/Admin.php
Line: 3775 Function: _error_handler
File: /home/acetronsma/public_html/index.php Line: 316 Function:
require_once
$backup = $this->dbutil->backup($prefs);
remove =&,
cm