Posts In "Codeigniter"

Simple Ajax Pagination With JQuery and Codeigniter

November 22nd, 2011 by aditia rahman / 2 Comments  

     

Codeigniter pagination class is really useful for me, it help to cut the repetitive task when we are creating pagination with large data, today I want to share a little of my thought, using codeigniter pagination class with ajax jquery. Here I show with a simple codeigniter code.  This post only show the code example, cause i don’t think it necessary to provide a downloadable code.

codeigniter ajax pagination jquery

Controller

Here are the controller, to make it easier the data in this example using a static array variable, so it very easy for us to get the data by the array index, and we need to load the url helper and of course the pagination library.

Codeigniter Layout Library For Autoload Frequently Used Views

May 2nd, 2011 by aditia rahman / 11 Comments  

     

I came up with idea how to automatically load most used layout in Codeigniter, basically I came from CakePHP that automated all default layout, in this case we can call it views part of MVC, when creating codeingniter application usually I follow the documentation when load some views from controller, something like this code

$data['page_title'] = 'Your title';
$this->load->view('header');
$this->load->view('menu');
$this->load->view('content', $data);
$this->load->view('footer');

Or the worse before this sometimes I include the header and footer directly on the view file, well these method really wasting time, an make the code on the views not really well organized.

[Opinion] Why PHP Developers Choose CodeIgniter

March 28th, 2011 by aditia rahman / 11 Comments  

     

Codeigniter is one of the most popular php framework out there, that have been used by many php developers around the world. This post is just my own opinion from my technical experience while using codeigniter. This graphic below is taken from google trends to compare codeigniter search popularity, than any other popular php framework.

codeigniter, cakephp, zend framework, symfony google trend

The first php framework I use is cakephp, it has a lot more features than codeigniter, very detail documentation too, for the first time it will take some time to understanding, exploring the features and find some other reference online.

Extjs: Simple User Managament Using Codeigniter

December 9th, 2010 by aditia rahman / 12 Comments  

     

Hello again this is another post of ExtJS, this post is to showing my little idea how to manage user permission in ExtJS component, In this post I not showing the full source code, just a little part of the code to get the idea how it works, however the complete source code still available on the download link at the end of this post.

This example is a simple user management that user can manipulate other user data and users groups, user need to logged in to the system to do some action, and the feature are:

- Add, Update, Delete Users
- Add, Update, Delete Groups
- Administrator cannot be deleted or updated

Which mean it will take different action button in the application screen, depend on the users groups, what is not handled in this example is user restriction, if a group have granted to modify certain user, it can modify whole user although it is the administrator.

The image is the file structure that I have created on this example, there will be a form and two grid panel in this application, a usual login form with label and textfield, a grid contain user data with the toolbar menu and a grid contain group data.

In the database we need to make a relation between user and groups and here the sql code that I created, for both groups and users table

Drag and Drop Shopping Cart Using ExtJS and CodeIgniter Cart

August 21st, 2010 by aditia rahman / 9 Comments  

     

This is my other post about simple usage of ExtJS with CodeIgniter, this time I want to create a simple drag and drop shopping cart, I have learn about how to use the cart class in CodeIgniter that I have posted in the previous post, i’m using MySQL for the storing the product data. I prepared the mockup it something like this

Understanding CodeIgniter Cart Class

August 4th, 2010 by aditia rahman / 1 Comment  

     

CodeIgniter Cart ClassCart is one of the most important feature when creating an online store. In this post I want to have more understanding about Cart Class in CodeIgniter, cause maybe come in handy in the future, you can see how many new online store out there open in business, and in this internet age, online store seems the must have for many people who have retail business, in this post I’m not writing about how to use it in some example, the code I posted in here just copying from the original cart class documentation, but i’m included the link to the example usage of this class on the section 4 below.

Cropping Image To Square Dimension With CodeIgniter

July 14th, 2010 by aditia rahman / 8 Comments  

     

I’ve posted similar article before but this time I want to do it with codeigniter, codeigniter have a powerful image manipulation class, in this post I will use it to make thumbnail square from image, let get directly to the code. I make the function inside the controller, this code is cropping image that already located on the server so the image path (not URL) have to be defined.

CRUD using CodeIgniter and EXTJS Grid – Part 3

July 13th, 2010 by aditia rahman / 37 Comments  

     

This is the final post of the series CodeIgniter and Extjs CRUD, if you want to read the previous posts, here the first part and the second part of this post. Basically we already finish all the crud feature on the second part this only another common feature to add in the application, so we will add a quick search field on the grid, and what you need is the search grid plugin, I’m using the extjs example search field plugin from this extjs grid tutorial, you can download the complete code and find this file searchfield.js and put it your desire folder, in this post i put on the “assets/js/ext/plugins/” folder. Now all you have to do just include the js file in the view file and change the controller method.

CRUD using CodeIgniter and EXTJS Grid – Part 2

July 12th, 2010 by aditia rahman / 26 Comments  

     

This post is continuation of the part 1, in part 1 we already created the Extjs grid with pagination and load the store grid from the database, in this part we will add the save, edit and delete feature to that grid, and for make it easier it will use the editor grid.

First Edit The View ( in “application/views/user/index.php” )

We will use the editorGrid, one of them should be editable on the combobox field and the value is fetched from the database, so we create country store component and set like the code below (in this step we haven’t created the method to get all countries. it described in the controller section).

CRUD using CodeIgniter and EXTJS Grid – Part 1

July 10th, 2010 by aditia rahman / 21 Comments  

     

In this post I want to share how to create simple CRUD (create, read, update, delete) using codeigniter ExtJS editor grid. In this first part, we will setup the database schema, codeigniter and extjs. I limited this first part, only setup fetching data from database and pagination grid in extjs grid.

1. Create Database Schema

The table that we will use is two tables with “has one” relationship, namely users table with foreign key country_id and countries table that store all the countries data, so when we want to know the country name from the users we have to get from the countries table, and here the sql for creating the table.