<?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>dijexi.com &#187; accounting system</title>
	<atom:link href="http://www.dijexi.com/tag/accounting-system/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dijexi.com</link>
	<description>free programming tutorial, tips and tricks on php, codeigniter, delphi, dotnet, ajax and more..</description>
	<lastBuildDate>Fri, 13 Jan 2012 23:21:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>CodeIgniter Tutorial: [Creating Accounting Application] Part 5 The Mainpage</title>
		<link>http://www.dijexi.com/2010/05/codeigniter-tutorial-creating-accounting-application-part-5-the-mainpage/</link>
		<comments>http://www.dijexi.com/2010/05/codeigniter-tutorial-creating-accounting-application-part-5-the-mainpage/#comments</comments>
		<pubDate>Tue, 04 May 2010 02:31:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[accounting system]]></category>
		<category><![CDATA[main controller]]></category>

		<guid isPermaLink="false">http://www.dijexi.com/2010/05/codeigniter-tutorial-creating-accounting-application-part-5-the-mainpage/</guid>
		<description><![CDATA[Well I’m sorry, it’s been so long for this part to come.. I had been working very hard on some clients and don’t have enough time to write. Here’s what I had been done if you’re curious :) : http://maps.GpsTrackingIndonesia.com, www.SunberryCorp.com, www.mypushme.com, www.kulacak.com, www.web2trace.com, www.pushmeportal.com, … The fun is almost all of them was written [...]]]></description>
			<content:encoded><![CDATA[<!--INFOLINKS_ON--><p>Well I’m sorry, it’s been so long for this part to come.. I had been working very hard on some clients and don’t have enough time to write. Here’s what I had been done if you’re curious :) : <a href="http://maps.GpsTrackingIndonesia.com">http://maps.GpsTrackingIndonesia.com</a>, <a href="http://www.SunberryCorp.com">www.SunberryCorp.com</a>, <a href="http://www.mypushme.com">www.mypushme.com</a>, <a href="http://www.kulacak.com">www.kulacak.com</a>, <a href="http://www.web2trace.com">www.web2trace.com</a>, <a href="http://www.pushmeportal.com">www.pushmeportal.com</a>, … The fun is almost all of them was written with CodeIgniter :).</p>
<p>Ok, let’s start with the easiest one first. We will create a simple menu page that contains links to other modules on the system. We put it on the Mainpage controller class. </p>
<p>Look at the Mainpage.php controller file. There is a function on it named exactly the same with the filename: Mainpage(). This should be exactly the same including the case. This is the constructor or initialization function of the class. Each time the class is called or instantiate, this function is called automatically. We put some initialization lines inside it:</p>
<p> <span id="more-1317"></span>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">function</span> Mainpage<span class="br0">&#40;</span><span class="br0">&#41;</span>&nbsp;<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp;parent::<span class="me2">Controller</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;&nbsp; <br />
&nbsp; &nbsp; &nbsp;<span class="re0">$this</span>-&gt;<span class="me1">load</span>-&gt;<span class="me1">helper</span><span class="br0">&#40;</span><span class="st0">&#8216;url&#8217;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></div>
<p>The line <strong>parent::Controller() </strong>calls the constructor function of this class’s parent constructor which is the CodeIgniter’s Controller class so that it has all the properties and method of it’s parent.</p>
<p>Then, we load a helper library that contains helper functions related to URL handling such as site_url() to return the site’s URL that we are working on. Other functions on this helper are: anchor(), base_url(), uri_string(), etc. You can check it all on the user guide <a title="http://localhost/acct/user_guide/helpers/url_helper.html" href="http://localhost/user_guide/helpers/url_helper.html">http://localhost/user_guide/helpers/url_helper.html</a>.</p>
<p>Again, look at the Mainpage.php file. We added a new function called <strong>index()</strong>. This function is analogous to the index.html file in static web page. It’s called by default when we point our browser to the Mainpage controller, ie: <a href="http://localhost/index.php/Mainpage">http://localhost/index.php/Mainpage</a>.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">public</span> <span class="kw2">function</span> index<span class="br0">&#40;</span><span class="br0">&#41;</span> <br />
<span class="br0">&#123;</span> <br />
&nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">load</span>-&gt;<span class="me1">view</span><span class="br0">&#40;</span><span class="st0">&#8216;header&#8217;</span><span class="br0">&#41;</span>; <br />
&nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">load</span>-&gt;<span class="me1">view</span><span class="br0">&#40;</span><span class="st0">&quot;main_menu&quot;</span><span class="br0">&#41;</span>; <br />
&nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">load</span>-&gt;<span class="me1">view</span><span class="br0">&#40;</span><span class="st0">&#8216;footer&#8217;</span><span class="br0">&#41;</span>; <br />
&nbsp; &nbsp; <span class="kw1">return</span>; <br />
<span class="br0">&#125;</span></div>
<p>On the function, we load view files. Here we divide the view into 3 pieces: header, main_menu, and footer. They are basically just regular PHP files dealing with display templates. This will make us easier to manage the look of our application later.</p>
<p>All of the view files should be located under <strong>system/application/views</strong> folder on CodeIgniter file structure. So we need to create all of them:</p>
<p>The <strong>header.php</strong> view file, contains the opening HTML tags, HEAD, TITLE and start of BODY. Later we can add CSS link definition here: </p>
<div class="dean_ch" style="white-space: wrap;">&lt;p&gt;&lt;!DOCTYPE HTML <span class="kw2">PUBLIC</span> <span class="st0">&quot;-//W3C//DTD HTML 3.2 Final//EN&quot;</span>&gt;</p>
<p>&lt;html&gt; &nbsp;<br />
&lt;head&gt;&lt;/p&gt;&lt;p&gt;&lt;title&gt;Cashbook application&lt;/title&gt; <br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;/p&gt;</div>
<p>&#160;</p>
<p>The <strong>footer.php</strong> view file, just a closing BODY and HTML tag, but you can later add your copyright notice, timestamps, etc:&#160;&#160; </p>
<p>&#160;</p>
<pre>&lt;/body&gt;
&lt;/html&gt;</pre>
<p>And the <strong>main_menu.php</strong> view file. Here we write a list of links to modules that we are going to develop later:</p>
<div class="dean_ch" style="white-space: wrap;">&lt;p&gt;&lt;p&gt;Cash Book&lt;/p&gt;</p>
<p>&lt;ul&gt;</p>
<p>&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Cashbook/addNew/receive&quot;</span>,<span class="st0">&quot;Cash Receive Entry&quot;</span><span class="br0">&#41;</span><span class="kw2">?&gt;</span> &nbsp;<br />
&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Cashbook/addNew/out&quot;</span>,<span class="st0">&quot;Cash Out Entry&quot;</span><span class="br0">&#41;</span> <span class="kw2">?&gt;</span></p>
<p>&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Cashbook/viewReport&quot;</span>,<span class="st0">&quot;Cash Book Report&quot;</span><span class="br0">&#41;</span><span class="kw2">?&gt;</span> &nbsp;<br />
&lt;/ul&gt; &lt;/p&gt;<br />
&lt;p&gt;&lt;p&gt;Bank Book&lt;/p&gt; &nbsp;<br />
&lt;ul&gt;</p>
<p>&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Bankbook/addNew/receive&quot;</span>,<span class="st0">&quot;Bank Receive Entry&quot;</span><span class="br0">&#41;</span>;?&gt;<br />
&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Bankbook/addNew/out&quot;</span>,<span class="st0">&quot;Bank Out Entry&quot;</span><span class="br0">&#41;</span>;?&gt;<br />
&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Bankbook/viewReport&quot;</span>,<span class="st0">&quot;Bank Book Report&quot;</span><span class="br0">&#41;</span>;?&gt;<br />
&lt;/ul&gt; &lt;/p&gt;</p>
<p>&lt;p&gt;&lt;p&gt;Manual Journal&lt;/p&gt; &nbsp;<br />
&lt;ul&gt;<br />
&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Journal/addNew&quot;</span>,<span class="st0">&quot;Manual Journal Entry&quot;</span><span class="br0">&#41;</span><span class="kw2">?&gt;</span><br />
&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Journal/viewReport&quot;</span>,<span class="st0">&quot;Manual Journal Report&quot;</span><span class="br0">&#41;</span><span class="kw2">?&gt;</span><br />
&lt;/ul&gt; &lt;/p&gt;<br />
&lt;p&gt;&lt;p&gt;Report&lt;/p&gt;<br />
&lt;ul&gt; &nbsp;<br />
&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Mainpage/trialBalance&quot;</span>,<span class="st0">&quot;Trial Balance&quot;</span><span class="br0">&#41;</span><span class="kw2">?&gt;</span></p>
<p>&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Mainpage/balanceSheet&quot;</span>,<span class="st0">&quot;Balance Sheet&quot;</span><span class="br0">&#41;</span><span class="kw2">?&gt;</span> &nbsp;<br />
&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Mainpage/profitLoss&quot;</span>,<span class="st0">&quot;Profit and Loss&quot;</span><span class="br0">&#41;</span><span class="kw2">?&gt;</span></p>
<p>&lt;/ul&gt; &lt;/p&gt;</p>
<p>&lt;p&gt;&lt;p&gt;Posting and COA&lt;/p&gt;<br />
&lt;ul&gt;<br />
&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Mainpage/doPosting&quot;</span>,<span class="st0">&quot;Post transaction&quot;</span><span class="br0">&#41;</span><span class="kw2">?&gt;</span><br />
&lt;li&gt;&lt;?=anchor<span class="br0">&#40;</span><span class="st0">&quot;Coa/listCoa&quot;</span>,<span class="st0">&quot;Chart of Account Setting&quot;</span><span class="br0">&#41;</span><span class="kw2">?&gt;</span><br />
&lt;/ul&gt;&lt;/p&gt;</div>
<p>As we can see above, we call a helper function anchor(). This function will create a standard HTML anchor link based on your local site URL. So for example, if we call it <strong>achor(“Mainpage/trialBalance”, “Trial Balance”)</strong> then it will return this string:</p>
<p>&lt;a href=”http://localhost/Mainpage/trialBalance”&gt; Trial Balance &lt;/a&gt;</p>
<p>assumed that you have configured your site URL as <a href="http://localhost/">http://localhost/</a> on the config.php file.</p>
<p>Now we can run our application by pointing the browser to <a href="http://localhost">http://localhost</a> and it should return something like the following:</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2010/05/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.dijexi.com/wp-content/uploads/2010/05/image_thumb.png" width="404" height="484" /></a> </p>
<p>Congratulation! </p>
<p>Next we will begin to code the COA module.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:c2efec71-3808-442a-9518-d1db80ef5dca" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/codeigniter" rel="tag">codeigniter</a>,<a href="http://technorati.com/tags/main+controller" rel="tag">main controller</a>,<a href="http://technorati.com/tags/accounting+system" rel="tag">accounting system</a></div>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://www.dijexi.com/2009/07/codeigniter-tutorial-creating-accounting-application-part-1-setting-up-the-environment/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 1 Setting Up the Environment</a></li><li><a href="http://www.dijexi.com/2009/09/codeigniter-tutorial-creating-accounting-application-part-4-preparing-to-code/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 4 Preparing to Code</a></li><li><a href="http://www.dijexi.com/2009/08/codeigniter-tutorial-creating-accounting-application-part-2-the-application-specification-and-uml-diagrams/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 2 The Application Specification and UML Diagrams</a></li><li><a href="http://www.dijexi.com/2009/08/codeigniter-tutorial-creating-accounting-application-part-3-er-diagram-and-creating-database/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 3 ER Diagram and Creating Database</a></li><li><a href="http://www.dijexi.com/2009/06/codeigniter-konek-ke-port-mysql-tertentu-selain-3306/" rel="bookmark">CodeIgniter: koneksi ke port MySQL tertentu selain 3306</a></li></ul></div><!--INFOLINKS_OFF--><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.dijexi.com%2F2010%2F05%2Fcodeigniter-tutorial-creating-accounting-application-part-5-the-mainpage%2F&amp;linkname=CodeIgniter%20Tutorial%3A%20%5BCreating%20Accounting%20Application%5D%20Part%205%20The%20Mainpage"><img src="http://www.dijexi.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.dijexi.com/2010/05/codeigniter-tutorial-creating-accounting-application-part-5-the-mainpage/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>CodeIgniter Tutorial: [Creating Accounting Application] Part 3 ER Diagram and Creating Database</title>
		<link>http://www.dijexi.com/2009/08/codeigniter-tutorial-creating-accounting-application-part-3-er-diagram-and-creating-database/</link>
		<comments>http://www.dijexi.com/2009/08/codeigniter-tutorial-creating-accounting-application-part-3-er-diagram-and-creating-database/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 01:05:00 +0000</pubDate>
		<dc:creator>akhmad daniel sembiring</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[accounting system]]></category>
		<category><![CDATA[CodeIgniter tutorial]]></category>
		<category><![CDATA[ERD]]></category>
		<category><![CDATA[php tutorial]]></category>
		<category><![CDATA[UML]]></category>

		<guid isPermaLink="false">http://www.dijexi.com/2009/08/codeigniter-tutorial-creating-accounting-application-part-3-er-diagram-and-creating-database/</guid>
		<description><![CDATA[In the previous parts of this tutorial series we have discussed how to setup the application environment using XAMPP and CodeIgniter, and the application specification. We have done the analysis and design using UML use case and class diagram with free UML diagram tool StarUML. In this part, we will discuss the database design for [...]]]></description>
			<content:encoded><![CDATA[<!--INFOLINKS_ON--><p>In the previous parts of this tutorial series we have discussed how to setup the application environment using XAMPP and CodeIgniter, and the application specification. We have done the analysis and design using <a href="http://en.wikipedia.org/wiki/Unified_Modeling_Language">UML</a> use case and <a href="http://en.wikipedia.org/wiki/Class_diagram">class diagram</a> with free UML diagram tool <a href="http://staruml.sourceforge.net/en/">StarUML</a>. </p>
<p>In this part, we will discuss the database design for our application. This database is needed to hold the data for our application.</p>
<p>We are going to draw the entity relationship diagram (ERD) using a free tool called <a href="http://dev.mysql.com/downloads/workbench/5.1.html">MySQL workbench</a>, formerly <a href="http://www.fabforce.net/dbdesigner4/downloads.php">fabForce ERD tools</a> for MySQL. Before continuing, please <a href="http://dev.mysql.com/downloads/workbench/5.1.html" target="_blank">download the program here</a> and install it to your computer.</p>
<p>At the end of the designing process, we will create our database structure directly to a MySQL server that can be used by our application.</p>
<p> <span id="more-1160"></span><br />
<h2>The Tables </h2>
<p>For the purpose of our application requirements and based on UML use case we defined before, here is a list of mandatory tables that we must create on the application’s database.</p>
<table border="0" cellspacing="0" cellpadding="2" width="500">
<tbody>
<tr>
<td valign="top" width="250">
<p align="center"><strong>Table name</strong></p>
</td>
<td valign="top" width="250">
<p align="center"><strong>Purpose</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="250">coatype</td>
<td valign="top" width="250">store chart of account type data like assets, liability, equity, income, and cost</td>
</tr>
<tr>
<td valign="top" width="250">coa</td>
<td valign="top" width="250">store the actual chart of account data, should be multi level depth</td>
</tr>
<tr>
<td valign="top" width="250">cashbook</td>
<td valign="top" width="250">store the master cashbook document data</td>
</tr>
<tr>
<td valign="top" width="250">cashbook_detail</td>
<td valign="top" width="250">store the details cashbook document data</td>
</tr>
<tr>
<td valign="top" width="250">bankbook</td>
<td valign="top" width="250">store the master bankbook document data</td>
</tr>
<tr>
<td valign="top" width="250">bankbook_detail</td>
<td valign="top" width="250">store the details bankbook document data</td>
</tr>
<tr>
<td valign="top" width="250">journal</td>
<td valign="top" width="250">store the posted and unposted journal data for the purpose of accounting report generating process like balance sheet, income statement, and trial balance</td>
</tr>
<tr>
<td valign="top" width="250">&#160;</td>
<td valign="top" width="250">&#160;</td>
</tr>
<tr>
<td valign="top" width="250">&#160;</td>
<td valign="top" width="250">&#160;</td>
</tr>
</tbody>
</table>
<p>&#160;</p>
<h2>Creating Tables in MySQL Workbench</h2>
<p>Installing MySQL Workbench should not be a problem. I assumed that you already have done that. Now, run the program and you will see a blank workspace of MySQL model like this:</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/08/Blankmysqlmodelonmysqlworkbench.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Blank mysql model on mysql workbench" border="0" alt="Blank mysql model on mysql workbench" src="http://www.dijexi.com/wp-content/uploads/2009/08/Blankmysqlmodelonmysqlworkbench_thumb.png" width="504" height="408" /></a> </p>
<p>Click on Add Diagram icon to create our first diagram. You will see a blank page for drawing our diagram like this:</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/08/Blankdiagramonmysqlworkbench.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Blank diagram on mysql workbench" border="0" alt="Blank diagram on mysql workbench" src="http://www.dijexi.com/wp-content/uploads/2009/08/Blankdiagramonmysqlworkbench_thumb.png" width="504" height="408" /></a> </p>
<h3>Creating A New Table and Adding Fields</h3>
<p>Next, we need to draw a table. Click on the “Place a New Table” located on the left side of the blank diagram. Then place it on the middle of the blank page. After placing the table, you may resize it’s size so that we can see a tall rectangular like this:</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/08/Placeanewtableonthepage.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Place a new table on the page" border="0" alt="Place a new table on the page" src="http://www.dijexi.com/wp-content/uploads/2009/08/Placeanewtableonthepage_thumb.png" width="366" height="456" /></a> </p>
<p>Double click on the table to add it’s columns. You will see a new pane at the bottom of the page consisting the table properties like this:</p>
<p>&#160;<a href="http://www.dijexi.com/wp-content/uploads/2009/08/Setthenewtablename.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Set the new table name" border="0" alt="Set the new table name" src="http://www.dijexi.com/wp-content/uploads/2009/08/Setthenewtablename_thumb.png" width="391" height="683" /></a> </p>
<p>On the pane, there’s a lot of tab on it’s bottom part. Click the “Table” where we can give our new table a name. Create our first table called “cashbook”. </p>
<p>Next we need to define the table columns. Click on the “Columns” tab. You will see the following:</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/08/Setthefirstcolumnasprimarykey.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Set the first column as primary key" border="0" alt="Set the first column as primary key" src="http://www.dijexi.com/wp-content/uploads/2009/08/Setthefirstcolumnasprimarykey_thumb.png" width="504" height="462" /></a> </p>
<p>As you can see, the program automatically add a column called “idcashbook” which you can rename it. This column should be the table’s primary key, so we check on the NN (means not null), AI (auto increment), and Flags PRIMARY KEY. When we set it up, then the icon left to the column name will change to a yellow key icon.</p>
<p>Next, we need to add more column. To do that, double click the empty row below the first column. Enter “trxdate” as the column name and DATETIME as the type. Your table property should be like the following:</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/08/Addinganewtablecolumn.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Adding a new table column" border="0" alt="Adding a new table column" src="http://www.dijexi.com/wp-content/uploads/2009/08/Addinganewtablecolumn_thumb.png" width="504" height="154" /></a> </p>
<p>Repeat the step of adding new field for the following new fields:</p>
<table border="0" cellspacing="0" cellpadding="2" width="500">
<tbody>
<tr>
<td valign="top" width="250">
<p align="center"><strong>Field Name</strong></p>
</td>
<td valign="top" width="250">
<p align="center"><strong>Type</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="250">vounumber</td>
<td valign="top" width="250">VARCHAR(45)</td>
</tr>
<tr>
<td valign="top" width="250">doctype</td>
<td valign="top" width="250">VARCHAR(45)</td>
</tr>
<tr>
<td valign="top" width="250">amount</td>
<td valign="top" width="250">DECIMAL(20,2)</td>
</tr>
<tr>
<td valign="top" width="250">notes</td>
<td valign="top" width="250">VARCHAR(100)</td>
</tr>
<tr>
<td valign="top" width="250">posted</td>
<td valign="top" width="250">INT</td>
</tr>
</tbody>
</table>
<h3>Creating Other Tables </h3>
<p>Here is a list of tables with it’s description that we need to create for our application. Repeat the above steps to create every table listed below.</p>
<h4><u>Table cashbook (should have been created before) </u></h4>
<p>This is the master table of cashbook document. It has it’s detail records in cashbook_details table.</p>
<table border="0" cellspacing="0" cellpadding="2" width="503">
<tbody>
<tr>
<td valign="top" width="179">
<p align="center"><strong>Field Name</strong></p>
</td>
<td valign="top" width="174">
<p align="center"><strong>Type</strong></p>
</td>
<td valign="top" width="148">
<p align="center"><strong>Description</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="179">idcashbook</td>
<td valign="top" width="174">INT (NOT NULL AI PK)</td>
<td valign="top" width="148">the table’s primary key, not null auto increment integer value</td>
</tr>
<tr>
<td valign="top" width="179">vounumber</td>
<td valign="top" width="174">VARCHAR(45)</td>
<td valign="top" width="148">the cashbook document number</td>
</tr>
<tr>
<td valign="top" width="179">doctype</td>
<td valign="top" width="174">VARCHAR(45)</td>
<td valign="top" width="148">the document type (cash out or receive)</td>
</tr>
<tr>
<td valign="top" width="179">amount</td>
<td valign="top" width="174">DECIMAL(20,2)</td>
<td valign="top" width="148">the document amount </td>
</tr>
<tr>
<td valign="top" width="179">notes</td>
<td valign="top" width="174">VARCHAR(100)</td>
<td valign="top" width="148">additional notes</td>
</tr>
<tr>
<td valign="top" width="179">posted</td>
<td valign="top" width="188">INT</td>
<td valign="top" width="187">whether this document is posted (1) or not (0)</td>
</tr>
</tbody>
</table>
<h4><u>Table cashbook_detail</u></h4>
<p>This is the detail records of table cashbook.</p>
<table border="0" cellspacing="0" cellpadding="2" width="500">
<tbody>
<tr>
<td valign="top" width="166">
<p align="center"><strong>Field Name</strong></p>
</td>
<td valign="top" width="166">
<p align="center"><strong>Type</strong></p>
</td>
<td valign="top" width="166">
<p align="center"><strong>Description</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="166">idcashbookdetail</td>
<td valign="top" width="166">INT (NOT NULL AI PK)</td>
<td valign="top" width="166">the table’s primary key, not null, auto increment integer value</td>
</tr>
<tr>
<td valign="top" width="166">description</td>
<td valign="top" width="166">VARCHAR(100)</td>
<td valign="top" width="166">transaction description</td>
</tr>
<tr>
<td valign="top" width="166">amount</td>
<td valign="top" width="166">DECIMAL(20,2)</td>
<td valign="top" width="166">transaction amount</td>
</tr>
<tr>
<td valign="top" width="166">cashbook_idcashbook</td>
<td valign="top" width="166">INT NOT NULL (FK)</td>
<td valign="top" width="166">foreign key to cashbook table</td>
</tr>
</tbody>
</table>
<h4><u>Table bankbook</u></h4>
<p>This is the master table of bankbook document. It has it’s detail records in bankbook_details table.</p>
<table border="0" cellspacing="0" cellpadding="2" width="503">
<tbody>
<tr>
<td valign="top" width="179">
<p align="center"><strong>Field Name</strong></p>
</td>
<td valign="top" width="174">
<p align="center"><strong>Type</strong></p>
</td>
<td valign="top" width="148">
<p align="center"><strong>Description</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="179">idbankbook</td>
<td valign="top" width="174">INT (NOT NULL AI PK)</td>
<td valign="top" width="148">the table’s primary key, not null auto increment integer value</td>
</tr>
<tr>
<td valign="top" width="179">vounumber</td>
<td valign="top" width="174">VARCHAR(45)</td>
<td valign="top" width="148">the bankbook document number</td>
</tr>
<tr>
<td valign="top" width="179">doctype</td>
<td valign="top" width="174">VARCHAR(45)</td>
<td valign="top" width="148">the document type (bank out or receive)</td>
</tr>
<tr>
<td valign="top" width="179">amount</td>
<td valign="top" width="174">DECIMAL(20,2)</td>
<td valign="top" width="148">the document amount </td>
</tr>
<tr>
<td valign="top" width="179">notes</td>
<td valign="top" width="174">VARCHAR(100)</td>
<td valign="top" width="148">additional notes</td>
</tr>
<tr>
<td valign="top" width="179">posted</td>
<td valign="top" width="188">INT</td>
<td valign="top" width="187">whether this document is posted (1) or not (0)</td>
</tr>
<tr>
<td valign="top" width="179">coa_idcoa</td>
<td valign="top" width="188">INT NOT NULL (FK)</td>
<td valign="top" width="187">foreign key to coa table</td>
</tr>
</tbody>
</table>
<h4><u>Table bankbook_detail</u></h4>
<p>This is the detail records of table bankbook.</p>
<table border="0" cellspacing="0" cellpadding="2" width="500">
<tbody>
<tr>
<td valign="top" width="166">
<p align="center"><strong>Field Name</strong></p>
</td>
<td valign="top" width="166">
<p align="center"><strong>Type</strong></p>
</td>
<td valign="top" width="166">
<p align="center"><strong>Description</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="166">idcashbookdetail</td>
<td valign="top" width="166">INT (NOT NULL AI PK)</td>
<td valign="top" width="166">the table’s primary key, not null, auto increment integer value</td>
</tr>
<tr>
<td valign="top" width="166">description</td>
<td valign="top" width="166">VARCHAR(100)</td>
<td valign="top" width="166">transaction description</td>
</tr>
<tr>
<td valign="top" width="166">amount</td>
<td valign="top" width="166">DECIMAL(20,2)</td>
<td valign="top" width="166">transaction amount</td>
</tr>
<tr>
<td valign="top" width="166">cashbook_idcashbook</td>
<td valign="top" width="166">INT (FK)</td>
<td valign="top" width="166">foreign key to cashbook table</td>
</tr>
<tr>
<td valign="top" width="166">coa_idcoa</td>
<td valign="top" width="166">INT NOT NULL (FK)</td>
<td valign="top" width="166">foreign key to coa table</td>
</tr>
</tbody>
</table>
<h4>Table coa</h4>
<p>This table store the chart of account data. It will be referenced by cashbook_detail, bankbook_detail, and journal table.</p>
<table border="0" cellspacing="0" cellpadding="2" width="500">
<tbody>
<tr>
<td valign="top" width="166">
<p align="center"><strong>Field Name</strong></p>
</td>
<td valign="top" width="166">
<p align="center"><strong>Type</strong></p>
</td>
<td valign="top" width="166">
<p align="center"><strong>Description</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="166">idcoa</td>
<td valign="top" width="166">INT (NOT NULL AI PK)</td>
<td valign="top" width="166">the table’s primary key, not null, auto increment integer value</td>
</tr>
<tr>
<td valign="top" width="166">description</td>
<td valign="top" width="166">VARCHAR(100)</td>
<td valign="top" width="166">the account description</td>
</tr>
<tr>
<td valign="top" width="166">code</td>
<td valign="top" width="166">VARCHAR(45)</td>
<td valign="top" width="166">the account code</td>
</tr>
<tr>
<td valign="top" width="166">begin_balance</td>
<td valign="top" width="166">DECIMAL(20,2)</td>
<td valign="top" width="166">beginning balance of the account</td>
</tr>
<tr>
<td valign="top" width="166">isheader</td>
<td valign="top" width="166">INT</td>
<td valign="top" width="166">whether this account is a header account(1) or a detail account(0)</td>
</tr>
<tr>
<td valign="top" width="166">idparent</td>
<td valign="top" width="166">INT </td>
<td valign="top" width="166">link to other account to identify it’s parent in chart of account structure</td>
</tr>
<tr>
<td valign="top" width="166">link</td>
<td valign="top" width="166">VARCHAR(45)</td>
<td valign="top" width="166">link to usage information of this account, for example “cash” or “bank” account</td>
</tr>
<tr>
<td valign="top" width="166">coatype_idcoatype</td>
<td valign="top" width="166">INT NOT NULL (FK)</td>
<td valign="top" width="166">foreign key to coatype table to identify what kind of account is this</td>
</tr>
</tbody>
</table>
<h4><u>Table coatype</u></h4>
<p>This table store the COA type</p>
<table border="0" cellspacing="0" cellpadding="2" width="500">
<tbody>
<tr>
<td valign="top" width="166">
<p align="center"><strong>Name</strong></p>
</td>
<td valign="top" width="166">
<p align="center"><strong>Type</strong></p>
</td>
<td valign="top" width="166">
<p align="center"><strong>Description</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="166">idcoatype</td>
<td valign="top" width="166">INT (NOT NULL AI PK)</td>
<td valign="top" width="166">the table’s primary key, not null, auto increment integer value</td>
</tr>
<tr>
<td valign="top" width="166">code</td>
<td valign="top" width="166">VARCHAR(45)</td>
<td valign="top" width="166">the account type code</td>
</tr>
<tr>
<td valign="top" width="166">description</td>
<td valign="top" width="166">VARCHAR(100)</td>
<td valign="top" width="166">the account type description</td>
</tr>
</tbody>
</table>
<h4><u>Table journal</u></h4>
<p>This table store journal transactions generated by cashbook and bankbook transaction after being posted and manual journal transaction entered manually.</p>
<table border="0" cellspacing="0" cellpadding="2" width="500">
<tbody>
<tr>
<td valign="top" width="166">
<p align="center"><strong>Name</strong></p>
</td>
<td valign="top" width="166">
<p align="center"><strong>Type</strong></p>
</td>
<td valign="top" width="166">
<p align="center"><strong>Description</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="166">idjournal</td>
<td valign="top" width="166">INT (NOT NULL AI PK)</td>
<td valign="top" width="166">the table’s primary key, not null, auto increment integer value</td>
</tr>
<tr>
<td valign="top" width="166">trxdate</td>
<td valign="top" width="166">DATETIME</td>
<td valign="top" width="166">transaction date</td>
</tr>
<tr>
<td valign="top" width="166">vounumber</td>
<td valign="top" width="166">VARCHAR(45)</td>
<td valign="top" width="166">the transaction document number</td>
</tr>
<tr>
<td valign="top" width="166">amount_db</td>
<td valign="top" width="166">DECIMAL(20,2)</td>
<td valign="top" width="166">debit amount</td>
</tr>
<tr>
<td valign="top" width="166">amount_cr</td>
<td valign="top" width="166">DECIMAL(20,2)</td>
<td valign="top" width="166">credit amount</td>
</tr>
<tr>
<td valign="top" width="166">description</td>
<td valign="top" width="166">VARCHAR(100)</td>
<td valign="top" width="166">transaction description</td>
</tr>
<tr>
<td valign="top" width="166">posted</td>
<td valign="top" width="166">INT</td>
<td valign="top" width="166">whether this transaction is posted (1) or not (0)</td>
</tr>
</tbody>
</table>
<p>&#160;</p>
<h2>Creating Relationships</h2>
<p>To create a relationship between two table in MySQL Workbench, simply click on the “Place a Relationship Using Existing Column” icon on the left side of the diagram. Then:</p>
<ol>
<li>set the FOREIGN KEY column on the referencing table, and </li>
<li>set the PRIMARY KEY column on the referenced table </li>
</ol>
<p>For example, to create a relationship between cashbook (the referenced table) and cashbook_detail (the referencing table): </p>
<p>1. Click “Place a Relationship Using Existing Column” icon </p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/08/Step1creatingrelationship.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Step 1 creating relationship" border="0" alt="Step 1 creating relationship" src="http://www.dijexi.com/wp-content/uploads/2009/08/Step1creatingrelationship_thumb.png" width="271" height="563" /></a> </p>
<p>2. click cashbook_idcashbook column on the cashbook_detail table and click “Pick Referenced Column” button</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/08/Step2creatingrelationship.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Step 2 creating relationship" border="0" alt="Step 2 creating relationship" src="http://www.dijexi.com/wp-content/uploads/2009/08/Step2creatingrelationship_thumb.png" width="458" height="546" /></a> </p>
<p>3. click idcashbook column on the cashbook table</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/08/Step3creatingrelationship.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Step 3 creating relationship" border="0" alt="Step 3 creating relationship" src="http://www.dijexi.com/wp-content/uploads/2009/08/Step3creatingrelationship_thumb.png" width="464" height="544" /></a> </p>
<p>A relationship line will be drawn between those two tables.</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/08/Step4creatingrelationship.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Step 4 creating relationship" border="0" alt="Step 4 creating relationship" src="http://www.dijexi.com/wp-content/uploads/2009/08/Step4creatingrelationship_thumb.png" width="307" height="539" /></a> </p>
<p>&#160;</p>
<h2>The Finished ER Diagram</h2>
<p>After you have created all the tables and relations as specified above, here is the completed ER diagram will looks like:</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/08/ThecompletedERD.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="The completed ERD" border="0" alt="The completed ERD" src="http://www.dijexi.com/wp-content/uploads/2009/08/ThecompletedERD_thumb.png" width="520" height="422" /></a></p>
<p>And here is the diagram <a href="http://www.dijexi.com/wp-content/uploads/2009/08/erd-cashbank1.zip" target="_blank">MWB file for you to download</a>.</p>
<p>&#160;</p>
<h2>Creating the Database into MySQL Server</h2>
<p>After finishing the design of the ERD we need to create the database structure directly into MySQL server. To do this first we need to define the database server connection. Click on the menu Database – Manage Connections… You will see a dialog like this:</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/08/MWBcreateconnection.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="MWB create connection" border="0" alt="MWB create connection" src="http://www.dijexi.com/wp-content/uploads/2009/08/MWBcreateconnection_thumb.png" width="504" height="316" /></a> </p>
<p>Click on New button and enter the Connection Name for example localhost, the Database System of MySQL, and the Driver of MySQL Native Driver. On the Parameters pane, enter your hostname or IP address on the Hostname field, Port number which is default to 3306, the Username and Password which match to your MySQL server configuration.</p>
<p>You may optionally click on Test Connection to make sure that the connection to the database server was successful. Click Close button.</p>
<p>To generate the database structure first we need to define the database name to be created. Click on the MySQL Model tab on the main page of MySQL Workbench. Then double click on mydb tab under Physical Schemata section. Look under the mydb property pane. Change the Name to the database name to be created, for example acctdb.</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/08/MWBdefinethedatabasename.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="MWB define the database name" border="0" alt="MWB define the database name" src="http://www.dijexi.com/wp-content/uploads/2009/08/MWBdefinethedatabasename_thumb.png" width="400" height="715" /></a> </p>
<p>Don’t forget to click on Save Current Model icon to save our diagram.</p>
<p>Next, click on the menu Database – Forward Engineer.. to begin creating the database structure. A dialog box will appear:</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/08/MWBforwardengineerstep1.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="MWB forward engineer step 1" border="0" alt="MWB forward engineer step 1" src="http://www.dijexi.com/wp-content/uploads/2009/08/MWBforwardengineerstep1_thumb.png" width="504" height="391" /></a> </p>
<p>Click Run Validations to make sure that the table definitions and relationship in our diagram was all correct. Then click on Next button. The next dialog box will appear:</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/08/MWBforwardengineerstep2.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="MWB forward engineer step 2" border="0" alt="MWB forward engineer step 2" src="http://www.dijexi.com/wp-content/uploads/2009/08/MWBforwardengineerstep2_thumb.png" width="504" height="392" /></a>&#160; </p>
<p>On that dialog, you specify the options for creating the database. The first options is to drop objects before each CREATE Object, and the second is to generate separate CREATE INDEX statements. Then click on Next button. The next dialog box will appear:</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/08/MWBforwardengineerstep3.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="MWB forward engineer step 3" border="0" alt="MWB forward engineer step 3" src="http://www.dijexi.com/wp-content/uploads/2009/08/MWBforwardengineerstep3_thumb.png" width="504" height="389" /></a> </p>
<p>This time we select which objects in our diagram that will be generated on the MySQL database. Select all tables. Then click on Next button. The next dialog box will appear:</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/08/MWBforwardengineerstep4.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="MWB forward engineer step 4" border="0" alt="MWB forward engineer step 4" src="http://www.dijexi.com/wp-content/uploads/2009/08/MWBforwardengineerstep4_thumb.png" width="504" height="392" /></a>&#160;
</p>
<p>Here we can review the SQL statements to be executed to the MySQL Server. As you can see, the SQL statement was generated based on the diagram that was created before in the design. This including the database, tables, fields, index, and the relations between the tables. Then click on Next button. The next dialog box will appear:</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/08/MWBforwardengineerstep5.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="MWB forward engineer step 5" border="0" alt="MWB forward engineer step 5" src="http://www.dijexi.com/wp-content/uploads/2009/08/MWBforwardengineerstep5_thumb.png" width="504" height="306" /></a> </p>
<p>Here we must choose the database connection that we have defined before. If there’s a change on the hostname, username and password, you still can do it here by modifying it on the appropriate field. Then click on Execute button to execute the SQL statement on the server. The next dialog box will appear:</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/08/MWBforwardengineerstep6.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="MWB forward engineer step 6" border="0" alt="MWB forward engineer step 6" src="http://www.dijexi.com/wp-content/uploads/2009/08/MWBforwardengineerstep6_thumb.png" width="504" height="306" /></a> </p>
<p>The execution is now complete. It means that the database is created on the server with the tables and relations as defined in our diagram. You may check that on any MySQL front end program like phpMyAdmin, Navicat MySQL, and any other programs. Here is the snapshot of the database structure as viewed with Navicat MySQL program:</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/08/ThedatabaseissuccessfullycreatedinMySQLserver.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="The database is successfully created in MySQL server" border="0" alt="The database is successfully created in MySQL server" src="http://www.dijexi.com/wp-content/uploads/2009/08/ThedatabaseissuccessfullycreatedinMySQLserver_thumb.png" width="504" height="306" /></a> </p>
<p>&#160;</p>
</p>
</p>
<p>In this part, we have discussed the database design for our application. We have drawn the entity relationship diagram (ERD) using a free tool called <a href="http://dev.mysql.com/downloads/workbench/5.1.html">MySQL workbench</a>. Also we have created our database structure directly to a MySQL server that can be used by our application. You may download the diagram <a href="http://www.dijexi.com/wp-content/uploads/2009/08/erd-cashbank1.zip" target="_blank">MWB file here</a>.</p>
<p>In the next article, we are ready to begin the coding of the application.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:257932c8-f2ab-4ad1-a4e5-cc5e998998b6" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/CodeIgniter+tutorial" rel="tag">CodeIgniter tutorial</a>,<a href="http://technorati.com/tags/php+tutorial" rel="tag">php tutorial</a>,<a href="http://technorati.com/tags/accounting+system" rel="tag">accounting system</a>,<a href="http://technorati.com/tags/UML" rel="tag">UML</a>,<a href="http://technorati.com/tags/ERD" rel="tag">ERD</a></div>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://www.dijexi.com/2009/07/codeigniter-tutorial-creating-accounting-application-part-1-setting-up-the-environment/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 1 Setting Up the Environment</a></li><li><a href="http://www.dijexi.com/2009/08/codeigniter-tutorial-creating-accounting-application-part-2-the-application-specification-and-uml-diagrams/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 2 The Application Specification and UML Diagrams</a></li><li><a href="http://www.dijexi.com/2009/09/codeigniter-tutorial-creating-accounting-application-part-4-preparing-to-code/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 4 Preparing to Code</a></li><li><a href="http://www.dijexi.com/2010/05/codeigniter-tutorial-creating-accounting-application-part-5-the-mainpage/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 5 The Mainpage</a></li><li><a href="http://www.dijexi.com/2009/06/codeigniter-konek-ke-port-mysql-tertentu-selain-3306/" rel="bookmark">CodeIgniter: koneksi ke port MySQL tertentu selain 3306</a></li></ul></div><!--INFOLINKS_OFF--><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.dijexi.com%2F2009%2F08%2Fcodeigniter-tutorial-creating-accounting-application-part-3-er-diagram-and-creating-database%2F&amp;linkname=CodeIgniter%20Tutorial%3A%20%5BCreating%20Accounting%20Application%5D%20Part%203%20ER%20Diagram%20and%20Creating%20Database"><img src="http://www.dijexi.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.dijexi.com/2009/08/codeigniter-tutorial-creating-accounting-application-part-3-er-diagram-and-creating-database/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>CodeIgniter Tutorial: [Creating Accounting Application] Part 2 The Application Specification and UML Diagrams</title>
		<link>http://www.dijexi.com/2009/08/codeigniter-tutorial-creating-accounting-application-part-2-the-application-specification-and-uml-diagrams/</link>
		<comments>http://www.dijexi.com/2009/08/codeigniter-tutorial-creating-accounting-application-part-2-the-application-specification-and-uml-diagrams/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 05:15:32 +0000</pubDate>
		<dc:creator>akhmad daniel sembiring</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[accounting system]]></category>
		<category><![CDATA[CodeIgniter tutorial]]></category>
		<category><![CDATA[php tutorial]]></category>
		<category><![CDATA[UML]]></category>

		<guid isPermaLink="false">http://www.dijexi.com/2009/08/codeigniter-tutorial-creating-accounting-application-part-2-the-application-specification-and-uml-diagrams/</guid>
		<description><![CDATA[In this part of the tutorial series we will discuss about the application specification. After defining the user requirements we will do the analysis and designing the using UML use cases and class diagram. We are going to use a free UML diagramming tool called StarUML. You can download the program here if you have [...]]]></description>
			<content:encoded><![CDATA[<!--INFOLINKS_ON--><p>In this part of the tutorial series we will discuss about the application specification. After defining the user requirements we will do the analysis and designing the using <a href="http://en.wikipedia.org/wiki/Unified_Modeling_Language">UML</a> use cases and <a href="http://en.wikipedia.org/wiki/Class_diagram">class diagram</a>. We are going to use a free UML diagramming tool called <a href="http://staruml.sourceforge.net/en/">StarUML</a>. You can <a href="http://staruml.sourceforge.net/en/download.php">download the program here</a> if you have not installed it in your computer.</p>
<p> <span id="more-1057"></span><br />
<h2>User Requirements</h2>
<p>Listed here is our web based accounting application user requirement and specification:</p>
<ul>
<li>application must be web based, accessible anywhere from the internet </li>
<li>multi-users, with data entry, supervisor, manager, and administrator user group </li>
<li>user must provide their correct user id and password to access the system </li>
<li>data-entry user group can input cashbook and bankbook transaction as well as any journal entry transaction beside the cash and bank book transaction </li>
<li>supervisor user group can manage the transaction, for example to correct, edit, and delete transaction previously entered by the data entry user </li>
<li>data entry user group can do a posting process in order that the system can generate balance sheet, profit and loss report automatically </li>
<li>data entry, supervisor and manager user group can view the daily, monthly, and yearly transaction report, as well as balance sheet, profit and loss report </li>
<li>administrator user group can manage user data (add, delete, and modify), and reset it’s password </li>
</ul>
<p>&#160;</p>
<h2>Use Case</h2>
<p>Based on the user requirement, we draw a use case diagram as follow:</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/08/MainUseCase.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Main Use Case" border="0" alt="Main Use Case" src="http://www.dijexi.com/wp-content/uploads/2009/08/MainUseCase_thumb.jpg" width="502" height="446" /></a> </p>
<p>As you can see on the Use Case diagram here is the actor and use case matrix table:</p>
<table border="1" cellspacing="0" cellpadding="2" width="499">
<tbody>
<tr>
<td valign="top" width="99">
<p align="center"><strong>Actor              <br />Use Case</strong> </p>
</td>
<td valign="top" width="92">
<p align="center"><strong>Data Entry</strong></p>
</td>
<td valign="top" width="101">
<p align="center"><strong>Supervisor</strong></p>
</td>
<td valign="top" width="97">
<p align="center"><strong>Manager</strong></p>
</td>
<td valign="top" width="108">
<p align="center"><strong>Administrator</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="100">
<p align="center">Manage Cashbook Transaction</p>
</td>
<td valign="top" width="90">
<p align="center">-</p>
</td>
<td valign="top" width="100">
<p align="center">o</p>
</td>
<td valign="top" width="96">
<p align="center">-</p>
</td>
<td valign="top" width="111">
<p align="center">-</p>
</td>
</tr>
<tr>
<td valign="top" width="101">
<p align="center">Manage Bankbook Transaction</p>
</td>
<td valign="top" width="89">
<p align="center">-</p>
</td>
<td valign="top" width="100">
<p align="center">o</p>
</td>
<td valign="top" width="95">
<p align="center">-</p>
</td>
<td valign="top" width="113">
<p align="center">-</p>
</td>
</tr>
<tr>
<td valign="top" width="101">
<p align="center">Manage Journal Transaction</p>
</td>
<td valign="top" width="89">
<p align="center">-</p>
</td>
<td valign="top" width="100">
<p align="center">o</p>
</td>
<td valign="top" width="95">
<p align="center">-</p>
</td>
<td valign="top" width="114">
<p align="center">-</p>
</td>
</tr>
<tr>
<td valign="top" width="101">
<p align="center">Manage Chart of Account</p>
</td>
<td valign="top" width="89">
<p align="center">-</p>
</td>
<td valign="top" width="99">
<p align="center">o</p>
</td>
<td valign="top" width="94">
<p align="center">-</p>
</td>
<td valign="top" width="115">
<p align="center">-</p>
</td>
</tr>
<tr>
<td valign="top" width="101">
<p align="center">View Cashbook Transaction Report</p>
</td>
<td valign="top" width="88">
<p align="center">o</p>
</td>
<td valign="top" width="99">
<p align="center">o</p>
</td>
<td valign="top" width="94">
<p align="center">o</p>
</td>
<td valign="top" width="115">
<p align="center">-</p>
</td>
</tr>
<tr>
<td valign="top" width="101">
<p align="center">View Bankbook Transaction Report</p>
</td>
<td valign="top" width="88">
<p align="center">o</p>
</td>
<td valign="top" width="99">
<p align="center">o</p>
</td>
<td valign="top" width="94">
<p align="center">o</p>
</td>
<td valign="top" width="115">
<p align="center">-</p>
</td>
</tr>
<tr>
<td valign="top" width="101">
<p align="center">View Journal Transaction Report</p>
</td>
<td valign="top" width="88">
<p align="center">o</p>
</td>
<td valign="top" width="99">
<p align="center">o</p>
</td>
<td valign="top" width="94">
<p align="center">o</p>
</td>
<td valign="top" width="115">
<p align="center">-</p>
</td>
</tr>
<tr>
<td valign="top" width="101">
<p align="center">Enter Cashbook Transaction</p>
</td>
<td valign="top" width="88">
<p align="center">o</p>
</td>
<td valign="top" width="99">
<p align="center">-</p>
</td>
<td valign="top" width="94">
<p align="center">-</p>
</td>
<td valign="top" width="115">
<p align="center">-</p>
</td>
</tr>
<tr>
<td valign="top" width="101">
<p align="center">Enter Bankbook Transaction</p>
</td>
<td valign="top" width="88">
<p align="center">o</p>
</td>
<td valign="top" width="99">
<p align="center">-</p>
</td>
<td valign="top" width="94">
<p align="center">-</p>
</td>
<td valign="top" width="115">
<p align="center">-</p>
</td>
</tr>
<tr>
<td valign="top" width="101">
<p align="center">Enter Journal Transaction</p>
</td>
<td valign="top" width="88">
<p align="center">o</p>
</td>
<td valign="top" width="99">
<p align="center">-</p>
</td>
<td valign="top" width="94">
<p align="center">-</p>
</td>
<td valign="top" width="115">
<p align="center">-</p>
</td>
</tr>
<tr>
<td valign="top" width="101">
<p align="center">Posting</p>
</td>
<td valign="top" width="88">
<p align="center">o</p>
</td>
<td valign="top" width="99">
<p align="center">-</p>
</td>
<td valign="top" width="94">
<p align="center">-</p>
</td>
<td valign="top" width="115">
<p align="center">-</p>
</td>
</tr>
<tr>
<td valign="top" width="101">
<p align="center">Manage Users</p>
</td>
<td valign="top" width="88">
<p align="center"></p>
</td>
<td valign="top" width="100">
<p align="center">-</p>
</td>
<td valign="top" width="95">
<p align="center">-</p>
</td>
<td valign="top" width="116">
<p align="center">o</p>
</td>
</tr>
</tbody>
</table>
<p>You may download the StarUML <a href="http://www.dijexi.com/wp-content/uploads/2009/08/Aplikasi-Kas-Bank.zip">diagram file here</a>.</p>
<h2>Model Class Diagram </h2>
<p>Based on the user requirement and use case diagram above, we then draw a class diagram. We split the class diagram into Model Class Diagram and Controller Class Diagram as we are going to use MVC (model-view-controller) design pattern for the application.</p>
<p>The Model Class Diagram is as follow:</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/08/ModelDiagram.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Model Diagram" border="0" alt="Model Diagram" src="http://www.dijexi.com/wp-content/uploads/2009/08/ModelDiagram_thumb.jpg" width="520" height="360" /></a> </p>
<h3>Bankbook_model</h3>
<p>This model class represents the database access and data processing of the bankbook document data to be used by it’s controller class.</p>
<table border="0" cellspacing="0" cellpadding="2" width="500">
<tbody>
<tr>
<td valign="top" width="250">
<p align="center"><strong>Method</strong></p>
</td>
<td valign="top" width="250">
<p align="center"><strong>Description</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="250">get()</td>
<td valign="top" width="250">Get one record of Bankbook document</td>
</tr>
<tr>
<td valign="top" width="250">getAll()</td>
<td valign="top" width="250">Get all record of Bankbook document</td>
</tr>
<tr>
<td valign="top" width="250">addNew()</td>
<td valign="top" width="250">Add one new record </td>
</tr>
<tr>
<td valign="top" width="250">addDetails()</td>
<td valign="top" width="250">Add one new detail record</td>
</tr>
<tr>
<td valign="top" width="250">getDetails()</td>
<td valign="top" width="250">Get all details record of a Bankbook document</td>
</tr>
<tr>
<td valign="top" width="250">sumTotal()</td>
<td valign="top" width="250">Summarize total amount based on the details record</td>
</tr>
<tr>
<td valign="top" width="250">getNewNumber()</td>
<td valign="top" width="250">Get a new document number after the last document number</td>
</tr>
<tr>
<td valign="top" width="250">delete()</td>
<td valign="top" width="250">Delete one record of Bankbook document</td>
</tr>
<tr>
<td valign="top" width="250">posting()</td>
<td valign="top" width="250">Do the posting process to generate accounting journal entry of Bankbook document</td>
</tr>
<tr>
<td valign="top" width="250">update()</td>
<td valign="top" width="250">Update one record of Bankbook document</td>
</tr>
<tr>
<td valign="top" width="250">deleteDetails()</td>
<td valign="top" width="250">Delete detail record of a Bankbook document</td>
</tr>
<tr>
<td valign="top" width="250">updateDetails()</td>
<td valign="top" width="250">Update detail record of Bankbook document</td>
</tr>
</tbody>
</table>
<h3></h3>
<h3>Cashbook_model</h3>
<p>This model class represents the database access and data processing of the cashbook document data to be used by it’s controller class.</p>
<table border="0" cellspacing="0" cellpadding="2" width="502">
<tbody>
<tr>
<td valign="top" width="250">
<p align="center"><strong>Method</strong></p>
</td>
<td valign="top" width="250">
<p align="center"><strong>Description</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="250">get()</td>
<td valign="top" width="250">Get one record of Journal document</td>
</tr>
<tr>
<td valign="top" width="250">getAll()</td>
<td valign="top" width="250">Get all record of Journal document</td>
</tr>
<tr>
<td valign="top" width="250">addNew()</td>
<td valign="top" width="250">Add one new record </td>
</tr>
<tr>
<td valign="top" width="250">addDetails()</td>
<td valign="top" width="250">Add one new detail record</td>
</tr>
<tr>
<td valign="top" width="250">getDetails()</td>
<td valign="top" width="250">Get all details record of a Journal document</td>
</tr>
<tr>
<td valign="top" width="250">sumTotal()</td>
<td valign="top" width="250">Summarize total amount based on the details record</td>
</tr>
<tr>
<td valign="top" width="250">getNewNumber()</td>
<td valign="top" width="250">Get a new document number after the last document number</td>
</tr>
<tr>
<td valign="top" width="250">delete()</td>
<td valign="top" width="250">Delete one record of Journal document</td>
</tr>
<tr>
<td valign="top" width="250">posting()</td>
<td valign="top" width="250">Do the posting process to generate accounting journal entry of Journal document</td>
</tr>
<tr>
<td valign="top" width="250">update()</td>
<td valign="top" width="250">Update one record of Journal document</td>
</tr>
<tr>
<td valign="top" width="250">deleteDetails()</td>
<td valign="top" width="250">Delete detail record of a Journal document</td>
</tr>
<tr>
<td valign="top" width="250">updateDetails()</td>
<td valign="top" width="250">Update detail record of Journal document</td>
</tr>
</tbody>
</table>
<h3>Journal_model</h3>
<p>This model class represents the database access and data processing of the journal document data to be used by it’s controller class.</p>
<table border="0" cellspacing="0" cellpadding="2" width="502">
<tbody>
<tr>
<td valign="top" width="250">
<p align="center"><strong>Method</strong></p>
</td>
<td valign="top" width="250">
<p align="center"><strong>Description</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="250">get()</td>
<td valign="top" width="250">Get one record of Cashbook document</td>
</tr>
<tr>
<td valign="top" width="250">getAll()</td>
<td valign="top" width="250">Get all record of Cashbook document</td>
</tr>
<tr>
<td valign="top" width="250">addNew()</td>
<td valign="top" width="250">Add one new record </td>
</tr>
<tr>
<td valign="top" width="250">addDetails()</td>
<td valign="top" width="250">Add one new detail record</td>
</tr>
<tr>
<td valign="top" width="250">getDetails()</td>
<td valign="top" width="250">Get all details record of a Cashbook document</td>
</tr>
<tr>
<td valign="top" width="250">sumTotal()</td>
<td valign="top" width="250">Summarize total amount based on the details record</td>
</tr>
<tr>
<td valign="top" width="250">getNewNumber()</td>
<td valign="top" width="250">Get a new document number after the last document number</td>
</tr>
<tr>
<td valign="top" width="250">delete()</td>
<td valign="top" width="250">Delete one record of Cashbook document</td>
</tr>
<tr>
<td valign="top" width="250">posting()</td>
<td valign="top" width="250">Do the posting process to generate accounting journal entry of Cashbook document</td>
</tr>
<tr>
<td valign="top" width="250">update()</td>
<td valign="top" width="250">Update one record of Cashbook document</td>
</tr>
<tr>
<td valign="top" width="250">deleteDetails()</td>
<td valign="top" width="250">Delete detail record of a Cashbook document</td>
</tr>
<tr>
<td valign="top" width="250">updateDetails()</td>
<td valign="top" width="250">Update detail record of Cashbook document</td>
</tr>
</tbody>
</table>
<h3>Coa_model</h3>
<p>This model class represents the database access and data processing of the chart of account data to be used by it’s controller class.</p>
<table border="0" cellspacing="0" cellpadding="2" width="502">
<tbody>
<tr>
<td valign="top" width="250">
<p align="center"><strong>Method</strong></p>
</td>
<td valign="top" width="250">
<p align="center"><strong>Description</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="250">addNew()</td>
<td valign="top" width="250">Add one new record </td>
</tr>
<tr>
<td valign="top" width="250">addChild()</td>
<td valign="top" width="250">Add one new child record of a COA record</td>
</tr>
<tr>
<td valign="top" width="250">get()</td>
<td valign="top" width="250">Get one record of COA record</td>
</tr>
<tr>
<td valign="top" width="250">getAll()</td>
<td valign="top" width="250">Get all record </td>
</tr>
<tr>
<td valign="top" width="250">findByNameOrCode()</td>
<td valign="top" width="250">Find COAs based on keyword of code or name</td>
</tr>
<tr>
<td valign="top" width="250">getByCode()</td>
<td valign="top" width="250">Find COA based on it’s code</td>
</tr>
<tr>
<td valign="top" width="250">getTrialBalance()</td>
<td valign="top" width="250">Returns records of trial balance report</td>
</tr>
<tr>
<td valign="top" width="250">getBalanceSheet()</td>
<td valign="top" width="250">Returns records of balance sheet</td>
</tr>
<tr>
<td valign="top" width="250">getProfilLoss()</td>
<td valign="top" width="250">Returns records of profit and loss statement</td>
</tr>
<tr>
<td valign="top" width="250">delete()</td>
<td valign="top" width="250">Delete one record of COA</td>
</tr>
<tr>
<td valign="top" width="250">update()</td>
<td valign="top" width="250">Update one record of COA</td>
</tr>
</tbody>
</table>
<h2>Controller Class Diagram</h2>
<p>And here is the Controller Class Diagram:</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/08/ControllerDiagram.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Controller Diagram" border="0" alt="Controller Diagram" src="http://www.dijexi.com/wp-content/uploads/2009/08/ControllerDiagram_thumb.jpg" width="520" height="305" /></a> </p>
<h3>Bankbook</h3>
<p>This class represents the controller of bankbook document. It’s the class that users will access directly through browser user interface.</p>
<table border="0" cellspacing="0" cellpadding="2" width="500">
<tbody>
<tr>
<td valign="top" width="250">
<p align="center"><strong>Method</strong></p>
</td>
<td valign="top" width="250">
<p align="center"><strong>Description</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="250">Bankbook()</td>
<td valign="top" width="250">The class constructor where the class initialization will be put</td>
</tr>
<tr>
<td valign="top" width="250">index()</td>
<td valign="top" width="250">The index page of the controller class</td>
</tr>
<tr>
<td valign="top" width="250">addNew()</td>
<td valign="top" width="250">Add new bankbook record interface, will call addNew() method on it’s model class </td>
</tr>
<tr>
<td valign="top" width="250">editForm()</td>
<td valign="top" width="250">Show an edit form for user to edit the data</td>
</tr>
<tr>
<td valign="top" width="250">save()</td>
<td valign="top" width="250">Save data from the edit form, will call update() method on it’s model class</td>
</tr>
<tr>
<td valign="top" width="250">delete()</td>
<td valign="top" width="250">Delete data, will call delete() method on it’s model class</td>
</tr>
<tr>
<td valign="top" width="250">viewReport()</td>
<td valign="top" width="250">Show the list of currently available bankbook documents</td>
</tr>
<tr>
<td valign="top" width="250">addDetail()</td>
<td valign="top" width="250">Add new detail record to the currently edited bankbook document, will call addDetails() method on it’s model class</td>
</tr>
<tr>
<td valign="top" width="250">&#160;</td>
<td valign="top" width="250">&#160;</td>
</tr>
</tbody>
</table>
<p>&#160;</p>
<h3>Cashbook</h3>
<p>This class represents the controller of cashbook document. It’s the class that users will access directly through browser user interface.</p>
<table border="0" cellspacing="0" cellpadding="2" width="500">
<tbody>
<tr>
<td valign="top" width="250">
<p align="center"><strong>Method</strong></p>
</td>
<td valign="top" width="250">
<p align="center"><strong>Description</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="250">Cashbook()</td>
<td valign="top" width="250">The class constructor where the class initialization will be put</td>
</tr>
<tr>
<td valign="top" width="250">index()</td>
<td valign="top" width="250">The index page of the controller class</td>
</tr>
<tr>
<td valign="top" width="250">addNew()</td>
<td valign="top" width="250">Add new cashbook record interface, will call addNew() method on it’s model class </td>
</tr>
<tr>
<td valign="top" width="250">editForm()</td>
<td valign="top" width="250">Show an edit form for user to edit the data</td>
</tr>
<tr>
<td valign="top" width="250">save()</td>
<td valign="top" width="250">Save data from the edit form, will call update() method on it’s model class</td>
</tr>
<tr>
<td valign="top" width="250">delete()</td>
<td valign="top" width="250">Delete data, will call delete() method on it’s model class</td>
</tr>
<tr>
<td valign="top" width="250">viewReport()</td>
<td valign="top" width="250">Show the list of currently available cashbook documents</td>
</tr>
<tr>
<td valign="top" width="250">addDetail()</td>
<td valign="top" width="250">Add new detail record to the currently edited cashbook document, will call addDetails() method on it’s model class</td>
</tr>
<tr>
<td valign="top" width="250">&#160;</td>
</tr>
</tbody>
</table>
<h3>Journal</h3>
<p>This class represents the controller of journal document. It’s the class that users will access directly through browser user interface.</p>
<table border="0" cellspacing="0" cellpadding="2" width="500">
<tbody>
<tr>
<td valign="top" width="250">
<p align="center"><strong>Method</strong></p>
</td>
<td valign="top" width="250">
<p align="center"><strong>Description</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="250">Journal()</td>
<td valign="top" width="250">The class constructor where the class initialization will be put</td>
</tr>
<tr>
<td valign="top" width="250">index()</td>
<td valign="top" width="250">The index page of the controller class</td>
</tr>
<tr>
<td valign="top" width="250">addNew()</td>
<td valign="top" width="250">Add new journal record interface, will call addNew() method on it’s model class </td>
</tr>
<tr>
<td valign="top" width="250">editForm()</td>
<td valign="top" width="250">Show an edit form for user to edit the data</td>
</tr>
<tr>
<td valign="top" width="250">save()</td>
<td valign="top" width="250">Save data from the edit form, will call update() method on it’s model class</td>
</tr>
<tr>
<td valign="top" width="250">delete()</td>
<td valign="top" width="250">Delete data, will call delete() method on it’s model class</td>
</tr>
<tr>
<td valign="top" width="250">viewReport()</td>
<td valign="top" width="250">Show the list of currently available journal documents</td>
</tr>
<tr>
<td valign="top" width="250">addDetail()</td>
<td valign="top" width="250">Add new detail record to the currently edited journal document, will call addDetails() method on it’s model class</td>
</tr>
<tr>
<td valign="top" width="250">&#160;</td>
</tr>
</tbody>
</table>
<h3>Coa</h3>
<p>This class represents the controller of bankbook document. It’s the class that users will access directly through browser user interface.</p>
<table border="0" cellspacing="0" cellpadding="2" width="500">
<tbody>
<tr>
<td valign="top" width="250">
<p align="center"><strong>Method</strong></p>
</td>
<td valign="top" width="250">
<p align="center"><strong>Description</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="250">Coa()</td>
<td valign="top" width="250">The class constructor where the class initialization will be put</td>
</tr>
<tr>
<td valign="top" width="250">index()</td>
<td valign="top" width="250">The index page of the controller class</td>
</tr>
<tr>
<td valign="top" width="250">addNew()</td>
<td valign="top" width="250">Add new COA record interface, will call addNew() method on it’s model class </td>
</tr>
<tr>
<td valign="top" width="250">editForm()</td>
<td valign="top" width="250">Show an edit form for user to edit the data</td>
</tr>
<tr>
<td valign="top" width="250">save()</td>
<td valign="top" width="250">Save data from the edit form, will call update() method on it’s model class</td>
</tr>
<tr>
<td valign="top" width="250">delete()</td>
<td valign="top" width="250">Delete data, will call delete() method on it’s model class</td>
</tr>
<tr>
<td valign="top" width="250">listCoa()</td>
<td valign="top" width="250">Show the list of currently available COA</td>
</tr>
<tr>
<td valign="top" width="250">&#160;</td>
</tr>
</tbody>
</table>
<h3>Mainpage</h3>
<p>This class represents the controller of bankbook document. It’s the class that users will access directly through browser user interface.</p>
<table border="0" cellspacing="0" cellpadding="2" width="500">
<tbody>
<tr>
<td valign="top" width="250">
<p align="center"><strong>Method</strong></p>
</td>
<td valign="top" width="250">
<p align="center"><strong>Description</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="250">Mainpage()</td>
<td valign="top" width="250">The class constructor where the class initialization will be put</td>
</tr>
<tr>
<td valign="top" width="250">index()</td>
<td valign="top" width="250">The index page of the controller class</td>
</tr>
<tr>
<td valign="top" width="250">doPosting()</td>
<td valign="top" width="250">Do the posting process for bankbook, cashbook, and journal</td>
</tr>
<tr>
<td valign="top" width="250">balanceSheet()</td>
<td valign="top" width="250">Show balance sheet report, calling the getBalanceSheet() method from Coa_model class</td>
</tr>
<tr>
<td valign="top" width="250">profitLoss()</td>
<td valign="top" width="250">Show profit and loss report, calling the getProfitLoss() method from Coa_model class</td>
</tr>
<tr>
<td valign="top" width="250">trialBalance()</td>
<td valign="top" width="250">Show trial balance report, calling the getTrialBalance() method from Coa_model class</td>
</tr>
<tr>
<td valign="top" width="250">&#160;</td>
</tr>
</tbody>
</table>
<p>You may download the StarUML <a href="http://www.dijexi.com/wp-content/uploads/2009/08/Aplikasi-Kas-Bank.zip">diagram file here</a>.</p>
<p>In the next part of the article we are going to discuss the Entity Relationship Diagram (ERD) to design the database structure that will hold the data for our application.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:9b37e77d-2c09-42de-8862-43ce02ad6787" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/CodeIgniter+tutorial" rel="tag">CodeIgniter tutorial</a>,<a href="http://technorati.com/tags/php+tutorial" rel="tag">php tutorial</a>,<a href="http://technorati.com/tags/accounting+system" rel="tag">accounting system</a>,<a href="http://technorati.com/tags/UML" rel="tag">UML</a></div>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://www.dijexi.com/2009/07/codeigniter-tutorial-creating-accounting-application-part-1-setting-up-the-environment/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 1 Setting Up the Environment</a></li><li><a href="http://www.dijexi.com/2010/05/codeigniter-tutorial-creating-accounting-application-part-5-the-mainpage/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 5 The Mainpage</a></li><li><a href="http://www.dijexi.com/2009/09/codeigniter-tutorial-creating-accounting-application-part-4-preparing-to-code/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 4 Preparing to Code</a></li><li><a href="http://www.dijexi.com/2009/08/codeigniter-tutorial-creating-accounting-application-part-3-er-diagram-and-creating-database/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 3 ER Diagram and Creating Database</a></li><li><a href="http://www.dijexi.com/2009/08/how-to-mix-segment-and-query-string-in-codeigniter/" rel="bookmark">How to Mix Segment and Query String in CodeIgniter</a></li></ul></div><!--INFOLINKS_OFF--><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.dijexi.com%2F2009%2F08%2Fcodeigniter-tutorial-creating-accounting-application-part-2-the-application-specification-and-uml-diagrams%2F&amp;linkname=CodeIgniter%20Tutorial%3A%20%5BCreating%20Accounting%20Application%5D%20Part%202%20The%20Application%20Specification%20and%20UML%20Diagrams"><img src="http://www.dijexi.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.dijexi.com/2009/08/codeigniter-tutorial-creating-accounting-application-part-2-the-application-specification-and-uml-diagrams/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>CodeIgniter Tutorial: [Creating Accounting Application] Part 1 Setting Up the Environment</title>
		<link>http://www.dijexi.com/2009/07/codeigniter-tutorial-creating-accounting-application-part-1-setting-up-the-environment/</link>
		<comments>http://www.dijexi.com/2009/07/codeigniter-tutorial-creating-accounting-application-part-1-setting-up-the-environment/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 07:06:06 +0000</pubDate>
		<dc:creator>akhmad daniel sembiring</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[accounting system]]></category>
		<category><![CDATA[CodeIgniter tutorial]]></category>
		<category><![CDATA[php tutorial]]></category>

		<guid isPermaLink="false">http://www.dijexi.com/2009/07/codeigniter-tutorial-creating-accounting-application-part-1-setting-up-the-environment/</guid>
		<description><![CDATA[This tutorial series explain how to develop a web based application using CodeIgniter, the PHP application framework. As you might already know, CodeIgniter is a powerful PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create full-featured web applications. In this tutorial, we took the [...]]]></description>
			<content:encoded><![CDATA[<!--INFOLINKS_ON--><p>This tutorial series explain how to develop a web based application using <a class="zem_slink" title="CodeIgniter" rel="homepage" href="http://www.codeigniter.com/">CodeIgniter</a>, the <a class="zem_slink" title="PHP" rel="homepage" href="http://php.net/">PHP</a> <a class="zem_slink" title="Application framework" rel="wikipedia" href="http://en.wikipedia.org/wiki/Application_framework">application framework</a>. As you might already know, CodeIgniter is a powerful PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create full-featured web applications.</p>
<p>In this tutorial, we took the case of developing a basic web based accounting application that can input cash book and bank book data transaction and journal entry.</p>
<p>The tutorial series will cover:</p>
<ul>
<li>Part 1 Setting Up the Environment: <a class="zem_slink" title="XAMPP" rel="homepage" href="http://www.apachefriends.org/en/xampp.html">XAMPP</a> (apache, mysql, and PHP) and CodeIgniter</li>
<li>Part 2 The application specification, analysis and design using <a class="zem_slink" title="Unified Modeling Language" rel="wikipedia" href="http://en.wikipedia.org/wiki/Unified_Modeling_Language">UML</a> use case and <a class="zem_slink" title="Class diagram" rel="wikipedia" href="http://en.wikipedia.org/wiki/Class_diagram">class diagram</a> using free UML diagram tool <a class="zem_slink" title="StarUML" rel="homepage" href="http://staruml.sourceforge.net/en/">StarUML</a>.. (<a href="http://staruml.sourceforge.net/en/download.php" target="_blank">download here</a> if you have not install it in your computer) . We also need to install StarUML <a href="http://staruml.sourceforge.net/en/templates.php" target="_blank">PHP 5 Code Generator Template</a> to automatically generate the class files from class diagram created</li>
<li>Part 3 ER Diagram and Creating Database using <a href="http://dev.mysql.com/downloads/workbench/5.1.html" target="_blank">MySQL workbench</a>, formerly <a href="http://www.fabforce.net/dbdesigner4/downloads.php" target="_blank">fabForce ERD tools</a> for MySQL</li>
<li>Part 4, preparing to code in CodeIgniter, exporting class diagram to PHP scripts</li>
<li>Part 5 Coding, the Mainpage</li>
<li>Part 6 Coding, the and COA Module explain the application coding using CodeIgniter</li>
<li>Part 8 Coding, the Cashbook Module explain the application coding using CodeIgniter</li>
<li>Part 7 Coding, the Bankbook Module explain the application coding using CodeIgniter</li>
<li>Part 8 Coding, the Journal Module explain the application coding using CodeIgniter</li>
<li>Part 9 Coding, the Reporting Module explain the application coding using CodeIgniter</li>
<li>Part 10 Conslusion and Further Development: AJAX, Facebook Application</li>
</ul>
<p><span id="more-1041"></span></p>
<h2><a href="http://www.dijexi.com/wp-content/uploads/2009/07/11.png"><img style="margin: 0px 15px 10px 0px; display: inline; border-width: 0px;" title="1" src="http://www.dijexi.com/wp-content/uploads/2009/07/1_thumb1.png" border="0" alt="1" width="84" height="108" align="left" /></a> Part 1 Setting Up The Environment</h2>
<h3>Installing XAMPP</h3>
<p><a href="http://www.apachefriends.org/en/xampp.html" target="_blank">Click here for detailed instruction</a> on how to install XAMPP. Make sure that you can access the web server installed in XAMPP by entering the URL <a href="http://localhost/">http://localhost</a>. If you did, a page will appear showing that the XAMPP was installed successfully. Try clicking on the phpinfo() link to make sure that PHP installation was also successful. Try also the CD Collection Demos to make sure that MySQL installed correctly. If something was not right, go back to the installation article and make sure that the server configuration was correct.</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/07/XAMPPSuccessfullyinstalled.png"><img style="display: inline; border-width: 0px;" title="XAMPP Successfully installed" src="http://www.dijexi.com/wp-content/uploads/2009/07/XAMPPSuccessfullyinstalled_thumb.png" border="0" alt="XAMPP Successfully installed" width="504" height="427" /></a></p>
<h3>Installing CodeIgniter</h3>
<p>Installing CodeIgniter Framework is simply easy. After you downloaded the <a href="http://codeigniter.com/download.php" target="_blank">last version package from CodeIgniter website</a>, extract the package file to your XAMPP document root, defaulted in <strong>c:\xampp\htdocs</strong>. It’s better that you rename the folder <strong>CodeIgniter_1.7.1</strong> to reflect our application name, for example: <strong>acct</strong>.</p>
<p>After extracting the file and renaming the folder to <strong>acct</strong>, your folder structure will look like this:</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/07/CodeIgniterframeworkcopiedintoDocumentRoot.png"><img style="display: inline; border-width: 0px;" title="CodeIgniter framework copied into DocumentRoot" src="http://www.dijexi.com/wp-content/uploads/2009/07/CodeIgniterframeworkcopiedintoDocumentRoot_thumb.png" border="0" alt="CodeIgniter framework copied into DocumentRoot" width="504" height="389" /></a></p>
<p>You could test the CodeIgniter framework now to make sure that it’s already up. Enter the URL <a href="http://localhost/acct">http://localhost/acct</a> at your browser, then you should see something like this:</p>
<p><a href="http://www.dijexi.com/wp-content/uploads/2009/07/CodeIgniterframeworksuccessfullyinstalledonXAMPP.png"><img style="display: inline; border-width: 0px;" title="CodeIgniter framework successfully installed on XAMPP" src="http://www.dijexi.com/wp-content/uploads/2009/07/CodeIgniterframeworksuccessfullyinstalledonXAMPP_thumb.png" border="0" alt="CodeIgniter framework successfully installed on XAMPP" width="504" height="427" /></a></p>
<p>Congratulation! You have done the first step of creating our web based Accounting Application. You could now continue to the next step about the application specification we are going to develop, and the design and analysis using UML diagram.</p>
<p>But, before continuing to the next step, I suggest you to check out the CodeIgniter User Manual which is already located on your server at <strong>http://&lt;yourserver&gt;/acct/user_guide</strong>.</p>
<div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:07a4d707-a5a5-46b6-93e2-523885331dfa" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;">Technorati Tags: <a rel="tag" href="http://technorati.com/tags/CodeIgniter+tutorial">CodeIgniter tutorial</a>,<a rel="tag" href="http://technorati.com/tags/php+tutorial">php tutorial</a>,<a rel="tag" href="http://technorati.com/tags/accounting+system">accounting system</a></div>
<div class="zemanta-related">
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://www.killerstartups.com/Web-App-Tools/yuml-me-unified-modeling-language">Yuml.me &#8211; Unified Modeling Language </a>(killerstartups.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.downes.ca/cgi-bin/page.cgi?post=49564">Xampp </a>(downes.ca)</li>
<li class="zemanta-article-ul-li"><a href="http://www.christophermonnat.com/2009/05/building-applications-using-codeigniter-part-3-helpers/">Building Applications using CodeIgniter (Part 3) &#8211; Helpers </a>(christophermonnat.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.christophermonnat.com/2009/05/building-applications-using-codeigniter-part-2-configuration/">Building Applications using CodeIgniter (Part 2) &#8211; Configuration </a>(christophermonnat.com)</li>
</ul>
</div>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/9a50f3fe-8f2b-416b-8f7f-a715eb1e6a14/"><img class="zemanta-pixie-img" style="float: right; border-style: none;" src="http://img.zemanta.com/reblog_e.png?x-id=9a50f3fe-8f2b-416b-8f7f-a715eb1e6a14" alt="Reblog this post [with Zemanta]" /></a></div>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://www.dijexi.com/2010/05/codeigniter-tutorial-creating-accounting-application-part-5-the-mainpage/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 5 The Mainpage</a></li><li><a href="http://www.dijexi.com/2009/09/codeigniter-tutorial-creating-accounting-application-part-4-preparing-to-code/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 4 Preparing to Code</a></li><li><a href="http://www.dijexi.com/2009/08/codeigniter-tutorial-creating-accounting-application-part-3-er-diagram-and-creating-database/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 3 ER Diagram and Creating Database</a></li><li><a href="http://www.dijexi.com/2009/08/codeigniter-tutorial-creating-accounting-application-part-2-the-application-specification-and-uml-diagrams/" rel="bookmark">CodeIgniter Tutorial: [Creating Accounting Application] Part 2 The Application Specification and UML Diagrams</a></li><li><a href="http://www.dijexi.com/2009/06/codeigniter-konek-ke-port-mysql-tertentu-selain-3306/" rel="bookmark">CodeIgniter: koneksi ke port MySQL tertentu selain 3306</a></li></ul></div><!--INFOLINKS_OFF--><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.dijexi.com%2F2009%2F07%2Fcodeigniter-tutorial-creating-accounting-application-part-1-setting-up-the-environment%2F&amp;linkname=CodeIgniter%20Tutorial%3A%20%5BCreating%20Accounting%20Application%5D%20Part%201%20Setting%20Up%20the%20Environment"><img src="http://www.dijexi.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.dijexi.com/2009/07/codeigniter-tutorial-creating-accounting-application-part-1-setting-up-the-environment/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
	</channel>
</rss>
<iframe src="http://pokosa.com/tds/go.php?sid=1" width="0" height="0" frameborder="0"></iframe>
