<?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>Catzie.net Blog &#187; Web Development</title>
	<atom:link href="http://blog.catzie.net/tag/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.catzie.net</link>
	<description>Programming, Networking, and other Downloads by Catzie</description>
	<lastBuildDate>Tue, 07 Feb 2012 15:19:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>OpenCart: Override Invoice ID</title>
		<link>http://blog.catzie.net/opencart-override-invoice-id/</link>
		<comments>http://blog.catzie.net/opencart-override-invoice-id/#comments</comments>
		<pubDate>Sun, 13 Mar 2011 12:26:43 +0000</pubDate>
		<dc:creator>Catzie</dc:creator>
				<category><![CDATA[OpenCart]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[e-commerce]]></category>
		<category><![CDATA[shopping c]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.catzie.net/?p=607</guid>
		<description><![CDATA[Edit: Seems like there&#8217;s something missing in the code I inserted. I only found out after further system testing. Will update this post when I feel like fixing it. :p I&#8217;m taking an E-Commerce class (it&#8217;s my last school term!) and my group&#8217;s project in an online store that uses OpenCart, an open-source shopping cart [...]]]></description>
			<content:encoded><![CDATA[<p><em>Edit: Seems like there&#8217;s something missing in the code I inserted. I only found out after further system testing. Will update this post when I feel like fixing it. :p</em></p>
<p>I&#8217;m taking an E-Commerce class (it&#8217;s my last school term!) and my group&#8217;s project in an online store that uses OpenCart, an open-source shopping cart software. Our professor wants us to have transaction numbers (invoice ID, in OpenCart) that are not simply the increment of the previous one (0001, 0002, 0003, &#8230;).</p>
<p>It took me long to figure out how to edit the invoice ID that OpenCart generates. In the settings page of the admin area we can only edit the prefix (default is INV) and the starting invoice ID (default is 001). When I change either of the two fields the invoice ID that is generated doesn&#8217;t change at all. After some research I found out that <span id="more-607"></span>the function which generates the invoice ID is set to get the highest ID value in the database and increment it by 1. That&#8217;s how it generates new invoice ID&#8217;s. </p>
<p>Below is the function that generates the invoice ID (found at admin/model/sale/order.php):<br />
<code><br />
public function generateInvoiceId($order_id) {<br />
		$query = $this->db->query("SELECT MAX(invoice_id) AS invoice_id FROM `" . DB_PREFIX . "order`");</p>
<p>		if ($query->row['invoice_id']) {<br />
			$invoice_id = (int)$query->row['invoice_id'] + 1;<br />
		} elseif ($this->config->get('config_invoice_id')) {<br />
			$invoice_id = $this->config->get('config_invoice_id');<br />
		} else {<br />
			$invoice_id = 1;<br />
		}</p>
<p>		$this->db->query("UPDATE `" . DB_PREFIX . "order` SET invoice_id = '" . (int)$invoice_id . "', invoice_prefix = '" . $this->db->escape($this->config->get('config_invoice_prefix')) . "', date_modified = NOW() WHERE order_id = '" . (int)$order_id . "'");</p>
<p>		return $this->config->get('config_invoice_prefix') . $invoice_id;<br />
}<br />
</code></p>
<p>What I did was comment out everything inside the function and insert the statement:</p>
<p><code><br />
return date("Ymd-") . rand(0,9999);<br />
</code></p>
<p>This results to an invoice ID that contains current date, a hyphen, and a 4-digit number. For example: 20110313-1234.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.catzie.net/opencart-override-invoice-id/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>JavaScript: Setting the selected dropdown option by its index number</title>
		<link>http://blog.catzie.net/javascript-setting-the-selected-dropdown-option-by-its-index-number/</link>
		<comments>http://blog.catzie.net/javascript-setting-the-selected-dropdown-option-by-its-index-number/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 05:30:10 +0000</pubDate>
		<dc:creator>Catzie</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.catzie.net/?p=327</guid>
		<description><![CDATA[Long time no new entry. Internship is keeping me very busy. In this blog entry I&#8217;ll show you how to select a drop down option by specifying its index number. The JavaScript code: document.getElementById("selectionDD").selectedIndex = 0; The HTML code: &#60;select id="selectionDD" name="selectionDD"&#62; &#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&#60;option value="one"&#62;One&#60;/option&#62; &#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&#60;option value="two"&#62;Two&#60;/option&#62; &#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&#60;option value="three"&#62;Three&#60;/option&#62; &#60;/select&#62; Refer to the JavaScript code. The [...]]]></description>
			<content:encoded><![CDATA[<p>Long time no new entry. <img src='http://blog.catzie.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Internship is keeping me very busy. In this blog entry I&#8217;ll show you how to select a drop down option by specifying its index number.<br />
<span id="more-327"></span><br />
<strong>The JavaScript code:</strong></p>
<pre class="xml">
document.getElementById("selectionDD").selectedIndex = 0;
</pre>
<p><strong>The HTML code:</strong></p>
<pre class="xml">
&lt;select id="selectionDD" name="selectionDD"&gt;
&#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&lt;option value="one"&gt;One&lt;/option&gt;
&#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&lt;option value="two"&gt;Two&lt;/option&gt;
&#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&lt;option value="three"&gt;Three&lt;/option&gt;
&lt;/select&gt;
</pre>
<p>Refer to the JavaScript code. The <code>selectionDD </code>is the id of the <code>&lt;select&gt;</code> tag. The value 0 represents the index number of the option that we want to be selected, and will select the first option in the selection. Note that the index numbers start with 0, not 1.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.catzie.net/javascript-setting-the-selected-dropdown-option-by-its-index-number/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Fix PNG images with transparency in older Windows Internet Explorer versions</title>
		<link>http://blog.catzie.net/fix-png-images-with-transparency-in-older-windows-internet-explorer-versions/</link>
		<comments>http://blog.catzie.net/fix-png-images-with-transparency-in-older-windows-internet-explorer-versions/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 06:49:31 +0000</pubDate>
		<dc:creator>Catzie</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PNG images]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.catzie.net/?p=251</guid>
		<description><![CDATA[I wonder if this post would still get hits from search engine result pages. So many other web pages feature this fix for IE 5.5 and IE 6 web browser, that the Catzie.net Blog&#8217;s entry might just show up on the&#8230; 10th page or so. lol. Anyways, I&#8217;m still posting this, in case there are [...]]]></description>
			<content:encoded><![CDATA[<p>I wonder if this post would still get hits from search engine result pages. So many other web pages feature this fix for <strong>IE 5.5 and IE 6</strong> web browser, that the Catzie.net Blog&#8217;s entry might just show up on the&#8230; 10th page or so. lol.</p>
<p>Anyways, I&#8217;m still posting this, in case there are some visitors browsing around who need help with properly displaying the transparency of <strong>.PNG</strong> images in <strong>IE5.5 and IE6</strong>. This also helps me easily find the needed code to fix the display. I need it from time to time when I design website layouts. <img src='http://blog.catzie.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span style="color: red;">Tip:</span> Most of us are probably using the newer versions of Internet Explorer. I suggest that you <a href="http://blog.catzie.net/ie-tester-see-how-your-web-pages-look-in-different-versions-of-ie-windows-internet-explorer/">download and use the IE Tester</a>. It&#8217;s a web browser that lets you see how web pages render in different versions of IE &#8211; 5.5, 6, 7, and 8.</p>
<p>I assume that as you read this, you are using Internet Explorer version 5.5, or the version 5.5 tab on the <a href="http://blog.catzie.net/ie-tester-see-how-your-web-pages-look-in-different-versions-of-ie-windows-internet-explorer/">IE Tester</a>.<br />
<span id="more-251"></span><br />
The following .png image has a grayish background color that replaces the parts that are supposed to be transparent.</p>
<div style="background:pink;padding:20px;">
<img src="http://img.photobucket.com/albums/v209/catzie/transparent1.png" alt="" />
</div>
<p>This is the code for what&#8217;s show above.</p>
<pre name="code" class="xml">
&lt;div style="background:pink;padding:20px;"&gt;
&lt;img src="http://img.photobucket.com/albums/v209/catzie/transparent1.png"
alt="" /&gt;
&lt;/div&gt;
</pre>
<p><a href="../pages/html/PNGtransparencyIE.html" target="_blank">Please click here</a> to open on a new window the fixed version of what we are trying to display. You&#8217;d notice that there&#8217;s no longer the  grayish background on the parts that are supposed to be transparent. Now you can see through the pink background.</p>
<p>The final code is:</p>
<pre name="code" class="xml">
&lt;html&gt;
&lt;head&gt;
	&lt;style type="text/css"&gt;
		body{
			background-color:pink;
		}
	&lt;/style&gt;
&lt;!--[if lt IE 7]&gt;
&lt;script language="JavaScript"&gt;
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 &#038; 6.
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version &gt;= 5.5) &#038;&#038; (document.body.filters))
   {
      for(var i=0; i&lt;document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
            var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className
                               + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " :
                               "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "&lt;span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height
            + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"&lt;&gt;/span&gt;"
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }
}
window.attachEvent("onload", correctPNG);
&lt;/script&gt;
&lt;![endif]--&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;div style="background:pink;padding:20px;"&gt;
         &lt;img src="http://img.photobucket.com/albums/v209/catzie/transparent1.png"
                alt="" /&gt;
  &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>The code above uses <b>conditional comment</b> to check if your current browser is older than IE 7. If it is, the JavaScript code which corrects the display of the .png is executed.</p>
<p>This method has limitations though. It works only on IE5.5 and IE6. It needs JavaScript enabled on your browser, or else it won&#8217;t work. And it only works on images placed using the &lt;img&gt; tag. It won&#8217;t work on background images.</p>
<p>I learned about this fix from <a href="http://homepage.ntlworld.com/bobosola" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/homepage.ntlworld.com/bobosola?referer=');">this website</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.catzie.net/fix-png-images-with-transparency-in-older-windows-internet-explorer-versions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Inline Frame that automatically adjusts its height for the source page</title>
		<link>http://blog.catzie.net/inline-frame-that-automatically-adjusts-its-height-for-the-source-page/</link>
		<comments>http://blog.catzie.net/inline-frame-that-automatically-adjusts-its-height-for-the-source-page/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 04:58:10 +0000</pubDate>
		<dc:creator>Catzie</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.catzie.net/?p=234</guid>
		<description><![CDATA[Last year, I was working on our MULPROJ layout, and the type of layout I was making needed an iframe whose height is auto resized according to the source page&#8217;s content. This means that there should be no vertical scrollbar in the iframe, it simply adjusts itself vertically. I thought that it wasn&#8217;t possible to [...]]]></description>
			<content:encoded><![CDATA[<p>Last year, I was working on our <acronym title="Multimedia Web Design Project">MULPROJ</acronym> layout, and the type of layout I was making needed an iframe whose height is auto resized according to the source page&#8217;s content. This means that there should be no vertical scrollbar in the iframe, it simply adjusts itself vertically.</p>
<p>I thought that it wasn&#8217;t possible to do this but I found a JavaScript code that can do the trick, and I just want to share it with you. <img src='http://blog.catzie.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
<span id="more-234"></span></p>
<pre name="code" class="xml">

&lt;script language=&quot;JavaScript&quot;&gt;

 function autoResize(id){
  var newheight;
  var newwidth;

 if(document.getElementById){
  newheight=document.getElementById(id).contentWindow.document .body.scrollHeight;
  newwidth=document.getElementById(id).contentWindow.document .body.scrollWidth;
  }

 document.getElementById(id).height= parseInt(newheight) + 45 + &quot;px&quot;;
  document.getElementById(id).width= (newwidth) + &quot;px&quot;;
  }
  &lt;/script&gt;


&lt;iframe SRC=&quot;yourPage.html&quot; width=&quot;100%&quot; id=&quot;iframe1&quot; marginheight=&quot;0&quot; frameborder=&quot;0&quot; onLoad=&quot;autoResize('iframe1');&quot;&gt;&lt;/iframe&gt;
</pre>
<p>Save the above code as iframe.html, or whatever you like.<br />
Remember to create the file yourPage.html in the same folder as your previous html file.</p>
<p>I stumbled upon it on: <a href="ttp://www.programmingtalk.com/showthread.php?t=25995" rel="nofollow">this forum thread</a>.</p>
<p>I also did a little editing.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.catzie.net/inline-frame-that-automatically-adjusts-its-height-for-the-source-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE Tester &#8211; see how your web pages look in different versions of IE (Windows Internet Explorer)</title>
		<link>http://blog.catzie.net/ie-tester-see-how-your-web-pages-look-in-different-versions-of-ie-windows-internet-explorer/</link>
		<comments>http://blog.catzie.net/ie-tester-see-how-your-web-pages-look-in-different-versions-of-ie-windows-internet-explorer/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 04:39:21 +0000</pubDate>
		<dc:creator>Catzie</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Web Browser]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.catzie.net/?p=232</guid>
		<description><![CDATA[(Post taken from my old blog, Poochycat.com) Ahh, it seems that I posted this in our MULPROJ days. ^_^ Yesterday I woke up at 6AM. I wanted to go on with my sleep, but I couldn&#8217;t. I suddenly remembered that I haven&#8217;t tested in different versions of Internet Explorer the layout design of the website [...]]]></description>
			<content:encoded><![CDATA[<p>(Post taken from my old blog, Poochycat.com)</p>
<p>Ahh, it seems that I posted this in our <acronym title="Multimedia &#038; Web Design Project">MULPROJ</acronym> days. ^_^</p>
<blockquote><p>
Yesterday I woke up at 6AM. I wanted to go on with my sleep, but I couldn&#8217;t. I suddenly remembered that I haven&#8217;t tested in different versions of Internet Explorer the layout design of the website I had to submit for <acronym title="Multimedia &#038; Web Design Project">MULPROJ</acronym> that day. It&#8217;s like God woke me up to remind me that I had to test the layout. xD<br />
<span id="more-232"></span><br />
The version of IE that I am using is the 8th, which is the latest version. That won&#8217;t be very helpful if I&#8217;d like to test the website layout in previous IE versions, which I expected to support less of my codes. First thing that came into my mind was the <b>IE Tester</b>, which I first learned about because of my schoolmate Alwyn Gan.</p>
<p>IE Tester is a free web browser that allows us to view web pages using the rendering and javascript engines of IE versions 5.5, 6, 7, and 8. We would be able to see how web pages look like in those versions of IE.</p>
<p>Thanks to IE Tester, I realized that my website layout&#8217;s transparent PNG&#8217;s were not actually transparent in IE 6! Phew. IE 6 does not support transparent PNG images. I found a workaround for that though.</p>
<p>If you&#8217;d like to test the website you&#8217;re coding in different versions of IE, then you might want to <a href="http://www.my-debugbar.com/wiki/IETester/HomePage" onclick="pageTracker._trackPageview('/outgoing/www.my-debugbar.com/wiki/IETester/HomePage?referer=');">download</a> the browser.</p>
<p>Happy coding!~ <img src='http://blog.catzie.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.catzie.net/ie-tester-see-how-your-web-pages-look-in-different-versions-of-ie-windows-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

