Welcome, Guest
You have to register before you can post on our site.



Search Forums

(Advanced Search)

Forum Statistics
» Members: 9,932
» Latest member: Ana Lima
» Forum threads: 66,937
» Forum posts: 419,341

Full Statistics

Latest Threads
This page isn’t working u...
Forum: General Help
1 hour ago
» Replies: 0   » Views: 10
Google Chrome Moving to a...
Forum: Lounge
1 hour ago
» Replies: 4   » Views: 327
Problem with session file...
Forum: Issues
5 hours ago
» Replies: 2   » Views: 67
CSRF and Browser Cookie S...
Forum: General Help
5 hours ago
» Replies: 13   » Views: 450
language subdomains
Forum: Best Practices
11 hours ago
» Replies: 6   » Views: 275
Error 404 with unicode ch...
Forum: General Help
Yesterday, 01:55 PM
» Replies: 1   » Views: 65
Calling multiple header/f...
Forum: General Help
Yesterday, 01:39 PM
» Replies: 3   » Views: 65
Forum: Choosing CodeIgniter
Yesterday, 01:18 PM
» Replies: 1   » Views: 55
Routes and hashed URLs
Forum: General Help
Yesterday, 12:03 PM
» Replies: 6   » Views: 124
testing with phpunit in p...
Forum: CodeIgniter 4 Support
Yesterday, 11:11 AM
» Replies: 0   » Views: 36

Rainbow This page isn’t working using while loop.
Posted by: nadeem14375 - 1 hour ago - Forum: General Help - No Replies

hi all,

I have a strange problem in my application. unable to loop through an array. 

