Archive for the ‘Codeigniter’ Category

Drag and Drop Shopping Cart Using ExtJS and CodeIgniter Cart

August 21st, 2010   by  aditia rahman

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

Posted in Codeigniter Extjs5 Comments

Understanding CodeIgniter Cart Class

August 4th, 2010   by  aditia rahman

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.

Posted in Codeigniter2 Comments
Tags:

Cropping Image To Square Dimension With CodeIgniter

July 14th, 2010   by  aditia rahman

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.

Posted in Codeigniter1 Comment

CRUD using CodeIgniter and EXTJS Grid – Part 3

July 13th, 2010   by  aditia rahman

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.

Posted in Codeigniter Extjs19 Comments
Tags:

CRUD using CodeIgniter and EXTJS Grid – Part 2

July 12th, 2010   by  aditia rahman

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).

Posted in Codeigniter Extjs2 Comments
Tags:

CRUD using CodeIgniter and EXTJS Grid – Part 1

July 10th, 2010   by  aditia rahman

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.

Posted in Codeigniter ExtjsNo Comments
Tags:

Basic Image Gallery With CodeIgniter

June 27th, 2010   by  aditia rahman

CodeIgniter is quite mature framework to creating web application, the built in libraries and helper very helpful to creating most feature in web application, this post I want to create very basic image gallery using CodeIgniter, the the built in libraries that I used are File Uploading, Image Manipulation and Pagination, whereas the used helper is URL Helper, and here’s we go

First open the config.php in folder system/application/config/ and set the CodeIgniter base_url

$config['base_url'] = "http://localhost/ci_gallery/";

Next load the URL Helper in autoload.php in the same folder as above file

$autoload['helper'] = array('url');

Now create the image controller in file image.php inside folder system/application/controller and add this attribute inside the image class

private $data = array(
    'dir' => array(
        'original' => 'assets/uploads/original/',
        'thumb' => 'assets/uploads/thumbs/'
    ),
    'total' => 0,
    'images' => array(),
    'error' => ''
);

Posted in Codeigniter PHP1 Comment
Tags:

Creating Register and Login Form Using EXTJS and CodeIgniter

June 2nd, 2010   by  aditia rahman

Like another tutorial this post will create the basic form login and register using Extjs and Codeigniter, and I want to mix my previous post about Codeigniter Session Library, Extjs Unique Field Validation and using Statusbar in Extjs Window.

1. Setting up the database

Using phpmyadmin in XAMPP I create the database named “ci_extjs_login”, and create simple “users” table, here below is the sql code that I generated from phpmyadmin, for more advance database modelling you can use mysql workbench.

CREATE TABLE  `ci_extjs_login`.`users` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`username` VARCHAR( 100 ) NOT NULL ,
`password` VARCHAR( 100 ) NOT NULL ,
`email` VARCHAR( 100 ) NOT NULL
) ENGINE = MYISAM ;

CMS List based on CodeIgniter

April 29th, 2010   by  aditia rahman

Codeigniter recently is my favorite PHP framework, it’s has really small learning curve to get move on, here list of content management system built on codeigniter, hope this useful whether you want to use it for your simple site or you can learn more about codeigniter by exploring the code. Personally I explore it to knowing how people write code in codeigniter.

Posted in CMS Codeigniter5 Comments
Tags:

Creating user session checking with CodeIgniter library

April 17th, 2010   by  aditia rahman

When we build web application with user authentification, the application must have user login/logout or signin/signout or whatever you called it, then the system must have user logged feature to check whether the user is logged in or logged out. Session is the most common way to checking it. In Codeigniter, using Session Class you can use simple function inside controller, it’s something like this:

class User extends Controller {

	// constructor class
	function __construct()
	{
		parent::Controller();
		$this->load->library('session');
	}

	function index()
	{
		$this->load->view('user/index');
	}

	function login()
	{
		// if user already logged in, redirect to user index
		if ($this->_is_logged_in())
		{
			redirect('user/index');
		}
		else
		{
			$this->load->view('user/login');
		}
	}

	function register()
	{
		// if user already logged in, redirect to user index
		if ($this->_is_logged_in())
		{
			redirect('user/index');
		}
		else
		{
			$this->load->view('user/register');
		}
	}

	// checking user logged user by registered session
	function _is_logged_in()
	{
		$logged = $this->session->userdata('user_id');
		if ($logged)
		{
			return TRUE;
		}
		else
		{
			return FALSE;
		}
	}
}

Posted in Codeigniter PHP3 Comments