<?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; Code Labs</title>
	<atom:link href="http://blog.mashupsdev.com/category/code-labs/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>PHP: function of url exists</title>
		<link>http://blog.mashupsdev.com/php-function-of-url-exists/</link>
		<comments>http://blog.mashupsdev.com/php-function-of-url-exists/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 08:43:08 +0000</pubDate>
		<dc:creator>center</dc:creator>
				<category><![CDATA[Code Labs]]></category>

		<guid isPermaLink="false">http://blog.mashupsdev.com/?p=99</guid>
		<description><![CDATA[ 
Check if a URL exists.

function url_exists($url) {

//in this case: check if url contents is not null then return 1
if(@file_get_contents($url,0,
&#60;div id=&#34;:10w&#34;&#62;NULL,0,1))
{
echo &#34;Url exists&#34;;
}
else
{
echo &#34;Url does not exist&#34;;
}
}
EXAMPLE:
$url_here = &#8216;http://www.google.com&#8216;
url_exists($url_here);
it prints-&#62; Url exists.
Thank you!
]]></description>
			<content:encoded><![CDATA[<p><span id="main" style="visibility: visible;"> </span></p>
<h3>Check if a URL exists.</h3>
<p><span id="more-99"></span></p>
<pre class="brush: php;">function url_exists($url) {

//in this case: check if url contents is not null then return 1
if(@file_get_contents($url,0,
&lt;div id=&quot;:10w&quot;&gt;NULL,0,1))
{
echo &quot;Url exists&quot;;
}
else
{
echo &quot;Url does not exist&quot;;
}
}</pre>
<p>EXAMPLE:<br />
$url_here = &#8216;<a href="http://www.google.com/" target="_blank">http://www.google.com</a>&#8216;<br />
url_exists($url_here);</p>
<p>it prints-&gt; Url exists.</p>
<p>Thank you!</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.mashupsdev.com%2Fphp-function-of-url-exists%2F&amp;linkname=PHP%3A%20function%20of%20url%20exists"><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/php-function-of-url-exists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PayPal Shopping Cart HTML Code</title>
		<link>http://blog.mashupsdev.com/paypal-shopping-cart-html-code/</link>
		<comments>http://blog.mashupsdev.com/paypal-shopping-cart-html-code/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 08:42:35 +0000</pubDate>
		<dc:creator>center</dc:creator>
				<category><![CDATA[Code Labs]]></category>

		<guid isPermaLink="false">http://blog.mashupsdev.com/?p=97</guid>
		<description><![CDATA[When a buyer clicks the &#8220;Add to Cart&#8221; button, a new window will appear listing the contents of the buyer&#8217;s PayPal Shopping Cart, including the item just added. To make the purchase, the buyer clicks &#8220;Checkout&#8221; from this window.

HTML Code Displayed Below:
This example uploads 1 item. It provides an idea of how the coding works.
* [...]]]></description>
			<content:encoded><![CDATA[<p>When a buyer clicks the &#8220;Add to Cart&#8221; button, a new window will appear listing the contents of the buyer&#8217;s PayPal Shopping Cart, including the item just added. To make the purchase, the buyer clicks &#8220;Checkout&#8221; from this window.<br />
<span id="more-97"></span><br />
HTML Code Displayed Below:<br />
This example uploads 1 item. It provides an idea of how the coding works.<br />
* Sandbox URL: <a href="https://www.sandbox.paypal.com/cgi-bin/webscr" target="_blank">https://www.sandbox.paypal.com/cgi-bin/webscr</a><br />
* Live Site URL: <a href="https://www.paypal.com/cgi-bin/webscr" target="_blank">https://www.paypal.com/cgi-bin/webscr</a></p>
<pre class="brush: php;">&lt;form action=&quot;&lt;a href=&quot;https://www.paypal.com/cgi-bin/webscr&quot; target=&quot;_blank&quot;&gt;https://www.paypal.com/cgi-bin/webscr&lt;/a&gt;&quot; method=&quot;post&quot;&gt;</pre>
<p>Set the &#8220;cmd&#8221; variable to &#8220;_cart&#8221;</p>
<pre class="brush: php;">&lt;input type=&quot;hidden&quot; name=&quot;cmd&quot; value=&quot;_cart&quot;&gt;</pre>
<p>Add a new variable called &#8220;add&#8221;<br />
* add – Add to Cart buttons</p>
<pre class="brush: php;">&lt;input type=&quot;hidden&quot; name=&quot;add&quot; value=&quot;1&quot;&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;business&quot; value=&quot;&lt;a href=&quot;mailto:paypal.testing@gmail.com&quot; target=&quot;_blank&quot;&gt;paypal.testing@gmail.com&lt;/a&gt;&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;currency_code&quot; value=&quot;USD&quot;&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;item_name&quot; value=&quot;PayPal Shopping Cart&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;amount&quot; value=&quot;24.00&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;return&quot; value=&quot;&lt;a href=&quot;http://www.yoursite.com/thankyou.htm&quot; target=&quot;_blank&quot;&gt;http://www.yoursite.com/thankyou.htm&lt;/a&gt;&quot;&gt;
 &lt;input type=&quot;image&quot; src=&quot;&lt;a href=&quot;http://www.paypal.com/en_US/i/btn/sc-but-01.gif&quot; target=&quot;_blank&quot;&gt;http://www.paypal.com/en_US/i/btn/sc-but-01.gif&lt;/a&gt;&quot; border=&quot;0&quot; name=&quot;submit&quot; alt=&quot;Make payments with PayPal - it's fast, free and secure!&quot;&gt;
 &lt;/form&gt;</pre>
<p>You can use the same code in your live site by changing the URL of the action line to point to the live PayPal site.<br />
You must first be logged into your Sandbox Developer Account to test your PayPal Shopping Cart button code.</p>
<p>DEMO:</p>
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<input type="hidden" name="business" value="paypal.testing@gmail.com">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="PayPal Shopping Cart">
<input type="hidden" name="amount" value="24.00">
<input type="hidden" name="return" value="http://www.yoursite.com/thankyou.htm">
<input type="image" src="http://www.paypal.com/en_US/i/btn/sc-but-01.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
<p>Thanks.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.mashupsdev.com%2Fpaypal-shopping-cart-html-code%2F&amp;linkname=PayPal%20Shopping%20Cart%20HTML%20Code"><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/paypal-shopping-cart-html-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Toggle DIV &#8211; Show / Hide</title>
		<link>http://blog.mashupsdev.com/toggle-div-show-hide/</link>
		<comments>http://blog.mashupsdev.com/toggle-div-show-hide/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 02:31:45 +0000</pubDate>
		<dc:creator>center</dc:creator>
				<category><![CDATA[Code Labs]]></category>

		<guid isPermaLink="false">http://blog.mashupsdev.com/?p=29</guid>
		<description><![CDATA[Toggle function
takes the ID of the element to toggle
To hide an element, you just set display to &#8216;none&#8217;.

	&#60;script type=&#34;text/javascript&#34;&#62;
	function showText(vThis)
	{
	vParent = vThis.parentNode;
	vSibling = vParent.nextSibling;
	while (vSibling.nodeType==3) { // Fix for Mozilla/FireFox Empty Space becomes a TextNode or Something
	vSibling = vSibling.nextSibling;
	};
		if(vSibling.style.display == &#34;none&#34;)
		{
		document.getElementById('link').innerHTML = &#34;Hide&#34;;
		vSibling.style.display = &#34;block&#34;;
		} else {
		document.getElementById('link').innerHTML = &#34;Show&#34;;
		vSibling.style.display = &#34;none&#34;;
		}
	return;
	}
	&#60;/script&#62;
For example if you wanted [...]]]></description>
			<content:encoded><![CDATA[<p>Toggle function<br />
takes the ID of the element to toggle<br />
To hide an element, you just set display to &#8216;none&#8217;.<br />
<span id="more-29"></span></p>
<pre class="brush: jscript;">	&lt;script type=&quot;text/javascript&quot;&gt;
	function showText(vThis)
	{
	vParent = vThis.parentNode;
	vSibling = vParent.nextSibling;
	while (vSibling.nodeType==3) { // Fix for Mozilla/FireFox Empty Space becomes a TextNode or Something
	vSibling = vSibling.nextSibling;
	};
		if(vSibling.style.display == &quot;none&quot;)
		{
		document.getElementById('link').innerHTML = &quot;Hide&quot;;
		vSibling.style.display = &quot;block&quot;;
		} else {
		document.getElementById('link').innerHTML = &quot;Show&quot;;
		vSibling.style.display = &quot;none&quot;;
		}
	return;
	}
	&lt;/script&gt;</pre>
<p>For example if you wanted to hide this link:</p>
<p>click on link Hide it hides div #text .</p>
<p><strong>Example:</strong></p>
<p><a id="link" onclick="showText(this);" href="#here">Hide</a></p>
<div id="text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc volutpat ante et ante. Donec sodales lacinia ante. Quisque sem urna, iaculis id, rhoncus ac, venenatis ut, massa. Mauris sit amet mauris. Aliquam ut massa at ante condimentum gravida. Etiam pulvinar massa a ante. Integer pharetra. Fusce quam neque, aliquet tristique, ullamcorper id, blandit id, tortor. Nunc lacinia egestas enim. Maecenas molestie rhoncus quam.</div>
<pre class="brush: php;">&lt;a onclick=&quot;showText(this);&quot; id=&quot;link&quot;&gt;Hide&lt;/a&gt;</pre>
<pre class="brush: php;">&lt;div id=&quot;text&quot;&gt;
 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc volutpat ante et ante. Donec sodales lacinia ante. Quisque sem urna, iaculis id, rhoncus ac, venenatis ut, massa. Mauris sit amet mauris. Aliquam ut massa at ante condimentum gravida. Etiam pulvinar massa a ante. Integer pharetra. Fusce quam neque, aliquet tristique, ullamcorper id, blandit id, tortor. Nunc lacinia egestas enim. Maecenas molestie rhoncus quam.
&lt;/div&gt;</pre>
<p>After you clicked on it, the link Hide change the text to Show. with this javascript function ( document.getElementById(&#8216;link&#8217;).innerHTML = &#8220;Show&#8221;; )</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.mashupsdev.com%2Ftoggle-div-show-hide%2F&amp;linkname=Toggle%20DIV%20%26%238211%3B%20Show%20%2F%20Hide"><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/toggle-div-show-hide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Form Submit onChange</title>
		<link>http://blog.mashupsdev.com/form-submit-onchange/</link>
		<comments>http://blog.mashupsdev.com/form-submit-onchange/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 02:32:24 +0000</pubDate>
		<dc:creator>center</dc:creator>
				<category><![CDATA[Code Labs]]></category>

		<guid isPermaLink="false">http://blog.mashupsdev.com/?p=31</guid>
		<description><![CDATA[Form Submit onChange select without the submit button.
Using the onchange=&#8221;this.form.submit();&#8221; on your select.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in [...]]]></description>
			<content:encoded><![CDATA[<p>Form Submit onChange select without the submit button.</p>
<p>Using the onchange=&#8221;this.form.submit();&#8221; on your select.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p><span id="more-31"></span></p>
<pre class="brush: php;">&lt;form action=&quot;#urlhere&quot; method=&quot;post&quot;&gt;

			&lt;select name=&quot;choose&quot; onchange=&quot;this.form.submit();&quot;&gt;

			&lt;option value=&quot;1&quot;&gt;1&lt;/option&gt;

			&lt;option value=&quot;2&quot;&gt;2&lt;/option&gt;

			&lt;option value=&quot;3&quot;&gt;3&lt;/option&gt;

			&lt;option value=&quot;4&quot;&gt;4&lt;/option&gt;

			&lt;option value=&quot;5&quot;&gt;5&lt;/option&gt;

			&lt;/select&gt;

		&lt;/form&gt;</pre>
<p>Example:</p>
<form action="#urlhere" method="post">
<select name="choose"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select>
</p></form>
<p>Thank You!</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.mashupsdev.com%2Fform-submit-onchange%2F&amp;linkname=Form%20Submit%20onChange"><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/form-submit-onchange/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>Using window.onload</title>
		<link>http://blog.mashupsdev.com/using-window-onload/</link>
		<comments>http://blog.mashupsdev.com/using-window-onload/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 02:30:42 +0000</pubDate>
		<dc:creator>center</dc:creator>
				<category><![CDATA[Code Labs]]></category>

		<guid isPermaLink="false">http://blog.mashupsdev.com/?p=25</guid>
		<description><![CDATA[Toggle function
takes the ID of the element to toggle
To hide an element, you just set display to &#8216;none&#8217;.

	&#60;script type=&#34;text/javascript&#34;&#62;
	function showText(vThis)
	{
	vParent = vThis.parentNode;
	vSibling = vParent.nextSibling;
	while (vSibling.nodeType==3) { // Fix for Mozilla/FireFox Empty Space becomes a TextNode or Something
	vSibling = vSibling.nextSibling;
	};
		if(vSibling.style.display == &#34;none&#34;)
		{
		document.getElementById('link').innerHTML = &#34;Hide&#34;;
		vSibling.style.display = &#34;block&#34;;
		} else {
		document.getElementById('link').innerHTML = &#34;Show&#34;;
		vSibling.style.display = &#34;none&#34;;
		}
	return;
	}
	&#60;/script&#62;
For example if you wanted [...]]]></description>
			<content:encoded><![CDATA[<p>Toggle function<br />
takes the ID of the element to toggle<br />
To hide an element, you just set display to &#8216;none&#8217;.<br />
<span id="more-25"></span></p>
<pre class="brush: jscript;">	&lt;script type=&quot;text/javascript&quot;&gt;
	function showText(vThis)
	{
	vParent = vThis.parentNode;
	vSibling = vParent.nextSibling;
	while (vSibling.nodeType==3) { // Fix for Mozilla/FireFox Empty Space becomes a TextNode or Something
	vSibling = vSibling.nextSibling;
	};
		if(vSibling.style.display == &quot;none&quot;)
		{
		document.getElementById('link').innerHTML = &quot;Hide&quot;;
		vSibling.style.display = &quot;block&quot;;
		} else {
		document.getElementById('link').innerHTML = &quot;Show&quot;;
		vSibling.style.display = &quot;none&quot;;
		}
	return;
	}
	&lt;/script&gt;</pre>
<p>For example if you wanted to hide this link:</p>
<p>click on link Hide it hides div #text .</p>
<p><strong>Example:</strong></p>
<p><a id="link" onclick="showText(this);" href="#here">Hide</a></p>
<div id="text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc volutpat ante et ante. Donec sodales lacinia ante. Quisque sem urna, iaculis id, rhoncus ac, venenatis ut, massa. Mauris sit amet mauris. Aliquam ut massa at ante condimentum gravida. Etiam pulvinar massa a ante. Integer pharetra. Fusce quam neque, aliquet tristique, ullamcorper id, blandit id, tortor. Nunc lacinia egestas enim. Maecenas molestie rhoncus quam.</div>
<pre class="brush: php;">&lt;a onclick=&quot;showText(this);&quot; id=&quot;link&quot;&gt;Hide&lt;/a&gt;</pre>
<pre class="brush: php;">&lt;div id=&quot;text&quot;&gt;
 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc volutpat ante et ante. Donec sodales lacinia ante. Quisque sem urna, iaculis id, rhoncus ac, venenatis ut, massa. Mauris sit amet mauris. Aliquam ut massa at ante condimentum gravida. Etiam pulvinar massa a ante. Integer pharetra. Fusce quam neque, aliquet tristique, ullamcorper id, blandit id, tortor. Nunc lacinia egestas enim. Maecenas molestie rhoncus quam.
&lt;/div&gt;</pre>
<p>After you clicked on it, the link Hide change the text to Show. with this javascript function ( document.getElementById(&#8216;link&#8217;).innerHTML = &#8220;Show&#8221;; )</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.mashupsdev.com%2Fusing-window-onload%2F&amp;linkname=Using%20window.onload"><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/using-window-onload/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>PHP: in_array &#8211; Search Array</title>
		<link>http://blog.mashupsdev.com/php-in_array-search-array/</link>
		<comments>http://blog.mashupsdev.com/php-in_array-search-array/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 02:29:24 +0000</pubDate>
		<dc:creator>center</dc:creator>
				<category><![CDATA[Code Labs]]></category>

		<guid isPermaLink="false">http://blog.mashupsdev.com/?p=21</guid>
		<description><![CDATA[Apply the in_array function to check the presence of an element.
in_array function will return True or False based on the presence of the search element.


 &#60;?php
    $code = array(&#34;CSS&#34;, &#34;PHP&#34;, &#34;Javascript&#34;, &#34;MySql&#34;);
    if (in_array(&#34;PHP&#34;, $code)) {
       echo &#34;PHP found&#34;;
    } [...]]]></description>
			<content:encoded><![CDATA[<p>Apply the in_array function to check the presence of an element.<br />
in_array function will return True or False based on the presence of the search element.<br />
<span id="more-21"></span></p>
<pre class="brush: php;">
 &lt;?php
    $code = array(&quot;CSS&quot;, &quot;PHP&quot;, &quot;Javascript&quot;, &quot;MySql&quot;);
    if (in_array(&quot;PHP&quot;, $code)) {
       echo &quot;PHP found&quot;;
    } else {
       echo &quot;PHP is not there &quot;;
    }
    if (in_array(&quot;css&quot;, $os)) {
       echo &quot;css?&quot;;
    }
?&gt;
</pre>
<p>
Thank You!</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.mashupsdev.com%2Fphp-in_array-search-array%2F&amp;linkname=PHP%3A%20in_array%20%26%238211%3B%20Search%20Array"><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/php-in_array-search-array/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>Text in the Tooltip</title>
		<link>http://blog.mashupsdev.com/text-in-the-tooltip/</link>
		<comments>http://blog.mashupsdev.com/text-in-the-tooltip/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 02:25:09 +0000</pubDate>
		<dc:creator>center</dc:creator>
				<category><![CDATA[Code Labs]]></category>

		<guid isPermaLink="false">http://blog.mashupsdev.com/?p=15</guid>
		<description><![CDATA[
    
    
    
		$(document).ready(function(){
			$('.tTip').betterTooltip({speed: 150, delay: 300});
		});
	
This is an Ajax tooltip script.When your mouse over the &#8220;text&#8221; below, ajax will show tooltip from the tag title caption with an image background.
	


How To Use

The lines that should be inserted in the head section are the following:
&#60;script type=&#34;text/javascript&#34; [...]]]></description>
			<content:encoded><![CDATA[<link href="http://www.mashupsdesign.com/js/tooltip.css" rel="stylesheet" type="text/css" media="all" />
    <script type="text/javascript" src="http://www.mashupsdesign.com/js/jquery-1.3.1.min.js"></script><br />
    <script type="text/javascript" src="http://www.mashupsdesign.com/js/Tooltip.js"></script><br />
    <script type="text/javascript">
		$(document).ready(function(){
			$('.tTip').betterTooltip({speed: 150, delay: 300});
		});
	</script><br />
This is an Ajax tooltip script.<br />When your mouse over the &#8220;text&#8221; below, ajax will show tooltip from the tag title caption with an image background.<br />
	<br />
<span id="more-15"></span></p>
<pre>
How To Use

The lines that should be inserted in the head section are the following:
<pre class="brush: jscript;">&lt;script type=&quot;text/javascript&quot; src=&quot;jquery-1.3.1.min.js&quot;&gt;
&lt;/script&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;Tooltip.js&quot;&gt;
&lt;/script&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
		$(document).ready(function(){
			$('.tTip').betterTooltip({speed: 150, delay: 300});
		});
	&lt;/script&gt;</pre>
<p>The CSS used for this tooltip: style.css</p>
<pre class="brush: jscript;">&lt;link href=&quot;tooltip.css&quot; rel=&quot;stylesheet&quot;
type=&quot;text/css&quot; media=&quot;all&quot; /&gt;</pre>
<p>This is an example of a tooltip from the tag title caption.<br />
title="Lorem Ipsum is simply dummy text of the printing and typesetting industry."</p>
<p>Add class="tTip" attribute to the div you wish to show the tooltip. For example:<br />
&lt;div class="tTip" title="Lorem Ipsum is simply dummy text of the printing<br />
and typesetting industry.">What is Lorem Ipsum?&lt;/div>
</pre>
<p>DEMO:</p>
<div id="main">
<div class="tTip" title="Lorem Ipsum is simply dummy text of the printing and typesetting industry.">What is Lorem Ipsum?</div>
<div class="tTip" title="It is a long established fact that a reader will be distracted by the readable content of a page">Why do we use it?</div>
<div class="tTip" title="Lorem ipsum dolor sit amet, consectetur adipisicing elit">Example of Lorem Ipsum</div>
<p>
Thanky You.
    	</div>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.mashupsdev.com%2Ftext-in-the-tooltip%2F&amp;linkname=Text%20in%20the%20Tooltip"><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/text-in-the-tooltip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