here my code:


  public function rep_fee_invoice_4class()
       $data = array(  
                   //'fee_type'    => $this->input->post('fee_type'),
                   'id'     => $this->input->post('class')

       $this->data['fee_detail']= $this->Fee_model->get_fee_invoice_4class($data);
       $this->load->view('reports/rep_fee_invoice_4class_html', $this->data , TRUE); 

  public function get_fee_invoice_4class($data){

   $class_condition = "WHERE studentclass=". $data['id'];

   $student_query=$this->anotherDb->query("SELECT * from
       users $class_condition
       AND activated =1
       AND role = 'Student'");

$totalrows = $student_query->num_rows();

               for($i=0;$i<$totalrows;$i++) {
           $result = $student_query->result_array();
           $student_id = $result[$i]['id'];

                       $student_condition = "WHERE paymentStudent=". $student_id;
                           SELECT paymentStudent, feeMonth, paymentDescription, paymentamount
                           FROM payments
                           AND date_format(feeMonth, '%d-%m-%Y') >= date_format(curdate(), '00-%m-%Y')
                           AND PAYMENTSTATUS =0");
       return $query->result_array();



do {

       ?> <table>
               if(isset($fee_detail) && is_array($fee_detail) && count($fee_detail)): $i=1;
               foreach ($fee_detail as $key => $data) {
                   <td style=" border: 1px solid #555555;"><?php echo $i; ?></td>
                   <td style=" border: 1px solid #555555;"><?php echo $data['paymentStudent']; ?></td>
                   <td style=" border: 1px solid #555555;"><?php echo $data['paymentDescription']; ?></td>
                   <td style=" border: 1px solid #555555;"><?php echo $data['paymentamount']; ?></td>
                   <td style=" border: solid 1px #000000 colspan="8" >No Records Found..</td>



while ($fee_detail);


  testing with phpunit in phpstorm
Posted by: puschie - Yesterday, 11:11 AM - Forum: CodeIgniter 4 Support - No Replies

currently im trying to get phpunit run all tests ( include own application tests ) in phpstorm.

1. install all dependency via composer
  ( got an error on extractTo phpunit/php-code-coverage : no such file or stream | and git was not found : github.com/sebastianbergmann/php-code-coverage.git ) -> guess i dont need this for testing, so just as notice

2. download phpunit.phar and select it in Settings/Languages&Frameworks/PHP/TestFramework

when i try to run a test without the configuration file i get :
   Fatal error: Class 'CodeIgniter\Test\CIDatabaseTestCase' not found

when i try to run a test with the configuration file ( phpunit.xml.dist ) i get :
  require(application/Config/Paths.php): failed to open stream [...] \tests\_support\_bootstrap.php on line 10

im very new to phpunit - so maybe i miss some phpstorm configuration, but when i use the build-in test creation it work ( but i dont get codeignigter to run in a TestCase class )

thx for reading - hope someone had the same problems and solved it^^

  Error 404 with unicode character in the URL like Japanese
Posted by: phongtnit - Yesterday, 08:20 AM - Forum: General Help - Replies (1)


I want to allow Unicode character in the URL like Japanese.

I added in my route.php

Quote:$route['category/(:any)'] = 'Category/view/$1';

When I tried access "category/大人っぽすぎる小学生が中学3年生にもなると.html", it's ok. However with the string "category/筧美和子さんのニットの衣装が素晴らしすぎる.html", it failed and return 404 error (please refer this image https://imgur.com/8lCA7s4 )

I don't know why and how to fix it. Please help me, many thanks,

  Calling multiple header/footer template and setting in route
Posted by: chized - Yesterday, 05:24 AM - Forum: General Help - Replies (3)

Hello everyone
I am new to codeigniter and want to use it for a fairly large project. I intend to use two different bootstrap template.
The first one is working but I don't understand why the second is'nt.
below is the controller code

PHP Code:
    class Pages 
extends CI_Controller{
     public function view($page 'home'){
       $data['title'] = ucfirst($page);

     public function iview($page 'volunteers'){
       $data['title'] = ucfirst($page);
Below is the change I made in the application/config/routes.php

Quote:$route['default_controller'] = 'pages/view';
$route['(:any)'] = 'pages/view/$1';
$route['ipages/(:any)'] = 'ipages/iview/$1';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

  A new row with a link at the left side of the table
Posted by: FARUKB13 - Yesterday, 04:05 AM - Forum: General Help - Replies (1)

PHP Code:
$database $this->verversBelbestand();
       if($database == null){
           $database $database;
       } else {

      //Defineer hier de database
       $config['hostname'] = 'secret';
       $config['username'] = 'secret';
       $config['password'] = 'secret';
       $config['database'] = $database;
       $config['dbdriver'] = 'sqlsrv';
       $config['dbprefix'] = '';
       $config['pconnect'] = FALSE;
       $config['db_debug'] = TRUE;
       $config['cache_on'] = FALSE;
       $config['cachedir'] = '';
       $config['char_set'] = 'utf8';
       $config['dbcollat'] = 'utf8_general_ci';

       $this->customDb $this->load->database($configtrue);


       $campagne '';
       $datum date("Y/m/d");
       $bmnrlic $this->getBmnrLicentie();

       $this->table->set_heading('Campagne ''Aantal agenten''Nog benaderbaar''Terugbellers''Nog na te kijken''BMNR uitgesloten''Geparkeerd''Maxbeldatum');

       $objquery $this->customDb->query("Aantallen_datum_intranet '".$campagne."','".$datum."','".$bmnrlic."'");

       $template = array(
       'table_open'            => '<table border="1" cellpadding="4" cellspacing="0">',

       'thead_open'            => '<thead>',
       'thead_close'           => '</thead>',

       'heading_row_start'     => '<tr>',
       'heading_row_end'       => '</tr>',
       'heading_cell_start'    => '<th>',
       'heading_cell_end'      => '</th>',

       'tbody_open'            => '<tbody>',
       'tbody_close'           => '</tbody>',
'row_start'             => '<tr">',
       'row_end'               => '</tr>',

       'cell_start'            => '<td>',
       'cell_end'              => '</td>',

       'row_alt_start'         => '<tr>',
       'row_alt_end'           => '</tr>',
       'cell_alt_start'        => '<td>',
       'cell_alt_end'          => '</td>',

       'table_close'           => '</table>'

        return $this


<button onclick="myFunction()" class="btn"><span style="color: green;">Ververs</span></button><br><hr>
<form method="post" accept-charset="utf-8">
<button class="btn dropdown scrollable-menu" type="button" id="" data-toggle="dropdown"  aria-expanded="true">
Terugbel Afpsraken
<span class="caret"></span>

<select name="klanten" class="dropdown-menu" onchange="this.form.submit()"> 
<?php foreach($klanten as $row){ ?>
<option value="<?php echo $row->klantnaam;?>"> 
<?php echo $row->klantnaam; ?></option> 
<?php } ?>


<p> <?php echo $terugbel; ?></p>

Well..the title already says it. I have a generated table right now.
But I want an emptry row at the left side of the table with a link in it.
But I have seriously no idea how I should do it..
Anyone who can help me please? Thanks in advance.

Posted by: nvquang9999 - Yesterday, 03:36 AM - Forum: Choosing CodeIgniter - Replies (1)

Hi everyone,

I just wanted to say THANK YOU to all contributors on the Choosing CodeIgniter Forum.
I am a newbie, I want to learn more about CodeIgniter. Mong any supporters. thank you

  Problem with session files
Posted by: raffaele.bennoli - Yesterday, 03:18 AM - Forum: Issues - Replies (2)

Hello everybody,

we develop with CI from many years but we have a weird thing that happen with our last project.

We use CI 3.1.3 on virtualized server with VMware. The "sess_driver" parameter is set to "files".

Sometimes we get this error: 

Severity: Warning --> filesize(): stat failed for /webroot/temp/webcrm/evolutionweb_ikbbigqenm63k241vhle4nhh96oshui9 /webroot/engine/system/libraries/Session/drivers/Session_files_driver.php 208

This file is not updated in the latest CI versions.

Looking at the code we think it's something going wrong between row 170 (where file presence is checked) and row 208 (where file is read).

Now we are tring to switch to "tmpfs" to have more fast access to filesystem. No idea if this can fix it.

Any other suggestion or fixes?

  Use namespaces in Codeigniter 3.1.6
Posted by: blackiven - Yesterday, 03:14 AM - Forum: Libraries & Helpers - Replies (3)

Hi, I want to use my own classes but it throws me an type error.

Type: TypeError

Message: Argument 1 passed to Posts::__construct() must be an instance of PostsRepository, none given, called in C:\wamp64\www\ciblog\system\core\CodeIgniter.php on line 518

Here is my code:


PHP Code:
class Posts extends CI_controller
function __construct (\application\repositories\posts\PostsRepository $postsRepository) {
      $this->postsRepository $postsRepository;




PHP Code:

class PostsRepository() {
function all(){

        return \application\models\Post_model->get_posts();


How can I solve this problem? Thank you!!!

  Routes and hashed URLs
Posted by: wirikidor - 11-21-2017, 06:11 PM - Forum: General Help - Replies (6)

I started a projected and noticed that it was getting rather large, so I decided I needed to go to a framework like CI.  So I just set up a new site and I'm setting up the basic functionality but one of the important things about my site is the URLS.  Here's an example:


So if you use this URL, and you click on the Head slot and pick an item, the URL will reload to something like this:


The reason for this is I want people to be able to build a unit, and then copy and paste the URL to share with other people.

I accomplished this by doing this in the .htaccess

RewriteEngine On

RewriteCond %{REQUEST_URI} !^/assets
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f

RewriteRule ^(\w+)$ ./index.php?$1

Now moving to CI, I'm a bit at a loss as how to accomplish the same thing.  I've tinkered around with trying to use the same regex in the routes file but I'm not having a whole lot of luck.  Everything I try just results in a 404.

Any advice or guidance would be appreciated.

  google map issue
Posted by: niki - 11-21-2017, 08:26 AM - Forum: General Help - No Replies

Hi ,I have attached library google map v3 API and now i need to fetch Latitude and longitude from database which I have calculated and which should display by serial  Every time dynamically.I used marker but it's not displaying .Does anyone can help me to solve this problem?
function Googlemaps($serial)
        // Load the library
            $config['minifyJS'] = TRUE;
            //$config['center_lat_long']= '030.259565,-81.61062';//30.25953,-81.611
        // Initialize our map. Here you can also pass in additional parameters for customising the map

            foreach($coords as $coordinate)
                $lat1=$coordinate->cycle_19_INT.(substr($coordinate->cycle_20_INT, 0, 2)+(substr($coordinate->cycle_20_INT, 2).".".$coordinate->cycle_21_INT)/60);
                $lat2=str_replace($coordinate->cycle_22_INT,'-',$coordinate->cycle_22_INT).(substr($coordinate->cycle_23_INT, 0, 2)+substr((substr($coordinate->cycle_23_INT, 2).".".$coordinate->cycle_24_INT)/60,0,7));                

        // Create the map
            $this->data['map'] = $this->googlemaps->create_map();            
        // Load our view, passing the map data that has just been created
            $this->load->view('dashboard/dashboard_googlemap_view', $this->data);

function googlemaps($serial)
            foreach($query->result() as $row)
        return $return;    

<?php echo $map['javascript'];?>      <?php echo $map['mapdiv']; ?>

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.