<?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>ReloadedPC Ashland, Ohio</title>
	<atom:link href="http://www.reloadedpc.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.reloadedpc.com</link>
	<description>Small Business Website Development</description>
	<lastBuildDate>Fri, 08 Mar 2013 01:35:10 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Compile CodeIgniter User Guide on Windows</title>
		<link>http://www.reloadedpc.com/code-igniter/compile-codeigniter-user-guide-windows/</link>
		<comments>http://www.reloadedpc.com/code-igniter/compile-codeigniter-user-guide-windows/#comments</comments>
		<pubDate>Sat, 15 Sep 2012 15:55:29 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Code Igniter]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=343</guid>
		<description><![CDATA[For users following the development of CodeIgniter, the documentation for the upcoming 3.0 release will be in a different format. Previously the CodeIgniter documentation was created and published in html format. The dev at CodeIgniter have switched to using Markdown and Sphinx for creating the source files to be compiled into html format. This allows [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://codeigniter.com"><img class="alignright size-full wp-image-41" title="CodeIgniter Logo" src="http://www.reloadedpc.com/wp-content/uploads/2009/07/ci_logo_flame.jpg" alt="Compile CodeIgniter User Guide on Windows ci logo flame " width="150" height="164" /></a>For users following the development of CodeIgniter, the documentation for the upcoming 3.0 release will be in a different format. Previously the CodeIgniter documentation was created and published in html format. The dev at CodeIgniter have switched to using Markdown and Sphinx for creating the source files to be compiled into html format. This allows for easier syntax highlighting as this is taken care of by Markdown and Sphinx.</p>
<p>Some of the components needed to compile the user guide, are not installed by default on Windows. Here are the steps to getting Ruby, Sphinx, and CI-Lexer installed on Windows XP and Vista/7.</p>
<p>I am using WAMP on my Windows computer for development, so I have CodeIgniter installed in the diretory:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="dos" style="font-family:monospace;">c:\wamp\www\codeigniter\</pre></td></tr></table></div>

<p>This folder will be referenced a few times in the lines of code below. If you have CodeIgniter running in a different directory, you will need to change references to those directories.<br />
The first step is to install Python. I found Python version 2.7 was best, because it was the easiest to setup one of the necessary dependencies.</p>
<p>1. Download <a href="http://www.python.org/download/">Python 2.7.3 Installer for Windows</a>.</p>
<p>Install this to the default folder which will be c:\Python27. After the installation completes we need to setup easy_install for Python.</p>
<p>2. For 32bit users you can download <a href="http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11.win32-py2.7.exe#md5=57e1e64f6b7c7f1d2eddfc9746bbaf20">setuptools-0.6c11.win32-py2.7.exe</a> and run the installer. For 64bit users you need to download <a href="http://peak.telecommunity.com/dist/ez_setup.py">ez_setup.py</a>. Save the file to c:\Python27 (default installation directory). click the Start button in the lower left corner and click Run. In the dialog box type:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="dos" style="font-family:monospace;">cmd</pre></td></tr></table></div>

<p>Then press the OK buttons. This will open the Windows command prompt. Then type:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="dos" style="font-family:monospace;"><span style="color: #b1b100; font-weight: bold;">cd</span> c:\Python27\</pre></td></tr></table></div>

<p>For 64bit users only type:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="dos" style="font-family:monospace;">python ez_setup.py</pre></td></tr></table></div>

<p>Now we have easy_install setup and ready to use so we can install Sphinx. To install Sphinx simple type:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="dos" style="font-family:monospace;"><span style="color: #b1b100; font-weight: bold;">cd</span> Scripts
easy_install sphinx</pre></td></tr></table></div>

<p>Now we have Sphinx setup we need to install the PHP syntax highligher for Sphinx. Type the following command:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="dos" style="font-family:monospace;">easy_install sphinxcontrib-phpdomain</pre></td></tr></table></div>

<p>The next step is to install the CI Lexer to get syntax highlighting support for CodeIgniter. We need to switch to our CodeIgniter folder that has the user guide sr Type the following command:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="dos" style="font-family:monospace;"><span style="color: #b1b100; font-weight: bold;">cd</span> c:\wamp\www\codeigniter\user_guide_src\cilexer
c:\Python27\python.exe setup.py install</pre></td></tr></table></div>

<p>Now everything is setup to compile the CodeIgniter user guide from the Markdown source. The first run will take some time, so be patient. If you were wanting to contribute, and update the user guide, the compilation process on runs on pages that are updated after the first run. This usually only takes a few seconds. The Markdown source is located in the user_guide_src/source folder inside of your CodeIgniter setup. To run the compiler use the following command:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="dos" style="font-family:monospace;">c:\Python27\Scripts\sphinx-build -b html c:\wamp\www\codeigniter\user_guide_src\source c:\wamp\www\codeigniter\user_guide_html</pre></td></tr></table></div>

<p>The -b html commandline option tells Sphinx to compile in html format. Now if you look inside your CodeIgniter folder you will see a new folder /user_guide_html. This will be the complete html user guide.</p>
<p>If all is you want is the latest user guide for CI 3.0, you can access it as well at http://codeigniter.com/nightly_user_guide/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/code-igniter/compile-codeigniter-user-guide-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Opencart Sales Report by Store vQmod</title>
		<link>http://www.reloadedpc.com/opencart/opencart-sales-report-store-vqmod/</link>
		<comments>http://www.reloadedpc.com/opencart/opencart-sales-report-store-vqmod/#comments</comments>
		<pubDate>Thu, 03 May 2012 15:29:41 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[OpenCart]]></category>
		<category><![CDATA[opencart]]></category>
		<category><![CDATA[reports]]></category>
		<category><![CDATA[vqmod]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=334</guid>
		<description><![CDATA[I just recently started looking at Opencart for an open source ecommerce platform.  It has a nice clean MVC codebase, and has support for multiple stores. Having multiple stores offers a great benefit of creating different marketing opportunities by using different themes or product offerings. Opencart has several useful reports that are included by default. [...]]]></description>
				<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-335" title="opencart-logo" src="http://www.reloadedpc.com/wp-content/uploads/2012/05/opencart-logo.png" alt="Opencart Sales Report by Store vQmod opencart logo " width="268" height="50" />I just recently started looking at <a title="OpenCart" href="http://www.opencart.com">Opencart</a> for an open source ecommerce platform.  It has a nice clean MVC codebase, and has support for multiple stores. Having multiple stores offers a great benefit of creating different marketing opportunities by using different themes or product offerings. Opencart has several useful reports that are included by default. Wanting to use Opencart for multiple stores, I saw that the Sales Order report didn&#8217;t allow you to view sales by store.  I put together this vQmod xml file for Opencart 1.5.2.1 that adds a drop down filter for store names.</p>
<p>Download <a href="http://www.reloadedpc.com/wp-content/uploads/2012/05/vqmod_sales_order_by_store.zip">Sales Order Report by Storee vQmod</a> for Opencart 1.5.2</p>
<p><a href="http://www.reloadedpc.com/wp-content/uploads/2012/05/opencart-sales-order-by-store.jpg"><img class="aligncenter size-full wp-image-338" title="opencart-sales-order-by-store" src="http://www.reloadedpc.com/wp-content/uploads/2012/05/opencart-sales-order-by-store.jpg" alt="Opencart Sales Report by Store vQmod opencart sales order by store " width="595" height="218" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/opencart/opencart-sales-report-store-vqmod/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zencart Twitter Sync Coupons</title>
		<link>http://www.reloadedpc.com/zen-cart/zencart-twitter-sync-coupons/</link>
		<comments>http://www.reloadedpc.com/zen-cart/zencart-twitter-sync-coupons/#comments</comments>
		<pubDate>Fri, 23 Mar 2012 00:00:52 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Zen-Cart]]></category>
		<category><![CDATA[coupons]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[zencart]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=324</guid>
		<description><![CDATA[This is my latest add on from Zencart. This addon for Zencart allows a store owner to add a twitter has tag on the coupon admin page. Customers will need to register their twitter usernames with you store. Once this is all setup a user can tweet the Twitter hash tag, and they will be [...]]]></description>
				<content:encoded><![CDATA[<div id="attachment_18" class="wp-caption alignright" style="width: 156px"><a href="http://www.reloadedpc.com/wp-content/uploads/2009/07/zen-cart-logo.png"><img class="size-full wp-image-18" title="zen-cart-logo" src="http://www.reloadedpc.com/wp-content/uploads/2009/07/zen-cart-logo.png" alt="Zencart Twitter Sync Coupons zen cart logo " width="146" height="40" /></a><p class="wp-caption-text">Zen-Cart</p></div>
<p>This is my latest add on from Zencart. This addon for Zencart allows a store owner to add a twitter has tag on the coupon admin page. Customers will need to register their twitter usernames with you store. Once this is all setup a user can tweet the Twitter hash tag, and they will be emailed the actual coupon code/offer. The Twitter hash tag can anything you set, but you would like would want something unique to your store.</p>
<p>This still allows all the same feature and benefits of standard coupons in Zencart. You can still set the minimum order, expiration date, and number of redemptions. Anytime a user has been emailed the coupon for the Twitter hash tag, Zencart will log it, so a user will only get emailed once. This also allows for the possibility to see who has tweeted which hashtags, and when.</p>
<p><span id="more-324"></span></p>
<p>There are two original zencart files for create account that have to edited (included in download), to add the Twitter username to their account. The only requirement for this to work is to setup a cron job. A cron job is the name for a file/script that automatically runs at a set time. This addon does not require any API keys, or even have a Twitter account.  This uses Twitters GET method to fetch the hash tags. The searches are limited to 150 requests per hour.  You will need to take  how many hash tags you will be tracking, and divide that number into 150.</p>
<p>Example:</p>
<p>You are going to track 3 hash tags. 150 (request limit) / 3 (# of hash tags) = 50 request / hour. That&#8217;s a little less than a minute, so you would want to set your cron job to run, at most, every 2 minutes. You can set a longer period time, but Twitter allows you to fetch the last 100 tweets for a hash tag. You can set the time limit to be longer if you know you will not receive that many tweets in the 2 minute time period.</p>
<p>Installation:</p>
<ol>
<li>Merge/copy the  orginal files:<br />
includes/modules/pages/account_edit.php<br />
admin/coupon_admin.php</li>
<li>Rename the two file locations to match the name of your template in the zip package<br />
includes/modules/CUSTOM<br />
includes/templates/CUSTOM</li>
<li>Upload the rest of the zip package.</li>
<li>Login to your admin page</li>
<li>Click link at top of page to install Twitter Coupons</li>
<li>Add a hashtag to a coupon</li>
<li>Setup cron job for the file /cron_twitter_coupons.php</li>
<li>Donate to this cool add on <img src='http://www.reloadedpc.com/wp-includes/images/smilies/icon_smile.gif' alt="Zencart Twitter Sync Coupons icon smile " class='wp-smiley' title="Zencart Twitter Sync Coupons" /> </li>
</ol>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="image" name="submit" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" alt="PayPal - The safer, easier way to pay online!" /> <img title="Zencart Custom Session Length" src="https://www.paypal.com/en_US/i/scr/pixel.gif" alt="Zencart Twitter Sync Coupons pixel " width="1" height="1" border="0" /></form>
<p>Download <a href="https://bitbucket.org/pickupman/zencart-twitter-coupons/get/tip.zip" target="_blank">Zencart Twitter Coupons</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/zen-cart/zencart-twitter-sync-coupons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Convert CSV Price Matrix to MySQL Table</title>
		<link>http://www.reloadedpc.com/php/php-convert-csv-price-matrix-mysql-table/</link>
		<comments>http://www.reloadedpc.com/php/php-convert-csv-price-matrix-mysql-table/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 03:53:33 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=313</guid>
		<description><![CDATA[Recently, I had needed to convert a CSV file that was based on a price matrix based a width by height chart. The products had different size increments for width and height and products. I needed to come up with a solution for making this work dynamically. The price matrix works by finding the column [...]]]></description>
				<content:encoded><![CDATA[<p>Recently, I had needed to convert a CSV file that was based on a price matrix based a width by height chart. The products had different size increments for width and height and products. I needed to come up with a solution for making this work dynamically.</p>
<p>The price matrix works by finding the column of the closest width (x) without going over, then finding the closest height (y) without going over. Then where coordinates (x,y) intersect reads a price. The price matrix below shows about a 1/3 of the actual table. <a href="http://www.reloadedpc.com/wp-content/uploads/2012/02/price_matrix.jpg"><img class="aligncenter size-full wp-image-314" title="pricecmatrix" src="http://www.reloadedpc.com/wp-content/uploads/2012/02/price_matrix.jpg" alt="PHP Convert CSV Price Matrix to MySQL Table price matrix " width="496" height="200" /></a></p>
<p>In order to easily create the CSV file was by a handy little trick using Excel. The table above is from a web page, so by copying the HTML table into its own file, and then save with a .xls extension. Open the Excel file, and then save file as a CSV file.  This was a little bit of clicking, but this is an extemely easy way to create the CSV file with the price matrix to convert to MySQL.</p>
<p>Now the that CSV was created, I needed a way to parse the file in PHP to get both the width and height columns and corresponding price.  I knew using some of the built in functions like fgetscsv is fine for just needing rows of data. I did some searches on some forums I frequent, and found <a href="http://hg.mijnpraktijk.com/csv-library/overview">CSV Library</a>. It was written by Jelmer, an active member, and was being used with CodeIgniter.  The library is a simple class wrapper with few handy features that made this all work. There were some built in methods that allowed to get column names, remove colums, and manipulate the content.</p>
<p>Now for some the code to make this all work:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//include CSV Reader class</span>
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'CSVReader.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//create CSV object</span>
<span style="color: #000088;">$csv</span> <span style="color: #339933;">=</span> Csv<span style="color: #339933;">::</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pricing.csv'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//store CSV contents</span>
<span style="color: #000088;">$cells</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$csv</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Cell contents is now available, we need to get the width column and the row with the heights.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//Get height column before removing it from cells</span>
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cells</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$columns</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$cells</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//remove the first column from every row since these are our height increments</span>
<span style="color: #000088;">$csv</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">remove_column</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//get cell contents again</span>
<span style="color: #000088;">$cells</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$csv</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//get the row of width increments</span>
<span style="color: #000088;">$stack</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$csv</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_names</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//remove first blank cell in the height row because this was a placeholder</span>
<span style="color: #000088;">$field_names</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_shift</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$stack</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>At this point we have the width increments, height increments, and cell contents (prices) in arrays. Next we need to loop through the cells of prices in the matrix to find the respective width and height.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>25
26
27
28
29
30
31
32
33
34
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//Put it back together</span>
<span style="color: #666666; font-style: italic;">//loop through each row</span>
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cells</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">//loop through each column to pair row index with height index with price</span>
    <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$j</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #000088;">$j</span> <span style="color: #339933;">&lt;</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cells</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000088;">$j</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;INSERT INTO frames (width,height,price) VALUES('&quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&quot;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$stack</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$j</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;','&quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&quot;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$columns</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;','&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$cells</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$j</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;');&quot;</span><span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&lt;br/&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>    
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>This echoes out some sql statments that you would want to import into your MySQL table. So, now we have converted the price matrix HTML table to a CSV file, and have imported it into MySQL. Now we need to use the database table to lookup a price. This is very easy and straightforward to do with one simple query.</p>
<p>This is how the table looks</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #CC0099;">+-------+--------+-------+</span>
<span style="color: #CC0099;">|</span> width <span style="color: #CC0099;">|</span> height <span style="color: #CC0099;">|</span> price <span style="color: #CC0099;">|</span>
<span style="color: #CC0099;">+-------+--------+-------+</span>
<span style="color: #CC0099;">|</span>    <span style="color: #008080;">24</span> <span style="color: #CC0099;">|</span>     <span style="color: #008080;">36</span> <span style="color: #CC0099;">|</span>   <span style="color: #008080;">132</span> <span style="color: #CC0099;">|</span>
<span style="color: #CC0099;">|</span>    <span style="color: #008080;">24</span> <span style="color: #CC0099;">|</span>     <span style="color: #008080;">42</span> <span style="color: #CC0099;">|</span>   <span style="color: #008080;">145</span> <span style="color: #CC0099;">|</span>
<span style="color: #CC0099;">|</span>    <span style="color: #008080;">24</span> <span style="color: #CC0099;">|</span>     <span style="color: #008080;">48</span> <span style="color: #CC0099;">|</span>   <span style="color: #008080;">154</span> <span style="color: #CC0099;">|</span>
<span style="color: #CC0099;">|</span>    <span style="color: #008080;">24</span> <span style="color: #CC0099;">|</span>     <span style="color: #008080;">54</span> <span style="color: #CC0099;">|</span>   <span style="color: #008080;">163</span> <span style="color: #CC0099;">|</span>
<span style="color: #CC0099;">|</span>    <span style="color: #008080;">24</span> <span style="color: #CC0099;">|</span>     <span style="color: #008080;">60</span> <span style="color: #CC0099;">|</span>   <span style="color: #008080;">174</span> <span style="color: #CC0099;">|</span>
<span style="color: #CC0099;">|</span>    <span style="color: #008080;">24</span> <span style="color: #CC0099;">|</span>     <span style="color: #008080;">66</span> <span style="color: #CC0099;">|</span>   <span style="color: #008080;">184</span> <span style="color: #CC0099;">|</span>
<span style="color: #CC0099;">|</span>    <span style="color: #008080;">24</span> <span style="color: #CC0099;">|</span>     <span style="color: #008080;">72</span> <span style="color: #CC0099;">|</span>   <span style="color: #008080;">194</span> <span style="color: #CC0099;">|</span>
<span style="color: #CC0099;">|</span>    <span style="color: #008080;">24</span> <span style="color: #CC0099;">|</span>     <span style="color: #008080;">78</span> <span style="color: #CC0099;">|</span>   <span style="color: #008080;">207</span> <span style="color: #CC0099;">|</span>
<span style="color: #CC0099;">|</span>    <span style="color: #008080;">24</span> <span style="color: #CC0099;">|</span>     <span style="color: #008080;">84</span> <span style="color: #CC0099;">|</span>   <span style="color: #008080;">217</span> <span style="color: #CC0099;">|</span>
<span style="color: #CC0099;">|</span>    <span style="color: #008080;">24</span> <span style="color: #CC0099;">|</span>     <span style="color: #008080;">90</span> <span style="color: #CC0099;">|</span>   <span style="color: #008080;">229</span> <span style="color: #CC0099;">|</span>
<span style="color: #CC0099;">+-------+--------+-------+</span></pre></td></tr></table></div>

<p>Say we wanted to find the price for a frame that is 36&#8243; x 60&#8243;. We would use this query below:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">SELECT</span> price <span style="color: #990099; font-weight: bold;">FROM</span> frames <span style="color: #990099; font-weight: bold;">WHERE</span> width <span style="color: #CC0099;">&gt;=</span> <span style="color: #008080;">36</span> <span style="color: #CC0099; font-weight: bold;">AND</span> height <span style="color: #CC0099;">&gt;=</span> <span style="color: #008080;">60</span> <span style="color: #990099; font-weight: bold;">ORDER BY</span> height<span style="color: #000033;">,</span> width <span style="color: #990099; font-weight: bold;">LIMIT</span> <span style="color: #008080;">1</span><span style="color: #000033;">;</span></pre></td></tr></table></div>

<p>This will return the result 235, and if you look in the example price matrix grid above you will see the same number. The query works by finding all rows as big or bigger than the given size. The ORDER BY clause will sort the results from smallest to largest. Since we want the smallest possible step in the matrix the LIMIT 1, retrieves the first row.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/php/php-convert-csv-price-matrix-mysql-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Samsung Fascinate + CM7 + usb tethering</title>
		<link>http://www.reloadedpc.com/other/samsung-fascinate-cm7-usb-tethering/</link>
		<comments>http://www.reloadedpc.com/other/samsung-fascinate-cm7-usb-tethering/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 19:18:10 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[cyanogenmod]]></category>
		<category><![CDATA[fascinate]]></category>
		<category><![CDATA[tether]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=302</guid>
		<description><![CDATA[I was recently needing Internet access on a desktop PC with Windows XP SP3 installed using a Samsung Fascinate running CyanogenMod 7(CM7). USB tethering had work easily using under Windows 7, but Windows XP would not recognize the USB device. Digging through dozens of posts and forums I found  the information from Google. Google as [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.cyanogenmod.com"><img class="alignright size-full wp-image-305" title="CyanogenMod Logo" src="http://www.reloadedpc.com/wp-content/uploads/2011/12/cyan-logo.png" alt="Samsung Fascinate + CM7 + usb tethering cyan logo " width="111" height="105" /></a>I was recently needing Internet access on a desktop PC with Windows XP SP3 installed using a Samsung Fascinate running CyanogenMod 7(CM7). USB tethering had work easily using under Windows 7, but Windows XP would not recognize the USB device. Digging through dozens of posts and forums I found  the information from Google. Google as a help topic for installing Android based phones as USB modem interface using the <a href="http://support.google.com/mobile/bin/answer.py?hl=en&amp;answer=182134">tetherxp.inf</a> file. I downloaded the file, and tried plugging in my Fascinate, enabled USB tethering, and still could not get Windows XP to recognize the USB device for tethering. So, here was a simple fix I got to get this working.</p>
<p>I opened up the the tetherxp.inf file and save a few of the usb identifiers for installing the device. You will see a line like this.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>AndroidDevices<span style="">&#93;</span></span>
<span style="color: #666666; font-style: italic;">; Google Nexus One without adb</span>
%AndroidDevice%    <span style="color: #000066; font-weight:bold;">=</span> RNDIS, USB\VID_18D1&amp;PID_4E13</pre></td></tr></table></div>

<p>I then opened Device Manager in Windows XP by right-clicking on My Computer-&gt;Properties, click on Hardware tab, and then Device Manger button. There was the unrecognized USB device with the yellow question mark icon. I right-clicked on the item and chose Properties. Then click on the Details tab at the top. Here I could see the USB device ID. I copied those values into my tetherxp.inf file to see what would happen. My section of tetherxp.inf now looks like:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>AndroidDevices<span style="">&#93;</span></span>
<span style="color: #666666; font-style: italic;">;Samsung Fascinate i500</span>
%AndroidDevice%    <span style="color: #000066; font-weight:bold;">=</span> RNDIS, USB\VID_18D1&amp;PID_4E24
&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>AndroidDevices.NT.5.1<span style="">&#93;</span></span>
<span style="color: #666666; font-style: italic;">; Samsung Fascinate i500 with adb</span>
%AndroidDevice%    <span style="color: #000066; font-weight:bold;">=</span> RNDIS.NT.5.1, USB\VID_18D1&amp;PID_4E24</pre></td></tr></table></div>

<p>Saved the file. Back on the Details tab, I clicked on the Driver tab for the device, and clicked Update Driver button. Choose the tetherxp.inf you have saved. Windows XP will propmpt to accept to install and unsigned driver. Click Continue Anyway. It will proceed to install the device and will be named Android USB/RNDIS Ethernet. Your computer should then be able to connect now being tethered via the USB cable.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/other/samsung-fascinate-cm7-usb-tethering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zencart Reloaded Advanced Search module</title>
		<link>http://www.reloadedpc.com/zen-cart/zencart-reloaded-advanced-search-module/</link>
		<comments>http://www.reloadedpc.com/zen-cart/zencart-reloaded-advanced-search-module/#comments</comments>
		<pubDate>Sat, 13 Aug 2011 16:46:37 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Zen-Cart]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=296</guid>
		<description><![CDATA[This module will help the relevancy of the products returned on your zencart advanced search results. The stock search runs a LIKE query for each word in the query. There is no regard to the relevancy of the word for the product associated with it.  When a user searches using a adjective like a color [...]]]></description>
				<content:encoded><![CDATA[<div id="attachment_18" class="wp-caption alignright" style="width: 156px"><a href="http://www.reloadedpc.com/wp-content/uploads/2009/07/zen-cart-logo.png"><img class="size-full wp-image-18" title="zen-cart-logo" src="http://www.reloadedpc.com/wp-content/uploads/2009/07/zen-cart-logo.png" alt="Zencart Reloaded Advanced Search module zen cart logo " width="146" height="40" /></a><p class="wp-caption-text">Zen-Cart</p></div>
<p>This module will help the relevancy of the products returned on your zencart advanced search results. The stock search runs a LIKE query for each word in the query. There is no regard to the relevancy of the word for the product associated with it.  When a user searches using a adjective like a color red, any product with &#8220;red&#8221; will be returned.  Now make the search &#8220;red shoes&#8221;, and you will receive any product with red or shoes. You may get red shirts, black shoes,  white shoes, or any other variation. As long as one of the words is in the name, model, description, or keywords it will be shown. Obvisously red shirts and white shoes are nothing like the users original query.  This zencart advanced search module uses a natural language search function in MySQL which will return more accurate results for multi keyword search phrases. Each keyword searched, is scored for its relevancy for each product, and the results are ordered by this relevancy score. It will also try to pluralize words to expand the search.  The module will create a configuration group in your admin panel for setting the weights for the product columns that are searched. The default values seem to be returning accurate results.</p>
<p>Only one original file is overwritten in /includes/modules/pages/advanced_search_result/header_php.php. Only a few lines where changed to modify the query being ran for the results. Installation is simple as uploading the zip file to your zencart installation. Login to your admin panel, and you will be prompted with a link to install the module. The installation link will install the proper database queries, and take you to the configuration page under Admin-&gt;Configuration-&gt;Reloaded Search.</p>
<p>An additional feature, is when only one product is returned in the search results, the product is displayed rather than the search result page.</p>
<p><a href="https://bitbucket.org/pickupman/zencart-reloaded-search/overview">Download Zencart Reloaded Search</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/zen-cart/zencart-reloaded-advanced-search-module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WAMP + CodeIgniter + Sparks</title>
		<link>http://www.reloadedpc.com/code-igniter/wamp-codeigniter-sparks/</link>
		<comments>http://www.reloadedpc.com/code-igniter/wamp-codeigniter-sparks/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 15:16:26 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[wamp]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=290</guid>
		<description><![CDATA[I was recently decided to give the Get Sparks project a try. If you are not familiar with the Get Sparks project for Codeigniter, it allows you to download packages/modules for quickly installing into your app. Similar to the idea with PEAR extensions for PHP. I am setting this up on my Windows box using [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.reloadedpc.com/wp-content/uploads/2009/07/ci_logo_flame.jpg"><img class="alignright size-full wp-image-41" title="CodeIgniter Logo" src="http://www.reloadedpc.com/wp-content/uploads/2009/07/ci_logo_flame.jpg" alt="WAMP + CodeIgniter + Sparks  ci logo flame " width="150" height="164" /></a>I was recently decided to give the <a title="Get Sparks" href="http://getsparks.org">Get Sparks</a> project a try. If you are not familiar with the Get Sparks project for Codeigniter, it allows you to download packages/modules for quickly installing into your app. Similar to the idea with PEAR extensions for PHP. I am setting this up on my Windows box using WAMP. I followed the setup instructions from the Get Sparks website, and everything went perfectly fine. I decided to download the popular spark &#8220;curl&#8221;, and kept getting the:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">&quot;You have to install PECL ZipArchive or `unzip` to install this spark.&quot;</pre></td></tr></table></div>

<p> I kept checking in my php.ini file that php_zip.dll was enabled.  Hmmm&#8230;..</p>
<p>So, I decided to create a test script to test the code that was creating this error message. Running the PHP script in the browser ran ZipArchive() successfully. Next, I ran this test PHP script from the command line (CLI). I got a &#8220;Fatal Error:  Class ZipArchive not found in &#8230;&#8221; error. I couldn&#8217;t quite figure out why PHP was throwing an error on the CLI and not when run in the browser. A little digging found that PHP run from the command line uses relative paths including php.ini. This the part where WAMP comes into play. For those using WAMP, your php.ini file that is used is located in<strong> C:\wamp\bin\apache\Apache2.2.11\bin</strong> not where PHP is being executed from. Ah ha! So I went and opened <strong>C:\wamp\bin\php\php5.2.9-2</strong> and scrolled down to find:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">;extension=php_zip.dll</pre></td></tr></table></div>

<p>So I changed this to:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">extension=php_zip.dll</pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">php tools\spark install -v1.2.0 curl</pre></td></tr></table></div>

<p>Enabling php_zip.dll in the PHP folder of WAMP, and ran the Sparks command again. Success! The spark was downloaded, unzipped, and installed with no more error.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/code-igniter/wamp-codeigniter-sparks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zencart + USPS Webtools with Multiple Package Support</title>
		<link>http://www.reloadedpc.com/zen-cart/zencart-usps-webtools-multiple-package-support/</link>
		<comments>http://www.reloadedpc.com/zen-cart/zencart-usps-webtools-multiple-package-support/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 16:22:27 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Zen-Cart]]></category>
		<category><![CDATA[shipping]]></category>
		<category><![CDATA[usps]]></category>
		<category><![CDATA[zencart]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=282</guid>
		<description><![CDATA[This is another shipping module for Zencart. I have been working on the UPS XML module for awhile now. I have ported over the more advanced packing algorithm from the UPS module, to allow packing support in the USPS shipping module. This module allows Zencart to calculate shipping for multiple boxes for a freight quote. [...]]]></description>
				<content:encoded><![CDATA[<div id="attachment_18" class="wp-caption alignright" style="width: 156px"><a href="http://www.reloadedpc.com/wp-content/uploads/2009/07/zen-cart-logo.png"><img class="size-full wp-image-18" title="zen-cart-logo" src="http://www.reloadedpc.com/wp-content/uploads/2009/07/zen-cart-logo.png" alt="Zencart + USPS Webtools with Multiple Package Support zen cart logo " width="146" height="40" /></a><p class="wp-caption-text">Zen-Cart</p></div>
<p>This is another shipping module for Zencart. I have been working on the UPS XML module for awhile now. I have ported over the more advanced packing algorithm from the UPS module, to allow packing support in the USPS shipping module. This module allows Zencart to calculate shipping for multiple boxes for a freight quote. The default behavior for Zencart is to place all items in one box with a total weight to send for quote. With this updated USPS shipping module, items will be packed into boxes you enter, or you may set items to always be packaged separately. The module then returns the aggregate shipping cost for your packages. This should provide much more accurate shipping quotes.<span id="more-282"></span>You can download the module from <a title="bitbucket.org" href="https://bitbucket.org/pickupman/zencart-uspsxml" target="_blank">bitbucket.org</a>. In the upper right hand corner highlight over &#8220;get source&#8221;, and click on zip to download the files. Found a bug? Or what to update the code, please fork my project, or send me your revisions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/zen-cart/zencart-usps-webtools-multiple-package-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeIgniter + UPS Worldship</title>
		<link>http://www.reloadedpc.com/code-igniter/codeigniter-ups-worldship/</link>
		<comments>http://www.reloadedpc.com/code-igniter/codeigniter-ups-worldship/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 22:00:19 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[odbc]]></category>
		<category><![CDATA[ups worldship]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=259</guid>
		<description><![CDATA[This is a post I have been to get around to for quite awhile. At work we have UPS Worldship installed on our desktops for shipping out packages. I had written a small php script that could open the UPS Worldship database, and report all of our tracking numbers with links. UPS had switched from [...]]]></description>
				<content:encoded><![CDATA[<p>This is a post I have been to get around to for quite awhile. At work we have UPS Worldship<a href="http://codeigniter.com"><img class="alignright size-full wp-image-41" title="CodeIgniter Logo" src="http://www.reloadedpc.com/wp-content/uploads/2009/07/ci_logo_flame.jpg" alt="CodeIgniter + UPS Worldship ci logo flame " width="150" height="164" /></a> installed on our desktops for shipping out packages. I had written a small php script that could open the UPS Worldship database, and report all of our tracking numbers with links. UPS had switched from being an unprotected Microsoft Access database file, to using a Microsoft SQL (MSSQL database). This kind of broke my little php script I had written, but I was eventual able to work something together. Recently, I installed the latest update UPS Worldship 2010 Version 12. Wouldn&#8217;t you know it, broken again. I couldn&#8217;t get my little script working again. ODBC access had been removed from this version. I could no longer connect to the MS SQL  dabatabe for UPS Worldship.</p>
<p><span id="more-259"></span> It seemed the only option was to buy some 3rd party software USP authorizes to connect to the database. Digging through the internet, I found a nice little utility call <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796">Microsoft SQL Server Management Studio Express</a> that allows you to access the USP database instance. Once you install the software open the program.</p>
<p>Fill in the Server Name box (usually Servername\UPSWSDBSERVER), and click connect. In the left hand window, double click on the Security folder. You will see a list of logins. You now need to create a new user.</p>
<p>Right click on the right pane, and choose New Login. Type in your Login Name in the top, and now select the SQL Server Login radio box. Type in your password.</p>
<p>At the bottom for Default Database select &#8220;master&#8221; from the drop down box. In the left pane of the window, there is a link for Server Roles. Click on Server Roles, and check all boxes in the right pane to add all rights to your login. Hey you are into the database, you might as well give yourself full access right?</p>
<p>Save your login, and it&#8217;s time to setup an ODBC connection for Codeigniter to use. Open the Control Panel-&gt;Administrative Tools-&gt;Data Sources (ODBC).</p>
<p>Click on the System DSN tab, and then the Add button. Under Name type in a with no spaces. I used UPS_WS_12 for mine. In the description you can enter anything. In the server box click on the dropdown and select your UPS server databse instance. It should be something like ServerName\UPSWSDBSERVER. Click on the Next button.</p>
<p><a href="http://www.reloadedpc.com/wp-content/uploads/2010/11/codeigniter_ups_09112010_162448.jpg"><img class="aligncenter size-medium wp-image-266" title="codeigniter_ups_step1" src="http://www.reloadedpc.com/wp-content/uploads/2010/11/codeigniter_ups_09112010_162448-300x196.jpg" alt="CodeIgniter + UPS Worldship codeigniter ups 09112010 162448 300x196 " width="300" height="196" /></a>Now fill out the options as shown below. Fill in the login credentials as entered in the UPS database. Then, click on the Next button.</p>
<p><a href="http://www.reloadedpc.com/wp-content/uploads/2010/11/codeigniter_ups_09112010_162603.jpg"><img class="aligncenter size-medium wp-image-267" title="codeigniter_ups_step2" src="http://www.reloadedpc.com/wp-content/uploads/2010/11/codeigniter_ups_09112010_162603-300x196.jpg" alt="CodeIgniter + UPS Worldship codeigniter ups 09112010 162603 300x196 " width="300" height="196" /></a>Select upswsdb from the dropdown box as shown. Then, click on the Next button.</p>
<p><a href="http://www.reloadedpc.com/wp-content/uploads/2010/11/codeigniter_ups_09112010_162619.jpg"><img class="aligncenter size-medium wp-image-268" title="codeigniter_ups_step3" src="http://www.reloadedpc.com/wp-content/uploads/2010/11/codeigniter_ups_09112010_162619-300x196.jpg" alt="CodeIgniter + UPS Worldship codeigniter ups 09112010 162619 300x196 " width="300" height="196" /></a>The options show will probably be set by default. Click on Finish button. Your connection should now be created. You may click on Test Data Source button, and you should connect successfully.</p>
<p><a href="http://www.reloadedpc.com/wp-content/uploads/2010/11/codeigniter_ups_09112010_162628.jpg"><img class="aligncenter size-medium wp-image-265" title="codeigniter_ups_step4" src="http://www.reloadedpc.com/wp-content/uploads/2010/11/codeigniter_ups_09112010_162628-300x196.jpg" alt="CodeIgniter + UPS Worldship codeigniter ups 09112010 162628 300x196 " width="300" height="196" /></a>Close your the ODBC screen, and open up your codeigniter application folder. Here are the connections settings you will need to use for application/config/database.php</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$active_group</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;default&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$db</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'hostname'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;UPS_WS_12&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//System DSN name you created</span>
<span style="color: #000088;">$db</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'username'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;username&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Username as entered in ODBC connection</span>
<span style="color: #000088;">$db</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;password&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Password as entered in ODBC connection</span>
<span style="color: #000088;">$db</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'database'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$db</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dbdriver'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;odbc&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$db</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dbprefix'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$db</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'pconnect'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$db</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'db_debug'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$db</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cache_on'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>If you are interested in a SQL query to view completed shipments with all the shipping details for you shipping log try out this query:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">db</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT * FROM upswsdb.dbo.calPkgAgent a 
   JOIN upswsdb.dbo.calShipment s ON a.m_primaryKey=s.m_foreignKey00 
   JOIN upswsdb.dbo.calPackage p ON s.m_primaryKey=p.m_foreignKey 
   WHERE s.m_shipDataSet='eod' AND s.m_isVoid='0' 
   ORDER BY s.m_shipDateTime DESC&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>To view pending shipments that have not been processed by End of Day, change s.m_shipDataSet=&#8217;eod&#8217; to s.m_shipDataSet != &#8216;eod&#8217;. I use this simple little codeigniter application to view all of my UPS Worldship data. This makes it very easy to paginate the results, and provide real time access to tracking data. Much easier than trying to open UPS Worldship on a workstation that does not have it open or security rights to view the shipping log.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/code-igniter/codeigniter-ups-worldship/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeIgniter + Chargify</title>
		<link>http://www.reloadedpc.com/code-igniter/codeigniter-chargify/</link>
		<comments>http://www.reloadedpc.com/code-igniter/codeigniter-chargify/#comments</comments>
		<pubDate>Sat, 18 Sep 2010 14:45:53 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[chargify]]></category>
		<category><![CDATA[codeigniter]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=255</guid>
		<description><![CDATA[I recently began integrating the Chargify service into a web app I am coding for codeigniter. Chargify is seems to be a slick web service for creating subscription based services. They provide a strong API, and along with a slick web based dashboard (GUI). One of the points on using the API are Chargify postbacks. [...]]]></description>
				<content:encoded><![CDATA[<p>I recently began integrating the Chargify service into a web app I am coding for codeigniter. <a href="http://codeigniter.com"><img class="alignright size-full wp-image-41" title="CodeIgniter Logo" src="http://www.reloadedpc.com/wp-content/uploads/2009/07/ci_logo_flame.jpg" alt="CodeIgniter + Chargify ci logo flame " width="150" height="164" /></a> Chargify is seems to be a slick web service for creating subscription based services. They provide a strong API, and along with a slick web based dashboard (GUI). One of the points on using the API are Chargify postbacks. I did some quick googling and didn&#8217;t turn up much in the way of chargify and codeigniter. I did find a great library for integrating the API called <a href="http://chargeigniter.com/">ChargeIgniter</a>.</p>
<p>Chargify will send a json array back a POST var to your site. The docs for Chargify don&#8217;t state what variable they are submitted as. This is what I came up with.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> post_back<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000088;">$body</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;php://input&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$replace</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'['</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">']'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$replacements</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$body</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">','</span><span style="color: #339933;">,</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$replace</span><span style="color: #339933;">,</span> <span style="color: #000088;">$replacements</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
       <span style="color: #666666; font-style: italic;">//$body now contains array of subscription ID's</span>
       <span style="color: #666666; font-style: italic;">//Iterate through returned subscription IDs</span>
       <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$body</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$subscription_id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$subscription</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">chargify</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_subscription</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$subscription_id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #666666; font-style: italic;">//Do something here with $subscription details</span>
      <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/code-igniter/codeigniter-chargify/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching using disk: basic
Object Caching 1082/1212 objects using disk: basic

Served from: www.reloadedpc.com @ 2013-06-19 20:40:07 -->