<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog :: Outsource to Asia &#124; Philippine Web Design &#124; Philippine Web Development &#124; Philippine Ecommerce Solutions &#124; CMS  &#124; SEO Philippines &#124; Realestate Website &#124; Online Booking System &#124; Mashups Web 2.0 &#187; CMS/Framework</title>
	<atom:link href="http://blog.mashupsdev.com/category/cmsframework/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mashupsdev.com</link>
	<description></description>
	<lastBuildDate>Thu, 24 Dec 2009 06:45:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Magento Commerce: How to change configuration</title>
		<link>http://blog.mashupsdev.com/magento-commerce-how-to-change-configuration/</link>
		<comments>http://blog.mashupsdev.com/magento-commerce-how-to-change-configuration/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 02:31:15 +0000</pubDate>
		<dc:creator>Jdam</dc:creator>
				<category><![CDATA[CMS/Framework]]></category>
		<category><![CDATA[Code Labs]]></category>

		<guid isPermaLink="false">http://blog.mashupsdev.com/?p=27</guid>
		<description><![CDATA[Mostly new user to magento commerce encounter problem on migration or switching to new database. 
Here is some tips how to avoid that:
1. Always backup your database.
2. Make sure you know what your doing. Consult to Magento forums if needed.
3. Go to  app/etc/local.xml, look for this code


&#60;connection&#62;
    &#60;host&#62;&#60;![CDATA[localhost]]&#62;&#60;/host&#62;
    [...]]]></description>
			<content:encoded><![CDATA[<p>Mostly new user to magento commerce encounter problem on migration or switching to new database. </p>
<p>Here is some tips how to avoid that:<br />
1. Always backup your database.<br />
2. Make sure you know what your doing. Consult to Magento forums if needed.<br />
3. Go to  app/etc/local.xml, look for this code<br />
<span id="more-27"></span></p>
<pre class="brush: plain;">
&lt;connection&gt;
    &lt;host&gt;&lt;![CDATA[localhost]]&gt;&lt;/host&gt;
    &lt;username&gt;&lt;![CDATA[root]]&gt;&lt;/username&gt;
    &lt;password&gt;&lt;![CDATA[password_here]]&gt;&lt;/password&gt;
    &lt;dbname&gt;&lt;![CDATA[your_database_here]]&gt;&lt;/dbname&gt;
    &lt;active&gt;1&lt;/active&gt;
&lt;/connection&gt;
</pre>
<p>          &#8211; You can now update your own database settings.<br />
4.  Final thing to do is clear or delete magento’s cache files from the directory: var/cache.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.mashupsdev.com%2Fmagento-commerce-how-to-change-configuration%2F&amp;linkname=Magento%20Commerce%3A%20How%20to%20change%20configuration"><img src="http://blog.mashupsdev.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://blog.mashupsdev.com/magento-commerce-how-to-change-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Codeigniter: Get the last row of table</title>
		<link>http://blog.mashupsdev.com/codeigniter-get-the-last-row-of-table/</link>
		<comments>http://blog.mashupsdev.com/codeigniter-get-the-last-row-of-table/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 02:30:06 +0000</pubDate>
		<dc:creator>center</dc:creator>
				<category><![CDATA[CMS/Framework]]></category>
		<category><![CDATA[Code Labs]]></category>

		<guid isPermaLink="false">http://blog.mashupsdev.com/?p=23</guid>
		<description><![CDATA[
         // you can use the where clause
         $this-&#62;db-&#62;where('field1', 'string');
         $query = $this-&#62;db-&#62;get('tabledb');
         // Returns the &#34;last&#34; row
      [...]]]></description>
			<content:encoded><![CDATA[<pre class="brush: php;">
         // you can use the where clause
         $this-&gt;db-&gt;where('field1', 'string');
         $query = $this-&gt;db-&gt;get('tabledb');
         // Returns the &quot;last&quot; row
         $last = $query-&gt;last_row('array');
         // retrieve last inserted id from table
         $last_id = $last['id'];
</pre>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.mashupsdev.com%2Fcodeigniter-get-the-last-row-of-table%2F&amp;linkname=Codeigniter%3A%20Get%20the%20last%20row%20of%20table"><img src="http://blog.mashupsdev.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://blog.mashupsdev.com/codeigniter-get-the-last-row-of-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pagination Class &#8211;  Codeigniter</title>
		<link>http://blog.mashupsdev.com/pagination-class-codeigniter/</link>
		<comments>http://blog.mashupsdev.com/pagination-class-codeigniter/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 02:27:15 +0000</pubDate>
		<dc:creator>center</dc:creator>
				<category><![CDATA[CMS/Framework]]></category>
		<category><![CDATA[Code Labs]]></category>

		<guid isPermaLink="false">http://blog.mashupsdev.com/pagination-class-codeigniter/</guid>
		<description><![CDATA[Hello everyone!
	CodeIgniter&#8217;s Pagination class is very easy to use. I set up following code.
Create this file Pagination.php in the system/libraries/Pagination.php folder

system/libraries/Pagination.php
&#60;?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * CodeIgniter
 *
 * An open source application development framework for PHP 4.3.2 or newer
 *
 * @package		CodeIgniter
 * @author		ExpressionEngine Dev Team
 * @copyright	Copyright [...]]]></description>
			<content:encoded><![CDATA[<p>Hello everyone!<br />
	CodeIgniter&#8217;s Pagination class is very easy to use. I set up following code.</p>
<p>Create this file Pagination.php in the system/libraries/Pagination.php folder<br />
<span id="more-17"></span><br />
system/libraries/Pagination.php</p>
<pre class="brush: php;">&lt;?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * CodeIgniter
 *
 * An open source application development framework for PHP 4.3.2 or newer
 *
 * @package		CodeIgniter
 * @author		ExpressionEngine Dev Team
 * @copyright	Copyright (c) 2006, EllisLab, Inc.
 * @license		http://codeigniter.com/user_guide/license.html
 * @link		http://codeigniter.com
 * @since		Version 1.0
 * @filesource
 */ 

// ------------------------------------------------------------------------ 

/**
 * Pagination Class
 *
 * @package		CodeIgniter
 * @subpackage	Libraries
 * @category	Pagination
 * @author		ExpressionEngine Dev Team
 * @link		http://codeigniter.com/user_guide/libraries/pagination.html
 */
class CI_Pagination { 

	var $base_url			= ''; // The page we are linking to
	var $total_rows  		= ''; // Total number of items (database results)
	var $per_page	 		= 10; // Max number of items you want shown per page
	var $num_links			=  2; // Number of &quot;digit&quot; links to show before/after the currently viewed page
	var $cur_page	 		=  0; // The current page being viewed
	var $first_link   		= '&amp;lsaquo; Start';
	var $next_link			= '&amp;gt;';
	var $prev_link			= '&amp;lt;';
	var $last_link			= 'End &amp;rsaquo;';
	var $uri_segment		= 3;
	var $full_tag_open		= '';
	var $full_tag_close		= '';
	var $first_tag_open		= '';
	var $first_tag_close	= '&amp;nbsp;';
	var $last_tag_open		= '&amp;nbsp;';
	var $last_tag_close		= '';
	var $cur_tag_open		= '&amp;nbsp;&lt;b&gt;';
	var $cur_tag_close		= '&lt;/b&gt;';
	var $next_tag_open		= '&amp;nbsp;';
	var $next_tag_close		= '&amp;nbsp;';
	var $prev_tag_open		= '&amp;nbsp;';
	var $prev_tag_close		= '';
	var $num_tag_open		= '&amp;nbsp;';
	var $num_tag_close		= '';
	var $page_query_string	= FALSE;
	var $query_string_segment = 'per_page'; 

	/**
	 * Constructor
	 *
	 * @access	public
	 * @param	array	initialization parameters
	 */
	function CI_Pagination($params = array())
	{
		if (count($params) &gt; 0)
		{
			$this-&gt;initialize($params);
		} 

		log_message('debug', &quot;Pagination Class Initialized&quot;);
	} 

	// -------------------------------------------------------------------- 

	/**
	 * Initialize Preferences
	 *
	 * @access	public
	 * @param	array	initialization parameters
	 * @return	void
	 */
	function initialize($params = array())
	{
		if (count($params) &gt; 0)
		{
			foreach ($params as $key =&gt; $val)
			{
				if (isset($this-&gt;$key))
				{
					$this-&gt;$key = $val;
				}
			}
		}
	} 

	// -------------------------------------------------------------------- 

	/**
	 * Generate the pagination links
	 *
	 * @access	public
	 * @return	string
	 */	 

	 	function create_links()
	{
		// If our item count or per-page total is zero there is no need to continue.
		if ($this-&gt;total_rows == 0 OR $this-&gt;per_page == 0)
		{
		   return '';
		} 

		// Calculate the total number of pages
		$num_pages = ceil($this-&gt;total_rows / $this-&gt;per_page); 

		// Is there only one page? Hm... nothing more to do here then.
		if ($num_pages == 1)
		{
			return '';
		} 

		// Determine the current page number.
		$CI =&amp; get_instance();	 

		if ($CI-&gt;config-&gt;item('enable_query_strings') === TRUE OR $this-&gt;page_query_string === TRUE)
		{
			if ($CI-&gt;input-&gt;get($this-&gt;query_string_segment) != 0)
			{
				$this-&gt;cur_page = $CI-&gt;input-&gt;get($this-&gt;query_string_segment); 

				// Prep the current page - no funny business!
				$this-&gt;cur_page = (int) $this-&gt;cur_page;
			}
		}
		else
		{
			if ($CI-&gt;uri-&gt;segment($this-&gt;uri_segment) != 0)
			{
				$this-&gt;cur_page = $CI-&gt;uri-&gt;segment($this-&gt;uri_segment); 

				// Prep the current page - no funny business!
				$this-&gt;cur_page = (int) $this-&gt;cur_page;
			}
		} 

		$this-&gt;num_links = (int)$this-&gt;num_links; 

		if ($this-&gt;num_links &lt; 1)
		{
			show_error('Your number of links must be a positive number.');
		} 

		if ( ! is_numeric($this-&gt;cur_page))
		{
			$this-&gt;cur_page = 0;
		} 

		// Is the page number beyond the result range?
		// If so we show the last page
		if ($this-&gt;cur_page &gt; $this-&gt;total_rows)
		{
			$this-&gt;cur_page = ($num_pages - 1) * $this-&gt;per_page;
		} 

		$uri_page_number = $this-&gt;cur_page;
		$this-&gt;cur_page = floor(($this-&gt;cur_page/$this-&gt;per_page) + 1); 

		// Calculate the start and end numbers. These determine
		// which number to start and end the digit links with
		$start = (($this-&gt;cur_page - $this-&gt;num_links) &gt; 0) ? $this-&gt;cur_page - ($this-&gt;num_links - 1) : 1;
		$end   = (($this-&gt;cur_page + $this-&gt;num_links) &lt; $num_pages) ? $this-&gt;cur_page + $this-&gt;num_links : $num_pages; 

		// Is pagination being used over GET or POST?  If get, add a per_page query
		// string. If post, add a trailing slash to the base URL if needed
		if ($CI-&gt;config-&gt;item('enable_query_strings') === TRUE OR $this-&gt;page_query_string === TRUE)
		{
			$this-&gt;base_url = rtrim($this-&gt;base_url).AMP.$this-&gt;query_string_segment.'=';
		}
		else
		{
			$this-&gt;base_url = rtrim($this-&gt;base_url, '/') .'/';
		} 

  		// And here we go...
		$output = ''; 

		// Render the &quot;First&quot; link
		if  ($this-&gt;cur_page &gt; $this-&gt;num_links)
		{
			$output .= $this-&gt;first_tag_open.'&lt;a href=&quot;'.$this-&gt;base_url.'&quot;&gt;'.$this-&gt;first_link.'&lt;/a&gt;'.$this-&gt;first_tag_close;
		} 

		// Render the &quot;previous&quot; link
		if  ($this-&gt;cur_page != 1)
		{
			$i = $uri_page_number - $this-&gt;per_page;
			if ($i == 0) $i = '';
			$output .= $this-&gt;prev_tag_open.'&lt;a href=&quot;'.$this-&gt;base_url.$i.'&quot;&gt;'.$this-&gt;prev_link.'&lt;/a&gt;'.$this-&gt;prev_tag_close;
		} 

		// Write the digit links
		for ($loop = $start -1; $loop &lt;= $end; $loop++)
		{
			$i = ($loop * $this-&gt;per_page) - $this-&gt;per_page; 

			if ($i &gt;= 0)
			{
				if ($this-&gt;cur_page == $loop)
				{
					$output .= $this-&gt;cur_tag_open.$loop.$this-&gt;cur_tag_close; // Current page
				}
				else
				{
					$n = ($i == 0) ? '' : $i;
					$output .= $this-&gt;num_tag_open.'&lt;a href=&quot;'.$this-&gt;base_url.$n.'&quot;&gt;'.$loop.'&lt;/a&gt;'.$this-&gt;num_tag_close;
				}
			}
		} 

		// Render the &quot;next&quot; link
		if ($this-&gt;cur_page &lt; $num_pages)
		{
			$output .= $this-&gt;next_tag_open.'&lt;a href=&quot;'.$this-&gt;base_url.($this-&gt;cur_page * $this-&gt;per_page).'&quot;&gt;'.$this-&gt;next_link.'&lt;/a&gt;'.$this-&gt;next_tag_close;
		} 

		// Render the &quot;Last&quot; link
		if (($this-&gt;cur_page + $this-&gt;num_links) &lt; $num_pages)
		{
			$i = (($num_pages * $this-&gt;per_page) - $this-&gt;per_page);
			$output .= $this-&gt;last_tag_open.'&lt;a href=&quot;'.$this-&gt;base_url.$i.'&quot;&gt;'.$this-&gt;last_link.'&lt;/a&gt;'.$this-&gt;last_tag_close;
		} 

		// Kill double slashes.  Note: Sometimes we can end up with a double slash
		// in the penultimate link so we'll kill all double slashes.
		$output = preg_replace(&quot;#([^:])//+#&quot;, &quot;\\1/&quot;, $output); 

		// Add the wrapper HTML if exists
		$output = $this-&gt;full_tag_open.$output.$this-&gt;full_tag_close; 

		return $output;
	} 

	function create_links_left()
	{
		// If our item count or per-page total is zero there is no need to continue.
		if ($this-&gt;total_rows == 0 OR $this-&gt;per_page == 0)
		{
		   return '';
		} 

		// Calculate the total number of pages
		$num_pages = ceil($this-&gt;total_rows / $this-&gt;per_page); 

		// Is there only one page? Hm... nothing more to do here then.
		if ($num_pages == 1)
		{
			return '';
		} 

		// Determine the current page number.
		$CI =&amp; get_instance();	 

		if ($CI-&gt;config-&gt;item('enable_query_strings') === TRUE OR $this-&gt;page_query_string === TRUE)
		{
			if ($CI-&gt;input-&gt;get($this-&gt;query_string_segment) != 0)
			{
				$this-&gt;cur_page = $CI-&gt;input-&gt;get($this-&gt;query_string_segment); 

				// Prep the current page - no funny business!
				$this-&gt;cur_page = (int) $this-&gt;cur_page;
			}
		}
		else
		{
			if ($CI-&gt;uri-&gt;segment($this-&gt;uri_segment) != 0)
			{
				$this-&gt;cur_page = $CI-&gt;uri-&gt;segment($this-&gt;uri_segment); 

				// Prep the current page - no funny business!
				$this-&gt;cur_page = (int) $this-&gt;cur_page;
			}
		} 

		$this-&gt;num_links = (int)$this-&gt;num_links; 

		if ($this-&gt;num_links &lt; 1)
		{
			show_error('Your number of links must be a positive number.');
		} 

		if ( ! is_numeric($this-&gt;cur_page))
		{
			$this-&gt;cur_page = 0;
		} 

		// Is the page number beyond the result range?
		// If so we show the last page
		if ($this-&gt;cur_page &gt; $this-&gt;total_rows)
		{
			$this-&gt;cur_page = ($num_pages - 1) * $this-&gt;per_page;
		} 

		$uri_page_number = $this-&gt;cur_page;
		$this-&gt;cur_page = floor(($this-&gt;cur_page/$this-&gt;per_page) + 1); 

		// Calculate the start and end numbers. These determine
		// which number to start and end the digit links with
		$start = (($this-&gt;cur_page - $this-&gt;num_links) &gt; 0) ? $this-&gt;cur_page - ($this-&gt;num_links - 1) : 1;
		$end   = (($this-&gt;cur_page + $this-&gt;num_links) &lt; $num_pages) ? $this-&gt;cur_page + $this-&gt;num_links : $num_pages; 

		// Is pagination being used over GET or POST?  If get, add a per_page query
		// string. If post, add a trailing slash to the base URL if needed
		if ($CI-&gt;config-&gt;item('enable_query_strings') === TRUE OR $this-&gt;page_query_string === TRUE)
		{
			$this-&gt;base_url = rtrim($this-&gt;base_url).AMP.$this-&gt;query_string_segment.'=';
		}
		else
		{
			$this-&gt;base_url = rtrim($this-&gt;base_url, '/') .'/';
		} 

  		// And here we go...
		$output = ''; 

		// Render the &quot;First&quot; link
		if  ($this-&gt;cur_page &gt; $this-&gt;num_links)
		{
			$output .= $this-&gt;first_tag_open.'&lt;a href=&quot;'.$this-&gt;base_url.'&quot;&gt;'.$this-&gt;first_link.'&lt;/a&gt;'.$this-&gt;first_tag_close;
		} 

		// Render the &quot;previous&quot; link
		if  ($this-&gt;cur_page != 1)
		{
			$i = $uri_page_number - $this-&gt;per_page;
			if ($i == 0) $i = '';
			$output .= $this-&gt;prev_tag_open.'&lt;a href=&quot;'.$this-&gt;base_url.$i.'&quot;&gt;'.$this-&gt;prev_link.'&lt;/a&gt;'.$this-&gt;prev_tag_close;
		} 

		// Write the digit links
		for ($loop = $start -1; $loop &lt;= $end; $loop++)
		{
			$i = ($loop * $this-&gt;per_page) - $this-&gt;per_page; 

			if ($i &gt;= 0)
			{
				if ($this-&gt;cur_page == $loop)
				{
					$output .= $this-&gt;cur_tag_open.$loop.$this-&gt;cur_tag_close; // Current page
				}
				else
				{
					$n = ($i == 0) ? '' : $i;
					$output .= $this-&gt;num_tag_open.'&lt;a href=&quot;'.$this-&gt;base_url.$n.'&quot;&gt;'.$loop.'&lt;/a&gt;'.$this-&gt;num_tag_close;
				}
			}
		} 

		// Render the &quot;next&quot; link
		if ($this-&gt;cur_page &lt; $num_pages)
		{
			$output .= $this-&gt;next_tag_open.'&lt;a href=&quot;'.$this-&gt;base_url.($this-&gt;cur_page * $this-&gt;per_page).'&quot;&gt;'.$this-&gt;next_link.'&lt;/a&gt;'.$this-&gt;next_tag_close;
		} 

		// Render the &quot;Last&quot; link
		if (($this-&gt;cur_page + $this-&gt;num_links) &lt; $num_pages)
		{
			$i = (($num_pages * $this-&gt;per_page) - $this-&gt;per_page);
			$output .= $this-&gt;last_tag_open.'&lt;a href=&quot;'.$this-&gt;base_url.$i.'&quot;&gt;'.$this-&gt;last_link.'&lt;/a&gt;'.$this-&gt;last_tag_close;
		} 

		// Kill double slashes.  Note: Sometimes we can end up with a double slash
		// in the penultimate link so we'll kill all double slashes.
		$output = preg_replace(&quot;#([^:])//+#&quot;, &quot;\\1/&quot;, $output); 

		// Add the wrapper HTML if exists
		$output = $this-&gt;full_tag_open.$output.$this-&gt;full_tag_close; 

		return $output;
	} 

		function create_links_right()
	{
		// If our item count or per-page total is zero there is no need to continue.
		if ($this-&gt;total_rows == 0 OR $this-&gt;per_page == 0)
		{
		   return '';
		} 

		// Calculate the total number of pages
		$num_pages = ceil($this-&gt;total_rows / $this-&gt;per_page); 

		// Is there only one page? Hm... nothing more to do here then.
		if ($num_pages == 1)
		{
			return '';
		} 

		// Determine the current page number.
		$CI =&amp; get_instance();	 

		if ($CI-&gt;config-&gt;item('enable_query_strings') === TRUE OR $this-&gt;page_query_string === TRUE)
		{
			if ($CI-&gt;input-&gt;get($this-&gt;query_string_segment) != 0)
			{
				$this-&gt;cur_page = $CI-&gt;input-&gt;get($this-&gt;query_string_segment); 

				// Prep the current page - no funny business!
				$this-&gt;cur_page = (int) $this-&gt;cur_page;
			}
		}
		else
		{
			if ($CI-&gt;uri-&gt;segment($this-&gt;uri_segment) != 0)
			{
				$this-&gt;cur_page = $CI-&gt;uri-&gt;segment($this-&gt;uri_segment); 

				// Prep the current page - no funny business!
				$this-&gt;cur_page = (int) $this-&gt;cur_page;
			}
		} 

		$this-&gt;num_links = (int)$this-&gt;num_links; 

		if ($this-&gt;num_links &lt; 1)
		{
			show_error('Your number of links must be a positive number.');
		} 

		if ( ! is_numeric($this-&gt;cur_page))
		{
			$this-&gt;cur_page = 0;
		} 

		// Is the page number beyond the result range?
		// If so we show the last page
		if ($this-&gt;cur_page &gt; $this-&gt;total_rows)
		{
			$this-&gt;cur_page = ($num_pages - 1) * $this-&gt;per_page;
		} 

		$uri_page_number = $this-&gt;cur_page;
		$this-&gt;cur_page = floor(($this-&gt;cur_page/$this-&gt;per_page) + 1); 

		// Calculate the start and end numbers. These determine
		// which number to start and end the digit links with
		$start = (($this-&gt;cur_page - $this-&gt;num_links) &gt; 0) ? $this-&gt;cur_page - ($this-&gt;num_links - 1) : 1;
		$end   = (($this-&gt;cur_page + $this-&gt;num_links) &lt; $num_pages) ? $this-&gt;cur_page + $this-&gt;num_links : $num_pages; 

		// Is pagination being used over GET or POST?  If get, add a per_page query
		// string. If post, add a trailing slash to the base URL if needed
		if ($CI-&gt;config-&gt;item('enable_query_strings') === TRUE OR $this-&gt;page_query_string === TRUE)
		{
			$this-&gt;base_url = rtrim($this-&gt;base_url).AMP.$this-&gt;query_string_segment.'=';
		}
		else
		{
			$this-&gt;base_url = rtrim($this-&gt;base_url, '/') .'/';
		} 

  		// And here we go...
		$output = ''; 

		// Render the &quot;First&quot; link
		if  ($this-&gt;cur_page &gt; $this-&gt;num_links)
		{
			$output .= $this-&gt;first_tag_open.'&lt;a href=&quot;'.$this-&gt;base_url.'&quot;&gt;'.$this-&gt;first_link.'&lt;/a&gt;'.$this-&gt;first_tag_close;
		} 

		// Render the &quot;previous&quot; link
		if  ($this-&gt;cur_page != 1)
		{
			$i = $uri_page_number - $this-&gt;per_page;
			if ($i == 0) $i = '';
			$output .= $this-&gt;prev_tag_open.'&lt;a href=&quot;'.$this-&gt;base_url.$i.'&quot;&gt;'.$this-&gt;prev_link.'&lt;/a&gt;'.$this-&gt;prev_tag_close;
		} 

		// Write the digit links
		for ($loop = $start -1; $loop &lt;= $end; $loop++)
		{
			$i = ($loop * $this-&gt;per_page) - $this-&gt;per_page; 

			if ($i &gt;= 0)
			{
				if ($this-&gt;cur_page == $loop)
				{
					$output .= $this-&gt;cur_tag_open.$loop.$this-&gt;cur_tag_close; // Current page
				}
				else
				{
					$n = ($i == 0) ? '' : $i;
					$output .= $this-&gt;num_tag_open.'&lt;a href=&quot;'.$this-&gt;base_url.$n.'&quot;&gt;'.$loop.'&lt;/a&gt;'.$this-&gt;num_tag_close;
				}
			}
		} 

		// Render the &quot;next&quot; link
		if ($this-&gt;cur_page &lt; $num_pages)
		{
			$output .= $this-&gt;next_tag_open.'&lt;a href=&quot;'.$this-&gt;base_url.($this-&gt;cur_page * $this-&gt;per_page).'&quot;&gt;'.$this-&gt;next_link.'&lt;/a&gt;'.$this-&gt;next_tag_close;
		} 

		// Render the &quot;Last&quot; link
		if (($this-&gt;cur_page + $this-&gt;num_links) &lt; $num_pages)
		{
			$i = (($num_pages * $this-&gt;per_page) - $this-&gt;per_page);
			$output .= $this-&gt;last_tag_open.'&lt;a href=&quot;'.$this-&gt;base_url.$i.'&quot;&gt;'.$this-&gt;last_link.'&lt;/a&gt;'.$this-&gt;last_tag_close;
		} 

		// Kill double slashes.  Note: Sometimes we can end up with a double slash
		// in the penultimate link so we'll kill all double slashes.
		$output = preg_replace(&quot;#([^:])//+#&quot;, &quot;\\1/&quot;, $output); 

		// Add the wrapper HTML if exists
		$output = $this-&gt;full_tag_open.$output.$this-&gt;full_tag_close; 

		return $output;
	} 

}
// END Pagination Class 

/* End of file Pagination.php */
/* Location: ./system/libraries/Pagination.php */
</pre>
<p>&nbsp;</p>
<p>Here’s the controller:</p>
<pre class="brush: php;">function index()
    {
   		//load model class
		 $this-&gt;load-&gt;model('mdl_tests', 'tests');

   		//load pagination class

		$this-&gt;load-&gt;library('pagination');

		//The $config array contains your configuration variables.

		$config['base_url'] = base_url().'tests/index/';
		$config['total_rows'] = $this-&gt;db-&gt;count_all('ms_tests');

		$config['per_page'] = '10';
		//The number of items you intend to show per page. In the above example, you would be showing 10 items per page.

		$config['full_tag_open'] = '&lt;p align=&quot;center&quot;&gt;';
		$config['full_tag_close'] = '&lt;/p&gt;';

		$config['first_link'] = 'First';
		$config['last_link'] = 'Last';

	           $config['next_link'] = '&amp;nbsp;&amp;nbsp; NEXT 4 ISSUE &gt;&gt;';
	           $config['prev_link'] = '&lt;&lt; PREVIOUS 4 ISSUE &amp;nbsp; &amp;nbsp;';  

	           $config['num_tag_open'] = '&lt;span&gt;&amp;nbsp;&lt;u&gt;';
       	           $config['num_tag_close'] = '&lt;/u&gt;&amp;nbsp;&lt;/span&gt;'; 

	           $this-&gt;pagination-&gt;initialize($config);

	           $this-&gt;data['pagination'] = $this-&gt;pagination-&gt;create_links();
                       $this-&gt;data['results'] = $this-&gt;tests-&gt;get_tests_issue($config['per_page'],$this-&gt;uri-&gt;segment(3));

                       $this-&gt;load-&gt;view('pagination_sample', $this-&gt;data);

    }
</pre>
<p>&nbsp;</p>
<p>Here’s the model:</p>
<pre class="brush: php;">
	function get_tests_issue($num, $offset) {
			$query = $this-&gt;db-&gt;get('ms_tests', $num, $offset);
			return $query;
	}
</pre>
<p>&nbsp;</p>
<p>The view:</p>
<pre class="brush: php;">
		&lt;div class=&quot;clearfix&quot;&gt;
			&lt;?=$pagination?&gt;
		&lt;/div&gt;
	&lt;?php
		foreach ($tests as $test) :
 			echo $test['title'];
		endforeach
	?&gt;

		&lt;div class=&quot;clearfix&quot;&gt;
			&lt;?=$pagination?&gt;
		&lt;/div&gt;
</pre>
<p>&nbsp;</p>
<p>Thank you and have a good day!!!</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.mashupsdev.com%2Fpagination-class-codeigniter%2F&amp;linkname=Pagination%20Class%20%26%238211%3B%20%20Codeigniter"><img src="http://blog.mashupsdev.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://blog.mashupsdev.com/pagination-class-codeigniter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>This is for multiple forms with validation on codeigniter</title>
		<link>http://blog.mashupsdev.com/this-is-for-multiple-forms-with-validation-on-codeigniter/</link>
		<comments>http://blog.mashupsdev.com/this-is-for-multiple-forms-with-validation-on-codeigniter/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 02:15:55 +0000</pubDate>
		<dc:creator>center</dc:creator>
				<category><![CDATA[CMS/Framework]]></category>
		<category><![CDATA[Code Labs]]></category>

		<guid isPermaLink="false">http://blog.mashupsdev.com/?p=4</guid>
		<description><![CDATA[Hi there everyone, this is my second tutorial on code igniter. Here, I will discuss about using multiple forms with validation.
Here is the procedure:

First we need to create a form to your views, here is one example.
Views:

&#60;p&#62;&#60;?php echo $this-&#62;validation-&#62;error_string; ?&#62;&#60;/p&#62;
&#60;form id=&#34;form1&#34; method=&#34;post&#34; action=&#34;validateform&#34;&#62;
  &#60;fieldset&#62;
      &#60;legend&#62;Login&#60;/legend&#62;
     [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there everyone, this is my second tutorial on code igniter. Here, I will discuss about using multiple forms with validation.</p>
<p>Here is the procedure:<br />
<span id="more-4"></span><br />
First we need to create a form to your views, here is one example.</p>
<p><strong>Views:</strong></p>
<pre class="brush: php;">
&lt;p&gt;&lt;?php echo $this-&gt;validation-&gt;error_string; ?&gt;&lt;/p&gt;
&lt;form id=&quot;form1&quot; method=&quot;post&quot; action=&quot;validateform&quot;&gt;
  &lt;fieldset&gt;
      &lt;legend&gt;Login&lt;/legend&gt;
      &lt;p&gt;
        &lt;h3&gt;Username&lt;/h3&gt;
        &lt;input name=&quot;username1&quot; type=&quot;text&quot; id=&quot;username1&quot; /&gt;
      &lt;/p&gt;
      &lt;p&gt;
        &lt;h3&gt;Password&lt;/h3&gt;
        &lt;input name=&quot;password1&quot; type=&quot;password&quot; id=&quot;password1&quot; /&gt;
      &lt;/p&gt;
      &lt;p&gt;
        &lt;input name=&quot;form1&quot; type=&quot;submit&quot; id=&quot;form1&quot; value=&quot;Envoyer&quot; /&gt;
      &lt;/p&gt;
  &lt;/fieldset&gt;
&lt;/form&gt;
&lt;form id=&quot;form2&quot; method=&quot;post&quot; action=&quot;validateform&quot;&gt;
&lt;fieldset&gt;
&lt;legend&gt;Subscribe&lt;/legend&gt;
&lt;h5&gt;Username&lt;/h5&gt;
&lt;input type=&quot;text&quot; name=&quot;username2&quot; id=&quot;username2&quot; /&gt;
&lt;p&gt;
&lt;h5&gt;Password&lt;/h5&gt;
  &lt;input type=&quot;password&quot; name=&quot;password2&quot; id=&quot;password2&quot; /&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h5&gt;Password Confirm&lt;/h5&gt;
  &lt;input type=&quot;password&quot; name=&quot;passwordCheck&quot; id=&quot;passwordCheck&quot; /&gt;
&lt;/p&gt;
&lt;p&gt;
  &lt;input name=&quot;form2&quot; type=&quot;submit&quot; id=&quot;form2&quot; value=&quot;Envoyer&quot; /&gt;
&lt;/p&gt;
&lt;/fieldset&gt;
&lt;/form&gt;
</pre>
<p>&nbsp;</p>
<p>This is the view that I’ve created it has two forms then create id which define to post to your controller. Your Form must have this <font color="#0000FF"><strong>“ echo $this->validation->error_string; ” </strong></font>to print out our error messages.</p>
<p>&nbsp;</p>
<p>Next, lets create a simple controller called “Validateform” in our system/application/controllers directory.<br />
<strong>Controllers:</strong></p>
<pre class="brush: php;">
&lt;?php
class Validateform extends Controller {

  function index() {

    $this-&gt;load-&gt;library('validation');

    if ($this-&gt;input-&gt;post('form1')) {
      $rules['username1'] = 'required|alpha_numeric';
      $rules['password1'] = 'required|alpha_numeric';
      $this-&gt;validation-&gt;set_rules($rules);
    }
    else if ($this-&gt;input-&gt;post('form2')) {
      $rules['username2'] = 'required|alpha_numeric';
      $rules['password2'] = 'required|matches[password2]';
      $rules['passwordCheck'] = 'required|alpha_numeric';
      $this-&gt;validation-&gt;set_rules($rules);
    }

    if (!$this-&gt;validation-&gt;run()) {
      $this-&gt;load-&gt;view('view.php');
    }
    else {
      if ($this-&gt;input-&gt;post('form1'))
          echo 'Form 1 posted !';
      else if ($this-&gt;input-&gt;post('form2'))
          echo 'Form 2 posted !';
    }
  }
}
?&gt;
</pre>
<p>&nbsp;</p>
<p>Rule Reference<br />
The following is a list of all the rules that are available to use:<br />
<a href="http://www.mashupsdesign.com/wp-content/uploads/2009/07/Screenshot-1.png"><img src="http://www.mashupsdesign.com/wp-content/uploads/2009/07/rules_reference.png" /></a></p>
<p>&nbsp;</p>
<p>Hope these codes will help all of you.<br />
Thank you, and have a nice day.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.mashupsdev.com%2Fthis-is-for-multiple-forms-with-validation-on-codeigniter%2F&amp;linkname=This%20is%20for%20multiple%20forms%20with%20validation%20on%20codeigniter"><img src="http://blog.mashupsdev.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://blog.mashupsdev.com/this-is-for-multiple-forms-with-validation-on-codeigniter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to upload array of files with thumbnail in Code Igniter</title>
		<link>http://blog.mashupsdev.com/how-to-upload-array-of-files-with-thumbnail-in-code-igniter/</link>
		<comments>http://blog.mashupsdev.com/how-to-upload-array-of-files-with-thumbnail-in-code-igniter/#comments</comments>
		<pubDate>Tue, 26 May 2009 02:14:27 +0000</pubDate>
		<dc:creator>center</dc:creator>
				<category><![CDATA[CMS/Framework]]></category>
		<category><![CDATA[Code Labs]]></category>

		<guid isPermaLink="false">http://blog.mashupsdev.com/?p=1</guid>
		<description><![CDATA[Hello everyone, I would like to share with you on how to upload array of files with Thumbnail in Code Igniter.
Here&#8217;s the step by step guide for you to follow:
In views, you can create a form including input files in an array then submit to the controller to be saved in a folder or directory [...]]]></description>
			<content:encoded><![CDATA[<p>Hello everyone, I would like to share with you on how to upload array of files with Thumbnail in Code Igniter.</p>
<p>Here&#8217;s the step by step guide for you to follow:<br />
In views, you can create a form including input files in an array then submit to the controller to be saved in a folder or directory where the upload path is located.<br />
<span id="more-1"></span><br />
<strong>Views:</strong></p>
<pre class="brush: php;">
&lt;form action=&quot;&lt;?=base_url()?&gt;upload_array_files&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt;
     &lt;label for=&quot;url&quot;&gt;Upload Files: &lt;/label&gt;
          &lt;input type=&quot;file&quot; name=&quot;files[]&quot; value=&quot;&quot; /&gt;
          &lt;input type=&quot;file&quot; name=&quot;files[]&quot; value=&quot;&quot; /&gt;
          &lt;input type=&quot;file&quot; name=&quot;files[]&quot; value=&quot;&quot; /&gt;
     &lt;input type=&quot;submit&quot; value=&quot;Save Article/s&quot;&gt;
&lt;/form&gt;
</pre>
<p>&nbsp;</p>
<p>Here’s the controller:<br />
This function called upload_array files. In this process, all configurations in files were applied in an array.</p>
<p><strong>Controllers:</strong></p>
<pre class="brush: php;">function upload_array_files() {
     $this-&gt;load-&gt;helper('form');
     // config for all files in array the same
     $config['upload_path'] = './uploads/';
     $config['allowed_types'] = 'jpg|pdf';
     $config['max_size'] = '1000';
     $this-&gt;load-&gt;library('upload',$config);
          if ( ! $this-&gt;upload-&gt;do_upload()) {
               $error = array('error' =&gt; $this-&gt;upload-&gt;display_errors());
               $this-&gt;load-&gt;view('upload_form',$error);
          } else {
               for($i = 0, $t = count($_Files['files']); $i &lt; $t; $i++) {
                    $id = $this-&gt;files-&gt;add_files($i);
               }
          }
     redirect('home');
}
</pre>
<p>&nbsp;</p>
<p>The files were uploaded and automatically create thumbnail, then apply all configurations for thumbnails in an array.<br />
<font color="#0000FF"><strong>&#8221; for($i = 0, $t = count($files); $i < $t; $i++) { } " </strong></font>as shown in this model, the uploaded files from views were counted and used for loop. After this, the function of the model will be called and save to the table of the file uploaded, this function is called add_files.</p>
<p>&nbsp;</p>
<p>In this model, the files were saved on the table.<br />
<strong>Model:</strong></p>
<pre class="brush: php;">
function add_files($i) {
	$file = $this-&gt;upload-&gt;data();
	$files = $file['file_name'];
	$fields = array(
		'files' =&gt; $files[$i]
	);
		for ($i = 0; $i &lt; count($files); $i++) {
				$data['image'] = './uploads/'.$files[$i];
				//$data['image'] = './uploads/'.$files[1];
				$config['image_library'] = 'gd2';
				$config['source_image'] = $data['image'];
				$config['create_thumb'] = TRUE;
				$config['maintain_ratio'] = TRUE;
				$config['width'] = 345;
				$config['height'] = 224;
				$config['new_image'] = './uploads/thumb/'.$files[$i];
				$this-&gt;load-&gt;library('image_lib');
				//$this-&gt;image_lib-&gt;resize();
				$this-&gt;image_lib-&gt;initialize($config); //MUST CALL THIS METHOD
			if(!$this-&gt;image_lib-&gt;resize()){
				//echo '&lt;p&gt; not resized&lt;/p&gt;';
			}else{
				//echo '&lt;p&gt; OK &lt;/p&gt;';
			}
			$this-&gt;image_lib-&gt;clear();
		}
	$this-&gt;db-&gt;set($fields);
	$this-&gt;db-&gt;insert($this-&gt;files_table);
	return $this-&gt;db-&gt;insert_id();
}
</pre>
<p>&nbsp;</p>
<p>This is just one way to upload arrays with thumbnail. Using the power of internet, you can find more advanced programming to do this process. Watch out for more tutorial that we will publish soon.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.mashupsdev.com%2Fhow-to-upload-array-of-files-with-thumbnail-in-code-igniter%2F&amp;linkname=How%20to%20upload%20array%20of%20files%20with%20thumbnail%20in%20Code%20Igniter"><img src="http://blog.mashupsdev.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://blog.mashupsdev.com/how-to-upload-array-of-files-with-thumbnail-in-code-igniter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
