Integrate with codeigniter

QuestionsIntegrate with codeigniter
C3media asked 3 years ago

Hello, I'm trying to integrate with codeigniter so:

Controller:

<?php

class Segway extends MY_Controller
{

function __construct()
{
parent::__construct();

if (!$this->loggedIn) {
$this->session->set_userdata('requested_page', $this->uri->uri_string());
$this->sma->md('login');
}
if (!$this->Owner && !$this->Admin) {
$this->session->set_flashdata('warning', lang('access_denied'));
redirect($_SERVER["HTTP_REFERER"]);
}
}

public function index()
{
// $this->load->view('welcome_message');

require_once(APPPATH. 'libraries/phpgrid/config.php'); // APPPATH is path to application folder
// Database config file to be passed in phpgrid constructor
$db_conf = array(
"type" => PHPGRID_DBTYPE,
"server" => PHPGRID_DBHOST,
"user" => PHPGRID_DBUSER,
"password" => PHPGRID_DBPASS,
"database" => PHPGRID_DBNAME
);

$g = new jqgrid($db_conf);

$grid["caption"] = "Sample Grid";
$g->set_options($grid);
$g->table = "clients";

$out = $g->render("list1");

$this->load->view('show_grid',$out);
}

?>

View:

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Show Grid</title>
</head>
<body>

<div id="container">
<h1>Welcome to CodeIgniter! Show me the grid!</h1>

<div id="body">
<?php echo $out?>
</div>

</div>

</body>
</html>

I have used tutorial to try to integrate it:

phpGrid and CodeIgniter Integration

But not works; Thanks by your help!

7 Answers
C3media answered 3 years ago
C3media answered 3 years ago

I did it, but show me error:

Unable to load the requested file: default.php

Thanks by your help!

Abu Ghufran answered 3 years ago

Hello,

Make sure file is correct and always check php error log for error details. There could be more than one reasons for this.

C3media answered 3 years ago

Fine, talk me about where to copy LIB folder?

Thanks!

Abu Ghufran answered 3 years ago

Emailed you sample project.

Closing this ticket.

C3media answered 3 years ago

Hello Abu,

It's working partially, just because says grid message: No records to view

But i have records here in clients table.

Regards!

Abu Ghufran answered 2 years ago

Closing this ticket, duplicate conversation on email.

Your Answer

17 + 9 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?